@styleflow.app/flowpress-astro-core 1.0.0-beta.2 → 1.0.0-beta.3
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 +8 -0
- package/README.md +1 -1
- package/dist/astro/GutenbergRenderer.astro +11 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 1.0.0-beta.3
|
|
6
|
+
|
|
7
|
+
- Deferred generic Gutenberg semantic validation until its renderer branch is
|
|
8
|
+
selected, preventing valid numeric heading variants from being validated as
|
|
9
|
+
body typography and spuriously falling back to `md`.
|
|
10
|
+
- Added a strict production fixture for `core/heading` with `v="5"` and verified
|
|
11
|
+
that the emitted Styleflow type and variant remain `heading` and `5`.
|
|
12
|
+
|
|
5
13
|
## 1.0.0-beta.2
|
|
6
14
|
|
|
7
15
|
- Added exact `@splidejs/splide@4.1.4` support and dedicated renderers for
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ The package must not import from an application or project plugin.
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
pnpm add @styleflow.app/flowpress-astro-core@1.0.0-beta.
|
|
12
|
+
pnpm add @styleflow.app/flowpress-astro-core@1.0.0-beta.3 \
|
|
13
13
|
@styleflow.app/astro@1.0.0-beta.1
|
|
14
14
|
```
|
|
15
15
|
|
|
@@ -54,7 +54,7 @@ function youtubeEmbedUrl(value: unknown): string | null {
|
|
|
54
54
|
{blocks.map((block) => {
|
|
55
55
|
const name = block.name.replace(/^sf\//, "");
|
|
56
56
|
const children = block.innerBlocks ?? [];
|
|
57
|
-
const
|
|
57
|
+
const genericSemantic = () => semanticProps(block.attributes, contract);
|
|
58
58
|
const htmlAttributes = blockHtmlAttributes(block.attributes);
|
|
59
59
|
const CustomBlockRenderer = blockRenderers[block.name];
|
|
60
60
|
|
|
@@ -244,7 +244,7 @@ function youtubeEmbedUrl(value: unknown): string | null {
|
|
|
244
244
|
? block.attributes.images as Array<Record<string, unknown>>
|
|
245
245
|
: [];
|
|
246
246
|
return (
|
|
247
|
-
<S as="div" {...
|
|
247
|
+
<S as="div" {...genericSemantic()} {...htmlAttributes}>
|
|
248
248
|
{images.map((image) => image.url ? (
|
|
249
249
|
<img
|
|
250
250
|
src={String(image.url)}
|
|
@@ -261,7 +261,7 @@ function youtubeEmbedUrl(value: unknown): string | null {
|
|
|
261
261
|
const video = objectValue(block, "video");
|
|
262
262
|
const poster = objectValue(block, "poster");
|
|
263
263
|
return video.url ? (
|
|
264
|
-
<S as="div" {...
|
|
264
|
+
<S as="div" {...genericSemantic()} {...htmlAttributes}>
|
|
265
265
|
<video
|
|
266
266
|
src={String(video.url)}
|
|
267
267
|
poster={poster.url ? String(poster.url) : undefined}
|
|
@@ -277,7 +277,7 @@ function youtubeEmbedUrl(value: unknown): string | null {
|
|
|
277
277
|
if (name === "video-youtube") {
|
|
278
278
|
const embed = youtubeEmbedUrl(block.attributes.url);
|
|
279
279
|
return embed ? (
|
|
280
|
-
<S as="div" {...
|
|
280
|
+
<S as="div" {...genericSemantic()} {...htmlAttributes}>
|
|
281
281
|
<iframe
|
|
282
282
|
src={embed}
|
|
283
283
|
title={String(block.attributes.title ?? "YouTube video")}
|
|
@@ -291,7 +291,7 @@ function youtubeEmbedUrl(value: unknown): string | null {
|
|
|
291
291
|
|
|
292
292
|
if (name === "chip") {
|
|
293
293
|
return (
|
|
294
|
-
<S as="span" {...
|
|
294
|
+
<S as="span" {...genericSemantic()} {...htmlAttributes}>
|
|
295
295
|
{textValue(block, "label")}
|
|
296
296
|
</S>
|
|
297
297
|
);
|
|
@@ -301,7 +301,7 @@ function youtubeEmbedUrl(value: unknown): string | null {
|
|
|
301
301
|
const media = objectValue(block, "image");
|
|
302
302
|
const href = linkValue(block);
|
|
303
303
|
return (
|
|
304
|
-
<S as="article" {...
|
|
304
|
+
<S as="article" {...genericSemantic()} {...htmlAttributes}>
|
|
305
305
|
{media.url && (
|
|
306
306
|
<img src={String(media.url)} alt={String(media.alt ?? "")} loading="lazy" />
|
|
307
307
|
)}
|
|
@@ -320,7 +320,7 @@ function youtubeEmbedUrl(value: unknown): string | null {
|
|
|
320
320
|
? block.attributes.resolvedBlocks as FlowpressBlock[][]
|
|
321
321
|
: [];
|
|
322
322
|
return (
|
|
323
|
-
<S as="ul" {...
|
|
323
|
+
<S as="ul" {...genericSemantic()} {...htmlAttributes}>
|
|
324
324
|
{items.map((item, index) => (
|
|
325
325
|
<S as="li">
|
|
326
326
|
{resolvedBlocks[index]?.length ? (
|
|
@@ -365,7 +365,7 @@ function youtubeEmbedUrl(value: unknown): string | null {
|
|
|
365
365
|
|
|
366
366
|
if (name === "accordion-item") {
|
|
367
367
|
return (
|
|
368
|
-
<S as="div" {...
|
|
368
|
+
<S as="div" {...genericSemantic()} {...htmlAttributes}>
|
|
369
369
|
<details>
|
|
370
370
|
<summary>{String(block.attributes.title ?? "")}</summary>
|
|
371
371
|
<Astro.self
|
|
@@ -396,7 +396,7 @@ function youtubeEmbedUrl(value: unknown): string | null {
|
|
|
396
396
|
+ `?key=${encodeURIComponent(googleMapsApiKey)}`
|
|
397
397
|
+ `&q=${encodeURIComponent(query)}`;
|
|
398
398
|
return (
|
|
399
|
-
<S as="div" {...
|
|
399
|
+
<S as="div" {...genericSemantic()} {...htmlAttributes}>
|
|
400
400
|
<iframe
|
|
401
401
|
src={source}
|
|
402
402
|
title={address || "Map"}
|
|
@@ -407,7 +407,7 @@ function youtubeEmbedUrl(value: unknown): string | null {
|
|
|
407
407
|
);
|
|
408
408
|
}
|
|
409
409
|
return query ? (
|
|
410
|
-
<S as="div" {...
|
|
410
|
+
<S as="div" {...genericSemantic()} {...htmlAttributes}>
|
|
411
411
|
<S
|
|
412
412
|
as="a"
|
|
413
413
|
href={`https://www.openstreetmap.org/search?query=${encodeURIComponent(query)}`}
|
|
@@ -421,7 +421,7 @@ function youtubeEmbedUrl(value: unknown): string | null {
|
|
|
421
421
|
|
|
422
422
|
const layoutTag = name === "section" ? "section" : "div";
|
|
423
423
|
return (
|
|
424
|
-
<S as={layoutTag} {...
|
|
424
|
+
<S as={layoutTag} {...genericSemantic()} {...htmlAttributes}>
|
|
425
425
|
{block.innerHtml && children.length === 0
|
|
426
426
|
? <S as="div" set:html={block.innerHtml} />
|
|
427
427
|
: (
|
package/package.json
CHANGED