@brillout/docpress 0.6.20 → 0.6.21-commit-74553e7
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/+config.ts +26 -7
- package/MobileHeader.tsx +5 -3
- package/PageLayout.css +11 -11
- package/PageLayout.tsx +27 -20
- package/algolia/DocSearch.css +6 -9
- package/autoScrollNav.ts +4 -3
- package/components/FeatureList/FeatureList.client.ts +6 -11
- package/components/Link.tsx +9 -9
- package/config/getConfig.ts +2 -1
- package/config/resolveHeadingsData.ts +22 -30
- package/config/resolvePageContext.ts +4 -6
- package/dist/+config.d.ts +25 -8
- package/dist/+config.js +7 -7
- package/dist/components/CodeBlockTransformer.d.ts +7 -0
- package/dist/components/CodeBlockTransformer.js +9 -0
- package/dist/components/Comment.d.ts +5 -0
- package/dist/components/Comment.js +6 -0
- package/dist/components/Consulting.d.ts +4 -0
- package/dist/components/Consulting.js +39 -0
- package/dist/components/Contributors.d.ts +7 -0
- package/dist/components/Contributors.js +74 -0
- package/dist/components/FileRemoved.d.ts +9 -0
- package/dist/components/FileRemoved.js +28 -0
- package/dist/components/HorizontalLine.d.ts +5 -0
- package/dist/components/HorizontalLine.js +15 -0
- package/dist/components/ImportMeta.d.ts +5 -0
- package/dist/components/ImportMeta.js +10 -0
- package/dist/components/Link.d.ts +16 -0
- package/dist/components/Link.js +108 -0
- package/dist/components/Note.d.ts +22 -0
- package/dist/components/Note.js +93 -0
- package/dist/components/P.d.ts +4 -0
- package/dist/components/P.js +17 -0
- package/dist/components/ReadingRecommendation.d.ts +6 -0
- package/dist/components/ReadingRecommendation.js +40 -0
- package/dist/components/RepoLink.d.ts +9 -0
- package/dist/components/RepoLink.js +22 -0
- package/dist/components/Sponsors.d.ts +22 -0
- package/dist/components/Sponsors.js +161 -0
- package/dist/components/Supporters.d.ts +32 -0
- package/dist/components/Supporters.js +80 -0
- package/dist/components/index.d.ts +15 -0
- package/dist/components/index.js +15 -0
- package/dist/config/getConfig.d.ts +3 -0
- package/dist/config/getConfig.js +14 -0
- package/dist/config/resolveHeadingsData.d.ts +16 -0
- package/dist/config/resolveHeadingsData.js +223 -0
- package/dist/config/resolvePageContext.d.ts +38 -0
- package/dist/config/resolvePageContext.js +23 -0
- package/dist/data/maintainersList.d.ts +9 -0
- package/dist/data/maintainersList.js +83 -0
- package/dist/data/sponsorsList.d.ts +3 -0
- package/dist/data/sponsorsList.js +151 -0
- package/dist/navigation/Navigation.d.ts +20 -0
- package/dist/navigation/Navigation.js +127 -0
- package/dist/navigation/NavigationHeader.d.ts +4 -0
- package/dist/navigation/NavigationHeader.js +85 -0
- package/dist/navigation/navigation-fullscreen/NavigationFullscreenButton.d.ts +6 -0
- package/dist/navigation/navigation-fullscreen/NavigationFullscreenButton.js +22 -0
- package/dist/parsePageSections.js +2 -2
- package/dist/parseTitle.d.ts +5 -0
- package/dist/parseTitle.js +52 -0
- package/dist/renderer/usePageContext.d.ts +17 -0
- package/dist/renderer/usePageContext.js +26 -0
- package/dist/types/Config.d.ts +30 -0
- package/dist/types/Config.js +1 -0
- package/dist/types/Heading.d.ts +45 -0
- package/dist/types/Heading.js +1 -0
- package/dist/utils/Emoji/Emoji.d.ts +8 -0
- package/dist/utils/Emoji/Emoji.js +191 -0
- package/dist/utils/Emoji/assets.d.ts +6 -0
- package/dist/utils/Emoji/assets.js +7 -0
- package/dist/utils/Emoji/index.d.ts +1 -0
- package/dist/utils/Emoji/index.js +1 -0
- package/dist/utils/client.d.ts +2 -0
- package/dist/utils/client.js +2 -0
- package/dist/utils/filter.d.ts +2 -0
- package/dist/utils/filter.js +11 -0
- package/dist/utils/isBrowser.d.ts +2 -0
- package/dist/utils/isBrowser.js +4 -0
- package/dist/utils/jsxToTextContent.d.ts +2 -0
- package/dist/utils/jsxToTextContent.js +12 -0
- package/dist/utils/objectAssign.d.ts +2 -0
- package/dist/utils/objectAssign.js +5 -0
- package/dist/utils/server.d.ts +7 -0
- package/dist/utils/server.js +7 -0
- package/dist/vite.config.js +7 -2
- package/installSectionUrlHashs.ts +7 -6
- package/navigation/Navigation-layout.css +2 -2
- package/navigation/Navigation.tsx +9 -6
- package/navigation/NavigationHeader.tsx +33 -4
- package/navigation/initPressKit.ts +2 -1
- package/package.json +17 -13
- package/renderer/getPageElement.tsx +16 -0
- package/renderer/onBeforeRender.ts +12 -0
- package/renderer/onRenderClient.tsx +53 -0
- package/renderer/onRenderHtml.tsx +7 -22
- package/renderer/usePageContext.tsx +20 -0
- package/tsconfig.json +1 -1
- package/types/Config.ts +6 -20
- package/types/Heading.ts +4 -4
- package/vite.config.ts +7 -2
- package/algolia/DocSearch.ts +0 -62
- package/navigation/Navigation.client.ts +0 -7
- package/renderer/client.ts +0 -4
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export { maintainers };
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var maintainers = [
|
|
4
|
+
{
|
|
5
|
+
username: 'brillout',
|
|
6
|
+
firstName: 'Rom',
|
|
7
|
+
roles: [
|
|
8
|
+
React.createElement(React.Fragment, null, "Vike Core (Lead Maintainer, Creator)"),
|
|
9
|
+
React.createElement(React.Fragment, null,
|
|
10
|
+
React.createElement("code", null, "vike-react"),
|
|
11
|
+
" (Lead Maintainer, Creator)"),
|
|
12
|
+
React.createElement(React.Fragment, null,
|
|
13
|
+
React.createElement("code", null, "vike-vue"),
|
|
14
|
+
" (Contributor)"),
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
username: 'magne4000',
|
|
19
|
+
firstName: 'Joël',
|
|
20
|
+
roles: [
|
|
21
|
+
React.createElement(React.Fragment, null, "Bati (Lead Maintainer, Creator)"),
|
|
22
|
+
React.createElement(React.Fragment, null,
|
|
23
|
+
React.createElement("code", null, "vike-solid"),
|
|
24
|
+
" (Lead Maintainer, Creator)"),
|
|
25
|
+
React.createElement(React.Fragment, null, "Vike Core (Contributor)"),
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
username: 'nitedani',
|
|
30
|
+
firstName: 'Dániel',
|
|
31
|
+
roles: [
|
|
32
|
+
React.createElement(React.Fragment, null,
|
|
33
|
+
React.createElement("code", null, "vike-react-query"),
|
|
34
|
+
" (Lead Maintainer, Creator)"),
|
|
35
|
+
React.createElement(React.Fragment, null,
|
|
36
|
+
React.createElement("code", null, "vike-angular"),
|
|
37
|
+
" (Lead Maintainer, Creator)"),
|
|
38
|
+
React.createElement(React.Fragment, null, "Vike Core (Contributor)"),
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
username: 'phonzammi',
|
|
43
|
+
firstName: 'Muhammad',
|
|
44
|
+
roles: [
|
|
45
|
+
React.createElement(React.Fragment, null,
|
|
46
|
+
React.createElement("code", null, "vike-vue"),
|
|
47
|
+
" (Contributor)"),
|
|
48
|
+
React.createElement(React.Fragment, null,
|
|
49
|
+
React.createElement("code", null, "vike-solid"),
|
|
50
|
+
" (Contributor)"),
|
|
51
|
+
React.createElement(React.Fragment, null,
|
|
52
|
+
React.createElement("code", null, "vike-react"),
|
|
53
|
+
" (Contributor)"),
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
username: '4350pChris',
|
|
58
|
+
firstName: 'Chris',
|
|
59
|
+
roles: [
|
|
60
|
+
React.createElement(React.Fragment, null,
|
|
61
|
+
React.createElement("code", null, "vike-pinia"),
|
|
62
|
+
" (Lead Maintainer, Creator)"),
|
|
63
|
+
React.createElement(React.Fragment, null,
|
|
64
|
+
React.createElement("code", null, "vike-vue"),
|
|
65
|
+
" (Contributor)"),
|
|
66
|
+
React.createElement(React.Fragment, null, "Vike Core (Contributor)"),
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
username: 'AurelienLourot',
|
|
71
|
+
firstName: 'Aurélien',
|
|
72
|
+
roles: [
|
|
73
|
+
React.createElement(React.Fragment, null,
|
|
74
|
+
React.createElement("code", null, "vike-vue"),
|
|
75
|
+
" (Contributor)"),
|
|
76
|
+
React.createElement(React.Fragment, null,
|
|
77
|
+
React.createElement("code", null, "vike-react"),
|
|
78
|
+
" (Contributor)"),
|
|
79
|
+
React.createElement(React.Fragment, null, "Vike Core (Contributor)"),
|
|
80
|
+
],
|
|
81
|
+
// consultingUrl: 'https://lourot.dev/'
|
|
82
|
+
},
|
|
83
|
+
];
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
export { sponsorsList };
|
|
11
|
+
import contraLogo from './sponsorsList/companyLogos/contra.svg';
|
|
12
|
+
import optimizersLogo from './sponsorsList/companyLogos/optimizers.svg';
|
|
13
|
+
import sourcegraphLogo from './sponsorsList/companyLogos/sourcegraph.svg';
|
|
14
|
+
import burdaforwardLogo from './sponsorsList/companyLogos/burdaforward.png';
|
|
15
|
+
import ecosiaLogo from './sponsorsList/companyLogos/ecosia.svg';
|
|
16
|
+
import inlangLogo from './sponsorsList/companyLogos/inlang.png';
|
|
17
|
+
import bluefinLogo from './sponsorsList/companyLogos/bluefin.svg';
|
|
18
|
+
import alignableLogo from './sponsorsList/companyLogos/alignable.svg';
|
|
19
|
+
var individuals = [
|
|
20
|
+
{ username: 'arp' },
|
|
21
|
+
{ username: 'tlancina' },
|
|
22
|
+
{ username: 'shishkin17' },
|
|
23
|
+
{ username: 'royalswe' },
|
|
24
|
+
{ username: 'lebretont' },
|
|
25
|
+
{ username: 'xar' },
|
|
26
|
+
{ username: 'NicoZweifel' },
|
|
27
|
+
{ username: 'mariuslian' },
|
|
28
|
+
{ username: 'shortpoet' },
|
|
29
|
+
{ username: 'sqs' },
|
|
30
|
+
{ username: 'dylmye' },
|
|
31
|
+
{ username: 'isakura313' },
|
|
32
|
+
{ username: 'rivatove' },
|
|
33
|
+
{ username: 'SMKJALLAD' },
|
|
34
|
+
{ username: 'routinghub' },
|
|
35
|
+
{ username: 'LostCrew' }, // Ecosia
|
|
36
|
+
{ username: 'jakubfiala' }, // Ecosia
|
|
37
|
+
{ username: 'HarshwardhanSingh' },
|
|
38
|
+
{ username: 'd3x7r0' },
|
|
39
|
+
{ username: 'ChristophP' }, // BurdaForward
|
|
40
|
+
{ username: 'msiegenthaler' },
|
|
41
|
+
{ username: 'linkyard' },
|
|
42
|
+
{ username: 'AnukarOP' },
|
|
43
|
+
{ username: 'RoyMcCrain' },
|
|
44
|
+
{ username: 'chrisvander' }, // Bluefin
|
|
45
|
+
{ username: 'EralChen' },
|
|
46
|
+
{ username: '3dyuval' },
|
|
47
|
+
{ username: 'talzion12' },
|
|
48
|
+
{ username: 'felixhaeberle' },
|
|
49
|
+
{ username: 'apappas1129' },
|
|
50
|
+
/* 404
|
|
51
|
+
{ username: 'agalbenus' },
|
|
52
|
+
*/
|
|
53
|
+
{ username: 'phiberber' },
|
|
54
|
+
{ username: 'cookieplace' },
|
|
55
|
+
{ username: 'JiangWeixian' },
|
|
56
|
+
{ username: 'harrytran998' },
|
|
57
|
+
{ username: 'alexturpin' },
|
|
58
|
+
{ username: 'gu-stav' },
|
|
59
|
+
{ username: 'YannBirba' },
|
|
60
|
+
{ username: 'fi3ework' },
|
|
61
|
+
{ username: 'EJM-Company' },
|
|
62
|
+
{ username: 'Nelie-Taylor' },
|
|
63
|
+
{ username: 'fortezhuo' },
|
|
64
|
+
{ username: 'nshelia' },
|
|
65
|
+
{ username: 'marcusway' },
|
|
66
|
+
{ username: 'edikdeisling' },
|
|
67
|
+
{ username: 'AurelienLourot' },
|
|
68
|
+
{ username: 'jahredhope' },
|
|
69
|
+
{ username: 'charlieforward9' },
|
|
70
|
+
{ username: 'leonmondria' },
|
|
71
|
+
{ username: 'jscottsf' },
|
|
72
|
+
{ username: 'micah-redwood' },
|
|
73
|
+
{ username: 'nicka-redwood' },
|
|
74
|
+
{ username: 'ser1us' },
|
|
75
|
+
{ username: 'nikitavoloboev' },
|
|
76
|
+
{ username: 'samuelstroschein' },
|
|
77
|
+
{ username: 'npacucci' },
|
|
78
|
+
{ username: 'szarapka' },
|
|
79
|
+
{ username: 'techniath' },
|
|
80
|
+
{ username: 'DannyZB' },
|
|
81
|
+
{ username: 'pieperz' },
|
|
82
|
+
{ username: 'hemengke1997' },
|
|
83
|
+
{ username: 'spacedawwwg' },
|
|
84
|
+
{ username: 'arthurgailes' },
|
|
85
|
+
{ username: 'stackblitz' },
|
|
86
|
+
{ username: 'codthing' },
|
|
87
|
+
{ username: 'Junaidhkn' },
|
|
88
|
+
{ username: 'zgfdev' },
|
|
89
|
+
];
|
|
90
|
+
var companies = [
|
|
91
|
+
{
|
|
92
|
+
companyName: 'Contra',
|
|
93
|
+
companyLogo: contraLogo,
|
|
94
|
+
plan: 'silver',
|
|
95
|
+
website: 'https://contra.com',
|
|
96
|
+
github: 'contra',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
companyName: 'Inlang',
|
|
100
|
+
companyLogo: inlangLogo,
|
|
101
|
+
plan: 'silver',
|
|
102
|
+
website: 'https://inlang.com/',
|
|
103
|
+
github: 'opral',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
companyName: 'Alignable',
|
|
107
|
+
companyLogo: alignableLogo,
|
|
108
|
+
plan: 'silver',
|
|
109
|
+
website: 'https://www.alignable.com/',
|
|
110
|
+
github: 'AlignableUser',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
companyName: 'Sourcegraph',
|
|
114
|
+
companyLogo: sourcegraphLogo,
|
|
115
|
+
plan: 'bronze',
|
|
116
|
+
website: 'https://sourcegraph.com',
|
|
117
|
+
github: 'sourcegraph',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
companyName: 'Optimizers',
|
|
121
|
+
companyLogo: optimizersLogo,
|
|
122
|
+
plan: 'bronze',
|
|
123
|
+
website: 'https://www.optimizers.nl/',
|
|
124
|
+
divSize: {
|
|
125
|
+
padding: 20,
|
|
126
|
+
},
|
|
127
|
+
github: 'OptimizersGroup',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
companyName: 'BurdaFoward',
|
|
131
|
+
companyLogo: burdaforwardLogo,
|
|
132
|
+
plan: 'bronze',
|
|
133
|
+
website: 'https://www.burda-forward.de',
|
|
134
|
+
github: 'BurdaForward',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
companyName: 'Ecosia',
|
|
138
|
+
companyLogo: ecosiaLogo,
|
|
139
|
+
plan: 'bronze',
|
|
140
|
+
website: 'https://ecosia.org',
|
|
141
|
+
github: 'ecosia',
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
companyName: 'Bluefin',
|
|
145
|
+
companyLogo: bluefinLogo,
|
|
146
|
+
plan: 'indie',
|
|
147
|
+
website: 'https://www.bluefin.one',
|
|
148
|
+
github: 'bluefin-clinical',
|
|
149
|
+
},
|
|
150
|
+
];
|
|
151
|
+
var sponsorsList = __spreadArray(__spreadArray([], companies, true), individuals, true);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { Navigation };
|
|
2
|
+
export { NavigationMask };
|
|
3
|
+
export type { NavigationData };
|
|
4
|
+
export type { NavItem };
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import './Navigation.css';
|
|
7
|
+
type NavigationData = Parameters<typeof Navigation>[0];
|
|
8
|
+
declare function Navigation({ navItems, navItemsAll, currentUrl, isDetachedPage, }: {
|
|
9
|
+
navItems: NavItem[];
|
|
10
|
+
navItemsAll: NavItem[];
|
|
11
|
+
currentUrl: string;
|
|
12
|
+
isDetachedPage: boolean;
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
declare function NavigationMask(): React.JSX.Element;
|
|
15
|
+
type NavItem = {
|
|
16
|
+
level: number;
|
|
17
|
+
url?: string | null;
|
|
18
|
+
title: string;
|
|
19
|
+
titleInNav: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
export { Navigation };
|
|
13
|
+
export { NavigationMask };
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import { NavigationHeader } from './NavigationHeader';
|
|
16
|
+
import { assert, Emoji, assertWarning, jsxToTextContent } from '../utils/server';
|
|
17
|
+
import './Navigation.css';
|
|
18
|
+
import { NavigationFullscreenClose } from './navigation-fullscreen/NavigationFullscreenButton';
|
|
19
|
+
import { parseTitle } from '../parseTitle';
|
|
20
|
+
function Navigation(_a) {
|
|
21
|
+
var navItems = _a.navItems, navItemsAll = _a.navItemsAll, currentUrl = _a.currentUrl, isDetachedPage = _a.isDetachedPage;
|
|
22
|
+
return (React.createElement(React.Fragment, null,
|
|
23
|
+
React.createElement("div", { id: "navigation-container" },
|
|
24
|
+
React.createElement(NavigationHeader, null),
|
|
25
|
+
isDetachedPage && (React.createElement(React.Fragment, null,
|
|
26
|
+
navItems.length > 1 && (React.createElement(NavigationContent, { id: "navigation-content-detached", navItems: navItems, currentUrl: currentUrl })),
|
|
27
|
+
React.createElement(DetachedPageNote, null))),
|
|
28
|
+
React.createElement(NavigationContent, { id: "navigation-content-main", navItems: navItemsAll, currentUrl: currentUrl }),
|
|
29
|
+
React.createElement(NavigationFullscreenClose, null))));
|
|
30
|
+
}
|
|
31
|
+
function NavigationMask() {
|
|
32
|
+
return React.createElement("div", { id: "mobile-navigation-mask" });
|
|
33
|
+
}
|
|
34
|
+
function NavigationContent(props) {
|
|
35
|
+
var navItemsWithComputed = addComputedProps(props.navItems, props.currentUrl);
|
|
36
|
+
var navItemsGrouped = groupByLevel1(navItemsWithComputed);
|
|
37
|
+
return (React.createElement("div", { id: props.id, className: "navigation-content" },
|
|
38
|
+
React.createElement("div", { className: "nav-column", style: { position: 'relative' } }, navItemsGrouped.map(function (navItemLevel1, i) { return (React.createElement("div", { className: "nav-items-level-1-group", key: i },
|
|
39
|
+
React.createElement(NavItemComponent, { navItem: navItemLevel1 }),
|
|
40
|
+
navItemLevel1.navItemChilds.map(function (navItem, j) { return (React.createElement(NavItemComponent, { navItem: navItem, key: j })); }))); }))));
|
|
41
|
+
}
|
|
42
|
+
function NavItemComponent(_a) {
|
|
43
|
+
var _b;
|
|
44
|
+
var navItem = _a.navItem;
|
|
45
|
+
assert([1, 2, 3, 4].includes(navItem.level), navItem);
|
|
46
|
+
var titleJsx = parseTitle(navItem.title);
|
|
47
|
+
var titleInNavJsx = parseTitle(navItem.titleInNav);
|
|
48
|
+
if (navItem.level === 1 || navItem.level === 4) {
|
|
49
|
+
assert(navItem.url === undefined);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
var sectionTitle = jsxToTextContent(titleJsx);
|
|
53
|
+
assertWarning(navItem.url, "".concat(jsxToTextContent(titleInNavJsx), " is missing a URL hash. Use `<h2 id=\"url-hash\">").concat(sectionTitle, "</h2>` instead of `## ").concat(sectionTitle, "`."));
|
|
54
|
+
}
|
|
55
|
+
return (React.createElement("a", { className: [
|
|
56
|
+
'nav-item',
|
|
57
|
+
'nav-item-level-' + navItem.level,
|
|
58
|
+
navItem.isActive && ' is-active',
|
|
59
|
+
navItem.isActiveFirst && ' is-active-first',
|
|
60
|
+
navItem.isActiveLast && ' is-active-last',
|
|
61
|
+
navItem.isFirstOfItsKind && 'nav-item-first-of-its-kind',
|
|
62
|
+
navItem.isLastOfItsKind && 'nav-item-last-of-its-kind',
|
|
63
|
+
]
|
|
64
|
+
.filter(Boolean)
|
|
65
|
+
.join(' '), href: (_b = navItem.url) !== null && _b !== void 0 ? _b : undefined }, titleInNavJsx));
|
|
66
|
+
}
|
|
67
|
+
function groupByLevel1(navItems) {
|
|
68
|
+
var navItemsGrouped = [];
|
|
69
|
+
var levelMin = Math.min.apply(Math, navItems.map(function (h) { return h.level; }));
|
|
70
|
+
navItems.forEach(function (navItem) {
|
|
71
|
+
if (navItem.level === levelMin) {
|
|
72
|
+
navItemsGrouped.push(__assign(__assign({}, navItem), { navItemChilds: [] }));
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
navItemsGrouped[navItemsGrouped.length - 1].navItemChilds.push(navItem);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return navItemsGrouped;
|
|
79
|
+
}
|
|
80
|
+
function addComputedProps(navItems, currentUrl) {
|
|
81
|
+
return navItems.map(function (navItem, i) {
|
|
82
|
+
assert([1, 2, 3, 4].includes(navItem.level), navItem);
|
|
83
|
+
var navItemPrevious = navItems[i - 1];
|
|
84
|
+
var navItemNext = navItems[i + 1];
|
|
85
|
+
var isActiveFirst = false;
|
|
86
|
+
var isActiveLast = false;
|
|
87
|
+
var isActive = false;
|
|
88
|
+
if (navItem.url === currentUrl) {
|
|
89
|
+
assert(navItem.level === 2, { currentUrl: currentUrl });
|
|
90
|
+
isActive = true;
|
|
91
|
+
isActiveFirst = true;
|
|
92
|
+
if ((navItemNext === null || navItemNext === void 0 ? void 0 : navItemNext.level) !== 3) {
|
|
93
|
+
isActiveLast = true;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (navItem.level === 3) {
|
|
97
|
+
isActive = true;
|
|
98
|
+
if ((navItemNext === null || navItemNext === void 0 ? void 0 : navItemNext.level) !== 3) {
|
|
99
|
+
isActiveLast = true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
var isFirstOfItsKind = navItem.level !== (navItemPrevious === null || navItemPrevious === void 0 ? void 0 : navItemPrevious.level);
|
|
103
|
+
var isLastOfItsKind = navItem.level !== (navItemNext === null || navItemNext === void 0 ? void 0 : navItemNext.level);
|
|
104
|
+
return __assign(__assign({}, navItem), { isActive: isActive, isActiveFirst: isActiveFirst, isActiveLast: isActiveLast, isFirstOfItsKind: isFirstOfItsKind, isLastOfItsKind: isLastOfItsKind });
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function DetachedPageNote() {
|
|
108
|
+
return (React.createElement("div", { id: "detached-note", style: {
|
|
109
|
+
backgroundColor: 'var(--background-color)',
|
|
110
|
+
textAlign: 'left',
|
|
111
|
+
marginLeft: 10,
|
|
112
|
+
marginRight: 10,
|
|
113
|
+
marginTop: 25,
|
|
114
|
+
marginBottom: -5,
|
|
115
|
+
borderRadius: 5,
|
|
116
|
+
padding: 10,
|
|
117
|
+
} },
|
|
118
|
+
React.createElement(Emoji, { name: "info" }),
|
|
119
|
+
' ',
|
|
120
|
+
React.createElement("b", null,
|
|
121
|
+
React.createElement("em", null, "Detached")),
|
|
122
|
+
React.createElement("span", { style: {
|
|
123
|
+
opacity: 0.8,
|
|
124
|
+
} },
|
|
125
|
+
' ',
|
|
126
|
+
"\u2014 this page isn't listed in the navigation below.")));
|
|
127
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import iconGithub from '../icons/github.svg';
|
|
14
|
+
import iconTwitter from '../icons/twitter.svg';
|
|
15
|
+
import iconDiscord from '../icons/discord.svg';
|
|
16
|
+
import iconChangelog from '../icons/changelog.svg';
|
|
17
|
+
import iconLanguages from '../icons/languages.svg';
|
|
18
|
+
import { usePageContext, usePageContext2 } from '../renderer/usePageContext';
|
|
19
|
+
import { DocSearch } from '@docsearch/react';
|
|
20
|
+
import '@docsearch/css';
|
|
21
|
+
export { NavigationHeader };
|
|
22
|
+
function NavigationHeader() {
|
|
23
|
+
var _a;
|
|
24
|
+
var pageContext = usePageContext();
|
|
25
|
+
var pageContext2 = usePageContext2();
|
|
26
|
+
var NavHeader = pageContext2.config.NavHeader.NavHeader;
|
|
27
|
+
return (React.createElement("div", { id: "navigation-header", className: pageContext.config.pressKit && 'press-kit', style: {
|
|
28
|
+
display: 'flex',
|
|
29
|
+
flexDirection: 'column',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
marginBottom: -5,
|
|
32
|
+
} },
|
|
33
|
+
React.createElement("a", { id: "navigation-header-logo", style: __assign({ display: 'flex', alignItems: 'center', color: 'inherit', justifyContent: 'left', textDecoration: 'none', paddingTop: 12, paddingBottom: 7 }, (_a = pageContext2.config.NavHeader) === null || _a === void 0 ? void 0 : _a.navHeaderWrapperStyle), href: "/" },
|
|
34
|
+
React.createElement(NavHeader, null)),
|
|
35
|
+
React.createElement(Links, null)));
|
|
36
|
+
}
|
|
37
|
+
function Links() {
|
|
38
|
+
var pageContext = usePageContext();
|
|
39
|
+
var _a = pageContext.config, projectInfo = _a.projectInfo, i18n = _a.i18n;
|
|
40
|
+
var iconI18n = !i18n ? null : (React.createElement(LinkIcon, { className: "decolorize-4", icon: iconLanguages, href: '/languages', style: { height: 21, position: 'relative', top: 0, left: 0 } }));
|
|
41
|
+
var algolia = pageContext.meta.algolia;
|
|
42
|
+
return (React.createElement("div", { style: {
|
|
43
|
+
display: 'flex',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
paddingTop: 0,
|
|
46
|
+
justifyContent: 'left',
|
|
47
|
+
} },
|
|
48
|
+
React.createElement(LinkIcon, { className: "decolorize-4", icon: iconGithub, href: projectInfo.githubRepository }),
|
|
49
|
+
projectInfo.discordInvite && (React.createElement(LinkIcon, { className: "decolorize-6", icon: iconDiscord, href: projectInfo.discordInvite })),
|
|
50
|
+
React.createElement(LinkIcon, { className: "decolorize-7", icon: iconTwitter, href: projectInfo.twitterProfile }),
|
|
51
|
+
algolia && (React.createElement("div", { className: "decolorize-6 colorize-on-hover" },
|
|
52
|
+
React.createElement(DocSearch, { appId: algolia.appId, indexName: algolia.indexName, apiKey: algolia.apiKey, transformItems: transformItems, insights: true }))),
|
|
53
|
+
iconI18n,
|
|
54
|
+
React.createElement(ChangelogButton, null)));
|
|
55
|
+
}
|
|
56
|
+
function ChangelogButton() {
|
|
57
|
+
var pageContext = usePageContext();
|
|
58
|
+
var projectInfo = pageContext.config.projectInfo;
|
|
59
|
+
return (React.createElement("a", { href: "".concat(projectInfo.githubRepository, "/blob/main/CHANGELOG.md"), className: "button colorize-on-hover", style: {
|
|
60
|
+
display: 'flex',
|
|
61
|
+
alignItems: 'center',
|
|
62
|
+
padding: '1px 7px',
|
|
63
|
+
marginLeft: 2,
|
|
64
|
+
fontSize: '0.97em',
|
|
65
|
+
color: 'inherit',
|
|
66
|
+
} },
|
|
67
|
+
React.createElement("span", { id: "version-number", className: "decolorize-7" },
|
|
68
|
+
"v",
|
|
69
|
+
projectInfo.projectVersion),
|
|
70
|
+
React.createElement("img", { className: "decolorize-6", src: iconChangelog, height: 16, style: { marginLeft: 5 } })));
|
|
71
|
+
}
|
|
72
|
+
function LinkIcon(_a) {
|
|
73
|
+
var className = _a.className, icon = _a.icon, href = _a.href, style = _a.style;
|
|
74
|
+
return (React.createElement(React.Fragment, null,
|
|
75
|
+
React.createElement("a", { className: 'colorize-on-hover ' + className, href: href, style: { padding: 3, display: 'inline-block', lineHeight: 0 } },
|
|
76
|
+
React.createElement("img", { src: icon, height: "20", style: style }))));
|
|
77
|
+
}
|
|
78
|
+
var transformItems = function (hits) {
|
|
79
|
+
hits.map(function (hit) {
|
|
80
|
+
if (hit.url.indexOf('#page-content') > 0) {
|
|
81
|
+
hit.url = hit.url.replace('#page-content', '');
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
return hits;
|
|
85
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { NavigationFullscreenButton };
|
|
2
|
+
export { NavigationFullscreenClose };
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import './NavigationFullscreenButton.css';
|
|
5
|
+
declare function NavigationFullscreenButton(): React.JSX.Element;
|
|
6
|
+
declare function NavigationFullscreenClose(): React.JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { NavigationFullscreenButton };
|
|
2
|
+
export { NavigationFullscreenClose };
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import './NavigationFullscreenButton.css';
|
|
5
|
+
import closeIcon from './close.svg';
|
|
6
|
+
function NavigationFullscreenButton() {
|
|
7
|
+
return (React.createElement(React.Fragment, null,
|
|
8
|
+
React.createElement("a", { id: "navigation-fullscreen-button" },
|
|
9
|
+
React.createElement("div", { style: {
|
|
10
|
+
position: 'fixed',
|
|
11
|
+
cursor: 'pointer',
|
|
12
|
+
height: '100vh',
|
|
13
|
+
width: 20,
|
|
14
|
+
overflow: 'hidden',
|
|
15
|
+
} },
|
|
16
|
+
React.createElement("div", null)),
|
|
17
|
+
React.createElement("div", { style: { position: 'fixed', height: '100vh', width: 20 }, "aria-label": "Press <Esc>", "data-balloon-pos": "right" }))));
|
|
18
|
+
}
|
|
19
|
+
function NavigationFullscreenClose() {
|
|
20
|
+
return (React.createElement("a", { id: "navigation-fullscreen-close", style: { position: 'absolute', top: 11, right: 11, zIndex: 10 }, "aria-label": "Press <Esc>", "data-balloon-pos": "left" },
|
|
21
|
+
React.createElement("img", { src: closeIcon, height: 50, width: 50, style: { display: 'block' } })));
|
|
22
|
+
}
|
|
@@ -8,8 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
-
return g =
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
13
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
14
|
function step(op) {
|
|
15
15
|
if (f) throw new TypeError("Generator is already executing.");
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
10
|
+
export { parseTitle };
|
|
11
|
+
export { withEmoji };
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { Emoji } from './utils/server';
|
|
14
|
+
function parseTitle(title) {
|
|
15
|
+
var parts = [];
|
|
16
|
+
var current;
|
|
17
|
+
title.split('').forEach(function (letter) {
|
|
18
|
+
if (letter === '`') {
|
|
19
|
+
if ((current === null || current === void 0 ? void 0 : current.nodeType) === 'code') {
|
|
20
|
+
// </code>
|
|
21
|
+
parts.push(current);
|
|
22
|
+
current = undefined;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
// <code>
|
|
26
|
+
if (current) {
|
|
27
|
+
parts.push(current);
|
|
28
|
+
}
|
|
29
|
+
current = { nodeType: 'code', content: '' };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
if (!current) {
|
|
34
|
+
current = { nodeType: 'text', content: '' };
|
|
35
|
+
}
|
|
36
|
+
current.content += letter;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
if (current) {
|
|
40
|
+
parts.push(current);
|
|
41
|
+
}
|
|
42
|
+
var titleJsx = React.createElement.apply(React, __spreadArray([React.Fragment,
|
|
43
|
+
{}], parts.map(function (part, i) {
|
|
44
|
+
return React.createElement(part.nodeType === 'code' ? 'code' : React.Fragment, { key: i }, part.content);
|
|
45
|
+
}), false));
|
|
46
|
+
return titleJsx;
|
|
47
|
+
}
|
|
48
|
+
function withEmoji(name, title) {
|
|
49
|
+
var style = { fontSize: '1.4em' };
|
|
50
|
+
//return React.createElement(React.Fragment, null, Emoji({ name, style }), ' ', title)
|
|
51
|
+
return React.createElement('span', { style: style }, Emoji({ name: name }), ' ', React.createElement('span', { style: { fontSize: '1rem' } }, title));
|
|
52
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PageContextResolved } from '../config/resolvePageContext';
|
|
3
|
+
import type { PageContext } from 'vike/types';
|
|
4
|
+
export { PageContextProvider };
|
|
5
|
+
export { usePageContext };
|
|
6
|
+
declare function PageContextProvider({ pageContext, children, }: {
|
|
7
|
+
pageContext: PageContextResolved;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
declare function usePageContext(): PageContextResolved;
|
|
11
|
+
export { PageContextProvider2 };
|
|
12
|
+
export { usePageContext2 };
|
|
13
|
+
declare function usePageContext2(): PageContext;
|
|
14
|
+
declare function PageContextProvider2({ pageContext, children, }: {
|
|
15
|
+
pageContext: PageContext;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// `usePageContext` allows us to access `pageContext` in any React component.
|
|
2
|
+
// More infos: https://vike.dev/pageContext-anywhere
|
|
3
|
+
import React, { useContext } from 'react';
|
|
4
|
+
export { PageContextProvider };
|
|
5
|
+
export { usePageContext };
|
|
6
|
+
var Context = React.createContext(undefined);
|
|
7
|
+
function PageContextProvider(_a) {
|
|
8
|
+
var pageContext = _a.pageContext, children = _a.children;
|
|
9
|
+
return React.createElement(Context.Provider, { value: pageContext }, children);
|
|
10
|
+
}
|
|
11
|
+
function usePageContext() {
|
|
12
|
+
var pageContext = useContext(Context);
|
|
13
|
+
return pageContext;
|
|
14
|
+
}
|
|
15
|
+
export { PageContextProvider2 };
|
|
16
|
+
// TODO/refactor: rename to usePageContext and remove old implementation
|
|
17
|
+
export { usePageContext2 };
|
|
18
|
+
var Context2 = React.createContext(undefined);
|
|
19
|
+
function usePageContext2() {
|
|
20
|
+
var pageContext = useContext(Context2);
|
|
21
|
+
return pageContext;
|
|
22
|
+
}
|
|
23
|
+
function PageContextProvider2(_a) {
|
|
24
|
+
var pageContext = _a.pageContext, children = _a.children;
|
|
25
|
+
return React.createElement(Context2.Provider, { value: pageContext }, children);
|
|
26
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type { Config };
|
|
2
|
+
import type { HeadingDefinition, HeadingDetachedDefinition } from './Heading';
|
|
3
|
+
type Config = {
|
|
4
|
+
projectInfo: {
|
|
5
|
+
githubRepository: string;
|
|
6
|
+
githubIssues: string;
|
|
7
|
+
githubDiscussions?: string;
|
|
8
|
+
projectName: string;
|
|
9
|
+
projectVersion: string;
|
|
10
|
+
discordInvite?: string;
|
|
11
|
+
twitterProfile: string;
|
|
12
|
+
};
|
|
13
|
+
faviconUrl: string;
|
|
14
|
+
algolia: null | {
|
|
15
|
+
appId: string;
|
|
16
|
+
apiKey: string;
|
|
17
|
+
indexName: string;
|
|
18
|
+
};
|
|
19
|
+
headings: HeadingDefinition[];
|
|
20
|
+
headingsDetached: HeadingDetachedDefinition[];
|
|
21
|
+
/** Sets `<meta name="description" content="${tagline}" />` */
|
|
22
|
+
tagline: string;
|
|
23
|
+
websiteUrl: string;
|
|
24
|
+
bannerUrl?: string;
|
|
25
|
+
twitterHandle: string;
|
|
26
|
+
globalNote?: React.ReactNode;
|
|
27
|
+
i18n?: true;
|
|
28
|
+
pressKit?: true;
|
|
29
|
+
sponsorGithubAccount?: string;
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|