diff --git a/docs/404.html b/docs/404.html index cb94ee8..ddb9626 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -404 - not found

Gdpr

404 - not found.
\ No newline at end of file +404 - not found

Gdpr

404 - not found.
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 4db78e0..8788916 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,6 +1,6 @@ -@magic-modules/gdpr

Gdpr

@magic-modules/gdpr

this is the +@magic-modules/gdpr

@magic-modules/gdpr

this is the @magic-modules Gdpr component.

adds a gdpr compliant information popup with minimal intrusion and complexity to your page.

installation:

npm install --save-exact @magic-modules/gdpr

usage

activate

to activate Gdpr, add it to the list of hoisted modules

// src/config.mjsexport default {  // ... other config variables  HOIST: ['Gdpr'],}

after doing this, the gdpr module will show up.'),

change contents, add cookies

// /src/app.mjsexport const state = {  gdpr: {    allowAllText: 'button text for allow all data',    allowText: 'button text for allow selected data',    allowTitle: 'Title above the three cookie buttons',    content: 'String or Array of Magic modules',    denyText: 'button text for no data allowed',    noDataText: 'Button text if no cookies are defined',    title: 'Title text for the gdpr popup',  },  cookies: [    ['name', { title: 'cookie1 title', content: 'cookie description' }],    ['cookie 2', { title: 'cookie title', content: 'cookie content' }],  ],})

source

the source for this page is in the example directory, and gets built and published to github using -@magic/core

made with a few bits of magic
\ No newline at end of file +@magic/core

