@everymatrix/user-action-controller 1.55.0 → 1.56.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.
Files changed (25) hide show
  1. package/dist/cjs/{index-316ef19a.js → index-acdc077f.js} +176 -73
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/player-user-consents_2.cjs.entry.js +72 -22
  4. package/dist/cjs/user-action-controller.cjs.js +3 -3
  5. package/dist/collection/collection-manifest.json +1 -1
  6. package/dist/collection/components/user-action-controller/user-action-controller.js +64 -17
  7. package/dist/esm/{index-48848b35.js → index-82e2d554.js} +176 -73
  8. package/dist/esm/loader.js +3 -3
  9. package/dist/esm/player-user-consents_2.entry.js +72 -22
  10. package/dist/esm/user-action-controller.js +4 -4
  11. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-action-controller/.stencil/packages/stencil/user-action-controller/stencil.config.d.ts +2 -0
  12. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/user-action-controller/.stencil/packages/stencil/user-action-controller/stencil.config.dev.d.ts +2 -0
  13. package/dist/types/components/user-action-controller/user-action-controller.d.ts +2 -1
  14. package/dist/user-action-controller/p-839810ba.entry.js +1 -0
  15. package/dist/user-action-controller/p-e2754eb5.js +2 -0
  16. package/dist/user-action-controller/user-action-controller.esm.js +1 -1
  17. package/package.json +1 -1
  18. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/user-action-controller/.stencil/packages/stencil/user-action-controller/stencil.config.d.ts +0 -2
  19. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/user-action-controller/.stencil/packages/stencil/user-action-controller/stencil.config.dev.d.ts +0 -2
  20. package/dist/user-action-controller/p-5a10e23d.js +0 -2
  21. package/dist/user-action-controller/p-ef35142f.entry.js +0 -1
  22. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/user-action-controller/.stencil/tools/plugins/index.d.ts +0 -0
  23. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/user-action-controller/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  24. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/user-action-controller/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  25. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/user-action-controller/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-316ef19a.js');
5
+ const index = require('./index-acdc077f.js');
6
6
 
7
7
  const DEFAULT_LANGUAGE$1 = 'en';
