@graphcommerce/ecommerce-ui 1.1.2 → 1.1.5
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,30 @@
|
|
|
1
1
|
# @graphcommerce/ecommerce-ui
|
|
2
2
|
|
|
3
|
+
## 1.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`e167992df`](https://github.com/graphcommerce-org/graphcommerce/commit/e167992dfdc6964a392af719667f8a188626ab1b), [`9c2504b4e`](https://github.com/graphcommerce-org/graphcommerce/commit/9c2504b4ed75f41d3003c4d3339814010e85e37e)]:
|
|
8
|
+
- @graphcommerce/next-ui@4.15.0
|
|
9
|
+
|
|
10
|
+
## 1.1.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#1557](https://github.com/graphcommerce-org/graphcommerce/pull/1557) [`c0a7f9427`](https://github.com/graphcommerce-org/graphcommerce/commit/c0a7f9427466f0a3886b2c3ebf2f0aa5d79ee081) Thanks [@paales](https://github.com/paales)! - WaitForQueries already handles the SSR loading, no need for NoSSR
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`01f1588c9`](https://github.com/graphcommerce-org/graphcommerce/commit/01f1588c9200bb39dd61146e260bfa2b32060612)]:
|
|
17
|
+
- @graphcommerce/graphql@3.4.3
|
|
18
|
+
|
|
19
|
+
## 1.1.3
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [[`1afc6a547`](https://github.com/graphcommerce-org/graphcommerce/commit/1afc6a5473d6e31f47b5d0188801803b31865290), [`4a4579bb2`](https://github.com/graphcommerce-org/graphcommerce/commit/4a4579bb2f7da378f3fcc504405caf2560dc10f6), [`afcd8e4bf`](https://github.com/graphcommerce-org/graphcommerce/commit/afcd8e4bfb7010da4d5faeed85b61991ed7975f4), [`02e1988e5`](https://github.com/graphcommerce-org/graphcommerce/commit/02e1988e5f361c6f66ae30d3bbee38ef2ac062df), [`323fdee4b`](https://github.com/graphcommerce-org/graphcommerce/commit/323fdee4b15ae23e0e84dd0588cb2c6446dcfd50)]:
|
|
24
|
+
- @graphcommerce/graphql@3.4.2
|
|
25
|
+
- @graphcommerce/react-hook-form@3.3.1
|
|
26
|
+
- @graphcommerce/next-ui@4.14.0
|
|
27
|
+
|
|
3
28
|
## 1.1.2
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useIsomorphicLayoutEffect } from '@graphcommerce/framer-utils'
|
|
2
|
+
import { QueryResult } from '@graphcommerce/graphql'
|
|
3
|
+
import React, { useState } from 'react'
|
|
4
|
+
|
|
5
|
+
export type WaitForQueriesProps = {
|
|
6
|
+
waitFor: QueryResult<any, any> | QueryResult<any, any>[]
|
|
7
|
+
children: React.ReactNode
|
|
8
|
+
fallback?: React.ReactNode
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Shows the fallback during: SSR, Hydration and Query Loading.
|
|
13
|
+
*
|
|
14
|
+
* Why not use suspense? Not support with Apollo Client yet!
|
|
15
|
+
*/
|
|
16
|
+
export const WaitForQueries = (props: WaitForQueriesProps) => {
|
|
17
|
+
const { waitFor, fallback, children } = props
|
|
18
|
+
|
|
19
|
+
// We are done when all queries either have data or an error
|
|
20
|
+
const isDone = (Array.isArray(waitFor) ? waitFor : [waitFor]).every(
|
|
21
|
+
({ data, error }) => data || error,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
// Wait for the queries to finish
|
|
25
|
+
const [mountedState, setMountedState] = useState(false)
|
|
26
|
+
useIsomorphicLayoutEffect(() => setMountedState(true), [])
|
|
27
|
+
|
|
28
|
+
return <>{isDone && mountedState ? children : fallback}</>
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WaitForQueries'
|
package/components/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/ecommerce-ui",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.5",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@graphcommerce/
|
|
16
|
-
"@graphcommerce/
|
|
17
|
-
"@graphcommerce/
|
|
15
|
+
"@graphcommerce/framer-utils": "3.1.4",
|
|
16
|
+
"@graphcommerce/next-ui": "4.15.0",
|
|
17
|
+
"@graphcommerce/react-hook-form": "3.3.1",
|
|
18
|
+
"@graphcommerce/graphql": "3.4.3"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
21
|
"@graphcommerce/eslint-config-pwa": "^4.1.9",
|