@xyo-network/react-typedoc 7.0.0 → 7.0.2

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.
@@ -1,62 +1,57 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/CommentViewer.tsx
5
2
  import { Typography } from "@mui/material";
6
3
  import { FlexCol } from "@xylabs/react-flexbox";
7
- import React from "react";
8
- var CommentViewer = /* @__PURE__ */ __name(({ comment, ...props }) => {
9
- return /* @__PURE__ */ React.createElement(FlexCol, {
10
- alignItems: "stretch",
11
- ...props
12
- }, /* @__PURE__ */ React.createElement(Typography, {
13
- variant: "body2"
14
- }, comment.summary[0]?.text));
15
- }, "CommentViewer");
4
+ import { jsx } from "react/jsx-runtime";
5
+ var CommentViewer = ({ comment, ...props }) => {
6
+ return /* @__PURE__ */ jsx(FlexCol, { alignItems: "stretch", ...props, children: /* @__PURE__ */ jsx(Typography, { variant: "body2", children: comment.summary[0]?.text }) });
7
+ };
16
8
 
17
9
  // src/JsonViewerButton.tsx
18
- import { Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
10
+ import {
11
+ Dialog,
12
+ DialogActions,
13
+ DialogContent,
14
+ DialogTitle
15
+ } from "@mui/material";
19
16
  import { ButtonEx } from "@xylabs/react-button";
20
17
  import { JsonViewerEx } from "@xyo-network/react-payload-raw-info";
21
- import React2, { useState } from "react";
22
- var JsonViewerButton = /* @__PURE__ */ __name(({ jsonViewProps, src, title, ...props }) => {
18
+ import { useState } from "react";
19
+ import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
20
+ var JsonViewerButton = ({
21
+ jsonViewProps,
22
+ src,
23
+ title,
24
+ ...props
25
+ }) => {
23
26
  const [open, setOpen] = useState(false);
24
- return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(ButtonEx, {
25
- onClick: /* @__PURE__ */ __name(() => setOpen(!open), "onClick"),
26
- ...props
27
- }, "JSON"), /* @__PURE__ */ React2.createElement(Dialog, {
28
- open,
29
- onClose: /* @__PURE__ */ __name(() => setOpen(false), "onClose")
30
- }, title ? /* @__PURE__ */ React2.createElement(DialogTitle, null, title) : null, /* @__PURE__ */ React2.createElement(DialogContent, null, /* @__PURE__ */ React2.createElement(JsonViewerEx, {
31
- value: src,
32
- ...jsonViewProps
33
- })), /* @__PURE__ */ React2.createElement(DialogActions, null, /* @__PURE__ */ React2.createElement(ButtonEx, {
34
- onClick: /* @__PURE__ */ __name(() => setOpen(false), "onClick")
35
- }, "Close"))));
36
- }, "JsonViewerButton");
27
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
28
+ /* @__PURE__ */ jsx2(ButtonEx, { onClick: () => setOpen(!open), ...props, children: "JSON" }),
29
+ /* @__PURE__ */ jsxs(Dialog, { open, onClose: () => setOpen(false), children: [
30
+ title ? /* @__PURE__ */ jsx2(DialogTitle, { children: title }) : null,
31
+ /* @__PURE__ */ jsx2(DialogContent, { children: /* @__PURE__ */ jsx2(JsonViewerEx, { value: src, ...jsonViewProps }) }),
32
+ /* @__PURE__ */ jsx2(DialogActions, { children: /* @__PURE__ */ jsx2(ButtonEx, { onClick: () => setOpen(false), children: "Close" }) })
33
+ ] })
34
+ ] });
35
+ };
37
36
 
38
37
  // src/ProjectTwoPanelReflectionViewer.tsx
39
38
  import { assertEx } from "@xylabs/assert";
40
- import React15 from "react";
41
-
42
- // src/ReflectionViewer/Container.tsx
43
- import React8 from "react";
44
39
 
45
40
  // src/createLookup.ts
46
- var createLookup = /* @__PURE__ */ __name((reflection) => {
41
+ var createLookup = (reflection) => {
47
42
  const lookup = {};
48
43
  if (reflection.children) for (const item of reflection.children) lookup[item.id] = item;
49
44
  return lookup;
50
- }, "createLookup");
45
+ };
51
46
 
52
47
  // src/ReflectionViewer/ReflectionGroupViewer.tsx
53
48
  import { Typography as Typography4 } from "@mui/material";
