@stackable-labs/sdk-extension-react 1.68.1 → 1.69.1
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/index.d.ts +1 -1
- package/dist/index.js +10 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -530,7 +530,7 @@ declare namespace ui {
|
|
|
530
530
|
}
|
|
531
531
|
|
|
532
532
|
/**
|
|
533
|
-
* useContextData — reads host context on mount and
|
|
533
|
+
* useContextData — reads host context on mount and subscribes to host-pushed updates.
|
|
534
534
|
*/
|
|
535
535
|
|
|
536
536
|
type UseContextDataResult = ContextData & {
|
package/dist/index.js
CHANGED
|
@@ -493,6 +493,16 @@ var useContextData = () => {
|
|
|
493
493
|
};
|
|
494
494
|
loadContext();
|
|
495
495
|
}, []);
|
|
496
|
+
useEffect(() => {
|
|
497
|
+
const handleContextPush = (event) => {
|
|
498
|
+
const msg = event.data;
|
|
499
|
+
if (msg?.type === "context-push" && msg.context) {
|
|
500
|
+
setContextData(msg.context);
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
window.addEventListener("message", handleContextPush);
|
|
504
|
+
return () => window.removeEventListener("message", handleContextPush);
|
|
505
|
+
}, []);
|
|
496
506
|
return { ...contextData, loading };
|
|
497
507
|
};
|
|
498
508
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackable-labs/sdk-extension-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.69.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@agnostack/verifyd": "alpha",
|
|
16
16
|
"@remote-dom/core": "1.x",
|
|
17
17
|
"@remote-dom/react": "1.x",
|
|
18
|
-
"@stackable-labs/sdk-extension-contracts": "1.
|
|
18
|
+
"@stackable-labs/sdk-extension-contracts": "1.69.1"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": ">=18.0.0 <19.0.0",
|