@styleflow.app/flowpress-astro-core 1.0.0-beta.26 → 1.0.0-beta.27
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 +5 -0
- package/dist/astro/BaseLayout.astro +3 -3
- package/dist/astro/DefaultTemplate.astro +6 -6
- package/dist/astro/GutenbergRenderer.astro +33 -33
- package/dist/astro/StyleflowElement.astro +19 -0
- package/dist/astro/blocks/CarouselBlock.astro +5 -5
- package/dist/astro/blocks/CarouselItemBlock.astro +3 -3
- package/dist/astro/blocks/ColumnBlock.astro +3 -3
- package/dist/astro/blocks/CoverBlock.astro +6 -6
- package/dist/astro/blocks/FormBlock.astro +6 -6
- package/dist/astro/blocks/GridBlock.astro +3 -3
- package/dist/astro/blocks/HeroBlock.astro +3 -3
- package/dist/astro/blocks/ImageBlock.astro +3 -3
- package/dist/astro/blocks/ListItemFallback.astro +5 -5
- package/dist/astro/blocks/NumberSpinnerBlock.astro +3 -3
- package/dist/astro/blocks/SemanticElement.astro +19 -19
- package/dist/astro/blocks/SiteLogoBlock.astro +3 -3
- package/dist/astro/blocks/TextBlock.astro +8 -8
- package/dist/astro/blocks/ThemeToggleBlock.astro +4 -4
- package/dist/astro/blocks/helpers.d.ts.map +1 -1
- package/dist/astro/blocks/helpers.js +4 -3
- package/dist/astro/blocks/helpers.js.map +1 -1
- package/dist/astro/blocks/helpers.ts +4 -3
- package/dist/astro/native/Blob.astro +6 -6
- package/dist/astro/native/CustomFieldValue.astro +21 -21
- package/dist/astro/native/LevelTag.astro +10 -10
- package/dist/astro/native/MapBlock.astro +5 -5
- package/dist/astro/native/NativeHtmlBlock.astro +2 -2
- package/dist/astro/native/NativeIconBlock.astro +2 -2
- package/dist/astro/native/ResolvedBlocks.astro +6 -6
- package/dist/astro/native/SyncedPatternContent.astro +6 -6
- package/dist/astro/native/TermFieldValue.astro +4 -4
- package/dist/astro/native/Timeline.astro +12 -12
- package/dist/astro/native/core-block.astro +2 -2
- package/dist/astro/native/core-button.astro +8 -8
- package/dist/astro/native/core-buttons.astro +2 -2
- package/dist/astro/native/core-group.astro +9 -9
- package/dist/astro/native/core-home-link.astro +2 -2
- package/dist/astro/native/core-image.astro +9 -9
- package/dist/astro/native/core-navigation-link.astro +8 -8
- package/dist/astro/native/core-navigation-submenu.astro +11 -11
- package/dist/astro/native/core-navigation.astro +17 -17
- package/dist/astro/native/core-page-list-data-item.astro +6 -6
- package/dist/astro/native/core-page-list-item.astro +2 -2
- package/dist/astro/native/core-page-list.astro +3 -3
- package/dist/astro/native/core-post-date.astro +5 -5
- package/dist/astro/native/core-post-excerpt.astro +7 -7
- package/dist/astro/native/core-post-featured-image.astro +5 -5
- package/dist/astro/native/core-post-template.astro +5 -5
- package/dist/astro/native/core-post-terms.astro +8 -8
- package/dist/astro/native/core-post-title.astro +2 -2
- package/dist/astro/native/core-query-no-results.astro +2 -2
- package/dist/astro/native/core-query.astro +6 -6
- package/dist/astro/native/core-site-title.astro +8 -8
- package/dist/astro/native/core-term-description.astro +2 -2
- package/dist/astro/native/core-term-name.astro +2 -2
- package/dist/astro/native/core-term-template.astro +5 -5
- package/dist/astro/native/core-terms-query.astro +5 -5
- package/dist/astro/native/core-transparent.astro +2 -2
- package/dist/astro/native/sf-block-binding.astro +3 -3
- package/dist/astro/preferences/AccessibilityPanel.astro +17 -17
- package/dist/astro/preferences/Toggle.astro +7 -7
- package/dist/styleflow.d.ts.map +1 -1
- package/dist/styleflow.js +11 -2
- package/dist/styleflow.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
|
|
5
5
|
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
@@ -8,4 +8,4 @@ const label = String(block.resolvedData?.label ?? block.attributes.label ?? "Hom
|
|
|
8
8
|
const rootProps = { ...htmlProps, class: ["wp-block-navigation-item", htmlProps.class].filter(Boolean).join(" ") };
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
<
|
|
11
|
+
<StyleflowElement as="li" {...rootProps} {...styleflowProps}><StyleflowElement as="a" class="wp-block-navigation-item__content" href={href}><StyleflowElement as="span" class="wp-block-navigation-item__label">{label}</StyleflowElement></StyleflowElement></StyleflowElement>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
|
|
5
5
|
type ImageResolvedData = {
|
|
@@ -104,21 +104,21 @@ const imageProps = {
|
|
|
104
104
|
---
|
|
105
105
|
|
|
106
106
|
{src ? (
|
|
107
|
-
<
|
|
107
|
+
<StyleflowElement as="figure" {...rootProps} {...styleflowProps} data-flowpress-image-lightbox={lightboxHref ? "link" : undefined}>
|
|
108
108
|
{href ? (
|
|
109
|
-
<
|
|
109
|
+
<StyleflowElement as="a"
|
|
110
110
|
href={href}
|
|
111
111
|
class={text(attributes.linkClass) || text(media.linkClass) || undefined}
|
|
112
112
|
target={external ? "_blank" : undefined}
|
|
113
113
|
rel={rel}
|
|
114
114
|
>
|
|
115
|
-
<
|
|
116
|
-
</
|
|
117
|
-
) : <
|
|
115
|
+
<StyleflowElement as="img" {...imageProps} />
|
|
116
|
+
</StyleflowElement>
|
|
117
|
+
) : <StyleflowElement as="img" {...imageProps} />}
|
|
118
118
|
{caption ? (
|
|
119
|
-
<
|
|
119
|
+
<StyleflowElement as="figcaption" class="wp-element-caption">
|
|
120
120
|
<Fragment set:html={caption} />
|
|
121
|
-
</
|
|
121
|
+
</StyleflowElement>
|
|
122
122
|
) : null}
|
|
123
|
-
</
|
|
123
|
+
</StyleflowElement>
|
|
124
124
|
) : null}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
|
|
5
5
|
const { block, htmlProps, styleflowProps } =
|
|
@@ -40,8 +40,8 @@ try {
|
|
|
40
40
|
}
|
|
41
41
|
---
|
|
42
42
|
|
|
43
|
-
<
|
|
44
|
-
<
|
|
43
|
+
<StyleflowElement as="li" {...rootProps} {...styleflowProps}>
|
|
44
|
+
<StyleflowElement as="a"
|
|
45
45
|
class="wp-block-navigation-item__content site-nav__link"
|
|
46
46
|
href={href}
|
|
47
47
|
title={String(block.attributes.title ?? "").trim() || undefined}
|
|
@@ -54,17 +54,17 @@ try {
|
|
|
54
54
|
>
|
|
55
55
|
{
|
|
56
56
|
current ? (
|
|
57
|
-
<
|
|
57
|
+
<StyleflowElement as="span"
|
|
58
58
|
class="wp-block-navigation-item__label"
|
|
59
59
|
surface="default"
|
|
60
60
|
foreground="accent"
|
|
61
61
|
noBackground
|
|
62
62
|
>
|
|
63
63
|
{label}
|
|
64
|
-
</
|
|
64
|
+
</StyleflowElement>
|
|
65
65
|
) : (
|
|
66
|
-
<
|
|
66
|
+
<StyleflowElement as="span" class="wp-block-navigation-item__label">{label}</StyleflowElement>
|
|
67
67
|
)
|
|
68
68
|
}
|
|
69
|
-
</
|
|
70
|
-
</
|
|
69
|
+
</StyleflowElement>
|
|
70
|
+
</StyleflowElement>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
|
|
5
5
|
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
@@ -7,9 +7,9 @@ const label = String(block.attributes.label ?? block.attributes.title ?? "Submen
|
|
|
7
7
|
const rootProps = { ...htmlProps, class: ["wp-block-navigation-item has-child", htmlProps.class].filter(Boolean).join(" ") };
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
<
|
|
10
|
+
<StyleflowElement as="li" {...rootProps} {...styleflowProps}>
|
|
11
|
+
<StyleflowElement as="details" data-navigation-disclosure class="site-nav__disclosure">
|
|
12
|
+
<StyleflowElement as="summary"
|
|
13
13
|
class="site-nav__link site-nav__summary"
|
|
14
14
|
layoutRole="control"
|
|
15
15
|
density="regular"
|
|
@@ -17,16 +17,16 @@ const rootProps = { ...htmlProps, class: ["wp-block-navigation-item has-child",
|
|
|
17
17
|
noBackground
|
|
18
18
|
noBorder
|
|
19
19
|
>
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
</
|
|
23
|
-
<
|
|
20
|
+
<StyleflowElement as="span" class="wp-block-navigation-item__label">{label}</StyleflowElement>
|
|
21
|
+
<StyleflowElement as="span" aria-hidden="true" class="site-nav__chevron"></StyleflowElement>
|
|
22
|
+
</StyleflowElement>
|
|
23
|
+
<StyleflowElement as="ul"
|
|
24
24
|
class="wp-block-navigation__submenu-container site-nav__submenu"
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
surface="default"
|
|
28
28
|
layoutRole="panel"
|
|
29
29
|
density="compact"
|
|
30
|
-
><slot /></
|
|
31
|
-
</
|
|
32
|
-
</
|
|
30
|
+
><slot /></StyleflowElement>
|
|
31
|
+
</StyleflowElement>
|
|
32
|
+
</StyleflowElement>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import "./flowpress-navigation.css";
|
|
4
4
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
5
5
|
|
|
@@ -34,8 +34,8 @@ const closeLabel = String(block.attributes.closeMenuLabel ?? "Close menu");
|
|
|
34
34
|
data-open-label={openLabel}
|
|
35
35
|
data-close-label={closeLabel}
|
|
36
36
|
>
|
|
37
|
-
<
|
|
38
|
-
<
|
|
37
|
+
<StyleflowElement as="nav" {...htmlProps} {...styleflowProps} layoutRole="none" aria-label={label}>
|
|
38
|
+
<StyleflowElement as="button"
|
|
39
39
|
type="button"
|
|
40
40
|
data-navigation-toggle
|
|
41
41
|
aria-expanded="false"
|
|
@@ -51,13 +51,13 @@ const closeLabel = String(block.attributes.closeMenuLabel ?? "Close menu");
|
|
|
51
51
|
class="site-nav__toggle sf-motion-menu-toggle"
|
|
52
52
|
hidden
|
|
53
53
|
>
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
<
|
|
57
|
-
<
|
|
58
|
-
</
|
|
59
|
-
</
|
|
60
|
-
<
|
|
54
|
+
<StyleflowElement as="span" class="sr-only">{openLabel}</StyleflowElement>
|
|
55
|
+
<StyleflowElement as="span" aria-hidden="true" class="sf-motion-menu-toggle__icon relative block size-5">
|
|
56
|
+
<StyleflowElement as="span" class="sf-motion-menu-toggle__line"></StyleflowElement>
|
|
57
|
+
<StyleflowElement as="span" class="sf-motion-menu-toggle__line"></StyleflowElement>
|
|
58
|
+
</StyleflowElement>
|
|
59
|
+
</StyleflowElement>
|
|
60
|
+
<StyleflowElement as="div"
|
|
61
61
|
data-navigation-backdrop
|
|
62
62
|
data-sf-motion-state="closed"
|
|
63
63
|
|
|
@@ -66,15 +66,15 @@ const closeLabel = String(block.attributes.closeMenuLabel ?? "Close menu");
|
|
|
66
66
|
layoutRole="none"
|
|
67
67
|
class="sf-motion-backdrop site-nav__backdrop"
|
|
68
68
|
hidden
|
|
69
|
-
></
|
|
70
|
-
<
|
|
69
|
+
></StyleflowElement>
|
|
70
|
+
<StyleflowElement as="div"
|
|
71
71
|
id={`${navigationId}-panel`}
|
|
72
72
|
data-navigation-panel
|
|
73
73
|
data-sf-motion-state="closed"
|
|
74
74
|
layoutRole="none"
|
|
75
75
|
class="site-nav__panel"
|
|
76
76
|
>
|
|
77
|
-
<
|
|
77
|
+
<StyleflowElement as="span"
|
|
78
78
|
aria-hidden="true"
|
|
79
79
|
|
|
80
80
|
|
|
@@ -82,10 +82,10 @@ const closeLabel = String(block.attributes.closeMenuLabel ?? "Close menu");
|
|
|
82
82
|
layoutRole="panel"
|
|
83
83
|
density="regular"
|
|
84
84
|
class="site-nav__sheet"
|
|
85
|
-
></
|
|
86
|
-
<
|
|
87
|
-
</
|
|
88
|
-
</
|
|
85
|
+
></StyleflowElement>
|
|
86
|
+
<StyleflowElement as="ul" layoutRole="stack" density="regular" class="site-nav__list"><slot /></StyleflowElement>
|
|
87
|
+
</StyleflowElement>
|
|
88
|
+
</StyleflowElement>
|
|
89
89
|
</flowpress-navigation>
|
|
90
90
|
|
|
91
91
|
<script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
|
|
4
4
|
interface Props { item: Record<string, unknown>; styleflowProps?: Record<string, unknown> | undefined; htmlProps?: { id?: string | undefined; class?: string } | undefined; }
|
|
5
5
|
const { item, styleflowProps = {}, htmlProps = {} } = Astro.props;
|
|
@@ -8,11 +8,11 @@ const children = Array.isArray(item.children)
|
|
|
8
8
|
: [];
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
<
|
|
12
|
-
<
|
|
11
|
+
<StyleflowElement as="li" {...htmlProps} class={["wp-block-pages-list__item", htmlProps.class].filter(Boolean).join(" ")} {...styleflowProps}>
|
|
12
|
+
<StyleflowElement as="a" href={String(item.url ?? "#")}>{String(item.label ?? "")}</StyleflowElement>
|
|
13
13
|
{children.length > 0 && (
|
|
14
|
-
<
|
|
14
|
+
<StyleflowElement as="ul">
|
|
15
15
|
{children.map((child) => <Astro.self item={child} />)}
|
|
16
|
-
</
|
|
16
|
+
</StyleflowElement>
|
|
17
17
|
)}
|
|
18
|
-
</
|
|
18
|
+
</StyleflowElement>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
5
5
|
const rootProps = { ...htmlProps, class: ["wp-block-pages-list__item", htmlProps.class].filter(Boolean).join(" ") };
|
|
6
6
|
---
|
|
7
|
-
<
|
|
7
|
+
<StyleflowElement as="li" {...rootProps} {...styleflowProps}><StyleflowElement as="a" href={String(block.attributes.url ?? "#")}>{String(block.attributes.label ?? "")}</StyleflowElement><slot /></StyleflowElement>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
import PageListItem from "./core-page-list-data-item.astro";
|
|
5
5
|
|
|
@@ -33,8 +33,8 @@ const nestedInNavigation = ["core/navigation", "core/navigation-submenu"]
|
|
|
33
33
|
{nestedInNavigation
|
|
34
34
|
? roots.map((item, index) => <PageListItem item={item} styleflowProps={styleflowProps} htmlProps={index === 0 ? htmlProps : undefined} />)
|
|
35
35
|
: (
|
|
36
|
-
<
|
|
36
|
+
<StyleflowElement as="ul" {...htmlProps} class={["wp-block-page-list", htmlProps.class].filter(Boolean).join(" ")} {...styleflowProps}>
|
|
37
37
|
{roots.map((item) => <PageListItem item={item} />)}
|
|
38
|
-
</
|
|
38
|
+
</StyleflowElement>
|
|
39
39
|
)}
|
|
40
40
|
<slot />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
import { classNames, text } from "./query-loop.js";
|
|
5
5
|
|
|
@@ -12,9 +12,9 @@ const rootProps = { ...htmlProps, class: classNames("wp-block-post-date", htmlPr
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
14
|
{formatted ? (
|
|
15
|
-
<
|
|
15
|
+
<StyleflowElement as="div" {...rootProps} {...styleflowProps}>
|
|
16
16
|
{block.attributes.isLink && url
|
|
17
|
-
? <
|
|
18
|
-
: <
|
|
19
|
-
</
|
|
17
|
+
? <StyleflowElement as="a" href={url}><StyleflowElement as="time" datetime={datetime}>{formatted}</StyleflowElement></StyleflowElement>
|
|
18
|
+
: <StyleflowElement as="time" datetime={datetime}>{formatted}</StyleflowElement>}
|
|
19
|
+
</StyleflowElement>
|
|
20
20
|
) : null}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
import { classNames, text } from "./query-loop.js";
|
|
5
5
|
|
|
@@ -13,13 +13,13 @@ const rootProps = { ...htmlProps, class: classNames("wp-block-post-excerpt", htm
|
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
{excerpt ? (
|
|
16
|
-
<
|
|
17
|
-
<
|
|
16
|
+
<StyleflowElement as="div" {...rootProps} {...styleflowProps}>
|
|
17
|
+
<StyleflowElement as="p" class="wp-block-post-excerpt__excerpt">
|
|
18
18
|
{excerpt}
|
|
19
|
-
{moreText && url && !attributes.showMoreOnNewLine ? <> <
|
|
20
|
-
</
|
|
19
|
+
{moreText && url && !attributes.showMoreOnNewLine ? <> <StyleflowElement as="a" class="wp-block-post-excerpt__more-link" href={url}>{moreText}</StyleflowElement></> : null}
|
|
20
|
+
</StyleflowElement>
|
|
21
21
|
{moreText && url && attributes.showMoreOnNewLine ? (
|
|
22
|
-
<
|
|
22
|
+
<StyleflowElement as="p" class="wp-block-post-excerpt__more-text"><StyleflowElement as="a" class="wp-block-post-excerpt__more-link" href={url}>{moreText}</StyleflowElement></StyleflowElement>
|
|
23
23
|
) : null}
|
|
24
|
-
</
|
|
24
|
+
</StyleflowElement>
|
|
25
25
|
) : null}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
import { classNames, externalRel, text, type ResolvedImage } from "./query-loop.js";
|
|
5
5
|
|
|
@@ -29,9 +29,9 @@ const imageProps = {
|
|
|
29
29
|
---
|
|
30
30
|
|
|
31
31
|
{src ? (
|
|
32
|
-
<
|
|
32
|
+
<StyleflowElement as="figure" {...rootProps} {...styleflowProps}>
|
|
33
33
|
{href
|
|
34
|
-
? <
|
|
35
|
-
: <
|
|
36
|
-
</
|
|
34
|
+
? <StyleflowElement as="a" href={href} target={attributes.linkTarget === "_blank" ? "_blank" : undefined} rel={externalRel(attributes.linkTarget, attributes.rel)}><StyleflowElement as="img" {...imageProps} /></StyleflowElement>
|
|
35
|
+
: <StyleflowElement as="img" {...imageProps} />}
|
|
36
|
+
</StyleflowElement>
|
|
37
37
|
) : null}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
import ResolvedBlocks from "./ResolvedBlocks.astro";
|
|
5
5
|
import { classNames, type LoopTemplateData } from "./query-loop.js";
|
|
@@ -20,11 +20,11 @@ const rootProps = {
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
22
|
{items.length > 0 ? (
|
|
23
|
-
<
|
|
23
|
+
<StyleflowElement as="ul" {...rootProps} {...styleflowProps}>
|
|
24
24
|
{items.map((item, index) => (
|
|
25
|
-
<
|
|
25
|
+
<StyleflowElement as="li" class={classNames("wp-block-post", `post-${item.id}`, item.postType ? `type-${item.postType}` : "", grid ? [...spanClasses((childAttributes[index] ?? {})), ...usedSpanClasses(block.attributes, (childAttributes[index] ?? {})), ...(bleed[index] ?? [])].join(" ") : "")}>
|
|
26
26
|
<ResolvedBlocks {...props} blocks={item.blocks} pass={data} renderPassOutput={index === 0} />
|
|
27
|
-
</
|
|
27
|
+
</StyleflowElement>
|
|
28
28
|
))}
|
|
29
|
-
</
|
|
29
|
+
</StyleflowElement>
|
|
30
30
|
) : null}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
import TermFieldValue from "./TermFieldValue.astro";
|
|
5
5
|
import { classNames, text } from "./query-loop.js";
|
|
@@ -23,24 +23,24 @@ const rootProps = {
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
25
|
{terms.length > 0 ? (
|
|
26
|
-
<
|
|
27
|
-
{prefix ? <
|
|
26
|
+
<StyleflowElement as="div" {...rootProps} {...styleflowProps}>
|
|
27
|
+
{prefix ? <StyleflowElement as="span" class="wp-block-post-terms__prefix">{prefix}</StyleflowElement> : null}
|
|
28
28
|
{terms.map((term, index) => {
|
|
29
29
|
const field = display === "name" ? undefined : term.field;
|
|
30
30
|
const label = field ? (
|
|
31
31
|
<>
|
|
32
|
-
{display === "both" ? <
|
|
32
|
+
{display === "both" ? <StyleflowElement as="span" class="wp-block-post-terms__name">{term.name}</StyleflowElement> : null}
|
|
33
33
|
{display === "both" ? " " : null}
|
|
34
34
|
<TermFieldValue field={field} fallbackAlt={display === "field" ? term.name : ""} />
|
|
35
35
|
</>
|
|
36
36
|
) : term.name;
|
|
37
37
|
return (
|
|
38
38
|
<>
|
|
39
|
-
{index > 0 ? <
|
|
40
|
-
{term.url ? <
|
|
39
|
+
{index > 0 ? <StyleflowElement as="span" class="wp-block-post-terms__separator">{separator}</StyleflowElement> : null}
|
|
40
|
+
{term.url ? <StyleflowElement as="a" href={term.url} rel="tag">{label}</StyleflowElement> : <StyleflowElement as="span">{label}</StyleflowElement>}
|
|
41
41
|
</>
|
|
42
42
|
);
|
|
43
43
|
})}
|
|
44
|
-
{suffix ? <
|
|
45
|
-
</
|
|
44
|
+
{suffix ? <StyleflowElement as="span" class="wp-block-post-terms__suffix">{suffix}</StyleflowElement> : null}
|
|
45
|
+
</StyleflowElement>
|
|
46
46
|
) : null}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
import LevelTag from "./LevelTag.astro";
|
|
5
5
|
import { classNames, externalRel, headingLevel, text } from "./query-loop.js";
|
|
@@ -17,7 +17,7 @@ const rootProps = { ...htmlProps, class: classNames("wp-block-post-title", htmlP
|
|
|
17
17
|
{title ? (
|
|
18
18
|
<LevelTag tag={tag} {...rootProps} {...styleflowProps}>
|
|
19
19
|
{attributes.isLink && url
|
|
20
|
-
? <
|
|
20
|
+
? <StyleflowElement as="a" href={url} target={attributes.linkTarget === "_blank" ? "_blank" : undefined} rel={externalRel(attributes.linkTarget, attributes.rel)}><Fragment set:html={title} /></StyleflowElement>
|
|
21
21
|
: <Fragment set:html={title} />}
|
|
22
22
|
</LevelTag>
|
|
23
23
|
) : null}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
import { classNames } from "./query-loop.js";
|
|
5
5
|
|
|
@@ -9,4 +9,4 @@ const visible = block.resolvedData?.visible === true;
|
|
|
9
9
|
const rootProps = { ...htmlProps, class: classNames("wp-block-query-no-results", htmlProps.class) };
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
{visible ? <
|
|
12
|
+
{visible ? <StyleflowElement as="div" {...rootProps} {...styleflowProps}><slot /></StyleflowElement> : null}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
import ResolvedBlocks from "./ResolvedBlocks.astro";
|
|
5
5
|
import { classNames, type LoopData } from "./query-loop.js";
|
|
@@ -15,8 +15,8 @@ const tag = ["div", "section", "main", "aside", "article"].includes(authored) ?
|
|
|
15
15
|
const rootProps = { ...htmlProps, class: classNames("wp-block-query", htmlProps.class) };
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
{tag === "section" ? <
|
|
19
|
-
: tag === "main" ? <
|
|
20
|
-
: tag === "aside" ? <
|
|
21
|
-
: tag === "article" ? <
|
|
22
|
-
: <
|
|
18
|
+
{tag === "section" ? <StyleflowElement as="section" {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></StyleflowElement>
|
|
19
|
+
: tag === "main" ? <StyleflowElement as="main" {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></StyleflowElement>
|
|
20
|
+
: tag === "aside" ? <StyleflowElement as="aside" {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></StyleflowElement>
|
|
21
|
+
: tag === "article" ? <StyleflowElement as="article" {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></StyleflowElement>
|
|
22
|
+
: <StyleflowElement as="div" {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></StyleflowElement>}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
5
5
|
const level = Number(block.attributes.level ?? 1);
|
|
6
6
|
const title = String(block.resolvedData?.title ?? "");
|
|
7
7
|
const url = String(block.resolvedData?.url ?? "/");
|
|
8
8
|
---
|
|
9
|
-
{level === 1 ? <
|
|
10
|
-
: level === 2 ? <
|
|
11
|
-
: level === 3 ? <
|
|
12
|
-
: level === 4 ? <
|
|
13
|
-
: level === 5 ? <
|
|
14
|
-
: level === 6 ? <
|
|
15
|
-
: <
|
|
9
|
+
{level === 1 ? <StyleflowElement as="h1" {...htmlProps} {...styleflowProps}><StyleflowElement as="a" href={url}>{title}</StyleflowElement></StyleflowElement>
|
|
10
|
+
: level === 2 ? <StyleflowElement as="h2" {...htmlProps} {...styleflowProps}><StyleflowElement as="a" href={url}>{title}</StyleflowElement></StyleflowElement>
|
|
11
|
+
: level === 3 ? <StyleflowElement as="h3" {...htmlProps} {...styleflowProps}><StyleflowElement as="a" href={url}>{title}</StyleflowElement></StyleflowElement>
|
|
12
|
+
: level === 4 ? <StyleflowElement as="h4" {...htmlProps} {...styleflowProps}><StyleflowElement as="a" href={url}>{title}</StyleflowElement></StyleflowElement>
|
|
13
|
+
: level === 5 ? <StyleflowElement as="h5" {...htmlProps} {...styleflowProps}><StyleflowElement as="a" href={url}>{title}</StyleflowElement></StyleflowElement>
|
|
14
|
+
: level === 6 ? <StyleflowElement as="h6" {...htmlProps} {...styleflowProps}><StyleflowElement as="a" href={url}>{title}</StyleflowElement></StyleflowElement>
|
|
15
|
+
: <StyleflowElement as="p" {...htmlProps} {...styleflowProps}><StyleflowElement as="a" href={url}>{title}</StyleflowElement></StyleflowElement>}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
import { classNames, text } from "./query-loop.js";
|
|
5
5
|
|
|
@@ -9,4 +9,4 @@ const description = text(block.resolvedData?.description);
|
|
|
9
9
|
const rootProps = { ...htmlProps, class: classNames("wp-block-term-description", htmlProps.class) };
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
{description ? <
|
|
12
|
+
{description ? <StyleflowElement as="div" {...rootProps} {...styleflowProps}><Fragment set:html={description} /></StyleflowElement> : null}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
import LevelTag from "./LevelTag.astro";
|
|
5
5
|
import { classNames, headingLevel, text } from "./query-loop.js";
|
|
@@ -15,6 +15,6 @@ const rootProps = { ...htmlProps, class: classNames("wp-block-term-name", htmlPr
|
|
|
15
15
|
|
|
16
16
|
{name ? (
|
|
17
17
|
<LevelTag tag={tag} {...rootProps} {...styleflowProps}>
|
|
18
|
-
{block.attributes.isLink && url ? <
|
|
18
|
+
{block.attributes.isLink && url ? <StyleflowElement as="a" href={url}>{name}</StyleflowElement> : name}
|
|
19
19
|
</LevelTag>
|
|
20
20
|
) : null}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
import ResolvedBlocks from "./ResolvedBlocks.astro";
|
|
5
5
|
import { classNames, type LoopTemplateData } from "./query-loop.js";
|
|
@@ -20,11 +20,11 @@ const rootProps = {
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
22
|
{items.length > 0 ? (
|
|
23
|
-
<
|
|
23
|
+
<StyleflowElement as="ul" {...rootProps} {...styleflowProps}>
|
|
24
24
|
{items.map((item, index) => (
|
|
25
|
-
<
|
|
25
|
+
<StyleflowElement as="li" class={classNames("wp-block-term", `term-${item.id}`, item.taxonomy ? `taxonomy-${item.taxonomy}` : "", grid ? [...spanClasses((childAttributes[index] ?? {})), ...usedSpanClasses(block.attributes, (childAttributes[index] ?? {})), ...(bleed[index] ?? [])].join(" ") : "")}>
|
|
26
26
|
<ResolvedBlocks {...props} blocks={item.blocks} pass={data} renderPassOutput={index === 0} />
|
|
27
|
-
</
|
|
27
|
+
</StyleflowElement>
|
|
28
28
|
))}
|
|
29
|
-
</
|
|
29
|
+
</StyleflowElement>
|
|
30
30
|
) : null}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
import ResolvedBlocks from "./ResolvedBlocks.astro";
|
|
5
5
|
import { classNames, type LoopData } from "./query-loop.js";
|
|
@@ -13,7 +13,7 @@ const tag = ["div", "section", "aside", "nav"].includes(authored) ? authored : "
|
|
|
13
13
|
const rootProps = { ...htmlProps, class: classNames("wp-block-terms-query", htmlProps.class) };
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
{tag === "section" ? <
|
|
17
|
-
: tag === "aside" ? <
|
|
18
|
-
: tag === "nav" ? <
|
|
19
|
-
: <
|
|
16
|
+
{tag === "section" ? <StyleflowElement as="section" {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></StyleflowElement>
|
|
17
|
+
: tag === "aside" ? <StyleflowElement as="aside" {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></StyleflowElement>
|
|
18
|
+
: tag === "nav" ? <StyleflowElement as="nav" {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></StyleflowElement>
|
|
19
|
+
: <StyleflowElement as="div" {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></StyleflowElement>}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlockRendererProps } from "../../block-renderers.js";
|
|
4
4
|
|
|
5
5
|
const { htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
@@ -7,5 +7,5 @@ const ownsSemanticContext = Object.keys(styleflowProps).length > 0 || Object.key
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
{ownsSemanticContext
|
|
10
|
-
? <
|
|
10
|
+
? <StyleflowElement as="div" {...htmlProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
11
11
|
: <slot />}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { FlowpressBlock, FlowpressBlockRendererProps } from "../../index.js";
|
|
4
4
|
import ResolvedBlocks from "./ResolvedBlocks.astro";
|
|
5
5
|
import type { NestedPass } from "./query-loop.js";
|
|
@@ -13,8 +13,8 @@ const data = (block.resolvedData ?? {}) as NestedPass & {
|
|
|
13
13
|
const items = data.items ?? [];
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
<
|
|
16
|
+
<StyleflowElement as="div" {...htmlProps} {...styleflowProps} class:list={["wp-block-project-block-binding", htmlProps.class]}>
|
|
17
17
|
{items.length > 0 ? items.map((item, index) => (
|
|
18
18
|
<ResolvedBlocks {...props} blocks={item.blocks} pass={data} renderPassOutput={index === 0} />
|
|
19
19
|
)) : <ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} />}
|
|
20
|
-
</
|
|
20
|
+
</StyleflowElement>
|