@tamagui/use-window-dimensions 1.0.1-rc.5 → 1.0.1-rc.6

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["import { useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { useState } from 'react'\nimport { ScaledSize, useWindowDimensions as useWindowDimensionsRN } from 'react-native'\n\n/**\n * SSR safe useWindowDimensions\n */\n\nconst initialValue: ScaledSize = {\n fontScale: 1,\n height: 800,\n width: 600,\n scale: 1,\n}\n\nexport function useWindowDimensions() {\n const [state, setState] = useState(initialValue)\n const current = useWindowDimensionsRN()\n\n useIsomorphicLayoutEffect(() => {\n setState(current)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [current.height, current.width, current.fontScale, current.scale])\n\n return state\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0C;AAC1C,mBAAyB;AACzB,0BAAyE;AAMzE,MAAM,eAA2B;AAAA,EAC/B,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AACT;AAEO,SAAS,sBAAsB;AACpC,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAAS,YAAY;AAC/C,QAAM,cAAU,oBAAAA,qBAAsB;AAEtC,kDAA0B,MAAM;AAC9B,aAAS,OAAO;AAAA,EAElB,GAAG,CAAC,QAAQ,QAAQ,QAAQ,OAAO,QAAQ,WAAW,QAAQ,KAAK,CAAC;AAEpE,SAAO;AACT;",
4
+ "sourcesContent": ["import { useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { useState } from 'react'\nimport {\n ScaledSize,\n useWindowDimensions as useWindowDimensionsRN,\n} from 'react-native'\n\n/**\n * SSR safe useWindowDimensions\n */\n\nconst initialValue: ScaledSize = {\n fontScale: 1,\n height: 800,\n width: 600,\n scale: 1,\n}\n\nexport function useWindowDimensions() {\n const [state, setState] = useState(initialValue)\n const current = useWindowDimensionsRN()\n\n useIsomorphicLayoutEffect(() => {\n setState(current)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [current.height, current.width, current.fontScale, current.scale])\n\n return state\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0C;AAC1C,mBAAyB;AACzB,0BAGO;AAMP,MAAM,eAA2B;AAAA,EAC/B,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AACT;AAEO,SAAS,sBAAsB;AACpC,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAAS,YAAY;AAC/C,QAAM,cAAU,oBAAAA,qBAAsB;AAEtC,kDAA0B,MAAM;AAC9B,aAAS,OAAO;AAAA,EAElB,GAAG,CAAC,QAAQ,QAAQ,QAAQ,OAAO,QAAQ,WAAW,QAAQ,KAAK,CAAC;AAEpE,SAAO;AACT;",
6
6
  "names": ["useWindowDimensionsRN"]
7
7
  }
package/dist/esm/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import { useIsomorphicLayoutEffect } from "@tamagui/constants";
2
2
  import { useState } from "react";
3
- import { useWindowDimensions as useWindowDimensionsRN } from "react-native";
3
+ import {
4
+ useWindowDimensions as useWindowDimensionsRN
5
+ } from "react-native";
4
6
  const initialValue = {
5
7
  fontScale: 1,
6
8
  height: 800,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["import { useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { useState } from 'react'\nimport { ScaledSize, useWindowDimensions as useWindowDimensionsRN } from 'react-native'\n\n/**\n * SSR safe useWindowDimensions\n */\n\nconst initialValue: ScaledSize = {\n fontScale: 1,\n height: 800,\n width: 600,\n scale: 1,\n}\n\nexport function useWindowDimensions() {\n const [state, setState] = useState(initialValue)\n const current = useWindowDimensionsRN()\n\n useIsomorphicLayoutEffect(() => {\n setState(current)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [current.height, current.width, current.fontScale, current.scale])\n\n return state\n}\n"],
5
- "mappings": "AAAA,SAAS,iCAAiC;AAC1C,SAAS,gBAAgB;AACzB,SAAqB,uBAAuB,6BAA6B;AAMzE,MAAM,eAA2B;AAAA,EAC/B,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AACT;AAEO,SAAS,sBAAsB;AACpC,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,YAAY;AAC/C,QAAM,UAAU,sBAAsB;AAEtC,4BAA0B,MAAM;AAC9B,aAAS,OAAO;AAAA,EAElB,GAAG,CAAC,QAAQ,QAAQ,QAAQ,OAAO,QAAQ,WAAW,QAAQ,KAAK,CAAC;AAEpE,SAAO;AACT;",
4
+ "sourcesContent": ["import { useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { useState } from 'react'\nimport {\n ScaledSize,\n useWindowDimensions as useWindowDimensionsRN,\n} from 'react-native'\n\n/**\n * SSR safe useWindowDimensions\n */\n\nconst initialValue: ScaledSize = {\n fontScale: 1,\n height: 800,\n width: 600,\n scale: 1,\n}\n\nexport function useWindowDimensions() {\n const [state, setState] = useState(initialValue)\n const current = useWindowDimensionsRN()\n\n useIsomorphicLayoutEffect(() => {\n setState(current)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [current.height, current.width, current.fontScale, current.scale])\n\n return state\n}\n"],
5
+ "mappings": "AAAA,SAAS,iCAAiC;AAC1C,SAAS,gBAAgB;AACzB;AAAA,EAEE,uBAAuB;AAAA,OAClB;AAMP,MAAM,eAA2B;AAAA,EAC/B,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AACT;AAEO,SAAS,sBAAsB;AACpC,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,YAAY;AAC/C,QAAM,UAAU,sBAAsB;AAEtC,4BAA0B,MAAM;AAC9B,aAAS,OAAO;AAAA,EAElB,GAAG,CAAC,QAAQ,QAAQ,QAAQ,OAAO,QAAQ,WAAW,QAAQ,KAAK,CAAC;AAEpE,SAAO;AACT;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/use-window-dimensions",
3
- "version": "1.0.1-rc.5",
3
+ "version": "1.0.1-rc.6",
4
4
  "types": "./types/index.d.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -12,16 +12,16 @@
12
12
  "scripts": {
13
13
  "build": "tamagui-build",
14
14
  "watch": "tamagui-build --watch",
15
- "lint": "eslint src",
16
- "lint:fix": "yarn lint --fix",
15
+ "lint": "../../node_modules/.bin/rome check src",
16
+ "lint:fix": "../../node_modules/.bin/rome check --apply-suggested src",
17
17
  "clean": "tamagui-build clean",
18
18
  "clean:build": "tamagui-build clean:build"
19
19
  },
20
20
  "dependencies": {
21
- "@tamagui/constants": "^1.0.1-rc.5"
21
+ "@tamagui/constants": "^1.0.1-rc.6"
22
22
  },
23
23
  "devDependencies": {
24
- "@tamagui/build": "^1.0.1-rc.5",
24
+ "@tamagui/build": "^1.0.1-rc.6",
25
25
  "@types/react": "^18.0.15",
26
26
  "react": "^18.2.0",
27
27
  "react-native": "*"
package/src/index.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  import { useIsomorphicLayoutEffect } from '@tamagui/constants'
2
2
  import { useState } from 'react'
3
- import { ScaledSize, useWindowDimensions as useWindowDimensionsRN } from 'react-native'
3
+ import {
4
+ ScaledSize,
5
+ useWindowDimensions as useWindowDimensionsRN,
6
+ } from 'react-native'
4
7
 
5
8
  /**
6
9
  * SSR safe useWindowDimensions