@xyo-network/react-typedoc 2.64.0 → 2.64.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.
- package/dist/browser/CommentViewer.js +3 -2
- package/dist/browser/CommentViewer.js.map +1 -1
- package/dist/browser/JsonViewerButton.js +4 -3
- package/dist/browser/JsonViewerButton.js.map +1 -1
- package/dist/browser/ProjectTwoPanelReflectionViewer.js +513 -5
- package/dist/browser/ProjectTwoPanelReflectionViewer.js.map +1 -1
- package/dist/browser/ReflectionViewer/Container.js +294 -7
- package/dist/browser/ReflectionViewer/Container.js.map +1 -1
- package/dist/browser/ReflectionViewer/Declaration.js +208 -7
- package/dist/browser/ReflectionViewer/Declaration.js.map +1 -1
- package/dist/browser/ReflectionViewer/DeclarationContainer.js +355 -6
- package/dist/browser/ReflectionViewer/DeclarationContainer.js.map +1 -1
- package/dist/browser/ReflectionViewer/NameViewer.js +157 -15
- package/dist/browser/ReflectionViewer/NameViewer.js.map +1 -1
- package/dist/browser/ReflectionViewer/Project.js +296 -7
- package/dist/browser/ReflectionViewer/Project.js.map +1 -1
- package/dist/browser/ReflectionViewer/ReflectionGroupViewer.js +237 -17
- package/dist/browser/ReflectionViewer/ReflectionGroupViewer.js.map +1 -1
- package/dist/browser/ReflectionViewer/ReflectionViewer.js +185 -9
- package/dist/browser/ReflectionViewer/ReflectionViewer.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.js +107 -5
- package/dist/browser/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildArrayString.js +2 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildArrayString.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildIntersectionString.js +2 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildIntersectionString.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildReferenceString.js +2 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildReferenceString.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildReflectionString.js +2 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildReflectionString.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildTypeString.js +63 -6
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildTypeString.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildUnionString.js +2 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/buildUnionString.js.map +1 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/index.js +115 -1
- package/dist/browser/ReflectionViewer/SomeTypeViewer/index.js.map +1 -1
- package/dist/browser/ReflectionViewer/index.js +412 -8
- package/dist/browser/ReflectionViewer/index.js.map +1 -1
- package/dist/browser/SourceViewer.js +3 -2
- package/dist/browser/SourceViewer.js.map +1 -1
- package/dist/browser/TreeViewer/Reflection.js +3 -2
- package/dist/browser/TreeViewer/Reflection.js.map +1 -1
- package/dist/browser/TreeViewer/ReflectionGroup.js +231 -11
- package/dist/browser/TreeViewer/ReflectionGroup.js.map +1 -1
- package/dist/browser/TreeViewer/index.js +299 -2
- package/dist/browser/TreeViewer/index.js.map +1 -1
- package/dist/browser/TwoPanelReflectionViewer.js +344 -18
- package/dist/browser/TwoPanelReflectionViewer.js.map +1 -1
- package/dist/browser/createLookup.js +2 -1
- package/dist/browser/createLookup.js.map +1 -1
- package/dist/browser/index.js +611 -9
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/resolveChildren.js +2 -1
- package/dist/browser/resolveChildren.js.map +1 -1
- package/dist/browser/trimFlagLabel.js +2 -1
- package/dist/browser/trimFlagLabel.js.map +1 -1
- package/dist/docs.json +72 -72
- package/package.json +6 -6
|
@@ -1,10 +1,211 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
// src/ReflectionViewer/ReflectionViewer.tsx
|
|
2
|
+
import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
|
|
3
|
+
|
|
4
|
+
// src/CommentViewer.tsx
|
|
5
|
+
import { Typography } from "@mui/material";
|
|
6
|
+
import { FlexCol } from "@xylabs/react-flexbox";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var CommentViewer = ({ comment, ...props }) => {
|
|
9
|
+
return /* @__PURE__ */ jsx(FlexCol, { alignItems: "stretch", ...props, children: /* @__PURE__ */ jsx(Typography, { variant: "body2", children: comment.summary[0]?.text }) });
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// src/ReflectionViewer/NameViewer.tsx
|
|
13
|
+
import { Chip, Stack, Typography as Typography3 } from "@mui/material";
|
|
14
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
15
|
+
|
|
16
|
+
// src/JsonViewerButton.tsx
|
|
17
|
+
import { Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
|
|
18
|
+
import { ButtonEx } from "@xylabs/react-button";
|
|
19
|
+
import { lazy, Suspense, useState } from "react";
|
|
20
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
21
|
+
var JsonView = lazy(() => import(
|
|
22
|
+
/* webpackChunkName: "jsonView" */
|
|
23
|
+
"react-json-view"
|
|
24
|
+
));
|
|
25
|
+
var JsonViewerButton = ({ jsonViewProps, src, title, ...props }) => {
|
|
26
|
+
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(Suspense, { fallback: /* @__PURE__ */ jsx2("div", {}), children: /* @__PURE__ */ jsx2(JsonView, { src, ...jsonViewProps }) }) }),
|
|
32
|
+
/* @__PURE__ */ jsx2(DialogActions, { children: /* @__PURE__ */ jsx2(ButtonEx, { onClick: () => setOpen(false), children: "Close" }) })
|
|
33
|
+
] })
|
|
34
|
+
] });
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// src/trimFlagLabel.ts
|
|
38
|
+
var trimFlagLabel = (label) => {
|
|
39
|
+
if (label.startsWith("is")) {
|
|
40
|
+
return label.substring(2);
|
|
41
|
+
}
|
|
42
|
+
return label;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx
|
|
46
|
+
import { Typography as Typography2 } from "@mui/material";
|
|
47
|
+
|
|
48
|
+
// src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx
|
|
49
|
+
var buildArrayString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
50
|
+
const parts = [];
|
|
51
|
+
const typeString = typeBuilder(typeObj.elementType, reflectionViewer);
|
|
52
|
+
if (typeof typeString === "string") {
|
|
53
|
+
parts.push(typeString);
|
|
54
|
+
}
|
|
55
|
+
parts.push("[]");
|
|
56
|
+
return parts;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx
|
|
60
|
+
var buildIntersectionString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
61
|
+
const parts = [];
|
|
62
|
+
if (typeObj.types) {
|
|
63
|
+
parts.push(
|
|
64
|
+
typeObj.types.map((arg) => {
|
|
65
|
+
return typeBuilder(arg, reflectionViewer);
|
|
66
|
+
}).join(" & ")
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
return parts;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts
|
|
73
|
+
var buildReferenceString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
74
|
+
const parts = [];
|
|
75
|
+
parts.push(typeObj.name);
|
|
76
|
+
if (typeObj.typeArguments) {
|
|
77
|
+
parts.push("<");
|
|
78
|
+
parts.push(
|
|
79
|
+
typeObj.typeArguments.map((arg) => {
|
|
80
|
+
return typeBuilder(arg, reflectionViewer);
|
|
81
|
+
}).join(", ")
|
|
82
|
+
);
|
|
83
|
+
parts.push(">");
|
|
84
|
+
}
|
|
85
|
+
return parts;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx
|
|
89
|
+
import { Fragment as Fragment2, jsx as jsx3 } from "react/jsx-runtime";
|
|
90
|
+
var buildRelfectionString = (typeObj, reflectionViewer) => {
|
|
91
|
+
if (typeObj.declaration) {
|
|
92
|
+
return /* @__PURE__ */ jsx3(Fragment2, { children: reflectionViewer({ reflection: typeObj.declaration }) });
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx
|
|
97
|
+
var buildUnionString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
98
|
+
const parts = [];
|
|
99
|
+
if (typeObj.types) {
|
|
100
|
+
parts.push(
|
|
101
|
+
typeObj.types.map((arg) => {
|
|
102
|
+
return typeBuilder(arg, reflectionViewer);
|
|
103
|
+
}).join(" | ")
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
return parts;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx
|
|
110
|
+
var buildTypeString = (type, reflectionViewer) => {
|
|
111
|
+
const someType = type;
|
|
112
|
+
const parts = [];
|
|
113
|
+
switch (someType.type) {
|
|
114
|
+
case "intrinsic":
|
|
115
|
+
parts.push(someType.name);
|
|
116
|
+
break;
|
|
117
|
+
case "intersection": {
|
|
118
|
+
parts.push(...buildIntersectionString(someType, reflectionViewer, buildTypeString));
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
case "literal":
|
|
122
|
+
parts.push(JSON.stringify(someType.value));
|
|
123
|
+
break;
|
|
124
|
+
case "array": {
|
|
125
|
+
parts.push(...buildArrayString(someType, reflectionViewer, buildTypeString));
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
case "reference": {
|
|
129
|
+
parts.push(...buildReferenceString(someType, reflectionViewer, buildTypeString));
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
case "union": {
|
|
133
|
+
parts.push(...buildUnionString(someType, reflectionViewer, buildTypeString));
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
case "reflection": {
|
|
137
|
+
return buildRelfectionString(someType, reflectionViewer);
|
|
138
|
+
}
|
|
139
|
+
default:
|
|
140
|
+
parts.push("#");
|
|
141
|
+
parts.push(someType.type);
|
|
142
|
+
parts.push("#");
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
return parts.join("");
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
// src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx
|
|
149
|
+
import { Fragment as Fragment3, jsx as jsx4 } from "react/jsx-runtime";
|
|
150
|
+
var SomeTypeViewer = ({ opacity = 0.5, reflection, reflectionViewer, ...props }) => {
|
|
151
|
+
const typeReactNode = reflection.type ? buildTypeString(reflection.type, reflectionViewer) : "";
|
|
152
|
+
if (typeof typeReactNode === "string") {
|
|
153
|
+
return /* @__PURE__ */ jsx4(Typography2, { title: "SomeTypeViewer", style: { opacity }, ...props, children: typeReactNode });
|
|
154
|
+
}
|
|
155
|
+
return /* @__PURE__ */ jsx4(Fragment3, { children: typeReactNode });
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// src/ReflectionViewer/NameViewer.tsx
|
|
159
|
+
import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
160
|
+
var NameViewer = ({ reflectionViewer, variant, reflection, ...props }) => {
|
|
161
|
+
return /* @__PURE__ */ jsxs2(FlexRow, { justifyContent: "flex-start", ...props, children: [
|
|
162
|
+
/* @__PURE__ */ jsxs2(FlexRow, { marginRight: 1, children: [
|
|
163
|
+
/* @__PURE__ */ jsxs2(Typography3, { variant, noWrap: true, children: [
|
|
164
|
+
reflection.name,
|
|
165
|
+
reflection.type ? /* @__PURE__ */ jsx5(Fragment4, { children: ":\xA0" }) : null
|
|
166
|
+
] }),
|
|
167
|
+
/* @__PURE__ */ jsx5(SomeTypeViewer, { reflection, reflectionViewer })
|
|
168
|
+
] }),
|
|
169
|
+
/* @__PURE__ */ jsxs2(Stack, { direction: "row", spacing: 1, children: [
|
|
170
|
+
/* @__PURE__ */ jsx5(Chip, { size: "small", label: reflection.kind }),
|
|
171
|
+
reflection.flags ? Object.entries(reflection.flags).map(([flag, value]) => {
|
|
172
|
+
return value ? /* @__PURE__ */ jsx5(Chip, { size: "small", label: trimFlagLabel(flag), variant: "outlined" }, flag) : null;
|
|
173
|
+
}) : null
|
|
174
|
+
] }),
|
|
175
|
+
document && document?.location.hostname === "localhost" && /* @__PURE__ */ jsx5(JsonViewerButton, { jsonViewProps: { collapsed: 1 }, size: "small", variant: "contained", padding: 0, marginX: 1, src: reflection })
|
|
176
|
+
] });
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
// src/ReflectionViewer/ReflectionViewer.tsx
|
|
180
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
181
|
+
var hide = (flags, hiddenFlags = []) => {
|
|
182
|
+
let hide2 = false;
|
|
183
|
+
hiddenFlags.map((hiddenFlag) => {
|
|
184
|
+
if (flags?.[hiddenFlag]) {
|
|
185
|
+
hide2 = true;
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
return hide2;
|
|
189
|
+
};
|
|
190
|
+
var ReflectionViewer = ({ variant, nameViewer, children, reflection, hiddenFlags, ...props }) => {
|
|
191
|
+
const someReflection = reflection;
|
|
192
|
+
return hide(reflection?.flags, hiddenFlags) ? null : /* @__PURE__ */ jsxs3(FlexCol2, { title: "ReflectionViewer", alignItems: "stretch", ...props, children: [
|
|
193
|
+
nameViewer === void 0 ? /* @__PURE__ */ jsx6(NameViewer, { marginY: 0.25, variant, reflection: someReflection, reflectionViewer: ReflectionViewer }) : nameViewer,
|
|
194
|
+
reflection.comment ? /* @__PURE__ */ jsx6(CommentViewer, { comment: reflection.comment }) : null,
|
|
195
|
+
someReflection.parameters?.map((parameter) => {
|
|
196
|
+
return /* @__PURE__ */ jsx6(ReflectionViewer, { hiddenFlags, marginY: 0.25, marginX: 1, reflection: parameter }, parameter.id);
|
|
197
|
+
}) ?? null,
|
|
198
|
+
children
|
|
199
|
+
] });
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
// src/ReflectionViewer/Declaration.tsx
|
|
203
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
204
|
+
var DeclarationReflectionViewer = ({ reflection, hiddenFlags, ...props }) => {
|
|
4
205
|
const safeSignatures = (signatures) => {
|
|
5
206
|
return Array.isArray(signatures) ? signatures : signatures ? [signatures] : void 0;
|
|
6
207
|
};
|
|
7
|
-
return /* @__PURE__ */
|
|
208
|
+
return /* @__PURE__ */ jsxs4(
|
|
8
209
|
ReflectionViewer,
|
|
9
210
|
{
|
|
10
211
|
nameViewer: reflection.signatures || reflection.getSignature || reflection.setSignature ? null : void 0,
|
|
@@ -14,13 +215,13 @@ const DeclarationReflectionViewer = ({ reflection, hiddenFlags, ...props }) => {
|
|
|
14
215
|
...props,
|
|
15
216
|
children: [
|
|
16
217
|
reflection.signatures?.map((signature) => {
|
|
17
|
-
return /* @__PURE__ */
|
|
218
|
+
return /* @__PURE__ */ jsx7(ReflectionViewer, { hiddenFlags, reflection: signature }, signature.id);
|
|
18
219
|
}),
|
|
19
220
|
safeSignatures(reflection.getSignature)?.map((signature) => {
|
|
20
|
-
return /* @__PURE__ */
|
|
221
|
+
return /* @__PURE__ */ jsx7(ReflectionViewer, { marginX: 1, hiddenFlags, reflection: signature }, signature.id);
|
|
21
222
|
}),
|
|
22
223
|
safeSignatures(reflection.setSignature)?.map((signature) => {
|
|
23
|
-
return /* @__PURE__ */
|
|
224
|
+
return /* @__PURE__ */ jsx7(ReflectionViewer, { marginX: 1, hiddenFlags, reflection: signature }, signature.id);
|
|
24
225
|
})
|
|
25
226
|
]
|
|
26
227
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ReflectionViewer/Declaration.tsx"],"sourcesContent":["import type { DeclarationReflection, SignatureReflection } from 'typedoc'\n\nimport { ReflectionViewer } from './ReflectionViewer'\nimport { ReflectionViewerProps } from './ReflectionViewerProps'\n\nexport const DeclarationReflectionViewer: React.FC<ReflectionViewerProps<DeclarationReflection>> = ({ reflection, hiddenFlags, ...props }) => {\n const safeSignatures = (signatures?: SignatureReflection[] | SignatureReflection) => {\n return Array.isArray(signatures) ? signatures : signatures ? [signatures] : undefined\n }\n\n return (\n <ReflectionViewer\n nameViewer={reflection.signatures || reflection.getSignature || reflection.setSignature ? null : undefined}\n title=\"DeclarationReflectionViewer\"\n hiddenFlags={hiddenFlags}\n reflection={reflection}\n {...props}\n >\n {reflection.signatures?.map((signature) => {\n return <ReflectionViewer key={signature.id} hiddenFlags={hiddenFlags} reflection={signature} />\n })}\n {safeSignatures(reflection.getSignature)?.map((signature) => {\n return <ReflectionViewer marginX={1} key={signature.id} hiddenFlags={hiddenFlags} reflection={signature} />\n })}\n {safeSignatures(reflection.setSignature)?.map((signature) => {\n return <ReflectionViewer marginX={1} key={signature.id} hiddenFlags={hiddenFlags} reflection={signature} />\n })}\n </ReflectionViewer>\n )\n}\n"],"mappings":"AAWI,SAQW,KARX;AATJ,SAAS,wBAAwB;AAG1B,MAAM,8BAAsF,CAAC,EAAE,YAAY,aAAa,GAAG,MAAM,MAAM;AAC5I,QAAM,iBAAiB,CAAC,eAA6D;AACnF,WAAO,MAAM,QAAQ,UAAU,IAAI,aAAa,aAAa,CAAC,UAAU,IAAI;AAAA,EAC9E;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,YAAY,WAAW,cAAc,WAAW,gBAAgB,WAAW,eAAe,OAAO;AAAA,MACjG,OAAM;AAAA,MACN;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEH;AAAA,mBAAW,YAAY,IAAI,CAAC,cAAc;AACzC,iBAAO,oBAAC,oBAAoC,aAA0B,YAAY,aAApD,UAAU,EAAqD;AAAA,QAC/F,CAAC;AAAA,QACA,eAAe,WAAW,YAAY,GAAG,IAAI,CAAC,cAAc;AAC3D,iBAAO,oBAAC,oBAAiB,SAAS,GAAsB,aAA0B,YAAY,aAApD,UAAU,EAAqD;AAAA,QAC3G,CAAC;AAAA,QACA,eAAe,WAAW,YAAY,GAAG,IAAI,CAAC,cAAc;AAC3D,iBAAO,oBAAC,oBAAiB,SAAS,GAAsB,aAA0B,YAAY,aAApD,UAAU,EAAqD;AAAA,QAC3G,CAAC;AAAA;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/ReflectionViewer/ReflectionViewer.tsx","../../../src/CommentViewer.tsx","../../../src/ReflectionViewer/NameViewer.tsx","../../../src/JsonViewerButton.tsx","../../../src/trimFlagLabel.ts","../../../src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx","../../../src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx","../../../src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx","../../../src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts","../../../src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx","../../../src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx","../../../src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx","../../../src/ReflectionViewer/Declaration.tsx"],"sourcesContent":["import { FlexCol } from '@xylabs/react-flexbox'\nimport type { ReflectionFlags } from 'typedoc'\n\nimport { CommentViewer } from '../CommentViewer'\nimport { SomeReflection } from '../SomeReflection'\nimport { NameViewer } from './NameViewer'\nimport { FlagFilter, ReflectionViewerProps } from './ReflectionViewerProps'\n\nconst hide = (flags?: ReflectionFlags, hiddenFlags: FlagFilter[] = []) => {\n let hide = false\n hiddenFlags.map((hiddenFlag) => {\n if (flags?.[hiddenFlag]) {\n hide = true\n }\n })\n return hide\n}\n\nexport const ReflectionViewer: React.FC<ReflectionViewerProps> = ({ variant, nameViewer, children, reflection, hiddenFlags, ...props }) => {\n const someReflection = reflection as SomeReflection\n\n return hide(reflection?.flags, hiddenFlags) ? null : (\n <FlexCol title=\"ReflectionViewer\" alignItems=\"stretch\" {...props}>\n {nameViewer === undefined ? (\n <NameViewer marginY={0.25} variant={variant} reflection={someReflection} reflectionViewer={ReflectionViewer} />\n ) : (\n nameViewer\n )}\n {reflection.comment ? <CommentViewer comment={reflection.comment} /> : null}\n {/*sources && reflection.sources && children ? (\n <>\n {reflection.sources.map((source, index) => {\n return <SourceViewer key={index} source={source} />\n })}\n </>\n ) : null*/}\n {someReflection.parameters?.map((parameter) => {\n return <ReflectionViewer hiddenFlags={hiddenFlags} marginY={0.25} marginX={1} key={parameter.id} reflection={parameter} />\n }) ?? null}\n {children}\n </FlexCol>\n )\n}\n","import { Typography } from '@mui/material'\nimport { FlexBoxProps, FlexCol } from '@xylabs/react-flexbox'\nimport type { Comment } from 'typedoc'\n\nexport interface CommentViewerProps extends FlexBoxProps {\n comment: Comment\n}\n\nexport const CommentViewer: React.FC<CommentViewerProps> = ({ comment, ...props }) => {\n return (\n <FlexCol alignItems=\"stretch\" {...props}>\n <Typography variant=\"body2\">{comment.summary[0]?.text}</Typography>\n </FlexCol>\n )\n}\n","import { Chip, Stack, Typography, TypographyVariant } from '@mui/material'\nimport { FlexBoxProps, FlexRow } from '@xylabs/react-flexbox'\n\nimport { JsonViewerButton } from '../JsonViewerButton'\nimport { SomeReflection } from '../SomeReflection'\nimport { trimFlagLabel } from '../trimFlagLabel'\nimport { ReflectionViewerProps } from './ReflectionViewerProps'\nimport { SomeTypeViewer } from './SomeTypeViewer'\n\nexport interface NameViewerProps extends FlexBoxProps {\n reflection: SomeReflection\n reflectionViewer: React.FC<ReflectionViewerProps>\n variant?: TypographyVariant\n}\n\nexport const NameViewer: React.FC<NameViewerProps> = ({ reflectionViewer, variant, reflection, ...props }) => {\n return (\n <FlexRow justifyContent=\"flex-start\" {...props}>\n <FlexRow marginRight={1}>\n <Typography variant={variant} noWrap>\n {reflection.name}\n {reflection.type ? <>: </> : null}\n </Typography>\n <SomeTypeViewer reflection={reflection} reflectionViewer={reflectionViewer} />\n </FlexRow>\n <Stack direction=\"row\" spacing={1}>\n <Chip size=\"small\" label={reflection.kind} />\n {reflection.flags\n ? Object.entries(reflection.flags).map(([flag, value]) => {\n return value ? <Chip size=\"small\" key={flag} label={trimFlagLabel(flag)} variant=\"outlined\" /> : null\n })\n : null}\n </Stack>\n {document && document?.location.hostname === 'localhost' && (\n <JsonViewerButton jsonViewProps={{ collapsed: 1 }} size=\"small\" variant=\"contained\" padding={0} marginX={1} src={reflection} />\n )}\n </FlexRow>\n )\n}\n","import { Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material'\nimport { ButtonEx, ButtonExProps } from '@xylabs/react-button'\nimport { lazy, Suspense, useState } from 'react'\nimport { ReactJsonViewProps } from 'react-json-view'\n\nconst JsonView = lazy(() => import(/* webpackChunkName: \"jsonView\" */ 'react-json-view'))\n\nexport interface JsonViewerButtonProps extends ButtonExProps {\n jsonViewProps?: Partial<ReactJsonViewProps>\n src: object\n}\n\nexport const JsonViewerButton: React.FC<JsonViewerButtonProps> = ({ jsonViewProps, src, title, ...props }) => {\n const [open, setOpen] = useState(false)\n return (\n <>\n <ButtonEx onClick={() => setOpen(!open)} {...props}>\n JSON\n </ButtonEx>\n <Dialog open={open} onClose={() => setOpen(false)}>\n {title ? <DialogTitle>{title}</DialogTitle> : null}\n <DialogContent>\n <Suspense fallback={<div />}>\n <JsonView src={src} {...jsonViewProps} />\n </Suspense>\n </DialogContent>\n <DialogActions>\n <ButtonEx onClick={() => setOpen(false)}>Close</ButtonEx>\n </DialogActions>\n </Dialog>\n </>\n )\n}\n","export const trimFlagLabel = (label: string) => {\n if (label.startsWith('is')) {\n return label.substring(2)\n }\n return label\n}\n","import { Typography, TypographyProps } from '@mui/material'\n\nimport { SomeReflection } from '../../SomeReflection'\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { buildTypeString } from './buildTypeString'\n\nexport interface SomeTypeViewerProps extends TypographyProps {\n opacity?: number\n reflection: SomeReflection\n reflectionViewer: React.FC<ReflectionViewerProps>\n}\n\nexport const SomeTypeViewer: React.FC<SomeTypeViewerProps> = ({ opacity = 0.5, reflection, reflectionViewer, ...props }) => {\n const typeReactNode = reflection.type ? buildTypeString(reflection.type, reflectionViewer) : ''\n if (typeof typeReactNode === 'string') {\n return (\n <Typography title=\"SomeTypeViewer\" style={{ opacity }} {...props}>\n {typeReactNode}\n </Typography>\n )\n }\n return <>{typeReactNode}</>\n}\n","import type { ArrayType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildArrayString = (typeObj: ArrayType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n const typeString = typeBuilder(typeObj.elementType, reflectionViewer)\n if (typeof typeString === 'string') {\n parts.push(typeString)\n }\n parts.push('[]')\n return parts\n}\n","import type { IntersectionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildIntersectionString = (typeObj: IntersectionType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n if (typeObj.types) {\n parts.push(\n typeObj.types\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(' & '),\n )\n }\n return parts\n}\n","import type { ReferenceType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildReferenceString = (typeObj: ReferenceType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n parts.push(typeObj.name)\n if (typeObj.typeArguments) {\n parts.push('<')\n parts.push(\n typeObj.typeArguments\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(', '),\n )\n parts.push('>')\n }\n return parts\n}\n","import type { ReflectionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\n\nexport const buildRelfectionString = (typeObj: ReflectionType, reflectionViewer: React.FC<ReflectionViewerProps>) => {\n if (typeObj.declaration) {\n return <>{reflectionViewer({ reflection: typeObj.declaration })}</>\n }\n}\n","import type { UnionType } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildUnionString = (typeObj: UnionType, reflectionViewer: React.FC<ReflectionViewerProps>, typeBuilder: TypeBuilder) => {\n const parts: string[] = []\n if (typeObj.types) {\n parts.push(\n typeObj.types\n .map((arg) => {\n return typeBuilder(arg, reflectionViewer)\n })\n .join(' | '),\n )\n }\n return parts\n}\n","import { ReactNode } from 'react'\nimport type { SomeType, Type } from 'typedoc'\n\nimport { ReflectionViewerProps } from '../ReflectionViewerProps'\nimport { buildArrayString } from './buildArrayString'\nimport { buildIntersectionString } from './buildIntersectionString'\nimport { buildReferenceString } from './buildReferenceString'\nimport { buildRelfectionString } from './buildReflectionString'\nimport { buildUnionString } from './buildUnionString'\nimport { TypeBuilder } from './TypeBuilder'\n\nexport const buildTypeString: TypeBuilder = (type: SomeType | Type, reflectionViewer: React.FC<ReflectionViewerProps>): ReactNode => {\n const someType = type as SomeType\n const parts: string[] = []\n\n switch (someType.type) {\n case 'intrinsic':\n parts.push(someType.name)\n break\n case 'intersection': {\n parts.push(...buildIntersectionString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'literal':\n parts.push(JSON.stringify(someType.value))\n break\n case 'array': {\n parts.push(...buildArrayString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'reference': {\n parts.push(...buildReferenceString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'union': {\n parts.push(...buildUnionString(someType, reflectionViewer, buildTypeString))\n break\n }\n case 'reflection': {\n return buildRelfectionString(someType, reflectionViewer)\n }\n default:\n parts.push('#')\n parts.push(someType.type)\n parts.push('#')\n break\n }\n return parts.join('')\n}\n","import type { DeclarationReflection, SignatureReflection } from 'typedoc'\n\nimport { ReflectionViewer } from './ReflectionViewer'\nimport { ReflectionViewerProps } from './ReflectionViewerProps'\n\nexport const DeclarationReflectionViewer: React.FC<ReflectionViewerProps<DeclarationReflection>> = ({ reflection, hiddenFlags, ...props }) => {\n const safeSignatures = (signatures?: SignatureReflection[] | SignatureReflection) => {\n return Array.isArray(signatures) ? signatures : signatures ? [signatures] : undefined\n }\n\n return (\n <ReflectionViewer\n nameViewer={reflection.signatures || reflection.getSignature || reflection.setSignature ? null : undefined}\n title=\"DeclarationReflectionViewer\"\n hiddenFlags={hiddenFlags}\n reflection={reflection}\n {...props}\n >\n {reflection.signatures?.map((signature) => {\n return <ReflectionViewer key={signature.id} hiddenFlags={hiddenFlags} reflection={signature} />\n })}\n {safeSignatures(reflection.getSignature)?.map((signature) => {\n return <ReflectionViewer marginX={1} key={signature.id} hiddenFlags={hiddenFlags} reflection={signature} />\n })}\n {safeSignatures(reflection.setSignature)?.map((signature) => {\n return <ReflectionViewer marginX={1} key={signature.id} hiddenFlags={hiddenFlags} reflection={signature} />\n })}\n </ReflectionViewer>\n )\n}\n"],"mappings":";AAAA,SAAS,WAAAA,gBAAe;;;ACAxB,SAAS,kBAAkB;AAC3B,SAAuB,eAAe;AAUhC;AAHC,IAAM,gBAA8C,CAAC,EAAE,SAAS,GAAG,MAAM,MAAM;AACpF,SACE,oBAAC,WAAQ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BAAiB,SAAS,GAAsB,aAA0B,YAAY,aAApD,UAAU,EAAqD;AAAA,QAC3G,CAAC;AAAA;AAAA;AAAA,EACH;AAEJ;","names":["FlexCol","Typography","jsx","Typography","Fragment","jsx","Fragment","jsx","Typography","Fragment","jsx","jsxs","Typography","jsx","jsxs","hide","FlexCol","jsx","jsxs"]}
|
|
@@ -1,17 +1,366 @@
|
|
|
1
|
-
|
|
1
|
+
// src/ReflectionViewer/DeclarationContainer.tsx
|
|
2
2
|
import { useTheme } from "@mui/material";
|
|
3
|
+
import { useLocation as useLocation2 } from "react-router-dom";
|
|
4
|
+
|
|
5
|
+
// src/createLookup.ts
|
|
6
|
+
var createLookup = (reflection) => {
|
|
7
|
+
const lookup = {};
|
|
8
|
+
reflection.children?.forEach((item) => lookup[item.id] = item);
|
|
9
|
+
return lookup;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// src/ReflectionViewer/ReflectionGroupViewer.tsx
|
|
13
|
+
import { Typography as Typography4 } from "@mui/material";
|
|
14
|
+
import { FlexCol as FlexCol3, FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
|
|
15
|
+
import { useEffect } from "react";
|
|
3
16
|
import { useLocation } from "react-router-dom";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
17
|
+
|
|
18
|
+
// src/JsonViewerButton.tsx
|
|
19
|
+
import { Dialog, DialogActions, DialogContent, DialogTitle } from "@mui/material";
|
|
20
|
+
import { ButtonEx } from "@xylabs/react-button";
|
|
21
|
+
import { lazy, Suspense, useState } from "react";
|
|
22
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
23
|
+
var JsonView = lazy(() => import(
|
|
24
|
+
/* webpackChunkName: "jsonView" */
|
|
25
|
+
"react-json-view"
|
|
26
|
+
));
|
|
27
|
+
var JsonViewerButton = ({ jsonViewProps, src, title, ...props }) => {
|
|
28
|
+
const [open, setOpen] = useState(false);
|
|
29
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30
|
+
/* @__PURE__ */ jsx(ButtonEx, { onClick: () => setOpen(!open), ...props, children: "JSON" }),
|
|
31
|
+
/* @__PURE__ */ jsxs(Dialog, { open, onClose: () => setOpen(false), children: [
|
|
32
|
+
title ? /* @__PURE__ */ jsx(DialogTitle, { children: title }) : null,
|
|
33
|
+
/* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("div", {}), children: /* @__PURE__ */ jsx(JsonView, { src, ...jsonViewProps }) }) }),
|
|
34
|
+
/* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(ButtonEx, { onClick: () => setOpen(false), children: "Close" }) })
|
|
35
|
+
] })
|
|
36
|
+
] });
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/resolveChildren.ts
|
|
40
|
+
var resolveChildren = (reflection, lookup = {}) => {
|
|
41
|
+
return reflection.children?.map((child) => {
|
|
42
|
+
switch (typeof child) {
|
|
43
|
+
case "object":
|
|
44
|
+
return child;
|
|
45
|
+
case "number": {
|
|
46
|
+
const childObj = lookup[child];
|
|
47
|
+
if (childObj === void 0) {
|
|
48
|
+
throw Error(`Child Reference Not Found [${child}]`);
|
|
49
|
+
}
|
|
50
|
+
return childObj;
|
|
51
|
+
}
|
|
52
|
+
default:
|
|
53
|
+
throw Error(`Invalid Child Type [${typeof child}, ${child}]`);
|
|
54
|
+
}
|
|
55
|
+
}) ?? [];
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// src/ReflectionViewer/ReflectionViewer.tsx
|
|
59
|
+
import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
|
|
60
|
+
|
|
61
|
+
// src/CommentViewer.tsx
|
|
62
|
+
import { Typography } from "@mui/material";
|
|
63
|
+
import { FlexCol } from "@xylabs/react-flexbox";
|
|
64
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
65
|
+
var CommentViewer = ({ comment, ...props }) => {
|
|
66
|
+
return /* @__PURE__ */ jsx2(FlexCol, { alignItems: "stretch", ...props, children: /* @__PURE__ */ jsx2(Typography, { variant: "body2", children: comment.summary[0]?.text }) });
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// src/ReflectionViewer/NameViewer.tsx
|
|
70
|
+
import { Chip, Stack, Typography as Typography3 } from "@mui/material";
|
|
71
|
+
import { FlexRow } from "@xylabs/react-flexbox";
|
|
72
|
+
|
|
73
|
+
// src/trimFlagLabel.ts
|
|
74
|
+
var trimFlagLabel = (label) => {
|
|
75
|
+
if (label.startsWith("is")) {
|
|
76
|
+
return label.substring(2);
|
|
77
|
+
}
|
|
78
|
+
return label;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx
|
|
82
|
+
import { Typography as Typography2 } from "@mui/material";
|
|
83
|
+
|
|
84
|
+
// src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx
|
|
85
|
+
var buildArrayString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
86
|
+
const parts = [];
|
|
87
|
+
const typeString = typeBuilder(typeObj.elementType, reflectionViewer);
|
|
88
|
+
if (typeof typeString === "string") {
|
|
89
|
+
parts.push(typeString);
|
|
90
|
+
}
|
|
91
|
+
parts.push("[]");
|
|
92
|
+
return parts;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx
|
|
96
|
+
var buildIntersectionString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
97
|
+
const parts = [];
|
|
98
|
+
if (typeObj.types) {
|
|
99
|
+
parts.push(
|
|
100
|
+
typeObj.types.map((arg) => {
|
|
101
|
+
return typeBuilder(arg, reflectionViewer);
|
|
102
|
+
}).join(" & ")
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
return parts;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts
|
|
109
|
+
var buildReferenceString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
110
|
+
const parts = [];
|
|
111
|
+
parts.push(typeObj.name);
|
|
112
|
+
if (typeObj.typeArguments) {
|
|
113
|
+
parts.push("<");
|
|
114
|
+
parts.push(
|
|
115
|
+
typeObj.typeArguments.map((arg) => {
|
|
116
|
+
return typeBuilder(arg, reflectionViewer);
|
|
117
|
+
}).join(", ")
|
|
118
|
+
);
|
|
119
|
+
parts.push(">");
|
|
120
|
+
}
|
|
121
|
+
return parts;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx
|
|
125
|
+
import { Fragment as Fragment2, jsx as jsx3 } from "react/jsx-runtime";
|
|
126
|
+
var buildRelfectionString = (typeObj, reflectionViewer) => {
|
|
127
|
+
if (typeObj.declaration) {
|
|
128
|
+
return /* @__PURE__ */ jsx3(Fragment2, { children: reflectionViewer({ reflection: typeObj.declaration }) });
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
// src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx
|
|
133
|
+
var buildUnionString = (typeObj, reflectionViewer, typeBuilder) => {
|
|
134
|
+
const parts = [];
|
|
135
|
+
if (typeObj.types) {
|
|
136
|
+
parts.push(
|
|
137
|
+
typeObj.types.map((arg) => {
|
|
138
|
+
return typeBuilder(arg, reflectionViewer);
|
|
139
|
+
}).join(" | ")
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
return parts;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx
|
|
146
|
+
var buildTypeString = (type, reflectionViewer) => {
|
|
147
|
+
const someType = type;
|
|
148
|
+
const parts = [];
|
|
149
|
+
switch (someType.type) {
|
|
150
|
+
case "intrinsic":
|
|
151
|
+
parts.push(someType.name);
|
|
152
|
+
break;
|
|
153
|
+
case "intersection": {
|
|
154
|
+
parts.push(...buildIntersectionString(someType, reflectionViewer, buildTypeString));
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
case "literal":
|
|
158
|
+
parts.push(JSON.stringify(someType.value));
|
|
159
|
+
break;
|
|
160
|
+
case "array": {
|
|
161
|
+
parts.push(...buildArrayString(someType, reflectionViewer, buildTypeString));
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
case "reference": {
|
|
165
|
+
parts.push(...buildReferenceString(someType, reflectionViewer, buildTypeString));
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
case "union": {
|
|
169
|
+
parts.push(...buildUnionString(someType, reflectionViewer, buildTypeString));
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
case "reflection": {
|
|
173
|
+
return buildRelfectionString(someType, reflectionViewer);
|
|
174
|
+
}
|
|
175
|
+
default:
|
|
176
|
+
parts.push("#");
|
|
177
|
+
parts.push(someType.type);
|
|
178
|
+
parts.push("#");
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
return parts.join("");
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
// src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx
|
|
185
|
+
import { Fragment as Fragment3, jsx as jsx4 } from "react/jsx-runtime";
|
|
186
|
+
var SomeTypeViewer = ({ opacity = 0.5, reflection, reflectionViewer, ...props }) => {
|
|
187
|
+
const typeReactNode = reflection.type ? buildTypeString(reflection.type, reflectionViewer) : "";
|
|
188
|
+
if (typeof typeReactNode === "string") {
|
|
189
|
+
return /* @__PURE__ */ jsx4(Typography2, { title: "SomeTypeViewer", style: { opacity }, ...props, children: typeReactNode });
|
|
190
|
+
}
|
|
191
|
+
return /* @__PURE__ */ jsx4(Fragment3, { children: typeReactNode });
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// src/ReflectionViewer/NameViewer.tsx
|
|
195
|
+
import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
196
|
+
var NameViewer = ({ reflectionViewer, variant, reflection, ...props }) => {
|
|
197
|
+
return /* @__PURE__ */ jsxs2(FlexRow, { justifyContent: "flex-start", ...props, children: [
|
|
198
|
+
/* @__PURE__ */ jsxs2(FlexRow, { marginRight: 1, children: [
|
|
199
|
+
/* @__PURE__ */ jsxs2(Typography3, { variant, noWrap: true, children: [
|
|
200
|
+
reflection.name,
|
|
201
|
+
reflection.type ? /* @__PURE__ */ jsx5(Fragment4, { children: ":\xA0" }) : null
|
|
202
|
+
] }),
|
|
203
|
+
/* @__PURE__ */ jsx5(SomeTypeViewer, { reflection, reflectionViewer })
|
|
204
|
+
] }),
|
|
205
|
+
/* @__PURE__ */ jsxs2(Stack, { direction: "row", spacing: 1, children: [
|
|
206
|
+
/* @__PURE__ */ jsx5(Chip, { size: "small", label: reflection.kind }),
|
|
207
|
+
reflection.flags ? Object.entries(reflection.flags).map(([flag, value]) => {
|
|
208
|
+
return value ? /* @__PURE__ */ jsx5(Chip, { size: "small", label: trimFlagLabel(flag), variant: "outlined" }, flag) : null;
|
|
209
|
+
}) : null
|
|
210
|
+
] }),
|
|
211
|
+
document && document?.location.hostname === "localhost" && /* @__PURE__ */ jsx5(JsonViewerButton, { jsonViewProps: { collapsed: 1 }, size: "small", variant: "contained", padding: 0, marginX: 1, src: reflection })
|
|
212
|
+
] });
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
// src/ReflectionViewer/ReflectionViewer.tsx
|
|
216
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
217
|
+
var hide = (flags, hiddenFlags = []) => {
|
|
218
|
+
let hide2 = false;
|
|
219
|
+
hiddenFlags.map((hiddenFlag) => {
|
|
220
|
+
if (flags?.[hiddenFlag]) {
|
|
221
|
+
hide2 = true;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
return hide2;
|
|
225
|
+
};
|
|
226
|
+
var ReflectionViewer = ({ variant, nameViewer, children, reflection, hiddenFlags, ...props }) => {
|
|
227
|
+
const someReflection = reflection;
|
|
228
|
+
return hide(reflection?.flags, hiddenFlags) ? null : /* @__PURE__ */ jsxs3(FlexCol2, { title: "ReflectionViewer", alignItems: "stretch", ...props, children: [
|
|
229
|
+
nameViewer === void 0 ? /* @__PURE__ */ jsx6(NameViewer, { marginY: 0.25, variant, reflection: someReflection, reflectionViewer: ReflectionViewer }) : nameViewer,
|
|
230
|
+
reflection.comment ? /* @__PURE__ */ jsx6(CommentViewer, { comment: reflection.comment }) : null,
|
|
231
|
+
someReflection.parameters?.map((parameter) => {
|
|
232
|
+
return /* @__PURE__ */ jsx6(ReflectionViewer, { hiddenFlags, marginY: 0.25, marginX: 1, reflection: parameter }, parameter.id);
|
|
233
|
+
}) ?? null,
|
|
234
|
+
children
|
|
235
|
+
] });
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
// src/ReflectionViewer/ReflectionGroupViewer.tsx
|
|
239
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
240
|
+
var ReflectionGroupViewer = ({
|
|
241
|
+
autoscroll = false,
|
|
242
|
+
children,
|
|
243
|
+
hiddenFlags,
|
|
244
|
+
group,
|
|
245
|
+
lookup,
|
|
246
|
+
renderer = ReflectionViewer,
|
|
247
|
+
variant,
|
|
248
|
+
...props
|
|
249
|
+
}) => {
|
|
250
|
+
const hide2 = (flags, hiddenFlags2 = []) => {
|
|
251
|
+
let hide3 = false;
|
|
252
|
+
hiddenFlags2.map((hiddenFlag) => {
|
|
253
|
+
if (flags?.[hiddenFlag]) {
|
|
254
|
+
hide3 = true;
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
return hide3;
|
|
258
|
+
};
|
|
259
|
+
const resolvedChildern = resolveChildren(group, lookup) ?? [];
|
|
260
|
+
const visibleChildren = hiddenFlags ? resolvedChildern.reduce((acc, item) => {
|
|
261
|
+
return acc + (hide2(item.flags, hiddenFlags) ? 0 : 1);
|
|
262
|
+
}, 0) : 1;
|
|
263
|
+
const { hash } = useLocation();
|
|
264
|
+
useEffect(() => {
|
|
265
|
+
if (hash && autoscroll) {
|
|
266
|
+
document.querySelector(hash)?.scrollIntoView({ behavior: "smooth" });
|
|
267
|
+
}
|
|
268
|
+
}, [hash, autoscroll]);
|
|
269
|
+
return visibleChildren > 0 ? /* @__PURE__ */ jsxs4(FlexCol3, { title: "ReflectionGroupViewer", ...props, children: [
|
|
270
|
+
/* @__PURE__ */ jsxs4(FlexRow2, { marginY: 1, justifyContent: "flex-start", children: [
|
|
271
|
+
/* @__PURE__ */ jsx7(Typography4, { variant, children: group.title }),
|
|
272
|
+
/* @__PURE__ */ jsx7(
|
|
273
|
+
JsonViewerButton,
|
|
274
|
+
{
|
|
275
|
+
jsonViewProps: { collapsed: 1 },
|
|
276
|
+
size: "small",
|
|
277
|
+
variant: "contained",
|
|
278
|
+
padding: 0,
|
|
279
|
+
marginX: 1,
|
|
280
|
+
src: resolveChildren(group, lookup)
|
|
281
|
+
}
|
|
282
|
+
)
|
|
283
|
+
] }),
|
|
284
|
+
resolveChildren(group, lookup).map((reflection) => {
|
|
285
|
+
return reflection ? (
|
|
286
|
+
// I wrap this in a div since React does not understand that they have keys using the Renderer
|
|
287
|
+
/* @__PURE__ */ jsx7("div", { id: reflection.name, children: renderer({ hiddenFlags, lookup, margin: 1, padding: 1, reflection }) }, reflection.id)
|
|
288
|
+
) : null;
|
|
289
|
+
}),
|
|
290
|
+
children
|
|
291
|
+
] }) : null;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
// src/ReflectionViewer/Container.tsx
|
|
295
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
296
|
+
var ContainerReflectionViewer = ({
|
|
297
|
+
children,
|
|
298
|
+
reflection,
|
|
299
|
+
hiddenFlags,
|
|
300
|
+
itemRenderer = ReflectionViewer,
|
|
301
|
+
...props
|
|
302
|
+
}) => {
|
|
303
|
+
const lookup = createLookup(reflection);
|
|
304
|
+
return /* @__PURE__ */ jsxs5(ReflectionViewer, { title: "ContainerReflectionViewer", sources: true, reflection, lookup, ...props, children: [
|
|
305
|
+
reflection.groups?.map((group) => {
|
|
306
|
+
return /* @__PURE__ */ jsx8(
|
|
307
|
+
ReflectionGroupViewer,
|
|
308
|
+
{
|
|
309
|
+
margin: 1,
|
|
310
|
+
lookup,
|
|
311
|
+
renderer: itemRenderer,
|
|
312
|
+
group,
|
|
313
|
+
reflection,
|
|
314
|
+
hiddenFlags,
|
|
315
|
+
alignItems: "stretch"
|
|
316
|
+
},
|
|
317
|
+
group.title
|
|
318
|
+
);
|
|
319
|
+
}),
|
|
320
|
+
children
|
|
321
|
+
] });
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
// src/ReflectionViewer/Declaration.tsx
|
|
325
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
326
|
+
var DeclarationReflectionViewer = ({ reflection, hiddenFlags, ...props }) => {
|
|
327
|
+
const safeSignatures = (signatures) => {
|
|
328
|
+
return Array.isArray(signatures) ? signatures : signatures ? [signatures] : void 0;
|
|
329
|
+
};
|
|
330
|
+
return /* @__PURE__ */ jsxs6(
|
|
331
|
+
ReflectionViewer,
|
|
332
|
+
{
|
|
333
|
+
nameViewer: reflection.signatures || reflection.getSignature || reflection.setSignature ? null : void 0,
|
|
334
|
+
title: "DeclarationReflectionViewer",
|
|
335
|
+
hiddenFlags,
|
|
336
|
+
reflection,
|
|
337
|
+
...props,
|
|
338
|
+
children: [
|
|
339
|
+
reflection.signatures?.map((signature) => {
|
|
340
|
+
return /* @__PURE__ */ jsx9(ReflectionViewer, { hiddenFlags, reflection: signature }, signature.id);
|
|
341
|
+
}),
|
|
342
|
+
safeSignatures(reflection.getSignature)?.map((signature) => {
|
|
343
|
+
return /* @__PURE__ */ jsx9(ReflectionViewer, { marginX: 1, hiddenFlags, reflection: signature }, signature.id);
|
|
344
|
+
}),
|
|
345
|
+
safeSignatures(reflection.setSignature)?.map((signature) => {
|
|
346
|
+
return /* @__PURE__ */ jsx9(ReflectionViewer, { marginX: 1, hiddenFlags, reflection: signature }, signature.id);
|
|
347
|
+
})
|
|
348
|
+
]
|
|
349
|
+
}
|
|
350
|
+
);
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
// src/ReflectionViewer/DeclarationContainer.tsx
|
|
354
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
355
|
+
var DeclarationContainerReflectionViewer = ({
|
|
7
356
|
reflection,
|
|
8
357
|
lookup,
|
|
9
358
|
itemRenderer = DeclarationReflectionViewer,
|
|
10
359
|
...props
|
|
11
360
|
}) => {
|
|
12
|
-
const { hash } =
|
|
361
|
+
const { hash } = useLocation2();
|
|
13
362
|
const theme = useTheme();
|
|
14
|
-
return /* @__PURE__ */
|
|
363
|
+
return /* @__PURE__ */ jsx10(
|
|
15
364
|
ContainerReflectionViewer,
|
|
16
365
|
{
|
|
17
366
|
title: "DeclarationContainerReflectionViewer",
|