@styleflow.app/flowpress-astro-core 1.0.0-beta.5 → 1.0.0-beta.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +307 -1
- package/README.md +121 -6
- 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 +170 -0
- package/dist/astro/DefaultBlockAdapter.astro +37 -0
- package/dist/astro/EditorialMedia.astro +47 -0
- package/dist/astro/FontStylesheets.astro +35 -0
- package/dist/astro/GutenbergRenderer.astro +270 -84
- 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 +72 -101
- 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 +312 -0
- package/dist/astro/motion/motion-controller.js.map +1 -0
- package/dist/astro/motion/motion-controller.ts +393 -0
- package/dist/astro/motion/motion.css +600 -0
- package/dist/astro/motion/motion.d.ts +132 -0
- package/dist/astro/motion/motion.d.ts.map +1 -0
- package/dist/astro/motion/motion.js +265 -0
- package/dist/astro/motion/motion.js.map +1 -0
- package/dist/astro/motion/motion.ts +430 -0
- package/dist/astro/native/AccordionRuntime.astro +11 -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/accordion-controller.d.ts +3 -0
- package/dist/astro/native/accordion-controller.d.ts.map +1 -0
- package/dist/astro/native/accordion-controller.js +143 -0
- package/dist/astro/native/accordion-controller.js.map +1 -0
- package/dist/astro/native/accordion-controller.ts +108 -0
- package/dist/astro/native/accordion.css +36 -0
- package/dist/astro/native/accordion.d.ts +24 -0
- package/dist/astro/native/accordion.d.ts.map +1 -0
- package/dist/astro/native/accordion.js +82 -0
- package/dist/astro/native/accordion.js.map +1 -0
- package/dist/astro/native/accordion.ts +91 -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/carousel.css +323 -0
- package/dist/astro/native/core-accordion-heading.astro +23 -0
- package/dist/astro/native/core-accordion-item.astro +8 -0
- package/dist/astro/native/core-accordion-panel.astro +8 -0
- package/dist/astro/native/core-accordion.astro +8 -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 +136 -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 +18 -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 +108 -0
- package/dist/astro/native/grid.js.map +1 -0
- package/dist/astro/native/grid.ts +132 -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 +13 -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 +60 -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 +91 -0
- package/dist/astro/native/registry.js.map +1 -0
- package/dist/astro/native/registry.ts +93 -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-slot.astro +6 -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 +82 -0
- package/dist/build-cache.js.map +1 -0
- package/dist/carousel.d.ts +56 -6
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +183 -27
- package/dist/carousel.js.map +1 -1
- package/dist/client.d.ts +34 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +124 -42
- 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 +122 -0
- package/dist/default-blocks.js.map +1 -0
- package/dist/env.d.ts +21 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +53 -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,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
|
+
|
|
4
|
+
// Heading (h1–h6), paragraph (0 / "p") or inline span, with Styleflow props.
|
|
5
|
+
interface Props {
|
|
6
|
+
tag: string;
|
|
7
|
+
[attribute: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
const { tag, ...rest } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
{tag === "h1" ? <StyleflowElement as="h1" {...rest}><slot /></StyleflowElement>
|
|
13
|
+
: tag === "h2" ? <StyleflowElement as="h2" {...rest}><slot /></StyleflowElement>
|
|
14
|
+
: tag === "h3" ? <StyleflowElement as="h3" {...rest}><slot /></StyleflowElement>
|
|
15
|
+
: tag === "h4" ? <StyleflowElement as="h4" {...rest}><slot /></StyleflowElement>
|
|
16
|
+
: tag === "h5" ? <StyleflowElement as="h5" {...rest}><slot /></StyleflowElement>
|
|
17
|
+
: tag === "h6" ? <StyleflowElement as="h6" {...rest}><slot /></StyleflowElement>
|
|
18
|
+
: tag === "span" ? <StyleflowElement as="span" {...rest}><slot /></StyleflowElement>
|
|
19
|
+
: tag === "div" ? <StyleflowElement as="div" {...rest}><slot /></StyleflowElement>
|
|
20
|
+
: <StyleflowElement as="p" {...rest}><slot /></StyleflowElement>}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
|
+
import {
|
|
4
|
+
flowpressBlockHtmlProps,
|
|
5
|
+
resolveFlowpressBlockStyleflowProps,
|
|
6
|
+
} from "../../index.js";
|
|
7
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
8
|
+
import { resolveMap } from "./map.js";
|
|
9
|
+
|
|
10
|
+
type Props = Pick<FlowpressBlockRendererProps, "block"> & Partial<FlowpressBlockRendererProps>;
|
|
11
|
+
const { block, contract, htmlProps, styleflowProps } = Astro.props as Props;
|
|
12
|
+
const html = htmlProps ?? flowpressBlockHtmlProps(block.attributes);
|
|
13
|
+
const semantic = styleflowProps ?? resolveFlowpressBlockStyleflowProps(block.attributes, contract);
|
|
14
|
+
const map = resolveMap(block.attributes as import("./map.js").MapAttributes, import.meta.env.GOOGLE_MAPS_API_KEY ?? "");
|
|
15
|
+
const label = map.address || `Mappa: ${map.query}`;
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
{map.query ? (
|
|
19
|
+
<StyleflowElement as="div" {...semantic} {...html}>
|
|
20
|
+
{map.iframeSrc ? (
|
|
21
|
+
<StyleflowElement as="iframe"
|
|
22
|
+
class="sf-map-frame"
|
|
23
|
+
title={label}
|
|
24
|
+
src={map.iframeSrc}
|
|
25
|
+
loading="lazy"
|
|
26
|
+
referrerpolicy="no-referrer-when-downgrade"
|
|
27
|
+
allowfullscreen
|
|
28
|
+
/>
|
|
29
|
+
) : null}
|
|
30
|
+
<StyleflowElement as="a" href={map.linkHref} target="_blank" rel="noopener noreferrer" layoutRole="control" density="compact" interactivePriority="tertiary">Apri la mappa</StyleflowElement>
|
|
31
|
+
</StyleflowElement>
|
|
32
|
+
) : null}
|
|
33
|
+
|
|
34
|
+
<style>
|
|
35
|
+
.sf-map-frame {
|
|
36
|
+
display: block;
|
|
37
|
+
width: 100%;
|
|
38
|
+
min-height: var(--fp-map-min-height, 22rem);
|
|
39
|
+
border: 0;
|
|
40
|
+
}
|
|
41
|
+
</style>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
|
+
import { nativeHtmlData } from "./html.js";
|
|
5
|
+
|
|
6
|
+
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
7
|
+
const { html, hidden } = nativeHtmlData(block.resolvedData, block.innerHtml);
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
{!hidden && html ? (
|
|
11
|
+
<StyleflowElement as="div" {...htmlProps} {...styleflowProps} data-project-native-html set:html={html} />
|
|
12
|
+
) : null}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
|
+
import { nativeIconSvg, nativeIconWidth } from "./icon.js";
|
|
5
|
+
|
|
6
|
+
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
7
|
+
const svg = nativeIconSvg(block.attributes.icon, block.resolvedData, `fp-icon-${crypto.randomUUID()}`);
|
|
8
|
+
const dimensions = (block.attributes.style as { dimensions?: { width?: unknown } } | undefined)?.dimensions;
|
|
9
|
+
const width = nativeIconWidth(dimensions?.width) ?? "24px";
|
|
10
|
+
const label = typeof block.attributes.ariaLabel === "string" ? block.attributes.ariaLabel.trim() : "";
|
|
11
|
+
const align = ["left", "center", "right"].includes(String(block.attributes.align)) ? `align${block.attributes.align}` : "";
|
|
12
|
+
const semantic = {
|
|
13
|
+
...styleflowProps,
|
|
14
|
+
...(!block.attributes.layoutRole ? { layoutRole: "none" as const } : {}),
|
|
15
|
+
};
|
|
16
|
+
const rootProps = {
|
|
17
|
+
...htmlProps,
|
|
18
|
+
class: ["wp-block-icon", align, htmlProps.class].filter(Boolean).join(" "),
|
|
19
|
+
style: [htmlProps.style, `--fp-core-icon-width:${width}`].filter(Boolean).join(";"),
|
|
20
|
+
};
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
<!-- styleflow-ignore-start rule=SF_INLINE_STYLE reason="Validated structural icon width from the native Gutenberg control" scope="Native icon pilot" -->
|
|
24
|
+
{svg ? <StyleflowElement as="div"
|
|
25
|
+
{...rootProps}
|
|
26
|
+
{...semantic}
|
|
27
|
+
data-icon={block.attributes.icon}
|
|
28
|
+
role={label ? "img" : undefined}
|
|
29
|
+
aria-label={label || undefined}
|
|
30
|
+
aria-hidden={label ? undefined : "true"}
|
|
31
|
+
set:html={svg}
|
|
32
|
+
/> : null}
|
|
33
|
+
<!-- styleflow-ignore-end -->
|
|
34
|
+
|
|
35
|
+
<style is:global>
|
|
36
|
+
/* Match the native WordPress icon geometry and inherit Styleflow foreground. */
|
|
37
|
+
.wp-block-icon { width: var(--fp-core-icon-width, 24px); max-width: 100%; line-height: 0; }
|
|
38
|
+
.wp-block-icon > svg { display: block; width: 100%; height: auto; max-width: 100%; fill: currentColor; }
|
|
39
|
+
.wp-block-icon.aligncenter { margin-inline: auto; }
|
|
40
|
+
.wp-block-icon.alignright { margin-inline-start: auto; }
|
|
41
|
+
.wp-block-icon.alignleft { margin-inline-end: auto; }
|
|
42
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type {
|
|
3
|
+
FlowpressBlockRendererProps
|
|
4
|
+
} from "../../index.js";
|
|
5
|
+
import Timeline from "./Timeline.astro";
|
|
6
|
+
import {
|
|
7
|
+
normalizeTimelineIntensity,
|
|
8
|
+
normalizeTimelineTone,
|
|
9
|
+
timelineItemsFromBlocks
|
|
10
|
+
} from "./timeline.js";
|
|
11
|
+
|
|
12
|
+
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
13
|
+
|
|
14
|
+
function optionalAttribute(
|
|
15
|
+
attributes: Record<string, unknown>,
|
|
16
|
+
name: string
|
|
17
|
+
): string | undefined {
|
|
18
|
+
const value = String(attributes[name] ?? "").trim();
|
|
19
|
+
return value || undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const tone = normalizeTimelineTone(block.attributes.tone);
|
|
23
|
+
const intensity = normalizeTimelineIntensity(block.attributes.intensity);
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
<Timeline
|
|
27
|
+
rootProps={htmlProps}
|
|
28
|
+
styleflowProps={styleflowProps}
|
|
29
|
+
items={timelineItemsFromBlocks(block.innerBlocks ?? [])}
|
|
30
|
+
tone={tone}
|
|
31
|
+
intensity={intensity}
|
|
32
|
+
id={optionalAttribute(block.attributes, "anchor")}
|
|
33
|
+
class={optionalAttribute(block.attributes, "className")}
|
|
34
|
+
/>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
import S from "../StyleflowElement.astro";
|
|
3
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
|
+
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
5
|
+
const data = (block.resolvedData ?? {}) as { authenticated?: boolean; loginPage?: boolean; page?: number; totalPages?: number; base?: string; target?: string; targets?: { slug: string; name: string }[] };
|
|
6
|
+
const page = data.page ?? 1;
|
|
7
|
+
const total = data.totalPages ?? 0;
|
|
8
|
+
const base = (data.base ?? "/area-riservata/").replace(/page\/\d+\/$/, "");
|
|
9
|
+
const pageUrl = (n: number) => `${base}${n > 1 ? `page/${n}/` : ""}${data.target ? `?target=${encodeURIComponent(data.target)}` : ""}`;
|
|
10
|
+
---
|
|
11
|
+
<S as="div" {...htmlProps} {...styleflowProps}>
|
|
12
|
+
{block.name === "flowpress/reserved-pagination" ? (
|
|
13
|
+
total > 1 && <S as="nav" aria-label="Pagine contenuti riservati">
|
|
14
|
+
{page > 1 && <S as="a" href={pageUrl(page - 1)}>Precedente</S>}
|
|
15
|
+
<S as="span">Pagina {page} di {total}</S>
|
|
16
|
+
{page < total && <S as="a" href={pageUrl(page + 1)}>Successiva</S>}
|
|
17
|
+
</S>
|
|
18
|
+
) : data.authenticated ? (
|
|
19
|
+
<S as="div" class="flowpress-login flowpress-login--session">
|
|
20
|
+
<S as="p" class="flowpress-login__status" role="status">Accesso effettuato.</S>
|
|
21
|
+
<S as="div" class="flowpress-login__actions">
|
|
22
|
+
<S as="a" class="flowpress-login__link" href="/area-riservata/">Contenuti riservati</S>
|
|
23
|
+
<S as="form" method="post" action="/api/flowpress/reserved-area/logout"><S as="button" class="flowpress-login__button flowpress-login__button--secondary" type="submit">Esci</S></S>
|
|
24
|
+
</S>
|
|
25
|
+
{data.targets?.length ? <S as="form" class="flowpress-login__filter" method="get" action="/area-riservata/">
|
|
26
|
+
<S as="div" class="flowpress-login__field">
|
|
27
|
+
<S as="label" class="flowpress-login__label" for="flowpress-target">Filtra per destinatario</S>
|
|
28
|
+
<S as="select" class="flowpress-login__input" id="flowpress-target" name="target">
|
|
29
|
+
<S as="option" value="">Tutti i destinatari</S>
|
|
30
|
+
{data.targets.map(target => <S as="option" value={target.slug} selected={data.target === target.slug}>{target.name}</S>)}
|
|
31
|
+
</S>
|
|
32
|
+
</S>
|
|
33
|
+
<S as="button" class="flowpress-login__button" type="submit">Filtra</S>
|
|
34
|
+
</S> : null}
|
|
35
|
+
</S>
|
|
36
|
+
) : data.loginPage ? (
|
|
37
|
+
<S as="form" class="flowpress-login" method="post" action="/api/flowpress/reserved-area/login" data-flowpress-login>
|
|
38
|
+
<S as="p" class="flowpress-login__error" data-flowpress-error id="flowpress-login-error" role="alert" hidden />
|
|
39
|
+
<S as="input" type="hidden" name="redirect_to" value="/area-riservata/" />
|
|
40
|
+
<S as="div" class="flowpress-login__field">
|
|
41
|
+
<S as="label" class="flowpress-login__label" for="flowpress-username">Nome utente o email</S>
|
|
42
|
+
<S as="input" class="flowpress-login__input" id="flowpress-username" name="username" type="text" autocomplete="username" autocapitalize="none" autocorrect="off" spellcheck="false" required />
|
|
43
|
+
</S>
|
|
44
|
+
<S as="div" class="flowpress-login__field">
|
|
45
|
+
<S as="label" class="flowpress-login__label" for="flowpress-password">Password</S>
|
|
46
|
+
<S as="div" class="flowpress-login__password">
|
|
47
|
+
<S as="input" class="flowpress-login__input" id="flowpress-password" name="password" type="password" autocomplete="current-password" required />
|
|
48
|
+
<S as="button" class="flowpress-login__toggle" type="button" data-flowpress-toggle aria-controls="flowpress-password" aria-pressed="false" aria-label="Mostra password" hidden>Mostra</S>
|
|
49
|
+
</S>
|
|
50
|
+
</S>
|
|
51
|
+
<S as="label" class="flowpress-login__remember"><S as="input" name="remember" type="checkbox" value="1" /> <S as="span">Ricordami su questo dispositivo</S></S>
|
|
52
|
+
<S as="button" class="flowpress-login__button" type="submit" data-flowpress-submit>Accedi</S>
|
|
53
|
+
<S as="a" class="flowpress-login__link" href="/area-riservata/">Vai ai contenuti riservati</S>
|
|
54
|
+
</S>
|
|
55
|
+
) :
|
|
56
|
+
<S as="div" layoutRole="panel" class="flex flex-col" surface="default" density="comfortable">
|
|
57
|
+
<S as="h2" ty="heading" w="default" v="3">Area riservata</S>
|
|
58
|
+
<S as="a" href="/area-riservata/" layoutRole="control" density="comfortable" interactivePriority="primary" class="w-fit">Accesso area riservata</S>
|
|
59
|
+
</S>
|
|
60
|
+
}
|
|
61
|
+
</S>
|
|
62
|
+
|
|
63
|
+
<script>
|
|
64
|
+
import { safeFlowpressReservedRedirect } from "../../reserved-area.js";
|
|
65
|
+
const params = new URLSearchParams(window.location.search);
|
|
66
|
+
const errors: Record<string, string> = { credenziali: "Credenziali non valide. Controlla nome utente e password e riprova.", accesso: "Questo account non è abilitato all’area riservata.", servizio: "Servizio temporaneamente non disponibile. Riprova tra qualche minuto." };
|
|
67
|
+
for (const form of document.querySelectorAll<HTMLFormElement>("[data-flowpress-login]")) {
|
|
68
|
+
const redirect = form.elements.namedItem("redirect_to") as HTMLInputElement;
|
|
69
|
+
redirect.value = safeFlowpressReservedRedirect(params.get("redirect_to"));
|
|
70
|
+
const message = form.querySelector<HTMLElement>("[data-flowpress-error]");
|
|
71
|
+
const username = form.elements.namedItem("username") as HTMLInputElement;
|
|
72
|
+
const password = form.elements.namedItem("password") as HTMLInputElement;
|
|
73
|
+
const text = errors[params.get("errore") ?? ""];
|
|
74
|
+
if (message && text) {
|
|
75
|
+
message.textContent = text;
|
|
76
|
+
message.hidden = false;
|
|
77
|
+
if (params.get("errore") === "credenziali") {
|
|
78
|
+
for (const input of [username, password]) { input.setAttribute("aria-invalid", "true"); input.setAttribute("aria-describedby", message.id); }
|
|
79
|
+
}
|
|
80
|
+
username.focus();
|
|
81
|
+
}
|
|
82
|
+
const toggle = form.querySelector<HTMLButtonElement>("[data-flowpress-toggle]");
|
|
83
|
+
if (toggle) {
|
|
84
|
+
toggle.hidden = false;
|
|
85
|
+
toggle.addEventListener("click", () => {
|
|
86
|
+
const show = password.type === "password";
|
|
87
|
+
password.type = show ? "text" : "password";
|
|
88
|
+
toggle.textContent = show ? "Nascondi" : "Mostra";
|
|
89
|
+
toggle.setAttribute("aria-pressed", String(show));
|
|
90
|
+
toggle.setAttribute("aria-label", show ? "Nascondi password" : "Mostra password");
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
const submit = form.querySelector<HTMLButtonElement>("[data-flowpress-submit]");
|
|
94
|
+
let pending = false;
|
|
95
|
+
form.addEventListener("submit", event => {
|
|
96
|
+
if (pending) return event.preventDefault();
|
|
97
|
+
pending = true;
|
|
98
|
+
submit?.setAttribute("aria-disabled", "true");
|
|
99
|
+
if (submit) submit.textContent = "Accesso in corso…";
|
|
100
|
+
});
|
|
101
|
+
window.addEventListener("pageshow", () => {
|
|
102
|
+
pending = false;
|
|
103
|
+
submit?.removeAttribute("aria-disabled");
|
|
104
|
+
if (submit) submit.textContent = "Accedi";
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
</script>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
|
+
import CompositionRenderer from "../CompositionRenderer.astro";
|
|
4
|
+
import GutenbergRenderer from "../GutenbergRenderer.astro";
|
|
5
|
+
import type {
|
|
6
|
+
FlowpressBlock,
|
|
7
|
+
FlowpressBlockRendererProps,
|
|
8
|
+
FlowpressCompositionV1,
|
|
9
|
+
} from "../../index.js";
|
|
10
|
+
import type { NestedPass } from "./query-loop.js";
|
|
11
|
+
import { decorateGridBlocks } from "./grid.js";
|
|
12
|
+
|
|
13
|
+
// Blocks resolved by a project resolver in a nested composition pass (Query
|
|
14
|
+
// Loop, Terms Query, one loop item). That pass cannot write into the outer
|
|
15
|
+
// composition, so it exports its own block types, stylesheets and
|
|
16
|
+
// diagnostics: merge them here, as SyncedPatternContent does for patterns.
|
|
17
|
+
|
|
18
|
+
type Props = Pick<
|
|
19
|
+
FlowpressBlockRendererProps,
|
|
20
|
+
"block" | "composition" | "contract" | "context" | "adapters"
|
|
21
|
+
> & {
|
|
22
|
+
blocks: FlowpressBlock[];
|
|
23
|
+
pass: NestedPass;
|
|
24
|
+
// Stylesheets and diagnostics belong to the whole pass: render them once,
|
|
25
|
+
// not once per loop item.
|
|
26
|
+
renderPassOutput?: boolean | undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const { block, blocks, pass, composition, contract, context, adapters, renderPassOutput = true } = Astro.props;
|
|
30
|
+
|
|
31
|
+
const stylesheets = renderPassOutput ? pass.stylesheets ?? [] : [];
|
|
32
|
+
const blocking = renderPassOutput ? (pass.diagnostics ?? []).filter((diagnostic) => diagnostic.blocking) : [];
|
|
33
|
+
if (blocking.length > 0 && context.production) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`FlowPress ${block.name} is not renderable:\n`
|
|
36
|
+
+ blocking.map(({ code, message }) => `- ${code}: ${message}`).join("\n"),
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Composition path: the parent chain was rendered through the adapter registry.
|
|
41
|
+
// Semantic-renderer path (inside sf/* blocks): no registry, so use the project
|
|
42
|
+
// renderers, which register every loop adapter.
|
|
43
|
+
// block-renderers.ts imports the loop adapters, which import this component:
|
|
44
|
+
// a static import would close that cycle, and Vite's SSR loader then hands
|
|
45
|
+
// block-renderers.ts undefined adapters (core/query rendered as a plain
|
|
46
|
+
// container, with the page-context pass). Load the registry at render time.
|
|
47
|
+
const { nativeBlockRenderers } = await import("./registry.js");
|
|
48
|
+
const nestedComposition: FlowpressCompositionV1 | undefined = composition && adapters && Object.keys(adapters).length > 0
|
|
49
|
+
? {
|
|
50
|
+
...composition,
|
|
51
|
+
blockTypes: [...composition.blockTypes, ...(pass.blockTypes ?? [])],
|
|
52
|
+
diagnostics: pass.diagnostics ?? [],
|
|
53
|
+
stylesheets: [],
|
|
54
|
+
}
|
|
55
|
+
: undefined;
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
{stylesheets.map((stylesheet) => (
|
|
59
|
+
<style data-flowpress-composition-style={stylesheet.id} set:html={stylesheet.css} />
|
|
60
|
+
))}
|
|
61
|
+
{blocking.length > 0 ? (
|
|
62
|
+
<StyleflowElement as="aside" data-flowpress-composition-diagnostics role="status">
|
|
63
|
+
<StyleflowElement as="ul">
|
|
64
|
+
{blocking.map(({ code, message }) => <StyleflowElement as="li" data-diagnostic-code={code}>{message}</StyleflowElement>)}
|
|
65
|
+
</StyleflowElement>
|
|
66
|
+
</StyleflowElement>
|
|
67
|
+
) : null}
|
|
68
|
+
{blocks.length > 0 ? (
|
|
69
|
+
nestedComposition ? (
|
|
70
|
+
<CompositionRenderer
|
|
71
|
+
composition={nestedComposition}
|
|
72
|
+
adapters={adapters!}
|
|
73
|
+
blocks={decorateGridBlocks(blocks)}
|
|
74
|
+
contract={contract}
|
|
75
|
+
parentBlockName={block.name}
|
|
76
|
+
production={context.production}
|
|
77
|
+
depth={context.depth + 1}
|
|
78
|
+
inheritedTone={context.effectiveTone}
|
|
79
|
+
/>
|
|
80
|
+
) : (
|
|
81
|
+
<GutenbergRenderer
|
|
82
|
+
blocks={decorateGridBlocks(blocks)}
|
|
83
|
+
contract={contract}
|
|
84
|
+
blockRenderers={{ ...nativeBlockRenderers, ...context.blockRenderers }}
|
|
85
|
+
parentBlockName={block.name}
|
|
86
|
+
production={context.production}
|
|
87
|
+
depth={context.depth + 1}
|
|
88
|
+
inheritedTone={context.effectiveTone}
|
|
89
|
+
/>
|
|
90
|
+
)
|
|
91
|
+
) : null}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
|
+
import CompositionRenderer from "../CompositionRenderer.astro";
|
|
4
|
+
import GutenbergRenderer from "../GutenbergRenderer.astro";
|
|
5
|
+
import type {
|
|
6
|
+
FlowpressBlock,
|
|
7
|
+
FlowpressBlockRenderer,
|
|
8
|
+
FlowpressBlockRendererProps,
|
|
9
|
+
FlowpressBlockTypeDescriptor,
|
|
10
|
+
FlowpressCompositionDiagnostic,
|
|
11
|
+
FlowpressCompositionStylesheet,
|
|
12
|
+
FlowpressCompositionV1,
|
|
13
|
+
} from "../../index.js";
|
|
14
|
+
import { decorateGridBlocks } from "./grid.js";
|
|
15
|
+
|
|
16
|
+
// Content of a synced pattern (core/block). The pattern's blocks arrive either
|
|
17
|
+
// as `innerBlocks` (the default slot, once FlowPress resolves core/block) or as
|
|
18
|
+
// `resolvedData` from the project resolver, which exports the block types,
|
|
19
|
+
// stylesheets and diagnostics of its own nested pass because that pass cannot
|
|
20
|
+
// write into the outer composition.
|
|
21
|
+
interface SyncedPatternData {
|
|
22
|
+
ref?: number | undefined;
|
|
23
|
+
blocks?: FlowpressBlock[] | undefined;
|
|
24
|
+
blockTypes?: FlowpressBlockTypeDescriptor[] | undefined;
|
|
25
|
+
stylesheets?: FlowpressCompositionStylesheet[] | undefined;
|
|
26
|
+
diagnostics?: FlowpressCompositionDiagnostic[] | undefined;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// `selfRenderer` lets the semantic renderer resolve patterns nested in patterns.
|
|
30
|
+
const { block, composition, contract, context, adapters, selfRenderer } = Astro.props as Pick<
|
|
31
|
+
FlowpressBlockRendererProps,
|
|
32
|
+
"block" | "composition" | "contract" | "context" | "adapters"
|
|
33
|
+
> & { selfRenderer?: FlowpressBlockRenderer };
|
|
34
|
+
|
|
35
|
+
const pattern = (block.resolvedData ?? {}) as SyncedPatternData;
|
|
36
|
+
const patternBlocks = pattern.blocks ?? [];
|
|
37
|
+
const stylesheets = pattern.stylesheets ?? [];
|
|
38
|
+
const blocking = (pattern.diagnostics ?? []).filter((diagnostic) => diagnostic.blocking);
|
|
39
|
+
if (blocking.length > 0 && context.production) {
|
|
40
|
+
throw new Error(
|
|
41
|
+
`FlowPress synced pattern ${pattern.ref ?? block.attributes.ref} is not renderable:\n`
|
|
42
|
+
+ blocking.map(({ code, message }) => `- ${code}: ${message}`).join("\n"),
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Composition path: the parent chain was rendered through the adapter registry.
|
|
47
|
+
// Semantic-renderer path (inside sf/* blocks): use the project renderers so
|
|
48
|
+
// resolved blocks inside patterns keep their adapters too.
|
|
49
|
+
const { nativeBlockRenderers } = await import("./registry.js");
|
|
50
|
+
const patternComposition: FlowpressCompositionV1 | undefined = composition && adapters && Object.keys(adapters).length > 0
|
|
51
|
+
? {
|
|
52
|
+
...composition,
|
|
53
|
+
blockTypes: [...composition.blockTypes, ...(pattern.blockTypes ?? [])],
|
|
54
|
+
diagnostics: pattern.diagnostics ?? [],
|
|
55
|
+
stylesheets: [],
|
|
56
|
+
}
|
|
57
|
+
: undefined;
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
{stylesheets.map((stylesheet) => (
|
|
61
|
+
<style data-flowpress-composition-style={stylesheet.id} set:html={stylesheet.css} />
|
|
62
|
+
))}
|
|
63
|
+
{blocking.length > 0 ? (
|
|
64
|
+
<StyleflowElement as="aside" data-flowpress-composition-diagnostics role="status">
|
|
65
|
+
<StyleflowElement as="ul">
|
|
66
|
+
{blocking.map(({ code, message }) => <StyleflowElement as="li" data-diagnostic-code={code}>{message}</StyleflowElement>)}
|
|
67
|
+
</StyleflowElement>
|
|
68
|
+
</StyleflowElement>
|
|
69
|
+
) : null}
|
|
70
|
+
{patternBlocks.length > 0 ? (
|
|
71
|
+
patternComposition ? (
|
|
72
|
+
<CompositionRenderer
|
|
73
|
+
composition={patternComposition}
|
|
74
|
+
adapters={adapters!}
|
|
75
|
+
blocks={decorateGridBlocks(patternBlocks)}
|
|
76
|
+
contract={contract}
|
|
77
|
+
parentBlockName={block.name}
|
|
78
|
+
production={context.production}
|
|
79
|
+
depth={context.depth + 1}
|
|
80
|
+
inheritedTone={context.effectiveTone}
|
|
81
|
+
/>
|
|
82
|
+
) : (
|
|
83
|
+
<GutenbergRenderer
|
|
84
|
+
blocks={decorateGridBlocks(patternBlocks)}
|
|
85
|
+
contract={contract}
|
|
86
|
+
blockRenderers={{ ...nativeBlockRenderers, ...context.blockRenderers, ...(selfRenderer ? { [block.name]: selfRenderer } : {}) }}
|
|
87
|
+
parentBlockName={block.name}
|
|
88
|
+
production={context.production}
|
|
89
|
+
depth={context.depth + 1}
|
|
90
|
+
inheritedTone={context.effectiveTone}
|
|
91
|
+
/>
|
|
92
|
+
)
|
|
93
|
+
) : null}
|
|
94
|
+
<slot />
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Media from "../Media.astro";
|
|
3
|
+
import { decodeFlowpressText } from "../../text.js";
|
|
4
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
5
|
+
import { classNames, text, type ResolvedImage } from "./query-loop.js";
|
|
6
|
+
|
|
7
|
+
// Value of a term custom field inside the link of a Post Terms item
|
|
8
|
+
// (apps/cms/project/src/custom-fields.php, FLOWPRESS_PROJECT_TERM_LIST_OUTPUTS).
|
|
9
|
+
// Inline outputs only: the block-level ones (rich text, list, link) are never
|
|
10
|
+
// resolved for this block, and none of them would be valid inside an <a>.
|
|
11
|
+
interface Props {
|
|
12
|
+
field: { as?: string | undefined; value?: unknown };
|
|
13
|
+
// Accessible name of an image that is the only content of the term link.
|
|
14
|
+
fallbackAlt?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
const { field, fallbackAlt = "" } = Astro.props;
|
|
17
|
+
const as = text(field.as);
|
|
18
|
+
const image = (as === "image" ? field.value ?? {} : {}) as ResolvedImage;
|
|
19
|
+
const date = (as === "date" ? field.value ?? {} : {}) as { datetime?: string | undefined; formatted?: string };
|
|
20
|
+
const imageProps = {
|
|
21
|
+
src: text(image.url),
|
|
22
|
+
srcset: image.srcSet || undefined,
|
|
23
|
+
sizes: image.srcSet ? image.sizes || undefined : undefined,
|
|
24
|
+
width: image.width,
|
|
25
|
+
height: image.height,
|
|
26
|
+
alt: image.alt || fallbackAlt,
|
|
27
|
+
class: classNames("wp-block-post-terms__field", image.id ? `wp-image-${image.id}` : undefined),
|
|
28
|
+
loading: "lazy" as const,
|
|
29
|
+
decoding: "async" as const,
|
|
30
|
+
};
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
{as === "image" ? (
|
|
34
|
+
imageProps.src ? <Media {...imageProps} /> : null
|
|
35
|
+
) : as === "date" ? (
|
|
36
|
+
<StyleflowElement as="time" class="wp-block-post-terms__field" datetime={date.datetime}>{decodeFlowpressText(date.formatted)}</StyleflowElement>
|
|
37
|
+
) : (
|
|
38
|
+
<StyleflowElement as="span" class="wp-block-post-terms__field">{decodeFlowpressText(field.value)}</StyleflowElement>
|
|
39
|
+
)}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Media from "../Media.astro";
|
|
3
|
+
import { decodeFlowpressText } from "../../text.js";
|
|
4
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
5
|
+
import type { TimelineItem } from "./timeline.js";
|
|
6
|
+
import "./timeline.css";
|
|
7
|
+
interface Props { items:TimelineItem[]; tone?:string | undefined; intensity?:string | undefined; id?:string | undefined; class?:string | undefined; ariaLabel?:string | undefined; rootProps?:Record<string,unknown> | undefined; styleflowProps?:Record<string,unknown> | undefined; }
|
|
8
|
+
const {items,tone="inherit",intensity="inherit",id,class:className="",ariaLabel="Timeline",rootProps={},styleflowProps={}}=Astro.props;
|
|
9
|
+
---
|
|
10
|
+
<StyleflowElement as="section" {...rootProps} {...styleflowProps} id={id ?? (typeof rootProps.id === "string" ? rootProps.id : undefined)} {...(tone !== "inherit" ? {tone} : {})} {...(intensity !== "inherit" ? {intensity} : {})} layoutRole="stack" density="regular" aria-label={ariaLabel} class:list={["flowpress-timeline",rootProps.class,className]} data-flowpress-timeline>
|
|
11
|
+
<StyleflowElement as="ol" layoutRole="stack" density="regular" class="flowpress-timeline__list">
|
|
12
|
+
{items.map(item=>(
|
|
13
|
+
<StyleflowElement as="li" {...(item.tone && item.tone !== "inherit" ? {tone:item.tone} : {})} {...(item.intensity && item.intensity !== "inherit" ? {intensity:item.intensity} : {})} layoutRole="stack" density="regular" surface="default" class="flowpress-timeline__item" data-flowpress-timeline-item>
|
|
14
|
+
{item.year && <StyleflowElement as="h3">{decodeFlowpressText(item.year)}</StyleflowElement>}
|
|
15
|
+
{item.image && <Media src={item.image.url ?? item.image.sourceUrl} alt={item.image.alt ?? item.image.altText ?? ""} width={item.image.width} height={item.image.height} loading="lazy" />}
|
|
16
|
+
{item.description && <StyleflowElement as="p">{decodeFlowpressText(item.description)}</StyleflowElement>}
|
|
17
|
+
{item.metric && <StyleflowElement as="p">{decodeFlowpressText(item.metric)}</StyleflowElement>}
|
|
18
|
+
{(item.statisticValue || item.statisticLabel) && <StyleflowElement as="p"><StyleflowElement as="strong">{decodeFlowpressText(item.statisticValue)}</StyleflowElement> {decodeFlowpressText(item.statisticLabel)}</StyleflowElement>}
|
|
19
|
+
</StyleflowElement>
|
|
20
|
+
))}
|
|
21
|
+
</StyleflowElement>
|
|
22
|
+
</StyleflowElement>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
3
|
+
import Timeline from "./Timeline.astro";
|
|
4
|
+
import { timelineItemsFromBlocks } from "./timeline.js";
|
|
5
|
+
const {block,htmlProps,styleflowProps} = Astro.props as FlowpressBlockRendererProps;
|
|
6
|
+
---
|
|
7
|
+
<Timeline items={timelineItemsFromBlocks([block])} rootProps={htmlProps} styleflowProps={styleflowProps} />
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion-controller.d.ts","sourceRoot":"","sources":["../../../src/astro/native/accordion-controller.ts"],"names":[],"mappings":"AAGA,kFAAkF;AAClF,wBAAgB,0BAA0B,CAAC,KAAK,GAAE,UAAqB,GAAG,MAAM,IAAI,CAuGnF"}
|