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

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 (316) hide show
  1. package/CHANGELOG.md +242 -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 +24 -0
  13. package/dist/astro/StyleflowElement.astro +24 -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 +169 -0
  19. package/dist/astro/blocks/FormBlock.astro +23 -20
  20. package/dist/astro/blocks/GridBlock.astro +6 -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/button-template.d.ts +31 -0
  100. package/dist/astro/native/button-template.d.ts.map +1 -0
  101. package/dist/astro/native/button-template.js +54 -0
  102. package/dist/astro/native/button-template.js.map +1 -0
  103. package/dist/astro/native/button-template.ts +92 -0
  104. package/dist/astro/native/button.d.ts +13 -0
  105. package/dist/astro/native/button.d.ts.map +1 -0
  106. package/dist/astro/native/button.js +26 -0
  107. package/dist/astro/native/button.js.map +1 -0
  108. package/dist/astro/native/button.ts +26 -0
  109. package/dist/astro/native/core-block.astro +18 -0
  110. package/dist/astro/native/core-button-fallback.astro +43 -0
  111. package/dist/astro/native/core-button.astro +65 -0
  112. package/dist/astro/native/core-buttons.astro +14 -0
  113. package/dist/astro/native/core-group.astro +25 -0
  114. package/dist/astro/native/core-home-link.astro +12 -0
  115. package/dist/astro/native/core-html.astro +8 -0
  116. package/dist/astro/native/core-icon.astro +7 -0
  117. package/dist/astro/native/core-image.astro +139 -0
  118. package/dist/astro/native/core-navigation-link.astro +71 -0
  119. package/dist/astro/native/core-navigation-submenu.astro +33 -0
  120. package/dist/astro/native/core-navigation.astro +101 -0
  121. package/dist/astro/native/core-page-list-data-item.astro +19 -0
  122. package/dist/astro/native/core-page-list-item.astro +8 -0
  123. package/dist/astro/native/core-page-list.astro +40 -0
  124. package/dist/astro/native/core-post-date.astro +21 -0
  125. package/dist/astro/native/core-post-excerpt.astro +26 -0
  126. package/dist/astro/native/core-post-featured-image.astro +38 -0
  127. package/dist/astro/native/core-post-template-fallback.astro +30 -0
  128. package/dist/astro/native/core-post-template.astro +23 -0
  129. package/dist/astro/native/core-post-terms.astro +47 -0
  130. package/dist/astro/native/core-post-title.astro +23 -0
  131. package/dist/astro/native/core-query-no-results.astro +12 -0
  132. package/dist/astro/native/core-query.astro +22 -0
  133. package/dist/astro/native/core-separator.astro +20 -0
  134. package/dist/astro/native/core-site-title.astro +16 -0
  135. package/dist/astro/native/core-term-description.astro +12 -0
  136. package/dist/astro/native/core-term-name.astro +21 -0
  137. package/dist/astro/native/core-term-template.astro +30 -0
  138. package/dist/astro/native/core-terms-query.astro +19 -0
  139. package/dist/astro/native/core-transparent.astro +11 -0
  140. package/dist/astro/native/flowpress-navigation-controller.d.ts +2 -0
  141. package/dist/astro/native/flowpress-navigation-controller.d.ts.map +1 -0
  142. package/dist/astro/native/flowpress-navigation-controller.js +217 -0
  143. package/dist/astro/native/flowpress-navigation-controller.js.map +1 -0
  144. package/dist/astro/native/flowpress-navigation-controller.ts +215 -0
  145. package/dist/astro/native/flowpress-navigation.css +17 -0
  146. package/dist/astro/native/grid-bleed.d.ts +2 -0
  147. package/dist/astro/native/grid-bleed.d.ts.map +1 -0
  148. package/dist/astro/native/grid-bleed.js +123 -0
  149. package/dist/astro/native/grid-bleed.js.map +1 -0
  150. package/dist/astro/native/grid.css +180 -0
  151. package/dist/astro/native/grid.d.ts +17 -0
  152. package/dist/astro/native/grid.d.ts.map +1 -0
  153. package/dist/astro/native/grid.js +103 -0
  154. package/dist/astro/native/grid.js.map +1 -0
  155. package/dist/astro/native/grid.ts +118 -0
  156. package/dist/astro/native/group.css +36 -0
  157. package/dist/astro/native/group.d.ts +15 -0
  158. package/dist/astro/native/group.d.ts.map +1 -0
  159. package/dist/astro/native/group.js +66 -0
  160. package/dist/astro/native/group.js.map +1 -0
  161. package/dist/astro/native/group.ts +61 -0
  162. package/dist/astro/native/html.d.ts +6 -0
  163. package/dist/astro/native/html.d.ts.map +1 -0
  164. package/dist/astro/native/html.js +10 -0
  165. package/dist/astro/native/html.js.map +1 -0
  166. package/dist/astro/native/html.ts +9 -0
  167. package/dist/astro/native/icon.d.ts +3 -0
  168. package/dist/astro/native/icon.d.ts.map +1 -0
  169. package/dist/astro/native/icon.js +23 -0
  170. package/dist/astro/native/icon.js.map +1 -0
  171. package/dist/astro/native/icon.ts +21 -0
  172. package/dist/astro/native/image.d.ts +5 -0
  173. package/dist/astro/native/image.d.ts.map +1 -0
  174. package/dist/astro/native/image.js +65 -0
  175. package/dist/astro/native/image.js.map +1 -0
  176. package/dist/astro/native/image.ts +56 -0
  177. package/dist/astro/native/inline-text.css +15 -0
  178. package/dist/astro/native/map.d.ts +14 -0
  179. package/dist/astro/native/map.d.ts.map +1 -0
  180. package/dist/astro/native/map.js +60 -0
  181. package/dist/astro/native/map.js.map +1 -0
  182. package/dist/astro/native/map.ts +70 -0
  183. package/dist/astro/native/motion-preference.d.ts +50 -0
  184. package/dist/astro/native/motion-preference.d.ts.map +1 -0
  185. package/dist/astro/native/motion-preference.js +132 -0
  186. package/dist/astro/native/motion-preference.js.map +1 -0
  187. package/dist/astro/native/motion-preference.ts +158 -0
  188. package/dist/astro/native/motion.d.ts +101 -0
  189. package/dist/astro/native/motion.d.ts.map +1 -0
  190. package/dist/astro/native/motion.js +168 -0
  191. package/dist/astro/native/motion.js.map +1 -0
  192. package/dist/astro/native/motion.ts +312 -0
  193. package/dist/astro/native/query-carousel.d.ts +12 -0
  194. package/dist/astro/native/query-carousel.d.ts.map +1 -0
  195. package/dist/astro/native/query-carousel.js +36 -0
  196. package/dist/astro/native/query-carousel.js.map +1 -0
  197. package/dist/astro/native/query-carousel.ts +56 -0
  198. package/dist/astro/native/query-loop.d.ts +38 -0
  199. package/dist/astro/native/query-loop.d.ts.map +1 -0
  200. package/dist/astro/native/query-loop.js +20 -0
  201. package/dist/astro/native/query-loop.js.map +1 -0
  202. package/dist/astro/native/query-loop.ts +67 -0
  203. package/dist/astro/native/registry.d.ts +3 -0
  204. package/dist/astro/native/registry.d.ts.map +1 -0
  205. package/dist/astro/native/registry.js +81 -0
  206. package/dist/astro/native/registry.js.map +1 -0
  207. package/dist/astro/native/registry.ts +82 -0
  208. package/dist/astro/native/sf-block-binding.astro +20 -0
  209. package/dist/astro/native/sf-post-field.astro +9 -0
  210. package/dist/astro/native/sf-term-field.astro +9 -0
  211. package/dist/astro/native/timeline.css +4 -0
  212. package/dist/astro/native/timeline.d.ts +28 -0
  213. package/dist/astro/native/timeline.d.ts.map +1 -0
  214. package/dist/astro/native/timeline.js +43 -0
  215. package/dist/astro/native/timeline.js.map +1 -0
  216. package/dist/astro/native/timeline.ts +79 -0
  217. package/dist/astro/preferences/AccessibilityPanel.astro +105 -0
  218. package/dist/astro/preferences/ColorModeToggle.astro +26 -0
  219. package/dist/astro/preferences/MotionToggle.astro +27 -0
  220. package/dist/astro/preferences/PreferencesRuntime.astro +9 -0
  221. package/dist/astro/preferences/ThemeToggle.astro +30 -0
  222. package/dist/astro/preferences/Toggle.astro +50 -0
  223. package/dist/astro/preferences/preferences.css +125 -0
  224. package/dist/block-renderers.d.ts +23 -3
  225. package/dist/block-renderers.d.ts.map +1 -1
  226. package/dist/block-renderers.js.map +1 -1
  227. package/dist/build-cache.d.ts +8 -0
  228. package/dist/build-cache.d.ts.map +1 -0
  229. package/dist/build-cache.js +81 -0
  230. package/dist/build-cache.js.map +1 -0
  231. package/dist/client.d.ts +23 -2
  232. package/dist/client.d.ts.map +1 -1
  233. package/dist/client.js +78 -39
  234. package/dist/client.js.map +1 -1
  235. package/dist/composition.d.ts +14 -0
  236. package/dist/composition.d.ts.map +1 -0
  237. package/dist/composition.js +125 -0
  238. package/dist/composition.js.map +1 -0
  239. package/dist/default-blocks.d.ts +9 -0
  240. package/dist/default-blocks.d.ts.map +1 -0
  241. package/dist/default-blocks.js +117 -0
  242. package/dist/default-blocks.js.map +1 -0
  243. package/dist/env.d.ts +9 -0
  244. package/dist/env.d.ts.map +1 -1
  245. package/dist/env.js +20 -0
  246. package/dist/env.js.map +1 -1
  247. package/dist/index.d.ts +7 -0
  248. package/dist/index.d.ts.map +1 -1
  249. package/dist/index.js +6 -0
  250. package/dist/index.js.map +1 -1
  251. package/dist/media.d.ts +20 -0
  252. package/dist/media.d.ts.map +1 -0
  253. package/dist/media.js +106 -0
  254. package/dist/media.js.map +1 -0
  255. package/dist/motion-preference.d.ts +50 -0
  256. package/dist/motion-preference.d.ts.map +1 -0
  257. package/dist/motion-preference.js +132 -0
  258. package/dist/motion-preference.js.map +1 -0
  259. package/dist/preferences-runtime.d.ts +3 -0
  260. package/dist/preferences-runtime.d.ts.map +1 -0
  261. package/dist/preferences-runtime.js +23 -0
  262. package/dist/preferences-runtime.js.map +1 -0
  263. package/dist/preferences-styleflow.d.ts +3 -0
  264. package/dist/preferences-styleflow.d.ts.map +1 -0
  265. package/dist/preferences-styleflow.js +14 -0
  266. package/dist/preferences-styleflow.js.map +1 -0
  267. package/dist/preferences.d.ts +4 -0
  268. package/dist/preferences.d.ts.map +1 -0
  269. package/dist/preferences.js +4 -0
  270. package/dist/preferences.js.map +1 -0
  271. package/dist/reserved-area.d.ts +10 -0
  272. package/dist/reserved-area.d.ts.map +1 -0
  273. package/dist/reserved-area.js +93 -0
  274. package/dist/reserved-area.js.map +1 -0
  275. package/dist/styleflow.d.ts +18 -1
  276. package/dist/styleflow.d.ts.map +1 -1
  277. package/dist/styleflow.js +82 -11
  278. package/dist/styleflow.js.map +1 -1
  279. package/dist/svg-media-runtime.d.ts +3 -0
  280. package/dist/svg-media-runtime.d.ts.map +1 -0
  281. package/dist/svg-media-runtime.js +33 -0
  282. package/dist/svg-media-runtime.js.map +1 -0
  283. package/dist/svg-media-types.d.ts +11 -0
  284. package/dist/svg-media-types.d.ts.map +1 -0
  285. package/dist/svg-media-types.js +2 -0
  286. package/dist/svg-media-types.js.map +1 -0
  287. package/dist/svg-media.d.ts +13 -0
  288. package/dist/svg-media.d.ts.map +1 -0
  289. package/dist/svg-media.js +47 -0
  290. package/dist/svg-media.js.map +1 -0
  291. package/dist/template-hierarchy.d.ts +0 -7
  292. package/dist/template-hierarchy.d.ts.map +1 -1
  293. package/dist/template-hierarchy.js +0 -21
  294. package/dist/template-hierarchy.js.map +1 -1
  295. package/dist/text.d.ts +3 -0
  296. package/dist/text.d.ts.map +1 -0
  297. package/dist/text.js +6 -0
  298. package/dist/text.js.map +1 -0
  299. package/dist/theme-runtime.d.ts +16 -0
  300. package/dist/theme-runtime.d.ts.map +1 -0
  301. package/dist/theme-runtime.js +100 -0
  302. package/dist/theme-runtime.js.map +1 -0
  303. package/dist/tsconfig.tsbuildinfo +1 -1
  304. package/dist/types.d.ts +75 -1
  305. package/dist/types.d.ts.map +1 -1
  306. package/dist/types.js.map +1 -1
  307. package/dist/vivid-colors-preference.d.ts +31 -0
  308. package/dist/vivid-colors-preference.d.ts.map +1 -0
  309. package/dist/vivid-colors-preference.js +102 -0
  310. package/dist/vivid-colors-preference.js.map +1 -0
  311. package/package.json +58 -7
  312. package/dist/astro/DefaultTemplate.astro +0 -42
  313. package/dist/templates.d.ts +0 -19
  314. package/dist/templates.d.ts.map +0 -1
  315. package/dist/templates.js +0 -20
  316. package/dist/templates.js.map +0 -1