\ No newline at end of file diff --git a/docs/magic.css b/docs/magic.css index ed37e97..8f91139 100644 --- a/docs/magic.css +++ b/docs/magic.css @@ -1 +1 @@ -html{scroll-behavior:smooth;overflow-y:scroll}h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,img,picture,source,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video,div,body{border:0;box-sizing:border-box;font:inherit;font-size:100%;margin:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1.5;margin:0;max-width:100vw;overflow-x:hidden;padding:0;font-family:"Ubuntu Narrow",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,sans-serif}ul{display:inline-block;list-style:none}ol{display:inline-block;list-style:inside decimal}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}a{cursor:pointer;outline:none;white-space:nowrap;color:#eeeeee;text-decoration:underline;transition:color 500ms}b,strong{font-weight:700}i,em{font-style:italic}button,.button,input[type="reset"],input[type="button"],input[type="submit"],input[type="file"] > input[type="button"]{background-color:#9E9E9E;color:#212121;cursor:pointer;padding:0.5em}button:hover,.button:hover,input[type="reset"]:hover,input[type="button"]:hover,input[type="submit"]:hover,input[type="file"] > input[type="button"]:hover{background-color:#616161;color:#F5F5F5}button::-moz-focus-inner,.button::-moz-focus-inner,input[type="reset"]::-moz-focus-inner,input[type="button"]::-moz-focus-inner,input[type="submit"]::-moz-focus-inner,input[type="file"] > input[type="button"]::-moz-focus-inner{border:0 none;padding:0}#Magic{height:100%;min-height:100vh;width:100%;background-color:#232323;color:#cccccc;transition:color 300ms,background-color 300ms;font-weight:400}#Magic .icon{width:1.5em;height:auto}.Wrapper{margin:0 auto;max-width:1300px;width:90%}.Header{display:inline-block;width:100%;padding:.5em 0 0}.Header .Logo{display:inline-block}.Header .Logo img{float:left}.Header .Logo span{float:left;font-size:1.5em;margin:.7em .2em}.Page h1{padding:1em 0 .2em}.Footer{width:100%;padding:2em 0 .5em;position:relative}h1,h2,h3,h4,h5{padding:1em 0 .2em}h1{font-size:1.4em}h2{font-size:1.3em}h3{font-size:1.2em}.Credits{clear:both;display:block;margin:2em 0 1em}.Credits a{color:#cccccc;text-decoration:underline}.Credits a:hover{color:#c4c4c4}.Footer .Container{text-align:center}.Gdpr .Container{background-color:#212121;border:1px solid;border-radius:.5em;color:#F5F5F5;display:inline-block;padding:1em;position:relative;text-align:left}.light .Gdpr .Container{background-color:#F5F5F5;color:#212121}.Gdpr .ShowHide{position:fixed;left:0.5em;bottom:0.5em;cursor:pointer;color:#9E9E9E;stroke:#9E9E9E;fill:#9E9E9E}.Gdpr .ShowHide:hover{color:#616161;stroke:#616161;fill:#616161}.Gdpr h3{padding:0;margin:0}.Gdpr h4{display:inline;font-weight:bold}.Gdpr input[type=button]{display:inline-block;margin:0.5em 0;width:100%}.Gdpr ul{display:block}.GitBadges{display:inline-block;margin:15px 0}.GitBadges img{height:23px}.GitBadges li{margin:0 .5em 0 0;display:inline-block;float:left}.Header .Menu{display:inline-block;width:100%}.Header p{font-size:1.5em}.LightSwitch{background:none;border:none;color:inherit;cursor:pointer;fill:#9E9E9E;font:inherit;outline:inherit;padding:0;left:0.5em;position:fixed;bottom:2.5em}.LightSwitch:hover{background:none;fill:#616161}.Logo{float:left;height:2.4em}.Logo .stroke{fill:none;stroke:#663695;stroke-width:15;stroke-linecap:round;stroke-linejoin:round}.Logo .stroke.white{stroke:#ffffff}.Logo svg{display:inline-block;width:3em;height:auto}.Menu{float:none;margin:1.5em 0 0;position:relative;display:block;clear:both}.Menu li{float:none;margin:0 .5em 0 0;display:block}.Menu li.active > a{text-decoration:underline;color:#fefefe}.Menu li a{display:block;text-decoration:none}.Menu ul ul{position:relative;left:0;border-left:1px dotted;display:block;margin:0 0 0 0.2em;padding:0 0 0 0.3em}.Pre{background-color:#121212;border:1px solid #666;border-radius:5px;color:#eee;counter-reset:line;display:block;font-family:monospace;line-height:1.3;margin:1em 0;padding:1em .5em 0 .2em;position:relative;text-align:left;transition:color 300ms,background-color 300ms;white-space:pre}.Pre.lines pre > code{counter-increment:line;padding:0}.Pre.lines pre > code:last-child{padding:0 0 1em}.Pre.lines pre > code:before{content:counter(line);display:inline-block;padding:0 .5em 0 0;text-align:right;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:3ch}.Pre .actions{color:blueviolet}.Pre .boolean{color:#7979e4}.Pre .builtin{color:cadetblue}.Pre .colon{color:#8eef8e}.Pre .comment{opacity:0.7;font-style:italic}.Pre .html{color:#008800}.Pre .keyword{color:violet}.light .Pre{background-color:#ddd;color:#111}.light .Pre > code:before{color:#666}.light .Pre .html{color:#008800}.light .Pre .keyword{color:purple}.light .Pre .builtin{color:cadetblue}.light .Pre .string{color:#d15100}.light .Pre .colon{color:#016301}.light .Pre .boolean{color:blue}.light .Pre .actions{color:blueviolet}.light .Pre .state{color:cornflowerblue}.light .Pre .comment{color:#555;opacity:0.8;font-style:italic}.light .Pre .object{color:#016301}.light .Pre .property{color:#2a952a}.light .Pre a{color:#d15100}.light .Pre a:hover{color:turquoise}.Pre .menu{position:absolute;margin-top:-2em;right:0}.Pre .object{color:#00ff00}.Pre .property{color:#8eef8e}.Pre .state{color:cornflowerblue}.Pre .string{color:#dd8f00}.Pre > code:before{color:#666}.Pre a{color:turquoise}.Pre a:hover{color:#d15100}.Pre button{background-color:#666;border-radius:3px;color:#fefefe;margin:0 .2em;padding:1px 3px;border:0 none}.Pre pre{overflow-x:auto}.Pre pre > code{display:block;padding:0 1em 0}.Pre pre > code:last-child{padding:0 1em 1em}.SkipLink{height:1px;left:0;overflow:hidden;position:absolute;top:0;width:1px}#Magic.light{background-color:#eeeeee;color:#232323}h1:target,h2:target,h3:target,h4:target,h5:target{text-decoration:underline}:target > h1:first-child,:target > h2:first-child,:target > h3:first-child,:target > h4:first-child,:target > h5:first-child{text-decoration:underline}a:hover{color:#fefefe}.light a{color:#232323}.light a:hover{color:#232323}.Page{margin-bottom:3em}h4{font-size:1.1em}p{line-height:1.8}.light .Menu li.active > a{color:#232323}.Menu li.active li a{text-decoration:none}.Gpdr svg.icon,.NoSpy svg.icon{left:0.5em;bottom:0.5em}@media screen and (min-width:900px){.Gdpr input[type=button]{margin:1em 3% 0 0;max-width:30%;width:auto}}@media screen and (min-width:1024px){.Header{width:210px;position:fixed;float:left;max-height:100vh;height:100vh;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.Header p{font-size:1em}.Header .Menu{max-width:210px;padding:0 0 2em}.Logo{float:none}.Menu{max-width:210px;padding:0 0 2em}.Page{float:right;width:calc(100% - 220px);min-height:83vh}.Footer{clear:both}}@media screen and (min-width:500px{.Header .Menu{width:auto;float:left}} \ No newline at end of file +html{scroll-behavior:smooth;overflow-y:scroll}h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,img,picture,source,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video,div,body{border:0;box-sizing:border-box;font:inherit;font-size:100%;margin:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1.5;margin:0;max-width:100vw;overflow-x:hidden;padding:0;font-family:"Ubuntu Narrow",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,sans-serif}ul{display:inline-block;list-style:none}ol{display:inline-block;list-style:inside decimal}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}a{cursor:pointer;outline:none;white-space:nowrap;color:#eeeeee;text-decoration:underline;transition:color 500ms}b,strong{font-weight:700}i,em{font-style:italic}button,.button,input[type="reset"],input[type="button"],input[type="submit"],input[type="file"] > input[type="button"]{background-color:#9E9E9E;color:#212121;cursor:pointer;padding:0.5em}button:hover,.button:hover,input[type="reset"]:hover,input[type="button"]:hover,input[type="submit"]:hover,input[type="file"] > input[type="button"]:hover{background-color:#616161;color:#F5F5F5}button::-moz-focus-inner,.button::-moz-focus-inner,input[type="reset"]::-moz-focus-inner,input[type="button"]::-moz-focus-inner,input[type="submit"]::-moz-focus-inner,input[type="file"] > input[type="button"]::-moz-focus-inner{border:0 none;padding:0}#Magic{height:100%;min-height:100vh;width:100%;background-color:#232323;color:#cccccc;transition:color 300ms,background-color 300ms;font-weight:400}#Magic .icon{width:1.5em;height:auto;-webkit-animation:showHoisted 500ms 0s forwards;animation:showHoisted 500ms 0s forwards;opacity:0}.Wrapper{margin:0 auto;max-width:1300px;width:90%}.Header{display:inline-block;width:100%;padding:.5em 0 0}.Header .Logo{display:inline-block}.Header .Logo img{float:left}.Header .Logo span{float:left;font-size:1.5em;margin:.7em .2em}.Page h1{padding:1em 0 .2em}.Footer{width:100%;padding:2em 0 .5em;position:relative}h1,h2,h3,h4,h5{padding:1em 0 .2em}h1{font-size:1.4em}h2{font-size:1.3em}h3{font-size:1.2em}@-webkit-keyframes showHoisted{0%{opacity:0}100%{opacity:1}}@keyframes showHoisted{0%{opacity:0}100%{opacity:1}}.Credits{clear:both;display:block;margin:2em 0 1em}.Credits a{color:#cccccc;text-decoration:underline}.Credits a:hover{color:#c4c4c4}.Footer .Container{text-align:center}.Gdpr .Container{background-color:#212121;border:1px solid;border-radius:.5em;color:#F5F5F5;display:inline-block;padding:1em;position:fixed;text-align:left;left:0.5em;bottom:0.5em}.light .Gdpr .Container{background-color:#F5F5F5;color:#212121}.Gdpr .icon{position:fixed;left:0.5em;bottom:0.5em;cursor:pointer;color:#9E9E9E;stroke:#9E9E9E;fill:#9E9E9E}.Gdpr .icon:hover{color:#616161;stroke:#616161;fill:#616161}.Gdpr h3{padding:0;margin:0}.Gdpr h4{display:inline;font-weight:bold}.Gdpr input[type=button]{display:inline-block;margin:0.5em 0;width:100%}.Gdpr ul{display:block}.GitBadges{display:inline-block;margin:15px 0}.GitBadges img{height:23px}.GitBadges li{margin:0 .5em 0 0;display:inline-block;float:left}.Header .Menu{display:inline-block;width:100%}.Header p{font-size:1.5em}.LightSwitch{bottom:2.5em;cursor:pointer;fill:#9E9E9E;left:0.5em;padding:0;position:fixed}.LightSwitch:hover{fill:#616161}.Logo{float:left;height:2.4em}.Logo .stroke{fill:none;stroke:#663695;stroke-width:15;stroke-linecap:round;stroke-linejoin:round}.Logo .stroke.white{stroke:#ffffff}.Logo svg{display:inline-block;width:3em;height:auto}.Menu{float:none;margin:1.5em 0 0;position:relative;display:block;clear:both}.Menu li{float:none;margin:0 .5em 0 0;display:block}.Menu li.active > a{text-decoration:underline;color:#fefefe}.Menu li a{display:block;text-decoration:none}.Menu ul ul{position:relative;left:0;border-left:1px dotted;display:block;margin:0 0 0 0.2em;padding:0 0 0 0.3em}.Pre{background-color:#121212;border:1px solid #666;border-radius:5px;color:#eee;counter-reset:line;display:block;font-family:monospace;line-height:1.3;margin:1em 0;padding:1em .5em 0 .2em;position:relative;text-align:left;transition:color 300ms,background-color 300ms;white-space:pre}.Pre.lines pre > code{counter-increment:line;padding:0}.Pre.lines pre > code:last-child{padding:0 0 1em}.Pre.lines pre > code:before{content:counter(line);display:inline-block;padding:0 .5em 0 0;text-align:right;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:3ch}.Pre .actions{color:blueviolet}.Pre .boolean{color:#7979e4}.Pre .builtin{color:cadetblue}.Pre .colon{color:#8eef8e}.Pre .comment{opacity:0.7;font-style:italic}.Pre .html{color:#008800}.Pre .keyword{color:violet}.light .Pre{background-color:#ddd;color:#111}.light .Pre > code:before{color:#666}.light .Pre .html{color:#008800}.light .Pre .keyword{color:purple}.light .Pre .builtin{color:cadetblue}.light .Pre .string{color:#d15100}.light .Pre .colon{color:#016301}.light .Pre .boolean{color:blue}.light .Pre .actions{color:blueviolet}.light .Pre .state{color:cornflowerblue}.light .Pre .comment{color:#555;opacity:0.8;font-style:italic}.light .Pre .object{color:#016301}.light .Pre .property{color:#2a952a}.light .Pre a{color:#d15100}.light .Pre a:hover{color:turquoise}.Pre .menu{position:absolute;margin-top:-2em;right:0}.Pre .object{color:#00ff00}.Pre .property{color:#8eef8e}.Pre .state{color:cornflowerblue}.Pre .string{color:#dd8f00}.Pre > code:before{color:#666}.Pre a{color:turquoise}.Pre a:hover{color:#d15100}.Pre button{background-color:#666;border-radius:3px;color:#fefefe;margin:0 .2em;padding:1px 3px;border:0 none}.Pre pre{overflow-x:auto}.Pre pre > code{display:block;padding:0 1em 0}.Pre pre > code:last-child{padding:0 1em 1em}.SkipLink{height:1px;left:0;overflow:hidden;position:absolute;top:0;width:1px}#Magic.light{background-color:#eeeeee;color:#232323}h1:target,h2:target,h3:target,h4:target,h5:target{text-decoration:underline}:target > h1:first-child,:target > h2:first-child,:target > h3:first-child,:target > h4:first-child,:target > h5:first-child{text-decoration:underline}a:hover{color:#fefefe}.light a{color:#232323}.light a:hover{color:#232323}.Page{margin-bottom:3em}h4{font-size:1.1em}p{line-height:1.8}.light .Menu li.active > a{color:#232323}.Menu li.active li a{text-decoration:none}@media screen and (min-width:900px){.Gdpr input[type=button]{margin:1em 3% 0 0;max-width:30%;width:auto}}@media screen and (min-width:1024px){.Header{width:210px;position:fixed;float:left;max-height:100vh;height:100vh;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.Header p{font-size:1em}.Header .Menu{max-width:210px;padding:0 0 2em}.Logo{float:none}.Menu{max-width:210px;padding:0 0 2em}.Page{float:right;width:calc(100% - 220px);min-height:83vh}.Footer{clear:both}}@media screen and (min-width:500px{.Header .Menu{width:auto;float:left}} \ No newline at end of file diff --git a/docs/magic.js b/docs/magic.js index 4d24a83..b245633 100644 --- a/docs/magic.js +++ b/docs/magic.js @@ -1 +1 @@ -"use strict";function b(a){return s(a)||c(a)||n(a)||m()}function c(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function d(a,b){if(null==a)return{};var c,d,f=e(a,b);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(a);for(d=0;da.length)&&(b=a.length);for(var c=0,d=Array(b);cy)for(;x<=z;)c.insertBefore(p(u[x]=v(u[x++]),f,g),(k=t[w])&&k.node);else if(x>z)for(;w<=y;)c.removeChild(t[w++].node);else{for(var A=w,B={},C={};A<=y;A++)null!=(l=t[A].key)&&(B[l]=t[A]);for(;x<=z;){if(l=q(k=t[w]),m=q(u[x]=v(u[x],k)),C[l]||null!=m&&m===q(t[w+1])){null==l&&c.removeChild(k.node),w++;continue}null==m||1===d.type?(null==l&&(r(c,k&&k.node,k,u[x],f,g),x++),w++):(l===m?(r(c,k.node,k,u[x],f,g),C[m]=!0,w++):null==(h=B[m])?r(c,k&&k.node,null,u[x],f,g):(r(c,c.insertBefore(h.node,k&&k.node),h,u[x],f,g),C[m]=!0),x++)}for(;w<=y;)null==q(k=t[w++])&&c.removeChild(k.node);for(var A in B)null==C[A]&&c.removeChild(B[A].node)}}return e.node=c},s=function(c,a){for(var b in c)if(c[b]!==a[b])return!0;for(var b in a)if(c[b]!==a[b])return!0},u=function(a){return"object"===t(a)?a:x(a)},v=function(b,c){return b.type===a?((!c||!c.lazy||s(c.lazy,b.lazy))&&((c=u(b.lazy.view(b.lazy))).lazy=b.lazy),c):b},w=function(a,b,c,d,e,f){return{name:a,props:b,children:c,node:d,type:f,key:e}},x=function(a,e){return w(a,c,d,e,void 0,b)},y=function(a){return a.nodeType===b?x(a.nodeValue,a):w(a.nodeName.toLowerCase(),c,e.call(a.childNodes,y),a,void 0,1)};return{h:function h(a,b){for(var d,e=[],g=[],h=arguments.length;2"],stringRegex:/("|')(.*?)\1/gim,wordRegex:/( )/gim},preventDefault:function preventDefault(a){return a.preventDefault(),a},tryCatch:function tryCatch(a){return function(){try{return a.apply(void 0,arguments)}catch(a){return a}}}},oa={changeTheme:function changeTheme(a){return j(j({},a),{},{pageClass:j(j({},a.pageClass),{},{light:"dark"===a.theme}),theme:"dark"===a.theme?"light":"dark"})},gdpr:{allowAll:function allowAll(a){return[j({},a),[na.db.set,{key:"magic-gdpr",value:{allowed:a.cookies.map(function(a){return a.name}),show:!1},action:oa.gdpr.show}]]},allowSome:function allowSome(a){return[j({},a),[na.db.set,{key:"magic-gdpr",value:{allowed:a.gdpr.allowed,show:!1},action:oa.gdpr.show}]]},deny:function deny(a){return[a,[na.db.set,{key:"magic-gdpr",value:{allowed:[],show:!1},action:oa.gdpr.show}]]},show:function(a,b){var c=b.show,d=b.allowed,e=void 0===d?a.gdpr.allowed:d;return b.value&&(c=b.value.show,b.value.allowed&&(e=b.value.allowed)),"boolean"==typeof c?(a.gdpr.show=c,a.gdpr.allowed=e,j({},a)):a},toggleAllow:function toggleAllow(a,b){var d=b.name,e=a.gdpr.allowed.includes(d);return e?a.gdpr.allowed=a.gdpr.allowed.filter(function(a){return a!==d}):a.gdpr.allowed.push(d),j({},a)}},go:function go(a,b){var c=b.currentTarget.href.replace(window.location.origin,""),d=c.split("#"),e=l(d,2),f=e[0],g=e[1],h=void 0===g?"":g;if(f===a.url&&h===a.hash)return h&&(window.location.hash=h),a;var i=window,k=i.scrollY,m=a.pages&&a.pages[f]&&a.pages[f].title;if(m&&(document.title=a.title=m),f===a.url)window.location.hash=h;else if(!h){var n=document.getElementsByTagName("html"),o=l(n,1),p=o[0],q=p.style.scrollBehavior;p.style.scrollBehavior="auto",window.scrollTo({top:0,behavior:"smooth"}),p.style.scrollBehavior=q}return window.history.pushState({url:f,hash:h,scrollY:k},a.title,c),j(j({},a),{},{url:f,hash:h,prev:a.url})},pop:function pop(a,b){var c=window.location,d=c.pathname,e=c.hash;e=e.substring(1);var f=0;return b.state&&(d=b.state.url,e=b.state.hash,f=b.state.scrollY||0),e?window.location.hash=e:window.scroll({top:f,behavior:"smooth"}),j(j({},a),{},{url:d,hash:e})},pre:{clip:function clip(a,b){var c=b.content;if("undefined"!=typeof document&&"function"==typeof document.execCommand){var d=document.createElement("textarea");d.id="copy",d.innerHTML=c,document.body.appendChild(d);var e=document.getElementById("copy");e.select(),document.execCommand("copy"),document.body.removeChild(e)}return a}}},pa={"/gdpr/":function gdpr(){return[g({id:"magic-modulesgdpr"},"@magic-modules/gdpr"),O(["this is the\n",ga({to:"https://github.com/magic-modules",text:"@magic-modules"}),"\nGdpr component."]),O("adds a gdpr compliant information popup with minimal intrusion and complexity to your page."),ca("@magic-modules/gdpr"),B({id:"installation"},"installation:"),ma({lines:"false"},"npm install --save-exact @magic-modules/gdpr"),B({id:"usage"},"usage"),C({id:"activate"},"activate"),O("to activate Gdpr, add it to the list of hoisted modules"),ma("// src/config.mjs\nexport default {\n // ... other config variables\n\n HOIST: ['Gdpr'],\n}"),O("after doing this, the gdpr module will show up.'),"),C({id:"change-contents-add-cookies"},"change contents, add cookies"),ma("// /src/app.mjs\nexport const state = {\n gdpr: {\n allowAllText: 'button text for allow all data',\n allowText: 'button text for allow selected data',\n allowTitle: 'Title above the three cookie buttons',\n content: 'String or Array of Magic modules',\n denyText: 'button text for no data allowed',\n noDataText: 'Button text if no cookies are defined',\n title: 'Title text for the gdpr popup',\n },\n cookies: [\n ['name', { title: 'cookie1 title', content: 'cookie description' }],\n ['cookie 2', { title: 'cookie title', content: 'cookie content' }],\n ],\n})"),B({id:"source"},"source"),O(["the source for this page is in the\n",ga({to:"https://github.com/magic-modules/gdpr/tree/master/example",text:"example directory"}),",\nand gets built and published to github using\n",ga({to:"https://github.com/magic/core",text:"@magic/core"})])]},"/gdpr/404/":function gdpr404(){return y("404 - not found.")}};h({init:[j(j({},W),{},{url:window.location.pathname,hash:window.location.hash.substr(1)}),[[na.db.get,{key:"magic-gdpr",action:oa.gdpr.show}]]],subscriptions:function subscriptions(){return[[X.listenPopState,oa.pop]]},view:function(a){var b=pa[a.url]?a.url:"/404/",c=pa[b],d=a.pages&&a.pages[b];return d&&Object.keys(d).forEach(function(b){a[b]=d[b]}),a.url=b,la({page:c,state:a},[fa(a),ba(a)])},node:document.getElementById("Magic")}); \ No newline at end of file +"use strict";function b(a){return s(a)||c(a)||n(a)||m()}function c(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function d(a,b){if(null==a)return{};var c,d,f=e(a,b);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(a);for(d=0;da.length)&&(b=a.length);for(var c=0,d=Array(b);cy)for(;x<=z;)c.insertBefore(p(u[x]=v(u[x++]),f,g),(k=t[w])&&k.node);else if(x>z)for(;w<=y;)c.removeChild(t[w++].node);else{for(var A=w,B={},C={};A<=y;A++)null!=(l=t[A].key)&&(B[l]=t[A]);for(;x<=z;){if(l=q(k=t[w]),m=q(u[x]=v(u[x],k)),C[l]||null!=m&&m===q(t[w+1])){null==l&&c.removeChild(k.node),w++;continue}null==m||1===d.type?(null==l&&(r(c,k&&k.node,k,u[x],f,g),x++),w++):(l===m?(r(c,k.node,k,u[x],f,g),C[m]=!0,w++):null==(h=B[m])?r(c,k&&k.node,null,u[x],f,g):(r(c,c.insertBefore(h.node,k&&k.node),h,u[x],f,g),C[m]=!0),x++)}for(;w<=y;)null==q(k=t[w++])&&c.removeChild(k.node);for(var A in B)null==C[A]&&c.removeChild(B[A].node)}}return e.node=c},s=function(c,a){for(var b in c)if(c[b]!==a[b])return!0;for(var b in a)if(c[b]!==a[b])return!0},u=function(a){return"object"===t(a)?a:x(a)},v=function(b,c){return b.type===a?((!c||!c.lazy||s(c.lazy,b.lazy))&&((c=u(b.lazy.view(b.lazy))).lazy=b.lazy),c):b},w=function(a,b,c,d,e,f){return{name:a,props:b,children:c,node:d,type:f,key:e}},x=function(a,e){return w(a,c,d,e,void 0,b)},y=function(a){return a.nodeType===b?x(a.nodeValue,a):w(a.nodeName.toLowerCase(),c,e.call(a.childNodes,y),a,void 0,1)};return{h:function h(a,b){for(var d,e=[],g=[],h=arguments.length;2"],stringRegex:/("|')(.*?)\1/gim,wordRegex:/( )/gim},preventDefault:function preventDefault(a){return a.preventDefault(),a},tryCatch:function tryCatch(a){return function(){try{return a.apply(void 0,arguments)}catch(a){return a}}}},oa={changeTheme:function changeTheme(a){return j(j({},a),{},{pageClass:j(j({},a.pageClass),{},{light:"dark"===a.theme}),theme:"dark"===a.theme?"light":"dark"})},gdpr:{allowAll:function allowAll(a){return[j({},a),[na.db.set,{key:"magic-gdpr",value:{allowed:a.cookies.map(function(a){return a.name}),show:!1},action:oa.gdpr.show}]]},allowSome:function allowSome(a){return[j({},a),[na.db.set,{key:"magic-gdpr",value:{allowed:a.gdpr.allowed,show:!1},action:oa.gdpr.show}]]},deny:function deny(a){return[a,[na.db.set,{key:"magic-gdpr",value:{allowed:[],show:!1},action:oa.gdpr.show}]]},show:function(a,b){var c=b.show,d=b.allowed,e=void 0===d?a.gdpr.allowed:d;return b.value&&(c=b.value.show,b.value.allowed&&(e=b.value.allowed)),"boolean"==typeof c?(a.gdpr.show=c,a.gdpr.allowed=e,j({},a)):a},toggleAllow:function toggleAllow(a,b){var d=b.name,e=a.gdpr.allowed.includes(d);return e?a.gdpr.allowed=a.gdpr.allowed.filter(function(a){return a!==d}):a.gdpr.allowed.push(d),j({},a)}},go:function go(a,b){var c=b.currentTarget.href.replace(window.location.origin,""),d=c.split("#"),e=l(d,2),f=e[0],g=e[1],h=void 0===g?"":g;if(f===a.url&&h===a.hash)return h&&(window.location.hash=h),a;var i=window,k=i.scrollY,m=a.pages&&a.pages[f]&&a.pages[f].title;if(m&&(document.title=a.title=m),f===a.url)window.location.hash=h;else if(!h){var n=document.getElementsByTagName("html"),o=l(n,1),p=o[0],q=p.style.scrollBehavior;p.style.scrollBehavior="auto",window.scrollTo({top:0,behavior:"smooth"}),p.style.scrollBehavior=q}return window.history.pushState({url:f,hash:h,scrollY:k},a.title,c),j(j({},a),{},{url:f,hash:h,prev:a.url})},pop:function pop(a,b){var c=window.location,d=c.pathname,e=c.hash;e=e.substring(1);var f=0;return b.state&&(d=b.state.url,e=b.state.hash,f=b.state.scrollY||0),e?window.location.hash=e:window.scroll({top:f,behavior:"smooth"}),j(j({},a),{},{url:d,hash:e})},pre:{clip:function clip(a,b){var c=b.content;if("undefined"!=typeof document&&"function"==typeof document.execCommand){var d=document.createElement("textarea");d.id="copy",d.innerHTML=c,document.body.appendChild(d);var e=document.getElementById("copy");e.select(),document.execCommand("copy"),document.body.removeChild(e)}return a}}},pa={"/gdpr/":function gdpr(){return[g({id:"magic-modulesgdpr"},"@magic-modules/gdpr"),O(["this is the\n",ga({to:"https://github.com/magic-modules",text:"@magic-modules"}),"\nGdpr component."]),O("adds a gdpr compliant information popup with minimal intrusion and complexity to your page."),ca("@magic-modules/gdpr"),B({id:"installation"},"installation:"),ma({lines:"false"},"npm install --save-exact @magic-modules/gdpr"),B({id:"usage"},"usage"),C({id:"activate"},"activate"),O("to activate Gdpr, add it to the list of hoisted modules"),ma("// src/config.mjs\nexport default {\n // ... other config variables\n\n HOIST: ['Gdpr'],\n}"),O("after doing this, the gdpr module will show up.'),"),C({id:"change-contents-add-cookies"},"change contents, add cookies"),ma("// /src/app.mjs\nexport const state = {\n gdpr: {\n allowAllText: 'button text for allow all data',\n allowText: 'button text for allow selected data',\n allowTitle: 'Title above the three cookie buttons',\n content: 'String or Array of Magic modules',\n denyText: 'button text for no data allowed',\n noDataText: 'Button text if no cookies are defined',\n title: 'Title text for the gdpr popup',\n },\n cookies: [\n ['name', { title: 'cookie1 title', content: 'cookie description' }],\n ['cookie 2', { title: 'cookie title', content: 'cookie content' }],\n ],\n})"),B({id:"source"},"source"),O(["the source for this page is in the\n",ga({to:"https://github.com/magic-modules/gdpr/tree/master/example",text:"example directory"}),",\nand gets built and published to github using\n",ga({to:"https://github.com/magic/core",text:"@magic/core"})])]},"/gdpr/404/":function gdpr404(){return y("404 - not found.")}};h({init:[j(j({},W),{},{url:window.location.pathname,hash:window.location.hash.substr(1)}),[[na.db.get,{key:"magic-gdpr",action:oa.gdpr.show}]]],subscriptions:function subscriptions(){return[[X.listenPopState,oa.pop]]},view:function(a){var b=pa[a.url]?a.url:"/404/",c=pa[b],d=a.pages&&a.pages[b];return d&&Object.keys(d).forEach(function(b){a[b]=d[b]}),a.url=b,la({page:c,state:a},[fa(a),ba(a)])},node:document.getElementById("Magic")}); \ No newline at end of file diff --git a/docs/sri-hashes.json b/docs/sri-hashes.json index 59eb3d8..faadb65 100644 --- a/docs/sri-hashes.json +++ b/docs/sri-hashes.json @@ -1,8 +1,8 @@ { - "/magic.css": "sha384-Wi9faqSbI+ITATz8u1GY10j42nh3Zdl/9buo3WCUzPSc0dHP2XyMCNBifq+nf47p", - "/magic.js": "sha384-uatJhLW9H/VgBC4fHC8b+5zSlBkeDrgGQpVvkSo3pBjnL7FfUuMUAHRSEBskejbX", - "/gdpr/": "sha384-9fhzYsrjTHfmUvsESNUDB4KrtT6AQyfCcUE+IgwDt8AA2cKLyHWVxjMbndkRAuAh", - "/gdpr/404/": "sha384-76xARHyJHX4qnnuKDgvHnt4ZkgU1TCRYXiL/dx4x7nLObMAuPN5fCmu4JPEB6obW", + "/magic.css": "sha384-CwSx5l4tph+FTpxYom8zsYncI+QREjy8Q4GSWdjz4MGli+K9as0a46Ij1NlaN4Ko", + "/magic.js": "sha384-c1EUGEc6Cpb99OG1ASQxAvDmEyJkqjmHiK47Z6C4VbI70WGWtUZk2zkUyuZSukEg", + "/gdpr/": "sha384-6B3IPWQIHYjqqnjdCyd+lkKmHsGBx6ygno22B6qz7JEJfbem64zyTSWVWi2GYtuU", + "/gdpr/404/": "sha384-7As9UUpt19gOFDJUHekotB5YtOaEBFuS5P5/f00QGmmTm3Z3nnVx2wvXqCGsNefP", "/robots.txt": "sha384-ecOQzusX3in/IhiCS3OVe/lCOk5j8t0L3tCGM57ZnutJq8rNVX846mJIxNCl57wB", "/sitemap.xml": "sha384-N8x+fBHEpDh4WdqHJ2vfU5tjNUHt3iDrmmQMaDQOxFGwOm33u1emknKHnprGnkyN" } \ No newline at end of file