@styleflow.app/flowpress-astro-core 1.0.0-beta.3 → 1.0.0-beta.30

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 (243) hide show
  1. package/CHANGELOG.md +190 -1
  2. package/README.md +111 -3
  3. package/dist/accessibility-panel.d.ts +2 -0
  4. package/dist/accessibility-panel.d.ts.map +1 -0
  5. package/dist/accessibility-panel.js +81 -0
  6. package/dist/accessibility-panel.js.map +1 -0
  7. package/dist/astro/BaseLayout.astro +34 -17
  8. package/dist/astro/CompositionRenderer.astro +157 -0
  9. package/dist/astro/DefaultBlockAdapter.astro +35 -0
  10. package/dist/astro/DefaultTemplate.astro +12 -7
  11. package/dist/astro/GutenbergRenderer.astro +240 -80
  12. package/dist/astro/StyleflowElement.astro +23 -0
  13. package/dist/astro/ThemeRuntime.astro +26 -0
  14. package/dist/astro/blocks/CarouselBlock.astro +8 -10
  15. package/dist/astro/blocks/CarouselItemBlock.astro +4 -4
  16. package/dist/astro/blocks/ColumnBlock.astro +4 -5
  17. package/dist/astro/blocks/CoverBlock.astro +155 -0
  18. package/dist/astro/blocks/FormBlock.astro +23 -20
  19. package/dist/astro/blocks/GridBlock.astro +4 -4
  20. package/dist/astro/blocks/HeroBlock.astro +4 -5
  21. package/dist/astro/blocks/ImageBlock.astro +4 -5
  22. package/dist/astro/blocks/ListItemFallback.astro +10 -7
  23. package/dist/astro/blocks/NumberSpinnerBlock.astro +29 -22
  24. package/dist/astro/blocks/SemanticElement.astro +35 -0
  25. package/dist/astro/blocks/SiteLogoBlock.astro +53 -0
  26. package/dist/astro/blocks/TextBlock.astro +33 -28
  27. package/dist/astro/blocks/ThemeToggleBlock.astro +13 -0
  28. package/dist/astro/blocks/cover.d.ts +13 -0
  29. package/dist/astro/blocks/cover.d.ts.map +1 -0
  30. package/dist/astro/blocks/cover.js +105 -0
  31. package/dist/astro/blocks/cover.js.map +1 -0
  32. package/dist/astro/blocks/cover.ts +119 -0
  33. package/dist/astro/blocks/helpers.d.ts +7 -0
  34. package/dist/astro/blocks/helpers.d.ts.map +1 -1
  35. package/dist/astro/blocks/helpers.js +52 -41
  36. package/dist/astro/blocks/helpers.js.map +1 -1
  37. package/dist/astro/blocks/helpers.ts +64 -45
  38. package/dist/astro/native/Blob.astro +113 -0
  39. package/dist/astro/native/BlobBlock.astro +52 -0
  40. package/dist/astro/native/CustomFieldValue.astro +87 -0
  41. package/dist/astro/native/LevelTag.astro +20 -0
  42. package/dist/astro/native/MapBlock.astro +41 -0
  43. package/dist/astro/native/NativeHtmlBlock.astro +12 -0
  44. package/dist/astro/native/NativeIconBlock.astro +42 -0
  45. package/dist/astro/native/ProjectTimelineBlock.astro +34 -0
  46. package/dist/astro/native/ResolvedBlocks.astro +89 -0
  47. package/dist/astro/native/SyncedPatternContent.astro +92 -0
  48. package/dist/astro/native/TermFieldValue.astro +38 -0
  49. package/dist/astro/native/Timeline.astro +21 -0
  50. package/dist/astro/native/TimelineCardBlock.astro +7 -0
  51. package/dist/astro/native/blob/blob-shapes.generated.d.ts +2 -0
  52. package/dist/astro/native/blob/blob-shapes.generated.d.ts.map +1 -0
  53. package/dist/astro/native/blob/blob-shapes.generated.js +2 -0
  54. package/dist/astro/native/blob/blob-shapes.generated.js.map +1 -0
  55. package/dist/astro/native/blob/blob-shapes.generated.ts +1 -0
  56. package/dist/astro/native/blob/config.d.ts +49 -0
  57. package/dist/astro/native/blob/config.d.ts.map +1 -0
  58. package/dist/astro/native/blob/config.js +86 -0
  59. package/dist/astro/native/blob/config.js.map +1 -0
  60. package/dist/astro/native/blob/config.ts +132 -0
  61. package/dist/astro/native/blob/controller.d.ts +11 -0
  62. package/dist/astro/native/blob/controller.d.ts.map +1 -0
  63. package/dist/astro/native/blob/controller.js +240 -0
  64. package/dist/astro/native/blob/controller.js.map +1 -0
  65. package/dist/astro/native/blob/controller.ts +248 -0
  66. package/dist/astro/native/blob/geometry.d.ts +2 -0
  67. package/dist/astro/native/blob/geometry.d.ts.map +1 -0
  68. package/dist/astro/native/blob/geometry.js +2 -0
  69. package/dist/astro/native/blob/geometry.js.map +1 -0
  70. package/dist/astro/native/blob/geometry.ts +1 -0
  71. package/dist/astro/native/blob/ids.d.ts +7 -0
  72. package/dist/astro/native/blob/ids.d.ts.map +1 -0
  73. package/dist/astro/native/blob/ids.js +11 -0
  74. package/dist/astro/native/blob/ids.js.map +1 -0
  75. package/dist/astro/native/blob/ids.ts +11 -0
  76. package/dist/astro/native/blob.css +83 -0
  77. package/dist/astro/native/button.d.ts +13 -0
  78. package/dist/astro/native/button.d.ts.map +1 -0
  79. package/dist/astro/native/button.js +26 -0
  80. package/dist/astro/native/button.js.map +1 -0
  81. package/dist/astro/native/button.ts +26 -0
  82. package/dist/astro/native/core-block.astro +18 -0
  83. package/dist/astro/native/core-button.astro +43 -0
  84. package/dist/astro/native/core-buttons.astro +14 -0
  85. package/dist/astro/native/core-group.astro +23 -0
  86. package/dist/astro/native/core-home-link.astro +12 -0
  87. package/dist/astro/native/core-html.astro +8 -0
  88. package/dist/astro/native/core-icon.astro +7 -0
  89. package/dist/astro/native/core-image.astro +124 -0
  90. package/dist/astro/native/core-navigation-link.astro +71 -0
  91. package/dist/astro/native/core-navigation-submenu.astro +33 -0
  92. package/dist/astro/native/core-navigation.astro +94 -0
  93. package/dist/astro/native/core-page-list-data-item.astro +19 -0
  94. package/dist/astro/native/core-page-list-item.astro +8 -0
  95. package/dist/astro/native/core-page-list.astro +40 -0
  96. package/dist/astro/native/core-post-date.astro +21 -0
  97. package/dist/astro/native/core-post-excerpt.astro +26 -0
  98. package/dist/astro/native/core-post-featured-image.astro +37 -0
  99. package/dist/astro/native/core-post-template.astro +30 -0
  100. package/dist/astro/native/core-post-terms.astro +47 -0
  101. package/dist/astro/native/core-post-title.astro +23 -0
  102. package/dist/astro/native/core-query-no-results.astro +12 -0
  103. package/dist/astro/native/core-query.astro +22 -0
  104. package/dist/astro/native/core-separator.astro +20 -0
  105. package/dist/astro/native/core-site-title.astro +16 -0
  106. package/dist/astro/native/core-term-description.astro +12 -0
  107. package/dist/astro/native/core-term-name.astro +21 -0
  108. package/dist/astro/native/core-term-template.astro +30 -0
  109. package/dist/astro/native/core-terms-query.astro +19 -0
  110. package/dist/astro/native/core-transparent.astro +11 -0
  111. package/dist/astro/native/flowpress-navigation-controller.d.ts +2 -0
  112. package/dist/astro/native/flowpress-navigation-controller.d.ts.map +1 -0
  113. package/dist/astro/native/flowpress-navigation-controller.js +217 -0
  114. package/dist/astro/native/flowpress-navigation-controller.js.map +1 -0
  115. package/dist/astro/native/flowpress-navigation-controller.ts +215 -0
  116. package/dist/astro/native/flowpress-navigation.css +17 -0
  117. package/dist/astro/native/grid-bleed.js +106 -0
  118. package/dist/astro/native/grid.css +180 -0
  119. package/dist/astro/native/grid.d.ts +17 -0
  120. package/dist/astro/native/grid.d.ts.map +1 -0
  121. package/dist/astro/native/grid.js +103 -0
  122. package/dist/astro/native/grid.js.map +1 -0
  123. package/dist/astro/native/grid.ts +118 -0
  124. package/dist/astro/native/html.d.ts +6 -0
  125. package/dist/astro/native/html.d.ts.map +1 -0
  126. package/dist/astro/native/html.js +10 -0
  127. package/dist/astro/native/html.js.map +1 -0
  128. package/dist/astro/native/html.ts +9 -0
  129. package/dist/astro/native/icon.d.ts +3 -0
  130. package/dist/astro/native/icon.d.ts.map +1 -0
  131. package/dist/astro/native/icon.js +23 -0
  132. package/dist/astro/native/icon.js.map +1 -0
  133. package/dist/astro/native/icon.ts +21 -0
  134. package/dist/astro/native/map.d.ts +14 -0
  135. package/dist/astro/native/map.d.ts.map +1 -0
  136. package/dist/astro/native/map.js +60 -0
  137. package/dist/astro/native/map.js.map +1 -0
  138. package/dist/astro/native/map.ts +70 -0
  139. package/dist/astro/native/motion-preference.d.ts +50 -0
  140. package/dist/astro/native/motion-preference.d.ts.map +1 -0
  141. package/dist/astro/native/motion-preference.js +132 -0
  142. package/dist/astro/native/motion-preference.js.map +1 -0
  143. package/dist/astro/native/motion-preference.ts +158 -0
  144. package/dist/astro/native/motion.d.ts +101 -0
  145. package/dist/astro/native/motion.d.ts.map +1 -0
  146. package/dist/astro/native/motion.js +168 -0
  147. package/dist/astro/native/motion.js.map +1 -0
  148. package/dist/astro/native/motion.ts +312 -0
  149. package/dist/astro/native/query-loop.d.ts +38 -0
  150. package/dist/astro/native/query-loop.d.ts.map +1 -0
  151. package/dist/astro/native/query-loop.js +20 -0
  152. package/dist/astro/native/query-loop.js.map +1 -0
  153. package/dist/astro/native/query-loop.ts +67 -0
  154. package/dist/astro/native/registry.d.ts +3 -0
  155. package/dist/astro/native/registry.d.ts.map +1 -0
  156. package/dist/astro/native/registry.js +81 -0
  157. package/dist/astro/native/registry.js.map +1 -0
  158. package/dist/astro/native/registry.ts +81 -0
  159. package/dist/astro/native/sf-block-binding.astro +20 -0
  160. package/dist/astro/native/sf-post-field.astro +9 -0
  161. package/dist/astro/native/sf-term-field.astro +9 -0
  162. package/dist/astro/native/timeline.css +4 -0
  163. package/dist/astro/native/timeline.d.ts +28 -0
  164. package/dist/astro/native/timeline.d.ts.map +1 -0
  165. package/dist/astro/native/timeline.js +43 -0
  166. package/dist/astro/native/timeline.js.map +1 -0
  167. package/dist/astro/native/timeline.ts +79 -0
  168. package/dist/astro/preferences/AccessibilityPanel.astro +118 -0
  169. package/dist/astro/preferences/ColorModeToggle.astro +26 -0
  170. package/dist/astro/preferences/MotionToggle.astro +27 -0
  171. package/dist/astro/preferences/PreferencesRuntime.astro +9 -0
  172. package/dist/astro/preferences/ThemeToggle.astro +30 -0
  173. package/dist/astro/preferences/Toggle.astro +50 -0
  174. package/dist/astro/preferences/preferences.css +125 -0
  175. package/dist/block-renderers.d.ts +20 -3
  176. package/dist/block-renderers.d.ts.map +1 -1
  177. package/dist/block-renderers.js.map +1 -1
  178. package/dist/client.d.ts +17 -1
  179. package/dist/client.d.ts.map +1 -1
  180. package/dist/client.js +63 -9
  181. package/dist/client.js.map +1 -1
  182. package/dist/composition.d.ts +14 -0
  183. package/dist/composition.d.ts.map +1 -0
  184. package/dist/composition.js +124 -0
  185. package/dist/composition.js.map +1 -0
  186. package/dist/default-blocks.d.ts +9 -0
  187. package/dist/default-blocks.d.ts.map +1 -0
  188. package/dist/default-blocks.js +118 -0
  189. package/dist/default-blocks.js.map +1 -0
  190. package/dist/env.d.ts +9 -0
  191. package/dist/env.d.ts.map +1 -1
  192. package/dist/env.js +20 -0
  193. package/dist/env.js.map +1 -1
  194. package/dist/index.d.ts +8 -0
  195. package/dist/index.d.ts.map +1 -1
  196. package/dist/index.js +7 -0
  197. package/dist/index.js.map +1 -1
  198. package/dist/links.d.ts +5 -0
  199. package/dist/links.d.ts.map +1 -0
  200. package/dist/links.js +32 -0
  201. package/dist/links.js.map +1 -0
  202. package/dist/media.d.ts +28 -0
  203. package/dist/media.d.ts.map +1 -0
  204. package/dist/media.js +212 -0
  205. package/dist/media.js.map +1 -0
  206. package/dist/motion-preference.d.ts +50 -0
  207. package/dist/motion-preference.d.ts.map +1 -0
  208. package/dist/motion-preference.js +132 -0
  209. package/dist/motion-preference.js.map +1 -0
  210. package/dist/preferences-runtime.d.ts +3 -0
  211. package/dist/preferences-runtime.d.ts.map +1 -0
  212. package/dist/preferences-runtime.js +23 -0
  213. package/dist/preferences-runtime.js.map +1 -0
  214. package/dist/preferences-styleflow.d.ts +3 -0
  215. package/dist/preferences-styleflow.d.ts.map +1 -0
  216. package/dist/preferences-styleflow.js +14 -0
  217. package/dist/preferences-styleflow.js.map +1 -0
  218. package/dist/preferences.d.ts +4 -0
  219. package/dist/preferences.d.ts.map +1 -0
  220. package/dist/preferences.js +4 -0
  221. package/dist/preferences.js.map +1 -0
  222. package/dist/styleflow.d.ts +16 -1
  223. package/dist/styleflow.d.ts.map +1 -1
  224. package/dist/styleflow.js +76 -7
  225. package/dist/styleflow.js.map +1 -1
  226. package/dist/templates.d.ts +16 -16
  227. package/dist/text.d.ts +3 -0
  228. package/dist/text.d.ts.map +1 -0
  229. package/dist/text.js +6 -0
  230. package/dist/text.js.map +1 -0
  231. package/dist/theme-runtime.d.ts +16 -0
  232. package/dist/theme-runtime.d.ts.map +1 -0
  233. package/dist/theme-runtime.js +100 -0
  234. package/dist/theme-runtime.js.map +1 -0
  235. package/dist/tsconfig.tsbuildinfo +1 -1
  236. package/dist/types.d.ts +84 -1
  237. package/dist/types.d.ts.map +1 -1
  238. package/dist/types.js.map +1 -1
  239. package/dist/vivid-colors-preference.d.ts +31 -0
  240. package/dist/vivid-colors-preference.d.ts.map +1 -0
  241. package/dist/vivid-colors-preference.js +102 -0
  242. package/dist/vivid-colors-preference.js.map +1 -0
  243. package/package.json +26 -4
