@everymatrix/player-user-consents 1.32.4 → 1.33.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/dist/cjs/index-e77a2edf.js +1215 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/player-user-consents.cjs.entry.js +178 -0
- package/dist/cjs/player-user-consents.cjs.js +19 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/player-user-consents/player-user-consents.css +28 -0
- package/dist/collection/components/player-user-consents/player-user-consents.js +250 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/utils.js +83 -0
- package/dist/components/index.d.ts +26 -0
- package/dist/components/index.js +1 -0
- package/dist/components/player-user-consents.d.ts +11 -0
- package/dist/components/player-user-consents.js +202 -0
- package/dist/esm/index-b34076ff.js +1189 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/player-user-consents.entry.js +174 -0
- package/dist/esm/player-user-consents.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/player-user-consents/index.esm.js +0 -0
- package/dist/player-user-consents/p-6a20deb9.entry.js +1 -0
- package/dist/player-user-consents/p-b1139724.js +1 -0
- package/dist/player-user-consents/player-user-consents.esm.js +1 -0
- package/dist/stencil.config.js +22 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/player-user-consents/.stencil/packages/player-user-consents/stencil.config.d.ts +2 -0
- package/dist/types/components/player-user-consents/player-user-consents.d.ts +48 -0
- package/dist/types/components.d.ts +94 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/utils.d.ts +2 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +2 -3
- package/LICENSE +0 -21
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e77a2edf.js');
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
9
|
+
*/
|
|
10
|
+
const patchEsm = () => {
|
|
11
|
+
return index.promiseResolve();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const defineCustomElements = (win, options) => {
|
|
15
|
+
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
|
+
return patchEsm().then(() => {
|
|
17
|
+
return index.bootstrapLazy([["player-user-consents.cjs",[[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"translationUrl":[513,"translation-url"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.defineCustomElements = defineCustomElements;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-e77a2edf.js');
|
|
6
|
+
|
|
7
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
8
|
+
const TRANSLATIONS = {
|
|
9
|
+
en: {
|
|
10
|
+
termsandconditions1: "I accept the ",
|
|
11
|
+
termsandconditions2: ", I have read and understood the ",
|
|
12
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
13
|
+
tc: "Terms and Conditions",
|
|
14
|
+
privacy: "Privacy Policy",
|
|
15
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
16
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
17
|
+
},
|
|
18
|
+
ro: {
|
|
19
|
+
termsandconditions1: "I accept the ",
|
|
20
|
+
termsandconditions2: ", I have read and understood the ",
|
|
21
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
22
|
+
tc: "Terms and Conditions",
|
|
23
|
+
privacy: "Privacy Policy",
|
|
24
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
25
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
26
|
+
},
|
|
27
|
+
hr: {
|
|
28
|
+
termsandconditions1: "I accept the ",
|
|
29
|
+
termsandconditions2: ", I have read and understood the ",
|
|
30
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
31
|
+
tc: "Terms and Conditions",
|
|
32
|
+
privacy: "Privacy Policy",
|
|
33
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
34
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
35
|
+
},
|
|
36
|
+
fr: {
|
|
37
|
+
termsandconditions1: "I accept the ",
|
|
38
|
+
termsandconditions2: ", I have read and understood the ",
|
|
39
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
40
|
+
tc: "Terms and Conditions",
|
|
41
|
+
privacy: "Privacy Policy",
|
|
42
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
43
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
44
|
+
},
|
|
45
|
+
cs: {
|
|
46
|
+
termsandconditions1: "I accept the ",
|
|
47
|
+
termsandconditions2: ", I have read and understood the ",
|
|
48
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
49
|
+
tc: "Terms and Conditions",
|
|
50
|
+
privacy: "Privacy Policy",
|
|
51
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
52
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
53
|
+
},
|
|
54
|
+
de: {
|
|
55
|
+
termsandconditions1: "I accept the ",
|
|
56
|
+
termsandconditions2: ", I have read and understood the ",
|
|
57
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
58
|
+
tc: "Terms and Conditions",
|
|
59
|
+
privacy: "Privacy Policy",
|
|
60
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
61
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
const getTranslations = (url) => {
|
|
65
|
+
// fetch url, get the data, replace the TRANSLATIONS content
|
|
66
|
+
return new Promise((resolve) => {
|
|
67
|
+
fetch(url)
|
|
68
|
+
.then((res) => res.json())
|
|
69
|
+
.then((data) => {
|
|
70
|
+
Object.keys(data).forEach((item) => {
|
|
71
|
+
for (let key in data[item]) {
|
|
72
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
resolve(true);
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
const translate = (key, customLang, values) => {
|
|
80
|
+
const lang = customLang;
|
|
81
|
+
let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
|
|
82
|
+
if (values !== undefined) {
|
|
83
|
+
for (const [key, value] of Object.entries(values.values)) {
|
|
84
|
+
const regex = new RegExp(`{${key}}`, 'g');
|
|
85
|
+
translation = translation.replace(regex, value);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return translation;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const playerUserConsentsCss = ":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.UserConsent:hover{cursor:pointer}.UserConsent{display:flex;align-items:baseline}.MandatoryItem{color:#f00;font-size:1.2rem}.ConsentLink{text-decoration:underline;color:var(--emfe-w-color-primary);font-weight:bold}";
|
|
92
|
+
|
|
93
|
+
const PlayerUserConsents = class {
|
|
94
|
+
constructor(hostRef) {
|
|
95
|
+
index.registerInstance(this, hostRef);
|
|
96
|
+
this.userLegislationConsent = index.createEvent(this, "userLegislationConsent", 7);
|
|
97
|
+
/**
|
|
98
|
+
* Language
|
|
99
|
+
*/
|
|
100
|
+
this.lang = 'en';
|
|
101
|
+
/**
|
|
102
|
+
* 'true' when parent expects component to emit it's current value
|
|
103
|
+
*/
|
|
104
|
+
this.queried = false;
|
|
105
|
+
/**
|
|
106
|
+
* the type of the consent, used to determine render details
|
|
107
|
+
*/
|
|
108
|
+
this.consentType = '';
|
|
109
|
+
/**
|
|
110
|
+
* wether or not this consent is mandatory. Used for render details
|
|
111
|
+
*/
|
|
112
|
+
this.mandatory = false;
|
|
113
|
+
/**
|
|
114
|
+
* the title of the consent to be displayed
|
|
115
|
+
*/
|
|
116
|
+
this.consentTitle = '';
|
|
117
|
+
/**
|
|
118
|
+
* Client custom styling via inline style
|
|
119
|
+
*/
|
|
120
|
+
this.clientStyling = '';
|
|
121
|
+
/**
|
|
122
|
+
* Translation url
|
|
123
|
+
*/
|
|
124
|
+
this.translationUrl = '';
|
|
125
|
+
/**
|
|
126
|
+
* the text content to be rendered by the component. Determined at runtime
|
|
127
|
+
*/
|
|
128
|
+
this.textContent = '';
|
|
129
|
+
this.limitStylingAppends = false;
|
|
130
|
+
this.goToTermsAndConditions = () => window.postMessage({ type: 'GoToTermsAndConditions' });
|
|
131
|
+
this.goToPrivacyPolicy = () => window.postMessage({ type: 'GoToPrivacyPolicy' });
|
|
132
|
+
this.setClientStyling = () => {
|
|
133
|
+
let sheet = document.createElement('style');
|
|
134
|
+
sheet.innerHTML = this.clientStyling;
|
|
135
|
+
this.stylingContainer.prepend(sheet);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
handleNewTranslations() {
|
|
139
|
+
getTranslations(this.translationUrl);
|
|
140
|
+
}
|
|
141
|
+
async componentWillLoad() {
|
|
142
|
+
if (this.translationUrl.length > 2) {
|
|
143
|
+
await getTranslations(this.translationUrl);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
userLegislationConsentHandler() {
|
|
147
|
+
this.userLegislationConsent.emit({
|
|
148
|
+
type: this.consentType,
|
|
149
|
+
value: this.checkboxInput.checked
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
componentDidRender() {
|
|
153
|
+
// start custom styling area
|
|
154
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
155
|
+
if (this.clientStyling)
|
|
156
|
+
this.setClientStyling();
|
|
157
|
+
this.limitStylingAppends = true;
|
|
158
|
+
}
|
|
159
|
+
// end custom styling area
|
|
160
|
+
}
|
|
161
|
+
determineTextContent() {
|
|
162
|
+
return this.consentType === 'termsandconditions' ?
|
|
163
|
+
index.h("p", null, translate('termsandconditions1', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('tc', this.lang)), translate('termsandconditions2', this.lang), index.h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacy', this.lang)), translate('termsandconditions3', this.lang))
|
|
164
|
+
: index.h("p", null, translate('consentType', this.lang));
|
|
165
|
+
}
|
|
166
|
+
render() {
|
|
167
|
+
if (this.queried) {
|
|
168
|
+
this.userLegislationConsentHandler();
|
|
169
|
+
}
|
|
170
|
+
return (index.h("div", { ref: el => this.stylingContainer = el }, index.h("p", { class: "ConsentTitle" }, this.consentTitle), index.h("label", { class: "UserConsent", htmlFor: "userConsent" }, index.h("input", { ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }), this.determineTextContent(), this.mandatory && index.h("span", { class: "MandatoryItem" }, "*"))));
|
|
171
|
+
}
|
|
172
|
+
static get watchers() { return {
|
|
173
|
+
"translationUrl": ["handleNewTranslations"]
|
|
174
|
+
}; }
|
|
175
|
+
};
|
|
176
|
+
PlayerUserConsents.style = playerUserConsentsCss;
|
|
177
|
+
|
|
178
|
+
exports.player_user_consents = PlayerUserConsents;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index-e77a2edf.js');
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
7
|
+
*/
|
|
8
|
+
const patchBrowser = () => {
|
|
9
|
+
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('player-user-consents.cjs.js', document.baseURI).href));
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== '') {
|
|
12
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return index.promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(options => {
|
|
18
|
+
return index.bootstrapLazy([["player-user-consents.cjs",[[1,"player-user-consents",{"lang":[1537],"queried":[516],"consentType":[513,"consent-type"],"mandatory":[516],"consentTitle":[513,"consent-title"],"clientStyling":[1,"client-styling"],"translationUrl":[513,"translation-url"],"textContent":[32],"limitStylingAppends":[32]}]]]], options);
|
|
19
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.ConsentTitle {
|
|
6
|
+
margin-bottom: 0.2rem;
|
|
7
|
+
font-weight: 600;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.UserConsent:hover {
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.UserConsent {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: baseline;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.MandatoryItem {
|
|
20
|
+
color: #f00;
|
|
21
|
+
font-size: 1.2rem;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ConsentLink {
|
|
25
|
+
text-decoration: underline;
|
|
26
|
+
color: var(--emfe-w-color-primary);
|
|
27
|
+
font-weight: bold;
|
|
28
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { Component, h, Event, Prop, State, Watch } from '@stencil/core';
|
|
2
|
+
import { getTranslations, translate } from '../../utils/utils';
|
|
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
|
+
* the title of the consent to be displayed
|
|
23
|
+
*/
|
|
24
|
+
this.consentTitle = '';
|
|
25
|
+
/**
|
|
26
|
+
* Client custom styling via inline style
|
|
27
|
+
*/
|
|
28
|
+
this.clientStyling = '';
|
|
29
|
+
/**
|
|
30
|
+
* Translation url
|
|
31
|
+
*/
|
|
32
|
+
this.translationUrl = '';
|
|
33
|
+
/**
|
|
34
|
+
* the text content to be rendered by the component. Determined at runtime
|
|
35
|
+
*/
|
|
36
|
+
this.textContent = '';
|
|
37
|
+
this.limitStylingAppends = false;
|
|
38
|
+
this.goToTermsAndConditions = () => window.postMessage({ type: 'GoToTermsAndConditions' });
|
|
39
|
+
this.goToPrivacyPolicy = () => window.postMessage({ type: 'GoToPrivacyPolicy' });
|
|
40
|
+
this.setClientStyling = () => {
|
|
41
|
+
let sheet = document.createElement('style');
|
|
42
|
+
sheet.innerHTML = this.clientStyling;
|
|
43
|
+
this.stylingContainer.prepend(sheet);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
handleNewTranslations() {
|
|
47
|
+
getTranslations(this.translationUrl);
|
|
48
|
+
}
|
|
49
|
+
async componentWillLoad() {
|
|
50
|
+
if (this.translationUrl.length > 2) {
|
|
51
|
+
await getTranslations(this.translationUrl);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
userLegislationConsentHandler() {
|
|
55
|
+
this.userLegislationConsent.emit({
|
|
56
|
+
type: this.consentType,
|
|
57
|
+
value: this.checkboxInput.checked
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
componentDidRender() {
|
|
61
|
+
// start custom styling area
|
|
62
|
+
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
63
|
+
if (this.clientStyling)
|
|
64
|
+
this.setClientStyling();
|
|
65
|
+
this.limitStylingAppends = true;
|
|
66
|
+
}
|
|
67
|
+
// end custom styling area
|
|
68
|
+
}
|
|
69
|
+
determineTextContent() {
|
|
70
|
+
return this.consentType === 'termsandconditions' ?
|
|
71
|
+
h("p", null,
|
|
72
|
+
translate('termsandconditions1', this.lang),
|
|
73
|
+
h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('tc', this.lang)),
|
|
74
|
+
translate('termsandconditions2', this.lang),
|
|
75
|
+
h("span", { class: "ConsentLink", onClick: this.goToPrivacyPolicy }, translate('privacy', this.lang)),
|
|
76
|
+
translate('termsandconditions3', this.lang))
|
|
77
|
+
: h("p", null, translate('consentType', this.lang));
|
|
78
|
+
}
|
|
79
|
+
render() {
|
|
80
|
+
if (this.queried) {
|
|
81
|
+
this.userLegislationConsentHandler();
|
|
82
|
+
}
|
|
83
|
+
return (h("div", { ref: el => this.stylingContainer = el },
|
|
84
|
+
h("p", { class: "ConsentTitle" }, this.consentTitle),
|
|
85
|
+
h("label", { class: "UserConsent", htmlFor: "userConsent" },
|
|
86
|
+
h("input", { ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }),
|
|
87
|
+
this.determineTextContent(),
|
|
88
|
+
this.mandatory && h("span", { class: "MandatoryItem" }, "*"))));
|
|
89
|
+
}
|
|
90
|
+
static get is() { return "player-user-consents"; }
|
|
91
|
+
static get encapsulation() { return "shadow"; }
|
|
92
|
+
static get originalStyleUrls() { return {
|
|
93
|
+
"$": ["player-user-consents.scss"]
|
|
94
|
+
}; }
|
|
95
|
+
static get styleUrls() { return {
|
|
96
|
+
"$": ["player-user-consents.css"]
|
|
97
|
+
}; }
|
|
98
|
+
static get properties() { return {
|
|
99
|
+
"lang": {
|
|
100
|
+
"type": "string",
|
|
101
|
+
"mutable": true,
|
|
102
|
+
"complexType": {
|
|
103
|
+
"original": "string",
|
|
104
|
+
"resolved": "string",
|
|
105
|
+
"references": {}
|
|
106
|
+
},
|
|
107
|
+
"required": false,
|
|
108
|
+
"optional": false,
|
|
109
|
+
"docs": {
|
|
110
|
+
"tags": [],
|
|
111
|
+
"text": "Language"
|
|
112
|
+
},
|
|
113
|
+
"attribute": "lang",
|
|
114
|
+
"reflect": true,
|
|
115
|
+
"defaultValue": "'en'"
|
|
116
|
+
},
|
|
117
|
+
"queried": {
|
|
118
|
+
"type": "boolean",
|
|
119
|
+
"mutable": false,
|
|
120
|
+
"complexType": {
|
|
121
|
+
"original": "boolean",
|
|
122
|
+
"resolved": "boolean",
|
|
123
|
+
"references": {}
|
|
124
|
+
},
|
|
125
|
+
"required": false,
|
|
126
|
+
"optional": false,
|
|
127
|
+
"docs": {
|
|
128
|
+
"tags": [],
|
|
129
|
+
"text": "'true' when parent expects component to emit it's current value"
|
|
130
|
+
},
|
|
131
|
+
"attribute": "queried",
|
|
132
|
+
"reflect": true,
|
|
133
|
+
"defaultValue": "false"
|
|
134
|
+
},
|
|
135
|
+
"consentType": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"mutable": false,
|
|
138
|
+
"complexType": {
|
|
139
|
+
"original": "string",
|
|
140
|
+
"resolved": "string",
|
|
141
|
+
"references": {}
|
|
142
|
+
},
|
|
143
|
+
"required": false,
|
|
144
|
+
"optional": false,
|
|
145
|
+
"docs": {
|
|
146
|
+
"tags": [],
|
|
147
|
+
"text": "the type of the consent, used to determine render details"
|
|
148
|
+
},
|
|
149
|
+
"attribute": "consent-type",
|
|
150
|
+
"reflect": true,
|
|
151
|
+
"defaultValue": "''"
|
|
152
|
+
},
|
|
153
|
+
"mandatory": {
|
|
154
|
+
"type": "boolean",
|
|
155
|
+
"mutable": false,
|
|
156
|
+
"complexType": {
|
|
157
|
+
"original": "boolean",
|
|
158
|
+
"resolved": "boolean",
|
|
159
|
+
"references": {}
|
|
160
|
+
},
|
|
161
|
+
"required": false,
|
|
162
|
+
"optional": false,
|
|
163
|
+
"docs": {
|
|
164
|
+
"tags": [],
|
|
165
|
+
"text": "wether or not this consent is mandatory. Used for render details"
|
|
166
|
+
},
|
|
167
|
+
"attribute": "mandatory",
|
|
168
|
+
"reflect": true,
|
|
169
|
+
"defaultValue": "false"
|
|
170
|
+
},
|
|
171
|
+
"consentTitle": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"mutable": false,
|
|
174
|
+
"complexType": {
|
|
175
|
+
"original": "string",
|
|
176
|
+
"resolved": "string",
|
|
177
|
+
"references": {}
|
|
178
|
+
},
|
|
179
|
+
"required": false,
|
|
180
|
+
"optional": false,
|
|
181
|
+
"docs": {
|
|
182
|
+
"tags": [],
|
|
183
|
+
"text": "the title of the consent to be displayed"
|
|
184
|
+
},
|
|
185
|
+
"attribute": "consent-title",
|
|
186
|
+
"reflect": true,
|
|
187
|
+
"defaultValue": "''"
|
|
188
|
+
},
|
|
189
|
+
"clientStyling": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"mutable": false,
|
|
192
|
+
"complexType": {
|
|
193
|
+
"original": "string",
|
|
194
|
+
"resolved": "string",
|
|
195
|
+
"references": {}
|
|
196
|
+
},
|
|
197
|
+
"required": false,
|
|
198
|
+
"optional": false,
|
|
199
|
+
"docs": {
|
|
200
|
+
"tags": [],
|
|
201
|
+
"text": "Client custom styling via inline style"
|
|
202
|
+
},
|
|
203
|
+
"attribute": "client-styling",
|
|
204
|
+
"reflect": false,
|
|
205
|
+
"defaultValue": "''"
|
|
206
|
+
},
|
|
207
|
+
"translationUrl": {
|
|
208
|
+
"type": "string",
|
|
209
|
+
"mutable": false,
|
|
210
|
+
"complexType": {
|
|
211
|
+
"original": "string",
|
|
212
|
+
"resolved": "string",
|
|
213
|
+
"references": {}
|
|
214
|
+
},
|
|
215
|
+
"required": false,
|
|
216
|
+
"optional": false,
|
|
217
|
+
"docs": {
|
|
218
|
+
"tags": [],
|
|
219
|
+
"text": "Translation url"
|
|
220
|
+
},
|
|
221
|
+
"attribute": "translation-url",
|
|
222
|
+
"reflect": true,
|
|
223
|
+
"defaultValue": "''"
|
|
224
|
+
}
|
|
225
|
+
}; }
|
|
226
|
+
static get states() { return {
|
|
227
|
+
"textContent": {},
|
|
228
|
+
"limitStylingAppends": {}
|
|
229
|
+
}; }
|
|
230
|
+
static get events() { return [{
|
|
231
|
+
"method": "userLegislationConsent",
|
|
232
|
+
"name": "userLegislationConsent",
|
|
233
|
+
"bubbles": true,
|
|
234
|
+
"cancelable": true,
|
|
235
|
+
"composed": true,
|
|
236
|
+
"docs": {
|
|
237
|
+
"tags": [],
|
|
238
|
+
"text": ""
|
|
239
|
+
},
|
|
240
|
+
"complexType": {
|
|
241
|
+
"original": "object",
|
|
242
|
+
"resolved": "object",
|
|
243
|
+
"references": {}
|
|
244
|
+
}
|
|
245
|
+
}]; }
|
|
246
|
+
static get watchers() { return [{
|
|
247
|
+
"propName": "translationUrl",
|
|
248
|
+
"methodName": "handleNewTranslations"
|
|
249
|
+
}]; }
|
|
250
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
2
|
+
const TRANSLATIONS = {
|
|
3
|
+
en: {
|
|
4
|
+
termsandconditions1: "I accept the ",
|
|
5
|
+
termsandconditions2: ", I have read and understood the ",
|
|
6
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
7
|
+
tc: "Terms and Conditions",
|
|
8
|
+
privacy: "Privacy Policy",
|
|
9
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
10
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
11
|
+
},
|
|
12
|
+
ro: {
|
|
13
|
+
termsandconditions1: "I accept the ",
|
|
14
|
+
termsandconditions2: ", I have read and understood the ",
|
|
15
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
16
|
+
tc: "Terms and Conditions",
|
|
17
|
+
privacy: "Privacy Policy",
|
|
18
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
19
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
20
|
+
},
|
|
21
|
+
hr: {
|
|
22
|
+
termsandconditions1: "I accept the ",
|
|
23
|
+
termsandconditions2: ", I have read and understood the ",
|
|
24
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
25
|
+
tc: "Terms and Conditions",
|
|
26
|
+
privacy: "Privacy Policy",
|
|
27
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
28
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
29
|
+
},
|
|
30
|
+
fr: {
|
|
31
|
+
termsandconditions1: "I accept the ",
|
|
32
|
+
termsandconditions2: ", I have read and understood the ",
|
|
33
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
34
|
+
tc: "Terms and Conditions",
|
|
35
|
+
privacy: "Privacy Policy",
|
|
36
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
37
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
38
|
+
},
|
|
39
|
+
cs: {
|
|
40
|
+
termsandconditions1: "I accept the ",
|
|
41
|
+
termsandconditions2: ", I have read and understood the ",
|
|
42
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
43
|
+
tc: "Terms and Conditions",
|
|
44
|
+
privacy: "Privacy Policy",
|
|
45
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
46
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
47
|
+
},
|
|
48
|
+
de: {
|
|
49
|
+
termsandconditions1: "I accept the ",
|
|
50
|
+
termsandconditions2: ", I have read and understood the ",
|
|
51
|
+
termsandconditions3: " as published on this site and confirm that I am over 18 years old.",
|
|
52
|
+
tc: "Terms and Conditions",
|
|
53
|
+
privacy: "Privacy Policy",
|
|
54
|
+
sms: "I consent to receive marketing communication via SMS.",
|
|
55
|
+
emailmarketing: "I consent to receive marketing communication via Email."
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
export const getTranslations = (url) => {
|
|
59
|
+
// fetch url, get the data, replace the TRANSLATIONS content
|
|
60
|
+
return new Promise((resolve) => {
|
|
61
|
+
fetch(url)
|
|
62
|
+
.then((res) => res.json())
|
|
63
|
+
.then((data) => {
|
|
64
|
+
Object.keys(data).forEach((item) => {
|
|
65
|
+
for (let key in data[item]) {
|
|
66
|
+
TRANSLATIONS[item][key] = data[item][key];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
resolve(true);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
export const translate = (key, customLang, values) => {
|
|
74
|
+
const lang = customLang;
|
|
75
|
+
let translation = TRANSLATIONS[lang !== undefined ? lang : DEFAULT_LANGUAGE][key];
|
|
76
|
+
if (values !== undefined) {
|
|
77
|
+
for (const [key, value] of Object.entries(values.values)) {
|
|
78
|
+
const regex = new RegExp(`{${key}}`, 'g');
|
|
79
|
+
translation = translation.replace(regex, value);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return translation;
|
|
83
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* PlayerUserConsents custom elements */
|
|
2
|
+
|
|
3
|
+
import type { Components, JSX } from "../types/components";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Used to manually set the base path where assets can be found.
|
|
7
|
+
* If the script is used as "module", it's recommended to use "import.meta.url",
|
|
8
|
+
* such as "setAssetPath(import.meta.url)". Other options include
|
|
9
|
+
* "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
|
|
10
|
+
* dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
|
|
11
|
+
* But do note that this configuration depends on how your script is bundled, or lack of
|
|
12
|
+
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
13
|
+
* will have to ensure the static assets are copied to its build directory.
|
|
14
|
+
*/
|
|
15
|
+
export declare const setAssetPath: (path: string) => void;
|
|
16
|
+
|
|
17
|
+
export interface SetPlatformOptions {
|
|
18
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
19
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
20
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
+
|
|
24
|
+
export type { Components, JSX };
|
|
25
|
+
|
|
26
|
+
export * from '../types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface PlayerUserConsents extends Components.PlayerUserConsents, HTMLElement {}
|
|
4
|
+
export const PlayerUserConsents: {
|
|
5
|
+
prototype: PlayerUserConsents;
|
|
6
|
+
new (): PlayerUserConsents;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|