@styleflow.app/flowpress-astro-core 1.0.0-beta.28 → 1.0.0-beta.29

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 CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0-beta.29 — 2026-10-08
4
+
5
+ - Extend the escaped plain-text entity decoding to buttons, cards, spinner segments, excerpts, timeline, list fallbacks, forms and accessibility labels. Keep RichText fragments unchanged.
6
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-tipografia-tag-mapping.md).
7
+
3
8
  ## 1.0.0-beta.28 — 2026-10-08
4
9
 
5
10
  - Decode WordPress entities once for escaped plain text across site titles, navigation, terms, custom fields and metadata.
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import { decodeFlowpressText } from "../text.js";
2
3
  import "./native/grid.css";
3
4
  import StyleflowElement from "./StyleflowElement.astro";
4
5
  import type {
@@ -326,7 +327,7 @@ function nestedRendererProps(nextParentBlockName: string) {
326
327
  const buttonContent = (
327
328
  <>
328
329
  {iconPosition === "before" ? buttonIcon : null}
329
- {textValue(block, "label")}
330
+ {decodeFlowpressText(textValue(block, "label"))}
330
331
  {iconPosition === "after" ? buttonIcon : null}
331
332
  </>
332
333
  );
@@ -369,7 +370,7 @@ function nestedRendererProps(nextParentBlockName: string) {
369
370
  name={icon}
370
371
  display={display}
371
372
  size={size}
372
- label={String(block.attributes.label ?? "").trim() || undefined}
373
+ label={decodeFlowpressText(block.attributes.label).trim() || undefined}
373
374
  {...iconSemantic}
374
375
  {...htmlAttributes}
375
376
  />
@@ -399,7 +400,7 @@ function nestedRendererProps(nextParentBlockName: string) {
399
400
  {images.map((image) => image.url ? (
400
401
  <img
401
402
  src={String(image.url)}
402
- alt={String(image.alt ?? "")}
403
+ alt={decodeFlowpressText(image.alt)}
403
404
  loading="lazy"
404
405
  decoding="async"
405
406
  />
@@ -431,7 +432,7 @@ function nestedRendererProps(nextParentBlockName: string) {
431
432
  <StyleflowElement as="div" {...semantic} {...htmlAttributes}>
432
433
  <iframe
433
434
  src={embed}
434
- title={String(block.attributes.title ?? "YouTube video")}
435
+ title={decodeFlowpressText(block.attributes.title ?? "YouTube video")}
435
436
  loading="lazy"
436
437
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
437
438
  allowfullscreen
@@ -443,7 +444,7 @@ function nestedRendererProps(nextParentBlockName: string) {
443
444
  if (name === "chip") {
444
445
  return (
445
446
  <StyleflowElement as="span" {...semantic} {...htmlAttributes}>
446
- {textValue(block, "label")}
447
+ {decodeFlowpressText(textValue(block, "label"))}
447
448
  </StyleflowElement>
448
449
  );
449
450
  }
@@ -454,10 +455,10 @@ function nestedRendererProps(nextParentBlockName: string) {
454
455
  return (
455
456
  <StyleflowElement as="article" {...semantic} {...htmlAttributes}>
456
457
  {media.url && (
457
- <img src={String(media.url)} alt={String(media.alt ?? "")} loading="lazy" />
458
+ <img src={String(media.url)} alt={decodeFlowpressText(media.alt)} loading="lazy" />
458
459
  )}
459
- {block.attributes.title && <StyleflowElement as="h3">{String(block.attributes.title)}</StyleflowElement>}
460
- {block.attributes.text && <StyleflowElement as="p">{String(block.attributes.text)}</StyleflowElement>}
460
+ {block.attributes.title && <StyleflowElement as="h3">{decodeFlowpressText(block.attributes.title)}</StyleflowElement>}
461
+ {block.attributes.text && <StyleflowElement as="p">{decodeFlowpressText(block.attributes.text)}</StyleflowElement>}
461
462
  {href && <StyleflowElement as="a" href={href}>Scopri</StyleflowElement>}
462
463
  </StyleflowElement>
463
464
  );
@@ -521,7 +522,7 @@ function nestedRendererProps(nextParentBlockName: string) {
521
522
  return (
522
523
  <StyleflowElement as="div" {...semantic} {...htmlAttributes}>
523
524
  <details>
524
- <summary>{String(block.attributes.title ?? "")}</summary>
525
+ <summary>{decodeFlowpressText(block.attributes.title)}</summary>
525
526
  <Astro.self descriptorIndex={descriptors}
526
527
  blocks={children}
527
528
  contract={contract}
@@ -567,7 +568,7 @@ function nestedRendererProps(nextParentBlockName: string) {
567
568
  href={`https://www.openstreetmap.org/search?query=${encodeURIComponent(query)}`}
568
569
  rel="noreferrer"
569
570
  >
570
- {address || query}
571
+ {decodeFlowpressText(address || query)}
571
572
  </StyleflowElement>
572
573
  </StyleflowElement>
573
574
  ) : null;
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import { decodeFlowpressText } from "../../text.js";
2
3
  import type { HTMLAttributes } from "astro/types";
3
4
  type HTMLInputTypeAttribute = HTMLAttributes<"input">["type"];
4
5
  import StyleflowElement from "../StyleflowElement.astro";
@@ -37,7 +38,7 @@ const labelFor = (field: FormField): string => field.name
37
38
  .replace(/[-_]+/g, " ")
38
39
  .replace(/\b\w/g, (letter) => letter.toUpperCase());
39
40
  const optionLabel = (field: FormField, index: number): string =>
40
- field.labels?.[index] || field.values?.[index] || "";
41
+ decodeFlowpressText(field.labels?.[index] || field.values?.[index] || "");
41
42
  ---
42
43
 
43
44
  {schema?.available ? (
@@ -45,13 +46,13 @@ const optionLabel = (field: FormField, index: number): string =>
45
46
  <flowpress-cf7-form>
46
47
  <form action={schema.submitUrl} method="post" enctype="multipart/form-data" novalidate>
47
48
  {block.attributes.title || schema.title ? (
48
- <StyleflowElement as="h2">{String(block.attributes.title || schema.title)}</StyleflowElement>
49
+ <StyleflowElement as="h2">{decodeFlowpressText(block.attributes.title || schema.title)}</StyleflowElement>
49
50
  ) : null}
50
51
  {schema.fields.map((field) => {
51
52
  if (field.type === "submit") {
52
53
  return (
53
54
  <button type="submit">
54
- {field.values?.[0] || "Invia"}
55
+ {decodeFlowpressText(field.values?.[0] || "Invia")}
55
56
  </button>
56
57
  );
57
58
  }
@@ -81,7 +82,7 @@ const optionLabel = (field: FormField, index: number): string =>
81
82
  return (
82
83
  <label>
83
84
  <input type="checkbox" name={field.name} value="1" required={field.required} />
84
- {field.values?.[0] || labelFor(field)}
85
+ {decodeFlowpressText(field.values?.[0] || labelFor(field))}
85
86
  <span data-field-error={field.name}></span>
86
87
  </label>
87
88
  );
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import { decodeFlowpressText } from "../../text.js";
2
3
  import StyleflowElement from "../StyleflowElement.astro";
3
4
  import { flowpressLinkHref } from "../../links.js";
4
5
 
@@ -16,15 +17,15 @@ const href = flowpressLinkHref(item.uri);
16
17
  {image.url ? (
17
18
  <img
18
19
  src={String(image.url)}
19
- alt={String(image.alt ?? "")}
20
+ alt={decodeFlowpressText(image.alt)}
20
21
  loading="lazy"
21
22
  decoding="async"
22
23
  />
23
24
  ) : null}
24
25
  {href ? (
25
- <StyleflowElement as="a" href={href}>{String(item.title ?? "")}</StyleflowElement>
26
+ <StyleflowElement as="a" href={href}>{decodeFlowpressText(item.title)}</StyleflowElement>
26
27
  ) : (
27
- <StyleflowElement as="span">{String(item.title ?? "")}</StyleflowElement>
28
+ <StyleflowElement as="span">{decodeFlowpressText(item.title)}</StyleflowElement>
28
29
  )}
29
- {item.excerpt ? <StyleflowElement as="p">{String(item.excerpt)}</StyleflowElement> : null}
30
+ {item.excerpt ? <StyleflowElement as="p">{decodeFlowpressText(item.excerpt)}</StyleflowElement> : null}
30
31
  {item.priceHtml ? <StyleflowElement as="div" set:html={String(item.priceHtml)} /> : null}
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import { decodeFlowpressText } from "../../text.js";
2
3
  import StyleflowElement from "../StyleflowElement.astro";
3
4
  import {
4
5
  clampSpinnerDuration,
@@ -21,8 +22,8 @@ interface Props {
21
22
 
22
23
  const { block, contract } = Astro.props;
23
24
  const attributes = block.attributes;
24
- const prefix = String(attributes.prefix ?? "");
25
- const suffix = String(attributes.suffix ?? "");
25
+ const prefix = decodeFlowpressText(attributes.prefix);
26
+ const suffix = decodeFlowpressText(attributes.suffix);
26
27
  const candidateNumber = Number(attributes.number);
27
28
  const number = Number.isFinite(candidateNumber) ? candidateNumber : 0;
28
29
  const duration = clampSpinnerDuration(attributes.duration);
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import { decodeFlowpressText } from "../../text.js";
2
3
  import StyleflowElement from "../StyleflowElement.astro";
3
4
  import type { TimelineItem } from "./timeline.js";
4
5
  import "./timeline.css";
@@ -9,11 +10,11 @@ const {items,tone="inherit",intensity="inherit",id,class:className="",ariaLabel=
9
10
  <StyleflowElement as="ol" layoutRole="stack" density="regular" class="flowpress-timeline__list">
10
11
  {items.map(item=>(
11
12
  <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.year && <StyleflowElement as="h3">{decodeFlowpressText(item.year)}</StyleflowElement>}
13
14
  {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>}
15
+ {item.description && <StyleflowElement as="p">{decodeFlowpressText(item.description)}</StyleflowElement>}
16
+ {item.metric && <StyleflowElement as="p">{decodeFlowpressText(item.metric)}</StyleflowElement>}
17
+ {(item.statisticValue || item.statisticLabel) && <StyleflowElement as="p"><StyleflowElement as="strong">{decodeFlowpressText(item.statisticValue)}</StyleflowElement> {decodeFlowpressText(item.statisticLabel)}</StyleflowElement>}
17
18
  </StyleflowElement>
18
19
  ))}
19
20
  </StyleflowElement>
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import { decodeFlowpressText } from "../../text.js";
2
3
  import StyleflowElement from "../StyleflowElement.astro";
3
4
  import type { FlowpressBlockRendererProps } from "../../index.js";
4
5
  import { classNames, text } from "./query-loop.js";
@@ -6,9 +7,9 @@ import { classNames, text } from "./query-loop.js";
6
7
  // Excerpt of the current loop item, trimmed to `excerptLength` words.
7
8
  const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
8
9
  const attributes = block.attributes;
9
- const excerpt = text(block.resolvedData?.excerpt);
10
+ const excerpt = decodeFlowpressText(block.resolvedData?.excerpt);
10
11
  const url = text(block.resolvedData?.url);
11
- const moreText = text(attributes.moreText).trim();
12
+ const moreText = decodeFlowpressText(attributes.moreText).trim();
12
13
  const rootProps = { ...htmlProps, class: classNames("wp-block-post-excerpt", htmlProps.class) };
13
14
  ---
14
15
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import { decodeFlowpressText } from "../../text.js";
2
3
  import StyleflowElement from "../StyleflowElement.astro";
3
4
  import MotionToggle from "./MotionToggle.astro";
4
5
  import ThemeToggle from "./ThemeToggle.astro";
@@ -93,19 +94,19 @@ const id = `sf-a11y-${crypto.randomUUID()}`;
93
94
  density="regular"
94
95
  class="sf-a11y__panel"
95
96
  >
96
- <StyleflowElement as="h2" id={`${id}-title`} {...titleTypography}>{title}</StyleflowElement>
97
+ <StyleflowElement as="h2" id={`${id}-title`} {...titleTypography}>{decodeFlowpressText(title)}</StyleflowElement>
97
98
  {showTheme ? (
98
99
  <StyleflowElement as="div" layoutRole="none" class="sf-a11y__row">
99
- <StyleflowElement as="span" id={`${id}-theme-label`} {...labelTypography}>{themeLabel}</StyleflowElement>
100
+ <StyleflowElement as="span" id={`${id}-theme-label`} {...labelTypography}>{decodeFlowpressText(themeLabel)}</StyleflowElement>
100
101
  <ThemeToggle labelledby={`${id}-theme-label`} />
101
102
  </StyleflowElement>
102
103
  ) : null}
103
104
  <StyleflowElement as="div" layoutRole="none" class="sf-a11y__row">
104
- <StyleflowElement as="span" id={`${id}-motion-label`} {...labelTypography}>{motionLabel}</StyleflowElement>
105
+ <StyleflowElement as="span" id={`${id}-motion-label`} {...labelTypography}>{decodeFlowpressText(motionLabel)}</StyleflowElement>
105
106
  <MotionToggle labelledby={`${id}-motion-label`} />
106
107
  </StyleflowElement>
107
108
  <StyleflowElement as="div" layoutRole="none" class="sf-a11y__row">
108
- <StyleflowElement as="span" id={`${id}-color-mode-vivid-label`} {...labelTypography}>{vividColorLabel}</StyleflowElement>
109
+ <StyleflowElement as="span" id={`${id}-color-mode-vivid-label`} {...labelTypography}>{decodeFlowpressText(vividColorLabel)}</StyleflowElement>
109
110
  <ColorModeToggle labelledby={`${id}-color-mode-vivid-label`} />
110
111
  </StyleflowElement>
111
112
  </StyleflowElement>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@styleflow.app/flowpress-astro-core",
3
- "version": "1.0.0-beta.28",
3
+ "version": "1.0.0-beta.29",
4
4
  "description": "Project-agnostic WordPress routing, templates, SEO and GraphQL runtime for FlowPress Astro apps.",
5
5
  "type": "module",
6
6
  "private": false,