@styleflow.app/flowpress-astro-core 1.0.0-beta.5 → 1.0.0-beta.50

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 (340) hide show
  1. package/CHANGELOG.md +307 -1
  2. package/README.md +121 -6
  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 +170 -0
  9. package/dist/astro/DefaultBlockAdapter.astro +37 -0
  10. package/dist/astro/EditorialMedia.astro +47 -0
  11. package/dist/astro/FontStylesheets.astro +35 -0
  12. package/dist/astro/GutenbergRenderer.astro +270 -84
  13. package/dist/astro/Media.astro +27 -0
  14. package/dist/astro/StyleflowElement.astro +25 -0
  15. package/dist/astro/ThemeRuntime.astro +26 -0
  16. package/dist/astro/blocks/CarouselBlock.astro +72 -101
  17. package/dist/astro/blocks/CarouselItemBlock.astro +4 -4
  18. package/dist/astro/blocks/ColumnBlock.astro +4 -5
  19. package/dist/astro/blocks/CoverBlock.astro +158 -0
  20. package/dist/astro/blocks/FormBlock.astro +23 -20
  21. package/dist/astro/blocks/GridBlock.astro +5 -4
  22. package/dist/astro/blocks/HeroBlock.astro +6 -6
  23. package/dist/astro/blocks/ImageBlock.astro +6 -6
  24. package/dist/astro/blocks/ListItemFallback.astro +9 -7
  25. package/dist/astro/blocks/NumberSpinnerBlock.astro +29 -22
  26. package/dist/astro/blocks/SemanticElement.astro +35 -0
  27. package/dist/astro/blocks/SiteLogoBlock.astro +54 -0
  28. package/dist/astro/blocks/TextBlock.astro +33 -28
  29. package/dist/astro/blocks/ThemeToggleBlock.astro +13 -0
  30. package/dist/astro/blocks/cover.d.ts +13 -0
  31. package/dist/astro/blocks/cover.d.ts.map +1 -0
  32. package/dist/astro/blocks/cover.js +105 -0
  33. package/dist/astro/blocks/cover.js.map +1 -0
  34. package/dist/astro/blocks/cover.ts +119 -0
  35. package/dist/astro/blocks/helpers.d.ts +10 -1
  36. package/dist/astro/blocks/helpers.d.ts.map +1 -1
  37. package/dist/astro/blocks/helpers.js +55 -39
  38. package/dist/astro/blocks/helpers.js.map +1 -1
  39. package/dist/astro/blocks/helpers.ts +69 -44
  40. package/dist/astro/motion/AccordionRuntime.astro +9 -0
  41. package/dist/astro/motion/MotionBoot.astro +21 -0
  42. package/dist/astro/motion/MotionRuntime.astro +31 -0
  43. package/dist/astro/motion/accordion.css +163 -0
  44. package/dist/astro/motion/accordion.d.ts +3 -0
  45. package/dist/astro/motion/accordion.d.ts.map +1 -0
  46. package/dist/astro/motion/accordion.js +98 -0
  47. package/dist/astro/motion/accordion.js.map +1 -0
  48. package/dist/astro/motion/accordion.ts +109 -0
  49. package/dist/astro/motion/motion-controller.d.ts +12 -0
  50. package/dist/astro/motion/motion-controller.d.ts.map +1 -0
  51. package/dist/astro/motion/motion-controller.js +312 -0
  52. package/dist/astro/motion/motion-controller.js.map +1 -0
  53. package/dist/astro/motion/motion-controller.ts +393 -0
  54. package/dist/astro/motion/motion.css +600 -0
  55. package/dist/astro/motion/motion.d.ts +132 -0
  56. package/dist/astro/motion/motion.d.ts.map +1 -0
  57. package/dist/astro/motion/motion.js +265 -0
  58. package/dist/astro/motion/motion.js.map +1 -0
  59. package/dist/astro/motion/motion.ts +430 -0
  60. package/dist/astro/native/AccordionRuntime.astro +11 -0
  61. package/dist/astro/native/Blob.astro +113 -0
  62. package/dist/astro/native/BlobBlock.astro +52 -0
  63. package/dist/astro/native/CustomFieldValue.astro +88 -0
  64. package/dist/astro/native/LevelTag.astro +20 -0
  65. package/dist/astro/native/MapBlock.astro +41 -0
  66. package/dist/astro/native/NativeHtmlBlock.astro +12 -0
  67. package/dist/astro/native/NativeIconBlock.astro +42 -0
  68. package/dist/astro/native/ProjectTimelineBlock.astro +34 -0
  69. package/dist/astro/native/ReservedLogin.astro +107 -0
  70. package/dist/astro/native/ResolvedBlocks.astro +91 -0
  71. package/dist/astro/native/SyncedPatternContent.astro +94 -0
  72. package/dist/astro/native/TermFieldValue.astro +39 -0
  73. package/dist/astro/native/Timeline.astro +22 -0
  74. package/dist/astro/native/TimelineCardBlock.astro +7 -0
  75. package/dist/astro/native/accordion-controller.d.ts +3 -0
  76. package/dist/astro/native/accordion-controller.d.ts.map +1 -0
  77. package/dist/astro/native/accordion-controller.js +143 -0
  78. package/dist/astro/native/accordion-controller.js.map +1 -0
  79. package/dist/astro/native/accordion-controller.ts +108 -0
  80. package/dist/astro/native/accordion.css +36 -0
  81. package/dist/astro/native/accordion.d.ts +24 -0
  82. package/dist/astro/native/accordion.d.ts.map +1 -0
  83. package/dist/astro/native/accordion.js +82 -0
  84. package/dist/astro/native/accordion.js.map +1 -0
  85. package/dist/astro/native/accordion.ts +91 -0
  86. package/dist/astro/native/blob/blob-shapes.generated.d.ts +2 -0
  87. package/dist/astro/native/blob/blob-shapes.generated.d.ts.map +1 -0
  88. package/dist/astro/native/blob/blob-shapes.generated.js +2 -0
  89. package/dist/astro/native/blob/blob-shapes.generated.js.map +1 -0
  90. package/dist/astro/native/blob/blob-shapes.generated.ts +1 -0
  91. package/dist/astro/native/blob/config.d.ts +49 -0
  92. package/dist/astro/native/blob/config.d.ts.map +1 -0
  93. package/dist/astro/native/blob/config.js +86 -0
  94. package/dist/astro/native/blob/config.js.map +1 -0
  95. package/dist/astro/native/blob/config.ts +132 -0
  96. package/dist/astro/native/blob/controller.d.ts +11 -0
  97. package/dist/astro/native/blob/controller.d.ts.map +1 -0
  98. package/dist/astro/native/blob/controller.js +240 -0
  99. package/dist/astro/native/blob/controller.js.map +1 -0
  100. package/dist/astro/native/blob/controller.ts +248 -0
  101. package/dist/astro/native/blob/geometry.d.ts +2 -0
  102. package/dist/astro/native/blob/geometry.d.ts.map +1 -0
  103. package/dist/astro/native/blob/geometry.js +2 -0
  104. package/dist/astro/native/blob/geometry.js.map +1 -0
  105. package/dist/astro/native/blob/geometry.ts +1 -0
  106. package/dist/astro/native/blob/ids.d.ts +7 -0
  107. package/dist/astro/native/blob/ids.d.ts.map +1 -0
  108. package/dist/astro/native/blob/ids.js +11 -0
  109. package/dist/astro/native/blob/ids.js.map +1 -0
  110. package/dist/astro/native/blob/ids.ts +11 -0
  111. package/dist/astro/native/blob.css +83 -0
  112. package/dist/astro/native/block-sizing.css +34 -0
  113. package/dist/astro/native/button-template.d.ts +31 -0
  114. package/dist/astro/native/button-template.d.ts.map +1 -0
  115. package/dist/astro/native/button-template.js +54 -0
  116. package/dist/astro/native/button-template.js.map +1 -0
  117. package/dist/astro/native/button-template.ts +92 -0
  118. package/dist/astro/native/button.d.ts +13 -0
  119. package/dist/astro/native/button.d.ts.map +1 -0
  120. package/dist/astro/native/button.js +26 -0
  121. package/dist/astro/native/button.js.map +1 -0
  122. package/dist/astro/native/button.ts +26 -0
  123. package/dist/astro/native/carousel.css +323 -0
  124. package/dist/astro/native/core-accordion-heading.astro +23 -0
  125. package/dist/astro/native/core-accordion-item.astro +8 -0
  126. package/dist/astro/native/core-accordion-panel.astro +8 -0
  127. package/dist/astro/native/core-accordion.astro +8 -0
  128. package/dist/astro/native/core-block.astro +18 -0
  129. package/dist/astro/native/core-button-fallback.astro +43 -0
  130. package/dist/astro/native/core-button.astro +65 -0
  131. package/dist/astro/native/core-buttons.astro +14 -0
  132. package/dist/astro/native/core-group.astro +25 -0
  133. package/dist/astro/native/core-home-link.astro +12 -0
  134. package/dist/astro/native/core-html.astro +8 -0
  135. package/dist/astro/native/core-icon.astro +7 -0
  136. package/dist/astro/native/core-image.astro +136 -0
  137. package/dist/astro/native/core-navigation-link.astro +71 -0
  138. package/dist/astro/native/core-navigation-submenu.astro +33 -0
  139. package/dist/astro/native/core-navigation.astro +101 -0
  140. package/dist/astro/native/core-page-list-data-item.astro +19 -0
  141. package/dist/astro/native/core-page-list-item.astro +8 -0
  142. package/dist/astro/native/core-page-list.astro +40 -0
  143. package/dist/astro/native/core-post-date.astro +21 -0
  144. package/dist/astro/native/core-post-excerpt.astro +26 -0
  145. package/dist/astro/native/core-post-featured-image.astro +40 -0
  146. package/dist/astro/native/core-post-template-fallback.astro +30 -0
  147. package/dist/astro/native/core-post-template.astro +23 -0
  148. package/dist/astro/native/core-post-terms.astro +47 -0
  149. package/dist/astro/native/core-post-title.astro +23 -0
  150. package/dist/astro/native/core-query-no-results.astro +12 -0
  151. package/dist/astro/native/core-query.astro +22 -0
  152. package/dist/astro/native/core-separator.astro +18 -0
  153. package/dist/astro/native/core-site-title.astro +16 -0
  154. package/dist/astro/native/core-term-description.astro +12 -0
  155. package/dist/astro/native/core-term-name.astro +21 -0
  156. package/dist/astro/native/core-term-template.astro +30 -0
  157. package/dist/astro/native/core-terms-query.astro +19 -0
  158. package/dist/astro/native/core-transparent.astro +11 -0
  159. package/dist/astro/native/flowpress-navigation-controller.d.ts +2 -0
  160. package/dist/astro/native/flowpress-navigation-controller.d.ts.map +1 -0
  161. package/dist/astro/native/flowpress-navigation-controller.js +217 -0
  162. package/dist/astro/native/flowpress-navigation-controller.js.map +1 -0
  163. package/dist/astro/native/flowpress-navigation-controller.ts +215 -0
  164. package/dist/astro/native/flowpress-navigation.css +18 -0
  165. package/dist/astro/native/grid-bleed.d.ts +2 -0
  166. package/dist/astro/native/grid-bleed.d.ts.map +1 -0
  167. package/dist/astro/native/grid-bleed.js +123 -0
  168. package/dist/astro/native/grid-bleed.js.map +1 -0
  169. package/dist/astro/native/grid.css +180 -0
  170. package/dist/astro/native/grid.d.ts +17 -0
  171. package/dist/astro/native/grid.d.ts.map +1 -0
  172. package/dist/astro/native/grid.js +108 -0
  173. package/dist/astro/native/grid.js.map +1 -0
  174. package/dist/astro/native/grid.ts +132 -0
  175. package/dist/astro/native/group.css +36 -0
  176. package/dist/astro/native/group.d.ts +15 -0
  177. package/dist/astro/native/group.d.ts.map +1 -0
  178. package/dist/astro/native/group.js +66 -0
  179. package/dist/astro/native/group.js.map +1 -0
  180. package/dist/astro/native/group.ts +61 -0
  181. package/dist/astro/native/html.d.ts +6 -0
  182. package/dist/astro/native/html.d.ts.map +1 -0
  183. package/dist/astro/native/html.js +10 -0
  184. package/dist/astro/native/html.js.map +1 -0
  185. package/dist/astro/native/html.ts +9 -0
  186. package/dist/astro/native/icon.d.ts +3 -0
  187. package/dist/astro/native/icon.d.ts.map +1 -0
  188. package/dist/astro/native/icon.js +23 -0
  189. package/dist/astro/native/icon.js.map +1 -0
  190. package/dist/astro/native/icon.ts +21 -0
  191. package/dist/astro/native/image.d.ts +5 -0
  192. package/dist/astro/native/image.d.ts.map +1 -0
  193. package/dist/astro/native/image.js +65 -0
  194. package/dist/astro/native/image.js.map +1 -0
  195. package/dist/astro/native/image.ts +56 -0
  196. package/dist/astro/native/inline-text.css +15 -0
  197. package/dist/astro/native/map.d.ts +14 -0
  198. package/dist/astro/native/map.d.ts.map +1 -0
  199. package/dist/astro/native/map.js +60 -0
  200. package/dist/astro/native/map.js.map +1 -0
  201. package/dist/astro/native/map.ts +70 -0
  202. package/dist/astro/native/motion-preference.d.ts +50 -0
  203. package/dist/astro/native/motion-preference.d.ts.map +1 -0
  204. package/dist/astro/native/motion-preference.js +132 -0
  205. package/dist/astro/native/motion-preference.js.map +1 -0
  206. package/dist/astro/native/motion-preference.ts +158 -0
  207. package/dist/astro/native/motion.d.ts +101 -0
  208. package/dist/astro/native/motion.d.ts.map +1 -0
  209. package/dist/astro/native/motion.js +168 -0
  210. package/dist/astro/native/motion.js.map +1 -0
  211. package/dist/astro/native/motion.ts +312 -0
  212. package/dist/astro/native/query-carousel.d.ts +13 -0
  213. package/dist/astro/native/query-carousel.d.ts.map +1 -0
  214. package/dist/astro/native/query-carousel.js +36 -0
  215. package/dist/astro/native/query-carousel.js.map +1 -0
  216. package/dist/astro/native/query-carousel.ts +60 -0
  217. package/dist/astro/native/query-loop.d.ts +38 -0
  218. package/dist/astro/native/query-loop.d.ts.map +1 -0
  219. package/dist/astro/native/query-loop.js +20 -0
  220. package/dist/astro/native/query-loop.js.map +1 -0
  221. package/dist/astro/native/query-loop.ts +67 -0
  222. package/dist/astro/native/registry.d.ts +3 -0
  223. package/dist/astro/native/registry.d.ts.map +1 -0
  224. package/dist/astro/native/registry.js +91 -0
  225. package/dist/astro/native/registry.js.map +1 -0
  226. package/dist/astro/native/registry.ts +93 -0
  227. package/dist/astro/native/sf-block-binding.astro +20 -0
  228. package/dist/astro/native/sf-post-field.astro +9 -0
  229. package/dist/astro/native/sf-slot.astro +6 -0
  230. package/dist/astro/native/sf-term-field.astro +9 -0
  231. package/dist/astro/native/timeline.css +4 -0
  232. package/dist/astro/native/timeline.d.ts +28 -0
  233. package/dist/astro/native/timeline.d.ts.map +1 -0
  234. package/dist/astro/native/timeline.js +43 -0
  235. package/dist/astro/native/timeline.js.map +1 -0
  236. package/dist/astro/native/timeline.ts +79 -0
  237. package/dist/astro/preferences/AccessibilityPanel.astro +105 -0
  238. package/dist/astro/preferences/ColorModeToggle.astro +26 -0
  239. package/dist/astro/preferences/MotionToggle.astro +27 -0
  240. package/dist/astro/preferences/PreferencesRuntime.astro +9 -0
  241. package/dist/astro/preferences/ThemeToggle.astro +30 -0
  242. package/dist/astro/preferences/Toggle.astro +50 -0
  243. package/dist/astro/preferences/preferences.css +125 -0
  244. package/dist/block-renderers.d.ts +23 -3
  245. package/dist/block-renderers.d.ts.map +1 -1
  246. package/dist/block-renderers.js.map +1 -1
  247. package/dist/build-cache.d.ts +8 -0
  248. package/dist/build-cache.d.ts.map +1 -0
  249. package/dist/build-cache.js +82 -0
  250. package/dist/build-cache.js.map +1 -0
  251. package/dist/carousel.d.ts +56 -6
  252. package/dist/carousel.d.ts.map +1 -1
  253. package/dist/carousel.js +183 -27
  254. package/dist/carousel.js.map +1 -1
  255. package/dist/client.d.ts +34 -2
  256. package/dist/client.d.ts.map +1 -1
  257. package/dist/client.js +124 -42
  258. package/dist/client.js.map +1 -1
  259. package/dist/composition.d.ts +14 -0
  260. package/dist/composition.d.ts.map +1 -0
  261. package/dist/composition.js +125 -0
  262. package/dist/composition.js.map +1 -0
  263. package/dist/default-blocks.d.ts +9 -0
  264. package/dist/default-blocks.d.ts.map +1 -0
  265. package/dist/default-blocks.js +122 -0
  266. package/dist/default-blocks.js.map +1 -0
  267. package/dist/env.d.ts +21 -0
  268. package/dist/env.d.ts.map +1 -1
  269. package/dist/env.js +53 -0
  270. package/dist/env.js.map +1 -1
  271. package/dist/index.d.ts +7 -0
  272. package/dist/index.d.ts.map +1 -1
  273. package/dist/index.js +6 -0
  274. package/dist/index.js.map +1 -1
  275. package/dist/media.d.ts +20 -0
  276. package/dist/media.d.ts.map +1 -0
  277. package/dist/media.js +106 -0
  278. package/dist/media.js.map +1 -0
  279. package/dist/motion-preference.d.ts +50 -0
  280. package/dist/motion-preference.d.ts.map +1 -0
  281. package/dist/motion-preference.js +132 -0
  282. package/dist/motion-preference.js.map +1 -0
  283. package/dist/preferences-runtime.d.ts +3 -0
  284. package/dist/preferences-runtime.d.ts.map +1 -0
  285. package/dist/preferences-runtime.js +23 -0
  286. package/dist/preferences-runtime.js.map +1 -0
  287. package/dist/preferences-styleflow.d.ts +3 -0
  288. package/dist/preferences-styleflow.d.ts.map +1 -0
  289. package/dist/preferences-styleflow.js +14 -0
  290. package/dist/preferences-styleflow.js.map +1 -0
  291. package/dist/preferences.d.ts +4 -0
  292. package/dist/preferences.d.ts.map +1 -0
  293. package/dist/preferences.js +4 -0
  294. package/dist/preferences.js.map +1 -0
  295. package/dist/reserved-area.d.ts +10 -0
  296. package/dist/reserved-area.d.ts.map +1 -0
  297. package/dist/reserved-area.js +93 -0
  298. package/dist/reserved-area.js.map +1 -0
  299. package/dist/styleflow.d.ts +18 -1
  300. package/dist/styleflow.d.ts.map +1 -1
  301. package/dist/styleflow.js +82 -11
  302. package/dist/styleflow.js.map +1 -1
  303. package/dist/svg-media-runtime.d.ts +3 -0
  304. package/dist/svg-media-runtime.d.ts.map +1 -0
  305. package/dist/svg-media-runtime.js +33 -0
  306. package/dist/svg-media-runtime.js.map +1 -0
  307. package/dist/svg-media-types.d.ts +11 -0
  308. package/dist/svg-media-types.d.ts.map +1 -0
  309. package/dist/svg-media-types.js +2 -0
  310. package/dist/svg-media-types.js.map +1 -0
  311. package/dist/svg-media.d.ts +13 -0
  312. package/dist/svg-media.d.ts.map +1 -0
  313. package/dist/svg-media.js +47 -0
  314. package/dist/svg-media.js.map +1 -0
  315. package/dist/template-hierarchy.d.ts +0 -7
  316. package/dist/template-hierarchy.d.ts.map +1 -1
  317. package/dist/template-hierarchy.js +0 -21
  318. package/dist/template-hierarchy.js.map +1 -1
  319. package/dist/text.d.ts +3 -0
  320. package/dist/text.d.ts.map +1 -0
  321. package/dist/text.js +6 -0
  322. package/dist/text.js.map +1 -0
  323. package/dist/theme-runtime.d.ts +16 -0
  324. package/dist/theme-runtime.d.ts.map +1 -0
  325. package/dist/theme-runtime.js +100 -0
  326. package/dist/theme-runtime.js.map +1 -0
  327. package/dist/tsconfig.tsbuildinfo +1 -1
  328. package/dist/types.d.ts +75 -1
  329. package/dist/types.d.ts.map +1 -1
  330. package/dist/types.js.map +1 -1
  331. package/dist/vivid-colors-preference.d.ts +31 -0
  332. package/dist/vivid-colors-preference.d.ts.map +1 -0
  333. package/dist/vivid-colors-preference.js +102 -0
  334. package/dist/vivid-colors-preference.js.map +1 -0
  335. package/package.json +58 -7
  336. package/dist/astro/DefaultTemplate.astro +0 -42
  337. package/dist/templates.d.ts +0 -19
  338. package/dist/templates.d.ts.map +0 -1
  339. package/dist/templates.js +0 -20
  340. package/dist/templates.js.map +0 -1
