@styleflow.app/flowpress-astro-core 1.0.0-beta.4 → 1.0.0-beta.41

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 (317) hide show
  1. package/CHANGELOG.md +249 -1
  2. package/README.md +104 -5
  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 +168 -0
  9. package/dist/astro/DefaultBlockAdapter.astro +37 -0
  10. package/dist/astro/FontStylesheets.astro +35 -0
  11. package/dist/astro/GutenbergRenderer.astro +267 -80
  12. package/dist/astro/Media.astro +27 -0
  13. package/dist/astro/StyleflowElement.astro +25 -0
  14. package/dist/astro/ThemeRuntime.astro +26 -0
  15. package/dist/astro/blocks/CarouselBlock.astro +11 -10
  16. package/dist/astro/blocks/CarouselItemBlock.astro +4 -4
  17. package/dist/astro/blocks/ColumnBlock.astro +4 -5
  18. package/dist/astro/blocks/CoverBlock.astro +158 -0
  19. package/dist/astro/blocks/FormBlock.astro +23 -20
  20. package/dist/astro/blocks/GridBlock.astro +5 -4
  21. package/dist/astro/blocks/HeroBlock.astro +6 -6
  22. package/dist/astro/blocks/ImageBlock.astro +6 -6
  23. package/dist/astro/blocks/ListItemFallback.astro +9 -7
  24. package/dist/astro/blocks/NumberSpinnerBlock.astro +29 -22
  25. package/dist/astro/blocks/SemanticElement.astro +35 -0
  26. package/dist/astro/blocks/SiteLogoBlock.astro +54 -0
  27. package/dist/astro/blocks/TextBlock.astro +33 -28
  28. package/dist/astro/blocks/ThemeToggleBlock.astro +13 -0
  29. package/dist/astro/blocks/cover.d.ts +13 -0
  30. package/dist/astro/blocks/cover.d.ts.map +1 -0
  31. package/dist/astro/blocks/cover.js +105 -0
  32. package/dist/astro/blocks/cover.js.map +1 -0
  33. package/dist/astro/blocks/cover.ts +119 -0
  34. package/dist/astro/blocks/helpers.d.ts +10 -1
  35. package/dist/astro/blocks/helpers.d.ts.map +1 -1
  36. package/dist/astro/blocks/helpers.js +55 -39
  37. package/dist/astro/blocks/helpers.js.map +1 -1
  38. package/dist/astro/blocks/helpers.ts +69 -44
  39. package/dist/astro/motion/AccordionRuntime.astro +9 -0
  40. package/dist/astro/motion/MotionBoot.astro +21 -0
  41. package/dist/astro/motion/MotionRuntime.astro +31 -0
  42. package/dist/astro/motion/accordion.css +163 -0
  43. package/dist/astro/motion/accordion.d.ts +3 -0
  44. package/dist/astro/motion/accordion.d.ts.map +1 -0
  45. package/dist/astro/motion/accordion.js +98 -0
  46. package/dist/astro/motion/accordion.js.map +1 -0
  47. package/dist/astro/motion/accordion.ts +109 -0
  48. package/dist/astro/motion/motion-controller.d.ts +12 -0
  49. package/dist/astro/motion/motion-controller.d.ts.map +1 -0
  50. package/dist/astro/motion/motion-controller.js +293 -0
  51. package/dist/astro/motion/motion-controller.js.map +1 -0
  52. package/dist/astro/motion/motion-controller.ts +377 -0
  53. package/dist/astro/motion/motion.css +546 -0
  54. package/dist/astro/motion/motion.d.ts +127 -0
  55. package/dist/astro/motion/motion.d.ts.map +1 -0
  56. package/dist/astro/motion/motion.js +255 -0
  57. package/dist/astro/motion/motion.js.map +1 -0
  58. package/dist/astro/motion/motion.ts +419 -0
  59. package/dist/astro/native/Blob.astro +113 -0
  60. package/dist/astro/native/BlobBlock.astro +52 -0
  61. package/dist/astro/native/CustomFieldValue.astro +88 -0
  62. package/dist/astro/native/LevelTag.astro +20 -0
  63. package/dist/astro/native/MapBlock.astro +41 -0
  64. package/dist/astro/native/NativeHtmlBlock.astro +12 -0
  65. package/dist/astro/native/NativeIconBlock.astro +42 -0
  66. package/dist/astro/native/ProjectTimelineBlock.astro +34 -0
  67. package/dist/astro/native/ReservedLogin.astro +107 -0
  68. package/dist/astro/native/ResolvedBlocks.astro +91 -0
  69. package/dist/astro/native/SyncedPatternContent.astro +94 -0
  70. package/dist/astro/native/TermFieldValue.astro +39 -0
  71. package/dist/astro/native/Timeline.astro +22 -0
  72. package/dist/astro/native/TimelineCardBlock.astro +7 -0
  73. package/dist/astro/native/blob/blob-shapes.generated.d.ts +2 -0
  74. package/dist/astro/native/blob/blob-shapes.generated.d.ts.map +1 -0
  75. package/dist/astro/native/blob/blob-shapes.generated.js +2 -0
  76. package/dist/astro/native/blob/blob-shapes.generated.js.map +1 -0
  77. package/dist/astro/native/blob/blob-shapes.generated.ts +1 -0
  78. package/dist/astro/native/blob/config.d.ts +49 -0
  79. package/dist/astro/native/blob/config.d.ts.map +1 -0
  80. package/dist/astro/native/blob/config.js +86 -0
  81. package/dist/astro/native/blob/config.js.map +1 -0
  82. package/dist/astro/native/blob/config.ts +132 -0
  83. package/dist/astro/native/blob/controller.d.ts +11 -0
  84. package/dist/astro/native/blob/controller.d.ts.map +1 -0
  85. package/dist/astro/native/blob/controller.js +240 -0
  86. package/dist/astro/native/blob/controller.js.map +1 -0
  87. package/dist/astro/native/blob/controller.ts +248 -0
  88. package/dist/astro/native/blob/geometry.d.ts +2 -0
  89. package/dist/astro/native/blob/geometry.d.ts.map +1 -0
  90. package/dist/astro/native/blob/geometry.js +2 -0
  91. package/dist/astro/native/blob/geometry.js.map +1 -0
  92. package/dist/astro/native/blob/geometry.ts +1 -0
  93. package/dist/astro/native/blob/ids.d.ts +7 -0
  94. package/dist/astro/native/blob/ids.d.ts.map +1 -0
  95. package/dist/astro/native/blob/ids.js +11 -0
  96. package/dist/astro/native/blob/ids.js.map +1 -0
  97. package/dist/astro/native/blob/ids.ts +11 -0
  98. package/dist/astro/native/blob.css +83 -0
  99. package/dist/astro/native/block-sizing.css +34 -0
  100. package/dist/astro/native/button-template.d.ts +31 -0
  101. package/dist/astro/native/button-template.d.ts.map +1 -0
  102. package/dist/astro/native/button-template.js +54 -0
  103. package/dist/astro/native/button-template.js.map +1 -0
  104. package/dist/astro/native/button-template.ts +92 -0
  105. package/dist/astro/native/button.d.ts +13 -0
  106. package/dist/astro/native/button.d.ts.map +1 -0
  107. package/dist/astro/native/button.js +26 -0
  108. package/dist/astro/native/button.js.map +1 -0
  109. package/dist/astro/native/button.ts +26 -0
  110. package/dist/astro/native/core-block.astro +18 -0
  111. package/dist/astro/native/core-button-fallback.astro +43 -0
  112. package/dist/astro/native/core-button.astro +65 -0
  113. package/dist/astro/native/core-buttons.astro +14 -0
  114. package/dist/astro/native/core-group.astro +25 -0
  115. package/dist/astro/native/core-home-link.astro +12 -0
  116. package/dist/astro/native/core-html.astro +8 -0
  117. package/dist/astro/native/core-icon.astro +7 -0
  118. package/dist/astro/native/core-image.astro +137 -0
  119. package/dist/astro/native/core-navigation-link.astro +71 -0
  120. package/dist/astro/native/core-navigation-submenu.astro +33 -0
  121. package/dist/astro/native/core-navigation.astro +101 -0
  122. package/dist/astro/native/core-page-list-data-item.astro +19 -0
  123. package/dist/astro/native/core-page-list-item.astro +8 -0
  124. package/dist/astro/native/core-page-list.astro +40 -0
  125. package/dist/astro/native/core-post-date.astro +21 -0
  126. package/dist/astro/native/core-post-excerpt.astro +26 -0
  127. package/dist/astro/native/core-post-featured-image.astro +40 -0
  128. package/dist/astro/native/core-post-template-fallback.astro +30 -0
  129. package/dist/astro/native/core-post-template.astro +23 -0
  130. package/dist/astro/native/core-post-terms.astro +47 -0
  131. package/dist/astro/native/core-post-title.astro +23 -0
  132. package/dist/astro/native/core-query-no-results.astro +12 -0
  133. package/dist/astro/native/core-query.astro +22 -0
  134. package/dist/astro/native/core-separator.astro +18 -0
  135. package/dist/astro/native/core-site-title.astro +16 -0
  136. package/dist/astro/native/core-term-description.astro +12 -0
  137. package/dist/astro/native/core-term-name.astro +21 -0
  138. package/dist/astro/native/core-term-template.astro +30 -0
  139. package/dist/astro/native/core-terms-query.astro +19 -0
  140. package/dist/astro/native/core-transparent.astro +11 -0
  141. package/dist/astro/native/flowpress-navigation-controller.d.ts +2 -0
  142. package/dist/astro/native/flowpress-navigation-controller.d.ts.map +1 -0
  143. package/dist/astro/native/flowpress-navigation-controller.js +217 -0
  144. package/dist/astro/native/flowpress-navigation-controller.js.map +1 -0
  145. package/dist/astro/native/flowpress-navigation-controller.ts +215 -0
  146. package/dist/astro/native/flowpress-navigation.css +17 -0
  147. package/dist/astro/native/grid-bleed.d.ts +2 -0
  148. package/dist/astro/native/grid-bleed.d.ts.map +1 -0
  149. package/dist/astro/native/grid-bleed.js +123 -0
  150. package/dist/astro/native/grid-bleed.js.map +1 -0
  151. package/dist/astro/native/grid.css +180 -0
  152. package/dist/astro/native/grid.d.ts +17 -0
  153. package/dist/astro/native/grid.d.ts.map +1 -0
  154. package/dist/astro/native/grid.js +103 -0
  155. package/dist/astro/native/grid.js.map +1 -0
  156. package/dist/astro/native/grid.ts +118 -0
  157. package/dist/astro/native/group.css +36 -0
  158. package/dist/astro/native/group.d.ts +15 -0
  159. package/dist/astro/native/group.d.ts.map +1 -0
  160. package/dist/astro/native/group.js +66 -0
  161. package/dist/astro/native/group.js.map +1 -0
  162. package/dist/astro/native/group.ts +61 -0
  163. package/dist/astro/native/html.d.ts +6 -0
  164. package/dist/astro/native/html.d.ts.map +1 -0
  165. package/dist/astro/native/html.js +10 -0
  166. package/dist/astro/native/html.js.map +1 -0
  167. package/dist/astro/native/html.ts +9 -0
  168. package/dist/astro/native/icon.d.ts +3 -0
  169. package/dist/astro/native/icon.d.ts.map +1 -0
  170. package/dist/astro/native/icon.js +23 -0
  171. package/dist/astro/native/icon.js.map +1 -0
  172. package/dist/astro/native/icon.ts +21 -0
  173. package/dist/astro/native/image.d.ts +5 -0
  174. package/dist/astro/native/image.d.ts.map +1 -0
  175. package/dist/astro/native/image.js +65 -0
  176. package/dist/astro/native/image.js.map +1 -0
  177. package/dist/astro/native/image.ts +56 -0
  178. package/dist/astro/native/inline-text.css +15 -0
  179. package/dist/astro/native/map.d.ts +14 -0
  180. package/dist/astro/native/map.d.ts.map +1 -0
  181. package/dist/astro/native/map.js +60 -0
  182. package/dist/astro/native/map.js.map +1 -0
  183. package/dist/astro/native/map.ts +70 -0
  184. package/dist/astro/native/motion-preference.d.ts +50 -0
  185. package/dist/astro/native/motion-preference.d.ts.map +1 -0
  186. package/dist/astro/native/motion-preference.js +132 -0
  187. package/dist/astro/native/motion-preference.js.map +1 -0
  188. package/dist/astro/native/motion-preference.ts +158 -0
  189. package/dist/astro/native/motion.d.ts +101 -0
  190. package/dist/astro/native/motion.d.ts.map +1 -0
  191. package/dist/astro/native/motion.js +168 -0
  192. package/dist/astro/native/motion.js.map +1 -0
  193. package/dist/astro/native/motion.ts +312 -0
  194. package/dist/astro/native/query-carousel.d.ts +12 -0
  195. package/dist/astro/native/query-carousel.d.ts.map +1 -0
  196. package/dist/astro/native/query-carousel.js +36 -0
  197. package/dist/astro/native/query-carousel.js.map +1 -0
  198. package/dist/astro/native/query-carousel.ts +56 -0
  199. package/dist/astro/native/query-loop.d.ts +38 -0
  200. package/dist/astro/native/query-loop.d.ts.map +1 -0
  201. package/dist/astro/native/query-loop.js +20 -0
  202. package/dist/astro/native/query-loop.js.map +1 -0
  203. package/dist/astro/native/query-loop.ts +67 -0
  204. package/dist/astro/native/registry.d.ts +3 -0
  205. package/dist/astro/native/registry.d.ts.map +1 -0
  206. package/dist/astro/native/registry.js +81 -0
  207. package/dist/astro/native/registry.js.map +1 -0
  208. package/dist/astro/native/registry.ts +82 -0
  209. package/dist/astro/native/sf-block-binding.astro +20 -0
  210. package/dist/astro/native/sf-post-field.astro +9 -0
  211. package/dist/astro/native/sf-term-field.astro +9 -0
  212. package/dist/astro/native/timeline.css +4 -0
  213. package/dist/astro/native/timeline.d.ts +28 -0
  214. package/dist/astro/native/timeline.d.ts.map +1 -0
  215. package/dist/astro/native/timeline.js +43 -0
  216. package/dist/astro/native/timeline.js.map +1 -0
  217. package/dist/astro/native/timeline.ts +79 -0
  218. package/dist/astro/preferences/AccessibilityPanel.astro +105 -0
  219. package/dist/astro/preferences/ColorModeToggle.astro +26 -0
  220. package/dist/astro/preferences/MotionToggle.astro +27 -0
  221. package/dist/astro/preferences/PreferencesRuntime.astro +9 -0
  222. package/dist/astro/preferences/ThemeToggle.astro +30 -0
  223. package/dist/astro/preferences/Toggle.astro +50 -0
  224. package/dist/astro/preferences/preferences.css +125 -0
  225. package/dist/block-renderers.d.ts +23 -3
  226. package/dist/block-renderers.d.ts.map +1 -1
  227. package/dist/block-renderers.js.map +1 -1
  228. package/dist/build-cache.d.ts +8 -0
  229. package/dist/build-cache.d.ts.map +1 -0
  230. package/dist/build-cache.js +81 -0
  231. package/dist/build-cache.js.map +1 -0
  232. package/dist/client.d.ts +23 -2
  233. package/dist/client.d.ts.map +1 -1
  234. package/dist/client.js +78 -39
  235. package/dist/client.js.map +1 -1
  236. package/dist/composition.d.ts +14 -0
  237. package/dist/composition.d.ts.map +1 -0
  238. package/dist/composition.js +125 -0
  239. package/dist/composition.js.map +1 -0
  240. package/dist/default-blocks.d.ts +9 -0
  241. package/dist/default-blocks.d.ts.map +1 -0
  242. package/dist/default-blocks.js +117 -0
  243. package/dist/default-blocks.js.map +1 -0
  244. package/dist/env.d.ts +9 -0
  245. package/dist/env.d.ts.map +1 -1
  246. package/dist/env.js +20 -0
  247. package/dist/env.js.map +1 -1
  248. package/dist/index.d.ts +7 -0
  249. package/dist/index.d.ts.map +1 -1
  250. package/dist/index.js +6 -0
  251. package/dist/index.js.map +1 -1
  252. package/dist/media.d.ts +20 -0
  253. package/dist/media.d.ts.map +1 -0
  254. package/dist/media.js +106 -0
  255. package/dist/media.js.map +1 -0
  256. package/dist/motion-preference.d.ts +50 -0
  257. package/dist/motion-preference.d.ts.map +1 -0
  258. package/dist/motion-preference.js +132 -0
  259. package/dist/motion-preference.js.map +1 -0
  260. package/dist/preferences-runtime.d.ts +3 -0
  261. package/dist/preferences-runtime.d.ts.map +1 -0
  262. package/dist/preferences-runtime.js +23 -0
  263. package/dist/preferences-runtime.js.map +1 -0
  264. package/dist/preferences-styleflow.d.ts +3 -0
  265. package/dist/preferences-styleflow.d.ts.map +1 -0
  266. package/dist/preferences-styleflow.js +14 -0
  267. package/dist/preferences-styleflow.js.map +1 -0
  268. package/dist/preferences.d.ts +4 -0
  269. package/dist/preferences.d.ts.map +1 -0
  270. package/dist/preferences.js +4 -0
  271. package/dist/preferences.js.map +1 -0
  272. package/dist/reserved-area.d.ts +10 -0
  273. package/dist/reserved-area.d.ts.map +1 -0
  274. package/dist/reserved-area.js +93 -0
  275. package/dist/reserved-area.js.map +1 -0
  276. package/dist/styleflow.d.ts +18 -1
  277. package/dist/styleflow.d.ts.map +1 -1
  278. package/dist/styleflow.js +82 -11
  279. package/dist/styleflow.js.map +1 -1
  280. package/dist/svg-media-runtime.d.ts +3 -0
  281. package/dist/svg-media-runtime.d.ts.map +1 -0
  282. package/dist/svg-media-runtime.js +33 -0
  283. package/dist/svg-media-runtime.js.map +1 -0
  284. package/dist/svg-media-types.d.ts +11 -0
  285. package/dist/svg-media-types.d.ts.map +1 -0
  286. package/dist/svg-media-types.js +2 -0
  287. package/dist/svg-media-types.js.map +1 -0
  288. package/dist/svg-media.d.ts +13 -0
  289. package/dist/svg-media.d.ts.map +1 -0
  290. package/dist/svg-media.js +47 -0
  291. package/dist/svg-media.js.map +1 -0
  292. package/dist/template-hierarchy.d.ts +0 -7
  293. package/dist/template-hierarchy.d.ts.map +1 -1
  294. package/dist/template-hierarchy.js +0 -21
  295. package/dist/template-hierarchy.js.map +1 -1
  296. package/dist/text.d.ts +3 -0
  297. package/dist/text.d.ts.map +1 -0
  298. package/dist/text.js +6 -0
  299. package/dist/text.js.map +1 -0
  300. package/dist/theme-runtime.d.ts +16 -0
  301. package/dist/theme-runtime.d.ts.map +1 -0
  302. package/dist/theme-runtime.js +100 -0
  303. package/dist/theme-runtime.js.map +1 -0
  304. package/dist/tsconfig.tsbuildinfo +1 -1
  305. package/dist/types.d.ts +75 -1
  306. package/dist/types.d.ts.map +1 -1
  307. package/dist/types.js.map +1 -1
  308. package/dist/vivid-colors-preference.d.ts +31 -0
  309. package/dist/vivid-colors-preference.d.ts.map +1 -0
  310. package/dist/vivid-colors-preference.js +102 -0
  311. package/dist/vivid-colors-preference.js.map +1 -0
  312. package/package.json +58 -7
  313. package/dist/astro/DefaultTemplate.astro +0 -42
  314. package/dist/templates.d.ts +0 -19
  315. package/dist/templates.d.ts.map +0 -1
  316. package/dist/templates.js +0 -20
  317. package/dist/templates.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,255 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0-beta.41 — 2026-10-27
