@surfside/ads-core-web 0.1.21 → 0.1.23

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/README.md CHANGED
@@ -1,15 +1,15 @@
1
- # @surfside/ads-core-web
2
-
3
- To install dependencies:
4
-
5
- ```bash
6
- bun install
7
- ```
8
-
9
- To run:
10
-
11
- ```bash
12
- bun run src/index.ts
13
- ```
14
-
15
- This project was created using `bun init` in bun v1.2.10. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
1
+ # @surfside/ads-core-web
2
+
3
+ To install dependencies:
4
+
5
+ ```bash
6
+ bun install
7
+ ```
8
+
9
+ To run:
10
+
11
+ ```bash
12
+ bun run src/index.ts
13
+ ```
14
+
15
+ This project was created using `bun init` in bun v1.2.10. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SurfsideAdsCoreWebVersionInfo = void 0;
4
- exports.SurfsideAdsCoreWebVersionInfo = { buildBranch: 'master', buildHash: '204013e', buildVer: '0.1.20' };
4
+ exports.SurfsideAdsCoreWebVersionInfo = { buildBranch: 'hotfix-0.1.23', buildHash: 'f4f4536', buildVer: '0.1.23' };
5
5
  //# sourceMappingURL=BuildInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BuildInfo.js","sourceRoot":"src/","sources":["BuildInfo.ts"],"names":[],"mappings":";;;AAAa,QAAA,6BAA6B,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAC,CAAC"}
