@d-fischer/documen.ts 0.16.3 → 0.16.4

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 (109) hide show
  1. package/lib/common/components/Badge.js +1 -1
  2. package/lib/common/components/Badge.js.map +1 -1
  3. package/lib/common/components/BetaNotice.js +1 -1
  4. package/lib/common/components/BetaNotice.js.map +1 -1
  5. package/lib/common/components/Button.js +2 -2
  6. package/lib/common/components/Button.js.map +1 -1
  7. package/lib/common/components/CodeBlock.js +1 -1
  8. package/lib/common/components/CodeBlock.js.map +1 -1
  9. package/lib/common/components/CodeLink.js +4 -4
  10. package/lib/common/components/CodeLink.js.map +1 -1
  11. package/lib/common/components/DeprecationNotice.js +1 -1
  12. package/lib/common/components/DeprecationNotice.js.map +1 -1
  13. package/lib/common/components/FunctionParamDesc.js +1 -1
  14. package/lib/common/components/FunctionParamDesc.js.map +1 -1
  15. package/lib/common/components/FunctionParamDescEntry.js +13 -9
  16. package/lib/common/components/FunctionParamDescEntry.js.map +1 -1
  17. package/lib/common/components/FunctionReturnType.js +1 -1
  18. package/lib/common/components/FunctionReturnType.js.map +1 -1
  19. package/lib/common/components/FunctionSignature.js +1 -1
  20. package/lib/common/components/FunctionSignature.js.map +1 -1
  21. package/lib/common/components/InterfaceRepresentation.js +5 -3
  22. package/lib/common/components/InterfaceRepresentation.js.map +1 -1
  23. package/lib/common/components/MainMenu.js +2 -2
  24. package/lib/common/components/MainMenu.js.map +1 -1
  25. package/lib/common/components/NavMenu.js +3 -3
  26. package/lib/common/components/NavMenu.js.map +1 -1
  27. package/lib/common/components/NavMenuGroup.js +2 -2
  28. package/lib/common/components/NavMenuGroup.js.map +1 -1
  29. package/lib/common/components/NavMenuItem.js +1 -1
  30. package/lib/common/components/NavMenuItem.js.map +1 -1
  31. package/lib/common/components/TypeAliasHint.js +2 -2
  32. package/lib/common/components/TypeAliasHint.js.map +1 -1
  33. package/lib/common/components/TypeLink.js +2 -2
  34. package/lib/common/components/TypeLink.js.map +1 -1
  35. package/lib/common/components/VersionMenu.js +1 -1
  36. package/lib/common/components/VersionMenu.js.map +1 -1
  37. package/lib/common/components/cards/CardToolbar.js +5 -5
  38. package/lib/common/components/cards/CardToolbar.js.map +1 -1
  39. package/lib/common/components/cards/EventCard.js +1 -1
  40. package/lib/common/components/cards/EventCard.js.map +1 -1
  41. package/lib/common/components/cards/FunctionCardHeader.js +1 -1
  42. package/lib/common/components/cards/FunctionCardHeader.js.map +1 -1
  43. package/lib/common/components/cards/MethodCard.js +1 -1
  44. package/lib/common/components/cards/MethodCard.js.map +1 -1
  45. package/lib/common/components/cards/PropertyCard.js +1 -1
  46. package/lib/common/components/cards/PropertyCard.js.map +1 -1
  47. package/lib/common/components/codeBuilders/ReferenceTypeView.js +3 -3
  48. package/lib/common/components/codeBuilders/ReferenceTypeView.js.map +1 -1
  49. package/lib/common/components/overviewTable/OverviewTable.js +6 -6
  50. package/lib/common/components/overviewTable/OverviewTable.js.map +1 -1
  51. package/lib/common/components/overviewTable/OverviewTableEntry.js +1 -1
  52. package/lib/common/components/overviewTable/OverviewTableEntry.js.map +1 -1
  53. package/lib/common/containers/Card.js +2 -2
  54. package/lib/common/containers/Card.js.map +1 -1
  55. package/lib/common/containers/PageContent.js +2 -2
  56. package/lib/common/containers/PageContent.js.map +1 -1
  57. package/lib/common/containers/PageHeader.js +2 -2
  58. package/lib/common/containers/PageHeader.js.map +1 -1
  59. package/lib/common/containers/ReferencePackageContainer.js +1 -1
  60. package/lib/common/containers/ReferencePackageContainer.js.map +1 -1
  61. package/lib/common/htmlRenderer/HtmlRenderer.js +5 -5
  62. package/lib/common/htmlRenderer/HtmlRenderer.js.map +1 -1
  63. package/lib/common/pages/DocPage.js +1 -1
  64. package/lib/common/pages/DocPage.js.map +1 -1
  65. package/lib/common/pages/InterfacePage.js +1 -1
  66. package/lib/common/pages/InterfacePage.js.map +1 -1
  67. package/lib/common/pages/TypeAliasPage.js +1 -1
  68. package/lib/common/pages/TypeAliasPage.js.map +1 -1
  69. package/lib/common/tools/markdown/MarkdownParser.js +6 -6
  70. package/lib/common/tools/markdown/MarkdownParser.js.map +1 -1
  71. package/package.json +7 -4
  72. package/src/common/components/Badge.tsx +2 -2
  73. package/src/common/components/BetaNotice.tsx +1 -1
  74. package/src/common/components/Button.tsx +27 -24
  75. package/src/common/components/CodeBlock.tsx +1 -1
  76. package/src/common/components/CodeLink.tsx +5 -5
  77. package/src/common/components/DeprecationNotice.tsx +2 -2
  78. package/src/common/components/FunctionParamDesc.tsx +1 -1
  79. package/src/common/components/FunctionParamDescEntry.tsx +75 -50
  80. package/src/common/components/FunctionReturnType.tsx +1 -1
  81. package/src/common/components/FunctionSignature.tsx +25 -15
  82. package/src/common/components/InterfaceRepresentation.tsx +61 -56
  83. package/src/common/components/MainMenu.tsx +2 -2
  84. package/src/common/components/NavMenu.tsx +12 -13
  85. package/src/common/components/NavMenuGroup.tsx +25 -24
  86. package/src/common/components/NavMenuItem.tsx +1 -1
  87. package/src/common/components/TypeAliasHint.tsx +2 -2
  88. package/src/common/components/TypeLink.tsx +17 -10
  89. package/src/common/components/VersionMenu.tsx +1 -1
  90. package/src/common/components/cards/CardToolbar.tsx +31 -24
  91. package/src/common/components/cards/EventCard.tsx +2 -2
  92. package/src/common/components/cards/FunctionCardHeader.tsx +1 -1
  93. package/src/common/components/cards/MethodCard.tsx +1 -1
  94. package/src/common/components/cards/PropertyCard.tsx +1 -1
  95. package/src/common/components/codeBuilders/ReferenceTypeView.tsx +4 -4
  96. package/src/common/components/overviewTable/OverviewTable.tsx +41 -25
  97. package/src/common/components/overviewTable/OverviewTableEntry.tsx +1 -1
  98. package/src/common/containers/Card.tsx +20 -17
  99. package/src/common/containers/PageContent.tsx +14 -15
  100. package/src/common/containers/PageHeader.tsx +22 -23
  101. package/src/common/containers/ReferencePackageContainer.tsx +1 -1
  102. package/src/common/htmlRenderer/HtmlRenderer.tsx +7 -7
  103. package/src/common/pages/DocPage.tsx +28 -14
  104. package/src/common/pages/InterfacePage.tsx +1 -1
  105. package/src/common/pages/TypeAliasPage.tsx +1 -1
  106. package/src/common/theme.ts +1 -1
  107. package/src/common/tools/markdown/MarkdownParser.tsx +100 -73
  108. package/src/dev/index.tsx +1 -1
  109. package/src/progressiveEnhancement/index.tsx +7 -9
