nextjs-darkmode
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -1,1 +0,1 @@ | ||
"use strict";var l=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var o in e)l(t,o,{get:e[o],enumerable:!0})},E=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of R(e))!x.call(t,s)&&s!==o&&l(t,s,{get:()=>e[s],enumerable:!(r=y(e,s))||r.enumerable});return t};var M=t=>E(l({},"__esModule",{value:!0}),t);var b={};w(b,{Core:()=>A});module.exports=M(b);var S="system",i="dark",v="";var C=require("r18gs");var g=()=>(0,C.useRGS)("ndm",()=>{if(typeof document=="undefined")return{m:S,s:i};let[t,e]=["m","sm"].map(o=>document.documentElement.getAttribute("data-"+o));return{m:t!=null?t:S,s:e}});var p=t=>{var r;let[e,o]=["system","dark"];window.u=(s,m)=>{let c=s===e?m:s,n=document.documentElement;c===o?n.classList.add(o):n.classList.remove(o),[["sm",m],["rm",c],["m",s]].forEach(([a,P])=>n.setAttribute(`data-${a}`,P)),localStorage.setItem(t,s)},window.q=matchMedia(`(prefers-color-scheme: ${o})`),u((r=localStorage.getItem(t))!=null?r:e,q.matches?o:"")};var h=require("react/jsx-runtime"),f,d,T=({n:t,k:e})=>(0,h.jsx)("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${p.toString()})('${e}')`},nonce:t}),L=(t="none",e="")=>{let o=document,r=o.createElement("style");return r.textContent=`*,*:after,*:before{transition:${t.split(";")[0]} !important;}`,r.setAttribute("nonce",e),o.head.appendChild(r),()=>{getComputedStyle(o.body),setTimeout(()=>o.head.removeChild(r),1)}},A=({t,nonce:e,k:o="o"})=>{let r=typeof window!="undefined";r&&!window.q&&p(o);let[{m:s,s:m},c]=g();if(!d&&r&&([f,d]=[q,u],f.addEventListener("change",()=>c(n=>({...n,s:f.matches?i:v}))),addEventListener("storage",n=>{n.key===o&&c(a=>({...a,m:n.newValue}))})),d){let n=L(t,e);d(s,m),n()}return(0,h.jsx)(T,{n:e,k:o})};0&&(module.exports={Core}); | ||
"use strict";var f=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var T=(e,o)=>{for(var t in o)f(e,t,{get:o[t],enumerable:!0})},A=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of L(o))!M.call(e,r)&&r!==t&&f(e,r,{get:()=>o[r],enumerable:!(s=E(o,r))||s.enumerable});return e};var b=e=>A(f({},"__esModule",{value:!0}),e);var I={};T(I,{Core:()=>$});module.exports=b(I);var h="system",S="dark",P="";var R=require("r18gs");var y=()=>(0,R.useRGS)("ndm",()=>{if(typeof document=="undefined")return{m:h,s:S};let[e,o]=["m","sm"].map(t=>document.documentElement.getAttribute("data-"+t));return{m:e!=null?e:h,s:o}});var v=(e,o,t)=>{var i;let[s,r]=["system","dark"];window.u=(n,c)=>{let d=n===s?c:n,a=document,p=document.documentElement,l=a.createElement("style");l.textContent=`*,*:after,*:before{transition:${o.split(";")[0]} !important;}`,l.setAttribute("nonce",t),a.head.appendChild(l),d===r?p.classList.add(r):p.classList.remove(r),[["sm",c],["rm",d],["m",n]].forEach(([x,w])=>p.setAttribute(`data-${x}`,w)),localStorage.setItem(e,n),getComputedStyle(a.body),setTimeout(()=>a.head.removeChild(l),1)},window.q=matchMedia(`(prefers-color-scheme: ${r})`),u((i=localStorage.getItem(e))!=null?i:s,q.matches?r:"")};var g=require("react/jsx-runtime"),C,m,k=({n:e,k:o,t})=>(0,g.jsx)("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${v.toString()})(${[o,t,e].map(s=>`'${s}'`)})`},nonce:e}),$=({t:e="none",nonce:o="",k:t="o"})=>{let s=typeof window!="undefined";s&&!window.q&&v(t,e,o);let[{m:r,s:i},n]=y();return!m&&s&&([C,m]=[q,u],C.addEventListener("change",()=>n(c=>({...c,s:C.matches?S:P}))),addEventListener("storage",c=>{c.key===t&&n(d=>({...d,m:c.newValue}))})),m==null||m(r,i),(0,g.jsx)(k,{n:o,k:t,t:e})};0&&(module.exports={Core}); |
"use client"; | ||
"use strict";var l=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var o in e)l(t,o,{get:e[o],enumerable:!0})},E=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of R(e))!x.call(t,s)&&s!==o&&l(t,s,{get:()=>e[s],enumerable:!(r=y(e,s))||r.enumerable});return t};var M=t=>E(l({},"__esModule",{value:!0}),t);var b={};w(b,{Core:()=>A});module.exports=M(b);var S="system",i="dark",v="";var C=require("r18gs");var g=()=>(0,C.useRGS)("ndm",()=>{if(typeof document=="undefined")return{m:S,s:i};let[t,e]=["m","sm"].map(o=>document.documentElement.getAttribute("data-"+o));return{m:t!=null?t:S,s:e}});var p=t=>{var r;let[e,o]=["system","dark"];window.u=(s,m)=>{let c=s===e?m:s,n=document.documentElement;c===o?n.classList.add(o):n.classList.remove(o),[["sm",m],["rm",c],["m",s]].forEach(([a,P])=>n.setAttribute(`data-${a}`,P)),localStorage.setItem(t,s)},window.q=matchMedia(`(prefers-color-scheme: ${o})`),u((r=localStorage.getItem(t))!=null?r:e,q.matches?o:"")};var h=require("react/jsx-runtime"),f,d,T=({n:t,k:e})=>(0,h.jsx)("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${p.toString()})('${e}')`},nonce:t}),L=(t="none",e="")=>{let o=document,r=o.createElement("style");return r.textContent=`*,*:after,*:before{transition:${t.split(";")[0]} !important;}`,r.setAttribute("nonce",e),o.head.appendChild(r),()=>{getComputedStyle(o.body),setTimeout(()=>o.head.removeChild(r),1)}},A=({t,nonce:e,k:o="o"})=>{let r=typeof window!="undefined";r&&!window.q&&p(o);let[{m:s,s:m},c]=g();if(!d&&r&&([f,d]=[q,u],f.addEventListener("change",()=>c(n=>({...n,s:f.matches?i:v}))),addEventListener("storage",n=>{n.key===o&&c(a=>({...a,m:n.newValue}))})),d){let n=L(t,e);d(s,m),n()}return(0,h.jsx)(T,{n:e,k:o})};0&&(module.exports={Core}); | ||
"use strict";var f=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var T=(e,o)=>{for(var t in o)f(e,t,{get:o[t],enumerable:!0})},A=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of L(o))!M.call(e,r)&&r!==t&&f(e,r,{get:()=>o[r],enumerable:!(s=E(o,r))||s.enumerable});return e};var b=e=>A(f({},"__esModule",{value:!0}),e);var I={};T(I,{Core:()=>$});module.exports=b(I);var h="system",S="dark",P="";var R=require("r18gs");var y=()=>(0,R.useRGS)("ndm",()=>{if(typeof document=="undefined")return{m:h,s:S};let[e,o]=["m","sm"].map(t=>document.documentElement.getAttribute("data-"+t));return{m:e!=null?e:h,s:o}});var v=(e,o,t)=>{var i;let[s,r]=["system","dark"];window.u=(n,c)=>{let d=n===s?c:n,a=document,p=document.documentElement,l=a.createElement("style");l.textContent=`*,*:after,*:before{transition:${o.split(";")[0]} !important;}`,l.setAttribute("nonce",t),a.head.appendChild(l),d===r?p.classList.add(r):p.classList.remove(r),[["sm",c],["rm",d],["m",n]].forEach(([x,w])=>p.setAttribute(`data-${x}`,w)),localStorage.setItem(e,n),getComputedStyle(a.body),setTimeout(()=>a.head.removeChild(l),1)},window.q=matchMedia(`(prefers-color-scheme: ${r})`),u((i=localStorage.getItem(e))!=null?i:s,q.matches?r:"")};var g=require("react/jsx-runtime"),C,m,k=({n:e,k:o,t})=>(0,g.jsx)("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${v.toString()})(${[o,t,e].map(s=>`'${s}'`)})`},nonce:e}),$=({t:e="none",nonce:o="",k:t="o"})=>{let s=typeof window!="undefined";s&&!window.q&&v(t,e,o);let[{m:r,s:i},n]=y();return!m&&s&&([C,m]=[q,u],C.addEventListener("change",()=>n(c=>({...c,s:C.matches?S:P}))),addEventListener("storage",c=>{c.key===t&&n(d=>({...d,m:c.newValue}))})),m==null||m(r,i),(0,g.jsx)(k,{n:o,k:t,t:e})};0&&(module.exports={Core}); |
@@ -7,2 +7,2 @@ import { ColorSchemePreference, ResolvedScheme } from "../../utils"; | ||
/** function to be injected in script tag for avoiding FOUC */ | ||
export declare const noFOUCScript: (storageKey: string) => void; | ||
export declare const noFOUCScript: (storageKey: string, themeTransition: string, nonce: string) => void; |
@@ -1,1 +0,1 @@ | ||
"use strict";var l=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var f=(o,e)=>{for(var r in e)l(o,r,{get:e[r],enumerable:!0})},v=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of S(e))!h.call(o,c)&&c!==r&&l(o,c,{get:()=>e[c],enumerable:!(t=i(e,c))||t.enumerable});return o};var C=o=>v(l({},"__esModule",{value:!0}),o);var p={};f(p,{noFOUCScript:()=>g});module.exports=C(p);var g=o=>{var t;let[e,r]=["system","dark"];window.u=(c,a)=>{let m=c===e?a:c,s=document.documentElement;m===r?s.classList.add(r):s.classList.remove(r),[["sm",a],["rm",m],["m",c]].forEach(([n,d])=>s.setAttribute(`data-${n}`,d)),localStorage.setItem(o,c)},window.q=matchMedia(`(prefers-color-scheme: ${r})`),u((t=localStorage.getItem(o))!=null?t:e,q.matches?r:"")};0&&(module.exports={noFOUCScript}); | ||
"use strict";var m=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var g=(o,e)=>{for(var r in e)m(o,r,{get:e[r],enumerable:!0})},b=(o,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of v(e))!C.call(o,t)&&t!==r&&m(o,t,{get:()=>e[t],enumerable:!(s=p(e,t))||s.enumerable});return o};var w=o=>b(m({},"__esModule",{value:!0}),o);var E={};g(E,{noFOUCScript:()=>y});module.exports=w(E);var y=(o,e,r)=>{var d;let[s,t]=["system","dark"];window.u=(c,i)=>{let h=c===s?i:c,n=document,l=document.documentElement,a=n.createElement("style");a.textContent=`*,*:after,*:before{transition:${e.split(";")[0]} !important;}`,a.setAttribute("nonce",r),n.head.appendChild(a),h===t?l.classList.add(t):l.classList.remove(t),[["sm",i],["rm",h],["m",c]].forEach(([S,f])=>l.setAttribute(`data-${S}`,f)),localStorage.setItem(o,c),getComputedStyle(n.body),setTimeout(()=>n.head.removeChild(a),1)},window.q=matchMedia(`(prefers-color-scheme: ${t})`),u((d=localStorage.getItem(o))!=null?d:s,q.matches?t:"")};0&&(module.exports={noFOUCScript}); |
"use client"; | ||
"use strict";var l=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var o in e)l(t,o,{get:e[o],enumerable:!0})},E=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of R(e))!x.call(t,s)&&s!==o&&l(t,s,{get:()=>e[s],enumerable:!(r=y(e,s))||r.enumerable});return t};var M=t=>E(l({},"__esModule",{value:!0}),t);var b={};w(b,{Core:()=>A});module.exports=M(b);var S="system",i="dark",v="";var C=require("r18gs");var g=()=>(0,C.useRGS)("ndm",()=>{if(typeof document=="undefined")return{m:S,s:i};let[t,e]=["m","sm"].map(o=>document.documentElement.getAttribute("data-"+o));return{m:t!=null?t:S,s:e}});var p=t=>{var r;let[e,o]=["system","dark"];window.u=(s,m)=>{let c=s===e?m:s,n=document.documentElement;c===o?n.classList.add(o):n.classList.remove(o),[["sm",m],["rm",c],["m",s]].forEach(([a,P])=>n.setAttribute(`data-${a}`,P)),localStorage.setItem(t,s)},window.q=matchMedia(`(prefers-color-scheme: ${o})`),u((r=localStorage.getItem(t))!=null?r:e,q.matches?o:"")};var h=require("react/jsx-runtime"),f,d,T=({n:t,k:e})=>(0,h.jsx)("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${p.toString()})('${e}')`},nonce:t}),L=(t="none",e="")=>{let o=document,r=o.createElement("style");return r.textContent=`*,*:after,*:before{transition:${t.split(";")[0]} !important;}`,r.setAttribute("nonce",e),o.head.appendChild(r),()=>{getComputedStyle(o.body),setTimeout(()=>o.head.removeChild(r),1)}},A=({t,nonce:e,k:o="o"})=>{let r=typeof window!="undefined";r&&!window.q&&p(o);let[{m:s,s:m},c]=g();if(!d&&r&&([f,d]=[q,u],f.addEventListener("change",()=>c(n=>({...n,s:f.matches?i:v}))),addEventListener("storage",n=>{n.key===o&&c(a=>({...a,m:n.newValue}))})),d){let n=L(t,e);d(s,m),n()}return(0,h.jsx)(T,{n:e,k:o})};0&&(module.exports={Core}); | ||
"use strict";var f=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var T=(e,o)=>{for(var t in o)f(e,t,{get:o[t],enumerable:!0})},A=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of L(o))!M.call(e,r)&&r!==t&&f(e,r,{get:()=>o[r],enumerable:!(s=E(o,r))||s.enumerable});return e};var b=e=>A(f({},"__esModule",{value:!0}),e);var I={};T(I,{Core:()=>$});module.exports=b(I);var h="system",S="dark",P="";var R=require("r18gs");var y=()=>(0,R.useRGS)("ndm",()=>{if(typeof document=="undefined")return{m:h,s:S};let[e,o]=["m","sm"].map(t=>document.documentElement.getAttribute("data-"+t));return{m:e!=null?e:h,s:o}});var v=(e,o,t)=>{var i;let[s,r]=["system","dark"];window.u=(n,c)=>{let d=n===s?c:n,a=document,p=document.documentElement,l=a.createElement("style");l.textContent=`*,*:after,*:before{transition:${o.split(";")[0]} !important;}`,l.setAttribute("nonce",t),a.head.appendChild(l),d===r?p.classList.add(r):p.classList.remove(r),[["sm",c],["rm",d],["m",n]].forEach(([x,w])=>p.setAttribute(`data-${x}`,w)),localStorage.setItem(e,n),getComputedStyle(a.body),setTimeout(()=>a.head.removeChild(l),1)},window.q=matchMedia(`(prefers-color-scheme: ${r})`),u((i=localStorage.getItem(e))!=null?i:s,q.matches?r:"")};var g=require("react/jsx-runtime"),C,m,k=({n:e,k:o,t})=>(0,g.jsx)("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${v.toString()})(${[o,t,e].map(s=>`'${s}'`)})`},nonce:e}),$=({t:e="none",nonce:o="",k:t="o"})=>{let s=typeof window!="undefined";s&&!window.q&&v(t,e,o);let[{m:r,s:i},n]=y();return!m&&s&&([C,m]=[q,u],C.addEventListener("change",()=>n(c=>({...c,s:C.matches?S:P}))),addEventListener("storage",c=>{c.key===t&&n(d=>({...d,m:c.newValue}))})),m==null||m(r,i),(0,g.jsx)(k,{n:o,k:t,t:e})};0&&(module.exports={Core}); |
"use client"; | ||
"use strict";var l=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var o in e)l(t,o,{get:e[o],enumerable:!0})},E=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of R(e))!x.call(t,s)&&s!==o&&l(t,s,{get:()=>e[s],enumerable:!(r=y(e,s))||r.enumerable});return t};var M=t=>E(l({},"__esModule",{value:!0}),t);var b={};w(b,{Core:()=>A});module.exports=M(b);var S="system",i="dark",v="";var C=require("r18gs");var P=()=>(0,C.useRGS)("ndm",()=>{if(typeof document=="undefined")return{m:S,s:i};let[t,e]=["m","sm"].map(o=>document.documentElement.getAttribute("data-"+o));return{m:t!=null?t:S,s:e}});var p=t=>{var r;let[e,o]=["system","dark"];window.u=(s,m)=>{let c=s===e?m:s,n=document.documentElement;c===o?n.classList.add(o):n.classList.remove(o),[["sm",m],["rm",c],["m",s]].forEach(([a,g])=>n.setAttribute(`data-${a}`,g)),localStorage.setItem(t,s)},window.q=matchMedia(`(prefers-color-scheme: ${o})`),u((r=localStorage.getItem(t))!=null?r:e,q.matches?o:"")};var h=require("react/jsx-runtime"),f,d,T=({n:t,k:e})=>(0,h.jsx)("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${p.toString()})('${e}')`},nonce:t}),L=(t="none",e="")=>{let o=document,r=o.createElement("style");return r.textContent=`*,*:after,*:before{transition:${t.split(";")[0]} !important;}`,r.setAttribute("nonce",e),o.head.appendChild(r),()=>{getComputedStyle(o.body),setTimeout(()=>o.head.removeChild(r),1)}},A=({t,nonce:e,k:o="o"})=>{let r=typeof window!="undefined";r&&!window.q&&p(o);let[{m:s,s:m},c]=P();if(!d&&r&&([f,d]=[q,u],f.addEventListener("change",()=>c(n=>({...n,s:f.matches?i:v}))),addEventListener("storage",n=>{n.key===o&&c(a=>({...a,m:n.newValue}))})),d){let n=L(t,e);d(s,m),n()}return(0,h.jsx)(T,{n:e,k:o})};0&&(module.exports={Core}); | ||
"use strict";var f=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var T=(e,o)=>{for(var r in o)f(e,r,{get:o[r],enumerable:!0})},A=(e,o,r,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of L(o))!M.call(e,t)&&t!==r&&f(e,t,{get:()=>o[t],enumerable:!(s=E(o,t))||s.enumerable});return e};var b=e=>A(f({},"__esModule",{value:!0}),e);var I={};T(I,{Core:()=>$});module.exports=b(I);var h="system",S="dark",P="";var R=require("r18gs");var y=()=>(0,R.useRGS)("ndm",()=>{if(typeof document=="undefined")return{m:h,s:S};let[e,o]=["m","sm"].map(r=>document.documentElement.getAttribute("data-"+r));return{m:e!=null?e:h,s:o}});var v=(e,o,r)=>{var i;let[s,t]=["system","dark"];window.u=(n,c)=>{let d=n===s?c:n,l=document,p=document.documentElement,a=l.createElement("style");a.textContent=`*,*:after,*:before{transition:${o.split(";")[0]} !important;}`,a.setAttribute("nonce",r),l.head.appendChild(a),d===t?p.classList.add(t):p.classList.remove(t),[["sm",c],["rm",d],["m",n]].forEach(([x,w])=>p.setAttribute(`data-${x}`,w)),localStorage.setItem(e,n),getComputedStyle(l.body),setTimeout(()=>l.head.removeChild(a),1)},window.q=matchMedia(`(prefers-color-scheme: ${t})`),u((i=localStorage.getItem(e))!=null?i:s,q.matches?t:"")};var g=require("react/jsx-runtime"),C,m,k=({n:e,k:o,t:r})=>(0,g.jsx)("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${v.toString()})(${[o,r,e].map(s=>`'${s}'`)})`},nonce:e}),$=({t:e="none",nonce:o="",k:r="o"})=>{let s=typeof window!="undefined";s&&!window.q&&v(r,e,o);let[{m:t,s:i},n]=y();return!m&&s&&([C,m]=[q,u],C.addEventListener("change",()=>n(c=>({...c,s:C.matches?S:P}))),addEventListener("storage",c=>{c.key===r&&n(d=>({...d,m:c.newValue}))})),m==null||m(t,i),(0,g.jsx)(k,{n:o,k:r,t:e})};0&&(module.exports={Core}); |
@@ -5,3 +5,3 @@ { | ||
"private": false, | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Unleash the Power of React Server Components! Use dark/light mode on your site with confidence, without losing any advantages of React Server Components", | ||
@@ -81,4 +81,4 @@ "license": "MPL-2.0", | ||
"peerDependencies": { | ||
"@types/react": "16.8 - 19", | ||
"react": "16.8 - 19" | ||
"@types/react": ">=16.8", | ||
"react": ">=16.8" | ||
}, | ||
@@ -85,0 +85,0 @@ "funding": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
38208
197