@xyo-network/react-typedoc 2.77.0-rc.1 → 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 -616
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +1 -593
- package/dist/browser/index.js.map +1 -1
- package/dist/neutral/index.cjs +1 -616
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.js +1 -593
- package/dist/neutral/index.js.map +1 -1
- package/dist/node/index.cjs +1 -643
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +1 -603
- package/dist/node/index.js.map +1 -1
- package/package.json +10 -11
package/dist/browser/index.cjs
CHANGED
|
@@ -1,617 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
|
|
20
|
-
// src/index.ts
|
|
21
|
-
var src_exports = {};
|
|
22
|
-
__export(src_exports, {
|
|
23
|
-
CommentViewer: () => CommentViewer,
|
|
24
|
-
ContainerReflectionViewer: () => ContainerReflectionViewer,
|
|
25
|
-
DeclarationContainerReflectionViewer: () => DeclarationContainerReflectionViewer,
|
|
26
|
-
DeclarationReflectionViewer: () => DeclarationReflectionViewer,
|
|
27
|
-
JsonViewerButton: () => JsonViewerButton,
|
|
28
|
-
ProjectReflectionViewer: () => ProjectReflectionViewer,
|
|
29
|
-
ProjectTwoPanelReflectionViewer: () => ProjectTwoPanelReflectionViewer,
|
|
30
|
-
ReflectionGroupTreeViewer: () => ReflectionGroupTreeViewer,
|
|
31
|
-
ReflectionGroupViewer: () => ReflectionGroupViewer,
|
|
32
|
-
ReflectionTreeViewer: () => ReflectionTreeViewer,
|
|
33
|
-
ReflectionViewer: () => ReflectionViewer,
|
|
34
|
-
SomeTypeViewer: () => SomeTypeViewer,
|
|
35
|
-
SourceViewer: () => SourceViewer,
|
|
36
|
-
TwoPanelReflectionViewer: () => TwoPanelReflectionViewer
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(src_exports);
|
|
39
|
-
|
|
40
|
-
// src/CommentViewer.tsx
|
|
41
|
-
var import_material = require("@mui/material");
|
|
42
|
-
var import_react_flexbox = require("@xylabs/react-flexbox");
|
|
43
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
44
|
-
var CommentViewer = ({ comment, ...props }) => {
|
|
45
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_flexbox.FlexCol, { alignItems: "stretch", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Typography, { variant: "body2", children: comment.summary[0]?.text }) });
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// src/JsonViewerButton.tsx
|
|
49
|
-
var import_material2 = require("@mui/material");
|
|
50
|
-
var import_react_button = require("@xylabs/react-button");
|
|
51
|
-
var import_react_payload_raw_info = require("@xyo-network/react-payload-raw-info");
|
|
52
|
-
var import_react = require("react");
|
|
53
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
54
|
-
var JsonViewerButton = ({ jsonViewProps, src, title, ...props }) => {
|
|
55
|
-
const [open, setOpen] = (0, import_react.useState)(false);
|
|
56
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
57
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_button.ButtonEx, { onClick: () => setOpen(!open), ...props, children: "JSON" }),
|
|
58
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_material2.Dialog, { open, onClose: () => setOpen(false), children: [
|
|
59
|
-
title ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.DialogTitle, { children: title }) : null,
|
|
60
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_payload_raw_info.JsonViewerEx, { value: src, ...jsonViewProps }) }),
|
|
61
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_material2.DialogActions, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_button.ButtonEx, { onClick: () => setOpen(false), children: "Close" }) })
|
|
62
|
-
] })
|
|
63
|
-
] });
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// src/ProjectTwoPanelReflectionViewer.tsx
|
|
67
|
-
var import_assert = require("@xylabs/assert");
|
|
68
|
-
|
|
69
|
-
// src/createLookup.ts
|
|
70
|
-
var createLookup = (reflection) => {
|
|
71
|
-
const lookup = {};
|
|
72
|
-
if (reflection.children)
|
|
73
|
-
for (const item of reflection.children)
|
|
74
|
-
lookup[item.id] = item;
|
|
75
|
-
return lookup;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// src/ReflectionViewer/ReflectionGroupViewer.tsx
|
|
79
|
-
var import_material5 = require("@mui/material");
|
|
80
|
-
var import_react_flexbox4 = require("@xylabs/react-flexbox");
|
|
81
|
-
var import_react2 = require("react");
|
|
82
|
-
var import_react_router_dom = require("react-router-dom");
|
|
83
|
-
|
|
84
|
-
// src/resolveChildren.ts
|
|
85
|
-
var resolveChildren = (reflection, lookup = {}) => {
|
|
86
|
-
return reflection.children?.map((child) => {
|
|
87
|
-
switch (typeof child) {
|
|
88
|
-
case "object": {
|
|
89
|
-
return child;
|
|
90
|
-
}
|
|
91
|
-
case "number": {
|
|
92
|
-
const childObj = lookup[child];
|
|
93
|
-
if (childObj === void 0) {
|
|
94
|
-
throw new Error(`Child Reference Not Found [${child}]`);
|
|
95
|
-
}
|
|
96
|
-
return childObj;
|
|
97
|
-
}
|
|
98
|
-
default: {
|
|
99
|
-
throw new Error(`Invalid Child Type [${typeof child}, ${child}]`);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}) ?? [];
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
// src/ReflectionViewer/ReflectionViewer.tsx
|
|
106
|
-
var import_react_flexbox3 = require("@xylabs/react-flexbox");
|
|
107
|
-
|
|
108
|
-
// src/ReflectionViewer/NameViewer.tsx
|
|
109
|
-
var import_material4 = require("@mui/material");
|
|
110
|
-
var import_react_flexbox2 = require("@xylabs/react-flexbox");
|
|
111
|
-
|
|
112
|
-
// src/trimFlagLabel.ts
|
|
113
|
-
var trimFlagLabel = (label) => {
|
|
114
|
-
if (label.startsWith("is")) {
|
|
115
|
-
return label.slice(2);
|
|
116
|
-
}
|
|
117
|
-
return label;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
// src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx
|
|
121
|
-
var import_material3 = require("@mui/material");
|
|
122
|
-
|
|
123
|
-
// src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx
|
|
124
|
-
var buildArrayString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
125
|
-
const parts = [];
|
|
126
|
-
const typeString = typeBuilder(typeObj.elementType, reflectionViewer);
|
|
127
|
-
if (typeof typeString === "string") {
|
|
128
|
-
parts.push(typeString);
|
|
129
|
-
}
|
|
130
|
-
parts.push("[]");
|
|
131
|
-
return parts;
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
// src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx
|
|
135
|
-
var buildIntersectionString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
136
|
-
const parts = [];
|
|
137
|
-
if (typeObj.types) {
|
|
138
|
-
parts.push(
|
|
139
|
-
typeObj.types.map((arg) => {
|
|
140
|
-
return typeBuilder(arg, reflectionViewer);
|
|
141
|
-
}).join(" & ")
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
return parts;
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
// src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts
|
|
148
|
-
var buildReferenceString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
149
|
-
const parts = [];
|
|
150
|
-
parts.push(typeObj.name);
|
|
151
|
-
if (typeObj.typeArguments) {
|
|
152
|
-
parts.push(
|
|
153
|
-
"<",
|
|
154
|
-
typeObj.typeArguments.map((arg) => {
|
|
155
|
-
return typeBuilder(arg, reflectionViewer);
|
|
156
|
-
}).join(", "),
|
|
157
|
-
">"
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
return parts;
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
// src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx
|
|
164
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
165
|
-
var buildRelfectionString = (typeObj, reflectionViewer) => {
|
|
166
|
-
if (typeObj.declaration) {
|
|
167
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: reflectionViewer({ reflection: typeObj.declaration }) });
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
// src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx
|
|
172
|
-
var buildUnionString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
173
|
-
const parts = [];
|
|
174
|
-
if (typeObj.types) {
|
|
175
|
-
parts.push(
|
|
176
|
-
typeObj.types.map((arg) => {
|
|
177
|
-
return typeBuilder(arg, reflectionViewer);
|
|
178
|
-
}).join(" | ")
|
|
179
|
-
);
|
|
180
|
-
}
|
|
181
|
-
return parts;
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
// src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx
|
|
185
|
-
var buildTypeString = (type, reflectionViewer) => {
|
|
186
|
-
const someType = type;
|
|
187
|
-
const parts = [];
|
|
188
|
-
switch (someType.type) {
|
|
189
|
-
case "intrinsic": {
|
|
190
|
-
parts.push(someType.name);
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
case "intersection": {
|
|
194
|
-
parts.push(...buildIntersectionString(someType, reflectionViewer, buildTypeString));
|
|
195
|
-
break;
|
|
196
|
-
}
|
|
197
|
-
case "literal": {
|
|
198
|
-
parts.push(JSON.stringify(someType.value));
|
|
199
|
-
break;
|
|
200
|
-
}
|
|
201
|
-
case "array": {
|
|
202
|
-
parts.push(...buildArrayString(someType, reflectionViewer, buildTypeString));
|
|
203
|
-
break;
|
|
204
|
-
}
|
|
205
|
-
case "reference": {
|
|
206
|
-
parts.push(...buildReferenceString(someType, reflectionViewer, buildTypeString));
|
|
207
|
-
break;
|
|
208
|
-
}
|
|
209
|
-
case "union": {
|
|
210
|
-
parts.push(...buildUnionString(someType, reflectionViewer, buildTypeString));
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
case "reflection": {
|
|
214
|
-
return buildRelfectionString(someType, reflectionViewer);
|
|
215
|
-
}
|
|
216
|
-
default: {
|
|
217
|
-
parts.push("#", someType.type, "#");
|
|
218
|
-
break;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return parts.join("");
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
// src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx
|
|
225
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
226
|
-
var SomeTypeViewer = ({ opacity = 0.5, reflection, reflectionViewer, ...props }) => {
|
|
227
|
-
const typeReactNode = reflection.type ? buildTypeString(reflection.type, reflectionViewer) : "";
|
|
228
|
-
if (typeof typeReactNode === "string") {
|
|
229
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material3.Typography, { title: "SomeTypeViewer", style: { opacity }, ...props, children: typeReactNode });
|
|
230
|
-
}
|
|
231
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: typeReactNode });
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
// src/ReflectionViewer/NameViewer.tsx
|
|
235
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
236
|
-
var NameViewer = ({ reflectionViewer, variant, reflection, ...props }) => {
|
|
237
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_flexbox2.FlexRow, { justifyContent: "flex-start", ...props, children: [
|
|
238
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react_flexbox2.FlexRow, { marginRight: 1, children: [
|
|
239
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material4.Typography, { variant, noWrap: true, children: [
|
|
240
|
-
reflection.name,
|
|
241
|
-
reflection.type ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: ":\xA0" }) : null
|
|
242
|
-
] }),
|
|
243
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SomeTypeViewer, { reflection, reflectionViewer })
|
|
244
|
-
] }),
|
|
245
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material4.Stack, { direction: "row", spacing: 1, children: [
|
|
246
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material4.Chip, { size: "small", label: reflection.kind }),
|
|
247
|
-
reflection.flags ? Object.entries(reflection.flags).map(([flag, value]) => {
|
|
248
|
-
return value ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material4.Chip, { size: "small", label: trimFlagLabel(flag), variant: "outlined" }, flag) : null;
|
|
249
|
-
}) : null
|
|
250
|
-
] }),
|
|
251
|
-
document && document?.location.hostname === "localhost" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(JsonViewerButton, { size: "small", variant: "contained", padding: 0, marginX: 1, src: reflection })
|
|
252
|
-
] });
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
// src/ReflectionViewer/ReflectionViewer.tsx
|
|
256
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
257
|
-
var hide = (flags, hiddenFlags = []) => {
|
|
258
|
-
let hide3 = false;
|
|
259
|
-
hiddenFlags.map((hiddenFlag) => {
|
|
260
|
-
if (flags?.[hiddenFlag]) {
|
|
261
|
-
hide3 = true;
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
return hide3;
|
|
265
|
-
};
|
|
266
|
-
var ReflectionViewer = ({ variant, nameViewer, children, reflection, hiddenFlags, ...props }) => {
|
|
267
|
-
const someReflection = reflection;
|
|
268
|
-
return hide(reflection?.flags, hiddenFlags) ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_flexbox3.FlexCol, { title: "ReflectionViewer", alignItems: "stretch", ...props, children: [
|
|
269
|
-
nameViewer === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(NameViewer, { marginY: 0.25, variant, reflection: someReflection, reflectionViewer: ReflectionViewer }) : nameViewer,
|
|
270
|
-
reflection.comment ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CommentViewer, { comment: reflection.comment }) : null,
|
|
271
|
-
someReflection.parameters?.map((parameter) => {
|
|
272
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ReflectionViewer, { hiddenFlags, marginY: 0.25, marginX: 1, reflection: parameter }, parameter.id);
|
|
273
|
-
}) ?? null,
|
|
274
|
-
children
|
|
275
|
-
] });
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
// src/ReflectionViewer/ReflectionGroupViewer.tsx
|
|
279
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
280
|
-
var hide2 = (flags, hiddenFlags = []) => {
|
|
281
|
-
let hide3 = false;
|
|
282
|
-
hiddenFlags.map((hiddenFlag) => {
|
|
283
|
-
if (flags?.[hiddenFlag]) {
|
|
284
|
-
hide3 = true;
|
|
285
|
-
}
|
|
286
|
-
});
|
|
287
|
-
return hide3;
|
|
288
|
-
};
|
|
289
|
-
var ReflectionGroupViewer = ({
|
|
290
|
-
autoScroll = false,
|
|
291
|
-
children,
|
|
292
|
-
hiddenFlags,
|
|
293
|
-
group,
|
|
294
|
-
lookup,
|
|
295
|
-
renderer = ReflectionViewer,
|
|
296
|
-
variant,
|
|
297
|
-
...props
|
|
298
|
-
}) => {
|
|
299
|
-
const resolvedChildren = resolveChildren(group, lookup) ?? [];
|
|
300
|
-
const visibleChildren = hiddenFlags ? resolvedChildren.reduce((acc, item) => {
|
|
301
|
-
return acc + (hide2(item.flags, hiddenFlags) ? 0 : 1);
|
|
302
|
-
}, 0) : 1;
|
|
303
|
-
const { hash } = (0, import_react_router_dom.useLocation)();
|
|
304
|
-
(0, import_react2.useEffect)(() => {
|
|
305
|
-
if (hash && autoScroll) {
|
|
306
|
-
document.querySelector(hash)?.scrollIntoView({ behavior: "smooth" });
|
|
307
|
-
}
|
|
308
|
-
}, [hash, autoScroll]);
|
|
309
|
-
return visibleChildren > 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react_flexbox4.FlexCol, { title: "ReflectionGroupViewer", ...props, children: [
|
|
310
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react_flexbox4.FlexRow, { marginY: 1, justifyContent: "flex-start", children: [
|
|
311
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material5.Typography, { variant, children: group.title }),
|
|
312
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(JsonViewerButton, { size: "small", variant: "contained", padding: 0, marginX: 1, src: resolveChildren(group, lookup) })
|
|
313
|
-
] }),
|
|
314
|
-
resolveChildren(group, lookup).map((reflection) => {
|
|
315
|
-
return reflection ? (
|
|
316
|
-
// I wrap this in a div since React does not understand that they have keys using the Renderer
|
|
317
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { id: reflection.name, children: renderer({ hiddenFlags, lookup, margin: 1, padding: 1, reflection }) }, reflection.id)
|
|
318
|
-
) : null;
|
|
319
|
-
}),
|
|
320
|
-
children
|
|
321
|
-
] }) : null;
|
|
322
|
-
};
|
|
323
|
-
|
|
324
|
-
// src/ReflectionViewer/Container.tsx
|
|
325
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
326
|
-
var ContainerReflectionViewer = ({
|
|
327
|
-
children,
|
|
328
|
-
reflection,
|
|
329
|
-
hiddenFlags,
|
|
330
|
-
itemRenderer = ReflectionViewer,
|
|
331
|
-
...props
|
|
332
|
-
}) => {
|
|
333
|
-
const lookup = createLookup(reflection);
|
|
334
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(ReflectionViewer, { title: "ContainerReflectionViewer", sources: true, reflection, lookup, ...props, children: [
|
|
335
|
-
reflection.groups?.map((group) => {
|
|
336
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
337
|
-
ReflectionGroupViewer,
|
|
338
|
-
{
|
|
339
|
-
margin: 1,
|
|
340
|
-
lookup,
|
|
341
|
-
renderer: itemRenderer,
|
|
342
|
-
group,
|
|
343
|
-
reflection,
|
|
344
|
-
hiddenFlags,
|
|
345
|
-
alignItems: "stretch"
|
|
346
|
-
},
|
|
347
|
-
group.title
|
|
348
|
-
);
|
|
349
|
-
}),
|
|
350
|
-
children
|
|
351
|
-
] });
|
|
352
|
-
};
|
|
353
|
-
|
|
354
|
-
// src/ReflectionViewer/Declaration.tsx
|
|
355
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
356
|
-
var DeclarationReflectionViewer = ({ reflection, hiddenFlags, ...props }) => {
|
|
357
|
-
const safeSignatures = (signatures) => {
|
|
358
|
-
return Array.isArray(signatures) ? signatures : signatures ? [signatures] : void 0;
|
|
359
|
-
};
|
|
360
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
361
|
-
ReflectionViewer,
|
|
362
|
-
{
|
|
363
|
-
nameViewer: reflection.signatures || reflection.getSignature || reflection.setSignature ? null : void 0,
|
|
364
|
-
title: "DeclarationReflectionViewer",
|
|
365
|
-
hiddenFlags,
|
|
366
|
-
reflection,
|
|
367
|
-
...props,
|
|
368
|
-
children: [
|
|
369
|
-
reflection.signatures?.map((signature) => {
|
|
370
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ReflectionViewer, { hiddenFlags, reflection: signature }, signature.id);
|
|
371
|
-
}),
|
|
372
|
-
safeSignatures(reflection.getSignature)?.map((signature) => {
|
|
373
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ReflectionViewer, { marginX: 1, hiddenFlags, reflection: signature }, signature.id);
|
|
374
|
-
}),
|
|
375
|
-
safeSignatures(reflection.setSignature)?.map((signature) => {
|
|
376
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ReflectionViewer, { marginX: 1, hiddenFlags, reflection: signature }, signature.id);
|
|
377
|
-
})
|
|
378
|
-
]
|
|
379
|
-
}
|
|
380
|
-
);
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
// src/ReflectionViewer/DeclarationContainer.tsx
|
|
384
|
-
var import_material6 = require("@mui/material");
|
|
385
|
-
var import_react_router_dom2 = require("react-router-dom");
|
|
386
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
387
|
-
var DeclarationContainerReflectionViewer = ({
|
|
388
|
-
reflection,
|
|
389
|
-
lookup,
|
|
390
|
-
itemRenderer = DeclarationReflectionViewer,
|
|
391
|
-
...props
|
|
392
|
-
}) => {
|
|
393
|
-
const { hash } = (0, import_react_router_dom2.useLocation)();
|
|
394
|
-
const theme = (0, import_material6.useTheme)();
|
|
395
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
396
|
-
ContainerReflectionViewer,
|
|
397
|
-
{
|
|
398
|
-
title: "DeclarationContainerReflectionViewer",
|
|
399
|
-
paper: hash.slice(1) === reflection.name,
|
|
400
|
-
bgcolor: hash.slice(1) === reflection.name ? theme.palette.background.default : void 0,
|
|
401
|
-
lookup,
|
|
402
|
-
itemRenderer,
|
|
403
|
-
reflection,
|
|
404
|
-
...props
|
|
405
|
-
}
|
|
406
|
-
);
|
|
407
|
-
};
|
|
408
|
-
|
|
409
|
-
// src/ReflectionViewer/Project.tsx
|
|
410
|
-
var import_react3 = require("react");
|
|
411
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
412
|
-
var ProjectReflectionViewer = ({
|
|
413
|
-
reflection,
|
|
414
|
-
hiddenFlags,
|
|
415
|
-
itemRenderer = ReflectionViewer,
|
|
416
|
-
...props
|
|
417
|
-
}) => {
|
|
418
|
-
const lookup = (0, import_react3.useMemo)(() => createLookup(reflection), [reflection]);
|
|
419
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ReflectionViewer, { title: "ProjectReflectionViewer", hiddenFlags, reflection, ...props, children: (0, import_react3.useMemo)(() => {
|
|
420
|
-
return reflection.groups?.map((group) => {
|
|
421
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
422
|
-
ReflectionGroupViewer,
|
|
423
|
-
{
|
|
424
|
-
autoScroll: true,
|
|
425
|
-
variant: "h6",
|
|
426
|
-
lookup,
|
|
427
|
-
renderer: itemRenderer,
|
|
428
|
-
group,
|
|
429
|
-
reflection,
|
|
430
|
-
alignItems: "stretch",
|
|
431
|
-
hiddenFlags
|
|
432
|
-
},
|
|
433
|
-
group.title
|
|
434
|
-
);
|
|
435
|
-
});
|
|
436
|
-
}, [lookup, reflection, hiddenFlags, itemRenderer]) });
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
// src/TwoPanelReflectionViewer.tsx
|
|
440
|
-
var import_icons_material2 = require("@mui/icons-material");
|
|
441
|
-
var import_material9 = require("@mui/material");
|
|
442
|
-
var import_react_flexbox7 = require("@xylabs/react-flexbox");
|
|
443
|
-
var import_react4 = require("react");
|
|
444
|
-
|
|
445
|
-
// src/TreeViewer/Reflection.tsx
|
|
446
|
-
var import_icons_material = require("@mui/icons-material");
|
|
447
|
-
var import_material7 = require("@mui/material");
|
|
448
|
-
var import_x_tree_view = require("@mui/x-tree-view");
|
|
449
|
-
var import_react_flexbox5 = require("@xylabs/react-flexbox");
|
|
450
|
-
var import_react_router_dom3 = require("react-router-dom");
|
|
451
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
452
|
-
var ReflectionTreeViewer = ({ lookup, reflection, searchTerm, ...props }) => {
|
|
453
|
-
const navigate = (0, import_react_router_dom3.useNavigate)();
|
|
454
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_flexbox5.FlexCol, { alignItems: "stretch", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
455
|
-
import_x_tree_view.TreeView,
|
|
456
|
-
{
|
|
457
|
-
"aria-label": "XYO SDK Documentation",
|
|
458
|
-
defaultExpandIcon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_icons_material.Add, {}),
|
|
459
|
-
defaultCollapseIcon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_icons_material.Remove, {}),
|
|
460
|
-
defaultExpanded: reflection.groups ? [reflection.groups[0].title] : [],
|
|
461
|
-
children: reflection.groups?.map((group, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_x_tree_view.TreeItem, { nodeId: group.title, label: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material7.Typography, { variant: "h6", children: group.title }), children: group.children.map((child, jndex) => {
|
|
462
|
-
const searchTermTrimmed = searchTerm?.trim().toLowerCase();
|
|
463
|
-
const childReflection = typeof child === "number" ? lookup?.[child] : child;
|
|
464
|
-
return childReflection && (!searchTermTrimmed || childReflection.name.toLowerCase().includes(searchTermTrimmed)) ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
465
|
-
import_x_tree_view.TreeItem,
|
|
466
|
-
{
|
|
467
|
-
nodeId: `declaration-${childReflection?.id}`,
|
|
468
|
-
label: childReflection.name,
|
|
469
|
-
onClick: () => {
|
|
470
|
-
const hash = `#${childReflection.name}`;
|
|
471
|
-
navigate({ hash });
|
|
472
|
-
document.querySelector(hash)?.scrollIntoView({ behavior: "smooth" });
|
|
473
|
-
}
|
|
474
|
-
},
|
|
475
|
-
`secondary-${index}- ${jndex}`
|
|
476
|
-
) : null;
|
|
477
|
-
}) }, `primary-${index}`))
|
|
478
|
-
}
|
|
479
|
-
) });
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
// src/TreeViewer/ReflectionGroup.tsx
|
|
483
|
-
var import_material8 = require("@mui/material");
|
|
484
|
-
var import_react_flexbox6 = require("@xylabs/react-flexbox");
|
|
485
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
486
|
-
var ReflectionGroupTreeViewer = ({
|
|
487
|
-
variant,
|
|
488
|
-
group,
|
|
489
|
-
children,
|
|
490
|
-
lookup,
|
|
491
|
-
renderer = ReflectionViewer,
|
|
492
|
-
...props
|
|
493
|
-
}) => {
|
|
494
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_flexbox6.FlexCol, { ...props, children: [
|
|
495
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_flexbox6.FlexRow, { marginY: 1, justifyContent: "flex-start", children: [
|
|
496
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_material8.Typography, { variant, children: group.title }),
|
|
497
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(JsonViewerButton, { size: "small", variant: "contained", padding: 0, marginX: 1, src: resolveChildren(group, lookup) })
|
|
498
|
-
] }),
|
|
499
|
-
resolveChildren(group, lookup).map((reflection) => {
|
|
500
|
-
return reflection ? (
|
|
501
|
-
// I wrap this in a div since React does not understand that they have keys using the Renderer
|
|
502
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: renderer({ lookup, margin: 1, reflection }) }, reflection.id)
|
|
503
|
-
) : null;
|
|
504
|
-
}),
|
|
505
|
-
children
|
|
506
|
-
] });
|
|
507
|
-
};
|
|
508
|
-
|
|
509
|
-
// src/TwoPanelReflectionViewer.tsx
|
|
510
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
511
|
-
var TwoPanelReflectionViewer = ({
|
|
512
|
-
reflection,
|
|
513
|
-
itemRenderer = ReflectionViewer,
|
|
514
|
-
hiddenFlags,
|
|
515
|
-
...props
|
|
516
|
-
}) => {
|
|
517
|
-
const lookup = (0, import_react4.useMemo)(() => createLookup(reflection), [reflection]);
|
|
518
|
-
const theme = (0, import_material9.useTheme)();
|
|
519
|
-
const [searchTerm, setSearchTerm] = (0, import_react4.useState)();
|
|
520
|
-
const onSearchTermChange = (e) => {
|
|
521
|
-
setSearchTerm(e.target.value);
|
|
522
|
-
};
|
|
523
|
-
const reflectionGroups = (0, import_react4.useMemo)(() => {
|
|
524
|
-
return reflection.groups?.map((group) => {
|
|
525
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
526
|
-
ReflectionGroupViewer,
|
|
527
|
-
{
|
|
528
|
-
autoScroll: true,
|
|
529
|
-
variant: "h6",
|
|
530
|
-
lookup,
|
|
531
|
-
renderer: itemRenderer,
|
|
532
|
-
group,
|
|
533
|
-
reflection,
|
|
534
|
-
alignItems: "stretch",
|
|
535
|
-
hiddenFlags
|
|
536
|
-
},
|
|
537
|
-
group.title
|
|
538
|
-
);
|
|
539
|
-
});
|
|
540
|
-
}, [itemRenderer, lookup, reflection, hiddenFlags]);
|
|
541
|
-
const NavigationCol = (props2) => {
|
|
542
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_flexbox7.FlexCol, { ...props2, children: [
|
|
543
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
544
|
-
import_material9.TextField,
|
|
545
|
-
{
|
|
546
|
-
fullWidth: true,
|
|
547
|
-
InputProps: {
|
|
548
|
-
startAdornment: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons_material2.Search, {})
|
|
549
|
-
},
|
|
550
|
-
onChange: onSearchTermChange
|
|
551
|
-
}
|
|
552
|
-
),
|
|
553
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_flexbox7.FlexGrowCol, { marginTop: 1, alignItems: "stretch", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
554
|
-
ReflectionTreeViewer,
|
|
555
|
-
{
|
|
556
|
-
justifyContent: "flex-start",
|
|
557
|
-
position: "absolute",
|
|
558
|
-
top: 0,
|
|
559
|
-
left: 0,
|
|
560
|
-
right: 0,
|
|
561
|
-
bottom: 0,
|
|
562
|
-
overflow: "scroll",
|
|
563
|
-
searchTerm,
|
|
564
|
-
hiddenFlags,
|
|
565
|
-
reflection,
|
|
566
|
-
lookup,
|
|
567
|
-
border: `1px solid ${theme.palette.grey["300"]}`,
|
|
568
|
-
borderRadius: 1,
|
|
569
|
-
paddingY: 1
|
|
570
|
-
}
|
|
571
|
-
) })
|
|
572
|
-
] });
|
|
573
|
-
};
|
|
574
|
-
const DetailsCol = (props2) => {
|
|
575
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_flexbox7.FlexGrowCol, { ...props2, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_flexbox7.FlexGrowCol, { alignItems: "stretch", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
576
|
-
import_react_flexbox7.FlexCol,
|
|
577
|
-
{
|
|
578
|
-
alignItems: "stretch",
|
|
579
|
-
justifyContent: "flex-start",
|
|
580
|
-
position: "absolute",
|
|
581
|
-
top: 0,
|
|
582
|
-
left: 0,
|
|
583
|
-
right: 0,
|
|
584
|
-
bottom: 0,
|
|
585
|
-
overflow: "scroll",
|
|
586
|
-
borderRadius: 1,
|
|
587
|
-
padding: 1,
|
|
588
|
-
border: `1px solid ${theme.palette.grey["300"]}`,
|
|
589
|
-
children: reflectionGroups
|
|
590
|
-
}
|
|
591
|
-
) }) });
|
|
592
|
-
};
|
|
593
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_flexbox7.FlexRow, { alignItems: "stretch", justifyContent: "start", sx: { overflowY: "scroll" }, ...props, children: [
|
|
594
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(NavigationCol, { minWidth: 320, alignItems: "stretch", justifyContent: "flex-start", overflow: "hidden" }),
|
|
595
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DetailsCol, { marginLeft: 1, alignItems: "stretch", justifyContent: "flex-start", overflow: "hidden" })
|
|
596
|
-
] });
|
|
597
|
-
};
|
|
598
|
-
|
|
599
|
-
// src/ProjectTwoPanelReflectionViewer.tsx
|
|
600
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
601
|
-
var ProjectTwoPanelReflectionViewer = ({
|
|
602
|
-
reflection,
|
|
603
|
-
itemRenderer = DeclarationContainerReflectionViewer,
|
|
604
|
-
...props
|
|
605
|
-
}) => {
|
|
606
|
-
(0, import_assert.assertEx)(reflection.isProject, () => "Project expected to be Project");
|
|
607
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TwoPanelReflectionViewer, { itemRenderer, reflection, ...props });
|
|
608
|
-
};
|
|
609
|
-
|
|
610
|
-
// src/SourceViewer.tsx
|
|
611
|
-
var import_material10 = require("@mui/material");
|
|
612
|
-
var import_react_flexbox8 = require("@xylabs/react-flexbox");
|
|
613
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
614
|
-
var SourceViewer = ({ source, ...props }) => {
|
|
615
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react_flexbox8.FlexCol, { alignItems: "stretch", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_material10.Typography, { style: { opacity: 0.5 }, variant: "body2", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("i", { children: source.fileName }) }) });
|
|
616
|
-
};
|
|
1
|
+
"use strict";var X=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var ke=Object.getOwnPropertyNames;var ve=Object.prototype.hasOwnProperty;var Be=(e,o)=>{for(var r in o)X(e,r,{get:o[r],enumerable:!0})},Ie=(e,o,r,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of ke(o))!ve.call(e,i)&&i!==r&&X(e,i,{get:()=>o[i],enumerable:!(t=be(o,i))||t.enumerable});return e};var De=e=>Ie(X({},"__esModule",{value:!0}),e);var $e={};Be($e,{CommentViewer:()=>j,ContainerReflectionViewer:()=>M,DeclarationContainerReflectionViewer:()=>H,DeclarationReflectionViewer:()=>q,JsonViewerButton:()=>g,ProjectReflectionViewer:()=>Le,ProjectTwoPanelReflectionViewer:()=>Ae,ReflectionGroupTreeViewer:()=>Ne,ReflectionGroupViewer:()=>h,ReflectionTreeViewer:()=>Q,ReflectionViewer:()=>p,SomeTypeViewer:()=>z,SourceViewer:()=>Je,TwoPanelReflectionViewer:()=>Z});module.exports=De($e);var _=require("@mui/material"),ee=require("@xylabs/react-flexbox"),Y=require("react/jsx-runtime"),j=({comment:e,...o})=>(0,Y.jsx)(ee.FlexCol,{alignItems:"stretch",...o,children:(0,Y.jsx)(_.Typography,{variant:"body2",children:e.summary[0]?.text})});var y=require("@mui/material"),W=require("@xylabs/react-button"),oe=require("@xyo-network/react-payload-raw-info"),re=require("react"),m=require("react/jsx-runtime"),g=({jsonViewProps:e,src:o,title:r,...t})=>{let[i,n]=(0,re.useState)(!1);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(W.ButtonEx,{onClick:()=>n(!i),...t,children:"JSON"}),(0,m.jsxs)(y.Dialog,{open:i,onClose:()=>n(!1),children:[r?(0,m.jsx)(y.DialogTitle,{children:r}):null,(0,m.jsx)(y.DialogContent,{children:(0,m.jsx)(oe.JsonViewerEx,{value:o,...e})}),(0,m.jsx)(y.DialogActions,{children:(0,m.jsx)(W.ButtonEx,{onClick:()=>n(!1),children:"Close"})})]})]})};var Te=require("@xylabs/assert");var P=e=>{let o={};if(e.children)for(let r of e.children)o[r.id]=r;return o};var fe=require("@mui/material"),E=require("@xylabs/react-flexbox"),ue=require("react"),Re=require("react-router-dom");var C=(e,o={})=>e.children?.map(r=>{switch(typeof r){case"object":return r;case"number":{let t=o[r];if(t===void 0)throw new Error(`Child Reference Not Found [${r}]`);return t}default:throw new Error(`Invalid Child Type [${typeof r}, ${r}]`)}})??[];var se=require("@xylabs/react-flexbox");var x=require("@mui/material"),U=require("@xylabs/react-flexbox");var te=e=>e.startsWith("is")?e.slice(2):e;var ce=require("@mui/material");var ie=(e,o,r)=>{let t=[],i=r(e.elementType,o);return typeof i=="string"&&t.push(i),t.push("[]"),t};var ne=(e,o,r)=>{let t=[];return e.types&&t.push(e.types.map(i=>r(i,o)).join(" & ")),t};var pe=(e,o,r)=>{let t=[];return t.push(e.name),e.typeArguments&&t.push("<",e.typeArguments.map(i=>r(i,o)).join(", "),">"),t};var G=require("react/jsx-runtime"),le=(e,o)=>{if(e.declaration)return(0,G.jsx)(G.Fragment,{children:o({reflection:e.declaration})})};var ae=(e,o,r)=>{let t=[];return e.types&&t.push(e.types.map(i=>r(i,o)).join(" | ")),t};var S=(e,o)=>{let r=e,t=[];switch(r.type){case"intrinsic":{t.push(r.name);break}case"intersection":{t.push(...ne(r,o,S));break}case"literal":{t.push(JSON.stringify(r.value));break}case"array":{t.push(...ie(r,o,S));break}case"reference":{t.push(...pe(r,o,S));break}case"union":{t.push(...ae(r,o,S));break}case"reflection":return le(r,o);default:{t.push("#",r.type,"#");break}}return t.join("")};var B=require("react/jsx-runtime"),z=({opacity:e=.5,reflection:o,reflectionViewer:r,...t})=>{let i=o.type?S(o.type,r):"";return typeof i=="string"?(0,B.jsx)(ce.Typography,{title:"SomeTypeViewer",style:{opacity:e},...t,children:i}):(0,B.jsx)(B.Fragment,{children:i})};var c=require("react/jsx-runtime"),me=({reflectionViewer:e,variant:o,reflection:r,...t})=>(0,c.jsxs)(U.FlexRow,{justifyContent:"flex-start",...t,children:[(0,c.jsxs)(U.FlexRow,{marginRight:1,children:[(0,c.jsxs)(x.Typography,{variant:o,noWrap:!0,children:[r.name,r.type?(0,c.jsx)(c.Fragment,{children:":\xA0"}):null]}),(0,c.jsx)(z,{reflection:r,reflectionViewer:e})]}),(0,c.jsxs)(x.Stack,{direction:"row",spacing:1,children:[(0,c.jsx)(x.Chip,{size:"small",label:r.kind}),r.flags?Object.entries(r.flags).map(([i,n])=>n?(0,c.jsx)(x.Chip,{size:"small",label:te(i),variant:"outlined"},i):null):null]}),document&&document?.location.hostname==="localhost"&&(0,c.jsx)(g,{size:"small",variant:"contained",padding:0,marginX:1,src:r})]});var b=require("react/jsx-runtime"),Ge=(e,o=[])=>{let r=!1;return o.map(t=>{e?.[t]&&(r=!0)}),r},p=({variant:e,nameViewer:o,children:r,reflection:t,hiddenFlags:i,...n})=>{let l=t;return Ge(t?.flags,i)?null:(0,b.jsxs)(se.FlexCol,{title:"ReflectionViewer",alignItems:"stretch",...n,children:[o===void 0?(0,b.jsx)(me,{marginY:.25,variant:e,reflection:l,reflectionViewer:p}):o,t.comment?(0,b.jsx)(j,{comment:t.comment}):null,l.parameters?.map(s=>(0,b.jsx)(p,{hiddenFlags:i,marginY:.25,marginX:1,reflection:s},s.id))??null,r]})};var V=require("react/jsx-runtime"),Ee=(e,o=[])=>{let r=!1;return o.map(t=>{e?.[t]&&(r=!0)}),r},h=({autoScroll:e=!1,children:o,hiddenFlags:r,group:t,lookup:i,renderer:n=p,variant:l,...s})=>{let v=C(t,i)??[],F=r?v.reduce((u,R)=>u+(Ee(R.flags,r)?0:1),0):1,{hash:f}=(0,Re.useLocation)();return(0,ue.useEffect)(()=>{f&&e&&document.querySelector(f)?.scrollIntoView({behavior:"smooth"})},[f,e]),F>0?(0,V.jsxs)(E.FlexCol,{title:"ReflectionGroupViewer",...s,children:[(0,V.jsxs)(E.FlexRow,{marginY:1,justifyContent:"flex-start",children:[(0,V.jsx)(fe.Typography,{variant:l,children:t.title}),(0,V.jsx)(g,{size:"small",variant:"contained",padding:0,marginX:1,src:C(t,i)})]}),C(t,i).map(u=>u?(0,V.jsx)("div",{id:u.name,children:n({hiddenFlags:r,lookup:i,margin:1,padding:1,reflection:u})},u.id):null),o]}):null};var L=require("react/jsx-runtime"),M=({children:e,reflection:o,hiddenFlags:r,itemRenderer:t=p,...i})=>{let n=P(o);return(0,L.jsxs)(p,{title:"ContainerReflectionViewer",sources:!0,reflection:o,lookup:n,...i,children:[o.groups?.map(l=>(0,L.jsx)(h,{margin:1,lookup:n,renderer:t,group:l,reflection:o,hiddenFlags:r,alignItems:"stretch"},l.title)),e]})};var k=require("react/jsx-runtime"),q=({reflection:e,hiddenFlags:o,...r})=>{let t=i=>Array.isArray(i)?i:i?[i]:void 0;return(0,k.jsxs)(p,{nameViewer:e.signatures||e.getSignature||e.setSignature?null:void 0,title:"DeclarationReflectionViewer",hiddenFlags:o,reflection:e,...r,children:[e.signatures?.map(i=>(0,k.jsx)(p,{hiddenFlags:o,reflection:i},i.id)),t(e.getSignature)?.map(i=>(0,k.jsx)(p,{marginX:1,hiddenFlags:o,reflection:i},i.id)),t(e.setSignature)?.map(i=>(0,k.jsx)(p,{marginX:1,hiddenFlags:o,reflection:i},i.id))]})};var de=require("@mui/material"),ye=require("react-router-dom");var we=require("react/jsx-runtime"),H=({reflection:e,lookup:o,itemRenderer:r=q,...t})=>{let{hash:i}=(0,ye.useLocation)(),n=(0,de.useTheme)();return(0,we.jsx)(M,{title:"DeclarationContainerReflectionViewer",paper:i.slice(1)===e.name,bgcolor:i.slice(1)===e.name?n.palette.background.default:void 0,lookup:o,itemRenderer:r,reflection:e,...t})};var K=require("react");var O=require("react/jsx-runtime"),Le=({reflection:e,hiddenFlags:o,itemRenderer:r=p,...t})=>{let i=(0,K.useMemo)(()=>P(e),[e]);return(0,O.jsx)(p,{title:"ProjectReflectionViewer",hiddenFlags:o,reflection:e,...t,children:(0,K.useMemo)(()=>e.groups?.map(n=>(0,O.jsx)(h,{autoScroll:!0,variant:"h6",lookup:i,renderer:r,group:n,reflection:e,alignItems:"stretch",hiddenFlags:o},n.title)),[i,e,o,r])})};var he=require("@mui/icons-material"),J=require("@mui/material"),d=require("@xylabs/react-flexbox"),D=require("react");var N=require("@mui/icons-material"),ge=require("@mui/material"),I=require("@mui/x-tree-view"),Ce=require("@xylabs/react-flexbox"),xe=require("react-router-dom"),w=require("react/jsx-runtime"),Q=({lookup:e,reflection:o,searchTerm:r,...t})=>{let i=(0,xe.useNavigate)();return(0,w.jsx)(Ce.FlexCol,{alignItems:"stretch",...t,children:(0,w.jsx)(I.TreeView,{"aria-label":"XYO SDK Documentation",defaultExpandIcon:(0,w.jsx)(N.Add,{}),defaultCollapseIcon:(0,w.jsx)(N.Remove,{}),defaultExpanded:o.groups?[o.groups[0].title]:[],children:o.groups?.map((n,l)=>(0,w.jsx)(I.TreeItem,{nodeId:n.title,label:(0,w.jsx)(ge.Typography,{variant:"h6",children:n.title}),children:n.children.map((s,v)=>{let F=r?.trim().toLowerCase(),f=typeof s=="number"?e?.[s]:s;return f&&(!F||f.name.toLowerCase().includes(F))?(0,w.jsx)(I.TreeItem,{nodeId:`declaration-${f?.id}`,label:f.name,onClick:()=>{let u=`#${f.name}`;i({hash:u}),document.querySelector(u)?.scrollIntoView({behavior:"smooth"})}},`secondary-${l}- ${v}`):null})},`primary-${l}`))})})};var Ve=require("@mui/material"),A=require("@xylabs/react-flexbox");var T=require("react/jsx-runtime"),Ne=({variant:e,group:o,children:r,lookup:t,renderer:i=p,...n})=>(0,T.jsxs)(A.FlexCol,{...n,children:[(0,T.jsxs)(A.FlexRow,{marginY:1,justifyContent:"flex-start",children:[(0,T.jsx)(Ve.Typography,{variant:e,children:o.title}),(0,T.jsx)(g,{size:"small",variant:"contained",padding:0,marginX:1,src:C(o,t)})]}),C(o,t).map(l=>l?(0,T.jsx)("div",{children:i({lookup:t,margin:1,reflection:l})},l.id):null),r]});var a=require("react/jsx-runtime"),Z=({reflection:e,itemRenderer:o=p,hiddenFlags:r,...t})=>{let i=(0,D.useMemo)(()=>P(e),[e]),n=(0,J.useTheme)(),[l,s]=(0,D.useState)(),v=R=>{s(R.target.value)},F=(0,D.useMemo)(()=>e.groups?.map(R=>(0,a.jsx)(h,{autoScroll:!0,variant:"h6",lookup:i,renderer:o,group:R,reflection:e,alignItems:"stretch",hiddenFlags:r},R.title)),[o,i,e,r]);return(0,a.jsxs)(d.FlexRow,{alignItems:"stretch",justifyContent:"start",sx:{overflowY:"scroll"},...t,children:[(0,a.jsx)(R=>(0,a.jsxs)(d.FlexCol,{...R,children:[(0,a.jsx)(J.TextField,{fullWidth:!0,InputProps:{startAdornment:(0,a.jsx)(he.Search,{})},onChange:v}),(0,a.jsx)(d.FlexGrowCol,{marginTop:1,alignItems:"stretch",children:(0,a.jsx)(Q,{justifyContent:"flex-start",position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"scroll",searchTerm:l,hiddenFlags:r,reflection:e,lookup:i,border:`1px solid ${n.palette.grey[300]}`,borderRadius:1,paddingY:1})})]}),{minWidth:320,alignItems:"stretch",justifyContent:"flex-start",overflow:"hidden"}),(0,a.jsx)(R=>(0,a.jsx)(d.FlexGrowCol,{...R,children:(0,a.jsx)(d.FlexGrowCol,{alignItems:"stretch",children:(0,a.jsx)(d.FlexCol,{alignItems:"stretch",justifyContent:"flex-start",position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"scroll",borderRadius:1,padding:1,border:`1px solid ${n.palette.grey[300]}`,children:F})})}),{marginLeft:1,alignItems:"stretch",justifyContent:"flex-start",overflow:"hidden"})]})};var Fe=require("react/jsx-runtime"),Ae=({reflection:e,itemRenderer:o=H,...r})=>((0,Te.assertEx)(e.isProject,()=>"Project expected to be Project"),(0,Fe.jsx)(Z,{itemRenderer:o,reflection:e,...r}));var Pe=require("@mui/material"),Se=require("@xylabs/react-flexbox"),$=require("react/jsx-runtime"),Je=({source:e,...o})=>(0,$.jsx)(Se.FlexCol,{alignItems:"stretch",...o,children:(0,$.jsx)(Pe.Typography,{style:{opacity:.5},variant:"body2",children:(0,$.jsx)("i",{children:e.fileName})})});
|
|
617
2
|
//# sourceMappingURL=index.cjs.map
|