@everymatrix/player-user-consents 1.44.0 → 1.45.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 (47) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-69db8b9e.js +1229 -0
  3. package/dist/cjs/loader.cjs.js +7 -13
  4. package/dist/cjs/player-user-consents.cjs.entry.js +177 -203
  5. package/dist/cjs/player-user-consents.cjs.js +17 -11
  6. package/dist/collection/collection-manifest.json +3 -3
  7. package/dist/collection/components/player-user-consents/index.js +1 -0
  8. package/dist/collection/components/player-user-consents/player-user-consents.js +250 -280
  9. package/dist/collection/utils/locale.utils.js +110 -110
  10. package/dist/esm/app-globals-0f993ce5.js +3 -0
  11. package/dist/esm/index-cea90c73.js +1202 -0
  12. package/dist/esm/loader.js +7 -13
  13. package/dist/esm/player-user-consents.entry.js +177 -203
  14. package/dist/esm/player-user-consents.js +14 -11
  15. package/dist/player-user-consents/p-1e483854.js +2 -0
  16. package/dist/player-user-consents/{p-f88e76d0.entry.js → p-c5bf5548.entry.js} +1 -1
  17. package/dist/player-user-consents/p-e1255160.js +1 -0
  18. package/dist/player-user-consents/player-user-consents.esm.js +1 -1
  19. package/dist/stencil.config.dev.js +17 -0
  20. package/dist/stencil.config.js +14 -19
  21. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/player-user-consents/.stencil/packages/stencil/player-user-consents/stencil.config.d.ts +2 -0
  22. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/player-user-consents/.stencil/packages/stencil/player-user-consents/stencil.config.dev.d.ts +2 -0
  23. package/dist/types/components/player-user-consents/index.d.ts +1 -0
  24. package/dist/types/components/player-user-consents/player-user-consents.d.ts +49 -49
  25. package/dist/types/components.d.ts +16 -1
  26. package/dist/types/stencil-public-runtime.d.ts +142 -33
  27. package/loader/cdn.js +1 -3
  28. package/loader/index.cjs.js +1 -3
  29. package/loader/index.d.ts +13 -1
  30. package/loader/index.es2017.js +1 -3
  31. package/loader/index.js +1 -3
  32. package/loader/package.json +1 -0
  33. package/package.json +8 -1
  34. package/dist/cjs/index-e77a2edf.js +0 -1215
  35. package/dist/components/index.d.ts +0 -26
  36. package/dist/components/index.js +0 -1
  37. package/dist/components/player-user-consents.d.ts +0 -11
  38. package/dist/components/player-user-consents.js +0 -260
  39. package/dist/esm/index-b34076ff.js +0 -1189
  40. package/dist/esm/polyfills/core-js.js +0 -11
  41. package/dist/esm/polyfills/css-shim.js +0 -1
  42. package/dist/esm/polyfills/dom.js +0 -79
  43. package/dist/esm/polyfills/es5-html-element.js +0 -1
  44. package/dist/esm/polyfills/index.js +0 -34
  45. package/dist/esm/polyfills/system.js +0 -6
  46. package/dist/player-user-consents/p-b1139724.js +0 -1
  47. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/player-user-consents/.stencil/packages/player-user-consents/stencil.config.d.ts +0 -2
