diff --git a/dist/other/jupyterlite/JupyterLiteSession.d.ts b/dist/other/jupyterlite/JupyterLiteSession.d.ts index e4d8cba..19af4e0 100644 --- a/dist/other/jupyterlite/JupyterLiteSession.d.ts +++ b/dist/other/jupyterlite/JupyterLiteSession.d.ts @@ -1,3 +1,4 @@ +import { JupyterliteMessageSchema } from "@mat3ra/esse/lib/js/types"; import React from "react"; interface JupyterLiteSessionProps { originURL: string; @@ -9,7 +10,7 @@ declare class JupyterLiteSession extends React.Component; componentDidMount(): void; componentWillUnmount(): void; - receiveMessage: (event: MessageEvent) => void; + receiveMessage: (event: MessageEvent) => void; sendData: (data: Record[], variableName: string) => void; render(): React.JSX.Element; } diff --git a/dist/other/jupyterlite/JupyterLiteSession.js b/dist/other/jupyterlite/JupyterLiteSession.js index 5d7fb92..b122bfe 100644 --- a/dist/other/jupyterlite/JupyterLiteSession.js +++ b/dist/other/jupyterlite/JupyterLiteSession.js @@ -13,7 +13,10 @@ class JupyterLiteSession extends React.Component { } }; this.sendData = (data, variableName) => { - const message = { type: "from-host-to-iframe", data, variableName }; + const message = { + type: "from-host-to-iframe", + payload: { data, variableName }, + }; const iframe = document.getElementById(this.props.frameId); if (iframe && iframe.contentWindow) { iframe.contentWindow.postMessage(message, this.props.originURL); diff --git a/package-lock.json b/package-lock.json index c8ef738..2058992 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1926,8 +1926,8 @@ } }, "@mat3ra/esse": { - "version": "git+https://github.com/Exabyte-io/esse.git#56051891cc8d54a8f17ff16edacc75894450bb4c", - "from": "git+https://github.com/Exabyte-io/esse.git#56051891cc8d54a8f17ff16edacc75894450bb4c", + "version": "git+https://github.com/Exabyte-io/esse.git#bdf3516f2f7caef4567f1a4253925979273f69ed", + "from": "git+https://github.com/Exabyte-io/esse.git#bdf3516f2f7caef4567f1a4253925979273f69ed", "dev": true, "requires": { "@babel/cli": "7.16.0", diff --git a/package.json b/package.json index 64077e7..17c1c4c 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,7 @@ }, "devDependencies": { "@exabyte-io/code.js": "^2024.2.20-0", - "@mat3ra/esse": "https://github.com/Exabyte-io/esse.git#56051891cc8d54a8f17ff16edacc75894450bb4c", + "@mat3ra/esse": "https://github.com/Exabyte-io/esse.git#bdf3516f2f7caef4567f1a4253925979273f69ed", "@exabyte-io/eslint-config": "^2023.8.29-1", "@mui/icons-material": "^5.11.9", "@mui/lab": "^5.0.0-alpha.120", diff --git a/src/other/jupyterlite/JupyterLiteSession.tsx b/src/other/jupyterlite/JupyterLiteSession.tsx index 1cb676c..4d833c9 100644 --- a/src/other/jupyterlite/JupyterLiteSession.tsx +++ b/src/other/jupyterlite/JupyterLiteSession.tsx @@ -26,7 +26,7 @@ class JupyterLiteSession extends React.Component { if (event.origin !== new URL(this.props.originURL).origin) return; if (event.data) { if (event.data.type === "from-iframe-to-host") { - if (this.props.receiveData) this.props.receiveData(event.data.payload); + if (this.props.receiveData) this.props.receiveData(event.data); } } };