4
+
5
+ - Fill the assigned layout space by default for structural blocks and editorial images, while allowing Styleflow recipes and responsive CSS widths to override the defaults.
6
+ - Preserve fixed flex sizing, grid spans, image crop/focal settings, and authored image dimensions; remove stronger Cover/Grid width resets.
7
+ - Keep normal and wide Separator widths consistent with the WordPress canvas.
8
+ - [Canonical report](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-27-larghezze-blocchi.md).
9
+
10
+ ## 1.0.0-beta.40 — 2026-10-27
11
+
12
+ - Honor native Image aspect ratios, cover/contain/fill scale and focal points on the actual media in Gutenberg and Site Editor rendering.
13
+ - Preserve authored CSS dimensions and responsive sources without letting intrinsic attachment dimensions override the selected ratio; keep captions and links outside the crop.
14
+ - Cover nested synced patterns, native units, invalid inputs and inline SVG presentation.
15
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-27-core-image-proporzioni-focale.md).
16
+
17
+ ## 1.0.0-beta.39 — 2026-10-26
18
+
19
+ - Let structural sections and constrained Groups fill aligned Cover content while preserving authored maximum widths.
20
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-26-adozione-simab.md).
21
+
22
+ ## 1.0.0-beta.38 — 2026-10-26
23
+
24
+ - Preserve the available width of responsive FlowPress grids inside aligned Cover content instead of shrinking columns to their intrinsic minimum.
25
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-26-adozione-simab.md).
26
+
27
+ ## 1.0.0-beta.37 — 2026-10-26
28
+
29
+ - Scan immutable SVG media trees once per render request, preserving nested/resolved media, scoped SVG IDs, and the explicit registration API for mutable caller data.
30
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-26-prestazioni-oauth-dmo.md).
31
+
32
+ ## 1.0.0-beta.36 — 2026-10-26
33
+
34
+ - Align StyleFlow Astro beta.11 and Components beta.16 so every default/native renderer shares the compiled design contract instead of allocating it for every primitive.
35
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-26-prestazioni-oauth-dmo.md).
36
+
37
+ ## 1.0.0-beta.35 — 2026-10-26
38
+
39
+ - Add a fresh CMS content revision API and an optional request store; HTTP remains the default.
40
+ - Export a separate Node build store for private, revision-bound data shared across processes. Authenticated queries, mutations and failed responses bypass storage.
41
+ - [Canonical report](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-26-prestazioni-oauth-dmo.md).
42
+
43
+ ## 1.0.0-beta.34 — 2026-10-20
44
+
45
+ - Make page loading composition-only and retire content-loader and conventional Astro template APIs.
46
+ - Remove pilot block aliases and media proxies; redirect historical file URLs to their real origins while preserving editorial /media pages.
47
+ - [Canonical report](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-20-sync-site-editor-ritiro-legacy.md).
48
+
49
+ ## 1.0.0-beta.33 — 2026-10-15
50
+
51
+ - Preserve inherited surfaces and layout on native blocks rendered in nested semantic passes, including dynamic query titles.
52
+ - Point README installation and release instructions to the current pins and canonical release evidence.
53
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-14-consolidamento-tessari.md).
54
+
55
+ ## 1.0.0-beta.32 — 2026-10-15
56
+
57
+ - Preserve project renderer overrides through Query Loop, Query Carousel and synced-pattern resolved passes, including semantic rendering without a composition registry.
58
+ - Add an actual Astro build regression with custom renderers in all three paths.
59
+ - [Canonical integration report](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-14-consolidamento-tessari.md).
60
+
61
+ ## 1.0.0-beta.31 — 2026-10-14
62
+
63
+ - Official renderers, inline SVG, inherited color validation, preferences, portable motion and accordion runtimes.
64
+ - Preserve inline typography and explicit inherited tones; provide readable uninitialized carousels.
65
+ - [Canonical integration report](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-14-consolidamento-tessari.md).
66
+
67
+
68
+ ## 1.0.0-beta.30 — 2026-10-09
69
+
70
+ - 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`.
71
+ - Verify native/project icons in traditional Gutenberg and Site Editor compositions, including inherited colors, accessible labels, invalid width fallback and scoped SVG IDs.
72
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-09-core-icon-frontend.md).
73
+
74
+ ## 1.0.0-beta.29 — 2026-10-08
75
+
76
+ - Extend the escaped plain-text entity decoding to buttons, cards, spinner segments, excerpts, timeline, list fallbacks, forms and accessibility labels. Keep RichText fragments unchanged.
77
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-tipografia-tag-mapping.md).
78
+
79
+ ## 1.0.0-beta.28 — 2026-10-08
80
+
81
+ - Decode WordPress entities once for escaped plain text across site titles, navigation, terms, custom fields and metadata.
82
+ - Add the official core/separator adapter with Styleflow props and a line painted from foreground via currentColor; preserve wide and dots variants.
83
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-tipografia-tag-mapping.md).
84
+
85
+ ## 1.0.0-beta.27 — 2026-10-08
86
+
87
+ - 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.
88
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-tipografia-tag-mapping.md).
89
+
90
+ ## 1.0.0-beta.26 — 2026-10-08
91
+
92
+ - 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.
93
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-pannello-accessibilita-default.md).
94
+
95
+ ## 1.0.0-beta.25 — 2026-10-08
96
+
97
+ - Focus the first accessibility switch after the panel becomes visible; cancel pending focus on close and cleanup.
98
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-pannello-accessibilita-default.md).
99
+
100
+ ## 1.0.0-beta.24 — 2026-10-08
101
+
102
+ - Validate the accessibility trigger intensity against the current project contract, including Starter designs with only main/base.
103
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-pannello-accessibilita-default.md).
104
+
105
+ ## 1.0.0-beta.23 — 2026-10-08
106
+
107
+ - 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.
108
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-pannello-accessibilita-default.md).
109
+
110
+ ## 1.0.0-beta.22 — 2026-10-08
111
+
112
+ - 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.
113
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-default-css-adapter-bleed.md).
114
+
115
+ ## 1.0.0-beta.21 — 2026-10-08
116
+
117
+ - 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.
118
+ - [Cloudflare and responsive grid verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-08-cloudflare-rendering-commonjs.md).
119
+
120
+ ## 1.0.0-beta.20 — 2026-10-07
121
+
122
+ - 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.
123
+ - 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).
124
+
125
+ ## 1.0.0-beta.19 — 2026-10-07
126
+
127
+ - Publish the direct-media and editorial/runtime optimizations described below with a lockfile verified by clean installation and StyleFlow beta.9.
128
+ - Supersedes the unpublished beta.18 candidate; its immutable Git tag is retained.
129
+
130
+ ## 1.0.0-beta.18 — unpublished candidate, 2026-10-07
131
+
132
+ - 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.
133
+ - 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.
134
+ - Prepare descriptor/diagnostic indexes once per recursive composition, share unchanged media payload branches and consume StyleFlow Astro beta.9 contract indexes.
135
+ - [Canonical verification](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-07-media-diretti-runtime.md).
136
+
137
+ ## 1.0.0-beta.17 — 2026-10-07
138
+
139
+ - Official native and sf/* renderers at every nesting depth; responsive grids and measured container bleed, maps, neutral organic shapes, timeline and accessible navigation.
140
+ - 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).
141
+
3
142
  ## Unreleased
143
+ - Agent rules only, no runtime or API change: `AGENTS.md` names the canonical
144
+ docs vault path (2026-10-18) and requires every published change to be
145
+ merged into `main`, with its branches, worktrees and stashes removed in the
146
+ same task.
147
+ [Canonical report](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-19-branch-residui-e-regole-di-chiusura.md).
148
+
149
+ ## 1.0.0-beta.16
150
+
151
+ - Rebase owned composition media to the current frontend, including nested
152
+ query data, authoring attributes and responsive sources. WordPress uploads
153
+ keep `/app/uploads/`; offloaded assets keep `/media/`. External media and
154
+ raw HTML remain unchanged.
155
+ - Export `rewriteFlowpressMediaUrl`, `rewriteFlowpressMediaUrls` and explicit
156
+ frontend/backend/offload origin options for project integrations.
157
+ - Follow storage redirects server-side with a bounded redirect count. Proxy
158
+ responses no longer expose backend/CDN `Location` headers to the browser.
159
+
160
+ ## 1.0.0-beta.15
161
+
162
+ - Fixed `proxyFlowpressMedia` forwarding the `/media/` route prefix to the
163
+ upstream `FLOWPRESS_MEDIA` origin. `/media/` is a frontend-only routing
164
+ marker with no equivalent on either upstream (an offload CDN root, or the
165
+ WordPress backend as a fallback), so it is now stripped before the request
166
+ is forwarded: `/media/2026/09/x.jpg` resolves to `<origin>/2026/09/x.jpg`
167
+ instead of `<origin>/media/2026/09/x.jpg`, which 404s.
168
+ - `proxyFlowpressUpload` (`/app/uploads/`) is unaffected: that prefix mirrors
169
+ a real path on the WordPress backend and continues to be forwarded as-is.
170
+
171
+ ## 1.0.0-beta.14
172
+
173
+ - Adopted `@styleflow.app/astro@1.0.0-beta.7` and Typography vNext contract
174
+ axes with per-type `weightsByType` and partial HTML `tagMappings`.
175
+ - Updated the real renderer fixture to build format `2.0.0` bundles while
176
+ preserving the complete Cover, carousel, composition and Gutenberg suite.
177
+ - Added strict regression coverage for weights disabled on a selected type.
178
+
179
+ ## 1.0.0-beta.13
180
+
181
+ - Added `scrimOpacity` as an explicit `0–100` percentage for the official
182
+ Cover renderer, clamped at the public boundary and emitted through a scoped
183
+ CSS custom property.
184
+ - Preserved legacy Cover content by using native `dimRatio` as the opacity
185
+ fallback only when `scrimOpacity` is absent or invalid.
186
+
187
+ ## 1.0.0-beta.12
188
+
189
+ - Added the official `core/cover` renderer and editable default adapter with
190
+ image/video media, focal point, validated minimum height, nested content and
191
+ Styleflow root props.
192
+ - Added prefixed Styleflow coordinates for semantic scrims and kept native
193
+ `dimRatio` only as a temporary compatibility switch, never as raw CSS.
194
+ - Added a `default` root export so Node CommonJS resolution can locate the ESM
195
+ entry used by project scaffolding commands.
196
+
197
+ ## 1.0.0-beta.11
198
+
199
+ - Made the official default adapter usable by both Site Editor compositions
200
+ and traditional Gutenberg rendering.
201
+ - Kept nested project overrides active in traditional rendering while applying
202
+ composition fingerprint gates only when a composition is present.
203
+
204
+ ## 1.0.0-beta.10
205
+
206
+ - Added a versioned catalog of official default block adapters and a public
207
+ source generator for editable project overrides.
208
+ - Let an official default render a block without recursively selecting the
209
+ override currently wrapping it, while preserving certified overrides for
210
+ every nested child.
211
+ - Added reusable `FLOWPRESS_MEDIA` resolution, Astro image remote patterns and
212
+ safe upload/media proxy helpers with `GET`, `HEAD`, range and cache support.
213
+ - Extended normalized block HTML props with an explicit safe attribute
214
+ allowlist; Gutenberg event handlers, inline styles and Styleflow-owned data
215
+ attributes remain blocked.
216
+
217
+ ## 1.0.0-beta.9
218
+
219
+ - Validated typography variants against the union of contract variants when
220
+ the block adapter has not yet supplied its typography type, preventing the
221
+ composition registry from rejecting valid heading-only variants early.
222
+
223
+ ## 1.0.0-beta.8
224
+
225
+ - Normalized finite numeric CMS values for enumerated Styleflow axes to their
226
+ canonical contract strings, so typography variants such as WordPress `v=0`
227
+ remain valid in strict production builds without emitting a fallback.
228
+
229
+ ## 1.0.0-beta.7
230
+
231
+ - Fixed theme-aware logo selection by placing fallback visibility variables on
232
+ the document root, allowing the nearest global or nested Styleflow theme to
233
+ override them while preserving per-block logo overrides.
234
+
235
+ ## 1.0.0-beta.6
236
+
237
+ - Added required `htmlProps`, `styleflowProps`, composition and deterministic
238
+ render context to every certified block adapter.
239
+ - Added single-emission composition stylesheets for validated WordPress block
240
+ CSS, plus theme-aware positive/negative Site Logo rendering.
241
+ - Added the no-hydration multi-theme runtime and `sf/theme-toggle` adapter.
242
+ - Made `<S.*>` the only public Astro authoring syntax in package sources.
243
+ - Added `FlowpressCompositionV1`, typed `resolvedData`,
244
+ `FlowpressClient.getComposition()` and recursive production fail-closed
245
+ rendering with exact compatibility commands in development.
246
+
247
+ ## 1.0.0-beta.5
248
+
249
+ - Updated the exact `@styleflow.app/astro` dependency to `1.0.0-beta.4`,
250
+ adopting the Styleflow contract beta.6 validator and generated runtime.
251
+ - Kept the grouped CMS coordinates and Gutenberg block format unchanged; no
252
+ legacy adapter was introduced.
4
253
 
5
254
  ## 1.0.0-beta.4
6
255
 
@@ -37,7 +286,6 @@
37
286
  - Updated the exact `@styleflow.app/astro` dependency to `1.0.0-beta.1`,
38
287
  keeping consumer trees on one runtime while adopting deterministic CLI
39
288
  reports. Runtime behavior is unchanged.
40
-
41
289
  ## 1.0.0-beta.0
42
290
 
43
291
  - 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.4 \
13
- @styleflow.app/astro@1.0.0-beta.1
12
+ pnpm add @styleflow.app/flowpress-astro-core@1.0.0-beta.33 \
13
+ @styleflow.app/astro@1.0.0-beta.9
14
14
  ```