@@ -1,288 +1,258 @@
1
- import { Component, h, Event, Prop, State, Watch } from '@stencil/core';
2
- import { getTranslations, translate } from '../../utils/locale.utils';
1
+ import { h } from "@stencil/core";
2
+ import { getTranslations, translate } from "../../utils/locale.utils";
3
3
  export class PlayerUserConsents {
4
- constructor() {
5
- /**
6
- * Language
7
- */
8
- this.lang = 'en';
9
- /**
10
- * 'true' when parent expects component to emit it's current value
11
- */
12
- this.queried = false;
13
- /**
14
- * the type of the consent, used to determine render details
15
- */
16
- this.consentType = '';
17
- /**
18
- * wether or not this consent is mandatory. Used for render details
19
- */
20
- this.mandatory = false;
21
- /**
22
- * Select GM version
23
- */
24
- this.gmVersion = '';
25
- /**
26
- * the title of the consent to be displayed
27
- */
28
- this.consentTitle = '';
29
- /**
30
- * Client custom styling via inline style
31
- */
32
- this.clientStyling = '';
33
- /**
34
- * Translation url
35
- */
36
- this.translationUrl = '';
37
- /**
38
- * the text content to be rendered by the component. Determined at runtime
39
- */
40
- this.textContent = '';
41
- this.limitStylingAppends = false;
42
- this.goToTermsAndConditions = () => window.postMessage({ type: 'GoToTermsAndConditions' });
43
- this.goToPrivacyPolicy = () => window.postMessage({ type: 'GoToPrivacyPolicy' });
44
- this.setClientStyling = () => {
45
- let sheet = document.createElement('style');
46
- sheet.innerHTML = this.clientStyling;
47
- this.stylingContainer.prepend(sheet);
48
- };
49
- }
50
- handleNewTranslations() {
51
- getTranslations(this.translationUrl);
52
- }
53
- async componentWillLoad() {
54
- if (this.translationUrl.length > 2) {
55
- await getTranslations(this.translationUrl);
4
+ constructor() {
5
+ this.goToTermsAndConditions = () => window.postMessage({ type: 'GoToTermsAndConditions' });
6
+ this.goToPrivacyPolicy = () => window.postMessage({ type: 'GoToPrivacyPolicy' });
7
+ this.setClientStyling = () => {
8
+ let sheet = document.createElement('style');
9
+ sheet.innerHTML = this.clientStyling;
10
+ this.stylingContainer.prepend(sheet);
11
+ };
12
+ this.lang = 'en';
13
+ this.queried = false;
14
+ this.consentType = '';
15
+ this.mandatory = false;
16
+ this.gmVersion = '';
17
+ this.consentTitle = '';
18
+ this.clientStyling = '';
19
+ this.translationUrl = '';
20
+ this.textContent = '';
21
+ this.limitStylingAppends = false;
56
22
  }
57
- }
58
- userLegislationConsentHandler() {
59
- this.userLegislationConsent.emit({
60
- type: this.consentType,
61
- value: this.checkboxInput.checked
62
- });
63
- }
64
- componentDidRender() {
65
- // start custom styling area
66
- if (!this.limitStylingAppends && this.stylingContainer) {
67
- if (this.clientStyling)
68
- this.setClientStyling();
69
- this.limitStylingAppends = true;
23
+ handleNewTranslations() {
24
+ getTranslations(this.translationUrl);
70
25
  }
71
- // end custom styling area
72
- }
73
- determineTextContent() {
74
- if (this.gmVersion === 'gmcore') {
75
- if (this.consentType === 'termsandconditions') {
76
- return h("p", null,
77
- translate('termsAndConditions.acceptPart1', this.lang),
78
- h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tcLink', this.lang)),
79
- translate('termsAndConditions.acceptPart2', this.lang),
80
- h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.privacyLink', this.lang)),
81
- translate('termsAndConditions.acceptPart3', this.lang));
82
- }
26
+ async componentWillLoad() {
27
+ if (this.translationUrl.length > 2) {
28
+ await getTranslations(this.translationUrl);
29
+ }
83
30
  }
84
- if (this.gmVersion === 'gm16') {
85
- if (this.consentType === 'termsandconditions') {
86
- return h("p", null,
87
- translate('termsAndConditions.acceptPart1', this.lang),
88
- h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tcLink', this.lang)));
89
- }
90
- if (this.consentType === 'privacypolicy') {
91
- return h("p", null,
92
- translate('privacyPolicy.readUnderstandPart1', this.lang),
93
- h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.privacyLink', this.lang)),
94
- translate('privacyPolicy.readUnderstandPart2', this.lang));
95
- }
31
+ userLegislationConsentHandler() {
32
+ this.userLegislationConsent.emit({
33
+ type: this.consentType,
34
+ value: this.checkboxInput.checked
35
+ });
96
36
  }
97
- return h("p", null, translate(this.consentType, this.lang));
98
- }
99
- render() {
100
- if (this.queried) {
101
- this.userLegislationConsentHandler();
37
+ componentDidRender() {
38
+ // start custom styling area
39
+ if (!this.limitStylingAppends && this.stylingContainer) {
40
+ if (this.clientStyling)
41
+ this.setClientStyling();
42
+ this.limitStylingAppends = true;
43
+ }
44
+ // end custom styling area
102
45
  }
103
- return (h("div", { ref: el => this.stylingContainer = el },
104
- h("p", { class: "ConsentTitle" }, this.consentTitle),
105
- h("label", { class: "UserConsent", htmlFor: "userConsent" },
106
- h("input", { ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }),
107
- this.determineTextContent(),
108
- this.mandatory && h("span", { class: "MandatoryItem" }, "*"))));
109
- }
110
- static get is() { return "player-user-consents"; }
111
- static get encapsulation() { return "shadow"; }
112
- static get originalStyleUrls() { return {
113
- "$": ["player-user-consents.scss"]
114
- }; }
115
- static get styleUrls() { return {
116
- "$": ["player-user-consents.css"]
117
- }; }
118
- static get properties() { return {
119
- "lang": {
120
- "type": "string",
121
- "mutable": true,
122
- "complexType": {
123
- "original": "string",
124
- "resolved": "string",
125
- "references": {}
126
- },
127
- "required": false,
128
- "optional": false,
129
- "docs": {
130
- "tags": [],
131
- "text": "Language"
132
- },
133
- "attribute": "lang",
134
- "reflect": true,
135
- "defaultValue": "'en'"
136
- },
137
- "queried": {
138
- "type": "boolean",
139
- "mutable": false,
140
- "complexType": {
141
- "original": "boolean",
142
- "resolved": "boolean",
143
- "references": {}
144
- },
145
- "required": false,
146
- "optional": false,
147
- "docs": {
148
- "tags": [],
149
- "text": "'true' when parent expects component to emit it's current value"
150
- },
151
- "attribute": "queried",
152
- "reflect": true,
153
- "defaultValue": "false"
154
- },
155
- "consentType": {
156
- "type": "string",
157
- "mutable": false,
158
- "complexType": {
159
- "original": "string",
160
- "resolved": "string",
161
- "references": {}
162
- },
163
- "required": false,
164
- "optional": false,
165
- "docs": {
166
- "tags": [],
167
- "text": "the type of the consent, used to determine render details"
168
- },
169
- "attribute": "consent-type",
170
- "reflect": true,
171
- "defaultValue": "''"
172
- },
173
- "mandatory": {
174
- "type": "boolean",
175
- "mutable": false,
176
- "complexType": {
177
- "original": "boolean",
178
- "resolved": "boolean",
179
- "references": {}
180
- },
181
- "required": false,
182
- "optional": false,
183
- "docs": {
184
- "tags": [],
185
- "text": "wether or not this consent is mandatory. Used for render details"
186
- },
187
- "attribute": "mandatory",
188
- "reflect": true,
189
- "defaultValue": "false"
190
- },
191
- "gmVersion": {
192
- "type": "string",
193
- "mutable": false,
194
- "complexType": {
195
- "original": "string",
196
- "resolved": "string",
197
- "references": {}
198
- },
199
- "required": false,
200
- "optional": false,
201
- "docs": {
202
- "tags": [],
203
- "text": "Select GM version"
204
- },
205
- "attribute": "gm-version",
206
- "reflect": false,
207
- "defaultValue": "''"
208
- },
209
- "consentTitle": {
210
- "type": "string",
211
- "mutable": false,
212
- "complexType": {
213
- "original": "string",
214
- "resolved": "string",
215
- "references": {}
216
- },
217
- "required": false,
218
- "optional": false,
219
- "docs": {
220
- "tags": [],
221
- "text": "the title of the consent to be displayed"
222
- },
223
- "attribute": "consent-title",
224
- "reflect": true,
225
- "defaultValue": "''"
226
- },
227
- "clientStyling": {
228
- "type": "string",
229
- "mutable": false,
230
- "complexType": {
231
- "original": "string",
232
- "resolved": "string",
233
- "references": {}
234
- },
235
- "required": false,
236
- "optional": false,
237
- "docs": {
238
- "tags": [],
239
- "text": "Client custom styling via inline style"
240
- },
241
- "attribute": "client-styling",
242
- "reflect": false,
243
- "defaultValue": "''"
244
- },
245
- "translationUrl": {
246
- "type": "string",
247
- "mutable": false,
248
- "complexType": {
249
- "original": "string",
250
- "resolved": "string",
251
- "references": {}
252
- },
253
- "required": false,
254
- "optional": false,
255
- "docs": {
256
- "tags": [],
257
- "text": "Translation url"
258
- },
259
- "attribute": "translation-url",
260
- "reflect": true,
261
- "defaultValue": "''"
46
+ determineTextContent() {
47
+ if (this.gmVersion === 'gmcore') {
48
+ if (this.consentType === 'termsandconditions') {
49
+ return h("p", null, translate('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tcLink', this.lang)), translate('termsAndConditions.acceptPart2', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.privacyLink', this.lang)), translate('termsAndConditions.acceptPart3', this.lang));
50
+ }
51
+ }
52
+ if (this.gmVersion === 'gm16') {
53
+ if (this.consentType === 'termsandconditions') {
54
+ return h("p", null, translate('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tcLink', this.lang)));
55
+ }
56
+ if (this.consentType === 'privacypolicy') {
57
+ return h("p", null, translate('privacyPolicy.readUnderstandPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacyPolicy.privacyLink', this.lang)), translate('privacyPolicy.readUnderstandPart2', this.lang));
58
+ }
59
+ }
60
+ return h("p", null, translate(this.consentType, this.lang));
61
+ }
62
+ render() {
63
+ if (this.queried) {
64
+ this.userLegislationConsentHandler();
65
+ }
66
+ return (h("div", { key: 'e3c5e7d280de637fd8297dd59c170479d6142372', ref: el => this.stylingContainer = el }, h("p", { key: '8d103ef2eda5fd078a46a7d818eadd07dade5277', class: "ConsentTitle" }, this.consentTitle), h("label", { key: '6a333af5b8585e609285f9f172bf8ddb3b0d4b4b', class: "UserConsent", htmlFor: "userConsent" }, h("input", { key: 'c003a2ef7219e4c5442730432dffcaef4a16b947', ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }), this.determineTextContent(), this.mandatory && h("span", { key: '0bc4b24a85b76763af5e691f126e8ee8ae90e447', class: "MandatoryItem" }, "*"))));
67
+ }
68
+ static get is() { return "player-user-consents"; }
69
+ static get encapsulation() { return "shadow"; }
70
+ static get originalStyleUrls() {
71
+ return {
72
+ "$": ["player-user-consents.scss"]
73
+ };
74
+ }
75
+ static get styleUrls() {
76
+ return {
77
+ "$": ["player-user-consents.css"]
78
+ };
79
+ }
80
+ static get properties() {
81
+ return {
82
+ "lang": {
83
+ "type": "string",
84
+ "mutable": true,
85
+ "complexType": {
86
+ "original": "string",
87
+ "resolved": "string",
88
+ "references": {}
89
+ },
90
+ "required": false,
91
+ "optional": false,
92
+ "docs": {
93
+ "tags": [],
94
+ "text": "Language"
95
+ },
96
+ "attribute": "lang",
97
+ "reflect": true,
98
+ "defaultValue": "'en'"
99
+ },
100
+ "queried": {
101
+ "type": "boolean",
102
+ "mutable": false,
103
+ "complexType": {
104
+ "original": "boolean",
105
+ "resolved": "boolean",
106
+ "references": {}
107
+ },
108
+ "required": false,
109
+ "optional": false,
110
+ "docs": {
111
+ "tags": [],
112
+ "text": "'true' when parent expects component to emit it's current value"
113
+ },
114
+ "attribute": "queried",
115
+ "reflect": true,
116
+ "defaultValue": "false"
117
+ },
118
+ "consentType": {
119
+ "type": "string",
120
+ "mutable": false,
121
+ "complexType": {
122
+ "original": "string",
123
+ "resolved": "string",
124
+ "references": {}
125
+ },
126
+ "required": false,
127
+ "optional": false,
128
+ "docs": {
129
+ "tags": [],
130
+ "text": "the type of the consent, used to determine render details"
131
+ },
132
+ "attribute": "consent-type",
133
+ "reflect": true,
134
+ "defaultValue": "''"
135
+ },
136
+ "mandatory": {
137
+ "type": "boolean",
138
+ "mutable": false,
139
+ "complexType": {
140
+ "original": "boolean",
141
+ "resolved": "boolean",
142
+ "references": {}
143
+ },
144
+ "required": false,
145
+ "optional": false,
146
+ "docs": {
147
+ "tags": [],
148
+ "text": "wether or not this consent is mandatory. Used for render details"
149
+ },
150
+ "attribute": "mandatory",
151
+ "reflect": true,
152
+ "defaultValue": "false"
153
+ },
154
+ "gmVersion": {
155
+ "type": "string",
156
+ "mutable": false,
157
+ "complexType": {
158
+ "original": "string",
159
+ "resolved": "string",
160
+ "references": {}
161
+ },
162
+ "required": false,
163
+ "optional": false,
164
+ "docs": {
165
+ "tags": [],
166
+ "text": "Select GM version"
167
+ },
168
+ "attribute": "gm-version",
169
+ "reflect": false,
170
+ "defaultValue": "''"
171
+ },
172
+ "consentTitle": {
173
+ "type": "string",
174
+ "mutable": false,
175
+ "complexType": {
176
+ "original": "string",
177
+ "resolved": "string",
178
+ "references": {}
179
+ },
180
+ "required": false,
181
+ "optional": false,
182
+ "docs": {
183
+ "tags": [],
184
+ "text": "the title of the consent to be displayed"
185
+ },
186
+ "attribute": "consent-title",
187
+ "reflect": true,
188
+ "defaultValue": "''"
189
+ },
190
+ "clientStyling": {
191
+ "type": "string",
192
+ "mutable": false,
193
+ "complexType": {
194
+ "original": "string",
195
+ "resolved": "string",
196
+ "references": {}
197
+ },
198
+ "required": false,
199
+ "optional": false,
200
+ "docs": {
201
+ "tags": [],
202
+ "text": "Client custom styling via inline style"
203
+ },
204
+ "attribute": "client-styling",
205
+ "reflect": false,
206
+ "defaultValue": "''"
207
+ },
208
+ "translationUrl": {
209
+ "type": "string",
210
+ "mutable": false,
211
+ "complexType": {
212
+ "original": "string",
213
+ "resolved": "string",
214
+ "references": {}
215
+ },
216
+ "required": false,
217
+ "optional": false,
218
+ "docs": {
219
+ "tags": [],
220
+ "text": "Translation url"
221
+ },
222
+ "attribute": "translation-url",
223
+ "reflect": true,
224
+ "defaultValue": "''"
225
+ }
226
+ };
227
+ }
228
+ static get states() {
229
+ return {
230
+ "textContent": {},
231
+ "limitStylingAppends": {}
232
+ };
233
+ }
234
+ static get events() {
235
+ return [{
236
+ "method": "userLegislationConsent",
237
+ "name": "userLegislationConsent",
238
+ "bubbles": true,
239
+ "cancelable": true,
240
+ "composed": true,
241
+ "docs": {
242
+ "tags": [],
243
+ "text": ""
244
+ },
245
+ "complexType": {
246
+ "original": "object",
247
+ "resolved": "object",
248
+ "references": {}
249
+ }
250
+ }];
251
+ }
252
+ static get watchers() {
253
+ return [{
254
+ "propName": "translationUrl",
255
+ "methodName": "handleNewTranslations"
256
+ }];
262
257
  }
263
- }; }
264
- static get states() { return {
265
- "textContent": {},
266
- "limitStylingAppends": {}
267
- }; }
268
- static get events() { return [{
269
- "method": "userLegislationConsent",
270
- "name": "userLegislationConsent",
271
- "bubbles": true,
272
- "cancelable": true,
273
- "composed": true,
274
- "docs": {
275
- "tags": [],
276
- "text": ""
277
- },
278
- "complexType": {
279
- "original": "object",
280
- "resolved": "object",
281
- "references": {}
282
- }
283
- }]; }
284
- static get watchers() { return [{
285
- "propName": "translationUrl",
286
- "methodName": "handleNewTranslations"
287
- }]; }
288
258
  }