@graphcommerce/framer-utils 5.1.0-canary.1 → 5.1.0-canary.10

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,40 @@
1
1
  # Change Log
2
2
 
3
+ ## 5.1.0-canary.10
4
+
5
+ ## 5.1.0-canary.9
6
+
7
+ ## 5.1.0-canary.8
8
+
9
+ ## 5.1.0-canary.7
10
+
11
+ ## 5.1.0-canary.6
12
+
13
+ ## 5.1.0-canary.5
14
+
15
+ ## 5.1.0-canary.4
16
+
17
+ ### Patch Changes
18
+
19
+ - [#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))
20
+
21
+ - [#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))
22
+
23
+ - [#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))
24
+
25
+ ## 5.1.0-canary.3
26
+
27
+ ### Patch Changes
28
+
29
+ - [#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.
30
+
31
+ - Updated the @mui/material package
32
+ - Removed dependencies on react-hook-form-mui and @playwright/test
33
+ - Upgraded dependencies including type-fest and graphql-mesh
34
+ - Solved peer dependency issues ([@paales](https://github.com/paales))
35
+
36
+ ## 5.1.0-canary.2
37
+
3
38
  ## 5.1.0-canary.1
4
39
 
5
40
  ## 5.1.0-canary.0
@@ -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.1",
5
+ "version": "5.1.0-canary.10",
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.1",
19
- "@graphcommerce/prettier-config-pwa": "^5.1.0-canary.1",
20
- "@graphcommerce/typescript-config-pwa": "^5.1.0-canary.1",
21
- "@playwright/test": "^1.21.1"
18
+ "@graphcommerce/eslint-config-pwa": "5.1.0-canary.10",
19
+ "@graphcommerce/prettier-config-pwa": "5.1.0-canary.10",
20
+ "@graphcommerce/typescript-config-pwa": "5.1.0-canary.10"
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"