@xyo-network/react-typedoc 7.5.7 → 7.5.11
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.mjs +408 -434
- package/dist/browser/index.mjs.map +1 -1
- package/dist/browser/resolveChildren.d.ts +2 -2
- package/dist/browser/resolveChildren.d.ts.map +1 -1
- package/package.json +98 -32
- package/src/CommentViewer.tsx +0 -17
- package/src/JsonViewerButton.tsx +0 -37
- package/src/ProjectTwoPanelReflectionViewer.stories.tsx +0 -32
- package/src/ProjectTwoPanelReflectionViewer.tsx +0 -16
- package/src/ReflectionLookup.ts +0 -3
- package/src/ReflectionViewer/Container.tsx +0 -42
- package/src/ReflectionViewer/Declaration.tsx +0 -39
- package/src/ReflectionViewer/DeclarationContainer.tsx +0 -34
- package/src/ReflectionViewer/NameViewer.tsx +0 -48
- package/src/ReflectionViewer/Project.tsx +0 -37
- package/src/ReflectionViewer/ReflectionGroupViewer.tsx +0 -80
- package/src/ReflectionViewer/ReflectionViewer.tsx +0 -48
- package/src/ReflectionViewer/ReflectionViewerProps.tsx +0 -17
- package/src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx +0 -27
- package/src/ReflectionViewer/SomeTypeViewer/TypeBuilder.ts +0 -6
- package/src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx +0 -14
- package/src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx +0 -18
- package/src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts +0 -20
- package/src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx +0 -10
- package/src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx +0 -50
- package/src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx +0 -18
- package/src/ReflectionViewer/SomeTypeViewer/index.ts +0 -1
- package/src/ReflectionViewer/index.ts +0 -8
- package/src/SomeReflection.ts +0 -9
- package/src/SourceViewer.tsx +0 -19
- package/src/TreeViewer/Reflection.tsx +0 -67
- package/src/TreeViewer/ReflectionGroup.tsx +0 -39
- package/src/TreeViewer/index.ts +0 -2
- package/src/TwoPanelReflectionViewer.tsx +0 -93
- package/src/createLookup.ts +0 -7
- package/src/global.d.ts +0 -1
- package/src/index.ts +0 -9
- package/src/resolveChildren.ts +0 -26
- package/src/trimFlagLabel.ts +0 -6
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { Search } from '@mui/icons-material'
|
|
2
|
-
import { TextField, useTheme } from '@mui/material'
|
|
3
|
-
import {
|
|
4
|
-
FlexCol, FlexGrowCol, FlexRow,
|
|
5
|
-
} from '@xylabs/react-flexbox'
|
|
6
|
-
import React, { useMemo, useState } from 'react'
|
|
7
|
-
import type { ReflectionGroup } from 'typedoc'
|
|
8
|
-
|
|
9
|
-
import { createLookup } from './createLookup.ts'
|
|
10
|
-
import type { ContainerReflectionViewerProps } from './ReflectionViewer/index.ts'
|
|
11
|
-
import { ReflectionGroupViewer, ReflectionViewer } from './ReflectionViewer/index.ts'
|
|
12
|
-
import { ReflectionTreeViewer } from './TreeViewer/index.ts'
|
|
13
|
-
|
|
14
|
-
export const TwoPanelReflectionViewer: React.FC<ContainerReflectionViewerProps> = ({
|
|
15
|
-
reflection,
|
|
16
|
-
itemRenderer = ReflectionViewer,
|
|
17
|
-
hiddenFlags,
|
|
18
|
-
...props
|
|
19
|
-
}) => {
|
|
20
|
-
const lookup = useMemo(() => createLookup(reflection), [reflection])
|
|
21
|
-
const theme = useTheme()
|
|
22
|
-
const [searchTerm, setSearchTerm] = useState<string>()
|
|
23
|
-
const onSearchTermChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
24
|
-
setSearchTerm(e.target.value)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const reflectionGroups = useMemo(() => {
|
|
28
|
-
return reflection.groups?.map((group: ReflectionGroup) => {
|
|
29
|
-
return (
|
|
30
|
-
<ReflectionGroupViewer
|
|
31
|
-
autoScroll
|
|
32
|
-
variant="h6"
|
|
33
|
-
lookup={lookup}
|
|
34
|
-
renderer={itemRenderer}
|
|
35
|
-
key={group.title}
|
|
36
|
-
group={group}
|
|
37
|
-
reflection={reflection}
|
|
38
|
-
alignItems="stretch"
|
|
39
|
-
hiddenFlags={hiddenFlags}
|
|
40
|
-
/>
|
|
41
|
-
)
|
|
42
|
-
})
|
|
43
|
-
}, [itemRenderer, lookup, reflection, hiddenFlags])
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<FlexRow alignItems="stretch" justifyContent="start" sx={{ overflowY: 'scroll' }} {...props}>
|
|
47
|
-
<FlexCol minWidth={320} alignItems="stretch" justifyContent="flex-start" overflow="hidden">
|
|
48
|
-
<TextField
|
|
49
|
-
fullWidth
|
|
50
|
-
onChange={onSearchTermChange}
|
|
51
|
-
slotProps={{ input: { startAdornment: <Search /> } }}
|
|
52
|
-
/>
|
|
53
|
-
<FlexGrowCol marginTop={1} alignItems="stretch">
|
|
54
|
-
<ReflectionTreeViewer
|
|
55
|
-
justifyContent="flex-start"
|
|
56
|
-
position="absolute"
|
|
57
|
-
top={0}
|
|
58
|
-
left={0}
|
|
59
|
-
right={0}
|
|
60
|
-
bottom={0}
|
|
61
|
-
overflow="scroll"
|
|
62
|
-
searchTerm={searchTerm}
|
|
63
|
-
hiddenFlags={hiddenFlags}
|
|
64
|
-
reflection={reflection}
|
|
65
|
-
lookup={lookup}
|
|
66
|
-
border={`1px solid ${theme.vars.palette.grey['300']}`}
|
|
67
|
-
borderRadius={1}
|
|
68
|
-
paddingY={1}
|
|
69
|
-
/>
|
|
70
|
-
</FlexGrowCol>
|
|
71
|
-
</FlexCol>
|
|
72
|
-
<FlexGrowCol marginLeft={1} alignItems="stretch" justifyContent="flex-start" overflow="hidden">
|
|
73
|
-
<FlexGrowCol alignItems="stretch">
|
|
74
|
-
<FlexCol
|
|
75
|
-
alignItems="stretch"
|
|
76
|
-
justifyContent="flex-start"
|
|
77
|
-
position="absolute"
|
|
78
|
-
top={0}
|
|
79
|
-
left={0}
|
|
80
|
-
right={0}
|
|
81
|
-
bottom={0}
|
|
82
|
-
overflow="scroll"
|
|
83
|
-
borderRadius={1}
|
|
84
|
-
padding={1}
|
|
85
|
-
border={`1px solid ${theme.vars.palette.grey['300']}`}
|
|
86
|
-
>
|
|
87
|
-
{reflectionGroups}
|
|
88
|
-
</FlexCol>
|
|
89
|
-
</FlexGrowCol>
|
|
90
|
-
</FlexGrowCol>
|
|
91
|
-
</FlexRow>
|
|
92
|
-
)
|
|
93
|
-
}
|
package/src/createLookup.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ContainerReflection, DeclarationReflection } from 'typedoc'
|
|
2
|
-
|
|
3
|
-
export const createLookup = <T extends DeclarationReflection>(reflection: ContainerReflection) => {
|
|
4
|
-
const lookup: Record<number, T> = {}
|
|
5
|
-
if (reflection.children) for (const item of reflection.children) lookup[item.id] = item as unknown as T
|
|
6
|
-
return lookup
|
|
7
|
-
}
|
package/src/global.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import '@mui/material/themeCssVarsAugmentation'
|
package/src/index.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './CommentViewer.tsx'
|
|
2
|
-
export * from './JsonViewerButton.tsx'
|
|
3
|
-
export * from './ProjectTwoPanelReflectionViewer.tsx'
|
|
4
|
-
export * from './ReflectionLookup.ts'
|
|
5
|
-
export * from './ReflectionViewer/index.ts'
|
|
6
|
-
export * from './SomeReflection.ts'
|
|
7
|
-
export * from './SourceViewer.tsx'
|
|
8
|
-
export * from './TreeViewer/index.ts'
|
|
9
|
-
export * from './TwoPanelReflectionViewer.tsx'
|
package/src/resolveChildren.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Reflection } from 'typedoc'
|
|
2
|
-
|
|
3
|
-
import type { ReflectionLookup } from './ReflectionLookup.ts'
|
|
4
|
-
import type { SomeReflection } from './SomeReflection.ts'
|
|
5
|
-
|
|
6
|
-
type ReflectionWithChildren = { children: Reflection[] }
|
|
7
|
-
|
|
8
|
-
export const resolveChildren = <T extends SomeReflection>(reflection: ReflectionWithChildren, lookup: ReflectionLookup = {}): T[] => {
|
|
9
|
-
return (reflection.children?.map((child) => {
|
|
10
|
-
switch (typeof child) {
|
|
11
|
-
case 'object': {
|
|
12
|
-
return child
|
|
13
|
-
}
|
|
14
|
-
case 'number': {
|
|
15
|
-
const childObj = lookup[child]
|
|
16
|
-
if (childObj === undefined) {
|
|
17
|
-
throw new Error(`Child Reference Not Found [${child}]`)
|
|
18
|
-
}
|
|
19
|
-
return childObj
|
|
20
|
-
}
|
|
21
|
-
default: {
|
|
22
|
-
throw new Error(`Invalid Child Type [${typeof child}, ${child}]`)
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}) ?? []) as T[]
|
|
26
|
-
}
|