@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.
Files changed (84) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/astro/BaseLayout.astro +10 -9
  3. package/dist/astro/DefaultTemplate.astro +6 -6
  4. package/dist/astro/GutenbergRenderer.astro +33 -33
  5. package/dist/astro/StyleflowElement.astro +23 -0
  6. package/dist/astro/blocks/CarouselBlock.astro +5 -5
  7. package/dist/astro/blocks/CarouselItemBlock.astro +3 -3
  8. package/dist/astro/blocks/ColumnBlock.astro +3 -3
  9. package/dist/astro/blocks/CoverBlock.astro +6 -6
  10. package/dist/astro/blocks/FormBlock.astro +6 -6
  11. package/dist/astro/blocks/GridBlock.astro +3 -3
  12. package/dist/astro/blocks/HeroBlock.astro +3 -3
  13. package/dist/astro/blocks/ImageBlock.astro +3 -3
  14. package/dist/astro/blocks/ListItemFallback.astro +5 -5
  15. package/dist/astro/blocks/NumberSpinnerBlock.astro +3 -3
  16. package/dist/astro/blocks/SemanticElement.astro +19 -19
  17. package/dist/astro/blocks/SiteLogoBlock.astro +3 -3
  18. package/dist/astro/blocks/TextBlock.astro +10 -9
  19. package/dist/astro/blocks/ThemeToggleBlock.astro +4 -4
  20. package/dist/astro/blocks/helpers.d.ts.map +1 -1
  21. package/dist/astro/blocks/helpers.js +4 -3
  22. package/dist/astro/blocks/helpers.js.map +1 -1
  23. package/dist/astro/blocks/helpers.ts +4 -3
  24. package/dist/astro/native/Blob.astro +6 -6
  25. package/dist/astro/native/CustomFieldValue.astro +25 -24
  26. package/dist/astro/native/LevelTag.astro +10 -10
  27. package/dist/astro/native/MapBlock.astro +5 -5
  28. package/dist/astro/native/NativeHtmlBlock.astro +2 -2
  29. package/dist/astro/native/NativeIconBlock.astro +2 -2
  30. package/dist/astro/native/ResolvedBlocks.astro +6 -6
  31. package/dist/astro/native/SyncedPatternContent.astro +6 -6
  32. package/dist/astro/native/TermFieldValue.astro +5 -4
  33. package/dist/astro/native/Timeline.astro +12 -12
  34. package/dist/astro/native/core-block.astro +2 -2
  35. package/dist/astro/native/core-button.astro +8 -8
  36. package/dist/astro/native/core-buttons.astro +2 -2
  37. package/dist/astro/native/core-group.astro +9 -9
  38. package/dist/astro/native/core-home-link.astro +4 -3
  39. package/dist/astro/native/core-image.astro +9 -9
  40. package/dist/astro/native/core-navigation-link.astro +10 -9
  41. package/dist/astro/native/core-navigation-submenu.astro +13 -12
  42. package/dist/astro/native/core-navigation.astro +17 -17
  43. package/dist/astro/native/core-page-list-data-item.astro +7 -6
  44. package/dist/astro/native/core-page-list-item.astro +3 -2
  45. package/dist/astro/native/core-page-list.astro +3 -3
  46. package/dist/astro/native/core-post-date.astro +7 -6
  47. package/dist/astro/native/core-post-excerpt.astro +7 -7
  48. package/dist/astro/native/core-post-featured-image.astro +5 -5
  49. package/dist/astro/native/core-post-template.astro +5 -5
  50. package/dist/astro/native/core-post-terms.astro +13 -12
  51. package/dist/astro/native/core-post-title.astro +2 -2
  52. package/dist/astro/native/core-query-no-results.astro +2 -2
  53. package/dist/astro/native/core-query.astro +6 -6
  54. package/dist/astro/native/core-separator.astro +20 -0
  55. package/dist/astro/native/core-site-title.astro +10 -9
  56. package/dist/astro/native/core-term-description.astro +2 -2
  57. package/dist/astro/native/core-term-name.astro +4 -3
  58. package/dist/astro/native/core-term-template.astro +5 -5
  59. package/dist/astro/native/core-terms-query.astro +5 -5
  60. package/dist/astro/native/core-transparent.astro +2 -2
  61. package/dist/astro/native/registry.d.ts.map +1 -1
  62. package/dist/astro/native/registry.js +2 -0
  63. package/dist/astro/native/registry.js.map +1 -1
  64. package/dist/astro/native/registry.ts +2 -0
  65. package/dist/astro/native/sf-block-binding.astro +3 -3
  66. package/dist/astro/preferences/AccessibilityPanel.astro +17 -17
  67. package/dist/astro/preferences/Toggle.astro +7 -7
  68. package/dist/default-blocks.d.ts +1 -1
  69. package/dist/default-blocks.d.ts.map +1 -1
  70. package/dist/default-blocks.js +2 -1
  71. package/dist/default-blocks.js.map +1 -1
  72. package/dist/index.d.ts +1 -0
  73. package/dist/index.d.ts.map +1 -1
  74. package/dist/index.js +1 -0
  75. package/dist/index.js.map +1 -1
  76. package/dist/styleflow.d.ts.map +1 -1
  77. package/dist/styleflow.js +11 -2
  78. package/dist/styleflow.js.map +1 -1
  79. package/dist/text.d.ts +3 -0
  80. package/dist/text.d.ts.map +1 -0
  81. package/dist/text.js +6 -0
  82. package/dist/text.js.map +1 -0
  83. package/dist/tsconfig.tsbuildinfo +1 -1
  84. package/package.json +3 -2