54
49
  import { FlexCol as FlexCol3, FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
55
- import React7, { useEffect } from "react";
50
+ import { useEffect } from "react";
56
51
  import { useLocation } from "react-router-dom";
57
52
 
58
53
  // src/resolveChildren.ts
59
- var resolveChildren = /* @__PURE__ */ __name((reflection, lookup = {}) => {
54
+ var resolveChildren = (reflection, lookup = {}) => {
60
55
  return reflection.children?.map((child) => {
61
56
  switch (typeof child) {
62
57
  case "object": {
@@ -74,31 +69,32 @@ var resolveChildren = /* @__PURE__ */ __name((reflection, lookup = {}) => {
74
69
  }
75
70
  }
76
71
  }) ?? [];
77
- }, "resolveChildren");
72
+ };
78
73
 
79
74
  // src/ReflectionViewer/ReflectionViewer.tsx
80
75
  import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
81
- import React6 from "react";
82
76
 
83
77
  // src/ReflectionViewer/NameViewer.tsx
84
- import { Chip, Stack, Typography as Typography3 } from "@mui/material";
78
+ import {
79
+ Chip,
80
+ Stack,
81
+ Typography as Typography3
82
+ } from "@mui/material";
85
83
  import { FlexRow } from "@xylabs/react-flexbox";
86
- import React5 from "react";
87
84
 
88
85
  // src/trimFlagLabel.ts
89
- var trimFlagLabel = /* @__PURE__ */ __name((label) => {
86
+ var trimFlagLabel = (label) => {
90
87
  if (label.startsWith("is")) {
91
88
  return label.slice(2);
92
89
  }
93
90
  return label;
94
- }, "trimFlagLabel");
91
+ };
95
92
 
96
93
  // src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx
97
94
  import { Typography as Typography2 } from "@mui/material";
98
- import React4 from "react";
99
95
 
100
96
  // src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx
101
- var buildArrayString = /* @__PURE__ */ __name((typeObj, reflectionViewer, typeBuilder) => {
97
+ var buildArrayString = (typeObj, reflectionViewer, typeBuilder) => {
102
98
  const parts = [];
103
99
  const typeString = typeBuilder(typeObj.elementType, reflectionViewer);
104
100
  if (typeof typeString === "string") {
@@ -106,54 +102,60 @@ var buildArrayString = /* @__PURE__ */ __name((typeObj, reflectionViewer, typeBu
106
102
  }
107
103
  parts.push("[]");
108
104
  return parts;
109
- }, "buildArrayString");
105
+ };
110
106
 
111
107
  // src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx
112
- var buildIntersectionString = /* @__PURE__ */ __name((typeObj, reflectionViewer, typeBuilder) => {
108
+ var buildIntersectionString = (typeObj, reflectionViewer, typeBuilder) => {
113
109
  const parts = [];
114
110
  if (typeObj.types) {
115
- parts.push(typeObj.types.map((arg) => {
116
- return typeBuilder(arg, reflectionViewer);
117
- }).join(" & "));
111
+ parts.push(
112
+ typeObj.types.map((arg) => {
113
+ return typeBuilder(arg, reflectionViewer);
114
+ }).join(" & ")
115
+ );
118
116
  }
119
117
  return parts;
120
- }, "buildIntersectionString");
118
+ };
121
119
 
122
120
  // src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts
123
- var buildReferenceString = /* @__PURE__ */ __name((typeObj, reflectionViewer, typeBuilder) => {
121
+ var buildReferenceString = (typeObj, reflectionViewer, typeBuilder) => {
124
122
  const parts = [];
125
123
  parts.push(typeObj.name);
126
124
  if (typeObj.typeArguments) {
127
- parts.push("<", typeObj.typeArguments.map((arg) => {
128
- return typeBuilder(arg, reflectionViewer);
129
- }).join(", "), ">");
125
+ parts.push(
126
+ "<",
127
+ typeObj.typeArguments.map((arg) => {
128
+ return typeBuilder(arg, reflectionViewer);
129
+ }).join(", "),
130
+ ">"
131
+ );
130
132
  }
131
133
  return parts;
132
- }, "buildReferenceString");
134
+ };
133
135
 
134
136
  // src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx
135
- import React3 from "react";
136
- var buildReflectionString = /* @__PURE__ */ __name((typeObj, reflectionViewer) => {
137
+ import { Fragment as Fragment2, jsx as jsx3 } from "react/jsx-runtime";
138
+ var buildReflectionString = (typeObj, reflectionViewer) => {
137
139
  if (typeObj.declaration) {
138
- return /* @__PURE__ */ React3.createElement(React3.Fragment, null, reflectionViewer({
139
- reflection: typeObj.declaration
140
- }));
140
+ return /* @__PURE__ */ jsx3(Fragment2, { children: reflectionViewer({ reflection: typeObj.declaration }) });
141
141
  }
142
- }, "buildReflectionString");
142
+ };
143
143
 
144
144
  // src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx
145
- var buildUnionString = /* @__PURE__ */ __name((typeObj, reflectionViewer, typeBuilder) => {
145
+ var buildUnionString = (typeObj, reflectionViewer, typeBuilder) => {
146
146
  const parts = [];
147
147
  if (typeObj.types) {
148
- parts.push(typeObj.types.map((arg) => {
149
- return typeBuilder(arg, reflectionViewer);
150
- }).join(" | "));
148
+ parts.push(
149
+ typeObj.types.map((arg) => {
150
+ return typeBuilder(arg, reflectionViewer);
151
+ }).join(" | ")
152
+ );
151
153
  }
152
154
  return parts;
153
- }, "buildUnionString");
155
+ };
154
156
 
155
157
  // src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx
156
- var buildTypeString = /* @__PURE__ */ __name((type, reflectionViewer) => {
158
+ var buildTypeString = (type, reflectionViewer) => {
157
159
  const someType = type;
158
160
  const parts = [];
159
161
  switch (someType.type) {
@@ -190,60 +192,52 @@ var buildTypeString = /* @__PURE__ */ __name((type, reflectionViewer) => {
190
192
  }
191
193
  }
192
194
  return parts.join("");
193
- }, "buildTypeString");
195
+ };
194
196
 
195
197
  // src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx
196
- var SomeTypeViewer = /* @__PURE__ */ __name(({ opacity = 0.5, reflection, reflectionViewer, ...props }) => {
198
+ import { Fragment as Fragment3, jsx as jsx4 } from "react/jsx-runtime";
199
+ var SomeTypeViewer = ({
200
+ opacity = 0.5,
201
+ reflection,
202
+ reflectionViewer,
203
+ ...props
204
+ }) => {
197
205
  const typeReactNode = reflection.type ? buildTypeString(reflection.type, reflectionViewer) : "";
198
206
  if (typeof typeReactNode === "string") {
199
- return /* @__PURE__ */ React4.createElement(Typography2, {
200
- title: "SomeTypeViewer",
201
- style: {
202
- opacity
203
- },
204
- ...props
205
- }, typeReactNode);
207
+ return /* @__PURE__ */ jsx4(Typography2, { title: "SomeTypeViewer", style: { opacity }, ...props, children: typeReactNode });
206
208
  }
207
- return /* @__PURE__ */ React4.createElement(React4.Fragment, null, typeReactNode);
208
- }, "SomeTypeViewer");
209
+ return /* @__PURE__ */ jsx4(Fragment3, { children: typeReactNode });
210
+ };
209
211
 
210
212
  // src/ReflectionViewer/NameViewer.tsx
211
- var NameViewer = /* @__PURE__ */ __name(({ reflectionViewer, variant, reflection, ...props }) => {
212
- return /* @__PURE__ */ React5.createElement(FlexRow, {
213
- justifyContent: "flex-start",
214
- ...props
215
- }, /* @__PURE__ */ React5.createElement(FlexRow, {
216
- marginRight: 1
217
- }, /* @__PURE__ */ React5.createElement(Typography3, {
218
- variant,
219
- noWrap: true
220
- }, reflection.name, reflection.type ? /* @__PURE__ */ React5.createElement(React5.Fragment, null, ":\xA0") : null), /* @__PURE__ */ React5.createElement(SomeTypeViewer, {
221
- reflection,
222
- reflectionViewer
223
- })), /* @__PURE__ */ React5.createElement(Stack, {
224
- direction: "row",
225
- spacing: 1
226
- }, /* @__PURE__ */ React5.createElement(Chip, {
227
- size: "small",
228
- label: reflection.kind
229
- }), reflection.flags ? Object.entries(reflection.flags).map(([flag, value]) => {
230
- return value ? /* @__PURE__ */ React5.createElement(Chip, {
231
- size: "small",
232
- key: flag,
233
- label: trimFlagLabel(flag),
234
- variant: "outlined"
235
- }) : null;
236
- }) : null), document && document?.location.hostname === "localhost" && /* @__PURE__ */ React5.createElement(JsonViewerButton, {
237
- size: "small",
238
- variant: "contained",
239
- padding: 0,
240
- marginX: 1,
241
- src: reflection
242
- }));
243
- }, "NameViewer");
213
+ import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
214
+ var NameViewer = ({
215
+ reflectionViewer,
216
+ variant,
217
+ reflection,
218
+ ...props
219
+ }) => {
220
+ return /* @__PURE__ */ jsxs2(FlexRow, { justifyContent: "flex-start", ...props, children: [
221
+ /* @__PURE__ */ jsxs2(FlexRow, { marginRight: 1, children: [
222
+ /* @__PURE__ */ jsxs2(Typography3, { variant, noWrap: true, children: [
223
+ reflection.name,
224
+ reflection.type ? /* @__PURE__ */ jsx5(Fragment4, { children: ":\xA0" }) : null
225
+ ] }),
226
+ /* @__PURE__ */ jsx5(SomeTypeViewer, { reflection, reflectionViewer })
227
+ ] }),
228
+ /* @__PURE__ */ jsxs2(Stack, { direction: "row", spacing: 1, children: [
229
+ /* @__PURE__ */ jsx5(Chip, { size: "small", label: reflection.kind }),
230
+ reflection.flags ? Object.entries(reflection.flags).map(([flag, value]) => {
231
+ return value ? /* @__PURE__ */ jsx5(Chip, { size: "small", label: trimFlagLabel(flag), variant: "outlined" }, flag) : null;
232
+ }) : null
233
+ ] }),
234
+ document && document?.location.hostname === "localhost" && /* @__PURE__ */ jsx5(JsonViewerButton, { size: "small", variant: "contained", padding: 0, marginX: 1, src: reflection })
235
+ ] });
236
+ };
244
237
 
245
238
  // src/ReflectionViewer/ReflectionViewer.tsx
246
- var hide = /* @__PURE__ */ __name((flags, hiddenFlags = []) => {
239
+ import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
240
+ var hide = (flags, hiddenFlags = []) => {
247
241
  let hide3 = false;
248
242
  for (const hiddenFlag of hiddenFlags) {
249
243
  if (flags?.[hiddenFlag]) {
@@ -251,33 +245,29 @@ var hide = /* @__PURE__ */ __name((flags, hiddenFlags = []) => {
251
245
  }
252
246
  }
253
247
  return hide3;
254
- }, "hide");
255
- var ReflectionViewer = /* @__PURE__ */ __name(({ variant, nameViewer, children, reflection, hiddenFlags, ...props }) => {
248
+ };
249
+ var ReflectionViewer = ({
250
+ variant,
251
+ nameViewer,
252
+ children,
253
+ reflection,
254
+ hiddenFlags,
255
+ ...props
256
+ }) => {
256
257
  const someReflection = reflection;
257
- return hide(reflection?.flags, hiddenFlags) ? null : /* @__PURE__ */ React6.createElement(FlexCol2, {
258
- title: "ReflectionViewer",
259
- alignItems: "stretch",
260
- ...props
261
- }, nameViewer === void 0 ? /* @__PURE__ */ React6.createElement(NameViewer, {
262
- marginY: 0.25,
263
- variant,
264
- reflection: someReflection,
265
- reflectionViewer: ReflectionViewer
266
- }) : nameViewer, reflection.comment ? /* @__PURE__ */ React6.createElement(CommentViewer, {
267
- comment: reflection.comment
268
- }) : null, someReflection.parameters?.map((parameter) => {
269
- return /* @__PURE__ */ React6.createElement(ReflectionViewer, {
270
- hiddenFlags,
271
- marginY: 0.25,
272
- marginX: 1,
273
- key: parameter.id,
274
- reflection: parameter
275
- });
276
- }) ?? null, children);
277
- }, "ReflectionViewer");
258
+ return hide(reflection?.flags, hiddenFlags) ? null : /* @__PURE__ */ jsxs3(FlexCol2, { title: "ReflectionViewer", alignItems: "stretch", ...props, children: [
259
+ nameViewer === void 0 ? /* @__PURE__ */ jsx6(NameViewer, { marginY: 0.25, variant, reflection: someReflection, reflectionViewer: ReflectionViewer }) : nameViewer,
260
+ reflection.comment ? /* @__PURE__ */ jsx6(CommentViewer, { comment: reflection.comment }) : null,
261
+ someReflection.parameters?.map((parameter) => {
262
+ return /* @__PURE__ */ jsx6(ReflectionViewer, { hiddenFlags, marginY: 0.25, marginX: 1, reflection: parameter }, parameter.id);
263
+ }) ?? null,
264
+ children
265
+ ] });
266
+ };
278
267
 
279
268
  // src/ReflectionViewer/ReflectionGroupViewer.tsx
280
- var hide2 = /* @__PURE__ */ __name((flags, hiddenFlags = []) => {
269
+ import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
270
+ var hide2 = (flags, hiddenFlags = []) => {
281
271
  let hide3 = false;
282
272
  for (const hiddenFlag of hiddenFlags) {
283
273
  if (flags?.[hiddenFlag]) {
@@ -285,8 +275,17 @@ var hide2 = /* @__PURE__ */ __name((flags, hiddenFlags = []) => {
285
275
  }
286
276
  }
287
277
  return hide3;
288
- }, "hide");
289
- var ReflectionGroupViewer = /* @__PURE__ */ __name(({ autoScroll = false, children, hiddenFlags, group, lookup, renderer = ReflectionViewer, variant, ...props }) => {
278
+ };
279
+ var ReflectionGroupViewer = ({
280
+ autoScroll = false,
281
+ children,
282
+ hiddenFlags,
283
+ group,
284
+ lookup,
285
+ renderer = ReflectionViewer,
286
+ variant,
287
+ ...props
288
+ }) => {
290
289
  const resolvedChildren = resolveChildren(group, lookup) ?? [];
291
290
  const visibleChildren = hiddenFlags ? resolvedChildren.reduce((acc, item) => {
292
291
  return acc + (hide2(item.flags, hiddenFlags) ? 0 : 1);
@@ -294,354 +293,331 @@ var ReflectionGroupViewer = /* @__PURE__ */ __name(({ autoScroll = false, childr
294
293
  const { hash } = useLocation();
295
294
  useEffect(() => {
296
295
  if (hash && autoScroll) {
297
- document.querySelector(hash)?.scrollIntoView({
298
- behavior: "smooth"
299
- });
296
+ document.querySelector(hash)?.scrollIntoView({ behavior: "smooth" });
300
297
  }
301
- }, [
302
- hash,
303
- autoScroll
304
- ]);
305
- return visibleChildren > 0 ? /* @__PURE__ */ React7.createElement(FlexCol3, {
306
- title: "ReflectionGroupViewer",
307
- ...props
308
- }, /* @__PURE__ */ React7.createElement(FlexRow2, {
309
- marginY: 1,
310
- justifyContent: "flex-start"
311
- }, /* @__PURE__ */ React7.createElement(Typography4, {
312
- variant
313
- }, group.title), /* @__PURE__ */ React7.createElement(JsonViewerButton, {
314
- size: "small",
315
- variant: "contained",
316
- padding: 0,
317
- marginX: 1,
318
- src: resolveChildren(group, lookup)
319
- })), resolveChildren(group, lookup).map((reflection) => {
320
- return reflection ? /* @__PURE__ */ React7.createElement("div", {
321
- id: reflection.name,
322
- key: reflection.id
323
- }, renderer({
324
- hiddenFlags,
325
- lookup,
326
- margin: 1,
327
- padding: 1,
328
- reflection
329
- })) : null;
330
- }), children) : null;
331
- }, "ReflectionGroupViewer");
298
+ }, [hash, autoScroll]);
299
+ return visibleChildren > 0 ? /* @__PURE__ */ jsxs4(FlexCol3, { title: "ReflectionGroupViewer", ...props, children: [
300
+ /* @__PURE__ */ jsxs4(FlexRow2, { marginY: 1, justifyContent: "flex-start", children: [
301
+ /* @__PURE__ */ jsx7(Typography4, { variant, children: group.title }),
302
+ /* @__PURE__ */ jsx7(JsonViewerButton, { size: "small", variant: "contained", padding: 0, marginX: 1, src: resolveChildren(group, lookup) })
303
+ ] }),
304
+ resolveChildren(group, lookup).map((reflection) => {
305
+ return reflection ? /* @__PURE__ */ jsx7("div", { id: reflection.name, children: renderer({
306
+ hiddenFlags,
307
+ lookup,
308
+ margin: 1,
309
+ padding: 1,
310
+ reflection
311
+ }) }, reflection.id) : null;
312
+ }),
313
+ children
314
+ ] }) : null;
315
+ };
332
316
 
333
317
  // src/ReflectionViewer/Container.tsx
334
- var ContainerReflectionViewer = /* @__PURE__ */ __name(({ children, reflection, hiddenFlags, itemRenderer = ReflectionViewer, ...props }) => {
318
+ import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
319
+ var ContainerReflectionViewer = ({
320
+ children,
321
+ reflection,
322
+ hiddenFlags,
323
+ itemRenderer = ReflectionViewer,
324
+ ...props
325
+ }) => {
335
326
  const lookup = createLookup(reflection);
336
- return /* @__PURE__ */ React8.createElement(ReflectionViewer, {
337
- title: "ContainerReflectionViewer",
338
- sources: true,
339
- reflection,
340
- lookup,
341
- ...props
342
- }, reflection.groups?.map((group) => {
343
- return /* @__PURE__ */ React8.createElement(ReflectionGroupViewer, {
344
- margin: 1,
345
- lookup,
346
- renderer: itemRenderer,
347
- key: group.title,
348
- group,
349
- reflection,
350
- hiddenFlags,
351
- alignItems: "stretch"
352
- });
353
- }), children);
354
- }, "ContainerReflectionViewer");
327
+ return /* @__PURE__ */ jsxs5(ReflectionViewer, { title: "ContainerReflectionViewer", sources: true, reflection, lookup, ...props, children: [
328
+ reflection.groups?.map((group) => {
329
+ return /* @__PURE__ */ jsx8(
330
+ ReflectionGroupViewer,
331
+ {
332
+ margin: 1,
333
+ lookup,
334
+ renderer: itemRenderer,
335
+ group,
336
+ reflection,
337
+ hiddenFlags,
338
+ alignItems: "stretch"
339
+ },
340
+ group.title
341
+ );
342
+ }),
343
+ children
344
+ ] });
345
+ };
355
346
 
356
347
  // src/ReflectionViewer/Declaration.tsx
357
- import React9 from "react";
358
- var DeclarationReflectionViewer = /* @__PURE__ */ __name(({ reflection, hiddenFlags, ...props }) => {
359
- const safeSignatures = /* @__PURE__ */ __name((signatures) => {
360
- return Array.isArray(signatures) ? signatures : signatures ? [
361
- signatures
362
- ] : void 0;
363
- }, "safeSignatures");
364
- return /* @__PURE__ */ React9.createElement(ReflectionViewer, {
365
- nameViewer: reflection.signatures || reflection.getSignature || reflection.setSignature ? null : void 0,
366
- title: "DeclarationReflectionViewer",
367
- hiddenFlags,
368
- reflection,
369
- ...props
370
- }, reflection.signatures?.map((signature) => {
371
- return /* @__PURE__ */ React9.createElement(ReflectionViewer, {
372
- key: signature.id,
348
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
349
+ var DeclarationReflectionViewer = ({
350
+ reflection,
351
+ hiddenFlags,
352
+ ...props
353
+ }) => {
354
+ const safeSignatures = (signatures) => {
355
+ return Array.isArray(signatures) ? signatures : signatures ? [signatures] : void 0;
356
+ };
357
+ return /* @__PURE__ */ jsxs6(
358
+ ReflectionViewer,
359
+ {
360
+ nameViewer: reflection.signatures || reflection.getSignature || reflection.setSignature ? null : void 0,
361
+ title: "DeclarationReflectionViewer",
373
362
  hiddenFlags,
374
- reflection: signature
375
- });
376
- }), safeSignatures(reflection.getSignature)?.map((signature) => {
377
- return /* @__PURE__ */ React9.createElement(ReflectionViewer, {
378
- marginX: 1,
379
- key: signature.id,
380
- hiddenFlags,
381
- reflection: signature
382
- });
383
- }), safeSignatures(reflection.setSignature)?.map((signature) => {
384
- return /* @__PURE__ */ React9.createElement(ReflectionViewer, {
385
- marginX: 1,
386
- key: signature.id,
387
- hiddenFlags,
388
- reflection: signature
389
- });
390
- }));
391
- }, "DeclarationReflectionViewer");
363
+ reflection,
364
+ ...props,
365
+ children: [
366
+ reflection.signatures?.map((signature) => {
367
+ return /* @__PURE__ */ jsx9(ReflectionViewer, { hiddenFlags, reflection: signature }, signature.id);
368
+ }),
369
+ safeSignatures(reflection.getSignature)?.map((signature) => {
370
+ return /* @__PURE__ */ jsx9(ReflectionViewer, { marginX: 1, hiddenFlags, reflection: signature }, signature.id);
371
+ }),
372
+ safeSignatures(reflection.setSignature)?.map((signature) => {
373
+ return /* @__PURE__ */ jsx9(ReflectionViewer, { marginX: 1, hiddenFlags, reflection: signature }, signature.id);
374
+ })
375
+ ]
376
+ }
377
+ );
378
+ };
392
379
 
393
380
  // src/ReflectionViewer/DeclarationContainer.tsx
394
381
  import { useTheme } from "@mui/material";
395
- import React10 from "react";
396
382
  import { useLocation as useLocation2 } from "react-router-dom";
397
- var DeclarationContainerReflectionViewer = /* @__PURE__ */ __name(({ reflection, lookup, itemRenderer = DeclarationReflectionViewer, ...props }) => {
383
+ import { jsx as jsx10 } from "react/jsx-runtime";
384
+ var DeclarationContainerReflectionViewer = ({
385
+ reflection,
386
+ lookup,
387
+ itemRenderer = DeclarationReflectionViewer,
388
+ ...props
389
+ }) => {
398
390
  const { hash } = useLocation2();
399
391
  const theme = useTheme();
400
- return /* @__PURE__ */ React10.createElement(ContainerReflectionViewer, {
401
- title: "DeclarationContainerReflectionViewer",
402
- paper: hash.slice(1) === reflection.name,
403
- bgcolor: hash.slice(1) === reflection.name ? theme.vars.palette.background.default : void 0,
404
- lookup,
405
- itemRenderer,
406
- reflection,
407
- ...props
408
- });
409
- }, "DeclarationContainerReflectionViewer");
392
+ return /* @__PURE__ */ jsx10(
393
+ ContainerReflectionViewer,
394
+ {
395
+ title: "DeclarationContainerReflectionViewer",
396
+ paper: hash.slice(1) === reflection.name,
397
+ bgcolor: hash.slice(1) === reflection.name ? theme.vars.palette.background.default : void 0,
398
+ lookup,
399
+ itemRenderer,
400
+ reflection,
401
+ ...props
402
+ }
403
+ );
404
+ };
410
405
 
411
406
  // src/ReflectionViewer/Project.tsx
412
- import React11, { useMemo } from "react";
413
- var ProjectReflectionViewer = /* @__PURE__ */ __name(({ reflection, hiddenFlags, itemRenderer = ReflectionViewer, ...props }) => {
414
- const lookup = useMemo(() => createLookup(reflection), [
415
- reflection
416
- ]);
417
- return /* @__PURE__ */ React11.createElement(ReflectionViewer, {
418
- title: "ProjectReflectionViewer",
419
- hiddenFlags,
420
- reflection,
421
- ...props
422
- }, useMemo(() => {
407
+ import { useMemo } from "react";
408
+ import { jsx as jsx11 } from "react/jsx-runtime";
409
+ var ProjectReflectionViewer = ({
410
+ reflection,
411
+ hiddenFlags,
412
+ itemRenderer = ReflectionViewer,
413
+ ...props
414
+ }) => {
415
+ const lookup = useMemo(() => createLookup(reflection), [reflection]);
416
+ return /* @__PURE__ */ jsx11(ReflectionViewer, { title: "ProjectReflectionViewer", hiddenFlags, reflection, ...props, children: useMemo(() => {
423
417
  return reflection.groups?.map((group) => {
424
- return /* @__PURE__ */ React11.createElement(ReflectionGroupViewer, {
425
- autoScroll: true,
426
- variant: "h6",
427
- lookup,
428
- key: group.title,
429
- renderer: itemRenderer,
430
- group,
431
- reflection,
432
- alignItems: "stretch",
433
- hiddenFlags
434
- });
418
+ return /* @__PURE__ */ jsx11(
419
+ ReflectionGroupViewer,
420
+ {
421
+ autoScroll: true,
422
+ variant: "h6",
423
+ lookup,
424
+ renderer: itemRenderer,
425
+ group,
426
+ reflection,
427
+ alignItems: "stretch",
428
+ hiddenFlags
429
+ },
430
+ group.title
431
+ );
435
432
  });
436
- }, [
437
- lookup,
438
- reflection,
439
- hiddenFlags,
440
- itemRenderer
441
- ]));
442
- }, "ProjectReflectionViewer");
433
+ }, [lookup, reflection, hiddenFlags, itemRenderer]) });
434
+ };
443
435
 
444
436
  // src/TwoPanelReflectionViewer.tsx
445
437
  import { Search } from "@mui/icons-material";
446
438
  import { TextField, useTheme as useTheme2 } from "@mui/material";
447
- import { FlexCol as FlexCol6, FlexGrowCol, FlexRow as FlexRow4 } from "@xylabs/react-flexbox";
448
- import React14, { useMemo as useMemo2, useState as useState2 } from "react";
439
+ import {
440
+ FlexCol as FlexCol6,
441
+ FlexGrowCol,
442
+ FlexRow as FlexRow4
443
+ } from "@xylabs/react-flexbox";
444
+ import { useMemo as useMemo2, useState as useState2 } from "react";
449
445
 
450
446
  // src/TreeViewer/Reflection.tsx
451
447
  import { Add, Remove } from "@mui/icons-material";
452
448
  import { Typography as Typography5 } from "@mui/material";
453
449
  import { SimpleTreeView, TreeItem } from "@mui/x-tree-view";
454
450
  import { FlexCol as FlexCol4 } from "@xylabs/react-flexbox";
455
- import React12 from "react";
456
451
  import { useNavigate } from "react-router-dom";
457
- var ReflectionTreeViewer = /* @__PURE__ */ __name(({ lookup, reflection, searchTerm, ...props }) => {
452
+ import { jsx as jsx12 } from "react/jsx-runtime";
453
+ var ReflectionTreeViewer = ({
454
+ lookup,
455
+ reflection,
456
+ searchTerm,
457
+ ...props
458
+ }) => {
458
459
  const navigate = useNavigate();
459
- return /* @__PURE__ */ React12.createElement(FlexCol4, {
460
- alignItems: "stretch",
461
- ...props
462
- }, /* @__PURE__ */ React12.createElement(SimpleTreeView, {
463
- "aria-label": "XYO SDK Documentation",
464
- slots: {
465
- collapseIcon: Remove,
466
- expandIcon: Add
467
- },
468
- expandedItems: reflection.groups ? [
469
- reflection.groups[0].title
470
- ] : []
471
- }, reflection.groups?.map((group, index) => /* @__PURE__ */ React12.createElement(TreeItem, {
472
- key: `primary-${index}`,
473
- itemId: group.title,
474
- label: /* @__PURE__ */ React12.createElement(Typography5, {
475
- variant: "h6"
476
- }, group.title)
477
- }, group.children.map((child, jndex) => {
478
- const searchTermTrimmed = searchTerm?.trim().toLowerCase();
479
- const childReflection = typeof child === "number" ? lookup?.[child] : child;
480
- return childReflection && (!searchTermTrimmed || childReflection.name.toLowerCase().includes(searchTermTrimmed)) ? /* @__PURE__ */ React12.createElement(TreeItem, {
481
- key: `secondary-${index}- ${jndex}`,
482
- itemId: `declaration-${childReflection?.id}`,
483
- label: childReflection.name,
484
- onClick: /* @__PURE__ */ __name(() => {
485
- const hash = `#${childReflection.name}`;
486
- void navigate({
487
- hash
488
- });
489
- document.querySelector(hash)?.scrollIntoView({
490
- behavior: "smooth"
491
- });
492
- }, "onClick")
493
- }) : null;
494
- })))));
495
- }, "ReflectionTreeViewer");
460
+ return /* @__PURE__ */ jsx12(FlexCol4, { alignItems: "stretch", ...props, children: /* @__PURE__ */ jsx12(
461
+ SimpleTreeView,
462
+ {
463
+ "aria-label": "XYO SDK Documentation",
464
+ slots: { collapseIcon: Remove, expandIcon: Add },
465
+ expandedItems: reflection.groups ? [reflection.groups[0].title] : [],
466
+ children: reflection.groups?.map((group, index) => /* @__PURE__ */ jsx12(TreeItem, { itemId: group.title, label: /* @__PURE__ */ jsx12(Typography5, { variant: "h6", children: group.title }), children: group.children.map((child, jndex) => {
467
+ const searchTermTrimmed = searchTerm?.trim().toLowerCase();
468
+ const childReflection = typeof child === "number" ? lookup?.[child] : child;
469
+ return childReflection && (!searchTermTrimmed || childReflection.name.toLowerCase().includes(searchTermTrimmed)) ? /* @__PURE__ */ jsx12(
470
+ TreeItem,
471
+ {
472
+ itemId: `declaration-${childReflection?.id}`,
473
+ label: childReflection.name,
474
+ onClick: () => {
475
+ const hash = `#${childReflection.name}`;
476
+ void navigate({ hash });
477
+ document.querySelector(hash)?.scrollIntoView({ behavior: "smooth" });
478
+ }
479
+ },
480
+ `secondary-${index}- ${jndex}`
481
+ ) : null;
482
+ }) }, `primary-${index}`))
483
+ }
484
+ ) });
485
+ };
496
486
 
497
487
  // src/TreeViewer/ReflectionGroup.tsx
498
488
  import { Typography as Typography6 } from "@mui/material";
499
489
  import { FlexCol as FlexCol5, FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
500
- import React13 from "react";
501
- var ReflectionGroupTreeViewer = /* @__PURE__ */ __name(({ variant, group, children, lookup, renderer = ReflectionViewer, ...props }) => {
502
- return /* @__PURE__ */ React13.createElement(FlexCol5, props, /* @__PURE__ */ React13.createElement(FlexRow3, {
503
- marginY: 1,
504
- justifyContent: "flex-start"
505
- }, /* @__PURE__ */ React13.createElement(Typography6, {
506
- variant
507
- }, group.title), /* @__PURE__ */ React13.createElement(JsonViewerButton, {
508
- size: "small",
509
- variant: "contained",
510
- padding: 0,
511
- marginX: 1,
512
- src: resolveChildren(group, lookup)
513
- })), resolveChildren(group, lookup).map((reflection) => {
514
- return reflection ? /* @__PURE__ */ React13.createElement("div", {
515
- key: reflection.id
516
- }, renderer({
517
- lookup,
518
- margin: 1,
519
- reflection
520
- })) : null;
521
- }), children);
522
- }, "ReflectionGroupTreeViewer");
490
+ import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
491
+ var ReflectionGroupTreeViewer = ({
492
+ variant,
493
+ group,
494
+ children,
495
+ lookup,
496
+ renderer = ReflectionViewer,
497
+ ...props
498
+ }) => {
499
+ return /* @__PURE__ */ jsxs7(FlexCol5, { ...props, children: [
500
+ /* @__PURE__ */ jsxs7(FlexRow3, { marginY: 1, justifyContent: "flex-start", children: [
501
+ /* @__PURE__ */ jsx13(Typography6, { variant, children: group.title }),
502
+ /* @__PURE__ */ jsx13(JsonViewerButton, { size: "small", variant: "contained", padding: 0, marginX: 1, src: resolveChildren(group, lookup) })
503
+ ] }),
504
+ resolveChildren(group, lookup).map((reflection) => {
505
+ return reflection ? /* @__PURE__ */ jsx13("div", { children: renderer({
506
+ lookup,
507
+ margin: 1,
508
+ reflection
509
+ }) }, reflection.id) : null;
510
+ }),
511
+ children
512
+ ] });
513
+ };
523
514
 
524
515
  // src/TwoPanelReflectionViewer.tsx
525
- var TwoPanelReflectionViewer = /* @__PURE__ */ __name(({ reflection, itemRenderer = ReflectionViewer, hiddenFlags, ...props }) => {
526
- const lookup = useMemo2(() => createLookup(reflection), [
527
- reflection
528
- ]);
516
+ import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
517
+ var TwoPanelReflectionViewer = ({
518
+ reflection,
519
+ itemRenderer = ReflectionViewer,
520
+ hiddenFlags,
521
+ ...props
522
+ }) => {
523
+ const lookup = useMemo2(() => createLookup(reflection), [reflection]);
529
524
  const theme = useTheme2();
530
525
  const [searchTerm, setSearchTerm] = useState2();
531
- const onSearchTermChange = /* @__PURE__ */ __name((e) => {
526
+ const onSearchTermChange = (e) => {
532
527
  setSearchTerm(e.target.value);
533
- }, "onSearchTermChange");
528
+ };
534
529
  const reflectionGroups = useMemo2(() => {
535
530
  return reflection.groups?.map((group) => {
536
- return /* @__PURE__ */ React14.createElement(ReflectionGroupViewer, {
537
- autoScroll: true,
538
- variant: "h6",
539
- lookup,
540
- renderer: itemRenderer,
541
- key: group.title,
542
- group,
543
- reflection,
544
- alignItems: "stretch",
545
- hiddenFlags
546
- });
531
+ return /* @__PURE__ */ jsx14(
532
+ ReflectionGroupViewer,
533
+ {
534
+ autoScroll: true,
535
+ variant: "h6",
536
+ lookup,
537
+ renderer: itemRenderer,
538
+ group,
539
+ reflection,
540
+ alignItems: "stretch",
541
+ hiddenFlags
542
+ },
543
+ group.title
544
+ );
547
545
  });
548
- }, [
549
- itemRenderer,
550
- lookup,
551
- reflection,
552
- hiddenFlags
553
- ]);
554
- const NavigationCol = /* @__PURE__ */ __name((props2) => {
555
- return /* @__PURE__ */ React14.createElement(FlexCol6, props2, /* @__PURE__ */ React14.createElement(TextField, {
556
- fullWidth: true,
557
- onChange: onSearchTermChange,
558
- slotProps: {
559
- input: {
560
- startAdornment: /* @__PURE__ */ React14.createElement(Search, null)
546
+ }, [itemRenderer, lookup, reflection, hiddenFlags]);
547
+ const NavigationCol = (props2) => {
548
+ return /* @__PURE__ */ jsxs8(FlexCol6, { ...props2, children: [
549
+ /* @__PURE__ */ jsx14(
550
+ TextField,
551
+ {
552
+ fullWidth: true,
553
+ onChange: onSearchTermChange,
554
+ slotProps: { input: { startAdornment: /* @__PURE__ */ jsx14(Search, {}) } }
555
+ }
556
+ ),
557
+ /* @__PURE__ */ jsx14(FlexGrowCol, { marginTop: 1, alignItems: "stretch", children: /* @__PURE__ */ jsx14(
558
+ ReflectionTreeViewer,
559
+ {
560
+ justifyContent: "flex-start",
561
+ position: "absolute",
562
+ top: 0,
563
+ left: 0,
564
+ right: 0,
565
+ bottom: 0,
566
+ overflow: "scroll",
567
+ searchTerm,
568
+ hiddenFlags,
569
+ reflection,
570
+ lookup,
571
+ border: `1px solid ${theme.vars.palette.grey["300"]}`,
572
+ borderRadius: 1,
573
+ paddingY: 1
561
574
  }
575
+ ) })
576
+ ] });
577
+ };
578
+ const DetailsCol = (props2) => {
579
+ return /* @__PURE__ */ jsx14(FlexGrowCol, { ...props2, children: /* @__PURE__ */ jsx14(FlexGrowCol, { alignItems: "stretch", children: /* @__PURE__ */ jsx14(
580
+ FlexCol6,
581
+ {
582
+ alignItems: "stretch",
583
+ justifyContent: "flex-start",
584
+ position: "absolute",
585
+ top: 0,
586
+ left: 0,
587
+ right: 0,
588
+ bottom: 0,
589
+ overflow: "scroll",
590
+ borderRadius: 1,
591
+ padding: 1,
592
+ border: `1px solid ${theme.vars.palette.grey["300"]}`,
593
+ children: reflectionGroups
562
594
  }
563
- }), /* @__PURE__ */ React14.createElement(FlexGrowCol, {
564
- marginTop: 1,
565
- alignItems: "stretch"
566
- }, /* @__PURE__ */ React14.createElement(ReflectionTreeViewer, {
567
- justifyContent: "flex-start",
568
- position: "absolute",
569
- top: 0,
570
- left: 0,
571
- right: 0,
572
- bottom: 0,
573
- overflow: "scroll",
574
- searchTerm,
575
- hiddenFlags,
576
- reflection,
577
- lookup,
578
- border: `1px solid ${theme.vars.palette.grey["300"]}`,
579
- borderRadius: 1,
580
- paddingY: 1
581
- })));
582
- }, "NavigationCol");
583
- const DetailsCol = /* @__PURE__ */ __name((props2) => {
584
- return /* @__PURE__ */ React14.createElement(FlexGrowCol, props2, /* @__PURE__ */ React14.createElement(FlexGrowCol, {
585
- alignItems: "stretch"
586
- }, /* @__PURE__ */ React14.createElement(FlexCol6, {
587
- alignItems: "stretch",
588
- justifyContent: "flex-start",
589
- position: "absolute",
590
- top: 0,
591
- left: 0,
592
- right: 0,
593
- bottom: 0,
594
- overflow: "scroll",
595
- borderRadius: 1,
596
- padding: 1,
597
- border: `1px solid ${theme.vars.palette.grey["300"]}`
598
- }, reflectionGroups)));
599
- }, "DetailsCol");
600
- return /* @__PURE__ */ React14.createElement(FlexRow4, {
601
- alignItems: "stretch",
602
- justifyContent: "start",
603
- sx: {
604
- overflowY: "scroll"
605
- },
606
- ...props
607
- }, /* @__PURE__ */ React14.createElement(NavigationCol, {
608
- minWidth: 320,
609
- alignItems: "stretch",
610
- justifyContent: "flex-start",
611
- overflow: "hidden"
612
- }), /* @__PURE__ */ React14.createElement(DetailsCol, {
613
- marginLeft: 1,
614
- alignItems: "stretch",
615
- justifyContent: "flex-start",
616
- overflow: "hidden"
617
- }));
618
- }, "TwoPanelReflectionViewer");
595
+ ) }) });
596
+ };
597
+ return /* @__PURE__ */ jsxs8(FlexRow4, { alignItems: "stretch", justifyContent: "start", sx: { overflowY: "scroll" }, ...props, children: [
598
+ /* @__PURE__ */ jsx14(NavigationCol, { minWidth: 320, alignItems: "stretch", justifyContent: "flex-start", overflow: "hidden" }),
599
+ /* @__PURE__ */ jsx14(DetailsCol, { marginLeft: 1, alignItems: "stretch", justifyContent: "flex-start", overflow: "hidden" })
600
+ ] });
601
+ };
619
602
 
620
603
  // src/ProjectTwoPanelReflectionViewer.tsx
621
- var ProjectTwoPanelReflectionViewer = /* @__PURE__ */ __name(({ reflection, itemRenderer = DeclarationContainerReflectionViewer, ...props }) => {
604
+ import { jsx as jsx15 } from "react/jsx-runtime";
605
+ var ProjectTwoPanelReflectionViewer = ({
606
+ reflection,
607
+ itemRenderer = DeclarationContainerReflectionViewer,
608
+ ...props
609
+ }) => {
622
610
  assertEx(reflection.isProject, () => "Project expected to be Project");
623
- return /* @__PURE__ */ React15.createElement(TwoPanelReflectionViewer, {
624
- itemRenderer,
625
- reflection,
626
- ...props
627
- });
628
- }, "ProjectTwoPanelReflectionViewer");
611
+ return /* @__PURE__ */ jsx15(TwoPanelReflectionViewer, { itemRenderer, reflection, ...props });
612
+ };
629
613
 
630
614
  // src/SourceViewer.tsx
631
615
  import { Typography as Typography7 } from "@mui/material";
632
616
  import { FlexCol as FlexCol7 } from "@xylabs/react-flexbox";
633
- import React16 from "react";
634
- var SourceViewer = /* @__PURE__ */ __name(({ source, ...props }) => {
635
- return /* @__PURE__ */ React16.createElement(FlexCol7, {
636
- alignItems: "stretch",
637
- ...props
638
- }, /* @__PURE__ */ React16.createElement(Typography7, {
639
- style: {
640
- opacity: 0.5
641
- },
642
- variant: "body2"
643
- }, /* @__PURE__ */ React16.createElement("i", null, source.fileName)));
644
- }, "SourceViewer");
617
+ import { jsx as jsx16 } from "react/jsx-runtime";
618
+ var SourceViewer = ({ source, ...props }) => {
619
+ return /* @__PURE__ */ jsx16(FlexCol7, { alignItems: "stretch", ...props, children: /* @__PURE__ */ jsx16(Typography7, { style: { opacity: 0.5 }, variant: "body2", children: /* @__PURE__ */ jsx16("i", { children: source.fileName }) }) });
620
+ };
645
621
  export {
646
622
  CommentViewer,
647
623
  ContainerReflectionViewer,