8
8
  const TRANSLATIONS$1 = {
@@ -194,26 +194,52 @@ const PlayerUserConsents = class {
194
194
  constructor(hostRef) {
195
195
  index.registerInstance(this, hostRef);
196
196
  this.userLegislationConsent = index.createEvent(this, "userLegislationConsent", 7);
197
- this.goToTermsAndConditions = () => window.postMessage({ type: 'GoToTermsAndConditions' });
198
- this.goToPrivacyPolicy = () => window.postMessage({ type: 'GoToPrivacyPolicy' });
197
+ /**
198
+ * Language
199
+ */
199
200
  this.lang = 'en';
201
+ /**
202
+ * 'true' when parent expects component to emit it's current value
203
+ */
200
204
  this.queried = false;
205
+ /**
206
+ * the type of the consent, used to determine render details
207
+ */
201
208
  this.consentType = '';
209
+ /**
210
+ * wether or not this consent is mandatory. Used for render details
211
+ */
202
212
  this.mandatory = false;
213
+ /**
214
+ * Select GM version
215
+ */
203
216
  this.gmVersion = '';
217
+ /**
218
+ * the title of the consent to be displayed
219
+ */
204
220
  this.consentTitle = '';
221
+ /**
222
+ * Client custom styling via inline style
223
+ */
205
224
  this.clientStyling = '';
225
+ /**
226
+ * Client custom styling via url
227
+ */
206
228
  this.clientStylingUrl = '';
229
+ /**
230
+ * Translation url
231
+ */
207
232
  this.translationUrl = '';
208
- this.mbSource = undefined;
209
233
  this.textContent = '';
234
+ this.goToTermsAndConditions = () => window.postMessage({ type: 'GoToTermsAndConditions' });
235
+ this.goToPrivacyPolicy = () => window.postMessage({ type: 'GoToPrivacyPolicy' });
210
236
  }
211
237
  handleNewTranslations() {
212
238
  getTranslations$1(this.translationUrl);
213
239
  }
214
240
  handleStylingUrlChange(newValue, oldValue) {
215
241
  if (newValue !== oldValue)
216
- this.setClientStylingURL();
242
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
217
243
  }
218
244
  async componentWillLoad() {
219
245
  if (this.translationUrl.length > 2) {
@@ -263,7 +289,7 @@ const PlayerUserConsents = class {
263
289
  if (this.queried) {
264
290
  this.userLegislationConsentHandler();
265
291
  }
266
- return (index.h("div", { key: 'e3c4962028cea95e4391432bba0c6a4fa20d64cb', ref: el => this.stylingContainer = el }, index.h("p", { key: '606baf671f199a739b3738a73cd6e76748eb71c0', class: "ConsentTitle" }, this.consentTitle), index.h("label", { key: '7a581d02cbebf1ad6ec31b58e4b3b3583c0115bc', class: "UserConsent", htmlFor: "userConsent" }, index.h("input", { key: '70949461872d972a8d8a393dd36e6bbfbd3b82d0', ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }), this.determineTextContent(), this.mandatory && index.h("span", { key: 'e10c68ce2898d1b5801672b022ef9e1d0f185a17', class: "MandatoryItem" }, "*"))));
292
+ return (index.h("div", { key: 'aba04e96251f2f0febe96883b931193fb5ca8c94', ref: el => this.stylingContainer = el }, index.h("p", { key: 'd3f0cbeb5b45b4538462a53c41ab041b176a7c26', class: "ConsentTitle" }, this.consentTitle), index.h("label", { key: '800ab8d45e87b075402c3178e60a16866d0321d4', class: "UserConsent", htmlFor: "userConsent" }, index.h("input", { key: '919c15c353a8146661eca2870e7a63f7c689953e', ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }), this.determineTextContent(), this.mandatory && index.h("span", { key: 'f7126adee1ba5540837da4b852961d08a9eae857', class: "MandatoryItem" }, "*"))));
267
293
  }
268
294
  static get watchers() { return {
269
295
  "translationUrl": ["handleNewTranslations"],
@@ -398,38 +424,60 @@ const UserActionControllerStyle0 = userActionControllerCss;
398
424
  const UserActionController = class {
399
425
  constructor(hostRef) {
400
426
  index.registerInstance(this, hostRef);
401
- //for now this variable is hardcoded bcs we have terms and conditions and privacy policy mandatory and we dont receive with these new functionality the mandatory actions
402
- this.mandatoryActions = ['termsandconditions', 'privacypolicy'];
403
- this.userActions = [];
404
- this.consentTitles = {
405
- termsandconditions: translate('termsAndConditionsTitle', this.lang),
406
- sms: translate('smsTitle', this.lang),
407
- emailmarketing: translate('emailMarketingTitle', this.lang),
408
- privacypolicy: translate('privacyPolicyTitle', this.lang)
409
- };
410
- this.endpoint = undefined;
411
- this.userSession = undefined;
412
- this.userId = undefined;
427
+ /**
428
+ * Language
429
+ */
413
430
  this.lang = 'en';
414
- this.includeSubmitButton = undefined;
431
+ /**
432
+ * Select GM version
433
+ */
415
434
  this.gmVersion = '';
435
+ /**
436
+ * Translation url
437
+ */
416
438
  this.translationUrl = '';
439
+ /**
440
+ * Client custom styling via inline style
441
+ */
417
442
  this.clientStyling = '';
443
+ /**
444
+ * Client custom styling via url
445
+ */
418
446
  this.clientStylingUrl = '';
419
- this.mbSource = undefined;
447
+ /**
448
+ * Which actions are required in order to activate the "Apply" button. Other actions are considered optional.
449
+ */
420
450
  this.queryFired = false;
421
451
  this.readyActionsCount = 0;
422
452
  this.activeUserActions = [];
423
453
  this.userActionsValidated = true;
424
454
  this.receivedQueryResponses = 0;
425
- this.limitStylingAppends = false;
426
455
  this.isLoading = true;
427
456
  this.mandatoryActionsChecked = 0;
428
- this.mandatoryItems = undefined;
457
+ //for now this variable is hardcoded bcs we have terms and conditions and privacy policy mandatory and we dont receive with these new functionality the mandatory actions
458
+ this.mandatoryActions = ['termsandconditions', 'privacypolicy'];
459
+ this.userActions = [];
460
+ this.consentTitles = {
461
+ termsandconditions: translate('termsAndConditionsTitle', this.lang),
462
+ sms: translate('smsTitle', this.lang),
463
+ emailmarketing: translate('emailMarketingTitle', this.lang),
464
+ privacypolicy: translate('privacyPolicyTitle', this.lang)
465
+ };
429
466
  }
430
467
  handleNewTranslations() {
431
468
  getTranslations(this.translationUrl);
432
469
  }
470
+ handleClientStylingChange(newValue, oldValue) {
471
+ if (newValue != oldValue) {
472
+ setClientStyling(this.stylingContainer, this.clientStyling);
473
+ }
474
+ }
475
+ handleClientStylingUrlChange(newValue, oldValue) {
476
+ if (newValue != oldValue) {
477
+ if (this.clientStylingUrl)
478
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
479
+ }
480
+ }
433
481
  handleQueryResponse() {
434
482
  if (this.receivedQueryResponses === this.activeUserActions.length) {
435
483
  this.updateUserConsents();
@@ -602,6 +650,8 @@ const UserActionController = class {
602
650
  }
603
651
  static get watchers() { return {
604
652
  "translationUrl": ["handleNewTranslations"],
653
+ "clientStyling": ["handleClientStylingChange"],
654
+ "clientStylingUrl": ["handleClientStylingUrlChange"],
605
655
  "receivedQueryResponses": ["handleQueryResponse"]
606
656
  }; }
607
657
  };
@@ -2,11 +2,11 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-316ef19a.js');
5
+ const index = require('./index-acdc077f.js');
6
6
  const appGlobals = require('./app-globals-3a1e7e63.js');
7
7
 
8
8
  /*
9
- Stencil Client Patch Browser v4.22.3 | MIT Licensed | https://stenciljs.com
9
+ Stencil Client Patch Browser v4.26.0 | MIT Licensed | https://stenciljs.com
10
10
  */
11
11
  var patchBrowser = () => {
12
12
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('user-action-controller.cjs.js', document.baseURI).href));
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy([["player-user-consents_2.cjs",[[1,"user-action-controller",{"endpoint":[513],"userSession":[513,"user-session"],"userId":[513,"user-id"],"lang":[1537],"includeSubmitButton":[516,"include-submit-button"],"gmVersion":[1,"gm-version"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"queryFired":[32],"readyActionsCount":[32],"activeUserActions":[32],"userActionsValidated":[32],"receivedQueryResponses":[32],"limitStylingAppends":[32],"isLoading":[32],"mandatoryActionsChecked":[32],"mandatoryItems":[32]},[[0,"userLegislationConsent","userLegislationConsentHandler"]],{"translationUrl":["handleNewTranslations"],"receivedQueryResponses":["handleQueryResponse"]}],[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"gmVersion":[1,"gm-version"],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"mbSource":[513,"mb-source"],"textContent":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStylingUrl":["handleStylingUrlChange"]}]]]], options);
22
+ return index.bootstrapLazy([["player-user-consents_2.cjs",[[1,"user-action-controller",{"endpoint":[513],"userSession":[513,"user-session"],"userId":[513,"user-id"],"lang":[1537],"includeSubmitButton":[516,"include-submit-button"],"gmVersion":[1,"gm-version"],"translationUrl":[513,"translation-url"],"clientStyling":[1537,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"mbSource":[513,"mb-source"],"queryFired":[32],"readyActionsCount":[32],"activeUserActions":[32],"userActionsValidated":[32],"receivedQueryResponses":[32],"isLoading":[32],"mandatoryActionsChecked":[32],"mandatoryItems":[32]},[[0,"userLegislationConsent","userLegislationConsentHandler"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"receivedQueryResponses":["handleQueryResponse"]}],[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"gmVersion":[1,"gm-version"],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"mbSource":[513,"mb-source"],"textContent":[32]},null,{"translationUrl":["handleNewTranslations"],"clientStylingUrl":["handleStylingUrlChange"]}]]]], options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -4,7 +4,7 @@
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "4.22.3",
7
+ "version": "4.26.0",
8
8
  "typescriptVersion": "5.5.4"
9
9
  },
10
10
  "collections": [
@@ -4,38 +4,60 @@ import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../.
4
4
  import "../../../../../player-user-consents/dist/types/index";
5
5
  export class UserActionController {
6
6
  constructor() {
7
- //for now this variable is hardcoded bcs we have terms and conditions and privacy policy mandatory and we dont receive with these new functionality the mandatory actions
8
- this.mandatoryActions = ['termsandconditions', 'privacypolicy'];
9
- this.userActions = [];
10
- this.consentTitles = {
11
- termsandconditions: translate('termsAndConditionsTitle', this.lang),
12
- sms: translate('smsTitle', this.lang),
13
- emailmarketing: translate('emailMarketingTitle', this.lang),
14
- privacypolicy: translate('privacyPolicyTitle', this.lang)
15
- };
16
- this.endpoint = undefined;
17
- this.userSession = undefined;
18
- this.userId = undefined;
7
+ /**
8
+ * Language
9
+ */
19
10
  this.lang = 'en';
20
- this.includeSubmitButton = undefined;
11
+ /**
12
+ * Select GM version
13
+ */
21
14
  this.gmVersion = '';
15
+ /**
16
+ * Translation url
17
+ */
22
18
  this.translationUrl = '';
19
+ /**
20
+ * Client custom styling via inline style
21
+ */
23
22
  this.clientStyling = '';
23
+ /**
24
+ * Client custom styling via url
25
+ */
24
26
  this.clientStylingUrl = '';
25
- this.mbSource = undefined;
27
+ /**
28
+ * Which actions are required in order to activate the "Apply" button. Other actions are considered optional.
29
+ */
26
30
  this.queryFired = false;
27
31
  this.readyActionsCount = 0;
28
32
  this.activeUserActions = [];
29
33
  this.userActionsValidated = true;
30
34
  this.receivedQueryResponses = 0;
31
- this.limitStylingAppends = false;
32
35
  this.isLoading = true;
33
36
  this.mandatoryActionsChecked = 0;
34
- this.mandatoryItems = undefined;
37
+ //for now this variable is hardcoded bcs we have terms and conditions and privacy policy mandatory and we dont receive with these new functionality the mandatory actions
38
+ this.mandatoryActions = ['termsandconditions', 'privacypolicy'];
39
+ this.userActions = [];
40
+ this.consentTitles = {
41
+ termsandconditions: translate('termsAndConditionsTitle', this.lang),
42
+ sms: translate('smsTitle', this.lang),
43
+ emailmarketing: translate('emailMarketingTitle', this.lang),
44
+ privacypolicy: translate('privacyPolicyTitle', this.lang)
45
+ };
35
46
  }
36
47
  handleNewTranslations() {
37
48
  getTranslations(this.translationUrl);
38
49
  }
50
+ handleClientStylingChange(newValue, oldValue) {
51
+ if (newValue != oldValue) {
52
+ setClientStyling(this.stylingContainer, this.clientStyling);
53
+ }
54
+ }
55
+ handleClientStylingUrlChange(newValue, oldValue) {
56
+ if (newValue != oldValue) {
57
+ if (this.clientStylingUrl)
58
+ setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
59
+ }
60
+ }
39
61
  handleQueryResponse() {
40
62
  if (this.receivedQueryResponses === this.activeUserActions.length) {
41
63
  this.updateUserConsents();
@@ -234,6 +256,8 @@ export class UserActionController {
234
256
  "tags": [],
235
257
  "text": "the endpoint required for the update call"
236
258
  },
259
+ "getter": false,
260
+ "setter": false,
237
261
  "attribute": "endpoint",
238
262
  "reflect": true
239
263
  },
@@ -251,6 +275,8 @@ export class UserActionController {
251
275
  "tags": [],
252
276
  "text": "user session required for the update call"
253
277
  },
278
+ "getter": false,
279
+ "setter": false,
254
280
  "attribute": "user-session",
255
281
  "reflect": true
256
282
  },
@@ -268,6 +294,8 @@ export class UserActionController {
268
294
  "tags": [],
269
295
  "text": "user id required for the update call"
270
296
  },
297
+ "getter": false,
298
+ "setter": false,
271
299
  "attribute": "user-id",
272
300
  "reflect": true
273
301
  },
@@ -285,6 +313,8 @@ export class UserActionController {
285
313
  "tags": [],
286
314
  "text": "Language"
287
315
  },
316
+ "getter": false,
317
+ "setter": false,
288
318
  "attribute": "lang",
289
319
  "reflect": true,
290
320
  "defaultValue": "'en'"
@@ -303,6 +333,8 @@ export class UserActionController {
303
333
  "tags": [],
304
334
  "text": "whether or not to include the submit button (in case we want to compose a different )"
305
335
  },
336
+ "getter": false,
337
+ "setter": false,
306
338
  "attribute": "include-submit-button",
307
339
  "reflect": true
308
340
  },
@@ -320,6 +352,8 @@ export class UserActionController {
320
352
  "tags": [],
321
353
  "text": "Select GM version"
322
354
  },
355
+ "getter": false,
356
+ "setter": false,
323
357
  "attribute": "gm-version",
324
358
  "reflect": false,
325
359
  "defaultValue": "''"
@@ -338,6 +372,8 @@ export class UserActionController {
338
372
  "tags": [],
339
373
  "text": "Translation url"
340
374
  },
375
+ "getter": false,
376
+ "setter": false,
341
377
  "attribute": "translation-url",
342
378
  "reflect": true,
343
379
  "defaultValue": "''"
@@ -356,6 +392,8 @@ export class UserActionController {
356
392
  "tags": [],
357
393
  "text": "Client custom styling via inline style"
358
394
  },
395
+ "getter": false,
396
+ "setter": false,
359
397
  "attribute": "client-styling",
360
398
  "reflect": true,
361
399
  "defaultValue": "''"
@@ -374,6 +412,8 @@ export class UserActionController {
374
412
  "tags": [],
375
413
  "text": "Client custom styling via url"
376
414
  },
415
+ "getter": false,
416
+ "setter": false,
377
417
  "attribute": "client-styling-url",
378
418
  "reflect": true,
379
419
  "defaultValue": "''"
@@ -392,6 +432,8 @@ export class UserActionController {
392
432
  "tags": [],
393
433
  "text": ""
394
434
  },
435
+ "getter": false,
436
+ "setter": false,
395
437
  "attribute": "mb-source",
396
438
  "reflect": true
397
439
  }
@@ -404,7 +446,6 @@ export class UserActionController {
404
446
  "activeUserActions": {},
405
447
  "userActionsValidated": {},
406
448
  "receivedQueryResponses": {},
407
- "limitStylingAppends": {},
408
449
  "isLoading": {},
409
450
  "mandatoryActionsChecked": {},
410
451
  "mandatoryItems": {}
@@ -414,6 +455,12 @@ export class UserActionController {
414
455
  return [{
415
456
  "propName": "translationUrl",
416
457
  "methodName": "handleNewTranslations"
458
+ }, {
459
+ "propName": "clientStyling",
460
+ "methodName": "handleClientStylingChange"
461
+ }, {
462
+ "propName": "clientStylingUrl",
463
+ "methodName": "handleClientStylingUrlChange"
417
464
  }, {
418
465
  "propName": "receivedQueryResponses",
419
466
  "methodName": "handleQueryResponse"