@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,38 @@
|
|
|
1
|
+
import type { FlowpressBlock, FlowpressBlockTypeDescriptor, FlowpressCompositionDiagnostic, FlowpressCompositionStylesheet } from "../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* resolvedData shapes of the project Query Loop pilot
|
|
4
|
+
* (apps/cms/project/src/query-loop.php and custom-fields.php).
|
|
5
|
+
*/
|
|
6
|
+
export interface NestedPass {
|
|
7
|
+
blockTypes?: FlowpressBlockTypeDescriptor[];
|
|
8
|
+
stylesheets?: FlowpressCompositionStylesheet[];
|
|
9
|
+
diagnostics?: FlowpressCompositionDiagnostic[];
|
|
10
|
+
}
|
|
11
|
+
export interface LoopData extends NestedPass {
|
|
12
|
+
blocks?: FlowpressBlock[];
|
|
13
|
+
}
|
|
14
|
+
export interface LoopItem {
|
|
15
|
+
id: number;
|
|
16
|
+
postType?: string;
|
|
17
|
+
taxonomy?: string;
|
|
18
|
+
blocks: FlowpressBlock[];
|
|
19
|
+
}
|
|
20
|
+
export interface LoopTemplateData extends NestedPass {
|
|
21
|
+
items?: LoopItem[];
|
|
22
|
+
}
|
|
23
|
+
export interface ResolvedImage {
|
|
24
|
+
id?: number;
|
|
25
|
+
url?: string;
|
|
26
|
+
alt?: string;
|
|
27
|
+
width?: number;
|
|
28
|
+
height?: number;
|
|
29
|
+
srcSet?: string;
|
|
30
|
+
sizes?: string;
|
|
31
|
+
sizeSlug?: string;
|
|
32
|
+
href?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function classNames(...values: unknown[]): string | undefined;
|
|
35
|
+
export declare function text(value: unknown): string;
|
|
36
|
+
export declare function headingLevel(value: unknown, fallback?: number): number;
|
|
37
|
+
export declare function externalRel(target: unknown, rel?: unknown): string | undefined;
|
|
38
|
+
//# sourceMappingURL=query-loop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-loop.d.ts","sourceRoot":"","sources":["../../../src/astro/native/query-loop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,4BAA4B,EAC5B,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,gBAAgB,CAAC;AAExB;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,4BAA4B,EAAE,CAAC;IAC5C,WAAW,CAAC,EAAE,8BAA8B,EAAE,CAAC;IAC/C,WAAW,CAAC,EAAE,8BAA8B,EAAE,CAAC;CAChD;AAED,MAAM,WAAW,QAAS,SAAQ,UAAU;IAC1C,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,cAAc,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,UAAU,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,SAAS,CAOnE;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE3C;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,SAAI,GAAG,MAAM,CAGjE;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAI9E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function classNames(...values) {
|
|
2
|
+
const className = [...new Set(values
|
|
3
|
+
.flatMap((value) => String(value ?? "").split(/\s+/))
|
|
4
|
+
.filter(Boolean))].join(" ");
|
|
5
|
+
return className || undefined;
|
|
6
|
+
}
|
|
7
|
+
export function text(value) {
|
|
8
|
+
return typeof value === "string" ? value : typeof value === "number" ? String(value) : "";
|
|
9
|
+
}
|
|
10
|
+
export function headingLevel(value, fallback = 2) {
|
|
11
|
+
const level = Number(value);
|
|
12
|
+
return Number.isInteger(level) && level >= 0 && level <= 6 ? level : fallback;
|
|
13
|
+
}
|
|
14
|
+
export function externalRel(target, rel) {
|
|
15
|
+
const tokens = text(rel).split(/\s+/).filter(Boolean);
|
|
16
|
+
if (target === "_blank")
|
|
17
|
+
tokens.push("noopener", "noreferrer");
|
|
18
|
+
return tokens.length > 0 ? [...new Set(tokens)].join(" ") : undefined;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=query-loop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-loop.js","sourceRoot":"","sources":["../../../src/astro/native/query-loop.ts"],"names":[],"mappings":"AA4CA,MAAM,UAAU,UAAU,CAAC,GAAG,MAAiB;IAC7C,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,GAAG,CAC3B,MAAM;aACH,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;aACpD,MAAM,CAAC,OAAO,CAAC,CACnB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACb,OAAO,SAAS,IAAI,SAAS,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,KAAc;IACjC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAc,EAAE,QAAQ,GAAG,CAAC;IACvD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;AAChF,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAe,EAAE,GAAa;IACxD,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACtD,IAAI,MAAM,KAAK,QAAQ;QAAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAC/D,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACxE,CAAC","sourcesContent":["import type {\n FlowpressBlock,\n FlowpressBlockTypeDescriptor,\n FlowpressCompositionDiagnostic,\n FlowpressCompositionStylesheet,\n} from \"../../index.js\";\n\n/**\n * resolvedData shapes of the project Query Loop pilot\n * (apps/cms/project/src/query-loop.php and custom-fields.php).\n */\nexport interface NestedPass {\n blockTypes?: FlowpressBlockTypeDescriptor[];\n stylesheets?: FlowpressCompositionStylesheet[];\n diagnostics?: FlowpressCompositionDiagnostic[];\n}\n\nexport interface LoopData extends NestedPass {\n blocks?: FlowpressBlock[];\n}\n\nexport interface LoopItem {\n id: number;\n postType?: string;\n taxonomy?: string;\n blocks: FlowpressBlock[];\n}\n\nexport interface LoopTemplateData extends NestedPass {\n items?: LoopItem[];\n}\n\nexport interface ResolvedImage {\n id?: number;\n url?: string;\n alt?: string;\n width?: number;\n height?: number;\n srcSet?: string;\n sizes?: string;\n sizeSlug?: string;\n href?: string;\n}\n\nexport function classNames(...values: unknown[]): string | undefined {\n const className = [...new Set(\n values\n .flatMap((value) => String(value ?? \"\").split(/\\s+/))\n .filter(Boolean),\n )].join(\" \");\n return className || undefined;\n}\n\nexport function text(value: unknown): string {\n return typeof value === \"string\" ? value : typeof value === \"number\" ? String(value) : \"\";\n}\n\nexport function headingLevel(value: unknown, fallback = 2): number {\n const level = Number(value);\n return Number.isInteger(level) && level >= 0 && level <= 6 ? level : fallback;\n}\n\nexport function externalRel(target: unknown, rel?: unknown): string | undefined {\n const tokens = text(rel).split(/\\s+/).filter(Boolean);\n if (target === \"_blank\") tokens.push(\"noopener\", \"noreferrer\");\n return tokens.length > 0 ? [...new Set(tokens)].join(\" \") : undefined;\n}\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
FlowpressBlock,
|
|
3
|
+
FlowpressBlockTypeDescriptor,
|
|
4
|
+
FlowpressCompositionDiagnostic,
|
|
5
|
+
FlowpressCompositionStylesheet,
|
|
6
|
+
} from "../../index.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* resolvedData shapes of the project Query Loop pilot
|
|
10
|
+
* (apps/cms/project/src/query-loop.php and custom-fields.php).
|
|
11
|
+
*/
|
|
12
|
+
export interface NestedPass {
|
|
13
|
+
blockTypes?: FlowpressBlockTypeDescriptor[];
|
|
14
|
+
stylesheets?: FlowpressCompositionStylesheet[];
|
|
15
|
+
diagnostics?: FlowpressCompositionDiagnostic[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface LoopData extends NestedPass {
|
|
19
|
+
blocks?: FlowpressBlock[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface LoopItem {
|
|
23
|
+
id: number;
|
|
24
|
+
postType?: string;
|
|
25
|
+
taxonomy?: string;
|
|
26
|
+
blocks: FlowpressBlock[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface LoopTemplateData extends NestedPass {
|
|
30
|
+
items?: LoopItem[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface ResolvedImage {
|
|
34
|
+
id?: number;
|
|
35
|
+
url?: string;
|
|
36
|
+
alt?: string;
|
|
37
|
+
width?: number;
|
|
38
|
+
height?: number;
|
|
39
|
+
srcSet?: string;
|
|
40
|
+
sizes?: string;
|
|
41
|
+
sizeSlug?: string;
|
|
42
|
+
href?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function classNames(...values: unknown[]): string | undefined {
|
|
46
|
+
const className = [...new Set(
|
|
47
|
+
values
|
|
48
|
+
.flatMap((value) => String(value ?? "").split(/\s+/))
|
|
49
|
+
.filter(Boolean),
|
|
50
|
+
)].join(" ");
|
|
51
|
+
return className || undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function text(value: unknown): string {
|
|
55
|
+
return typeof value === "string" ? value : typeof value === "number" ? String(value) : "";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function headingLevel(value: unknown, fallback = 2): number {
|
|
59
|
+
const level = Number(value);
|
|
60
|
+
return Number.isInteger(level) && level >= 0 && level <= 6 ? level : fallback;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function externalRel(target: unknown, rel?: unknown): string | undefined {
|
|
64
|
+
const tokens = text(rel).split(/\s+/).filter(Boolean);
|
|
65
|
+
if (target === "_blank") tokens.push("noopener", "noreferrer");
|
|
66
|
+
return tokens.length > 0 ? [...new Set(tokens)].join(" ") : undefined;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/astro/native/registry.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAyCxE,eAAO,MAAM,oBAAoB,EAAE,uBA+ClC,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import NativeAccordion from "./core-accordion.astro";
|
|
2
|
+
import NativeAccordionItem from "./core-accordion-item.astro";
|
|
3
|
+
import NativeAccordionHeading from "./core-accordion-heading.astro";
|
|
4
|
+
import NativeAccordionPanel from "./core-accordion-panel.astro";
|
|
5
|
+
import Renderer0 from "./core-term-name.astro";
|
|
6
|
+
import Renderer2 from "./core-post-terms.astro";
|
|
7
|
+
import Renderer3 from "./core-button.astro";
|
|
8
|
+
import Renderer4 from "./core-post-date.astro";
|
|
9
|
+
import Renderer5 from "./core-icon.astro";
|
|
10
|
+
import Renderer6 from "./core-post-excerpt.astro";
|
|
11
|
+
import Renderer7 from "./core-term-description.astro";
|
|
12
|
+
import Renderer8 from "./core-post-template.astro";
|
|
13
|
+
import Renderer9 from "./core-group.astro";
|
|
14
|
+
import Renderer10 from "./core-html.astro";
|
|
15
|
+
import Renderer11 from "./core-block.astro";
|
|
16
|
+
import Renderer12 from "./core-site-title.astro";
|
|
17
|
+
import Renderer13 from "./core-post-featured-image.astro";
|
|
18
|
+
import Renderer14 from "./core-page-list.astro";
|
|
19
|
+
import Renderer15 from "./core-terms-query.astro";
|
|
20
|
+
import Renderer16 from "./core-buttons.astro";
|
|
21
|
+
import Renderer17 from "./core-image.astro";
|
|
22
|
+
import Renderer18 from "./core-query-no-results.astro";
|
|
23
|
+
import Renderer19 from "./core-term-template.astro";
|
|
24
|
+
import Renderer20 from "./core-navigation.astro";
|
|
25
|
+
import Renderer21 from "./core-navigation-submenu.astro";
|
|
26
|
+
import Renderer22 from "./core-query.astro";
|
|
27
|
+
import Renderer23 from "./core-home-link.astro";
|
|
28
|
+
import Renderer24 from "./core-page-list-item.astro";
|
|
29
|
+
import Renderer25 from "./core-navigation-link.astro";
|
|
30
|
+
import Renderer26 from "./core-post-title.astro";
|
|
31
|
+
import Renderer27 from "./sf-post-field.astro";
|
|
32
|
+
import Renderer28 from "./sf-block-binding.astro";
|
|
33
|
+
import Renderer29 from "./sf-term-field.astro";
|
|
34
|
+
import Renderer30 from "./MapBlock.astro";
|
|
35
|
+
import Renderer31 from "./ProjectTimelineBlock.astro";
|
|
36
|
+
import TimelineCardBlock from "./TimelineCardBlock.astro";
|
|
37
|
+
import BlobBlock from "./BlobBlock.astro";
|
|
38
|
+
import TransparentBlock from "./core-transparent.astro";
|
|
39
|
+
import SeparatorBlock from "./core-separator.astro";
|
|
40
|
+
import SiteLogoBlock from "../blocks/SiteLogoBlock.astro";
|
|
41
|
+
import ThemeToggleBlock from "../blocks/ThemeToggleBlock.astro";
|
|
42
|
+
import ReservedLogin from "./ReservedLogin.astro";
|
|
43
|
+
import Slot from "./sf-slot.astro";
|
|
44
|
+
export const nativeBlockRenderers = {
|
|
45
|
+
"core/accordion": NativeAccordion,
|
|
46
|
+
"core/accordion-item": NativeAccordionItem,
|
|
47
|
+
"core/accordion-heading": NativeAccordionHeading,
|
|
48
|
+
"core/accordion-panel": NativeAccordionPanel,
|
|
49
|
+
"core/separator": SeparatorBlock,
|
|
50
|
+
"core/post-content": TransparentBlock,
|
|
51
|
+
"core/template-part": TransparentBlock,
|
|
52
|
+
"core/site-logo": SiteLogoBlock,
|
|
53
|
+
"sf/theme-toggle": ThemeToggleBlock,
|
|
54
|
+
"sf/slot": Slot,
|
|
55
|
+
"core/term-name": Renderer0,
|
|
56
|
+
"core/post-terms": Renderer2,
|
|
57
|
+
"core/button": Renderer3,
|
|
58
|
+
"core/post-date": Renderer4,
|
|
59
|
+
"core/icon": Renderer5,
|
|
60
|
+
"core/post-excerpt": Renderer6,
|
|
61
|
+
"core/term-description": Renderer7,
|
|
62
|
+
"core/post-template": Renderer8,
|
|
63
|
+
"core/group": Renderer9,
|
|
64
|
+
"core/html": Renderer10,
|
|
65
|
+
"core/block": Renderer11,
|
|
66
|
+
"core/site-title": Renderer12,
|
|
67
|
+
"core/post-featured-image": Renderer13,
|
|
68
|
+
"core/page-list": Renderer14,
|
|
69
|
+
"core/terms-query": Renderer15,
|
|
70
|
+
"core/buttons": Renderer16,
|
|
71
|
+
"core/image": Renderer17,
|
|
72
|
+
"flowpress/login": ReservedLogin,
|
|
73
|
+
"flowpress/reserved-pagination": ReservedLogin,
|
|
74
|
+
"core/query-no-results": Renderer18,
|
|
75
|
+
"core/term-template": Renderer19,
|
|
76
|
+
"core/navigation": Renderer20,
|
|
77
|
+
"core/navigation-submenu": Renderer21,
|
|
78
|
+
"core/query": Renderer22,
|
|
79
|
+
"core/home-link": Renderer23,
|
|
80
|
+
"core/page-list-item": Renderer24,
|
|
81
|
+
"core/navigation-link": Renderer25,
|
|
82
|
+
"core/post-title": Renderer26,
|
|
83
|
+
"sf/post-field": Renderer27,
|
|
84
|
+
"sf/block-binding": Renderer28,
|
|
85
|
+
"sf/term-field": Renderer29,
|
|
86
|
+
"sf/blob": BlobBlock,
|
|
87
|
+
"sf/map": Renderer30,
|
|
88
|
+
"sf/timeline": Renderer31,
|
|
89
|
+
"sf/timeline-card": TimelineCardBlock,
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/astro/native/registry.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,wBAAwB,CAAC;AACrD,OAAO,mBAAmB,MAAM,6BAA6B,CAAC;AAC9D,OAAO,sBAAsB,MAAM,gCAAgC,CAAC;AACpE,OAAO,oBAAoB,MAAM,8BAA8B,CAAC;AAEhE,OAAO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AAU;IACxB,gBAAgB,EAAE,UAAU;IAC5B,qBAAqB,EAAE,UAAU;IACjC,sBAAsB,EAAE,UAAU;IAClC,iBAAiB,EAAE,UAAU;IAC7B,eAAe,EAAE,UAAU;IAC3B,kBAAkB,EAAE,UAAU;IAC9B,eAAe,EAAE,UAAU;IAC3B,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,UAAU;IACpB,aAAa,EAAE,UAAU;IACzB,kBAAkB,EAAE,iBAAiB;CACtC,CAAC","sourcesContent":["import NativeAccordion from \"./core-accordion.astro\";\nimport NativeAccordionItem from \"./core-accordion-item.astro\";\nimport NativeAccordionHeading from \"./core-accordion-heading.astro\";\nimport NativeAccordionPanel from \"./core-accordion-panel.astro\";\nimport type { FlowpressBlockRenderers } from \"../../block-renderers.js\";\nimport Renderer0 from \"./core-term-name.astro\";\nimport Renderer2 from \"./core-post-terms.astro\";\nimport Renderer3 from \"./core-button.astro\";\nimport Renderer4 from \"./core-post-date.astro\";\nimport Renderer5 from \"./core-icon.astro\";\nimport Renderer6 from \"./core-post-excerpt.astro\";\nimport Renderer7 from \"./core-term-description.astro\";\nimport Renderer8 from \"./core-post-template.astro\";\nimport Renderer9 from \"./core-group.astro\";\nimport Renderer10 from \"./core-html.astro\";\nimport Renderer11 from \"./core-block.astro\";\nimport Renderer12 from \"./core-site-title.astro\";\nimport Renderer13 from \"./core-post-featured-image.astro\";\nimport Renderer14 from \"./core-page-list.astro\";\nimport Renderer15 from \"./core-terms-query.astro\";\nimport Renderer16 from \"./core-buttons.astro\";\nimport Renderer17 from \"./core-image.astro\";\nimport Renderer18 from \"./core-query-no-results.astro\";\nimport Renderer19 from \"./core-term-template.astro\";\nimport Renderer20 from \"./core-navigation.astro\";\nimport Renderer21 from \"./core-navigation-submenu.astro\";\nimport Renderer22 from \"./core-query.astro\";\nimport Renderer23 from \"./core-home-link.astro\";\nimport Renderer24 from \"./core-page-list-item.astro\";\nimport Renderer25 from \"./core-navigation-link.astro\";\nimport Renderer26 from \"./core-post-title.astro\";\nimport Renderer27 from \"./sf-post-field.astro\";\nimport Renderer28 from \"./sf-block-binding.astro\";\nimport Renderer29 from \"./sf-term-field.astro\";\nimport Renderer30 from \"./MapBlock.astro\";\nimport Renderer31 from \"./ProjectTimelineBlock.astro\";\nimport TimelineCardBlock from \"./TimelineCardBlock.astro\";\nimport BlobBlock from \"./BlobBlock.astro\";\nimport TransparentBlock from \"./core-transparent.astro\";\nimport SeparatorBlock from \"./core-separator.astro\";\nimport SiteLogoBlock from \"../blocks/SiteLogoBlock.astro\";\nimport ThemeToggleBlock from \"../blocks/ThemeToggleBlock.astro\";\nimport ReservedLogin from \"./ReservedLogin.astro\";\nimport Slot from \"./sf-slot.astro\";\n\nexport const nativeBlockRenderers: FlowpressBlockRenderers = {\n \"core/accordion\": NativeAccordion,\n \"core/accordion-item\": NativeAccordionItem,\n \"core/accordion-heading\": NativeAccordionHeading,\n \"core/accordion-panel\": NativeAccordionPanel,\n\n \"core/separator\": SeparatorBlock,\n \"core/post-content\": TransparentBlock,\n \"core/template-part\": TransparentBlock,\n \"core/site-logo\": SiteLogoBlock,\n \"sf/theme-toggle\": ThemeToggleBlock,\n \"sf/slot\": Slot,\n \"core/term-name\": Renderer0,\n \"core/post-terms\": Renderer2,\n \"core/button\": Renderer3,\n \"core/post-date\": Renderer4,\n \"core/icon\": Renderer5,\n \"core/post-excerpt\": Renderer6,\n \"core/term-description\": Renderer7,\n \"core/post-template\": Renderer8,\n \"core/group\": Renderer9,\n \"core/html\": Renderer10,\n \"core/block\": Renderer11,\n \"core/site-title\": Renderer12,\n \"core/post-featured-image\": Renderer13,\n \"core/page-list\": Renderer14,\n \"core/terms-query\": Renderer15,\n \"core/buttons\": Renderer16,\n \"core/image\": Renderer17,\n \"flowpress/login\": ReservedLogin,\n \"flowpress/reserved-pagination\": ReservedLogin,\n \"core/query-no-results\": Renderer18,\n \"core/term-template\": Renderer19,\n \"core/navigation\": Renderer20,\n \"core/navigation-submenu\": Renderer21,\n \"core/query\": Renderer22,\n \"core/home-link\": Renderer23,\n \"core/page-list-item\": Renderer24,\n \"core/navigation-link\": Renderer25,\n \"core/post-title\": Renderer26,\n \"sf/post-field\": Renderer27,\n \"sf/block-binding\": Renderer28,\n \"sf/term-field\": Renderer29,\n \"sf/blob\": BlobBlock,\n \"sf/map\": Renderer30,\n \"sf/timeline\": Renderer31,\n \"sf/timeline-card\": TimelineCardBlock,\n};\n"]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import NativeAccordion from "./core-accordion.astro";
|
|
2
|
+
import NativeAccordionItem from "./core-accordion-item.astro";
|
|
3
|
+
import NativeAccordionHeading from "./core-accordion-heading.astro";
|
|
4
|
+
import NativeAccordionPanel from "./core-accordion-panel.astro";
|
|
5
|
+
import type { FlowpressBlockRenderers } from "../../block-renderers.js";
|
|
6
|
+
import Renderer0 from "./core-term-name.astro";
|
|
7
|
+
import Renderer2 from "./core-post-terms.astro";
|
|
8
|
+
import Renderer3 from "./core-button.astro";
|
|
9
|
+
import Renderer4 from "./core-post-date.astro";
|
|
10
|
+
import Renderer5 from "./core-icon.astro";
|
|
11
|
+
import Renderer6 from "./core-post-excerpt.astro";
|
|
12
|
+
import Renderer7 from "./core-term-description.astro";
|
|
13
|
+
import Renderer8 from "./core-post-template.astro";
|
|
14
|
+
import Renderer9 from "./core-group.astro";
|
|
15
|
+
import Renderer10 from "./core-html.astro";
|
|
16
|
+
import Renderer11 from "./core-block.astro";
|
|
17
|
+
import Renderer12 from "./core-site-title.astro";
|
|
18
|
+
import Renderer13 from "./core-post-featured-image.astro";
|
|
19
|
+
import Renderer14 from "./core-page-list.astro";
|
|
20
|
+
import Renderer15 from "./core-terms-query.astro";
|
|
21
|
+
import Renderer16 from "./core-buttons.astro";
|
|
22
|
+
import Renderer17 from "./core-image.astro";
|
|
23
|
+
import Renderer18 from "./core-query-no-results.astro";
|
|
24
|
+
import Renderer19 from "./core-term-template.astro";
|
|
25
|
+
import Renderer20 from "./core-navigation.astro";
|
|
26
|
+
import Renderer21 from "./core-navigation-submenu.astro";
|
|
27
|
+
import Renderer22 from "./core-query.astro";
|
|
28
|
+
import Renderer23 from "./core-home-link.astro";
|
|
29
|
+
import Renderer24 from "./core-page-list-item.astro";
|
|
30
|
+
import Renderer25 from "./core-navigation-link.astro";
|
|
31
|
+
import Renderer26 from "./core-post-title.astro";
|
|
32
|
+
import Renderer27 from "./sf-post-field.astro";
|
|
33
|
+
import Renderer28 from "./sf-block-binding.astro";
|
|
34
|
+
import Renderer29 from "./sf-term-field.astro";
|
|
35
|
+
import Renderer30 from "./MapBlock.astro";
|
|
36
|
+
import Renderer31 from "./ProjectTimelineBlock.astro";
|
|
37
|
+
import TimelineCardBlock from "./TimelineCardBlock.astro";
|
|
38
|
+
import BlobBlock from "./BlobBlock.astro";
|
|
39
|
+
import TransparentBlock from "./core-transparent.astro";
|
|
40
|
+
import SeparatorBlock from "./core-separator.astro";
|
|
41
|
+
import SiteLogoBlock from "../blocks/SiteLogoBlock.astro";
|
|
42
|
+
import ThemeToggleBlock from "../blocks/ThemeToggleBlock.astro";
|
|
43
|
+
import ReservedLogin from "./ReservedLogin.astro";
|
|
44
|
+
import Slot from "./sf-slot.astro";
|
|
45
|
+
|
|
46
|
+
export const nativeBlockRenderers: FlowpressBlockRenderers = {
|
|
47
|
+
"core/accordion": NativeAccordion,
|
|
48
|
+
"core/accordion-item": NativeAccordionItem,
|
|
49
|
+
"core/accordion-heading": NativeAccordionHeading,
|
|
50
|
+
"core/accordion-panel": NativeAccordionPanel,
|
|
51
|
+
|
|
52
|
+
"core/separator": SeparatorBlock,
|
|
53
|
+
"core/post-content": TransparentBlock,
|
|
54
|
+
"core/template-part": TransparentBlock,
|
|
55
|
+
"core/site-logo": SiteLogoBlock,
|
|
56
|
+
"sf/theme-toggle": ThemeToggleBlock,
|
|
57
|
+
"sf/slot": Slot,
|
|
58
|
+
"core/term-name": Renderer0,
|
|
59
|
+
"core/post-terms": Renderer2,
|
|
60
|
+
"core/button": Renderer3,
|
|
61
|
+
"core/post-date": Renderer4,
|
|
62
|
+
"core/icon": Renderer5,
|
|
63
|
+
"core/post-excerpt": Renderer6,
|
|
64
|
+
"core/term-description": Renderer7,
|
|
65
|
+
"core/post-template": Renderer8,
|
|
66
|
+
"core/group": Renderer9,
|
|
67
|
+
"core/html": Renderer10,
|
|
68
|
+
"core/block": Renderer11,
|
|
69
|
+
"core/site-title": Renderer12,
|
|
70
|
+
"core/post-featured-image": Renderer13,
|
|
71
|
+
"core/page-list": Renderer14,
|
|
72
|
+
"core/terms-query": Renderer15,
|
|
73
|
+
"core/buttons": Renderer16,
|
|
74
|
+
"core/image": Renderer17,
|
|
75
|
+
"flowpress/login": ReservedLogin,
|
|
76
|
+
"flowpress/reserved-pagination": ReservedLogin,
|
|
77
|
+
"core/query-no-results": Renderer18,
|
|
78
|
+
"core/term-template": Renderer19,
|
|
79
|
+
"core/navigation": Renderer20,
|
|
80
|
+
"core/navigation-submenu": Renderer21,
|
|
81
|
+
"core/query": Renderer22,
|
|
82
|
+
"core/home-link": Renderer23,
|
|
83
|
+
"core/page-list-item": Renderer24,
|
|
84
|
+
"core/navigation-link": Renderer25,
|
|
85
|
+
"core/post-title": Renderer26,
|
|
86
|
+
"sf/post-field": Renderer27,
|
|
87
|
+
"sf/block-binding": Renderer28,
|
|
88
|
+
"sf/term-field": Renderer29,
|
|
89
|
+
"sf/blob": BlobBlock,
|
|
90
|
+
"sf/map": Renderer30,
|
|
91
|
+
"sf/timeline": Renderer31,
|
|
92
|
+
"sf/timeline-card": TimelineCardBlock,
|
|
93
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
|
+
import type { FlowpressBlock, FlowpressBlockRendererProps } from "../../index.js";
|
|
4
|
+
import ResolvedBlocks from "./ResolvedBlocks.astro";
|
|
5
|
+
import type { NestedPass } from "./query-loop.js";
|
|
6
|
+
|
|
7
|
+
const props = Astro.props as FlowpressBlockRendererProps;
|
|
8
|
+
const { block, htmlProps, styleflowProps } = props;
|
|
9
|
+
const data = (block.resolvedData ?? {}) as NestedPass & {
|
|
10
|
+
blocks?: FlowpressBlock[] | undefined;
|
|
11
|
+
items?: { blocks: FlowpressBlock[] }[] | undefined;
|
|
12
|
+
};
|
|
13
|
+
const items = data.items ?? [];
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<StyleflowElement as="div" {...htmlProps} {...styleflowProps} class:list={["wp-block-project-block-binding", htmlProps.class]}>
|
|
17
|
+
{items.length > 0 ? items.map((item, index) => (
|
|
18
|
+
<ResolvedBlocks {...props} blocks={item.blocks} pass={data} renderPassOutput={index === 0} />
|
|
19
|
+
)) : <ResolvedBlocks {...props} blocks={data.blocks ?? []} pass={data} />}
|
|
20
|
+
</StyleflowElement>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
3
|
+
import CustomFieldValue from "./CustomFieldValue.astro";
|
|
4
|
+
|
|
5
|
+
// sf/post-field: ACF / meta field of the current post (custom-fields.php).
|
|
6
|
+
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<CustomFieldValue block={block} htmlProps={htmlProps} styleflowProps={styleflowProps} baseClass="wp-block-project-post-field" />
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
3
|
+
import CustomFieldValue from "./CustomFieldValue.astro";
|
|
4
|
+
|
|
5
|
+
// sf/term-field: ACF / meta field of the current term (custom-fields.php).
|
|
6
|
+
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
<CustomFieldValue block={block} htmlProps={htmlProps} styleflowProps={styleflowProps} baseClass="wp-block-project-term-field" />
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
.flowpress-timeline__list { list-style:none; padding-inline-start:var(--fp-timeline-inset,1.5rem); border-inline-start:var(--fp-timeline-line-width,2px) solid currentColor; }
|
|
2
|
+
.flowpress-timeline__item { position:relative; }
|
|
3
|
+
.flowpress-timeline__item::before { content:""; position:absolute; inline-size:var(--fp-timeline-marker-size,.5rem); block-size:var(--fp-timeline-marker-size,.5rem); border-radius:50%; background:currentColor; inset-inline-start:calc(-1 * var(--fp-timeline-inset,1.5rem) - var(--fp-timeline-marker-size,.5rem) / 2 - var(--fp-timeline-line-width,2px) / 2); }
|
|
4
|
+
.flowpress-timeline__item :is(img, svg.flowpress-svg-media) { max-inline-size:100%; block-size:auto; }
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type TimelineTone = string;
|
|
2
|
+
export type TimelineIntensity = string;
|
|
3
|
+
export interface TimelineMedia {
|
|
4
|
+
url?: string | undefined;
|
|
5
|
+
sourceUrl?: string | undefined;
|
|
6
|
+
alt?: string | undefined;
|
|
7
|
+
altText?: string | undefined;
|
|
8
|
+
width?: number | undefined;
|
|
9
|
+
height?: number | undefined;
|
|
10
|
+
}
|
|
11
|
+
export interface TimelineItem {
|
|
12
|
+
year: string;
|
|
13
|
+
description: string;
|
|
14
|
+
image?: TimelineMedia | undefined;
|
|
15
|
+
metric?: string | undefined;
|
|
16
|
+
statisticValue?: string | undefined;
|
|
17
|
+
statisticLabel?: string | undefined;
|
|
18
|
+
tone?: TimelineTone | "inherit" | undefined;
|
|
19
|
+
intensity?: TimelineIntensity | "inherit" | undefined;
|
|
20
|
+
}
|
|
21
|
+
export interface TimelineBlockLike {
|
|
22
|
+
name?: string;
|
|
23
|
+
attributes?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export declare function normalizeTimelineTone(value: unknown): string;
|
|
26
|
+
export declare const normalizeTimelineIntensity: typeof normalizeTimelineTone;
|
|
27
|
+
export declare function timelineItemsFromBlocks(blocks: TimelineBlockLike[]): TimelineIt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uB,CACrC,MAAM,EAAE,iBAAiB,EAAE,GAC1B,YAAY,EAAE,CAgBhB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function optionalText(value) {
|
|
2
|
+
const normalized = String(value ?? "").trim();
|
|
3
|
+
return normalized || undefined;
|
|
4
|
+
}
|
|
5
|
+
export function normalizeTimelineTone(value) {
|
|
6
|
+
const normalized = String(value ?? "inherit").trim();
|
|
7
|
+
return /^[a-z][a-z0-9-]*$/.test(normalized) ? normalized : "inherit";
|
|
8
|
+
}
|
|
9
|
+
export const normalizeTimelineIntensity = normalizeTimelineTone;
|
|
10
|
+
function mediaValue(value) {
|
|
11
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
const media = value;
|
|
15
|
+
const url = optionalText(media.url) ?? optionalText(media.sourceUrl);
|
|
16
|
+
if (!url) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
url: optionalText(media.url),
|
|
21
|
+
sourceUrl: optionalText(media.sourceUrl),
|
|
22
|
+
alt: optionalText(media.alt),
|
|
23
|
+
altText: optionalText(media.altText),
|
|
24
|
+
width: Number(media.width) || undefined,
|
|
25
|
+
height: Number(media.height) || undefined
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function timelineItemsFromBlocks(blocks) {
|
|
29
|
+
return blocks
|
|
30
|
+
.filter(({ name }) => name === "sf/timeline-card")
|
|
31
|
+
.map(({ attributes = {} }) => ({
|
|
32
|
+
year: String(attributes.year ?? "").trim(),
|
|
33
|
+
description: String(attributes.description ?? "").trim(),
|
|
34
|
+
image: mediaValue(attributes.image),
|
|
35
|
+
metric: optionalText(attributes.metric),
|
|
36
|
+
statisticValue: optionalText(attributes.statisticValue),
|
|
37
|
+
statisticLabel: optionalText(attributes.statisticLabel),
|
|
38
|
+
tone: normalizeTimelineTone(attributes.tone),
|
|
39
|
+
intensity: normalizeTimelineIntensity(attributes.intensity)
|
|
40
|
+
}))
|
|
41
|
+
.filter(({ year, description, image, metric, statisticValue }) => (Boolean(year || description || image || metric || statisticValue)));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.js","sourceRoot":"","sources":["../../../src/astro/native/timeline.ts"],"names":[],"mappings":"AA4BA,SAAS,YAAY,CAAC,KAAc;IAClC,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9C,OAAO,UAAU,IAAI,SAAS,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAc;IAClD,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,IAAI,SAAS,CAAC,CAAC,IAAI,EAAE,CAAC;IACrD,OAAO,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC;AACD,MAAM,CAAC,MAAM,0BAA0B,GAAG,qBAAqB,CAAC;AAEhE,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAChE,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,KAAK,GAAG,KAAgC,CAAC;IAC/C,MAAM,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACrE,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC;QAC5B,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC,SAAS,CAAC;QACxC,GAAG,EA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\nexport type TimelineIntensity = string;\n\nexport interface TimelineMedia {\n url?: string | undefined;\n sourceUrl?: string | undefined;\n alt?: string | undefined;\n altText?: string | undefined;\n width?: number | undefined;\n height?: number | undefined;\n}\n\nexport interface TimelineItem {\n year: string;\n description: string;\n image?: TimelineMedia | undefined;\n metric?: string | undefined;\n statisticValue?: string | undefined;\n statisticLabel?: string | undefined;\n tone?: TimelineTone | \"inherit\" | undefined;\n intensity?: TimelineIntensity | \"inherit\" | undefined;\n}\n\nexport interface TimelineBlockLike {\n name?: string;\n attributes?: Record<string, unknown>;\n}\n\nfunction optionalText(value: unknown): string | undefined {\n const normalized = String(value ?? \"\").trim();\n return normalized || undefined;\n}\n\nexport function normalizeTimelineTone(value: unknown): string {\n const normalized = String(value ?? \"inherit\").trim();\n return /^[a-z][a-z0-9-]*$/.test(normalized) ? normalized : \"inherit\";\n}\nexport const normalizeTimelineIntensity = normalizeTimelineTone;\n\nfunction mediaValue(value: unknown): TimelineMedia | undefined {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return undefined;\n }\n\n const media = value as Record<string, unknown>;\n const url = optionalText(media.url) ?? optionalText(media.sourceUrl);\n if (!url) {\n return undefined;\n }\n\n return {\n url: optionalText(media.url),\n sourceUrl: optionalText(media.sourceUrl),\n alt: optionalText(media.alt),\n altText: optionalText(media.altText),\n width: Number(media.width) || undefined,\n height: Number(media.height) || undefined\n };\n}\n\nexport function timelineItemsFromBlocks(\n blocks: TimelineBlockLike[]\n): TimelineItem[] {\n return blocks\n .filter(({ name }) => name === \"sf/timeline-card\")\n .map(({ attributes = {} }) => ({\n year: String(attributes.year ?? \"\").trim(),\n description: String(attributes.description ?? \"\").trim(),\n image: mediaValue(attributes.image),\n metric: optionalText(attributes.metric),\n statisticValue: optionalText(attributes.statisticValue),\n statisticLabel: optionalText(attributes.statisticLabel),\n tone: normalizeTimelineTone(attributes.tone),\n intensity: normalizeTimelineIntensity(attributes.intensity)\n }))\n .filter(({ year, description, image, metric, statisticValue }) => (\n Boolean(year || description || image || metric || statisticValue)\n ));\n}\n"]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export type TimelineTone = string;
|
|
2
|
+
export type TimelineIntensity = string;
|
|
3
|
+
|
|
4
|
+
export interface TimelineMedia {
|
|
5
|
+
url?: string | undefined;
|
|
6
|
+
sourceUrl?: string | undefined;
|
|
7
|
+
alt?: string | undefined;
|
|
8
|
+
altText?: string | undefined;
|
|
9
|
+
width?: number | undefined;
|
|
10
|
+
height?: number | undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface TimelineItem {
|
|
14
|
+
year: string;
|
|
15
|
+
description: string;
|
|
16
|
+
image?: TimelineMedia | undefined;
|
|
17
|
+
metric?: string | undefined;
|
|
18
|
+
statisticValue?: string | undefined;
|
|
19
|
+
statisticLabel?: string | undefined;
|
|
20
|
+
tone?: TimelineTone | "inherit" | undefined;
|
|
21
|
+
intensity?: TimelineIntensity | "inherit" | undefined;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface TimelineBlockLike {
|
|
25
|
+
name?: string;
|
|
26
|
+
attributes?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function optionalText(value: unknown): string | undefined {
|
|
30
|
+
const normalized = String(value ?? "").trim();
|
|
31
|
+
return normalized || undefined;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function normalizeTimelineTone(value: unknown): string {
|
|
35
|
+
const normalized = String(value ?? "inherit").trim();
|
|
36
|
+
return /^[a-z][a-z0-9-]*$/.test(normalized) ? normalized : "inherit";
|
|
37
|
+
}
|
|
38
|
+
export const normalizeTimelineIntensity = normalizeTimelineTone;
|
|
39
|
+
|
|
40
|
+
function mediaValue(value: unknown): TimelineMedia | undefined {
|
|
41
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const media = value as Record<string, unknown>;
|
|
46
|
+
const url = optionalText(media.url) ?? optionalText(media.sourceUrl);
|
|
47
|
+
if (!url) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
url: optionalText(media.url),
|
|
53
|
+
sourceUrl: optionalText(media.sourceUrl),
|
|
54
|
+
alt: optionalText(media.alt),
|
|
55
|
+
altText: optionalText(media.altText),
|
|
56
|
+
width: Number(media.width) || undefined,
|
|
57
|
+
height: Number(media.height) || undefined
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function timelineItemsFromBlocks(
|
|
62
|
+
blocks: TimelineBlockLike[]
|
|
63
|
+
): TimelineItem[] {
|
|
64
|
+
return blocks
|
|
65
|
+
.filter(({ name }) => name === "sf/timeline-card")
|
|
66
|
+
.map(({ attributes = {} }) => ({
|
|
67
|
+
year: String(attributes.year ?? "").trim(),
|
|
68
|
+
description: String(attributes.description ?? "").trim(),
|
|
69
|
+
image: mediaValue(attributes.image),
|
|
70
|
+
metric: optionalText(attributes.metric),
|
|
71
|
+
statisticValue: optionalText(attributes.statisticValue),
|
|
72
|
+
statisticLabel: optionalText(attributes.statisticLabel),
|
|
73
|
+
tone: normalizeTimelineTone(attributes.tone),
|
|
74
|
+
intensity: normalizeTimelineIntensity(attributes.intensity)
|
|
75
|
+
}))
|
|
76
|
+
.filter(({ year, description, image, metric, statisticValue }) => (
|
|
77
|
+
Boolean(year || description || image || metric || statisticValue)
|
|
78
|
+
));
|
|
79
|
+
}
|