@20minutes/hela 0.0.3 → 0.0.4

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.
@@ -0,0 +1 @@
1
+ (function(t){"use strict";const n=global;var u=Object.defineProperty,l=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,i=(e,r,a)=>r in e?u(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,o=(e,r)=>{for(var a in r||(r={}))y.call(r,a)&&i(e,a,r[a]);if(l)for(var a of l(r))c.call(r,a)&&i(e,a,r[a]);return e};const d=()=>({page_uri:"/"}),b=()=>({darkmode:0}),s=()=>{var e,r;return{signature:((e=n.datalayer)==null?void 0:e.signature)||void 0,nbParagraphs:((r=n.datalayer)==null?void 0:r.nbParagraphs)||void 0}},v=()=>{const e=d(),r=b(),a=s();n.datalayer=o(o(o({},e),r),a)};return t.initDatalayer=v,Object.defineProperty(t,"__esModule",{value:!0}),t})({});
@@ -1 +1 @@
1
- (function(){"use strict";const c=(e,t)=>{const n=e==="dark";t.setAttribute("aria-checked",String(n));const r=t.querySelector("span[aria-hidden]");r&&(r.setAttribute("aria-hidden",String(n)),r.innerHTML=n?"on":"off")},s=(e=document.querySelector(".js-switch-dark-mode"))=>{const t=localStorage.getItem("theme")||"light";t&&e&&(document.documentElement.dataset.theme=t,c(t,e))},u=(e=document.querySelector(".js-switch-dark-mode"))=>{e&&e.addEventListener("click",()=>{const t=document.documentElement.dataset.theme,n=!t||t==="light"?"dark":"light";document.documentElement.dataset.theme=n,localStorage.setItem("theme",n),c(n,e)})},m=(e,t)=>{t.preventDefault();const n=t.target,r=e.querySelectorAll('[role="tab"]'),o=e.querySelectorAll('[role="tabpanel"]'),b=n.getAttribute("aria-controls"),d=Object.values(o).find(a=>a.id===b);r.forEach(a=>{a.setAttribute("aria-selected","false")}),o.forEach(a=>{a.setAttribute("aria-hidden","true")}),n.setAttribute("aria-selected","true"),d&&d.removeAttribute("aria-hidden")},i=e=>e.code==="ArrowLeft"||e.keyCode===39,l=e=>e.code==="ArrowRight"||e.keyCode===37,h=(e=document.querySelector(".js-tabs"))=>{if(e){const t=e.querySelectorAll('[role="tab"]');t.forEach(r=>{r.addEventListener("click",m.bind(!1,e))});const n=e.querySelector('[role="tablist"]');if(n&&t.length>0){let r=0;n.addEventListener("keydown",o=>{o instanceof KeyboardEvent&&(i(o)||l(o))&&(t[r].setAttribute("tabindex","-1"),i(o)?(r+=1,r>=t.length&&(r=0)):l(o)&&(r-=1,r<0&&(r=t.length-1)),t[r].setAttribute("tabindex","0"),t[r].focus())})}}};s(),u(),h()})();
1
+ (function(){"use strict";const c=(t,e)=>{const r=t==="dark";e.setAttribute("aria-checked",String(r));const a=e.querySelector("span[aria-hidden]");a&&(a.setAttribute("aria-hidden",String(r)),a.innerHTML=r?"on":"off")},h=(t=document.querySelector(".js-switch-dark-mode"))=>{const e=localStorage.getItem("theme")||"light";e&&t&&(document.documentElement.dataset.theme=e,c(e,t))},y=(t=document.querySelector(".js-switch-dark-mode"))=>{t&&t.addEventListener("click",()=>{const e=document.documentElement.dataset.theme,r=!e||e==="light"?"dark":"light";document.documentElement.dataset.theme=r,localStorage.setItem("theme",r),c(r,t)})},l=global;var g=Object.defineProperty,d=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,s=(t,e,r)=>e in t?g(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,i=(t,e)=>{for(var r in e||(e={}))f.call(e,r)&&s(t,r,e[r]);if(d)for(var r of d(e))v.call(e,r)&&s(t,r,e[r]);return t};const p=()=>({page_uri:"/"}),S=()=>({darkmode:0}),A=()=>{var t,e;return{signature:((t=l.datalayer)==null?void 0:t.signature)||void 0,nbParagraphs:((e=l.datalayer)==null?void 0:e.nbParagraphs)||void 0}},E=()=>{const t=p(),e=S(),r=A();l.datalayer=i(i(i({},t),e),r)},k=(t,e)=>{e.preventDefault();const r=e.target,a=t.querySelectorAll('[role="tab"]'),o=t.querySelectorAll('[role="tabpanel"]'),O=r.getAttribute("aria-controls"),m=Object.values(o).find(n=>n.id===O);a.forEach(n=>{n.setAttribute("aria-selected","false")}),o.forEach(n=>{n.setAttribute("aria-hidden","true")}),r.setAttribute("aria-selected","true"),m&&m.removeAttribute("aria-hidden")},u=t=>t.code==="ArrowLeft"||t.keyCode===39,b=t=>t.code==="ArrowRight"||t.keyCode===37,w=(t=document.querySelector(".js-tabs"))=>{if(t){const e=t.querySelectorAll('[role="tab"]');e.forEach(a=>{a.addEventListener("click",k.bind(!1,t))});const r=t.querySelector('[role="tablist"]');if(r&&e.length>0){let a=0;r.addEventListener("keydown",o=>{o instanceof KeyboardEvent&&(u(o)||b(o))&&(e[a].setAttribute("tabindex","-1"),u(o)?(a+=1,a>=e.length&&(a=0)):b(o)&&(a-=1,a<0&&(a=e.length-1)),e[a].setAttribute("tabindex","0"),e[a].focus())})}}};h(),y(),w(),E()})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@20minutes/hela",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",