@storyblok/react 3.0.0 → 3.0.2
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/client.js +1 -1
- package/dist/client.mjs +11 -15
- package/package.json +2 -2
package/dist/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),b=require("./storyblok-js.js"),f=(e=null,u={})=>{const[r,s]=o.useState(e),t=(e==null?void 0:e.internalId)??(e==null?void 0:e.id)??0,d=typeof window<"u"&&typeof window.storyblokRegisterEvent<"u";return o.useEffect(()=>{s(e),!(!d||!e)&&b.registerStoryblokBridge(t,c=>s(c),u)},[e,d]),r};exports.useStoryblokState=f;
|
package/dist/client.mjs
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { registerStoryblokBridge as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
o(e), g(
|
|
11
|
-
n,
|
|
12
|
-
(d) => o(d),
|
|
13
|
-
s
|
|
1
|
+
import { useState as c, useEffect as g } from "react";
|
|
2
|
+
import { registerStoryblokBridge as p } from "./storyblok-js.mjs";
|
|
3
|
+
const n = (e = null, f = {}) => {
|
|
4
|
+
const [o, s] = c(e), r = (e == null ? void 0 : e.internalId) ?? (e == null ? void 0 : e.id) ?? 0, d = typeof window < "u" && typeof window.storyblokRegisterEvent < "u";
|
|
5
|
+
return g(() => {
|
|
6
|
+
s(e), !(!d || !e) && p(
|
|
7
|
+
r,
|
|
8
|
+
(u) => s(u),
|
|
9
|
+
f
|
|
14
10
|
);
|
|
15
|
-
}, [e,
|
|
11
|
+
}, [e, d]), o;
|
|
16
12
|
};
|
|
17
13
|
export {
|
|
18
|
-
|
|
14
|
+
n as useStoryblokState
|
|
19
15
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyblok/react",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "SDK to integrate Storyblok into your project using React.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react-dom": "^18.2.0",
|
|
64
64
|
"rollup-plugin-preserve-directives": "^0.2.0",
|
|
65
65
|
"start-server-and-test": "^2.0.3",
|
|
66
|
-
"vite": "^5.0.
|
|
66
|
+
"vite": "^5.0.10"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"react": "^17.0.0 || ^18.0.0",
|