@crombolo/next-integration 0.63.0 → 0.64.0
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/dist/components.d.ts +6 -1
- package/dist/components.js +6 -0
- package/package.json +3 -3
package/dist/components.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Server components for crombolo values (story 208): rich text, and block lists
|
|
4
4
|
* and grids rendered through a component per element type.
|
|
5
5
|
*/
|
|
6
|
-
import { type ApiBlockGrid, type ApiBlockList, type ApiElement, type RichTextGenericElement, type RichTextTags, type RichTextValue } from '@crombolo/delivery-client';
|
|
6
|
+
import { type ApiBlockGrid, type ApiBlockList, type ApiBlockListItem, type ApiElement, type RichTextGenericElement, type RichTextTags, type RichTextValue } from '@crombolo/delivery-client';
|
|
7
7
|
import { type ComponentType, type ReactNode } from 'react';
|
|
8
8
|
/** What a tag's component in `<RichText components>` is given. */
|
|
9
9
|
export interface RichTextTagProps<Node = RichTextGenericElement> {
|
|
@@ -35,6 +35,11 @@ export interface BlockComponentProps<Content = ApiElement, Settings = ApiElement
|
|
|
35
35
|
settings: Settings | null;
|
|
36
36
|
}
|
|
37
37
|
export type BlockComponents = Record<string, ComponentType<BlockComponentProps<never, never>>>;
|
|
38
|
+
/** A Single Block's one block through its element type's component, or nothing (story 345). */
|
|
39
|
+
export declare function SingleBlock({ value, components, }: {
|
|
40
|
+
value: ApiBlockListItem | null | undefined;
|
|
41
|
+
components: BlockComponents;
|
|
42
|
+
}): import("react").JSX.Element | null;
|
|
38
43
|
/** A block list, each item through the component for its element type. */
|
|
39
44
|
export declare function BlockList({ value, components, }: {
|
|
40
45
|
value: ApiBlockList | null | undefined;
|
package/dist/components.js
CHANGED
|
@@ -98,6 +98,12 @@ function Block({ content, settings, components, }) {
|
|
|
98
98
|
const Component = components[content.contentType];
|
|
99
99
|
return Component ? (_jsx(Component, { content: content, settings: settings })) : (_jsx(Missing, { alias: content.contentType }));
|
|
100
100
|
}
|
|
101
|
+
/** A Single Block's one block through its element type's component, or nothing (story 345). */
|
|
102
|
+
export function SingleBlock({ value, components, }) {
|
|
103
|
+
if (!value?.content)
|
|
104
|
+
return null;
|
|
105
|
+
return _jsx(Block, { content: value.content, settings: value.settings, components: components });
|
|
106
|
+
}
|
|
101
107
|
/** A block list, each item through the component for its element type. */
|
|
102
108
|
export function BlockList({ value, components, }) {
|
|
103
109
|
if (!value?.items.length)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crombolo/next-integration",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.64.0",
|
|
4
4
|
"description": "A Next.js App Router front end for a crombolo site: pages, metadata, preview, revalidation, members, images and content components.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Crombolo",
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"NOTICE"
|
|
70
70
|
],
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@crombolo/common": "0.
|
|
73
|
-
"@crombolo/delivery-client": "0.
|
|
72
|
+
"@crombolo/common": "0.64.0",
|
|
73
|
+
"@crombolo/delivery-client": "0.64.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"next": ">=15.5 <17",
|