@everymatrix/player-user-consents 1.43.4 → 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.
- package/dist/cjs/app-globals-3a1e7e63.js +5 -0
- package/dist/cjs/index-69db8b9e.js +1229 -0
- package/dist/cjs/loader.cjs.js +7 -13
- package/dist/cjs/player-user-consents.cjs.entry.js +177 -203
- package/dist/cjs/player-user-consents.cjs.js +17 -11
- package/dist/collection/collection-manifest.json +3 -3
- package/dist/collection/components/player-user-consents/index.js +1 -0
- package/dist/collection/components/player-user-consents/player-user-consents.js +250 -280
- package/dist/collection/utils/locale.utils.js +110 -110
- package/dist/esm/app-globals-0f993ce5.js +3 -0
- package/dist/esm/index-cea90c73.js +1202 -0
- package/dist/esm/loader.js +7 -13
- package/dist/esm/player-user-consents.entry.js +177 -203
- package/dist/esm/player-user-consents.js +14 -11
- package/dist/player-user-consents/p-1e483854.js +2 -0
- package/dist/player-user-consents/{p-f88e76d0.entry.js → p-c5bf5548.entry.js} +1 -1
- package/dist/player-user-consents/p-e1255160.js +1 -0
- package/dist/player-user-consents/player-user-consents.esm.js +1 -1
- package/dist/stencil.config.dev.js +17 -0
- package/dist/stencil.config.js +14 -19
- 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
- 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
- package/dist/types/components/player-user-consents/index.d.ts +1 -0
- package/dist/types/components/player-user-consents/player-user-consents.d.ts +49 -49
- package/dist/types/components.d.ts +16 -1
- package/dist/types/stencil-public-runtime.d.ts +142 -33
- package/loader/cdn.js +1 -3
- package/loader/index.cjs.js +1 -3
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -3
- package/loader/index.js +1 -3
- package/loader/package.json +1 -0
- package/package.json +8 -1
- package/dist/cjs/index-e77a2edf.js +0 -1215
- package/dist/components/index.d.ts +0 -26
- package/dist/components/index.js +0 -1
- package/dist/components/player-user-consents.d.ts +0 -11
- package/dist/components/player-user-consents.js +0 -260
- package/dist/esm/index-b34076ff.js +0 -1189
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/player-user-consents/p-b1139724.js +0 -1
- 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,26 +0,0 @@
|
|
|
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';
|
package/dist/components/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
|
|
3
|
-
const DEFAULT_LANGUAGE = 'en';
|
|
4
|
-
const TRANSLATIONS = {
|
|
5
|
-
en: {
|
|
6
|
-
termsAndConditions: {
|
|
7
|
-
acceptPart1: "I accept the ",
|
|
8
|
-
acceptPart2: ", I have read and understood the ",
|
|
9
|
-
acceptPart3: " as published on this site and confirm that I am over 18 years old.",
|
|
10
|
-
tc: "Terms and Conditions"
|
|
11
|
-
},
|
|
12
|
-
privacyPolicy: {
|
|
13
|
-
readUnderstandPart1: "I have read and understood the ",
|
|
14
|
-
readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
|
|
15
|
-
privacy: "Privacy Policy"
|
|
16
|
-
},
|
|
17
|
-
sms: "I consent to receive marketing communication via SMS.",
|
|
18
|
-
emailmarketing: "I consent to receive marketing communication via Email."
|
|
19
|
-
},
|
|
20
|
-
ro: {
|
|
21
|
-
termsAndConditions: {
|
|
22
|
-
acceptPart1: "Accept ",
|
|
23
|
-
acceptPart2: " platformei. Am citit şi înţeles ",
|
|
24
|
-
acceptPart3: " publicată pe acest site şi confirm că am vârstă peste 18 ani.",
|
|
25
|
-
tc: "Termenii şi condiţiile"
|
|
26
|
-
},
|
|
27
|
-
privacyPolicy: {
|
|
28
|
-
readUnderstandPart1: "Am citit şi înţeles ",
|
|
29
|
-
readUnderstandPart2: " publicată pe acest site şi confirm că am vârstă peste 18 ani.",
|
|
30
|
-
privacy: "Politica de confidenţialitate"
|
|
31
|
-
},
|
|
32
|
-
sms: "Sunt de acord să primesc promoţii de marketing prin SMS.",
|
|
33
|
-
emailmarketing: "Sunt de acord să primesc promoţii de marketing pe e-mail."
|
|
34
|
-
},
|
|
35
|
-
hr: {
|
|
36
|
-
termsAndConditions: {
|
|
37
|
-
acceptPart1: "Prihvaćam Opće uvjete i odredbe ",
|
|
38
|
-
acceptPart2: "",
|
|
39
|
-
acceptPart3: "",
|
|
40
|
-
tcLink: "Opći uvjeti i odredbe"
|
|
41
|
-
},
|
|
42
|
-
privacyPolicy: {
|
|
43
|
-
readUnderstandPart1: "Pročitao sam i razumijem Politiku Privatnosti ",
|
|
44
|
-
readUnderstandPart2: ", i potvrđujem da imam više od 18 godina",
|
|
45
|
-
privacyLink: "Politika Privatnosti"
|
|
46
|
-
},
|
|
47
|
-
sms: "Želim dobivati marketinški sadržaj putem sms",
|
|
48
|
-
emailmarketing: "Želim dobivati marketinški sadržaj putem e-maila"
|
|
49
|
-
},
|
|
50
|
-
fr: {
|
|
51
|
-
termsAndConditions: {
|
|
52
|
-
acceptPart1: "I accept the ",
|
|
53
|
-
acceptPart2: ", I have read and understood the ",
|
|
54
|
-
acceptPart3: " as published on this site and confirm that I am over 18 years old.",
|
|
55
|
-
tc: "Terms and Conditions"
|
|
56
|
-
},
|
|
57
|
-
privacyPolicy: {
|
|
58
|
-
readUnderstandPart1: "I have read and understood the ",
|
|
59
|
-
readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
|
|
60
|
-
privacy: "Privacy Policy"
|
|
61
|
-
},
|
|
62
|
-
sms: "I consent to receive marketing communication via SMS.",
|
|
63
|
-
emailmarketing: "I consent to receive marketing communication via Email."
|
|
64
|
-
},
|
|
65
|
-
cs: {
|
|
66
|
-
termsAndConditions: {
|
|
67
|
-
acceptPart1: "I accept the ",
|
|
68
|
-
acceptPart2: ", I have read and understood the ",
|
|
69
|
-
acceptPart3: " as published on this site and confirm that I am over 18 years old.",
|
|
70
|
-
tc: "Terms and Conditions"
|
|
71
|
-
},
|
|
72
|
-
privacyPolicy: {
|
|
73
|
-
readUnderstandPart1: "I have read and understood the ",
|
|
74
|
-
readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
|
|
75
|
-
privacy: "Privacy Policy"
|
|
76
|
-
},
|
|
77
|
-
sms: "I consent to receive marketing communication via SMS.",
|
|
78
|
-
emailmarketing: "I consent to receive marketing communication via Email."
|
|
79
|
-
},
|
|
80
|
-
de: {
|
|
81
|
-
termsAndConditions: {
|
|
82
|
-
acceptPart1: "I accept the ",
|
|
83
|
-
acceptPart2: ", I have read and understood the ",
|
|
84
|
-
acceptPart3: " as published on this site and confirm that I am over 18 years old.",
|
|
85
|
-
tc: "Terms and Conditions"
|
|
86
|
-
},
|
|
87
|
-
privacyPolicy: {
|
|
88
|
-
readUnderstandPart1: "I have read and understood the ",
|
|
89
|
-
readUnderstandPart2: ", as published on this site and confirm that I am over 18 years old.",
|
|
90
|
-
privacy: "Privacy Policy"
|
|
91
|
-
},
|
|
92
|
-
sms: "I consent to receive marketing communication via SMS.",
|
|
93
|
-
emailmarketing: "I consent to receive marketing communication via Email."
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
const getTranslations = (url) => {
|
|
97
|
-
// fetch url, get the data, replace the TRANSLATIONS content
|
|
98
|
-
return new Promise((resolve) => {
|
|
99
|
-
fetch(url)
|
|
100
|
-
.then((res) => res.json())
|
|
101
|
-
.then((data) => {
|
|
102
|
-
Object.keys(data).forEach((item) => {
|
|
103
|
-
for (let key in data[item]) {
|
|
104
|
-
TRANSLATIONS[item][key] = data[item][key];
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
resolve(true);
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
const translate = (key, customLang, values) => {
|
|
112
|
-
const lang = customLang || DEFAULT_LANGUAGE;
|
|
113
|
-
const getNestedTranslation = (obj, path) => {
|
|
114
|
-
return path.split('.').reduce((o, k) => (o && o[k] !== undefined ? o[k] : null), obj);
|
|
115
|
-
};
|
|
116
|
-
let translation = getNestedTranslation(TRANSLATIONS[lang], key);
|
|
117
|
-
if (translation === null) {
|
|
118
|
-
return key;
|
|
119
|
-
}
|
|
120
|
-
if (values !== undefined) {
|
|
121
|
-
for (const [k, v] of Object.entries(values)) {
|
|
122
|
-
const regex = new RegExp(`{${k}}`, 'g');
|
|
123
|
-
translation = translation.replace(regex, v);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return translation;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
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}";
|
|
130
|
-
|
|
131
|
-
const PlayerUserConsents$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
132
|
-
constructor() {
|
|
133
|
-
super();
|
|
134
|
-
this.__registerHost();
|
|
135
|
-
this.__attachShadow();
|
|
136
|
-
this.userLegislationConsent = createEvent(this, "userLegislationConsent", 7);
|
|
137
|
-
/**
|
|
138
|
-
* Language
|
|
139
|
-
*/
|
|
140
|
-
this.lang = 'en';
|
|
141
|
-
/**
|
|
142
|
-
* 'true' when parent expects component to emit it's current value
|
|
143
|
-
*/
|
|
144
|
-
this.queried = false;
|
|
145
|
-
/**
|
|
146
|
-
* the type of the consent, used to determine render details
|
|
147
|
-
*/
|
|
148
|
-
this.consentType = '';
|
|
149
|
-
/**
|
|
150
|
-
* wether or not this consent is mandatory. Used for render details
|
|
151
|
-
*/
|
|
152
|
-
this.mandatory = false;
|
|
153
|
-
/**
|
|
154
|
-
* Select GM version
|
|
155
|
-
*/
|
|
156
|
-
this.gmVersion = '';
|
|
157
|
-
/**
|
|
158
|
-
* the title of the consent to be displayed
|
|
159
|
-
*/
|
|
160
|
-
this.consentTitle = '';
|
|
161
|
-
/**
|
|
162
|
-
* Client custom styling via inline style
|
|
163
|
-
*/
|
|
164
|
-
this.clientStyling = '';
|
|
165
|
-
/**
|
|
166
|
-
* Translation url
|
|
167
|
-
*/
|
|
168
|
-
this.translationUrl = '';
|
|
169
|
-
/**
|
|
170
|
-
* the text content to be rendered by the component. Determined at runtime
|
|
171
|
-
*/
|
|
172
|
-
this.textContent = '';
|
|
173
|
-
this.limitStylingAppends = false;
|
|
174
|
-
this.goToTermsAndConditions = () => window.postMessage({ type: 'GoToTermsAndConditions' });
|
|
175
|
-
this.goToPrivacyPolicy = () => window.postMessage({ type: 'GoToPrivacyPolicy' });
|
|
176
|
-
this.setClientStyling = () => {
|
|
177
|
-
let sheet = document.createElement('style');
|
|
178
|
-
sheet.innerHTML = this.clientStyling;
|
|
179
|
-
this.stylingContainer.prepend(sheet);
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
handleNewTranslations() {
|
|
183
|
-
getTranslations(this.translationUrl);
|
|
184
|
-
}
|
|
185
|
-
async componentWillLoad() {
|
|
186
|
-
if (this.translationUrl.length > 2) {
|
|
187
|
-
await getTranslations(this.translationUrl);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
userLegislationConsentHandler() {
|
|
191
|
-
this.userLegislationConsent.emit({
|
|
192
|
-
type: this.consentType,
|
|
193
|
-
value: this.checkboxInput.checked
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
componentDidRender() {
|
|
197
|
-
// start custom styling area
|
|
198
|
-
if (!this.limitStylingAppends && this.stylingContainer) {
|
|
199
|
-
if (this.clientStyling)
|
|
200
|
-
this.setClientStyling();
|
|
201
|
-
this.limitStylingAppends = true;
|
|
202
|
-
}
|
|
203
|
-
// end custom styling area
|
|
204
|
-
}
|
|
205
|
-
determineTextContent() {
|
|
206
|
-
if (this.gmVersion === 'gmcore') {
|
|
207
|
-
if (this.consentType === 'termsandconditions') {
|
|
208
|
-
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));
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
if (this.gmVersion === 'gm16') {
|
|
212
|
-
if (this.consentType === 'termsandconditions') {
|
|
213
|
-
return h("p", null, translate('termsAndConditions.acceptPart1', this.lang), h("span", { class: "ConsentLink", onClick: this.goToTermsAndConditions }, translate('termsAndConditions.tcLink', this.lang)));
|
|
214
|
-
}
|
|
215
|
-
if (this.consentType === 'privacypolicy') {
|
|
216
|
-
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));
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
return h("p", null, translate(this.consentType, this.lang));
|
|
220
|
-
}
|
|
221
|
-
render() {
|
|
222
|
-
if (this.queried) {
|
|
223
|
-
this.userLegislationConsentHandler();
|
|
224
|
-
}
|
|
225
|
-
return (h("div", { ref: el => this.stylingContainer = el }, h("p", { class: "ConsentTitle" }, this.consentTitle), h("label", { class: "UserConsent", htmlFor: "userConsent" }, h("input", { ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }), this.determineTextContent(), this.mandatory && h("span", { class: "MandatoryItem" }, "*"))));
|
|
226
|
-
}
|
|
227
|
-
static get watchers() { return {
|
|
228
|
-
"translationUrl": ["handleNewTranslations"]
|
|
229
|
-
}; }
|
|
230
|
-
static get style() { return playerUserConsentsCss; }
|
|
231
|
-
}, [1, "player-user-consents", {
|
|
232
|
-
"lang": [1537],
|
|
233
|
-
"queried": [516],
|
|
234
|
-
"consentType": [513, "consent-type"],
|
|
235
|
-
"mandatory": [516],
|
|
236
|
-
"gmVersion": [1, "gm-version"],
|
|
237
|
-
"consentTitle": [513, "consent-title"],
|
|
238
|
-
"clientStyling": [1, "client-styling"],
|
|
239
|
-
"translationUrl": [513, "translation-url"],
|
|
240
|
-
"textContent": [32],
|
|
241
|
-
"limitStylingAppends": [32]
|
|
242
|
-
}]);
|
|
243
|
-
function defineCustomElement$1() {
|
|
244
|
-
if (typeof customElements === "undefined") {
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
const components = ["player-user-consents"];
|
|
248
|
-
components.forEach(tagName => { switch (tagName) {
|
|
249
|
-
case "player-user-consents":
|
|
250
|
-
if (!customElements.get(tagName)) {
|
|
251
|
-
customElements.define(tagName, PlayerUserConsents$1);
|
|
252
|
-
}
|
|
253
|
-
break;
|
|
254
|
-
} });
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
const PlayerUserConsents = PlayerUserConsents$1;
|
|
258
|
-
const defineCustomElement = defineCustomElement$1;
|
|
259
|
-
|
|
260
|
-
export { PlayerUserConsents, defineCustomElement };
|