@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.
- package/lib/common/components/Badge.js +1 -1
- package/lib/common/components/Badge.js.map +1 -1
- package/lib/common/components/BetaNotice.js +1 -1
- package/lib/common/components/BetaNotice.js.map +1 -1
- package/lib/common/components/Button.js +2 -2
- package/lib/common/components/Button.js.map +1 -1
- package/lib/common/components/CodeBlock.js +1 -1
- package/lib/common/components/CodeBlock.js.map +1 -1
- package/lib/common/components/CodeLink.js +4 -4
- package/lib/common/components/CodeLink.js.map +1 -1
- package/lib/common/components/DeprecationNotice.js +1 -1
- package/lib/common/components/DeprecationNotice.js.map +1 -1
- package/lib/common/components/FunctionParamDesc.js +1 -1
- package/lib/common/components/FunctionParamDesc.js.map +1 -1
- package/lib/common/components/FunctionParamDescEntry.js +13 -9
- package/lib/common/components/FunctionParamDescEntry.js.map +1 -1
- package/lib/common/components/FunctionReturnType.js +1 -1
- package/lib/common/components/FunctionReturnType.js.map +1 -1
- package/lib/common/components/FunctionSignature.js +1 -1
- package/lib/common/components/FunctionSignature.js.map +1 -1
- package/lib/common/components/InterfaceRepresentation.js +5 -3
- package/lib/common/components/InterfaceRepresentation.js.map +1 -1
- package/lib/common/components/MainMenu.js +2 -2
- package/lib/common/components/MainMenu.js.map +1 -1
- package/lib/common/components/NavMenu.js +3 -3
- package/lib/common/components/NavMenu.js.map +1 -1
- package/lib/common/components/NavMenuGroup.js +2 -2
- package/lib/common/components/NavMenuGroup.js.map +1 -1
- package/lib/common/components/NavMenuItem.js +1 -1
- package/lib/common/components/NavMenuItem.js.map +1 -1
- package/lib/common/components/TypeAliasHint.js +2 -2
- package/lib/common/components/TypeAliasHint.js.map +1 -1
- package/lib/common/components/TypeLink.js +2 -2
- package/lib/common/components/TypeLink.js.map +1 -1
- package/lib/common/components/VersionMenu.js +1 -1
- package/lib/common/components/VersionMenu.js.map +1 -1
- package/lib/common/components/cards/CardToolbar.js +5 -5
- package/lib/common/components/cards/CardToolbar.js.map +1 -1
- package/lib/common/components/cards/EventCard.js +1 -1
- package/lib/common/components/cards/EventCard.js.map +1 -1
- package/lib/common/components/cards/FunctionCardHeader.js +1 -1
- package/lib/common/components/cards/FunctionCardHeader.js.map +1 -1
- package/lib/common/components/cards/MethodCard.js +1 -1
- package/lib/common/components/cards/MethodCard.js.map +1 -1
- package/lib/common/components/cards/PropertyCard.js +1 -1
- package/lib/common/components/cards/PropertyCard.js.map +1 -1
- package/lib/common/components/codeBuilders/ReferenceTypeView.js +3 -3
- package/lib/common/components/codeBuilders/ReferenceTypeView.js.map +1 -1
- package/lib/common/components/overviewTable/OverviewTable.js +6 -6
- package/lib/common/components/overviewTable/OverviewTable.js.map +1 -1
- package/lib/common/components/overviewTable/OverviewTableEntry.js +1 -1
- package/lib/common/components/overviewTable/OverviewTableEntry.js.map +1 -1
- package/lib/common/containers/Card.js +2 -2
- package/lib/common/containers/Card.js.map +1 -1
- package/lib/common/containers/PageContent.js +2 -2
- package/lib/common/containers/PageContent.js.map +1 -1
- package/lib/common/containers/PageHeader.js +2 -2
- package/lib/common/containers/PageHeader.js.map +1 -1
- package/lib/common/containers/ReferencePackageContainer.js +1 -1
- package/lib/common/containers/ReferencePackageContainer.js.map +1 -1
- package/lib/common/htmlRenderer/HtmlRenderer.js +5 -5
- package/lib/common/htmlRenderer/HtmlRenderer.js.map +1 -1
- package/lib/common/pages/DocPage.js +1 -1
- package/lib/common/pages/DocPage.js.map +1 -1
- package/lib/common/pages/InterfacePage.js +1 -1
- package/lib/common/pages/InterfacePage.js.map +1 -1
- package/lib/common/pages/TypeAliasPage.js +1 -1
- package/lib/common/pages/TypeAliasPage.js.map +1 -1
- package/lib/common/tools/markdown/MarkdownParser.js +6 -6
- package/lib/common/tools/markdown/MarkdownParser.js.map +1 -1
- package/package.json +7 -4
- package/src/common/components/Badge.tsx +2 -2
- package/src/common/components/BetaNotice.tsx +1 -1
- package/src/common/components/Button.tsx +27 -24
- package/src/common/components/CodeBlock.tsx +1 -1
- package/src/common/components/CodeLink.tsx +5 -5
- package/src/common/components/DeprecationNotice.tsx +2 -2
- package/src/common/components/FunctionParamDesc.tsx +1 -1
- package/src/common/components/FunctionParamDescEntry.tsx +75 -50
- package/src/common/components/FunctionReturnType.tsx +1 -1
- package/src/common/components/FunctionSignature.tsx +25 -15
- package/src/common/components/InterfaceRepresentation.tsx +61 -56
- package/src/common/components/MainMenu.tsx +2 -2
- package/src/common/components/NavMenu.tsx +12 -13
- package/src/common/components/NavMenuGroup.tsx +25 -24
- package/src/common/components/NavMenuItem.tsx +1 -1
- package/src/common/components/TypeAliasHint.tsx +2 -2
- package/src/common/components/TypeLink.tsx +17 -10
- package/src/common/components/VersionMenu.tsx +1 -1
- package/src/common/components/cards/CardToolbar.tsx +31 -24
- package/src/common/components/cards/EventCard.tsx +2 -2
- package/src/common/components/cards/FunctionCardHeader.tsx +1 -1
- package/src/common/components/cards/MethodCard.tsx +1 -1
- package/src/common/components/cards/PropertyCard.tsx +1 -1
- package/src/common/components/codeBuilders/ReferenceTypeView.tsx +4 -4
- package/src/common/components/overviewTable/OverviewTable.tsx +41 -25
- package/src/common/components/overviewTable/OverviewTableEntry.tsx +1 -1
- package/src/common/containers/Card.tsx +20 -17
- package/src/common/containers/PageContent.tsx +14 -15
- package/src/common/containers/PageHeader.tsx +22 -23
- package/src/common/containers/ReferencePackageContainer.tsx +1 -1
- package/src/common/htmlRenderer/HtmlRenderer.tsx +7 -7
- package/src/common/pages/DocPage.tsx +28 -14
- package/src/common/pages/InterfacePage.tsx +1 -1
- package/src/common/pages/TypeAliasPage.tsx +1 -1
- package/src/common/theme.ts +1 -1
- package/src/common/tools/markdown/MarkdownParser.tsx +100 -73
- package/src/dev/index.tsx +1 -1
- package/src/progressiveEnhancement/index.tsx +7 -9
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { makeStyles } from '@mui/styles';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import type { ReferenceNode } from '../reference';
|
|
3
3
|
import { Link } from 'react-router-dom';
|
|
4
|
+
import type { ReferenceNode } from '../reference';
|
|
4
5
|
import { getPageType } from '../tools/CodeTools';
|
|
5
6
|
import { findSymbolByMember } from '../tools/ReferenceTools';
|
|
6
7
|
import { getPackagePath } from '../tools/StringTools';
|
|
7
|
-
import { makeStyles } from '@material-ui/styles';
|
|
8
8
|
|
|
9
9
|
interface TypeLinkProps {
|
|
10
10
|
id?: number;
|
|
@@ -12,13 +12,16 @@ interface TypeLinkProps {
|
|
|
12
12
|
symbol?: ReferenceNode;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const useStyles = makeStyles(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
15
|
+
const useStyles = makeStyles(
|
|
16
|
+
theme => ({
|
|
17
|
+
root: {
|
|
18
|
+
color: theme.colors.link,
|
|
19
|
+
fontWeight: 'bold',
|
|
20
|
+
textDecoration: 'none'
|
|
21
|
+
}
|
|
22
|
+
}),
|
|
23
|
+
{ name: 'TypeLink' }
|
|
24
|
+
);
|
|
22
25
|
|
|
23
26
|
const TypeLink: React.FC<React.PropsWithChildren<TypeLinkProps>> = ({ id, name, children, symbol }) => {
|
|
24
27
|
const classes = useStyles();
|
|
@@ -37,7 +40,11 @@ const TypeLink: React.FC<React.PropsWithChildren<TypeLinkProps>> = ({ id, name,
|
|
|
37
40
|
return <>{children}</>;
|
|
38
41
|
}
|
|
39
42
|
|
|
40
|
-
return
|
|
43
|
+
return (
|
|
44
|
+
<Link className={classes.root} to={`/reference${getPackagePath(packageName)}/${getPageType(symbol)}/${name}`}>
|
|
45
|
+
{children}
|
|
46
|
+
</Link>
|
|
47
|
+
);
|
|
41
48
|
};
|
|
42
49
|
|
|
43
50
|
export default TypeLink;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { faLink } from '@fortawesome/free-solid-svg-icons';
|
|
2
|
+
import { FontAwesomeIcon as Icon } from '@fortawesome/react-fontawesome';
|
|
3
|
+
import { makeStyles } from '@mui/styles';
|
|
4
|
+
import classNames from 'classnames';
|
|
1
5
|
import React from 'react';
|
|
2
|
-
import
|
|
6
|
+
import { HashLink } from 'react-router-hash-link';
|
|
7
|
+
import type { CallSignatureReferenceNode, ConstructSignatureReferenceNode, ReferenceNode } from '../../reference';
|
|
3
8
|
import { getAnchorName } from '../../tools/NodeTools';
|
|
4
9
|
import CodeLink from '../CodeLink';
|
|
5
|
-
import { HashLink } from 'react-router-hash-link';
|
|
6
|
-
import { FontAwesomeIcon as Icon } from '@fortawesome/react-fontawesome';
|
|
7
|
-
import { faLink } from '@fortawesome/free-solid-svg-icons';
|
|
8
|
-
import classNames from 'classnames';
|
|
9
|
-
import { makeStyles } from '@material-ui/styles';
|
|
10
10
|
|
|
11
11
|
interface CardToolbarProps {
|
|
12
12
|
name?: string;
|
|
@@ -15,31 +15,38 @@ interface CardToolbarProps {
|
|
|
15
15
|
className?: string;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const useStyles = makeStyles(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
const useStyles = makeStyles(
|
|
19
|
+
theme => ({
|
|
20
|
+
root: {
|
|
21
|
+
float: 'right'
|
|
22
|
+
},
|
|
23
|
+
button: {
|
|
24
|
+
marginLeft: '.5em'
|
|
25
|
+
},
|
|
26
|
+
anchor: {
|
|
27
|
+
color: theme.colors.accent.default,
|
|
28
|
+
transition: 'color .3s ease-in-out',
|
|
29
|
+
marginLeft: '1em',
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
'&:hover': {
|
|
32
|
+
color: theme.colors.accent.focus
|
|
33
|
+
}
|
|
32
34
|
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
+
}),
|
|
36
|
+
{ name: 'CardToolbar' }
|
|
37
|
+
);
|
|
35
38
|
|
|
36
39
|
const CardToolbar: React.FC<CardToolbarProps> = ({ name, definition, signature, className }) => {
|
|
37
40
|
const classes = useStyles();
|
|
38
41
|
return (
|
|
39
42
|
<div className={classNames(classes.root, className)}>
|
|
40
|
-
<CodeLink className={classes.button} symbol={definition} signature={signature}/>
|
|
41
|
-
<HashLink
|
|
42
|
-
|
|
43
|
+
<CodeLink className={classes.button} symbol={definition} signature={signature} />
|
|
44
|
+
<HashLink
|
|
45
|
+
className={classNames(classes.button, classes.anchor)}
|
|
46
|
+
to={`#${getAnchorName(definition, name ?? signature?.name)}`}
|
|
47
|
+
title="Direct link to this symbol"
|
|
48
|
+
>
|
|
49
|
+
<Icon icon={faLink} size="lg" />
|
|
43
50
|
</HashLink>
|
|
44
51
|
</div>
|
|
45
52
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { makeStyles } from '@
|
|
1
|
+
import { makeStyles } from '@mui/styles';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Card from '../../containers/Card';
|
|
4
|
-
import type { ParameterReferenceNode, PropertyReferenceNode
|
|
4
|
+
import type { CallSignatureReferenceNode, ParameterReferenceNode, PropertyReferenceNode } from '../../reference';
|
|
5
5
|
import { getTag, hasTag } from '../../tools/CodeTools';
|
|
6
6
|
import MarkdownParser from '../../tools/markdown/MarkdownParser';
|
|
7
7
|
import { getAnchorName } from '../../tools/NodeTools';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { FontAwesomeIcon as Icon } from '@fortawesome/react-fontawesome';
|
|
2
1
|
import { faExternalLink } from '@fortawesome/free-solid-svg-icons';
|
|
3
|
-
import {
|
|
2
|
+
import { FontAwesomeIcon as Icon } from '@fortawesome/react-fontawesome';
|
|
3
|
+
import { makeStyles } from '@mui/styles';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type { ReferenceNode, ReferenceReferenceType, ReferenceType } from '../../reference';
|
|
4
6
|
import { createExternalLink } from '../../tools/CodeTools';
|
|
5
7
|
import TypeLink from '../TypeLink';
|
|
6
|
-
import React from 'react';
|
|
7
8
|
import Type from './Type';
|
|
8
|
-
import type { ReferenceNode, ReferenceReferenceType, ReferenceType } from '../../reference';
|
|
9
9
|
|
|
10
10
|
interface ReferenceTypeProps {
|
|
11
11
|
isOptional: boolean;
|
|
@@ -1,27 +1,35 @@
|
|
|
1
|
-
import { makeStyles } from '@
|
|
1
|
+
import { makeStyles } from '@mui/styles';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
AccessorReferenceNode,
|
|
5
|
+
EnumMemberReferenceNode,
|
|
6
|
+
MethodReferenceNode,
|
|
7
|
+
PropertyReferenceNode
|
|
8
|
+
} from '../../reference';
|
|
4
9
|
import OverviewTableEntry from './OverviewTableEntry';
|
|
5
10
|
|
|
6
|
-
const useStyles = makeStyles(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
11
|
+
const useStyles = makeStyles(
|
|
12
|
+
theme => ({
|
|
13
|
+
root: {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
marginBottom: theme.spacing.unit * 2,
|
|
16
|
+
padding: theme.spacing.unit * 2
|
|
17
|
+
},
|
|
18
|
+
column: {
|
|
19
|
+
minWidth: 300
|
|
20
|
+
},
|
|
21
|
+
heading: {
|
|
22
|
+
margin: 0,
|
|
23
|
+
marginBottom: theme.spacing.unit
|
|
24
|
+
},
|
|
25
|
+
list: {
|
|
26
|
+
margin: 0,
|
|
27
|
+
paddingLeft: theme.spacing.unit,
|
|
28
|
+
borderLeft: `${theme.spacing.unit / 2}px solid ${theme.colors.border}`
|
|
29
|
+
}
|
|
30
|
+
}),
|
|
31
|
+
{ name: 'OverviewTable' }
|
|
32
|
+
);
|
|
25
33
|
|
|
26
34
|
type OverviewTablePropertyEntry = PropertyReferenceNode | AccessorReferenceNode;
|
|
27
35
|
|
|
@@ -41,7 +49,9 @@ const OverviewTable: React.FC<OverviewTableProps> = ({ members, events, properti
|
|
|
41
49
|
<div className={classes.column}>
|
|
42
50
|
<h3 className={classes.heading}>Members</h3>
|
|
43
51
|
<ul className={classes.list}>
|
|
44
|
-
{members.map(member =>
|
|
52
|
+
{members.map(member => (
|
|
53
|
+
<OverviewTableEntry key={member.id} node={member} />
|
|
54
|
+
))}
|
|
45
55
|
</ul>
|
|
46
56
|
</div>
|
|
47
57
|
) : null}
|
|
@@ -49,7 +59,9 @@ const OverviewTable: React.FC<OverviewTableProps> = ({ members, events, properti
|
|
|
49
59
|
<div className={classes.column}>
|
|
50
60
|
<h3 className={classes.heading}>Events</h3>
|
|
51
61
|
<ul className={classes.list}>
|
|
52
|
-
{events.map(event =>
|
|
62
|
+
{events.map(event => (
|
|
63
|
+
<OverviewTableEntry key={event.id} node={event} />
|
|
64
|
+
))}
|
|
53
65
|
</ul>
|
|
54
66
|
</div>
|
|
55
67
|
) : null}
|
|
@@ -57,7 +69,9 @@ const OverviewTable: React.FC<OverviewTableProps> = ({ members, events, properti
|
|
|
57
69
|
<div className={classes.column}>
|
|
58
70
|
<h3 className={classes.heading}>Properties</h3>
|
|
59
71
|
<ul className={classes.list}>
|
|
60
|
-
{properties.map(prop =>
|
|
72
|
+
{properties.map(prop => (
|
|
73
|
+
<OverviewTableEntry key={prop.id} node={prop} />
|
|
74
|
+
))}
|
|
61
75
|
</ul>
|
|
62
76
|
</div>
|
|
63
77
|
) : null}
|
|
@@ -65,7 +79,9 @@ const OverviewTable: React.FC<OverviewTableProps> = ({ members, events, properti
|
|
|
65
79
|
<div className={classes.column}>
|
|
66
80
|
<h3 className={classes.heading}>Methods</h3>
|
|
67
81
|
<ul className={classes.list}>
|
|
68
|
-
{methods.map(method =>
|
|
82
|
+
{methods.map(method => (
|
|
83
|
+
<OverviewTableEntry key={method.id} node={method} />
|
|
84
|
+
))}
|
|
69
85
|
</ul>
|
|
70
86
|
</div>
|
|
71
87
|
) : null}
|
|
@@ -1,32 +1,35 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { makeStyles } from '@mui/styles';
|
|
2
2
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
|
-
import
|
|
4
|
+
import React from 'react';
|
|
5
5
|
|
|
6
6
|
interface CardProps {
|
|
7
7
|
className?: string;
|
|
8
8
|
id?: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
const useStyles = makeStyles(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const useStyles = makeStyles(
|
|
12
|
+
theme => ({
|
|
13
|
+
root: {
|
|
14
|
+
margin: `${theme.spacing.unit * 2}px 0`,
|
|
15
|
+
padding: theme.spacing.unit * 2,
|
|
16
|
+
borderLeft: `${theme.spacing.unit / 2}px solid ${theme.colors.border}`,
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
'& h3, & h4': {
|
|
19
|
+
margin: 0
|
|
20
|
+
},
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
'& > :last-child': {
|
|
23
|
+
marginBottom: 0
|
|
24
|
+
},
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
'&:target': {
|
|
27
|
+
backgroundColor: theme.colors.background.active
|
|
28
|
+
}
|
|
27
29
|
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
+
}),
|
|
31
|
+
{ name: 'Card' }
|
|
32
|
+
);
|
|
30
33
|
|
|
31
34
|
const Card: React.FC<React.PropsWithChildren<CardProps>> = ({ className, id, children }) => {
|
|
32
35
|
const classes = useStyles();
|
|
@@ -1,27 +1,26 @@
|
|
|
1
|
+
import { makeStyles } from '@mui/styles';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { makeStyles } from '@material-ui/styles';
|
|
3
3
|
|
|
4
|
-
const useStyles = makeStyles(
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const useStyles = makeStyles(
|
|
5
|
+
theme => ({
|
|
6
|
+
root: {
|
|
7
|
+
padding: theme.spacing.unit * 2,
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
'& h2': {
|
|
10
|
+
margin: `${theme.spacing.unit * 3}px 0 ${theme.spacing.unit * 2}px`,
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
'&:first-child': {
|
|
13
|
+
marginTop: 0
|
|
14
|
+
}
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
+
}),
|
|
18
|
+
{ name: 'PageContent' }
|
|
19
|
+
);
|
|
17
20
|
|
|
18
21
|
const PageContent: React.FC<React.PropsWithChildren<{}>> = ({ children }) => {
|
|
19
22
|
const classes = useStyles();
|
|
20
|
-
return
|
|
21
|
-
<div className={classes.root}>
|
|
22
|
-
{children}
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
23
|
+
return <div className={classes.root}>{children}</div>;
|
|
25
24
|
};
|
|
26
25
|
|
|
27
26
|
export default PageContent;
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
+
import { makeStyles } from '@mui/styles';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { makeStyles } from '@material-ui/styles';
|
|
3
3
|
|
|
4
|
-
const useStyles = makeStyles(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
const useStyles = makeStyles(
|
|
5
|
+
theme => ({
|
|
6
|
+
root: {
|
|
7
|
+
padding: theme.spacing.unit * 2,
|
|
8
|
+
position: 'relative',
|
|
9
|
+
backgroundColor: theme.colors.background.active,
|
|
10
|
+
color: theme.colors.text,
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
'& h1': {
|
|
13
|
+
fontWeight: 'normal',
|
|
14
|
+
margin: 0,
|
|
15
|
+
fontSize: '1.5em',
|
|
16
|
+
display: 'inline'
|
|
17
|
+
},
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
'& p': {
|
|
20
|
+
margin: 0
|
|
21
|
+
}
|
|
20
22
|
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
+
}),
|
|
24
|
+
{ name: 'PageHeader' }
|
|
25
|
+
);
|
|
23
26
|
|
|
24
|
-
const PageHeader: React.FC
|
|
27
|
+
const PageHeader: React.FC = ({ children }) => {
|
|
25
28
|
const classes = useStyles();
|
|
26
|
-
return
|
|
27
|
-
<div className={classes.root}>
|
|
28
|
-
{children}
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
29
|
+
return <div className={classes.root}>{children}</div>;
|
|
31
30
|
};
|
|
32
31
|
|
|
33
32
|
export default PageHeader;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
+
import { dom } from '@fortawesome/fontawesome-svg-core';
|
|
2
|
+
import { ServerStyleSheets, ThemeProvider } from '@mui/styles';
|
|
1
3
|
import path from 'path';
|
|
2
4
|
import React from 'react';
|
|
3
5
|
import { renderToString } from 'react-dom/server';
|
|
4
|
-
import { ConfigContext } from '../config';
|
|
5
|
-
import type { Config } from '../config/Config';
|
|
6
|
-
import StaticRouterWithSuffix from './StaticRouterWithSuffix';
|
|
7
|
-
import App from '../containers/App';
|
|
8
|
-
import type RouterMode from './RouterMode';
|
|
9
6
|
import { StaticRouter } from 'react-router-dom/server';
|
|
10
7
|
import type { ArticleContent } from '../components/PageArticle';
|
|
11
8
|
import { PageArticleContext } from '../components/PageArticle';
|
|
12
|
-
import {
|
|
9
|
+
import { ConfigContext } from '../config';
|
|
10
|
+
import type { Config } from '../config/Config';
|
|
11
|
+
import App from '../containers/App';
|
|
13
12
|
import theme from '../theme';
|
|
14
|
-
import
|
|
13
|
+
import type RouterMode from './RouterMode';
|
|
14
|
+
import StaticRouterWithSuffix from './StaticRouterWithSuffix';
|
|
15
15
|
|
|
16
16
|
const insertIntoSkeleton = (html: string, css: string, baseUrl: string, config: Config) =>
|
|
17
17
|
`<!doctype html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { makeStyles } from '@
|
|
1
|
+
import { makeStyles } from '@mui/styles';
|
|
2
2
|
import React, { useContext } from 'react';
|
|
3
3
|
import { useParams } from 'react-router-dom';
|
|
4
4
|
import NavMenu from '../components/NavMenu';
|
|
@@ -33,7 +33,11 @@ const useStyles = makeStyles({
|
|
|
33
33
|
|
|
34
34
|
const DocPage: React.FC = () => {
|
|
35
35
|
const classes = useStyles();
|
|
36
|
-
const {
|
|
36
|
+
const {
|
|
37
|
+
group: groupName,
|
|
38
|
+
category: categoryName,
|
|
39
|
+
article: articleName
|
|
40
|
+
} = useParams() as unknown as DocPageRouteParams;
|
|
37
41
|
const article = useContext(PageArticleContext);
|
|
38
42
|
const config = useContext(ConfigContext);
|
|
39
43
|
|
|
@@ -49,7 +53,9 @@ const DocPage: React.FC = () => {
|
|
|
49
53
|
|
|
50
54
|
if (!title) {
|
|
51
55
|
if (groupName) {
|
|
52
|
-
const confArticle = confCategory.groups
|
|
56
|
+
const confArticle = confCategory.groups
|
|
57
|
+
?.find(grp => grp.name === groupName)
|
|
58
|
+
?.articles?.find(art => art.name === articleName);
|
|
53
59
|
|
|
54
60
|
if (!confArticle) {
|
|
55
61
|
return null;
|
|
@@ -78,18 +84,26 @@ const DocPage: React.FC = () => {
|
|
|
78
84
|
<div className={classes.root}>
|
|
79
85
|
{confCategory?.groups?.length && confCategory.groups.some(grp => grp.articles?.length) ? (
|
|
80
86
|
<NavMenu className={classes.nav}>
|
|
81
|
-
<NavMenuItem path={`/docs/${confCategory.name}/`}>
|
|
87
|
+
<NavMenuItem path={`/docs/${confCategory.name}/`}>
|
|
88
|
+
{confCategory.indexTitle ?? confCategory.name}
|
|
89
|
+
</NavMenuItem>
|
|
82
90
|
{confCategory.groups.map(grp => (
|
|
83
91
|
<NavMenuGroup key={grp.name} title={grp.title}>
|
|
84
|
-
{grp.articles?.map(art =>
|
|
85
|
-
|
|
86
|
-
{art.title}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
{grp.articles?.map(art =>
|
|
93
|
+
'externalLink' in art ? (
|
|
94
|
+
<NavMenuItem key={art.name} external path={art.externalLink} title={art.title}>
|
|
95
|
+
{art.title}
|
|
96
|
+
</NavMenuItem>
|
|
97
|
+
) : (
|
|
98
|
+
<NavMenuItem
|
|
99
|
+
key={art.name}
|
|
100
|
+
path={`/docs/${confCategory!.name}/${grp.name}/${art.name}`}
|
|
101
|
+
title={art.title}
|
|
102
|
+
>
|
|
103
|
+
{art.title}
|
|
104
|
+
</NavMenuItem>
|
|
105
|
+
)
|
|
106
|
+
)}
|
|
93
107
|
</NavMenuGroup>
|
|
94
108
|
))}
|
|
95
109
|
</NavMenu>
|
|
@@ -101,7 +115,7 @@ const DocPage: React.FC = () => {
|
|
|
101
115
|
</PageHeader>
|
|
102
116
|
) : null}
|
|
103
117
|
<PageContent>
|
|
104
|
-
<PageArticle mockContent={mockContent}/>
|
|
118
|
+
<PageArticle mockContent={mockContent} />
|
|
105
119
|
</PageContent>
|
|
106
120
|
</div>
|
|
107
121
|
</div>
|
package/src/common/theme.ts
CHANGED
|
@@ -31,7 +31,7 @@ const theme = {
|
|
|
31
31
|
export default theme;
|
|
32
32
|
export type Theme = typeof theme;
|
|
33
33
|
|
|
34
|
-
declare module '@
|
|
34
|
+
declare module '@mui/styles' {
|
|
35
35
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
36
36
|
interface DefaultTheme extends Theme {}
|
|
37
37
|
}
|