@xyo-network/react-typedoc 7.5.8 → 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.
Files changed (39) hide show
  1. package/dist/browser/index.mjs +408 -434
  2. package/dist/browser/index.mjs.map +1 -1
  3. package/dist/browser/resolveChildren.d.ts +2 -2
  4. package/dist/browser/resolveChildren.d.ts.map +1 -1
  5. package/package.json +98 -32
  6. package/src/CommentViewer.tsx +0 -17
  7. package/src/JsonViewerButton.tsx +0 -37
  8. package/src/ProjectTwoPanelReflectionViewer.stories.tsx +0 -32
  9. package/src/ProjectTwoPanelReflectionViewer.tsx +0 -16
  10. package/src/ReflectionLookup.ts +0 -3
  11. package/src/ReflectionViewer/Container.tsx +0 -42
  12. package/src/ReflectionViewer/Declaration.tsx +0 -39
  13. package/src/ReflectionViewer/DeclarationContainer.tsx +0 -34
  14. package/src/ReflectionViewer/NameViewer.tsx +0 -48
  15. package/src/ReflectionViewer/Project.tsx +0 -37
  16. package/src/ReflectionViewer/ReflectionGroupViewer.tsx +0 -80
  17. package/src/ReflectionViewer/ReflectionViewer.tsx +0 -48
  18. package/src/ReflectionViewer/ReflectionViewerProps.tsx +0 -17
  19. package/src/ReflectionViewer/SomeTypeViewer/SomeTypeViewer.tsx +0 -27
  20. package/src/ReflectionViewer/SomeTypeViewer/TypeBuilder.ts +0 -6
  21. package/src/ReflectionViewer/SomeTypeViewer/buildArrayString.tsx +0 -14
  22. package/src/ReflectionViewer/SomeTypeViewer/buildIntersectionString.tsx +0 -18
  23. package/src/ReflectionViewer/SomeTypeViewer/buildReferenceString.ts +0 -20
  24. package/src/ReflectionViewer/SomeTypeViewer/buildReflectionString.tsx +0 -10
  25. package/src/ReflectionViewer/SomeTypeViewer/buildTypeString.tsx +0 -50
  26. package/src/ReflectionViewer/SomeTypeViewer/buildUnionString.tsx +0 -18
  27. package/src/ReflectionViewer/SomeTypeViewer/index.ts +0 -1
  28. package/src/ReflectionViewer/index.ts +0 -8
  29. package/src/SomeReflection.ts +0 -9
  30. package/src/SourceViewer.tsx +0 -19
  31. package/src/TreeViewer/Reflection.tsx +0 -67
  32. package/src/TreeViewer/ReflectionGroup.tsx +0 -39
  33. package/src/TreeViewer/index.ts +0 -2
  34. package/src/TwoPanelReflectionViewer.tsx +0 -93
  35. package/src/createLookup.ts +0 -7
  36. package/src/global.d.ts +0 -1
  37. package/src/index.ts +0 -9
  38. package/src/resolveChildren.ts +0 -26
  39. 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
- }
@@ -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'
@@ -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
- }
@@ -1,6 +0,0 @@
1
- export const trimFlagLabel = (label: string) => {
2
- if (label.startsWith('is')) {
3
- return label.slice(2)
4
- }
5
- return label
6
- }