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

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 (304) hide show
  1. package/CHANGELOG.md +197 -1
  2. package/README.md +111 -3
  3. package/dist/accessibility-panel.d.ts +2 -0
  4. package/dist/accessibility-panel.d.ts.map +1 -0
  5. package/dist/accessibility-panel.js +81 -0
  6. package/dist/accessibility-panel.js.map +1 -0
  7. package/dist/astro/BaseLayout.astro +34 -17
  8. package/dist/astro/CompositionRenderer.astro +168 -0
  9. package/dist/astro/DefaultBlockAdapter.astro +36 -0
  10. package/dist/astro/DefaultTemplate.astro +12 -7
  11. package/dist/astro/FontStylesheets.astro +35 -0
  12. package/dist/astro/GutenbergRenderer.astro +280 -81
  13. package/dist/astro/Media.astro +24 -0
  14. package/dist/astro/StyleflowElement.astro +24 -0
  15. package/dist/astro/ThemeRuntime.astro +26 -0
  16. package/dist/astro/blocks/CarouselBlock.astro +11 -10
  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 +156 -0
  20. package/dist/astro/blocks/FormBlock.astro +23 -20
  21. package/dist/astro/blocks/GridBlock.astro +4 -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 +12 -8
  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 +57 -44
  38. package/dist/astro/blocks/helpers.js.map +1 -1
  39. package/dist/astro/blocks/helpers.ts +71 -49
  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 +293 -0
  52. package/dist/astro/motion/motion-controller.js.map +1 -0
  53. package/dist/astro/motion/motion-controller.ts +377 -0
  54. package/dist/astro/motion/motion.css +546 -0
  55. package/dist/astro/motion/motion.d.ts +127 -0
  56. package/dist/astro/motion/motion.d.ts.map +1 -0
  57. package/dist/astro/motion/motion.js +255 -0
  58. package/dist/astro/motion/motion.js.map +1 -0
  59. package/dist/astro/motion/motion.ts +419 -0
  60. package/dist/astro/native/Blob.astro +113 -0
  61. package/dist/astro/native/BlobBlock.astro +52 -0
  62. package/dist/astro/native/CustomFieldValue.astro +88 -0
  63. package/dist/astro/native/LevelTag.astro +20 -0
  64. package/dist/astro/native/MapBlock.astro +41 -0
  65. package/dist/astro/native/NativeHtmlBlock.astro +12 -0
  66. package/dist/astro/native/NativeIconBlock.astro +42 -0
  67. package/dist/astro/native/ProjectTimelineBlock.astro +34 -0
  68. package/dist/astro/native/ReservedLogin.astro +107 -0
  69. package/dist/astro/native/ResolvedBlocks.astro +91 -0
  70. package/dist/astro/native/SyncedPatternContent.astro +94 -0
  71. package/dist/astro/native/TermFieldValue.astro +39 -0
  72. package/dist/astro/native/Timeline.astro +22 -0
  73. package/dist/astro/native/TimelineCardBlock.astro +7 -0
  74. package/dist/astro/native/blob/blob-shapes.generated.d.ts +2 -0
  75. package/dist/astro/native/blob/blob-shapes.generated.d.ts.map +1 -0
  76. package/dist/astro/native/blob/blob-shapes.generated.js +2 -0
  77. package/dist/astro/native/blob/blob-shapes.generated.js.map +1 -0
  78. package/dist/astro/native/blob/blob-shapes.generated.ts +1 -0
  79. package/dist/astro/native/blob/config.d.ts +49 -0
  80. package/dist/astro/native/blob/config.d.ts.map +1 -0
  81. package/dist/astro/native/blob/config.js +86 -0
  82. package/dist/astro/native/blob/config.js.map +1 -0
  83. package/dist/astro/native/blob/config.ts +132 -0
  84. package/dist/astro/native/blob/controller.d.ts +11 -0
  85. package/dist/astro/native/blob/controller.d.ts.map +1 -0
  86. package/dist/astro/native/blob/controller.js +240 -0
  87. package/dist/astro/native/blob/controller.js.map +1 -0
  88. package/dist/astro/native/blob/controller.ts +248 -0
  89. package/dist/astro/native/blob/geometry.d.ts +2 -0
  90. package/dist/astro/native/blob/geometry.d.ts.map +1 -0
  91. package/dist/astro/native/blob/geometry.js +2 -0
  92. package/dist/astro/native/blob/geometry.js.map +1 -0
  93. package/dist/astro/native/blob/geometry.ts +1 -0
  94. package/dist/astro/native/blob/ids.d.ts +7 -0
  95. package/dist/astro/native/blob/ids.d.ts.map +1 -0
  96. package/dist/astro/native/blob/ids.js +11 -0
  97. package/dist/astro/native/blob/ids.js.map +1 -0
  98. package/dist/astro/native/blob/ids.ts +11 -0
  99. package/dist/astro/native/blob.css +83 -0
  100. package/dist/astro/native/button-template.d.ts +31 -0
  101. package/dist/astro/native/button-template.d.ts.map +1 -0
  102. package/dist/astro/native/button-template.js +54 -0
  103. package/dist/astro/native/button-template.js.map +1 -0
  104. package/dist/astro/native/button-template.ts +92 -0
  105. package/dist/astro/native/button.d.ts +13 -0
  106. package/dist/astro/native/button.d.ts.map +1 -0
  107. package/dist/astro/native/button.js +26 -0
  108. package/dist/astro/native/button.js.map +1 -0
  109. package/dist/astro/native/button.ts +26 -0
  110. package/dist/astro/native/core-block.astro +18 -0
  111. package/dist/astro/native/core-button-fallback.astro +43 -0
  112. package/dist/astro/native/core-button.astro +65 -0
  113. package/dist/astro/native/core-buttons.astro +14 -0
  114. package/dist/astro/native/core-group.astro +25 -0
  115. package/dist/astro/native/core-home-link.astro +12 -0
  116. package/dist/astro/native/core-html.astro +8 -0
  117. package/dist/astro/native/core-icon.astro +7 -0
  118. package/dist/astro/native/core-image.astro +125 -0
  119. package/dist/astro/native/core-navigation-link.astro +71 -0
  120. package/dist/astro/native/core-navigation-submenu.astro +33 -0
  121. package/dist/astro/native/core-navigation.astro +101 -0
  122. package/dist/astro/native/core-page-list-data-item.astro +19 -0
  123. package/dist/astro/native/core-page-list-item.astro +8 -0
  124. package/dist/astro/native/core-page-list.astro +40 -0
  125. package/dist/astro/native/core-post-date.astro +21 -0
  126. package/dist/astro/native/core-post-excerpt.astro +26 -0
  127. package/dist/astro/native/core-post-featured-image.astro +38 -0
  128. package/dist/astro/native/core-post-template-fallback.astro +30 -0
  129. package/dist/astro/native/core-post-template.astro +23 -0
  130. package/dist/astro/native/core-post-terms.astro +47 -0
  131. package/dist/astro/native/core-post-title.astro +23 -0
  132. package/dist/astro/native/core-query-no-results.astro +12 -0
  133. package/dist/astro/native/core-query.astro +22 -0
  134. package/dist/astro/native/core-separator.astro +20 -0
  135. package/dist/astro/native/core-site-title.astro +16 -0
  136. package/dist/astro/native/core-term-description.astro +12 -0
  137. package/dist/astro/native/core-term-name.astro +21 -0
  138. package/dist/astro/native/core-term-template.astro +30 -0
  139. package/dist/astro/native/core-terms-query.astro +19 -0
  140. package/dist/astro/native/core-transparent.astro +11 -0
  141. package/dist/astro/native/flowpress-navigation-controller.d.ts +2 -0
  142. package/dist/astro/native/flowpress-navigation-controller.d.ts.map +1 -0
  143. package/dist/astro/native/flowpress-navigation-controller.js +217 -0
  144. package/dist/astro/native/flowpress-navigation-controller.js.map +1 -0
  145. package/dist/astro/native/flowpress-navigation-controller.ts +215 -0
  146. package/dist/astro/native/flowpress-navigation.css +17 -0
  147. package/dist/astro/native/grid-bleed.d.ts +2 -0
  148. package/dist/astro/native/grid-bleed.d.ts.map +1 -0
  149. package/dist/astro/native/grid-bleed.js +123 -0
  150. package/dist/astro/native/grid-bleed.js.map +1 -0
  151. package/dist/astro/native/grid.css +180 -0
  152. package/dist/astro/native/grid.d.ts +17 -0
  153. package/dist/astro/native/grid.d.ts.map +1 -0
  154. package/dist/astro/native/grid.js +103 -0
  155. package/dist/astro/native/grid.js.map +1 -0
  156. package/dist/astro/native/grid.ts +118 -0
  157. package/dist/astro/native/group.css +36 -0
  158. package/dist/astro/native/group.d.ts +15 -0
  159. package/dist/astro/native/group.d.ts.map +1 -0
  160. package/dist/astro/native/group.js +66 -0
  161. package/dist/astro/native/group.js.map +1 -0
  162. package/dist/astro/native/group.ts +61 -0
  163. package/dist/astro/native/html.d.ts +6 -0
  164. package/dist/astro/native/html.d.ts.map +1 -0
  165. package/dist/astro/native/html.js +10 -0
  166. package/dist/astro/native/html.js.map +1 -0
  167. package/dist/astro/native/html.ts +9 -0
  168. package/dist/astro/native/icon.d.ts +3 -0
  169. package/dist/astro/native/icon.d.ts.map +1 -0
  170. package/dist/astro/native/icon.js +23 -0
  171. package/dist/astro/native/icon.js.map +1 -0
  172. package/dist/astro/native/icon.ts +21 -0
  173. package/dist/astro/native/inline-text.css +15 -0
  174. package/dist/astro/native/map.d.ts +14 -0
  175. package/dist/astro/native/map.d.ts.map +1 -0
  176. package/dist/astro/native/map.js +60 -0
  177. package/dist/astro/native/map.js.map +1 -0
  178. package/dist/astro/native/map.ts +70 -0
  179. package/dist/astro/native/motion-preference.d.ts +50 -0
  180. package/dist/astro/native/motion-preference.d.ts.map +1 -0
  181. package/dist/astro/native/motion-preference.js +132 -0
  182. package/dist/astro/native/motion-preference.js.map +1 -0
  183. package/dist/astro/native/motion-preference.ts +158 -0
  184. package/dist/astro/native/motion.d.ts +101 -0
  185. package/dist/astro/native/motion.d.ts.map +1 -0
  186. package/dist/astro/native/motion.js +168 -0
  187. package/dist/astro/native/motion.js.map +1 -0
  188. package/dist/astro/native/motion.ts +312 -0
  189. package/dist/astro/native/query-carousel.d.ts +12 -0
  190. package/dist/astro/native/query-carousel.d.ts.map +1 -0
  191. package/dist/astro/native/query-carousel.js +36 -0
  192. package/dist/astro/native/query-carousel.js.map +1 -0
  193. package/dist/astro/native/query-carousel.ts +56 -0
  194. package/dist/astro/native/query-loop.d.ts +38 -0
  195. package/dist/astro/native/query-loop.d.ts.map +1 -0
  196. package/dist/astro/native/query-loop.js +20 -0
  197. package/dist/astro/native/query-loop.js.map +1 -0
  198. package/dist/astro/native/query-loop.ts +67 -0
  199. package/dist/astro/native/registry.d.ts +3 -0
  200. package/dist/astro/native/registry.d.ts.map +1 -0
  201. package/dist/astro/native/registry.js +84 -0
  202. package/dist/astro/native/registry.js.map +1 -0
  203. package/dist/astro/native/registry.ts +85 -0
  204. package/dist/astro/native/sf-block-binding.astro +20 -0
  205. package/dist/astro/native/sf-post-field.astro +9 -0
  206. package/dist/astro/native/sf-term-field.astro +9 -0
  207. package/dist/astro/native/timeline.css +4 -0
  208. package/dist/astro/native/timeline.d.ts +28 -0
  209. package/dist/astro/native/timeline.d.ts.map +1 -0
  210. package/dist/astro/native/timeline.js +43 -0
  211. package/dist/astro/native/timeline.js.map +1 -0
  212. package/dist/astro/native/timeline.ts +79 -0
  213. package/dist/astro/preferences/AccessibilityPanel.astro +105 -0
  214. package/dist/astro/preferences/ColorModeToggle.astro +26 -0
  215. package/dist/astro/preferences/MotionToggle.astro +27 -0
  216. package/dist/astro/preferences/PreferencesRuntime.astro +9 -0
  217. package/dist/astro/preferences/ThemeToggle.astro +30 -0
  218. package/dist/astro/preferences/Toggle.astro +50 -0
  219. package/dist/astro/preferences/preferences.css +125 -0
  220. package/dist/block-renderers.d.ts +22 -3
  221. package/dist/block-renderers.d.ts.map +1 -1
  222. package/dist/block-renderers.js.map +1 -1
  223. package/dist/client.d.ts +17 -1
  224. package/dist/client.d.ts.map +1 -1
  225. package/dist/client.js +63 -9
  226. package/dist/client.js.map +1 -1
  227. package/dist/composition.d.ts +14 -0
  228. package/dist/composition.d.ts.map +1 -0
  229. package/dist/composition.js +125 -0
  230. package/dist/composition.js.map +1 -0
  231. package/dist/default-blocks.d.ts +9 -0
  232. package/dist/default-blocks.d.ts.map +1 -0
  233. package/dist/default-blocks.js +120 -0
  234. package/dist/default-blocks.js.map +1 -0
  235. package/dist/env.d.ts +9 -0
  236. package/dist/env.d.ts.map +1 -1
  237. package/dist/env.js +20 -0
  238. package/dist/env.js.map +1 -1
  239. package/dist/index.d.ts +8 -0
  240. package/dist/index.d.ts.map +1 -1
  241. package/dist/index.js +7 -0
  242. package/dist/index.js.map +1 -1
  243. package/dist/links.d.ts +5 -0
  244. package/dist/links.d.ts.map +1 -0
  245. package/dist/links.js +32 -0
  246. package/dist/links.js.map +1 -0
  247. package/dist/media.d.ts +28 -0
  248. package/dist/media.d.ts.map +1 -0
  249. package/dist/media.js +212 -0
  250. package/dist/media.js.map +1 -0
  251. package/dist/motion-preference.d.ts +50 -0
  252. package/dist/motion-preference.d.ts.map +1 -0
  253. package/dist/motion-preference.js +132 -0
  254. package/dist/motion-preference.js.map +1 -0
  255. package/dist/preferences-runtime.d.ts +3 -0
  256. package/dist/preferences-runtime.d.ts.map +1 -0
  257. package/dist/preferences-runtime.js +23 -0
  258. package/dist/preferences-runtime.js.map +1 -0
  259. package/dist/preferences-styleflow.d.ts +3 -0
  260. package/dist/preferences-styleflow.d.ts.map +1 -0
  261. package/dist/preferences-styleflow.js +14 -0
  262. package/dist/preferences-styleflow.js.map +1 -0
  263. package/dist/preferences.d.ts +4 -0
  264. package/dist/preferences.d.ts.map +1 -0
  265. package/dist/preferences.js +4 -0
  266. package/dist/preferences.js.map +1 -0
  267. package/dist/reserved-area.d.ts +10 -0
  268. package/dist/reserved-area.d.ts.map +1 -0
  269. package/dist/reserved-area.js +93 -0
  270. package/dist/reserved-area.js.map +1 -0
  271. package/dist/styleflow.d.ts +18 -1
  272. package/dist/styleflow.d.ts.map +1 -1
  273. package/dist/styleflow.js +82 -11
  274. package/dist/styleflow.js.map +1 -1
  275. package/dist/svg-media-runtime.d.ts +3 -0
  276. package/dist/svg-media-runtime.d.ts.map +1 -0
  277. package/dist/svg-media-runtime.js +33 -0
  278. package/dist/svg-media-runtime.js.map +1 -0
  279. package/dist/svg-media-types.d.ts +11 -0
  280. package/dist/svg-media-types.d.ts.map +1 -0
  281. package/dist/svg-media-types.js +2 -0
  282. package/dist/svg-media-types.js.map +1 -0
  283. package/dist/svg-media.d.ts +10 -0
  284. package/dist/svg-media.d.ts.map +1 -0
  285. package/dist/svg-media.js +34 -0
  286. package/dist/svg-media.js.map +1 -0
  287. package/dist/templates.d.ts +16 -16
  288. package/dist/text.d.ts +3 -0
  289. package/dist/text.d.ts.map +1 -0
  290. package/dist/text.js +6 -0
  291. package/dist/text.js.map +1 -0
  292. package/dist/theme-runtime.d.ts +16 -0
  293. package/dist/theme-runtime.d.ts.map +1 -0
  294. package/dist/theme-runtime.js +100 -0
  295. package/dist/theme-runtime.js.map +1 -0
  296. package/dist/tsconfig.tsbuildinfo +1 -1
  297. package/dist/types.d.ts +84 -1
  298. package/dist/types.d.ts.map +1 -1
  299. package/dist/types.js.map +1 -1
  300. package/dist/vivid-colors-preference.d.ts +31 -0
  301. package/dist/vivid-colors-preference.d.ts.map +1 -0
  302. package/dist/vivid-colors-preference.js +102 -0
  303. package/dist/vivid-colors-preference.js.map +1 -0
  304. package/package.json +53 -4