15
15
 
16
16
  Prereleases are pinned exactly. The package expects Astro 7 or newer and the
@@ -79,6 +79,89 @@ grid and dead controls are hidden. If a legacy carousel contains any direct
79
79
  child other than `sf/carousel-item`, no interactive instance is initialized:
80
80
  the complete content renders statically, with a development diagnostic.
81
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
+
82
165
  Heading, rich-text, quote and matching core blocks accept Gutenberg alignment
83
166
  from either `style.typography.textAlign` or the FlowPress `textAlign` field.
84
167
  Only `left`, `center`, `right`, `justify`, `start` and `end` reach CSS.
@@ -147,6 +230,18 @@ assistive technology and without JavaScript; `prefers-reduced-motion: reduce`
147
230
  skips the animation entirely. Browsers without viewport observation keep the
148
231
  server-rendered final value instead of guessing when to start.
149
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
+
150
245
  ## Release
151
246
 
152
247
  ```bash
@@ -167,9 +262,13 @@ The TypeScript template-hierarchy suite is self-contained. Its additional PHP
167
262
  parity test runs when the sibling `flowpress-wordpress-core` checkout is
168
263
  available locally and is skipped in a standalone package checkout.
169
264
 
170
- Publish v1 betas on `next` only after Components and WordPress Core are
171
- available. Inspect `npm view`, `gitHead`, integrity and the downloaded tarball.
172
- Promote to `latest` only after the DMO canary and rollback gate.
265
+ Publish prereleases on `next` through CI/OIDC from an immutable version tag on main.
266
+ Inspect the workflow, registry, `gitHead`, integrity and downloaded tarball.
267
+ Canonical release and adoption evidence is in the [consolidation report](https://github.com/StyleFlow-App/styleflow-docs/blob/main/dev/rapporti/2026-10-14-consolidamento-tessari.md).
173
268
 
174
269
  Release activity reports are indexed in
175
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":[],"mapp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UAAU,CAAC,CAAC;QACjD,cAAc,CAAC,mBAAmB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;QACjE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAC;AACJ,CAAC","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>