1
+ {"version":3,"file":"BuildInfo.js","sourceRoot":"src/","sources":["BuildInfo.ts"],"names":[],"mappings":";;;AAAa,QAAA,6BAA6B,GAAG,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAC,CAAC"}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoadSurfAdsWebSimple = exports.LoadSurfAdsWeb = exports.LoadSurfAdsWebDependencies = exports.CreateSurfAdsWeb = void 0;
4
+ const ads_core_client_1 = require("@surfside/ads-core-client");
5
+ const _1 = require(".");
6
+ const helpers_1 = require("./helpers");
7
+ const TLS = (url) => 'https:' + url;
8
+ ;
9
+ const CreateSurfAdsWeb = (config) => {
10
+ const clientApiRes = (0, ads_core_client_1.CreateSurfAdsClient)(config);
11
+ if (!clientApiRes.ok) {
12
+ return clientApiRes;
13
+ }
14
+ const clientApi = clientApiRes.value;
15
+ const { logger, mobile } = config;
16
+ const { evaluateProductCardTemplate } = clientApi;
17
+ const { configuration, device, geo, navigator } = config;
18
+ const renderBanner = _1.RenderBanner.bind(undefined, logger, mobile);
19
+ const renderProductCard = _1.RenderProductCard.bind(undefined, logger, configuration.templates.productCardStylesheet, configuration.templates.javascriptCallbacks, evaluateProductCardTemplate);
20
+ const renderCarousel = _1.RenderCarousel.bind(undefined, logger, evaluateProductCardTemplate, configuration.settings.sponsoredByEnabled === true, configuration.templates.productCardStylesheet, configuration.templates.carouselStylesheet, configuration.templates.javascriptCallbacks);
21
+ const renderVideo = _1.RenderVideo.bind(undefined, logger, device, geo, navigator.userAgent);
22
+ return (0, ads_core_client_1.Ok)({
23
+ ...clientApi,
24
+ renderBanner,
25
+ renderProductCard,
26
+ renderCarousel,
27
+ renderVideo
28
+ });
29
+ };
30
+ exports.CreateSurfAdsWeb = CreateSurfAdsWeb;
31
+ const LoadSurfAdsWebDependencies = (config) => {
32
+ const { overrides, accountId, siteId, locationId, telemetry } = config;
33
+ const createTelemetryCollector = overrides?.services?.createTelemetryCollector ?? ((config) => (0, ads_core_client_1.Ok)(telemetry === true
34
+ ? new helpers_1.WebTelemetryCollector({
35
+ accountId: config.accountId,
36
+ siteId: config.siteId,
37
+ channelId: config.channelId,
38
+ locationId: config.locationId,
39
+ endpoint: TLS(ads_core_client_1.PROD_TELEMETRY_SERVICE),
40
+ tags: { accountId, siteId, locationId },
41
+ device: (0, ads_core_client_1.DeviceToTelemetryDevice)(config.device)
42
+ })
43
+ : undefined));
44
+ return (0, ads_core_client_1.LoadSurfAdsClientDependencies)({
45
+ ...config,
46
+ overrides: {
47
+ ...config.overrides,
48
+ services: {
49
+ ...config.overrides?.services,
50
+ createTelemetryCollector,
51
+ }
52
+ }
53
+ });
54
+ };
55
+ exports.LoadSurfAdsWebDependencies = LoadSurfAdsWebDependencies;
56
+ const LoadSurfAdsWeb = async (config) => {
57
+ const dependenciesRes = await (0, exports.LoadSurfAdsWebDependencies)(config);
58
+ if (!dependenciesRes.ok) {
59
+ return dependenciesRes;
60
+ }
61
+ const dependencies = dependenciesRes.value;
62
+ const result = (0, exports.CreateSurfAdsWeb)({
63
+ ...config,
64
+ ...dependencies,
65
+ });
66
+ return result;
67
+ };
68
+ exports.LoadSurfAdsWeb = LoadSurfAdsWeb;
69
+ const LoadSurfAdsWebSimple = async (accountId, siteId, channelId, locationId, userId, logger, telemetry, overrides) => {
70
+ const browserInfo = (0, ads_core_client_1.GetBrowserInfo)();
71
+ if (!browserInfo.ok) {
72
+ return browserInfo;
73
+ }
74
+ const { windowInfo, navigator, isMobile, screen } = browserInfo.value;
75
+ return await (0, exports.LoadSurfAdsWeb)({
76
+ logger,
77
+ accountId,
78
+ channelId,
79
+ siteId,
80
+ locationId,
81
+ userId,
82
+ windowInfo,
83
+ navigator,
84
+ mobile: isMobile,
85
+ screen,
86
+ ip: undefined,
87
+ overrides,
88
+ telemetry
89
+ });
90
+ };
91
+ exports.LoadSurfAdsWebSimple = LoadSurfAdsWebSimple;
92
+ //# sourceMappingURL=Init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Init.js","sourceRoot":"../@surfside-ads-core-web/","sources":["Init.ts"],"names":[],"mappings":";;;AAAA,+DAcmC;AACnC,wBAAuG;AACvG,uCAAkD;AAElD,MAAM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C;QACtB,OAAO,eAAe,CAAC;IAC3B,CAAC;IACD,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC;IAE3C,MAAM,MAAM,GAAG,IAAA,wBAAgB,EAAC;QAC5B,GAAG,MAAM;QACT,GAAG,YAAY;KAClB,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAfW,QAAA,cAAc,kBAezB;AAEK,MAAM,oBAAoB,GAAG,KAAK,EACrC,SAAiB,EACjB,MAAc,EACd,SAAiB,EACjB,UAAkB,EAClB,MAAe,EACf,MAAgB,EAChB,SAAmB,EACnB,SAGC,EAC2B,EAAE;IAC9B,MAAM,WAAW,GAAG,IAAA,gCAAc,GAAE,CAAC;IACrC,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC;QAClB,OAAO,WAAW,CAAC;IACvB,CAAC;IACD,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC,KAAK,CAAC;IAEtE,OAAO,MAAM,IAAA,sBAAc,EACvB;QACI,MAAM;QACN,SAAS;QACT,SAAS;QACT,MAAM;QACN,UAAU;QACV,MAAM;QACN,UAAU;QACV,SAAS;QACT,MAAM,EAAE,QAAQ;QAChB,MAAM;QACN,EAAE,EAAE,SAAS;QACb,SAAS;QACT,SAAS;KACZ,CACJ,CAAC;AACN,CAAC,CAAC;AApCW,QAAA,oBAAoB,wBAoC/B"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebTelemetryCollector = void 0;
4
+ const ads_core_client_1 = require("@surfside/ads-core-client");
5
+ class WebTelemetryCollector extends ads_core_client_1.ITelemetryCollector {
6
+ _endpoint;
7
+ _tags;
8
+ _batchIntervalMs;
9
+ _pageUrl;
10
+ _queue = [];
11
+ _flushTimer;
12
+ _device;
13
+ constructor(options) {
14
+ super(options.accountId, options.siteId, options.channelId, options.locationId, options.device);
15
+ this._endpoint = options.endpoint;
16
+ this._tags = { pageSessionId: crypto.randomUUID(), ...(options.tags ?? {}) };
17
+ this._batchIntervalMs = options.batchIntervalMs ?? 1000;
18
+ this._pageUrl = options.url ?? globalThis.location?.href;
19
+ }
20
+ record(entry) {
21
+ this._queue.push({
22
+ device: this.device,
23
+ pageUrl: this._pageUrl ?? globalThis?.window?.location?.href,
24
+ ...entry,
25
+ tags: { ...this._tags, ...(entry.tags ?? {}) },
26
+ });
27
+ if (this._batchIntervalMs === 0) {
28
+ this.flush();
29
+ return;
30
+ }
31
+ clearTimeout(this._flushTimer);
32
+ this._flushTimer = setTimeout(() => this.flush(), this._batchIntervalMs);
33
+ if (this._queue.length >= 100) {
34
+ this.flush();
35
+ }
36
+ }
37
+ flush() {
38
+ if (this._queue.length === 0) {
39
+ return;
40
+ }
41
+ const payload = JSON.stringify(this._queue.splice(0));
42
+ clearTimeout(this._flushTimer);
43
+ this._flushTimer = undefined;
44
+ const sent = globalThis.navigator.sendBeacon(this._endpoint, new Blob([payload], { type: 'application/json' }));
45
+ if (!sent) {
46
+ fetch(this._endpoint, {
47
+ method: 'POST',
48
+ headers: { 'Content-Type': 'application/json' },
49
+ body: payload,
50
+ keepalive: true,
51
+ }).catch(() => { });
52
+ }
53
+ }
54
+ }
55
+ exports.WebTelemetryCollector = WebTelemetryCollector;
56
+ //# sourceMappingURL=WebTelemetryCollector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebTelemetryCollector.js","sourceRoot":"../@surfside-ads-core-web/","sources":["helpers/WebTelemetryCollector.ts"],"names":[],"mappings":";;;AAAA,+DAImC;AAcnC,MAAa,qBAAsB,SAAQ,qCAAmB;IACzC,SAAS,CAAS;IAClB,KAAK,CAAyB;IAC9B,gBAAgB,CAAS;IACzB,QAAQ,CAAqB;IACtC,MAAM,GAAsB,EAAE,CAAC;IAC/B,WAAW,CAA4C;IACvD,OAAO,CAA+B;IAE9C,YAAY,OAAsC;QAC9C,KAAK,CACD,OAAO,C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ED,KAAK;QACD,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO;QACX,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACtD,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QAC7B,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC,CAAC;QAChH,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE;gBAClB,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;gBAC/C,IAAI,EAAE,OAAO;gBACb,SAAS,EAAE,IAAI;aAClB,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACvB,CAAC;IACL,CAAC;CACJ;AA1DD,sDA0DC"}
@@ -62,34 +62,34 @@ class MissingNurlError extends Error {
62
62
  }
