react-native-unistyles 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,8 +9,8 @@ var _utils = require("../utils");
9
9
  const useDimensions = () => {
10
10
  const timerRef = (0, _react.useRef)();
11
11
  const [screenSize, setScreenSize] = (0, _react.useState)({
12
- width: _utils.isServer ? 0 : window.innerWidth,
13
- height: _utils.isServer ? 0 : window.innerHeight
12
+ width: _utils.isServer ? undefined : window.innerWidth,
13
+ height: _utils.isServer ? undefined : window.innerHeight
14
14
  });
15
15
  (0, _react.useEffect)(() => {
16
16
  const handleResize = () => {
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_utils","useDimensions","timerRef","useRef","screenSize","setScreenSize","useState","width","isServer","window","innerWidth","height","innerHeight","useEffect","handleResize","clearTimeout","current","setTimeout","addEventListener","removeEventListener","exports"],"sourceRoot":"../../../src","sources":["hooks/useDimensions.web.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEO,MAAME,aAAa,GAAGA,CAAA,KAAkB;EAC3C,MAAMC,QAAQ,GAAG,IAAAC,aAAM,EAAgC,CAAC;EACxD,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,EAAa;IACrDC,KAAK,EAAEC,eAAQ,GAAG,CAAC,GAAGC,MAAM,CAACC,UAAU;IACvCC,MAAM,EAAEH,eAAQ,GAAG,CAAC,GAAGC,MAAM,CAACG;EAClC,CAAC,CAAC;EAEF,IAAAC,gBAAS,EAAC,MAAM;IACZ,MAAMC,YAAY,GAAGA,CAAA,KAAM;MACvBC,YAAY,CAACb,QAAQ,CAACc,OAAO,CAAC;MAE9Bd,QAAQ,CAACc,OAAO,GAAGC,UAAU,CAAC,MAAMZ,aAAa,CAAC;QAC9CE,KAAK,EAAEE,MAAM,CAACC,UAAU;QACxBC,MAAM,EAAEF,MAAM,CAACG;MACnB,CAAC,CAAC,EAAE,GAAG,CAAC;IACZ,CAAC;IAEDH,MAAM,CAACS,gBAAgB,CAAC,QAAQ,EAAEJ,YAAY,CAAC;IAE/C,OAAO,MAAM;MACTL,MAAM,CAACU,mBAAmB,CAAC,QAAQ,EAAEL,YAAY,CAAC;MAClDC,YAAY,CAACb,QAAQ,CAACc,OAAO,CAAC;IAClC,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOZ,UAAU;AACrB,CAAC;AAAAgB,OAAA,CAAAnB,aAAA,GAAAA,aAAA"}
1
+ {"version":3,"names":["_react","require","_utils","useDimensions","timerRef","useRef","screenSize","setScreenSize","useState","width","isServer","undefined","window","innerWidth","height","innerHeight","useEffect","handleResize","clearTimeout","current","setTimeout","addEventListener","removeEventListener","exports"],"sourceRoot":"../../../src","sources":["hooks/useDimensions.web.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEO,MAAME,aAAa,GAAGA,CAAA,KAAkB;EAC3C,MAAMC,QAAQ,GAAG,IAAAC,aAAM,EAAgC,CAAC;EACxD,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,EAAa;IACrDC,KAAK,EAAEC,eAAQ,GACTC,SAAS,GACTC,MAAM,CAACC,UAAU;IACvBC,MAAM,EAAEJ,eAAQ,GACVC,SAAS,GACTC,MAAM,CAACG;EACjB,CAAe,CAAC;EAEhB,IAAAC,gBAAS,EAAC,MAAM;IACZ,MAAMC,YAAY,GAAGA,CAAA,KAAM;MACvBC,YAAY,CAACd,QAAQ,CAACe,OAAO,CAAC;MAE9Bf,QAAQ,CAACe,OAAO,GAAGC,UAAU,CAAC,MAAMb,aAAa,CAAC;QAC9CE,KAAK,EAAEG,MAAM,CAACC,UAAU;QACxBC,MAAM,EAAEF,MAAM,CAACG;MACnB,CAAC,CAAC,EAAE,GAAG,CAAC;IACZ,CAAC;IAEDH,MAAM,CAACS,gBAAgB,CAAC,QAAQ,EAAEJ,YAAY,CAAC;IAE/C,OAAO,MAAM;MACTL,MAAM,CAACU,mBAAmB,CAAC,QAAQ,EAAEL,YAAY,CAAC;MAClDC,YAAY,CAACd,QAAQ,CAACe,OAAO,CAAC;IAClC,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOb,UAAU;AACrB,CAAC;AAAAiB,OAAA,CAAApB,aAAA,GAAAA,aAAA"}
@@ -3,8 +3,8 @@ import { isServer } from '../utils';
3
3
  export const useDimensions = () => {
4
4
  const timerRef = useRef();
5
5
  const [screenSize, setScreenSize] = useState({
6
- width: isServer ? 0 : window.innerWidth,
7
- height: isServer ? 0 : window.innerHeight
6
+ width: isServer ? undefined : window.innerWidth,
7
+ height: isServer ? undefined : window.innerHeight
8
8
  });
9
9
  useEffect(() => {
10
10
  const handleResize = () => {
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useRef","useState","isServer","useDimensions","timerRef","screenSize","setScreenSize","width","window","innerWidth","height","innerHeight","handleResize","clearTimeout","current","setTimeout","addEventListener","removeEventListener"],"sourceRoot":"../../../src","sources":["hooks/useDimensions.web.ts"],"mappings":"AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAEnD,SAASC,QAAQ,QAAQ,UAAU;AAEnC,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAkB;EAC3C,MAAMC,QAAQ,GAAGJ,MAAM,CAAgC,CAAC;EACxD,MAAM,CAACK,UAAU,EAAEC,aAAa,CAAC,GAAGL,QAAQ,CAAa;IACrDM,KAAK,EAAEL,QAAQ,GAAG,CAAC,GAAGM,MAAM,CAACC,UAAU;IACvCC,MAAM,EAAER,QAAQ,GAAG,CAAC,GAAGM,MAAM,CAACG;EAClC,CAAC,CAAC;EAEFZ,SAAS,CAAC,MAAM;IACZ,MAAMa,YAAY,GAAGA,CAAA,KAAM;MACvBC,YAAY,CAACT,QAAQ,CAACU,OAAO,CAAC;MAE9BV,QAAQ,CAACU,OAAO,GAAGC,UAAU,CAAC,MAAMT,aAAa,CAAC;QAC9CC,KAAK,EAAEC,MAAM,CAACC,UAAU;QACxBC,MAAM,EAAEF,MAAM,CAACG;MACnB,CAAC,CAAC,EAAE,GAAG,CAAC;IACZ,CAAC;IAEDH,MAAM,CAACQ,gBAAgB,CAAC,QAAQ,EAAEJ,YAAY,CAAC;IAE/C,OAAO,MAAM;MACTJ,MAAM,CAACS,mBAAmB,CAAC,QAAQ,EAAEL,YAAY,CAAC;MAClDC,YAAY,CAACT,QAAQ,CAACU,OAAO,CAAC;IAClC,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOT,UAAU;AACrB,CAAC"}
1
+ {"version":3,"names":["useEffect","useRef","useState","isServer","useDimensions","timerRef","screenSize","setScreenSize","width","undefined","window","innerWidth","height","innerHeight","handleResize","clearTimeout","current","setTimeout","addEventListener","removeEventListener"],"sourceRoot":"../../../src","sources":["hooks/useDimensions.web.ts"],"mappings":"AAAA,SAASA,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAEnD,SAASC,QAAQ,QAAQ,UAAU;AAEnC,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAkB;EAC3C,MAAMC,QAAQ,GAAGJ,MAAM,CAAgC,CAAC;EACxD,MAAM,CAACK,UAAU,EAAEC,aAAa,CAAC,GAAGL,QAAQ,CAAa;IACrDM,KAAK,EAAEL,QAAQ,GACTM,SAAS,GACTC,MAAM,CAACC,UAAU;IACvBC,MAAM,EAAET,QAAQ,GACVM,SAAS,GACTC,MAAM,CAACG;EACjB,CAAe,CAAC;EAEhBb,SAAS,CAAC,MAAM;IACZ,MAAMc,YAAY,GAAGA,CAAA,KAAM;MACvBC,YAAY,CAACV,QAAQ,CAACW,OAAO,CAAC;MAE9BX,QAAQ,CAACW,OAAO,GAAGC,UAAU,CAAC,MAAMV,aAAa,CAAC;QAC9CC,KAAK,EAAEE,MAAM,CAACC,UAAU;QACxBC,MAAM,EAAEF,MAAM,CAACG;MACnB,CAAC,CAAC,EAAE,GAAG,CAAC;IACZ,CAAC;IAEDH,MAAM,CAACQ,gBAAgB,CAAC,QAAQ,EAAEJ,YAAY,CAAC;IAE/C,OAAO,MAAM;MACTJ,MAAM,CAACS,mBAAmB,CAAC,QAAQ,EAAEL,YAAY,CAAC;MAClDC,YAAY,CAACV,QAAQ,CAACW,OAAO,CAAC;IAClC,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOV,UAAU;AACrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDimensions.web.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDimensions.web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAG1C,eAAO,MAAM,aAAa,QAAO,UA0BhC,CAAA"}
1
+ {"version":3,"file":"useDimensions.web.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDimensions.web.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAG1C,eAAO,MAAM,aAAa,QAAO,UA8BhC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-unistyles",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Level up your React Native StyleSheet",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -124,7 +124,7 @@
124
124
  },
125
125
  "plugins": {
126
126
  "@release-it/conventional-changelog": {
127
- "preset": "angular"
127
+ "preset": "conventionalcommits"
128
128
  }
129
129
  }
130
130
  },
@@ -5,9 +5,13 @@ import { isServer } from '../utils'
5
5
  export const useDimensions = (): ScreenSize => {
6
6
  const timerRef = useRef<ReturnType<typeof setTimeout>>()
7
7
  const [screenSize, setScreenSize] = useState<ScreenSize>({
8
- width: isServer ? 0 : window.innerWidth,
9
- height: isServer ? 0 : window.innerHeight
10
- })
8
+ width: isServer
9
+ ? undefined
10
+ : window.innerWidth,
11
+ height: isServer
12
+ ? undefined
13
+ : window.innerHeight
14
+ } as ScreenSize)
11
15
 
12
16
  useEffect(() => {
13
17
  const handleResize = () => {