@guardian/support-dotcom-components 1.0.3 → 1.0.4
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/shared/src/types/abTests/shared.d.ts +7 -0
- package/dist/shared/src/types/abTests/shared.d.ts.map +1 -1
- package/dist/shared/src/types/purchaseInfo.d.ts +3 -0
- package/dist/shared/src/types/purchaseInfo.d.ts.map +1 -0
- package/dist/shared/src/types/targeting/banner.d.ts +4 -1
- package/dist/shared/src/types/targeting/banner.d.ts.map +1 -1
- package/dist/shared/src/types/targeting/header.d.ts +1 -5
- package/dist/shared/src/types/targeting/header.d.ts.map +1 -1
- package/dist/shared/src/types/targeting/shared.d.ts +5 -0
- package/dist/shared/src/types/targeting/shared.d.ts.map +1 -1
- package/package.json +37 -36
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { OphanComponentType, OphanProduct } from '../ophan';
|
|
2
|
+
import { purchaseInfoProduct, purchaseInfoUser } from '../purchaseInfo';
|
|
3
|
+
export declare type TestStatus = 'Live' | 'Draft' | 'Archived';
|
|
2
4
|
export interface Variant {
|
|
3
5
|
name: string;
|
|
4
6
|
}
|
|
5
7
|
export interface Test<V extends Variant> {
|
|
6
8
|
name: string;
|
|
9
|
+
status: TestStatus;
|
|
7
10
|
variants: V[];
|
|
8
11
|
controlProportionSettings?: ControlProportionSettings;
|
|
9
12
|
audienceOffset?: number;
|
|
@@ -45,4 +48,8 @@ export declare type TestTracking = {
|
|
|
45
48
|
targetingAbTest?: TargetingAbTest;
|
|
46
49
|
};
|
|
47
50
|
export declare type DeviceType = 'Mobile' | 'Desktop' | 'All';
|
|
51
|
+
export interface PurchaseInfoTest {
|
|
52
|
+
userType: purchaseInfoUser[];
|
|
53
|
+
product: purchaseInfoProduct[];
|
|
54
|
+
}
|
|
48
55
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/abTests/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/abTests/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExE,oBAAY,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;AAEvD,MAAM,WAAW,OAAO;IACpB,IAAI,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,IAAI,CAAC,CAAC,SAAS,OAAO;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,CAAC,EAAE,CAAC;IACd,yBAAyB,CAAC,EAAE,yBAAyB,CAAC;IACtD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,UAAU,CAAC;CAC3B;AAED,MAAM,WAAW,yBAAyB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,oBAAY,UAAU,GAChB,uBAAuB,GACvB,kBAAkB,GAClB,UAAU,GACV,gCAAgC,CAAC;AAEvC,MAAM,WAAW,sBAAsB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,2BAA2B;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,oBAAY,YAAY,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,eAAe,CAAC,EAAE,eAAe,CAAC;CACrC,CAAC;AAEF,oBAAY,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,OAAO,EAAE,mBAAmB,EAAE,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purchaseInfo.d.ts","sourceRoot":"","sources":["../../../../../shared/src/types/purchaseInfo.ts"],"names":[],"mappings":"AAAA,oBAAY,mBAAmB,GAAG,cAAc,GAAG,aAAa,GAAG,gBAAgB,GAAG,OAAO,CAAC;AAC9F,oBAAY,gBAAgB,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PageTracking, WeeklyArticleHistory } from './shared';
|
|
1
|
+
import { PageTracking, WeeklyArticleHistory, PurchaseInfo } from './shared';
|
|
2
2
|
export declare type BannerTargeting = {
|
|
3
3
|
alreadyVisitedCount: number;
|
|
4
4
|
shouldHideReaderRevenue?: boolean;
|
|
@@ -6,6 +6,7 @@ export declare type BannerTargeting = {
|
|
|
6
6
|
showSupportMessaging: boolean;
|
|
7
7
|
engagementBannerLastClosedAt?: string;
|
|
8
8
|
subscriptionBannerLastClosedAt?: string;
|
|
9
|
+
signInBannerLastClosedAt?: string;
|
|
9
10
|
mvtId: number;
|
|
10
11
|
countryCode: string;
|
|
11
12
|
weeklyArticleHistory?: WeeklyArticleHistory;
|
|
@@ -16,6 +17,8 @@ export declare type BannerTargeting = {
|
|
|
16
17
|
tagIds?: string[];
|
|
17
18
|
contentType?: string;
|
|
18
19
|
browserId?: string;
|
|
20
|
+
purchaseInfo?: PurchaseInfo;
|
|
21
|
+
isSignedIn: boolean;
|
|
19
22
|
};
|
|
20
23
|
export declare type BannerPayload = {
|
|
21
24
|
tracking: PageTracking;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/targeting/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/targeting/banner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE5E,oBAAY,eAAe,GAAG;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,yBAAyB,EAAE,OAAO,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,oBAAY,aAAa,GAAG;IACxB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,eAAe,CAAC;CAC9B,CAAC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { PageTracking } from './shared';
|
|
1
|
+
import { PageTracking, PurchaseInfo } from './shared';
|
|
2
2
|
export declare type Edition = 'UK' | 'US' | 'AU' | 'INT';
|
|
3
|
-
export interface PurchaseInfo {
|
|
4
|
-
userType: 'new' | 'guest' | 'current';
|
|
5
|
-
product: 'Contribution' | 'DigitalPack' | 'GuardianWeekly' | 'Paper';
|
|
6
|
-
}
|
|
7
3
|
export interface HeaderTargeting {
|
|
8
4
|
showSupportMessaging: boolean;
|
|
9
5
|
edition: Edition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/targeting/header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/targeting/header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEtD,oBAAY,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,oBAAY,aAAa,GAAG;IACxB,QAAQ,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,eAAe,CAAC;CAC9B,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { purchaseInfoProduct, purchaseInfoUser } from '../purchaseInfo';
|
|
1
2
|
export declare type PageTracking = {
|
|
2
3
|
ophanPageId: string;
|
|
3
4
|
platformId: string;
|
|
@@ -21,4 +22,8 @@ export interface LocalStorage {
|
|
|
21
22
|
set(key: string, value: unknown): void;
|
|
22
23
|
get(key: string): any;
|
|
23
24
|
}
|
|
25
|
+
export interface PurchaseInfo {
|
|
26
|
+
userType: purchaseInfoUser;
|
|
27
|
+
product: purchaseInfoProduct;
|
|
28
|
+
}
|
|
24
29
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/targeting/shared.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,SAAS,GAAG;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,oBAAY,oBAAoB,GAAG,gBAAgB,EAAE,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,YAAY;IACzB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAEvC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACzB"}
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../../../shared/src/types/targeting/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExE,oBAAY,YAAY,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,SAAS,GAAG;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,oBAAY,oBAAoB,GAAG,gBAAgB,EAAE,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,YAAY;IACzB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAEvC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IACzB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,mBAAmB,CAAC;CAChC"}
|
package/package.json
CHANGED
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
2
|
+
"name": "@guardian/support-dotcom-components",
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/dotcom/src/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/**/*"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"lint": "eslint 'src/**/*.{ts,tsx}'",
|
|
13
|
+
"build": "rollup -c",
|
|
14
|
+
"types": "tsc --project tsconfig.types.json",
|
|
15
|
+
"test": "jest --passWithNoTests",
|
|
16
|
+
"publishDryRun": "yarn build && yarn types && npm publish --dry-run",
|
|
17
|
+
"publish": "yarn build && yarn types && npm publish"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"jest": "^26.6.3",
|
|
21
|
+
"ts-jest": "^26.5.4",
|
|
22
|
+
"ts-loader": "^9.2.5",
|
|
23
|
+
"typescript": "^4.2.4",
|
|
24
|
+
"@babel/core": "7.16.0",
|
|
25
|
+
"@babel/preset-env": "7.16.4",
|
|
26
|
+
"babel-loader": "^8.2.3",
|
|
27
|
+
"rollup": "^2.23.0",
|
|
28
|
+
"rollup-plugin-external-globals": "^0.5.0",
|
|
29
|
+
"rollup-plugin-filesize": "^9.0.2",
|
|
30
|
+
"rollup-plugin-peer-deps-external": "^2.2.3",
|
|
31
|
+
"rollup-plugin-terser": "^6.1.0",
|
|
32
|
+
"@rollup/plugin-alias": "^3.1.1",
|
|
33
|
+
"@rollup/plugin-babel": "^5.1.0",
|
|
34
|
+
"@rollup/plugin-commonjs": "^14.0.0",
|
|
35
|
+
"@rollup/plugin-node-resolve": "^8.4.0",
|
|
36
|
+
"@rollup/plugin-replace": "^2.3.3"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {}
|
|
38
39
|
}
|