@styleflow.app/flowpress-astro-core 1.0.0-beta.2 → 1.0.0-beta.20
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 +146 -1
- package/README.md +111 -3
- package/dist/astro/BaseLayout.astro +10 -6
- package/dist/astro/CompositionRenderer.astro +148 -0
- package/dist/astro/DefaultBlockAdapter.astro +35 -0
- package/dist/astro/DefaultTemplate.astro +6 -1
- package/dist/astro/GutenbergRenderer.astro +231 -72
- package/dist/astro/ThemeRuntime.astro +24 -0
- package/dist/astro/blocks/CarouselBlock.astro +7 -9
- package/dist/astro/blocks/CarouselItemBlock.astro +3 -3
- package/dist/astro/blocks/ColumnBlock.astro +3 -4
- package/dist/astro/blocks/CoverBlock.astro +155 -0
- package/dist/astro/blocks/FormBlock.astro +18 -16
- package/dist/astro/blocks/GridBlock.astro +3 -3
- package/dist/astro/blocks/HeroBlock.astro +3 -4
- package/dist/astro/blocks/ImageBlock.astro +3 -4
- package/dist/astro/blocks/ListItemFallback.astro +7 -5
- package/dist/astro/blocks/NumberSpinnerBlock.astro +25 -19
- package/dist/astro/blocks/SemanticElement.astro +35 -0
- package/dist/astro/blocks/SiteLogoBlock.astro +53 -0
- package/dist/astro/blocks/TextBlock.astro +29 -25
- package/dist/astro/blocks/ThemeToggleBlock.astro +23 -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 +7 -0
- package/dist/astro/blocks/helpers.d.ts.map +1 -1
- package/dist/astro/blocks/helpers.js +51 -41
- package/dist/astro/blocks/helpers.js.map +1 -1
- package/dist/astro/blocks/helpers.ts +63 -45
- package/dist/astro/native/Blob.astro +113 -0
- package/dist/astro/native/BlobBlock.astro +52 -0
- package/dist/astro/native/CustomFieldValue.astro +86 -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 +33 -0
- package/dist/astro/native/ProjectTimelineBlock.astro +34 -0
- package/dist/astro/native/ResolvedBlocks.astro +89 -0
- package/dist/astro/native/SyncedPatternContent.astro +92 -0
- package/dist/astro/native/TermFieldValue.astro +37 -0
- package/dist/astro/native/Timeline.astro +20 -0
- package/dist/astro/native/TimelineCardBlock.astro +7 -0
- package/dist/astro/native/blob/blob-shapes.generated.d.ts +2 -0
- package/dist/astro/native/blob/blob-shapes.generated.d.ts.map +1 -0
- package/dist/astro/native/blob/blob-shapes.generated.js +2 -0
- package/dist/astro/native/blob/blob-shapes.generated.js.map +1 -0
- package/dist/astro/native/blob/blob-shapes.generated.ts +1 -0
- package/dist/astro/native/blob/config.d.ts +49 -0
- package/dist/astro/native/blob/config.d.ts.map +1 -0
- package/dist/astro/native/blob/config.js +86 -0
- package/dist/astro/native/blob/config.js.map +1 -0
- package/dist/astro/native/blob/config.ts +132 -0
- package/dist/astro/native/blob/controller.d.ts +11 -0
- package/dist/astro/native/blob/controller.d.ts.map +1 -0
- package/dist/astro/native/blob/controller.js +240 -0
- package/dist/astro/native/blob/controller.js.map +1 -0
- package/dist/astro/native/blob/controller.ts +248 -0
- package/dist/astro/native/blob/geometry.d.ts +2 -0
- package/dist/astro/native/blob/geometry.d.ts.map +1 -0
- package/dist/astro/native/blob/geometry.js +2 -0
- package/dist/astro/native/blob/geometry.js.map +1 -0
- package/dist/astro/native/blob/geometry.ts +1 -0
- package/dist/astro/native/blob/ids.d.ts +7 -0
- package/dist/astro/native/blob/ids.d.ts.map +1 -0
- package/dist/astro/native/blob/ids.js +11 -0
- package/dist/astro/native/blob/ids.js.map +1 -0
- package/dist/astro/native/blob/ids.ts +11 -0
- package/dist/astro/native/blob.css +83 -0
- package/dist/astro/native/button.d.ts +13 -0
- package/dist/astro/native/button.d.ts.map +1 -0
- package/dist/astro/native/button.js +26 -0
- package/dist/astro/native/button.js.map +1 -0
- package/dist/astro/native/button.ts +26 -0
- package/dist/astro/native/core-block.astro +18 -0
- package/dist/astro/native/core-button.astro +43 -0
- package/dist/astro/native/core-buttons.astro +14 -0
- package/dist/astro/native/core-group.astro +23 -0
- package/dist/astro/native/core-home-link.astro +11 -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 +124 -0
- package/dist/astro/native/core-navigation-link.astro +70 -0
- package/dist/astro/native/core-navigation-submenu.astro +32 -0
- package/dist/astro/native/core-navigation.astro +94 -0
- package/dist/astro/native/core-page-list-data-item.astro +18 -0
- package/dist/astro/native/core-page-list-item.astro +7 -0
- package/dist/astro/native/core-page-list.astro +40 -0
- package/dist/astro/native/core-post-date.astro +20 -0
- package/dist/astro/native/core-post-excerpt.astro +25 -0
- package/dist/astro/native/core-post-featured-image.astro +37 -0
- package/dist/astro/native/core-post-template.astro +30 -0
- package/dist/astro/native/core-post-terms.astro +46 -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-site-title.astro +15 -0
- package/dist/astro/native/core-term-description.astro +12 -0
- package/dist/astro/native/core-term-name.astro +20 -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/flowpress-navigation-controller.d.ts +2 -0
- package/dist/astro/native/flowpress-navigation-controller.d.ts.map +1 -0
- package/dist/astro/native/flowpress-navigation-controller.js +217 -0
- package/dist/astro/native/flowpress-navigation-controller.js.map +1 -0
- package/dist/astro/native/flowpress-navigation-controller.ts +215 -0
- package/dist/astro/native/flowpress-navigation.css +17 -0
- package/dist/astro/native/grid-bleed.js +106 -0
- package/dist/astro/native/grid.css +180 -0
- package/dist/astro/native/grid.d.ts +17 -0
- package/dist/astro/native/grid.d.ts.map +1 -0
- package/dist/astro/native/grid.js +103 -0
- package/dist/astro/native/grid.js.map +1 -0
- package/dist/astro/native/grid.ts +118 -0
- package/dist/astro/native/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/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-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 +72 -0
- package/dist/astro/native/registry.js.map +1 -0
- package/dist/astro/native/registry.ts +72 -0
- package/dist/astro/native/sf-block-binding.astro +20 -0
- package/dist/astro/native/sf-post-field.astro +9 -0
- package/dist/astro/native/sf-term-field.astro +9 -0
- package/dist/astro/native/timeline.css +4 -0
- package/dist/astro/native/timeline.d.ts +28 -0
- package/dist/astro/native/timeline.d.ts.map +1 -0
- package/dist/astro/native/timeline.js +43 -0
- package/dist/astro/native/timeline.js.map +1 -0
- package/dist/astro/native/timeline.ts +79 -0
- package/dist/block-renderers.d.ts +20 -3
- package/dist/block-renderers.d.ts.map +1 -1
- package/dist/block-renderers.js.map +1 -1
- package/dist/client.d.ts +17 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +63 -9
- 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 +124 -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 +107 -0
- package/dist/default-blocks.js.map +1 -0
- package/dist/env.d.ts +9 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +20 -0
- package/dist/env.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/links.d.ts +5 -0
- package/dist/links.d.ts.map +1 -0
- package/dist/links.js +32 -0
- package/dist/links.js.map +1 -0
- package/dist/media.d.ts +28 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +212 -0
- package/dist/media.js.map +1 -0
- package/dist/styleflow.d.ts +16 -1
- package/dist/styleflow.d.ts.map +1 -1
- package/dist/styleflow.js +67 -7
- package/dist/styleflow.js.map +1 -1
- package/dist/templates.d.ts +16 -16
- package/dist/theme-runtime.d.ts +16 -0
- package/dist/theme-runtime.d.ts.map +1 -0
- package/dist/theme-runtime.js +77 -0
- package/dist/theme-runtime.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +84 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +13 -4
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import Renderer0 from "./core-term-name.astro";
|
|
2
|
+
import Renderer2 from "./core-post-terms.astro";
|
|
3
|
+
import Renderer3 from "./core-button.astro";
|
|
4
|
+
import Renderer4 from "./core-post-date.astro";
|
|
5
|
+
import Renderer5 from "./core-icon.astro";
|
|
6
|
+
import Renderer6 from "./core-post-excerpt.astro";
|
|
7
|
+
import Renderer7 from "./core-term-description.astro";
|
|
8
|
+
import Renderer8 from "./core-post-template.astro";
|
|
9
|
+
import Renderer9 from "./core-group.astro";
|
|
10
|
+
import Renderer10 from "./core-html.astro";
|
|
11
|
+
import Renderer11 from "./core-block.astro";
|
|
12
|
+
import Renderer12 from "./core-site-title.astro";
|
|
13
|
+
import Renderer13 from "./core-post-featured-image.astro";
|
|
14
|
+
import Renderer14 from "./core-page-list.astro";
|
|
15
|
+
import Renderer15 from "./core-terms-query.astro";
|
|
16
|
+
import Renderer16 from "./core-buttons.astro";
|
|
17
|
+
import Renderer17 from "./core-image.astro";
|
|
18
|
+
import Renderer18 from "./core-query-no-results.astro";
|
|
19
|
+
import Renderer19 from "./core-term-template.astro";
|
|
20
|
+
import Renderer20 from "./core-navigation.astro";
|
|
21
|
+
import Renderer21 from "./core-navigation-submenu.astro";
|
|
22
|
+
import Renderer22 from "./core-query.astro";
|
|
23
|
+
import Renderer23 from "./core-home-link.astro";
|
|
24
|
+
import Renderer24 from "./core-page-list-item.astro";
|
|
25
|
+
import Renderer25 from "./core-navigation-link.astro";
|
|
26
|
+
import Renderer26 from "./core-post-title.astro";
|
|
27
|
+
import Renderer27 from "./sf-post-field.astro";
|
|
28
|
+
import Renderer28 from "./sf-block-binding.astro";
|
|
29
|
+
import Renderer29 from "./sf-term-field.astro";
|
|
30
|
+
import Renderer30 from "./MapBlock.astro";
|
|
31
|
+
import Renderer31 from "./ProjectTimelineBlock.astro";
|
|
32
|
+
import TimelineCardBlock from "./TimelineCardBlock.astro";
|
|
33
|
+
import BlobBlock from "./BlobBlock.astro";
|
|
34
|
+
export const nativeBlockRenderers = {
|
|
35
|
+
"core/term-name": Renderer0,
|
|
36
|
+
"core/post-terms": Renderer2,
|
|
37
|
+
"core/button": Renderer3,
|
|
38
|
+
"core/post-date": Renderer4,
|
|
39
|
+
"core/icon": Renderer5,
|
|
40
|
+
"core/post-excerpt": Renderer6,
|
|
41
|
+
"core/term-description": Renderer7,
|
|
42
|
+
"core/post-template": Renderer8,
|
|
43
|
+
"core/group": Renderer9,
|
|
44
|
+
"core/html": Renderer10,
|
|
45
|
+
"core/block": Renderer11,
|
|
46
|
+
"core/site-title": Renderer12,
|
|
47
|
+
"core/post-featured-image": Renderer13,
|
|
48
|
+
"core/page-list": Renderer14,
|
|
49
|
+
"core/terms-query": Renderer15,
|
|
50
|
+
"core/buttons": Renderer16,
|
|
51
|
+
"core/image": Renderer17,
|
|
52
|
+
"core/query-no-results": Renderer18,
|
|
53
|
+
"core/term-template": Renderer19,
|
|
54
|
+
"core/navigation": Renderer20,
|
|
55
|
+
"core/navigation-submenu": Renderer21,
|
|
56
|
+
"core/query": Renderer22,
|
|
57
|
+
"core/home-link": Renderer23,
|
|
58
|
+
"core/page-list-item": Renderer24,
|
|
59
|
+
"core/navigation-link": Renderer25,
|
|
60
|
+
"core/post-title": Renderer26,
|
|
61
|
+
"sf/post-field": Renderer27,
|
|
62
|
+
"project/post-field": Renderer27,
|
|
63
|
+
"sf/block-binding": Renderer28,
|
|
64
|
+
"project/block-binding": Renderer28,
|
|
65
|
+
"sf/term-field": Renderer29,
|
|
66
|
+
"project/term-field": Renderer29,
|
|
67
|
+
"sf/blob": BlobBlock,
|
|
68
|
+
"sf/map": Renderer30,
|
|
69
|
+
"sf/timeline": Renderer31,
|
|
70
|
+
"sf/timeline-card": TimelineCardBlock,
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/astro/native/registry.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,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D,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,MAAM,CAAC,MAAM,oBAAoB,GAA4B;IAC3D,gBAAgB,EAAE,SAAS;IAC3B,iBAAiB,EAAE,SAAS;IAC5B,aAAa,EAAE,SAAS;IACxB,gBAAgB,EAAE,SAAS;IAC3B,WAAW,EAAE,SAAS;IACtB,mBAAmB,EAAE,SAAS;IAC9B,uBAAuB,EAAE,SAAS;IAClC,oBAAoB,EAAE,SAAS;IAC/B,YAAY,EAAE,SAAS;IACvB,WAAW,EAAE,UAAU;IACvB,YAAY,EAAE,UAAU;IACxB,iBAAiB,EAAE,UAAU;IAC7B,0BAA0B,EAAE,UAAU;IACtC,gBAAgB,EAAE,UAAU;IAC5B,kBAAkB,EAAE,UAAU;IAC9B,cAAc,EAAE,UAAU;IAC1B,YAAY,EAAE,UAAU;IACxB,uBAAuB,EAAE,UAAU;IACnC,oBAAoB,EAAE,UAAU;IAChC,iBAAiB,EAAE,UAAU;IAC7B,yBAAyB,EAAE,UAAU;IACrC,YAAY,EAAE,UAAU;IACxB,gBAAgB,EAAE,UAAU;IAC5B,qBAAqB,EAAE,UAAU;IACjC,sBAAsB,EAAE,UAAU;IAClC,iBAAiB,EAAE,UAAU;IAC7B,eAAe,EAAE,UAAU;IAC3B,oBAAoB,EAAE,UAAU;IAChC,kBAAkB,EAAE,UAAU;IAC9B,uBAAuB,EAAE,UAAU;IACnC,eAAe,EAAE,UAAU;IAC3B,oBAAoB,EAAE,UAAU;IAChC,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,UAAU;IACpB,aAAa,EAAE,UAAU;IACzB,kBAAkB,EAAE,iBAAiB;CACtC,CAAC","sourcesContent":["import 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\";\nexport const nativeBlockRenderers: FlowpressBlockRenderers = {\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 \"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 \"project/post-field\": Renderer27,\n \"sf/block-binding\": Renderer28,\n \"project/block-binding\": Renderer28,\n \"sf/term-field\": Renderer29,\n \"project/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,72 @@
|
|
|
1
|
+
import type { FlowpressBlockRenderers } from "../../block-renderers.js";
|
|
2
|
+
import Renderer0 from "./core-term-name.astro";
|
|
3
|
+
import Renderer2 from "./core-post-terms.astro";
|
|
4
|
+
import Renderer3 from "./core-button.astro";
|
|
5
|
+
import Renderer4 from "./core-post-date.astro";
|
|
6
|
+
import Renderer5 from "./core-icon.astro";
|
|
7
|
+
import Renderer6 from "./core-post-excerpt.astro";
|
|
8
|
+
import Renderer7 from "./core-term-description.astro";
|
|
9
|
+
import Renderer8 from "./core-post-template.astro";
|
|
10
|
+
import Renderer9 from "./core-group.astro";
|
|
11
|
+
import Renderer10 from "./core-html.astro";
|
|
12
|
+
import Renderer11 from "./core-block.astro";
|
|
13
|
+
import Renderer12 from "./core-site-title.astro";
|
|
14
|
+
import Renderer13 from "./core-post-featured-image.astro";
|
|
15
|
+
import Renderer14 from "./core-page-list.astro";
|
|
16
|
+
import Renderer15 from "./core-terms-query.astro";
|
|
17
|
+
import Renderer16 from "./core-buttons.astro";
|
|
18
|
+
import Renderer17 from "./core-image.astro";
|
|
19
|
+
import Renderer18 from "./core-query-no-results.astro";
|
|
20
|
+
import Renderer19 from "./core-term-template.astro";
|
|
21
|
+
import Renderer20 from "./core-navigation.astro";
|
|
22
|
+
import Renderer21 from "./core-navigation-submenu.astro";
|
|
23
|
+
import Renderer22 from "./core-query.astro";
|
|
24
|
+
import Renderer23 from "./core-home-link.astro";
|
|
25
|
+
import Renderer24 from "./core-page-list-item.astro";
|
|
26
|
+
import Renderer25 from "./core-navigation-link.astro";
|
|
27
|
+
import Renderer26 from "./core-post-title.astro";
|
|
28
|
+
import Renderer27 from "./sf-post-field.astro";
|
|
29
|
+
import Renderer28 from "./sf-block-binding.astro";
|
|
30
|
+
import Renderer29 from "./sf-term-field.astro";
|
|
31
|
+
import Renderer30 from "./MapBlock.astro";
|
|
32
|
+
import Renderer31 from "./ProjectTimelineBlock.astro";
|
|
33
|
+
import TimelineCardBlock from "./TimelineCardBlock.astro";
|
|
34
|
+
import BlobBlock from "./BlobBlock.astro";
|
|
35
|
+
export const nativeBlockRenderers: FlowpressBlockRenderers = {
|
|
36
|
+
"core/term-name": Renderer0,
|
|
37
|
+
"core/post-terms": Renderer2,
|
|
38
|
+
"core/button": Renderer3,
|
|
39
|
+
"core/post-date": Renderer4,
|
|
40
|
+
"core/icon": Renderer5,
|
|
41
|
+
"core/post-excerpt": Renderer6,
|
|
42
|
+
"core/term-description": Renderer7,
|
|
43
|
+
"core/post-template": Renderer8,
|
|
44
|
+
"core/group": Renderer9,
|
|
45
|
+
"core/html": Renderer10,
|
|
46
|
+
"core/block": Renderer11,
|
|
47
|
+
"core/site-title": Renderer12,
|
|
48
|
+
"core/post-featured-image": Renderer13,
|
|
49
|
+
"core/page-list": Renderer14,
|
|
50
|
+
"core/terms-query": Renderer15,
|
|
51
|
+
"core/buttons": Renderer16,
|
|
52
|
+
"core/image": Renderer17,
|
|
53
|
+
"core/query-no-results": Renderer18,
|
|
54
|
+
"core/term-template": Renderer19,
|
|
55
|
+
"core/navigation": Renderer20,
|
|
56
|
+
"core/navigation-submenu": Renderer21,
|
|
57
|
+
"core/query": Renderer22,
|
|
58
|
+
"core/home-link": Renderer23,
|
|
59
|
+
"core/page-list-item": Renderer24,
|
|
60
|
+
"core/navigation-link": Renderer25,
|
|
61
|
+
"core/post-title": Renderer26,
|
|
62
|
+
"sf/post-field": Renderer27,
|
|
63
|
+
"project/post-field": Renderer27,
|
|
64
|
+
"sf/block-binding": Renderer28,
|
|
65
|
+
"project/block-binding": Renderer28,
|
|
66
|
+
"sf/term-field": Renderer29,
|
|
67
|
+
"project/term-field": Renderer29,
|
|
68
|
+
"sf/blob": BlobBlock,
|
|
69
|
+
"sf/map": Renderer30,
|
|
70
|
+
"sf/timeline": Renderer31,
|
|
71
|
+
"sf/timeline-card": TimelineCardBlock,
|
|
72
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
import S from "@styleflow.app/astro/S.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
|
+
<S.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
|
+
</S.div>
|
|
@@ -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 img { 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[]): TimelineItem[];
|
|
28
|
+
//# sourceMappingURL=timeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeline.d.ts","sourceRoot":"","sources":["../../../src/astro/native/timeline.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAClC,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC;IAC5C,SAAS,CAAC,EAAE,iBAAiB,GAAG,SAAS,GAAG,SAAS,CAAC;CACvD;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAOD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAG5D;AACD,eAAO,MAAM,0BAA0B,8BAAwB,CAAC;AAuBhE,wBAAgB,uBAAuB,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,M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AC,UAAU,CAAC,KAAK,CAAC;QACnC,MAAM,EAAE,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC;QACvC,cAAc,EAAE,YAAY,CAAC,UAAU,CAAC,cAAc,CAAC;QACvD,cAAc,EAAE,YAAY,CAAC,UAAU,CAAC,cAAc,CAAC;QACvD,IAAI,EAAE,qBAAqB,CAAC,UAAU,CAAC,IAAI,CAAC;QAC5C,SAAS,EAAE,0BAA0B,CAAC,UAAU,CAAC,SAAS,CAAC;KAC5D,CAAC,CAAC;SACF,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC,CAChE,OAAO,CAAC,IAAI,IAAI,WAAW,IAAI,KAAK,IAAI,MAAM,IAAI,cAAc,CAAC,CAClE,CAAC,CAAC;AACP,CAAC","sourcesContent":["export type TimelineTone = string;\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
|
+
}
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import type { AstroComponentFactory } from "astro/runtime/server/index.js";
|
|
2
|
-
import type { StyleflowContract } from "./styleflow.js";
|
|
3
|
-
import type { FlowpressBlock } from "./types.js";
|
|
2
|
+
import type { DynamicStyleflowProps, StyleflowContract } from "./styleflow.js";
|
|
3
|
+
import type { FlowpressBlock, FlowpressBlockHtmlProps, FlowpressBlockAdapterStatus, FlowpressBlockClass, FlowpressCompositionV1 } from "./types.js";
|
|
4
4
|
export interface FlowpressBlockRendererProps {
|
|
5
5
|
block: FlowpressBlock;
|
|
6
|
-
|
|
6
|
+
styleflowProps: DynamicStyleflowProps;
|
|
7
|
+
htmlProps: FlowpressBlockHtmlProps;
|
|
8
|
+
composition?: FlowpressCompositionV1 | undefined;
|
|
9
|
+
context: {
|
|
10
|
+
parentBlockName?: string;
|
|
11
|
+
depth: number;
|
|
12
|
+
production: boolean;
|
|
13
|
+
};
|
|
14
|
+
parentBlockName?: string;
|
|
15
|
+
contract?: StyleflowContract | undefined;
|
|
16
|
+
adapters?: FlowpressBlockAdapters | undefined;
|
|
7
17
|
}
|
|
8
18
|
export interface FlowpressIconRendererProps {
|
|
9
19
|
name: string;
|
|
@@ -19,4 +29,11 @@ export interface FlowpressIconRendererProps {
|
|
|
19
29
|
export type FlowpressBlockRenderer = AstroComponentFactory;
|
|
20
30
|
export type FlowpressIconRenderer = AstroComponentFactory;
|
|
21
31
|
export type FlowpressBlockRenderers = Readonly<Record<string, FlowpressBlockRenderer>>;
|
|
32
|
+
export interface FlowpressBlockAdapterDefinition {
|
|
33
|
+
renderer: FlowpressBlockRenderer;
|
|
34
|
+
status: FlowpressBlockAdapterStatus;
|
|
35
|
+
class: FlowpressBlockClass;
|
|
36
|
+
fingerprint: string;
|
|
37
|
+
}
|
|
38
|
+
export type FlowpressBlockAdapters = Readonly<Record<string, FlowpressBlockAdapterDefinition>>;
|
|
22
39
|
//# sourceMappingURL=block-renderers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-renderers.d.ts","sourceRoot":"","sources":["../src/block-renderers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"block-renderers.d.ts","sourceRoot":"","sources":["../src/block-renderers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,2BAA2B,EAC3B,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,cAAc,CAAC;IACtB,cAAc,EAAE,qBAAqB,CAAC;IACtC,SAAS,EAAE,uBAAuB,CAAC;IACnC,WAAW,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC;IACjD,OAAO,EAAE;QACP,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC;CAC/C;AAED,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAE3D,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAE1D,MAAM,MAAM,uBAAuB,GAAG,QAAQ,CAC5C,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CACvC,CAAC;AAEF,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,EAAE,sBAAsB,CAAC;IACjC,MAAM,EAAE,2BAA2B,CAAC;IACpC,KAAK,EAAE,mBAAmB,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAC3C,MAAM,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAChD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-renderers.js","sourceRoot":"","sources":["../src/block-renderers.ts"],"names":[],"mappings":"","sourcesContent":["import type { AstroComponentFactory } from \"astro/runtime/server/index.js\";\nimport type { StyleflowContract } from \"./styleflow.js\";\nimport type {
|
|
1
|
+
{"version":3,"file":"block-renderers.js","sourceRoot":"","sources":["../src/block-renderers.ts"],"names":[],"mappings":"","sourcesContent":["import type { AstroComponentFactory } from \"astro/runtime/server/index.js\";\nimport type { DynamicStyleflowProps, StyleflowContract } from \"./styleflow.js\";\nimport type {\n FlowpressBlock,\n FlowpressBlockHtmlProps,\n FlowpressBlockAdapterStatus,\n FlowpressBlockClass,\n FlowpressCompositionV1\n} from \"./types.js\";\n\nexport interface FlowpressBlockRendererProps {\n block: FlowpressBlock;\n styleflowProps: DynamicStyleflowProps;\n htmlProps: FlowpressBlockHtmlProps;\n composition?: FlowpressCompositionV1 | undefined;\n context: {\n parentBlockName?: string;\n depth: number;\n production: boolean;\n };\n parentBlockName?: string;\n contract?: StyleflowContract | undefined;\n adapters?: FlowpressBlockAdapters | undefined;\n}\n\nexport interface FlowpressIconRendererProps {\n name: string;\n display?: \"inline\" | \"block\";\n foreground?: string;\n tone?: string;\n intensity?: string | number;\n size?: number;\n label?: string;\n id?: string;\n class?: string;\n}\n\nexport type FlowpressBlockRenderer = AstroComponentFactory;\n\nexport type FlowpressIconRenderer = AstroComponentFactory;\n\nexport type FlowpressBlockRenderers = Readonly<\n Record<string, FlowpressBlockRenderer>\n>;\n\nexport interface FlowpressBlockAdapterDefinition {\n renderer: FlowpressBlockRenderer;\n status: FlowpressBlockAdapterStatus;\n class: FlowpressBlockClass;\n fingerprint: string;\n}\n\nexport type FlowpressBlockAdapters = Readonly<\n Record<string, FlowpressBlockAdapterDefinition>\n>;\n"]}
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FlowpressCapabilities, FlowpressContent, FlowpressRoute } from "./types.js";
|
|
1
|
+
import type { FlowpressCapabilities, FlowpressCompositionV1, FlowpressContent, FlowpressRoute } from "./types.js";
|
|
2
2
|
export interface FlowpressGraphqlIssue {
|
|
3
3
|
message?: string;
|
|
4
4
|
extensions?: {
|
|
@@ -31,5 +31,21 @@ export declare class FlowpressClient {
|
|
|
31
31
|
getRoute(uri: string, locale?: string): Promise<FlowpressRoute | null>;
|
|
32
32
|
getRoutes(locale?: string): Promise<FlowpressRoute[]>;
|
|
33
33
|
getContent(loader: string, variables: Record<string, unknown>): Promise<FlowpressContent | null>;
|
|
34
|
+
getComposition(uri: string, locale?: string, options?: {
|
|
35
|
+
includeContent?: boolean;
|
|
36
|
+
}): Promise<FlowpressCompositionV1 | null>;
|
|
37
|
+
/** Site Editor already returns route and content in its composition. No
|
|
38
|
+
* route preflight, retries or cross-request cache are needed for previews.
|
|
39
|
+
*/
|
|
40
|
+
getPage(uri: string, options: {
|
|
41
|
+
mode: "site-editor" | "astro";
|
|
42
|
+
locale?: string;
|
|
43
|
+
route?: FlowpressRoute;
|
|
44
|
+
includeContent?: boolean;
|
|
45
|
+
}): Promise<{
|
|
46
|
+
route: FlowpressRoute;
|
|
47
|
+
content: FlowpressContent | null;
|
|
48
|
+
composition: FlowpressCompositionV1 | null;
|
|
49
|
+
} | null>;
|
|
34
50
|
}
|
|
35
51
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EAEf,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE;QACX,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;CACH;AAOD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO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G,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE;QAAE,cAAc,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;IAwCtI;;OAEG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE;QAClC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC;QAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,KAAK,CAAC,EAAE,cAAc,CAAC;QACvB,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;QAAC,WAAW,EAAE,sBAAsB,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;CAgB5H"}
|
package/dist/client.js
CHANGED
|
@@ -209,6 +209,49 @@ export class FlowpressClient {
|
|
|
209
209
|
projectFields: parseJson(projectFieldsJson, {})
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
|
+
async getComposition(uri, locale, options = {}) {
|
|
213
|
+
const data = await this.request(`query FlowpressComposition($uri: String!, $locale: String${options.includeContent === false ? ", $includeContent: Boolean" : ""}) {
|
|
214
|
+
sfCompositionByUri(uri: $uri, locale: $locale${options.includeContent === false ? ", includeContent: $includeContent" : ""}) {
|
|
215
|
+
version sourceDigest locale templateJson blocksJson stylesheetsJson blockTypesJson
|
|
216
|
+
diagnosticsJson routeJson contentJson
|
|
217
|
+
}
|
|
218
|
+
}`, { uri, locale: locale ?? null, ...(options.includeContent === false ? { includeContent: false } : {}) });
|
|
219
|
+
const wire = data.sfCompositionByUri;
|
|
220
|
+
if (!wire)
|
|
221
|
+
return null;
|
|
222
|
+
const route = parseRequiredJson(wire.routeJson, "routeJson");
|
|
223
|
+
return {
|
|
224
|
+
version: wire.version,
|
|
225
|
+
sourceDigest: wire.sourceDigest,
|
|
226
|
+
locale: wire.locale ?? null,
|
|
227
|
+
template: parseRequiredJson(wire.templateJson, "templateJson"),
|
|
228
|
+
blocks: parseRequiredJson(wire.blocksJson, "blocksJson"),
|
|
229
|
+
stylesheets: parseRequiredJson(wire.stylesheetsJson, "stylesheetsJson"),
|
|
230
|
+
blockTypes: parseRequiredJson(wire.blockTypesJson, "blockTypesJson"),
|
|
231
|
+
diagnostics: parseRequiredJson(wire.diagnosticsJson, "diagnosticsJson"),
|
|
232
|
+
route: { ...route, seo: normalizeGraphqlSeo(route.seo) },
|
|
233
|
+
content: parseJson(wire.contentJson, null)
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
/** Site Editor already returns route and content in its composition. No
|
|
237
|
+
* route preflight, retries or cross-request cache are needed for previews.
|
|
238
|
+
*/
|
|
239
|
+
async getPage(uri, options) {
|
|
240
|
+
if (options.mode === "site-editor") {
|
|
241
|
+
const composition = await this.getComposition(uri, options.locale, options);
|
|
242
|
+
return composition ? { route: composition.route, content: composition.content ?? null, composition } : null;
|
|
243
|
+
}
|
|
244
|
+
const route = options.route ?? await this.getRoute(uri, options.locale);
|
|
245
|
+
if (!route)
|
|
246
|
+
return null;
|
|
247
|
+
const content = route.content?.loader ? await this.getContent(route.content.loader, {
|
|
248
|
+
databaseId: route.content.databaseId ?? route.databaseId,
|
|
249
|
+
termId: route.content.termId ?? route.termId,
|
|
250
|
+
uri: route.uri,
|
|
251
|
+
locale: route.locale ?? options.locale
|
|
252
|
+
}) : null;
|
|
253
|
+
return { route, content, composition: null };
|
|
254
|
+
}
|
|
212
255
|
}
|
|
213
256
|
function getOperationName(query) {
|
|
214
257
|
return query.match(/\b(?:query|mutation|subscription)\s+([_A-Za-z][_0-9A-Za-z]*)/)?.[1] || "AnonymousOperation";
|
|
@@ -224,25 +267,28 @@ function sanitizeEndpoint(endpoint) {
|
|
|
224
267
|
function normalizeGraphqlSeo(seo) {
|
|
225
268
|
if (!seo)
|
|
226
269
|
return null;
|
|
227
|
-
const social = (value) =>
|
|
228
|
-
|
|
270
|
+
const social = (value) => {
|
|
271
|
+
if (!value)
|
|
272
|
+
return null;
|
|
273
|
+
const source = value.image;
|
|
274
|
+
const { altText, ...image } = source ?? {};
|
|
275
|
+
return {
|
|
229
276
|
title: value.title ?? null,
|
|
230
277
|
description: value.description ?? null,
|
|
231
|
-
image:
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
: null;
|
|
278
|
+
image: source ? { ...image, url: source.url, alt: altText ?? source.alt ?? null } : null
|
|
279
|
+
};
|
|
280
|
+
};
|
|
236
281
|
return {
|
|
237
282
|
title: seo.title ?? null,
|
|
238
283
|
description: seo.description ?? null,
|
|
239
284
|
canonicalUrl: seo.canonicalUrl ?? null,
|
|
240
285
|
robots: seo.robots ?? null,
|
|
241
286
|
headHtml: seo.headHtml ?? null,
|
|
242
|
-
jsonLd:
|
|
287
|
+
jsonLd: seo.jsonLd && typeof seo.jsonLd === "object" && "raw" in seo.jsonLd
|
|
288
|
+
? parseJson(seo.jsonLd.raw, null) : seo.jsonLd ?? null,
|
|
243
289
|
hreflang: seo.hreflang ?? null,
|
|
244
290
|
openGraph: social(seo.openGraph),
|
|
245
|
-
twitter: social(seo.twitterMeta)
|
|
291
|
+
twitter: social("twitterMeta" in seo ? seo.twitterMeta : seo.twitter)
|
|
246
292
|
};
|
|
247
293
|
}
|
|
248
294
|
function parseJson(value, fallback) {
|
|
@@ -255,4 +301,12 @@ function parseJson(value, fallback) {
|
|
|
255
301
|
return fallback;
|
|
256
302
|
}
|
|
257
303
|
}
|
|
304
|
+
function parseRequiredJson(value, field) {
|
|
305
|
+
try {
|
|
306
|
+
return JSON.parse(value);
|
|
307
|
+
}
|
|
308
|
+
catch (error) {
|
|
309
|
+
throw new FlowpressGraphqlError(`FlowPress composition field ${field} is not valid JSON.`, undefined, undefined, "FlowpressComposition", undefined, error);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
258
312
|
//# sourceMappingURL=client.js.map
|