@styleflow.app/flowpress-astro-core 1.0.0-beta.26 → 1.0.0-beta.28
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 +11 -0
- package/dist/astro/BaseLayout.astro +10 -9
- package/dist/astro/DefaultTemplate.astro +6 -6
- package/dist/astro/GutenbergRenderer.astro +33 -33
- package/dist/astro/StyleflowElement.astro +23 -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 +10 -9
- 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 +25 -24
- 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 +5 -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 +4 -3
- package/dist/astro/native/core-image.astro +9 -9
- package/dist/astro/native/core-navigation-link.astro +10 -9
- package/dist/astro/native/core-navigation-submenu.astro +13 -12
- package/dist/astro/native/core-navigation.astro +17 -17
- package/dist/astro/native/core-page-list-data-item.astro +7 -6
- package/dist/astro/native/core-page-list-item.astro +3 -2
- package/dist/astro/native/core-page-list.astro +3 -3
- package/dist/astro/native/core-post-date.astro +7 -6
- 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 +13 -12
- 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-separator.astro +20 -0
- package/dist/astro/native/core-site-title.astro +10 -9
- package/dist/astro/native/core-term-description.astro +2 -2
- package/dist/astro/native/core-term-name.astro +4 -3
- 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/registry.d.ts.map +1 -1
- package/dist/astro/native/registry.js +2 -0
- package/dist/astro/native/registry.js.map +1 -1
- package/dist/astro/native/registry.ts +2 -0
- 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/default-blocks.d.ts +1 -1
- package/dist/default-blocks.d.ts.map +1 -1
- package/dist/default-blocks.js +2 -1
- package/dist/default-blocks.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/styleflow.d.ts.map +1 -1
- package/dist/styleflow.js +11 -2
- package/dist/styleflow.js.map +1 -1
- package/dist/text.d.ts +3 -0
- package/dist/text.d.ts.map +1 -0
- package/dist/text.js +6 -0
- package/dist/text.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -2
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
3
|
import type { TimelineItem } from "./timeline.js";
|
|
4
4
|
import "./timeline.css";
|
|
5
5
|
interface Props { items:TimelineItem[]; tone?:string | undefined; intensity?:string | undefined; id?:string | undefined; class?:string | undefined; ariaLabel?:string | undefined; rootProps?:Record<string,unknown> | undefined; styleflowProps?:Record<string,unknown> | undefined; }
|
|
6
6
|
const {items,tone="inherit",intensity="inherit",id,class:className="",ariaLabel="Timeline",rootProps={},styleflowProps={}}=Astro.props;
|
|
7
7
|
---
|
|
8
|
-
<
|
|
9
|
-
<
|
|
8
|
+
<StyleflowElement as="section" {...rootProps} {...styleflowProps} id={id ?? (typeof rootProps.id === "string" ? rootProps.id : undefined)} {...(tone !== "inherit" ? {tone} : {})} {...(intensity !== "inherit" ? {intensity} : {})} layoutRole="stack" density="regular" aria-label={ariaLabel} class:list={["flowpress-timeline",rootProps.class,className]} data-flowpress-timeline>
|
|
9
|
+
<StyleflowElement as="ol" layoutRole="stack" density="regular" class="flowpress-timeline__list">
|
|
10
10
|
{items.map(item=>(
|
|
11
|
-
<
|
|
12
|
-
{item.year && <
|
|
13
|
-
{item.image && <
|
|
14
|
-
{item.description && <
|
|
15
|
-
{item.metric && <
|
|
16
|
-
{(item.statisticValue || item.statisticLabel) && <
|
|
17
|
-
</
|
|
11
|
+
<StyleflowElement as="li" {...(item.tone && item.tone !== "inherit" ? {tone:item.tone} : {})} {...(item.intensity && item.intensity !== "inherit" ? {intensity:item.intensity} : {})} layoutRole="stack" density="regular" surface="default" class="flowpress-timeline__item" data-flowpress-timeline-item>
|
|
12
|
+
{item.year && <StyleflowElement as="h3">{item.year}</StyleflowElement>}
|
|
13
|
+
{item.image && <StyleflowElement as="img" src={item.image.url ?? item.image.sourceUrl} alt={item.image.alt ?? item.image.altText ?? ""} width={item.image.width} height={item.image.height} loading="lazy" />}
|
|
14
|
+
{item.description && <StyleflowElement as="p">{item.description}</StyleflowElement>}
|
|
15
|
+
{item.metric && <StyleflowElement as="p">{item.metric}</StyleflowElement>}
|
|
16
|
+
{(item.statisticValue || item.statisticLabel) && <StyleflowElement as="p"><StyleflowElement as="strong">{item.statisticValue}</StyleflowElement> {item.statisticLabel}</StyleflowElement>}
|
|
17
|
+
</StyleflowElement>
|
|
18
18
|
))}
|
|
19
|
-
</
|
|
20
|
-
</
|
|
19
|
+
</StyleflowElement>
|
|
20
|
+
</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 SyncedPatternContent from "./SyncedPatternContent.astro";
|
|
5
5
|
|
|
@@ -14,5 +14,5 @@ const ownsSemanticContext = Object.keys(block.attributes ?? {}).some((name) => !
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
16
|
{ownsSemanticContext
|
|
17
|
-
? <
|
|
17
|
+
? <StyleflowElement as="div" {...htmlProps} {...styleflowProps}><SyncedPatternContent {...props} selfRenderer={Astro.self}><slot /></SyncedPatternContent></StyleflowElement>
|
|
18
18
|
: <SyncedPatternContent {...props} selfRenderer={Astro.self}><slot /></SyncedPatternContent>}
|
|
@@ -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 { nativeButtonData } from "./button.js";
|
|
5
5
|
|
|
@@ -22,19 +22,19 @@ const controlProps = {
|
|
|
22
22
|
---
|
|
23
23
|
|
|
24
24
|
{!resolved ? (
|
|
25
|
-
block.innerHtml ? <
|
|
25
|
+
block.innerHtml ? <StyleflowElement as="div" {...htmlProps} {...styleflowProps} data-flowpress-button-legacy set:html={block.innerHtml} /> : null
|
|
26
26
|
) : !button.empty ? (
|
|
27
|
-
<
|
|
27
|
+
<StyleflowElement as="div" {...rootProps}>
|
|
28
28
|
{button.tag === "button" ? (
|
|
29
|
-
<
|
|
29
|
+
<StyleflowElement as="button" {...controlProps} type={button.type}><Fragment set:html={button.label} /></StyleflowElement>
|
|
30
30
|
) : button.href ? (
|
|
31
|
-
<
|
|
31
|
+
<StyleflowElement as="a" {...controlProps} href={button.href} target={button.target} rel={button.rel}>
|
|
32
32
|
<Fragment set:html={button.label} />
|
|
33
|
-
</
|
|
33
|
+
</StyleflowElement>
|
|
34
34
|
) : (
|
|
35
|
-
<
|
|
35
|
+
<StyleflowElement as="span" {...controlProps} aria-disabled="true"><Fragment set:html={button.label} /></StyleflowElement>
|
|
36
36
|
)}
|
|
37
|
-
</
|
|
37
|
+
</StyleflowElement>
|
|
38
38
|
) : null}
|
|
39
39
|
|
|
40
40
|
<style>
|
|
@@ -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 { nativeButtonsLayout } from "./button.js";
|
|
5
5
|
|
|
@@ -11,4 +11,4 @@ const rootProps = {
|
|
|
11
11
|
style: [htmlProps.style, nativeButtonsLayout(layout)].filter(Boolean).join(";"),
|
|
12
12
|
};
|
|
13
13
|
---
|
|
14
|
-
<
|
|
14
|
+
<StyleflowElement as="div" {...rootProps} {...styleflowProps}><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
|
|
|
5
5
|
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
@@ -13,11 +13,11 @@ const rootProps = {
|
|
|
13
13
|
};
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
{tag === "section" ? <
|
|
17
|
-
: tag === "article" ? <
|
|
18
|
-
: tag === "header" ? <
|
|
19
|
-
: tag === "footer" ? <
|
|
20
|
-
: tag === "main" ? <
|
|
21
|
-
: tag === "aside" ? <
|
|
22
|
-
: tag === "nav" ? <
|
|
23
|
-
: <
|
|
16
|
+
{tag === "section" ? <StyleflowElement as="section" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
17
|
+
: tag === "article" ? <StyleflowElement as="article" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
18
|
+
: tag === "header" ? <StyleflowElement as="header" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
19
|
+
: tag === "footer" ? <StyleflowElement as="footer" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
20
|
+
: tag === "main" ? <StyleflowElement as="main" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
21
|
+
: tag === "aside" ? <StyleflowElement as="aside" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
22
|
+
: tag === "nav" ? <StyleflowElement as="nav" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
23
|
+
: <StyleflowElement as="div" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import { decodeFlowpressText } from "../../text.js";
|
|
3
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
4
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
5
|
|
|
5
6
|
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
6
7
|
const href = String(block.resolvedData?.url ?? block.attributes.url ?? "/");
|
|
7
|
-
const label =
|
|
8
|
+
const label = decodeFlowpressText(block.resolvedData?.label ?? block.attributes.label ?? "Home");
|
|
8
9
|
const rootProps = { ...htmlProps, class: ["wp-block-navigation-item", htmlProps.class].filter(Boolean).join(" ") };
|
|
9
10
|
---
|
|
10
11
|
|
|
11
|
-
<
|
|
12
|
+
<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,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import { decodeFlowpressText } from "../../text.js";
|
|
3
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
4
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
5
|
|
|
5
6
|
const { block, htmlProps, styleflowProps } =
|
|
6
7
|
Astro.props as FlowpressBlockRendererProps;
|
|
7
8
|
const href = String(block.attributes.url ?? "").trim() || "#";
|
|
8
|
-
const label =
|
|
9
|
+
const label = decodeFlowpressText(block.attributes.label ?? block.attributes.title ?? href);
|
|
9
10
|
const external = block.attributes.opensInNewTab === true;
|
|
10
11
|
const authoredRel = String(block.attributes.rel ?? "").trim();
|
|
11
12
|
const rel = external
|
|
@@ -40,8 +41,8 @@ try {
|
|
|
40
41
|
}
|
|
41
42
|
---
|
|
42
43
|
|
|
43
|
-
<
|
|
44
|
-
<
|
|
44
|
+
<StyleflowElement as="li" {...rootProps} {...styleflowProps}>
|
|
45
|
+
<StyleflowElement as="a"
|
|
45
46
|
class="wp-block-navigation-item__content site-nav__link"
|
|
46
47
|
href={href}
|
|
47
48
|
title={String(block.attributes.title ?? "").trim() || undefined}
|
|
@@ -54,17 +55,17 @@ try {
|
|
|
54
55
|
>
|
|
55
56
|
{
|
|
56
57
|
current ? (
|
|
57
|
-
<
|
|
58
|
+
<StyleflowElement as="span"
|
|
58
59
|
class="wp-block-navigation-item__label"
|
|
59
60
|
surface="default"
|
|
60
61
|
foreground="accent"
|
|
61
62
|
noBackground
|
|
62
63
|
>
|
|
63
64
|
{label}
|
|
64
|
-
</
|
|
65
|
+
</StyleflowElement>
|
|
65
66
|
) : (
|
|
66
|
-
<
|
|
67
|
+
<StyleflowElement as="span" class="wp-block-navigation-item__label">{label}</StyleflowElement>
|
|
67
68
|
)
|
|
68
69
|
}
|
|
69
|
-
</
|
|
70
|
-
</
|
|
70
|
+
</StyleflowElement>
|
|
71
|
+
</StyleflowElement>
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import { decodeFlowpressText } from "../../text.js";
|
|
3
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
4
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
5
|
|
|
5
6
|
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
6
|
-
const label =
|
|
7
|
+
const label = decodeFlowpressText(block.attributes.label ?? block.attributes.title ?? "Submenu");
|
|
7
8
|
const rootProps = { ...htmlProps, class: ["wp-block-navigation-item has-child", htmlProps.class].filter(Boolean).join(" ") };
|
|
8
9
|
---
|
|
9
10
|
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
<
|
|
11
|
+
<StyleflowElement as="li" {...rootProps} {...styleflowProps}>
|
|
12
|
+
<StyleflowElement as="details" data-navigation-disclosure class="site-nav__disclosure">
|
|
13
|
+
<StyleflowElement as="summary"
|
|
13
14
|
class="site-nav__link site-nav__summary"
|
|
14
15
|
layoutRole="control"
|
|
15
16
|
density="regular"
|
|
@@ -17,16 +18,16 @@ const rootProps = { ...htmlProps, class: ["wp-block-navigation-item has-child",
|
|
|
17
18
|
noBackground
|
|
18
19
|
noBorder
|
|
19
20
|
>
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
</
|
|
23
|
-
<
|
|
21
|
+
<StyleflowElement as="span" class="wp-block-navigation-item__label">{label}</StyleflowElement>
|
|
22
|
+
<StyleflowElement as="span" aria-hidden="true" class="site-nav__chevron"></StyleflowElement>
|
|
23
|
+
</StyleflowElement>
|
|
24
|
+
<StyleflowElement as="ul"
|
|
24
25
|
class="wp-block-navigation__submenu-container site-nav__submenu"
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
surface="default"
|
|
28
29
|
layoutRole="panel"
|
|
29
30
|
density="compact"
|
|
30
|
-
><slot /></
|
|
31
|
-
</
|
|
32
|
-
</
|
|
31
|
+
><slot /></StyleflowElement>
|
|
32
|
+
</StyleflowElement>
|
|
33
|
+
</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,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import { decodeFlowpressText } from "../../text.js";
|
|
3
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
4
|
|
|
4
5
|
interface Props { item: Record<string, unknown>; styleflowProps?: Record<string, unknown> | undefined; htmlProps?: { id?: string | undefined; class?: string } | undefined; }
|
|
5
6
|
const { item, styleflowProps = {}, htmlProps = {} } = Astro.props;
|
|
@@ -8,11 +9,11 @@ const children = Array.isArray(item.children)
|
|
|
8
9
|
: [];
|
|
9
10
|
---
|
|
10
11
|
|
|
11
|
-
<
|
|
12
|
-
<
|
|
12
|
+
<StyleflowElement as="li" {...htmlProps} class={["wp-block-pages-list__item", htmlProps.class].filter(Boolean).join(" ")} {...styleflowProps}>
|
|
13
|
+
<StyleflowElement as="a" href={String(item.url ?? "#")}>{decodeFlowpressText(item.label)}</StyleflowElement>
|
|
13
14
|
{children.length > 0 && (
|
|
14
|
-
<
|
|
15
|
+
<StyleflowElement as="ul">
|
|
15
16
|
{children.map((child) => <Astro.self item={child} />)}
|
|
16
|
-
</
|
|
17
|
+
</StyleflowElement>
|
|
17
18
|
)}
|
|
18
|
-
</
|
|
19
|
+
</StyleflowElement>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import { decodeFlowpressText } from "../../text.js";
|
|
3
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
4
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
5
|
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
5
6
|
const rootProps = { ...htmlProps, class: ["wp-block-pages-list__item", htmlProps.class].filter(Boolean).join(" ") };
|
|
6
7
|
---
|
|
7
|
-
<
|
|
8
|
+
<StyleflowElement as="li" {...rootProps} {...styleflowProps}><StyleflowElement as="a" href={String(block.attributes.url ?? "#")}>{decodeFlowpressText(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,20 +1,21 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import { decodeFlowpressText } from "../../text.js";
|
|
3
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
4
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
5
|
import { classNames, text } from "./query-loop.js";
|
|
5
6
|
|
|
6
7
|
// Publication (or modification) date of the current loop item.
|
|
7
8
|
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
8
9
|
const datetime = text(block.resolvedData?.datetime);
|
|
9
|
-
const formatted =
|
|
10
|
+
const formatted = decodeFlowpressText(block.resolvedData?.formatted);
|
|
10
11
|
const url = text(block.resolvedData?.url);
|
|
11
12
|
const rootProps = { ...htmlProps, class: classNames("wp-block-post-date", htmlProps.class) };
|
|
12
13
|
---
|
|
13
14
|
|
|
14
15
|
{formatted ? (
|
|
15
|
-
<
|
|
16
|
+
<StyleflowElement as="div" {...rootProps} {...styleflowProps}>
|
|
16
17
|
{block.attributes.isLink && url
|
|
17
|
-
? <
|
|
18
|
-
: <
|
|
19
|
-
</
|
|
18
|
+
? <StyleflowElement as="a" href={url}><StyleflowElement as="time" datetime={datetime}>{formatted}</StyleflowElement></StyleflowElement>
|
|
19
|
+
: <StyleflowElement as="time" datetime={datetime}>{formatted}</StyleflowElement>}
|
|
20
|
+
</StyleflowElement>
|
|
20
21
|
) : 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,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import { decodeFlowpressText } from "../../text.js";
|
|
3
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
4
|
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
5
|
import TermFieldValue from "./TermFieldValue.astro";
|
|
5
6
|
import { classNames, text } from "./query-loop.js";
|
|
@@ -13,9 +14,9 @@ const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRender
|
|
|
13
14
|
const attributes = block.attributes;
|
|
14
15
|
const terms = (Array.isArray(block.resolvedData?.terms) ? block.resolvedData.terms : []) as TermLink[];
|
|
15
16
|
const display = text(block.resolvedData?.display);
|
|
16
|
-
const separator = typeof attributes.separator === "string" ? attributes.separator : ", ";
|
|
17
|
-
const prefix =
|
|
18
|
-
const suffix =
|
|
17
|
+
const separator = typeof attributes.separator === "string" ? decodeFlowpressText(attributes.separator) : ", ";
|
|
18
|
+
const prefix = decodeFlowpressText(attributes.prefix);
|
|
19
|
+
const suffix = decodeFlowpressText(attributes.suffix);
|
|
19
20
|
const rootProps = {
|
|
20
21
|
...htmlProps,
|
|
21
22
|
class: classNames("wp-block-post-terms", `taxonomy-${text(attributes.term)}`, htmlProps.class),
|
|
@@ -23,24 +24,24 @@ const rootProps = {
|
|
|
23
24
|
---
|
|
24
25
|
|
|
25
26
|
{terms.length > 0 ? (
|
|
26
|
-
<
|
|
27
|
-
{prefix ? <
|
|
27
|
+
<StyleflowElement as="div" {...rootProps} {...styleflowProps}>
|
|
28
|
+
{prefix ? <StyleflowElement as="span" class="wp-block-post-terms__prefix">{prefix}</StyleflowElement> : null}
|
|
28
29
|
{terms.map((term, index) => {
|
|
29
30
|
const field = display === "name" ? undefined : term.field;
|
|
30
31
|
const label = field ? (
|
|
31
32
|
<>
|
|
32
|
-
{display === "both" ? <
|
|
33
|
+
{display === "both" ? <StyleflowElement as="span" class="wp-block-post-terms__name">{decodeFlowpressText(term.name)}</StyleflowElement> : null}
|
|
33
34
|
{display === "both" ? " " : null}
|
|
34
35
|
<TermFieldValue field={field} fallbackAlt={display === "field" ? term.name : ""} />
|
|
35
36
|
</>
|
|
36
|
-
) : term.name;
|
|
37
|
+
) : decodeFlowpressText(term.name);
|
|
37
38
|
return (
|
|
38
39
|
<>
|
|
39
|
-
{index > 0 ? <
|
|
40
|
-
{term.url ? <
|
|
40
|
+
{index > 0 ? <StyleflowElement as="span" class="wp-block-post-terms__separator">{separator}</StyleflowElement> : null}
|
|
41
|
+
{term.url ? <StyleflowElement as="a" href={term.url} rel="tag">{label}</StyleflowElement> : <StyleflowElement as="span">{label}</StyleflowElement>}
|
|
41
42
|
</>
|
|
42
43
|
);
|
|
43
44
|
})}
|
|
44
|
-
{suffix ? <
|
|
45
|
-
</
|
|
45
|
+
{suffix ? <StyleflowElement as="span" class="wp-block-post-terms__suffix">{suffix}</StyleflowElement> : null}
|
|
46
|
+
</StyleflowElement>
|
|
46
47
|
) : 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}
|