docgen-tool 5.3.0 → 6.0.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/app/app.tsx +18 -0
- package/dist/app/common/markdown/markdown.ts +27 -0
- package/dist/app/favicon.svg +4 -0
- package/dist/app/index.html +13 -0
- package/dist/app/pdf/react-pdf/pdf-page/pdf-footer/pdf-footer.tsx +35 -0
- package/dist/app/pdf/react-pdf/pdf-page/pdf-html-block/custom-renderers/custom-renderers.tsx +45 -0
- package/dist/app/pdf/react-pdf/pdf-page/pdf-html-block/pdf-html-block.tsx +19 -0
- package/dist/app/pdf/react-pdf/pdf-page/pdf-page.tsx +22 -0
- package/dist/app/pdf/react-pdf/pdf-styles/pdf-admonitions-styles.ts +37 -0
- package/dist/app/pdf/react-pdf/pdf-styles/pdf-docs-styles.ts +94 -0
- package/dist/app/pdf/react-pdf/pdf-styles/pdf-styles.ts +154 -0
- package/dist/app/pdf/react-pdf/pdf-styles/pdf-table-styles.ts +21 -0
- package/dist/app/pdf/react-pdf/react-pdf.tsx +107 -0
- package/dist/app/style-variables/css/style-variables.css +80 -0
- package/dist/app/style-variables/js/style-variables.js +78 -0
- package/dist/app/views/assets/styles/fonts/archivo-600-italic.ttf +0 -0
- package/dist/app/views/assets/styles/fonts/archivo-600-italic.woff2 +0 -0
- package/dist/app/views/assets/styles/fonts/archivo-600.ttf +0 -0
- package/dist/app/views/assets/styles/fonts/archivo-600.woff2 +0 -0
- package/dist/app/views/assets/styles/fonts/archivo-italic.ttf +0 -0
- package/dist/app/views/assets/styles/fonts/archivo-italic.woff2 +0 -0
- package/dist/app/views/assets/styles/fonts/archivo-regular.ttf +0 -0
- package/dist/app/views/assets/styles/fonts/archivo-regular.woff2 +0 -0
- package/dist/app/views/assets/styles/fonts/space-grotesk-600.ttf +0 -0
- package/dist/app/views/assets/styles/fonts/space-grotesk-600.woff2 +0 -0
- package/dist/app/views/assets/styles/fonts/space-grotesk-regular.ttf +0 -0
- package/dist/app/views/assets/styles/fonts/space-grotesk-regular.woff2 +0 -0
- package/dist/app/views/assets/styles/fonts/space-mono-700-italic.ttf +0 -0
- package/dist/app/views/assets/styles/fonts/space-mono-700-italic.woff2 +0 -0
- package/dist/app/views/assets/styles/fonts/space-mono-700.ttf +0 -0
- package/dist/app/views/assets/styles/fonts/space-mono-700.woff2 +0 -0
- package/dist/app/views/assets/styles/fonts/space-mono-italic.ttf +0 -0
- package/dist/app/views/assets/styles/fonts/space-mono-italic.woff2 +0 -0
- package/dist/app/views/assets/styles/fonts/space-mono-regular.ttf +0 -0
- package/dist/app/views/assets/styles/fonts/space-mono-regular.woff2 +0 -0
- package/dist/{include/require → app/views/assets}/styles/framework.css +69 -36
- package/dist/app/views/components/copyright/copyright.tsx +16 -0
- package/dist/app/views/components/footer/footer.tsx +37 -0
- package/dist/app/views/components/logo/logo.tsx +13 -0
- package/dist/app/views/components/page/page.tsx +15 -0
- package/dist/app/views/components/pdf-footer/pdf-footer.tsx +29 -0
- package/dist/app/views/components/pdf-header/pdf-header.tsx +12 -0
- package/dist/app/views/components/pdf-toggle-button/pdf-toggle-button.tsx +41 -0
- package/dist/app/views/components/side-bar/side-bar.tsx +89 -0
- package/dist/app/views/components/top-bar/top-bar.tsx +62 -0
- package/dist/app/views/content/markdown.tsx +60 -0
- package/dist/app/views/content/page.tsx +6 -0
- package/dist/app/views/html.tsx +5 -0
- package/dist/app/views/load-pages.ts +27 -0
- package/dist/app/views/pages/cover/cover.css +39 -0
- package/dist/app/views/pages/cover/cover.tsx +99 -0
- package/dist/app/views/pages/main/main.tsx +42 -0
- package/dist/app/views/pages/main/pdf-viewer.tsx +18 -0
- package/dist/app/views/router.tsx +142 -0
- package/dist/cli/cli.js +293 -0
- package/package.json +25 -19
- package/dist/cli.js +0 -1253
- package/dist/include/require/styles/fonts/DroidSansMono.woff +0 -0
- package/dist/include/require/styles/fonts/Montserrat-Italic.woff +0 -0
- package/dist/include/require/styles/fonts/Montserrat-Regular.woff +0 -0
- package/dist/include/require/styles/fonts/Montserrat-SemiBold.woff +0 -0
- package/dist/include/require/styles/fonts/Montserrat-SemiBoldItalic.woff +0 -0
- package/dist/include/require/styles/framework.js +0 -39
- package/dist/include/require/styles/icons.js +0 -9
- package/dist/include/templates/main.html +0 -14
- package/dist/include/templates/redirect.html +0 -10
- /package/dist/{include/require → app/views/assets}/print.css +0 -0
- /package/dist/{include/example → template}/contents.json +0 -0
- /package/dist/{include/example → template}/files/images/logo.svg +0 -0
- /package/dist/{include/example → template}/index.md +0 -0
- /package/dist/{include/example → template}/parameters.json +0 -0
- /package/dist/{include/example → template}/release-notes.md +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export const ColorPrimary = 'rgb(46, 113, 225)';
|
|
6
|
+
export const ColorPrimaryLight = 'rgb(222, 232, 252)';
|
|
7
|
+
export const ColorPrimaryDark = 'rgb(22, 71, 193)';
|
|
8
|
+
export const ColorBackgroundLight = '#fff';
|
|
9
|
+
export const ColorBackgroundSuccess = '#e8f5e9';
|
|
10
|
+
export const ColorBackgroundError = '#ffebee';
|
|
11
|
+
export const ColorBackgroundWarning = '#fff8e1';
|
|
12
|
+
export const ColorBackgroundInfo = 'rgb(222, 232, 252)';
|
|
13
|
+
export const ColorBackgroundNeutral = '#f5f5f5';
|
|
14
|
+
export const ColorBorder = '#999';
|
|
15
|
+
export const ColorBorderSuccess = '#4caf50';
|
|
16
|
+
export const ColorBorderError = '#f44336';
|
|
17
|
+
export const ColorBorderWarning = '#ff9800';
|
|
18
|
+
export const ColorBorderInfo = '#81a7f4';
|
|
19
|
+
export const ColorBorderNeutral = '#9e9e9e';
|
|
20
|
+
export const ColorText = 'rgb(1, 3, 4)';
|
|
21
|
+
export const ColorTextLight = '#bbb';
|
|
22
|
+
export const ColorTextNeutral = '#333';
|
|
23
|
+
export const ColorTextSuccess = '#2ab100';
|
|
24
|
+
export const ColorTextError = '#c20000';
|
|
25
|
+
export const ColorTextWarning = '#b28900';
|
|
26
|
+
export const ColorTextInfo = '#0a2a6b';
|
|
27
|
+
export const ColorTextLink = 'rgb(1, 3, 4)';
|
|
28
|
+
export const ColorTextLinkHover = '#4a72c1';
|
|
29
|
+
export const ColorTextLinkActive = '#4b91ff';
|
|
30
|
+
export const ColorTextLinkVisited = '#808080';
|
|
31
|
+
export const ColorButtonBorder = '2px solid rgb(46, 113, 225)';
|
|
32
|
+
export const ColorButtonBorderInverted = '2px solid rgb(46, 113, 225)';
|
|
33
|
+
export const ColorButtonBackground = 'rgb(46, 113, 225)';
|
|
34
|
+
export const ColorButtonBackgroundHover = '#0042b4';
|
|
35
|
+
export const ColorButtonBackgroundInverted = '#fff';
|
|
36
|
+
export const ColorButtonText = '#fff';
|
|
37
|
+
export const ColorButtonTextInverted = 'rgb(46, 113, 225)';
|
|
38
|
+
export const ColorButtonShadow = 'none';
|
|
39
|
+
export const ColorTableBackground = '#eee';
|
|
40
|
+
export const ColorTableBackgroundHeaderFooter = '#ddd';
|
|
41
|
+
export const ColorTableBackgroundHeaderFooterPdf = '#eee';
|
|
42
|
+
export const SizeBorderWidth = '1px';
|
|
43
|
+
export const SizeBorderWidthPdf = '0.8pt';
|
|
44
|
+
export const SizeButtonBase = '42px';
|
|
45
|
+
export const SizeFontBase = '16px';
|
|
46
|
+
export const SizeFontSmall = '12px';
|
|
47
|
+
export const SizeFontMedium = '16px';
|
|
48
|
+
export const SizeFontLarge = '24px';
|
|
49
|
+
export const SizeFontH1 = '2rem';
|
|
50
|
+
export const SizeFontH1Pdf = '24pt';
|
|
51
|
+
export const SizeFontH2 = '1.5rem';
|
|
52
|
+
export const SizeFontH2Pdf = '20pt';
|
|
53
|
+
export const SizeFontH3 = '1.25rem';
|
|
54
|
+
export const SizeFontH3Pdf = '18pt';
|
|
55
|
+
export const SizeFontH4 = '1rem';
|
|
56
|
+
export const SizeFontH4Pdf = '16pt';
|
|
57
|
+
export const SizeFontH5 = '0.875rem';
|
|
58
|
+
export const SizeFontH5Pdf = '14pt';
|
|
59
|
+
export const SizeFontH6 = '0.75rem';
|
|
60
|
+
export const SizeFontH6Pdf = '12pt';
|
|
61
|
+
export const SizeLineHeight = '26px';
|
|
62
|
+
export const SizeTableCellPadding = '2px 15px';
|
|
63
|
+
export const SizeTableCellPaddingPdf = '2mm 2mm';
|
|
64
|
+
export const SizeContentBlockMargin = '1.5em 0';
|
|
65
|
+
export const SizeContentBlockMarginPdf = '2mm 0';
|
|
66
|
+
export const SizeContentBlockPadding = '0.8rem 1rem';
|
|
67
|
+
export const SizeContentBlockPaddingPdf = '1mm 4mm';
|
|
68
|
+
export const SizeAdmonitionBorderLeft = '4px';
|
|
69
|
+
export const SizeAdmonitionBorderLeftPdf = '1mm';
|
|
70
|
+
export const SizeAdmonitionBorderRadius = '4px';
|
|
71
|
+
export const SizeAdmonitionTitleMargin = '0.1em 0 0';
|
|
72
|
+
export const SizeAdmonitionTitleMarginPdf = '3mm 0 0';
|
|
73
|
+
export const SizeMessagePadding = '20px 30px';
|
|
74
|
+
export const SizeMessageBorderRadius = '2px';
|
|
75
|
+
export const SizeHeaderHeight = '80px';
|
|
76
|
+
export const SizeSideBarWidth = '330px';
|
|
77
|
+
export const SizeSideBarMinWidth = '40px';
|
|
78
|
+
export const SizeSideBarPadding = '5px';
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -489,41 +489,81 @@ section > div blockquote {
|
|
|
489
489
|
typography
|
|
490
490
|
*/
|
|
491
491
|
@font-face {
|
|
492
|
-
font-family: '
|
|
493
|
-
|
|
494
|
-
|
|
492
|
+
font-family: 'archivo';
|
|
493
|
+
font-display: swap;
|
|
494
|
+
src: url('fonts/archivo-regular.woff2') format('woff2');
|
|
495
495
|
font-style: normal;
|
|
496
|
+
font-weight: 400;
|
|
496
497
|
}
|
|
497
498
|
@font-face {
|
|
498
|
-
font-family: '
|
|
499
|
-
|
|
500
|
-
|
|
499
|
+
font-family: 'archivo';
|
|
500
|
+
font-display: swap;
|
|
501
|
+
src: url('fonts/archivo-600.woff2') format('woff2');
|
|
501
502
|
font-style: normal;
|
|
503
|
+
font-weight: 600;
|
|
502
504
|
}
|
|
503
505
|
@font-face {
|
|
504
|
-
font-family: '
|
|
505
|
-
|
|
506
|
-
|
|
506
|
+
font-family: 'archivo';
|
|
507
|
+
font-display: swap;
|
|
508
|
+
src: url('fonts/archivo-italic.woff2') format('woff2');
|
|
507
509
|
font-style: italic;
|
|
510
|
+
font-weight: 400;
|
|
508
511
|
}
|
|
509
512
|
@font-face {
|
|
510
|
-
font-family: '
|
|
511
|
-
|
|
512
|
-
|
|
513
|
+
font-family: 'archivo';
|
|
514
|
+
font-display: swap;
|
|
515
|
+
src: url('fonts/archivo-600-italic.woff2') format('woff2');
|
|
513
516
|
font-style: italic;
|
|
517
|
+
font-weight: 600;
|
|
514
518
|
}
|
|
515
519
|
@font-face {
|
|
516
|
-
font-family: '
|
|
517
|
-
|
|
518
|
-
|
|
520
|
+
font-family: 'space-grotesk';
|
|
521
|
+
font-display: swap;
|
|
522
|
+
src: url('fonts/space-grotesk-regular.woff2') format('woff2');
|
|
523
|
+
font-style: normal;
|
|
524
|
+
font-weight: 400;
|
|
525
|
+
}
|
|
526
|
+
@font-face {
|
|
527
|
+
font-family: 'space-grotesk';
|
|
528
|
+
font-display: swap;
|
|
529
|
+
src: url('fonts/space-grotesk-600.woff2') format('woff2');
|
|
530
|
+
font-style: normal;
|
|
531
|
+
font-weight: 600;
|
|
532
|
+
}
|
|
533
|
+
@font-face {
|
|
534
|
+
font-family: 'space-mono';
|
|
535
|
+
font-display: swap;
|
|
536
|
+
src: url('fonts/space-mono-regular.woff2') format('woff2');
|
|
537
|
+
font-style: normal;
|
|
538
|
+
font-weight: 400;
|
|
539
|
+
}
|
|
540
|
+
@font-face {
|
|
541
|
+
font-family: 'space-mono';
|
|
542
|
+
font-display: swap;
|
|
543
|
+
src: url('fonts/space-mono-700.woff2') format('woff2');
|
|
519
544
|
font-style: normal;
|
|
545
|
+
font-weight: 700;
|
|
546
|
+
}
|
|
547
|
+
@font-face {
|
|
548
|
+
font-family: 'space-mono';
|
|
549
|
+
font-display: swap;
|
|
550
|
+
src: url('fonts/space-mono-italic.woff2') format('woff2');
|
|
551
|
+
font-style: italic;
|
|
552
|
+
font-weight: 400;
|
|
553
|
+
}
|
|
554
|
+
@font-face {
|
|
555
|
+
font-family: 'space-mono';
|
|
556
|
+
font-display: swap;
|
|
557
|
+
src: url('fonts/space-mono-700-italic.woff2') format('woff2');
|
|
558
|
+
font-style: italic;
|
|
559
|
+
font-weight: 700;
|
|
520
560
|
}
|
|
521
561
|
html {
|
|
522
562
|
font-size: var(--size-font-medium);
|
|
523
563
|
}
|
|
524
564
|
|
|
525
565
|
body {
|
|
526
|
-
font-family: '
|
|
566
|
+
font-family: 'archivo', sans-serif;
|
|
527
567
|
font-size: var(--size-font-medium);
|
|
528
568
|
line-height: var(--size-line-height);
|
|
529
569
|
}
|
|
@@ -684,7 +724,7 @@ a:visited {
|
|
|
684
724
|
pre-formatted, code
|
|
685
725
|
*/
|
|
686
726
|
code {
|
|
687
|
-
font-family: '
|
|
727
|
+
font-family: 'space-mono', monospace;
|
|
688
728
|
}
|
|
689
729
|
|
|
690
730
|
pre {
|
|
@@ -780,13 +820,14 @@ button,
|
|
|
780
820
|
justify-content: center;
|
|
781
821
|
outline: 0;
|
|
782
822
|
vertical-align: baseline;
|
|
783
|
-
border:
|
|
823
|
+
border: var(--color-button-border);
|
|
784
824
|
background: var(--color-button-background);
|
|
785
825
|
color: var(--color-button-text) !important;
|
|
786
826
|
padding: 0 25px;
|
|
787
827
|
text-transform: none;
|
|
788
828
|
text-shadow: none;
|
|
789
829
|
line-height: 1em;
|
|
830
|
+
font-family: 'space-grotesk', sans-serif;
|
|
790
831
|
font-style: normal;
|
|
791
832
|
text-align: center;
|
|
792
833
|
text-decoration: none;
|
|
@@ -838,14 +879,6 @@ button:active,
|
|
|
838
879
|
box-shadow: none;
|
|
839
880
|
}
|
|
840
881
|
|
|
841
|
-
.button .icon {
|
|
842
|
-
margin-left: 8px;
|
|
843
|
-
transition: transform 0.1s ease;
|
|
844
|
-
}
|
|
845
|
-
.button:hover .icon {
|
|
846
|
-
transform: translateX(4px);
|
|
847
|
-
}
|
|
848
|
-
|
|
849
882
|
img {
|
|
850
883
|
max-width: 100%;
|
|
851
884
|
height: auto;
|
|
@@ -1038,7 +1071,7 @@ img {
|
|
|
1038
1071
|
bottom: 0;
|
|
1039
1072
|
overflow-x: hidden;
|
|
1040
1073
|
overflow-y: auto;
|
|
1041
|
-
padding: var(size-side-bar-padding);
|
|
1074
|
+
padding: var(--size-side-bar-padding);
|
|
1042
1075
|
scrollbar-width: none; /* Firefox */
|
|
1043
1076
|
-ms-overflow-style: none; /* IE 10+ */
|
|
1044
1077
|
width: var(--size-side-bar-width);
|
|
@@ -1088,14 +1121,16 @@ img {
|
|
|
1088
1121
|
display: flex;
|
|
1089
1122
|
align-items: center;
|
|
1090
1123
|
}
|
|
1124
|
+
#dgSideBarContent .dgSideBarAttribution li a {
|
|
1125
|
+
display: inline-flex;
|
|
1126
|
+
align-items: center;
|
|
1127
|
+
gap: 6px;
|
|
1128
|
+
}
|
|
1129
|
+
#dgSideBarContent .dgSideBarAttribution li a svg {
|
|
1130
|
+
vertical-align: middle;
|
|
1131
|
+
}
|
|
1091
1132
|
#dgSideBarContent .dgSideBarAttribution .dgIcon {
|
|
1092
1133
|
padding: 0 5px 0 0;
|
|
1093
|
-
width: 20px;
|
|
1094
|
-
height: 20px;
|
|
1095
|
-
}
|
|
1096
|
-
#dgSideBarContent .dgSideBarAttribution .dgIcon svg {
|
|
1097
|
-
width: 20px;
|
|
1098
|
-
height: 20px;
|
|
1099
1134
|
}
|
|
1100
1135
|
#dgSideBarContent .dgSideBarPDFButton {
|
|
1101
1136
|
margin: 32px 0 12px 0;
|
|
@@ -1147,9 +1182,6 @@ img {
|
|
|
1147
1182
|
margin: 0;
|
|
1148
1183
|
color: white;
|
|
1149
1184
|
}
|
|
1150
|
-
#dgSideBarButton .dgIcon svg {
|
|
1151
|
-
height: 40px;
|
|
1152
|
-
}
|
|
1153
1185
|
.dgSideBarCollapsed #dgSideBarButton {
|
|
1154
1186
|
transform: scaleX(-1);
|
|
1155
1187
|
}
|
|
@@ -1195,6 +1227,7 @@ footer > div:first-child {
|
|
|
1195
1227
|
|
|
1196
1228
|
@media (min-width: 1200px) {
|
|
1197
1229
|
.banner h1 {
|
|
1230
|
+
font-family: 'space-grotesk', sans-serif;
|
|
1198
1231
|
font-size: 64px;
|
|
1199
1232
|
letter-spacing: -0.025em;
|
|
1200
1233
|
line-height: 1.15;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export const Copyright = ({
|
|
4
|
+
parameters
|
|
5
|
+
}) => {
|
|
6
|
+
return (
|
|
7
|
+
<span id="dg-copyright">
|
|
8
|
+
© {parameters.year}
|
|
9
|
+
{parameters?.organization?.url ? (
|
|
10
|
+
<a href={parameters.organization.url}>{parameters.organization.name}</a>
|
|
11
|
+
) : parameters?.organization?.nmee ? (
|
|
12
|
+
<span>parameters.organization.name</span>
|
|
13
|
+
) : null}
|
|
14
|
+
</span>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Copyright } from "../copyright/copyright.tsx";
|
|
3
|
+
|
|
4
|
+
export const Footer = ({
|
|
5
|
+
parameters
|
|
6
|
+
}) => {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<p>
|
|
10
|
+
<Copyright parameters={parameters} />
|
|
11
|
+
</p>
|
|
12
|
+
<p>
|
|
13
|
+
<span>
|
|
14
|
+
{parameters.marking} {parameters.legalese} {parameters.attribution}
|
|
15
|
+
</span>
|
|
16
|
+
</p>
|
|
17
|
+
</>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
export const WebFooter = ({parameters}) => {
|
|
23
|
+
return (
|
|
24
|
+
<footer>
|
|
25
|
+
<div>
|
|
26
|
+
<p>
|
|
27
|
+
<span id="dg-web-footer">
|
|
28
|
+
{parameters.webFooter}
|
|
29
|
+
</span>
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
32
|
+
<div>
|
|
33
|
+
<Footer parameters={parameters} />
|
|
34
|
+
</div>
|
|
35
|
+
</footer>
|
|
36
|
+
)
|
|
37
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Copyright } from "../copyright/copyright.tsx";
|
|
3
|
+
|
|
4
|
+
export const PdfFooter = ({
|
|
5
|
+
parameters
|
|
6
|
+
}) => {
|
|
7
|
+
return (
|
|
8
|
+
<div id="dg-pdf-footer">
|
|
9
|
+
<table>
|
|
10
|
+
<thead></thead>
|
|
11
|
+
<tfoot></tfoot>
|
|
12
|
+
<tbody>
|
|
13
|
+
<tr>
|
|
14
|
+
<td>
|
|
15
|
+
<span id="dg-title">{parameters.title}</span>
|
|
16
|
+
(<span id="dg-web-title-version">{parameters.version}</span>)
|
|
17
|
+
</td>
|
|
18
|
+
<td>
|
|
19
|
+
<Copyright parameters={parameters} />
|
|
20
|
+
</td>
|
|
21
|
+
<td>
|
|
22
|
+
Page <span className="page"></span> of <span className="topage"></span>
|
|
23
|
+
</td>
|
|
24
|
+
</tr>
|
|
25
|
+
</tbody>
|
|
26
|
+
</table>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useRouter, useRouterState } from '@tanstack/react-router';
|
|
3
|
+
import { TbFile, TbFileOff } from 'react-icons/tb';
|
|
4
|
+
import { pdfRoute } from '../../router';
|
|
5
|
+
|
|
6
|
+
type PdfToggleButtonProps = {
|
|
7
|
+
onClick?: () => void; // optional callback
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const PdfToggleButton = ({ onClick }: PdfToggleButtonProps) => {
|
|
11
|
+
const router = useRouter();
|
|
12
|
+
const pdfVisible = useRouterState({
|
|
13
|
+
select: (state) => state.location.pathname.endsWith(pdfRoute.path),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const onPdfToggle = () => {
|
|
17
|
+
if (pdfVisible) {
|
|
18
|
+
router.history.back();
|
|
19
|
+
} else {
|
|
20
|
+
router.navigate({ to: '/pdf' });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (onClick) onClick(); // call sidebar close
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<button
|
|
28
|
+
className={`button ${pdfVisible ? '' : 'inverted'}`}
|
|
29
|
+
onClick={onPdfToggle}
|
|
30
|
+
title="Toggle PDF"
|
|
31
|
+
style={{ display: 'inline-flex', alignItems: 'center', gap: '6px' }}
|
|
32
|
+
>
|
|
33
|
+
{pdfVisible ? (
|
|
34
|
+
<TbFile size={18} />
|
|
35
|
+
) : (
|
|
36
|
+
<TbFileOff size={18} />
|
|
37
|
+
)}
|
|
38
|
+
<span>PDF</span>
|
|
39
|
+
</button>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Link } from '@tanstack/react-router';
|
|
3
|
+
import { TbMenu2, TbX, TbUsers, TbRefresh } from 'react-icons/tb';
|
|
4
|
+
import cx from 'classnames';
|
|
5
|
+
import { PdfToggleButton } from '../pdf-toggle-button/pdf-toggle-button.tsx';
|
|
6
|
+
import type { TSortedPages } from '../../../../docgen/types.ts';
|
|
7
|
+
|
|
8
|
+
const SIDEBAR_ICON_SIZE = 24;
|
|
9
|
+
const SIDEBAR_SMALL_ICON_SIZE = 20;
|
|
10
|
+
|
|
11
|
+
const Page = ({ page, onLinkClick }) => {
|
|
12
|
+
const name = page.source.substring(0, page.source.lastIndexOf('.'));
|
|
13
|
+
const path = name === 'index' ? '/' : name;
|
|
14
|
+
return (
|
|
15
|
+
<li>
|
|
16
|
+
<Link to={path} onClick={onLinkClick}>
|
|
17
|
+
{page.title}
|
|
18
|
+
</Link>
|
|
19
|
+
</li>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type TSideBarProps = {
|
|
24
|
+
sortedPages: TSortedPages;
|
|
25
|
+
pdfEnabled: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const SideBar = ({
|
|
29
|
+
sortedPages,
|
|
30
|
+
pdfEnabled
|
|
31
|
+
} : TSideBarProps) => {
|
|
32
|
+
const [open, setOpen] = useState(false);
|
|
33
|
+
const toggleOpen = () => setOpen(!open);
|
|
34
|
+
const close = () => setOpen(false);
|
|
35
|
+
|
|
36
|
+
const pages = Object.values(sortedPages).flat();
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div id="dgSideBar" className={cx(!open ? 'dgSideBarCollapsed' : '')}>
|
|
40
|
+
<button id="dgSideBarButton" onClick={toggleOpen}>
|
|
41
|
+
<span className="dgIcon">
|
|
42
|
+
{open ? <TbX size={SIDEBAR_ICON_SIZE} /> : <TbMenu2 size={SIDEBAR_ICON_SIZE} />}
|
|
43
|
+
</span>
|
|
44
|
+
</button>
|
|
45
|
+
|
|
46
|
+
<div id="dgSideBarInnerWrapper">
|
|
47
|
+
<div id="dgSideBarInner">
|
|
48
|
+
<div id="dgSideBarContent">
|
|
49
|
+
{pages
|
|
50
|
+
.filter((p) => p?.heading !== 'Extra')
|
|
51
|
+
.map((page, i) => (
|
|
52
|
+
<div key={i}>
|
|
53
|
+
<div className="dgSideBarHeading">{page.heading}</div>
|
|
54
|
+
<ul>
|
|
55
|
+
{page.pages.map((subPage, i) => (
|
|
56
|
+
<Page key={i} page={subPage} onLinkClick={close} />
|
|
57
|
+
))}
|
|
58
|
+
</ul>
|
|
59
|
+
</div>
|
|
60
|
+
))}
|
|
61
|
+
|
|
62
|
+
<div className="dgSideBarAttribution">
|
|
63
|
+
<ul>
|
|
64
|
+
<li>
|
|
65
|
+
<span className="dgIcon" title="ownership"></span>
|
|
66
|
+
<Link to="/ownership" onClick={close}>
|
|
67
|
+
<TbUsers size={SIDEBAR_SMALL_ICON_SIZE} /> Ownership
|
|
68
|
+
</Link>
|
|
69
|
+
</li>
|
|
70
|
+
<li>
|
|
71
|
+
<span className="dgIcon" title="release notes"></span>
|
|
72
|
+
<Link to="/release-notes" onClick={close}>
|
|
73
|
+
<TbRefresh size={SIDEBAR_SMALL_ICON_SIZE} /> Release Notes
|
|
74
|
+
</Link>
|
|
75
|
+
</li>
|
|
76
|
+
</ul>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
{pdfEnabled && (
|
|
80
|
+
<div className="dgSideBarPDFButton">
|
|
81
|
+
<PdfToggleButton onClick={close} />
|
|
82
|
+
</div>
|
|
83
|
+
)}
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Link } from '@tanstack/react-router';
|
|
3
|
+
import { PdfToggleButton } from '../pdf-toggle-button/pdf-toggle-button.tsx';
|
|
4
|
+
|
|
5
|
+
const Logo = ({ parameters }) => {
|
|
6
|
+
return (
|
|
7
|
+
parameters?.logoPath && (
|
|
8
|
+
<img
|
|
9
|
+
style={{ marginRight: '25px' }}
|
|
10
|
+
src={parameters?.logoPath}
|
|
11
|
+
alt="logo"
|
|
12
|
+
/>
|
|
13
|
+
)
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const TopBar = ({ parameters }) => {
|
|
18
|
+
return (
|
|
19
|
+
<div>
|
|
20
|
+
<div className="topbar">
|
|
21
|
+
<div className="left">
|
|
22
|
+
<Link className="dg-homelink" to="/">
|
|
23
|
+
<Logo parameters={parameters} />
|
|
24
|
+
</Link>
|
|
25
|
+
<div id="headerLeftText">
|
|
26
|
+
<Link className="dg-homelink" to={parameters.homePagePath}>
|
|
27
|
+
<span id="dg-title">{parameters.title}</span>
|
|
28
|
+
<span id="dg-web-title-version" style={{ fontWeight: 'normal' }}>
|
|
29
|
+
({parameters.version})
|
|
30
|
+
</span>
|
|
31
|
+
</Link>
|
|
32
|
+
{parameters?.sponsorLink?.name && (
|
|
33
|
+
<div id="headerSponsor">
|
|
34
|
+
<span>{parameters.sponsorLink.name}</span>
|
|
35
|
+
<a href={parameters.sponsorLink.url}>
|
|
36
|
+
<img
|
|
37
|
+
id="sponsorLogo"
|
|
38
|
+
src={parameters.sponsorLink.logo}
|
|
39
|
+
alt="sponsor logo"
|
|
40
|
+
/>
|
|
41
|
+
</a>
|
|
42
|
+
</div>
|
|
43
|
+
)}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div
|
|
47
|
+
className="right"
|
|
48
|
+
style={{ display: 'flex', alignItems: 'center', gap: '10px' }}
|
|
49
|
+
>
|
|
50
|
+
<PdfToggleButton />
|
|
51
|
+
<span id="dg-backlink">
|
|
52
|
+
{parameters.backlink.url && (
|
|
53
|
+
<a className="button inverted" href={parameters.backlink.url}>
|
|
54
|
+
{parameters.backlink.name}
|
|
55
|
+
</a>
|
|
56
|
+
)}
|
|
57
|
+
</span>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
};
|