package/CHANGELOG.md CHANGED
@@ -1,7 +1,197 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0-beta.30 — 2026-10-09
4
+
5
+ - Ship native `core/icon` structural CSS with the Astro renderer: apply validated WordPress widths, proportional SVG dimensions and alignment, and paint icons from the StyleFlow foreground through `currentColor`.
6
+ - Verify native/project icons in traditional Gutenberg and Site Editor compositions, including inherited colors, accessible labels, invalid width fallback and scoped SVG IDs.
7
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-09-core-icon-frontend.md).
8
+
9
+ ## 1.0.0-beta.29 — 2026-10-08
10
+
11
+ - Extend the escaped plain-text entity decoding to buttons, cards, spinner segments, excerpts, timeline, list fallbacks, forms and accessibility labels. Keep RichText fragments unchanged.
12
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-tipografia-tag-mapping.md).
13
+
14
+ ## 1.0.0-beta.28 — 2026-10-08
15
+
16
+ - Decode WordPress entities once for escaped plain text across site titles, navigation, terms, custom fields and metadata.
17
+ - Add the official core/separator adapter with Styleflow props and a line painted from foreground via currentColor; preserve wide and dots variants.
18
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-tipografia-tag-mapping.md).
19
+
20
+ ## 1.0.0-beta.27 — 2026-10-08
21
+
22
+ - Render Gutenberg defaults through HTML tag mapping without text data attributes across official blocks, native adapters and independent Number Spinner segments. Preserve explicit typography overrides.
23
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-tipografia-tag-mapping.md).
24
+
25
+ ## 1.0.0-beta.26 — 2026-10-08
26
+
27
+ - Keep inherited panel visibility out of generic transitions and disable transitions throughout the panel when motion is reduced, so every switch receives keyboard focus reliably.
28
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-pannello-accessibilita-default.md).
29
+
30
+ ## 1.0.0-beta.25 — 2026-10-08
31
+
32
+ - Focus the first accessibility switch after the panel becomes visible; cancel pending focus on close and cleanup.
33
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-pannello-accessibilita-default.md).
34
+
35
+ ## 1.0.0-beta.24 — 2026-10-08
36
+
37
+ - Validate the accessibility trigger intensity against the current project contract, including Starter designs with only main/base.
38
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-pannello-accessibilita-default.md).
39
+
40
+ ## 1.0.0-beta.23 — 2026-10-08
41
+
42
+ - Promote the pilot accessibility panel and theme/motion/vivid-color switches to public, styled defaults. Preserve visitor preferences and keyboard behavior; ship geometry without consumer Tailwind scanning.
43
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-pannello-accessibilita-default.md).
44
+
45
+ ## 1.0.0-beta.22 — 2026-10-08
46
+
47
+ - Expose shared site defaults and initialize BaseLayout without locking nested themes. Complete default adapter catalog v4 from both pilots and restore active grid bleed for container items.
48
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-default-css-adapter-bleed.md).
49
+
50
+ ## 1.0.0-beta.21 — 2026-10-08
51
+
52
+ - Apply responsive native grid columns, child spans and container bleed in Site Editor compositions, including structural CSS and the bleed runtime. Preserve saved breakpoint values and cap rendered spans to the parent grid.
53
+ - [Cloudflare and responsive grid verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-cloudflare-rendering-commonjs.md).
54
+
55
+ ## 1.0.0-beta.20 — 2026-10-07
56
+
57
+ - Normalize composition route SEO exactly like the route query: JSON-LD, Twitter metadata and image alt text remain intact when using the single-call page loader. Also accept already normalized composition SEO.
58
+ - Retain beta.19 media/query/runtime optimizations. [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-07-media-diretti-runtime.md).
59
+
60
+ ## 1.0.0-beta.19 — 2026-10-07
61
+
62
+ - Publish the direct-media and editorial/runtime optimizations described below with a lockfile verified by clean installation and StyleFlow beta.9.
63
+ - Supersedes the unpublished beta.18 candidate; its immutable Git tag is retained.
64
+
65
+ ## 1.0.0-beta.18 — unpublished candidate, 2026-10-07
66
+
67
+ - Deliver media at their real WordPress/R2 origin; undo legacy frontend aliases without inventing offload URLs. Preserve mixed libraries, srcset and external URLs. Proxy exports are deprecated compatibility APIs.
68
+ - Add `getPage` to reuse the route already returned by Site Editor compositions and optional `includeContent: false` (WordPress Core beta.19) for unused HTML. Existing APIs retain their defaults; previews are not cached across requests.
69
+ - Prepare descriptor/diagnostic indexes once per recursive composition, share unchanged media payload branches and consume StyleFlow Astro beta.9 contract indexes.
70
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-07-media-diretti-runtime.md).
71
+
72
+ ## 1.0.0-beta.17 — 2026-10-07
73
+
74
+ - Official native and sf/* renderers at every nesting depth; responsive grids and measured container bleed, maps, neutral organic shapes, timeline and accessible navigation.
75
+ - Canonical behavior, migration and verification: [pilot integration](https://github.com/StyleFlow-App/styleflow-docs/blob/main/wiki/piloti-flowpress.md), [report](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-07-integrazione-piloti-flowpress.md).
76
+
3
77
  ## Unreleased
4
78
 
79
+ ## 1.0.0-beta.16
80
+
81
+ - Rebase owned composition media to the current frontend, including nested
82
+ query data, authoring attributes and responsive sources. WordPress uploads
83
+ keep `/app/uploads/`; offloaded assets keep `/media/`. External media and
84
+ raw HTML remain unchanged.
85
+ - Export `rewriteFlowpressMediaUrl`, `rewriteFlowpressMediaUrls` and explicit
86
+ frontend/backend/offload origin options for project integrations.
87
+ - Follow storage redirects server-side with a bounded redirect count. Proxy
88
+ responses no longer expose backend/CDN `Location` headers to the browser.
89
+
90
+ ## 1.0.0-beta.15
91
+
92
+ - Fixed `proxyFlowpressMedia` forwarding the `/media/` route prefix to the
93
+ upstream `FLOWPRESS_MEDIA` origin. `/media/` is a frontend-only routing
94
+ marker with no equivalent on either upstream (an offload CDN root, or the
95
+ WordPress backend as a fallback), so it is now stripped before the request
96
+ is forwarded: `/media/2026/09/x.jpg` resolves to `<origin>/2026/09/x.jpg`
97
+ instead of `<origin>/media/2026/09/x.jpg`, which 404s.
98
+ - `proxyFlowpressUpload` (`/app/uploads/`) is unaffected: that prefix mirrors
99
+ a real path on the WordPress backend and continues to be forwarded as-is.
100
+
101
+ ## 1.0.0-beta.14
102
+
103
+ - Adopted `@styleflow.app/astro@1.0.0-beta.7` and Typography vNext contract
104
+ axes with per-type `weightsByType` and partial HTML `tagMappings`.
105
+ - Updated the real renderer fixture to build format `2.0.0` bundles while
106
+ preserving the complete Cover, carousel, composition and Gutenberg suite.
107
+ - Added strict regression coverage for weights disabled on a selected type.
108
+
109
+ ## 1.0.0-beta.13
110
+
111
+ - Added `scrimOpacity` as an explicit `0–100` percentage for the official
112
+ Cover renderer, clamped at the public boundary and emitted through a scoped
113
+ CSS custom property.
114
+ - Preserved legacy Cover content by using native `dimRatio` as the opacity
115
+ fallback only when `scrimOpacity` is absent or invalid.
116
+
117
+ ## 1.0.0-beta.12
118
+
119
+ - Added the official `core/cover` renderer and editable default adapter with
120
+ image/video media, focal point, validated minimum height, nested content and
121
+ Styleflow root props.
122
+ - Added prefixed Styleflow coordinates for semantic scrims and kept native
123
+ `dimRatio` only as a temporary compatibility switch, never as raw CSS.
124
+ - Added a `default` root export so Node CommonJS resolution can locate the ESM
125
+ entry used by project scaffolding commands.
126
+
127
+ ## 1.0.0-beta.11
128
+
129
+ - Made the official default adapter usable by both Site Editor compositions
130
+ and traditional Gutenberg rendering.
131
+ - Kept nested project overrides active in traditional rendering while applying
132
+ composition fingerprint gates only when a composition is present.
133
+
134
+ ## 1.0.0-beta.10
135
+
136
+ - Added a versioned catalog of official default block adapters and a public
137
+ source generator for editable project overrides.
138
+ - Let an official default render a block without recursively selecting the
139
+ override currently wrapping it, while preserving certified overrides for
140
+ every nested child.
141
+ - Added reusable `FLOWPRESS_MEDIA` resolution, Astro image remote patterns and
142
+ safe upload/media proxy helpers with `GET`, `HEAD`, range and cache support.
143
+ - Extended normalized block HTML props with an explicit safe attribute
144
+ allowlist; Gutenberg event handlers, inline styles and Styleflow-owned data
145
+ attributes remain blocked.
146
+
147
+ ## 1.0.0-beta.9
148
+
149
+ - Validated typography variants against the union of contract variants when
150
+ the block adapter has not yet supplied its typography type, preventing the
151
+ composition registry from rejecting valid heading-only variants early.
152
+
153
+ ## 1.0.0-beta.8
154
+
155
+ - Normalized finite numeric CMS values for enumerated Styleflow axes to their
156
+ canonical contract strings, so typography variants such as WordPress `v=0`
157
+ remain valid in strict production builds without emitting a fallback.
158
+
159
+ ## 1.0.0-beta.7
160
+
161
+ - Fixed theme-aware logo selection by placing fallback visibility variables on
162
+ the document root, allowing the nearest global or nested Styleflow theme to
163
+ override them while preserving per-block logo overrides.
164
+
165
+ ## 1.0.0-beta.6
166
+
167
+ - Added required `htmlProps`, `styleflowProps`, composition and deterministic
168
+ render context to every certified block adapter.
169
+ - Added single-emission composition stylesheets for validated WordPress block
170
+ CSS, plus theme-aware positive/negative Site Logo rendering.
171
+ - Added the no-hydration multi-theme runtime and `sf/theme-toggle` adapter.
172
+ - Made `<S.*>` the only public Astro authoring syntax in package sources.
173
+ - Added `FlowpressCompositionV1`, typed `resolvedData`,
174
+ `FlowpressClient.getComposition()` and recursive production fail-closed
175
+ rendering with exact compatibility commands in development.
176
+
177
+ ## 1.0.0-beta.5
178
+
179
+ - Updated the exact `@styleflow.app/astro` dependency to `1.0.0-beta.4`,
180
+ adopting the Styleflow contract beta.6 validator and generated runtime.
181
+ - Kept the grouped CMS coordinates and Gutenberg block format unchanged; no
182
+ legacy adapter was introduced.
183
+
184
+ ## 1.0.0-beta.4
185
+
186
+ - Exported the `FlowpressLinkValue` relational contract and centralized safe
187
+ href extraction for resolved internal, external, protocol, and fragment
188
+ destinations.
189
+ - Made failed, missing, and bare-`#` relations fail closed: buttons retain
190
+ their label and Styleflow semantics as non-interactive elements, while
191
+ cards and list fallbacks emit anchors only for a valid resolved href.
192
+ - Added renderer and unit fixtures for missing translations, root-relative
193
+ query/fragment paths, safe protocols, and invalid schemes.
194
+
5
195
  ## 1.0.0-beta.3
6
196
 
7
197
  - Deferred generic Gutenberg semantic validation until its renderer branch is
@@ -26,7 +216,6 @@
26
216
  - Updated the exact `@styleflow.app/astro` dependency to `1.0.0-beta.1`,
27
217
  keeping consumer trees on one runtime while adopting deterministic CLI
28
218
  reports. Runtime behavior is unchanged.
29
-
30
219
  ## 1.0.0-beta.0
31
220
 
32
221
  - Adopted the grouped Styleflow vNext project contract and the exact Astro v1
package/README.md CHANGED
@@ -9,8 +9,8 @@ The package must not import from an application or project plugin.
9
9
  ## Install
10
10
 
11
11
  ```bash
12
- pnpm add @styleflow.app/flowpress-astro-core@1.0.0-beta.3 \
13
- @styleflow.app/astro@1.0.0-beta.1
12
+ pnpm add @styleflow.app/flowpress-astro-core@1.0.0-beta.16 \
13
+ @styleflow.app/astro@1.0.0-beta.6
14
14
  ```
15
15
 
16
16
  Prereleases are pinned exactly. The package expects Astro 7 or newer and the
@@ -54,6 +54,15 @@ visible characters. The exported
54
54
  from rendered CMS blocks so consumers can generate Tailwind
55
55
  `@source inline()` directives before compiling their frontend CSS.
56
56
 
57
+ The package exports `FlowpressLinkValue`, `flowpressLinkValue()` and
58
+ `flowpressLinkHref()` for the WordPress relational link contract. Navigation
59
+ paths are root-relative and are rendered only when resolution succeeds.
60
+ `missing_translation`, `missing_entity`, invalid schemes, and a bare `#` fail
61
+ closed. FlowPress buttons keep their authored label and semantic styling as an
62
+ `aria-disabled` non-interactive element; cards and list fallbacks omit the
63
+ anchor. Canonical, hreflang, social and media URLs remain under their separate
64
+ absolute-URL contracts.
65
+
57
66
  `sf/carousel` renders an accessible horizontal Splide carousel whose direct
58
67
  children must be `sf/carousel-item`; each item can recursively contain any
59
68
  renderable block. Item counts inherit across `base/sm/md/lg/xl/2xl`, with
@@ -70,6 +79,89 @@ grid and dead controls are hidden. If a legacy carousel contains any direct
70
79
  child other than `sf/carousel-item`, no interactive instance is initialized:
71
80
  the complete content renders statically, with a development diagnostic.
72
81
 
82
+ ## Site Editor composition
83
+
84
+ `FlowpressClient.getComposition(uri, locale)` reads the public
85
+ `FlowpressCompositionV1` contract. `CompositionRenderer.astro` walks its block
86
+ tree through an explicit `FlowpressBlockAdapters` registry, passes authored
87
+ attributes and `resolvedData` separately, and never renders `innerHtml` as a
88
+ fallback. Blocking WordPress diagnostics always fail the render. Missing or
89
+ draft adapters, absent block-type descriptors and schema-fingerprint drift
90
+ are visible diagnostics in development and fail closed in production with
91
+ the exact scaffold, refresh or approval command. The fingerprint comparison
92
+ is repeated by Astro and does not rely only on the CMS gate.
93
+ Before invoking an adapter, the renderer resolves the universal Styleflow
94
+ attributes through the same framework-neutral validator used by the built-in
95
+ renderer and passes them as `styleflowProps`. Project adapters can therefore
96
+ apply the authored semantic context to their real root without accepting raw
97
+ WordPress visual values.
98
+
99
+ At the composition root, owned media URLs are rebased to the current request
100
+ origin using explicit `BACKEND_URL`, `FLOWPRESS_MEDIA`, `SITE_URL` and the
101
+ composition's canonical frontend origin. This also covers nested query items
102
+ and responsive `srcSet` data passed to project adapters. WordPress uploads
103
+ remain under `/app/uploads/` and offloaded files under `/media/`; third-party
104
+ assets and raw HTML/CSS/scripts are preserved. A `media` prop of type
105
+ `FlowpressFrontendMediaOptions` can supply explicit origins. Projects can
106
+ also use exported `rewriteFlowpressMediaUrl` / `rewriteFlowpressMediaUrls`
107
+ for data rendered outside a composition. These functions do not mutate the
108
+ CMS payload.
109
+
110
+ The upload and media proxies follow HTTP(S) storage redirects on the server
111
+ (at most five), forwarding only safe request headers and preserving range,
112
+ validator and cache semantics. They never return an upstream `Location` or
113
+ `Set-Cookie` header: the browser stays on the public frontend URL.
114
+
115
+ Every adapter also receives required normalized `htmlProps` (`anchor` → `id`
116
+ and the additional classes), the full composition and a deterministic render
117
+ context. The public HTML allowlist also preserves `title`, `role`, `lang`,
118
+ `dir`, `tabindex`, `aria-*` and project `data-*` attributes. Inline styles,
119
+ event handlers and Styleflow-owned `data-*` attributes are never copied from
120
+ Gutenberg indiscriminately. WordPress-processed block custom CSS is emitted
121
+ once at the root.
122
+ `ThemeRuntime.astro` applies the persisted contract theme before paint and
123
+ progressively enhances `sf/theme-toggle` without hydrating React. The shared
124
+ Site Logo adapter renders positive and negative variants while inherited CSS
125
+ variables make the nearest nested theme authoritative.
126
+
127
+ ```astro
128
+ ---
129
+ import CompositionRenderer from "@styleflow.app/flowpress-astro-core/CompositionRenderer.astro";
130
+ import { blockAdapters } from "./generated/block-adapter-registry";
131
+ ---
132
+
133
+ <CompositionRenderer composition={composition} adapters={blockAdapters} />
134
+ ```
135
+
136
+ The package publishes a versioned `flowpressDefaultBlockCatalog` and
137
+ `DefaultBlockAdapter.astro`. A project registry can therefore resolve a block
138
+ in this order: conventional local `namespace-block.astro`, explicit manifest
139
+ renderer, official default. Calling the official default skips only the
140
+ current override and keeps the same registry for nested children, avoiding
141
+ recursion without losing child overrides. The same adapter works in Site
142
+ Editor compositions and in traditional Gutenberg rendering; fingerprint gates
143
+ remain composition-only. File discovery never changes a
144
+ `draft`, missing or stale fingerprint into a certified adapter.
145
+
146
+ `createFlowpressDefaultBlockAdapterSource(blockName)` returns the editable
147
+ source used by scaffolding when `--from-default` is selected. Unsupported
148
+ blocks throw instead of pretending that a semantic implementation exists.
149
+
150
+ `core/cover` is part of catalog version 2. Its public `CoverBlock.astro`
151
+ renderer accepts the native image/video URL, focal point, content position and
152
+ minimum height, renders nested blocks through a slot and keeps media at
153
+ `object-fit: cover`. The root uses the normal Styleflow props; the overlay uses
154
+ the same validated contract through prefixed attributes such as `scrimTone`,
155
+ `scrimIntensity`, `scrimSurface` and `scrimTheme`. `scrimEnabled` controls its
156
+ presence and `scrimOpacity` accepts an explicit percentage from `0` to `100`.
157
+ Values outside the interval are clamped. Native `dimRatio` remains a
158
+ compatibility input for both activation and opacity when the explicit
159
+ Styleflow-facing fields are absent.
160
+
161
+ Static adapters produce no JavaScript by default. A project opts into client
162
+ runtime only inside adapters classified as interactive; React views rendered
163
+ without `client:*` remain server-only HTML.
164
+
73
165
  Heading, rich-text, quote and matching core blocks accept Gutenberg alignment
74
166
  from either `style.typography.textAlign` or the FlowPress `textAlign` field.
75
167
  Only `left`, `center`, `right`, `justify`, `start` and `end` reach CSS.
@@ -138,6 +230,18 @@ assistive technology and without JavaScript; `prefers-reduced-motion: reduce`
138
230
  skips the animation entirely. Browsers without viewport observation keep the
139
231
  server-rendered final value instead of guessing when to start.
140
232
 
233
+ ## Media
234
+
235
+ `resolveFlowpressMediaUrl()` reads `FLOWPRESS_MEDIA`, falling back to
236
+ `BACKEND_URL`, while `flowpressMediaRemotePattern()` returns the matching Astro
237
+ image pattern. URLs with credentials, query strings or fragments are rejected.
238
+
239
+ `proxyFlowpressUpload()` and `proxyFlowpressMedia()` are shared request
240
+ handlers for server output and static Pages Functions. They accept only
241
+ `GET`/`HEAD`, preserve conditional and Range requests plus cache metadata, and
242
+ use explicit request/response header allowlists so cookies, authorization and
243
+ other sensitive headers never cross the proxy boundary.
244
+
141
245
  ## Release
142
246
 
143
247
  ```bash
@@ -158,9 +262,13 @@ The TypeScript template-hierarchy suite is self-contained. Its additional PHP
158
262
  parity test runs when the sibling `flowpress-wordpress-core` checkout is
159
263
  available locally and is skipped in a standalone package checkout.
160
264
 
161
- Publish v1 betas on `next` only after Components and WordPress Core are
265
+ Publish `1.0.0-beta.15` on `next` only after the exact Styleflow prerelease is
162
266
  available. Inspect `npm view`, `gitHead`, integrity and the downloaded tarball.
163
267
  Promote to `latest` only after the DMO canary and rollback gate.
164
268
 
165
269
  Release activity reports are indexed in
166
270
  [`docs/activities/README.md`](docs/activities/README.md).
271
+
272
+ Pilot integration in `1.0.0-beta.17`: Canonical behavior, migration and verification: [pilot integration](https://github.com/StyleFlow-App/styleflow-docs/blob/main/wiki/piloti-flowpress.md), [report](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-07-integrazione-piloti-flowpress.md).
273
+
274
+ Direct media and query loading: [canonical guide](https://github.com/StyleFlow-App/styleflow-docs/blob/main/wiki/runtime-editoriale.md), [media migration](https://github.com/StyleFlow-App/styleflow-docs/blob/main/wiki/asset.md).
@@ -0,0 +1,2 @@
1
+ export declare function initializeAccessibilityPanel(scope?: ParentNode): () => void;
2
+ //# sourceMappingURL=accessibility-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessibility-panel.d.ts","sourceRoot":"","sources":["../src/accessibility-panel.ts"],"names":[],"mappings":"AAWA,wBAAgB,4BAA4B,CAAC,KAAK,GAAE,UAAqB,GAAG,MAAM,IAAI,CAGrF"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Behaviour of the floating accessibility panel: a round button that opens a
3
+ * small non-modal dialog. Escape closes it and returns focus to the button;
4
+ * a press or focus outside closes it without stealing focus.
5
+ */
6
+ const ROOT_SELECTOR = "[data-sf-a11y]";
7
+ const TRIGGER_SELECTOR = "[data-sf-a11y-trigger]";
8
+ const PANEL_SELECTOR = "[data-sf-a11y-panel]";
9
+ const FOCUSABLE_SELECTOR = "button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex='-1'])";
10
+ const BOUND = "sfA11yBound";
11
+ export function initializeAccessibilityPanel(scope = document) {
12
+ const disposers = [...scope.querySelectorAll(ROOT_SELECTOR)].map(bindPanel);
13
+ return () => disposers.forEach((dispose) => dispose());
14
+ }
15
+ function bindPanel(root) {
16
+ const documentObject = root.ownerDocument;
17
+ const windowObject = documentObject.defaultView;
18
+ let focusFrame;
19
+ const trigger = root?.querySelector(TRIGGER_SELECTOR);
20
+ const panel = root?.querySelector(PANEL_SELECTOR);
21
+ if (!root || !trigger || !panel || root.dataset[BOUND] === "true")
22
+ return () => { };
23
+ root.dataset[BOUND] = "true";
24
+ const isOpen = () => trigger.getAttribute("aria-expanded") === "true";
25
+ const label = (state) => trigger.dataset[state === "open" ? "openLabel" : "closeLabel"] ?? trigger.getAttribute("aria-label") ?? "";
26
+ const setOpen = (open, restoreFocus = false) => {
27
+ if (focusFrame !== undefined)
28
+ windowObject?.cancelAnimationFrame(focusFrame);
29
+ focusFrame = undefined;
30
+ trigger.setAttribute("aria-expanded", String(open));
31
+ trigger.setAttribute("aria-label", label(open ? "close" : "open"));
32
+ panel.dataset.state = open ? "open" : "closed";
33
+ panel.inert = !open;
34
+ if (open) {
35
+ // Removing inert and changing CSS visibility needs a frame before focus.
36
+ const focusFirst = () => {
37
+ focusFrame = undefined;
38
+ if (isOpen())
39
+ panel.querySelector(FOCUSABLE_SELECTOR)?.focus({ preventScroll: true });
40
+ };
41
+ if (windowObject)
42
+ focusFrame = windowObject.requestAnimationFrame(focusFirst);
43
+ else
44
+ focusFirst();
45
+ }
46
+ else if (restoreFocus)
47
+ trigger.focus();
48
+ };
49
+ const onTrigger = () => setOpen(!isOpen());
50
+ const onKeydown = (event) => {
51
+ if (event.key !== "Escape" || !isOpen())
52
+ return;
53
+ event.preventDefault();
54
+ setOpen(false, true);
55
+ };
56
+ const onPointerDown = (event) => {
57
+ if (isOpen() && event.target instanceof Node && !root.contains(event.target))
58
+ setOpen(false);
59
+ };
60
+ const onFocusOut = (event) => {
61
+ if (isOpen() && event.relatedTarget instanceof Node && !root.contains(event.relatedTarget))
62
+ setOpen(false);
63
+ };
64
+ trigger.addEventListener("click", onTrigger);
65
+ root.addEventListener("keydown", onKeydown);
66
+ root.addEventListener("focusout", onFocusOut);
67
+ documentObject.addEventListener("pointerdown", onPointerDown);
68
+ setOpen(false);
69
+ // Without scripts the controls cannot work, so the markup ships hidden.
70
+ root.hidden = false;
71
+ return () => {
72
+ setOpen(false);
73
+ root.hidden = true;
74
+ trigger.removeEventListener("click", onTrigger);
75
+ root.removeEventListener("keydown", onKeydown);
76
+ root.removeEventListener("focusout", onFocusOut);
77
+ documentObject.removeEventListener("pointerdown", onPointerDown);
78
+ delete root.dataset[BOUND];
79
+ };
80
+ }
81
+ //# sourceMappingURL=accessibility-panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessibility-panel.js","sourceRoot":"","sources":["../src/accessibility-panel.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * Behaviour of the floating accessibility panel: a round button that opens a\n * small non-modal dialog. Escape closes it and returns focus to the button;\n * a press or focus outside closes it without stealing focus.\n */\nconst ROOT_SELECTOR = \"[data-sf-a11y]\";\nconst TRIGGER_SELECTOR = \"[data-sf-a11y-trigger]\";\nconst PANEL_SELECTOR = \"[data-sf-a11y-panel]\";\nconst FOCUSABLE_SELECTOR = \"button:not([disabled]), [href], input:not([disabled]), [tabindex]:not([tabindex='-1'])\";\nconst BOUND = \"sfA11yBound\";\n\nexport function initializeAccessibilityPanel(scope: ParentNode = document): () => void {\n const disposers = [...scope.querySelectorAll<HTMLElement>(ROOT_SELECTOR)].map(bindPanel);\n return () => disposers.forEach((dispose) => dispose());\n}\n\nfunction bindPanel(root: HTMLElement): () => void {\n const documentObject = root.ownerDocument;\n const windowObject = documentObject.defaultView;\n let focusFrame: number | undefined;\n const trigger = root?.querySelector<HTMLButtonElement>(TRIGGER_SELECTOR);\n const panel = root?.querySelector<HTMLElement>(PANEL_SELECTOR);\n if (!root || !trigger || !panel || root.dataset[BOUND] === \"true\") return () => {};\n root.dataset[BOUND] = \"true\";\n\n const isOpen = () => trigger.getAttribute(\"aria-expanded\") === \"true\";\n const label = (state: \"open\" | \"close\") =>\n trigger.dataset[state === \"open\" ? \"openLabel\" : \"closeLabel\"] ?? trigger.getAttribute(\"aria-label\") ?? \"\";\n\n const setOpen = (open: boolean, restoreFocus = false) => {\n if (focusFrame !== undefined) windowObject?.cancelAnimationFrame(focusFrame);\n focusFrame = undefined;\n trigger.setAttribute(\"aria-expanded\", String(open));\n trigger.setAttribute(\"aria-label\", label(open ? \"close\" : \"open\"));\n panel.dataset.state = open ? \"open\" : \"closed\";\n panel.inert = !open;\n if (open) {\n // Removing inert and changing CSS visibility needs a frame before focus.\n const focusFirst = () => {\n focusFrame = undefined;\n if (isOpen()) panel.querySelector<HTMLElement>(FOCUSABLE_SELECTOR)?.focus({ preventScroll: true });\n };\n if (windowObject) focusFrame = windowObject.requestAnimationFrame(focusFirst);\n else focusFirst();\n } else if (restoreFocus) trigger.focus();\n };\n\n const onTrigger = () => setOpen(!isOpen());\n const onKeydown = (event: KeyboardEvent) => {\n if (event.key !== \"Escape\" || !isOpen()) return;\n event.preventDefault();\n setOpen(false, true);\n };\n const onPointerDown = (event: PointerEvent) => {\n if (isOpen() && event.target instanceof Node && !root.contains(event.target)) setOpen(false);\n };\n const onFocusOut = (event: FocusEvent) => {\n if (isOpen() && event.relatedTarget instanceof Node && !root.contains(event.relatedTarget)) setOpen(false);\n };\n\n trigger.addEventListener(\"click\", onTrigger);\n root.addEventListener(\"keydown\", onKeydown);\n root.addEventListener(\"focusout\", onFocusOut);\n documentObject.addEventListener(\"pointerdown\", onPointerDown);\n setOpen(false);\n // Without scripts the controls cannot work, so the markup ships hidden.\n root.hidden = false;\n\n return () => {\n setOpen(false);\n root.hidden = true;\n trigger.removeEventListener(\"click\", onTrigger);\n root.removeEventListener(\"keydown\", onKeydown);\n root.removeEventListener(\"focusout\", onFocusOut);\n documentObject.removeEventListener(\"pointerdown\", onPointerDown);\n delete root.dataset[BOUND];\n };\n}\n"]}
@@ -1,31 +1,47 @@
1
1
  ---
