@graphcommerce/graphcms-ui 3.0.10 → 3.0.13

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,34 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.0.13
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`100f4c38c`](https://github.com/graphcommerce-org/graphcommerce/commit/100f4c38c8fcda4bc6e0425e38028b550b60adc2)]:
8
+ - @graphcommerce/graphql@3.1.1
9
+ - @graphcommerce/next-ui@4.6.2
10
+
11
+ ## 3.0.12
12
+
13
+ ### Patch Changes
14
+
15
+ - [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542) Thanks [@paales](https://github.com/paales)! - Now using [@graphql-yoga](https://github.com/dotansimha/graphql-yoga) for GraphQL which has full support for [envelop](https://www.envelop.dev/) plugins.
16
+
17
+ * [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542) Thanks [@paales](https://github.com/paales)! - Added a new @graphcommerce/cli package to generate the mesh so it can be generated _inside_ the @graphcommerce/graphql-mesh package to allow for better future extensibility.
18
+
19
+ - [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`da0ae7d02`](https://github.com/graphcommerce-org/graphcommerce/commit/da0ae7d0236e4908ba0bf0fa16656be516e841d4) Thanks [@paales](https://github.com/paales)! - Updated dependencies
20
+
21
+ - Updated dependencies [[`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542), [`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542), [`da0ae7d02`](https://github.com/graphcommerce-org/graphcommerce/commit/da0ae7d0236e4908ba0bf0fa16656be516e841d4)]:
22
+ - @graphcommerce/graphql@3.1.0
23
+ - @graphcommerce/next-ui@4.6.1
24
+ - @graphcommerce/image@3.1.5
25
+
26
+ ## 3.0.11
27
+
28
+ ### Patch Changes
29
+
30
+ - [#1392](https://github.com/graphcommerce-org/graphcommerce/pull/1392) [`123d441ac`](https://github.com/graphcommerce-org/graphcommerce/commit/123d441acb74706d08e453abae4a6a8dad3130e0) Thanks [@carlocarels90](https://github.com/carlocarels90)! - add missing fields to the iframe renderer
31
+
3
32
  ## 3.0.10
4
33
 
5
34
  ### Patch Changes
@@ -16,11 +16,22 @@ export const defaultRenderers: Renderers = {
16
16
  'list-item': (props) => <Box component='li' {...props} />,
17
17
  'list-item-child': (props) => <Box component='span' {...props} />,
18
18
  'block-quote': (props) => <Box component='blockquote' {...props} />,
19
- iframe: (props) => (
20
- // todo add security attributes to iframe
21
- // todo make iframe responsive (generic IFrame component?)
22
- <Box component='iframe' title='embedded content' loading='lazy' {...props} />
23
- ),
19
+ iframe: (props) => {
20
+ const { url, width, height, sx = [] } = props
21
+ return (
22
+ // todo add security attributes to iframe
23
+ // todo make iframe responsive (generic IFrame component?)
24
+ <Box
25
+ component='iframe'
26
+ src={url}
27
+ loading='lazy'
28
+ sx={[
29
+ { aspectRatio: `${width} / ${height}`, width: '100%' },
30
+ ...(Array.isArray(sx) ? sx : [sx]),
31
+ ]}
32
+ />
33
+ )
34
+ },
24
35
  image: ({ src, width, height, title, mimeType }) => (
25
36
  <Asset asset={{ url: src, alt: title, width, height, mimeType }} />
26
37
  ),
@@ -2,7 +2,7 @@ import { SxRenderer } from './types'
2
2
 
3
3
  export const defaultSxRenderer: SxRenderer = {
4
4
  all: {
5
- '&:empty': {
5
+ '&:empty:not(iframe)': {
6
6
  display: 'none',
7
7
  },
8
8
  },
@@ -104,4 +104,5 @@ export const defaultSxRenderer: SxRenderer = {
104
104
  underlined: {
105
105
  textDecoration: 'underline',
106
106
  },
107
+ iframe: {},
107
108
  }
@@ -1,5 +1,5 @@
1
1
  import { SxProps, Theme } from '@mui/material'
2
- import { LiteralUnion } from 'type-fest'
2
+ import type { LiteralUnion } from 'type-fest'
3
3
 
4
4
  type BaseElementTypes =
5
5
  | 'heading-one'
@@ -69,7 +69,9 @@ type VideoElement = {
69
69
  type IframeElement = {
70
70
  type: 'iframe'
71
71
  children: ElementOrTextNode[]
72
- src: string
72
+ url: string
73
+ width?: number
74
+ height?: number
73
75
  }
74
76
 
75
77
  export type ElementNode = SimpleElement | LinkElement | ImageElement | VideoElement | IframeElement
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/graphcms-ui",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "3.0.10",
5
+ "version": "3.0.13",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,16 +12,16 @@
12
12
  }
13
13
  },
14
14
  "devDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^4.1.4",
16
- "@graphcommerce/prettier-config-pwa": "^4.0.5",
15
+ "@graphcommerce/eslint-config-pwa": "^4.1.6",
16
+ "@graphcommerce/prettier-config-pwa": "^4.0.6",
17
17
  "@graphcommerce/typescript-config-pwa": "^4.0.2",
18
- "@playwright/test": "^1.20.1",
19
- "type-fest": "2.12.1"
18
+ "@playwright/test": "^1.21.1",
19
+ "type-fest": "^2.12.2"
20
20
  },
21
21
  "dependencies": {
22
- "@graphcommerce/graphql": "3.0.7",
23
- "@graphcommerce/image": "3.1.4",
24
- "@graphcommerce/next-ui": "4.6.0"
22
+ "@graphcommerce/graphql": "3.1.1",
23
+ "@graphcommerce/image": "3.1.5",
24
+ "@graphcommerce/next-ui": "4.6.2"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@mui/material": "5.5.3",