@xyo-network/react-typedoc 7.4.2 → 7.5.0

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