63
63
  exports.MissingNurlError = MissingNurlError;
64
64
  ;
65
- const template = `<div>
66
- <div class="surfside-banner-adm">
67
-
68
- </div>
69
- <div class="surfside-banner-watermark">
70
-
71
- </div>
72
- </div>
65
+ const template = `<div>
66
+ <div class="surfside-banner-adm">
67
+
68
+ </div>
69
+ <div class="surfside-banner-watermark">
70
+
71
+ </div>
72
+ </div>
73
73
  `;
74
- const style = `.surfside-banner {
75
- position: relative;
76
- display: inline-block;
77
- overflow: hidden;
78
- max-width: 100%;
79
- height: auto;
80
- width: 100%;
81
- }
82
-
83
- .surfside-banner-adm {
84
- display: flex;
85
-
86
- a {
87
- width: 100%;
88
-
89
- img {
90
- width: 100%;
91
- height: auto;
92
- }
93
- }
74
+ const style = `.surfside-banner {
75
+ position: relative;
76
+ display: inline-block;
77
+ overflow: hidden;
78
+ max-width: 100%;
79
+ height: auto;
80
+ width: 100%;
81
+ }
82
+
83
+ .surfside-banner-adm {
84
+ display: flex;
85
+
86
+ a {
87
+ width: 100%;
88
+
89
+ img {
90
+ width: 100%;
91
+ height: auto;
92
+ }
93
+ }
94
94
  }`;
95
95
  //# sourceMappingURL=Banner.js.map
@@ -285,126 +285,126 @@ class EmptyFirstPageError extends Error {
285
285
  }
286
286
  exports.EmptyFirstPageError = EmptyFirstPageError;
287
287
  ;
288
- const template = `<div class="carousel-wrapper">
289
- <div class="sponsored-carousel"></div>
290
- <div class="surf-carousel">
291
- <div class="items"></div>
292
- <div class="arrows">
293
- <div class="arrow left"></div>
294
- <div class="arrow right"></div>
295
- </div>
296
- </div>
288
+ const template = `<div class="carousel-wrapper">
289
+ <div class="sponsored-carousel"></div>
290
+ <div class="surf-carousel">
291
+ <div class="items"></div>
292
+ <div class="arrows">
293
+ <div class="arrow left"></div>
294
+ <div class="arrow right"></div>
295
+ </div>
296
+ </div>
297
297
  </div>`;
298
- const style = `
299
- .surf-carousel {
300
- display: flex;
301
- position: relative;
302
- flex-grow: 1;
303
-
304
- .sponsored-carousel {
305
- font-family: 'Helvetica', Verdana, Geneva, Tahoma, sans-serif;
306
- margin: 10px 0;
307
- font-size: 24px;
308
-
309
- &::before {
310
- content: 'For you';
311
- }
312
-
313
- &.sponsoredByOne::before {
314
- content: 'Sponsored by ';
315
- }
316
-
317
- &.recommended::before {
318
- content: 'Recommended';
319
- }
320
-
321
- &.sponsoredByMany::before {
322
- content: 'Sponsored';
323
- }
324
- }
325
-
326
- .carousel-wrapper {
327
- width: 100%;
328
- overflow-x: clip;
329
- position: relative;
330
- }
331
-
332
- .items {
333
- z-index: 1;
334
- display: flex;
335
- flex-direction: row;
336
- flex-grow: 1;
337
- flex-wrap: nowrap;
338
- align-items: stretch;
339
- padding: 0 37px;
340
- box-sizing: border-box;
341
- transition: transform 0.4s ease-out;
342
- width: 100%;
343
-
344
- .surf-product-card {
345
- flex: 1;
346
- display: flex;
347
- padding: 5px;
348
- box-sizing: border-box;
349
- }
350
- }
351
-
352
-
353
- }
354
-
355
- .arrows {
356
-
357
- .arrow {
358
- z-index: 2;
359
- position: absolute;
360
- top: 50%;
361
- transform: translateY(-50%);
362
- width: 40px;
363
- height: 40px;
364
- display: flex;
365
- background-color: rgba(0, 0, 0, 0.5);
366
- margin: 0 1rem;
367
- justify-content: center;
368
- align-items: center;
369
- border-radius: 50%;
370
- cursor: pointer;
371
- box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2),
372
- 0 2px 8px 0 rgba(0, 0, 0, 0.2);
373
-
374
- &:hover {
375
- background-color: rgba(0, 0, 0, 0.6);
376
- }
377
-
378
- &.disabled {
379
- cursor: not-allowed;
380
- filter: grayscale(100%);
381
- opacity: 0.2;
382
- }
383
-
384
- &.left {
385
- left: -10px;
386
-
387
- &:before {
388
- content: "";
389
- background: url('//cdn.surfside.io/icons/left-arrow.svg')
390
- no-repeat center;
391
- width: 40px;
392
- height: 40px;
393
- }
394
- }
395
-
396
- &.right {
397
- right: 0;
398
-
399
- &:before {
400
- content: "";
401
- background: url('//cdn.surfside.io/icons/right-arrow.svg')
402
- no-repeat center;
403
- width: 40px;
404
- height: 40px;
405
- }
406
-
407
- }
408
- }
298
+ const style = `
299
+ .surf-carousel {
300
+ display: flex;
301
+ position: relative;
302
+ flex-grow: 1;
303
+
304
+ .sponsored-carousel {
305
+ font-family: 'Helvetica', Verdana, Geneva, Tahoma, sans-serif;
306
+ margin: 10px 0;
307
+ font-size: 24px;
308
+
309
+ &::before {
310
+ content: 'For you';
311
+ }
312
+
313
+ &.sponsoredByOne::before {
314
+ content: 'Sponsored by ';
315
+ }
316
+
317
+ &.recommended::before {
318
+ content: 'Recommended';
319
+ }
320
+
321
+ &.sponsoredByMany::before {
322
+ content: 'Sponsored';
323
+ }
324
+ }
325
+
326
+ .carousel-wrapper {
327
+ width: 100%;
328
+ overflow-x: clip;
329
+ position: relative;
330
+ }
331
+
332
+ .items {
333
+ z-index: 1;
334
+ display: flex;
335
+ flex-direction: row;
336
+ flex-grow: 1;
337
+ flex-wrap: nowrap;
338
+ align-items: stretch;
339
+ padding: 0 37px;
340
+ box-sizing: border-box;
341
+ transition: transform 0.4s ease-out;
342
+ width: 100%;
343
+
344
+ .surf-product-card {
345
+ flex: 1;
346
+ display: flex;
347
+ padding: 5px;
348
+ box-sizing: border-box;
349
+ }
350
+ }
351
+
352
+
353
+ }
354
+
355
+ .arrows {
356
+
357
+ .arrow {
358
+ z-index: 2;
359
+ position: absolute;
360
+ top: 50%;
361
+ transform: translateY(-50%);
362
+ width: 40px;
363
+ height: 40px;
364
+ display: flex;
365
+ background-color: rgba(0, 0, 0, 0.5);
366
+ margin: 0 1rem;
367
+ justify-content: center;
368
+ align-items: center;
369
+ border-radius: 50%;
370
+ cursor: pointer;
371
+ box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2),
372
+ 0 2px 8px 0 rgba(0, 0, 0, 0.2);
373
+
374
+ &:hover {
375
+ background-color: rgba(0, 0, 0, 0.6);
376
+ }
377
+
378
+ &.disabled {
379
+ cursor: not-allowed;
380
+ filter: grayscale(100%);
381
+ opacity: 0.2;
382
+ }
383
+
384
+ &.left {
385
+ left: -10px;
386
+
387
+ &:before {
388
+ content: "";
389
+ background: url('//cdn.surfside.io/icons/left-arrow.svg')
390
+ no-repeat center;
391
+ width: 40px;
392
+ height: 40px;
393
+ }
394
+ }
395
+
396
+ &.right {
397
+ right: 0;
398
+
399
+ &:before {
400
+ content: "";
401
+ background: url('//cdn.surfside.io/icons/right-arrow.svg')
402
+ no-repeat center;
403
+ width: 40px;
404
+ height: 40px;
405
+ }
406
+
407
+ }
408
+ }
409
409
  }`;
410
410
  //# sourceMappingURL=Carousel.js.map
@@ -110,24 +110,24 @@ class MissingTrackersError extends Error {
110
110
  }
111
111
  exports.MissingTrackersError = MissingTrackersError;
112
112
  ;
113
- const style = `.surf-product-card {
114
- width: 100%;
115
-
116
- &.sponsored {
117
- position: relative;
118
-
119
- &::after {
120
- content: 'Sponsored';
121
- position: absolute;
122
- font-family: Verdana, Helvetica, 'sans-serif';
123
- font-weight: 100;
124
- color: #e0e0e0;
125
- font-size: 12px;
126
- box-sizing: border-box;
127
- bottom: 0px;
128
- width: 100%;
129
- text-align: center;
130
- }
131
- }
113
+ const style = `.surf-product-card {
114
+ width: 100%;
115
+
116
+ &.sponsored {
117
+ position: relative;
118
+
119
+ &::after {
120
+ content: 'Sponsored';
121
+ position: absolute;
122
+ font-family: Verdana, Helvetica, 'sans-serif';
123
+ font-weight: 100;
124
+ color: #e0e0e0;
125
+ font-size: 12px;
126
+ box-sizing: border-box;
127
+ bottom: 0px;
128
+ width: 100%;
129
+ text-align: center;
130
+ }
131
+ }
132
132
  }`;
133
133
  //# sourceMappingURL=ProductCard.js.map