@storyblok/react 7.1.0 → 7.2.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/README.md +32 -41
- package/dist/core/create-storyblok-richtext.js +1 -1
- package/dist/core/create-storyblok-richtext.mjs +13 -11
- package/dist/core/rich-text-renderer.js +1 -1
- package/dist/core/rich-text-renderer.mjs +72 -69
- package/dist/index.d.ts +2 -1
- package/dist/rsc.d.ts +2 -1
- package/dist/ssr.d.ts +2 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -233,24 +233,27 @@ export async function fetchData() {
|
|
|
233
233
|
|
|
234
234
|
| Export | Use Case | Live Editing | Static Export Support |
|
|
235
235
|
| ---------------------- | ----------------------------------- | ------------ | --------------------- |
|
|
236
|
-
| `@storyblok/react` | Client-side rendering, SPA | ✅
|
|
237
|
-
| `@storyblok/react/ssr` | Server-side rendering, static sites | ❌
|
|
238
|
-
| `@storyblok/react/rsc` | React Server Components | ✅
|
|
236
|
+
| `@storyblok/react` | Client-side rendering, SPA | ✅ | ✅ |
|
|
237
|
+
| `@storyblok/react/ssr` | Server-side rendering, static sites | ❌ | ✅ |
|
|
238
|
+
| `@storyblok/react/rsc` | React Server Components | ✅ | ❌ |
|
|
239
239
|
|
|
240
240
|
### When to Use Each Export
|
|
241
241
|
|
|
242
242
|
**Use `@storyblok/react`** for:
|
|
243
|
+
|
|
243
244
|
- Single Page Applications (SPA)
|
|
244
245
|
- Client-side rendered React apps
|
|
245
246
|
- When you need live editing in browser-based applications
|
|
246
247
|
|
|
247
248
|
**Use `@storyblok/react/ssr`** for:
|
|
249
|
+
|
|
248
250
|
- Next.js static exports (`output: 'export'`)
|
|
249
251
|
- Static site generation without live editing
|
|
250
252
|
- Server-side rendering where live editing isn't required
|
|
251
253
|
- Performance-critical scenarios where bundle size matters
|
|
252
254
|
|
|
253
255
|
**Use `@storyblok/react/rsc`** for:
|
|
256
|
+
|
|
254
257
|
- Next.js App Router with React Server Components
|
|
255
258
|
- When you need live editing with server components
|
|
256
259
|
- Modern React applications with server/client component separation
|
|
@@ -265,7 +268,7 @@ If you're using Next.js with `output: 'export'` for static site generation, you
|
|
|
265
268
|
// next.config.js
|
|
266
269
|
/** @type {import('next').NextConfig} */
|
|
267
270
|
const nextConfig = {
|
|
268
|
-
output:
|
|
271
|
+
output: "export", // Enables static export
|
|
269
272
|
};
|
|
270
273
|
|
|
271
274
|
module.exports = nextConfig;
|
|
@@ -306,7 +309,7 @@ export default async function Home() {
|
|
|
306
309
|
|
|
307
310
|
export async function fetchData() {
|
|
308
311
|
const storyblokApi = getStoryblokApi();
|
|
309
|
-
return storyblokApi.get(`cdn/stories/home`, { version:
|
|
312
|
+
return storyblokApi.get(`cdn/stories/home`, { version: "draft" });
|
|
310
313
|
}
|
|
311
314
|
```
|
|
312
315
|
|
|
@@ -386,6 +389,7 @@ export async function fetchData() {
|
|
|
386
389
|
```
|
|
387
390
|
|
|
388
391
|
**The `StoryblokStory` component automatically:**
|
|
392
|
+
|
|
389
393
|
- Renders your Storyblok content components on the server
|
|
390
394
|
- Loads the bridge script for live editing (when in Visual Editor)
|
|
391
395
|
- Handles live content updates via global cache
|
|
@@ -396,9 +400,9 @@ export async function fetchData() {
|
|
|
396
400
|
You can pass bridge options for advanced configurations:
|
|
397
401
|
|
|
398
402
|
```jsx
|
|
399
|
-
const bridgeOptions = { resolveRelations: [
|
|
403
|
+
const bridgeOptions = { resolveRelations: ["article.author"] };
|
|
400
404
|
|
|
401
|
-
<StoryblokStory story={data.story} bridgeOptions={bridgeOptions}
|
|
405
|
+
<StoryblokStory story={data.story} bridgeOptions={bridgeOptions} />;
|
|
402
406
|
```
|
|
403
407
|
|
|
404
408
|
**Advanced: Manual Component Separation**
|
|
@@ -421,6 +425,7 @@ import { StoryblokServerComponent, StoryblokLiveEditing } from '@storyblok/react
|
|
|
421
425
|
When creating your individual Storyblok content components (like `Page`, `Teaser`, etc.), you must use `StoryblokServerComponent` for nested components. Import it from the same export you're using:
|
|
422
426
|
|
|
423
427
|
**For RSC (with live editing):**
|
|
428
|
+
|
|
424
429
|
```jsx
|
|
425
430
|
import {
|
|
426
431
|
storyblokEditable,
|
|
@@ -439,6 +444,7 @@ export default Page;
|
|
|
439
444
|
```
|
|
440
445
|
|
|
441
446
|
**For SSR (static exports):**
|
|
447
|
+
|
|
442
448
|
```jsx
|
|
443
449
|
import {
|
|
444
450
|
storyblokEditable,
|
|
@@ -698,10 +704,18 @@ For a comprehensive list of options you can provide to the `useStoryblokRichText
|
|
|
698
704
|
You can override the default resolvers by passing a `resolvers` prop to the `StoryblokRichText` component, for example, to use NextJS Link component or add a custom codeblok component:
|
|
699
705
|
|
|
700
706
|
```ts
|
|
701
|
-
import { StoryblokRichText, useStoryblok, MarkTypes, type
|
|
707
|
+
import { StoryblokRichText, useStoryblok, MarkTypes, type SbReactRichTextComponentMap, type SbReactRichTextProps } from '@storyblok/react';
|
|
702
708
|
import Link from 'next/link';
|
|
703
709
|
import CodeBlock from './components/CodeBlock';
|
|
704
710
|
|
|
711
|
+
function CustomLink({ children, attrs }: SbReactRichTextProps<"link">) {
|
|
712
|
+
return (
|
|
713
|
+
<Link href={attrs?.href ?? ""} target={attrs?.target ?? "_self"}>
|
|
714
|
+
{children}
|
|
715
|
+
</Link>
|
|
716
|
+
);
|
|
717
|
+
}
|
|
718
|
+
|
|
705
719
|
function App() {
|
|
706
720
|
const story = useStoryblok('home', { version: 'draft' });
|
|
707
721
|
|
|
@@ -709,40 +723,16 @@ function App() {
|
|
|
709
723
|
return <div>Loading...</div>;
|
|
710
724
|
}
|
|
711
725
|
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
target={node.attrs?.target}
|
|
719
|
-
>
|
|
720
|
-
{node.text}
|
|
721
|
-
</Link>
|
|
722
|
-
)
|
|
723
|
-
: (
|
|
724
|
-
<a
|
|
725
|
-
href={node.attrs?.href}
|
|
726
|
-
target={node.attrs?.target}
|
|
727
|
-
>
|
|
728
|
-
{node.text}
|
|
729
|
-
</a>
|
|
730
|
-
);
|
|
731
|
-
},
|
|
732
|
-
[BlockTypes.CODE_BLOCK]: (node) =>
|
|
733
|
-
<CodeBlock
|
|
734
|
-
class={node?.attrs?.class}
|
|
735
|
-
>
|
|
736
|
-
{node.children}
|
|
737
|
-
</CodeBlock>;
|
|
738
|
-
}
|
|
726
|
+
const components: SbReactRichTextComponentMap = {
|
|
727
|
+
heading: CustomHeading,
|
|
728
|
+
link: CustomLink,
|
|
729
|
+
table: CustomTable,
|
|
730
|
+
bold: ({ children }) => <b className="font-bold text-black">{children}</b>,
|
|
731
|
+
};
|
|
739
732
|
|
|
740
733
|
return (
|
|
741
734
|
<div>
|
|
742
|
-
<StoryblokRichText
|
|
743
|
-
doc={story.content.richText}
|
|
744
|
-
resolvers={resolvers}
|
|
745
|
-
/>
|
|
735
|
+
<StoryblokRichText document={blok.richtext_field} components={components} />
|
|
746
736
|
</div>
|
|
747
737
|
);
|
|
748
738
|
}
|
|
@@ -867,6 +857,7 @@ By using these techniques, you can ensure that only the necessary components and
|
|
|
867
857
|
### "Server Actions are not supported with static export"
|
|
868
858
|
|
|
869
859
|
**Error:** When using Next.js with `output: 'export'`, you might encounter:
|
|
860
|
+
|
|
870
861
|
```
|
|
871
862
|
Error: Server Actions are not supported with static export
|
|
872
863
|
```
|
|
@@ -901,8 +892,8 @@ Error: Server Actions are not supported with static export
|
|
|
901
892
|
```js
|
|
902
893
|
storyblokInit({
|
|
903
894
|
components: {
|
|
904
|
-
page: Page,
|
|
905
|
-
teaser: Teaser,
|
|
895
|
+
page: Page, // Matches 'page' component in Storyblok
|
|
896
|
+
teaser: Teaser, // Matches 'teaser' component in Storyblok
|
|
906
897
|
// Add all your components here
|
|
907
898
|
},
|
|
908
899
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),a=require("./rich-text-renderer.js");require("@storyblok/richtext");const d=require("./create-default-blok.js");function f(t){const r=d.createDefaultBlok(t);return function({document:n,optimizeImage:o,components:c,data:i,wrapper:u=!0,...l}){const e=a.createRichTextRenderer({optimizeImage:o,components:{blok:r,...c},data:i})(n);return u?s.jsx("div",{...l,children:e}):e}}exports.createStoryblokRichText=f;
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createRichTextRenderer as
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { createRichTextRenderer as u } from "./rich-text-renderer.mjs";
|
|
3
3
|
import "@storyblok/richtext";
|
|
4
|
-
import { createDefaultBlok as
|
|
5
|
-
function
|
|
6
|
-
const e =
|
|
4
|
+
import { createDefaultBlok as p } from "./create-default-blok.mjs";
|
|
5
|
+
function R(t) {
|
|
6
|
+
const e = p(t);
|
|
7
7
|
return function({
|
|
8
8
|
document: o,
|
|
9
9
|
optimizeImage: n,
|
|
10
10
|
components: c,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
data: i,
|
|
12
|
+
wrapper: f = !0,
|
|
13
|
+
...l
|
|
13
14
|
}) {
|
|
14
|
-
const r =
|
|
15
|
+
const r = u({
|
|
15
16
|
optimizeImage: n,
|
|
16
17
|
components: {
|
|
17
18
|
blok: e,
|
|
18
19
|
...c
|
|
19
|
-
}
|
|
20
|
+
},
|
|
21
|
+
data: i
|
|
20
22
|
})(o);
|
|
21
|
-
return
|
|
23
|
+
return f ? /* @__PURE__ */ m("div", { ...l, children: r }) : r;
|
|
22
24
|
};
|
|
23
25
|
}
|
|
24
26
|
export {
|
|
25
|
-
|
|
27
|
+
R as createStoryblokRichText
|
|
26
28
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),u=require("@storyblok/richtext"),f=require("react");function y(t,e){return e==null?void 0:e[t]}const x={class:"className"};function j(t){return function(n){const r=u.normalizeNodes(n,!0);return r!=null&&r.length?p(r,t):null}}function p(t,e){return u.groupLinkNodes(t).map((r,c)=>r.linkMark?T(r.nodes,r.linkMark,e,r._key||c):h(r.nodes[0],e,r._key||c))}function T(t,e,n,r){const c=t.map((l,a)=>{const o=l,g=u.getInnerMarks(l);return d(o,g,n,l._key||a)}),s=y(e.type,n.components);if(s)return m.jsx(s,{...e,context:n,children:c},r);const i=u.resolveTag(e);return i?f.createElement(i,{key:r,...u.processAttrs(e.type,e.attrs,x)},c):m.jsx(f.Fragment,{children:c},r)}function h(t,e,n){var a;const r=t.type!=="text"&&t.content?p(t.content,e):null,c=y(t.type,e.components);if(c){const o=(a=e.components)!=null&&a[t.type]?{...e,components:{...e.components,[t.type]:void 0}}:e;return m.jsx(c,{...t,context:o,children:r},n)}if(t.type==="text")return A(t,e,n);const s=u.resolveTag(t);if(!s)return t.content?p(t.content,e):null;if(t.type==="image"&&e.optimizeImage)return R(t,e,n);const i=u.processAttrs(t.type,t.attrs,x);if(u.isSelfClosing(s))return f.createElement(s,{key:n,...i});if(t.type==="table")return S(t,e,n,s,i);const l=u.getStaticChildren(t);if(l){const o=t.content?p(t.content,e):null,g=b(t.type,l,t.attrs,o);return f.createElement(s,{key:n},g)}return f.createElement(s,{key:n,...i},t.content?p(t.content,e):null)}function R(t,e,n){const r=t.attrs,c=r==null?void 0:r.src;if(!c)return null;const{src:s,attrs:i}=u.buildStoryblokImage(c,e.optimizeImage),l=u.processAttrs("image",{...r,src:s,...i},x);return m.jsx("img",{...l},n)}function S(t,e,n,r,c){const{headerRows:s,bodyRows:i}=u.splitTableRows(t.content),l=[];return s.length>0&&l.push(m.jsx("thead",{children:s.map((a,o)=>h(a,e,a._key||o))},"thead")),i.length>0&&l.push(m.jsx("tbody",{children:i.map((a,o)=>h(a,e,a._key||o))},"tbody")),f.createElement(r,{key:n,...c},l)}function b(t,e,n,r){return e.map((c,s)=>{const{tag:i,children:l,attrs:a}=c,o={...a,...n},g=u.processAttrs(t,o,x);if(u.isSelfClosing(i))return f.createElement(i,{key:s,...g});const C=l?b(t,l,n,r):r;return f.createElement(i,{key:s,...g},C)})}function A(t,e,n){return d(t,t.marks,e,n)}function d(t,e,n,r){let c=t.text;if(e!=null&&e.length)for(const s of e)c=E(c,s,n);return m.jsx(f.Fragment,{children:c},r)}function E(t,e,n){const r=y(e.type,n.components);if(r)return m.jsx(r,{...e,context:n,children:t});const c=u.resolveTag(e);if(!c)return t;const s=u.processAttrs(e.type,e.attrs,x);return f.createElement(c,s,t)}exports.createRichTextRenderer=j;
|
|
@@ -1,105 +1,108 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { normalizeNodes as R, groupLinkNodes as S, getInnerMarks as T, resolveTag as
|
|
3
|
-
import
|
|
4
|
-
function
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { normalizeNodes as R, groupLinkNodes as S, getInnerMarks as T, resolveTag as x, processAttrs as g, isSelfClosing as b, getStaticChildren as z, buildStoryblokImage as _, splitTableRows as A } from "@storyblok/richtext";
|
|
3
|
+
import o from "react";
|
|
4
|
+
function C(t, e) {
|
|
5
5
|
return e == null ? void 0 : e[t];
|
|
6
6
|
}
|
|
7
|
-
const
|
|
7
|
+
const h = {
|
|
8
8
|
class: "className"
|
|
9
9
|
};
|
|
10
10
|
function O(t) {
|
|
11
|
-
return function(
|
|
12
|
-
const r = R(
|
|
13
|
-
return r != null && r.length ?
|
|
11
|
+
return function(n) {
|
|
12
|
+
const r = R(n, !0);
|
|
13
|
+
return r != null && r.length ? p(r, t) : null;
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return S(t).map((r,
|
|
16
|
+
function p(t, e) {
|
|
17
|
+
return S(t).map((r, c) => r.linkMark ? I(r.nodes, r.linkMark, e, r._key || c) : y(r.nodes[0], e, r._key || c));
|
|
18
18
|
}
|
|
19
|
-
function I(t, e,
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
return E(
|
|
23
|
-
}), s =
|
|
19
|
+
function I(t, e, n, r) {
|
|
20
|
+
const c = t.map((i, l) => {
|
|
21
|
+
const a = i, m = T(i);
|
|
22
|
+
return E(a, m, n, i._key || l);
|
|
23
|
+
}), s = C(e.type, n.components);
|
|
24
24
|
if (s)
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
const u =
|
|
27
|
-
return u ?
|
|
25
|
+
return /* @__PURE__ */ f(s, { ...e, context: n, children: c }, r);
|
|
26
|
+
const u = x(e);
|
|
27
|
+
return u ? o.createElement(u, { key: r, ...g(e.type, e.attrs, h) }, c) : /* @__PURE__ */ f(o.Fragment, { children: c }, r);
|
|
28
28
|
}
|
|
29
|
-
function y(t, e,
|
|
29
|
+
function y(t, e, n) {
|
|
30
|
+
var l;
|
|
31
|
+
const r = t.type !== "text" && t.content ? p(t.content, e) : null, c = C(t.type, e.components);
|
|
32
|
+
if (c) {
|
|
33
|
+
const a = (l = e.components) != null && l[t.type] ? { ...e, components: { ...e.components, [t.type]: void 0 } } : e;
|
|
34
|
+
return /* @__PURE__ */ f(c, { ...t, context: a, children: r }, n);
|
|
35
|
+
}
|
|
30
36
|
if (t.type === "text")
|
|
31
|
-
return
|
|
32
|
-
const
|
|
33
|
-
if (
|
|
34
|
-
return
|
|
35
|
-
const n = d(t);
|
|
36
|
-
if (!n)
|
|
37
|
-
return t.content ? m(t.content, e) : null;
|
|
37
|
+
return M(t, e, n);
|
|
38
|
+
const s = x(t);
|
|
39
|
+
if (!s)
|
|
40
|
+
return t.content ? p(t.content, e) : null;
|
|
38
41
|
if (t.type === "image" && e.optimizeImage)
|
|
39
|
-
return
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
return
|
|
42
|
+
return v(t, e, n);
|
|
43
|
+
const u = g(t.type, t.attrs, h);
|
|
44
|
+
if (b(s))
|
|
45
|
+
return o.createElement(s, { key: n, ...u });
|
|
43
46
|
if (t.type === "table")
|
|
44
|
-
return
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
const
|
|
48
|
-
return
|
|
47
|
+
return F(t, e, n, s, u);
|
|
48
|
+
const i = z(t);
|
|
49
|
+
if (i) {
|
|
50
|
+
const a = t.content ? p(t.content, e) : null, m = d(t.type, i, t.attrs, a);
|
|
51
|
+
return o.createElement(s, { key: n }, m);
|
|
49
52
|
}
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
{ key:
|
|
53
|
-
t.content ?
|
|
53
|
+
return o.createElement(
|
|
54
|
+
s,
|
|
55
|
+
{ key: n, ...u },
|
|
56
|
+
t.content ? p(t.content, e) : null
|
|
54
57
|
);
|
|
55
58
|
}
|
|
56
|
-
function
|
|
57
|
-
const r = t.attrs,
|
|
58
|
-
if (!
|
|
59
|
+
function v(t, e, n) {
|
|
60
|
+
const r = t.attrs, c = r == null ? void 0 : r.src;
|
|
61
|
+
if (!c)
|
|
59
62
|
return null;
|
|
60
|
-
const { src: s, attrs: u } = _(
|
|
63
|
+
const { src: s, attrs: u } = _(c, e.optimizeImage), i = g("image", {
|
|
61
64
|
...r,
|
|
62
65
|
src: s,
|
|
63
66
|
...u
|
|
64
|
-
},
|
|
65
|
-
return /* @__PURE__ */
|
|
67
|
+
}, h);
|
|
68
|
+
return /* @__PURE__ */ f("img", { ...i }, n);
|
|
66
69
|
}
|
|
67
|
-
function
|
|
70
|
+
function F(t, e, n, r, c) {
|
|
68
71
|
const { headerRows: s, bodyRows: u } = A(t.content), i = [];
|
|
69
72
|
return s.length > 0 && i.push(
|
|
70
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ f("thead", { children: s.map((l, a) => y(l, e, l._key || a)) }, "thead")
|
|
71
74
|
), u.length > 0 && i.push(
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
),
|
|
75
|
+
/* @__PURE__ */ f("tbody", { children: u.map((l, a) => y(l, e, l._key || a)) }, "tbody")
|
|
76
|
+
), o.createElement(r, { key: n, ...c }, i);
|
|
74
77
|
}
|
|
75
|
-
function
|
|
76
|
-
return e.map((
|
|
77
|
-
const { tag: u, children: i, attrs: l } =
|
|
78
|
-
if (
|
|
79
|
-
return
|
|
80
|
-
const N = i ?
|
|
81
|
-
return
|
|
78
|
+
function d(t, e, n, r) {
|
|
79
|
+
return e.map((c, s) => {
|
|
80
|
+
const { tag: u, children: i, attrs: l } = c, a = { ...l, ...n }, m = g(t, a, h);
|
|
81
|
+
if (b(u))
|
|
82
|
+
return o.createElement(u, { key: s, ...m });
|
|
83
|
+
const N = i ? d(t, i, n, r) : r;
|
|
84
|
+
return o.createElement(u, { key: s, ...m }, N);
|
|
82
85
|
});
|
|
83
86
|
}
|
|
84
|
-
function
|
|
85
|
-
return E(t, t.marks, e,
|
|
87
|
+
function M(t, e, n) {
|
|
88
|
+
return E(t, t.marks, e, n);
|
|
86
89
|
}
|
|
87
|
-
function E(t, e,
|
|
88
|
-
let
|
|
90
|
+
function E(t, e, n, r) {
|
|
91
|
+
let c = t.text;
|
|
89
92
|
if (e != null && e.length)
|
|
90
93
|
for (const s of e)
|
|
91
|
-
|
|
92
|
-
return /* @__PURE__ */ o
|
|
94
|
+
c = w(c, s, n);
|
|
95
|
+
return /* @__PURE__ */ f(o.Fragment, { children: c }, r);
|
|
93
96
|
}
|
|
94
|
-
function
|
|
95
|
-
const r =
|
|
97
|
+
function w(t, e, n) {
|
|
98
|
+
const r = C(e.type, n.components);
|
|
96
99
|
if (r)
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
const
|
|
99
|
-
if (!
|
|
100
|
+
return /* @__PURE__ */ f(r, { ...e, context: n, children: t });
|
|
101
|
+
const c = x(e);
|
|
102
|
+
if (!c)
|
|
100
103
|
return t;
|
|
101
|
-
const s =
|
|
102
|
-
return
|
|
104
|
+
const s = g(e.type, e.attrs, h);
|
|
105
|
+
return o.createElement(c, s, t);
|
|
103
106
|
}
|
|
104
107
|
export {
|
|
105
108
|
O as createRichTextRenderer
|
package/dist/index.d.ts
CHANGED
|
@@ -155,6 +155,7 @@ export declare type SbReactRichTextProps<T extends SbRichTextElement> = SbRichTe
|
|
|
155
155
|
export declare interface SbReactRichTextRenderContext {
|
|
156
156
|
optimizeImage?: boolean | SbRichTextImageOptions;
|
|
157
157
|
components?: SbReactRichTextComponentMap;
|
|
158
|
+
data?: unknown;
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
export declare interface SbReactSDKOptions extends SbSDKOptions {
|
|
@@ -203,7 +204,7 @@ export { storyblokEditable }
|
|
|
203
204
|
|
|
204
205
|
export declare const storyblokInit: (pluginOptions?: SbReactSDKOptions) => (() => StoryblokClient);
|
|
205
206
|
|
|
206
|
-
export declare const StoryblokRichText: ({ document, optimizeImage, components, wrapper, ...rest }: SbRichTextProps_2) => ReactNode;
|
|
207
|
+
export declare const StoryblokRichText: ({ document, optimizeImage, components, data, wrapper, ...rest }: SbRichTextProps_2) => ReactNode;
|
|
207
208
|
|
|
208
209
|
export declare interface StoryblokRichTextProps extends SbReactRichTextRenderContext {
|
|
209
210
|
optimizeImage?: boolean | SbRichTextImageOptions;
|
package/dist/rsc.d.ts
CHANGED
|
@@ -125,6 +125,7 @@ export declare type SbReactRichTextProps<T extends SbRichTextElement> = SbRichTe
|
|
|
125
125
|
export declare interface SbReactRichTextRenderContext {
|
|
126
126
|
optimizeImage?: boolean | SbRichTextImageOptions;
|
|
127
127
|
components?: SbReactRichTextComponentMap;
|
|
128
|
+
data?: unknown;
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
export declare interface SbReactSDKOptions extends SbSDKOptions {
|
|
@@ -183,7 +184,7 @@ export declare interface StoryblokRichTextProps extends SbReactRichTextRenderCon
|
|
|
183
184
|
|
|
184
185
|
export declare const StoryblokServerComponent: ForwardRefExoticComponent<Omit<SbServerComponentProps, "ref"> & RefAttributes<HTMLElement>>;
|
|
185
186
|
|
|
186
|
-
export declare const StoryblokServerRichText: ({ document, optimizeImage, components, wrapper, ...rest }: SbRichTextProps_2) => ReactNode;
|
|
187
|
+
export declare const StoryblokServerRichText: ({ document, optimizeImage, components, data, wrapper, ...rest }: SbRichTextProps_2) => ReactNode;
|
|
187
188
|
|
|
188
189
|
/**
|
|
189
190
|
* Shared server component for rendering Storyblok stories.
|
package/dist/ssr.d.ts
CHANGED
|
@@ -129,6 +129,7 @@ export declare type SbReactRichTextProps<T extends SbRichTextElement> = SbRichTe
|
|
|
129
129
|
export declare interface SbReactRichTextRenderContext {
|
|
130
130
|
optimizeImage?: boolean | SbRichTextImageOptions;
|
|
131
131
|
components?: SbReactRichTextComponentMap;
|
|
132
|
+
data?: unknown;
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
export declare interface SbReactSDKOptions extends SbSDKOptions {
|
|
@@ -188,7 +189,7 @@ export declare interface StoryblokRichTextProps extends SbReactRichTextRenderCon
|
|
|
188
189
|
|
|
189
190
|
export declare const StoryblokServerComponent: ForwardRefExoticComponent<Omit<SbServerComponentProps, "ref"> & RefAttributes<HTMLElement>>;
|
|
190
191
|
|
|
191
|
-
export declare const StoryblokServerRichText: ({ document, optimizeImage, components, wrapper, ...rest }: SbRichTextProps_2) => ReactNode;
|
|
192
|
+
export declare const StoryblokServerRichText: ({ document, optimizeImage, components, data, wrapper, ...rest }: SbRichTextProps_2) => ReactNode;
|
|
192
193
|
|
|
193
194
|
/**
|
|
194
195
|
* Shared server component for rendering Storyblok stories.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyblok/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.2.0",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "SDK to integrate Storyblok into your project using React.",
|
|
7
7
|
"author": "Storyblok",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@storyblok/
|
|
53
|
-
"@storyblok/
|
|
52
|
+
"@storyblok/js": "6.2.0",
|
|
53
|
+
"@storyblok/richtext": "5.2.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@babel/core": "^7.27.1",
|