mintlify 1.2.0 → 2.0.1
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/CONTRIBUTING.md +2 -0
- package/README.md +1 -1
- package/bin/index.js +0 -2
- package/bin/index.js.map +1 -1
- package/bin/local-preview/index.js +12 -60
- package/bin/local-preview/index.js.map +1 -1
- package/bin/local-preview/listener/categorizeFiles.js +47 -0
- package/bin/local-preview/listener/categorizeFiles.js.map +1 -0
- package/bin/local-preview/listener/generate.js +89 -0
- package/bin/local-preview/listener/generate.js.map +1 -0
- package/bin/local-preview/listener/index.js +135 -0
- package/bin/local-preview/listener/index.js.map +1 -0
- package/bin/local-preview/listener/update.js +41 -0
- package/bin/local-preview/listener/update.js.map +1 -0
- package/bin/local-preview/listener/utils/createPage.js +167 -0
- package/bin/local-preview/listener/utils/createPage.js.map +1 -0
- package/bin/local-preview/listener/utils/fileIsMdxOrMd.js +12 -0
- package/bin/local-preview/listener/utils/fileIsMdxOrMd.js.map +1 -0
- package/bin/local-preview/listener/utils/getOpenApiContext.js +57 -0
- package/bin/local-preview/listener/utils/getOpenApiContext.js.map +1 -0
- package/bin/local-preview/listener/utils/mintConfigFile.js +22 -0
- package/bin/local-preview/listener/utils/mintConfigFile.js.map +1 -0
- package/bin/local-preview/listener/utils/toTitleCase.js +36 -0
- package/bin/local-preview/listener/utils/toTitleCase.js.map +1 -0
- package/bin/local-preview/listener/utils/types.js +2 -0
- package/bin/local-preview/listener/utils/types.js.map +1 -0
- package/bin/local-preview/listener/utils.js +62 -0
- package/bin/local-preview/listener/utils.js.map +1 -0
- package/bin/scraping/detectFramework.js +1 -1
- package/bin/scraping/detectFramework.js.map +1 -1
- package/bin/scraping/scrapePageCommands.js +2 -2
- package/bin/scraping/scrapePageCommands.js.map +1 -1
- package/bin/scraping/site-scrapers/alternateGroupTitle.js +1 -1
- package/bin/scraping/site-scrapers/alternateGroupTitle.js.map +1 -1
- package/bin/scraping/site-scrapers/openNestedDocusaurusMenus.js +3 -3
- package/bin/scraping/site-scrapers/openNestedDocusaurusMenus.js.map +1 -1
- package/bin/scraping/site-scrapers/openNestedGitbookMenus.js +1 -2
- package/bin/scraping/site-scrapers/openNestedGitbookMenus.js.map +1 -1
- package/bin/util.js +40 -1
- package/bin/util.js.map +1 -1
- package/package.json +12 -5
- package/src/index.ts +0 -2
- package/src/local-preview/index.ts +14 -74
- package/src/local-preview/listener/categorizeFiles.ts +55 -0
- package/src/local-preview/listener/generate.ts +110 -0
- package/src/local-preview/listener/index.ts +169 -0
- package/src/local-preview/listener/update.ts +45 -0
- package/src/local-preview/listener/utils/createPage.ts +211 -0
- package/src/local-preview/listener/utils/fileIsMdxOrMd.ts +11 -0
- package/src/local-preview/{utils → listener/utils}/getOpenApiContext.ts +0 -0
- package/src/local-preview/listener/utils/mintConfigFile.ts +28 -0
- package/src/local-preview/listener/utils/toTitleCase.ts +40 -0
- package/src/local-preview/listener/utils/types.ts +1 -0
- package/src/local-preview/listener/utils.ts +69 -0
- package/src/scraping/scrapePageCommands.ts +2 -2
- package/src/util.ts +54 -1
- package/tsconfig.json +6 -5
- package/bin/local-preview/categorizeFiles.js +0 -56
- package/bin/local-preview/categorizeFiles.js.map +0 -1
- package/bin/local-preview/getOpenApiContext.js +0 -46
- package/bin/local-preview/getOpenApiContext.js.map +0 -1
- package/bin/local-preview/helper-commands/clearCommand.js +0 -27
- package/bin/local-preview/helper-commands/clearCommand.js.map +0 -1
- package/bin/local-preview/injectFavicons.js +0 -72
- package/bin/local-preview/injectFavicons.js.map +0 -1
- package/bin/local-preview/injectNav.js +0 -94
- package/bin/local-preview/injectNav.js.map +0 -1
- package/bin/local-preview/listener.js +0 -112
- package/bin/local-preview/listener.js.map +0 -1
- package/bin/local-preview/metadata.js +0 -121
- package/bin/local-preview/metadata.js.map +0 -1
- package/bin/local-preview/mintConfigFile.js +0 -43
- package/bin/local-preview/mintConfigFile.js.map +0 -1
- package/bin/local-preview/openApiCheck.js +0 -16
- package/bin/local-preview/openApiCheck.js.map +0 -1
- package/bin/local-preview/slugToTitle.js +0 -8
- package/bin/local-preview/slugToTitle.js.map +0 -1
- package/bin/mint/client/.babel-plugin-macrosrc.json +0 -5
- package/bin/mint/client/.babelrc +0 -4
- package/bin/mint/client/.editorconfig +0 -12
- package/bin/mint/client/.eslintrc.json +0 -7
- package/bin/mint/client/.prettierignore +0 -4
- package/bin/mint/client/.prettierrc +0 -14
- package/bin/mint/client/.vscode/launch.json +0 -28
- package/bin/mint/client/README.md +0 -44
- package/bin/mint/client/jest.config.ts +0 -195
- package/bin/mint/client/next-env.d.ts +0 -4
- package/bin/mint/client/next.config.js +0 -152
- package/bin/mint/client/package.json +0 -139
- package/bin/mint/client/postcss.config.cjs +0 -9
- package/bin/mint/client/prebuild/faviconConfig.js +0 -35
- package/bin/mint/client/prebuild/getOpenApiContext.js +0 -53
- package/bin/mint/client/prebuild/index.js +0 -117
- package/bin/mint/client/prebuild/injectNav.js +0 -115
- package/bin/mint/client/prebuild/slugToTitle.js +0 -7
- package/bin/mint/client/rehype/withApiComponents.js +0 -60
- package/bin/mint/client/rehype/withCodeBlocks.js +0 -54
- package/bin/mint/client/rehype/withLayouts.js +0 -113
- package/bin/mint/client/rehype/withLinkRoles.js +0 -13
- package/bin/mint/client/rehype/withRawComponents.js +0 -13
- package/bin/mint/client/rehype/withStaticProps.js +0 -25
- package/bin/mint/client/rehype/withSyntaxHighlighting.js +0 -60
- package/bin/mint/client/remark/utils.js +0 -369
- package/bin/mint/client/remark/withFrames.js +0 -55
- package/bin/mint/client/remark/withImportsInjected.js +0 -36
- package/bin/mint/client/remark/withNextLinks.js +0 -37
- package/bin/mint/client/remark/withTableOfContents.js +0 -71
- package/bin/mint/client/scripts/local.js +0 -177
- package/bin/mint/client/sentry.client.config.js +0 -15
- package/bin/mint/client/sentry.properties +0 -4
- package/bin/mint/client/sentry.server.config.js +0 -15
- package/bin/mint/client/src/analytics/AbstractAnalyticsImplementation.ts +0 -50
- package/bin/mint/client/src/analytics/AnalyticsContext.ts +0 -5
- package/bin/mint/client/src/analytics/AnalyticsMediator.ts +0 -101
- package/bin/mint/client/src/analytics/FakeAnalyticsMediator.ts +0 -9
- package/bin/mint/client/src/analytics/GA4Script.tsx +0 -33
- package/bin/mint/client/src/analytics/implementations/amplitude.ts +0 -26
- package/bin/mint/client/src/analytics/implementations/fathom.ts +0 -38
- package/bin/mint/client/src/analytics/implementations/ga4.ts +0 -33
- package/bin/mint/client/src/analytics/implementations/hotjar.ts +0 -53
- package/bin/mint/client/src/analytics/implementations/mixpanel-browser.d.ts +0 -1
- package/bin/mint/client/src/analytics/implementations/mixpanel.ts +0 -52
- package/bin/mint/client/src/analytics/implementations/posthog.ts +0 -37
- package/bin/mint/client/src/components/Accordion/Accordion.tsx +0 -43
- package/bin/mint/client/src/components/Accordion/index.ts +0 -4
- package/bin/mint/client/src/components/ApiExample.tsx +0 -9
- package/bin/mint/client/src/components/Card.tsx +0 -51
- package/bin/mint/client/src/components/CodeGroup.tsx +0 -132
- package/bin/mint/client/src/components/Editor.tsx +0 -12
- package/bin/mint/client/src/components/Expandable.tsx +0 -40
- package/bin/mint/client/src/components/Heading.tsx +0 -84
- package/bin/mint/client/src/components/Param.tsx +0 -56
- package/bin/mint/client/src/components/Request.tsx +0 -19
- package/bin/mint/client/src/components/ResponseField.tsx +0 -33
- package/bin/mint/client/src/components/TabBar.tsx +0 -61
- package/bin/mint/client/src/config.ts +0 -115
- package/bin/mint/client/src/css/bar-of-progress.css +0 -10
- package/bin/mint/client/src/css/base.css +0 -29
- package/bin/mint/client/src/css/font-awesome.css +0 -7
- package/bin/mint/client/src/css/fonts.css +0 -44
- package/bin/mint/client/src/css/main.css +0 -11
- package/bin/mint/client/src/css/prism.css +0 -270
- package/bin/mint/client/src/css/utilities.css +0 -43
- package/bin/mint/client/src/enums/components.ts +0 -8
- package/bin/mint/client/src/fonts/FiraCode-VF.woff +0 -0
- package/bin/mint/client/src/fonts/FiraCode-VF.woff2 +0 -0
- package/bin/mint/client/src/fonts/IBMPlexMono-Regular.ttf +0 -0
- package/bin/mint/client/src/fonts/IBMPlexMono-SemiBold.ttf +0 -0
- package/bin/mint/client/src/fonts/Inter-italic-latin.var.woff2 +0 -0
- package/bin/mint/client/src/fonts/Inter-roman-latin.var.woff2 +0 -0
- package/bin/mint/client/src/fonts/Pally-Variable.ttf +0 -0
- package/bin/mint/client/src/fonts/SourceSansPro-Regular.otf +0 -0
- package/bin/mint/client/src/fonts/SourceSerifPro-Regular.ttf +0 -0
- package/bin/mint/client/src/fonts/Synonym-Variable.ttf +0 -0
- package/bin/mint/client/src/fonts/Ubuntu-Mono-bold.woff2 +0 -0
- package/bin/mint/client/src/fonts/generated/IBMPlexMono-Regular-subset.woff2 +0 -0
- package/bin/mint/client/src/fonts/generated/IBMPlexMono-Regular-subset.zopfli.woff +0 -0
- package/bin/mint/client/src/fonts/generated/IBMPlexMono-Regular.module.css +0 -11
- package/bin/mint/client/src/fonts/generated/IBMPlexMono-SemiBold-subset.woff2 +0 -0
- package/bin/mint/client/src/fonts/generated/IBMPlexMono-SemiBold-subset.zopfli.woff +0 -0
- package/bin/mint/client/src/fonts/generated/IBMPlexMono-SemiBold.module.css +0 -11
- package/bin/mint/client/src/fonts/generated/Pally-Variable-subset.woff2 +0 -0
- package/bin/mint/client/src/fonts/generated/Pally-Variable-subset.zopfli.woff +0 -0
- package/bin/mint/client/src/fonts/generated/Pally-Variable.module.css +0 -11
- package/bin/mint/client/src/fonts/generated/SourceSerifPro-Regular-subset.woff2 +0 -0
- package/bin/mint/client/src/fonts/generated/SourceSerifPro-Regular-subset.zopfli.woff +0 -0
- package/bin/mint/client/src/fonts/generated/SourceSerifPro-Regular.module.css +0 -11
- package/bin/mint/client/src/fonts/generated/Synonym-Variable-subset.woff2 +0 -0
- package/bin/mint/client/src/fonts/generated/Synonym-Variable-subset.zopfli.woff +0 -0
- package/bin/mint/client/src/fonts/generated/Synonym-Variable.module.css +0 -11
- package/bin/mint/client/src/fonts/generated/TenorSans-Regular-subset.woff2 +0 -0
- package/bin/mint/client/src/fonts/generated/TenorSans-Regular-subset.zopfli.woff +0 -0
- package/bin/mint/client/src/fonts/generated/TenorSans-Regular.module.css +0 -11
- package/bin/mint/client/src/hooks/useActionKey.ts +0 -20
- package/bin/mint/client/src/hooks/useIsomorphicLayoutEffect.ts +0 -3
- package/bin/mint/client/src/hooks/useMedia.ts +0 -27
- package/bin/mint/client/src/hooks/usePrevNext.ts +0 -34
- package/bin/mint/client/src/hooks/useTop.ts +0 -15
- package/bin/mint/client/src/icons/CopyToClipboard.tsx +0 -33
- package/bin/mint/client/src/index.d.ts +0 -1
- package/bin/mint/client/src/layouts/ApiSupplemental.tsx +0 -173
- package/bin/mint/client/src/layouts/ContentsLayout.tsx +0 -256
- package/bin/mint/client/src/layouts/DocumentationLayout.tsx +0 -44
- package/bin/mint/client/src/layouts/OpenApiContent.tsx +0 -301
- package/bin/mint/client/src/layouts/SidebarLayout.tsx +0 -412
- package/bin/mint/client/src/layouts/UserFeedback.tsx +0 -73
- package/bin/mint/client/src/layouts/getGroupsInDivision.ts +0 -25
- package/bin/mint/client/src/layouts/isPathInGroupPages.ts +0 -10
- package/bin/mint/client/src/metadata.ts +0 -58
- package/bin/mint/client/src/nav.json +0 -219
- package/bin/mint/client/src/openapi.ts +0 -3
- package/bin/mint/client/src/pages/404.tsx +0 -73
- package/bin/mint/client/src/pages/_app.tsx +0 -138
- package/bin/mint/client/src/pages/_document.tsx +0 -57
- package/bin/mint/client/src/pages/api/issue.ts +0 -10
- package/bin/mint/client/src/pages/api/name.ts +0 -8
- package/bin/mint/client/src/pages/api/request.ts +0 -31
- package/bin/mint/client/src/pages/api/suggest.ts +0 -10
- package/bin/mint/client/src/pages/api/syntax-highlighted-json.ts +0 -13
- package/bin/mint/client/src/pages/api/utils.ts +0 -6
- package/bin/mint/client/src/pages/index.tsx +0 -31
- package/bin/mint/client/src/ui/Api.tsx +0 -359
- package/bin/mint/client/src/ui/Footer.tsx +0 -124
- package/bin/mint/client/src/ui/Header.tsx +0 -370
- package/bin/mint/client/src/ui/Logo.tsx +0 -55
- package/bin/mint/client/src/ui/PageHeader.tsx +0 -51
- package/bin/mint/client/src/ui/Search.tsx +0 -386
- package/bin/mint/client/src/ui/ThemeToggle.tsx +0 -285
- package/bin/mint/client/src/ui/Title.tsx +0 -22
- package/bin/mint/client/src/ui/TopLevelLink.tsx +0 -122
- package/bin/mint/client/src/utils/api.ts +0 -252
- package/bin/mint/client/src/utils/brands.ts +0 -217
- package/bin/mint/client/src/utils/castArray.ts +0 -3
- package/bin/mint/client/src/utils/childrenArray.ts +0 -3
- package/bin/mint/client/src/utils/fit.ts +0 -27
- package/bin/mint/client/src/utils/fontAwesome.ts +0 -577
- package/bin/mint/client/src/utils/getAnalyticsConfig.ts +0 -14
- package/bin/mint/client/src/utils/getLogoHref.ts +0 -9
- package/bin/mint/client/src/utils/getOpenApiContext.ts +0 -26
- package/bin/mint/client/src/utils/importAll.ts +0 -6
- package/bin/mint/client/src/utils/isObject.ts +0 -3
- package/bin/mint/client/src/utils/kebabToTitleCase.ts +0 -3
- package/bin/mint/client/src/utils/loadImage.ts +0 -8
- package/bin/mint/client/src/utils/slugToTitle.ts +0 -7
- package/bin/mint/client/src/utils/wait.ts +0 -5
- package/bin/mint/client/tailwind.config.cjs +0 -323
- package/bin/mint/client/test/test.test.ts +0 -5
- package/bin/mint/client/tsconfig.json +0 -36
- package/bin/mint/client/yarn.lock +0 -9702
- package/bin/scraping/site-scrapers/getLinksRecursively.js +0 -38
- package/bin/scraping/site-scrapers/getLinksRecursively.js.map +0 -1
- package/src/init-command/index.ts +0 -59
- package/src/init-command/templates.ts +0 -52
- package/src/local-preview/utils/categorizeFiles.ts +0 -82
- package/src/local-preview/utils/injectFavicons.ts +0 -76
- package/src/local-preview/utils/listener.ts +0 -124
- package/src/local-preview/utils/metadata.ts +0 -151
- package/src/local-preview/utils/mintConfigFile.ts +0 -48
- package/src/local-preview/utils/openApiCheck.ts +0 -18
- package/src/local-preview/utils/slugToTitle.ts +0 -7
|
@@ -1,370 +0,0 @@
|
|
|
1
|
-
import { brands, regular } from '@fortawesome/fontawesome-svg-core/import.macro';
|
|
2
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
|
-
import { Dialog } from '@headlessui/react';
|
|
4
|
-
import axios from 'axios';
|
|
5
|
-
import clsx from 'clsx';
|
|
6
|
-
import gh from 'github-url-to-object';
|
|
7
|
-
import Link from 'next/link';
|
|
8
|
-
import Router from 'next/router';
|
|
9
|
-
import { useEffect, useState } from 'react';
|
|
10
|
-
|
|
11
|
-
import { Logo } from '@/ui/Logo';
|
|
12
|
-
import { SearchButton } from '@/ui/Search';
|
|
13
|
-
import getLogoHref from '@/utils/getLogoHref';
|
|
14
|
-
|
|
15
|
-
import { config, TopbarCta } from '../config';
|
|
16
|
-
import { ThemeSelect, ThemeToggle } from './ThemeToggle';
|
|
17
|
-
|
|
18
|
-
export function NavPopover({
|
|
19
|
-
display = 'md:hidden',
|
|
20
|
-
className,
|
|
21
|
-
...props
|
|
22
|
-
}: {
|
|
23
|
-
display: string;
|
|
24
|
-
className: string;
|
|
25
|
-
}) {
|
|
26
|
-
let [isOpen, setIsOpen] = useState(false);
|
|
27
|
-
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
if (!isOpen) return;
|
|
30
|
-
function handleRouteChange() {
|
|
31
|
-
setIsOpen(false);
|
|
32
|
-
}
|
|
33
|
-
Router.events.on('routeChangeComplete', handleRouteChange);
|
|
34
|
-
return () => {
|
|
35
|
-
Router.events.off('routeChangeComplete', handleRouteChange);
|
|
36
|
-
};
|
|
37
|
-
}, [isOpen]);
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<div className={clsx(className, display)} {...props}>
|
|
41
|
-
<button
|
|
42
|
-
type="button"
|
|
43
|
-
className="text-slate-500 w-8 h-8 flex items-center justify-center hover:text-slate-600 dark:text-slate-400 dark:hover:text-slate-300"
|
|
44
|
-
onClick={() => setIsOpen(true)}
|
|
45
|
-
>
|
|
46
|
-
<span className="sr-only">Navigation</span>
|
|
47
|
-
<svg width="24" height="24" fill="none" aria-hidden="true">
|
|
48
|
-
<path
|
|
49
|
-
d="M12 6v.01M12 12v.01M12 18v.01M12 7a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"
|
|
50
|
-
stroke="currentColor"
|
|
51
|
-
strokeWidth="1.5"
|
|
52
|
-
strokeLinecap="round"
|
|
53
|
-
strokeLinejoin="round"
|
|
54
|
-
/>
|
|
55
|
-
</svg>
|
|
56
|
-
</button>
|
|
57
|
-
<Dialog
|
|
58
|
-
as="div"
|
|
59
|
-
className={clsx('fixed z-50 inset-0', display)}
|
|
60
|
-
open={isOpen}
|
|
61
|
-
onClose={setIsOpen}
|
|
62
|
-
>
|
|
63
|
-
<Dialog.Overlay className="fixed inset-0 bg-black/20 backdrop-blur-sm dark:bg-slate-900/80" />
|
|
64
|
-
<div className="fixed top-4 right-4 w-full max-w-xs bg-white rounded-lg shadow-lg p-6 text-base font-semibold text-slate-900 dark:bg-slate-800 dark:text-slate-400 dark:highlight-white/5">
|
|
65
|
-
<button
|
|
66
|
-
type="button"
|
|
67
|
-
className="absolute top-5 right-5 w-8 h-8 flex items-center justify-center text-slate-500 hover:text-slate-600 dark:text-slate-400 dark:hover:text-slate-300"
|
|
68
|
-
onClick={() => setIsOpen(false)}
|
|
69
|
-
>
|
|
70
|
-
<span className="sr-only">Close navigation</span>
|
|
71
|
-
<svg viewBox="0 0 10 10" className="w-2.5 h-2.5 overflow-visible" aria-hidden="true">
|
|
72
|
-
<path
|
|
73
|
-
d="M0 0L10 10M10 0L0 10"
|
|
74
|
-
fill="none"
|
|
75
|
-
stroke="currentColor"
|
|
76
|
-
strokeWidth="2"
|
|
77
|
-
strokeLinecap="round"
|
|
78
|
-
/>
|
|
79
|
-
</svg>
|
|
80
|
-
</button>
|
|
81
|
-
<ul className="space-y-6">
|
|
82
|
-
<NavItems />
|
|
83
|
-
</ul>
|
|
84
|
-
<div className="mt-6 pt-6 border-t border-slate-200 dark:border-slate-200/10">
|
|
85
|
-
<ThemeSelect />
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
</Dialog>
|
|
89
|
-
</div>
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function GitHubCta({ button }: { button: TopbarCta }) {
|
|
94
|
-
const [repoData, setRepoData] = useState<{ stargazers_count: number; forks_count: number }>();
|
|
95
|
-
|
|
96
|
-
const github = gh(button.url);
|
|
97
|
-
|
|
98
|
-
useEffect(() => {
|
|
99
|
-
if (github == null) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
axios.get(`https://api.github.com/repos/${github.user}/${github.repo}`).then(({ data }) => {
|
|
104
|
-
setRepoData(data);
|
|
105
|
-
});
|
|
106
|
-
}, [github]);
|
|
107
|
-
|
|
108
|
-
if (github == null) {
|
|
109
|
-
return null;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return (
|
|
113
|
-
<li className="cursor-pointer">
|
|
114
|
-
<Link href={button.url}>
|
|
115
|
-
<div className="group flex items-center space-x-3">
|
|
116
|
-
<FontAwesomeIcon className="h-6 w-6" icon={brands('github-square')} />
|
|
117
|
-
<div className="font-normal">
|
|
118
|
-
<div className="text-sm font-medium text-slate-700 group-hover:text-slate-900 dark:text-slate-300 dark:group-hover:text-slate-200">
|
|
119
|
-
{github.user}/{github.repo}
|
|
120
|
-
</div>
|
|
121
|
-
{repoData ? (
|
|
122
|
-
<div className="text-xs flex items-center space-x-2 text-slate-600 dark:text-slate-400 group-hover:text-slate-700 dark:group-hover:text-slate-300">
|
|
123
|
-
<span className="flex items-center space-x-1">
|
|
124
|
-
<FontAwesomeIcon className="h-3 w-3" icon={regular('star')} />
|
|
125
|
-
<span>{repoData.stargazers_count}</span>
|
|
126
|
-
</span>
|
|
127
|
-
<span className="flex items-center space-x-1">
|
|
128
|
-
<FontAwesomeIcon className="h-3 w-3" icon={regular('code-fork')} />
|
|
129
|
-
<span>{repoData.forks_count}</span>
|
|
130
|
-
</span>
|
|
131
|
-
</div>
|
|
132
|
-
) : (
|
|
133
|
-
<div className="h-4" />
|
|
134
|
-
)}
|
|
135
|
-
</div>
|
|
136
|
-
</div>
|
|
137
|
-
</Link>
|
|
138
|
-
</li>
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function TopBarCtaButton({ button }: { button: TopbarCta }) {
|
|
143
|
-
if (button.type === 'github') {
|
|
144
|
-
return <GitHubCta button={button} />;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return (
|
|
148
|
-
<li>
|
|
149
|
-
<Link href={button.url}>
|
|
150
|
-
<a
|
|
151
|
-
target="_blank"
|
|
152
|
-
className={clsx(
|
|
153
|
-
config.classes?.topbarCtaButton ||
|
|
154
|
-
'relative inline-flex items-center space-x-1 px-4 py-1 border border-transparent shadow-sm text-sm font-medium rounded-[0.3rem] text-white bg-primary-dark hover:bg-primary-ultradark focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-primary-light'
|
|
155
|
-
)}
|
|
156
|
-
>
|
|
157
|
-
<span>{button.name}</span>
|
|
158
|
-
{!config.classes?.topbarCtaButton && (
|
|
159
|
-
<svg
|
|
160
|
-
className="h-2.5 text-white"
|
|
161
|
-
fill="currentColor"
|
|
162
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
163
|
-
viewBox="0 0 320 512"
|
|
164
|
-
>
|
|
165
|
-
<path d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z" />
|
|
166
|
-
</svg>
|
|
167
|
-
)}
|
|
168
|
-
</a>
|
|
169
|
-
</Link>
|
|
170
|
-
</li>
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export function NavItems() {
|
|
175
|
-
return (
|
|
176
|
-
<>
|
|
177
|
-
{config?.topbarLinks?.map((topbarLink) => (
|
|
178
|
-
<li key={topbarLink.name}>
|
|
179
|
-
<Link href={topbarLink.url}>
|
|
180
|
-
<a className="font-medium hover:text-primary dark:hover:text-primary-light">
|
|
181
|
-
{topbarLink.name}
|
|
182
|
-
</a>
|
|
183
|
-
</Link>
|
|
184
|
-
</li>
|
|
185
|
-
))}
|
|
186
|
-
{config?.topbarCtaButton && <TopBarCtaButton button={config.topbarCtaButton} />}
|
|
187
|
-
</>
|
|
188
|
-
);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export function Header({
|
|
192
|
-
hasNav = false,
|
|
193
|
-
navIsOpen,
|
|
194
|
-
onNavToggle,
|
|
195
|
-
title,
|
|
196
|
-
section,
|
|
197
|
-
}: {
|
|
198
|
-
hasNav: boolean;
|
|
199
|
-
navIsOpen: boolean;
|
|
200
|
-
onNavToggle: (toggle: boolean) => void;
|
|
201
|
-
title?: string;
|
|
202
|
-
section?: string;
|
|
203
|
-
}) {
|
|
204
|
-
let [isOpaque, setIsOpaque] = useState(false);
|
|
205
|
-
|
|
206
|
-
useEffect(() => {
|
|
207
|
-
let offset = 50;
|
|
208
|
-
function onScroll() {
|
|
209
|
-
if (!isOpaque && window.scrollY > offset) {
|
|
210
|
-
setIsOpaque(true);
|
|
211
|
-
} else if (isOpaque && window.scrollY <= offset) {
|
|
212
|
-
setIsOpaque(false);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
onScroll();
|
|
216
|
-
window.addEventListener('scroll', onScroll, { passive: true });
|
|
217
|
-
return () => {
|
|
218
|
-
window.removeEventListener('scroll', onScroll);
|
|
219
|
-
};
|
|
220
|
-
}, [isOpaque]);
|
|
221
|
-
|
|
222
|
-
return (
|
|
223
|
-
<>
|
|
224
|
-
<div
|
|
225
|
-
className={clsx(
|
|
226
|
-
'sticky top-0 w-full backdrop-blur flex-none transition-colors z-40 duration-500 lg:border-b lg:border-slate-900/5 dark:border-slate-50/[0.06] lg:z-50',
|
|
227
|
-
isOpaque
|
|
228
|
-
? 'bg-background-light/90 supports-backdrop-blur:bg-background-light/90 dark:bg-background-dark/75'
|
|
229
|
-
: 'bg-transparent dark:bg-transparent'
|
|
230
|
-
)}
|
|
231
|
-
>
|
|
232
|
-
<div className="max-w-8xl mx-auto">
|
|
233
|
-
<div
|
|
234
|
-
className={clsx(
|
|
235
|
-
'py-4 border-b border-slate-900/10 lg:px-8 lg:border-0 dark:border-slate-300/10',
|
|
236
|
-
hasNav ? 'mx-4 lg:mx-0' : 'px-4'
|
|
237
|
-
)}
|
|
238
|
-
>
|
|
239
|
-
<div className="relative flex items-center">
|
|
240
|
-
<div className="flex-1">
|
|
241
|
-
<Link href={getLogoHref(config)}>
|
|
242
|
-
<a
|
|
243
|
-
onContextMenu={(e) => {
|
|
244
|
-
e.preventDefault();
|
|
245
|
-
Router.push(getLogoHref(config));
|
|
246
|
-
}}
|
|
247
|
-
>
|
|
248
|
-
<span className="sr-only">{config.name} home page</span>
|
|
249
|
-
<Logo />
|
|
250
|
-
</a>
|
|
251
|
-
</Link>
|
|
252
|
-
</div>
|
|
253
|
-
<div className="relative flex-none bg-white lg:w-64 xl:w-80 dark:bg-slate-900 pointer-events-auto rounded-md">
|
|
254
|
-
<SearchButton className="hidden w-full lg:flex items-center text-sm leading-6 text-slate-400 rounded-md ring-1 ring-slate-500/10 shadow-sm py-1.5 pl-2 pr-3 bg-slate-50 hover:ring-slate-900/20 dark:bg-slate-800 dark:highlight-white/5 dark:hover:bg-slate-700">
|
|
255
|
-
{({ actionKey }: any) => (
|
|
256
|
-
<>
|
|
257
|
-
<svg
|
|
258
|
-
width="24"
|
|
259
|
-
height="24"
|
|
260
|
-
fill="none"
|
|
261
|
-
aria-hidden="true"
|
|
262
|
-
className="mr-3 flex-none"
|
|
263
|
-
>
|
|
264
|
-
<path
|
|
265
|
-
d="m19 19-3.5-3.5"
|
|
266
|
-
stroke="currentColor"
|
|
267
|
-
strokeWidth="2"
|
|
268
|
-
strokeLinecap="round"
|
|
269
|
-
strokeLinejoin="round"
|
|
270
|
-
/>
|
|
271
|
-
<circle
|
|
272
|
-
cx="11"
|
|
273
|
-
cy="11"
|
|
274
|
-
r="6"
|
|
275
|
-
stroke="currentColor"
|
|
276
|
-
strokeWidth="2"
|
|
277
|
-
strokeLinecap="round"
|
|
278
|
-
strokeLinejoin="round"
|
|
279
|
-
/>
|
|
280
|
-
</svg>
|
|
281
|
-
Search...
|
|
282
|
-
{actionKey && (
|
|
283
|
-
<span className="ml-auto flex-none text-xs font-semibold">
|
|
284
|
-
{actionKey[0]}K
|
|
285
|
-
</span>
|
|
286
|
-
)}
|
|
287
|
-
</>
|
|
288
|
-
)}
|
|
289
|
-
</SearchButton>
|
|
290
|
-
</div>
|
|
291
|
-
<div className="flex-1 relative hidden lg:flex items-center ml-auto justify-end">
|
|
292
|
-
<nav className="text-sm leading-6 font-semibold text-slate-700 dark:text-slate-200">
|
|
293
|
-
<ul className="flex space-x-8 items-center">
|
|
294
|
-
<NavItems />
|
|
295
|
-
</ul>
|
|
296
|
-
</nav>
|
|
297
|
-
<div className="flex items-center border-l border-slate-100 ml-6 pl-6 dark:border-slate-800">
|
|
298
|
-
<ThemeToggle panelClassName="mt-8" />
|
|
299
|
-
</div>
|
|
300
|
-
</div>
|
|
301
|
-
<SearchButton className="ml-auto text-slate-500 w-8 h-8 -my-1 flex items-center justify-center hover:text-slate-600 lg:hidden dark:text-slate-400 dark:hover:text-slate-300">
|
|
302
|
-
<span className="sr-only">Search</span>
|
|
303
|
-
<svg
|
|
304
|
-
width="24"
|
|
305
|
-
height="24"
|
|
306
|
-
fill="none"
|
|
307
|
-
stroke="currentColor"
|
|
308
|
-
strokeWidth="2"
|
|
309
|
-
strokeLinecap="round"
|
|
310
|
-
strokeLinejoin="round"
|
|
311
|
-
aria-hidden="true"
|
|
312
|
-
>
|
|
313
|
-
<path d="m19 19-3.5-3.5" />
|
|
314
|
-
<circle cx="11" cy="11" r="6" />
|
|
315
|
-
</svg>
|
|
316
|
-
</SearchButton>
|
|
317
|
-
<NavPopover className="ml-2 -my-1" display="lg:hidden" />
|
|
318
|
-
</div>
|
|
319
|
-
</div>
|
|
320
|
-
{hasNav && (
|
|
321
|
-
<div className="flex items-center p-4 border-b border-slate-900/10 lg:hidden dark:border-slate-50/[0.06]">
|
|
322
|
-
<button
|
|
323
|
-
type="button"
|
|
324
|
-
onClick={() => onNavToggle(!navIsOpen)}
|
|
325
|
-
className="text-slate-500 hover:text-slate-600 dark:text-slate-400 dark:hover:text-slate-300"
|
|
326
|
-
>
|
|
327
|
-
<span className="sr-only">Navigation</span>
|
|
328
|
-
<svg width="24" height="24">
|
|
329
|
-
<path
|
|
330
|
-
d="M5 6h14M5 12h14M5 18h14"
|
|
331
|
-
fill="none"
|
|
332
|
-
stroke="currentColor"
|
|
333
|
-
strokeWidth="2"
|
|
334
|
-
strokeLinecap="round"
|
|
335
|
-
/>
|
|
336
|
-
</svg>
|
|
337
|
-
</button>
|
|
338
|
-
{title && (
|
|
339
|
-
<ol className="ml-4 flex text-sm leading-6 whitespace-nowrap min-w-0">
|
|
340
|
-
{section && (
|
|
341
|
-
<li className="flex items-center">
|
|
342
|
-
{section}
|
|
343
|
-
<svg
|
|
344
|
-
width="3"
|
|
345
|
-
height="6"
|
|
346
|
-
aria-hidden="true"
|
|
347
|
-
className="mx-3 overflow-visible text-slate-400"
|
|
348
|
-
>
|
|
349
|
-
<path
|
|
350
|
-
d="M0 0L3 3L0 6"
|
|
351
|
-
fill="none"
|
|
352
|
-
stroke="currentColor"
|
|
353
|
-
strokeWidth="1.5"
|
|
354
|
-
strokeLinecap="round"
|
|
355
|
-
/>
|
|
356
|
-
</svg>
|
|
357
|
-
</li>
|
|
358
|
-
)}
|
|
359
|
-
<li className="font-semibold text-slate-900 truncate dark:text-slate-200">
|
|
360
|
-
{title}
|
|
361
|
-
</li>
|
|
362
|
-
</ol>
|
|
363
|
-
)}
|
|
364
|
-
</div>
|
|
365
|
-
)}
|
|
366
|
-
</div>
|
|
367
|
-
</div>
|
|
368
|
-
</>
|
|
369
|
-
);
|
|
370
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import clsx from 'clsx';
|
|
2
|
-
import Image from 'next/image';
|
|
3
|
-
|
|
4
|
-
import { config } from '@/config';
|
|
5
|
-
|
|
6
|
-
export function Logo() {
|
|
7
|
-
const className = clsx('w-auto h-7 relative', config.classes?.logo);
|
|
8
|
-
if (typeof config.logo === 'object' && config.logo !== null) {
|
|
9
|
-
return (
|
|
10
|
-
<>
|
|
11
|
-
<div className={clsx(className, 'block dark:hidden')}>
|
|
12
|
-
<Image
|
|
13
|
-
src={config?.logo.light}
|
|
14
|
-
alt="light logo"
|
|
15
|
-
layout="fill"
|
|
16
|
-
objectFit="contain"
|
|
17
|
-
objectPosition="left"
|
|
18
|
-
/>
|
|
19
|
-
</div>
|
|
20
|
-
<div className={clsx(className, 'hidden dark:block')}>
|
|
21
|
-
<Image
|
|
22
|
-
src={config?.logo.dark}
|
|
23
|
-
alt="dark logo"
|
|
24
|
-
layout="fill"
|
|
25
|
-
objectFit="contain"
|
|
26
|
-
objectPosition="left"
|
|
27
|
-
/>
|
|
28
|
-
</div>
|
|
29
|
-
</>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
if (config?.logo) {
|
|
33
|
-
return (
|
|
34
|
-
<div className={clsx(className)}>
|
|
35
|
-
<Image
|
|
36
|
-
src={config?.logo}
|
|
37
|
-
alt="logo"
|
|
38
|
-
layout="fill"
|
|
39
|
-
objectFit="contain"
|
|
40
|
-
objectPosition="left"
|
|
41
|
-
/>
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
if (config?.name) {
|
|
46
|
-
return (
|
|
47
|
-
<div
|
|
48
|
-
className={`inline-block text-2xl sm:text-3xl font-extrabold text-slate-900 tracking-tight dark:text-slate-200 ${className}`}
|
|
49
|
-
>
|
|
50
|
-
{config?.name}
|
|
51
|
-
</div>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
return <></>;
|
|
55
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { UserFeedback } from '@/layouts/UserFeedback';
|
|
2
|
-
import { Api, ApiComponent } from '@/ui/Api';
|
|
3
|
-
|
|
4
|
-
type PageHeaderProps = {
|
|
5
|
-
title?: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
api?: string;
|
|
8
|
-
openapi?: string;
|
|
9
|
-
auth?: string;
|
|
10
|
-
section: string;
|
|
11
|
-
children: any;
|
|
12
|
-
apiComponents: ApiComponent[];
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export function PageHeader({
|
|
16
|
-
title,
|
|
17
|
-
description,
|
|
18
|
-
section,
|
|
19
|
-
api,
|
|
20
|
-
auth,
|
|
21
|
-
children,
|
|
22
|
-
apiComponents,
|
|
23
|
-
}: PageHeaderProps) {
|
|
24
|
-
if (!title && !description) return null;
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<header id="header" className="relative z-20">
|
|
28
|
-
<div>
|
|
29
|
-
<div className="flex">
|
|
30
|
-
<div className="flex-1">
|
|
31
|
-
{section && (
|
|
32
|
-
<p className="mb-2 text-sm leading-6 font-semibold text-primary dark:text-primary-light">
|
|
33
|
-
{section}
|
|
34
|
-
</p>
|
|
35
|
-
)}
|
|
36
|
-
</div>
|
|
37
|
-
<UserFeedback title="" />
|
|
38
|
-
</div>
|
|
39
|
-
<div className="flex items-center">
|
|
40
|
-
<h1 className="inline-block text-2xl sm:text-3xl font-extrabold text-slate-900 tracking-tight dark:text-slate-200">
|
|
41
|
-
{title}
|
|
42
|
-
</h1>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
{description && (
|
|
46
|
-
<p className="mt-2 text-lg text-slate-700 dark:text-slate-400">{description}</p>
|
|
47
|
-
)}
|
|
48
|
-
{api && <Api api={api} children={children} auth={auth} apiComponents={apiComponents} />}
|
|
49
|
-
</header>
|
|
50
|
-
);
|
|
51
|
-
}
|