@@ -0,0 +1,26 @@
1
+ ---
2
+ import Toggle from "./Toggle.astro";
3
+
4
+ /**
5
+ * Vivid-colors switch (checked means full saturation). State and persistence
6
+ * live in vivid-colors-preference.ts and are mirrored on
7
+ * `<html data-sf-vivid-colors>`.
8
+ */
9
+ interface Props {
10
+ label?: string | undefined;
11
+ /** Id of a visible label; it then names the switch instead of `label`. */
12
+ labelledby?: string | undefined;
13
+ class?: string | undefined;
14
+ [attribute: string]: unknown;
15
+ }
16
+
17
+ const { label = "Vivid colors", labelledby, class: className, ...attributes } = Astro.props;
18
+ ---
19
+
20
+ <Toggle {...attributes} label={label} labelledby={labelledby} class={className} data-sf-vivid-colors-toggle />
21
+
22
+
23
+ <script>
24
+ import { startFlowpressPreferencesRuntime } from "../../preferences-runtime.js";
25
+ startFlowpressPreferencesRuntime();
26
+ </script>
@@ -0,0 +1,27 @@
1
+ ---
2
+ import Toggle from "./Toggle.astro";
3
+
4
+ /**
5
+ * Animations on/off switch (checked means animations on). State and
6
+ * persistence live in motion-preference.ts: the choice is stored, mirrored on
7
+ * `<html data-sf-motion-preference>` and picked up live by blobs, reveals and
8
+ * the navigation drawer.
9
+ */
10
+ interface Props {
11
+ label?: string | undefined;
12
+ /** Id of a visible label; it then names the switch instead of `label`. */
13
+ labelledby?: string | undefined;
14
+ class?: string | undefined;
15
+ [attribute: string]: unknown;
16
+ }
17
+
18
+ const { label = "Animations", labelledby, class: className, ...attributes } = Astro.props;
19
+ ---
20
+
21
+ <Toggle {...attributes} label={label} labelledby={labelledby} class={className} data-sf-motion-toggle />
22
+
23
+
24
+ <script>
25
+ import { startFlowpressPreferencesRuntime } from "../../preferences-runtime.js";
26
+ startFlowpressPreferencesRuntime();
27
+ </script>
@@ -0,0 +1,9 @@
1
+ ---
2
+ import { motionPreferenceBootstrapScript, vividColorsBootstrapScript } from "../../preferences.js";
3
+ ---
4
+ <script is:inline set:html={motionPreferenceBootstrapScript()}></script>
5
+ <script is:inline set:html={vividColorsBootstrapScript()}></script>
6
+ <script>
7
+ import { startFlowpressPreferencesRuntime } from "../../preferences-runtime.js";
8
+ startFlowpressPreferencesRuntime();
9
+ </script>
@@ -0,0 +1,30 @@
1
+ ---
2
+ import Toggle from "./Toggle.astro";
3
+
4
+ /**
5
+ * Dark/light switch. The theme itself belongs to the FlowPress theme runtime,
6
+ * which binds every `[data-styleflow-theme-toggle]` and flips
7
+ * `<html data-styleflow-theme>`; this component only renders the switch and
8
+ * keeps `aria-checked` in step (checked means the dark theme).
9
+ */
10
+ interface Props {
11
+ label?: string | undefined;
12
+ /** Id of a visible label; it then names the switch instead of `label`. */
13
+ labelledby?: string | undefined;
14
+ class?: string | undefined;
15
+ [attribute: string]: unknown;
16
+ }
17
+
18
+ const { label = "Change color theme", labelledby, class: className, ...attributes } = Astro.props;
19
+ ---
20
+
21
+ <Toggle {...attributes} label={label} labelledby={labelledby} class={className} data-styleflow-theme-toggle data-styleflow-theme-toggle-target="dark">
22
+ <svg slot="thumb" class="sf-toggle__glyph sf-toggle__glyph--off" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
23
+ <circle cx="12" cy="12" r="4.5"></circle>
24
+ <path d="M12 2.5v2M12 19.5v2M4.6 4.6l1.4 1.4M18 18l1.4 1.4M2.5 12h2M19.5 12h2M4.6 19.4L6 18M18 6l1.4-1.4"></path>
25
+ </svg>
26
+ <svg slot="thumb" class="sf-toggle__glyph sf-toggle__glyph--on" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
27
+ <path d="M20.5 13.2A8.5 8.5 0 1 1 10.8 3.5a6.7 6.7 0 0 0 9.7 9.7z"></path>
28
+ </svg>
29
+ </Toggle>
30
+
@@ -0,0 +1,50 @@
1
+ ---
2
+ import StyleflowElement from "../StyleflowElement.astro";
3
+ import "./preferences.css";
4
+ import { preferencesStyleflow } from "../../preferences-styleflow.js";
5
+
6
+ /**
7
+ * iOS-style switch: a track that cross-fades from neutral to the main tone and a
8
+ * thumb that slides across. It owns semantics (`role="switch"`, `aria-checked`)
9
+ * and looks, not state: whoever uses it flips `aria-checked` (see ThemeToggle,
10
+ * MotionToggle). Colours come from Styleflow props only; the "on" look lives
11
+ * in preferences.css so a toggle can also mirror document state before scripts run.
12
+ *
13
+ * Name it with `label` (aria-label) or, when a visible label sits next to it,
14
+ * with `labelledby` (id of that label).
15
+ */
16
+ interface Props {
17
+ label?: string | undefined;
18
+ labelledby?: string | undefined;
19
+ checked?: boolean | undefined;
20
+ class?: string | undefined;
21
+ [attribute: string]: unknown;
22
+ }
23
+
24
+ const { label, labelledby, checked = false, class: className, ...attributes } = Astro.props;
25
+ const off = preferencesStyleflow({tone:"neutral",intensity:"soft-1",surface:"sunken"},{tone:"neutral",intensity:"base",surface:"default"});
26
+ const on = preferencesStyleflow({tone:"main",intensity:"strong-2",surface:"default"},{tone:"main",intensity:"base",surface:"default"});
27
+ const thumb = preferencesStyleflow({tone:"neutral",intensity:"soft-3",surface:"raised"},{tone:"neutral",intensity:"soft-2",surface:"raised"},{tone:"neutral",intensity:"base",surface:"default"});
28
+ ---
29
+
30
+ <StyleflowElement as="button"
31
+ {...attributes}
32
+ type="button"
33
+ role="switch"
34
+ aria-checked={checked ? "true" : "false"}
35
+ aria-label={labelledby ? undefined : label}
36
+ aria-labelledby={labelledby}
37
+ foreground="primary"
38
+ layoutRole="none"
39
+ density="compact"
40
+ interactivePriority="tertiary"
41
+ noPadding
42
+ noBackground
43
+ class:list={["sf-toggle", className]}
44
+ >
45
+ <StyleflowElement as="span" aria-hidden="true" {...off} layoutRole="none" class="sf-toggle__track"></StyleflowElement>
46
+ <StyleflowElement as="span" aria-hidden="true" {...on} layoutRole="none" class="sf-toggle__track sf-toggle__track--on"></StyleflowElement>
47
+ <StyleflowElement as="span" aria-hidden="true" {...thumb} layoutRole="none" class="sf-toggle__thumb">
48
+ <slot name="thumb" />
49
+ </StyleflowElement>
50
+ </StyleflowElement>
@@ -0,0 +1,125 @@
1
+ /*
2
+ * Toggle: state and geometry live here; colours come from StyleFlow props.
3
+ *
4
+ * `--sf-toggle-on` is 1 when the switch reads "on". Besides `aria-checked`, the
5
+ * theme and motion switches mirror the document (`<html>` attributes set by the
6
+ * head bootstrap scripts), so they are right from first paint and never slide
7
+ * into place after the page loads.
8
+ */
9
+ .sf-toggle {
10
+ --sf-toggle-on: 0;
11
+ --sf-toggle-travel: 1.25rem;
12
+ --sf-toggle-direction: 1;
13
+ }
14
+
15
+ .sf-toggle:dir(rtl) {
16
+ --sf-toggle-direction: -1;
17
+ }
18
+
19
+ .sf-toggle[aria-checked="true"],
20
+ html[data-styleflow-theme="dark"] .sf-toggle[data-styleflow-theme-toggle],
21
+ html[data-sf-motion-preference="full"] .sf-toggle[data-sf-motion-toggle],
22
+ html[data-sf-vivid-colors="true"] .sf-toggle[data-sf-vivid-colors-toggle] {
23
+ --sf-toggle-on: 1;
24
+ }
25
+
26
+ .sf-toggle__track--on {
27
+ opacity: var(--sf-toggle-on);
28
+ transition: opacity var(--sf-motion-duration-default, 180ms) var(--sf-motion-ease-standard, ease);
29
+ }
30
+
31
+ /* A ring keeps the "off" track readable against the panel in both themes. */
32
+ .sf-toggle__track:not(.sf-toggle__track--on) {
33
+ box-shadow: inset 0 0 0 0.0625rem var(--sf-border);
34
+ }
35
+
36
+ .sf-toggle__thumb {
37
+ box-shadow: 0 0.0625rem 0.25rem color-mix(in srgb, var(--sf-foreground-primary) 45%, transparent);
38
+ transform: translateX(calc(var(--sf-toggle-on) * var(--sf-toggle-travel) * var(--sf-toggle-direction)));
39
+ transition:
40
+ transform var(--sf-motion-duration-default, 180ms) var(--sf-motion-ease-out, ease-out),
41
+ scale var(--sf-motion-duration-fast, 120ms) var(--sf-motion-ease-out, ease-out);
42
+ }
43
+
44
+ .sf-toggle:active .sf-toggle__thumb {
45
+ scale: 1.08 1;
46
+ }
47
+
48
+ /* Optional thumb glyphs: one per state, cross-fading with the thumb. */
49
+ .sf-toggle__glyph {
50
+ position: absolute;
51
+ inline-size: 1rem;
52
+ block-size: 1rem;
53
+ transition: opacity var(--sf-motion-duration-default, 180ms) var(--sf-motion-ease-standard, ease);
54
+ }
55
+
56
+ .sf-toggle__glyph--off {
57
+ opacity: calc(1 - var(--sf-toggle-on));
58
+ }
59
+
60
+ .sf-toggle__glyph--on {
61
+ opacity: var(--sf-toggle-on);
62
+ }
63
+
64
+ /*
65
+ * Accessibility panel: the closed/open states and the lift under the round
66
+ * button. Colours are Styleflow tokens (set by the S props in the markup); the
67
+ * shadow is derived from the foreground token so it follows the theme.
68
+ * Transitions stop on their own when animations are off (motion.css).
69
+ */
70
+ html[data-sf-vivid-colors="false"] {
71
+ filter: saturate(30%);
72
+ }
73
+
74
+ .sf-a11y__trigger {
75
+ box-shadow: 0 0.375rem 1.25rem color-mix(in srgb, var(--sf-surface-default-foreground-primary) 28%, transparent);
76
+ transition: transform var(--sf-motion-duration-default, 180ms) var(--sf-motion-ease-out, ease-out);
77
+ }
78
+
79
+ .sf-a11y__trigger:active {
80
+ transform: scale(0.94);
81
+ }
82
+
83
+ .sf-a11y__panel {
84
+ box-shadow: 0 0.75rem 2rem color-mix(in srgb, var(--sf-surface-default-foreground-primary) 22%, transparent);
85
+ transform-origin: bottom right;
86
+ transition:
87
+ opacity var(--sf-motion-duration-fast, 120ms) var(--sf-motion-ease-soft, ease),
88
+ transform var(--sf-motion-duration-default, 180ms) var(--sf-motion-ease-out, ease-out),
89
+ visibility 0s linear var(--sf-motion-duration-default, 180ms);
90
+ }
91
+
92
+ .sf-a11y__panel[data-state="closed"] {
93
+ opacity: 0;
94
+ transform: translateY(0.5rem) scale(0.96);
95
+ visibility: hidden;
96
+ }
97
+
98
+ .sf-a11y__panel[data-state="open"] {
99
+ opacity: 1;
100
+ transform: none;
101
+ transition-delay: 0s;
102
+ visibility: visible;
103
+ }
104
+
105
+ .sf-a11y__panel[data-state="open"]:dir(rtl) {
106
+ transform-origin: bottom left;
107
+ }
108
+
109
+ /* Geometry formerly supplied by the pilot Tailwind classes. */
110
+ .sf-toggle { position: relative; display: inline-block; block-size: 2rem; inline-size: 3.25rem; flex-shrink: 0; cursor: pointer; border-radius: 9999px !important; }
111
+ .sf-toggle__track { position: absolute; inset: 0; border-radius: 9999px !important; }
112
+ .sf-toggle__thumb { position: absolute; inset-inline-start: .125rem; inset-block-start: .125rem; display: grid; inline-size: 1.75rem; block-size: 1.75rem; place-items: center; border-radius: 9999px !important; }
113
+ .sf-a11y { position: fixed; inset-inline-end: var(--fp-preferences-inset, 1rem); inset-block-end: var(--fp-preferences-inset, 1rem); z-index: var(--fp-preferences-z-index, var(--z-floating, 50)); display: flex; flex-direction: column-reverse; align-items: flex-end; gap: .75rem; }
114
+ .sf-a11y[hidden] { display: none !important; }
115
+ .sf-a11y__trigger { display: grid; inline-size: 3.5rem; block-size: 3.5rem; flex-shrink: 0; place-items: center; cursor: pointer; border-radius: 9999px !important; }
116
+ .sf-a11y__icon { inline-size: 1.75rem; block-size: 1.75rem; }
117
+ .sf-a11y__panel { display: flex; flex-direction: column; inline-size: var(--fp-preferences-width, 18rem); max-inline-size: calc(100vw - 2rem); gap: 1rem; }
118
+ .sf-a11y__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
119
+ /* Inherited visibility must become focusable immediately, without an all transition. */
120
+ .sf-a11y__row, .sf-toggle { transition-property: color, background-color, border-color, box-shadow; }
121
+ .sf-toggle:focus-visible, .sf-a11y__trigger:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
122
+ html[data-sf-motion-preference="reduce"] :is(.sf-toggle, .sf-toggle *, .sf-a11y, .sf-a11y *) { transition: none !important; }
123
+ @media print { .sf-a11y { display: none !important; } }
124
+
125
+ .flowpress-theme-control { display: inline-flex; align-items: center; gap: .5rem; }
@@ -1,9 +1,21 @@
1
1
  import type { AstroComponentFactory } from "astro/runtime/server/index.js";