@@ -0,0 +1,41 @@
1
+ ---
2
+ import StyleflowElement from "../StyleflowElement.astro";
3
+ import {
4
+ flowpressBlockHtmlProps,
5
+ resolveFlowpressBlockStyleflowProps,
6
+ } from "../../index.js";
7
+ import type { FlowpressBlockRendererProps } from "../../index.js";
8
+ import { resolveMap } from "./map.js";
9
+
10
+ type Props = Pick<FlowpressBlockRendererProps, "block"> & Partial<FlowpressBlockRendererProps>;
11
+ const { block, contract, htmlProps, styleflowProps } = Astro.props as Props;
12
+ const html = htmlProps ?? flowpressBlockHtmlProps(block.attributes);
13
+ const semantic = styleflowProps ?? resolveFlowpressBlockStyleflowProps(block.attributes, contract);
14
+ const map = resolveMap(block.attributes as import("./map.js").MapAttributes, import.meta.env.GOOGLE_MAPS_API_KEY ?? "");
15
+ const label = map.address || `Mappa: ${map.query}`;
16
+ ---
17
+
18
+ {map.query ? (
19
+ <StyleflowElement as="div" {...semantic} {...html}>
20
+ {map.iframeSrc ? (
21
+ <StyleflowElement as="iframe"
22
+ class="sf-map-frame"
23
+ title={label}
24
+ src={map.iframeSrc}
25
+ loading="lazy"
26
+ referrerpolicy="no-referrer-when-downgrade"
27
+ allowfullscreen
28
+ />
29
+ ) : null}
30
+ <StyleflowElement as="a" href={map.linkHref} target="_blank" rel="noopener noreferrer" layoutRole="control" density="compact" interactivePriority="tertiary">Apri la mappa</StyleflowElement>
31
+ </StyleflowElement>
32
+ ) : null}
33
+
34
+ <style>
35
+ .sf-map-frame {
36
+ display: block;
37
+ width: 100%;
38
+ min-height: var(--fp-map-min-height, 22rem);
39
+ border: 0;
40
+ }
41
+ </style>
@@ -0,0 +1,12 @@
1
+ ---
2
+ import StyleflowElement from "../StyleflowElement.astro";
3
+ import type { FlowpressBlockRendererProps } from "../../index.js";
4
+ import { nativeHtmlData } from "./html.js";
5
+
6
+ const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
7
+ const { html, hidden } = nativeHtmlData(block.resolvedData, block.innerHtml);
8
+ ---
9
+
10
+ {!hidden && html ? (
11
+ <StyleflowElement as="div" {...htmlProps} {...styleflowProps} data-project-native-html set:html={html} />
12
+ ) : null}
@@ -0,0 +1,42 @@
1
+ ---
2
+ import StyleflowElement from "../StyleflowElement.astro";
3
+ import type { FlowpressBlockRendererProps } from "../../index.js";
4
+ import { nativeIconSvg, nativeIconWidth } from "./icon.js";
5
+
6
+ const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
7
+ const svg = nativeIconSvg(block.attributes.icon, block.resolvedData, `fp-icon-${crypto.randomUUID()}`);
8
+ const dimensions = (block.attributes.style as { dimensions?: { width?: unknown } } | undefined)?.dimensions;
9
+ const width = nativeIconWidth(dimensions?.width) ?? "24px";
10
+ const label = typeof block.attributes.ariaLabel === "string" ? block.attributes.ariaLabel.trim() : "";
11
+ const align = ["left", "center", "right"].includes(String(block.attributes.align)) ? `align${block.attributes.align}` : "";
12
+ const semantic = {
13
+ ...styleflowProps,
14
+ ...(!block.attributes.layoutRole ? { layoutRole: "none" as const } : {}),
15
+ };
16
+ const rootProps = {
17
+ ...htmlProps,
18
+ class: ["wp-block-icon", align, htmlProps.class].filter(Boolean).join(" "),
19
+ style: [htmlProps.style, `--fp-core-icon-width:${width}`].filter(Boolean).join(";"),
20
+ };
21
+ ---
22
+
23
+ <!-- styleflow-ignore-start rule=SF_INLINE_STYLE reason="Validated structural icon width from the native Gutenberg control" scope="Native icon pilot" -->
24
+ {svg ? <StyleflowElement as="div"
25
+ {...rootProps}
26
+ {...semantic}
27
+ data-icon={block.attributes.icon}
28
+ role={label ? "img" : undefined}
29
+ aria-label={label || undefined}
30
+ aria-hidden={label ? undefined : "true"}
31
+ set:html={svg}
32
+ /> : null}
33
+ <!-- styleflow-ignore-end -->
34
+
35
+ <style is:global>
36
+ /* Match the native WordPress icon geometry and inherit Styleflow foreground. */
37
+ .wp-block-icon { width: var(--fp-core-icon-width, 24px); max-width: 100%; line-height: 0; }
38
+ .wp-block-icon > svg { display: block; width: 100%; height: auto; max-width: 100%; fill: currentColor; }
39
+ .wp-block-icon.aligncenter { margin-inline: auto; }
40
+ .wp-block-icon.alignright { margin-inline-start: auto; }
41
+ .wp-block-icon.alignleft { margin-inline-end: auto; }
42
+ </style>
@@ -0,0 +1,34 @@
1
+ ---
2
+ import type {
3
+ FlowpressBlockRendererProps
4
+ } from "../../index.js";
5
+ import Timeline from "./Timeline.astro";
6
+ import {
7
+ normalizeTimelineIntensity,
8
+ normalizeTimelineTone,
9
+ timelineItemsFromBlocks
10
+ } from "./timeline.js";
11
+
12
+ const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
13
+
14
+ function optionalAttribute(
15
+ attributes: Record<string, unknown>,
16
+ name: string
17
+ ): string | undefined {
18
+ const value = String(attributes[name] ?? "").trim();
19
+ return value || undefined;
20
+ }
21
+
22
+ const tone = normalizeTimelineTone(block.attributes.tone);
23
+ const intensity = normalizeTimelineIntensity(block.attributes.intensity);
24
+ ---
25
+
26
+ <Timeline
27
+ rootProps={htmlProps}
28
+ styleflowProps={styleflowProps}
29
+ items={timelineItemsFromBlocks(block.innerBlocks ?? [])}
30
+ tone={tone}
31
+ intensity={intensity}
32
+ id={optionalAttribute(block.attributes, "anchor")}
33
+ class={optionalAttribute(block.attributes, "className")}
34
+ />
@@ -0,0 +1,107 @@
1
+ ---
2
+ import S from "../StyleflowElement.astro";
3
+ import type { FlowpressBlockRendererProps } from "../../index.js";
4
+ const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
5
+ const data = (block.resolvedData ?? {}) as { authenticated?: boolean; loginPage?: boolean; page?: number; totalPages?: number; base?: string; target?: string; targets?: { slug: string; name: string }[] };
6
+ const page = data.page ?? 1;
7
+ const total = data.totalPages ?? 0;
8
+ const base = (data.base ?? "/area-riservata/").replace(/page\/\d+\/$/, "");
9
+ const pageUrl = (n: number) => `${base}${n > 1 ? `page/${n}/` : ""}${data.target ? `?target=${encodeURIComponent(data.target)}` : ""}`;
10
+ ---
11
+ <S as="div" {...htmlProps} {...styleflowProps}>
12
+ {block.name === "flowpress/reserved-pagination" ? (
13
+ total > 1 && <S as="nav" aria-label="Pagine contenuti riservati">
14
+ {page > 1 && <S as="a" href={pageUrl(page - 1)}>Precedente</S>}
15
+ <S as="span">Pagina {page} di {total}</S>
16
+ {page < total && <S as="a" href={pageUrl(page + 1)}>Successiva</S>}
17
+ </S>
18
+ ) : data.authenticated ? (
19
+ <S as="div" class="flowpress-login flowpress-login--session">
20
+ <S as="p" class="flowpress-login__status" role="status">Accesso effettuato.</S>
21
+ <S as="div" class="flowpress-login__actions">
22
+ <S as="a" class="flowpress-login__link" href="/area-riservata/">Contenuti riservati</S>
23
+ <S as="form" method="post" action="/api/flowpress/reserved-area/logout"><S as="button" class="flowpress-login__button flowpress-login__button--secondary" type="submit">Esci</S></S>
24
+ </S>
25
+ {data.targets?.length ? <S as="form" class="flowpress-login__filter" method="get" action="/area-riservata/">
26
+ <S as="div" class="flowpress-login__field">
27
+ <S as="label" class="flowpress-login__label" for="flowpress-target">Filtra per destinatario</S>
28
+ <S as="select" class="flowpress-login__input" id="flowpress-target" name="target">
29
+ <S as="option" value="">Tutti i destinatari</S>
30
+ {data.targets.map(target => <S as="option" value={target.slug} selected={data.target === target.slug}>{target.name}</S>)}
31
+ </S>
32
+ </S>
33
+ <S as="button" class="flowpress-login__button" type="submit">Filtra</S>
34
+ </S> : null}
35
+ </S>
36
+ ) : data.loginPage ? (
37
+ <S as="form" class="flowpress-login" method="post" action="/api/flowpress/reserved-area/login" data-flowpress-login>
38
+ <S as="p" class="flowpress-login__error" data-flowpress-error id="flowpress-login-error" role="alert" hidden />
39
+ <S as="input" type="hidden" name="redirect_to" value="/area-riservata/" />
40
+ <S as="div" class="flowpress-login__field">
41
+ <S as="label" class="flowpress-login__label" for="flowpress-username">Nome utente o email</S>
42
+ <S as="input" class="flowpress-login__input" id="flowpress-username" name="username" type="text" autocomplete="username" autocapitalize="none" autocorrect="off" spellcheck="false" required />
43
+ </S>
44
+ <S as="div" class="flowpress-login__field">
45
+ <S as="label" class="flowpress-login__label" for="flowpress-password">Password</S>
46
+ <S as="div" class="flowpress-login__password">
47
+ <S as="input" class="flowpress-login__input" id="flowpress-password" name="password" type="password" autocomplete="current-password" required />
48
+ <S as="button" class="flowpress-login__toggle" type="button" data-flowpress-toggle aria-controls="flowpress-password" aria-pressed="false" aria-label="Mostra password" hidden>Mostra</S>
49
+ </S>
50
+ </S>
51
+ <S as="label" class="flowpress-login__remember"><S as="input" name="remember" type="checkbox" value="1" /> <S as="span">Ricordami su questo dispositivo</S></S>
52
+ <S as="button" class="flowpress-login__button" type="submit" data-flowpress-submit>Accedi</S>
53
+ <S as="a" class="flowpress-login__link" href="/area-riservata/">Vai ai contenuti riservati</S>
54
+ </S>
55
+ ) :
56
+ <S as="div" layoutRole="panel" class="flex flex-col" surface="default" density="comfortable">
57
+ <S as="h2" ty="heading" w="default" v="3">Area riservata</S>
58
+ <S as="a" href="/area-riservata/" layoutRole="control" density="comfortable" interactivePriority="primary" class="w-fit">Accesso area riservata</S>
59
+ </S>
60
+ }
61
+ </S>
62
+
63
+ <script>
64
+ import { safeFlowpressReservedRedirect } from "../../reserved-area.js";
65
+ const params = new URLSearchParams(window.location.search);
66
+ const errors: Record<string, string> = { credenziali: "Credenziali non valide. Controlla nome utente e password e riprova.", accesso: "Questo account non è abilitato all’area riservata.", servizio: "Servizio temporaneamente non disponibile. Riprova tra qualche minuto." };
67
+ for (const form of document.querySelectorAll<HTMLFormElement>("[data-flowpress-login]")) {
68
+ const redirect = form.elements.namedItem("redirect_to") as HTMLInputElement;
69
+ redirect.value = safeFlowpressReservedRedirect(params.get("redirect_to"));
70
+ const message = form.querySelector<HTMLElement>("[data-flowpress-error]");
71
+ const username = form.elements.namedItem("username") as HTMLInputElement;
72
+ const password = form.elements.namedItem("password") as HTMLInputElement;
73
+ const text = errors[params.get("errore") ?? ""];
74
+ if (message && text) {
75
+ message.textContent = text;
76
+ message.hidden = false;
77
+ if (params.get("errore") === "credenziali") {
78
+ for (const input of [username, password]) { input.setAttribute("aria-invalid", "true"); input.setAttribute("aria-describedby", message.id); }
79
+ }
80
+ username.focus();
81
+ }
82
+ const toggle = form.querySelector<HTMLButtonElement>("[data-flowpress-toggle]");
83
+ if (toggle) {
84
+ toggle.hidden = false;
85
+ toggle.addEventListener("click", () => {
86
+ const show = password.type === "password";
87
+ password.type = show ? "text" : "password";
88
+ toggle.textContent = show ? "Nascondi" : "Mostra";
89
+ toggle.setAttribute("aria-pressed", String(show));
90
+ toggle.setAttribute("aria-label", show ? "Nascondi password" : "Mostra password");
91
+ });
92
+ }
93
+ const submit = form.querySelector<HTMLButtonElement>("[data-flowpress-submit]");
94
+ let pending = false;
95
+ form.addEventListener("submit", event => {
96
+ if (pending) return event.preventDefault();
97
+ pending = true;
98
+ submit?.setAttribute("aria-disabled", "true");
99
+ if (submit) submit.textContent = "Accesso in corso…";
100
+ });
101
+ window.addEventListener("pageshow", () => {
102
+ pending = false;
103
+ submit?.removeAttribute("aria-disabled");
104
+ if (submit) submit.textContent = "Accedi";
105
+ });
106
+ }
107
+ </script>
@@ -0,0 +1,91 @@
1
+ ---
2
+ import StyleflowElement from "../StyleflowElement.astro";
3
+ import CompositionRenderer from "../CompositionRenderer.astro";
4
+ import GutenbergRenderer from "../GutenbergRenderer.astro";
5
+ import type {
6
+ FlowpressBlock,
7
+ FlowpressBlockRendererProps,
8
+ FlowpressCompositionV1,
9
+ } from "../../index.js";
10
+ import type { NestedPass } from "./query-loop.js";
11
+ import { decorateGridBlocks } from "./grid.js";
12
+
13
+ // Blocks resolved by a project resolver in a nested composition pass (Query
14
+ // Loop, Terms Query, one loop item). That pass cannot write into the outer
15
+ // composition, so it exports its own block types, stylesheets and
16
+ // diagnostics: merge them here, as SyncedPatternContent does for patterns.
17
+
18
+ type Props = Pick<
19
+ FlowpressBlockRendererProps,
20
+ "block" | "composition" | "contract" | "context" | "adapters"
21
+ > & {
22
+ blocks: FlowpressBlock[];
23
+ pass: NestedPass;
24
+ // Stylesheets and diagnostics belong to the whole pass: render them once,
25
+ // not once per loop item.
26
+ renderPassOutput?: boolean | undefined;
27
+ };
28
+
29
+ const { block, blocks, pass, composition, contract, context, adapters, renderPassOutput = true } = Astro.props;
30
+
31
+ const stylesheets = renderPassOutput ? pass.stylesheets ?? [] : [];
32
+ const blocking = renderPassOutput ? (pass.diagnostics ?? []).filter((diagnostic) => diagnostic.blocking) : [];
33
+ if (blocking.length > 0 && context.production) {
34
+ throw new Error(
35
+ `FlowPress ${block.name} is not renderable:\n`
36
+ + blocking.map(({ code, message }) => `- ${code}: ${message}`).join("\n"),
37
+ );
38
+ }
39
+
40
+ // Composition path: the parent chain was rendered through the adapter registry.
41
+ // Semantic-renderer path (inside sf/* blocks): no registry, so use the project
42
+ // renderers, which register every loop adapter.
43
+ // block-renderers.ts imports the loop adapters, which import this component:
44
+ // a static import would close that cycle, and Vite's SSR loader then hands
45
+ // block-renderers.ts undefined adapters (core/query rendered as a plain
46
+ // container, with the page-context pass). Load the registry at render time.
47
+ const { nativeBlockRenderers } = await import("./registry.js");
48
+ const nestedComposition: FlowpressCompositionV1 | undefined = composition && adapters && Object.keys(adapters).length > 0
49
+ ? {
50
+ ...composition,
51
+ blockTypes: [...composition.blockTypes, ...(pass.blockTypes ?? [])],
52
+ diagnostics: pass.diagnostics ?? [],
53
+ stylesheets: [],
54
+ }
55
+ : undefined;
56
+ ---
57
+
58
+ {stylesheets.map((stylesheet) => (
59
+ <style data-flowpress-composition-style={stylesheet.id} set:html={stylesheet.css} />
60
+ ))}
61
+ {blocking.length > 0 ? (
62
+ <StyleflowElement as="aside" data-flowpress-composition-diagnostics role="status">
63
+ <StyleflowElement as="ul">
64
+ {blocking.map(({ code, message }) => <StyleflowElement as="li" data-diagnostic-code={code}>{message}</StyleflowElement>)}
65
+ </StyleflowElement>
66
+ </StyleflowElement>
67
+ ) : null}
68
+ {blocks.length > 0 ? (
69
+ nestedComposition ? (
70
+ <CompositionRenderer
71
+ composition={nestedComposition}
72
+ adapters={adapters!}
73
+ blocks={decorateGridBlocks(blocks)}
74
+ contract={contract}
75
+ parentBlockName={block.name}
76
+ production={context.production}
77
+ depth={context.depth + 1}
78
+ inheritedTone={context.effectiveTone}
79
+ />
80
+ ) : (
81
+ <GutenbergRenderer
82
+ blocks={decorateGridBlocks(blocks)}
83
+ contract={contract}
84
+ blockRenderers={{ ...nativeBlockRenderers, ...context.blockRenderers }}
85
+ parentBlockName={block.name}
86
+ production={context.production}
87
+ depth={context.depth + 1}
88
+ inheritedTone={context.effectiveTone}
89
+ />
90
+ )
91
+ ) : null}
@@ -0,0 +1,94 @@
1
+ ---
2
+ import StyleflowElement from "../StyleflowElement.astro";
3
+ import CompositionRenderer from "../CompositionRenderer.astro";
4
+ import GutenbergRenderer from "../GutenbergRenderer.astro";
5
+ import type {
6
+ FlowpressBlock,
7
+ FlowpressBlockRenderer,
8
+ FlowpressBlockRendererProps,
9
+ FlowpressBlockTypeDescriptor,
10
+ FlowpressCompositionDiagnostic,
11
+ FlowpressCompositionStylesheet,
12
+ FlowpressCompositionV1,
13
+ } from "../../index.js";
14
+ import { decorateGridBlocks } from "./grid.js";
15
+
16
+ // Content of a synced pattern (core/block). The pattern's blocks arrive either
17
+ // as `innerBlocks` (the default slot, once FlowPress resolves core/block) or as
18
+ // `resolvedData` from the project resolver, which exports the block types,
19
+ // stylesheets and diagnostics of its own nested pass because that pass cannot
20
+ // write into the outer composition.
21
+ interface SyncedPatternData {
22
+ ref?: number | undefined;
23
+ blocks?: FlowpressBlock[] | undefined;
24
+ blockTypes?: FlowpressBlockTypeDescriptor[] | undefined;
25
+ stylesheets?: FlowpressCompositionStylesheet[] | undefined;
26
+ diagnostics?: FlowpressCompositionDiagnostic[] | undefined;
27
+ }
28
+
29
+ // `selfRenderer` lets the semantic renderer resolve patterns nested in patterns.
30
+ const { block, composition, contract, context, adapters, selfRenderer } = Astro.props as Pick<
31
+ FlowpressBlockRendererProps,
32
+ "block" | "composition" | "contract" | "context" | "adapters"
33
+ > & { selfRenderer?: FlowpressBlockRenderer };
34
+
35
+ const pattern = (block.resolvedData ?? {}) as SyncedPatternData;
36
+ const patternBlocks = pattern.blocks ?? [];
37
+ const stylesheets = pattern.stylesheets ?? [];
38
+ const blocking = (pattern.diagnostics ?? []).filter((diagnostic) => diagnostic.blocking);
39
+ if (blocking.length > 0 && context.production) {
40
+ throw new Error(
41
+ `FlowPress synced pattern ${pattern.ref ?? block.attributes.ref} is not renderable:\n`
42
+ + blocking.map(({ code, message }) => `- ${code}: ${message}`).join("\n"),
43
+ );
44
+ }
45
+
46
+ // Composition path: the parent chain was rendered through the adapter registry.
47
+ // Semantic-renderer path (inside sf/* blocks): use the project renderers so
48
+ // resolved blocks inside patterns keep their adapters too.
49
+ const { nativeBlockRenderers } = await import("./registry.js");
50
+ const patternComposition: FlowpressCompositionV1 | undefined = composition && adapters && Object.keys(adapters).length > 0
51
+ ? {
52
+ ...composition,
53
+ blockTypes: [...composition.blockTypes, ...(pattern.blockTypes ?? [])],
54
+ diagnostics: pattern.diagnostics ?? [],
55
+ stylesheets: [],
56
+ }
57
+ : undefined;
58
+ ---
59
+
60
+ {stylesheets.map((stylesheet) => (
61
+ <style data-flowpress-composition-style={stylesheet.id} set:html={stylesheet.css} />
62
+ ))}
63
+ {blocking.length > 0 ? (
64
+ <StyleflowElement as="aside" data-flowpress-composition-diagnostics role="status">
65
+ <StyleflowElement as="ul">
66
+ {blocking.map(({ code, message }) => <StyleflowElement as="li" data-diagnostic-code={code}>{message}</StyleflowElement>)}
67
+ </StyleflowElement>
68
+ </StyleflowElement>
69
+ ) : null}
70
+ {patternBlocks.length > 0 ? (
71
+ patternComposition ? (
72
+ <CompositionRenderer
73
+ composition={patternComposition}
74
+ adapters={adapters!}
75
+ blocks={decorateGridBlocks(patternBlocks)}
76
+ contract={contract}
77
+ parentBlockName={block.name}
78
+ production={context.production}
79
+ depth={context.depth + 1}
80
+ inheritedTone={context.effectiveTone}
81
+ />
82
+ ) : (
83
+ <GutenbergRenderer
84
+ blocks={decorateGridBlocks(patternBlocks)}
85
+ contract={contract}
86
+ blockRenderers={{ ...nativeBlockRenderers, ...context.blockRenderers, ...(selfRenderer ? { [block.name]: selfRenderer } : {}) }}
87
+ parentBlockName={block.name}
88
+ production={context.production}
89
+ depth={context.depth + 1}
90
+ inheritedTone={context.effectiveTone}
91
+ />
92
+ )
93
+ ) : null}
94
+ <slot />
@@ -0,0 +1,39 @@
1
+ ---
2
+ import Media from "../Media.astro";
3
+ import { decodeFlowpressText } from "../../text.js";
4
+ import StyleflowElement from "../StyleflowElement.astro";
5
+ import { classNames, text, type ResolvedImage } from "./query-loop.js";
6
+
7
+ // Value of a term custom field inside the link of a Post Terms item
8
+ // (apps/cms/project/src/custom-fields.php, FLOWPRESS_PROJECT_TERM_LIST_OUTPUTS).
9
+ // Inline outputs only: the block-level ones (rich text, list, link) are never
10
+ // resolved for this block, and none of them would be valid inside an <a>.
11
+ interface Props {
12
+ field: { as?: string | undefined; value?: unknown };
13
+ // Accessible name of an image that is the only content of the term link.
14
+ fallbackAlt?: string | undefined;
15
+ }
16
+ const { field, fallbackAlt = "" } = Astro.props;
17
+ const as = text(field.as);
18
+ const image = (as === "image" ? field.value ?? {} : {}) as ResolvedImage;
19
+ const date = (as === "date" ? field.value ?? {} : {}) as { datetime?: string | undefined; formatted?: string };
20
+ const imageProps = {
21
+ src: text(image.url),
22
+ srcset: image.srcSet || undefined,
23
+ sizes: image.srcSet ? image.sizes || undefined : undefined,
24
+ width: image.width,
25
+ height: image.height,
26
+ alt: image.alt || fallbackAlt,
27
+ class: classNames("wp-block-post-terms__field", image.id ? `wp-image-${image.id}` : undefined),
28
+ loading: "lazy" as const,
29
+ decoding: "async" as const,
30
+ };
31
+ ---
32
+
33
+ {as === "image" ? (
34
+ imageProps.src ? <Media {...imageProps} /> : null
35
+ ) : as === "date" ? (
36
+ <StyleflowElement as="time" class="wp-block-post-terms__field" datetime={date.datetime}>{decodeFlowpressText(date.formatted)}</StyleflowElement>
37
+ ) : (
38
+ <StyleflowElement as="span" class="wp-block-post-terms__field">{decodeFlowpressText(field.value)}</StyleflowElement>
39
+ )}
@@ -0,0 +1,22 @@
1
+ ---
2
+ import Media from "../Media.astro";
3
+ import { decodeFlowpressText } from "../../text.js";
4
+ import StyleflowElement from "../StyleflowElement.astro";
5
+ import type { TimelineItem } from "./timeline.js";
6
+ import "./timeline.css";
7
+ interface Props { items:TimelineItem[]; tone?:string | undefined; intensity?:string | undefined; id?:string | undefined; class?:string | undefined; ariaLabel?:string | undefined; rootProps?:Record<string,unknown> | undefined; styleflowProps?:Record<string,unknown> | undefined; }
8
+ const {items,tone="inherit",intensity="inherit",id,class:className="",ariaLabel="Timeline",rootProps={},styleflowProps={}}=Astro.props;
9
+ ---
10
+ <StyleflowElement as="section" {...rootProps} {...styleflowProps} id={id ?? (typeof rootProps.id === "string" ? rootProps.id : undefined)} {...(tone !== "inherit" ? {tone} : {})} {...(intensity !== "inherit" ? {intensity} : {})} layoutRole="stack" density="regular" aria-label={ariaLabel} class:list={["flowpress-timeline",rootProps.class,className]} data-flowpress-timeline>
11
+ <StyleflowElement as="ol" layoutRole="stack" density="regular" class="flowpress-timeline__list">
12
+ {items.map(item=>(
13
+ <StyleflowElement as="li" {...(item.tone && item.tone !== "inherit" ? {tone:item.tone} : {})} {...(item.intensity && item.intensity !== "inherit" ? {intensity:item.intensity} : {})} layoutRole="stack" density="regular" surface="default" class="flowpress-timeline__item" data-flowpress-timeline-item>
14
+ {item.year && <StyleflowElement as="h3">{decodeFlowpressText(item.year)}</StyleflowElement>}
15
+ {item.image && <Media src={item.image.url ?? item.image.sourceUrl} alt={item.image.alt ?? item.image.altText ?? ""} width={item.image.width} height={item.image.height} loading="lazy" />}
16
+ {item.description && <StyleflowElement as="p">{decodeFlowpressText(item.description)}</StyleflowElement>}
17
+ {item.metric && <StyleflowElement as="p">{decodeFlowpressText(item.metric)}</StyleflowElement>}
18
+ {(item.statisticValue || item.statisticLabel) && <StyleflowElement as="p"><StyleflowElement as="strong">{decodeFlowpressText(item.statisticValue)}</StyleflowElement> {decodeFlowpressText(item.statisticLabel)}</StyleflowElement>}
19
+ </StyleflowElement>
20
+ ))}
21
+ </StyleflowElement>
22
+ </StyleflowElement>
@@ -0,0 +1,7 @@
1
+ ---
2
+ import type { FlowpressBlockRendererProps } from "../../index.js";
3
+ import Timeline from "./Timeline.astro";
4
+ import { timelineItemsFromBlocks } from "./timeline.js";
5
+ const {block,htmlProps,styleflowProps} = Astro.props as FlowpressBlockRendererProps;
6
+ ---
7
+ <Timeline items={timelineItemsFromBlocks([block])} rootProps={htmlProps} styleflowProps={styleflowProps} />
@@ -0,0 +1,2 @@
1
+ export { BLOB_BOX, BLOB_VARIANTS } from "@styleflow.app/flowpress-components/organic-shapes";
2
+ //# sourceMappingURL=blob-shapes.generated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blob-shapes.generated.d.ts","sourceRoot":"","sources":["../../../../src/astro/native/blob/blob-shapes.generated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { BLOB_BOX, BLOB_VARIANTS } from "@styleflow.app/flowpress-components/organic-shapes";
2
+ //# sourceMappingURL=blob-shapes.generated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blob-shapes.generated.js","sourceRoot":"","sources":["../../../../src/astro/native/blob/blob-shapes.generated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,oDAAoD,CAAC","sourcesContent":["export { BLOB_BOX, BLOB_VARIANTS } from \"@styleflow.app/flowpress-components/organic-shapes\";\n"]}
@@ -0,0 +1 @@
1
+ export { BLOB_BOX, BLOB_VARIANTS } from "@styleflow.app/flowpress-components/organic-shapes";
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Pure, DOM-free parsing of the blob authoring options. Shared by the Astro
3
+ * component (server) and the morph controller (browser) so both read the same
4
+ * `data-blob-*` contract and clamp values identically.
5
+ */
6
+ export declare const BLOB_MORPH_MODES: readonly ["none", "auto", "hover"];
7
+ export type BlobMorphMode = (typeof BLOB_MORPH_MODES)[number];
8
+ export declare const BLOB_CONTENT_FITS: readonly ["cover", "center"];
9
+ export type BlobContentFit = (typeof BLOB_CONTENT_FITS)[number];
10
+ export declare const BLOB_ASPECT_RATIOS: readonly ["natural", "square", "portrait", "landscape"];
11
+ export type BlobAspectRatio = (typeof BLOB_ASPECT_RATIOS)[number];
12
+ export declare const BLOB_DEFAULT_MORPH_DURATION = 2400;
13
+ export declare const BLOB_DEFAULT_MORPH_INTERVAL = 1200;
14
+ export declare const BLOB_DEFAULT_OUTLINE_WIDTH = 2;
15
+ export interface BlobMorphConfig {
16
+ mode: BlobMorphMode;
17
+ /** Zero-based index of the variant the blob rests on. */
18
+ base: number;
19
+ /** Zero-based variants the blob may morph into. */
20
+ targets: number[];
21
+ duration: number;
22
+ interval: number;
23
+ }
24
+ export declare function clampNumber(value: unknown, min: number, max: number, fallback: number): number;
25
+ /** Authors count from 1; the registry is zero-based. Invalid input rests on variant 1. */
26
+ export declare function resolveVariantIndex(value: unknown, count: number): number;
27
+ /**
28
+ * `"2, 5, 9"` or `[2, 5, 9]` → zero-based unique indices in authoring order.
29
+ * Empty input means every variant; unknown numbers are ignored.
30
+ */
31
+ export declare function parseVariantList(value: unknown, count: number): number[];
32
+ export declare const resolveMorphMode: (value: unknown) => BlobMorphMode;
33
+ export declare const resolveContentFit: (value: unknown) => BlobContentFit;
34
+ export declare const resolveAspectRatio: (value: unknown) => BlobAspectRatio;
35
+ export declare function resolveOutlineWidth(value: unknown): number;
36
+ export interface BlobMorphInput {
37
+ variant?: unknown;
38
+ morph?: unknown;
39
+ targets?: unknown;
40
+ duration?: unknown;
41
+ interval?: unknown;
42
+ }
43
+ export declare function resolveMorphConfig(input: BlobMorphInput, count: number): BlobMorphConfig;
44
+ /** The `data-blob-*` attributes the server writes and the controller reads back. */
45
+ export declare function morphDataAttributes(config: BlobMorphConfig): Record<string, string>;
46
+ export declare function morphConfigFromDataset(dataset: Readonly<Record<string, string | undefined>>, count: number): BlobMorphConfig;
47
+ /** Random candidate different from `current`, or `null` when nothing else is allowed. */
48
+ export declare function pickMorphTarget(candidates: readonly number[], current: number, random?: () => number): number | null;
49
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/astro/native/blob/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,gBAAgB,oCAAqC,CAAC;AACnE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9D,eAAO,MAAM,iBAAiB,8BAA+B,CAAC;AAC9D,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,eAAO,MAAM,kBAAkB,yDAA0D,CAAC;AAC1F,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAChD,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAChD,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,aAAa,CAAC;IACpB,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM9F;AAQD,0FAA0F;AAC1F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAGzE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAUxE;AAED,eAAO,MAAM,gBAAgB,GAAI,OAAO,OAAO,KAAG,aACV,CAAC;AACzC,eAAO,MAAM,iBAAiB,GAAI,OAAO,OAAO,KAAG,cACT,CAAC;AAC3C,eAAO,MAAM,kBAAkB,GAAI,OAAO,OAAO,KAAG,eACP,CAAC;AAE9C,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE1D;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,eAAe,CAQxF;AAED,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQnF;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EACrD,KAAK,EAAE,MAAM,GACZ,eAAe,CAWjB;AAED,yFAAyF;AACzF,wBAAgB,eAAe,CAC7B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAAM,MAAoB,GACjC,MAAM,GAAG,IAAI,CAKf"}