@@ -1,14 +1,33 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
2
+ import "./native/inline-text.css";
3
+ import { decorateAccordionBlocks, accordionRenderPrefix } from "./native/accordion.js";
4
+ import { registerFlowpressRenderSvgMedia, type FlowpressSvgMediaLocals } from "../svg-media.js";
5
+ import Media from "./Media.astro";
6
+ import { decodeFlowpressText } from "../text.js";
7
+ import "./native/grid.css";
8
+ import "./native/group.css";
9
+ import StyleflowElement from "./StyleflowElement.astro";
3
10
  import type {
11
+ FlowpressBlockAdapters,
4
12
  FlowpressBlockRenderers,
5
13
  FlowpressIconRenderer
6
14
  } from "../block-renderers.js";
15
+ import {
16
+ flowpressAdapterCompatibilityIssue,
17
+ flowpressBlockTypeDescriptors
18
+ } from "../composition.js";
7
19
  import type { StyleflowContract } from "../styleflow.js";
8
- import type { FlowpressBlock } from "../types.js";
20
+ import type {
21
+ FlowpressBlock,
22
+ FlowpressBlockHtmlProps,
23
+ FlowpressCompositionV1,
24
+ FlowpressBlockTypeDescriptor
25
+ } from "../types.js";
26
+ import type { DynamicStyleflowProps } from "../styleflow.js";
9
27
  import ColumnBlock from "./blocks/ColumnBlock.astro";