@@ -1,20 +1,20 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
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
- <S.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
- <S.ol layoutRole="stack" density="regular" class="flowpress-timeline__list">
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
- <S.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 && <S.h3>{item.year}</S.h3>}
13
- {item.image && <S.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 && <S.p>{item.description}</S.p>}
15
- {item.metric && <S.p>{item.metric}</S.p>}
16
- {(item.statisticValue || item.statisticLabel) && <S.p><S.strong>{item.statisticValue}</S.strong> {item.statisticLabel}</S.p>}
17
- </S.li>
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
- </S.ol>
20
- </S.section>
19
+ </StyleflowElement>
20
+ </StyleflowElement>
@@ -1,5 +1,5 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
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
- ? <S.div {...htmlProps} {...styleflowProps}><SyncedPatternContent {...props} selfRenderer={Astro.self}><slot /></SyncedPatternContent></S.div>
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 S from "@styleflow.app/astro/S.astro";
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 ? <S.div {...htmlProps} {...styleflowProps} data-flowpress-button-legacy set:html={block.innerHtml} /> : null
25
+ block.innerHtml ? <StyleflowElement as="div" {...htmlProps} {...styleflowProps} data-flowpress-button-legacy set:html={block.innerHtml} /> : null
26
26
  ) : !button.empty ? (
27
- <S.div {...rootProps}>
27
+ <StyleflowElement as="div" {...rootProps}>
28
28
  {button.tag === "button" ? (
29
- <S.button {...controlProps} type={button.type}><Fragment set:html={button.label} /></S.button>
29
+ <StyleflowElement as="button" {...controlProps} type={button.type}><Fragment set:html={button.label} /></StyleflowElement>
30
30
  ) : button.href ? (
31
- <S.a {...controlProps} href={button.href} target={button.target} rel={button.rel}>
31
+ <StyleflowElement as="a" {...controlProps} href={button.href} target={button.target} rel={button.rel}>
32
32
  <Fragment set:html={button.label} />
33
- </S.a>
33
+ </StyleflowElement>
34
34
  ) : (
35
- <S.span {...controlProps} aria-disabled="true"><Fragment set:html={button.label} /></S.span>
35
+ <StyleflowElement as="span" {...controlProps} aria-disabled="true"><Fragment set:html={button.label} /></StyleflowElement>
36
36
  )}
37
- </S.div>
37
+ </StyleflowElement>
38
38
  ) : null}
39
39
 
40
40
  <style>
