@20minutes/hela
Advanced tools
Comparing version 0.1.12 to 0.1.13
@@ -1,1 +0,1 @@ | ||
(function(){"use strict";const s=(t,e)=>{const r=t==="dark";e.setAttribute("aria-checked",String(r));const n=e.querySelector("span[aria-hidden]");n&&(n.setAttribute("aria-hidden",String(r)),n.innerHTML=r?"on":"off")},b=(t=document.querySelector(".js-switch-dark-mode"))=>{const e=localStorage.getItem("theme")||"light";e&&t&&(document.documentElement.dataset.theme=e,s(e,t))},m=(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),s(r,t)})},h=t=>{var e;const r=t.querySelector(".js-expandButton__label");t.setAttribute("aria-expanded","true"),r.innerHTML="Voir moins",(e=t.previousElementSibling)==null||e.setAttribute("aria-hidden","false")},v=t=>{var e;const r=t.querySelector(".js-expandButton__label");t.setAttribute("aria-expanded","false"),r.innerHTML="Voir plus",(e=t.previousElementSibling)==null||e.setAttribute("aria-hidden","true")},_=t=>{const e=t.currentTarget;return e.getAttribute("aria-expanded")==="true"?v(e):h(e)},L=(t=document.querySelector(".js-expandButton"))=>{t&&t.addEventListener("click",_)},f=(t,e)=>{e.stopImmediatePropagation(),e.preventDefault();const r=e.currentTarget,n=document.querySelectorAll(".js-collapse__button"),c=document.querySelectorAll('[role="tabpanel"]'),o=r.getAttribute("aria-controls"),l=Object.values(c).find(i=>i.id===o);if(r.getAttribute("aria-expanded")==="true"){r.setAttribute("aria-expanded","false"),l?.setAttribute("aria-hidden","true");return}n.forEach(i=>{i.setAttribute("aria-expanded","false")}),c.forEach(i=>{i.setAttribute("aria-hidden","true")}),r.setAttribute("aria-expanded","true"),l&&l.removeAttribute("aria-hidden")},S=(t=document.querySelector(".js-collapse__button"))=>{t&&document.querySelectorAll(".c-collapse__button").forEach(e=>{e.addEventListener("click",f.bind(!1,t))})},p=(t,e)=>{e.preventDefault();const r=e.target,n=t.querySelectorAll('[role="tab"]'),c=t.querySelectorAll('[role="tabpanel"]'),o=r.getAttribute("aria-controls"),l=Object.values(c).find(i=>i.id===o);n.forEach(i=>{i.setAttribute("aria-selected","false")}),c.forEach(i=>{i.setAttribute("aria-hidden","true")}),r.setAttribute("aria-selected","true"),l&&l.removeAttribute("aria-hidden")},a=t=>t.code==="ArrowLeft"||t.keyCode===39,d=t=>t.code==="ArrowRight"||t.keyCode===37,y=(t=document.querySelector(".js-tabs"))=>{if(t){const e=t.querySelectorAll('[role="tab"]');e.forEach(n=>{n.addEventListener("click",p.bind(!1,t))});const r=t.querySelector('[role="tablist"]');if(r&&e.length>0){let n=0;r.addEventListener("keydown",c=>{c instanceof KeyboardEvent&&(a(c)||d(c))&&(e[n].setAttribute("tabindex","-1"),a(c)?(n+=1,n>=e.length&&(n=0)):d(c)&&(n-=1,n<0&&(n=e.length-1)),e[n].setAttribute("tabindex","0"),e[n].focus())})}}},g=t=>{const e=document.documentElement.scrollTop;let r=document.documentElement.scrollHeight-document.documentElement.clientHeight;const n=t&&document.querySelector(".js-limit-scroll-progress-bar");n&&(r=n.scrollHeight-document.documentElement.clientHeight+(window.pageYOffset+n.getBoundingClientRect().top));const c=Math.round(e/r*100),o=document.querySelector(".c-progress__bar");o&&(o.style.width=`${c}%`,c>=100&&(o.style.width="100%"))},E=(t=document.querySelector(".c-progress"),e=!1)=>{t&&window.addEventListener("scroll",g.bind(!1,e))};var u=(t=>(t.MOBILE="mobile",t.DESKTOP="desktop",t))(u||{});const A=({breadcrumbList:t,btnNext:e,btnPrev:r})=>{t&&(t.scrollLeft>0&&(t.scrollLeft+t.clientWidth<t.scrollWidth&&e.classList.add("c-breadcrumb__button-container--visible"),e.classList.remove("c-breadcrumb__button-container--visible"),r.classList.add("c-breadcrumb__button-container--visible")),t.clientWidth<t.scrollWidth?e.classList.add("c-breadcrumb__button-container--visible"):(r.classList.remove("c-breadcrumb__button-container--visible"),e.classList.remove("c-breadcrumb__button-container--visible")),t.scrollLeft+t.clientWidth===t.scrollWidth&&e.classList.remove("c-breadcrumb__button-container--visible"))},q=({breadcrumbList:t,btnNext:e,btnPrev:r})=>{if(t)if(t.scrollWidth-t.clientWidth>t.clientWidth)t.scrollLeft+=Math.ceil(t.clientWidth*.7),r.classList.add("c-breadcrumb__button-container--visible"),t.scrollLeft+t.clientWidth>=t.scrollWidth&&e.classList.remove("c-breadcrumb__button-container--visible");else{const n=t.scrollWidth-t.clientWidth;t.scrollLeft+=n,e.classList.remove("c-breadcrumb__button-container--visible"),r.classList.add("c-breadcrumb__button-container--visible")}},x=({breadcrumbList:t,btnNext:e,btnPrev:r})=>{t&&(t.clientWidth<t.scrollLeft?(t.scrollLeft-=t.clientWidth*.7,e.classList.add("c-breadcrumb__button-container--visible")):(t.scrollLeft=0,r.classList.remove("c-breadcrumb__button-container--visible"),t.clientWidth<t.scrollWidth&&e.classList.add("c-breadcrumb__button-container--visible")))},W=({breadcrumbList:t,btnNext:e,btnPrev:r})=>{A({breadcrumbList:t,btnNext:e,btnPrev:r})},w=(t=document.querySelector(".c-breadcrumb"))=>{if(t){const e=t.querySelector(".c-breadcrumb__viewport"),r=t.querySelector(".c-breadcrumb__button-container--next-button"),n=t.querySelector(".c-breadcrumb__button-container--previous-button");e&&e.clientWidth<e.scrollWidth&&r?.classList.add("c-breadcrumb__button-container--visible"),r?.addEventListener("click",q.bind(!1,{breadcrumbList:e,btnNext:r,btnPrev:n})),n?.addEventListener("click",x.bind(!1,{breadcrumbList:e,btnNext:r,btnPrev:n}))}},k=(t=document.querySelector(".c-breadcrumb"))=>{if(t){const e=t.querySelector(".c-breadcrumb__viewport"),r=t.querySelector(".c-breadcrumb__button-container--next-button"),n=t.querySelector(".c-breadcrumb__button-container--previous-button");window.addEventListener("resize",W.bind(!1,{breadcrumbList:e,btnNext:r,btnPrev:n}))}};(()=>{b(),m(),L(),y(),S(),E(),window.layout===u.DESKTOP&&(w(),k())})()})(); | ||
(function(){"use strict";const s=(t,e)=>{const r=t==="dark";e.setAttribute("aria-checked",String(r));const n=e.querySelector("span[aria-hidden]");n&&(n.setAttribute("aria-hidden",String(r)),n.innerHTML=r?"on":"off")},b=(t=document.querySelector(".js-switch-dark-mode"))=>{const e=localStorage.getItem("theme")||"light";e&&t&&(document.documentElement.dataset.theme=e,s(e,t))},m=(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),s(r,t)})},h=t=>{var e;const r=t.querySelector(".js-expandButton__label");t.setAttribute("aria-expanded","true"),r.innerHTML="Voir moins",(e=t.previousElementSibling)==null||e.setAttribute("aria-hidden","false")},v=t=>{var e;const r=t.querySelector(".js-expandButton__label");t.setAttribute("aria-expanded","false"),r.innerHTML="Voir plus",(e=t.previousElementSibling)==null||e.setAttribute("aria-hidden","true")},_=t=>{const e=t.currentTarget;return t.preventDefault(),e.getAttribute("aria-expanded")==="true"?v(e):h(e)},L=(t=document.querySelector(".js-expandButton"))=>{t&&document.querySelectorAll(".js-expandButton").forEach(e=>e.addEventListener("click",_))},f=(t,e)=>{e.stopImmediatePropagation(),e.preventDefault();const r=e.currentTarget,n=document.querySelectorAll(".js-collapse__button"),c=document.querySelectorAll('[role="tabpanel"]'),o=r.getAttribute("aria-controls"),l=Object.values(c).find(i=>i.id===o);if(r.getAttribute("aria-expanded")==="true"){r.setAttribute("aria-expanded","false"),l?.setAttribute("aria-hidden","true");return}n.forEach(i=>{i.setAttribute("aria-expanded","false")}),c.forEach(i=>{i.setAttribute("aria-hidden","true")}),r.setAttribute("aria-expanded","true"),l&&l.removeAttribute("aria-hidden")},p=(t=document.querySelector(".js-collapse__button"))=>{t&&document.querySelectorAll(".c-collapse__button").forEach(e=>{e.addEventListener("click",f.bind(!1,t))})},S=(t,e)=>{e.preventDefault();const r=e.target,n=t.querySelectorAll('[role="tab"]'),c=t.querySelectorAll('[role="tabpanel"]'),o=r.getAttribute("aria-controls"),l=Object.values(c).find(i=>i.id===o);n.forEach(i=>{i.setAttribute("aria-selected","false")}),c.forEach(i=>{i.setAttribute("aria-hidden","true")}),r.setAttribute("aria-selected","true"),l&&l.removeAttribute("aria-hidden")},a=t=>t.code==="ArrowLeft"||t.keyCode===39,d=t=>t.code==="ArrowRight"||t.keyCode===37,y=(t=document.querySelector(".js-tabs"))=>{if(t){const e=t.querySelectorAll('[role="tab"]');e.forEach(n=>{n.addEventListener("click",S.bind(!1,t))});const r=t.querySelector('[role="tablist"]');if(r&&e.length>0){let n=0;r.addEventListener("keydown",c=>{c instanceof KeyboardEvent&&(a(c)||d(c))&&(e[n].setAttribute("tabindex","-1"),a(c)?(n+=1,n>=e.length&&(n=0)):d(c)&&(n-=1,n<0&&(n=e.length-1)),e[n].setAttribute("tabindex","0"),e[n].focus())})}}},g=t=>{const e=document.documentElement.scrollTop;let r=document.documentElement.scrollHeight-document.documentElement.clientHeight;const n=t&&document.querySelector(".js-limit-scroll-progress-bar");n&&(r=n.scrollHeight-document.documentElement.clientHeight+(window.pageYOffset+n.getBoundingClientRect().top));const c=Math.round(e/r*100),o=document.querySelector(".c-progress__bar");o&&(o.style.width=`${c}%`,c>=100&&(o.style.width="100%"))},E=(t=document.querySelector(".c-progress"),e=!1)=>{t&&window.addEventListener("scroll",g.bind(!1,e))};var u=(t=>(t.MOBILE="mobile",t.DESKTOP="desktop",t))(u||{});const A=({breadcrumbList:t,btnNext:e,btnPrev:r})=>{t&&(t.scrollLeft>0&&(t.scrollLeft+t.clientWidth<t.scrollWidth&&e.classList.add("c-breadcrumb__button-container--visible"),e.classList.remove("c-breadcrumb__button-container--visible"),r.classList.add("c-breadcrumb__button-container--visible")),t.clientWidth<t.scrollWidth?e.classList.add("c-breadcrumb__button-container--visible"):(r.classList.remove("c-breadcrumb__button-container--visible"),e.classList.remove("c-breadcrumb__button-container--visible")),t.scrollLeft+t.clientWidth===t.scrollWidth&&e.classList.remove("c-breadcrumb__button-container--visible"))},q=({breadcrumbList:t,btnNext:e,btnPrev:r})=>{if(t)if(t.scrollWidth-t.clientWidth>t.clientWidth)t.scrollLeft+=Math.ceil(t.clientWidth*.7),r.classList.add("c-breadcrumb__button-container--visible"),t.scrollLeft+t.clientWidth>=t.scrollWidth&&e.classList.remove("c-breadcrumb__button-container--visible");else{const n=t.scrollWidth-t.clientWidth;t.scrollLeft+=n,e.classList.remove("c-breadcrumb__button-container--visible"),r.classList.add("c-breadcrumb__button-container--visible")}},x=({breadcrumbList:t,btnNext:e,btnPrev:r})=>{t&&(t.clientWidth<t.scrollLeft?(t.scrollLeft-=t.clientWidth*.7,e.classList.add("c-breadcrumb__button-container--visible")):(t.scrollLeft=0,r.classList.remove("c-breadcrumb__button-container--visible"),t.clientWidth<t.scrollWidth&&e.classList.add("c-breadcrumb__button-container--visible")))},W=({breadcrumbList:t,btnNext:e,btnPrev:r})=>{A({breadcrumbList:t,btnNext:e,btnPrev:r})},w=(t=document.querySelector(".c-breadcrumb"))=>{if(t){const e=t.querySelector(".c-breadcrumb__viewport"),r=t.querySelector(".c-breadcrumb__button-container--next-button"),n=t.querySelector(".c-breadcrumb__button-container--previous-button");e&&e.clientWidth<e.scrollWidth&&r?.classList.add("c-breadcrumb__button-container--visible"),r?.addEventListener("click",q.bind(!1,{breadcrumbList:e,btnNext:r,btnPrev:n})),n?.addEventListener("click",x.bind(!1,{breadcrumbList:e,btnNext:r,btnPrev:n}))}},k=(t=document.querySelector(".c-breadcrumb"))=>{if(t){const e=t.querySelector(".c-breadcrumb__viewport"),r=t.querySelector(".c-breadcrumb__button-container--next-button"),n=t.querySelector(".c-breadcrumb__button-container--previous-button");window.addEventListener("resize",W.bind(!1,{breadcrumbList:e,btnNext:r,btnPrev:n}))}};(()=>{b(),m(),L(),y(),p(),E(),window.layout===u.DESKTOP&&(w(),k())})()})(); |
{ | ||
"name": "@20minutes/hela", | ||
"version": "0.1.12", | ||
"version": "0.1.13", | ||
"repository": "git@github.com:20minutes/hela.git", | ||
@@ -52,13 +52,13 @@ "license": "MIT", | ||
"@types/merge-stream": "^1.1.2", | ||
"@types/node": "^18.11.7", | ||
"@types/node": "^18.11.8", | ||
"@types/react": "^18.0.24", | ||
"@types/react-dom": "^18.0.8", | ||
"@typescript-eslint/eslint-plugin": "^5.41.0", | ||
"@typescript-eslint/parser": "^5.41.0", | ||
"@typescript-eslint/eslint-plugin": "^5.42.0", | ||
"@typescript-eslint/parser": "^5.42.0", | ||
"@vitejs/plugin-react": "^2.2.0", | ||
"autoprefixer": "^10.4.13", | ||
"babel-loader": "^9.0.0", | ||
"babel-loader": "^9.0.1", | ||
"babel-preset-env": "^1.7.0", | ||
"babel-preset-react": "^6.24.1", | ||
"cssnano": "^5.1.13", | ||
"cssnano": "^5.1.14", | ||
"eslint": "^8.26.0", | ||
@@ -89,6 +89,6 @@ "eslint-config-airbnb": "^19.0.4", | ||
"stylelint-config-standard-scss": "^6.0.0", | ||
"svg-sprite": "2.0.0", | ||
"svg-sprite": "2.0.1", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.8.4", | ||
"vite": "^3.2.0" | ||
"vite": "^3.2.2" | ||
}, | ||
@@ -95,0 +95,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2745857
47522