@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,26 @@
|
|
|
1
|
+
/** WordPress resolves the RichText; Astro restricts URL and control semantics. */
|
|
2
|
+
export function nativeButtonData(data) {
|
|
3
|
+
const value = data ?? {};
|
|
4
|
+
const text = (key) => typeof value[key] === "string" ? String(value[key]) : "";
|
|
5
|
+
const url = text("href").trim();
|
|
6
|
+
const href = /^(?:\/(?!\/)|#[^\s]*|https?:\/\/|mailto:|tel:)/i.test(url)
|
|
7
|
+
&& !/[\u0000-\u0020\u007f]/u.test(url) ? url : undefined;
|
|
8
|
+
const target = ["_blank", "_self", "_parent", "_top"].includes(text("target")) ? text("target") : undefined;
|
|
9
|
+
const rel = [...new Set([
|
|
10
|
+
...text("rel").split(/\s+/).filter(Boolean),
|
|
11
|
+
...(target === "_blank" ? ["noopener", "noreferrer"] : []),
|
|
12
|
+
])].join(" ") || undefined;
|
|
13
|
+
return {
|
|
14
|
+
empty: value.empty !== false,
|
|
15
|
+
tag: value.tag === "button" ? "button" : "a",
|
|
16
|
+
label: text("label"), href, target, rel,
|
|
17
|
+
title: text("title") || undefined,
|
|
18
|
+
type: (["button", "submit", "reset"].includes(text("type")) ? text("type") : "button"),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function nativeButtonsLayout(layout = {}) {
|
|
22
|
+
const justify = { left: "flex-start", center: "center", right: "flex-end", "space-between": "space-between" }[String(layout.justifyContent ?? "left")] ?? "flex-start";
|
|
23
|
+
const vertical = layout.orientation === "vertical";
|
|
24
|
+
return `flex-direction:${vertical ? "column" : "row"};justify-content:${justify};align-items:${vertical ? justify === "space-between" ? "stretch" : justify : "center"};flex-wrap:${layout.flexWrap === "nowrap" ? "nowrap" : "wrap"}`;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/astro/native/button.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,MAAM,UAAU,gBAAgB,CAAC,IAAqC;IACpE,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC;IACzB,MAAM,IAAI,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACvF,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IAChC,MAAM,IAAI,GAAG,iDAAiD,CAAC,IAAI,CAAC,GAAG,CAAC;WACnE,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3D,MAAM,MAAM,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5G,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC;YACtB,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;YAC3C,GAAG,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC3D,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC;IAC3B,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,KAAK,KAAK,KAAK;QAC5B,GAAG,EAAE,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG;QAC5C,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG;QACvC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,SAAS;QACjC,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAkC;KACxH,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,SAAkC,EAAE;IACtE,MAAM,OAAO,GAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAA6B,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,CAAC,IAAI,YAAY,CAAC;IACnM,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,KAAK,UAAU,CAAC;IACnD,OAAO,kBAAkB,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,oBAAoB,OAAO,gBAAgB,QAAQ,CAAC,CAAC,CAAC,OAAO,KAAK,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,cAAc,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;AACzO,CAAC","sourcesContent":["/** WordPress resolves the RichText; Astro restricts URL and control semantics. */\nexport function nativeButtonData(data?: Record<string, unknown> | null) {\n const value = data ?? {};\n const text = (key: string) => typeof value[key] === \"string\" ? String(value[key]) : \"\";\n const url = text(\"href\").trim();\n const href = /^(?:\\/(?!\\/)|#[^\\s]*|https?:\\/\\/|mailto:|tel:)/i.test(url)\n && !/[\\u0000-\\u0020\\u007f]/u.test(url) ? url : undefined;\n const target = [\"_blank\", \"_self\", \"_parent\", \"_top\"].includes(text(\"target\")) ? text(\"target\") : undefined;\n const rel = [...new Set([\n ...text(\"rel\").split(/\\s+/).filter(Boolean),\n ...(target === \"_blank\" ? [\"noopener\", \"noreferrer\"] : []),\n ])].join(\" \") || undefined;\n return {\n empty: value.empty !== false,\n tag: value.tag === \"button\" ? \"button\" : \"a\",\n label: text(\"label\"), href, target, rel,\n title: text(\"title\") || undefined,\n type: ([\"button\", \"submit\", \"reset\"].includes(text(\"type\")) ? text(\"type\") : \"button\") as \"button\" | \"submit\" | \"reset\",\n };\n}\n\nexport function nativeButtonsLayout(layout: Record<string, unknown> = {}) {\n const justify = ({ left: \"flex-start\", center: \"center\", right: \"flex-end\", \"space-between\": \"space-between\" } as Record<string, string>)[String(layout.justifyContent ?? \"left\")] ?? \"flex-start\";\n const vertical = layout.orientation === \"vertical\";\n return `flex-direction:${vertical ? \"column\" : \"row\"};justify-content:${justify};align-items:${vertical ? justify === \"space-between\" ? \"stretch\" : justify : \"center\"};flex-wrap:${layout.flexWrap === \"nowrap\" ? \"nowrap\" : \"wrap\"}`;\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** WordPress resolves the RichText; Astro restricts URL and control semantics. */
|
|
2
|
+
export function nativeButtonData(data?: Record<string, unknown> | null) {
|
|
3
|
+
const value = data ?? {};
|
|
4
|
+
const text = (key: string) => typeof value[key] === "string" ? String(value[key]) : "";
|
|
5
|
+
const url = text("href").trim();
|
|
6
|
+
const href = /^(?:\/(?!\/)|#[^\s]*|https?:\/\/|mailto:|tel:)/i.test(url)
|
|
7
|
+
&& !/[\u0000-\u0020\u007f]/u.test(url) ? url : undefined;
|
|
8
|
+
const target = ["_blank", "_self", "_parent", "_top"].includes(text("target")) ? text("target") : undefined;
|
|
9
|
+
const rel = [...new Set([
|
|
10
|
+
...text("rel").split(/\s+/).filter(Boolean),
|
|
11
|
+
...(target === "_blank" ? ["noopener", "noreferrer"] : []),
|
|
12
|
+
])].join(" ") || undefined;
|
|
13
|
+
return {
|
|
14
|
+
empty: value.empty !== false,
|
|
15
|
+
tag: value.tag === "button" ? "button" : "a",
|
|
16
|
+
label: text("label"), href, target, rel,
|
|
17
|
+
title: text("title") || undefined,
|
|
18
|
+
type: (["button", "submit", "reset"].includes(text("type")) ? text("type") : "button") as "button" | "submit" | "reset",
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function nativeButtonsLayout(layout: Record<string, unknown> = {}) {
|
|
23
|
+
const justify = ({ left: "flex-start", center: "center", right: "flex-end", "space-between": "space-between" } as Record<string, string>)[String(layout.justifyContent ?? "left")] ?? "flex-start";
|
|
24
|
+
const vertical = layout.orientation === "vertical";
|
|
25
|
+
return `flex-direction:${vertical ? "column" : "row"};justify-content:${justify};align-items:${vertical ? justify === "space-between" ? "stretch" : justify : "center"};flex-wrap:${layout.flexWrap === "nowrap" ? "nowrap" : "wrap"}`;
|
|
26
|
+
}
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* FlowPress carousel (sf/carousel). Shared verbatim with the WordPress block editor, where Splide
|
|
3
|
+
* never mounts: the static layout below reproduces Splide at rest (slide widths, peeks, gap,
|
|
4
|
+
* centring), so the editor, the page before mounting and the mounted carousel look the same.
|
|
5
|
+
* It must not rely on splide-core.css, which only the frontend loads. Geometry comes from the
|
|
6
|
+
* custom properties written by `carouselLayout()`; colours come from the StyleFlow context.
|
|
7
|
+
*/
|
|
8
|
+
.flowpress-carousel {
|
|
9
|
+
--flowpress-carousel-icon-fg: var(--sf-foreground-primary, currentColor);
|
|
10
|
+
--flowpress-carousel-veil: color-mix(in oklab, var(--flowpress-carousel-icon-fg) 30%, transparent);
|
|
11
|
+
--flowpress-carousel-arrow-size: 2.5rem;
|
|
12
|
+
--flowpress-carousel-arrow-radius: var(--sf-layout-chip-regular-radius, 999px);
|
|
13
|
+
--flowpress-carousel-slide: var(--flowpress-carousel-slide-base, 100%);
|
|
14
|
+
--flowpress-carousel-peek-start: var(--flowpress-carousel-peek-start-base, 0px);
|
|
15
|
+
--flowpress-carousel-peek-end: var(--flowpress-carousel-peek-end-base, 0px);
|
|
16
|
+
--flowpress-carousel-shift: var(--flowpress-carousel-shift-base, 0px);
|
|
17
|
+
--flowpress-carousel-edge: var(--flowpress-carousel-edge-base, 0px);
|
|
18
|
+
position: relative;
|
|
19
|
+
display: grid;
|
|
20
|
+
grid-template-columns: minmax(0, 1fr);
|
|
21
|
+
grid-template-areas: "arrows" "track" "pagination";
|
|
22
|
+
min-width: 0;
|
|
23
|
+
}
|
|
24
|
+
@media (min-width: 40rem) {
|
|
25
|
+
.flowpress-carousel {
|
|
26
|
+
--flowpress-carousel-slide: var(--flowpress-carousel-slide-sm, 100%);
|
|
27
|
+
--flowpress-carousel-peek-start: var(--flowpress-carousel-peek-start-sm, 0px);
|
|
28
|
+
--flowpress-carousel-peek-end: var(--flowpress-carousel-peek-end-sm, 0px);
|
|
29
|
+
--flowpress-carousel-shift: var(--flowpress-carousel-shift-sm, 0px);
|
|
30
|
+
--flowpress-carousel-edge: var(--flowpress-carousel-edge-sm, 0px);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
@media (min-width: 48rem) {
|
|
34
|
+
.flowpress-carousel {
|
|
35
|
+
--flowpress-carousel-slide: var(--flowpress-carousel-slide-md, 100%);
|
|
36
|
+
--flowpress-carousel-peek-start: var(--flowpress-carousel-peek-start-md, 0px);
|
|
37
|
+
--flowpress-carousel-peek-end: var(--flowpress-carousel-peek-end-md, 0px);
|
|
38
|
+
--flowpress-carousel-shift: var(--flowpress-carousel-shift-md, 0px);
|
|
39
|
+
--flowpress-carousel-edge: var(--flowpress-carousel-edge-md, 0px);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
@media (min-width: 64rem) {
|
|
43
|
+
.flowpress-carousel {
|
|
44
|
+
--flowpress-carousel-slide: var(--flowpress-carousel-slide-lg, 100%);
|
|
45
|
+
--flowpress-carousel-peek-start: var(--flowpress-carousel-peek-start-lg, 0px);
|
|
46
|
+
--flowpress-carousel-peek-end: var(--flowpress-carousel-peek-end-lg, 0px);
|
|
47
|
+
--flowpress-carousel-shift: var(--flowpress-carousel-shift-lg, 0px);
|
|
48
|
+
--flowpress-carousel-edge: var(--flowpress-carousel-edge-lg, 0px);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
@media (min-width: 80rem) {
|
|
52
|
+
.flowpress-carousel {
|
|
53
|
+
--flowpress-carousel-slide: var(--flowpress-carousel-slide-xl, 100%);
|
|
54
|
+
--flowpress-carousel-peek-start: var(--flowpress-carousel-peek-start-xl, 0px);
|
|
55
|
+
--flowpress-carousel-peek-end: var(--flowpress-carousel-peek-end-xl, 0px);
|
|
56
|
+
--flowpress-carousel-shift: var(--flowpress-carousel-shift-xl, 0px);
|
|
57
|
+
--flowpress-carousel-edge: var(--flowpress-carousel-edge-xl, 0px);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
@media (min-width: 96rem) {
|
|
61
|
+
.flowpress-carousel {
|
|
62
|
+
--flowpress-carousel-slide: var(--flowpress-carousel-slide-2xl, 100%);
|
|
63
|
+
--flowpress-carousel-peek-start: var(--flowpress-carousel-peek-start-2xl, 0px);
|
|
64
|
+
--flowpress-carousel-peek-end: var(--flowpress-carousel-peek-end-2xl, 0px);
|
|
65
|
+
--flowpress-carousel-shift: var(--flowpress-carousel-shift-2xl, 0px);
|
|
66
|
+
--flowpress-carousel-edge: var(--flowpress-carousel-edge-2xl, 0px);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* The page shows the static layout until Splide mounts: no shift, no hidden first paint. */
|
|
71
|
+
.flowpress-carousel:not(.is-initialized) {
|
|
72
|
+
visibility: visible;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Track and slides: the same box model Splide sets inline once mounted. */
|
|
76
|
+
.flowpress-carousel .splide__track {
|
|
77
|
+
grid-area: track;
|
|
78
|
+
position: relative;
|
|
79
|
+
z-index: 0;
|
|
80
|
+
min-width: 0;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
padding-inline: var(--flowpress-carousel-peek-start) var(--flowpress-carousel-peek-end);
|
|
83
|
+
}
|
|
84
|
+
.flowpress-carousel .splide__list {
|
|
85
|
+
display: flex;
|
|
86
|
+
margin: 0;
|
|
87
|
+
padding: 0;
|
|
88
|
+
list-style: none;
|
|
89
|
+
transform: translateX(var(--flowpress-carousel-shift));
|
|
90
|
+
}
|
|
91
|
+
.flowpress-carousel .splide__list > * {
|
|
92
|
+
position: relative;
|
|
93
|
+
flex: 0 0 auto;
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
inline-size: var(--flowpress-carousel-slide);
|
|
96
|
+
min-inline-size: 0;
|
|
97
|
+
margin: 0;
|
|
98
|
+
margin-inline-end: var(--flowpress-carousel-gap, 24px);
|
|
99
|
+
list-style: none;
|
|
100
|
+
}
|
|
101
|
+
.flowpress-carousel[data-aspect] .splide__list > * {
|
|
102
|
+
aspect-ratio: var(--flowpress-carousel-aspect);
|
|
103
|
+
}
|
|
104
|
+
.flowpress-carousel:is([data-aspect], [data-equal-height]) .splide__list > * {
|
|
105
|
+
display: flex;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
}
|
|
108
|
+
.flowpress-carousel:is([data-aspect], [data-equal-height]) .splide__list > * > * {
|
|
109
|
+
flex: 1 1 auto;
|
|
110
|
+
}
|
|
111
|
+
/* Fade shows one item at a time; the others wait in place until Splide mounts. */
|
|
112
|
+
.flowpress-carousel[data-effect="fade"]:not(.is-initialized) .splide__list > :not(:first-child) {
|
|
113
|
+
visibility: hidden;
|
|
114
|
+
}
|
|
115
|
+
/* Without JavaScript every item stays reachable by scrolling sideways. */
|
|
116
|
+
@media (scripting: none) {
|
|
117
|
+
.flowpress-carousel .splide__track {
|
|
118
|
+
overflow-x: auto;
|
|
119
|
+
scroll-snap-type: x mandatory;
|
|
120
|
+
}
|
|
121
|
+
.flowpress-carousel .splide__list {
|
|
122
|
+
transform: none;
|
|
123
|
+
}
|
|
124
|
+
.flowpress-carousel .splide__list > * {
|
|
125
|
+
scroll-snap-align: start;
|
|
126
|
+
visibility: visible;
|
|
127
|
+
}
|
|
128
|
+
.flowpress-carousel [data-flowpress-carousel-controls],
|
|
129
|
+
.flowpress-carousel .splide__pagination,
|
|
130
|
+
.flowpress-carousel .flowpress-carousel__counter {
|
|
131
|
+
display: none;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* Controls: a transparent hit area around a StyleFlow-coloured icon. */
|
|
136
|
+
.flowpress-carousel[data-arrows-size="sm"] { --flowpress-carousel-arrow-size: 2rem; }
|
|
137
|
+
.flowpress-carousel[data-arrows-size="lg"] { --flowpress-carousel-arrow-size: 3rem; }
|
|
138
|
+
.flowpress-carousel[data-arrows-shape="rounded"] { --flowpress-carousel-arrow-radius: var(--sf-layout-control-regular-radius, 0.5rem); }
|
|
139
|
+
.flowpress-carousel[data-arrows-shape="square"] { --flowpress-carousel-arrow-radius: 0; }
|
|
140
|
+
/* Rows without a control collapse: spacing sits on the controls, never on the grid. */
|
|
141
|
+
.flowpress-carousel .splide__arrows {
|
|
142
|
+
grid-area: arrows;
|
|
143
|
+
display: flex;
|
|
144
|
+
align-items: center;
|
|
145
|
+
justify-content: space-between;
|
|
146
|
+
gap: 0.5rem;
|
|
147
|
+
margin: 0 0 0.75rem;
|
|
148
|
+
}
|
|
149
|
+
.flowpress-carousel .splide__arrow {
|
|
150
|
+
display: grid;
|
|
151
|
+
place-items: center;
|
|
152
|
+
margin: 0;
|
|
153
|
+
padding: 0;
|
|
154
|
+
border: 0;
|
|
155
|
+
background: none;
|
|
156
|
+
color: var(--flowpress-carousel-icon-fg);
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
}
|
|
159
|
+
.flowpress-carousel .flowpress-carousel__icon {
|
|
160
|
+
display: grid;
|
|
161
|
+
place-items: center;
|
|
162
|
+
inline-size: var(--flowpress-carousel-arrow-size);
|
|
163
|
+
block-size: var(--flowpress-carousel-arrow-size);
|
|
164
|
+
border-radius: var(--flowpress-carousel-arrow-radius);
|
|
165
|
+
background: var(--flowpress-carousel-control-bg, transparent);
|
|
166
|
+
color: var(--flowpress-carousel-icon-fg);
|
|
167
|
+
}
|
|
168
|
+
.flowpress-carousel .flowpress-carousel__icon svg {
|
|
169
|
+
inline-size: 45%;
|
|
170
|
+
block-size: 45%;
|
|
171
|
+
}
|
|
172
|
+
.flowpress-carousel .splide__arrow:disabled {
|
|
173
|
+
opacity: 0.45;
|
|
174
|
+
cursor: default;
|
|
175
|
+
}
|
|
176
|
+
.flowpress-carousel .splide__arrow:focus-visible {
|
|
177
|
+
outline: none;
|
|
178
|
+
}
|
|
179
|
+
.flowpress-carousel .splide__arrow:focus-visible .flowpress-carousel__icon,
|
|
180
|
+
.flowpress-carousel .splide__pagination__page:focus-visible,
|
|
181
|
+
.flowpress-carousel .splide__toggle:focus-visible {
|
|
182
|
+
outline: 3px solid var(--flowpress-carousel-icon-fg);
|
|
183
|
+
outline-offset: 3px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.flowpress-carousel[data-arrows="top-end"] .splide__arrows { justify-content: flex-end; }
|
|
187
|
+
.flowpress-carousel:is([data-arrows="bottom"], [data-arrows="bottom-end"]) {
|
|
188
|
+
grid-template-areas: "track" "arrows" "pagination";
|
|
189
|
+
}
|
|
190
|
+
.flowpress-carousel:is([data-arrows="bottom"], [data-arrows="bottom-end"]) .splide__arrows {
|
|
191
|
+
margin: 0.75rem 0 0;
|
|
192
|
+
}
|
|
193
|
+
.flowpress-carousel[data-arrows="bottom"] .splide__arrows { justify-content: center; }
|
|
194
|
+
.flowpress-carousel[data-arrows="bottom-end"] .splide__arrows { justify-content: flex-end; }
|
|
195
|
+
/* Arrows over the slides: they share the track's grid area. */
|
|
196
|
+
.flowpress-carousel:is([data-arrows="sides"], [data-arrows="edges"]) .splide__arrows {
|
|
197
|
+
grid-area: track;
|
|
198
|
+
z-index: 2;
|
|
199
|
+
margin: 0;
|
|
200
|
+
pointer-events: none;
|
|
201
|
+
}
|
|
202
|
+
.flowpress-carousel:is([data-arrows="sides"], [data-arrows="edges"]) .splide__arrow {
|
|
203
|
+
pointer-events: auto;
|
|
204
|
+
}
|
|
205
|
+
.flowpress-carousel[data-arrows="sides"] .splide__arrows {
|
|
206
|
+
padding-inline: 0.75rem;
|
|
207
|
+
}
|
|
208
|
+
.flowpress-carousel[data-arrows="edges"] .splide__arrows {
|
|
209
|
+
align-items: stretch;
|
|
210
|
+
}
|
|
211
|
+
.flowpress-carousel[data-arrows="edges"] .splide__arrow {
|
|
212
|
+
inline-size: clamp(var(--flowpress-carousel-arrow-size), var(--flowpress-carousel-edge), 6.25rem);
|
|
213
|
+
background: var(--flowpress-carousel-veil);
|
|
214
|
+
}
|
|
215
|
+
/* Arrows outside the slides: one column on each side of the track. */
|
|
216
|
+
.flowpress-carousel[data-arrows="outside"] {
|
|
217
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
218
|
+
grid-template-areas: "prev track next" ". pagination .";
|
|
219
|
+
column-gap: 0.75rem;
|
|
220
|
+
}
|
|
221
|
+
.flowpress-carousel[data-arrows="outside"] .splide__arrows { display: contents; }
|
|
222
|
+
.flowpress-carousel[data-arrows="outside"] .splide__arrow--prev { grid-area: prev; }
|
|
223
|
+
.flowpress-carousel[data-arrows="outside"] .splide__arrow--next { grid-area: next; }
|
|
224
|
+
|
|
225
|
+
/* Below md the arrows can move under the slides or disappear (swipe stays available). */
|
|
226
|
+
@media (width < 48rem) {
|
|
227
|
+
.flowpress-carousel[data-arrows-mobile="hidden"] .splide__arrows {
|
|
228
|
+
display: none;
|
|
229
|
+
}
|
|
230
|
+
.flowpress-carousel[data-arrows-mobile="bottom"] {
|
|
231
|
+
grid-template-columns: minmax(0, 1fr);
|
|
232
|
+
grid-template-areas: "track" "arrows" "pagination";
|
|
233
|
+
column-gap: 0;
|
|
234
|
+
}
|
|
235
|
+
.flowpress-carousel[data-arrows-mobile="bottom"] .splide__arrows {
|
|
236
|
+
display: flex;
|
|
237
|
+
grid-area: arrows;
|
|
238
|
+
justify-content: center;
|
|
239
|
+
align-items: center;
|
|
240
|
+
margin: 0.75rem 0 0;
|
|
241
|
+
padding-inline: 0;
|
|
242
|
+
pointer-events: auto;
|
|
243
|
+
}
|
|
244
|
+
.flowpress-carousel[data-arrows-mobile="bottom"] .splide__arrow {
|
|
245
|
+
grid-area: auto;
|
|
246
|
+
inline-size: auto;
|
|
247
|
+
background: none;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* Pagination: dots or bars in the controls colour, the active one in the context foreground. */
|
|
252
|
+
.flowpress-carousel .splide__pagination {
|
|
253
|
+
grid-area: pagination;
|
|
254
|
+
display: flex;
|
|
255
|
+
flex-wrap: wrap;
|
|
256
|
+
align-items: center;
|
|
257
|
+
justify-content: center;
|
|
258
|
+
gap: 0.5rem;
|
|
259
|
+
margin: 0.75rem 0 0;
|
|
260
|
+
padding: 0;
|
|
261
|
+
list-style: none;
|
|
262
|
+
}
|
|
263
|
+
.flowpress-carousel .splide__pagination li {
|
|
264
|
+
display: inline-flex;
|
|
265
|
+
margin: 0;
|
|
266
|
+
list-style: none;
|
|
267
|
+
}
|
|
268
|
+
.flowpress-carousel .splide__pagination__page {
|
|
269
|
+
inline-size: 0.625rem;
|
|
270
|
+
block-size: 0.625rem;
|
|
271
|
+
margin: 0;
|
|
272
|
+
padding: 0;
|
|
273
|
+
border: 0;
|
|
274
|
+
border-radius: var(--sf-layout-chip-regular-radius, 999px);
|
|
275
|
+
background: var(--flowpress-carousel-control-bg, var(--flowpress-carousel-veil));
|
|
276
|
+
cursor: pointer;
|
|
277
|
+
}
|
|
278
|
+
.flowpress-carousel .splide__pagination__page.is-active {
|
|
279
|
+
background: var(--flowpress-carousel-icon-fg);
|
|
280
|
+
}
|
|
281
|
+
.flowpress-carousel[data-pagination="bars"] .splide__pagination__page {
|
|
282
|
+
inline-size: 1.5rem;
|
|
283
|
+
block-size: 0.25rem;
|
|
284
|
+
border-radius: 0.125rem;
|
|
285
|
+
}
|
|
286
|
+
.flowpress-carousel .flowpress-carousel__counter {
|
|
287
|
+
grid-area: pagination;
|
|
288
|
+
justify-self: center;
|
|
289
|
+
margin-block-start: 0.75rem;
|
|
290
|
+
padding: 0.25rem 0.75rem;
|
|
291
|
+
border-radius: var(--sf-layout-chip-regular-radius, 999px);
|
|
292
|
+
background: var(--flowpress-carousel-control-bg, transparent);
|
|
293
|
+
color: var(--flowpress-carousel-icon-fg);
|
|
294
|
+
font-variant-numeric: tabular-nums;
|
|
295
|
+
}
|
|
296
|
+
.flowpress-carousel[data-pagination-position="overlay"] :is(.splide__pagination, .flowpress-carousel__counter) {
|
|
297
|
+
grid-area: track;
|
|
298
|
+
align-self: end;
|
|
299
|
+
z-index: 2;
|
|
300
|
+
margin-block: 0 0.75rem;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/* Autoplay play/pause control, always available while autoplay runs (WCAG 2.2.2). */
|
|
304
|
+
.flowpress-carousel .splide__toggle {
|
|
305
|
+
grid-area: pagination;
|
|
306
|
+
justify-self: end;
|
|
307
|
+
margin: 0.75rem 0 0;
|
|
308
|
+
padding: 0.25rem 0.75rem;
|
|
309
|
+
border: 0;
|
|
310
|
+
border-radius: var(--sf-layout-chip-regular-radius, 999px);
|
|
311
|
+
background: var(--flowpress-carousel-control-bg, transparent);
|
|
312
|
+
color: var(--flowpress-carousel-icon-fg);
|
|
313
|
+
cursor: pointer;
|
|
314
|
+
}
|
|
315
|
+
.flowpress-carousel .splide__toggle__pause { display: none; }
|
|
316
|
+
.flowpress-carousel .splide__toggle.is-active .splide__toggle__play { display: none; }
|
|
317
|
+
.flowpress-carousel .splide__toggle.is-active .splide__toggle__pause { display: inline; }
|
|
318
|
+
|
|
319
|
+
/* Invalid children: the content stays readable as a plain stack. */
|
|
320
|
+
.flowpress-carousel.flowpress-carousel--static {
|
|
321
|
+
grid-template-areas: none;
|
|
322
|
+
gap: var(--flowpress-carousel-gap, 24px);
|
|
323
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
import S from "../StyleflowElement.astro";
|
|
3
|
+
import { accordionData, accordionTitle } from "./accordion.js";
|
|
4
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
5
|
+
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
6
|
+
// The block's `title` attribute is the heading's rich text, not an HTML tooltip.
|
|
7
|
+
const { title: _richTitle, ...buttonProps } = htmlProps;
|
|
8
|
+
const data = accordionData(block);
|
|
9
|
+
const tag = `h${data.level ?? 3}`;
|
|
10
|
+
const title = accordionTitle(block);
|
|
11
|
+
const dual = data.dualIcon === true;
|
|
12
|
+
---
|
|
13
|
+
<!-- styleflow-ignore-start rule=SF_INLINE_STYLE reason="Validated accordion icon rotation is interaction geometry" scope="Native accordion" -->
|
|
14
|
+
<S as={tag} id={htmlProps.id} class={["wp-block-accordion-heading", htmlProps.class].filter(Boolean).join(" ")}>
|
|
15
|
+
<S as="button" {...buttonProps} {...styleflowProps} id={data.id} class="wp-block-accordion-heading__toggle" type="button" aria-expanded={data.open === true ? "true" : "false"} aria-controls={data.panelId} data-fp-accordion-toggle data-fp-accordion-icon-position={data.iconPosition ?? "right"} data-fp-accordion-icon-animation={dual ? "none" : data.animation ?? "rotate"} style={[htmlProps.style, `--fp-accordion-icon-rotation:${data.rotation ?? 45}deg`].filter(Boolean).join(";")}>
|
|
16
|
+
<span class="wp-block-accordion-heading__toggle-title" set:html={title} />
|
|
17
|
+
{data.showIcon !== false && <span class="wp-block-accordion-heading__toggle-icon" aria-hidden="true">
|
|
18
|
+
<span data-fp-accordion-icon-closed={!dual ? undefined : ""} data-fp-accordion-icon-single={dual ? undefined : ""}>{data.closedIcon ? <Fragment set:html={data.closedIcon} /> : "+"}</span>
|
|
19
|
+
{dual && <span data-fp-accordion-icon-open>{data.openIcon ? <Fragment set:html={data.openIcon} /> : "+"}</span>}
|
|
20
|
+
</span>}
|
|
21
|
+
</S>
|
|
22
|
+
</S>
|
|
23
|
+
<!-- styleflow-ignore-end -->
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
import S from "../StyleflowElement.astro";
|
|
3
|
+
import { accordionData } from "./accordion.js";
|
|
4
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
5
|
+
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
6
|
+
const data = accordionData(block);
|
|
7
|
+
---
|
|
8
|
+
<S as="div" {...htmlProps} {...styleflowProps} class={["wp-block-accordion-item", htmlProps.class].filter(Boolean).join(" ")} data-fp-accordion-item data-fp-accordion-initial-open={String(data.open === true)}><slot /></S>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
import S from "../StyleflowElement.astro";
|
|
3
|
+
import { accordionData } from "./accordion.js";
|
|
4
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
5
|
+
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
6
|
+
const data = accordionData(block);
|
|
7
|
+
---
|
|
8
|
+
<S as="div" {...htmlProps} {...styleflowProps} class={["wp-block-accordion-panel", htmlProps.class].filter(Boolean).join(" ")} id={data.panelId ?? htmlProps.id} role="region" aria-labelledby={data.id} data-fp-accordion-panel><slot /></S>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
import S from "../StyleflowElement.astro";
|
|
3
|
+
import Runtime from "./AccordionRuntime.astro";
|
|
4
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
5
|
+
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
6
|
+
---
|
|
7
|
+
<S as="div" {...htmlProps} {...styleflowProps} class={["wp-block-accordion", htmlProps.class].filter(Boolean).join(" ")} role="group" data-fp-accordion data-fp-accordion-autoclose={String(block.attributes.autoclose === true)}><slot /></S>
|
|
8
|
+
<Runtime />
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
|
+
import SyncedPatternContent from "./SyncedPatternContent.astro";
|
|
5
|
+
|
|
6
|
+
// WordPress renders a synced pattern without a wrapper: keep the root only
|
|
7
|
+
// when the block authors something beyond the reference itself (anchor, class,
|
|
8
|
+
// Styleflow axes). Computed props are not enough, because the semantic
|
|
9
|
+
// renderer adds defaults to every block.
|
|
10
|
+
const props = Astro.props as FlowpressBlockRendererProps;
|
|
11
|
+
const { block, htmlProps, styleflowProps } = props;
|
|
12
|
+
const structural = new Set(["ref", "content", "lock", "metadata"]);
|
|
13
|
+
const ownsSemanticContext = Object.keys(block.attributes ?? {}).some((name) => !structural.has(name));
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
{ownsSemanticContext
|
|
17
|
+
? <StyleflowElement as="div" {...htmlProps} {...styleflowProps}><SyncedPatternContent {...props} selfRenderer={Astro.self}><slot /></SyncedPatternContent></StyleflowElement>
|
|
18
|
+
: <SyncedPatternContent {...props} selfRenderer={Astro.self}><slot /></SyncedPatternContent>}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
|
+
import { nativeButtonData } from "./button.js";
|
|
5
|
+
|
|
6
|
+
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
7
|
+
const button = nativeButtonData(block.resolvedData);
|
|
8
|
+
const resolved = typeof block.resolvedData?.empty === "boolean";
|
|
9
|
+
const width = Number(block.attributes.width);
|
|
10
|
+
const rootProps = {
|
|
11
|
+
...htmlProps,
|
|
12
|
+
class: ["wp-block-button", htmlProps.class].filter(Boolean).join(" "),
|
|
13
|
+
style: [htmlProps.style, [25, 50, 75, 100].includes(width) ? `width:${width}%` : ""].filter(Boolean).join(";"),
|
|
14
|
+
};
|
|
15
|
+
const controlProps = {
|
|
16
|
+
...styleflowProps,
|
|
17
|
+
...(!block.attributes.layoutRole ? { layoutRole: "control" as const } : {}),
|
|
18
|
+
...(!block.attributes.density ? { density: "regular" as const } : {}),
|
|
19
|
+
class: "wp-block-button__link wp-element-button",
|
|
20
|
+
title: button.title,
|
|
21
|
+
};
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
{!resolved ? (
|
|
25
|
+
block.innerHtml ? <StyleflowElement as="div" {...htmlProps} {...styleflowProps} data-flowpress-button-legacy set:html={block.innerHtml} /> : null
|
|
26
|
+
) : !button.empty ? (
|
|
27
|
+
<StyleflowElement as="div" {...rootProps}>
|
|
28
|
+
{button.tag === "button" ? (
|
|
29
|
+
<StyleflowElement as="button" {...controlProps} type={button.type}><Fragment set:html={button.label} /></StyleflowElement>
|
|
30
|
+
) : button.href ? (
|
|
31
|
+
<StyleflowElement as="a" {...controlProps} href={button.href} target={button.target} rel={button.rel}>
|
|
32
|
+
<Fragment set:html={button.label} />
|
|
33
|
+
</StyleflowElement>
|
|
34
|
+
) : (
|
|
35
|
+
<StyleflowElement as="span" {...controlProps} aria-disabled="true"><Fragment set:html={button.label} /></StyleflowElement>
|
|
36
|
+
)}
|
|
37
|
+
</StyleflowElement>
|
|
38
|
+
) : null}
|
|
39
|
+
|
|
40
|
+
<style>
|
|
41
|
+
.wp-block-button__link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
|
|
42
|
+
.wp-block-button[style*="width:"] .wp-block-button__link { width: 100%; }
|
|
43
|
+
</style>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
// Native button templates resolved by WordPress Core.
|
|
3
|
+
// With a template, the template root Group is the focusable control and its
|
|
4
|
+
// children render inside it through the synced pattern renderer. The
|
|
5
|
+
// instance styleflowProps are intentionally not applied: the template decides
|
|
6
|
+
// the look. Without a template (pilot off, no template published) the official
|
|
7
|
+
// native renderer runs with all props, as before the pilot.
|
|
8
|
+
import S from "../StyleflowElement.astro";
|
|
9
|
+
import NativeCoreButton from "./core-button-fallback.astro";
|
|
10
|
+
import SyncedPatternContent from "./SyncedPatternContent.astro";
|
|
11
|
+
import { nativeButtonData } from "./button.js";
|
|
12
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
13
|
+
import {
|
|
14
|
+
buttonTemplateControl,
|
|
15
|
+
buttonTemplateData,
|
|
16
|
+
buttonTemplateDiagnosticCodes,
|
|
17
|
+
} from "./button-template.js";
|
|
18
|
+
|
|
19
|
+
const props = Astro.props as FlowpressBlockRendererProps;
|
|
20
|
+
const { block, contract, context, htmlProps } = props;
|
|
21
|
+
const template = buttonTemplateData(block.resolvedData);
|
|
22
|
+
const button = nativeButtonData(block.resolvedData);
|
|
23
|
+
const control = template ? buttonTemplateControl(template, contract, {strict: context.production, effectiveTone: context.inheritedTone ?? context.effectiveTone}) : undefined;
|
|
24
|
+
const width = Number(block.attributes.width);
|
|
25
|
+
const diagnostics = context.production ? "" : buttonTemplateDiagnosticCodes(template, block.resolvedData);
|
|
26
|
+
const rootProps = {
|
|
27
|
+
...htmlProps,
|
|
28
|
+
class: ["wp-block-button", htmlProps.class].filter(Boolean).join(" "),
|
|
29
|
+
style: [htmlProps.style, [25, 50, 75, 100].includes(width) ? `width:${width}%` : ""].filter(Boolean).join(";") || undefined,
|
|
30
|
+
"data-sf-button-template": context.production ? undefined : template?.slug,
|
|
31
|
+
"data-sf-button-template-diagnostics": diagnostics || undefined,
|
|
32
|
+
};
|
|
33
|
+
const controlProps = { ...control?.controlProps, ...control?.styleflowProps, title: button.title };
|
|
34
|
+
const content = template && control
|
|
35
|
+
? {
|
|
36
|
+
...block,
|
|
37
|
+
resolvedData: {
|
|
38
|
+
ref: template.ref,
|
|
39
|
+
blocks: control.children,
|
|
40
|
+
blockTypes: template.blockTypes,
|
|
41
|
+
stylesheets: template.stylesheets,
|
|
42
|
+
diagnostics: template.diagnostics,
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
: block;
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
{!template || !control || button.empty ? (
|
|
49
|
+
<NativeCoreButton {...props} />
|
|
50
|
+
) : (
|
|
51
|
+
<S as="div" {...rootProps}>
|
|
52
|
+
{button.tag === "button" ? (
|
|
53
|
+
<S as="button" {...controlProps} type={button.type}><SyncedPatternContent {...props} block={content} context={{...context, effectiveTone: typeof control?.styleflowProps.tone === "string" ? control.styleflowProps.tone : context.effectiveTone}} /></S>
|
|
54
|
+
) : button.href ? (
|
|
55
|
+
<S as="a" {...controlProps} href={button.href} target={button.target} rel={button.rel}><SyncedPatternContent {...props} block={content} context={{...context, effectiveTone: typeof control?.styleflowProps.tone === "string" ? control.styleflowProps.tone : context.effectiveTone}} /></S>
|
|
56
|
+
) : (
|
|
57
|
+
<S as="span" {...controlProps} aria-disabled="true"><SyncedPatternContent {...props} block={content} context={{...context, effectiveTone: typeof control?.styleflowProps.tone === "string" ? control.styleflowProps.tone : context.effectiveTone}} /></S>
|
|
58
|
+
)}
|
|
59
|
+
</S>
|
|
60
|
+
)}
|
|
61
|
+
|
|
62
|
+
<style is:global>
|
|
63
|
+
:where(.flowpress-button-template) { text-decoration: none; }
|
|
64
|
+
:where(.wp-block-button[style*="width:"] > .flowpress-button-template) { width: 100%; }
|
|
65
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
3
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
4
|
+
import { nativeButtonsLayout } from "./button.js";
|
|
5
|
+
|
|
6
|
+
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
7
|
+
const layout = block.attributes.layout as Record<string, unknown> | undefined;
|
|
8
|
+
const rootProps = {
|
|
9
|
+
...htmlProps,
|
|
10
|
+
class: ["wp-block-buttons flex flex-wrap gap-4", htmlProps.class].filter(Boolean).join(" "),
|
|
11
|
+
style: [htmlProps.style, nativeButtonsLayout(layout)].filter(Boolean).join(";"),
|
|
12
|
+
};
|
|
13
|
+
---
|
|
14
|
+
<StyleflowElement as="div" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
import "./group.css";
|
|
3
|
+
import { nativeGroupProps } from "./group.js";
|
|
4
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
5
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
6
|
+
|
|
7
|
+
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
8
|
+
const authored = String(block.attributes.tagName ?? "div");
|
|
9
|
+
const tag = (["div", "section", "article", "header", "footer", "main", "aside", "nav"].includes(authored)
|
|
10
|
+
? authored
|
|
11
|
+
: "div");
|
|
12
|
+
const rootProps = {
|
|
13
|
+
...nativeGroupProps(block.attributes, htmlProps, styleflowProps),
|
|
14
|
+
id: htmlProps.id || (tag === "main" ? "main-content" : undefined),
|
|
15
|
+
};
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
{tag === "section" ? <StyleflowElement as="section" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
19
|
+
: tag === "article" ? <StyleflowElement as="article" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
20
|
+
: tag === "header" ? <StyleflowElement as="header" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
21
|
+
: tag === "footer" ? <StyleflowElement as="footer" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
22
|
+
: tag === "main" ? <StyleflowElement as="main" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
23
|
+
: tag === "aside" ? <StyleflowElement as="aside" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
24
|
+
: tag === "nav" ? <StyleflowElement as="nav" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>
|
|
25
|
+
: <StyleflowElement as="div" {...rootProps} {...styleflowProps}><slot /></StyleflowElement>}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { decodeFlowpressText } from "../../text.js";
|
|
3
|
+
import StyleflowElement from "../StyleflowElement.astro";
|
|
4
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
5
|
+
|
|
6
|
+
const { block, htmlProps, styleflowProps } = Astro.props as FlowpressBlockRendererProps;
|
|
7
|
+
const href = String(block.resolvedData?.url ?? block.attributes.url ?? "/");
|
|
8
|
+
const label = decodeFlowpressText(block.resolvedData?.label ?? block.attributes.label ?? "Home");
|
|
9
|
+
const rootProps = { ...htmlProps, class: ["wp-block-navigation-item", htmlProps.class].filter(Boolean).join(" ") };
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<StyleflowElement as="li" {...rootProps} {...styleflowProps}><StyleflowElement as="a" class="wp-block-navigation-item__content" href={href}><StyleflowElement as="span" class="wp-block-navigation-item__label">{label}</StyleflowElement></StyleflowElement></StyleflowElement>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
3
|
+
import NativeHtmlBlock from "./NativeHtmlBlock.astro";
|
|
4
|
+
|
|
5
|
+
const { htmlProps, styleflowProps, ...props } = Astro.props as FlowpressBlockRendererProps;
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
<NativeHtmlBlock {...props} htmlProps={htmlProps} styleflowProps={styleflowProps} />
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { FlowpressBlockRendererProps } from "../../index.js";
|
|
3
|
+
import NativeIconBlock from "./NativeIconBlock.astro";
|
|
4
|
+
const { htmlProps, styleflowProps, ...props } = Astro.props as FlowpressBlockRendererProps;
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<NativeIconBlock {...props} htmlProps={htmlProps} styleflowProps={styleflowProps} />
|