@graphcommerce/magento-cms 9.0.4-canary.1 → 9.0.4-canary.11

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,35 @@
1
1
  # Change Log
2
2
 
3
+ ## 9.0.4-canary.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2485](https://github.com/graphcommerce-org/graphcommerce/pull/2485) [`2e52ea3`](https://github.com/graphcommerce-org/graphcommerce/commit/2e52ea39823a15fc4ffe3ca47780f7e64ace3110) - Added cmsBlocks query and `<CmsBlock />` component. ([@paales](https://github.com/paales))
8
+
9
+ ## 9.0.4-canary.10
10
+
11
+ ## 9.0.4-canary.9
12
+
13
+ ## 9.0.4-canary.8
14
+
15
+ ## 9.0.4-canary.7
16
+
17
+ ## 9.0.4-canary.6
18
+
19
+ ### Patch Changes
20
+
21
+ - [#2478](https://github.com/graphcommerce-org/graphcommerce/pull/2478) [`a317221`](https://github.com/graphcommerce-org/graphcommerce/commit/a317221a6ef88dc037985398bf87926a73f7fa48) - Convert home to render the home CmsPage and add page/[…url] route for additional pages. ([@paales](https://github.com/paales))
22
+
23
+ - [#2478](https://github.com/graphcommerce-org/graphcommerce/pull/2478) [`d09c98b`](https://github.com/graphcommerce-org/graphcommerce/commit/d09c98bba2ee83fb51b17494354a42b6c38446ab) - Added support for loading CMS Pages from Magento ([@paales](https://github.com/paales))
24
+
25
+ ## 9.0.4-canary.5
26
+
27
+ ## 9.0.4-canary.4
28
+
29
+ ## 9.0.4-canary.3
30
+
31
+ ## 9.0.4-canary.2
32
+
3
33
  ## 9.0.4-canary.1
4
34
 
5
35
  ## 9.0.4-canary.0
@@ -0,0 +1,4 @@
1
+ fragment CmsBlock on CmsBlock {
2
+ identifier
3
+ content
4
+ }
@@ -0,0 +1,10 @@
1
+ import type { CmsBlockFragment } from './CmsBlock.gql'
2
+
3
+ export type CmsBlockProps = { cmsBlock: CmsBlockFragment | null | undefined }
4
+
5
+ export function CmsBlock(props: CmsBlockProps) {
6
+ const { cmsBlock } = props
7
+ if (!cmsBlock?.content) return null
8
+ // eslint-disable-next-line react/no-danger
9
+ return <div dangerouslySetInnerHTML={{ __html: cmsBlock.content }} />
10
+ }
@@ -0,0 +1,14 @@
1
+ import { Container } from '@mui/material'
2
+ import type { CmsPageContentFragment } from './CmsPageContent.gql'
3
+
4
+ export type CmsPageContentProps = { cmsPage: CmsPageContentFragment }
5
+
6
+ export function CmsPageContent(props: CmsPageContentProps) {
7
+ const { cmsPage } = props
8
+ return (
9
+ <Container>
10
+ {/* eslint-disable-next-line react/no-danger */}
11
+ {cmsPage.content && <div dangerouslySetInnerHTML={{ __html: cmsPage.content }} />}
12
+ </Container>
13
+ )
14
+ }
@@ -0,0 +1,7 @@
1
+ query CmsBlocks($identifiers: [String!]!) {
2
+ cmsBlocks(identifiers: $identifiers) {
3
+ items {
4
+ ...CmsBlock
5
+ }
6
+ }
7
+ }
@@ -0,0 +1,11 @@
1
+ query CmsPage($url: String!) {
2
+ route(url: $url) {
3
+ __typename
4
+ relative_url
5
+ redirect_code
6
+ type
7
+ ... on CmsPage {
8
+ ...CmsPageFragment
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,5 @@
1
+ fragment CmsPageFragment on CmsPage {
2
+ identifier
3
+ ...CmsPageMeta
4
+ ...CmsPageContent
5
+ }
package/index.ts CHANGED
@@ -1,2 +1,8 @@
1
- export * from './CmsPageContent'
2
- export * from './CmsPageMeta'
1
+ export * from './components/CmsBlock/CmsBlock'
2
+ export * from './components/CmsBlock/CmsBlock.gql'
3
+ export * from './components/CmsPageContent/CmsPageContent'
4
+ export * from './components/CmsPageContent/CmsPageContent.gql'
5
+ export * from './components/CmsPageMeta/CmsPageMeta'
6
+ export * from './components/CmsPageMeta/CmsPageMeta.gql'
7
+ export * from './graphql/CmsPage.gql'
8
+ export * from './graphql/CmsPageFragment.gql'
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cms",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.0.4-canary.1",
5
+ "version": "9.0.4-canary.11",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,11 +12,11 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^9.0.4-canary.1",
16
- "@graphcommerce/graphql": "^9.0.4-canary.1",
17
- "@graphcommerce/magento-store": "^9.0.4-canary.1",
18
- "@graphcommerce/prettier-config-pwa": "^9.0.4-canary.1",
19
- "@graphcommerce/typescript-config-pwa": "^9.0.4-canary.1",
15
+ "@graphcommerce/eslint-config-pwa": "^9.0.4-canary.11",
16
+ "@graphcommerce/graphql": "^9.0.4-canary.11",
17
+ "@graphcommerce/magento-store": "^9.0.4-canary.11",
18
+ "@graphcommerce/prettier-config-pwa": "^9.0.4-canary.11",
19
+ "@graphcommerce/typescript-config-pwa": "^9.0.4-canary.11",
20
20
  "@lingui/core": "^4.2.1",
21
21
  "@lingui/macro": "^4.2.1",
22
22
  "@lingui/react": "^4.2.1",
@@ -1,19 +0,0 @@
1
- import { Container, Typography } from '@mui/material'
2
- import type { CmsPageContentFragment } from './CmsPageContent.gql'
3
-
4
- export type CmsPageContentProps = CmsPageContentFragment
5
-
6
- export function CmsPageContent(props: CmsPageContentProps) {
7
- const { content_heading, content } = props
8
- return (
9
- <Container>
10
- {content_heading && (
11
- <Typography variant='h2' component='h1'>
12
- {content_heading}
13
- </Typography>
14
- )}
15
- {/* eslint-disable-next-line react/no-danger */}
16
- {content && <div dangerouslySetInnerHTML={{ __html: content }} />}
17
- </Container>
18
- )
19
- }
@@ -1,7 +0,0 @@
1
- fragment CmsPageQueryFragment on Query {
2
- cmsPage(identifier: $urlKey) {
3
- identifier
4
- ...CmsPageMeta
5
- ...CmsPageContent
6
- }
7
- }