@getpara/wagmi-v2-integration 2.0.0-dev.2 → 2.0.0-dev.4
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.js +8 -12
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -58,14 +58,8 @@ import { createParaConnector } from "@getpara/wagmi-v2-connector";
|
|
|
58
58
|
// src/connectorModal.tsx
|
|
59
59
|
import { ParaProvider, setIsOpen } from "@getpara/react-sdk";
|
|
60
60
|
import { jsx } from "react/jsx-runtime";
|
|
61
|
-
var
|
|
61
|
+
var Portal;
|
|
62
62
|
function renderModal(para, modalProps, onCloseArg) {
|
|
63
|
-
const existingContainer = document.getElementById("para-modal");
|
|
64
|
-
const container = existingContainer != null ? existingContainer : document.createElement("div");
|
|
65
|
-
container.id = "para-modal";
|
|
66
|
-
if (!existingContainer) {
|
|
67
|
-
document.body.appendChild(container);
|
|
68
|
-
}
|
|
69
63
|
const onClose = () => {
|
|
70
64
|
onCloseArg();
|
|
71
65
|
modalProps.onClose && modalProps.onClose();
|
|
@@ -73,6 +67,9 @@ function renderModal(para, modalProps, onCloseArg) {
|
|
|
73
67
|
};
|
|
74
68
|
const render = () => __async(this, null, function* () {
|
|
75
69
|
var _a;
|
|
70
|
+
if (typeof document === "undefined") {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
76
73
|
const Modal = /* @__PURE__ */ jsx(
|
|
77
74
|
ParaProvider,
|
|
78
75
|
{
|
|
@@ -82,14 +79,13 @@ function renderModal(para, modalProps, onCloseArg) {
|
|
|
82
79
|
}
|
|
83
80
|
);
|
|
84
81
|
try {
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
87
|
-
|
|
82
|
+
const { createPortal } = yield import("react-dom");
|
|
83
|
+
if (!Portal) {
|
|
84
|
+
Portal = createPortal(Modal, document.body);
|
|
88
85
|
}
|
|
89
|
-
Root.render(Modal);
|
|
90
86
|
} catch (e) {
|
|
91
87
|
const ReactDOM = yield import("react-dom");
|
|
92
|
-
ReactDOM.
|
|
88
|
+
ReactDOM.createPortal(Modal, document.body);
|
|
93
89
|
}
|
|
94
90
|
});
|
|
95
91
|
render();
|
package/dist/index.js.br
CHANGED
|
Binary file
|
package/dist/index.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/wagmi-v2-integration",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@getpara/react-sdk": "2.0.0-dev.1",
|
|
10
|
-
"@getpara/wagmi-v2-connector": "2.0.0-dev.
|
|
10
|
+
"@getpara/wagmi-v2-connector": "2.0.0-dev.2"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "rm -rf dist && yarn typegen && node ./scripts/build.mjs",
|