@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 { styleflowThemeBootstrapScript } from "../theme-runtime.js";
3
+
4
+ interface Props {
5
+ themes: string[];
6
+ defaultTheme: string;
7
+ }
8
+
9
+ const { themes, defaultTheme } = Astro.props;
10
+ const bootstrap = styleflowThemeBootstrapScript(themes, defaultTheme);
11
+ ---
12
+
13
+ <script is:inline set:html={bootstrap}></script>
14
+ <script>
15
+ import { initializeStyleflowThemeRuntime } from "../theme-runtime.js";
16
+
17
+ let cleanup = () => {};
18
+ const initialize = () => { cleanup(); cleanup = initializeStyleflowThemeRuntime(); };
19
+ if (document.readyState === "loading") {
20
+ document.addEventListener("DOMContentLoaded", initialize, { once: true });
21
+ } else {
22
+ initialize();
23
+ }
24
+ document.addEventListener("astro:page-load", initialize);
25
+ document.addEventListener("astro:before-swap", () => cleanup());
26
+ </script>
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  import "@splidejs/splide/css/core";
3
- import S from "@styleflow.app/astro/S.astro";
3
+ import StyleflowElement from "../StyleflowElement.astro";
4
4
  import { carouselOptions, carouselSettings } from "../../carousel.js";
5
5
  import type { FlowpressBlock } from "../../types.js";
6
6
  import type { StyleflowContract } from "../../styleflow.js";
@@ -8,9 +8,9 @@ import { blockHtmlAttributes, semanticProps } from "./helpers.js";
8
8
 
9
9
  interface Props {
10
10
  block: FlowpressBlock;
11
- contract?: StyleflowContract;
11
+ contract?: StyleflowContract | undefined;
12
12
  validChildren: boolean;
13
- invalidChildNames?: string[];
13
+ invalidChildNames?: string[] | undefined;
14
14
  }
15
15
 
16
16
  const { block, contract, validChildren, invalidChildNames = [] } = Astro.props;
