@xyo-network/react-wallet 2.64.0 → 2.64.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.
Files changed (94) hide show
  1. package/dist/browser/components/MaxAccounts/MaxAccountsTableRow.js +41 -11
  2. package/dist/browser/components/MaxAccounts/MaxAccountsTableRow.js.map +1 -1
  3. package/dist/browser/components/MaxAccounts/OutOfBoundsSnackBar.js +3 -2
  4. package/dist/browser/components/MaxAccounts/OutOfBoundsSnackBar.js.map +1 -1
  5. package/dist/browser/components/MaxAccounts/index.js +88 -1
  6. package/dist/browser/components/MaxAccounts/index.js.map +1 -1
  7. package/dist/browser/components/SeedPhrase/DefaultSeedPhrase.js +3 -2
  8. package/dist/browser/components/SeedPhrase/DefaultSeedPhrase.js.map +1 -1
  9. package/dist/browser/components/SeedPhrase/_shared/SeedPhraseIconButton.js +3 -2
  10. package/dist/browser/components/SeedPhrase/_shared/SeedPhraseIconButton.js.map +1 -1
  11. package/dist/browser/components/SeedPhrase/_shared/index.js +45 -1
  12. package/dist/browser/components/SeedPhrase/_shared/index.js.map +1 -1
  13. package/dist/browser/components/SeedPhrase/dialog/SeedPhraseDialog.js +295 -16
  14. package/dist/browser/components/SeedPhrase/dialog/SeedPhraseDialog.js.map +1 -1
  15. package/dist/browser/components/SeedPhrase/dialog/components/DialogActionButtons.js +13 -3
  16. package/dist/browser/components/SeedPhrase/dialog/components/DialogActionButtons.js.map +1 -1
  17. package/dist/browser/components/SeedPhrase/dialog/components/OverwriteWarning.js +13 -3
  18. package/dist/browser/components/SeedPhrase/dialog/components/OverwriteWarning.js.map +1 -1
  19. package/dist/browser/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.js +74 -12
  20. package/dist/browser/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.js.map +1 -1
  21. package/dist/browser/components/SeedPhrase/dialog/components/fields/SavedPhraseTextField.js +60 -10
  22. package/dist/browser/components/SeedPhrase/dialog/components/fields/SavedPhraseTextField.js.map +1 -1
  23. package/dist/browser/components/SeedPhrase/dialog/components/fields/index.js +125 -2
  24. package/dist/browser/components/SeedPhrase/dialog/components/fields/index.js.map +1 -1
  25. package/dist/browser/components/SeedPhrase/dialog/components/fields/validation-messages/InvalidPhrase.js +3 -2
  26. package/dist/browser/components/SeedPhrase/dialog/components/fields/validation-messages/InvalidPhrase.js.map +1 -1
  27. package/dist/browser/components/SeedPhrase/dialog/components/fields/validation-messages/PhraseHeaderBox.js +3 -2
  28. package/dist/browser/components/SeedPhrase/dialog/components/fields/validation-messages/PhraseHeaderBox.js.map +1 -1
  29. package/dist/browser/components/SeedPhrase/dialog/components/fields/validation-messages/colorParser.js +2 -1
  30. package/dist/browser/components/SeedPhrase/dialog/components/fields/validation-messages/colorParser.js.map +1 -1
  31. package/dist/browser/components/SeedPhrase/dialog/components/fields/validation-messages/index.js +57 -3
  32. package/dist/browser/components/SeedPhrase/dialog/components/fields/validation-messages/index.js.map +1 -1
  33. package/dist/browser/components/SeedPhrase/dialog/components/index.js +164 -3
  34. package/dist/browser/components/SeedPhrase/dialog/components/index.js.map +1 -1
  35. package/dist/browser/components/SeedPhrase/dialog/index.js +315 -1
  36. package/dist/browser/components/SeedPhrase/dialog/index.js.map +1 -1
  37. package/dist/browser/components/SeedPhrase/index.js +373 -4
  38. package/dist/browser/components/SeedPhrase/index.js.map +1 -1
  39. package/dist/browser/components/SeedPhrase/settings/SeedPhraseTableRow.js +325 -12
  40. package/dist/browser/components/SeedPhrase/settings/SeedPhraseTableRow.js.map +1 -1
  41. package/dist/browser/components/SeedPhrase/settings/index.js +339 -1
  42. package/dist/browser/components/SeedPhrase/settings/index.js.map +1 -1
  43. package/dist/browser/components/WalletAccountDetails/WalletAccountDetails.js +62 -3
  44. package/dist/browser/components/WalletAccountDetails/WalletAccountDetails.js.map +1 -1
  45. package/dist/browser/components/WalletAccountDetails/index.js +83 -1
  46. package/dist/browser/components/WalletAccountDetails/index.js.map +1 -1
  47. package/dist/browser/components/WalletAccountSelect/Select.js +70 -5
  48. package/dist/browser/components/WalletAccountSelect/Select.js.map +1 -1
  49. package/dist/browser/components/WalletAccountSelect/SelectBar.js +150 -4
  50. package/dist/browser/components/WalletAccountSelect/SelectBar.js.map +1 -1
  51. package/dist/browser/components/WalletAccountSelect/WalletInfo.js +116 -10
  52. package/dist/browser/components/WalletAccountSelect/WalletInfo.js.map +1 -1
  53. package/dist/browser/components/WalletAccountSelect/index.js +175 -2
  54. package/dist/browser/components/WalletAccountSelect/index.js.map +1 -1
  55. package/dist/browser/components/index.js +694 -4
  56. package/dist/browser/components/index.js.map +1 -1
  57. package/dist/browser/contexts/SeedPhrase/Context.js +2 -1
  58. package/dist/browser/contexts/SeedPhrase/Context.js.map +1 -1
  59. package/dist/browser/contexts/SeedPhrase/Provider.js +9 -3
  60. package/dist/browser/contexts/SeedPhrase/Provider.js.map +1 -1
  61. package/dist/browser/contexts/SeedPhrase/index.js +91 -4
  62. package/dist/browser/contexts/SeedPhrase/index.js.map +1 -1
  63. package/dist/browser/contexts/SeedPhrase/use.js +8 -2
  64. package/dist/browser/contexts/SeedPhrase/use.js.map +1 -1
  65. package/dist/browser/contexts/Wallet/Context.js +2 -1
  66. package/dist/browser/contexts/Wallet/Context.js.map +1 -1
  67. package/dist/browser/contexts/Wallet/Provider.js +90 -7
  68. package/dist/browser/contexts/Wallet/Provider.js.map +1 -1
  69. package/dist/browser/contexts/Wallet/index.js +183 -5
  70. package/dist/browser/contexts/Wallet/index.js.map +1 -1
  71. package/dist/browser/contexts/Wallet/lib/WalletPath.js +4 -3
  72. package/dist/browser/contexts/Wallet/lib/WalletPath.js.map +1 -1
  73. package/dist/browser/contexts/Wallet/lib/index.js +21 -1
  74. package/dist/browser/contexts/Wallet/lib/index.js.map +1 -1
  75. package/dist/browser/contexts/Wallet/use.js +13 -7
  76. package/dist/browser/contexts/Wallet/use.js.map +1 -1
  77. package/dist/browser/contexts/Wallet/usePromise.js +2 -1
  78. package/dist/browser/contexts/Wallet/usePromise.js.map +1 -1
  79. package/dist/browser/contexts/index.js +273 -2
  80. package/dist/browser/contexts/index.js.map +1 -1
  81. package/dist/browser/hooks/index.js +147 -4
  82. package/dist/browser/hooks/index.js.map +1 -1
  83. package/dist/browser/hooks/useAccount.js +24 -4
  84. package/dist/browser/hooks/useAccount.js.map +1 -1
  85. package/dist/browser/hooks/useWallet.js +38 -4
  86. package/dist/browser/hooks/useWallet.js.map +1 -1
  87. package/dist/browser/hooks/useWallets.js +69 -4
  88. package/dist/browser/hooks/useWallets.js.map +1 -1
  89. package/dist/browser/hooks/useWrapperAccount.js +4 -3
  90. package/dist/browser/hooks/useWrapperAccount.js.map +1 -1
  91. package/dist/browser/index.js +890 -3
  92. package/dist/browser/index.js.map +1 -1
  93. package/dist/docs.json +147 -147
  94. package/package.json +22 -22
