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