@@ -44,8 +44,7 @@ if (!validChildren && import.meta.env.DEV) {
44
44
 
45
45
  {validChildren ? (
46
46
  <flowpress-carousel>
47
- <S
48
- as="section"
47
+ <StyleflowElement as="section"
49
48
  {...semantic}
50
49
  {...htmlAttributes}
51
50
  aria-label={settings.ariaLabel}
@@ -79,11 +78,10 @@ if (!validChildren && import.meta.env.DEV) {
79
78
  <span class="splide__toggle__pause">Pausa</span>
80
79
  </button>
81
80
  ) : null}
82
- </S>
81
+ </StyleflowElement>
83
82
  </flowpress-carousel>
84
83
  ) : (
85
- <S
86
- as="section"
84
+ <StyleflowElement as="section"
87
85
  {...semantic}
88
86
  {...htmlAttributes}
89
87
  aria-label={settings.ariaLabel}
@@ -92,7 +90,7 @@ if (!validChildren && import.meta.env.DEV) {
92
90
  style={style}
93
91
  >
94
92
  <slot />
95
- </S>
93
+ </StyleflowElement>
96
94
  )}
97
95
 
98
96
  <script>
@@ -101,7 +99,7 @@ if (!validChildren && import.meta.env.DEV) {
101
99
 
102
100
  if (!customElements.get("flowpress-carousel")) {
103
101
  customElements.define("flowpress-carousel", class extends HTMLElement {
104
- private instance?: Splide;
102
+ private instance?: Splide | undefined;
105
103
 
106
104
  connectedCallback() {
107
105
  if (this.instance) return;
@@ -127,6 +125,7 @@ if (!validChildren && import.meta.env.DEV) {
127
125
  <style>
128
126
  flowpress-carousel { display: block; }
129
127
  .flowpress-carousel { min-width: 0; }
128
+ .flowpress-carousel:not(.is-initialized) { visibility: visible; }
130
129
  .flowpress-carousel:not(.is-initialized) .splide__list {
131
130
  display: grid;
132
131
  grid-template-columns: repeat(var(--flowpress-carousel-base), minmax(0, 1fr));
@@ -198,3 +197,5 @@ if (!validChildren && import.meta.env.DEV) {
198
197
  .flowpress-carousel * { scroll-behavior: auto !important; }
199
198
  }
200
199
  </style>
200
+
201
+ <style is:global>.flowpress-carousel:not(.is-initialized) { visibility: visible; }</style>
@@ -1,12 +1,12 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
2
+ import StyleflowElement from "../StyleflowElement.astro";
3
3
  import type { FlowpressBlock } from "../../types.js";
4
4
  import type { StyleflowContract } from "../../styleflow.js";
5
5
  import { blockHtmlAttributes, semanticProps } from "./helpers.js";
6
6
 
7
7
  interface Props {
8
8
  block: FlowpressBlock;
9
- contract?: StyleflowContract;
9
+ contract?: StyleflowContract | undefined;
10
10
  }
11
11
 
12
12
  const { block, contract } = Astro.props;
@@ -17,9 +17,9 @@ const htmlAttributes = blockHtmlAttributes(
17
17
  );
18
18
  ---
19
19
 
20
- <S as="li" {...semantic} {...htmlAttributes}>
20
+ <StyleflowElement as="li" {...semantic} {...htmlAttributes}>
21
21
  <slot />
22
- </S>
22
+ </StyleflowElement>
23
23
 
24
24
  <style>
25
25
  .flowpress-carousel-item { min-width: 0; }
@@ -1,5 +1,5 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
2
+ import StyleflowElement from "../StyleflowElement.astro";
3
3
  import type { FlowpressBlock } from "../../types.js";
4
4
  import type { StyleflowContract } from "../../styleflow.js";
5
5
  import {
@@ -10,7 +10,7 @@ import {
10
10
 
11
11
  interface Props {
12
12
  block: FlowpressBlock;
13
- contract?: StyleflowContract;
13
+ contract?: StyleflowContract | undefined;
14
14
  }
15
15
 
16
16
  const { block, contract } = Astro.props;
@@ -33,8 +33,7 @@ const style = [
33
33
  ].join(";");
34
34
  ---
35
35
 
36
- <S
37
- as="div"
36
+ <StyleflowElement as="div"
38
37
  {...semantic}
39
38
  {...htmlAttributes}
40
39
  data-partial={partial}
@@ -42,7 +41,7 @@ const style = [
42
41
  style={style}
43
42
  >
44
43
  <slot />
45
- </S>
44
+ </StyleflowElement>
46
45
 
47
46
  <style>
48
47
  .flowpress-column {
@@ -0,0 +1,156 @@
1
+ ---
2
+ import Media from "../Media.astro";
3
+ import StyleflowElement from "../StyleflowElement.astro";
4
+ import type { DynamicStyleflowProps, StyleflowContract } from "../../styleflow.js";
5
+ import { resolvePrefixedFlowpressBlockStyleflowProps } from "../../styleflow.js";
6
+ import type {
7
+ FlowpressBlock,
8
+ FlowpressBlockHtmlProps
9
+ } from "../../types.js";
10
+ import { blockHtmlAttributes, semanticProps } from "./helpers.js";
11
+ import {
12
+ coverBackgroundType,
13
+ coverContentPosition,
14
+ coverMediaSource,
15
+ coverMinimumHeight,
16
+ coverObjectPosition,
17
+ coverPosterSource,
18
+ coverScrimEnabled,
19
+ coverScrimOpacity,
20
+ coverTagName
21
+ } from "./cover.js";
22
+
23
+ interface Props {
24
+ block: FlowpressBlock;
25
+ contract?: StyleflowContract | undefined;
26
+ htmlProps?: FlowpressBlockHtmlProps | undefined;
27
+ styleflowProps?: DynamicStyleflowProps | undefined;
28
+ }
29
+
30
+ const { block, contract, htmlProps, styleflowProps } = Astro.props;
31
+ const attributes = block.attributes;
32
+ const rootStyleflowProps = styleflowProps ?? semanticProps(attributes, contract, {
33
+ layoutRole: "region",
34
+ density: "regular"
35
+ });
36
+ const normalizedHtmlProps = htmlProps ?? blockHtmlAttributes(attributes);
37
+ const rootHtmlProps = {
38
+ ...normalizedHtmlProps,
39
+ class: ["wp-block-cover", "flowpress-cover", normalizedHtmlProps.class]
40
+ .filter(Boolean)
41
+ .join(" ")
42
+ };
43
+ const backgroundType = coverBackgroundType(block);
44
+ const source = coverMediaSource(block);
45
+ const poster = coverPosterSource(block);
46
+ const alt = String(attributes.alt ?? block.resolvedData?.alt ?? "");
47
+ const width = Number(block.resolvedData?.width) || undefined;
48
+ const height = Number(block.resolvedData?.height) || undefined;
49
+ const objectPosition = coverObjectPosition(attributes.focalPoint);
50
+ const minimumHeight = coverMinimumHeight(
51
+ attributes.minHeight,
52
+ attributes.minHeightUnit
53
+ );
54
+ const [contentBlockPosition, contentInlinePosition] = coverContentPosition(
55
+ attributes.contentPosition
56
+ );
57
+ const scrimOpacity = coverScrimOpacity(attributes);
58
+ const rootStyle = [
59
+ `--flowpress-cover-object-position:${objectPosition}`,
60
+ minimumHeight ? `--flowpress-cover-min-height:${minimumHeight}` : "",
61
+ `--flowpress-cover-content-block:${contentBlockPosition}`,
62
+ `--flowpress-cover-content-inline:${contentInlinePosition}`,
63
+ `--flowpress-cover-scrim-opacity:${scrimOpacity / 100}`
64
+ ].filter(Boolean).join(";");
65
+ const scrimEnabled = backgroundType !== "color" && coverScrimEnabled(attributes);
66
+ const scrimStyleflowProps = resolvePrefixedFlowpressBlockStyleflowProps(
67
+ attributes,
68
+ "scrim",
69
+ contract,
70
+ {},
71
+ {
72
+ strict: process.env.NODE_ENV === "production" || process.env.STYLEFLOW_STRICT === "1",
73
+ onDiagnostic: (diagnostic) => console.warn(`[${diagnostic.code}] ${diagnostic.message}`)
74
+ }
75
+ );
76
+ const tagName = coverTagName(attributes.tagName);
77
+ ---
78
+
79
+ <StyleflowElement as={tagName} {...rootStyleflowProps} {...rootHtmlProps} style={rootStyle}>
80
+ {backgroundType === "image" && source ? (
81
+ <Media
82
+ class="wp-block-cover__image-background flowpress-cover__media"
83
+ src={source}
84
+ width={width}
85
+ height={height}
86
+ alt={alt}
87
+ aria-hidden={alt ? undefined : "true"}
88
+ loading="lazy"
89
+ decoding="async"
90
+ />
91
+ ) : null}
92
+ {backgroundType === "video" && source ? (
93
+ <video
94
+ class="wp-block-cover__video-background flowpress-cover__media"
95
+ src={source}
96
+ poster={poster}
97
+ autoplay
98
+ muted
99
+ loop
100
+ playsinline
101
+ preload="metadata"
102
+ aria-hidden="true"
103
+ tabindex="-1"
104
+ />
105
+ ) : null}
106
+ {scrimEnabled ? (
107
+ <StyleflowElement as="span"
108
+ class="wp-block-cover__background flowpress-cover__scrim"
109
+ {...scrimStyleflowProps}
110
+ data-flowpress-cover-scrim
111
+ aria-hidden="true"
112
+ />
113
+ ) : null}
114
+ <StyleflowElement as="div" class="wp-block-cover__inner-container flowpress-cover__content">
115
+ <slot />
116
+ </StyleflowElement>
117
+ </StyleflowElement>
118
+
119
+ <style>
120
+ .flowpress-cover {
121
+ position: relative;
122
+ display: grid;
123
+ min-height: var(--flowpress-cover-min-height, 0);
124
+ overflow: hidden;
125
+ isolation: isolate;
126
+ }
127
+
128
+ .flowpress-cover__media,
129
+ .flowpress-cover__scrim {
130
+ position: absolute;
131
+ inset: 0;
132
+ width: 100%;
133
+ height: 100%;
134
+ }
135
+
136
+ .flowpress-cover__media {
137
+ z-index: 0;
138
+ object-fit: cover;
139
+ object-position: var(--flowpress-cover-object-position, 50% 50%);
140
+ }
141
+
142
+ .flowpress-cover__scrim {
143
+ z-index: 1;
144
+ background: var(--sf-background);
145
+ opacity: var(--flowpress-cover-scrim-opacity, 1);
146
+ pointer-events: none;
147
+ }
148
+
149
+ .flowpress-cover__content {
150
+ position: relative;
151
+ z-index: 2;
152
+ display: grid;
153
+ align-items: var(--flowpress-cover-content-block, center);
154
+ justify-items: var(--flowpress-cover-content-inline, center);
155
+ }
156
+ </style>
@@ -1,5 +1,8 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
2
+ import { decodeFlowpressText } from "../../text.js";
3
+ import type { HTMLAttributes } from "astro/types";
4
+ type HTMLInputTypeAttribute = HTMLAttributes<"input">["type"];
5
+ import StyleflowElement from "../StyleflowElement.astro";
3
6
  import type { FlowpressBlock } from "../../types.js";
4
7
  import type { StyleflowContract } from "../../styleflow.js";
5
8
  import { blockHtmlAttributes, semanticProps } from "./helpers.js";
@@ -7,10 +10,10 @@ import { blockHtmlAttributes, semanticProps } from "./helpers.js";
7
10
  interface FormField {
8
11
  name: string;
9
12
  type: string;
10
- required?: boolean;
11
- values?: string[];
12
- labels?: string[];
13
- options?: string[];
13
+ required?: boolean | undefined;
14
+ values?: string[] | undefined;
15
+ labels?: string[] | undefined;
16
+ options?: string[] | undefined;
14
17
  }
15
18
 
16
19
  interface FormSchema {
@@ -24,7 +27,7 @@ interface FormSchema {
24
27
 
25
28
  interface Props {
26
29
  block: FlowpressBlock;
27
- contract?: StyleflowContract;
30
+ contract?: StyleflowContract | undefined;
28
31
  }
29
32
 
30
33
  const { block, contract } = Astro.props;
@@ -35,21 +38,21 @@ const labelFor = (field: FormField): string => field.name
35
38
  .replace(/[-_]+/g, " ")
36
39
  .replace(/\b\w/g, (letter) => letter.toUpperCase());
37
40
  const optionLabel = (field: FormField, index: number): string =>
38
- field.labels?.[index] || field.values?.[index] || "";
41
+ decodeFlowpressText(field.labels?.[index] || field.values?.[index] || "");
39
42
  ---
40
43
 
41
44
  {schema?.available ? (
42
- <S as="div" {...semantic} {...htmlAttributes}>
45
+ <StyleflowElement as="div" {...semantic} {...htmlAttributes}>
43
46
  <flowpress-cf7-form>
44
47
  <form action={schema.submitUrl} method="post" enctype="multipart/form-data" novalidate>
45
48
  {block.attributes.title || schema.title ? (
46
- <S as="h2">{String(block.attributes.title || schema.title)}</S>
49
+ <StyleflowElement as="h2">{decodeFlowpressText(block.attributes.title || schema.title)}</StyleflowElement>
47
50
  ) : null}
48
51
  {schema.fields.map((field) => {
49
52
  if (field.type === "submit") {
50
53
  return (
51
54
  <button type="submit">
52
- {field.values?.[0] || "Invia"}
55
+ {decodeFlowpressText(field.values?.[0] || "Invia")}
53
56
  </button>
54
57
  );
55
58
  }
@@ -63,7 +66,7 @@ const optionLabel = (field: FormField, index: number): string =>
63
66
  {(field.values || []).map((value, index) => (
64
67
  <label>
65
68
  <input
66
- type={field.type}
69
+ type={field.type as HTMLInputTypeAttribute}
67
70
  name={field.type === "checkbox" ? `${field.name}[]` : field.name}
68
71
  value={value}
69
72
  required={field.required}
@@ -79,7 +82,7 @@ const optionLabel = (field: FormField, index: number): string =>
79
82
  return (
80
83
  <label>
81
84
  <input type="checkbox" name={field.name} value="1" required={field.required} />
82
- {field.values?.[0] || labelFor(field)}
85
+ {decodeFlowpressText(field.values?.[0] || labelFor(field))}
83
86
  <span data-field-error={field.name}></span>
84
87
  </label>
85
88
  );
@@ -114,7 +117,7 @@ const optionLabel = (field: FormField, index: number): string =>
114
117
  <label>
115
118
  {labelFor(field)}
116
119
  <input
117
- type={field.type === "file" ? "file" : field.type}
120
+ type={field.type === "file" ? "file" : field.type as HTMLInputTypeAttribute}
118
121
  name={field.name}
119
122
  required={field.required}
120
123
  />
@@ -130,11 +133,11 @@ const optionLabel = (field: FormField, index: number): string =>
130
133
  <p data-form-status role="status" aria-live="polite"></p>
131
134
  </form>
132
135
  </flowpress-cf7-form>
133
- </S>
136
+ </StyleflowElement>
134
137
  ) : (
135
- <S as="p" {...semantic} {...htmlAttributes} role="status">
138
+ <StyleflowElement as="p" {...semantic} {...htmlAttributes} role="status">
136
139
  Il modulo non è temporaneamente disponibile.
137
- </S>
140
+ </StyleflowElement>
138
141
  )}
139
142
 
140
143
  <script>
@@ -142,7 +145,7 @@ const optionLabel = (field: FormField, index: number): string =>
142
145
  interface Window {
143
146
  turnstile?: {
144
147
  render(target: Element, options: Record<string, unknown>): string;
145
- reset(widgetId?: string): void;
148
+ reset(widgetId?: string): void | undefined;
146
149
  };
147
150
  }
148
151
  }
@@ -174,7 +177,7 @@ const optionLabel = (field: FormField, index: number): string =>
174
177
 
175
178
  if (!customElements.get("flowpress-cf7-form")) {
176
179
  customElements.define("flowpress-cf7-form", class extends HTMLElement {
177
- private widgetId?: string;
180
+ private widgetId?: string | undefined;
178
181
 
179
182
  connectedCallback() {
180
183
  const form = this.querySelector<HTMLFormElement>("form");
@@ -207,8 +210,8 @@ const optionLabel = (field: FormField, index: number): string =>
207
210
  headers: { Accept: "application/json" }
208
211
  });
209
212
  const result = await response.json() as {
210
- message?: string;
211
- invalidFields?: Array<{ field?: string; into?: string; message?: string }>;
213
+ message?: string | undefined;
214
+ invalidFields?: Array<{ field?: string | undefined; into?: string | undefined; message?: string }> | undefined;
212
215
  };
213
216
  status.textContent = result.message || (response.ok ? "Messaggio inviato." : "Invio non riuscito.");
214
217
  for (const invalid of result.invalidFields || []) {
@@ -1,5 +1,5 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
2
+ import StyleflowElement from "../StyleflowElement.astro";
3
3
  import type { FlowpressBlock } from "../../types.js";
4
4
  import type { StyleflowContract } from "../../styleflow.js";
5
5
  import {
@@ -10,7 +10,7 @@ import {
10
10
 
11
11
  interface Props {
12
12
  block: FlowpressBlock;
13
- contract?: StyleflowContract;
13
+ contract?: StyleflowContract | undefined;
14
14
  }
15
15
 
16
16
  const { block, contract } = Astro.props;
@@ -38,9 +38,9 @@ const style = [
38
38
  ].join(";");
39
39
  ---
40
40
 
41
- <S as="div" {...semantic} {...htmlAttributes} data-align={align} style={style}>
41
+ <StyleflowElement as="div" {...semantic} {...htmlAttributes} data-align={align} style={style}>
42
42
  <slot />
43
- </S>
43
+ </StyleflowElement>
44
44
 
45
45
  <style>
46
46
  .flowpress-grid {
@@ -1,5 +1,6 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
2
+ import Media from "../Media.astro";
3
+ import StyleflowElement from "../StyleflowElement.astro";
3
4
  import type { FlowpressBlock } from "../../types.js";
4
5
  import type { StyleflowContract } from "../../styleflow.js";
5
6
  import {
@@ -11,7 +12,7 @@ import {
11
12
 
12
13
  interface Props {
13
14
  block: FlowpressBlock;
14
- contract?: StyleflowContract;
15
+ contract?: StyleflowContract | undefined;
15
16
  }
16
17
 
17
18
  const { block, contract } = Astro.props;
@@ -34,8 +35,7 @@ const scrimEnabled = Boolean(attributes.scrimEnabled) && backgroundType !== "col
34
35
  const scrimIntensity = Math.min(10, Math.max(1, Number(attributes.scrimIntensity) || 6));
35
36
  ---
36
37
 
37
- <S
38
- as="section"
38
+ <StyleflowElement as="section"
39
39
  {...semantic}
40
40
  {...htmlAttributes}
41
41
  style={[
@@ -44,7 +44,7 @@ const scrimIntensity = Math.min(10, Math.max(1, Number(attributes.scrimIntensity
44
44
  ].join(";")}
45
45
  >
46
46
  {backgroundType === "image" && imageSrc ? (
47
- <img
47
+ <Media
48
48
  class="flowpress-hero__media"
49
49
  src={imageSrc}
50
50
  alt=""
@@ -71,7 +71,7 @@ const scrimIntensity = Math.min(10, Math.max(1, Number(attributes.scrimIntensity
71
71
  <div class="flowpress-hero__content">
72
72
  <slot />
73
73
  </div>
74
- </S>
74
+ </StyleflowElement>
75
75
 
76
76
  <style>
77
77
  .flowpress-hero {
@@ -1,5 +1,6 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
2
+ import Media from "../Media.astro";
3
+ import StyleflowElement from "../StyleflowElement.astro";
3
4
  import type { StyleflowContract } from "../../styleflow.js";
4
5
  import type { FlowpressBlock } from "../../types.js";
5
6
  import {
@@ -9,7 +10,7 @@ import {
9
10
 
10
11
  interface Props {
11
12
  block: FlowpressBlock;
12
- contract?: StyleflowContract;
13
+ contract?: StyleflowContract | undefined;
13
14
  }
14
15
 
15
16
  type ImageLoading = "eager" | "lazy";
@@ -69,12 +70,11 @@ const fetchPriority = fetchPriorityValue(attributes.fetchPriority);
69
70
  ---
70
71
 
71
72
  {src ? (
72
- <S
73
- as="div"
73
+ <StyleflowElement as="div"
74
74
  {...semanticProps(attributes, contract)}
75
75
  {...blockHtmlAttributes(attributes)}
76
76
  >
77
- <img
77
+ <Media
78
78
  src={src}
79
79
  srcset={srcSet || undefined}
80
80
  sizes={sizes}
@@ -86,5 +86,5 @@ const fetchPriority = fetchPriorityValue(attributes.fetchPriority);
86
86
  decoding={decoding}
87
87
  fetchpriority={fetchPriority}
88
88
  />
89
- </S>
89
+ </StyleflowElement>
90
90
  ) : null}
@@ -1,5 +1,8 @@
1
1
  ---
2
- import S from "@styleflow.app/astro/S.astro";
2
+ import Media from "../Media.astro";
3
+ import { decodeFlowpressText } from "../../text.js";
4
+ import StyleflowElement from "../StyleflowElement.astro";
5
+ import { flowpressLinkHref } from "../../links.js";
3
6
 
4
7
  interface Props {
5
8
  item: Record<string, unknown>;
@@ -9,20 +12,21 @@ const { item } = Astro.props;
9
12
  const image = item.image && typeof item.image === "object" && !Array.isArray(item.image)
10
13
  ? item.image as Record<string, unknown>
11
14
  : {};
15
+ const href = flowpressLinkHref(item.uri);
12
16
  ---
13
17
 
14
18
  {image.url ? (
15
- <img
19
+ <Media
16
20
  src={String(image.url)}
17
- alt={String(image.alt ?? "")}
21
+ alt={decodeFlowpressText(image.alt)}
18
22
  loading="lazy"
19
23
  decoding="async"
20
24
  />
21
25
  ) : null}
22
- {item.uri ? (
23
- <S as="a" href={String(item.uri)}>{String(item.title ?? "")}</S>
26
+ {href ? (
27
+ <StyleflowElement as="a" href={href}>{decodeFlowpressText(item.title)}</StyleflowElement>
24
28
  ) : (
25
- <S as="span">{String(item.title ?? "")}</S>
29
+ <StyleflowElement as="span">{decodeFlowpressText(item.title)}</StyleflowElement>
26
30
  )}
27
- {item.excerpt ? <S as="p">{String(item.excerpt)}</S> : null}
28
- {item.priceHtml ? <S as="div" set:html={String(item.priceHtml)} /> : null}
31
+ {item.excerpt ? <StyleflowElement as="p">{decodeFlowpressText(item.excerpt)}</StyleflowElement> : null}
32
+ {item.priceHtml ? <StyleflowElement as="div" set:html={String(item.priceHtml)} /> : null}