@@ -1,5 +1,374 @@
1
- export * from "./_shared";
2
- export * from "./DefaultSeedPhrase";
3
- export * from "./dialog";
4
- export * from "./settings";
1
+ // src/components/SeedPhrase/_shared/SeedPhraseIconButton.tsx
2
+ import { HelpOutline as HelpOutlineIcon } from "@mui/icons-material";
3
+ import {
4
+ Button,
5
+ Dialog,
6
+ DialogActions,
7
+ DialogContent,
8
+ DialogTitle,
9
+ IconButton,
10
+ Link,
11
+ List,
12
+ ListItem,
13
+ Typography
14
+ } from "@mui/material";
15
+ import { useState } from "react";
16
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
17
+ var SeedPhraseIconButton = (props) => {
18
+ const [open, setOpen] = useState(false);
19
+ const onClose = () => setOpen(false);
20
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
21
+ /* @__PURE__ */ jsx(IconButton, { onClick: () => setOpen(true), ...props, children: /* @__PURE__ */ jsx(HelpOutlineIcon, { fontSize: "small" }) }),
22
+ /* @__PURE__ */ jsxs(Dialog, { open, children: [
23
+ /* @__PURE__ */ jsx(DialogTitle, { children: "Understanding your Seed Phrase" }),
24
+ /* @__PURE__ */ jsxs(DialogContent, { children: [
25
+ /* @__PURE__ */ jsxs(Typography, { children: [
26
+ "Your Seed Phrase should adhere to the",
27
+ " ",
28
+ /* @__PURE__ */ jsx(Link, { target: "_blank", href: "https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki", children: "bip39 specification" }),
29
+ " ",
30
+ "and is used to generate accounts which identify your data on the XYO Network."
31
+ ] }),
32
+ /* @__PURE__ */ jsxs(List, { children: [
33
+ /* @__PURE__ */ jsx(ListItem, { children: "Do not share this phrase with anyone." }),
34
+ /* @__PURE__ */ jsx(ListItem, { children: "Do not save it to a public computer." }),
35
+ /* @__PURE__ */ jsx(ListItem, { children: "Do not use a existing phrase from another wallet (i.e. Metamask)." }),
36
+ /* @__PURE__ */ jsx(ListItem, { children: "Do not use before copying it down somewhere safe." })
37
+ ] })
38
+ ] }),
39
+ /* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(Button, { onClick: onClose, variant: "outlined", children: "OK" }) })
40
+ ] })
41
+ ] });
42
+ };
43
+
44
+ // src/components/SeedPhrase/DefaultSeedPhrase.tsx
45
+ import { Alert, AlertTitle, Snackbar } from "@mui/material";
46
+ import { generateMnemonic, wordlists } from "@xyo-network/bip39";
47
+ import { useEffect, useState as useState2 } from "react";
48
+ import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
49
+ var DefaultSeedPhrase = ({ changeSeedPhrase, children, hideDefaultSeedPhraseMessage, seedPhrase }) => {
50
+ const [showSnackBar, setShowSnackBar] = useState2(false);
51
+ useEffect(() => {
52
+ if (!seedPhrase) {
53
+ const mnemonic = generateMnemonic(wordlists.english, 256);
54
+ changeSeedPhrase?.(mnemonic);
55
+ setShowSnackBar(true);
56
+ }
57
+ }, [changeSeedPhrase, seedPhrase]);
58
+ return /* @__PURE__ */ jsxs2(Fragment2, { children: [
59
+ hideDefaultSeedPhraseMessage ? null : /* @__PURE__ */ jsx2(
60
+ Snackbar,
61
+ {
62
+ open: showSnackBar,
63
+ autoHideDuration: 5e3,
64
+ onClose: () => setShowSnackBar(false),
65
+ anchorOrigin: { horizontal: "center", vertical: "top" },
66
+ children: /* @__PURE__ */ jsxs2(Alert, { severity: "success", children: [
67
+ /* @__PURE__ */ jsx2(AlertTitle, { children: "Default Seed Phrase Generated" }),
68
+ "Go to application settings to save it."
69
+ ] })
70
+ }
71
+ ),
72
+ children
73
+ ] });
74
+ };
75
+
76
+ // src/components/SeedPhrase/dialog/SeedPhraseDialog.tsx
77
+ import { Dialog as Dialog2, DialogContent as DialogContent2, DialogTitle as DialogTitle2 } from "@mui/material";
78
+
79
+ // src/contexts/SeedPhrase/Context.ts
80
+ import { createContextEx } from "@xyo-network/react-shared";
81
+ var SeedPhraseContext = createContextEx();
82
+
83
+ // src/contexts/SeedPhrase/Provider.tsx
84
+ import { generateMnemonic as generateMnemonic2, validateMnemonic, wordlists as wordlists2 } from "@xyo-network/bip39";
85
+ import { useEffect as useEffect2, useMemo, useState as useState3 } from "react";
86
+ import { jsx as jsx3 } from "react/jsx-runtime";
87
+ var SeedPhraseProvider = ({
88
+ children,
89
+ defaultPhrase,
90
+ handleChangeSeedPhrase,
91
+ saveCallback,
92
+ seedPhrase,
93
+ open
94
+ }) => {
95
+ const [phrase, setPhrase] = useState3();
96
+ const [overwriteWarning, setOverwriteWarning] = useState3(false);
97
+ useEffect2(() => {
98
+ setPhrase(defaultPhrase);
99
+ }, [defaultPhrase]);
100
+ useEffect2(() => {
101
+ if (!open) {
102
+ handleCancelOverwrite();
103
+ }
104
+ }, [open]);
105
+ useEffect2(() => {
106
+ if (seedPhrase || open) {
107
+ setPhrase?.(seedPhrase ?? "");
108
+ }
109
+ }, [seedPhrase, open, setPhrase]);
110
+ const handleGenerate = () => {
111
+ const mnemonic = generateMnemonic2(wordlists2.english, 256);
112
+ setPhrase?.(mnemonic);
113
+ setOverwriteWarning?.(false);
114
+ };
115
+ const handleCancelOverwrite = () => {
116
+ setOverwriteWarning?.(false);
117
+ };
118
+ const handleClear = () => {
119
+ setPhrase?.("");
120
+ setOverwriteWarning?.(false);
121
+ };
122
+ const handleSave = () => {
123
+ if (!overwriteWarning && seedPhrase && seedPhrase !== phrase) {
124
+ setOverwriteWarning?.(true);
125
+ } else {
126
+ handleChangeSeedPhrase?.(phrase ?? "");
127
+ saveCallback?.();
128
+ }
129
+ };
130
+ const validate = (passedPhrase) => {
131
+ if (!passedPhrase) {
132
+ return null;
133
+ }
134
+ return validateMnemonic(passedPhrase, wordlists2.english);
135
+ };
136
+ const validSeedPhrase = useMemo(() => validate?.(seedPhrase), [seedPhrase]);
137
+ const validPhrase = useMemo(() => validate?.(phrase), [phrase]);
138
+ return /* @__PURE__ */ jsx3(
139
+ SeedPhraseContext.Provider,
140
+ {
141
+ value: {
142
+ handleCancelOverwrite,
143
+ handleChangeSeedPhrase,
144
+ handleClear,
145
+ handleGenerate,
146
+ handleSave,
147
+ overwriteWarning,
148
+ phrase,
149
+ provided: true,
150
+ seedPhrase,
151
+ setOverwriteWarning,
152
+ setPhrase,
153
+ validPhrase,
154
+ validSeedPhrase,
155
+ validate
156
+ },
157
+ children
158
+ }
159
+ );
160
+ };
161
+
162
+ // src/contexts/SeedPhrase/use.tsx
163
+ import { useContextEx } from "@xyo-network/react-shared";
164
+ var useSeedPhrase = () => useContextEx(SeedPhraseContext, "SeedPhrase", true);
165
+
166
+ // src/components/SeedPhrase/dialog/components/DialogActionButtons.tsx
167
+ import { Button as Button2, DialogActions as DialogActions2 } from "@mui/material";
168
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
169
+ var DialogActionButtons = ({ onClose, ...props }) => {
170
+ const { handleSave, setPhrase } = useSeedPhrase();
171
+ const wrappedOnClose = (e) => {
172
+ setPhrase?.("");
173
+ onClose?.(e, "escapeKeyDown");
174
+ };
175
+ return /* @__PURE__ */ jsxs3(DialogActions2, { ...props, children: [
176
+ /* @__PURE__ */ jsx4(Button2, { variant: "outlined", onClick: wrappedOnClose, children: "Cancel" }),
177
+ /* @__PURE__ */ jsx4(Button2, { variant: "outlined", onClick: handleSave, children: "Save" })
178
+ ] });
179
+ };
180
+
181
+ // src/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.tsx
182
+ import { Button as Button3, DialogActions as DialogActions3, FormControl, FormLabel, TextField } from "@mui/material";
183
+
184
+ // src/components/SeedPhrase/dialog/components/fields/validation-messages/colorParser.ts
185
+ var colorParser = (conditional) => {
186
+ switch (conditional) {
187
+ case true:
188
+ return "success";
189
+ case false:
190
+ return "error";
191
+ default:
192
+ return void 0;
193
+ }
194
+ };
195
+
196
+ // src/components/SeedPhrase/dialog/components/fields/validation-messages/InvalidPhrase.tsx
197
+ import { Link as Link2, Typography as Typography2 } from "@mui/material";
198
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
199
+ var InvalidPhraseTypography = (props) => /* @__PURE__ */ jsxs4(Typography2, { variant: "caption", color: "error", ...props, children: [
200
+ "Invalid seed phrase. See -",
201
+ " ",
202
+ /* @__PURE__ */ jsx5(Link2, { target: "_blank", href: "https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki", children: "bip39 Proposal" })
203
+ ] });
204
+
205
+ // src/components/SeedPhrase/dialog/components/fields/validation-messages/PhraseHeaderBox.tsx
206
+ import { CheckCircleOutline as CheckCircleOutlineIcon, HighlightOff as HighlightOffIcon } from "@mui/icons-material";
207
+ import { FlexRow } from "@xylabs/react-flexbox";
208
+ import { useMemo as useMemo2 } from "react";
209
+ import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
210
+ var PhraseHeaderBox = ({ children, conditional, ...props }) => {
211
+ const state = useMemo2(() => {
212
+ switch (conditional) {
213
+ case true:
214
+ return "success";
215
+ case false:
216
+ return "error";
217
+ default:
218
+ return null;
219
+ }
220
+ }, [conditional]);
221
+ const Icon = useMemo2(() => {
222
+ switch (state) {
223
+ case "success":
224
+ return /* @__PURE__ */ jsx6(CheckCircleOutlineIcon, { fontSize: "small", color: "success" });
225
+ case "error":
226
+ return /* @__PURE__ */ jsx6(HighlightOffIcon, { fontSize: "small", color: "error" });
227
+ default:
228
+ return null;
229
+ }
230
+ }, [state]);
231
+ return /* @__PURE__ */ jsxs5(FlexRow, { justifyContent: "start", columnGap: 1, ...props, children: [
232
+ Icon,
233
+ children
234
+ ] });
235
+ };
236
+
237
+ // src/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.tsx
238
+ import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
239
+ var NewPhraseTextField = (props) => {
240
+ const { handleClear, handleGenerate, overwriteWarning, phrase, setPhrase, validPhrase } = useSeedPhrase();
241
+ return /* @__PURE__ */ jsxs6(Fragment3, { children: [
242
+ /* @__PURE__ */ jsxs6(FormControl, { fullWidth: true, size: "small", sx: { display: "flex", flexDirection: "column", rowGap: 1 }, children: [
243
+ /* @__PURE__ */ jsx7(FormLabel, { children: /* @__PURE__ */ jsx7(PhraseHeaderBox, { conditional: validPhrase, children: "New Seed Phrase" }) }),
244
+ /* @__PURE__ */ jsx7(
245
+ TextField,
246
+ {
247
+ focused: true,
248
+ color: colorParser(validPhrase),
249
+ error: validPhrase === false,
250
+ helperText: validPhrase === false ? /* @__PURE__ */ jsx7(InvalidPhraseTypography, {}) : null,
251
+ fullWidth: true,
252
+ maxRows: Infinity,
253
+ multiline: true,
254
+ onChange: (e) => setPhrase?.(e.target.value),
255
+ value: phrase,
256
+ ...props
257
+ }
258
+ )
259
+ ] }),
260
+ /* @__PURE__ */ jsxs6(DialogActions3, { sx: { justifyContent: "center" }, children: [
261
+ /* @__PURE__ */ jsx7(Button3, { disabled: overwriteWarning, variant: "outlined", onClick: handleGenerate, children: "Generate" }),
262
+ /* @__PURE__ */ jsx7(Button3, { variant: "outlined", onClick: handleClear, children: "Clear" })
263
+ ] })
264
+ ] });
265
+ };
266
+
267
+ // src/components/SeedPhrase/dialog/components/fields/SavedPhraseTextField.tsx
268
+ import { Chip, FormControl as FormControl2, FormLabel as FormLabel2, TextField as TextField2 } from "@mui/material";
269
+ import { useState as useState4 } from "react";
270
+ import { Fragment as Fragment4, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
271
+ var SavedPhraseTextField = (props) => {
272
+ const { validSeedPhrase, seedPhrase } = useSeedPhrase();
273
+ const [visible, setVisible] = useState4(false);
274
+ return /* @__PURE__ */ jsxs7(FormControl2, { fullWidth: true, size: "small", sx: { display: "flex", flexDirection: "column", rowGap: 1 }, children: [
275
+ /* @__PURE__ */ jsx8(Chip, { label: visible ? "Hide Saved Seed Phrase" : "Reveal Saved Seed Phrase", onClick: () => setVisible(!visible) }),
276
+ visible ? /* @__PURE__ */ jsxs7(Fragment4, { children: [
277
+ /* @__PURE__ */ jsx8(FormLabel2, { children: /* @__PURE__ */ jsx8(PhraseHeaderBox, { conditional: validSeedPhrase, children: "Saved Seed Phrase" }) }),
278
+ /* @__PURE__ */ jsx8(
279
+ TextField2,
280
+ {
281
+ defaultValue: seedPhrase,
282
+ disabled: true,
283
+ error: validSeedPhrase === false,
284
+ helperText: validSeedPhrase === false ? /* @__PURE__ */ jsx8(InvalidPhraseTypography, {}) : null,
285
+ fullWidth: true,
286
+ maxRows: Infinity,
287
+ multiline: true,
288
+ ...props
289
+ }
290
+ )
291
+ ] }) : null
292
+ ] });
293
+ };
294
+
295
+ // src/components/SeedPhrase/dialog/components/OverwriteWarning.tsx
296
+ import { Alert as Alert2, Button as Button4 } from "@mui/material";
297
+ import { FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
298
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
299
+ var OverwriteWarning = () => {
300
+ const { handleCancelOverwrite, handleSave } = useSeedPhrase();
301
+ return /* @__PURE__ */ jsx9(
302
+ Alert2,
303
+ {
304
+ variant: "outlined",
305
+ severity: "warning",
306
+ action: /* @__PURE__ */ jsxs8(FlexRow2, { sx: { columnGap: 1 }, children: [
307
+ /* @__PURE__ */ jsx9(Button4, { variant: "outlined", color: "inherit", size: "small", onClick: handleSave, children: "Overwrite" }),
308
+ /* @__PURE__ */ jsx9(Button4, { variant: "outlined", color: "inherit", size: "small", onClick: handleCancelOverwrite, children: "Cancel" })
309
+ ] }),
310
+ children: "Are you sure you want to overwrite existing seed phrase? This action cannot be undone."
311
+ }
312
+ );
313
+ };
314
+
315
+ // src/components/SeedPhrase/dialog/SeedPhraseDialog.tsx
316
+ import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
317
+ var SeedPhraseDialog = ({ changeSeedPhrase, seedPhrase, ...props }) => {
318
+ return /* @__PURE__ */ jsx10(
319
+ SeedPhraseProvider,
320
+ {
321
+ seedPhrase,
322
+ handleChangeSeedPhrase: changeSeedPhrase,
323
+ open: props.open,
324
+ saveCallback: () => props.onClose?.({}, "escapeKeyDown"),
325
+ children: /* @__PURE__ */ jsx10(SeedPhraseDialogInner, { ...props })
326
+ }
327
+ );
328
+ };
329
+ var SeedPhraseDialogInner = (props) => {
330
+ const { overwriteWarning, seedPhrase } = useSeedPhrase();
331
+ return /* @__PURE__ */ jsxs9(Dialog2, { "aria-labelledby": "alert-dialog-title", "aria-describedby": "alert-dialog-description", fullWidth: true, maxWidth: "sm", ...props, children: [
332
+ /* @__PURE__ */ jsxs9(DialogTitle2, { id: "alert-dialog-title", children: [
333
+ "Update Your Seed Phrase ",
334
+ /* @__PURE__ */ jsx10(SeedPhraseIconButton, {})
335
+ ] }),
336
+ /* @__PURE__ */ jsxs9(DialogContent2, { sx: { display: "flex", flexDirection: "column", rowGap: 2 }, children: [
337
+ /* @__PURE__ */ jsx10(NewPhraseTextField, {}),
338
+ seedPhrase ? /* @__PURE__ */ jsx10(SavedPhraseTextField, {}) : null,
339
+ overwriteWarning ? /* @__PURE__ */ jsx10(OverwriteWarning, {}) : null
340
+ ] }),
341
+ /* @__PURE__ */ jsx10(DialogActionButtons, { onClose: props.onClose })
342
+ ] });
343
+ };
344
+
345
+ // src/components/SeedPhrase/settings/SeedPhraseTableRow.tsx
346
+ import { Cancel as CancelIcon, RadioButtonChecked as RadioButtonCheckedIcon } from "@mui/icons-material";
347
+ import { Button as Button5, ButtonGroup, TableCell, TableRow } from "@mui/material";
348
+ import { useState as useState5 } from "react";
349
+ import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
350
+ var SeedPhraseTableRow = ({ changeSeedPhrase, seedPhrase, ...props }) => {
351
+ const [open, setOpen] = useState5(false);
352
+ const handleOpen = () => {
353
+ setOpen(true);
354
+ };
355
+ return /* @__PURE__ */ jsxs10(TableRow, { ...props, children: [
356
+ /* @__PURE__ */ jsxs10(TableCell, { children: [
357
+ "Seed Phrase ",
358
+ /* @__PURE__ */ jsx11(SeedPhraseIconButton, {})
359
+ ] }),
360
+ /* @__PURE__ */ jsx11(TableCell, { align: "center", children: seedPhrase ? /* @__PURE__ */ jsx11(RadioButtonCheckedIcon, { color: "success" }) : /* @__PURE__ */ jsx11(CancelIcon, { color: "error" }) }),
361
+ /* @__PURE__ */ jsxs10(TableCell, { children: [
362
+ /* @__PURE__ */ jsx11(SeedPhraseDialog, { changeSeedPhrase, open, onClose: () => setOpen(false), seedPhrase }),
363
+ /* @__PURE__ */ jsx11(ButtonGroup, { fullWidth: true, children: /* @__PURE__ */ jsx11(Button5, { variant: "contained", size: "small", onClick: handleOpen, children: "Update" }) })
364
+ ] })
365
+ ] });
366
+ };
367
+ export {
368
+ DefaultSeedPhrase,
369
+ SeedPhraseDialog,
370
+ SeedPhraseDialogInner,
371
+ SeedPhraseIconButton,
372
+ SeedPhraseTableRow
373
+ };
5
374
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/components/SeedPhrase/index.ts"],"sourcesContent":["export * from './_shared'\nexport * from './DefaultSeedPhrase'\nexport * from './dialog'\nexport * from './settings'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
1
+ {"version":3,"sources":["../../../../src/components/SeedPhrase/_shared/SeedPhraseIconButton.tsx","../../../../src/components/SeedPhrase/DefaultSeedPhrase.tsx","../../../../src/components/SeedPhrase/dialog/SeedPhraseDialog.tsx","../../../../src/contexts/SeedPhrase/Context.ts","../../../../src/contexts/SeedPhrase/Provider.tsx","../../../../src/contexts/SeedPhrase/use.tsx","../../../../src/components/SeedPhrase/dialog/components/DialogActionButtons.tsx","../../../../src/components/SeedPhrase/dialog/components/fields/NewPhraseTextField.tsx","../../../../src/components/SeedPhrase/dialog/components/fields/validation-messages/colorParser.ts","../../../../src/components/SeedPhrase/dialog/components/fields/validation-messages/InvalidPhrase.tsx","../../../../src/components/SeedPhrase/dialog/components/fields/validation-messages/PhraseHeaderBox.tsx","../../../../src/components/SeedPhrase/dialog/components/fields/SavedPhraseTextField.tsx","../../../../src/components/SeedPhrase/dialog/components/OverwriteWarning.tsx","../../../../src/components/SeedPhrase/settings/SeedPhraseTableRow.tsx"],"sourcesContent":["import { HelpOutline as HelpOutlineIcon } from '@mui/icons-material'\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n IconButton,\n IconButtonProps,\n Link,\n List,\n ListItem,\n Typography,\n} from '@mui/material'\nimport { useState } from 'react'\n\nexport const SeedPhraseIconButton: React.FC<IconButtonProps> = (props) => {\n const [open, setOpen] = useState(false)\n const onClose = () => setOpen(false)\n return (\n <>\n <IconButton onClick={() => setOpen(true)} {...props}>\n <HelpOutlineIcon fontSize=\"small\" />\n </IconButton>\n <Dialog open={open}>\n <DialogTitle>Understanding your Seed Phrase</DialogTitle>\n <DialogContent>\n <Typography>\n Your Seed Phrase should adhere to the{' '}\n <Link target={'_blank'} href=\"https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki\">\n bip39 specification\n </Link>{' '}\n and is used to generate accounts which identify your data on the XYO Network.\n </Typography>\n <List>\n <ListItem>Do not share this phrase with anyone.</ListItem>\n <ListItem>Do not save it to a public computer.</ListItem>\n <ListItem>Do not use a existing phrase from another wallet (i.e. Metamask).</ListItem>\n <ListItem>Do not use before copying it down somewhere safe.</ListItem>\n </List>\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose} variant=\"outlined\">\n OK\n </Button>\n </DialogActions>\n </Dialog>\n </>\n )\n}\n","import { Alert, AlertTitle, Snackbar } from '@mui/material'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { generateMnemonic, wordlists } from '@xyo-network/bip39'\nimport { useEffect, useState } from 'react'\n\nexport interface DefaultSeedPhraseProps extends WithChildren {\n changeSeedPhrase?: (seedPhrase: string) => void\n hideDefaultSeedPhraseMessage?: boolean\n seedPhrase?: string\n}\n\nexport const DefaultSeedPhrase: React.FC<DefaultSeedPhraseProps> = ({ changeSeedPhrase, children, hideDefaultSeedPhraseMessage, seedPhrase }) => {\n const [showSnackBar, setShowSnackBar] = useState(false)\n\n useEffect(() => {\n if (!seedPhrase) {\n const mnemonic = generateMnemonic(wordlists.english, 256)\n changeSeedPhrase?.(mnemonic)\n setShowSnackBar(true)\n }\n }, [changeSeedPhrase, seedPhrase])\n\n return (\n <>\n {hideDefaultSeedPhraseMessage ? null : (\n <Snackbar\n open={showSnackBar}\n autoHideDuration={5000}\n onClose={() => setShowSnackBar(false)}\n anchorOrigin={{ horizontal: 'center', vertical: 'top' }}\n >\n <Alert severity={'success'}>\n <AlertTitle>Default Seed Phrase Generated</AlertTitle>\n Go to application settings to save it.\n </Alert>\n </Snackbar>\n )}\n {children}\n </>\n )\n}\n","import { Dialog, DialogContent, DialogProps, DialogTitle } from '@mui/material'\n\nimport { SeedPhraseProvider, useSeedPhrase } from '../../../contexts'\nimport { SeedPhraseIconButton } from '../_shared'\nimport { DialogActionButtons, NewPhraseTextField, OverwriteWarning, SavedPhraseTextField } from './components'\n\nexport interface SeedPhraseDialogProps extends DialogProps {\n changeSeedPhrase?: (value: string) => void\n seedPhrase?: string\n}\n\nexport const SeedPhraseDialog: React.FC<SeedPhraseDialogProps> = ({ changeSeedPhrase, seedPhrase, ...props }) => {\n return (\n <SeedPhraseProvider\n seedPhrase={seedPhrase}\n handleChangeSeedPhrase={changeSeedPhrase}\n open={props.open}\n saveCallback={() => props.onClose?.({}, 'escapeKeyDown')}\n >\n <SeedPhraseDialogInner {...props} />\n </SeedPhraseProvider>\n )\n}\n\nexport const SeedPhraseDialogInner: React.FC<SeedPhraseDialogProps> = (props) => {\n const { overwriteWarning, seedPhrase } = useSeedPhrase()\n\n return (\n <Dialog aria-labelledby=\"alert-dialog-title\" aria-describedby=\"alert-dialog-description\" fullWidth maxWidth={'sm'} {...props}>\n <DialogTitle id=\"alert-dialog-title\">\n Update Your Seed Phrase <SeedPhraseIconButton />\n </DialogTitle>\n <DialogContent sx={{ display: 'flex', flexDirection: 'column', rowGap: 2 }}>\n <NewPhraseTextField />\n {seedPhrase ? <SavedPhraseTextField /> : null}\n {overwriteWarning ? <OverwriteWarning /> : null}\n </DialogContent>\n <DialogActionButtons onClose={props.onClose} />\n </Dialog>\n )\n}\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport { SeedPhraseContextState } from './State'\n\nexport const SeedPhraseContext = createContextEx<SeedPhraseContextState>()\n","import { WithChildren } from '@xylabs/react-shared'\nimport { generateMnemonic, validateMnemonic, wordlists } from '@xyo-network/bip39'\nimport { useEffect, useMemo, useState } from 'react'\n\nimport { SeedPhraseContext } from './Context'\n\nexport interface SeedPhraseProviderProps extends WithChildren {\n defaultPhrase?: string\n handleChangeSeedPhrase?: (phrase: string) => void\n open?: boolean\n saveCallback?: () => void\n seedPhrase?: string\n}\n\nexport const SeedPhraseProvider: React.FC<SeedPhraseProviderProps> = ({\n children,\n defaultPhrase,\n handleChangeSeedPhrase,\n saveCallback,\n seedPhrase,\n open,\n}) => {\n const [phrase, setPhrase] = useState<string | undefined>()\n const [overwriteWarning, setOverwriteWarning] = useState(false)\n\n useEffect(() => {\n setPhrase(defaultPhrase)\n }, [defaultPhrase])\n\n useEffect(() => {\n if (!open) {\n handleCancelOverwrite()\n }\n }, [open])\n\n useEffect(() => {\n if (seedPhrase || open) {\n setPhrase?.(seedPhrase ?? '')\n }\n }, [seedPhrase, open, setPhrase])\n\n const handleGenerate = () => {\n const mnemonic = generateMnemonic(wordlists.english, 256)\n setPhrase?.(mnemonic)\n setOverwriteWarning?.(false)\n }\n\n const handleCancelOverwrite = () => {\n setOverwriteWarning?.(false)\n }\n\n const handleClear = () => {\n setPhrase?.('')\n setOverwriteWarning?.(false)\n }\n\n const handleSave = () => {\n if (!overwriteWarning && seedPhrase && seedPhrase !== phrase) {\n setOverwriteWarning?.(true)\n } else {\n handleChangeSeedPhrase?.(phrase ?? '')\n saveCallback?.()\n }\n }\n\n const validate = (passedPhrase?: string) => {\n if (!passedPhrase) {\n return null\n }\n return validateMnemonic(passedPhrase, wordlists.english)\n }\n\n const validSeedPhrase = useMemo(() => validate?.(seedPhrase), [seedPhrase])\n const validPhrase = useMemo(() => validate?.(phrase), [phrase])\n\n return (\n <SeedPhraseContext.Provider\n value={{\n handleCancelOverwrite,\n handleChangeSeedPhrase,\n handleClear,\n handleGenerate,\n handleSave,\n overwriteWarning,\n phrase,\n provided: true,\n seedPhrase,\n setOverwriteWarning,\n setPhrase,\n validPhrase,\n validSeedPhrase,\n validate,\n }}\n >\n {children}\n </SeedPhraseContext.Provider>\n )\n}\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { SeedPhraseContext } from './Context'\n\nexport const useSeedPhrase = () => useContextEx(SeedPhraseContext, 'SeedPhrase', true)\n","import { Button, DialogActions, DialogActionsProps, DialogProps } from '@mui/material'\nimport { MouseEvent } from 'react'\n\nimport { useSeedPhrase } from '../../../../contexts'\n\ninterface DialogActionButtonsProps extends DialogActionsProps {\n onClose?: DialogProps['onClose']\n}\n\nexport const DialogActionButtons: React.FC<DialogActionButtonsProps> = ({ onClose, ...props }) => {\n const { handleSave, setPhrase } = useSeedPhrase()\n\n const wrappedOnClose = (e: MouseEvent<HTMLElement>) => {\n // clear local copy of phrase when modal closes\n setPhrase?.('')\n onClose?.(e, 'escapeKeyDown')\n }\n\n return (\n <DialogActions {...props}>\n <Button variant=\"outlined\" onClick={wrappedOnClose}>\n Cancel\n </Button>\n <Button variant=\"outlined\" onClick={handleSave}>\n Save\n </Button>\n </DialogActions>\n )\n}\n","import { Button, DialogActions, FormControl, FormLabel, StandardTextFieldProps, TextField } from '@mui/material'\n\nimport { useSeedPhrase } from '../../../../../contexts'\nimport { colorParser, InvalidPhraseTypography, PhraseHeaderBox } from './validation-messages'\n\nexport const NewPhraseTextField: React.FC<StandardTextFieldProps> = (props) => {\n const { handleClear, handleGenerate, overwriteWarning, phrase, setPhrase, validPhrase } = useSeedPhrase()\n return (\n <>\n <FormControl fullWidth size=\"small\" sx={{ display: 'flex', flexDirection: 'column', rowGap: 1 }}>\n <FormLabel>\n <PhraseHeaderBox conditional={validPhrase}>New Seed Phrase</PhraseHeaderBox>\n </FormLabel>\n <TextField\n focused\n color={colorParser(validPhrase)}\n error={validPhrase === false}\n helperText={validPhrase === false ? <InvalidPhraseTypography /> : null}\n fullWidth\n maxRows={Infinity}\n multiline\n onChange={(e) => setPhrase?.(e.target.value)}\n value={phrase}\n {...props}\n />\n </FormControl>\n <DialogActions sx={{ justifyContent: 'center' }}>\n <Button disabled={overwriteWarning} variant=\"outlined\" onClick={handleGenerate}>\n Generate\n </Button>\n <Button variant=\"outlined\" onClick={handleClear}>\n Clear\n </Button>\n </DialogActions>\n </>\n )\n}\n","export const colorParser = (conditional?: boolean | null) => {\n switch (conditional) {\n case true:\n return 'success'\n case false:\n return 'error'\n default:\n return undefined\n }\n}\n","import { Link, Typography, TypographyProps } from '@mui/material'\n\nexport const InvalidPhraseTypography: React.FC<TypographyProps> = (props) => (\n <Typography variant={'caption'} color={'error'} {...props}>\n Invalid seed phrase. See -{' '}\n <Link target={'_blank'} href=\"https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki\">\n bip39 Proposal\n </Link>\n </Typography>\n)\n","import { CheckCircleOutline as CheckCircleOutlineIcon, HighlightOff as HighlightOffIcon } from '@mui/icons-material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\nimport { WithChildren } from '@xylabs/react-shared'\nimport { useMemo } from 'react'\n\ninterface PhraseHeaderBox extends FlexBoxProps, WithChildren {\n conditional?: boolean | null\n}\n\nexport const PhraseHeaderBox: React.FC<PhraseHeaderBox> = ({ children, conditional, ...props }) => {\n const state = useMemo(() => {\n switch (conditional) {\n case true:\n return 'success'\n case false:\n return 'error'\n default:\n return null\n }\n }, [conditional])\n\n const Icon = useMemo(() => {\n switch (state) {\n case 'success':\n return <CheckCircleOutlineIcon fontSize=\"small\" color=\"success\" />\n case 'error':\n return <HighlightOffIcon fontSize=\"small\" color=\"error\" />\n default:\n return null\n }\n }, [state])\n\n return (\n <FlexRow justifyContent={'start'} columnGap={1} {...props}>\n {Icon}\n {children}\n </FlexRow>\n )\n}\n","import { Chip, FormControl, FormLabel, StandardTextFieldProps, TextField } from '@mui/material'\nimport { useState } from 'react'\n\nimport { useSeedPhrase } from '../../../../../contexts'\nimport { InvalidPhraseTypography, PhraseHeaderBox } from './validation-messages'\n\nexport const SavedPhraseTextField: React.FC<StandardTextFieldProps> = (props) => {\n const { validSeedPhrase, seedPhrase } = useSeedPhrase()\n\n const [visible, setVisible] = useState(false)\n\n return (\n <FormControl fullWidth size=\"small\" sx={{ display: 'flex', flexDirection: 'column', rowGap: 1 }}>\n <Chip label={visible ? 'Hide Saved Seed Phrase' : 'Reveal Saved Seed Phrase'} onClick={() => setVisible(!visible)} />\n {visible ? (\n <>\n <FormLabel>\n <PhraseHeaderBox conditional={validSeedPhrase}>Saved Seed Phrase</PhraseHeaderBox>\n </FormLabel>\n <TextField\n defaultValue={seedPhrase}\n disabled\n error={validSeedPhrase === false}\n helperText={validSeedPhrase === false ? <InvalidPhraseTypography /> : null}\n fullWidth\n maxRows={Infinity}\n multiline\n {...props}\n />\n </>\n ) : null}\n </FormControl>\n )\n}\n","import { Alert, Button } from '@mui/material'\nimport { FlexRow } from '@xylabs/react-flexbox'\n\nimport { useSeedPhrase } from '../../../../contexts'\n\nexport const OverwriteWarning = () => {\n const { handleCancelOverwrite, handleSave } = useSeedPhrase()\n return (\n <Alert\n variant=\"outlined\"\n severity=\"warning\"\n action={\n <FlexRow sx={{ columnGap: 1 }}>\n <Button variant=\"outlined\" color=\"inherit\" size=\"small\" onClick={handleSave}>\n Overwrite\n </Button>\n <Button variant=\"outlined\" color=\"inherit\" size=\"small\" onClick={handleCancelOverwrite}>\n Cancel\n </Button>\n </FlexRow>\n }\n >\n Are you sure you want to overwrite existing seed phrase? This action cannot be undone.\n </Alert>\n )\n}\n","import { Cancel as CancelIcon, RadioButtonChecked as RadioButtonCheckedIcon } from '@mui/icons-material'\nimport { Button, ButtonGroup, TableCell, TableRow, TableRowProps } from '@mui/material'\nimport { useState } from 'react'\n\nimport { SeedPhraseIconButton } from '../_shared'\nimport { SeedPhraseDialog } from '../dialog'\n\nexport interface SeedPhraseTableRowProps extends TableRowProps {\n changeSeedPhrase?: (seedPhrase: string) => void\n seedPhrase?: string\n}\n\nexport const SeedPhraseTableRow: React.FC<SeedPhraseTableRowProps> = ({ changeSeedPhrase, seedPhrase, ...props }) => {\n const [open, setOpen] = useState(false)\n\n const handleOpen = () => {\n setOpen(true)\n }\n return (\n <TableRow {...props}>\n <TableCell>\n Seed Phrase <SeedPhraseIconButton />\n </TableCell>\n <TableCell align=\"center\">{seedPhrase ? <RadioButtonCheckedIcon color=\"success\" /> : <CancelIcon color=\"error\" />}</TableCell>\n <TableCell>\n <SeedPhraseDialog changeSeedPhrase={changeSeedPhrase} open={open} onClose={() => setOpen(false)} seedPhrase={seedPhrase} />\n <ButtonGroup fullWidth>\n <Button variant=\"contained\" size=\"small\" onClick={handleOpen}>\n Update\n </Button>\n </ButtonGroup>\n </TableCell>\n </TableRow>\n )\n}\n"],"mappings":";AAAA,SAAS,eAAe,uBAAuB;AAC/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA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AAC,iBAAgB;AAkBnB,SACc,OAAAC,OADd,QAAAC,cAAA;AARC,IAAM,qBAAwD,CAAC,EAAE,kBAAkB,YAAY,GAAG,MAAM,MAAM;AACnH,QAAM,CAAC,MAAM,OAAO,IAAIC,UAAS,KAAK;AAEtC,QAAM,aAAa,MAAM;AACvB,YAAQ,IAAI;AAAA,EACd;AACA,SACE,gBAAAD,OAAC,YAAU,GAAG,OACZ;AAAA,oBAAAA,OAAC,aAAU;AAAA;AAAA,MACG,gBAAAD,MAAC,wBAAqB;AAAA,OACpC;AAAA,IACA,gBAAAA,MAAC,aAAU,OAAM,UAAU,uBAAa,gBAAAA,MAAC,0BAAuB,OAAM,WAAU,IAAK,gBAAAA,MAAC,cAAW,OAAM,SAAQ,GAAG;AAAA,IAClH,gBAAAC,OAAC,aACC;AAAA,sBAAAD,MAAC,oBAAiB,kBAAoC,MAAY,SAAS,MAAM,QAAQ,KAAK,GAAG,YAAwB;AAAA,MACzH,gBAAAA,MAAC,eAAY,WAAS,MACpB,0BAAAA,MAACG,SAAA,EAAO,SAAQ,aAAY,MAAK,SAAQ,SAAS,YAAY,oBAE9D,GACF;AAAA,OACF;AAAA,KACF;AAEJ;","names":["useState","Fragment","jsx","jsxs","Dialog","DialogContent","DialogTitle","generateMnemonic","wordlists","useEffect","useState","jsx","useState","useEffect","generateMnemonic","wordlists","Button","DialogActions","jsx","jsxs","DialogActions","Button","Button","DialogActions","Link","Typography","jsx","jsxs","useMemo","jsx","jsxs","Fragment","jsx","jsxs","DialogActions","Button","FormControl","FormLabel","TextField","useState","Fragment","jsx","jsxs","useState","FormControl","FormLabel","TextField","Alert","Button","FlexRow","jsx","jsxs","Alert","FlexRow","Button","jsx","jsxs","Dialog","DialogTitle","DialogContent","Button","useState","jsx","jsxs","useState","Button"]}