@surfside/ads-core-web 0.1.8 → 0.1.10
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/helpers/UserId.js +20 -0
- package/lib/cjs/helpers/UserId.js.map +1 -0
- package/lib/cjs/helpers/index.js +1 -0
- package/lib/cjs/helpers/index.js.map +1 -1
- package/lib/cjs/rendering/Carousel.js +2 -2
- package/lib/cjs/rendering/Video.js +2 -2
- package/lib/esm/helpers/UserId.js +16 -0
- package/lib/esm/helpers/UserId.js.map +1 -0
- package/lib/esm/helpers/index.js +1 -0
- package/lib/esm/helpers/index.js.map +1 -1
- package/lib/esm/rendering/Carousel.js +2 -2
- package/lib/esm/rendering/Video.js +2 -2
- package/lib/types/helpers/UserId.d.ts +3 -0
- package/lib/types/helpers/index.d.ts +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetSurfUserIdCookie = void 0;
|
|
4
|
+
const ads_core_client_1 = require("@surfside/ads-core-client");
|
|
5
|
+
const COOKIE_PREFIX = 'surfid.';
|
|
6
|
+
const SURFID_REGEX = /surfid.(?<site_hash>[a-z0-9]+)=(?<domain_userid>[^.]+).*/ig;
|
|
7
|
+
const GetSurfUserIdCookie = async (logger) => {
|
|
8
|
+
const log = (0, ads_core_client_1.Ctx)(logger)?.with('GetSurfUserIdCookie');
|
|
9
|
+
log?.info('Getting ID from Surfside Cookie');
|
|
10
|
+
const userId = document.cookie /* Cookie OR */
|
|
11
|
+
.split(';')
|
|
12
|
+
.map(c => c.trim())
|
|
13
|
+
.filter(c => c.startsWith(COOKIE_PREFIX))
|
|
14
|
+
.map(c => c.matchAll(SURFID_REGEX))
|
|
15
|
+
.map(m => [...m])?.[0]?.[0]?.groups?.domain_userid;
|
|
16
|
+
log?.debug('SurfsideUserIDService.getUserId userId', userId);
|
|
17
|
+
return userId;
|
|
18
|
+
};
|
|
19
|
+
exports.GetSurfUserIdCookie = GetSurfUserIdCookie;
|
|
20
|
+
//# sourceMappingURL=UserId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserId.js","sourceRoot":"src/","sources":["helpers/UserId.ts"],"names":[],"mappings":";;;AAAA,+DAA8D;AAE9D,MAAM,aAAa,GAAG,SAAS,CAAC;AAChC,MAAM,YAAY,GAAG,4DAA4D,CAAC;AAI3E,MAAM,mBAAmB,GAAG,KAAK,EAAE,MAAgB,EAAE,EAAE;IAC1D,MAAM,GAAG,GAAG,IAAA,qBAAG,EAAC,MAAM,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACrD,GAAG,EAAE,IAAI,CAAC,iCAAiC,CAAC,CAAC;IAC7C,MAAM,MAAM,GACR,QAAQ,CAAC,MAAM,CAAC,eAAe;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SAClB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;SACxC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;SAClC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAChB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC;IAE1C,GAAG,EAAE,KAAK,CAAC,wCAAwC,EAAE,MAAM,CAAC,CAAC;IAC7D,OAAO,MAAM,CAAC;AAElB,CAAC,CAAC;AAfW,QAAA,mBAAmB,uBAe9B"}
|
package/lib/cjs/helpers/index.js
CHANGED
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./Dom"), exports);
|
|
18
18
|
__exportStar(require("./Trackers"), exports);
|
|
19
|
+
__exportStar(require("./UserId"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,6CAA2B;AAC3B,2CAAyB"}
|
|
@@ -326,7 +326,7 @@ const style = `.surf-carousel {
|
|
|
326
326
|
|
|
327
327
|
&:before {
|
|
328
328
|
content: "";
|
|
329
|
-
background: url('
|
|
329
|
+
background: url('//cdn.surfside.io/icons/left-arrow.svg')
|
|
330
330
|
no-repeat center;
|
|
331
331
|
width: 40px;
|
|
332
332
|
height: 40px;
|
|
@@ -338,7 +338,7 @@ const style = `.surf-carousel {
|
|
|
338
338
|
|
|
339
339
|
&:before {
|
|
340
340
|
content: "";
|
|
341
|
-
background: url('
|
|
341
|
+
background: url('//cdn.surfside.io/icons/right-arrow.svg')
|
|
342
342
|
no-repeat center;
|
|
343
343
|
width: 40px;
|
|
344
344
|
height: 40px;
|
|
@@ -215,8 +215,8 @@ const style = `@keyframes grow-arc {
|
|
|
215
215
|
|
|
216
216
|
|
|
217
217
|
.surfside-video {
|
|
218
|
-
--icon-muted: url(
|
|
219
|
-
--icon-unmuted: url(
|
|
218
|
+
--icon-muted: url('//cdn.surfside.io/icons/muted.svg');
|
|
219
|
+
--icon-unmuted: url('//cdn.surfside.io/icons/unmuted.svg');
|
|
220
220
|
|
|
221
221
|
position: relative;
|
|
222
222
|
overflow: hidden;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Ctx } from '@surfside/ads-core-client';
|
|
2
|
+
const COOKIE_PREFIX = 'surfid.';
|
|
3
|
+
const SURFID_REGEX = /surfid.(?<site_hash>[a-z0-9]+)=(?<domain_userid>[^.]+).*/ig;
|
|
4
|
+
export const GetSurfUserIdCookie = async (logger) => {
|
|
5
|
+
const log = Ctx(logger)?.with('GetSurfUserIdCookie');
|
|
6
|
+
log?.info('Getting ID from Surfside Cookie');
|
|
7
|
+
const userId = document.cookie /* Cookie OR */
|
|
8
|
+
.split(';')
|
|
9
|
+
.map(c => c.trim())
|
|
10
|
+
.filter(c => c.startsWith(COOKIE_PREFIX))
|
|
11
|
+
.map(c => c.matchAll(SURFID_REGEX))
|
|
12
|
+
.map(m => [...m])?.[0]?.[0]?.groups?.domain_userid;
|
|
13
|
+
log?.debug('SurfsideUserIDService.getUserId userId', userId);
|
|
14
|
+
return userId;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=UserId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserId.js","sourceRoot":"src/","sources":["helpers/UserId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAgB,MAAM,2BAA2B,CAAC;AAE9D,MAAM,aAAa,GAAG,SAAS,CAAC;AAChC,MAAM,YAAY,GAAG,4DAA4D,CAAC;AAIlF,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EAAE,MAAgB,EAAE,EAAE;IAC1D,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACrD,GAAG,EAAE,IAAI,CAAC,iCAAiC,CAAC,CAAC;IAC7C,MAAM,MAAM,GACR,QAAQ,CAAC,MAAM,CAAC,eAAe;SAC1B,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SAClB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;SACxC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;SAClC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAChB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC;IAE1C,GAAG,EAAE,KAAK,CAAC,wCAAwC,EAAE,MAAM,CAAC,CAAC;IAC7D,OAAO,MAAM,CAAC;AAElB,CAAC,CAAC"}
|
package/lib/esm/helpers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
|
|
@@ -320,7 +320,7 @@ const style = `.surf-carousel {
|
|
|
320
320
|
|
|
321
321
|
&:before {
|
|
322
322
|
content: "";
|
|
323
|
-
background: url('
|
|
323
|
+
background: url('//cdn.surfside.io/icons/left-arrow.svg')
|
|
324
324
|
no-repeat center;
|
|
325
325
|
width: 40px;
|
|
326
326
|
height: 40px;
|
|
@@ -332,7 +332,7 @@ const style = `.surf-carousel {
|
|
|
332
332
|
|
|
333
333
|
&:before {
|
|
334
334
|
content: "";
|
|
335
|
-
background: url('
|
|
335
|
+
background: url('//cdn.surfside.io/icons/right-arrow.svg')
|
|
336
336
|
no-repeat center;
|
|
337
337
|
width: 40px;
|
|
338
338
|
height: 40px;
|
|
@@ -211,8 +211,8 @@ const style = `@keyframes grow-arc {
|
|
|
211
211
|
|
|
212
212
|
|
|
213
213
|
.surfside-video {
|
|
214
|
-
--icon-muted: url(
|
|
215
|
-
--icon-unmuted: url(
|
|
214
|
+
--icon-muted: url('//cdn.surfside.io/icons/muted.svg');
|
|
215
|
+
--icon-unmuted: url('//cdn.surfside.io/icons/unmuted.svg');
|
|
216
216
|
|
|
217
217
|
position: relative;
|
|
218
218
|
overflow: hidden;
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"types": "./lib/types/index.d.ts"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
|
-
"version": "0.1.
|
|
13
|
+
"version": "0.1.10",
|
|
14
14
|
"license": "UNLICENSED",
|
|
15
15
|
"files": [
|
|
16
16
|
"lib/",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"lint": "npx eslint"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@surfside/ads-core-client": "^0.1.
|
|
26
|
+
"@surfside/ads-core-client": "^0.1.10"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@eslint/js": "^9.25.1",
|
|
30
30
|
"@types/bun": "latest",
|
|
31
31
|
"eslint": "^9.25.1",
|
|
32
32
|
"handlebars": "^4.7.8",
|
|
33
|
-
"typescript-eslint": "^8.
|
|
33
|
+
"typescript-eslint": "^8.41.0",
|
|
34
34
|
"@surfside/ads-core-mock": "^0.1.6",
|
|
35
35
|
"typescript": "^5.8.3"
|
|
36
36
|
}
|