@graphcommerce/ecommerce-ui 1.1.0 → 1.1.3

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,29 @@
1
1
  # @graphcommerce/ecommerce-ui
2
2
 
3
+ ## 1.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 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)]:
8
+ - @graphcommerce/graphql@3.4.2
9
+ - @graphcommerce/react-hook-form@3.3.1
10
+ - @graphcommerce/next-ui@4.14.0
11
+
12
+ ## 1.1.2
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [[`18054c441`](https://github.com/graphcommerce-org/graphcommerce/commit/18054c441962ba750bed3acc39ab46c8d3a341ce), [`c5c539c44`](https://github.com/graphcommerce-org/graphcommerce/commit/c5c539c44eeac524cd62ce649e132d2e00333794), [`6f69bc54c`](https://github.com/graphcommerce-org/graphcommerce/commit/6f69bc54c6e0224452817c532ae58d9c332b61ea), [`21886d6fa`](https://github.com/graphcommerce-org/graphcommerce/commit/21886d6fa64a48d9e932bfaf8d138c9b13c36e43)]:
17
+ - @graphcommerce/graphql@3.4.1
18
+ - @graphcommerce/next-ui@4.13.1
19
+
20
+ ## 1.1.1
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [[`8d8fda262`](https://github.com/graphcommerce-org/graphcommerce/commit/8d8fda2623e561cb43441110c67ffa34b692668a), [`cefa7b365`](https://github.com/graphcommerce-org/graphcommerce/commit/cefa7b3652b55108d2178927e3c5d98a111cf373)]:
25
+ - @graphcommerce/next-ui@4.13.0
26
+
3
27
  ## 1.1.0
4
28
 
5
29
  ### Minor Changes
@@ -0,0 +1,24 @@
1
+ import { useIsomorphicLayoutEffect } from '@graphcommerce/framer-utils'
2
+ import { QueryResult } from '@graphcommerce/graphql'
3
+ import { NoSsr, NoSsrProps } from '@mui/material'
4
+ import { useState } from 'react'
5
+
6
+ export type WaitForQueriesProps = Omit<NoSsrProps, 'defer'> & {
7
+ waitFor: QueryResult<any, any> | QueryResult<any, any>[]
8
+ }
9
+
10
+ /**
11
+ * Shows the fallback during: SSR, Hydration and Query Loading.
12
+ *
13
+ * Why not use suspense? Not support with Apollo Client yet!
14
+ */
15
+ export const WaitForQueries = (props: WaitForQueriesProps) => {
16
+ const { waitFor, fallback, children } = props
17
+ const queries = Array.isArray(waitFor) ? waitFor : [waitFor]
18
+ const isDone = queries.every(({ data, error }) => data || error)
19
+
20
+ const [mountedState, setMountedState] = useState(false)
21
+ useIsomorphicLayoutEffect(() => setMountedState(true), [])
22
+
23
+ return <NoSsr fallback={fallback}>{isDone && mountedState ? children : fallback}</NoSsr>
24
+ }
@@ -0,0 +1 @@
1
+ export * from './WaitForQueries'
@@ -1,2 +1,3 @@
1
1
  export * from './ComposedSubmitButton'
2
2
  export * from './ApolloError'
3
+ export * from './WaitForQueries'
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.0",
5
+ "version": "1.1.3",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,14 +12,15 @@
12
12
  }
13
13
  },
14
14
  "dependencies": {
15
- "@graphcommerce/next-ui": "4.12.0",
16
- "@graphcommerce/react-hook-form": "3.3.0",
17
- "@graphcommerce/graphql": "3.4.0"
15
+ "@graphcommerce/framer-utils": "3.1.4",
16
+ "@graphcommerce/next-ui": "4.14.0",
17
+ "@graphcommerce/react-hook-form": "3.3.1",
18
+ "@graphcommerce/graphql": "3.4.2"
18
19
  },
19
20
  "devDependencies": {
20
- "@graphcommerce/eslint-config-pwa": "^4.1.8",
21
+ "@graphcommerce/eslint-config-pwa": "^4.1.9",
21
22
  "@graphcommerce/prettier-config-pwa": "^4.0.6",
22
- "@graphcommerce/typescript-config-pwa": "^4.0.3",
23
+ "@graphcommerce/typescript-config-pwa": "^4.0.4",
23
24
  "@playwright/test": "^1.21.1"
24
25
  },
25
26
  "peerDependencies": {