@getpara/wagmi-v2-integration 2.0.0-dev.6 → 2.0.0-dev.7
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/connectorModal.d.ts +2 -1
- package/dist/index.js +12 -14
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/paraConnector.d.ts +3 -1
- package/package.json +2 -1
package/dist/connectorModal.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import ParaWeb from '@getpara/react-sdk';
|
|
2
2
|
import { ParaModalPropsForInit } from './paraConnector.js';
|
|
3
|
-
|
|
3
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
4
|
+
export declare function renderModal(para: ParaWeb, modalProps: Partial<ParaModalPropsForInit>, onCloseArg: () => void, queryClient: QueryClient): void;
|
package/dist/index.js
CHANGED
|
@@ -57,10 +57,10 @@ import { createParaConnector } from "@getpara/wagmi-v2-connector";
|
|
|
57
57
|
|
|
58
58
|
// src/connectorModal.tsx
|
|
59
59
|
import { ParaProvider, setIsOpen } from "@getpara/react-sdk";
|
|
60
|
+
import { QueryClientProvider } from "@tanstack/react-query";
|
|
60
61
|
import { jsx } from "react/jsx-runtime";
|
|
61
|
-
var Portal;
|
|
62
62
|
var Root;
|
|
63
|
-
function renderModal(para, modalProps, onCloseArg) {
|
|
63
|
+
function renderModal(para, modalProps, onCloseArg, queryClient) {
|
|
64
64
|
const existingContainer = document.getElementById("para-modal");
|
|
65
65
|
const container = existingContainer != null ? existingContainer : document.createElement("div");
|
|
66
66
|
container.id = "para-modal";
|
|
@@ -77,24 +77,20 @@ function renderModal(para, modalProps, onCloseArg) {
|
|
|
77
77
|
if (typeof document === "undefined") {
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
const Modal = /* @__PURE__ */ jsx(
|
|
80
|
+
const Modal = /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(
|
|
81
81
|
ParaProvider,
|
|
82
82
|
{
|
|
83
83
|
paraClientConfig: para,
|
|
84
84
|
config: { appName: (_a = modalProps.appName) != null ? _a : "" },
|
|
85
85
|
paraModalConfig: __spreadProps(__spreadValues({}, modalProps), { onClose })
|
|
86
86
|
}
|
|
87
|
-
);
|
|
87
|
+
) });
|
|
88
88
|
try {
|
|
89
|
-
const
|
|
90
|
-
const { createRoot } = yield import("react-dom/client");
|
|
91
|
-
if (!Portal) {
|
|
92
|
-
Portal = createPortal(Modal, container);
|
|
93
|
-
}
|
|
89
|
+
const client = yield import("react-dom/client");
|
|
94
90
|
if (!Root) {
|
|
95
|
-
Root = createRoot(
|
|
91
|
+
Root = client.createRoot(container);
|
|
96
92
|
}
|
|
97
|
-
Root.render(
|
|
93
|
+
Root.render(Modal);
|
|
98
94
|
} catch (e) {
|
|
99
95
|
const ReactDOM = yield import("react-dom");
|
|
100
96
|
ReactDOM.render(Modal, container);
|
|
@@ -115,7 +111,8 @@ var paraConnector = (_a) => {
|
|
|
115
111
|
nameOverride,
|
|
116
112
|
idOverride,
|
|
117
113
|
transports,
|
|
118
|
-
appName
|
|
114
|
+
appName,
|
|
115
|
+
queryClient
|
|
119
116
|
} = _b, modalProps = __objRest(_b, [
|
|
120
117
|
"para",
|
|
121
118
|
"chains",
|
|
@@ -126,7 +123,8 @@ var paraConnector = (_a) => {
|
|
|
126
123
|
"nameOverride",
|
|
127
124
|
"idOverride",
|
|
128
125
|
"transports",
|
|
129
|
-
"appName"
|
|
126
|
+
"appName",
|
|
127
|
+
"queryClient"
|
|
130
128
|
]);
|
|
131
129
|
return createParaConnector({
|
|
132
130
|
para,
|
|
@@ -139,7 +137,7 @@ var paraConnector = (_a) => {
|
|
|
139
137
|
idOverride,
|
|
140
138
|
transports,
|
|
141
139
|
appName,
|
|
142
|
-
renderModal: (onClose) => renderModal(para, __spreadProps(__spreadValues({}, modalProps), { appName }), onClose),
|
|
140
|
+
renderModal: (onClose) => renderModal(para, __spreadProps(__spreadValues({}, modalProps), { appName }), onClose, queryClient),
|
|
143
141
|
openModal: () => {
|
|
144
142
|
setIsOpen2(true);
|
|
145
143
|
}
|
package/dist/index.js.br
CHANGED
|
Binary file
|
package/dist/index.js.gz
CHANGED
|
Binary file
|
package/dist/paraConnector.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ParaModalProps } from '@getpara/react-sdk';
|
|
2
2
|
import { ParaConnectorOpts as ParaConnectorOptsBase } from '@getpara/wagmi-v2-connector';
|
|
3
|
+
import { QueryClient } from '@tanstack/react-query';
|
|
3
4
|
export type ParaModalPropsForInit = Omit<ParaModalProps, 'isOpen' | 'para'> & {
|
|
4
5
|
appName: string;
|
|
6
|
+
queryClient: QueryClient;
|
|
5
7
|
};
|
|
6
8
|
type ParaConnectorOpts = Partial<ParaModalPropsForInit> & ParaConnectorOptsBase;
|
|
7
|
-
export declare const paraConnector: ({ para, chains: _chains, disableModal, storageOverride, options, iconOverride, nameOverride, idOverride, transports, appName, ...modalProps }: ParaConnectorOpts) => import("wagmi").CreateConnectorFn<unknown, {
|
|
9
|
+
export declare const paraConnector: ({ para, chains: _chains, disableModal, storageOverride, options, iconOverride, nameOverride, idOverride, transports, appName, queryClient, ...modalProps }: ParaConnectorOpts) => import("wagmi").CreateConnectorFn<unknown, {
|
|
8
10
|
type: string;
|
|
9
11
|
name: string;
|
|
10
12
|
icon: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/wagmi-v2-integration",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"typescript": "5.1.6"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
+
"@tanstack/react-query": "^5.0.0",
|
|
20
21
|
"react": "*",
|
|
21
22
|
"react-dom": "*"
|
|
22
23
|
},
|