10
28
  import CarouselBlock from "./blocks/CarouselBlock.astro";
11
29
  import CarouselItemBlock from "./blocks/CarouselItemBlock.astro";
30
+ import CoverBlock from "./blocks/CoverBlock.astro";
12
31
  import FormBlock from "./blocks/FormBlock.astro";
13
32
  import GridBlock from "./blocks/GridBlock.astro";
14
33
  import HeroBlock from "./blocks/HeroBlock.astro";
@@ -26,12 +45,51 @@ import {
26
45
 
27
46
  interface Props {
28
47
  blocks: FlowpressBlock[];
29
- contract?: StyleflowContract;
30
- blockRenderers?: FlowpressBlockRenderers;
31
- iconRenderer?: FlowpressIconRenderer;
48
+ descriptorIndex?: ReadonlyMap<string, FlowpressBlockTypeDescriptor> | undefined;
49
+ contract?: StyleflowContract | undefined;
50
+ blockRenderers?: FlowpressBlockRenderers | undefined;
51
+ iconRenderer?: FlowpressIconRenderer | undefined;
52
+ rootHtmlProps?: FlowpressBlockHtmlProps | undefined;
53
+ rootStyleflowProps?: DynamicStyleflowProps | undefined;
54
+ adapterDefinitions?: FlowpressBlockAdapters | undefined;
55
+ composition?: FlowpressCompositionV1 | undefined;
56
+ parentBlockName?: string | undefined;
57
+ production?: boolean | undefined;
58
+ depth?: number | undefined;
59
+ inheritedTone?: string | undefined;
60
+ skipCustomRendererFor?: string | undefined;
61
+ requireRegisteredAdapters?: boolean | undefined;
62
+ interactiveAncestor?: boolean | undefined;
32
63
  }
33
64
 
34
- const { blocks, contract, blockRenderers = {}, iconRenderer: IconRenderer } = Astro.props;
65
+ const {
66
+ blocks: rawBlocks,
67
+ contract,
68
+ blockRenderers = {},
69
+ iconRenderer: IconRenderer,
70
+ rootHtmlProps,
71
+ rootStyleflowProps,
72
+ adapterDefinitions,
73
+ composition,
74
+ parentBlockName,
75
+ production = import.meta.env.PROD,
76
+ depth = 0,
77
+ inheritedTone,
78
+ skipCustomRendererFor,
79
+ interactiveAncestor = false,
80
+ requireRegisteredAdapters = false
81
+ } = Astro.props;
82
+ registerFlowpressRenderSvgMedia(rawBlocks, Astro.locals as FlowpressSvgMediaLocals);
83
+
84
+ const { decorateGridBlocks } = await import("./native/grid.js");
85
+ const blocks = decorateAccordionBlocks(decorateGridBlocks(rawBlocks), accordionRenderPrefix(Astro.locals));
86
+ const { nativeBlockRenderers } = await import("./native/registry.js");
87
+ const effectiveRenderers = { ...nativeBlockRenderers, ...blockRenderers };
88
+ const descriptors = Astro.props.descriptorIndex ?? (composition ? flowpressBlockTypeDescriptors(composition) : undefined);
89
+
90
+ function objectCollection(value: unknown): Record<string, unknown>[] {
91
+ return Array.isArray(value) ? value.filter((item): item is Record<string, unknown> => !!item && typeof item === "object") : [];
92
+ }
35
93
 
36
94
  function youtubeEmbedUrl(value: unknown): string | null {
37
95
  try {
@@ -49,36 +107,115 @@ function youtubeEmbedUrl(value: unknown): string | null {
49
107
  return null;
50
108
  }
51
109
  }
110
+
111
+ function nestedRendererProps(nextParentBlockName: string, attrs: Record<string, unknown> = {}) {
112
+ return {
113
+ interactiveAncestor: interactiveAncestor || Boolean(attrs.interactivePriority && !["none", "inherit"].includes(String(attrs.interactivePriority))),
114
+ inheritedTone: typeof attrs.tone === "string" && attrs.tone !== "inherit" ? attrs.tone : inheritedTone,
115
+ adapterDefinitions,
116
+ composition,
117
+ parentBlockName: nextParentBlockName,
118
+ production,
119
+ depth: depth + 1,
120
+ requireRegisteredAdapters
121
+ };
122
+ }
52
123
  ---
53
124
 
54
- {blocks.map((block) => {
125
+ {blocks.map((block, index) => {
55
126
  const name = block.name.replace(/^sf\//, "");
56
- const children = block.innerBlocks ?? [];
57
- const genericSemantic = () => semanticProps(block.attributes, contract);
58
- const htmlAttributes = blockHtmlAttributes(block.attributes);
59
- const CustomBlockRenderer = blockRenderers[block.name];
127
+ const isSlot = block.name === "sf/slot";
128
+ const children = decorateGridBlocks(block.innerBlocks ?? []);
129
+ if (interactiveAncestor && /^(?:core|sf)\/(?:paragraph|heading)$/.test(block.name) && !block.attributes.foreground) block = {...block, attributes:{...block.attributes, foreground:"inherit"}};
130
+ const semantic = isSlot ? {} : index === 0 && blocks.length === 1 && rootStyleflowProps
131
+ ? rootStyleflowProps
132
+ : semanticProps(block.attributes, contract,
133
+ block.name.startsWith("core/") && block.name !== "core/group" ? {} : undefined,
134
+ inheritedTone);
135
+ const htmlAttributes = isSlot ? {} : index === 0 && blocks.length === 1 && rootHtmlProps
136
+ ? { ...rootHtmlProps, class: Array.from(new Set([rootHtmlProps.class, block.attributes.className].filter(Boolean).join(" ").split(/\s+/))).join(" ") }
137
+ : blockHtmlAttributes(block.attributes);
138
+ const CustomBlockRenderer = block.name === skipCustomRendererFor
139
+ ? nativeBlockRenderers[block.name as keyof typeof nativeBlockRenderers]
140
+ : effectiveRenderers[block.name as keyof typeof effectiveRenderers];
141
+ const compatibilityIssue = descriptors && adapterDefinitions
142
+ ? flowpressAdapterCompatibilityIssue(block.name, descriptors, adapterDefinitions)
143
+ : null;
144
+
145
+ if (compatibilityIssue && production && block.name !== skipCustomRendererFor) {
146
+ throw new Error(compatibilityIssue.message);
147
+ }
148
+
149
+ if (
150
+ requireRegisteredAdapters
151
+ && block.name !== skipCustomRendererFor
152
+ && (!adapterDefinitions?.[block.name] || !CustomBlockRenderer)
153
+ ) {
154
+ const message = compatibilityIssue?.message
155
+ ?? `Missing FlowPress block adapter for "${block.name}".`;
156
+ if (production) throw new Error(message);
157
+ return (
158
+ <aside data-flowpress-compatibility="missing-adapter" data-block-name={block.name} role="status">
159
+ <strong>{message}</strong>
160
+ <code>{compatibilityIssue?.command ?? `pnpm cms:block-adapter ${block.name}`}</code>
161
+ </aside>
162
+ );
163
+ }
60
164
 
61
165
  if (CustomBlockRenderer) {
62
166
  return (
63
- <CustomBlockRenderer block={block} contract={contract}>
64
- <Astro.self
167
+ <>
168
+ {compatibilityIssue ? (
169
+ <aside data-flowpress-compatibility={compatibilityIssue.code} data-block-name={block.name} role="status">
170
+ <strong>{compatibilityIssue.message}</strong>
171
+ <code>{compatibilityIssue.command}</code>
172
+ </aside>
173
+ ) : null}
174
+ <CustomBlockRenderer
175
+ block={block}
176
+ contract={contract}
177
+ composition={composition}
178
+ adapters={adapterDefinitions ?? {}}
179
+ htmlProps={Object.fromEntries(Object.entries(htmlAttributes).filter((entry): entry is [string, string | number | boolean | undefined] => ["string", "number", "boolean", "undefined"].includes(typeof entry[1])))}
180
+ styleflowProps={semantic}
181
+ parentBlockName={parentBlockName}
182
+ context={{
183
+ ...(parentBlockName ? { parentBlockName } : {}),
184
+ depth,
185
+ production,
186
+ blockRenderers,
187
+ inheritedTone,
188
+ effectiveTone: typeof semantic.tone === "string" ? semantic.tone : inheritedTone
189
+ }}
190
+ >
191
+ <Astro.self descriptorIndex={descriptors}
65
192
  blocks={children}
66
193
  contract={contract}
67
194
  blockRenderers={blockRenderers}
68
195
  iconRenderer={IconRenderer}
196
+ adapterDefinitions={adapterDefinitions}
197
+ composition={composition}
198
+ parentBlockName={isSlot ? parentBlockName : block.name}
199
+ production={production}
200
+ depth={depth + 1}
201
+ inheritedTone={typeof semantic.tone === "string" ? semantic.tone : inheritedTone}
202
+ interactiveAncestor={interactiveAncestor || (!isSlot && Boolean(block.attributes.interactivePriority && !["none", "inherit"].includes(String(block.attributes.interactivePriority))))}
203
+ requireRegisteredAdapters={requireRegisteredAdapters}
69
204
  />
70
205
  </CustomBlockRenderer>
206
+ </>
71
207
  );
72
208
  }
73
209
 
74
210
  if (name === "hero") {
75
211
  return (
76
212
  <HeroBlock block={block} contract={contract}>
77
- <Astro.self
213
+ <Astro.self descriptorIndex={descriptors}
78
214
  blocks={children}
79
215
  contract={contract}
80
216
  blockRenderers={blockRenderers}
81
217
  iconRenderer={IconRenderer}
218
+ {...nestedRendererProps(block.name, block.attributes)}
82
219
  />
83
220
  </HeroBlock>
84
221
  );
@@ -87,11 +224,12 @@ function youtubeEmbedUrl(value: unknown): string | null {
87
224
  if (name === "grid") {
88
225
  return (
89
226
  <GridBlock block={block} contract={contract}>
90
- <Astro.self
227
+ <Astro.self descriptorIndex={descriptors}
91
228
  blocks={children}
92
229
  contract={contract}
93
230
  blockRenderers={blockRenderers}
94
231
  iconRenderer={IconRenderer}
232
+ {...nestedRendererProps(block.name, block.attributes)}
95
233
  />
96
234
  </GridBlock>
97
235
  );
@@ -100,11 +238,12 @@ function youtubeEmbedUrl(value: unknown): string | null {
100
238
  if (name === "column") {
101
239
  return (
102
240
  <ColumnBlock block={block} contract={contract}>
103
- <Astro.self
241
+ <Astro.self descriptorIndex={descriptors}
104
242
  blocks={children}
105
243
  contract={contract}
106
244
  blockRenderers={blockRenderers}
107
245
  iconRenderer={IconRenderer}
246
+ {...nestedRendererProps(block.name, block.attributes)}
108
247
  />
109
248
  </ColumnBlock>
110
249
  );
@@ -121,11 +260,12 @@ function youtubeEmbedUrl(value: unknown): string | null {
121
260
  validChildren={invalidChildNames.length === 0}
122
261
  invalidChildNames={invalidChildNames}
123
262
  >
124
- <Astro.self
263
+ <Astro.self descriptorIndex={descriptors}
125
264
  blocks={children}
126
265
  contract={contract}
127
266
  blockRenderers={blockRenderers}
128
267
  iconRenderer={IconRenderer}
268
+ {...nestedRendererProps(block.name, block.attributes)}
129
269
  />
130
270
  </CarouselBlock>
131
271
  );
@@ -134,11 +274,12 @@ function youtubeEmbedUrl(value: unknown): string | null {
134
274
  if (name === "carousel-item") {
135
275
  return (
136
276
  <CarouselItemBlock block={block} contract={contract}>
137
- <Astro.self
277
+ <Astro.self descriptorIndex={descriptors}
138
278
  blocks={children}
139
279
  contract={contract}
140
280
  blockRenderers={blockRenderers}
141
281
  iconRenderer={IconRenderer}
282
+ {...nestedRendererProps(block.name, block.attributes)}
142
283
  />
143
284
  </CarouselItemBlock>
144
285
  );
@@ -148,6 +289,25 @@ function youtubeEmbedUrl(value: unknown): string | null {
148
289
  return <NumberSpinnerBlock block={block} contract={contract} />;
149
290
  }
150
291
 
292
+ if (block.name === "core/cover") {
293
+ return (
294
+ <CoverBlock
295
+ block={block}
296
+ contract={contract}
297
+ htmlProps={Object.fromEntries(Object.entries(htmlAttributes).filter((entry): entry is [string, string | number | boolean | undefined] => ["string", "number", "boolean", "undefined"].includes(typeof entry[1])))}
298
+ styleflowProps={semantic}
299
+ >
300
+ <Astro.self descriptorIndex={descriptors}
301
+ blocks={children}
302
+ contract={contract}
303
+ blockRenderers={blockRenderers}
304
+ iconRenderer={IconRenderer}
305
+ {...nestedRendererProps(block.name, block.attributes)}
306
+ />
307
+ </CoverBlock>
308
+ );
309
+ }
310
+
151
311
  if ([
152
312
  "heading",
153
313
  "rich-text",
@@ -160,11 +320,12 @@ function youtubeEmbedUrl(value: unknown): string | null {
160
320
  ].includes(name)) {
161
321
  return (
162
322
  <TextBlock block={block} contract={contract} hasChildren={children.length > 0}>
163
- <Astro.self
323
+ <Astro.self descriptorIndex={descriptors}
164
324
  blocks={children}
165
325
  contract={contract}
166
326
  blockRenderers={blockRenderers}
167
327
  iconRenderer={IconRenderer}
328
+ {...nestedRendererProps(block.name, block.attributes)}
168
329
  />
169
330
  </TextBlock>
170
331
  );
@@ -188,13 +349,12 @@ function youtubeEmbedUrl(value: unknown): string | null {
188
349
  const buttonContent = (
189
350
  <>
190
351
  {iconPosition === "before" ? buttonIcon : null}
191
- {textValue(block, "label")}
352
+ {decodeFlowpressText(textValue(block, "label"))}
192
353
  {iconPosition === "after" ? buttonIcon : null}
193
354
  </>
194
355
  );
195
356
  return href ? (
196
- <S
197
- as="a"
357
+ <StyleflowElement as="a"
198
358
  href={href}
199
359
  target={opensInNewTab ? "_blank" : undefined}
200
360
  rel={opensInNewTab ? "noopener noreferrer" : undefined}
@@ -202,17 +362,16 @@ function youtubeEmbedUrl(value: unknown): string | null {
202
362
  {...htmlAttributes}
203
363
  >
204
364
  {buttonContent}
205
- </S>
365
+ </StyleflowElement>
206
366
  ) : (
207
- <S
208
- as="span"
367
+ <StyleflowElement as="span"
209
368
  aria-disabled="true"
210
369
  data-flowpress-link-unresolved
211
370
  {...buttonSemantic}
212
371
  {...htmlAttributes}
213
372
  >
214
373
  {buttonContent}
215
- </S>
374
+ </StyleflowElement>
216
375
  );
217
376
  }
218
377
 
@@ -233,7 +392,7 @@ function youtubeEmbedUrl(value: unknown): string | null {
233
392
  name={icon}
234
393
  display={display}
235
394
  size={size}
236
- label={String(block.attributes.label ?? "").trim() || undefined}
395
+ label={decodeFlowpressText(block.attributes.label).trim() || undefined}
237
396
  {...iconSemantic}
238
397
  {...htmlAttributes}
239
398
  />
@@ -256,19 +415,16 @@ function youtubeEmbedUrl(value: unknown): string | null {
256
415
 
257
416
  if (name === "gallery") {
258
417
  const images = Array.isArray(block.attributes.images)
259
- ? block.attributes.images as Array<Record<string, unknown>>
418
+ ? objectCollection(block.attributes.images)
260
419
  : [];
261
420
  return (
262
- <S as="div" {...genericSemantic()} {...htmlAttributes}>
421
+ <StyleflowElement as="div" {...semantic} {...htmlAttributes}>
263
422
  {images.map((image) => image.url ? (
264
- <img
265
- src={String(image.url)}
266
- alt={String(image.alt ?? "")}
267
- loading="lazy"
268
- decoding="async"
269
- />
423
+ <ImageBlock block={{ name: "sf/image", attributes: {
424
+ image, alt: decodeFlowpressText(image.alt), loading: "lazy", decoding: "async",
425
+ } }} contract={contract} />
270
426
  ) : null)}
271
- </S>
427
+ </StyleflowElement>
272
428
  );
273
429
  }
274
430
 
@@ -276,7 +432,7 @@ function youtubeEmbedUrl(value: unknown): string | null {
276
432
  const video = objectValue(block, "video");
277
433
  const poster = objectValue(block, "poster");
278
434
  return video.url ? (
279
- <S as="div" {...genericSemantic()} {...htmlAttributes}>
435
+ <StyleflowElement as="div" {...semantic} {...htmlAttributes}>
280
436
  <video
281
437
  src={String(video.url)}
282
438
  poster={poster.url ? String(poster.url) : undefined}
@@ -285,30 +441,43 @@ function youtubeEmbedUrl(value: unknown): string | null {
285
441
  muted={Boolean(block.attributes.autoplay)}
286
442
  playsinline
287
443
  />
288
- </S>
444
+ </StyleflowElement>
289
445
  ) : null;
290
446
  }
291
447
 
292
448
  if (name === "video-youtube") {
293
449
  const embed = youtubeEmbedUrl(block.attributes.url);
294
450
  return embed ? (
295
- <S as="div" {...genericSemantic()} {...htmlAttributes}>
451
+ <StyleflowElement as="div" {...semantic} {...htmlAttributes}>
296
452
  <iframe
297
453
  src={embed}
298
- title={String(block.attributes.title ?? "YouTube video")}
454
+ title={decodeFlowpressText(block.attributes.title ?? "YouTube video")}
299
455
  loading="lazy"
300
456
  allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
301
457
  allowfullscreen
302
458
  />
303
- </S>
459
+ </StyleflowElement>
304
460
  ) : null;
305
461
  }
306
462
 
463
+ if (name === "media-text") {
464
+ const media = objectValue(block, "media");
465
+ const mediaNode = media.url ? <Media src={String(media.url)} alt={decodeFlowpressText(media.alt)} width={media.width} height={media.height} loading="lazy" /> : null;
466
+ const contentNode = <StyleflowElement as="div">
467
+ <Astro.self descriptorIndex={descriptors} blocks={children} contract={contract} blockRenderers={blockRenderers} iconRenderer={IconRenderer} {...nestedRendererProps(block.name, block.attributes)} />
468
+ </StyleflowElement>;
469
+ return (
470
+ <StyleflowElement as="div" {...semantic} {...htmlAttributes} data-flowpress-media-text>
471
+ {block.attributes.mediaPosition === "right" ? [contentNode, mediaNode] : [mediaNode, contentNode]}
472
+ </StyleflowElement>
473
+ );
474
+ }
475
+
307
476
  if (name === "chip") {
308
477
  return (
309
- <S as="span" {...genericSemantic()} {...htmlAttributes}>
310
- {textValue(block, "label")}
311
- </S>
478
+ <StyleflowElement as="span" {...semantic} {...htmlAttributes}>
479
+ {decodeFlowpressText(textValue(block, "label"))}
480
+ </StyleflowElement>
312
481
  );
313
482
  }
314
483
 
@@ -316,60 +485,63 @@ function youtubeEmbedUrl(value: unknown): string | null {
316
485
  const media = objectValue(block, "image");
317
486
  const href = linkValue(block);
318
487
  return (
319
- <S as="article" {...genericSemantic()} {...htmlAttributes}>
488
+ <StyleflowElement as="article" {...semantic} {...htmlAttributes}>
320
489
  {media.url && (
321
- <img src={String(media.url)} alt={String(media.alt ?? "")} loading="lazy" />
490
+ <Media src={String(media.url)} alt={decodeFlowpressText(media.alt)} loading="lazy" />
322
491
  )}
323
- {block.attributes.title && <S as="h3">{String(block.attributes.title)}</S>}
324
- {block.attributes.text && <S as="p">{String(block.attributes.text)}</S>}
325
- {href && <S as="a" href={href}>Scopri</S>}
326
- </S>
492
+ {block.attributes.title && <StyleflowElement as="h3">{decodeFlowpressText(block.attributes.title)}</StyleflowElement>}
493
+ {block.attributes.text && <StyleflowElement as="p">{decodeFlowpressText(block.attributes.text)}</StyleflowElement>}
494
+ {href && <StyleflowElement as="a" href={href}>Scopri</StyleflowElement>}
495
+ </StyleflowElement>
327
496
  );
328
497
  }
329
498
 
330
499
  if (name === "content-list" || name === "term-list") {
331
500
  const items = Array.isArray(block.attributes.resolvedItems)
332
- ? block.attributes.resolvedItems as Array<Record<string, unknown>>
501
+ ? objectCollection(block.attributes.resolvedItems)
333
502
  : [];
334
503
  const resolvedBlocks = Array.isArray(block.attributes.resolvedBlocks)
335
504
  ? block.attributes.resolvedBlocks as FlowpressBlock[][]
336
505
  : [];
337
506
  return (
338
- <S as="ul" {...genericSemantic()} {...htmlAttributes}>
507
+ <StyleflowElement as="ul" {...semantic} {...htmlAttributes}>
339
508
  {items.map((item, index) => (
340
- <S as="li">
509
+ <StyleflowElement as="li">
341
510
  {resolvedBlocks[index]?.length ? (
342
- <Astro.self
511
+ <Astro.self descriptorIndex={descriptors}
343
512
  blocks={resolvedBlocks[index]}
344
513
  contract={contract}
345
514
  blockRenderers={blockRenderers}
346
515
  iconRenderer={IconRenderer}
516
+ {...nestedRendererProps(block.name, block.attributes)}
347
517
  />
348
518
  ) : (
349
519
  <ListItemFallback item={item} />
350
520
  )}
351
- </S>
521
+ </StyleflowElement>
352
522
  ))}
353
- </S>
523
+ </StyleflowElement>
354
524
  );
355
525
  }
356
526
 
357
527
  if (name === "template") {
358
528
  return Object.keys(htmlAttributes).length > 0 ? (
359
529
  <div {...htmlAttributes}>
360
- <Astro.self
530
+ <Astro.self descriptorIndex={descriptors}
361
531
  blocks={children}
362
532
  contract={contract}
363
533
  blockRenderers={blockRenderers}
364
534
  iconRenderer={IconRenderer}
535
+ {...nestedRendererProps(block.name, block.attributes)}
365
536
  />
366
537
  </div>
367
538
  ) : (
368
- <Astro.self
539
+ <Astro.self descriptorIndex={descriptors}
369
540
  blocks={children}
370
541
  contract={contract}
371
542
  blockRenderers={blockRenderers}
372
543
  iconRenderer={IconRenderer}
544
+ {...nestedRendererProps(block.name, block.attributes)}
373
545
  />
374
546
  );
375
547
  }
@@ -380,17 +552,18 @@ function youtubeEmbedUrl(value: unknown): string | null {
380
552
 
381
553
  if (name === "accordion-item") {
382
554
  return (
383
- <S as="div" {...genericSemantic()} {...htmlAttributes}>
555
+ <StyleflowElement as="div" {...semantic} {...htmlAttributes}>
384
556
  <details>
385
- <summary>{String(block.attributes.title ?? "")}</summary>
386
- <Astro.self
557
+ <summary>{decodeFlowpressText(block.attributes.title)}</summary>
558
+ <Astro.self descriptorIndex={descriptors}
387
559
  blocks={children}
388
560
  contract={contract}
389
561
  blockRenderers={blockRenderers}
390
562
  iconRenderer={IconRenderer}
563
+ {...nestedRendererProps(block.name, block.attributes)}
391
564
  />
392
565
  </details>
393
- </S>
566
+ </StyleflowElement>
394
567
  );
395
568
  }
396
569
 
@@ -411,42 +584,55 @@ function youtubeEmbedUrl(value: unknown): string | null {
411
584
  + `?key=${encodeURIComponent(googleMapsApiKey)}`
412
585
  + `&q=${encodeURIComponent(query)}`;
413
586
  return (
414
- <S as="div" {...genericSemantic()} {...htmlAttributes}>
587
+ <StyleflowElement as="div" {...semantic} {...htmlAttributes}>
415
588
  <iframe
416
589
  src={source}
417
590
  title={address || "Map"}
418
591
  loading="lazy"
419
592
  referrerpolicy="no-referrer-when-downgrade"
420
593
  />
421
- </S>
594
+ </StyleflowElement>
422
595
  );
423
596
  }
424
597
  return query ? (
425
- <S as="div" {...genericSemantic()} {...htmlAttributes}>
426
- <S
427
- as="a"
598
+ <StyleflowElement as="div" {...semantic} {...htmlAttributes}>
599
+ <StyleflowElement as="a"
428
600
  href={`https://www.openstreetmap.org/search?query=${encodeURIComponent(query)}`}
429
601
  rel="noreferrer"
430
602
  >
431
- {address || query}
432
- </S>
433
- </S>
603
+ {decodeFlowpressText(address || query)}
604
+ </StyleflowElement>
605
+ </StyleflowElement>
434
606
  ) : null;
435
607
  }
436
608
 
437
- const layoutTag = name === "section" ? "section" : "div";
438
- return (
439
- <S as={layoutTag} {...genericSemantic()} {...htmlAttributes}>
440
- {block.innerHtml && children.length === 0
441
- ? <S as="div" set:html={block.innerHtml} />
442
- : (
443
- <Astro.self
444
- blocks={children}
445
- contract={contract}
446
- blockRenderers={blockRenderers}
447
- iconRenderer={IconRenderer}
448
- />
449
- )}
450
- </S>
609
+ const fallbackContent = block.innerHtml && children.length === 0
610
+ ? <StyleflowElement as="div" set:html={block.innerHtml} />
611
+ : (
612
+ <Astro.self descriptorIndex={descriptors}
613
+ blocks={children}
614
+ contract={contract}
615
+ blockRenderers={blockRenderers}
616
+ iconRenderer={IconRenderer}
617
+ {...nestedRendererProps(block.name, block.attributes)}
618
+ />
619
+ );
620
+ return name === "section" ? (
621
+ <StyleflowElement as="section" {...semantic} {...htmlAttributes} data-flowpress-structural>{fallbackContent}</StyleflowElement>
622
+ ) : (
623
+ <StyleflowElement as="div" {...semantic} {...htmlAttributes} data-flowpress-structural={["group", "flex"].includes(name) || undefined}>{fallbackContent}</StyleflowElement>
451
624
  );
452
625
  })}
626
+
627
+ <script>
628
+ import "./native/grid-bleed.js";
629
+ </script>
630
+
631
+ <style is:global>
632
+ [data-flowpress-media-text] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
633
+ @media (max-width: 40rem) { [data-flowpress-media-text] { grid-template-columns: minmax(0, 1fr); } }
634
+ </style>
635
+
636
+ <style is:global>
637
+ .flowpress-carousel:not(.is-initialized), .sf-carousel:not(.is-initialized), .flowpress-query-carousel:not(.is-initialized) { visibility: visible; }
638
+ </style>
@@ -0,0 +1,27 @@
1
+ ---
2
+ import StyleflowElement from "./StyleflowElement.astro";
3
+ import { resolveStyleFlowAstroPrimitive } from "@styleflow.app/astro";
4
+ import { decodeFlowpressText } from "../text.js";
5
+ import { flowpressSvgMediaProps, type FlowpressSvgMediaLocals } from "../svg-media.js";
6
+ interface Props { src?: unknown; [key: string]: unknown; }
7
+ const props = { ...Astro.props };
8
+ if (typeof props.alt === "string") props.alt = decodeFlowpressText(props.alt);
9
+ if (typeof props["aria-label"] === "string") props["aria-label"] = decodeFlowpressText(props["aria-label"]);
10
+ const svg = flowpressSvgMediaProps(props.src, props, Astro.locals as FlowpressSvgMediaLocals);
11
+ const svgAttributes = svg ? resolveStyleFlowAstroPrimitive({ ...svg.attributes, as: "img" }).attributes : {};
12
+ ---
13
+ {svg ? (
14
+ <svg {...svgAttributes}><Fragment set:html={svg.content} /></svg>
15
+ ) : (
16
+ <StyleflowElement as="img" {...props} />
17
+ )}
18
+ <script>
19
+ import { initializeFlowpressSvgMedia } from "../svg-media-runtime.js";
20
+ initializeFlowpressSvgMedia();
21
+ </script>
22
+ <style is:global>
23
+ @layer base {
24
+ :where(.flowpress-svg-media) { max-inline-size: 100%; block-size: auto; }
25
+ }
26
+ :where(.flowpress-svg-media) { overflow: hidden; vertical-align: middle; }
27
+ </style>
@@ -0,0 +1,25 @@
1
+ ---
2
+ import "./native/block-sizing.css";
3
+ import "./native/inline-text.css";
4
+ import { decodeFlowpressText } from "../text.js";
5
+ import { resolveStyleFlowAstroPrimitive } from "@styleflow.app/astro";
6
+
7
+ interface Props {
8
+ as: string;
9
+ [attribute: string]: unknown;
10
+ }
11
+ const props = { ...Astro.props } as Props;
12
+ for (const key of ["ty", "v", "w"]) {
13
+ if (props[key] === "" || props[key] === null) delete props[key];
14
+ }
15
+ for (const name of ["alt", "title", "aria-label", "placeholder"]) {
16
+ if (typeof props[name] === "string") props[name] = decodeFlowpressText(props[name]);
17
+ }
18
+ const { tag, attributes } = resolveStyleFlowAstroPrimitive(props);
19
+ if (["ty", "v", "w"].every((key) => props[key] === undefined)) {
20
+ for (const name of ["type", "variant", "weight", "style"]) delete attributes[`data-text-${name}`];
21
+ }
22
+ const Element = tag;
23
+ ---
24
+
25
+ <Element {...attributes}><slot /></Element>