@arcblock/did-playground 2.13.70 → 3.0.0
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/lib/Action/actions.js +391 -500
- package/lib/Action/index.js +192 -261
- package/lib/Action/session.js +8 -17
- package/lib/index.js +8 -32
- package/package.json +13 -20
- package/src/Action/{index.js → index.jsx} +51 -24
- package/vite.config.mjs +29 -0
- /package/src/Action/{actions.js → actions.jsx} +0 -0
- /package/src/Action/{session.js → session.jsx} +0 -0
package/lib/Action/index.js
CHANGED
|
@@ -1,272 +1,203 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var _Button = _interopRequireDefault(require("@arcblock/ux/lib/Button"));
|
|
17
|
-
var _Util = require("@arcblock/ux/lib/Util");
|
|
18
|
-
var _session = require("./session");
|
|
19
|
-
var _actions = require("./actions");
|
|
20
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
const _excluded = ["autoClose", "action", "buttonText", "buttonColor", "buttonVariant", "buttonSize", "buttonRounded", "children", "disableClose", "title", "scanMessage", "successMessage", "successUrl", "successTarget", "frameProps", "confirmMessage", "extraParams", "timeout", "webWalletUrl"];
|
|
22
|
-
var _templateObject;
|
|
23
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
24
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
27
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
28
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
29
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
30
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
31
|
-
function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
|
|
32
|
-
function Close(_ref) {
|
|
33
|
-
let {
|
|
34
|
-
onClose
|
|
35
|
-
} = _ref;
|
|
36
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseContainer, {
|
|
37
|
-
onClick: onClose,
|
|
38
|
-
children: "\xD7"
|
|
39
|
-
});
|
|
1
|
+
import { jsx as n, jsxs as l, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { use as ne, useState as d, useEffect as ie } from "react";
|
|
3
|
+
import t from "prop-types";
|
|
4
|
+
import { useSize as ae } from "ahooks";
|
|
5
|
+
import ce from "@arcblock/react-hooks/lib/useBrowser";
|
|
6
|
+
import { styled as le, useTheme as ue } from "@arcblock/ux/lib/Theme";
|
|
7
|
+
import s from "lodash/isUndefined";
|
|
8
|
+
import { CircularProgress as fe, Dialog as me, DialogContent as de } from "@mui/material";
|
|
9
|
+
import ge from "@arcblock/did-connect/lib/Connect";
|
|
10
|
+
import R from "@arcblock/ux/lib/Button";
|
|
11
|
+
import { mergeProps as pe } from "@arcblock/ux/lib/Util";
|
|
12
|
+
import { SessionContext as be } from "./session.js";
|
|
13
|
+
import { getMessage as i, actions as q, getActionName as E, getActionParams as he } from "./actions.js";
|
|
14
|
+
function h({ onClose: u }) {
|
|
15
|
+
return /* @__PURE__ */ n(Ce, { onClick: u, children: "×" });
|
|
40
16
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
rounded: buttonRounded,
|
|
102
|
-
color: buttonColor,
|
|
103
|
-
variant: buttonVariant,
|
|
104
|
-
size: buttonSize,
|
|
105
|
-
onClick: () => session.login(),
|
|
106
|
-
children: (0, _actions.getMessage)(buttonText || title, session)
|
|
107
|
-
}));
|
|
108
|
-
}
|
|
109
|
-
const config = _actions.actions[action];
|
|
110
|
-
if (!_actions.actions[action]) {
|
|
111
|
-
throw new Error("Unsupported playground action ".concat(action));
|
|
112
|
-
}
|
|
113
|
-
const doStart = async () => {
|
|
114
|
-
if (typeof config.onStart === 'function') {
|
|
17
|
+
h.propTypes = { onClose: t.func.isRequired };
|
|
18
|
+
const Ce = le("div")`
|
|
19
|
+
display: ${(u) => u.disableClose ? "none" : "block"};
|
|
20
|
+
position: absolute;
|
|
21
|
+
top: 1rem;
|
|
22
|
+
right: 1rem;
|
|
23
|
+
color: #999999;
|
|
24
|
+
font-size: 2rem;
|
|
25
|
+
line-height: 1rem;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
user-select: none;
|
|
28
|
+
`;
|
|
29
|
+
function I(u) {
|
|
30
|
+
const e = Object.assign({}, u);
|
|
31
|
+
s(e.autoClose) && (e.autoClose = !0), s(e.buttonText) && (e.buttonText = ""), s(e.buttonColor) && (e.buttonColor = "primary"), s(e.buttonVariant) && (e.buttonVariant = "contained"), s(e.buttonSize) && (e.buttonSize = "large"), s(e.buttonRounded) && (e.buttonRounded = !1), s(e.scanMessage) && (e.scanMessage = "Scan the QR Code with your DID Wallet"), s(e.confirmMessage) && (e.confirmMessage = "Confirm in your DID Wallet"), s(e.successMessage) && (e.successMessage = "Operation success!"), s(e.extraParams) && (e.extraParams = {}), s(e.timeout) && (e.timeout = 5 * 60 * 1e3), s(e.successUrl) && (e.successUrl = ""), s(e.successTarget) && (e.successTarget = "_self"), s(e.frameProps) && (e.frameProps = {}), s(e.webWalletUrl) && (e.webWalletUrl = "");
|
|
32
|
+
const B = pe(e, I, ["buttonRounded", "extraParams", "timeout"]), {
|
|
33
|
+
autoClose: H,
|
|
34
|
+
action: g,
|
|
35
|
+
buttonText: U,
|
|
36
|
+
buttonColor: C,
|
|
37
|
+
buttonVariant: w,
|
|
38
|
+
buttonSize: y,
|
|
39
|
+
buttonRounded: P,
|
|
40
|
+
children: D,
|
|
41
|
+
disableClose: we,
|
|
42
|
+
title: S,
|
|
43
|
+
scanMessage: K,
|
|
44
|
+
successMessage: z,
|
|
45
|
+
successUrl: r,
|
|
46
|
+
successTarget: p,
|
|
47
|
+
frameProps: L,
|
|
48
|
+
confirmMessage: N,
|
|
49
|
+
extraParams: Q,
|
|
50
|
+
timeout: G,
|
|
51
|
+
webWalletUrl: J,
|
|
52
|
+
...a
|
|
53
|
+
} = B, W = ue(), j = ce(), { api: v, session: o } = ne(be), [x, T] = d(!1), [X, F] = d(!1), [Y, Z] = d({}), M = ae(document.body), [b, _] = d(!1), [c, A] = d(b && r && p === "frame"), ee = (M == null ? void 0 : M.width) || 0;
|
|
54
|
+
if (ie(
|
|
55
|
+
() => () => {
|
|
56
|
+
_(!1), A(!1);
|
|
57
|
+
},
|
|
58
|
+
[x]
|
|
59
|
+
), g === "login")
|
|
60
|
+
return o.user ? /* @__PURE__ */ n(R, { ...a, rounded: P, color: C, variant: w, size: y, children: i(z || `Hello ${o.user.name}`, o) }) : /* @__PURE__ */ n(
|
|
61
|
+
R,
|
|
62
|
+
{
|
|
63
|
+
...a,
|
|
64
|
+
rounded: P,
|
|
65
|
+
color: C,
|
|
66
|
+
variant: w,
|
|
67
|
+
size: y,
|
|
68
|
+
onClick: () => o.login(),
|
|
69
|
+
children: i(U || S, o)
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
const f = q[g];
|
|
73
|
+
if (!q[g])
|
|
74
|
+
throw new Error(`Unsupported playground action ${g}`);
|
|
75
|
+
const O = async () => {
|
|
76
|
+
if (typeof f.onStart == "function") {
|
|
115
77
|
try {
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
console.error("Cannot generate dynamicParams for playground action ".concat((0, _actions.getActionName)(config, rest)));
|
|
78
|
+
F(!0);
|
|
79
|
+
const $ = await f.onStart(v, o);
|
|
80
|
+
Z($), F(!1);
|
|
81
|
+
} catch {
|
|
82
|
+
console.error(`Cannot generate dynamicParams for playground action ${E(f, a)}`);
|
|
122
83
|
}
|
|
123
|
-
|
|
124
|
-
} else
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if (!session.user) {
|
|
130
|
-
session.login(doStart);
|
|
84
|
+
T(!0);
|
|
85
|
+
} else
|
|
86
|
+
T(!0);
|
|
87
|
+
}, te = async () => {
|
|
88
|
+
if (!o.user) {
|
|
89
|
+
o.login(O);
|
|
131
90
|
return;
|
|
132
91
|
}
|
|
133
|
-
await
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
92
|
+
await O();
|
|
93
|
+
}, m = () => T(!1), se = () => {
|
|
94
|
+
_(!0), r ? p === "frame" ? A(!!r) : p === "_blank" ? window.open(r, "_blank") : window.open(r, "_self") : D || H && setTimeout(m, 2e3);
|
|
95
|
+
}, oe = () => /* @__PURE__ */ l(k, { children: [
|
|
96
|
+
/* @__PURE__ */ n(h, { onClose: m }),
|
|
97
|
+
/* @__PURE__ */ l("div", { children: [
|
|
98
|
+
"Redirecting to",
|
|
99
|
+
" ",
|
|
100
|
+
/* @__PURE__ */ n("a", { href: r, target: p, children: r })
|
|
101
|
+
] })
|
|
102
|
+
] }), re = () => /* @__PURE__ */ l(k, { children: [
|
|
103
|
+
/* @__PURE__ */ n(h, { onClose: m }),
|
|
104
|
+
/* @__PURE__ */ n(
|
|
105
|
+
"iframe",
|
|
106
|
+
{
|
|
107
|
+
style: { width: "100%", height: "100%" },
|
|
108
|
+
allow: "fullscreen",
|
|
109
|
+
id: "successFrame",
|
|
110
|
+
title: "successFrame",
|
|
111
|
+
src: r,
|
|
112
|
+
...L
|
|
147
113
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
114
|
+
)
|
|
115
|
+
] }), V = !r || r && !b;
|
|
116
|
+
return /* @__PURE__ */ l(k, { children: [
|
|
117
|
+
/* @__PURE__ */ l(
|
|
118
|
+
R,
|
|
119
|
+
{
|
|
120
|
+
...a,
|
|
121
|
+
rounded: P,
|
|
122
|
+
color: C,
|
|
123
|
+
variant: w,
|
|
124
|
+
size: y,
|
|
125
|
+
onClick: te,
|
|
126
|
+
children: [
|
|
127
|
+
i(U || S, o),
|
|
128
|
+
" ",
|
|
129
|
+
X && /* @__PURE__ */ n(fe, { size: 12, sx: { color: "#fff" } })
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
x && !V && /* @__PURE__ */ n(
|
|
134
|
+
me,
|
|
135
|
+
{
|
|
136
|
+
open: !0,
|
|
137
|
+
disableEscapeKeyDown: !0,
|
|
138
|
+
fullScreen: ee < W.breakpoints.values.sm && !(j.wallet || j.arcSphere),
|
|
139
|
+
fullWidth: c,
|
|
140
|
+
maxWidth: c ? "lg" : "",
|
|
141
|
+
children: /* @__PURE__ */ l(
|
|
142
|
+
de,
|
|
143
|
+
{
|
|
144
|
+
style: {
|
|
145
|
+
padding: b && !c && r ? 55 : 0,
|
|
146
|
+
display: "flex",
|
|
147
|
+
justifyContent: "center",
|
|
148
|
+
alignItems: "center",
|
|
149
|
+
height: c ? W.breakpoints.values.md : ""
|
|
150
|
+
},
|
|
151
|
+
children: [
|
|
152
|
+
/* @__PURE__ */ n(h, { onClose: m }),
|
|
153
|
+
r && b && !c && oe(),
|
|
154
|
+
c && re()
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
/* @__PURE__ */ n(
|
|
161
|
+
ge,
|
|
162
|
+
{
|
|
163
|
+
popup: !0,
|
|
164
|
+
open: x && V,
|
|
165
|
+
action: E(f, a),
|
|
166
|
+
checkFn: v.get,
|
|
167
|
+
onClose: m,
|
|
168
|
+
onSuccess: se,
|
|
169
|
+
checkTimeout: G,
|
|
170
|
+
extraParams: Object.assign(he(f, a, o), Y, Q),
|
|
171
|
+
webWalletUrl: J,
|
|
172
|
+
messages: {
|
|
173
|
+
title: i(S, o),
|
|
174
|
+
scan: i(K, o),
|
|
175
|
+
confirm: i(N, o),
|
|
176
|
+
success: D || i(z, o)
|
|
191
177
|
}
|
|
192
|
-
})]
|
|
193
|
-
})), open && !showDidConnect && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.default, {
|
|
194
|
-
open: true,
|
|
195
|
-
disableEscapeKeyDown: true,
|
|
196
|
-
fullScreen: width < theme.breakpoints.values.sm && !(browser.wallet || browser.arcSphere),
|
|
197
|
-
fullWidth: showFrame,
|
|
198
|
-
maxWidth: showFrame ? 'lg' : '',
|
|
199
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_DialogContent.default, {
|
|
200
|
-
style: {
|
|
201
|
-
padding: success && !showFrame && successUrl ? 55 : 0,
|
|
202
|
-
display: 'flex',
|
|
203
|
-
justifyContent: 'center',
|
|
204
|
-
alignItems: 'center',
|
|
205
|
-
height: showFrame ? theme.breakpoints.values.md : ''
|
|
206
|
-
},
|
|
207
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Close, {
|
|
208
|
-
onClose: onClose
|
|
209
|
-
}), successUrl && success && !showFrame && renderRedirectUrlAfterSuccess(), showFrame && renderFrameAfterSuccess()]
|
|
210
|
-
})
|
|
211
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Connect.default, {
|
|
212
|
-
popup: true,
|
|
213
|
-
open: open && showDidConnect,
|
|
214
|
-
action: (0, _actions.getActionName)(config, rest),
|
|
215
|
-
checkFn: api.get,
|
|
216
|
-
onClose: onClose,
|
|
217
|
-
onSuccess: onSuccess,
|
|
218
|
-
checkTimeout: timeout
|
|
219
|
-
// 3 layers of extraParams: user props, dynamically generated, from other props
|
|
220
|
-
,
|
|
221
|
-
extraParams: Object.assign((0, _actions.getActionParams)(config, rest, session), dynamicParams, extraParams),
|
|
222
|
-
webWalletUrl: webWalletUrl,
|
|
223
|
-
messages: {
|
|
224
|
-
title: (0, _actions.getMessage)(title, session),
|
|
225
|
-
scan: (0, _actions.getMessage)(scanMessage, session),
|
|
226
|
-
confirm: (0, _actions.getMessage)(confirmMessage, session),
|
|
227
|
-
success: children || (0, _actions.getMessage)(successMessage, session)
|
|
228
178
|
}
|
|
229
|
-
|
|
230
|
-
});
|
|
179
|
+
)
|
|
180
|
+
] });
|
|
231
181
|
}
|
|
232
|
-
|
|
233
|
-
action:
|
|
234
|
-
autoClose:
|
|
235
|
-
buttonText:
|
|
236
|
-
buttonColor:
|
|
237
|
-
buttonVariant:
|
|
238
|
-
buttonSize:
|
|
239
|
-
buttonRounded:
|
|
240
|
-
title:
|
|
241
|
-
scanMessage:
|
|
242
|
-
successMessage:
|
|
243
|
-
confirmMessage:
|
|
244
|
-
extraParams:
|
|
245
|
-
timeout:
|
|
246
|
-
successUrl:
|
|
247
|
-
successTarget:
|
|
248
|
-
frameProps:
|
|
249
|
-
webWalletUrl:
|
|
182
|
+
I.propTypes = {
|
|
183
|
+
action: t.string.isRequired,
|
|
184
|
+
autoClose: t.bool,
|
|
185
|
+
buttonText: t.string,
|
|
186
|
+
buttonColor: t.string,
|
|
187
|
+
buttonVariant: t.string,
|
|
188
|
+
buttonSize: t.string,
|
|
189
|
+
buttonRounded: t.bool,
|
|
190
|
+
title: t.string.isRequired,
|
|
191
|
+
scanMessage: t.string,
|
|
192
|
+
successMessage: t.string,
|
|
193
|
+
confirmMessage: t.string,
|
|
194
|
+
extraParams: t.object,
|
|
195
|
+
timeout: t.number,
|
|
196
|
+
successUrl: t.string,
|
|
197
|
+
successTarget: t.oneOf(["_blank", "_self", "frame"]),
|
|
198
|
+
frameProps: t.object,
|
|
199
|
+
webWalletUrl: t.string
|
|
250
200
|
};
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
// 只在没有 successUrl 属性下有效
|
|
254
|
-
buttonText: '',
|
|
255
|
-
buttonColor: 'primary',
|
|
256
|
-
// primary | secondary | reverse | error
|
|
257
|
-
buttonVariant: 'contained',
|
|
258
|
-
// contained | outlined | default
|
|
259
|
-
buttonSize: 'large',
|
|
260
|
-
// small | large | medium
|
|
261
|
-
buttonRounded: false,
|
|
262
|
-
scanMessage: 'Scan the QR Code with your DID Wallet',
|
|
263
|
-
confirmMessage: 'Confirm in your DID Wallet',
|
|
264
|
-
successMessage: 'Operation success!',
|
|
265
|
-
extraParams: {},
|
|
266
|
-
timeout: 5 * 60 * 1000,
|
|
267
|
-
successUrl: '',
|
|
268
|
-
successTarget: '_self',
|
|
269
|
-
frameProps: {},
|
|
270
|
-
webWalletUrl: ''
|
|
201
|
+
export {
|
|
202
|
+
I as default
|
|
271
203
|
};
|
|
272
|
-
var _default = exports.default = PlaygroundAction;
|
package/lib/Action/session.js
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
SessionProvider,
|
|
10
|
-
SessionContext,
|
|
11
|
-
SessionConsumer,
|
|
12
|
-
withSession
|
|
13
|
-
} = (0, _Session.createAuthServiceSessionContext)();
|
|
14
|
-
exports.withSession = withSession;
|
|
15
|
-
exports.SessionConsumer = SessionConsumer;
|
|
16
|
-
exports.SessionContext = SessionContext;
|
|
17
|
-
exports.SessionProvider = SessionProvider;
|
|
1
|
+
import { createAuthServiceSessionContext as e } from "@arcblock/did-connect/lib/Session";
|
|
2
|
+
const { SessionProvider: s, SessionContext: t, SessionConsumer: i, withSession: n } = e();
|
|
3
|
+
export {
|
|
4
|
+
i as SessionConsumer,
|
|
5
|
+
t as SessionContext,
|
|
6
|
+
s as SessionProvider,
|
|
7
|
+
n as withSession
|
|
8
|
+
};
|
package/lib/index.js
CHANGED
|
@@ -1,32 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return _Action.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "SessionConsumer", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function get() {
|
|
15
|
-
return _session.SessionConsumer;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(exports, "SessionContext", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _session.SessionContext;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "SessionProvider", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _session.SessionProvider;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
var _Action = _interopRequireDefault(require("./Action"));
|
|
31
|
-
var _session = require("./Action/session");
|
|
32
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
1
|
+
import { default as r } from "./Action/index.js";
|
|
2
|
+
import { SessionConsumer as n, SessionContext as t, SessionProvider as i } from "./Action/session.js";
|
|
3
|
+
export {
|
|
4
|
+
r as PlaygroundAction,
|
|
5
|
+
n as SessionConsumer,
|
|
6
|
+
t as SessionContext,
|
|
7
|
+
i as SessionProvider
|
|
8
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcblock/did-playground",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "React components that works with wallet-playground",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"lint": "eslint src tests --ext js --ext jsx",
|
|
20
20
|
"lint:fix": "npm run lint -- --fix",
|
|
21
|
-
"build": "
|
|
22
|
-
"watch": "
|
|
21
|
+
"build": "vite build",
|
|
22
|
+
"watch": "vite build --watch",
|
|
23
23
|
"precommit": "CI=1 npm run lint",
|
|
24
24
|
"prepush": "CI=1 npm run lint",
|
|
25
25
|
"prepublish": "npm run build",
|
|
@@ -30,28 +30,21 @@
|
|
|
30
30
|
"url": "https://github.com/ArcBlock/wallet-playground/issues"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@arcblock/did-connect": "
|
|
34
|
-
"@arcblock/react-hooks": "
|
|
35
|
-
"ahooks": "^3.
|
|
36
|
-
"axios": "^1.
|
|
37
|
-
"core-js": "^3.25.5",
|
|
33
|
+
"@arcblock/did-connect": "3.0.0",
|
|
34
|
+
"@arcblock/react-hooks": "3.0.0",
|
|
35
|
+
"ahooks": "^3.8.5",
|
|
36
|
+
"axios": "^1.10.0",
|
|
38
37
|
"mustache": "^4.2.0"
|
|
39
38
|
},
|
|
40
39
|
"peerDependencies": {
|
|
41
|
-
"@arcblock/ux": "
|
|
42
|
-
"@emotion/react": "^11.
|
|
43
|
-
"@emotion/styled": "^11.
|
|
44
|
-
"@mui/material": "^
|
|
45
|
-
"react": "^
|
|
46
|
-
},
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"@babel/cli": "^7.19.3",
|
|
49
|
-
"@babel/core": "^7.19.3",
|
|
50
|
-
"@babel/preset-env": "^7.19.3",
|
|
51
|
-
"@babel/preset-react": "^7.18.6"
|
|
40
|
+
"@arcblock/ux": "workspace:*",
|
|
41
|
+
"@emotion/react": "^11.14.0",
|
|
42
|
+
"@emotion/styled": "^11.14.0",
|
|
43
|
+
"@mui/material": "^7.1.2",
|
|
44
|
+
"react": "^19.0.0"
|
|
52
45
|
},
|
|
53
46
|
"publishConfig": {
|
|
54
47
|
"access": "public"
|
|
55
48
|
},
|
|
56
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "b001c32ca85d40d8a0784ca581bfd54d90550b24"
|
|
57
50
|
}
|