@xyo-network/react-powered-by-xyo 7.5.8 → 7.5.12
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/browser/components/PoweredByXyo.d.ts.map +1 -1
- package/dist/browser/components/XyoBusy.d.ts.map +1 -1
- package/dist/browser/index.mjs +274 -336
- package/dist/browser/index.mjs.map +1 -1
- package/package.json +151 -44
- package/src/components/ArchivistSummary.tsx +0 -10
- package/src/components/BridgeSummary.tsx +0 -10
- package/src/components/DebugDialog.tsx +0 -23
- package/src/components/DivinerSummary.tsx +0 -10
- package/src/components/JsonViewerButton.tsx +0 -37
- package/src/components/ModuleAccordion.tsx +0 -28
- package/src/components/ModuleDetails.tsx +0 -92
- package/src/components/ModuleSummary.tsx +0 -45
- package/src/components/NodeDetails.tsx +0 -30
- package/src/components/NodeSummary.tsx +0 -31
- package/src/components/PoweredByXyo.tsx +0 -136
- package/src/components/PoweredByXyoButton.tsx +0 -55
- package/src/components/SentinelSummary.tsx +0 -10
- package/src/components/TypedModuleSummary.tsx +0 -38
- package/src/components/WitnessSummary.tsx +0 -10
- package/src/components/XyoBusy.tsx +0 -40
- package/src/components/index.ts +0 -14
- package/src/components/stories/PoweredByXyo.stories.tsx +0 -81
- package/src/components/stories/PoweredByXyoButton.stories.tsx +0 -21
- package/src/components/stories/XyoBusy.stories.tsx +0 -21
- package/src/components/stories/manifest.ts +0 -1
- package/src/components/stories/simple-node-inline-manifest.json +0 -56
- package/src/img/index.ts +0 -2
- package/src/img/xyo-color-logo-text-only.svg +0 -1
- package/src/img/xyo-color-logo.svg +0 -1
- package/src/index.ts +0 -1
- package/src/types/images.d.ts +0 -5
package/dist/browser/index.mjs
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
1
|
// src/components/ArchivistSummary.tsx
|
|
5
2
|
import { Inventory2Rounded as Inventory2RoundedIcon } from "@mui/icons-material";
|
|
6
|
-
import React2 from "react";
|
|
7
3
|
|
|
8
4
|
// src/components/ModuleSummary.tsx
|
|
9
5
|
import { Extension as ExtensionIcon } from "@mui/icons-material";
|
|
@@ -11,14 +7,16 @@ import { FlexCol, FlexRow } from "@xylabs/react-flexbox";
|
|
|
11
7
|
import { delay } from "@xylabs/sdk-js";
|
|
12
8
|
import { useWeakModulesFromNode } from "@xyo-network/react-node";
|
|
13
9
|
import { TypographyEx } from "@xyo-network/react-shared";
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
import { useState } from "react";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var ModuleSummary = ({
|
|
13
|
+
children,
|
|
14
|
+
icon,
|
|
15
|
+
mod,
|
|
16
|
+
...props
|
|
17
|
+
}) => {
|
|
18
|
+
const [downModules] = useWeakModulesFromNode(void 0, { direction: "down" });
|
|
19
|
+
const [upModules] = useWeakModulesFromNode(void 0, { direction: "up" });
|
|
22
20
|
const [busy, setBusy] = useState(false);
|
|
23
21
|
const downModulesFromResolve = downModules?.length;
|
|
24
22
|
const upModulesFromResolve = upModules?.length;
|
|
@@ -27,52 +25,48 @@ var ModuleSummary = /* @__PURE__ */ __name(({ children, icon, mod, ...props }) =
|
|
|
27
25
|
await delay(2e3);
|
|
28
26
|
setBusy(false);
|
|
29
27
|
});
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
}, icon ?? /* @__PURE__ */ React.createElement(ExtensionIcon, null)), /* @__PURE__ */ React.createElement(TypographyEx, {
|
|
39
|
-
marginX: 1
|
|
40
|
-
}, mod?.config?.name ?? "<Unknown>")), children ?? (downModulesFromResolve !== void 0 && upModulesFromResolve !== void 0) ? `[${downModulesFromResolve}\u2193/${upModulesFromResolve}\u2191]` : null));
|
|
41
|
-
}, "ModuleSummary");
|
|
28
|
+
return /* @__PURE__ */ jsx(FlexCol, { alignItems: "stretch", width: "100%", ...props, children: /* @__PURE__ */ jsxs(FlexRow, { justifyContent: "flex-start", children: [
|
|
29
|
+
/* @__PURE__ */ jsxs(FlexRow, { children: [
|
|
30
|
+
/* @__PURE__ */ jsx(TypographyEx, { color: busy ? "gray" : void 0, children: icon ?? /* @__PURE__ */ jsx(ExtensionIcon, {}) }),
|
|
31
|
+
/* @__PURE__ */ jsx(TypographyEx, { marginX: 1, children: mod?.config?.name ?? "<Unknown>" })
|
|
32
|
+
] }),
|
|
33
|
+
children ?? (downModulesFromResolve !== void 0 && upModulesFromResolve !== void 0) ? `[${downModulesFromResolve}\u2193/${upModulesFromResolve}\u2191]` : null
|
|
34
|
+
] }) });
|
|
35
|
+
};
|
|
42
36
|
|
|
43
37
|
// src/components/ArchivistSummary.tsx
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
...props
|
|
49
|
-
});
|
|
50
|
-
}, "ArchivistSummary");
|
|
38
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
39
|
+
var ArchivistSummary = ({ mod, ...props }) => {
|
|
40
|
+
return /* @__PURE__ */ jsx2(ModuleSummary, { mod, icon: /* @__PURE__ */ jsx2(Inventory2RoundedIcon, {}), ...props });
|
|
41
|
+
};
|
|
51
42
|
|
|
52
43
|
// src/components/BridgeSummary.tsx
|
|
53
44
|
import { InsertLinkRounded as InsertLinkRoundedIcon } from "@mui/icons-material";
|
|
54
|
-
import
|
|
55
|
-
var BridgeSummary =
|
|
56
|
-
return /* @__PURE__ */
|
|
57
|
-
|
|
58
|
-
icon: /* @__PURE__ */ React3.createElement(InsertLinkRoundedIcon, null),
|
|
59
|
-
...props
|
|
60
|
-
});
|
|
61
|
-
}, "BridgeSummary");
|
|
45
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
46
|
+
var BridgeSummary = ({ mod, ...props }) => {
|
|
47
|
+
return /* @__PURE__ */ jsx3(ModuleSummary, { mod, icon: /* @__PURE__ */ jsx3(InsertLinkRoundedIcon, {}), ...props });
|
|
48
|
+
};
|
|
62
49
|
|
|
63
50
|
// src/components/DebugDialog.tsx
|
|
64
|
-
import {
|
|
65
|
-
|
|
51
|
+
import {
|
|
52
|
+
Button,
|
|
53
|
+
Dialog as Dialog2,
|
|
54
|
+
DialogActions as DialogActions2,
|
|
55
|
+
DialogContent as DialogContent2,
|
|
56
|
+
DialogTitle as DialogTitle2
|
|
57
|
+
} from "@mui/material";
|
|
66
58
|
|
|
67
59
|
// src/components/NodeDetails.tsx
|
|
68
60
|
import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
|
|
69
61
|
import { useProvidedNode, useWeakModulesFromNode as useWeakModulesFromNode3 } from "@xyo-network/react-node";
|
|
70
|
-
import React12 from "react";
|
|
71
62
|
|
|
72
63
|
// src/components/ModuleAccordion.tsx
|
|
73
64
|
import { ExpandMore as ExpandMoreIcon } from "@mui/icons-material";
|
|
74
|
-
import
|
|
75
|
-
|
|
65
|
+
import {
|
|
66
|
+
Accordion,
|
|
67
|
+
AccordionDetails,
|
|
68
|
+
AccordionSummary
|
|
69
|
+
} from "@mui/material";
|
|
76
70
|
|
|
77
71
|
// src/components/ModuleDetails.tsx
|
|
78
72
|
import { ButtonGroup } from "@mui/material";
|
|
@@ -82,87 +76,69 @@ import { usePromise } from "@xylabs/react-promise";
|
|
|
82
76
|
import { ModuleDescriptionSchema } from "@xyo-network/module-model";
|
|
83
77
|
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
84
78
|
import { Property } from "@xyo-network/react-property";
|
|
85
|
-
import React5 from "react";
|
|
86
79
|
|
|
87
80
|
// src/components/JsonViewerButton.tsx
|
|
88
|
-
import {
|
|
81
|
+
import {
|
|
82
|
+
Dialog,
|
|
83
|
+
DialogActions,
|
|
84
|
+
DialogContent,
|
|
85
|
+
DialogTitle
|
|
86
|
+
} from "@mui/material";
|
|
89
87
|
import { ButtonEx } from "@xylabs/react-button";
|
|
90
88
|
import { JsonViewerEx } from "@xyo-network/react-payload-raw-info";
|
|
91
|
-
import
|
|
92
|
-
|
|
89
|
+
import { useState as useState2 } from "react";
|
|
90
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
91
|
+
var JsonViewerButton = ({
|
|
92
|
+
children,
|
|
93
|
+
jsonViewProps,
|
|
94
|
+
src,
|
|
95
|
+
title,
|
|
96
|
+
...props
|
|
97
|
+
}) => {
|
|
93
98
|
const [open, setOpen] = useState2(false);
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
})), /* @__PURE__ */ React4.createElement(DialogActions, null, /* @__PURE__ */ React4.createElement(ButtonEx, {
|
|
104
|
-
onClick: /* @__PURE__ */ __name(() => setOpen(false), "onClick")
|
|
105
|
-
}, "Close"))));
|
|
106
|
-
}, "JsonViewerButton");
|
|
99
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
100
|
+
/* @__PURE__ */ jsx4(ButtonEx, { onClick: () => setOpen(!open), ...props, children: children ?? "JSON" }),
|
|
101
|
+
/* @__PURE__ */ jsxs2(Dialog, { open, onClose: () => setOpen(false), children: [
|
|
102
|
+
title ? /* @__PURE__ */ jsx4(DialogTitle, { children: title }) : null,
|
|
103
|
+
/* @__PURE__ */ jsx4(DialogContent, { children: /* @__PURE__ */ jsx4(JsonViewerEx, { value: src, ...jsonViewProps }) }),
|
|
104
|
+
/* @__PURE__ */ jsx4(DialogActions, { children: /* @__PURE__ */ jsx4(ButtonEx, { onClick: () => setOpen(false), children: "Close" }) })
|
|
105
|
+
] })
|
|
106
|
+
] });
|
|
107
|
+
};
|
|
107
108
|
|
|
108
109
|
// src/components/ModuleDetails.tsx
|
|
109
|
-
|
|
110
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
111
|
+
var ModuleDetails = ({ mod, ...props }) => {
|
|
110
112
|
const [manifest] = usePromise(async () => {
|
|
111
113
|
return await mod?.manifest();
|
|
112
|
-
}, [
|
|
113
|
-
mod
|
|
114
|
-
]);
|
|
114
|
+
}, [mod]);
|
|
115
115
|
const [discover] = usePromise(async () => {
|
|
116
116
|
return await mod?.state();
|
|
117
|
-
}, [
|
|
118
|
-
mod
|
|
119
|
-
]);
|
|
117
|
+
}, [mod]);
|
|
120
118
|
const [describe] = usePromise(async () => {
|
|
121
119
|
const state = await mod?.state();
|
|
122
120
|
return state?.find(isPayloadOfSchemaType(ModuleDescriptionSchema));
|
|
123
|
-
}, [
|
|
124
|
-
mod
|
|
125
|
-
]);
|
|
121
|
+
}, [mod]);
|
|
126
122
|
const queries = mod?.queries;
|
|
127
123
|
const config = mod?.config;
|
|
128
|
-
return /* @__PURE__ */
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}, "Discover") : null, describe ? /* @__PURE__ */ React5.createElement(JsonViewerButton, {
|
|
147
|
-
variant: "contained",
|
|
148
|
-
src: describe
|
|
149
|
-
}, "Describe") : null, queries ? /* @__PURE__ */ React5.createElement(JsonViewerButton, {
|
|
150
|
-
variant: "contained",
|
|
151
|
-
src: queries
|
|
152
|
-
}, "Queries") : null), /* @__PURE__ */ React5.createElement(ButtonGroup, null, /* @__PURE__ */ React5.createElement(ButtonEx2, {
|
|
153
|
-
target: "_blank",
|
|
154
|
-
href: `https://explore.xyo.network/block?network=main&address=${mod?.address}`,
|
|
155
|
-
variant: "outlined"
|
|
156
|
-
}, "Main"), /* @__PURE__ */ React5.createElement(ButtonEx2, {
|
|
157
|
-
target: "_blank",
|
|
158
|
-
href: `https://beta.explore.xyo.network/block?network=kerplunk&address=${mod?.address}`,
|
|
159
|
-
variant: "outlined"
|
|
160
|
-
}, "Kerplunk"), /* @__PURE__ */ React5.createElement(ButtonEx2, {
|
|
161
|
-
target: "_blank",
|
|
162
|
-
href: `https://beta.explore.xyo.network/block?network=local&address=${mod?.address}`,
|
|
163
|
-
variant: "outlined"
|
|
164
|
-
}, "Local"))));
|
|
165
|
-
}, "ModuleDetails");
|
|
124
|
+
return /* @__PURE__ */ jsxs3(FlexCol2, { alignItems: "stretch", ...props, children: [
|
|
125
|
+
/* @__PURE__ */ jsx5(Property, { title: "Address", value: mod?.address }),
|
|
126
|
+
/* @__PURE__ */ jsxs3(FlexRow2, { gap: 1, justifyContent: "space-between", children: [
|
|
127
|
+
/* @__PURE__ */ jsxs3(ButtonGroup, { children: [
|
|
128
|
+
manifest ? /* @__PURE__ */ jsx5(JsonViewerButton, { variant: "contained", src: manifest, children: "Manifest" }) : null,
|
|
129
|
+
config ? /* @__PURE__ */ jsx5(JsonViewerButton, { variant: "contained", src: config, children: "Config" }) : null,
|
|
130
|
+
discover ? /* @__PURE__ */ jsx5(JsonViewerButton, { variant: "contained", src: discover, children: "Discover" }) : null,
|
|
131
|
+
describe ? /* @__PURE__ */ jsx5(JsonViewerButton, { variant: "contained", src: describe, children: "Describe" }) : null,
|
|
132
|
+
queries ? /* @__PURE__ */ jsx5(JsonViewerButton, { variant: "contained", src: queries, children: "Queries" }) : null
|
|
133
|
+
] }),
|
|
134
|
+
/* @__PURE__ */ jsxs3(ButtonGroup, { children: [
|
|
135
|
+
/* @__PURE__ */ jsx5(ButtonEx2, { target: "_blank", href: `https://explore.xyo.network/block?network=main&address=${mod?.address}`, variant: "outlined", children: "Main" }),
|
|
136
|
+
/* @__PURE__ */ jsx5(ButtonEx2, { target: "_blank", href: `https://beta.explore.xyo.network/block?network=kerplunk&address=${mod?.address}`, variant: "outlined", children: "Kerplunk" }),
|
|
137
|
+
/* @__PURE__ */ jsx5(ButtonEx2, { target: "_blank", href: `https://beta.explore.xyo.network/block?network=local&address=${mod?.address}`, variant: "outlined", children: "Local" })
|
|
138
|
+
] })
|
|
139
|
+
] })
|
|
140
|
+
] });
|
|
141
|
+
};
|
|
166
142
|
|
|
167
143
|
// src/components/TypedModuleSummary.tsx
|
|
168
144
|
import { isArchivistInstance } from "@xyo-network/archivist-model";
|
|
@@ -171,152 +147,98 @@ import { isDivinerInstance } from "@xyo-network/diviner-model";
|
|
|
171
147
|
import { isNodeInstance } from "@xyo-network/node-model";
|
|
172
148
|
import { isSentinelInstance } from "@xyo-network/sentinel-model";
|
|
173
149
|
import { isWitnessInstance } from "@xyo-network/witness-model";
|
|
174
|
-
import React10 from "react";
|
|
175
150
|
|
|
176
151
|
// src/components/DivinerSummary.tsx
|
|
177
152
|
import { BubbleChartRounded as BubbleChartRoundedIcon } from "@mui/icons-material";
|
|
178
|
-
import
|
|
179
|
-
var DivinerSummary =
|
|
180
|
-
return /* @__PURE__ */
|
|
181
|
-
|
|
182
|
-
icon: /* @__PURE__ */ React6.createElement(BubbleChartRoundedIcon, null),
|
|
183
|
-
...props
|
|
184
|
-
});
|
|
185
|
-
}, "DivinerSummary");
|
|
153
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
154
|
+
var DivinerSummary = ({ mod, ...props }) => {
|
|
155
|
+
return /* @__PURE__ */ jsx6(ModuleSummary, { mod, icon: /* @__PURE__ */ jsx6(BubbleChartRoundedIcon, {}), ...props });
|
|
156
|
+
};
|
|
186
157
|
|
|
187
158
|
// src/components/NodeSummary.tsx
|
|
188
159
|
import { HubRounded as HubRoundedIcon } from "@mui/icons-material";
|
|
189
160
|
import { usePromise as usePromise2 } from "@xylabs/react-promise";
|
|
190
161
|
import { useWeakModulesFromNode as useWeakModulesFromNode2 } from "@xyo-network/react-node";
|
|
191
|
-
import
|
|
192
|
-
var NodeSummary =
|
|
162
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
163
|
+
var NodeSummary = ({ mod, ...props }) => {
|
|
193
164
|
const [manifest] = usePromise2(async () => {
|
|
194
165
|
return await mod?.manifest();
|
|
195
|
-
}, [
|
|
196
|
-
|
|
197
|
-
]);
|
|
198
|
-
const [downModules] = useWeakModulesFromNode2(void 0, {
|
|
199
|
-
direction: "down"
|
|
200
|
-
});
|
|
201
|
-
const [upModules] = useWeakModulesFromNode2(void 0, {
|
|
202
|
-
direction: "up"
|
|
203
|
-
});
|
|
166
|
+
}, [mod]);
|
|
167
|
+
const [downModules] = useWeakModulesFromNode2(void 0, { direction: "down" });
|
|
168
|
+
const [upModules] = useWeakModulesFromNode2(void 0, { direction: "up" });
|
|
204
169
|
const downModulesFromResolve = downModules?.length;
|
|
205
170
|
const upModulesFromResolve = upModules?.length;
|
|
206
171
|
const manifestPublicModules = manifest?.modules?.public?.length;
|
|
207
|
-
return /* @__PURE__ */
|
|
208
|
-
|
|
209
|
-
icon: /* @__PURE__ */ React7.createElement(HubRoundedIcon, null),
|
|
210
|
-
...props
|
|
211
|
-
}, manifestPublicModules !== void 0 && downModulesFromResolve !== void 0 && upModulesFromResolve !== void 0 ? `[${manifestPublicModules}m/${downModulesFromResolve}\u2193/${upModulesFromResolve}\u2191]` : null);
|
|
212
|
-
}, "NodeSummary");
|
|
172
|
+
return /* @__PURE__ */ jsx7(ModuleSummary, { mod, icon: /* @__PURE__ */ jsx7(HubRoundedIcon, {}), ...props, children: manifestPublicModules !== void 0 && downModulesFromResolve !== void 0 && upModulesFromResolve !== void 0 ? `[${manifestPublicModules}m/${downModulesFromResolve}\u2193/${upModulesFromResolve}\u2191]` : null });
|
|
173
|
+
};
|
|
213
174
|
|
|
214
175
|
// src/components/SentinelSummary.tsx
|
|
215
176
|
import { TimerRounded as TimerRoundedIcon } from "@mui/icons-material";
|
|
216
|
-
import
|
|
217
|
-
var SentinelSummary =
|
|
218
|
-
return /* @__PURE__ */
|
|
219
|
-
|
|
220
|
-
icon: /* @__PURE__ */ React8.createElement(TimerRoundedIcon, null),
|
|
221
|
-
...props
|
|
222
|
-
});
|
|
223
|
-
}, "SentinelSummary");
|
|
177
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
178
|
+
var SentinelSummary = ({ mod, ...props }) => {
|
|
179
|
+
return /* @__PURE__ */ jsx8(ModuleSummary, { mod, icon: /* @__PURE__ */ jsx8(TimerRoundedIcon, {}), ...props });
|
|
180
|
+
};
|
|
224
181
|
|
|
225
182
|
// src/components/WitnessSummary.tsx
|
|
226
183
|
import { VisibilityRounded as VisibilityRoundedIcon } from "@mui/icons-material";
|
|
227
|
-
import
|
|
228
|
-
var WitnessSummary =
|
|
229
|
-
return /* @__PURE__ */
|
|
230
|
-
|
|
231
|
-
icon: /* @__PURE__ */ React9.createElement(VisibilityRoundedIcon, null),
|
|
232
|
-
...props
|
|
233
|
-
});
|
|
234
|
-
}, "WitnessSummary");
|
|
184
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
185
|
+
var WitnessSummary = ({ mod, ...props }) => {
|
|
186
|
+
return /* @__PURE__ */ jsx9(ModuleSummary, { mod, icon: /* @__PURE__ */ jsx9(VisibilityRoundedIcon, {}), ...props });
|
|
187
|
+
};
|
|
235
188
|
|
|
236
189
|
// src/components/TypedModuleSummary.tsx
|
|
237
|
-
|
|
190
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
191
|
+
var TypedModuleSummary = ({ mod, ...props }) => {
|
|
238
192
|
if (isArchivistInstance(mod)) {
|
|
239
|
-
return /* @__PURE__ */
|
|
240
|
-
mod,
|
|
241
|
-
...props
|
|
242
|
-
});
|
|
193
|
+
return /* @__PURE__ */ jsx10(ArchivistSummary, { mod, ...props });
|
|
243
194
|
}
|
|
244
195
|
if (isDivinerInstance(mod)) {
|
|
245
|
-
return /* @__PURE__ */
|
|
246
|
-
mod,
|
|
247
|
-
...props
|
|
248
|
-
});
|
|
196
|
+
return /* @__PURE__ */ jsx10(DivinerSummary, { mod, ...props });
|
|
249
197
|
}
|
|
250
198
|
if (isNodeInstance(mod)) {
|
|
251
|
-
return /* @__PURE__ */
|
|
252
|
-
mod,
|
|
253
|
-
...props
|
|
254
|
-
});
|
|
199
|
+
return /* @__PURE__ */ jsx10(NodeSummary, { mod, ...props });
|
|
255
200
|
}
|
|
256
201
|
if (isWitnessInstance(mod)) {
|
|
257
|
-
return /* @__PURE__ */
|
|
258
|
-
mod,
|
|
259
|
-
...props
|
|
260
|
-
});
|
|
202
|
+
return /* @__PURE__ */ jsx10(WitnessSummary, { mod, ...props });
|
|
261
203
|
}
|
|
262
204
|
if (isBridgeInstance(mod)) {
|
|
263
|
-
return /* @__PURE__ */
|
|
264
|
-
mod,
|
|
265
|
-
...props
|
|
266
|
-
});
|
|
205
|
+
return /* @__PURE__ */ jsx10(BridgeSummary, { mod, ...props });
|
|
267
206
|
}
|
|
268
207
|
if (isSentinelInstance(mod)) {
|
|
269
|
-
return /* @__PURE__ */
|
|
270
|
-
mod,
|
|
271
|
-
...props
|
|
272
|
-
});
|
|
208
|
+
return /* @__PURE__ */ jsx10(SentinelSummary, { mod, ...props });
|
|
273
209
|
}
|
|
274
|
-
return /* @__PURE__ */
|
|
275
|
-
|
|
276
|
-
...props
|
|
277
|
-
});
|
|
278
|
-
}, "TypedModuleSummary");
|
|
210
|
+
return /* @__PURE__ */ jsx10(ModuleSummary, { mod, ...props });
|
|
211
|
+
};
|
|
279
212
|
|
|
280
213
|
// src/components/ModuleAccordion.tsx
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
mod
|
|
286
|
-
})
|
|
287
|
-
|
|
288
|
-
})));
|
|
289
|
-
}, "ModuleAccordion");
|
|
214
|
+
import { jsx as jsx11, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
215
|
+
var ModuleAccordion = ({ mod, ...props }) => {
|
|
216
|
+
return /* @__PURE__ */ jsxs4(Accordion, { ...props, children: [
|
|
217
|
+
/* @__PURE__ */ jsx11(AccordionSummary, { expandIcon: /* @__PURE__ */ jsx11(ExpandMoreIcon, {}), children: /* @__PURE__ */ jsx11(TypedModuleSummary, { mod }) }),
|
|
218
|
+
/* @__PURE__ */ jsx11(AccordionDetails, { children: /* @__PURE__ */ jsx11(ModuleDetails, { mod }) })
|
|
219
|
+
] });
|
|
220
|
+
};
|
|
290
221
|
|
|
291
222
|
// src/components/NodeDetails.tsx
|
|
292
|
-
|
|
223
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
224
|
+
var NodeDetails = ({ mod, ...props }) => {
|
|
293
225
|
const [node = mod] = useProvidedNode();
|
|
294
|
-
const [children] = useWeakModulesFromNode3(void 0, {
|
|
295
|
-
|
|
296
|
-
});
|
|
297
|
-
return /* @__PURE__ */ React12.createElement(FlexCol3, {
|
|
298
|
-
alignItems: "stretch",
|
|
299
|
-
...props
|
|
300
|
-
}, children ? /* @__PURE__ */ React12.createElement(FlexCol3, {
|
|
301
|
-
alignItems: "stretch",
|
|
302
|
-
marginY: 1
|
|
303
|
-
}, children?.map((child) => {
|
|
226
|
+
const [children] = useWeakModulesFromNode3(void 0, { node: node ?? void 0 });
|
|
227
|
+
return /* @__PURE__ */ jsx12(FlexCol3, { alignItems: "stretch", ...props, children: children ? /* @__PURE__ */ jsx12(FlexCol3, { alignItems: "stretch", marginY: 1, children: children?.map((child) => {
|
|
304
228
|
const instance = child.deref();
|
|
305
|
-
return instance ? /* @__PURE__ */
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}) : null;
|
|
309
|
-
})) : null);
|
|
310
|
-
}, "NodeDetails");
|
|
229
|
+
return instance ? /* @__PURE__ */ jsx12(ModuleAccordion, { mod: instance }, instance.address) : null;
|
|
230
|
+
}) }) : null });
|
|
231
|
+
};
|
|
311
232
|
|
|
312
233
|
// src/components/DebugDialog.tsx
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
234
|
+
import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
235
|
+
var DebugDialog = ({ onClose, ...props }) => {
|
|
236
|
+
return /* @__PURE__ */ jsxs5(Dialog2, { ...props, children: [
|
|
237
|
+
/* @__PURE__ */ jsx13(DialogTitle2, { children: "Xyo Module Viewer" }),
|
|
238
|
+
/* @__PURE__ */ jsx13(DialogContent2, { children: /* @__PURE__ */ jsx13(NodeDetails, { width: "100%" }) }),
|
|
239
|
+
/* @__PURE__ */ jsx13(DialogActions2, { children: /* @__PURE__ */ jsx13(Button, { onClick: (event) => onClose?.(event, "backdropClick"), children: "Close" }) })
|
|
240
|
+
] });
|
|
241
|
+
};
|
|
320
242
|
|
|
321
243
|
// src/components/PoweredByXyo.tsx
|
|
322
244
|
import { Paper } from "@mui/material";
|
|
@@ -324,13 +246,13 @@ import { useAsyncEffect } from "@xylabs/react-async-effect";
|
|
|
324
246
|
import { FlexCol as FlexCol6 } from "@xylabs/react-flexbox";
|
|
325
247
|
import { delay as delay2, forget } from "@xylabs/sdk-js";
|
|
326
248
|
import { useProvidedNode as useProvidedNode2 } from "@xyo-network/react-node";
|
|
327
|
-
import
|
|
249
|
+
import { useState as useState5 } from "react";
|
|
328
250
|
|
|
329
251
|
// src/components/PoweredByXyoButton.tsx
|
|
330
252
|
import { Typography } from "@mui/material";
|
|
331
253
|
import { ButtonEx as ButtonEx3 } from "@xylabs/react-button";
|
|
332
254
|
import { FlexCol as FlexCol5, FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
|
|
333
|
-
import
|
|
255
|
+
import { useEffect as useEffect2, useState as useState4 } from "react";
|
|
334
256
|
|
|
335
257
|
// src/img/xyo-color-logo.svg
|
|
336
258
|
var xyo_color_logo_default = '<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 238"><defs><style>.cls-1{fill:#8d8fc6;}.cls-2{fill:#579fd6;}.cls-3{fill:#f27046;}.cls-4{fill:#eb407a;}</style></defs><path class="cls-1" d="M74.5,28.33,21.29,120.5,74.5,212.67H180.94l1.76-3,51.46-89.13L180.94,28.33ZM84.65,40.54h78.83L111.65,56.93a15.85,15.85,0,0,1,2,5l59.66-18.81L185.22,101a20.12,20.12,0,0,1,5.36-.78l-10-47.91,37.87,65.53h-7.62a24.21,24.21,0,0,1,.15,2.68,23.29,23.29,0,0,1-.15,2.68h7.62l-39.1,67.75,10.92-50.13A20.57,20.57,0,0,1,185,140l-12.88,59-58.37-19.53a17.61,17.61,0,0,1-1.7,5l47.5,15.92H84.65l4-6.85A20.17,20.17,0,0,1,83.93,191L80,197.78,42.67,133.13l37,32.66a20.52,20.52,0,0,1,3.6-4L36.69,120.66,85,77.79a17.45,17.45,0,0,1-3.19-4.32l-39.46,35L80,43.22l5.56,9.69A17.51,17.51,0,0,1,90.12,50Zm28.24,31.17a16.15,16.15,0,0,1-2.68,4.64l62,35.81a19.74,19.74,0,0,1,2.83-4.54Zm-20,10.51v75.33a18,18,0,0,1,2.47-.16,17.18,17.18,0,0,1,2.89.21v-75a11.21,11.21,0,0,1-1.29,0,17.57,17.57,0,0,1-4.07-.47Zm79.34,46.63-62.08,35.81a18.45,18.45,0,0,1,2.68,4.68l62.23-36a19.68,19.68,0,0,1-2.83-4.53Z"/><path class="cls-2" d="M97,48.58a17.06,17.06,0,1,0,17,17,17.08,17.08,0,0,0-17-17Zm0,5.36a11.7,11.7,0,1,1-11.7,11.69A11.65,11.65,0,0,1,97,53.94Z"/><path class="cls-3" d="M95.37,157.39a18.73,18.73,0,1,0,18.7,18.7,18.74,18.74,0,0,0-18.7-18.7Zm0,5.31A13.4,13.4,0,1,1,82,176.09a13.37,13.37,0,0,1,13.4-13.39Z"/><path class="cls-4" d="M190.73,100.2A20.3,20.3,0,1,0,211,120.5a20.34,20.34,0,0,0-20.3-20.3Zm0,5.36a14.94,14.94,0,1,1-14.94,14.94,14.88,14.88,0,0,1,14.94-14.94Z"/></svg>';
|
|
@@ -340,79 +262,100 @@ var xyo_color_logo_text_only_default = '<svg id="Layer_1" data-name="Layer 1" xm
|
|
|
340
262
|
|
|
341
263
|
// src/components/XyoBusy.tsx
|
|
342
264
|
import { FlexCol as FlexCol4 } from "@xylabs/react-flexbox";
|
|
343
|
-
import
|
|
344
|
-
|
|
265
|
+
import { useEffect, useState as useState3 } from "react";
|
|
266
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
267
|
+
var XyoBusy = ({
|
|
268
|
+
widthInPixels,
|
|
269
|
+
busy,
|
|
270
|
+
spinsPerSecond = 0.5,
|
|
271
|
+
...props
|
|
272
|
+
}) => {
|
|
345
273
|
const [imageLoaded, setImageLoaded] = useState3(false);
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
274
|
+
useEffect(() => {
|
|
275
|
+
if (!imageLoaded) {
|
|
276
|
+
const img = new Image();
|
|
277
|
+
const onLoad = () => setImageLoaded(true);
|
|
278
|
+
img.addEventListener("load", onLoad);
|
|
279
|
+
img.src = xyo_color_logo_default;
|
|
280
|
+
return () => img.removeEventListener("load", onLoad);
|
|
281
|
+
}
|
|
282
|
+
}, [imageLoaded]);
|
|
283
|
+
return imageLoaded ? /* @__PURE__ */ jsx14(
|
|
284
|
+
FlexCol4,
|
|
285
|
+
{
|
|
286
|
+
sx: {
|
|
287
|
+
"@keyframes spin": {
|
|
288
|
+
"0%": { transform: "rotate(360deg)" },
|
|
289
|
+
"100%": { transform: "rotate(0deg)" }
|
|
356
290
|
},
|
|
357
|
-
"
|
|
358
|
-
|
|
359
|
-
}
|
|
291
|
+
"animation": busy ? `spin ${1 / spinsPerSecond}s linear infinite` : void 0,
|
|
292
|
+
"animationDirection": "reverse"
|
|
360
293
|
},
|
|
361
|
-
|
|
362
|
-
"
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
src: xyo_color_logo_default,
|
|
367
|
-
height: widthInPixels ?? 22
|
|
368
|
-
})) : null;
|
|
369
|
-
}, "XyoBusy");
|
|
294
|
+
...props,
|
|
295
|
+
children: /* @__PURE__ */ jsx14("img", { src: xyo_color_logo_default, height: widthInPixels ?? 22 })
|
|
296
|
+
}
|
|
297
|
+
) : null;
|
|
298
|
+
};
|
|
370
299
|
|
|
371
300
|
// src/components/PoweredByXyoButton.tsx
|
|
372
|
-
|
|
301
|
+
import { jsx as jsx15, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
302
|
+
var PoweredByXyoButton = ({
|
|
303
|
+
busy = false,
|
|
304
|
+
logoHeight,
|
|
305
|
+
logoTextSize,
|
|
306
|
+
...props
|
|
307
|
+
}) => {
|
|
373
308
|
const [imageLoaded, setImageLoaded] = useState4(false);
|
|
374
|
-
|
|
309
|
+
useEffect2(() => {
|
|
375
310
|
const img = new Image();
|
|
376
|
-
const onImageLoaded =
|
|
311
|
+
const onImageLoaded = () => setImageLoaded(true);
|
|
377
312
|
img.addEventListener("load", onImageLoaded);
|
|
378
313
|
img.src = xyo_color_logo_text_only_default;
|
|
379
314
|
return () => {
|
|
380
315
|
img.removeEventListener("load", onImageLoaded);
|
|
381
316
|
};
|
|
382
317
|
}, []);
|
|
383
|
-
return imageLoaded ? /* @__PURE__ */
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
318
|
+
return imageLoaded ? /* @__PURE__ */ jsx15(
|
|
319
|
+
ButtonEx3,
|
|
320
|
+
{
|
|
321
|
+
...props,
|
|
322
|
+
target: props.target ?? "_blank",
|
|
323
|
+
variant: props.variant ?? "text",
|
|
324
|
+
sx: {
|
|
325
|
+
textDecoration: "none",
|
|
326
|
+
borderRadius: 0,
|
|
327
|
+
padding: 0,
|
|
328
|
+
...props.sx
|
|
329
|
+
},
|
|
330
|
+
children: /* @__PURE__ */ jsxs6(FlexCol5, { padding: 0.5, children: [
|
|
331
|
+
/* @__PURE__ */ jsx15(Typography, { style: { fontSize: logoTextSize ?? 10 }, fontSize: "small", children: "Powered by" }),
|
|
332
|
+
/* @__PURE__ */ jsxs6(FlexRow3, { children: [
|
|
333
|
+
/* @__PURE__ */ jsx15(XyoBusy, { busy }),
|
|
334
|
+
/* @__PURE__ */ jsx15("img", { src: xyo_color_logo_text_only_default, height: logoHeight ?? 24, width: 45 })
|
|
335
|
+
] })
|
|
336
|
+
] })
|
|
392
337
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
}, /* @__PURE__ */ React15.createElement(Typography, {
|
|
396
|
-
style: {
|
|
397
|
-
fontSize: logoTextSize ?? 10
|
|
398
|
-
},
|
|
399
|
-
fontSize: "small"
|
|
400
|
-
}, "Powered by"), /* @__PURE__ */ React15.createElement(FlexRow3, null, /* @__PURE__ */ React15.createElement(XyoBusy, {
|
|
401
|
-
busy
|
|
402
|
-
}), /* @__PURE__ */ React15.createElement("img", {
|
|
403
|
-
src: xyo_color_logo_text_only_default,
|
|
404
|
-
height: logoHeight ?? 24,
|
|
405
|
-
width: 45
|
|
406
|
-
})))) : null;
|
|
407
|
-
}, "PoweredByXyoButton");
|
|
338
|
+
) : null;
|
|
339
|
+
};
|
|
408
340
|
|
|
409
341
|
// src/components/PoweredByXyo.tsx
|
|
410
|
-
|
|
342
|
+
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
343
|
+
var PoweredByXyo = ({
|
|
344
|
+
autoStop,
|
|
345
|
+
busy,
|
|
346
|
+
buttonProps,
|
|
347
|
+
debugDialog = false,
|
|
348
|
+
disableAnimation = false,
|
|
349
|
+
href = "https://xyo.network",
|
|
350
|
+
logoHeight,
|
|
351
|
+
logoTextSize,
|
|
352
|
+
onButtonClick,
|
|
353
|
+
node: propNode,
|
|
354
|
+
...props
|
|
355
|
+
}) => {
|
|
411
356
|
const [node] = useProvidedNode2();
|
|
412
357
|
const [debugDialogOpen, setDebugDialogOpen] = useState5(false);
|
|
413
|
-
const busyMap =
|
|
414
|
-
node
|
|
415
|
-
]);
|
|
358
|
+
const busyMap = {};
|
|
416
359
|
const activeBusy = busy ?? Object.values(busyMap).includes(true);
|
|
417
360
|
const activeOnButtonClick = (debugDialog ? (event) => {
|
|
418
361
|
if (event.shiftKey && event.altKey) {
|
|
@@ -422,77 +365,72 @@ var PoweredByXyo = /* @__PURE__ */ __name(({ autoStop, busy, buttonProps, debugD
|
|
|
422
365
|
}
|
|
423
366
|
} : void 0) ?? onButtonClick;
|
|
424
367
|
const activeHref = activeOnButtonClick ? void 0 : href;
|
|
425
|
-
const onKeyDownEscListener =
|
|
368
|
+
const onKeyDownEscListener = (event) => {
|
|
426
369
|
if (event.key === "Escape" && debugDialogOpen) {
|
|
427
370
|
setDebugDialogOpen(false);
|
|
428
371
|
}
|
|
429
|
-
}
|
|
430
|
-
useAsyncEffect(
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
372
|
+
};
|
|
373
|
+
useAsyncEffect(
|
|
374
|
+
async () => {
|
|
375
|
+
const activeNode = propNode ?? node;
|
|
376
|
+
if (disableAnimation) {
|
|
377
|
+
return;
|
|
378
|
+
} else if (activeNode) {
|
|
379
|
+
const mods = await activeNode?.resolve("*");
|
|
380
|
+
mods?.map((mod) => {
|
|
381
|
+
return mod.on("moduleBusy", ({ mod: mod2, busy: busy2 }) => {
|
|
382
|
+
busyMap[mod2.address] = busy2;
|
|
383
|
+
if (autoStop) {
|
|
384
|
+
forget(
|
|
385
|
+
(async () => {
|
|
386
|
+
await delay2(1e3);
|
|
387
|
+
busyMap[mod2.address] = false;
|
|
388
|
+
})()
|
|
389
|
+
);
|
|
390
|
+
}
|
|
391
|
+
});
|
|
392
|
+
});
|
|
393
|
+
activeNode?.on("moduleBusy", ({ mod, busy: busy2 }) => {
|
|
394
|
+
busyMap[mod.address] = busy2;
|
|
439
395
|
if (autoStop) {
|
|
440
|
-
forget(
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
396
|
+
forget(
|
|
397
|
+
(async () => {
|
|
398
|
+
await delay2(1e3);
|
|
399
|
+
busyMap[mod.address] = false;
|
|
400
|
+
})()
|
|
401
|
+
);
|
|
444
402
|
}
|
|
445
403
|
});
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
href: activeHref,
|
|
477
|
-
busy: activeBusy,
|
|
478
|
-
logoHeight,
|
|
479
|
-
logoTextSize,
|
|
480
|
-
fullWidth: true,
|
|
481
|
-
...buttonProps
|
|
482
|
-
}) : /* @__PURE__ */ React16.createElement(PoweredByXyoButton, {
|
|
483
|
-
onClick: activeOnButtonClick,
|
|
484
|
-
busy: activeBusy,
|
|
485
|
-
logoHeight,
|
|
486
|
-
logoTextSize,
|
|
487
|
-
fullWidth: true,
|
|
488
|
-
...buttonProps
|
|
489
|
-
})), debugDialog && debugDialogOpen ? /* @__PURE__ */ React16.createElement(DebugDialog, {
|
|
490
|
-
fullScreen: true,
|
|
491
|
-
open: debugDialogOpen,
|
|
492
|
-
onClose: /* @__PURE__ */ __name(() => setDebugDialogOpen(false), "onClose"),
|
|
493
|
-
onKeyDown: onKeyDownEscListener
|
|
494
|
-
}) : null);
|
|
495
|
-
}, "PoweredByXyo");
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
[disableAnimation, propNode, node, busyMap, autoStop]
|
|
407
|
+
);
|
|
408
|
+
return /* @__PURE__ */ jsxs7(FlexCol6, { alignItems: "stretch", position: "absolute", bottom: "0", left: "0", ...props, children: [
|
|
409
|
+
/* @__PURE__ */ jsx16(Paper, { sx: { borderRadius: 0 }, children: activeHref ? /* @__PURE__ */ jsx16(
|
|
410
|
+
PoweredByXyoButton,
|
|
411
|
+
{
|
|
412
|
+
onClick: activeOnButtonClick,
|
|
413
|
+
href: activeHref,
|
|
414
|
+
busy: activeBusy,
|
|
415
|
+
logoHeight,
|
|
416
|
+
logoTextSize,
|
|
417
|
+
fullWidth: true,
|
|
418
|
+
...buttonProps
|
|
419
|
+
}
|
|
420
|
+
) : /* @__PURE__ */ jsx16(
|
|
421
|
+
PoweredByXyoButton,
|
|
422
|
+
{
|
|
423
|
+
onClick: activeOnButtonClick,
|
|
424
|
+
busy: activeBusy,
|
|
425
|
+
logoHeight,
|
|
426
|
+
logoTextSize,
|
|
427
|
+
fullWidth: true,
|
|
428
|
+
...buttonProps
|
|
429
|
+
}
|
|
430
|
+
) }),
|
|
431
|
+
debugDialog && debugDialogOpen ? /* @__PURE__ */ jsx16(DebugDialog, { fullScreen: true, open: debugDialogOpen, onClose: () => setDebugDialogOpen(false), onKeyDown: onKeyDownEscListener }) : null
|
|
432
|
+
] });
|
|
433
|
+
};
|
|
496
434
|
export {
|
|
497
435
|
ArchivistSummary,
|
|
498
436
|
BridgeSummary,
|