@surfside/ads 3.8.0-cb0bf7b5.0 → 3.8.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/lib/cjs/BuildInfo.js +2 -2
- package/lib/cjs/BuildInfo.js.map +1 -1
- package/lib/cjs/ScriptStart.js +106 -0
- package/lib/cjs/ScriptStart.js.map +1 -0
- package/lib/cjs/components/Banner.js +5 -5
- package/lib/cjs/components/Banner.js.map +1 -1
- package/lib/cjs/components/Creative.js +23 -21
- package/lib/cjs/components/Creative.js.map +1 -1
- package/lib/cjs/components/Dynamic.js +11 -8
- package/lib/cjs/components/Dynamic.js.map +1 -1
- package/lib/cjs/components/Video.js +6 -6
- package/lib/cjs/components/Video.js.map +1 -1
- package/lib/cjs/index.app.script.js +6 -0
- package/lib/cjs/index.app.script.js.map +1 -0
- package/lib/cjs/index.script.js +2 -100
- package/lib/cjs/index.script.js.map +1 -1
- package/lib/esm/BuildInfo.js +2 -2
- package/lib/esm/BuildInfo.js.map +1 -1
- package/lib/esm/ScriptStart.js +102 -0
- package/lib/esm/ScriptStart.js.map +1 -0
- package/lib/esm/components/Banner.js +6 -6
- package/lib/esm/components/Banner.js.map +1 -1
- package/lib/esm/components/Creative.js +21 -20
- package/lib/esm/components/Creative.js.map +1 -1
- package/lib/esm/components/Dynamic.js +12 -9
- package/lib/esm/components/Dynamic.js.map +1 -1
- package/lib/esm/components/Video.js +7 -7
- package/lib/esm/components/Video.js.map +1 -1
- package/lib/esm/index.app.script.js +4 -0
- package/lib/esm/index.app.script.js.map +1 -0
- package/lib/esm/index.script.js +2 -100
- package/lib/esm/index.script.js.map +1 -1
- package/lib/types/ScriptStart.d.ts +4 -0
- package/lib/types/components/Banner.d.ts +2 -1
- package/lib/types/components/Creative.d.ts +8 -7
- package/lib/types/components/Video.d.ts +2 -1
- package/lib/types/index.app.script.d.ts +1 -0
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Video.js","sourceRoot":"../@surfside-ads/","sources":["components/Video.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Video.js","sourceRoot":"../@surfside-ads/","sources":["components/Video.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,iBAAiB,GAEpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,aAAa,EAEb,uBAAuB,EAE1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAStE,MAAM,OAAO,aAAc,SAAQ,uBAAuB;IAC9C,kBAAkB,GAAsB,IAAI,iBAAiB,EAAE,CAAC;IAE9D,WAAW,CAAiB;IAC5B,WAAW,CAAiB;IAE9B,OAAO,CAAwB;IAEhC,MAAM,KAAK,kBAAkB;QAChC,OAAO,CAAC,GAAG,uBAAuB,CAAC,wBAAwB,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;IACjG,CAAC;IAED,YACI,YAAiD;QAEjD,KAAK,CAAC,YAAY,CAAC,CAAC;IACxB,CAAC;IAEkB,gBAAgB;QAC/B,OAAO,eAAe,CAAC;IAC3B,CAAC;IAEkB,gBAAgB;QAC/B,OAAO,CACH,KAAK,CAAC,gBAAgB,EAAE,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS;eACzF,IAAI,CAAC,WAAW,KAAK,IAAI,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,CAC5D,CAAC;IACN,CAAC;IAEM,KAAK,CAAC,wBAAwB,CAEjC,IAAY,EACZ,QAAuB,EACvB,QAAuB;QAEvB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACvD,GAAG,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAE/B,IAAI,IAAI,KAAK,cAAc,EAAE,CAAC;YAC1B,IAAI,CAAC;gBACD,IAA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AAC,CAAC;YACjG,CAAC;QACL,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AppOnlyStartRequest, ReadHostAppBundle } from '@surfside/ads-core';
|
|
2
|
+
import { RunWhenDocumentReady, StartSurfAdsScript } from './ScriptStart';
|
|
3
|
+
RunWhenDocumentReady(() => StartSurfAdsScript({ startRequest: AppOnlyStartRequest(ReadHostAppBundle()) }));
|
|
4
|
+
//# sourceMappingURL=index.app.script.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.app.script.js","sourceRoot":"../@surfside-ads/","sources":["index.app.script.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEzE,oBAAoB,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,EAAE,YAAY,EAAE,mBAAmB,CAAC,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC"}
|
package/lib/esm/index.script.js
CHANGED
|
@@ -1,101 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const edge = '//cdn.surfside.io/sdk/1.0.0/edge.js';
|
|
4
|
-
const searchHasString = (str) => typeof globalThis.window !== 'undefined' &&
|
|
5
|
-
globalThis.window.location.search.toLowerCase().includes(str);
|
|
6
|
-
function GetSafeUrl(relativeUrl) {
|
|
7
|
-
/* Already has the Protocol included */
|
|
8
|
-
if (relativeUrl.includes('://')) {
|
|
9
|
-
return relativeUrl;
|
|
10
|
-
}
|
|
11
|
-
/* Check if protocol begins with // or not */
|
|
12
|
-
const slashes = relativeUrl.startsWith('//') ? '' : '//';
|
|
13
|
-
let protocol = globalThis.location.protocol;
|
|
14
|
-
if (!protocol.startsWith('http')) {
|
|
15
|
-
protocol = 'https:';
|
|
16
|
-
}
|
|
17
|
-
return `${protocol}${slashes}${relativeUrl}`;
|
|
18
|
-
}
|
|
19
|
-
function appendEdge() {
|
|
20
|
-
const wind = globalThis.window;
|
|
21
|
-
if (wind.surf === undefined) {
|
|
22
|
-
const url = GetSafeUrl(edge);
|
|
23
|
-
wind.surfContext = wind.surfContext ?? [];
|
|
24
|
-
wind.surfContext.push('surf');
|
|
25
|
-
wind.surf = function surfadsEventHandler(...args) {
|
|
26
|
-
if (wind.surf === undefined) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
(wind.surf.q = wind.surf.q ?? []).push(args);
|
|
30
|
-
};
|
|
31
|
-
wind.surf.q = wind.surf.q ?? [];
|
|
32
|
-
const script = globalThis.document.createElement('script');
|
|
33
|
-
script.src = url;
|
|
34
|
-
script.async = true;
|
|
35
|
-
globalThis.document.head.appendChild(script);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (globalThis.document.readyState === 'loading') {
|
|
39
|
-
globalThis.window.addEventListener('DOMContentLoaded', () => {
|
|
40
|
-
start();
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
start();
|
|
45
|
-
}
|
|
46
|
-
function start() {
|
|
47
|
-
const isDebug = searchHasString('surf_debug=true');
|
|
48
|
-
const isTelemetryEnabled = isDebug && searchHasString('surf_telemetry=true');
|
|
49
|
-
const logger = isDebug ? InitLogger(true) : undefined;
|
|
50
|
-
const monkeyPatchHistory = (name, newFunc) => {
|
|
51
|
-
const existing = globalThis.window[`surf_monkey_${name}_patched`];
|
|
52
|
-
if (existing !== undefined) {
|
|
53
|
-
return existing;
|
|
54
|
-
}
|
|
55
|
-
const oldFunc = globalThis.history[name];
|
|
56
|
-
globalThis.window[`surf_monkey_${name}`] = oldFunc;
|
|
57
|
-
const patched = (...p) => newFunc(oldFunc, ...p);
|
|
58
|
-
globalThis.window[`surf_monkey_${name}_patched`] = patched;
|
|
59
|
-
return patched;
|
|
60
|
-
};
|
|
61
|
-
try {
|
|
62
|
-
globalThis.history.replaceState = monkeyPatchHistory('replaceState', (oldFunc, ...args) => {
|
|
63
|
-
logger?.info('Intercepting replaceState');
|
|
64
|
-
oldFunc.call(globalThis.window.history, ...args);
|
|
65
|
-
globalThis.window.dispatchEvent(new Event('monkeyHistoryReplace'));
|
|
66
|
-
});
|
|
67
|
-
globalThis.history.pushState = monkeyPatchHistory('pushState', (oldFunc, ...args) => {
|
|
68
|
-
logger?.info('Intercepting pushState');
|
|
69
|
-
oldFunc.call(globalThis.window.history, ...args);
|
|
70
|
-
globalThis.window.dispatchEvent(new Event('monkeyHistoryReplace'));
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
catch (e) {
|
|
74
|
-
logger?.error('Unable to monkey patch the history functions', e);
|
|
75
|
-
}
|
|
76
|
-
try {
|
|
77
|
-
logger?.info('Loading digital SDK');
|
|
78
|
-
appendEdge();
|
|
79
|
-
}
|
|
80
|
-
catch (e) {
|
|
81
|
-
logger?.error('Failed to initialize digital SDK! Got', e);
|
|
82
|
-
}
|
|
83
|
-
try {
|
|
84
|
-
logger?.info('Starting up Surfside Ads');
|
|
85
|
-
LoadSurfAds({
|
|
86
|
-
logger,
|
|
87
|
-
telemetry: isTelemetryEnabled,
|
|
88
|
-
overrides: {
|
|
89
|
-
services: {
|
|
90
|
-
requestBids: (config, requestBids) => Ok(WrapBidRequestDebouncerIfEnabled(logger, config.configuration, config.windowInfo, requestBids))
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
isDebug
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
catch (e) {
|
|
97
|
-
logger?.error('Failed to initialize Surfside Ads! Got ', e);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
;
|
|
1
|
+
import { RunWhenDocumentReady, StartSurfAdsScript } from './ScriptStart';
|
|
2
|
+
RunWhenDocumentReady(() => StartSurfAdsScript());
|
|
101
3
|
//# sourceMappingURL=index.script.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.script.js","sourceRoot":"../@surfside-ads/","sources":["index.script.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.script.js","sourceRoot":"../@surfside-ads/","sources":["index.script.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEzE,oBAAoB,CAAC,GAAG,EAAE,CAAC,kBAAkB,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ISurfAdsWebConfigurationOverrides } from '@surfside/ads-core-web';
|
|
2
|
+
export declare function RunWhenDocumentReady(run: () => void): void;
|
|
3
|
+
export type ScriptServiceOverrides = Partial<Pick<ISurfAdsWebConfigurationOverrides, 'startRequest'>>;
|
|
4
|
+
export declare function StartSurfAdsScript(overrides?: ScriptServiceOverrides): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type BidRequestReason } from '@surfside/ads-core';
|
|
1
2
|
import { type ISimpleCreativeComponentDependencies, SimpleCreativeComponent, type CompletedSimpleCreativeAttributes } from './SimpleCreative';
|
|
2
3
|
export interface ISurfsideBannerComponentDependencies extends ISimpleCreativeComponentDependencies {
|
|
3
4
|
}
|
|
@@ -12,5 +13,5 @@ export declare class SurfsideBanner extends SimpleCreativeComponent {
|
|
|
12
13
|
adoptedCallback(): void;
|
|
13
14
|
disconnectedCallback(): void;
|
|
14
15
|
connectedMoveCallback(): void;
|
|
15
|
-
render(this: this & CompletedSimpleCreativeAttributes): Promise<void>;
|
|
16
|
+
render(this: this & CompletedSimpleCreativeAttributes, reason?: BidRequestReason): Promise<void>;
|
|
16
17
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AsyncResult, type ILogger, type IContextLogger } from '@surfside/ads-core';
|
|
1
|
+
import { type AsyncResult, type ILogger, type IContextLogger, type BidRequestReason, type IBidRequest } from '@surfside/ads-core';
|
|
2
2
|
import { type GetUserIdFn, type ISurfsideWebApi } from '@surfside/ads-core-web';
|
|
3
3
|
export type CompletedBaseAttributes = {
|
|
4
4
|
accountId: string;
|
|
@@ -24,6 +24,8 @@ export declare const RecommenderTypeInputs: {
|
|
|
24
24
|
};
|
|
25
25
|
export declare const AttributeValOrThrow: (element: Element, attribute: string, value: string | null) => string;
|
|
26
26
|
export declare const DEBOUNCE_THRESHOLD = 10;
|
|
27
|
+
export type ReauctionReason = Exclude<BidRequestReason, 'initial'>;
|
|
28
|
+
export declare const WithBidRequestReason: (request: IBidRequest, reason: BidRequestReason) => IBidRequest;
|
|
27
29
|
export interface ICreativeComponentDependencies {
|
|
28
30
|
initApi: InitApi;
|
|
29
31
|
getUserId: GetUserIdFn;
|
|
@@ -51,13 +53,11 @@ export declare abstract class CreativeComponent extends HTMLElement {
|
|
|
51
53
|
private _reauctionCallback;
|
|
52
54
|
private _reauctionRemainingMs;
|
|
53
55
|
private _reauctionStartedAt;
|
|
54
|
-
private
|
|
56
|
+
private _reauctionWasPaused;
|
|
55
57
|
private _initApi;
|
|
56
58
|
private _getUserId;
|
|
57
59
|
logger?: ILogger;
|
|
58
60
|
protected readonly isDebug: boolean;
|
|
59
|
-
private readonly _blurCallback;
|
|
60
|
-
private readonly _focusCallback;
|
|
61
61
|
private readonly _visibilityChangeCallback;
|
|
62
62
|
constructor({ initApi, getUserId, logger, isDebug }: ICreativeComponentDependencies);
|
|
63
63
|
connectedCallback(): void;
|
|
@@ -79,10 +79,11 @@ export declare abstract class CreativeComponent extends HTMLElement {
|
|
|
79
79
|
private reauctionPaused;
|
|
80
80
|
/**
|
|
81
81
|
* Schedules `callback` to run after `intervalMs`, replacing any pending re-auction.
|
|
82
|
-
* The countdown is paused while the
|
|
83
|
-
*
|
|
82
|
+
* The countdown is paused while the document is hidden and resumes with the remaining time
|
|
83
|
+
* once it is visible again. `callback` receives 'resume' if the countdown was paused at any
|
|
84
|
+
* point, otherwise 'refresh', so it can be passed through to the bid request's `ext.reason`.
|
|
84
85
|
*/
|
|
85
|
-
protected scheduleReauction(callback: () => void, intervalMs: number): void;
|
|
86
|
+
protected scheduleReauction(callback: (reason: ReauctionReason) => void, intervalMs: number): void;
|
|
86
87
|
protected clearReauction(): void;
|
|
87
88
|
private startReauctionTimer;
|
|
88
89
|
private pauseReauction;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type BidRequestReason } from '@surfside/ads-core';
|
|
1
2
|
import { type ISimpleCreativeComponentDependencies, SimpleCreativeComponent, type CompletedSimpleCreativeAttributes } from './SimpleCreative';
|
|
2
3
|
export type CompletedVideoAttributes = CompletedSimpleCreativeAttributes & {
|
|
3
4
|
minDuration: number;
|
|
@@ -18,5 +19,5 @@ export declare class SurfsideVideo extends SimpleCreativeComponent {
|
|
|
18
19
|
protected readVideoAttributes(): asserts this is this & CompletedVideoAttributes;
|
|
19
20
|
connectedCallback(): Promise<void>;
|
|
20
21
|
disconnectedCallback(): void;
|
|
21
|
-
render(this: this & CompletedVideoAttributes): Promise<void>;
|
|
22
|
+
render(this: this & CompletedVideoAttributes, reason?: BidRequestReason): Promise<void>;
|
|
22
23
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surfside/ads",
|
|
3
|
-
"version": "3.8.0
|
|
3
|
+
"version": "3.8.0",
|
|
4
4
|
"module": "./lib/esm/index.module.js",
|
|
5
5
|
"main": "./lib/cjs/index.module.js",
|
|
6
6
|
"types": "./lib/types/index.module.d.ts",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"typescript": "^5"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@surfside/ads-core": "2.8.0
|
|
39
|
-
"@surfside/ads-core-mock": "0.8.0
|
|
40
|
-
"@surfside/ads-core-web": "0.8.0
|
|
38
|
+
"@surfside/ads-core": "2.8.0",
|
|
39
|
+
"@surfside/ads-core-mock": "0.8.0",
|
|
40
|
+
"@surfside/ads-core-web": "0.8.0"
|
|
41
41
|
}
|
|
42
42
|
}
|