@graphcommerce/framer-utils 5.1.0-canary.2 → 5.1.0-canary.4

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Change Log
2
2
 
3
+ ## 5.1.0-canary.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1755](https://github.com/graphcommerce-org/graphcommerce/pull/1755) [`0025ad80f`](https://github.com/graphcommerce-org/graphcommerce/commit/0025ad80fb82d5d1e6c786bb8b5f39b2456c0932) - Renamed clientSizeCssVar.y/x to dvh(100) and dvw(100) ([@paales](https://github.com/paales))
8
+
9
+ - [#1755](https://github.com/graphcommerce-org/graphcommerce/pull/1755) [`f44a05a6c`](https://github.com/graphcommerce-org/graphcommerce/commit/f44a05a6cedadc17e44c87f53cad5f462bc52aba) - Use a singlular useElementScroll and provide ther scroll from the useScrollerContext ([@paales](https://github.com/paales))
10
+
11
+ - [#1755](https://github.com/graphcommerce-org/graphcommerce/pull/1755) [`c77f49e6e`](https://github.com/graphcommerce-org/graphcommerce/commit/c77f49e6ed6af0bf2890d51da4eaa4ac70ee2cc9) - clientSizeCssVar.x had a fallback to 100vw instead of 100vh ([@paales](https://github.com/paales))
12
+
13
+ ## 5.1.0-canary.3
14
+
15
+ ### Patch Changes
16
+
17
+ - [#1752](https://github.com/graphcommerce-org/graphcommerce/pull/1752) [`2a6a4d9ec`](https://github.com/graphcommerce-org/graphcommerce/commit/2a6a4d9ecfa1b58a66ba9b9d00016d6feda9aa95) - Updated dependencies to latest versions, except for nextjs; Solve tons of peer dependency issues.
18
+
19
+ - Updated the @mui/material package
20
+ - Removed dependencies on react-hook-form-mui and @playwright/test
21
+ - Upgraded dependencies including type-fest and graphql-mesh
22
+ - Solved peer dependency issues ([@paales](https://github.com/paales))
23
+
3
24
  ## 5.1.0-canary.2
4
25
 
5
26
  ## 5.1.0-canary.1
@@ -5,7 +5,7 @@ import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect'
5
5
 
6
6
  type ScrollMotionValue = { x: number; y: number; xMax: number; yMax: number }
7
7
 
8
- interface ScrollMotionValues {
8
+ export interface ScrollMotionValues {
9
9
  x: MotionValue<number>
10
10
  y: MotionValue<number>
11
11
  xProgress: MotionValue<number>
@@ -7,14 +7,28 @@ import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect'
7
7
  export type UseClientSizeReturn = { x: MotionValue<string>; y: MotionValue<string> }
8
8
  export type UseClientSizeOptions = { x?: string; y?: string }
9
9
 
10
+ /** @deprecated Please use dvh() or dvw() instead */
10
11
  export const clientSizeCssVar = {
11
12
  y: `var(--client-size-y, 100vh)`,
12
- x: `var(--client-size-x, 100vh)`,
13
+ x: `var(--client-size-x, 100vw)`,
14
+ }
15
+
16
+ export const dvh = (p = 100) => {
17
+ if (p === 100) return 'var(--client-size-y, 100vh)'
18
+ return `calc(var(--client-size-y, 100vh) * ${p / 100})`
19
+ }
20
+ export const dvw = (p = 100) => {
21
+ if (p === 100) return 'var(--client-size-x, 100vw)'
22
+ return `calc(var(--client-size-x, 100vw) * ${p / 100})`
13
23
  }
14
24
 
15
25
  let watching = false
16
26
 
17
- export function useClientSizeCssVar() {
27
+ /**
28
+ * Calculates the dvh and dvw css variables. Method should be deprecated when the real dvh/dvw are
29
+ * widelt available.
30
+ */
31
+ export function useMeasureDynamicViewportSize() {
18
32
  useIsomorphicLayoutEffect(() => {
19
33
  if (watching === true) return () => {}
20
34
 
package/index.ts CHANGED
@@ -2,7 +2,7 @@ export * from './utils/clientSize'
2
2
 
3
3
  export * from './utils/styled'
4
4
 
5
- export * from './hooks/useClientSize'
5
+ export * from './hooks/useMeasureDynamicViewportSize'
6
6
  export * from './hooks/useConstant'
7
7
  export * from './hooks/useElementScroll'
8
8
  export * from './hooks/useIsomorphicLayoutEffect'
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/framer-utils",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "5.1.0-canary.2",
5
+ "version": "5.1.0-canary.4",
6
6
  "sideEffects": false,
7
7
  "scripts": {
8
8
  "dev": "tsc -W"
@@ -15,15 +15,14 @@
15
15
  }
16
16
  },
17
17
  "devDependencies": {
18
- "@graphcommerce/eslint-config-pwa": "^5.1.0-canary.2",
19
- "@graphcommerce/prettier-config-pwa": "^5.1.0-canary.2",
20
- "@graphcommerce/typescript-config-pwa": "^5.1.0-canary.2",
21
- "@playwright/test": "^1.21.1"
18
+ "@graphcommerce/eslint-config-pwa": "5.1.0-canary.4",
19
+ "@graphcommerce/prettier-config-pwa": "5.1.0-canary.4",
20
+ "@graphcommerce/typescript-config-pwa": "5.1.0-canary.4"
22
21
  },
23
22
  "peerDependencies": {
24
- "framer-motion": "^6.2.4",
25
- "react": "^18.0.0",
26
- "react-dom": "^18.0.0"
23
+ "framer-motion": "^7.0.0",
24
+ "react": "^18.2.0",
25
+ "react-dom": "^18.2.0"
27
26
  },
28
27
  "dependencies": {
29
28
  "framesync": "^6.1.1"