@temple-wallet/extension-ads 6.3.1 → 7.0.0
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/index.d.ts +29 -30
- package/dist/index.js +11 -10
- package/package.json +3 -1
- package/src/ads-actions/helpers.ts +18 -5
- package/src/ads-actions/index.ts +33 -11
- package/src/ads-actions/process-permanent-rule.ts +35 -15
- package/src/ads-actions/process-providers-ads.ts +21 -7
- package/src/ads-actions/process-rule.ts +6 -1
- package/src/ads-configuration.ts +15 -24
- package/src/constants.ts +1 -1
- package/src/execute-ads-actions/ads-views/make-hypelab-ad.ts +16 -41
- package/src/execute-ads-actions/ads-views/make-persona-ad.ts +3 -3
- package/src/execute-ads-actions/index.ts +1 -1
- package/src/execute-ads-actions/process-insert-ad-action.ts +6 -12
- package/src/index.ts +0 -2
- package/src/render-ads-stack.ts +13 -10
- package/src/temple-wallet-api.ts +15 -3
- package/src/transform-raw-rules.ts +28 -13
- package/src/types/ads-actions.ts +1 -1
- package/src/types/ads-meta.ts +8 -24
- package/src/types/ads-rules.ts +3 -1
- package/src/types/temple-wallet-api.ts +5 -0
- package/dist/ads-actions/helpers.d.ts +0 -13
- package/dist/ads-actions/helpers.js +0 -83
- package/dist/ads-actions/helpers.js.map +0 -1
- package/dist/ads-actions/index.d.ts +0 -3
- package/dist/ads-actions/index.js +0 -45
- package/dist/ads-actions/index.js.map +0 -1
- package/dist/ads-actions/process-permanent-rule.d.ts +0 -3
- package/dist/ads-actions/process-permanent-rule.js +0 -132
- package/dist/ads-actions/process-permanent-rule.js.map +0 -1
- package/dist/ads-actions/process-providers-ads.d.ts +0 -3
- package/dist/ads-actions/process-providers-ads.js +0 -113
- package/dist/ads-actions/process-providers-ads.js.map +0 -1
- package/dist/ads-actions/process-rule.d.ts +0 -3
- package/dist/ads-actions/process-rule.js +0 -97
- package/dist/ads-actions/process-rule.js.map +0 -1
- package/dist/ads-configuration.d.ts +0 -33
- package/dist/ads-configuration.js +0 -29
- package/dist/ads-configuration.js.map +0 -1
- package/dist/ads-meta.d.ts +0 -17
- package/dist/ads-meta.js +0 -135
- package/dist/ads-meta.js.map +0 -1
- package/dist/constants.d.ts +0 -8
- package/dist/constants.js +0 -9
- package/dist/constants.js.map +0 -1
- package/dist/execute-ads-actions/ads-views/index.d.ts +0 -3
- package/dist/execute-ads-actions/ads-views/index.js +0 -4
- package/dist/execute-ads-actions/ads-views/index.js.map +0 -1
- package/dist/execute-ads-actions/ads-views/make-hypelab-ad.d.ts +0 -3
- package/dist/execute-ads-actions/ads-views/make-hypelab-ad.js +0 -60
- package/dist/execute-ads-actions/ads-views/make-hypelab-ad.js.map +0 -1
- package/dist/execute-ads-actions/ads-views/make-persona-ad.d.ts +0 -3
- package/dist/execute-ads-actions/ads-views/make-persona-ad.js +0 -11
- package/dist/execute-ads-actions/ads-views/make-persona-ad.js.map +0 -1
- package/dist/execute-ads-actions/ads-views/make-tkey-ad.d.ts +0 -2
- package/dist/execute-ads-actions/ads-views/make-tkey-ad.js +0 -24
- package/dist/execute-ads-actions/ads-views/make-tkey-ad.js.map +0 -1
- package/dist/execute-ads-actions/index.d.ts +0 -2
- package/dist/execute-ads-actions/index.js +0 -23
- package/dist/execute-ads-actions/index.js.map +0 -1
- package/dist/execute-ads-actions/observing.d.ts +0 -1
- package/dist/execute-ads-actions/observing.js +0 -123
- package/dist/execute-ads-actions/observing.js.map +0 -1
- package/dist/execute-ads-actions/override-element-styles.d.ts +0 -2
- package/dist/execute-ads-actions/override-element-styles.js +0 -6
- package/dist/execute-ads-actions/override-element-styles.js.map +0 -1
- package/dist/execute-ads-actions/process-insert-ad-action.d.ts +0 -2
- package/dist/execute-ads-actions/process-insert-ad-action.js +0 -120
- package/dist/execute-ads-actions/process-insert-ad-action.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/render-ads-stack.d.ts +0 -7
- package/dist/render-ads-stack.js +0 -101
- package/dist/render-ads-stack.js.map +0 -1
- package/dist/temple-wallet-api.d.ts +0 -17
- package/dist/temple-wallet-api.js +0 -56
- package/dist/temple-wallet-api.js.map +0 -1
- package/dist/transform-raw-rules.d.ts +0 -3
- package/dist/transform-raw-rules.js +0 -117
- package/dist/transform-raw-rules.js.map +0 -1
- package/dist/types/ad-view.d.ts +0 -3
- package/dist/types/ad-view.js +0 -2
- package/dist/types/ad-view.js.map +0 -1
- package/dist/types/ads-actions.d.ts +0 -54
- package/dist/types/ads-actions.js +0 -15
- package/dist/types/ads-actions.js.map +0 -1
- package/dist/types/ads-meta.d.ts +0 -46
- package/dist/types/ads-meta.js +0 -2
- package/dist/types/ads-meta.js.map +0 -1
- package/dist/types/ads-provider.d.ts +0 -7
- package/dist/types/ads-provider.js +0 -8
- package/dist/types/ads-provider.js.map +0 -1
- package/dist/types/ads-rules.d.ts +0 -17
- package/dist/types/ads-rules.js +0 -2
- package/dist/types/ads-rules.js.map +0 -1
- package/dist/types/temple-wallet-api.d.ts +0 -61
- package/dist/types/temple-wallet-api.js +0 -2
- package/dist/types/temple-wallet-api.js.map +0 -1
- package/dist/utils.d.ts +0 -6
- package/dist/utils.js +0 -4
- package/dist/utils.js.map +0 -1
- package/src/ads-meta.ts +0 -137
package/src/ads-configuration.ts
CHANGED
|
@@ -1,66 +1,57 @@
|
|
|
1
|
-
import { AdMetadata
|
|
1
|
+
import { AdMetadata } from './types/ads-meta';
|
|
2
2
|
|
|
3
3
|
interface IAdsConfiguration {
|
|
4
|
-
hypelab: {
|
|
5
|
-
regular: string;
|
|
6
|
-
small: string;
|
|
7
|
-
wide: string;
|
|
8
|
-
native: string;
|
|
9
|
-
};
|
|
10
4
|
hypelabAdsWindowUrl: string;
|
|
11
5
|
tkeyInpageAdUrl: string;
|
|
12
6
|
swapTkeyUrl: string;
|
|
13
7
|
externalAdsActivityMessageType: string;
|
|
14
|
-
getPersonaIframeURL: (id: string,
|
|
8
|
+
getPersonaIframeURL: (id: string, slug: string) => string;
|
|
15
9
|
getAdsStackIframeURL: (id: string, adsMetadataIds: (number | AdMetadata)[], origin: string) => string;
|
|
10
|
+
buildNativeAdsMeta: (containerWidth: number, containerHeight: number) => AdMetadata[];
|
|
11
|
+
bannerAdsMeta: AdMetadata[];
|
|
16
12
|
extVersion: string;
|
|
17
13
|
templePassphrase: string;
|
|
14
|
+
isMisesBrowser: boolean;
|
|
18
15
|
}
|
|
19
16
|
|
|
20
17
|
export class AdsConfiguration {
|
|
21
|
-
static
|
|
22
|
-
static HYPELAB_SMALL_PLACEMENT_SLUG = '';
|
|
23
|
-
static HYPELAB_HIGH_PLACEMENT_SLUG = '';
|
|
24
|
-
static HYPELAB_WIDE_PLACEMENT_SLUG = '';
|
|
18
|
+
static IS_MISES_BROWSER = false;
|
|
25
19
|
static HYPELAB_ADS_WINDOW_URL = '';
|
|
26
20
|
static TKEY_INPAGE_AD_URL = '';
|
|
27
21
|
static SWAP_TKEY_URL = '';
|
|
28
22
|
static EXTERNAL_ADS_ACTIVITY_MESSAGE_TYPE = '';
|
|
29
23
|
static getPersonaIframeURL: IAdsConfiguration['getPersonaIframeURL'] = () => '';
|
|
30
24
|
static getAdsStackIframeURL: IAdsConfiguration['getAdsStackIframeURL'] = () => '';
|
|
25
|
+
static buildNativeAdsMeta: IAdsConfiguration['buildNativeAdsMeta'] = () => [];
|
|
26
|
+
static bannerAdsMeta: AdMetadata[] = [];
|
|
31
27
|
static EXTENSION_VERSION: string | undefined;
|
|
32
28
|
static TEMPLE_PASSPHRASE: string;
|
|
33
29
|
}
|
|
34
30
|
|
|
35
31
|
export const configureAds = (config: IAdsConfiguration) => {
|
|
36
32
|
const {
|
|
37
|
-
hypelab,
|
|
38
33
|
hypelabAdsWindowUrl,
|
|
39
34
|
tkeyInpageAdUrl,
|
|
40
35
|
swapTkeyUrl,
|
|
41
36
|
externalAdsActivityMessageType,
|
|
42
37
|
getPersonaIframeURL,
|
|
43
38
|
getAdsStackIframeURL,
|
|
39
|
+
buildNativeAdsMeta,
|
|
40
|
+
bannerAdsMeta,
|
|
44
41
|
extVersion,
|
|
45
|
-
templePassphrase
|
|
42
|
+
templePassphrase,
|
|
43
|
+
isMisesBrowser
|
|
46
44
|
} = config;
|
|
47
|
-
const {
|
|
48
|
-
native: hypelabNativePlacementSlug,
|
|
49
|
-
small: hypelabSmallPlacementSlug,
|
|
50
|
-
regular: hypelabHighPlacementSlug,
|
|
51
|
-
wide: hypelabWidePlacementSlug
|
|
52
|
-
} = hypelab;
|
|
53
45
|
|
|
54
|
-
AdsConfiguration.HYPELAB_NATIVE_PLACEMENT_SLUG = hypelabNativePlacementSlug;
|
|
55
|
-
AdsConfiguration.HYPELAB_SMALL_PLACEMENT_SLUG = hypelabSmallPlacementSlug;
|
|
56
|
-
AdsConfiguration.HYPELAB_HIGH_PLACEMENT_SLUG = hypelabHighPlacementSlug;
|
|
57
|
-
AdsConfiguration.HYPELAB_WIDE_PLACEMENT_SLUG = hypelabWidePlacementSlug;
|
|
58
46
|
AdsConfiguration.HYPELAB_ADS_WINDOW_URL = hypelabAdsWindowUrl;
|
|
59
47
|
AdsConfiguration.TKEY_INPAGE_AD_URL = tkeyInpageAdUrl;
|
|
60
48
|
AdsConfiguration.SWAP_TKEY_URL = swapTkeyUrl;
|
|
61
49
|
AdsConfiguration.EXTERNAL_ADS_ACTIVITY_MESSAGE_TYPE = externalAdsActivityMessageType;
|
|
62
50
|
AdsConfiguration.getPersonaIframeURL = getPersonaIframeURL;
|
|
63
51
|
AdsConfiguration.getAdsStackIframeURL = getAdsStackIframeURL;
|
|
52
|
+
AdsConfiguration.buildNativeAdsMeta = buildNativeAdsMeta;
|
|
53
|
+
AdsConfiguration.bannerAdsMeta = bannerAdsMeta;
|
|
64
54
|
AdsConfiguration.EXTENSION_VERSION = extVersion;
|
|
65
55
|
AdsConfiguration.TEMPLE_PASSPHRASE = templePassphrase;
|
|
56
|
+
AdsConfiguration.IS_MISES_BROWSER = isMisesBrowser;
|
|
66
57
|
};
|
package/src/constants.ts
CHANGED
|
@@ -6,4 +6,4 @@ export const AD_RENDER_START_MESSAGE_TYPE = 'adRenderStart';
|
|
|
6
6
|
export const AD_RESIZE_MESSAGE_TYPE = 'resize';
|
|
7
7
|
export const AD_READY_MESSAGE_TYPE = 'ready';
|
|
8
8
|
export const AD_ERROR_MESSAGE_TYPE = 'error';
|
|
9
|
-
export const
|
|
9
|
+
export const IFRAME_ALLOWANCE = 'accelerometer; gyroscope';
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { AES } from 'crypto-js';
|
|
2
2
|
|
|
3
3
|
import { AdsConfiguration } from 'src/ads-configuration';
|
|
4
|
+
import { IFRAME_ALLOWANCE } from 'src/constants';
|
|
4
5
|
import { AdView } from 'src/types/ad-view';
|
|
5
|
-
import { AdDimensions,
|
|
6
|
-
|
|
7
|
-
export const makeHypelabAdView = (
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { AdDimensions, HypeLabAdSource } from 'src/types/ads-meta';
|
|
7
|
+
|
|
8
|
+
export const makeHypelabAdView = (
|
|
9
|
+
id: string,
|
|
10
|
+
source: HypeLabAdSource,
|
|
11
|
+
{ width, height }: AdDimensions,
|
|
12
|
+
origin: string
|
|
13
|
+
): AdView => {
|
|
10
14
|
const iframe = document.createElement('iframe');
|
|
15
|
+
iframe.id = id;
|
|
11
16
|
iframe.src = getHypelabIframeUrl(source, origin, width, height, iframe.id);
|
|
12
17
|
iframe.style.width = source.native ? '100%' : `${width}px`;
|
|
13
18
|
iframe.style.height = `${height}px`;
|
|
14
19
|
iframe.style.border = 'none';
|
|
20
|
+
iframe.allow = IFRAME_ALLOWANCE;
|
|
15
21
|
|
|
16
22
|
return { element: iframe };
|
|
17
23
|
};
|
|
@@ -23,46 +29,15 @@ export const makeHypelabAdView = (source: HypeLabAdSources, dimensions: AdDimens
|
|
|
23
29
|
* @param width Frame width
|
|
24
30
|
* @param height Frame height
|
|
25
31
|
*/
|
|
26
|
-
const getHypelabIframeUrl = (
|
|
27
|
-
source: HypeLabAdSources,
|
|
28
|
-
origin: string,
|
|
29
|
-
width?: number,
|
|
30
|
-
height?: number,
|
|
31
|
-
id?: string
|
|
32
|
-
) => {
|
|
33
|
-
let defaultWidth: number, defaultHeight: number, placementSlug: string;
|
|
34
|
-
|
|
35
|
-
if (source.native) {
|
|
36
|
-
placementSlug = AdsConfiguration.HYPELAB_NATIVE_PLACEMENT_SLUG;
|
|
37
|
-
defaultWidth = 360;
|
|
38
|
-
defaultHeight = 110;
|
|
39
|
-
} else
|
|
40
|
-
switch (source.size) {
|
|
41
|
-
case 'small':
|
|
42
|
-
defaultWidth = 320;
|
|
43
|
-
defaultHeight = 50;
|
|
44
|
-
placementSlug = AdsConfiguration.HYPELAB_SMALL_PLACEMENT_SLUG;
|
|
45
|
-
break;
|
|
46
|
-
case 'high':
|
|
47
|
-
defaultWidth = 300;
|
|
48
|
-
defaultHeight = 250;
|
|
49
|
-
placementSlug = AdsConfiguration.HYPELAB_HIGH_PLACEMENT_SLUG;
|
|
50
|
-
break;
|
|
51
|
-
case 'wide':
|
|
52
|
-
defaultWidth = 728;
|
|
53
|
-
defaultHeight = 90;
|
|
54
|
-
placementSlug = AdsConfiguration.HYPELAB_WIDE_PLACEMENT_SLUG;
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
|
-
|
|
32
|
+
const getHypelabIframeUrl = (source: HypeLabAdSource, origin: string, width: number, height: number, id: string) => {
|
|
58
33
|
const url = new URL(AdsConfiguration.HYPELAB_ADS_WINDOW_URL);
|
|
59
34
|
if (source.native) {
|
|
60
|
-
url.searchParams.set('vh', String(height
|
|
35
|
+
url.searchParams.set('vh', String(height));
|
|
61
36
|
} else {
|
|
62
|
-
url.searchParams.set('w', String(width
|
|
37
|
+
url.searchParams.set('w', String(width));
|
|
63
38
|
}
|
|
64
|
-
url.searchParams.set('h', String(height
|
|
65
|
-
url.searchParams.set('p',
|
|
39
|
+
url.searchParams.set('h', String(height));
|
|
40
|
+
url.searchParams.set('p', source.slug);
|
|
66
41
|
url.searchParams.set('o', encryptWithAES(origin));
|
|
67
42
|
if (id) {
|
|
68
43
|
url.searchParams.set('id', id);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AdsConfiguration } from 'src/ads-configuration';
|
|
2
2
|
import { AdView } from 'src/types/ad-view';
|
|
3
|
-
import { AdDimensions,
|
|
3
|
+
import { AdDimensions, PersonaAdSource } from 'src/types/ads-meta';
|
|
4
4
|
|
|
5
|
-
export const makePersonaAdView = (id: string,
|
|
5
|
+
export const makePersonaAdView = (id: string, source: PersonaAdSource, { width, height }: AdDimensions): AdView => {
|
|
6
6
|
const element = document.createElement('iframe');
|
|
7
|
-
element.src = AdsConfiguration.getPersonaIframeURL(id,
|
|
7
|
+
element.src = AdsConfiguration.getPersonaIframeURL(id, source.slug);
|
|
8
8
|
element.id = id;
|
|
9
9
|
|
|
10
10
|
element.style.width = `${width}px`;
|
|
@@ -8,7 +8,7 @@ export const executeAdsActions = (adsActions: AdAction[]) =>
|
|
|
8
8
|
if (action.type === AdActionType.RemoveElement) {
|
|
9
9
|
action.element.remove();
|
|
10
10
|
} else if (action.type === AdActionType.HideElement) {
|
|
11
|
-
action.element.style.setProperty('display', 'none');
|
|
11
|
+
action.element.style.setProperty('display', 'none', 'important');
|
|
12
12
|
} else {
|
|
13
13
|
await processInsertAdAction(action);
|
|
14
14
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { nanoid } from 'nanoid';
|
|
2
2
|
|
|
3
|
-
import { PX_VALUE_REGEX } from 'src/ads-actions/helpers';
|
|
3
|
+
import { PX_VALUE_REGEX, sumPxValues } from 'src/ads-actions/helpers';
|
|
4
4
|
import { AdsConfiguration } from 'src/ads-configuration';
|
|
5
|
-
import { BANNER_ADS_META } from 'src/ads-meta';
|
|
6
5
|
import {
|
|
6
|
+
IFRAME_ALLOWANCE,
|
|
7
7
|
SIBLING_REPLACEMENT_ATTRIBUTE_NAME,
|
|
8
8
|
TEMPLE_WALLET_AD_ATTRIBUTE_NAME,
|
|
9
9
|
TEMPLE_WALLET_NATIVE_AD_ATTRIBUTE_NAME
|
|
@@ -27,13 +27,6 @@ const adjustToAd = (wrapperElement: HTMLDivElement, adDimensions: AdDimensions)
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const sumPxValues = (values: string[]) =>
|
|
31
|
-
values.reduce((acc, value) => {
|
|
32
|
-
const parsedValue = parseInt(value, 10);
|
|
33
|
-
|
|
34
|
-
return isNaN(parsedValue) && PX_VALUE_REGEX.test(value) ? acc : acc + parsedValue;
|
|
35
|
-
}, 0);
|
|
36
|
-
|
|
37
30
|
const processInsertAdActionOnce = async (
|
|
38
31
|
action: InsertAdAction,
|
|
39
32
|
wrapperElement: HTMLDivElement,
|
|
@@ -48,11 +41,12 @@ const processInsertAdActionOnce = async (
|
|
|
48
41
|
|
|
49
42
|
const adId = nanoid();
|
|
50
43
|
const adElement = document.createElement('iframe');
|
|
51
|
-
adElement.src = AdsConfiguration.getAdsStackIframeURL(adId,
|
|
44
|
+
adElement.src = AdsConfiguration.getAdsStackIframeURL(adId, adsMetadata, window.location.href);
|
|
52
45
|
adElement.id = adId;
|
|
53
|
-
|
|
46
|
+
adElement.allow = IFRAME_ALLOWANCE;
|
|
47
|
+
const firstAdMetadataOrId = adsMetadata[0];
|
|
54
48
|
const { dimensions } =
|
|
55
|
-
typeof firstAdMetadataOrId === 'number' ?
|
|
49
|
+
typeof firstAdMetadataOrId === 'number' ? AdsConfiguration.bannerAdsMeta[firstAdMetadataOrId] : firstAdMetadataOrId;
|
|
56
50
|
adElement.style.width = wrapperType === 'tbody' ? '100%' : `${dimensions.width}px`;
|
|
57
51
|
adElement.style.height = `${dimensions.height}px`;
|
|
58
52
|
adElement.style.border = 'none';
|
package/src/index.ts
CHANGED
package/src/render-ads-stack.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AdsConfiguration } from './ads-configuration';
|
|
2
2
|
import {
|
|
3
3
|
AD_ERROR_MESSAGE_TYPE,
|
|
4
4
|
AD_READY_MESSAGE_TYPE,
|
|
5
5
|
AD_RENDER_START_MESSAGE_TYPE,
|
|
6
|
-
AD_RESIZE_MESSAGE_TYPE
|
|
7
|
-
AD_VARIANT_READY_TIMEOUT
|
|
6
|
+
AD_RESIZE_MESSAGE_TYPE
|
|
8
7
|
} from './constants';
|
|
9
8
|
import { makeHypelabAdView, makePersonaAdView, makeTKeyAdView } from './execute-ads-actions/ads-views';
|
|
10
9
|
import { AdView } from './types/ad-view';
|
|
@@ -29,7 +28,8 @@ export const renderAdsStack = async (
|
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
const [adMetadataOrId, ...rest] = adsMetadata;
|
|
32
|
-
const adMetadata =
|
|
31
|
+
const adMetadata =
|
|
32
|
+
typeof adMetadataOrId === 'number' ? AdsConfiguration.bannerAdsMeta[adMetadataOrId] : adMetadataOrId;
|
|
33
33
|
broadcastMessage({ id: adId, type: AD_RENDER_START_MESSAGE_TYPE, adMetadata });
|
|
34
34
|
|
|
35
35
|
const { source, dimensions } = adMetadata;
|
|
@@ -40,11 +40,11 @@ export const renderAdsStack = async (
|
|
|
40
40
|
adView = makeTKeyAdView(dimensions.width, dimensions.height);
|
|
41
41
|
break;
|
|
42
42
|
case 'HypeLab':
|
|
43
|
-
adView = makeHypelabAdView(source, dimensions, origin);
|
|
43
|
+
adView = makeHypelabAdView(adId, source, dimensions, origin);
|
|
44
44
|
if (source.native) withTempleLabel = false;
|
|
45
45
|
break;
|
|
46
46
|
default:
|
|
47
|
-
adView = makePersonaAdView(adId, source
|
|
47
|
+
adView = makePersonaAdView(adId, source, dimensions);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
const { element } = adView;
|
|
@@ -57,10 +57,13 @@ export const renderAdsStack = async (
|
|
|
57
57
|
|
|
58
58
|
if (element instanceof HTMLIFrameElement) {
|
|
59
59
|
return new Promise<void>((resolve, reject) => {
|
|
60
|
-
const responseTimeout = setTimeout(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
const responseTimeout = setTimeout(
|
|
61
|
+
() => {
|
|
62
|
+
window.removeEventListener('message', messageListener);
|
|
63
|
+
reject(new Error(`Timeout exceeded for ${adId}, ad source: ${JSON.stringify(source)}`));
|
|
64
|
+
},
|
|
65
|
+
(rest.length === 0 ? 20_000 : 10_000) * (AdsConfiguration.IS_MISES_BROWSER ? 2 : 1)
|
|
66
|
+
);
|
|
64
67
|
|
|
65
68
|
let wasReady = false;
|
|
66
69
|
const messageListener = (event: MessageEvent<any>) => {
|
package/src/temple-wallet-api.ts
CHANGED
|
@@ -29,7 +29,9 @@ export class TempleWalletApi {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
private getAdVersionRequestConfig() {
|
|
32
|
-
return {
|
|
32
|
+
return {
|
|
33
|
+
params: { extVersion: AdsConfiguration.EXTENSION_VERSION, isMisesBrowser: AdsConfiguration.IS_MISES_BROWSER }
|
|
34
|
+
};
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
getAdPlacesRulesForAllDomains = withFetchDataExtraction(() =>
|
|
@@ -48,6 +50,13 @@ export class TempleWalletApi {
|
|
|
48
50
|
this.api.get<RawAllAdsRules['providersSelectors']>('/slise-ad-rules/providers', this.getAdVersionRequestConfig())
|
|
49
51
|
);
|
|
50
52
|
|
|
53
|
+
getNegativeSelectorsForAllProviders = withFetchDataExtraction(() =>
|
|
54
|
+
this.api.get<RawAllAdsRules['providersNegativeSelectors']>(
|
|
55
|
+
'/slise-ad-rules/providers/negative-selectors',
|
|
56
|
+
this.getAdVersionRequestConfig()
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
|
|
51
60
|
getPermanentAdPlacesRulesForAllDomains = withFetchDataExtraction(() =>
|
|
52
61
|
this.api.get<Record<string, RawPermanentAdPlacesRule[]>>(
|
|
53
62
|
'/slise-ad-rules/ad-places/permanent',
|
|
@@ -74,7 +83,8 @@ export class TempleWalletApi {
|
|
|
74
83
|
providersToReplaceAtAllSites,
|
|
75
84
|
permanentAdPlacesRulesForAllDomains,
|
|
76
85
|
permanentNativeAdPlacesRulesForAllDomains,
|
|
77
|
-
adsReplaceUrlsBlacklist
|
|
86
|
+
adsReplaceUrlsBlacklist,
|
|
87
|
+
providersNegativeSelectors
|
|
78
88
|
] = await Promise.all([
|
|
79
89
|
this.getAdPlacesRulesForAllDomains(),
|
|
80
90
|
this.getProvidersRulesForAllDomains(),
|
|
@@ -82,7 +92,8 @@ export class TempleWalletApi {
|
|
|
82
92
|
this.getProvidersToReplaceAtAllSites(),
|
|
83
93
|
this.getPermanentAdPlacesRulesForAllDomains(),
|
|
84
94
|
this.getPermanentNativeAdPlacesRulesForAllDomains(),
|
|
85
|
-
this.getAdsReplaceUrlsBlacklist()
|
|
95
|
+
this.getAdsReplaceUrlsBlacklist(),
|
|
96
|
+
this.getNegativeSelectorsForAllProviders()
|
|
86
97
|
]);
|
|
87
98
|
|
|
88
99
|
return {
|
|
@@ -93,6 +104,7 @@ export class TempleWalletApi {
|
|
|
93
104
|
permanentAdPlacesRulesForAllDomains,
|
|
94
105
|
permanentNativeAdPlacesRulesForAllDomains,
|
|
95
106
|
adsReplaceUrlsBlacklist,
|
|
107
|
+
providersNegativeSelectors,
|
|
96
108
|
timestamp: Date.now()
|
|
97
109
|
};
|
|
98
110
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { isEqual } from 'lodash';
|
|
2
2
|
|
|
3
3
|
import { AdPlacesRule, AdsRules } from 'src/types/ads-rules';
|
|
4
|
-
import { RawAllAdsRules } from 'src/types/temple-wallet-api';
|
|
4
|
+
import { RawAllAdsRules, RawPermanentAdPlacesRule } from 'src/types/temple-wallet-api';
|
|
5
5
|
|
|
6
6
|
export const transformRawRules = (location: Location, rules: RawAllAdsRules): AdsRules => {
|
|
7
7
|
const {
|
|
8
8
|
adPlacesRulesForAllDomains,
|
|
9
9
|
providersRulesForAllDomains,
|
|
10
10
|
providersSelectors,
|
|
11
|
+
providersNegativeSelectors = {},
|
|
11
12
|
providersToReplaceAtAllSites,
|
|
12
13
|
permanentAdPlacesRulesForAllDomains,
|
|
13
14
|
permanentNativeAdPlacesRulesForAllDomains = {},
|
|
@@ -21,6 +22,7 @@ export const transformRawRules = (location: Location, rules: RawAllAdsRules): Ad
|
|
|
21
22
|
adPlacesRules: [],
|
|
22
23
|
permanentAdPlacesRules: [],
|
|
23
24
|
providersSelectors: [],
|
|
25
|
+
providersNegativeSelectors: [],
|
|
24
26
|
timestamp
|
|
25
27
|
};
|
|
26
28
|
}
|
|
@@ -48,6 +50,13 @@ export const transformRawRules = (location: Location, rules: RawAllAdsRules): Ad
|
|
|
48
50
|
providersSelectors,
|
|
49
51
|
providersToReplaceAtAllSites
|
|
50
52
|
),
|
|
53
|
+
providersNegativeSelectors: buildProvidersSelectors(
|
|
54
|
+
hostname,
|
|
55
|
+
hrefMatchPredicate,
|
|
56
|
+
providersRulesForAllDomains,
|
|
57
|
+
providersNegativeSelectors,
|
|
58
|
+
providersToReplaceAtAllSites
|
|
59
|
+
),
|
|
51
60
|
timestamp
|
|
52
61
|
};
|
|
53
62
|
};
|
|
@@ -86,6 +95,22 @@ const buildAdPlacesRules = (
|
|
|
86
95
|
return aggregatedRelatedAdPlacesRules;
|
|
87
96
|
};
|
|
88
97
|
|
|
98
|
+
const makePermanentAdRuleTransformationFn =
|
|
99
|
+
(isNative: boolean) =>
|
|
100
|
+
({
|
|
101
|
+
urlRegexes,
|
|
102
|
+
elementToMeasureSelector,
|
|
103
|
+
elementsToMeasureSelectors,
|
|
104
|
+
...restRuleProps
|
|
105
|
+
}: RawPermanentAdPlacesRule) => ({
|
|
106
|
+
...restRuleProps,
|
|
107
|
+
urlRegexes: urlRegexes.map(regex => new RegExp(regex)),
|
|
108
|
+
isNative,
|
|
109
|
+
elementsToMeasureSelectors:
|
|
110
|
+
elementsToMeasureSelectors ??
|
|
111
|
+
(elementToMeasureSelector ? { width: elementToMeasureSelector, height: elementToMeasureSelector } : undefined)
|
|
112
|
+
});
|
|
113
|
+
|
|
89
114
|
const buildPermanentAdPlacesRules = (
|
|
90
115
|
hostname: string,
|
|
91
116
|
hrefMatchPredicate: (regex: RegExp) => boolean,
|
|
@@ -96,18 +121,8 @@ const buildPermanentAdPlacesRules = (
|
|
|
96
121
|
const rawPermanentNativeAdPlacesRules = permanentNativeAdPlacesRulesForAllDomains[hostname] ?? [];
|
|
97
122
|
|
|
98
123
|
const permanentAdPlacesRules = rawPermanentAdPlacesRules
|
|
99
|
-
.map((
|
|
100
|
-
|
|
101
|
-
urlRegexes: urlRegexes.map(regex => new RegExp(regex)),
|
|
102
|
-
isNative: false
|
|
103
|
-
}))
|
|
104
|
-
.concat(
|
|
105
|
-
rawPermanentNativeAdPlacesRules.map(({ urlRegexes, ...restRuleProps }) => ({
|
|
106
|
-
...restRuleProps,
|
|
107
|
-
urlRegexes: urlRegexes.map(regex => new RegExp(regex)),
|
|
108
|
-
isNative: true
|
|
109
|
-
}))
|
|
110
|
-
);
|
|
124
|
+
.map(makePermanentAdRuleTransformationFn(false))
|
|
125
|
+
.concat(rawPermanentNativeAdPlacesRules.map(makePermanentAdRuleTransformationFn(true)));
|
|
111
126
|
|
|
112
127
|
return permanentAdPlacesRules.filter(({ urlRegexes }) => urlRegexes.some(hrefMatchPredicate));
|
|
113
128
|
};
|
package/src/types/ads-actions.ts
CHANGED
|
@@ -70,7 +70,7 @@ export type InsertAdActionWithoutMeta =
|
|
|
70
70
|
export type AdAction = InsertAdAction | RemoveElementAction | HideElementAction;
|
|
71
71
|
|
|
72
72
|
export type AddActionsIfAdResolutionAvailable = (
|
|
73
|
-
|
|
73
|
+
elementsToMeasure: Record<'width' | 'height', HTMLElement>,
|
|
74
74
|
adType: AdType,
|
|
75
75
|
adIsNative: boolean,
|
|
76
76
|
...actionsBases: (InsertAdActionWithoutMeta | HideElementAction | RemoveElementAction)[]
|
package/src/types/ads-meta.ts
CHANGED
|
@@ -2,39 +2,23 @@ interface AdSourceBase {
|
|
|
2
2
|
shouldNotUseStrictContainerLimits?: boolean;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
interface HypeLabBannerAdSource extends AdSourceBase {
|
|
6
|
-
providerName: 'HypeLab';
|
|
7
|
-
native: false;
|
|
8
|
-
size: 'small' | 'high' | 'wide';
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
interface HypeLabNativeAdSource extends AdSourceBase {
|
|
12
|
-
providerName: 'HypeLab';
|
|
13
|
-
native: true;
|
|
14
|
-
slug: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
5
|
/** Only covers TKEY ads for now */
|
|
18
6
|
interface TempleAdSource extends AdSourceBase {
|
|
19
7
|
providerName: 'Temple';
|
|
20
8
|
}
|
|
21
9
|
|
|
22
|
-
|
|
23
|
-
* `regular` - 321x101
|
|
24
|
-
* `medium` - 600x160
|
|
25
|
-
* `wide` - 970x90
|
|
26
|
-
* `squarish` - 300x250
|
|
27
|
-
*/
|
|
28
|
-
export type PersonaAdShape = 'regular' | 'medium' | 'wide' | 'squarish';
|
|
29
|
-
|
|
30
|
-
interface PersonaAdSource extends AdSourceBase {
|
|
10
|
+
export interface PersonaAdSource extends AdSourceBase {
|
|
31
11
|
providerName: 'Persona';
|
|
32
|
-
|
|
12
|
+
slug: string;
|
|
33
13
|
}
|
|
34
14
|
|
|
35
|
-
export
|
|
15
|
+
export interface HypeLabAdSource extends AdSourceBase {
|
|
16
|
+
providerName: 'HypeLab';
|
|
17
|
+
native: boolean;
|
|
18
|
+
slug: string;
|
|
19
|
+
}
|
|
36
20
|
|
|
37
|
-
type AdSource =
|
|
21
|
+
type AdSource = HypeLabAdSource | TempleAdSource | PersonaAdSource;
|
|
38
22
|
|
|
39
23
|
export interface AdDimensions {
|
|
40
24
|
width: number;
|
package/src/types/ads-rules.ts
CHANGED
|
@@ -4,7 +4,8 @@ export interface AdPlacesRule extends Omit<RawAdPlacesRule, 'urlRegexes'> {
|
|
|
4
4
|
urlRegexes: RegExp[];
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
export interface PermanentAdPlacesRule
|
|
7
|
+
export interface PermanentAdPlacesRule
|
|
8
|
+
extends Omit<RawPermanentAdPlacesRule, 'urlRegexes' | 'elementToMeasureSelector'> {
|
|
8
9
|
urlRegexes: RegExp[];
|
|
9
10
|
isNative: boolean;
|
|
10
11
|
}
|
|
@@ -13,5 +14,6 @@ export interface AdsRules {
|
|
|
13
14
|
adPlacesRules: Array<Omit<AdPlacesRule, 'urlRegexes'>>;
|
|
14
15
|
permanentAdPlacesRules: PermanentAdPlacesRule[];
|
|
15
16
|
providersSelectors: Array<{ selector: string; parentDepth: number }>;
|
|
17
|
+
providersNegativeSelectors: Array<{ selector: string; parentDepth: number }>;
|
|
16
18
|
timestamp: number;
|
|
17
19
|
}
|
|
@@ -17,6 +17,8 @@ export interface RawAdPlacesRule {
|
|
|
17
17
|
isNative?: boolean;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
export type ElementsToMeasure = Record<'width' | 'height', string>;
|
|
21
|
+
|
|
20
22
|
export interface RawPermanentAdPlacesRule {
|
|
21
23
|
urlRegexes: string[];
|
|
22
24
|
adSelector: {
|
|
@@ -42,8 +44,10 @@ export interface RawPermanentAdPlacesRule {
|
|
|
42
44
|
wrapperStyle?: Record<string, string>;
|
|
43
45
|
elementStyle?: Record<string, string>;
|
|
44
46
|
elementToMeasureSelector?: string;
|
|
47
|
+
elementsToMeasureSelectors?: ElementsToMeasure;
|
|
45
48
|
stylesOverrides?: AdStylesOverrides[];
|
|
46
49
|
shouldHideOriginal?: boolean;
|
|
50
|
+
displayWidth?: string;
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
export interface RawAdProvidersRule {
|
|
@@ -55,6 +59,7 @@ export interface RawAllAdsRules {
|
|
|
55
59
|
adPlacesRulesForAllDomains: Record<string, RawAdPlacesRule[]>;
|
|
56
60
|
providersRulesForAllDomains: Record<string, RawAdProvidersRule[]>;
|
|
57
61
|
providersSelectors: Record<string, (string | { selector: string; parentDepth: number })[]>;
|
|
62
|
+
providersNegativeSelectors: Record<string, (string | { selector: string; parentDepth: number })[]>;
|
|
58
63
|
providersToReplaceAtAllSites: string[];
|
|
59
64
|
permanentAdPlacesRulesForAllDomains: Record<string, RawPermanentAdPlacesRule[]>;
|
|
60
65
|
permanentNativeAdPlacesRulesForAllDomains: Record<string, RawPermanentAdPlacesRule[]>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AdType } from 'src/types/ads-actions';
|
|
2
|
-
import { AdMetadata } from 'src/types/ads-meta';
|
|
3
|
-
export declare const ourAdQuerySelector = "[twa]";
|
|
4
|
-
export declare const ourNativeAdQuerySelector = "[twa-native]";
|
|
5
|
-
export declare const elementIsOurAd: (element: Element) => boolean;
|
|
6
|
-
export declare const prevBannerSiblingIsReplacement: (banner: Element) => boolean;
|
|
7
|
-
export declare const getFinalSize: (element: Element) => {
|
|
8
|
-
width: number;
|
|
9
|
-
height: number;
|
|
10
|
-
};
|
|
11
|
-
export declare const applyQuerySelector: <E extends Element = Element>(querySelector: string, isMultiple: boolean, element?: Element | Document) => E[];
|
|
12
|
-
export declare const getParentOfDepth: (element: HTMLElement, depth: number) => HTMLElement | null;
|
|
13
|
-
export declare const pickAdsToDisplay: (containerWidth: number, containerHeight: number, adType: AdType, adIsNative: boolean) => (number | AdMetadata)[];
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { BANNER_ADS_META, buildHypeLabNativeMeta } from 'src/ads-meta';
|
|
2
|
-
import { SIBLING_REPLACEMENT_ATTRIBUTE_NAME, TEMPLE_WALLET_AD_ATTRIBUTE_NAME, TEMPLE_WALLET_NATIVE_AD_ATTRIBUTE_NAME } from 'src/constants';
|
|
3
|
-
import { AdType } from 'src/types/ads-actions';
|
|
4
|
-
export const ourAdQuerySelector = `[${TEMPLE_WALLET_AD_ATTRIBUTE_NAME}]`;
|
|
5
|
-
export const ourNativeAdQuerySelector = `[${TEMPLE_WALLET_NATIVE_AD_ATTRIBUTE_NAME}]`;
|
|
6
|
-
export const elementIsOurAd = (element) => Boolean(element.closest(ourAdQuerySelector));
|
|
7
|
-
export const prevBannerSiblingIsReplacement = (banner) => { var _a; return Boolean((_a = banner.previousElementSibling) === null || _a === void 0 ? void 0 : _a.getAttribute(SIBLING_REPLACEMENT_ATTRIBUTE_NAME)); };
|
|
8
|
-
export const getFinalSize = (element) => {
|
|
9
|
-
const elementStyle = getComputedStyle(element);
|
|
10
|
-
const { x, right, width: rectWidth, height: rectHeight } = element.getBoundingClientRect();
|
|
11
|
-
const size = { width: rectWidth, height: rectHeight };
|
|
12
|
-
const dimensions = ['width', 'height'];
|
|
13
|
-
for (const dimension of dimensions) {
|
|
14
|
-
const rawDimensionFromStyle = elementStyle[dimension];
|
|
15
|
-
const rawDimensionFromAttribute = element.getAttribute(dimension);
|
|
16
|
-
const rawDimension = rawDimensionFromAttribute || rawDimensionFromStyle;
|
|
17
|
-
if (/\d+px/.test(rawDimension)) {
|
|
18
|
-
size[dimension] = Number(rawDimension.replace('px', ''));
|
|
19
|
-
}
|
|
20
|
-
if (dimension === 'width' && x < 0) {
|
|
21
|
-
size.width += x;
|
|
22
|
-
}
|
|
23
|
-
else if (dimension === 'width' && right > window.innerWidth) {
|
|
24
|
-
size.width = window.innerWidth - x;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return size;
|
|
28
|
-
};
|
|
29
|
-
export const applyQuerySelector = (querySelector, isMultiple, element = document) => {
|
|
30
|
-
if (!querySelector) {
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
return isMultiple
|
|
34
|
-
? [...element.querySelectorAll(querySelector)]
|
|
35
|
-
: [element.querySelector(querySelector)].filter((el) => Boolean(el));
|
|
36
|
-
};
|
|
37
|
-
export const getParentOfDepth = (element, depth) => {
|
|
38
|
-
let parent = element;
|
|
39
|
-
for (let i = 0; i < depth; i++) {
|
|
40
|
-
const nextParent = parent.parentElement;
|
|
41
|
-
if (!nextParent) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
parent = nextParent;
|
|
45
|
-
}
|
|
46
|
-
return parent;
|
|
47
|
-
};
|
|
48
|
-
const smallestBannerAdsMetaIndex = BANNER_ADS_META.length - 2;
|
|
49
|
-
export const pickAdsToDisplay = (containerWidth, containerHeight, adType, adIsNative) => {
|
|
50
|
-
if (containerWidth < 2 && containerHeight < 2) {
|
|
51
|
-
return [];
|
|
52
|
-
}
|
|
53
|
-
if (adIsNative) {
|
|
54
|
-
return [buildHypeLabNativeMeta(containerWidth, containerHeight)];
|
|
55
|
-
}
|
|
56
|
-
return BANNER_ADS_META.reduce((acc, { dimensions }, i) => {
|
|
57
|
-
const { minContainerWidth, maxContainerWidth, minContainerHeight, maxContainerHeight, width } = dimensions;
|
|
58
|
-
let matches = false;
|
|
59
|
-
switch (adType) {
|
|
60
|
-
case AdType.Permanent:
|
|
61
|
-
matches =
|
|
62
|
-
i === smallestBannerAdsMetaIndex ||
|
|
63
|
-
(containerWidth >= width && (containerHeight >= minContainerHeight || containerHeight < 2));
|
|
64
|
-
break;
|
|
65
|
-
case AdType.SlotReplacement:
|
|
66
|
-
matches =
|
|
67
|
-
i === smallestBannerAdsMetaIndex ||
|
|
68
|
-
(containerWidth >= minContainerWidth && (containerHeight >= minContainerHeight || containerHeight < 2));
|
|
69
|
-
break;
|
|
70
|
-
default:
|
|
71
|
-
matches =
|
|
72
|
-
containerWidth >= minContainerWidth &&
|
|
73
|
-
containerHeight >= minContainerHeight &&
|
|
74
|
-
containerWidth <= maxContainerWidth &&
|
|
75
|
-
containerHeight <= maxContainerHeight;
|
|
76
|
-
}
|
|
77
|
-
if (matches) {
|
|
78
|
-
acc.push(i);
|
|
79
|
-
}
|
|
80
|
-
return acc;
|
|
81
|
-
}, []);
|
|
82
|
-
};
|
|
83
|
-
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/ads-actions/help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