@storyblok/react 5.4.13 → 5.4.15
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/core/state.js +1 -1
- package/dist/core/state.mjs +12 -12
- package/dist/rsc/live-edit-update-action.js +1 -1
- package/dist/rsc/live-edit-update-action.mjs +4 -3
- package/dist/rsc/story.js +1 -1
- package/dist/rsc/story.mjs +1 -1
- package/dist/server/server-story.js +1 -1
- package/dist/server/server-story.mjs +10 -11
- package/package.json +2 -2
package/dist/core/state.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let o=null;const e=new Map;let n=!1,l=null;globalThis.storyCache=globalThis.storyCache
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let o=null;const e=new Map;let n=!1,l=null;globalThis.storyCache=globalThis.storyCache||new Map;const c=()=>o,b=t=>{o=t},p=t=>(Object.entries(t).forEach(([s,a])=>{e.set(s,a)}),e),r=t=>e.has(t)?e.get(t):(console.error(`Component ${t} doesn't exist.`),!1),C=()=>n,m=t=>{n=t},k=()=>l,g=t=>{l=t};exports.getComponent=r;exports.getCustomFallbackComponent=k;exports.getEnableFallbackComponent=C;exports.getStoryblokApiInstance=c;exports.setComponents=p;exports.setCustomFallbackComponent=g;exports.setEnableFallbackComponent=m;exports.setStoryblokApiInstance=b;
|
package/dist/core/state.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
let
|
|
2
|
-
const
|
|
3
|
-
let
|
|
4
|
-
globalThis.storyCache = globalThis.storyCache
|
|
5
|
-
const c = () =>
|
|
6
|
-
|
|
1
|
+
let o = null;
|
|
2
|
+
const n = /* @__PURE__ */ new Map();
|
|
3
|
+
let e = !1, s = null;
|
|
4
|
+
globalThis.storyCache = globalThis.storyCache || /* @__PURE__ */ new Map();
|
|
5
|
+
const c = () => o, r = (t) => {
|
|
6
|
+
o = t;
|
|
7
7
|
}, b = (t) => (Object.entries(t).forEach(([l, a]) => {
|
|
8
|
-
|
|
9
|
-
}),
|
|
10
|
-
|
|
11
|
-
},
|
|
8
|
+
n.set(l, a);
|
|
9
|
+
}), n), p = (t) => n.has(t) ? n.get(t) : (console.error(`Component ${t} doesn't exist.`), !1), C = () => e, m = (t) => {
|
|
10
|
+
e = t;
|
|
11
|
+
}, k = () => s, i = (t) => {
|
|
12
12
|
s = t;
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
15
|
p as getComponent,
|
|
16
|
-
|
|
16
|
+
k as getCustomFallbackComponent,
|
|
17
17
|
C as getEnableFallbackComponent,
|
|
18
18
|
c as getStoryblokApiInstance,
|
|
19
19
|
b as setComponents,
|
|
20
|
-
|
|
20
|
+
i as setCustomFallbackComponent,
|
|
21
21
|
m as setEnableFallbackComponent,
|
|
22
22
|
r as setStoryblokApiInstance
|
|
23
23
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use server";
|
|
2
|
-
"use strict";var n=Object.create;var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty;var p=(e,t,i,
|
|
2
|
+
"use strict";var n=Object.create;var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var l=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty;var p=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of d(t))!s.call(e,o)&&o!==i&&a(e,o,{get:()=>t[o],enumerable:!(r=c(t,o))||r.enumerable});return e};var v=(e,t,i)=>(i=e!=null?n(l(e)):{},p(t||!e||!e.__esModule?a(i,"default",{value:e,enumerable:!0}):i,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});async function u({story:e,pathToRevalidate:t}){var i;if(!e||!t)return console.error("liveEditUpdateAction: story or pathToRevalidate is not provided");if((i=globalThis.storyCache)==null||i.set(e.uuid,e),process.env.NEXT_RUNTIME)try{const{revalidatePath:r}=await import("next/cache");r(t)}catch(r){console.error("liveEditUpdateAction: error while revalidating path",r)}}exports.liveEditUpdateAction=u;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use server";
|
|
2
|
-
async function
|
|
2
|
+
async function o({ story: e, pathToRevalidate: i }) {
|
|
3
|
+
var r;
|
|
3
4
|
if (!e || !i)
|
|
4
5
|
return console.error("liveEditUpdateAction: story or pathToRevalidate is not provided");
|
|
5
|
-
if (globalThis.storyCache.set(e.uuid, e), process.env.NEXT_RUNTIME)
|
|
6
|
+
if ((r = globalThis.storyCache) == null || r.set(e.uuid, e), process.env.NEXT_RUNTIME)
|
|
6
7
|
try {
|
|
7
8
|
const { revalidatePath: t } = await import("next/cache");
|
|
8
9
|
t(i);
|
|
@@ -11,5 +12,5 @@ async function r({ story: e, pathToRevalidate: i }) {
|
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
+
o as liveEditUpdateAction
|
|
15
16
|
};
|
package/dist/rsc/story.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=require("react/jsx-runtime"),i=require("react"),s=require("../server/server-component.js"),l=require("./live-editing.js"),u=i.forwardRef(({story:e,bridgeOptions:t,...o},n)=>{if(!e)return console.error("Please provide a 'story' property to the StoryblokServerComponent"),null;if(globalThis.storyCache.has(e.uuid)&&(e=globalThis.storyCache.get(e.uuid),globalThis.storyCache.delete(e.uuid)),typeof e.content=="string")try{e.content=JSON.parse(e.content)}catch(c){console.error("An error occurred while trying to parse the story content",c),e.content={}}return r.jsxs(r.Fragment,{children:[r.jsx(s,{ref:n,blok:e.content,...o}),r.jsx(l,{story:e,bridgeOptions:t})]})});module.exports=u;
|
|
1
|
+
"use strict";const r=require("react/jsx-runtime"),i=require("react"),s=require("../server/server-component.js"),l=require("./live-editing.js"),u=i.forwardRef(({story:e,bridgeOptions:t,...o},n)=>{if(!e)return console.error("Please provide a 'story' property to the StoryblokServerComponent"),null;if(globalThis!=null&&globalThis.storyCache.has(e.uuid)&&(e=globalThis.storyCache.get(e.uuid),globalThis.storyCache.delete(e.uuid)),typeof e.content=="string")try{e.content=JSON.parse(e.content)}catch(c){console.error("An error occurred while trying to parse the story content",c),e.content={}}return r.jsxs(r.Fragment,{children:[r.jsx(s,{ref:n,blok:e.content,...o}),r.jsx(l,{story:e,bridgeOptions:t})]})});module.exports=u;
|
package/dist/rsc/story.mjs
CHANGED
|
@@ -8,7 +8,7 @@ const s = a(
|
|
|
8
8
|
return console.error(
|
|
9
9
|
"Please provide a 'story' property to the StoryblokServerComponent"
|
|
10
10
|
), null;
|
|
11
|
-
if (globalThis.storyCache.has(e.uuid) && (e = globalThis.storyCache.get(e.uuid), globalThis.storyCache.delete(e.uuid)), typeof e.content == "string")
|
|
11
|
+
if (globalThis != null && globalThis.storyCache.has(e.uuid) && (e = globalThis.storyCache.get(e.uuid), globalThis.storyCache.delete(e.uuid)), typeof e.content == "string")
|
|
12
12
|
try {
|
|
13
13
|
e.content = JSON.parse(e.content);
|
|
14
14
|
} catch (i) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const n=require("react/jsx-runtime"),c=require("react"),i=require("./server-component.js"),l=c.forwardRef(({story:e,...r},t)=>{if(!e)return console.error("Please provide a 'story' property to the StoryblokServerStory"),null;if(globalThis!=null&&globalThis.storyCache.has(e.uuid)&&(e=globalThis.storyCache.get(e.uuid),globalThis.storyCache.delete(e.uuid)),typeof e.content=="string")try{e.content=JSON.parse(e.content)}catch(o){console.error("An error occurred while trying to parse the story content",o),e.content={}}return n.jsx(i,{ref:t,blok:e.content,...r})});module.exports=l;
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
({ story: e, ...
|
|
6
|
-
var r;
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as l } from "react";
|
|
3
|
+
import c from "./server-component.mjs";
|
|
4
|
+
const p = l(
|
|
5
|
+
({ story: e, ...r }, o) => {
|
|
7
6
|
if (!e)
|
|
8
7
|
return console.error(
|
|
9
8
|
"Please provide a 'story' property to the StoryblokServerStory"
|
|
10
9
|
), null;
|
|
11
|
-
if (
|
|
10
|
+
if (globalThis != null && globalThis.storyCache.has(e.uuid) && (e = globalThis.storyCache.get(e.uuid), globalThis.storyCache.delete(e.uuid)), typeof e.content == "string")
|
|
12
11
|
try {
|
|
13
12
|
e.content = JSON.parse(e.content);
|
|
14
|
-
} catch (
|
|
13
|
+
} catch (t) {
|
|
15
14
|
console.error(
|
|
16
15
|
"An error occurred while trying to parse the story content",
|
|
17
|
-
|
|
16
|
+
t
|
|
18
17
|
), e.content = {};
|
|
19
18
|
}
|
|
20
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ n(c, { ref: o, blok: e.content, ...r });
|
|
21
20
|
}
|
|
22
21
|
);
|
|
23
22
|
export {
|
|
24
|
-
|
|
23
|
+
p as default
|
|
25
24
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyblok/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.4.
|
|
4
|
+
"version": "5.4.15",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "SDK to integrate Storyblok into your project using React.",
|
|
7
7
|
"author": "Storyblok",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@storyblok/js": "4.3.
|
|
52
|
+
"@storyblok/js": "4.3.2"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@babel/core": "^7.27.1",
|