@styleflow.app/flowpress-astro-core 1.0.0-beta.25 → 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.
Files changed (67) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/astro/BaseLayout.astro +3 -3
  3. package/dist/astro/DefaultTemplate.astro +6 -6
  4. package/dist/astro/GutenbergRenderer.astro +33 -33
  5. package/dist/astro/StyleflowElement.astro +19 -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 +8 -8
  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 +21 -21
  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 +4 -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 +2 -2
  39. package/dist/astro/native/core-image.astro +9 -9
  40. package/dist/astro/native/core-navigation-link.astro +8 -8
  41. package/dist/astro/native/core-navigation-submenu.astro +11 -11
  42. package/dist/astro/native/core-navigation.astro +17 -17
  43. package/dist/astro/native/core-page-list-data-item.astro +6 -6
  44. package/dist/astro/native/core-page-list-item.astro +2 -2
  45. package/dist/astro/native/core-page-list.astro +3 -3
  46. package/dist/astro/native/core-post-date.astro +5 -5
  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 +8 -8
  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-site-title.astro +8 -8
  55. package/dist/astro/native/core-term-description.astro +2 -2
  56. package/dist/astro/native/core-term-name.astro +2 -2
  57. package/dist/astro/native/core-term-template.astro +5 -5
  58. package/dist/astro/native/core-terms-query.astro +5 -5
  59. package/dist/astro/native/core-transparent.astro +2 -2
  60. package/dist/astro/native/sf-block-binding.astro +3 -3
  61. package/dist/astro/preferences/AccessibilityPanel.astro +17 -17
  62. package/dist/astro/preferences/Toggle.astro +7 -7
  63. package/dist/astro/preferences/preferences.css +3 -1
  64. package/dist/styleflow.d.ts.map +1 -1
  65. package/dist/styleflow.js +11 -2
  66. package/dist/styleflow.js.map +1 -1
  67. package/package.json +2 -2
@@ -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;
@@ -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
- <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>
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 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,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 } =
@@ -40,8 +40,8 @@ try {
40
40
  }
41
41
  ---
42
42
 
43
- <S.li {...rootProps} {...styleflowProps}>
44
- <S.a
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
- <S.span
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
- </S.span>
64
+ </StyleflowElement>
65
65
  ) : (
66
- <S.span class="wp-block-navigation-item__label">{label}</S.span>
66
+ <StyleflowElement as="span" class="wp-block-navigation-item__label">{label}</StyleflowElement>
67
67
  )
68
68
  }
69
- </S.a>
70
- </S.li>
69
+ </StyleflowElement>
70
+ </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;
@@ -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
- <S.li {...rootProps} {...styleflowProps}>
11
- <S.details data-navigation-disclosure class="site-nav__disclosure">
12
- <S.summary
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
- <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
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 /></S.ul>
31
- </S.details>
32
- </S.li>
30
+ ><slot /></StyleflowElement>
31
+ </StyleflowElement>
32
+ </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,5 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
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
- <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>
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
- <S.ul>
14
+ <StyleflowElement as="ul">
15
15
  {children.map((child) => <Astro.self item={child} />)}
16
- </S.ul>
16
+ </StyleflowElement>
17
17
  )}
18
- </S.li>
18
+ </StyleflowElement>
@@ -1,7 +1,7 @@
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
  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
- <S.li {...rootProps} {...styleflowProps}><S.a href={String(block.attributes.url ?? "#")}>{String(block.attributes.label ?? "")}</S.a><slot /></S.li>
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 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,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
 
@@ -12,9 +12,9 @@ const rootProps = { ...htmlProps, class: classNames("wp-block-post-date", htmlPr
12
12
  ---
13
13
 
14
14
  {formatted ? (
15
- <S.div {...rootProps} {...styleflowProps}>
15
+ <StyleflowElement as="div" {...rootProps} {...styleflowProps}>
16
16
  {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>
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 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,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 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
- <S.div {...rootProps} {...styleflowProps}>
27
- {prefix ? <S.span class="wp-block-post-terms__prefix">{prefix}</S.span> : null}
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" ? <S.span class="wp-block-post-terms__name">{term.name}</S.span> : null}
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 ? <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>}
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 ? <S.span class="wp-block-post-terms__suffix">{suffix}</S.span> : null}
45
- </S.div>
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 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}
@@ -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 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" ? <S.section {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></S.section>
19
- : tag === "main" ? <S.main {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></S.main>
20
- : tag === "aside" ? <S.aside {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></S.aside>
21
- : tag === "article" ? <S.article {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></S.article>
22
- : <S.div {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></S.div>}
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 S from "@styleflow.app/astro/S.astro";
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 ? <S.h1 {...htmlProps} {...styleflowProps}><S.a href={url}>{title}</S.a></S.h1>
10
- : level === 2 ? <S.h2 {...htmlProps} {...styleflowProps}><S.a href={url}>{title}</S.a></S.h2>
11
- : level === 3 ? <S.h3 {...htmlProps} {...styleflowProps}><S.a href={url}>{title}</S.a></S.h3>
12
- : level === 4 ? <S.h4 {...htmlProps} {...styleflowProps}><S.a href={url}>{title}</S.a></S.h4>
13
- : level === 5 ? <S.h5 {...htmlProps} {...styleflowProps}><S.a href={url}>{title}</S.a></S.h5>
14
- : level === 6 ? <S.h6 {...htmlProps} {...styleflowProps}><S.a href={url}>{title}</S.a></S.h6>
15
- : <S.p {...htmlProps} {...styleflowProps}><S.a href={url}>{title}</S.a></S.p>}
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 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
 
@@ -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 ? <S.div {...rootProps} {...styleflowProps}><Fragment set:html={description} /></S.div> : null}
12
+ {description ? <StyleflowElement as="div" {...rootProps} {...styleflowProps}><Fragment set:html={description} /></StyleflowElement> : 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, 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 ? <S.a href={url}>{name}</S.a> : name}
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 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-term", `term-${item.id}`, item.taxonomy ? `taxonomy-${item.taxonomy}` : "", grid ? [...spanClasses((childAttributes[index] ?? {})), ...usedSpanClasses(block.attributes, (childAttributes[index] ?? {})), ...(bleed[index] ?? [])].join(" ") : "")}>
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
- </S.li>
27
+ </StyleflowElement>
28
28
  ))}
29
- </S.ul>
29
+ </StyleflowElement>
30
30
  ) : 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 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" ? <S.section {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></S.section>
17
- : tag === "aside" ? <S.aside {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></S.aside>
18
- : tag === "nav" ? <S.nav {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></S.nav>
19
- : <S.div {...rootProps} {...styleflowProps}><ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} /></S.div>}
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 S from "@styleflow.app/astro/S.astro";
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
- ? <S.div {...htmlProps} {...styleflowProps}><slot /></S.div>
10
+ ? <StyleflowElement as="div" {...htmlProps} {...styleflowProps}><slot /></StyleflowElement>
11
11
  : <slot />}
@@ -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 { 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
- <S.div {...htmlProps} {...styleflowProps} class:list={["wp-block-project-block-binding", htmlProps.class]}>
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
- </S.div>
20
+ </StyleflowElement>