@opensea/react-media
Advanced tools
Comparing version 4.0.0-rc.0 to 4.0.0-rc.1
@@ -1,2 +0,2 @@ | ||
"use strict";var W=Object.create;var n=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var H=(e,i)=>{for(var t in i)n(e,t,{get:i[t],enumerable:!0})},S=(e,i,t,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of I(i))!g.call(e,r)&&r!==t&&n(e,r,{get:()=>i[r],enumerable:!(o=y(i,r))||o.enumerable});return e};var z=(e,i,t)=>(t=e!=null?W(M(e)):{},S(i||!e||!e.__esModule?n(t,"default",{value:e,enumerable:!0}):t,e)),R=e=>S(n({},"__esModule",{value:!0}),e);var E={};H(E,{createMedia:()=>B,useIsHydrated:()=>x,useWindowSize:()=>s});module.exports=R(E);var T=require("@artsy/fresnel");var l=require("@artsy/fresnel"),f=require("use-context-selector");var m=z(require("react")),c=require("use-context-selector");var p=z(require("lodash.throttle")),a=require("react"),s=(e={width:void 0,height:void 0})=>{let[i,t]=(0,a.useState)(e);return(0,a.useEffect)(()=>{let o=()=>{t({width:window.innerWidth,height:window.innerHeight})},r=(0,p.default)(o,100);return window.addEventListener("resize",r),o(),()=>window.removeEventListener("resize",r)},[]),i};var u=({initialWindowSize:e})=>{let i=(0,c.createContext)(e);return{SizeProvider:({children:o})=>{let r=s(e);return m.default.createElement(i.Provider,{value:r},o)},SizeContext:i}};function P(e,{initialWindowSize:i={}}={}){let{SizeProvider:t,SizeContext:o}=u({initialWindowSize:i});function r(C){return(0,f.useContextSelector)(o,C)}let{Media:w,MediaContextProvider:v}=(0,l.createMedia)({breakpoints:e});return{Media:w,SizeProvider:t,useSizeContextSelector:r,MediaContextProvider:v}}var d=require("react"),h=!1,x=()=>{let[e,i]=(0,d.useState)(h);return(0,d.useEffect)(()=>{h=!0,e||i(!0)},[]),e};function B(e,i={}){let{createMediaStyle:t}=(0,T.createMedia)({breakpoints:e});return{createMediaStyle:t,breakpoints:e,prepareComponents:()=>P(e,i)}}0&&(module.exports={createMedia,useIsHydrated,useWindowSize}); | ||
"use strict";"use client";var W=Object.create;var n=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var H=(e,i)=>{for(var t in i)n(e,t,{get:i[t],enumerable:!0})},S=(e,i,t,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of I(i))!g.call(e,r)&&r!==t&&n(e,r,{get:()=>i[r],enumerable:!(o=y(i,r))||o.enumerable});return e};var z=(e,i,t)=>(t=e!=null?W(M(e)):{},S(i||!e||!e.__esModule?n(t,"default",{value:e,enumerable:!0}):t,e)),R=e=>S(n({},"__esModule",{value:!0}),e);var E={};H(E,{createMedia:()=>B,useIsHydrated:()=>x,useWindowSize:()=>s});module.exports=R(E);var T=require("@artsy/fresnel");var l=require("@artsy/fresnel"),f=require("use-context-selector");var m=z(require("react")),c=require("use-context-selector");var p=z(require("lodash.throttle")),a=require("react"),s=(e={width:void 0,height:void 0})=>{let[i,t]=(0,a.useState)(e);return(0,a.useEffect)(()=>{let o=()=>{t({width:window.innerWidth,height:window.innerHeight})},r=(0,p.default)(o,100);return window.addEventListener("resize",r),o(),()=>window.removeEventListener("resize",r)},[]),i};var u=({initialWindowSize:e})=>{let i=(0,c.createContext)(e);return{SizeProvider:({children:o})=>{let r=s(e);return m.default.createElement(i.Provider,{value:r},o)},SizeContext:i}};function P(e,{initialWindowSize:i={}}={}){let{SizeProvider:t,SizeContext:o}=u({initialWindowSize:i});function r(C){return(0,f.useContextSelector)(o,C)}let{Media:w,MediaContextProvider:v}=(0,l.createMedia)({breakpoints:e});return{Media:w,SizeProvider:t,useSizeContextSelector:r,MediaContextProvider:v}}var d=require("react"),h=!1,x=()=>{let[e,i]=(0,d.useState)(h);return(0,d.useEffect)(()=>{h=!0,e||i(!0)},[]),e};function B(e,i={}){let{createMediaStyle:t}=(0,T.createMedia)({breakpoints:e});return{createMediaStyle:t,breakpoints:e,prepareComponents:()=>P(e,i)}}0&&(module.exports={createMedia,useIsHydrated,useWindowSize}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@opensea/react-media", | ||
"version": "4.0.0-rc.0", | ||
"version": "4.0.0-rc.1", | ||
"description": "Javascript library to deal with media queries in isomorphic React applications.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -0,1 +1,3 @@ | ||
"use client"; | ||
import { createMedia as artsyCreateMedia } from "@artsy/fresnel"; | ||
@@ -2,0 +4,0 @@ import { prepareComponents } from "./prepareComponents"; |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
26925
169
0