@@ -1,5 +1,5 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
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
- <S.div {...rootProps} {...styleflowProps}><slot /></S.div>
14
+ <StyleflowElement as="div" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
@@ -1,5 +1,5 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
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" ? <S.section {...rootProps} {...styleflowProps}><slot /></S.section>
17
- : tag === "article" ? <S.article {...rootProps} {...styleflowProps}><slot /></S.article>
18
- : tag === "header" ? <S.header {...rootProps} {...styleflowProps}><slot /></S.header>
19
- : tag === "footer" ? <S.footer {...rootProps} {...styleflowProps}><slot /></S.footer>
20
- : tag === "main" ? <S.main {...rootProps} {...styleflowProps}><slot /></S.main>
21
- : tag === "aside" ? <S.aside {...rootProps} {...styleflowProps}><slot /></S.aside>
22
- : tag === "nav" ? <S.nav {...rootProps} {...styleflowProps}><slot /></S.nav>
23
- : <S.div {...rootProps} {...styleflowProps}><slot /></S.div>}
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 S from "@styleflow.app/astro/S.astro";
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 = String(block.resolvedData?.label ?? block.attributes.label ?? "Home");
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
- <S.li {...rootProps} {...styleflowProps}><S.a class="wp-block-navigation-item__content" href={href}><S.span class="wp-block-navigation-item__label">{label}</S.span></S.a></S.li>
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 S from "@styleflow.app/astro/S.astro";
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
- <S.figure {...rootProps} {...styleflowProps} data-flowpress-image-lightbox={lightboxHref ? "link" : undefined}>
107
+ <StyleflowElement as="figure" {...rootProps} {...styleflowProps} data-flowpress-image-lightbox={lightboxHref ? "link" : undefined}>
108
108
  {href ? (
109
- <S.a
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
- <S.img {...imageProps} />
116
- </S.a>
117
- ) : <S.img {...imageProps} />}
115
+ <StyleflowElement as="img" {...imageProps} />
116
+ </StyleflowElement>
117
+ ) : <StyleflowElement as="img" {...imageProps} />}
118
118
  {caption ? (
119
- <S.figcaption class="wp-element-caption">
119
+ <StyleflowElement as="figcaption" class="wp-element-caption">
120
120
  <Fragment set:html={caption} />
121
- </S.figcaption>
121
+ </StyleflowElement>
122
122
  ) : null}
123
- </S.figure>
123
+ </StyleflowElement>
124
124
  ) : null}
@@ -1,11 +1,12 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
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 = String(block.attributes.label ?? block.attributes.title ?? href);
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
- <S.li {...rootProps} {...styleflowProps}>
44
- <S.a
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
- <S.span
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
- </S.span>
65
+ </StyleflowElement>
65
66
  ) : (
66
- <S.span class="wp-block-navigation-item__label">{label}</S.span>
67
+ <StyleflowElement as="span" class="wp-block-navigation-item__label">{label}</StyleflowElement>
67
68
  )
68
69
  }
69
- </S.a>
70
- </S.li>
70
+ </StyleflowElement>
71
+ </StyleflowElement>
@@ -1,15 +1,16 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
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 = String(block.attributes.label ?? block.attributes.title ?? "Submenu");
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
- <S.li {...rootProps} {...styleflowProps}>
11
- <S.details data-navigation-disclosure class="site-nav__disclosure">
12
- <S.summary
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
- <S.span class="wp-block-navigation-item__label">{label}</S.span>
21
- <S.span aria-hidden="true" class="site-nav__chevron"></S.span>
22
- </S.summary>
23
- <S.ul
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 /></S.ul>
31
- </S.details>
32
- </S.li>
31
+ ><slot /></StyleflowElement>
32
+ </StyleflowElement>
33
+ </StyleflowElement>
@@ -1,5 +1,5 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
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
- <S.nav {...htmlProps} {...styleflowProps} layoutRole="none" aria-label={label}>
38
- <S.button
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
- <S.span class="sr-only">{openLabel}</S.span>
55
- <S.span aria-hidden="true" class="sf-motion-menu-toggle__icon relative block size-5">
56
- <S.span class="sf-motion-menu-toggle__line"></S.span>
57
- <S.span class="sf-motion-menu-toggle__line"></S.span>
58
- </S.span>
59
- </S.button>
60
- <S.div
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
- ></S.div>
70
- <S.div
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
- <S.span
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
- ></S.span>
86
- <S.ul layoutRole="stack" density="regular" class="site-nav__list"><slot /></S.ul>
87
- </S.div>
88
- </S.nav>
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 S from "@styleflow.app/astro/S.astro";
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
- <S.li {...htmlProps} class={["wp-block-pages-list__item", htmlProps.class].filter(Boolean).join(" ")} {...styleflowProps}>
12
- <S.a href={String(item.url ?? "#")}>{String(item.label ?? "")}</S.a>
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
- <S.ul>
15
+ <StyleflowElement as="ul">
15
16
  {children.map((child) => <Astro.self item={child} />)}
