@styleflow.app/flowpress-astro-core 0.2.0-beta.5 → 0.2.0-beta.7

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.
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  import type { SfSeo } from "../types.js";
3
+ import S from "@styleflow.app/astro/S.astro";
3
4
 
4
5
  interface Props {
5
6
  lang?: string;
@@ -44,6 +45,8 @@ const jsonLd = seo?.jsonLd ? JSON.stringify(seo.jsonLd) : null;
44
45
  <slot name="head" />
45
46
  </head>
46
47
  <body>
47
- <slot />
48
+ <S.main tone="neutral" intensity={1} surface="default" layoutRole="none" density="md">
49
+ <slot />
50
+ </S.main>
48
51
  </body>
49
52
  </html>
@@ -7,28 +7,38 @@ import type { FlowpressTemplateProps } from "../types.js";
7
7
  const { route, content, styleflowContract } = Astro.props as FlowpressTemplateProps;
8
8
  const title = content?.title || route.seo?.title || "Contenuto";
9
9
  const isNotFound = route.queryType === "404" || route.status === 404;
10
+ const hasGutembergBlocks = Array.isArray(content?.contentBlocks) && content.contentBlocks.length > 0 ? true : false;
11
+ //TODO SET GLOBAL LOCAL ON ENV
10
12
  ---
11
13
 
12
14
  <BaseLayout lang={route.locale || "it"} seo={route.seo}>
13
- <S.main tone="neutral" intensity={1} surface="default" layoutRole="container" density="md">
14
- <S.section tone="neutral" intensity={1} surface="default" layoutRole="section" density="md">
15
- <S.h1 ty="heading" v="1" w="strong">{isNotFound ? "Pagina non trovata" : title}</S.h1>
16
- {content?.excerpt && <S.p ty="body" v="md" w="default">{content.excerpt}</S.p>}
17
- {Array.isArray(content?.contentBlocks) && content.contentBlocks.length > 0 ? (
18
- <GutenbergRenderer
19
- blocks={content.contentBlocks as import("../types.js").FlowpressBlock[]}
20
- contract={styleflowContract}
21
- />
22
- ) : content?.content && (
23
- <S.div
24
- tone="neutral"
25
- intensity={1}
26
- surface="default"
27
- layoutRole="stack"
28
- density="md"
29
- set:html={String(content.content)}
30
- />
31
- )}
32
- </S.section>
33
- </S.main>
15
+
16
+ {hasGutembergBlocks ? (
17
+ <GutenbergRenderer
18
+ blocks={content?.contentBlocks as import("../types.js").FlowpressBlock[]}
19
+ contract={styleflowContract}
20
+ />
21
+ ) : (
22
+ <S.section tone="neutral" intensity={1} surface="default" layoutRole="section" density="md">
23
+ <S.h1 ty="heading" v="1" w="strong">{isNotFound ? "Pagina non trovata" : title}</S.h1>
24
+ {content?.excerpt && <S.p ty="body" v="md" w="default">{content.excerpt}</S.p>}
25
+ {Array.isArray(content?.contentBlocks) && content.contentBlocks.length > 0 ? (
26
+ <GutenbergRenderer
27
+ blocks={content.contentBlocks as import("../types.js").FlowpressBlock[]}
28
+ contract={styleflowContract}
29
+ />
30
+ ) : content?.content && (
31
+ <S.div
32
+ tone="neutral"
33
+ intensity={1}
34
+ surface="default"
35
+ layoutRole="stack"
36
+ density="md"
37
+ set:html={String(content.content)}
38
+ />
39
+ )}
40
+ </S.section>
41
+ )}
42
+
43
+
34
44
  </BaseLayout>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@styleflow.app/flowpress-astro-core",
3
- "version": "0.2.0-beta.5",
3
+ "version": "0.2.0-beta.7",
4
4
  "description": "Project-agnostic WordPress routing, templates, SEO and GraphQL runtime for FlowPress Astro apps.",
5
5
  "type": "module",
6
6
  "private": false,