@@ -1,6 +1,6 @@
1
- import React from 'react';
1
+ import { makeStyles } from '@mui/styles';
2
2
  import classNames from 'classnames';
3
- import { makeStyles } from '@material-ui/styles';
3
+ import React from 'react';
4
4
 
5
5
  type ButtonStyle = 'primary';
6
6
 
@@ -12,30 +12,33 @@ interface ButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>
12
12
  onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
13
13
  }
14
14
 
15
- const useStyles = makeStyles(theme => ({
16
- root: {
17
- display: 'inline-block',
18
- padding: '.4em .8em',
19
- borderRadius: 5,
20
- cursor: 'pointer'
21
- },
22
- rootSmall: {
23
- padding: 1,
24
- borderRadius: 5
25
- },
26
- rootPrimary: {
27
- color: 'white',
28
- transition: 'background-color .3s ease-in-out, border-color .3s ease-in-out',
29
- backgroundColor: theme.colors.accent.default,
30
- borderColor: theme.colors.accent.default,
31
-
32
- '&:hover, &:active, &:focus': {
15
+ const useStyles = makeStyles(
16
+ theme => ({
17
+ root: {
18
+ display: 'inline-block',
19
+ padding: '.4em .8em',
20
+ borderRadius: 5,
21
+ cursor: 'pointer'
22
+ },
23
+ rootSmall: {
24
+ padding: 1,
25
+ borderRadius: 5
26
+ },
27
+ rootPrimary: {
33
28
  color: 'white',
34
- backgroundColor: theme.colors.accent.focus,
35
- borderColor: theme.colors.accent.focus
29
+ transition: 'background-color .3s ease-in-out, border-color .3s ease-in-out',
30
+ backgroundColor: theme.colors.accent.default,
31
+ borderColor: theme.colors.accent.default,
32
+
33
+ '&:hover, &:active, &:focus': {
34
+ color: 'white',
35
+ backgroundColor: theme.colors.accent.focus,
36
+ borderColor: theme.colors.accent.focus
37
+ }
36
38
  }
37
- }
38
- }), { name: 'Button' });
39
+ }),
40
+ { name: 'Button' }
41
+ );
39
42
 
40
43
  const Button: React.FC<ButtonProps> = ({ className, type, small, ...props }) => {
41
44
  const classes = useStyles();
@@ -3,7 +3,7 @@ import jsHighlight from '@d-fischer/react-syntax-highlighter/dist/esm/languages/
3
3
  import json from '@d-fischer/react-syntax-highlighter/dist/esm/languages/hljs/json';
4
4
  import tsHighlight from '@d-fischer/react-syntax-highlighter/dist/esm/languages/hljs/typescript';
5
5
  import darcula from '@d-fischer/react-syntax-highlighter/dist/esm/styles/hljs/darcula';
6
- import { makeStyles } from '@material-ui/styles';
6
+ import { makeStyles } from '@mui/styles';
7
7
  import { twoslasher } from '@typescript/twoslash';
8
8
  import * as lzString from 'lz-string';
9
9
  import React, { useCallback, useMemo, useState } from 'react';
@@ -1,11 +1,11 @@
1
- import React, { useContext } from 'react';
2
- import type { CallSignatureReferenceNode, ConstructSignatureReferenceNode, ReferenceNode } from '../reference';
3
- import { FontAwesomeIcon as Icon } from '@fortawesome/react-fontawesome';
4
1
  import { faCode } from '@fortawesome/free-solid-svg-icons';
5
- import { ConfigContext } from '../config';
2
+ import { FontAwesomeIcon as Icon } from '@fortawesome/react-fontawesome';
3
+ import { makeStyles } from '@mui/styles';
6
4
 
7
5
  import classNames from 'classnames';
8
- import { makeStyles } from '@material-ui/styles';
6
+ import React, { useContext } from 'react';
7
+ import { ConfigContext } from '../config';
8
+ import type { CallSignatureReferenceNode, ConstructSignatureReferenceNode, ReferenceNode } from '../reference';
9
9
 
10
10
  interface CodeLinkProps {
11
11
  symbol: ReferenceNode;
@@ -1,5 +1,5 @@
1
+ import { makeStyles } from '@mui/styles';
1
2
  import React from 'react';
2
- import { makeStyles } from '@material-ui/styles';
3
3
 
4
4
  const useStyles = makeStyles(
5
5
  theme => ({
@@ -17,7 +17,7 @@ const useStyles = makeStyles(
17
17
  { name: 'DeprecationNotice' }
18
18
  );
19
19
 
20
- const DeprecationNotice: React.FC<React.PropsWithChildren> = ({ children }) => {
20
+ const DeprecationNotice: React.FC = ({ children }) => {
21
21
  const classes = useStyles();
22
22
  return (
23
23
  <div className={classes.root}>
@@ -1,4 +1,4 @@
1
- import { makeStyles } from '@material-ui/styles';
1
+ import { makeStyles } from '@mui/styles';
2
2
  import React from 'react';
3
3
  import type {
4
4
  CallSignatureReferenceNode,
@@ -1,10 +1,11 @@
1
1
  import { faCheck } from '@fortawesome/free-solid-svg-icons';
2
2
  import { FontAwesomeIcon as Icon } from '@fortawesome/react-fontawesome';
3
- import { makeStyles } from '@material-ui/styles';
3
+ import { makeStyles } from '@mui/styles';
4
4
  import React from 'react';
5
5
  import type {
6
6
  CallSignatureReferenceNode,
7
- ConstructorReferenceNode, ConstructSignatureReferenceNode,
7
+ ConstructorReferenceNode,
8
+ ConstructSignatureReferenceNode,
8
9
  FunctionReferenceNode,
9
10
  MethodReferenceNode,
10
11
  ParameterReferenceNode,
@@ -26,31 +27,43 @@ interface FunctionParamDescEntryProps {
26
27
  paramNamePrefix?: string;
27
28
  }
28
29
 
29
- const useStyles = makeStyles(theme => ({
30
- row: {
31
- padding: theme.spacing.unit,
32
- textAlign: 'center',
30
+ const useStyles = makeStyles(
31
+ theme => ({
32
+ row: {
33
+ padding: theme.spacing.unit,
34
+ textAlign: 'center',
33
35
 
34
- '& p': {
35
- margin: 0,
36
+ '& p': {
37
+ margin: 0,
36
38
 
37
- '& + p': {
38
- marginTop: theme.spacing.unit
39
+ '& + p': {
40
+ marginTop: theme.spacing.unit
41
+ }
39
42
  }
43
+ },
44
+ checkMark: {
45
+ width: '1em'
40
46
  }
41
- },
42
- checkMark: {
43
- width: '1em'
44
- }
45
- }), { name: 'FunctionParamDescEntry' });
47
+ }),
48
+ { name: 'FunctionParamDescEntry' }
49
+ );
46
50
 
47
- const FunctionParamDescEntry: React.FC<FunctionParamDescEntryProps> = ({ param, functionDefinition, functionSignature, isCallback, expandParams, paramNamePrefix = '' }) => {
51
+ const FunctionParamDescEntry: React.FC<FunctionParamDescEntryProps> = ({
52
+ param,
53
+ functionDefinition,
54
+ functionSignature,
55
+ isCallback,
56
+ expandParams,
57
+ paramNamePrefix = ''
58
+ }) => {
48
59
  const classes = useStyles();
49
60
  const shortDesc = param.comment?.shortText;
50
61
  let desc = param.comment?.text;
51
62
 
52
63
  if (!desc) {
53
- const correctTag = (functionSignature?.comment ?? functionDefinition.comment)?.tags?.find(tag => tag.tag === 'param' && tag.param === param.name);
64
+ const correctTag = (functionSignature?.comment ?? functionDefinition.comment)?.tags?.find(
65
+ tag => tag.tag === 'param' && tag.param === param.name
66
+ );
54
67
  if (correctTag) {
55
68
  desc = correctTag.text;
56
69
  }
@@ -60,28 +73,16 @@ const FunctionParamDescEntry: React.FC<FunctionParamDescEntryProps> = ({ param,
60
73
  expandParams ||= isNamedParams;
61
74
  const paramName = `${paramNamePrefix}${isNamedParams ? 'params' : param.name}`;
62
75
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
63
- const defaultValue = param.kind === 'property' ? undefined : (param.defaultValue || undefined);
76
+ const defaultValue = param.kind === 'property' ? undefined : param.defaultValue || undefined;
64
77
 
65
78
  const result: React.ReactNode[] = [];
66
79
 
67
80
  if (param.type.type === 'reflection') {
68
- result.push(...getChildren(param.type.declaration).filter((c): c is VariableReferenceNode => c.kind === 'variable').sort(defaultNodeSort).map(subParam => (
69
- <FunctionParamDescEntry
70
- key={`${paramName}.${subParam.name}`}
71
- param={subParam}
72
- functionDefinition={functionDefinition}
73
- functionSignature={functionSignature}
74
- isCallback={isCallback}
75
- expandParams={expandParams}
76
- paramNamePrefix={`${paramName}.`}
77
- />
78
- )));
79
- } else if (param.type.type === 'reference' && param.type.id && expandParams) {
80
- const refDesc = findSymbolByMember('id', param.type.id);
81
- if (refDesc) {
82
- const { symbol: ref } = refDesc;
83
- if (ref.kind === 'interface' && !hasTag(ref, 'neverExpand')) {
84
- result.push(...getChildren(ref).filter((c): c is PropertyReferenceNode => c.kind === 'property').sort(defaultNodeSort).map(subParam => (
81
+ result.push(
82
+ ...getChildren(param.type.declaration)
83
+ .filter((c): c is VariableReferenceNode => c.kind === 'variable')
84
+ .sort(defaultNodeSort)
85
+ .map(subParam => (
85
86
  <FunctionParamDescEntry
86
87
  key={`${paramName}.${subParam.name}`}
87
88
  param={subParam}
@@ -91,7 +92,29 @@ const FunctionParamDescEntry: React.FC<FunctionParamDescEntryProps> = ({ param,
91
92
  expandParams={expandParams}
92
93
  paramNamePrefix={`${paramName}.`}
93
94
  />
94
- )));
95
+ ))
96
+ );
97
+ } else if (param.type.type === 'reference' && param.type.id && expandParams) {
98
+ const refDesc = findSymbolByMember('id', param.type.id);
99
+ if (refDesc) {
100
+ const { symbol: ref } = refDesc;
101
+ if (ref.kind === 'interface' && !hasTag(ref, 'neverExpand')) {
102
+ result.push(
103
+ ...getChildren(ref)
104
+ .filter((c): c is PropertyReferenceNode => c.kind === 'property')
105
+ .sort(defaultNodeSort)
106
+ .map(subParam => (
107
+ <FunctionParamDescEntry
108
+ key={`${paramName}.${subParam.name}`}
109
+ param={subParam}
110
+ functionDefinition={functionDefinition}
111
+ functionSignature={functionSignature}
112
+ isCallback={isCallback}
113
+ expandParams={expandParams}
114
+ paramNamePrefix={`${paramName}.`}
115
+ />
116
+ ))
117
+ );
95
118
  }
96
119
  }
97
120
  }
@@ -100,27 +123,29 @@ const FunctionParamDescEntry: React.FC<FunctionParamDescEntryProps> = ({ param,
100
123
  <tr key={paramName}>
101
124
  <td className={classes.row}>{paramName}</td>
102
125
  <td className={classes.row}>
103
- <Type def={param.type} ignoreUndefined={param.kind !== 'parameter' || param.flags?.isOptional}/>
126
+ <Type def={param.type} ignoreUndefined={param.kind !== 'parameter' || param.flags?.isOptional} />
104
127
  </td>
105
128
  {isCallback ? null : (
106
129
  <>
107
- <td className={classes.row}>{
108
- param.flags?.isOptional || defaultValue || isOptionalType(param.type)
109
- ? ''
110
- : <Icon className={classes.checkMark} icon={faCheck}/>
111
- }</td>
130
+ <td className={classes.row}>
131
+ {param.flags?.isOptional || defaultValue || isOptionalType(param.type) ? (
132
+ ''
133
+ ) : (
134
+ <Icon className={classes.checkMark} icon={faCheck} />
135
+ )}
136
+ </td>
112
137
  <td className={classes.row}>{defaultValue ?? <em>none</em>}</td>
113
138
  </>
114
139
  )}
115
140
  <td className={classes.row}>
116
- {
117
- (shortDesc || desc) ? (
118
- <>
119
- {shortDesc ? <MarkdownParser source={shortDesc}/> : null}
120
- {desc ? <MarkdownParser source={desc}/> : null}
121
- </>
122
- ) : <em>{result.length ? 'see below' : 'none'}</em>
123
- }
141
+ {shortDesc || desc ? (
142
+ <>
143
+ {shortDesc ? <MarkdownParser source={shortDesc} /> : null}
144
+ {desc ? <MarkdownParser source={desc} /> : null}
145
+ </>
146
+ ) : (
147
+ <em>{result.length ? 'see below' : 'none'}</em>
148
+ )}
124
149
  </td>
125
150
  </tr>
126
151
  );
@@ -1,4 +1,4 @@
1
- import { makeStyles } from '@material-ui/styles';
1
+ import { makeStyles } from '@mui/styles';
2
2
  import React from 'react';
3
3
  import type { CallSignatureReferenceNode } from '../reference';
4
4
  import { useAsyncType } from '../tools/NodeTools';
@@ -1,19 +1,27 @@
1
- import { makeStyles } from '@material-ui/styles';
1
+ import { makeStyles } from '@mui/styles';
2
2
  import React from 'react';
3
- import type { CallSignatureReferenceNode, ClassReferenceNode, ConstructSignatureReferenceNode, InterfaceReferenceNode } from '../reference';
3
+ import type {
4
+ CallSignatureReferenceNode,
5
+ ClassReferenceNode,
6
+ ConstructSignatureReferenceNode,
7
+ InterfaceReferenceNode
8
+ } from '../reference';
4
9
 
5
10
  interface FunctionSignatureProps {
6
11
  signature: CallSignatureReferenceNode | ConstructSignatureReferenceNode;
7
12
  parent?: ClassReferenceNode | InterfaceReferenceNode;
8
13
  }
9
14
 
10
- const useStyles = makeStyles(theme => ({
11
- root: {
12
- fontFamily: theme.fonts.code,
13
- margin: '0 0 .5em',
14
- display: 'inline-block'
15
- }
16
- }), { name: 'FunctionSignature' });
15
+ const useStyles = makeStyles(
16
+ theme => ({
17
+ root: {
18
+ fontFamily: theme.fonts.code,
19
+ margin: '0 0 .5em',
20
+ display: 'inline-block'
21
+ }
22
+ }),
23
+ { name: 'FunctionSignature' }
24
+ );
17
25
 
18
26
  const FunctionSignature: React.FC<FunctionSignatureProps> = ({ signature, parent }) => {
19
27
  const classes = useStyles();
@@ -39,12 +47,14 @@ const FunctionSignature: React.FC<FunctionSignatureProps> = ({ signature, parent
39
47
  &gt;
40
48
  </>
41
49
  )}
42
- ({signature.parameters.map((param, idx) => (
43
- <React.Fragment key={param.name}>
44
- {idx === 0 ? '' : ', '}
45
- {/^__\d+$/.test(param.name) ? 'params' : param.name}
46
- </React.Fragment>
47
- ))})
50
+ (
51
+ {signature.parameters.map((param, idx) => (
52
+ <React.Fragment key={param.name}>
53
+ {idx === 0 ? '' : ', '}
54
+ {/^__\d+$/.test(param.name) ? 'params' : param.name}
55
+ </React.Fragment>
56
+ ))}
57
+ )
48
58
  </h3>
49
59
  );
50
60
  };
@@ -1,4 +1,4 @@
1
- import { makeStyles } from '@material-ui/styles';
1
+ import { makeStyles } from '@mui/styles';
2
2
  import classNames from 'classnames';
3
3
  import React from 'react';
4
4
  import { HashLink } from 'react-router-hash-link';
@@ -12,31 +12,34 @@ interface InterfaceRepresentationProps {
12
12
  className?: string;
13
13
  }
14
14
 
15
- const useStyles = makeStyles(theme => ({
16
- root: {
17
- fontFamily: theme.fonts.code,
18
- },
19
- prop: {
20
- display: 'block',
21
- marginLeft: '2em',
22
- '& + $prop': {
23
- marginTop: '.5em'
24
- }
25
- },
26
- comment: {
27
- color: '#808080',
28
- fontSize: '.8em',
15
+ const useStyles = makeStyles(
16
+ theme => ({
17
+ root: {
18
+ fontFamily: theme.fonts.code
19
+ },
20
+ prop: {
21
+ display: 'block',
22
+ marginLeft: '2em',
23
+ '& + $prop': {
24
+ marginTop: '.5em'
25
+ }
26
+ },
27
+ comment: {
28
+ color: '#808080',
29
+ fontSize: '.8em',
29
30
 
30
- '&:before': {
31
- content: '"// "',
32
- display: 'inline'
31
+ '&:before': {
32
+ content: '"// "',
33
+ display: 'inline'
34
+ }
35
+ },
36
+ name: {
37
+ color: '#9876AA',
38
+ textDecoration: 'none'
33
39
  }
34
- },
35
- name: {
36
- color: '#9876AA',
37
- textDecoration: 'none'
38
- }
39
- }), { name: 'InterfaceRepresentation' });
40
+ }),
41
+ { name: 'InterfaceRepresentation' }
42
+ );
40
43
 
41
44
  const InterfaceRepresentation: React.FC<InterfaceRepresentationProps> = ({ symbol, className }) => {
42
45
  const classes = useStyles();
@@ -44,42 +47,44 @@ const InterfaceRepresentation: React.FC<InterfaceRepresentationProps> = ({ symbo
44
47
  return (
45
48
  <div className={classNames(classes.root, className)}>
46
49
  {'{'}
47
- {getChildren(symbol).sort(defaultNodeSort).map(member => {
48
- if (member.kind === 'property') {
49
- return (
50
- <div key={member.name} className={classes.prop}>
51
- {member.comment?.shortText ? (
52
- <div className={classes.comment}>
53
- {member.comment.shortText}
50
+ {getChildren(symbol)
51
+ .sort(defaultNodeSort)
52
+ .map(member => {
53
+ if (member.kind === 'property') {
54
+ return (
55
+ <div key={member.name} className={classes.prop}>
56
+ {member.comment?.shortText ? (
57
+ <div className={classes.comment}>{member.comment.shortText}</div>
58
+ ) : null}
59
+ <div>
60
+ <HashLink to={`#${member.name}`} className={classes.name}>
61
+ {member.name}
62
+ </HashLink>
63
+ {member.flags?.isOptional ? '?' : ''}
64
+ : <Type def={member.type} ignoreUndefined />
54
65
  </div>
55
- ) : null}
56
- <div>
57
- <HashLink to={`#${member.name}`} className={classes.name}>{member.name}</HashLink>
58
- {member.flags?.isOptional ? '?' : ''}
59
- : <Type def={member.type} ignoreUndefined/>
60
66
  </div>
61
- </div>
62
- );
63
- }
64
- if (member.kind === 'method') {
65
- const sig = member.signatures![0];
66
- return (
67
- <div key={member.name} className={classes.prop}>
68
- {sig.comment?.shortText ? (
69
- <div className={classes.comment}>
70
- {sig.comment.shortText}
67
+ );
68
+ }
69
+ if (member.kind === 'method') {
70
+ const sig = member.signatures![0];
71
+ return (
72
+ <div key={member.name} className={classes.prop}>
73
+ {sig.comment?.shortText ? (
74
+ <div className={classes.comment}>{sig.comment.shortText}</div>
75
+ ) : null}
76
+ <div>
77
+ <HashLink to={`#${member.name}`} className={classes.name}>
78
+ {member.name}
79
+ </HashLink>
80
+ {member.flags?.isOptional ? '?' : ''}
81
+ (): <Type def={member.signatures![0].type} />
71
82
  </div>
72
- ) : null}
73
- <div>
74
- <HashLink to={`#${member.name}`} className={classes.name}>{member.name}</HashLink>
75
- {member.flags?.isOptional ? '?' : ''}
76
- (): <Type def={member.signatures![0].type}/>
77
83
  </div>
78
- </div>
79
- );
80
- }
81
- return null;
82
- })}
84
+ );
85
+ }
86
+ return null;
87
+ })}
83
88
  {'}'}
84
89
  </div>
85
90
  );
@@ -1,6 +1,6 @@
1
- import { FontAwesomeIcon as Icon } from '@fortawesome/react-fontawesome';
2
1
  import { faGithub } from '@fortawesome/free-brands-svg-icons';
3
- import { makeStyles } from '@material-ui/styles';
2
+ import { FontAwesomeIcon as Icon } from '@fortawesome/react-fontawesome';
3
+ import { makeStyles } from '@mui/styles';
4
4
  import classNames from 'classnames';
5
5
  import React, { useContext, useMemo } from 'react';
6
6
  import { NavLink, useLocation, useResolvedPath } from 'react-router-dom';
@@ -1,13 +1,16 @@
1
- import React from 'react';
1
+ import { makeStyles } from '@mui/styles';
2
2
  import classNames from 'classnames';
3
- import { makeStyles } from '@material-ui/styles';
3
+ import React from 'react';
4
4
 
5
- const useStyles = makeStyles(theme => ({
6
- root: {
7
- borderRight: `1px solid ${theme.colors.border}`,
8
- minHeight: '100%'
9
- }
10
- }), { name: 'NavMenu' });
5
+ const useStyles = makeStyles(
6
+ theme => ({
7
+ root: {
8
+ borderRight: `1px solid ${theme.colors.border}`,
9
+ minHeight: '100%'
10
+ }
11
+ }),
12
+ { name: 'NavMenu' }
13
+ );
11
14
 
12
15
  interface NavMenuProps {
13
16
  className?: string;
@@ -15,11 +18,7 @@ interface NavMenuProps {
15
18
 
16
19
  const NavMenu: React.FC<React.PropsWithChildren<NavMenuProps>> = ({ children, className }) => {
17
20
  const classes = useStyles();
18
- return (
19
- <div className={classNames(classes.root, className)}>
20
- {children}
21
- </div>
22
- );
21
+ return <div className={classNames(classes.root, className)}>{children}</div>;
23
22
  };
24
23
 
25
24
  export default NavMenu;
@@ -1,40 +1,41 @@
1
+ import { makeStyles } from '@mui/styles';
1
2
  import React from 'react';
2
- import { makeStyles } from '@material-ui/styles';
3
3
 
4
4
  interface NavMenuGroupProps {
5
5
  title: string;
6
6
  }
7
7
 
8
- const useStyles = makeStyles(({ colors: { text: textColor }, spacing: { unit: space } }) => ({
9
- root: {
10
- display: 'block',
11
- color: textColor,
12
- padding: `${space}px 0`,
13
- },
14
- title: {
15
- margin: 0,
16
- padding: `${space / 2}px ${space}px ${space / 2}px ${space * 1.5}px`,
17
- fontSize: '1.1em',
18
- lineHeight: '1em',
19
- height: '1em',
20
- fontWeight: 'bold',
21
- textTransform: 'uppercase'
22
- },
23
- items: {
24
- '& > a': {
25
- paddingLeft: space * 2.5
8
+ const useStyles = makeStyles(
9
+ ({ colors: { text: textColor }, spacing: { unit: space } }) => ({
10
+ root: {
11
+ display: 'block',
12
+ color: textColor,
13
+ padding: `${space}px 0`
14
+ },
15
+ title: {
16
+ margin: 0,
17
+ padding: `${space / 2}px ${space}px ${space / 2}px ${space * 1.5}px`,
18
+ fontSize: '1.1em',
19
+ lineHeight: '1em',
20
+ height: '1em',
21
+ fontWeight: 'bold',
22
+ textTransform: 'uppercase'
23
+ },
24
+ items: {
25
+ '& > a': {
26
+ paddingLeft: space * 2.5
27
+ }
26
28
  }
27
- }
28
- }), { name: 'NavMenuGroup' });
29
+ }),
30
+ { name: 'NavMenuGroup' }
31
+ );
29
32
 
30
33
  const NavMenuGroup: React.FC<React.PropsWithChildren<NavMenuGroupProps>> = ({ title, children }) => {
31
34
  const classes = useStyles();
32
35
  return (
33
36
  <div className={classes.root}>
34
37
  <h2 className={classes.title}>{title}</h2>
35
- <div className={classes.items}>
36
- {children}
37
- </div>
38
+ <div className={classes.items}>{children}</div>
38
39
  </div>
39
40
  );
40
41
  };
@@ -1,7 +1,7 @@
1
+ import { makeStyles } from '@mui/styles';
1
2
  import classNames from 'classnames';
2
3
  import React from 'react';
3
4
  import { NavLink } from 'react-router-dom';
4
- import { makeStyles } from '@material-ui/styles';
5
5
 
6
6
  interface NavMenuItemProps {
7
7
  path: string;
@@ -1,8 +1,8 @@
1
+ import { makeStyles } from '@mui/styles';
1
2
  import React from 'react';
2
3
  import type { TypeAliasReferenceNode } from '../reference';
3
- import { makeStyles } from '@material-ui/styles';
4
- import Type from './codeBuilders/Type';
5
4
  import MarkdownParser from '../tools/markdown/MarkdownParser';
5
+ import Type from './codeBuilders/Type';
6
6
 
7
7
  interface TypeAliasHintProps {
8
8
  symbol: TypeAliasReferenceNode;