2
+ import { decodeFlowpressText } from "../text.js";
2
3
  import type { SfSeo } from "../types.js";
3
- import S from "@styleflow.app/astro/S.astro";
4
+ import StyleflowElement from "./StyleflowElement.astro";
5
+ import ThemeRuntime from "./ThemeRuntime.astro";
6
+ import AccessibilityPanel from "./preferences/AccessibilityPanel.astro";
7
+ import PreferencesRuntime from "./preferences/PreferencesRuntime.astro";
8
+ import { flowpressSiteDesignAttributes, type FlowpressSiteDesign } from "@styleflow.app/flowpress-components/site-design";
4
9
 
5
10
  interface Props {
6
- lang?: string;
7
- seo?: SfSeo | null;
8
- siteName?: string;
9
- theme?: string;
11
+ showPreferences?: boolean;
12
+ lang?: string | undefined;
13
+ seo?: SfSeo | null | undefined;
14
+ siteName?: string | undefined;
15
+ theme?: string | undefined;
16
+ themes?: string[] | undefined;
17
+ siteDesign?: FlowpressSiteDesign | undefined;
10
18
  }
11
19
 
12
- const {
20
+ const { showPreferences = true,
13
21
  lang = "it",
14
22
  seo = null,
15
23
  siteName = import.meta.env.PROJECT_NAME ?? "FlowPress",
16
- theme
24
+ theme,
25
+ siteDesign,
26
+ themes = (siteDesign?.defaults.theme || theme) ? [siteDesign?.defaults.theme || theme!] : []
17
27
  } = Astro.props;
18
- const title = seo?.title || siteName;
19
- const description = seo?.description || "";
28
+ const defaultTheme = siteDesign?.defaults.theme || theme;
29
+ const documentAttributes = siteDesign ? flowpressSiteDesignAttributes(siteDesign) : {
30
+ html: defaultTheme ? { "data-styleflow-theme": defaultTheme } : {}, body: {}
31
+ };
32
+ const title = decodeFlowpressText(seo?.title || siteName);
33
+ const description = decodeFlowpressText(seo?.description);
20
34
  const robots = seo?.robots?.join(",") || "";
21
35
  const jsonLd = seo?.jsonLd ? JSON.stringify(seo.jsonLd) : null;
22
36
  ---
23
37
 
24
38
  <!doctype html>
25
- <html lang={lang}>
39
+ <html lang={lang} {...documentAttributes.html}>
26
40
  <head>
27
41
  <meta charset="UTF-8" />
42
+ {showPreferences && <PreferencesRuntime />}
28
43
  <meta name="viewport" content="width=device-width" />
44
+ {defaultTheme && themes.length ? <ThemeRuntime themes={themes} defaultTheme={defaultTheme} /> : null}
29
45
  <title>{title}</title>
30
46
  {description && <meta name="description" content={description} />}
31
47
  {robots && <meta name="robots" content={robots} />}
@@ -33,14 +49,14 @@ const jsonLd = seo?.jsonLd ? JSON.stringify(seo.jsonLd) : null;
33
49
  {seo?.hreflang?.map((alternate) => (
34
50
  <link rel="alternate" hreflang={alternate.locale} href={alternate.url} />
35
51
  ))}
36
- {seo?.openGraph?.title && <meta property="og:title" content={seo.openGraph.title} />}
37
- {seo?.openGraph?.description && <meta property="og:description" content={seo.openGraph.description} />}
52
+ {seo?.openGraph?.title && <meta property="og:title" content={decodeFlowpressText(seo.openGraph.title)} />}
53
+ {seo?.openGraph?.description && <meta property="og:description" content={decodeFlowpressText(seo.openGraph.description)} />}
38
54
  {seo?.canonicalUrl && <meta property="og:url" content={seo.canonicalUrl} />}
39
55
  {seo?.openGraph?.image?.url && <meta property="og:image" content={seo.openGraph.image.url} />}
40
56
  {seo?.openGraph?.image?.alt && <meta property="og:image:alt" content={seo.openGraph.image.alt} />}
41
57
  <meta name="twitter:card" content={seo?.twitter?.image?.url ? "summary_large_image" : "summary"} />
42
- {seo?.twitter?.title && <meta name="twitter:title" content={seo.twitter.title} />}
43
- {seo?.twitter?.description && <meta name="twitter:description" content={seo.twitter.description} />}
58
+ {seo?.twitter?.title && <meta name="twitter:title" content={decodeFlowpressText(seo.twitter.title)} />}
59
+ {seo?.twitter?.description && <meta name="twitter:description" content={decodeFlowpressText(seo.twitter.description)} />}
44
60
  {seo?.twitter?.image?.url && <meta name="twitter:image" content={seo.twitter.image.url} />}
45
61
  {seo?.twitter?.image?.alt && <meta name="twitter:image:alt" content={seo.twitter.image.alt} />}
46
62
  {jsonLd && <script type="application/ld+json" set:html={jsonLd} />}
@@ -49,9 +65,10 @@ const jsonLd = seo?.jsonLd ? JSON.stringify(seo.jsonLd) : null;
49
65
  <slot name="head-tag-manager" />
50
66
  <slot name="head" />
51
67
  </head>
52
- <body>
53
- <S.main theme={theme} surface="default" layoutRole="none" density="regular">
68
+ <body {...documentAttributes.body}>
69
+ <StyleflowElement as="main" surface={siteDesign?.defaults.surface || "default"} layoutRole="none" density={siteDesign?.defaults.density || "regular"}>
54
70
  <slot />
55
- </S.main>
71
+ </StyleflowElement>
72
+ {showPreferences && <AccessibilityPanel themes={themes} />}
56
73
  </body>
57
74
  </html>