2
- import type { StyleflowContract } from "./styleflow.js";
3
- import type { FlowpressBlock } from "./types.js";
2
+ import type { DynamicStyleflowProps, StyleflowContract } from "./styleflow.js";
3
+ import type { FlowpressBlock, FlowpressBlockHtmlProps, FlowpressBlockAdapterStatus, FlowpressBlockClass, FlowpressCompositionV1 } from "./types.js";
4
4
  export interface FlowpressBlockRendererProps {
5
5
  block: FlowpressBlock;
6
- contract?: StyleflowContract;
6
+ styleflowProps: DynamicStyleflowProps;
7
+ htmlProps: FlowpressBlockHtmlProps;
8
+ composition?: FlowpressCompositionV1 | undefined;
9
+ context: {
10
+ parentBlockName?: string;
11
+ depth: number;
12
+ production: boolean;
13
+ effectiveTone?: string | undefined;
14
+ inheritedTone?: string | undefined;
15
+ };
16
+ parentBlockName?: string;
17
+ contract?: StyleflowContract | undefined;
18
+ adapters?: FlowpressBlockAdapters | undefined;
7
19
  }
8
20
  export interface FlowpressIconRendererProps {
9
21
  name: string;
@@ -19,4 +31,11 @@ export interface FlowpressIconRendererProps {
19
31
  export type FlowpressBlockRenderer = AstroComponentFactory;
20
32
  export type FlowpressIconRenderer = AstroComponentFactory;
21
33
  export type FlowpressBlockRenderers = Readonly<Record<string, FlowpressBlockRenderer>>;
34
+ export interface FlowpressBlockAdapterDefinition {
35
+ renderer: FlowpressBlockRenderer;
36
+ status: FlowpressBlockAdapterStatus;
37
+ class: FlowpressBlockClass;
38
+ fingerprint: string;
39
+ }
40
+ export type FlowpressBlockAdapters = Readonly<Record<string, FlowpressBlockAdapterDefinition>>;
22
41
  //# sourceMappingURL=block-renderers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"block-renderers.d.ts","sourceRoot":"","sources":["../src/block-renderers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,C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IACF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC;CAC/C;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAE3D,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAE1D,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAC5C,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CACvC,CAAC;AAEF,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,EAAE,sBAAsB,CAAC;IACjC,MAAM,EAAE,2BAA2B,CAAC;IACpC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAC3C,MAAM,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAChD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"block-renderers.js","sourceRoot":"","sources":["../src/block-renderers.ts"],"names":[],"mappings":"","sourcesContent":["import type { AstroComponentFactory } from \"astro/runtime/server/index.js\";\nimport type { StyleflowContract } from \"./styleflow.js\";\nimport type { FlowpressBlock } from \"./types.js\";\n\nexport interface FlowpressBlockRendererProps {\n block: FlowpressBlock;\n contract?: StyleflowContract;\n}\n\nexport interface FlowpressIconRendererProps {\n name: string;\n display?: \"inline\" | \"block\";\n foreground?: string;\n tone?: string;\n intensity?: string | number;\n size?: number;\n label?: string;\n id?: string;\n class?: string;\n}\n\nexport type FlowpressBlockRenderer = AstroComponentFactory;\n\nexport type FlowpressIconRenderer = AstroComponentFactory;\n\nexport type FlowpressBlockRenderers = Readonly<\n Record<string, FlowpressBlockRenderer>\n>;\n"]}
1
+ {"version":3,"file":"block-renderers.js","sourceRoot":"","sources":["../src/block-renderers.ts"],"names":[],"mappings":"","sourcesContent":["import type { AstroComponentFactory } from \"astro/runtime/server/index.js\";\nimport type { DynamicStyleflowProps, StyleflowContract } from \"./styleflow.js\";\nimport type {\n FlowpressBlock,\n FlowpressBlockHtmlProps,\n FlowpressBlockAdapterStatus,\n FlowpressBlockClass,\n FlowpressCompositionV1\n} from \"./types.js\";\n\nexport interface FlowpressBlockRendererProps {\n block: FlowpressBlock;\n styleflowProps: DynamicStyleflowProps;\n htmlProps: FlowpressBlockHtmlProps;\n composition?: FlowpressCompositionV1 | undefined;\n context: {\n parentBlockName?: string;\n depth: number;\n production: boolean;\n effectiveTone?: string | undefined;\n inheritedTone?: string | undefined;\n };\n parentBlockName?: string;\n contract?: StyleflowContract | undefined;\n adapters?: FlowpressBlockAdapters | undefined;\n}\n\nexport interface FlowpressIconRendererProps {\n name: string;\n display?: \"inline\" | \"block\";\n foreground?: string;\n tone?: string;\n intensity?: string | number;\n size?: number;\n label?: string;\n id?: string;\n class?: string;\n}\n\nexport type FlowpressBlockRenderer = AstroComponentFactory;\n\nexport type FlowpressIconRenderer = AstroComponentFactory;\n\nexport type FlowpressBlockRenderers = Readonly<\n Record<string, FlowpressBlockRenderer>\n>;\n\nexport interface FlowpressBlockAdapterDefinition {\n renderer: FlowpressBlockRenderer;\n status: FlowpressBlockAdapterStatus;\n class: FlowpressBlockClass;\n fingerprint: string;\n}\n\nexport type FlowpressBlockAdapters = Readonly<\n Record<string, FlowpressBlockAdapterDefinition>\n>;\n"]}
package/dist/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { FlowpressCapabilities, FlowpressContent, FlowpressRoute } from "./types.js";
1
+ import type { FlowpressCapabilities, FlowpressCompositionV1, FlowpressContent, FlowpressRoute } from "./types.js";
2
2
  export interface FlowpressGraphqlIssue {
3
3
  message?: string;
4
4
  extensions?: {
@@ -31,5 +31,21 @@ export declare class FlowpressClient {
31
31
  getRoute(uri: string, locale?: string): Promise<FlowpressRoute | null>;
32
32
  getRoutes(locale?: string): Promise<FlowpressRoute[]>;
33
33
  getContent(loader: string, variables: Record<string, unknown>): Promise<FlowpressContent | null>;
34
+ getComposition(uri: string, locale?: string, options?: {
35
+ includeContent?: boolean;
36
+ }): Promise<FlowpressCompositionV1 | null>;
37
+ /** Site Editor already returns route and content in its composition. No
38
+ * route preflight, retries or cross-request cache are needed for previews.
39
+ */
40
+ getPage(uri: string, options: {
41
+ mode: "site-editor" | "astro";
42
+ locale?: string;
43
+ route?: FlowpressRoute;
44
+ includeContent?: boolean;
45
+ }): Promise<{
46
+ route: FlowpressRoute;
47
+ content: FlowpressContent | null;
48
+ composition: FlowpressCompositionV1 | null;
49
+ } | null>;
34
50
  }
35
51
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE;QACX,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH;AAOD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,M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
@@ -209,6 +209,49 @@ export class FlowpressClient {
209
209
  projectFields: parseJson(projectFieldsJson, {})
210
210
  };
211
211
  }
212
+ async getComposition(uri, locale, options = {}) {
213
+ const data = await this.request(`query FlowpressComposition($uri: String!, $locale: String${options.includeContent === false ? ", $includeContent: Boolean" : ""}) {
214
+ sfCompositionByUri(uri: $uri, locale: $locale${options.includeContent === false ? ", includeContent: $includeContent" : ""}) {
215
+ version sourceDigest locale templateJson blocksJson stylesheetsJson blockTypesJson
216
+ diagnosticsJson routeJson contentJson
217
+ }
218
+ }`, { uri, locale: locale ?? null, ...(options.includeContent === false ? { includeContent: false } : {}) });
219
+ const wire = data.sfCompositionByUri;
220
+ if (!wire)
221
+ return null;
222
+ const route = parseRequiredJson(wire.routeJson, "routeJson");
223
+ return {
224
+ version: wire.version,
225
+ sourceDigest: wire.sourceDigest,
226
+ locale: wire.locale ?? null,
227
+ template: parseRequiredJson(wire.templateJson, "templateJson"),
228
+ blocks: parseRequiredJson(wire.blocksJson, "blocksJson"),
229
+ stylesheets: parseRequiredJson(wire.stylesheetsJson, "stylesheetsJson"),
230
+ blockTypes: parseRequiredJson(wire.blockTypesJson, "blockTypesJson"),
231
+ diagnostics: parseRequiredJson(wire.diagnosticsJson, "diagnosticsJson"),
232
+ route: { ...route, seo: normalizeGraphqlSeo(route.seo) },
233
+ content: parseJson(wire.contentJson, null)
234
+ };
235
+ }
236
+ /** Site Editor already returns route and content in its composition. No
237
+ * route preflight, retries or cross-request cache are needed for previews.
238
+ */
239
+ async getPage(uri, options) {
240
+ if (options.mode === "site-editor") {
241
+ const composition = await this.getComposition(uri, options.locale, options);
242
+ return composition ? { route: composition.route, content: composition.content ?? null, composition } : null;
243
+ }
244
+ const route = options.route ?? await this.getRoute(uri, options.locale);
245
+ if (!route)
246
+ return null;
247
+ const content = route.content?.loader ? await this.getContent(route.content.loader, {
248
+ databaseId: route.content.databaseId ?? route.databaseId,
249
+ termId: route.content.termId ?? route.termId,
250
+ uri: route.uri,
251
+ locale: route.locale ?? options.locale
252
+ }) : null;
253
+ return { route, content, composition: null };
254
+ }
212
255
  }
213
256
  function getOperationName(query) {
214
257
  return query.match(/\b(?:query|mutation|subscription)\s+([_A-Za-z][_0-9A-Za-z]*)/)?.[1] || "AnonymousOperation";
@@ -224,25 +267,28 @@ function sanitizeEndpoint(endpoint) {
224
267
  function normalizeGraphqlSeo(seo) {
225
268
  if (!seo)
226
269
  return null;
227
- const social = (value) => value
228
- ? {
270
+ const social = (value) => {
271
+ if (!value)
272
+ return null;
273
+ const source = value.image;
274
+ const { altText, ...image } = source ?? {};
275
+ return {
229
276
  title: value.title ?? null,
230
277
  description: value.description ?? null,
231
- image: value.image
232
- ? { url: value.image.url, alt: value.image.altText ?? null }
233
- : null
234
- }
235
- : null;
278
+ image: source ? { ...image, url: source.url, alt: altText ?? source.alt ?? null } : null
279
+ };
280
+ };
236
281
  return {
237
282
  title: seo.title ?? null,
238
283
  description: seo.description ?? null,
239
284
  canonicalUrl: seo.canonicalUrl ?? null,
240
285
  robots: seo.robots ?? null,
241
286
  headHtml: seo.headHtml ?? null,
242
- jsonLd: parseJson(seo.jsonLd?.raw, null),
287
+ jsonLd: seo.jsonLd && typeof seo.jsonLd === "object" && "raw" in seo.jsonLd
288
+ ? parseJson(seo.jsonLd.raw, null) : seo.jsonLd ?? null,
243
289
  hreflang: seo.hreflang ?? null,
244
290
  openGraph: social(seo.openGraph),
245
- twitter: social(seo.twitterMeta)
291
+ twitter: social("twitterMeta" in seo ? seo.twitterMeta : seo.twitter)
246
292
  };
247
293
  }
248
294
  function parseJson(value, fallback) {
@@ -255,4 +301,12 @@ function parseJson(value, fallback) {
255
301
  return fallback;
256
302
  }
257
303
  }
304
+ function parseRequiredJson(value, field) {
305
+ try {
306
+ return JSON.parse(value);
307
+ }
308
+ catch (error) {
309
+ throw new FlowpressGraphqlError(`FlowPress composition field ${field} is not valid JSON.`, undefined, undefined, "FlowpressComposition", undefined, error);
310
+ }
311
+ }
258
312
  //# source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,KAAK,EAAE,GAAG,CAAC,KAAK,IAAI,IAAI;QACxB,WAAW,EAAE,GAAG,CAAC,WAAW,IAAI,IAAI;QACpC,YAAY,EAAE,GAAG,CAAC,YAAY,IAAI,IAAI;QACtC,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,IAAI;QAC1B,QAAQ,EAAE,GAAG,CAAC,QAAQ,IAAI,IAAI;QAC9B,MAAM,EAAE,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC;QACxC,QAAQ,EAAE,GAAG,CAAC,QAAQ,IAAI,IAAI;QAC9B,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC;QAChC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC;KACjC,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAI,KAAgC,EAAE,QAAW;IACjE,IAAI,CAAC,KAAK;QAAE,OAAO,QAAQ,CAAC;IAC5B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAM,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC","sourcesContent":["import type {\n FlowpressCapabilities,\n FlowpressContent,\n FlowpressRoute\n} from \"./types.js\";\n\nexport interface FlowpressGraphqlIssue {\n message?: string;\n extensions?: {\n debugMessage?: string;\n category?: string;\n [key: string]: unknown;\n };\n}\n\ninterface GraphqlResponse<T> {\n data?: T;\n errors?: FlowpressGraphqlIssue[];\n}\n\nexport interface FlowpressClientOptions {\n endpoint: string;\n timeoutMs?: number;\n headers?: Record<string, string>;\n debug?: boolean;\n}\n\nexport class FlowpressGraphqlError extends Error {\n constructor(\n message: string,\n readonly status?: number,\n readonly errors?: FlowpressGraphqlIssue[],\n readonly operationName?: string,\n readonly endpoint?: string,\n cause?: unknown\n ) {\n super(message, cause === undefined ? undefined : { cause });\n this.name = \"FlowpressGraphqlError\";\n }\n}\n\nexport class FlowpressClient {\n readonly endpoint: string;\n readonly timeoutMs: number;\n readonly headers: Record<string, string>;\n readonly debug: boolean;\n\n constructor(options: FlowpressClientOptions) {\n const endpoint = options.endpoint.trim();\n if (!endpoint) {\n throw new Error(\"FlowPress GraphQL endpoint is required.\");\n }\n\n new URL(endpoint);\n this.endpoint = endpoint;\n this.timeoutMs = options.timeoutMs ?? 15_000;\n this.headers = { ...options.headers };\n this.debug = options.debug ?? false;\n }\n\n async request<T>(\n query: string,\n variables: Record<string, unknown> = {}\n ): Promise<T> {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeoutMs);\n const operationName = getOperationName(query);\n const safeEndpoint = sanitizeEndpoint(this.endpoint);\n\n try {\n let response: Response;\n try {\n response = await fetch(this.endpoint, {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n ...this.headers\n },\n body: JSON.stringify({ query, variables }),\n signal: controller.signal\n });\n } catch (error) {\n const timedOut = controller.signal.aborted;\n const detail = error instanceof Error && error.message\n ? ` ${error.message}`\n : \"\";\n throw new FlowpressGraphqlError(\n timedOut\n ? `FlowPress GraphQL ${operationName} timed out after ${this.timeoutMs}ms at ${safeEndpoint}.`\n : `FlowPress GraphQL ${operationName} could not reach ${safeEndpoint}.${detail}`,\n undefined,\n undefined,\n operationName,\n safeEndpoint,\n error\n );\n }\n\n const body = await response.text();\n let payload: GraphqlResponse<T>;\n try {\n payload = JSON.parse(body) as GraphqlResponse<T>;\n } catch (error) {\n const contentType = response.headers.get(\"content-type\") || \"unknown content type\";\n throw new FlowpressGraphqlError(\n `FlowPress GraphQL ${operationName} returned ${response.status} `\n + `with ${contentType}, not JSON, from ${safeEndpoint}.`,\n response.status,\n undefined,\n operationName,\n safeEndpoint,\n error\n );\n }\n\n if (!response.ok || payload.errors?.length || payload.data === undefined) {\n const errors: FlowpressGraphqlIssue[] | undefined = payload.errors?.map(\n (error) => {\n if (this.debug) {\n return error;\n }\n return error.message ? { message: error.message } : {};\n }\n );\n const messages = errors\n ?.flatMap((error) => [\n error.message,\n this.debug ? error.extensions?.debugMessage : undefined\n ])\n .filter((message): message is string => Boolean(message));\n throw new FlowpressGraphqlError(\n messages?.join(\"; \")\n || `FlowPress GraphQL ${operationName} failed with ${response.status} at ${safeEndpoint}.`,\n response.status,\n errors,\n operationName,\n safeEndpoint\n );\n }\n\n return payload.data;\n } finally {\n clearTimeout(timer);\n }\n }\n\n async getCapabilities(): Promise<FlowpressCapabilities> {\n const data = await this.request<{ styleflowCapabilities: FlowpressCapabilities }>(\n `query FlowpressCapabilities {\n styleflowCapabilities {\n schemaVersion\n wpGraphql\n acfPro\n wpGraphqlAcf\n rankMath\n wpml\n woocommerce\n contactForm7\n defaultLocale\n locales { code slug homeUrl }\n features { id version enabled capabilities configJson }\n }\n }`\n );\n return {\n ...data.styleflowCapabilities,\n features: (data.styleflowCapabilities.features ?? []).map((feature) => {\n const wire = feature as typeof feature & { configJson?: string | null };\n let config: Record<string, unknown> = {};\n if (wire.configJson) {\n try {\n const parsed = JSON.parse(wire.configJson);\n if (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n config = parsed as Record<string, unknown>;\n }\n } catch {\n config = {};\n }\n }\n return {\n id: feature.id,\n version: feature.version ?? null,\n enabled: feature.enabled,\n capabilities: feature.capabilities ?? [],\n config\n };\n })\n };\n }\n\n async getRoute(uri: string, locale?: string): Promise<FlowpressRoute | null> {\n const data = await this.request<{\n sfRouteByUri: (Omit<FlowpressRoute, \"seo\"> & {\n seo?: GraphqlSeo | null;\n }) | null;\n }>(\n `query FlowpressRoute($uri: String!, $locale: String) {\n sfRouteByUri(uri: $uri, locale: $locale) {\n uri status queryType locale isFrontPage isPostsPage frontPageMode\n postType taxonomy slug term databaseId termId authorNicename authorId\n pageTemplate mimeType postFormat templateCandidates\n content { loader databaseId termId }\n seo {\n title description canonicalUrl robots headHtml\n hreflang { locale url }\n jsonLd { raw }\n openGraph { title description image { url altText } }\n twitterMeta { title description image { url altText } }\n }\n }\n }`,\n { uri, locale: locale ?? null }\n );\n if (!data.sfRouteByUri) {\n return null;\n }\n return {\n ...data.sfRouteByUri,\n seo: normalizeGraphqlSeo(data.sfRouteByUri.seo)\n };\n }\n\n async getRoutes(locale?: string): Promise<FlowpressRoute[]> {\n const data = await this.request<{\n sfRoutes: Array<Omit<FlowpressRoute, \"seo\"> & {\n seo?: GraphqlSeo | null;\n }>;\n }>(\n `query FlowpressRoutes($locale: String) {\n sfRoutes(locale: $locale) {\n uri status queryType locale isFrontPage isPostsPage frontPageMode\n postType taxonomy slug term databaseId termId authorNicename authorId\n pageTemplate mimeType postFormat templateCandidates\n content { loader databaseId termId }\n seo {\n title description canonicalUrl robots headHtml\n hreflang { locale url }\n jsonLd { raw }\n openGraph { title description image { url altText } }\n twitterMeta { title description image { url altText } }\n }\n }\n }`,\n { locale: locale ?? null }\n );\n return data.sfRoutes.map((route) => ({\n ...route,\n seo: normalizeGraphqlSeo(route.seo)\n }));\n }\n\n async getContent(\n loader: string,\n variables: Record<string, unknown>\n ): Promise<FlowpressContent | null> {\n const data = await this.request<{\n sfContentByLoader: (Omit<FlowpressContent, \"contentBlocks\"> & {\n contentBlocksJson?: string | null;\n projectFieldsJson?: string | null;\n }) | null;\n }>(\n `query FlowpressContent(\n $loader: String!,\n $databaseId: Int,\n $termId: Int,\n $uri: String,\n $locale: String\n ) {\n sfContentByLoader(\n loader: $loader,\n databaseId: $databaseId,\n termId: $termId,\n uri: $uri,\n locale: $locale\n ) {\n title excerpt content contentBlocksJson projectFieldsJson\n }\n }`,\n {\n loader,\n databaseId: variables.databaseId ?? null,\n termId: variables.termId ?? null,\n uri: variables.uri ?? null,\n locale: variables.locale ?? null\n }\n );\n const content = data.sfContentByLoader;\n if (!content) {\n return null;\n }\n const { contentBlocksJson, projectFieldsJson, ...rest } = content;\n return {\n ...rest,\n contentBlocks: parseJson(contentBlocksJson, []),\n projectFields: parseJson(projectFieldsJson, {})\n };\n }\n}\n\nfunction getOperationName(query: string): string {\n return query.match(\n /\\b(?:query|mutation|subscription)\\s+([_A-Za-z][_0-9A-Za-z]*)/\n )?.[1] || \"AnonymousOperation\";\n}\n\nfunction sanitizeEndpoint(endpoint: string): string {\n const url = new URL(endpoint);\n url.username = \"\";\n url.password = \"\";\n url.search = \"\";\n url.hash = \"\";\n return url.toString();\n}\n\ninterface GraphqlSeo {\n title?: string | null;\n description?: string | null;\n canonicalUrl?: string | null;\n robots?: string[] | null;\n headHtml?: string | null;\n jsonLd?: { raw?: string | null } | null;\n openGraph?: GraphqlSocial | null;\n twitterMeta?: GraphqlSocial | null;\n hreflang?: Array<{ locale: string; url: string }> | null;\n}\n\ninterface GraphqlSocial {\n title?: string | null;\n description?: string | null;\n image?: { url: string; altText?: string | null } | null;\n}\n\nfunction normalizeGraphqlSeo(seo?: GraphqlSeo | null) {\n if (!seo) return null;\n const social = (value?: GraphqlSocial | null) => value\n ? {\n title: value.title ?? null,\n description: value.description ?? null,\n image: value.image\n ? { url: value.image.url, alt: value.image.altText ?? null }\n : null\n }\n : null;\n\n return {\n title: seo.title ?? null,\n description: seo.description ?? null,\n canonicalUrl: seo.canonicalUrl ?? null,\n robots: seo.robots ?? null,\n headHtml: seo.headHtml ?? null,\n jsonLd: parseJson(seo.jsonLd?.raw, null),\n hreflang: seo.hreflang ?? null,\n openGraph: social(seo.openGraph),\n twitter: social(seo.twitterMeta)\n };\n}\n\nfunction parseJson<T>(value: string | null | undefined, fallback: T): T {\n if (!value) return fallback;\n try {\n return JSON.parse(value) as T;\n } catch {\n return fallback;\n }\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AA6BA,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAGnC;IACA;IACA;IACA;IALX,YACE,OAAe,EACN,MAAe,EACf,MAAgC,EAChC,aAAsB,EACtB,QAAiB,EAC1B,KAAe;QAEf,KAAK,CAAC,OAAO,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SA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AAM,IAAI,IAAI;QAC1B,QAAQ,EAAE,GAAG,CAAC,QAAQ,IAAI,IAAI;QAC9B,MAAM,EAAE,GAAG,CAAC,MAAM,IAAI,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,IAAI,KAAK,IAAI,GAAG,CAAC,MAAM;YACzE,CAAC,CAAC,SAAS,CAAE,GAAG,CAAC,MAAkC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,IAAI;QACrF,QAAQ,EAAE,GAAG,CAAC,QAAQ,IAAI,IAAI;QAC9B,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC;QAChC,OAAO,EAAE,MAAM,CAAC,aAAa,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAE,GAAa,CAAC,OAAO,CAAC;KACjF,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAI,KAAgC,EAAE,QAAW;IACjE,IAAI,CAAC,KAAK;QAAE,OAAO,QAAQ,CAAC;IAC5B,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAM,CAAC;IAChC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAS,iBAAiB,CAAI,KAAa,EAAE,KAAa;IACxD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAM,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,qBAAqB,CAC7B,+BAA+B,KAAK,qBAAqB,EACzD,SAAS,EACT,SAAS,EACT,sBAAsB,EACtB,SAAS,EACT,KAAK,CACN,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import type {\n FlowpressCapabilities,\n FlowpressCompositionV1,\n FlowpressContent,\n FlowpressRoute,\n SfSeo\n} from \"./types.js\";\n\nexport interface FlowpressGraphqlIssue {\n message?: string;\n extensions?: {\n debugMessage?: string;\n category?: string;\n [key: string]: unknown;\n };\n}\n\ninterface GraphqlResponse<T> {\n data?: T;\n errors?: FlowpressGraphqlIssue[];\n}\n\nexport interface FlowpressClientOptions {\n endpoint: string;\n timeoutMs?: number;\n headers?: Record<string, string>;\n debug?: boolean;\n}\n\nexport class FlowpressGraphqlError extends Error {\n constructor(\n message: string,\n readonly status?: number,\n readonly errors?: FlowpressGraphqlIssue[],\n readonly operationName?: string,\n readonly endpoint?: string,\n cause?: unknown\n ) {\n super(message, cause === undefined ? undefined : { cause });\n this.name = \"FlowpressGraphqlError\";\n }\n}\n\nexport class FlowpressClient {\n readonly endpoint: string;\n readonly timeoutMs: number;\n readonly headers: Record<string, string>;\n readonly debug: boolean;\n\n constructor(options: FlowpressClientOptions) {\n const endpoint = options.endpoint.trim();\n if (!endpoint) {\n throw new Error(\"FlowPress GraphQL endpoint is required.\");\n }\n\n new URL(endpoint);\n this.endpoint = endpoint;\n this.timeoutMs = options.timeoutMs ?? 15_000;\n this.headers = { ...options.headers };\n this.debug = options.debug ?? false;\n }\n\n async request<T>(\n query: string,\n variables: Record<string, unknown> = {}\n ): Promise<T> {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), this.timeoutMs);\n const operationName = getOperationName(query);\n const safeEndpoint = sanitizeEndpoint(this.endpoint);\n\n try {\n let response: Response;\n try {\n response = await fetch(this.endpoint, {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n ...this.headers\n },\n body: JSON.stringify({ query, variables }),\n signal: controller.signal\n });\n } catch (error) {\n const timedOut = controller.signal.aborted;\n const detail = error instanceof Error && error.message\n ? ` ${error.message}`\n : \"\";\n throw new FlowpressGraphqlError(\n timedOut\n ? `FlowPress GraphQL ${operationName} timed out after ${this.timeoutMs}ms at ${safeEndpoint}.`\n : `FlowPress GraphQL ${operationName} could not reach ${safeEndpoint}.${detail}`,\n undefined,\n undefined,\n operationName,\n safeEndpoint,\n error\n );\n }\n\n const body = await response.text();\n let payload: GraphqlResponse<T>;\n try {\n payload = JSON.parse(body) as GraphqlResponse<T>;\n } catch (error) {\n const contentType = response.headers.get(\"content-type\") || \"unknown content type\";\n throw new FlowpressGraphqlError(\n `FlowPress GraphQL ${operationName} returned ${response.status} `\n + `with ${contentType}, not JSON, from ${safeEndpoint}.`,\n response.status,\n undefined,\n operationName,\n safeEndpoint,\n error\n );\n }\n\n if (!response.ok || payload.errors?.length || payload.data === undefined) {\n const errors: FlowpressGraphqlIssue[] | undefined = payload.errors?.map(\n (error) => {\n if (this.debug) {\n return error;\n }\n return error.message ? { message: error.message } : {};\n }\n );\n const messages = errors\n ?.flatMap((error) => [\n error.message,\n this.debug ? error.extensions?.debugMessage : undefined\n ])\n .filter((message): message is string => Boolean(message));\n throw new FlowpressGraphqlError(\n messages?.join(\"; \")\n || `FlowPress GraphQL ${operationName} failed with ${response.status} at ${safeEndpoint}.`,\n response.status,\n errors,\n operationName,\n safeEndpoint\n );\n }\n\n return payload.data;\n } finally {\n clearTimeout(timer);\n }\n }\n\n async getCapabilities(): Promise<FlowpressCapabilities> {\n const data = await this.request<{ styleflowCapabilities: FlowpressCapabilities }>(\n `query FlowpressCapabilities {\n styleflowCapabilities {\n schemaVersion\n wpGraphql\n acfPro\n wpGraphqlAcf\n rankMath\n wpml\n woocommerce\n contactForm7\n defaultLocale\n locales { code slug homeUrl }\n features { id version enabled capabilities configJson }\n }\n }`\n );\n return {\n ...data.styleflowCapabilities,\n features: (data.styleflowCapabilities.features ?? []).map((feature) => {\n const wire = feature as typeof feature & { configJson?: string | null };\n let config: Record<string, unknown> = {};\n if (wire.configJson) {\n try {\n const parsed = JSON.parse(wire.configJson);\n if (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n config = parsed as Record<string, unknown>;\n }\n } catch {\n config = {};\n }\n }\n return {\n id: feature.id,\n version: feature.version ?? null,\n enabled: feature.enabled,\n capabilities: feature.capabilities ?? [],\n config\n };\n })\n };\n }\n\n async getRoute(uri: string, locale?: string): Promise<FlowpressRoute | null> {\n const data = await this.request<{\n sfRouteByUri: (Omit<FlowpressRoute, \"seo\"> & {\n seo?: GraphqlSeo | null;\n }) | null;\n }>(\n `query FlowpressRoute($uri: String!, $locale: String) {\n sfRouteByUri(uri: $uri, locale: $locale) {\n uri status queryType locale isFrontPage isPostsPage frontPageMode\n postType taxonomy slug term databaseId termId authorNicename authorId\n pageTemplate mimeType postFormat templateCandidates\n content { loader databaseId termId }\n seo {\n title description canonicalUrl robots headHtml\n hreflang { locale url }\n jsonLd { raw }\n openGraph { title description image { url altText } }\n twitterMeta { title description image { url altText } }\n }\n }\n }`,\n { uri, locale: locale ?? null }\n );\n if (!data.sfRouteByUri) {\n return null;\n }\n return {\n ...data.sfRouteByUri,\n seo: normalizeGraphqlSeo(data.sfRouteByUri.seo)\n };\n }\n\n async getRoutes(locale?: string): Promise<FlowpressRoute[]> {\n const data = await this.request<{\n sfRoutes: Array<Omit<FlowpressRoute, \"seo\"> & {\n seo?: GraphqlSeo | null;\n }>;\n }>(\n `query FlowpressRoutes($locale: String) {\n sfRoutes(locale: $locale) {\n uri status queryType locale isFrontPage isPostsPage frontPageMode\n postType taxonomy slug term databaseId termId authorNicename authorId\n pageTemplate mimeType postFormat templateCandidates\n content { loader databaseId termId }\n seo {\n title description canonicalUrl robots headHtml\n hreflang { locale url }\n jsonLd { raw }\n openGraph { title description image { url altText } }\n twitterMeta { title description image { url altText } }\n }\n }\n }`,\n { locale: locale ?? null }\n );\n return data.sfRoutes.map((route) => ({\n ...route,\n seo: normalizeGraphqlSeo(route.seo)\n }));\n }\n\n async getContent(\n loader: string,\n variables: Record<string, unknown>\n ): Promise<FlowpressContent | null> {\n const data = await this.request<{\n sfContentByLoader: (Omit<FlowpressContent, \"contentBlocks\"> & {\n contentBlocksJson?: string | null;\n projectFieldsJson?: string | null;\n }) | null;\n }>(\n `query FlowpressContent(\n $loader: String!,\n $databaseId: Int,\n $termId: Int,\n $uri: String,\n $locale: String\n ) {\n sfContentByLoader(\n loader: $loader,\n databaseId: $databaseId,\n termId: $termId,\n uri: $uri,\n locale: $locale\n ) {\n title excerpt content contentBlocksJson projectFieldsJson\n }\n }`,\n {\n loader,\n databaseId: variables.databaseId ?? null,\n termId: variables.termId ?? null,\n uri: variables.uri ?? null,\n locale: variables.locale ?? null\n }\n );\n const content = data.sfContentByLoader;\n if (!content) {\n return null;\n }\n const { contentBlocksJson, projectFieldsJson, ...rest } = content;\n return {\n ...rest,\n contentBlocks: parseJson(contentBlocksJson, []),\n projectFields: parseJson(projectFieldsJson, {})\n };\n }\n\n async getComposition(uri: string, locale?: string, options: { includeContent?: boolean } = {}): Promise<FlowpressCompositionV1 | null> {\n const data = await this.request<{\n sfCompositionByUri: null | {\n version: \"1\";\n sourceDigest: string;\n locale?: string | null;\n templateJson: string;\n blocksJson: string;\n stylesheetsJson: string;\n blockTypesJson: string;\n diagnosticsJson: string;\n routeJson: string;\n contentJson?: string | null;\n };\n }>(\n `query FlowpressComposition($uri: String!, $locale: String${options.includeContent === false ? \", $includeContent: Boolean\" : \"\"}) {\n sfCompositionByUri(uri: $uri, locale: $locale${options.includeContent === false ? \", includeContent: $includeContent\" : \"\"}) {\n version sourceDigest locale templateJson blocksJson stylesheetsJson blockTypesJson\n diagnosticsJson routeJson contentJson\n }\n }`,\n { uri, locale: locale ?? null, ...(options.includeContent === false ? { includeContent: false } : {}) }\n );\n const wire = data.sfCompositionByUri;\n if (!wire) return null;\n const route = parseRequiredJson<Omit<FlowpressRoute, \"seo\"> & { seo?: GraphqlSeo | SfSeo | null }>(wire.routeJson, \"routeJson\");\n return {\n version: wire.version,\n sourceDigest: wire.sourceDigest,\n locale: wire.locale ?? null,\n template: parseRequiredJson(wire.templateJson, \"templateJson\"),\n blocks: parseRequiredJson(wire.blocksJson, \"blocksJson\"),\n stylesheets: parseRequiredJson(wire.stylesheetsJson, \"stylesheetsJson\"),\n blockTypes: parseRequiredJson(wire.blockTypesJson, \"blockTypesJson\"),\n diagnostics: parseRequiredJson(wire.diagnosticsJson, \"diagnosticsJson\"),\n route: { ...route, seo: normalizeGraphqlSeo(route.seo) },\n content: parseJson(wire.contentJson, null)\n };\n }\n\n /** Site Editor already returns route and content in its composition. No\n * route preflight, retries or cross-request cache are needed for previews.\n */\n async getPage(uri: string, options: {\n mode: \"site-editor\" | \"astro\";\n locale?: string;\n route?: FlowpressRoute;\n includeContent?: boolean;\n }): Promise<{ route: FlowpressRoute; content: FlowpressContent | null; composition: FlowpressCompositionV1 | null } | null> {\n if (options.mode === \"site-editor\") {\n const composition = await this.getComposition(uri, options.locale, options);\n return composition ? { route: composition.route, content: composition.content ?? null, composition } : null;\n }\n const route = options.route ?? await this.getRoute(uri, options.locale);\n if (!route) return null;\n const content = route.content?.loader ? await this.getContent(route.content.loader, {\n databaseId: route.content.databaseId ?? route.databaseId,\n termId: route.content.termId ?? route.termId,\n uri: route.uri,\n locale: route.locale ?? options.locale\n }) : null;\n return { route, content, composition: null };\n }\n\n}\n\nfunction getOperationName(query: string): string {\n return query.match(\n /\\b(?:query|mutation|subscription)\\s+([_A-Za-z][_0-9A-Za-z]*)/\n )?.[1] || \"AnonymousOperation\";\n}\n\nfunction sanitizeEndpoint(endpoint: string): string {\n const url = new URL(endpoint);\n url.username = \"\";\n url.password = \"\";\n url.search = \"\";\n url.hash = \"\";\n return url.toString();\n}\n\ninterface GraphqlSeo {\n title?: string | null;\n description?: string | null;\n canonicalUrl?: string | null;\n robots?: string[] | null;\n headHtml?: string | null;\n jsonLd?: { raw?: string | null } | null;\n openGraph?: GraphqlSocial | null;\n twitterMeta?: GraphqlSocial | null;\n hreflang?: Array<{ locale: string; url: string }> | null;\n}\n\ninterface GraphqlSocial {\n title?: string | null;\n description?: string | null;\n image?: { url: string; altText?: string | null } | null;\n}\n\nfunction normalizeGraphqlSeo(seo?: GraphqlSeo | SfSeo | null) {\n if (!seo) return null;\n const social = (value?: GraphqlSocial | SfSeo[\"openGraph\"] | null) => {\n if (!value) return null;\n const source = value.image as (NonNullable<NonNullable<SfSeo[\"openGraph\"]>[\"image\"]> & { altText?: string | null }) | null | undefined;\n const { altText, ...image } = source ?? {};\n return {\n title: value.title ?? null,\n description: value.description ?? null,\n image: source ? { ...image, url: source.url, alt: altText ?? source.alt ?? null } : null\n };\n };\n\n return {\n title: seo.title ?? null,\n description: seo.description ?? null,\n canonicalUrl: seo.canonicalUrl ?? null,\n robots: seo.robots ?? null,\n headHtml: seo.headHtml ?? null,\n jsonLd: seo.jsonLd && typeof seo.jsonLd === \"object\" && \"raw\" in seo.jsonLd\n ? parseJson((seo.jsonLd as { raw?: string | null }).raw, null) : seo.jsonLd ?? null,\n hreflang: seo.hreflang ?? null,\n openGraph: social(seo.openGraph),\n twitter: social(\"twitterMeta\" in seo ? seo.twitterMeta : (seo as SfSeo).twitter)\n };\n}\n\nfunction parseJson<T>(value: string | null | undefined, fallback: T): T {\n if (!value) return fallback;\n try {\n return JSON.parse(value) as T;\n } catch {\n return fallback;\n }\n}\n\nfunction parseRequiredJson<T>(value: string, field: string): T {\n try {\n return JSON.parse(value) as T;\n } catch (error) {\n throw new FlowpressGraphqlError(\n `FlowPress composition field ${field} is not valid JSON.`,\n undefined,\n undefined,\n \"FlowpressComposition\",\n undefined,\n error\n );\n }\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import type { FlowpressBlockAdapters } from "./block-renderers.js";
2
+ import type { FlowpressBlockAuthoringAttributes, FlowpressBlockHtmlProps, FlowpressBlockTypeDescriptor, FlowpressCompositionV1 } from "./types.js";
3
+ export declare function flowpressBlockHtmlProps(attributes: FlowpressBlockAuthoringAttributes): FlowpressBlockHtmlProps;
4
+ /** Structural logo visibility rules emitted once per composition. */
5
+ export declare function flowpressCompositionLogoStyles(composition: FlowpressCompositionV1): string;
6
+ export type FlowpressAdapterCompatibilityCode = "missing-adapter" | "draft-adapter" | "missing-descriptor" | "stale-adapter";
7
+ export interface FlowpressAdapterCompatibilityIssue {
8
+ code: FlowpressAdapterCompatibilityCode;
9
+ message: string;
10
+ command: string;
11
+ }
12
+ export declare function flowpressBlockTypeDescriptors(composition: FlowpressCompositionV1): ReadonlyMap<string, FlowpressBlockTypeDescriptor>;
13
+ export declare function flowpressAdapterCompatibilityIssue(blockName: string, descriptors: ReadonlyMap<string, FlowpressBlockTypeDescriptor>, adapters: FlowpressBlockAdapters): FlowpressAdapterCompatibilityIssue | null;
14
+ //# sourceMappingURL=composition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../src/composition.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAEV,iCAAiC,EACjC,uBAAuB,EACvB,4BAA4B,EAC5B,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAEpB,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,iCAAiC,GAC5C,uBAAuB,CAiCzB;AAiCD,qEAAqE;AACrE,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,sBAAsB,GAClC,MAAM,CAsBR;AAED,MAAM,MAAM,iCAAiC,GACzC,iBAAiB,GACjB,eAAe,GACf,oBAAoB,GACpB,eAAe,CAAC;AAEpB,MAAM,WAAW,kCAAkC;IACjD,IAAI,EAAE,iCAAiC,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,sBAAsB,GAClC,WAAW,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAKnD;AAED,wBAAgB,kCAAkC,CAChD,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,4BAA4B,CAAC,EAC9D,QAAQ,EAAE,sBAAsB,GAC/B,kCAAkC,GAAG,IAAI,CAoC3C"}