@everymatrix/user-action-controller 1.22.1 → 1.22.2
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/player-legislation-wrapper_3.cjs.entry.js +2 -2
- package/dist/collection/components/user-action-controller/user-action-controller.js +2 -2
- package/dist/components/user-action-controller.js +2 -2
- package/dist/esm/player-legislation-wrapper_3.entry.js +2 -2
- package/dist/user-action-controller/p-9b3c5ed7.entry.js +1 -0
- package/dist/user-action-controller/user-action-controller.esm.js +1 -1
- package/package.json +1 -1
- package/dist/user-action-controller/p-cb43c2db.entry.js +0 -1
|
@@ -177,7 +177,7 @@ const UserActionController = class {
|
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
179
|
determineMandatoryActions() {
|
|
180
|
-
let url = new URL(`${this.endpoint}v1/player/consentRequirements`);
|
|
180
|
+
let url = new URL(`${this.endpoint}/v1/player/consentRequirements`);
|
|
181
181
|
return fetch(url.href)
|
|
182
182
|
.then(res => res.json())
|
|
183
183
|
.then(data => {
|
|
@@ -192,7 +192,7 @@ const UserActionController = class {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
updateUserConsents() {
|
|
195
|
-
const url = new URL(`${this.endpoint}v1/player/${this.userId}/consent`);
|
|
195
|
+
const url = new URL(`${this.endpoint}/v1/player/${this.userId}/consent`);
|
|
196
196
|
let body = {
|
|
197
197
|
items: this.userActions
|
|
198
198
|
};
|
|
@@ -52,7 +52,7 @@ export class UserActionController {
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
determineMandatoryActions() {
|
|
55
|
-
let url = new URL(`${this.endpoint}v1/player/consentRequirements`);
|
|
55
|
+
let url = new URL(`${this.endpoint}/v1/player/consentRequirements`);
|
|
56
56
|
return fetch(url.href)
|
|
57
57
|
.then(res => res.json())
|
|
58
58
|
.then(data => {
|
|
@@ -67,7 +67,7 @@ export class UserActionController {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
updateUserConsents() {
|
|
70
|
-
const url = new URL(`${this.endpoint}v1/player/${this.userId}/consent`);
|
|
70
|
+
const url = new URL(`${this.endpoint}/v1/player/${this.userId}/consent`);
|
|
71
71
|
let body = {
|
|
72
72
|
items: this.userActions
|
|
73
73
|
};
|
|
@@ -59,7 +59,7 @@ const UserActionController$1 = /*@__PURE__*/ proxyCustomElement(class extends HT
|
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
determineMandatoryActions() {
|
|
62
|
-
let url = new URL(`${this.endpoint}v1/player/consentRequirements`);
|
|
62
|
+
let url = new URL(`${this.endpoint}/v1/player/consentRequirements`);
|
|
63
63
|
return fetch(url.href)
|
|
64
64
|
.then(res => res.json())
|
|
65
65
|
.then(data => {
|
|
@@ -74,7 +74,7 @@ const UserActionController$1 = /*@__PURE__*/ proxyCustomElement(class extends HT
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
updateUserConsents() {
|
|
77
|
-
const url = new URL(`${this.endpoint}v1/player/${this.userId}/consent`);
|
|
77
|
+
const url = new URL(`${this.endpoint}/v1/player/${this.userId}/consent`);
|
|
78
78
|
let body = {
|
|
79
79
|
items: this.userActions
|
|
80
80
|
};
|
|
@@ -173,7 +173,7 @@ const UserActionController = class {
|
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
175
|
determineMandatoryActions() {
|
|
176
|
-
let url = new URL(`${this.endpoint}v1/player/consentRequirements`);
|
|
176
|
+
let url = new URL(`${this.endpoint}/v1/player/consentRequirements`);
|
|
177
177
|
return fetch(url.href)
|
|
178
178
|
.then(res => res.json())
|
|
179
179
|
.then(data => {
|
|
@@ -188,7 +188,7 @@ const UserActionController = class {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
updateUserConsents() {
|
|
191
|
-
const url = new URL(`${this.endpoint}v1/player/${this.userId}/consent`);
|
|
191
|
+
const url = new URL(`${this.endpoint}/v1/player/${this.userId}/consent`);
|
|
192
192
|
let body = {
|
|
193
193
|
items: this.userActions
|
|
194
194
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as s,c as e}from"./p-ba444709.js";const i=class{constructor(s){t(this,s),this.clientStyling="",this.limitStylingAppends=!1,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)}}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}render(){const t=this.activeUserActions.replace(/ /g,"").split(",");return s("div",{class:"PlayerLegislationWrapper",ref:t=>this.stylingContainer=t},t.map((t=>s("slot",{name:t}))))}};i.style=":host{display:block}";const n=class{constructor(s){t(this,s),this.userLegislationConsent=e(this,"userLegislationConsent",7),this.queried=!1,this.consentType="",this.mandatory=!1,this.consentTitle="",this.tcLink="#",this.privacyLink="#",this.clientStyling="",this.textContent="",this.limitStylingAppends=!1,this.stringVariants={termsandconditions1:"I accept the ",termsandconditions2:", I have read and understood the ",termsandconditions3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions",privacy:"Privacy Policy",sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)}}determineTextContent(){return"termsandconditions"===this.consentType?s("span",null,this.stringVariants.termsandconditions1,s("a",{href:this.tcLink},this.stringVariants.tc),this.stringVariants.termsandconditions2,s("a",{href:this.privacyLink},this.stringVariants.privacy),this.stringVariants.termsandconditions3):s("span",null,this.stringVariants[this.consentType])}userLegislationConsentHandler(){this.userLegislationConsent.emit({type:this.consentType,value:this.checkboxInput.checked})}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}render(){return this.queried&&this.userLegislationConsentHandler(),this.textContent=this.determineTextContent(),s("div",{ref:t=>this.stylingContainer=t},s("p",{class:"ConsentTitle"},this.consentTitle),s("label",{class:"userConsent",htmlFor:"userConsent"},s("input",{ref:t=>this.checkboxInput=t,id:"userConsent",type:"checkbox",onInput:()=>this.userLegislationConsentHandler()}),this.textContent,this.mandatory&&s("span",{class:"MandatoryItem"},"*")))}};n.style=":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.userConsent:hover{border-bottom:1px solid #000;cursor:pointer}.MandatoryItem{color:#f00;font-size:1.2rem}";const o=class{constructor(s){t(this,s),this.closeButtonEvent=e(this,"closeButtonClicked",7),this.postMessageEvent="closeButtonClicked",this.clientStyling="",this.clientStylingUrl="",this.consentTitles={termsandconditions:"Terms and Conditions",sms:"SMS marketing",emailmarketing:"Email marketing"},this.queryFired=!1,this.readyActionsCount=0,this.receivedQueryResponses=0,this.limitStylingAppends=!1,this.mandatoryActions=["termsandconditions"],this.requiredActionsCount=0,this.expectedQueryResponses=0,this.userActions=[],this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),s=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{this.clientStyling=t,s.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(s)}),1)})).catch((t=>{console.log("error ",t)}))}}determineMandatoryActions(){let t=new URL(`${this.endpoint}/v1/player/consentRequirements`);return fetch(t.href).then((t=>t.json())).then((t=>{t.items.forEach((t=>{t.mustAccept&&this.mandatoryActions.push(t.tagCode)}))}))}handleQueryResponse(){this.receivedQueryResponses===this.expectedQueryResponses&&this.updateUserConsents()}updateUserConsents(){const t=new URL(`${this.endpoint}/v1/player/${this.userId}/consent`);let s={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-SessionId":`${this.userSession}`},body:JSON.stringify({items:this.userActions})};fetch(t.href,s).then((t=>t.json())).then((()=>{window.postMessage({type:"WidgetNotification",data:{type:"success",message:"Consent update successfull!"}},window.location.href)})).catch((t=>{window.postMessage({type:"WidgetNotification",data:{type:"error",message:"Server might not be responding",err:t}},window.location.href)})).finally((()=>{window.postMessage({type:"UserActionsCompleted"},window.location.href)}))}handleApplyClick(){this.queryFired=!0}handleClose(){this.usePostmessage&&window.postMessage({type:this.postMessageEvent}),this.closeButtonEvent.emit()}userLegislationConsentHandler(t){this.mandatoryActions.includes(t.detail.type)&&(t.detail.value?this.readyActionsCount++:this.readyActionsCount--),this.queryFired&&(this.userActions.push({tagCode:t.detail.type,status:t.detail.value?"Accepted":"Denied"}),this.receivedQueryResponses++)}componentWillLoad(){return this.determineMandatoryActions()}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){const t=this.activeUserActions.replace(/ /g,"").split(",");return this.requiredActionsCount=t.filter((t=>this.mandatoryActions.includes(t))).length,this.expectedQueryResponses=t.length,s("div",{class:"QueryReferenceContainer",ref:t=>this.stylingContainer=t},s("div",{class:"UserActionController"},this.showCloseButton&&s("div",{class:"CloseButton",onClick:()=>this.handleClose()},s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",fill:"currentColor",viewBox:"0 0 16 16"},s("path",{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"}))),s("h2",{class:"UserConsentNotice"},this.userNoticeText),s("player-legislation-wrapper",{"active-user-actions":this.activeUserActions,"client-styling":this.clientStyling},t.map((t=>s("player-user-consents",{slot:t,consentType:t,consentTitle:this.consentTitles[t],queried:this.queryFired,mandatory:this.mandatoryActions.includes(t),"client-styling":this.clientStyling})))),this.includeSubmitButton&&s("button",{class:"ConsentSubmitButton",disabled:this.readyActionsCount!==this.requiredActionsCount,onClick:()=>this.handleApplyClick()},this.submitButtonText)))}static get watchers(){return{receivedQueryResponses:["handleQueryResponse"]}}};o.style=":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserConsentNotice{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserActionController{font-family:Arial, Helvetica, sans-serif;font-weight:100;height:100%;width:100%;padding:1rem 1.5rem 2rem;background-color:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:5%}.ConsentSubmitButton{font-size:1rem;padding:0.4rem 1.4rem;background:#fff;border:2px solid #000;color:#000;border-radius:5px;align-self:flex-end}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:blue}}";export{i as player_legislation_wrapper,n as player_user_consents,o as user_action_controller}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as e,b as t}from"./p-ba444709.js";(()=>{const t=import.meta.url,n={};return""!==t&&(n.resourcesUrl=new URL(".",t).href),e(n)})().then((e=>t([["p-9b3c5ed7",[[1,"user-action-controller",{endpoint:[513],userSession:[513,"user-session"],userId:[513,"user-id"],includeSubmitButton:[516,"include-submit-button"],submitButtonText:[513,"submit-button-text"],userNoticeText:[513,"user-notice-text"],activeUserActions:[513,"active-user-actions"],showCloseButton:[516,"show-close-button"],usePostmessage:[516,"use-postmessage"],postMessageEvent:[1,"post-message-event"],clientStyling:[1537,"client-styling"],clientStylingUrl:[513,"client-styling-url"],queryFired:[32],readyActionsCount:[32],receivedQueryResponses:[32],limitStylingAppends:[32]},[[0,"userLegislationConsent","userLegislationConsentHandler"]]],[1,"player-legislation-wrapper",{activeUserActions:[513,"active-user-actions"],clientStyling:[1,"client-styling"],limitStylingAppends:[32]}],[1,"player-user-consents",{queried:[516],consentType:[513,"consent-type"],mandatory:[516],consentTitle:[513,"consent-title"],tcLink:[513,"tc-link"],privacyLink:[513,"privacy-link"],clientStyling:[1,"client-styling"],textContent:[32],limitStylingAppends:[32]}]]]],e)));
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as s,c as e}from"./p-ba444709.js";const i=class{constructor(s){t(this,s),this.clientStyling="",this.limitStylingAppends=!1,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)}}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}render(){const t=this.activeUserActions.replace(/ /g,"").split(",");return s("div",{class:"PlayerLegislationWrapper",ref:t=>this.stylingContainer=t},t.map((t=>s("slot",{name:t}))))}};i.style=":host{display:block}";const n=class{constructor(s){t(this,s),this.userLegislationConsent=e(this,"userLegislationConsent",7),this.queried=!1,this.consentType="",this.mandatory=!1,this.consentTitle="",this.tcLink="#",this.privacyLink="#",this.clientStyling="",this.textContent="",this.limitStylingAppends=!1,this.stringVariants={termsandconditions1:"I accept the ",termsandconditions2:", I have read and understood the ",termsandconditions3:" as published on this site and confirm that I am over 18 years old.",tc:"Terms and Conditions",privacy:"Privacy Policy",sms:"I consent to receive marketing communication via SMS.",emailmarketing:"I consent to receive marketing communication via Email."},this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)}}determineTextContent(){return"termsandconditions"===this.consentType?s("span",null,this.stringVariants.termsandconditions1,s("a",{href:this.tcLink},this.stringVariants.tc),this.stringVariants.termsandconditions2,s("a",{href:this.privacyLink},this.stringVariants.privacy),this.stringVariants.termsandconditions3):s("span",null,this.stringVariants[this.consentType])}userLegislationConsentHandler(){this.userLegislationConsent.emit({type:this.consentType,value:this.checkboxInput.checked})}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.limitStylingAppends=!0)}render(){return this.queried&&this.userLegislationConsentHandler(),this.textContent=this.determineTextContent(),s("div",{ref:t=>this.stylingContainer=t},s("p",{class:"ConsentTitle"},this.consentTitle),s("label",{class:"userConsent",htmlFor:"userConsent"},s("input",{ref:t=>this.checkboxInput=t,id:"userConsent",type:"checkbox",onInput:()=>this.userLegislationConsentHandler()}),this.textContent,this.mandatory&&s("span",{class:"MandatoryItem"},"*")))}};n.style=":host{display:block}.ConsentTitle{margin-bottom:0.2rem;font-weight:600}.userConsent:hover{border-bottom:1px solid #000;cursor:pointer}.MandatoryItem{color:#f00;font-size:1.2rem}";const o=class{constructor(s){t(this,s),this.closeButtonEvent=e(this,"closeButtonClicked",7),this.postMessageEvent="closeButtonClicked",this.clientStyling="",this.clientStylingUrl="",this.consentTitles={termsandconditions:"Terms and Conditions",sms:"SMS marketing",emailmarketing:"Email marketing"},this.queryFired=!1,this.readyActionsCount=0,this.receivedQueryResponses=0,this.limitStylingAppends=!1,this.mandatoryActions=["termsandconditions"],this.requiredActionsCount=0,this.expectedQueryResponses=0,this.userActions=[],this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingUrl),s=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{this.clientStyling=t,s.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(s)}),1)})).catch((t=>{console.log("error ",t)}))}}determineMandatoryActions(){let t=new URL(`${this.endpoint}v1/player/consentRequirements`);return fetch(t.href).then((t=>t.json())).then((t=>{t.items.forEach((t=>{t.mustAccept&&this.mandatoryActions.push(t.tagCode)}))}))}handleQueryResponse(){this.receivedQueryResponses===this.expectedQueryResponses&&this.updateUserConsents()}updateUserConsents(){const t=new URL(`${this.endpoint}v1/player/${this.userId}/consent`);let s={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-SessionId":`${this.userSession}`},body:JSON.stringify({items:this.userActions})};fetch(t.href,s).then((t=>t.json())).then((()=>{window.postMessage({type:"WidgetNotification",data:{type:"success",message:"Consent update successfull!"}},window.location.href)})).catch((t=>{window.postMessage({type:"WidgetNotification",data:{type:"error",message:"Server might not be responding",err:t}},window.location.href)})).finally((()=>{window.postMessage({type:"UserActionsCompleted"},window.location.href)}))}handleApplyClick(){this.queryFired=!0}handleClose(){this.usePostmessage&&window.postMessage({type:this.postMessageEvent}),this.closeButtonEvent.emit()}userLegislationConsentHandler(t){this.mandatoryActions.includes(t.detail.type)&&(t.detail.value?this.readyActionsCount++:this.readyActionsCount--),this.queryFired&&(this.userActions.push({tagCode:t.detail.type,status:t.detail.value?"Accepted":"Denied"}),this.receivedQueryResponses++)}componentWillLoad(){return this.determineMandatoryActions()}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}render(){const t=this.activeUserActions.replace(/ /g,"").split(",");return this.requiredActionsCount=t.filter((t=>this.mandatoryActions.includes(t))).length,this.expectedQueryResponses=t.length,s("div",{class:"QueryReferenceContainer",ref:t=>this.stylingContainer=t},s("div",{class:"UserActionController"},this.showCloseButton&&s("div",{class:"CloseButton",onClick:()=>this.handleClose()},s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",fill:"currentColor",viewBox:"0 0 16 16"},s("path",{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"}))),s("h2",{class:"UserConsentNotice"},this.userNoticeText),s("player-legislation-wrapper",{"active-user-actions":this.activeUserActions,"client-styling":this.clientStyling},t.map((t=>s("player-user-consents",{slot:t,consentType:t,consentTitle:this.consentTitles[t],queried:this.queryFired,mandatory:this.mandatoryActions.includes(t),"client-styling":this.clientStyling})))),this.includeSubmitButton&&s("button",{class:"ConsentSubmitButton",disabled:this.readyActionsCount!==this.requiredActionsCount,onClick:()=>this.handleApplyClick()},this.submitButtonText)))}static get watchers(){return{receivedQueryResponses:["handleQueryResponse"]}}};o.style=":host{display:block}.QueryReferenceContainer{height:100%;width:100%}.UserConsentNotice{font-size:1.2rem;font-weight:200;text-align:center}.CloseButton{width:25px;height:25px;align-self:flex-end}.UserActionController{font-family:Arial, Helvetica, sans-serif;font-weight:100;height:100%;width:100%;padding:1rem 1.5rem 2rem;background-color:#fff;display:flex;flex-direction:column;justify-content:space-between;border-radius:5%}.ConsentSubmitButton{font-size:1rem;padding:0.4rem 1.4rem;background:#fff;border:2px solid #000;color:#000;border-radius:5px;align-self:flex-end}.ConsentSubmitButton:disabled{border:2px solid #ccc;color:#ccc}@media screen and (max-width: 320px){.QueryReferenceContainer{font-size:0.8rem;color:blue}}";export{i as player_legislation_wrapper,n as player_user_consents,o as user_action_controller}
|