16
- </S.ul>
17
+ </StyleflowElement>
17
18
  )}
18
- </S.li>
19
+ </StyleflowElement>
@@ -1,7 +1,8 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
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
- <S.li {...rootProps} {...styleflowProps}><S.a href={String(block.attributes.url ?? "#")}>{String(block.attributes.label ?? "")}</S.a><slot /></S.li>
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 S from "@styleflow.app/astro/S.astro";
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
- <S.ul {...htmlProps} class={["wp-block-page-list", htmlProps.class].filter(Boolean).join(" ")} {...styleflowProps}>
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
- </S.ul>
38
+ </StyleflowElement>
39
39
  )}
40
40
  <slot />
@@ -1,20 +1,21 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
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 = text(block.resolvedData?.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
- <S.div {...rootProps} {...styleflowProps}>
16
+ <StyleflowElement as="div" {...rootProps} {...styleflowProps}>
16
17
  {block.attributes.isLink && url
17
- ? <S.a href={url}><S.time datetime={datetime}>{formatted}</S.time></S.a>
18
- : <S.time datetime={datetime}>{formatted}</S.time>}
19
- </S.div>
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 S from "@styleflow.app/astro/S.astro";
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
- <S.div {...rootProps} {...styleflowProps}>
17
- <S.p class="wp-block-post-excerpt__excerpt">
16
+ <StyleflowElement as="div" {...rootProps} {...styleflowProps}>
17
+ <StyleflowElement as="p" class="wp-block-post-excerpt__excerpt">
18
18
  {excerpt}
19
- {moreText && url && !attributes.showMoreOnNewLine ? <> <S.a class="wp-block-post-excerpt__more-link" href={url}>{moreText}</S.a></> : null}
20
- </S.p>
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
- <S.p class="wp-block-post-excerpt__more-text"><S.a class="wp-block-post-excerpt__more-link" href={url}>{moreText}</S.a></S.p>
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
- </S.div>
24
+ </StyleflowElement>
25
25
  ) : null}
@@ -1,5 +1,5 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
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
- <S.figure {...rootProps} {...styleflowProps}>
32
+ <StyleflowElement as="figure" {...rootProps} {...styleflowProps}>
33
33
  {href
34
- ? <S.a href={href} target={attributes.linkTarget === "_blank" ? "_blank" : undefined} rel={externalRel(attributes.linkTarget, attributes.rel)}><S.img {...imageProps} /></S.a>
35
- : <S.img {...imageProps} />}
36
- </S.figure>
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 S from "@styleflow.app/astro/S.astro";
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
- <S.ul {...rootProps} {...styleflowProps}>
23
+ <StyleflowElement as="ul" {...rootProps} {...styleflowProps}>
24
24
  {items.map((item, index) => (
25
- <S.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(" ") : "")}>
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
- </S.li>
27
+ </StyleflowElement>
28
28
  ))}
29
- </S.ul>
29
+ </StyleflowElement>
30
30
  ) : null}
@@ -1,5 +1,6 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
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 = text(attributes.prefix);
18
- const suffix = text(attributes.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
- <S.div {...rootProps} {...styleflowProps}>
27
- {prefix ? <S.span class="wp-block-post-terms__prefix">{prefix}</S.span> : null}
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" ? <S.span class="wp-block-post-terms__name">{term.name}</S.span> : null}
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 ? <S.span class="wp-block-post-terms__separator">{separator}</S.span> : null}
40
- {term.url ? <S.a href={term.url} rel="tag">{label}</S.a> : <S.span>{label}</S.span>}
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 ? <S.span class="wp-block-post-terms__suffix">{suffix}</S.span> : null}
45
- </S.div>
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 S from "@styleflow.app/astro/S.astro";
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
- ? <S.a href={url} target={attributes.linkTarget === "_blank" ? "_blank" : undefined} rel={externalRel(attributes.linkTarget, attributes.rel)}><Fragment set:html={title} /></S.a>
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 S from "@styleflow.app/astro/S.astro";
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 ? <S.div {...rootProps} {...styleflowProps}><slot /></S.div> : null}
12
+ {visible ? <StyleflowElement as="div" {...rootProps} {...styleflowProps}><slot /></StyleflowElement> : null}