@styleflow.app/flowpress-astro-core 1.0.0-beta.4 → 1.0.0-beta.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +249 -1
- package/README.md +104 -5
- package/dist/accessibility-panel.d.ts +2 -0
- package/dist/accessibility-panel.d.ts.map +1 -0
- package/dist/accessibility-panel.js +81 -0
- package/dist/accessibility-panel.js.map +1 -0
- package/dist/astro/BaseLayout.astro +34 -17
- package/dist/astro/CompositionRenderer.astro +168 -0
- package/dist/astro/DefaultBlockAdapter.astro +37 -0
- package/dist/astro/FontStylesheets.astro +35 -0
- package/dist/astro/GutenbergRenderer.astro +267 -80
- package/dist/astro/Media.astro +27 -0
- package/dist/astro/StyleflowElement.astro +25 -0
- package/dist/astro/ThemeRuntime.astro +26 -0
- package/dist/astro/blocks/CarouselBlock.astro +11 -10
- package/dist/astro/blocks/CarouselItemBlock.astro +4 -4
- package/dist/astro/blocks/ColumnBlock.astro +4 -5
- package/dist/astro/blocks/CoverBlock.astro +158 -0
- package/dist/astro/blocks/FormBlock.astro +23 -20
- package/dist/astro/blocks/GridBlock.astro +5 -4
- package/dist/astro/blocks/HeroBlock.astro +6 -6
- package/dist/astro/blocks/ImageBlock.astro +6 -6
- package/dist/astro/blocks/ListItemFallback.astro +9 -7
- package/dist/astro/blocks/NumberSpinnerBlock.astro +29 -22
- package/dist/astro/blocks/SemanticElement.astro +35 -0
- package/dist/astro/blocks/SiteLogoBlock.astro +54 -0
- package/dist/astro/blocks/TextBlock.astro +33 -28
- package/dist/astro/blocks/ThemeToggleBlock.astro +13 -0
- package/dist/astro/blocks/cover.d.ts +13 -0
- package/dist/astro/blocks/cover.d.ts.map +1 -0
- package/dist/astro/blocks/cover.js +105 -0
- package/dist/astro/blocks/cover.js.map +1 -0
- package/dist/astro/blocks/cover.ts +119 -0
- package/dist/astro/blocks/helpers.d.ts +10 -1
- package/dist/astro/blocks/helpers.d.ts.map +1 -1
- package/dist/astro/blocks/helpers.js +55 -39
- package/dist/astro/blocks/helpers.js.map +1 -1
- package/dist/astro/blocks/helpers.ts +69 -44
- package/dist/astro/motion/AccordionRuntime.astro +9 -0
- package/dist/astro/motion/MotionBoot.astro +21 -0
- package/dist/astro/motion/MotionRuntime.astro +31 -0
- package/dist/astro/motion/accordion.css +163 -0
- package/dist/astro/motion/accordion.d.ts +3 -0
- package/dist/astro/motion/accordion.d.ts.map +1 -0
- package/dist/astro/motion/accordion.js +98 -0
- package/dist/astro/motion/accordion.js.map +1 -0
- package/dist/astro/motion/accordion.ts +109 -0
- package/dist/astro/motion/motion-controller.d.ts +12 -0
- package/dist/astro/motion/motion-controller.d.ts.map +1 -0
- package/dist/astro/motion/motion-controller.js +293 -0
- package/dist/astro/motion/motion-controller.js.map +1 -0
- package/dist/astro/motion/motion-controller.ts +377 -0
- package/dist/astro/motion/motion.css +546 -0
- package/dist/astro/motion/motion.d.ts +127 -0
- package/dist/astro/motion/motion.d.ts.map +1 -0
- package/dist/astro/motion/motion.js +255 -0
- package/dist/astro/motion/motion.js.map +1 -0
- package/dist/astro/motion/motion.ts +419 -0
- package/dist/astro/native/Blob.astro +113 -0
- package/dist/astro/native/BlobBlock.astro +52 -0
- package/dist/astro/native/CustomFieldValue.astro +88 -0
- package/dist/astro/native/LevelTag.astro +20 -0
- package/dist/astro/native/MapBlock.astro +41 -0
- package/dist/astro/native/NativeHtmlBlock.astro +12 -0
- package/dist/astro/native/NativeIconBlock.astro +42 -0
- package/dist/astro/native/ProjectTimelineBlock.astro +34 -0
- package/dist/astro/native/ReservedLogin.astro +107 -0
- package/dist/astro/native/ResolvedBlocks.astro +91 -0
- package/dist/astro/native/SyncedPatternContent.astro +94 -0
- package/dist/astro/native/TermFieldValue.astro +39 -0
- package/dist/astro/native/Timeline.astro +22 -0
- package/dist/astro/native/TimelineCardBlock.astro +7 -0
- package/dist/astro/native/blob/blob-shapes.generated.d.ts +2 -0
- package/dist/astro/native/blob/blob-shapes.generated.d.ts.map +1 -0
- package/dist/astro/native/blob/blob-shapes.generated.js +2 -0
- package/dist/astro/native/blob/blob-shapes.generated.js.map +1 -0
- package/dist/astro/native/blob/blob-shapes.generated.ts +1 -0
- package/dist/astro/native/blob/config.d.ts +49 -0
- package/dist/astro/native/blob/config.d.ts.map +1 -0
- package/dist/astro/native/blob/config.js +86 -0
- package/dist/astro/native/blob/config.js.map +1 -0
- package/dist/astro/native/blob/config.ts +132 -0
- package/dist/astro/native/blob/controller.d.ts +11 -0
- package/dist/astro/native/blob/controller.d.ts.map +1 -0
- package/dist/astro/native/blob/controller.js +240 -0
- package/dist/astro/native/blob/controller.js.map +1 -0
- package/dist/astro/native/blob/controller.ts +248 -0
- package/dist/astro/native/blob/geometry.d.ts +2 -0
- package/dist/astro/native/blob/geometry.d.ts.map +1 -0
- package/dist/astro/native/blob/geometry.js +2 -0
- package/dist/astro/native/blob/geometry.js.map +1 -0
- package/dist/astro/native/blob/geometry.ts +1 -0
- package/dist/astro/native/blob/ids.d.ts +7 -0
- package/dist/astro/native/blob/ids.d.ts.map +1 -0
- package/dist/astro/native/blob/ids.js +11 -0
- package/dist/astro/native/blob/ids.js.map +1 -0
- package/dist/astro/native/blob/ids.ts +11 -0
- package/dist/astro/native/blob.css +83 -0
- package/dist/astro/native/block-sizing.css +34 -0
- package/dist/astro/native/button-template.d.ts +31 -0
- package/dist/astro/native/button-template.d.ts.map +1 -0
- package/dist/astro/native/button-template.js +54 -0
- package/dist/astro/native/button-template.js.map +1 -0
- package/dist/astro/native/button-template.ts +92 -0
- package/dist/astro/native/button.d.ts +13 -0
- package/dist/astro/native/button.d.ts.map +1 -0
- package/dist/astro/native/button.js +26 -0
- package/dist/astro/native/button.js.map +1 -0
- package/dist/astro/native/button.ts +26 -0
- package/dist/astro/native/core-block.astro +18 -0
- package/dist/astro/native/core-button-fallback.astro +43 -0
- package/dist/astro/native/core-button.astro +65 -0
- package/dist/astro/native/core-buttons.astro +14 -0
- package/dist/astro/native/core-group.astro +25 -0
- package/dist/astro/native/core-home-link.astro +12 -0
- package/dist/astro/native/core-html.astro +8 -0
- package/dist/astro/native/core-icon.astro +7 -0
- package/dist/astro/native/core-image.astro +137 -0
- package/dist/astro/native/core-navigation-link.astro +71 -0
- package/dist/astro/native/core-navigation-submenu.astro +33 -0
- package/dist/astro/native/core-navigation.astro +101 -0
- package/dist/astro/native/core-page-list-data-item.astro +19 -0
- package/dist/astro/native/core-page-list-item.astro +8 -0
- package/dist/astro/native/core-page-list.astro +40 -0
- package/dist/astro/native/core-post-date.astro +21 -0
- package/dist/astro/native/core-post-excerpt.astro +26 -0
- package/dist/astro/native/core-post-featured-image.astro +40 -0
- package/dist/astro/native/core-post-template-fallback.astro +30 -0
- package/dist/astro/native/core-post-template.astro +23 -0
- package/dist/astro/native/core-post-terms.astro +47 -0
- package/dist/astro/native/core-post-title.astro +23 -0
- package/dist/astro/native/core-query-no-results.astro +12 -0
- package/dist/astro/native/core-query.astro +22 -0
- package/dist/astro/native/core-separator.astro +18 -0
- package/dist/astro/native/core-site-title.astro +16 -0
- package/dist/astro/native/core-term-description.astro +12 -0
- package/dist/astro/native/core-term-name.astro +21 -0
- package/dist/astro/native/core-term-template.astro +30 -0
- package/dist/astro/native/core-terms-query.astro +19 -0
- package/dist/astro/native/core-transparent.astro +11 -0
- package/dist/astro/native/flowpress-navigation-controller.d.ts +2 -0
- package/dist/astro/native/flowpress-navigation-controller.d.ts.map +1 -0
- package/dist/astro/native/flowpress-navigation-controller.js +217 -0
- package/dist/astro/native/flowpress-navigation-controller.js.map +1 -0
- package/dist/astro/native/flowpress-navigation-controller.ts +215 -0
- package/dist/astro/native/flowpress-navigation.css +17 -0
- package/dist/astro/native/grid-bleed.d.ts +2 -0
- package/dist/astro/native/grid-bleed.d.ts.map +1 -0
- package/dist/astro/native/grid-bleed.js +123 -0
- package/dist/astro/native/grid-bleed.js.map +1 -0
- package/dist/astro/native/grid.css +180 -0
- package/dist/astro/native/grid.d.ts +17 -0
- package/dist/astro/native/grid.d.ts.map +1 -0
- package/dist/astro/native/grid.js +103 -0
- package/dist/astro/native/grid.js.map +1 -0
- package/dist/astro/native/grid.ts +118 -0
- package/dist/astro/native/group.css +36 -0
- package/dist/astro/native/group.d.ts +15 -0
- package/dist/astro/native/group.d.ts.map +1 -0
- package/dist/astro/native/group.js +66 -0
- package/dist/astro/native/group.js.map +1 -0
- package/dist/astro/native/group.ts +61 -0
- package/dist/astro/native/html.d.ts +6 -0
- package/dist/astro/native/html.d.ts.map +1 -0
- package/dist/astro/native/html.js +10 -0
- package/dist/astro/native/html.js.map +1 -0
- package/dist/astro/native/html.ts +9 -0
- package/dist/astro/native/icon.d.ts +3 -0
- package/dist/astro/native/icon.d.ts.map +1 -0
- package/dist/astro/native/icon.js +23 -0
- package/dist/astro/native/icon.js.map +1 -0
- package/dist/astro/native/icon.ts +21 -0
- package/dist/astro/native/image.d.ts +5 -0
- package/dist/astro/native/image.d.ts.map +1 -0
- package/dist/astro/native/image.js +65 -0
- package/dist/astro/native/image.js.map +1 -0
- package/dist/astro/native/image.ts +56 -0
- package/dist/astro/native/inline-text.css +15 -0
- package/dist/astro/native/map.d.ts +14 -0
- package/dist/astro/native/map.d.ts.map +1 -0
- package/dist/astro/native/map.js +60 -0
- package/dist/astro/native/map.js.map +1 -0
- package/dist/astro/native/map.ts +70 -0
- package/dist/astro/native/motion-preference.d.ts +50 -0
- package/dist/astro/native/motion-preference.d.ts.map +1 -0
- package/dist/astro/native/motion-preference.js +132 -0
- package/dist/astro/native/motion-preference.js.map +1 -0
- package/dist/astro/native/motion-preference.ts +158 -0
- package/dist/astro/native/motion.d.ts +101 -0
- package/dist/astro/native/motion.d.ts.map +1 -0
- package/dist/astro/native/motion.js +168 -0
- package/dist/astro/native/motion.js.map +1 -0
- package/dist/astro/native/motion.ts +312 -0
- package/dist/astro/native/query-carousel.d.ts +12 -0
- package/dist/astro/native/query-carousel.d.ts.map +1 -0
- package/dist/astro/native/query-carousel.js +36 -0
- package/dist/astro/native/query-carousel.js.map +1 -0
- package/dist/astro/native/query-carousel.ts +56 -0
- package/dist/astro/native/query-loop.d.ts +38 -0
- package/dist/astro/native/query-loop.d.ts.map +1 -0
- package/dist/astro/native/query-loop.js +20 -0
- package/dist/astro/native/query-loop.js.map +1 -0
- package/dist/astro/native/query-loop.ts +67 -0
- package/dist/astro/native/registry.d.ts +3 -0
- package/dist/astro/native/registry.d.ts.map +1 -0
- package/dist/astro/native/registry.js +81 -0
- package/dist/astro/native/registry.js.map +1 -0
- package/dist/astro/native/registry.ts +82 -0
- package/dist/astro/native/sf-block-binding.astro +20 -0
- package/dist/astro/native/sf-post-field.astro +9 -0
- package/dist/astro/native/sf-term-field.astro +9 -0
- package/dist/astro/native/timeline.css +4 -0
- package/dist/astro/native/timeline.d.ts +28 -0
- package/dist/astro/native/timeline.d.ts.map +1 -0
- package/dist/astro/native/timeline.js +43 -0
- package/dist/astro/native/timeline.js.map +1 -0
- package/dist/astro/native/timeline.ts +79 -0
- package/dist/astro/preferences/AccessibilityPanel.astro +105 -0
- package/dist/astro/preferences/ColorModeToggle.astro +26 -0
- package/dist/astro/preferences/MotionToggle.astro +27 -0
- package/dist/astro/preferences/PreferencesRuntime.astro +9 -0
- package/dist/astro/preferences/ThemeToggle.astro +30 -0
- package/dist/astro/preferences/Toggle.astro +50 -0
- package/dist/astro/preferences/preferences.css +125 -0
- package/dist/block-renderers.d.ts +23 -3
- package/dist/block-renderers.d.ts.map +1 -1
- package/dist/block-renderers.js.map +1 -1
- package/dist/build-cache.d.ts +8 -0
- package/dist/build-cache.d.ts.map +1 -0
- package/dist/build-cache.js +81 -0
- package/dist/build-cache.js.map +1 -0
- package/dist/client.d.ts +23 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +78 -39
- package/dist/client.js.map +1 -1
- package/dist/composition.d.ts +14 -0
- package/dist/composition.d.ts.map +1 -0
- package/dist/composition.js +125 -0
- package/dist/composition.js.map +1 -0
- package/dist/default-blocks.d.ts +9 -0
- package/dist/default-blocks.d.ts.map +1 -0
- package/dist/default-blocks.js +117 -0
- package/dist/default-blocks.js.map +1 -0
- package/dist/env.d.ts +9 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +20 -0
- package/dist/env.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/media.d.ts +20 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +106 -0
- package/dist/media.js.map +1 -0
- package/dist/motion-preference.d.ts +50 -0
- package/dist/motion-preference.d.ts.map +1 -0
- package/dist/motion-preference.js +132 -0
- package/dist/motion-preference.js.map +1 -0
- package/dist/preferences-runtime.d.ts +3 -0
- package/dist/preferences-runtime.d.ts.map +1 -0
- package/dist/preferences-runtime.js +23 -0
- package/dist/preferences-runtime.js.map +1 -0
- package/dist/preferences-styleflow.d.ts +3 -0
- package/dist/preferences-styleflow.d.ts.map +1 -0
- package/dist/preferences-styleflow.js +14 -0
- package/dist/preferences-styleflow.js.map +1 -0
- package/dist/preferences.d.ts +4 -0
- package/dist/preferences.d.ts.map +1 -0
- package/dist/preferences.js +4 -0
- package/dist/preferences.js.map +1 -0
- package/dist/reserved-area.d.ts +10 -0
- package/dist/reserved-area.d.ts.map +1 -0
- package/dist/reserved-area.js +93 -0
- package/dist/reserved-area.js.map +1 -0
- package/dist/styleflow.d.ts +18 -1
- package/dist/styleflow.d.ts.map +1 -1
- package/dist/styleflow.js +82 -11
- package/dist/styleflow.js.map +1 -1
- package/dist/svg-media-runtime.d.ts +3 -0
- package/dist/svg-media-runtime.d.ts.map +1 -0
- package/dist/svg-media-runtime.js +33 -0
- package/dist/svg-media-runtime.js.map +1 -0
- package/dist/svg-media-types.d.ts +11 -0
- package/dist/svg-media-types.d.ts.map +1 -0
- package/dist/svg-media-types.js +2 -0
- package/dist/svg-media-types.js.map +1 -0
- package/dist/svg-media.d.ts +13 -0
- package/dist/svg-media.d.ts.map +1 -0
- package/dist/svg-media.js +47 -0
- package/dist/svg-media.js.map +1 -0
- package/dist/template-hierarchy.d.ts +0 -7
- package/dist/template-hierarchy.d.ts.map +1 -1
- package/dist/template-hierarchy.js +0 -21
- package/dist/template-hierarchy.js.map +1 -1
- package/dist/text.d.ts +3 -0
- package/dist/text.d.ts.map +1 -0
- package/dist/text.js +6 -0
- package/dist/text.js.map +1 -0
- package/dist/theme-runtime.d.ts +16 -0
- package/dist/theme-runtime.d.ts.map +1 -0
- package/dist/theme-runtime.js +100 -0
- package/dist/theme-runtime.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +75 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/vivid-colors-preference.d.ts +31 -0
- package/dist/vivid-colors-preference.d.ts.map +1 -0
- package/dist/vivid-colors-preference.js +102 -0
- package/dist/vivid-colors-preference.js.map +1 -0
- package/package.json +58 -7
- package/dist/astro/DefaultTemplate.astro +0 -42
- package/dist/templates.d.ts +0 -19
- package/dist/templates.d.ts.map +0 -1
- package/dist/templates.js +0 -20
- package/dist/templates.js.map +0 -1
|
@@ -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
|
|
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
|
-
<
|
|
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
|
-
</
|
|
81
|
+
</StyleflowElement>
|
|
83
82
|
</flowpress-carousel>
|
|
84
83
|
) : (
|
|
85
|
-
<
|
|
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
|
-
</
|
|
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
|
|
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
|
-
<
|
|
20
|
+
<StyleflowElement as="li" {...semantic} {...htmlAttributes}>
|
|
21
21
|
<slot />
|
|
22
|
-
</
|
|
22
|
+
</StyleflowElement>
|
|
23
23
|
|
|
24
24
|
<style>
|
|
25
25
|
.flowpress-carousel-item { min-width: 0; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
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
|
-
<
|
|
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
|
-
</
|
|
44
|
+
</StyleflowElement>
|
|
46
45
|
|
|
47
46
|
<style>
|
|
48
47
|
.flowpress-column {
|
|
@@ -0,0 +1,158 @@
|
|
|
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
|
+
width: 100%;
|
|
151
|
+
min-width: 0;
|
|
152
|
+
position: relative;
|
|
153
|
+
z-index: 2;
|
|
154
|
+
display: grid;
|
|
155
|
+
align-items: var(--flowpress-cover-content-block, center);
|
|
156
|
+
justify-items: var(--flowpress-cover-content-inline, center);
|
|
157
|
+
}
|
|
158
|
+
</style>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
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
|
-
<
|
|
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
|
-
<
|
|
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
|
-
</
|
|
136
|
+
</StyleflowElement>
|
|
134
137
|
) : (
|
|
135
|
-
<
|
|
138
|
+
<StyleflowElement as="p" {...semantic} {...htmlAttributes} role="status">
|
|
136
139
|
Il modulo non è temporaneamente disponibile.
|
|
137
|
-
</
|
|
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
|
|
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,13 +38,14 @@ const style = [
|
|
|
38
38
|
].join(";");
|
|
39
39
|
---
|
|
40
40
|
|
|
41
|
-
<
|
|
41
|
+
<StyleflowElement as="div" {...semantic} {...htmlAttributes} data-align={align} style={style}>
|
|
42
42
|
<slot />
|
|
43
|
-
</
|
|
43
|
+
</StyleflowElement>
|
|
44
44
|
|
|
45
45
|
<style>
|
|
46
46
|
.flowpress-grid {
|
|
47
47
|
display: grid;
|
|
48
|
+
min-width: 0;
|
|
48
49
|
grid-template-columns: repeat(var(--flowpress-grid-base), minmax(0, 1fr));
|
|
49
50
|
align-items: var(--flowpress-grid-align, stretch);
|
|
50
51
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
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
|
-
<
|
|
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
|
-
<
|
|
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
|
-
</
|
|
74
|
+
</StyleflowElement>
|
|
75
75
|
|
|
76
76
|
<style>
|
|
77
77
|
.flowpress-hero {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
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
|
-
<
|
|
73
|
-
as="div"
|
|
73
|
+
<StyleflowElement as="div" data-flowpress-image
|
|
74
74
|
{...semanticProps(attributes, contract)}
|
|
75
75
|
{...blockHtmlAttributes(attributes)}
|
|
76
76
|
>
|
|
77
|
-
<
|
|
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
|
-
</
|
|
89
|
+
</StyleflowElement>
|
|
90
90
|
) : null}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import Media from "../Media.astro";
|
|
3
|
+
import { decodeFlowpressText } from "../../text.js";
|
|
4
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
5
|
import { flowpressLinkHref } from "../../links.js";
|
|
4
6
|
|
|
5
7
|
interface Props {
|
|
@@ -14,17 +16,17 @@ const href = flowpressLinkHref(item.uri);
|
|
|
14
16
|
---
|
|
15
17
|
|
|
16
18
|
{image.url ? (
|
|
17
|
-
<
|
|
19
|
+
<Media
|
|
18
20
|
src={String(image.url)}
|
|
19
|
-
alt={
|
|
21
|
+
alt={decodeFlowpressText(image.alt)}
|
|
20
22
|
loading="lazy"
|
|
21
23
|
decoding="async"
|
|
22
24
|
/>
|
|
23
25
|
) : null}
|
|
24
26
|
{href ? (
|
|
25
|
-
<
|
|
27
|
+
<StyleflowElement as="a" href={href}>{decodeFlowpressText(item.title)}</StyleflowElement>
|
|
26
28
|
) : (
|
|
27
|
-
<
|
|
29
|
+
<StyleflowElement as="span">{decodeFlowpressText(item.title)}</StyleflowElement>
|
|
28
30
|
)}
|
|
29
|
-
{item.excerpt ? <
|
|
30
|
-
{item.priceHtml ? <
|
|
31
|
+
{item.excerpt ? <StyleflowElement as="p">{decodeFlowpressText(item.excerpt)}</StyleflowElement> : null}
|
|
32
|
+
{item.priceHtml ? <StyleflowElement as="div" set:html={String(item.priceHtml)} /> : null}
|