@xyo-network/react-powered-by-xyo 2.77.0 → 2.77.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.
- package/dist/browser/index.cjs +1 -425
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +1 -392
- package/dist/browser/index.js.map +1 -1
- package/dist/neutral/index.cjs +1 -425
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.js +1 -392
- package/dist/neutral/index.js.map +1 -1
- package/dist/node/index.cjs +1 -444
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +1 -394
- package/dist/node/index.js.map +1 -1
- package/package.json +6 -6
package/dist/node/index.cjs
CHANGED
|
@@ -1,445 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/index.ts
|
|
31
|
-
var src_exports = {};
|
|
32
|
-
__export(src_exports, {
|
|
33
|
-
ArchivistSummary: () => ArchivistSummary,
|
|
34
|
-
BridgeSummary: () => BridgeSummary,
|
|
35
|
-
DebugDialog: () => DebugDialog,
|
|
36
|
-
DivinerSummary: () => DivinerSummary,
|
|
37
|
-
ModuleAccordion: () => ModuleAccordion,
|
|
38
|
-
ModuleDetails: () => ModuleDetails,
|
|
39
|
-
ModuleSummary: () => ModuleSummary,
|
|
40
|
-
NodeDetails: () => NodeDetails,
|
|
41
|
-
PoweredByXyo: () => PoweredByXyo,
|
|
42
|
-
PoweredByXyoButton: () => PoweredByXyoButton,
|
|
43
|
-
SentinelSummary: () => SentinelSummary,
|
|
44
|
-
TypedModuleSummary: () => TypedModuleSummary,
|
|
45
|
-
WitnessSummary: () => WitnessSummary,
|
|
46
|
-
XyoBusy: () => XyoBusy
|
|
47
|
-
});
|
|
48
|
-
module.exports = __toCommonJS(src_exports);
|
|
49
|
-
|
|
50
|
-
// src/components/ArchivistSummary.tsx
|
|
51
|
-
var import_icons_material2 = require("@mui/icons-material");
|
|
52
|
-
|
|
53
|
-
// src/components/ModuleSummary.tsx
|
|
54
|
-
var import_icons_material = require("@mui/icons-material");
|
|
55
|
-
var import_delay = require("@xylabs/delay");
|
|
56
|
-
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
57
|
-
var import_react_node = require("@xyo-network/react-node");
|
|
58
|
-
var import_react_shared = require("@xyo-network/react-shared");
|
|
59
|
-
var import_react = require("react");
|
|
60
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
61
|
-
var ModuleSummary = ({ children, icon, mod, ...props }) => {
|
|
62
|
-
var _a;
|
|
63
|
-
const [downModules] = (0, import_react_node.useWeakModulesFromNode)(void 0, { direction: "down" });
|
|
64
|
-
const [upModules] = (0, import_react_node.useWeakModulesFromNode)(void 0, { direction: "up" });
|
|
65
|
-
const [busy, setBusy] = (0, import_react.useState)(false);
|
|
66
|
-
const downModulesFromResolve = downModules == null ? void 0 : downModules.length;
|
|
67
|
-
const upModulesFromResolve = upModules == null ? void 0 : upModules.length;
|
|
68
|
-
mod == null ? void 0 : mod.on("moduleBusy", async ({ busy: busy2 }) => {
|
|
69
|
-
setBusy(busy2);
|
|
70
|
-
await (0, import_delay.delay)(2e3);
|
|
71
|
-
setBusy(false);
|
|
72
|
-
});
|
|
73
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexCol, { alignItems: "stretch", width: "100%", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { justifyContent: "flex-start", children: [
|
|
74
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_flexbox.FlexRow, { children: [
|
|
75
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_shared.TypographyEx, { color: busy ? "gray" : void 0, children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons_material.Extension, {}) }),
|
|
76
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_shared.TypographyEx, { marginX: 1, children: ((_a = mod == null ? void 0 : mod.config) == null ? void 0 : _a.name) ?? "<Unknown>" })
|
|
77
|
-
] }),
|
|
78
|
-
children ?? (downModulesFromResolve !== void 0 && upModulesFromResolve !== void 0) ? `[${downModulesFromResolve}\u2193/${upModulesFromResolve}\u2191]` : null
|
|
79
|
-
] }) });
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
// src/components/ArchivistSummary.tsx
|
|
83
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
84
|
-
var ArchivistSummary = ({ mod, ...props }) => {
|
|
85
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ModuleSummary, { mod, icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_icons_material2.Inventory2Rounded, {}), ...props });
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// src/components/BridgeSummary.tsx
|
|
89
|
-
var import_icons_material3 = require("@mui/icons-material");
|
|
90
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
91
|
-
var BridgeSummary = ({ mod, ...props }) => {
|
|
92
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ModuleSummary, { mod, icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_icons_material3.InsertLinkRounded, {}), ...props });
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
// src/components/DebugDialog.tsx
|
|
96
|
-
var import_material4 = require("@mui/material");
|
|
97
|
-
|
|
98
|
-
// src/components/NodeDetails.tsx
|
|
99
|
-
var import_react_flexbox3 = require("@xylabs/react-flexbox");
|
|
100
|
-
var import_react_node3 = require("@xyo-network/react-node");
|
|
101
|
-
|
|
102
|
-
// src/components/ModuleAccordion.tsx
|
|
103
|
-
var import_icons_material8 = require("@mui/icons-material");
|
|
104
|
-
var import_material3 = require("@mui/material");
|
|
105
|
-
|
|
106
|
-
// src/components/ModuleDetails.tsx
|
|
107
|
-
var import_material2 = require("@mui/material");
|
|
108
|
-
var import_react_button2 = require("@xylabs/react-button");
|
|
109
|
-
var import_react_flexbox2 = require("@xylabs/react-flexbox");
|
|
110
|
-
var import_react_promise = require("@xylabs/react-promise");
|
|
111
|
-
var import_module_model = require("@xyo-network/module-model");
|
|
112
|
-
var import_payload_model = require("@xyo-network/payload-model");
|
|
113
|
-
var import_react_property = require("@xyo-network/react-property");
|
|
114
|
-
|
|
115
|
-
// src/components/JsonViewerButton.tsx
|
|
116
|
-
var import_material = require("@mui/material");
|
|
117
|
-
var import_react_button = require("@xylabs/react-button");
|
|
118
|
-
var import_react_payload_raw_info = require("@xyo-network/react-payload-raw-info");
|
|
119
|
-
var import_react2 = require("react");
|
|
120
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
121
|
-
var JsonViewerButton = ({ children, jsonViewProps, src, title, ...props }) => {
|
|
122
|
-
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
123
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
124
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_button.ButtonEx, { onClick: () => setOpen(!open), ...props, children: children ?? "JSON" }),
|
|
125
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_material.Dialog, { open, onClose: () => setOpen(false), children: [
|
|
126
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material.DialogTitle, { children: title }) : null,
|
|
127
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_payload_raw_info.JsonViewerEx, { value: src, ...jsonViewProps }) }),
|
|
128
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material.DialogActions, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_button.ButtonEx, { onClick: () => setOpen(false), children: "Close" }) })
|
|
129
|
-
] })
|
|
130
|
-
] });
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
// src/components/ModuleDetails.tsx
|
|
134
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
135
|
-
var ModuleDetails = ({ mod, ...props }) => {
|
|
136
|
-
const [manifest] = (0, import_react_promise.usePromise)(async () => {
|
|
137
|
-
return await (mod == null ? void 0 : mod.manifest());
|
|
138
|
-
}, [mod]);
|
|
139
|
-
const [discover] = (0, import_react_promise.usePromise)(async () => {
|
|
140
|
-
return await (mod == null ? void 0 : mod.state());
|
|
141
|
-
}, [mod]);
|
|
142
|
-
const [describe] = (0, import_react_promise.usePromise)(async () => {
|
|
143
|
-
const state = await (mod == null ? void 0 : mod.state());
|
|
144
|
-
return state == null ? void 0 : state.find((0, import_payload_model.isPayloadOfSchemaType)(import_module_model.ModuleDescriptionSchema));
|
|
145
|
-
}, [mod]);
|
|
146
|
-
const queries = mod == null ? void 0 : mod.queries;
|
|
147
|
-
const config = mod == null ? void 0 : mod.config;
|
|
148
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_flexbox2.FlexCol, { alignItems: "stretch", ...props, children: [
|
|
149
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_property.Property, { title: "Address", value: mod == null ? void 0 : mod.address }),
|
|
150
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_flexbox2.FlexRow, { gap: 1, justifyContent: "space-between", children: [
|
|
151
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material2.ButtonGroup, { children: [
|
|
152
|
-
manifest ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(JsonViewerButton, { variant: "contained", src: manifest, children: "Manifest" }) : null,
|
|
153
|
-
config ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(JsonViewerButton, { variant: "contained", src: config, children: "Config" }) : null,
|
|
154
|
-
discover ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(JsonViewerButton, { variant: "contained", src: discover, children: "Discover" }) : null,
|
|
155
|
-
describe ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(JsonViewerButton, { variant: "contained", src: describe, children: "Describe" }) : null,
|
|
156
|
-
queries ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(JsonViewerButton, { variant: "contained", src: queries, children: "Queries" }) : null
|
|
157
|
-
] }),
|
|
158
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material2.ButtonGroup, { children: [
|
|
159
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_button2.ButtonEx, { target: "_blank", href: `https://explore.xyo.network/block?network=main&address=${mod == null ? void 0 : mod.address}`, variant: "outlined", children: "Main" }),
|
|
160
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_button2.ButtonEx, { target: "_blank", href: `https://beta.explore.xyo.network/block?network=kerplunk&address=${mod == null ? void 0 : mod.address}`, variant: "outlined", children: "Kerplunk" }),
|
|
161
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_button2.ButtonEx, { target: "_blank", href: `https://beta.explore.xyo.network/block?network=local&address=${mod == null ? void 0 : mod.address}`, variant: "outlined", children: "Local" })
|
|
162
|
-
] })
|
|
163
|
-
] })
|
|
164
|
-
] });
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
// src/components/TypedModuleSummary.tsx
|
|
168
|
-
var import_archivist_model = require("@xyo-network/archivist-model");
|
|
169
|
-
var import_bridge_model = require("@xyo-network/bridge-model");
|
|
170
|
-
var import_diviner_model = require("@xyo-network/diviner-model");
|
|
171
|
-
var import_node_model = require("@xyo-network/node-model");
|
|
172
|
-
var import_sentinel_model = require("@xyo-network/sentinel-model");
|
|
173
|
-
var import_witness_model = require("@xyo-network/witness-model");
|
|
174
|
-
|
|
175
|
-
// src/components/DivinerSummary.tsx
|
|
176
|
-
var import_icons_material4 = require("@mui/icons-material");
|
|
177
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
178
|
-
var DivinerSummary = ({ mod, ...props }) => {
|
|
179
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ModuleSummary, { mod, icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons_material4.BubbleChartRounded, {}), ...props });
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
// src/components/NodeSummary.tsx
|
|
183
|
-
var import_icons_material5 = require("@mui/icons-material");
|
|
184
|
-
var import_react_promise2 = require("@xylabs/react-promise");
|
|
185
|
-
var import_react_node2 = require("@xyo-network/react-node");
|
|
186
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
187
|
-
var NodeSummary = ({ mod, ...props }) => {
|
|
188
|
-
var _a, _b;
|
|
189
|
-
const [manifest] = (0, import_react_promise2.usePromise)(async () => {
|
|
190
|
-
return await (mod == null ? void 0 : mod.manifest());
|
|
191
|
-
}, [mod]);
|
|
192
|
-
const [downModules] = (0, import_react_node2.useWeakModulesFromNode)(void 0, { direction: "down" });
|
|
193
|
-
const [upModules] = (0, import_react_node2.useWeakModulesFromNode)(void 0, { direction: "up" });
|
|
194
|
-
const downModulesFromResolve = downModules == null ? void 0 : downModules.length;
|
|
195
|
-
const upModulesFromResolve = upModules == null ? void 0 : upModules.length;
|
|
196
|
-
const manifestPublicModules = (_b = (_a = manifest == null ? void 0 : manifest.modules) == null ? void 0 : _a.public) == null ? void 0 : _b.length;
|
|
197
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ModuleSummary, { mod, icon: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_icons_material5.HubRounded, {}), ...props, children: manifestPublicModules !== void 0 && downModulesFromResolve !== void 0 && upModulesFromResolve !== void 0 ? `[${manifestPublicModules}m/${downModulesFromResolve}\u2193/${upModulesFromResolve}\u2191]` : null });
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
// src/components/SentinelSummary.tsx
|
|
201
|
-
var import_icons_material6 = require("@mui/icons-material");
|
|
202
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
203
|
-
var SentinelSummary = ({ mod, ...props }) => {
|
|
204
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ModuleSummary, { mod, icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons_material6.TimerRounded, {}), ...props });
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
// src/components/WitnessSummary.tsx
|
|
208
|
-
var import_icons_material7 = require("@mui/icons-material");
|
|
209
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
210
|
-
var WitnessSummary = ({ mod, ...props }) => {
|
|
211
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ModuleSummary, { mod, icon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_icons_material7.VisibilityRounded, {}), ...props });
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
// src/components/TypedModuleSummary.tsx
|
|
215
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
216
|
-
var TypedModuleSummary = ({ mod, ...props }) => {
|
|
217
|
-
if ((0, import_archivist_model.isArchivistInstance)(mod)) {
|
|
218
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ArchivistSummary, { mod, ...props });
|
|
219
|
-
}
|
|
220
|
-
if ((0, import_diviner_model.isDivinerInstance)(mod)) {
|
|
221
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DivinerSummary, { mod, ...props });
|
|
222
|
-
}
|
|
223
|
-
if ((0, import_node_model.isNodeInstance)(mod)) {
|
|
224
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(NodeSummary, { mod, ...props });
|
|
225
|
-
}
|
|
226
|
-
if ((0, import_witness_model.isWitnessInstance)(mod)) {
|
|
227
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(WitnessSummary, { mod, ...props });
|
|
228
|
-
}
|
|
229
|
-
if ((0, import_bridge_model.isBridgeInstance)(mod)) {
|
|
230
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(BridgeSummary, { mod, ...props });
|
|
231
|
-
}
|
|
232
|
-
if ((0, import_sentinel_model.isSentinelInstance)(mod)) {
|
|
233
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SentinelSummary, { mod, ...props });
|
|
234
|
-
}
|
|
235
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ModuleSummary, { mod, ...props });
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
// src/components/ModuleAccordion.tsx
|
|
239
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
240
|
-
var ModuleAccordion = ({ mod, ...props }) => {
|
|
241
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_material3.Accordion, { ...props, children: [
|
|
242
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material3.AccordionSummary, { expandIcon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons_material8.ExpandMore, {}), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TypedModuleSummary, { mod }) }),
|
|
243
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_material3.AccordionDetails, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ModuleDetails, { mod }) })
|
|
244
|
-
] });
|
|
245
|
-
};
|
|
246
|
-
|
|
247
|
-
// src/components/NodeDetails.tsx
|
|
248
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
249
|
-
var NodeDetails = ({ mod, ...props }) => {
|
|
250
|
-
const [node = mod] = (0, import_react_node3.useProvidedNode)();
|
|
251
|
-
const [children] = (0, import_react_node3.useWeakModulesFromNode)(void 0, { node: node ?? void 0 });
|
|
252
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_flexbox3.FlexCol, { alignItems: "stretch", ...props, children: children ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_flexbox3.FlexCol, { alignItems: "stretch", marginY: 1, children: children == null ? void 0 : children.map((child) => {
|
|
253
|
-
const instance = child.deref();
|
|
254
|
-
return instance ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ModuleAccordion, { mod: instance }, instance.address) : null;
|
|
255
|
-
}) }) }) : null });
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
// src/components/DebugDialog.tsx
|
|
259
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
260
|
-
var DebugDialog = ({ onClose, ...props }) => {
|
|
261
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_material4.Dialog, { ...props, children: [
|
|
262
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_material4.DialogTitle, { children: "Xyo Module Viewer" }),
|
|
263
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_material4.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(NodeDetails, { width: "100%" }) }),
|
|
264
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_material4.DialogActions, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_material4.Button, { onClick: (event) => onClose == null ? void 0 : onClose(event, "backdropClick"), children: "Close" }) })
|
|
265
|
-
] });
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
// src/components/PoweredByXyo.tsx
|
|
269
|
-
var import_material6 = require("@mui/material");
|
|
270
|
-
var import_delay2 = require("@xylabs/delay");
|
|
271
|
-
var import_forget = require("@xylabs/forget");
|
|
272
|
-
var import_react_async_effect = require("@xylabs/react-async-effect");
|
|
273
|
-
var import_react_flexbox6 = require("@xylabs/react-flexbox");
|
|
274
|
-
var import_react_node4 = require("@xyo-network/react-node");
|
|
275
|
-
var import_react5 = require("react");
|
|
276
|
-
|
|
277
|
-
// src/components/PoweredByXyoButton.tsx
|
|
278
|
-
var import_material5 = require("@mui/material");
|
|
279
|
-
var import_react_button3 = require("@xylabs/react-button");
|
|
280
|
-
var import_react_flexbox5 = require("@xylabs/react-flexbox");
|
|
281
|
-
var import_react4 = require("react");
|
|
282
|
-
|
|
283
|
-
// src/img/index.ts
|
|
284
|
-
var import_xyo_color_logo = __toESM(require("./xyo-color-logo-LHR2SMEM.svg"), 1);
|
|
285
|
-
var import_xyo_color_logo_text_only = __toESM(require("./xyo-color-logo-text-only-QPAW5BSQ.svg"), 1);
|
|
286
|
-
|
|
287
|
-
// src/components/XyoBusy.tsx
|
|
288
|
-
var import_react_flexbox4 = require("@xylabs/react-flexbox");
|
|
289
|
-
var import_react3 = require("react");
|
|
290
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
291
|
-
var XyoBusy = ({ widthInPixels, busy, spinsPerSecond = 0.5, ...props }) => {
|
|
292
|
-
const [imageLoaded, setImageLoaded] = (0, import_react3.useState)(false);
|
|
293
|
-
if (!imageLoaded) {
|
|
294
|
-
const img = new Image();
|
|
295
|
-
img.addEventListener("load", () => setImageLoaded(true));
|
|
296
|
-
img.src = import_xyo_color_logo.default;
|
|
297
|
-
}
|
|
298
|
-
return imageLoaded ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
299
|
-
import_react_flexbox4.FlexCol,
|
|
300
|
-
{
|
|
301
|
-
sx: {
|
|
302
|
-
"@keyframes spin": {
|
|
303
|
-
"0%": {
|
|
304
|
-
transform: "rotate(360deg)"
|
|
305
|
-
},
|
|
306
|
-
"100%": {
|
|
307
|
-
transform: "rotate(0deg)"
|
|
308
|
-
}
|
|
309
|
-
},
|
|
310
|
-
animation: busy ? `spin ${1 / spinsPerSecond}s linear infinite` : void 0,
|
|
311
|
-
animationDirection: "reverse"
|
|
312
|
-
},
|
|
313
|
-
...props,
|
|
314
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { src: import_xyo_color_logo.default, height: widthInPixels ?? 22 })
|
|
315
|
-
}
|
|
316
|
-
) : null;
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
// src/components/PoweredByXyoButton.tsx
|
|
320
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
321
|
-
var PoweredByXyoButton = ({
|
|
322
|
-
busy = false,
|
|
323
|
-
href,
|
|
324
|
-
logoHeight,
|
|
325
|
-
logoTextSize,
|
|
326
|
-
sx,
|
|
327
|
-
target = "_blank",
|
|
328
|
-
variant = "text",
|
|
329
|
-
...props
|
|
330
|
-
}) => {
|
|
331
|
-
const [imageLoaded, setImageLoaded] = (0, import_react4.useState)(false);
|
|
332
|
-
const img = new Image();
|
|
333
|
-
img.addEventListener("load", () => setImageLoaded(true));
|
|
334
|
-
img.src = import_xyo_color_logo_text_only.default;
|
|
335
|
-
return imageLoaded ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react_button3.ButtonEx, { href, target, variant, sx: { borderRadius: 0, padding: 0, ...sx }, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_flexbox5.FlexCol, { padding: 0.5, children: [
|
|
336
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_material5.Typography, { style: { fontSize: logoTextSize ?? 10 }, fontSize: "small", children: "Powered by" }),
|
|
337
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react_flexbox5.FlexRow, { children: [
|
|
338
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(XyoBusy, { busy }),
|
|
339
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { src: import_xyo_color_logo_text_only.default, height: logoHeight ?? 24, width: 45 })
|
|
340
|
-
] })
|
|
341
|
-
] }) }) : null;
|
|
342
|
-
};
|
|
343
|
-
|
|
344
|
-
// src/components/PoweredByXyo.tsx
|
|
345
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
346
|
-
var PoweredByXyo = ({
|
|
347
|
-
autoStop,
|
|
348
|
-
busy,
|
|
349
|
-
buttonProps = {},
|
|
350
|
-
debugDialog = false,
|
|
351
|
-
disableAnimation = false,
|
|
352
|
-
href = "https://xyo.network",
|
|
353
|
-
logoHeight,
|
|
354
|
-
logoTextSize,
|
|
355
|
-
onButtonClick,
|
|
356
|
-
node: propNode,
|
|
357
|
-
...props
|
|
358
|
-
}) => {
|
|
359
|
-
const [node] = (0, import_react_node4.useProvidedNode)();
|
|
360
|
-
const [debugDialogOpen, setDebugDialogOpen] = (0, import_react5.useState)(false);
|
|
361
|
-
const busyMap = (0, import_react5.useMemo)(() => ({}), [node]);
|
|
362
|
-
const activeBusy = busy ?? Object.values(busyMap).includes(true);
|
|
363
|
-
const activeOnButtonClick = (debugDialog ? (event) => {
|
|
364
|
-
if (event.shiftKey && event.altKey) {
|
|
365
|
-
setDebugDialogOpen(true);
|
|
366
|
-
} else if (href) {
|
|
367
|
-
window.open(href);
|
|
368
|
-
}
|
|
369
|
-
} : void 0) ?? onButtonClick;
|
|
370
|
-
const activeHref = activeOnButtonClick ? void 0 : href;
|
|
371
|
-
const onKeyDownEscListener = (event) => {
|
|
372
|
-
if (event.key === "Escape" && debugDialogOpen) {
|
|
373
|
-
setDebugDialogOpen(false);
|
|
374
|
-
}
|
|
375
|
-
};
|
|
376
|
-
(0, import_react_async_effect.useAsyncEffect)(
|
|
377
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
378
|
-
async () => {
|
|
379
|
-
const activeNode = propNode ?? node;
|
|
380
|
-
if (disableAnimation) {
|
|
381
|
-
return;
|
|
382
|
-
} else if (activeNode) {
|
|
383
|
-
const mods = await (activeNode == null ? void 0 : activeNode.resolve("*"));
|
|
384
|
-
mods == null ? void 0 : mods.map((mod) => {
|
|
385
|
-
mod.on("moduleBusy", ({ module: mod2, busy: busy2 }) => {
|
|
386
|
-
busyMap[mod2.address] = busy2;
|
|
387
|
-
if (autoStop) {
|
|
388
|
-
(0, import_forget.forget)(
|
|
389
|
-
(async () => {
|
|
390
|
-
await (0, import_delay2.delay)(1e3);
|
|
391
|
-
busyMap[mod2.address] = false;
|
|
392
|
-
})()
|
|
393
|
-
);
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
});
|
|
397
|
-
activeNode == null ? void 0 : activeNode.on("moduleBusy", ({ module: mod, busy: busy2 }) => {
|
|
398
|
-
busyMap[mod.address] = busy2;
|
|
399
|
-
if (autoStop) {
|
|
400
|
-
(0, import_forget.forget)(
|
|
401
|
-
(async () => {
|
|
402
|
-
await (0, import_delay2.delay)(1e3);
|
|
403
|
-
busyMap[mod.address] = false;
|
|
404
|
-
})()
|
|
405
|
-
);
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
|
-
}
|
|
409
|
-
},
|
|
410
|
-
[disableAnimation, propNode, node, busyMap, autoStop]
|
|
411
|
-
);
|
|
412
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react_flexbox6.FlexCol, { alignItems: "stretch", position: "absolute", bottom: "0", left: "0", ...props, children: [
|
|
413
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_material6.Paper, { sx: { borderRadius: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
414
|
-
PoweredByXyoButton,
|
|
415
|
-
{
|
|
416
|
-
onClick: activeOnButtonClick,
|
|
417
|
-
href: activeHref,
|
|
418
|
-
busy: activeBusy,
|
|
419
|
-
logoHeight,
|
|
420
|
-
logoTextSize,
|
|
421
|
-
fullWidth: true,
|
|
422
|
-
...buttonProps
|
|
423
|
-
}
|
|
424
|
-
) }),
|
|
425
|
-
debugDialog && debugDialogOpen ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DebugDialog, { fullScreen: true, open: debugDialogOpen, onClose: () => setDebugDialogOpen(false), onKeyDown: onKeyDownEscListener }) : null
|
|
426
|
-
] });
|
|
427
|
-
};
|
|
428
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
429
|
-
0 && (module.exports = {
|
|
430
|
-
ArchivistSummary,
|
|
431
|
-
BridgeSummary,
|
|
432
|
-
DebugDialog,
|
|
433
|
-
DivinerSummary,
|
|
434
|
-
ModuleAccordion,
|
|
435
|
-
ModuleDetails,
|
|
436
|
-
ModuleSummary,
|
|
437
|
-
NodeDetails,
|
|
438
|
-
PoweredByXyo,
|
|
439
|
-
PoweredByXyoButton,
|
|
440
|
-
SentinelSummary,
|
|
441
|
-
TypedModuleSummary,
|
|
442
|
-
WitnessSummary,
|
|
443
|
-
XyoBusy
|
|
444
|
-
});
|
|
1
|
+
"use strict";var re=Object.create;var k=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var ie=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var ae=(o,e)=>{for(var r in e)k(o,r,{get:e[r],enumerable:!0})},Po=(o,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of ne(e))!se.call(o,t)&&t!==r&&k(o,t,{get:()=>e[t],enumerable:!(n=te(e,t))||n.enumerable});return o};var Bo=(o,e,r)=>(r=o!=null?re(ie(o)):{},Po(e||!o||!o.__esModule?k(r,"default",{value:o,enumerable:!0}):r,o)),le=o=>Po(k({},"__esModule",{value:!0}),o);var me={};ae(me,{ArchivistSummary:()=>_,BridgeSummary:()=>q,DebugDialog:()=>mo,DivinerSummary:()=>j,ModuleAccordion:()=>ao,ModuleDetails:()=>Y,ModuleSummary:()=>a,NodeDetails:()=>uo,PoweredByXyo:()=>ue,PoweredByXyoButton:()=>fo,SentinelSummary:()=>to,TypedModuleSummary:()=>so,WitnessSummary:()=>io,XyoBusy:()=>co});module.exports=le(me);var bo=require("@mui/icons-material");var Mo=require("@mui/icons-material"),wo=require("@xylabs/delay"),h=require("@xylabs/react-flexbox"),H=require("@xyo-network/react-node"),K=require("@xyo-network/react-shared"),So=require("react"),y=require("react/jsx-runtime"),a=({children:o,icon:e,mod:r,...n})=>{var w;let[t]=(0,H.useWeakModulesFromNode)(void 0,{direction:"down"}),[i]=(0,H.useWeakModulesFromNode)(void 0,{direction:"up"}),[s,u]=(0,So.useState)(!1),f=t==null?void 0:t.length,p=i==null?void 0:i.length;return r==null||r.on("moduleBusy",async({busy:F})=>{u(F),await(0,wo.delay)(2e3),u(!1)}),(0,y.jsx)(h.FlexCol,{alignItems:"stretch",width:"100%",...n,children:(0,y.jsxs)(h.FlexRow,{justifyContent:"flex-start",children:[(0,y.jsxs)(h.FlexRow,{children:[(0,y.jsx)(K.TypographyEx,{color:s?"gray":void 0,children:e??(0,y.jsx)(Mo.Extension,{})}),(0,y.jsx)(K.TypographyEx,{marginX:1,children:((w=r==null?void 0:r.config)==null?void 0:w.name)??"<Unknown>"})]}),o??(f!==void 0&&p!==void 0)?`[${f}\u2193/${p}\u2191]`:null]})})};var z=require("react/jsx-runtime"),_=({mod:o,...e})=>(0,z.jsx)(a,{mod:o,icon:(0,z.jsx)(bo.Inventory2Rounded,{}),...e});var Io=require("@mui/icons-material");var G=require("react/jsx-runtime"),q=({mod:o,...e})=>(0,G.jsx)(a,{mod:o,icon:(0,G.jsx)(Io.InsertLinkRounded,{}),...e});var c=require("@mui/material");var lo=require("@xylabs/react-flexbox"),N=require("@xyo-network/react-node");var $o=require("@mui/icons-material"),D=require("@mui/material");var U=require("@mui/material"),E=require("@xylabs/react-button"),A=require("@xylabs/react-flexbox"),T=require("@xylabs/react-promise"),Fo=require("@xyo-network/module-model"),ho=require("@xyo-network/payload-model"),Ro=require("@xyo-network/react-property");var x=require("@mui/material"),Q=require("@xylabs/react-button"),Do=require("@xyo-network/react-payload-raw-info"),Co=require("react"),d=require("react/jsx-runtime"),I=({children:o,jsonViewProps:e,src:r,title:n,...t})=>{let[i,s]=(0,Co.useState)(!1);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Q.ButtonEx,{onClick:()=>s(!i),...t,children:o??"JSON"}),(0,d.jsxs)(x.Dialog,{open:i,onClose:()=>s(!1),children:[n?(0,d.jsx)(x.DialogTitle,{children:n}):null,(0,d.jsx)(x.DialogContent,{children:(0,d.jsx)(Do.JsonViewerEx,{value:r,...e})}),(0,d.jsx)(x.DialogActions,{children:(0,d.jsx)(Q.ButtonEx,{onClick:()=>s(!1),children:"Close"})})]})]})};var l=require("react/jsx-runtime"),Y=({mod:o,...e})=>{let[r]=(0,T.usePromise)(async()=>await(o==null?void 0:o.manifest()),[o]),[n]=(0,T.usePromise)(async()=>await(o==null?void 0:o.state()),[o]),[t]=(0,T.usePromise)(async()=>{let u=await(o==null?void 0:o.state());return u==null?void 0:u.find((0,ho.isPayloadOfSchemaType)(Fo.ModuleDescriptionSchema))},[o]),i=o==null?void 0:o.queries,s=o==null?void 0:o.config;return(0,l.jsxs)(A.FlexCol,{alignItems:"stretch",...e,children:[(0,l.jsx)(Ro.Property,{title:"Address",value:o==null?void 0:o.address}),(0,l.jsxs)(A.FlexRow,{gap:1,justifyContent:"space-between",children:[(0,l.jsxs)(U.ButtonGroup,{children:[r?(0,l.jsx)(I,{variant:"contained",src:r,children:"Manifest"}):null,s?(0,l.jsx)(I,{variant:"contained",src:s,children:"Config"}):null,n?(0,l.jsx)(I,{variant:"contained",src:n,children:"Discover"}):null,t?(0,l.jsx)(I,{variant:"contained",src:t,children:"Describe"}):null,i?(0,l.jsx)(I,{variant:"contained",src:i,children:"Queries"}):null]}),(0,l.jsxs)(U.ButtonGroup,{children:[(0,l.jsx)(E.ButtonEx,{target:"_blank",href:`https://explore.xyo.network/block?network=main&address=${o==null?void 0:o.address}`,variant:"outlined",children:"Main"}),(0,l.jsx)(E.ButtonEx,{target:"_blank",href:`https://beta.explore.xyo.network/block?network=kerplunk&address=${o==null?void 0:o.address}`,variant:"outlined",children:"Kerplunk"}),(0,l.jsx)(E.ButtonEx,{target:"_blank",href:`https://beta.explore.xyo.network/block?network=local&address=${o==null?void 0:o.address}`,variant:"outlined",children:"Local"})]})]})]})};var Vo=require("@xyo-network/archivist-model"),Xo=require("@xyo-network/bridge-model"),Lo=require("@xyo-network/diviner-model"),Jo=require("@xyo-network/node-model"),Oo=require("@xyo-network/sentinel-model"),Wo=require("@xyo-network/witness-model");var vo=require("@mui/icons-material");var Z=require("react/jsx-runtime"),j=({mod:o,...e})=>(0,Z.jsx)(a,{mod:o,icon:(0,Z.jsx)(vo.BubbleChartRounded,{}),...e});var ko=require("@mui/icons-material"),Eo=require("@xylabs/react-promise"),oo=require("@xyo-network/react-node");var eo=require("react/jsx-runtime"),To=({mod:o,...e})=>{var f,p;let[r]=(0,Eo.usePromise)(async()=>await(o==null?void 0:o.manifest()),[o]),[n]=(0,oo.useWeakModulesFromNode)(void 0,{direction:"down"}),[t]=(0,oo.useWeakModulesFromNode)(void 0,{direction:"up"}),i=n==null?void 0:n.length,s=t==null?void 0:t.length,u=(p=(f=r==null?void 0:r.modules)==null?void 0:f.public)==null?void 0:p.length;return(0,eo.jsx)(a,{mod:o,icon:(0,eo.jsx)(ko.HubRounded,{}),...e,children:u!==void 0&&i!==void 0&&s!==void 0?`[${u}m/${i}\u2193/${s}\u2191]`:null})};var Ao=require("@mui/icons-material");var ro=require("react/jsx-runtime"),to=({mod:o,...e})=>(0,ro.jsx)(a,{mod:o,icon:(0,ro.jsx)(Ao.TimerRounded,{}),...e});var No=require("@mui/icons-material");var no=require("react/jsx-runtime"),io=({mod:o,...e})=>(0,no.jsx)(a,{mod:o,icon:(0,no.jsx)(No.VisibilityRounded,{}),...e});var g=require("react/jsx-runtime"),so=({mod:o,...e})=>(0,Vo.isArchivistInstance)(o)?(0,g.jsx)(_,{mod:o,...e}):(0,Lo.isDivinerInstance)(o)?(0,g.jsx)(j,{mod:o,...e}):(0,Jo.isNodeInstance)(o)?(0,g.jsx)(To,{mod:o,...e}):(0,Wo.isWitnessInstance)(o)?(0,g.jsx)(io,{mod:o,...e}):(0,Xo.isBridgeInstance)(o)?(0,g.jsx)(q,{mod:o,...e}):(0,Oo.isSentinelInstance)(o)?(0,g.jsx)(to,{mod:o,...e}):(0,g.jsx)(a,{mod:o,...e});var P=require("react/jsx-runtime"),ao=({mod:o,...e})=>(0,P.jsxs)(D.Accordion,{...e,children:[(0,P.jsx)(D.AccordionSummary,{expandIcon:(0,P.jsx)($o.ExpandMore,{}),children:(0,P.jsx)(so,{mod:o})}),(0,P.jsx)(D.AccordionDetails,{children:(0,P.jsx)(Y,{mod:o})})]});var S=require("react/jsx-runtime"),uo=({mod:o,...e})=>{let[r=o]=(0,N.useProvidedNode)(),[n]=(0,N.useWeakModulesFromNode)(void 0,{node:r??void 0});return(0,S.jsx)(lo.FlexCol,{alignItems:"stretch",...e,children:n?(0,S.jsx)(S.Fragment,{children:(0,S.jsx)(lo.FlexCol,{alignItems:"stretch",marginY:1,children:n==null?void 0:n.map(t=>{let i=t.deref();return i?(0,S.jsx)(ao,{mod:i},i.address):null})})}):null})};var B=require("react/jsx-runtime"),mo=({onClose:o,...e})=>(0,B.jsxs)(c.Dialog,{...e,children:[(0,B.jsx)(c.DialogTitle,{children:"Xyo Module Viewer"}),(0,B.jsx)(c.DialogContent,{children:(0,B.jsx)(uo,{width:"100%"})}),(0,B.jsx)(c.DialogActions,{children:(0,B.jsx)(c.Button,{onClick:r=>o==null?void 0:o(r,"backdropClick"),children:"Close"})})]});var qo=require("@mui/material"),yo=require("@xylabs/delay"),xo=require("@xylabs/forget"),Qo=require("@xylabs/react-async-effect"),Uo=require("@xylabs/react-flexbox"),Yo=require("@xyo-network/react-node"),J=require("react");var zo=require("@mui/material"),_o=require("@xylabs/react-button"),L=require("@xylabs/react-flexbox"),Go=require("react");var V=Bo(require("./xyo-color-logo-LHR2SMEM.svg"),1),X=Bo(require("./xyo-color-logo-text-only-QPAW5BSQ.svg"),1);var Ho=require("@xylabs/react-flexbox"),Ko=require("react");var po=require("react/jsx-runtime"),co=({widthInPixels:o,busy:e,spinsPerSecond:r=.5,...n})=>{let[t,i]=(0,Ko.useState)(!1);if(!t){let s=new Image;s.addEventListener("load",()=>i(!0)),s.src=V.default}return t?(0,po.jsx)(Ho.FlexCol,{sx:{"@keyframes spin":{"0%":{transform:"rotate(360deg)"},"100%":{transform:"rotate(0deg)"}},animation:e?`spin ${1/r}s linear infinite`:void 0,animationDirection:"reverse"},...n,children:(0,po.jsx)("img",{src:V.default,height:o??22})}):null};var M=require("react/jsx-runtime"),fo=({busy:o=!1,href:e,logoHeight:r,logoTextSize:n,sx:t,target:i="_blank",variant:s="text",...u})=>{let[f,p]=(0,Go.useState)(!1),w=new Image;return w.addEventListener("load",()=>p(!0)),w.src=X.default,f?(0,M.jsx)(_o.ButtonEx,{href:e,target:i,variant:s,sx:{borderRadius:0,padding:0,...t},...u,children:(0,M.jsxs)(L.FlexCol,{padding:.5,children:[(0,M.jsx)(zo.Typography,{style:{fontSize:n??10},fontSize:"small",children:"Powered by"}),(0,M.jsxs)(L.FlexRow,{children:[(0,M.jsx)(co,{busy:o}),(0,M.jsx)("img",{src:X.default,height:r??24,width:45})]})]})}):null};var C=require("react/jsx-runtime"),ue=({autoStop:o,busy:e,buttonProps:r={},debugDialog:n=!1,disableAnimation:t=!1,href:i="https://xyo.network",logoHeight:s,logoTextSize:u,onButtonClick:f,node:p,...w})=>{let[F]=(0,Yo.useProvidedNode)(),[O,W]=(0,J.useState)(!1),b=(0,J.useMemo)(()=>({}),[F]),Zo=e??Object.values(b).includes(!0),go=(n?m=>{m.shiftKey&&m.altKey?W(!0):i&&window.open(i)}:void 0)??f,jo=go?void 0:i,oe=m=>{m.key==="Escape"&&O&&W(!1)};return(0,Qo.useAsyncEffect)(async()=>{let m=p??F;if(!t&&m){let $=await(m==null?void 0:m.resolve("*"));$==null||$.map(R=>{R.on("moduleBusy",({module:v,busy:ee})=>{b[v.address]=ee,o&&(0,xo.forget)((async()=>{await(0,yo.delay)(1e3),b[v.address]=!1})())})}),m==null||m.on("moduleBusy",({module:R,busy:v})=>{b[R.address]=v,o&&(0,xo.forget)((async()=>{await(0,yo.delay)(1e3),b[R.address]=!1})())})}},[t,p,F,b,o]),(0,C.jsxs)(Uo.FlexCol,{alignItems:"stretch",position:"absolute",bottom:"0",left:"0",...w,children:[(0,C.jsx)(qo.Paper,{sx:{borderRadius:0},children:(0,C.jsx)(fo,{onClick:go,href:jo,busy:Zo,logoHeight:s,logoTextSize:u,fullWidth:!0,...r})}),n&&O?(0,C.jsx)(mo,{fullScreen:!0,open:O,onClose:()=>W(!1),onKeyDown:oe}):null]})};0&&(module.exports={ArchivistSummary,BridgeSummary,DebugDialog,DivinerSummary,ModuleAccordion,ModuleDetails,ModuleSummary,NodeDetails,PoweredByXyo,PoweredByXyoButton,SentinelSummary,TypedModuleSummary,WitnessSummary,XyoBusy});
|
|
445
2
|
//# sourceMappingURL=index.cjs.map
|