@umijs/plugin-docs 4.0.0-beta.18 → 4.0.0-rc.3
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/client/theme-blog/index.ts +1 -0
- package/client/theme-doc/Github.tsx +18 -0
- package/client/theme-doc/Head.tsx +72 -0
- package/client/theme-doc/LangSwitch.tsx +55 -0
- package/client/theme-doc/Layout.tsx +116 -0
- package/client/theme-doc/Logo.tsx +18 -0
- package/client/theme-doc/NavBar.tsx +27 -0
- package/client/theme-doc/Search.tsx +178 -0
- package/client/theme-doc/Sidebar.tsx +84 -0
- package/client/theme-doc/ThemeSwitch.tsx +60 -0
- package/client/theme-doc/Tip.tsx +5 -0
- package/client/theme-doc/Toc.tsx +63 -0
- package/client/theme-doc/VersionSwitch.tsx +5 -0
- package/client/theme-doc/components/Announcement.tsx +62 -0
- package/client/theme-doc/components/FeatureItem.tsx +48 -0
- package/client/theme-doc/components/Features.tsx +44 -0
- package/client/theme-doc/components/Hero.tsx +152 -0
- package/client/theme-doc/components/Message.tsx +57 -0
- package/client/theme-doc/context.ts +40 -0
- package/client/theme-doc/firefox-polyfill.css +31 -0
- package/client/theme-doc/icons/github.svg +1 -0
- package/client/theme-doc/icons/hero-bg.svg +1 -0
- package/client/theme-doc/icons/moon.png +0 -0
- package/client/theme-doc/icons/star.png +0 -0
- package/client/theme-doc/icons/sun.png +0 -0
- package/client/theme-doc/icons/umi.png +0 -0
- package/client/theme-doc/index.ts +8 -0
- package/client/theme-doc/tailwind.css +153 -0
- package/client/theme-doc/tailwind.out.css +2031 -0
- package/client/theme-doc/useLanguage.ts +69 -0
- package/dist/compiler.d.ts +1 -1
- package/dist/compiler.js +22 -11
- package/dist/index.js +18 -3
- package/package.json +23 -8
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Helmet } from 'react-helmet';
|
|
3
|
+
import { useThemeContext } from './context';
|
|
4
|
+
import useLanguage from './useLanguage';
|
|
5
|
+
|
|
6
|
+
function getLinkFromTitle(title: string) {
|
|
7
|
+
return title
|
|
8
|
+
.toLowerCase()
|
|
9
|
+
.replace(/\s/g, '-')
|
|
10
|
+
.replace(/[()]/g, '');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default () => {
|
|
14
|
+
const { location, appData, themeConfig } = useThemeContext()!;
|
|
15
|
+
const lang = useLanguage();
|
|
16
|
+
const route =
|
|
17
|
+
appData.routes[
|
|
18
|
+
lang.isFromPath
|
|
19
|
+
? location.pathname.split('/').slice(2).join('/') +
|
|
20
|
+
'.' +
|
|
21
|
+
lang.currentLanguage?.locale
|
|
22
|
+
: location.pathname.slice(1)
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
if (!route) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const titles = route.titles.filter((t: any) => t.level > 1);
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
className="w-full lg:m-12 mb-12 border
|
|
33
|
+
border-gray-100 p-8 rounded-xl z-20"
|
|
34
|
+
>
|
|
35
|
+
<Helmet>
|
|
36
|
+
<title>
|
|
37
|
+
{route.titles[0].title} | {themeConfig.title}
|
|
38
|
+
</title>
|
|
39
|
+
</Helmet>
|
|
40
|
+
<p className="text-lg font-extrabold dark:text-white">
|
|
41
|
+
{route.titles[0].title}
|
|
42
|
+
</p>
|
|
43
|
+
<ul className="max-h-[calc(100vh-360px)] overflow-y-scroll py-2">
|
|
44
|
+
{titles.map((item: any) => {
|
|
45
|
+
return (
|
|
46
|
+
<li
|
|
47
|
+
style={{ paddingLeft: `${item.level - 2}rem` }}
|
|
48
|
+
className="mt-3 text-gray-600 cursor-pointer dark:text-gray-400
|
|
49
|
+
hover:text-blue-500 transition duration-300 dark:hover:text-blue-500"
|
|
50
|
+
>
|
|
51
|
+
<a
|
|
52
|
+
className={item.level > 2 ? 'text-sm' : ''}
|
|
53
|
+
href={'#' + getLinkFromTitle(item.title)}
|
|
54
|
+
>
|
|
55
|
+
{item.title}
|
|
56
|
+
</a>
|
|
57
|
+
</li>
|
|
58
|
+
);
|
|
59
|
+
})}
|
|
60
|
+
</ul>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import { useThemeContext } from '../context';
|
|
4
|
+
|
|
5
|
+
function Announcement() {
|
|
6
|
+
const { themeConfig } = useThemeContext()!;
|
|
7
|
+
|
|
8
|
+
if (!themeConfig.announcement) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const [closed, setClosed] = useState(false);
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (!themeConfig.announcement) return;
|
|
16
|
+
const item = localStorage.getItem('closed_announcements');
|
|
17
|
+
const closed: string[] = item ? JSON.parse(item) : [];
|
|
18
|
+
if (closed.includes(themeConfig.announcement.title)) {
|
|
19
|
+
setClosed(true);
|
|
20
|
+
}
|
|
21
|
+
}, []);
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
document.documentElement.style.setProperty(
|
|
25
|
+
'--anchor-offset',
|
|
26
|
+
(closed ? 0 : 28) + 'px',
|
|
27
|
+
);
|
|
28
|
+
}, [closed]);
|
|
29
|
+
|
|
30
|
+
function close(e: React.MouseEvent) {
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
if (!themeConfig.announcement) return;
|
|
33
|
+
const item = localStorage.getItem('closed_announcements');
|
|
34
|
+
const closed: string[] = item ? JSON.parse(item) : [];
|
|
35
|
+
closed.push(themeConfig.announcement.title);
|
|
36
|
+
localStorage.setItem('closed_announcements', JSON.stringify(closed));
|
|
37
|
+
setClosed(true);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (closed) return null;
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div className="w-full py-1 bg-blue-200 dark:bg-blue-900 animate-pulse">
|
|
44
|
+
<p
|
|
45
|
+
className={cx(
|
|
46
|
+
'text-center dark:text-white text-sm font-bold ',
|
|
47
|
+
themeConfig.announcement.link && 'cursor-pointer',
|
|
48
|
+
)}
|
|
49
|
+
onClick={() => {
|
|
50
|
+
window.open(themeConfig.announcement?.link, '_blank');
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
{themeConfig.announcement.title}
|
|
54
|
+
</p>
|
|
55
|
+
<button className="absolute right-2 top-0 px-8" onClick={close}>
|
|
56
|
+
x
|
|
57
|
+
</button>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export default Announcement;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface Feature {
|
|
4
|
+
icon: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
link?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Feature Item 组件是文档首页第二个 Feature 区块中的一个 Item,
|
|
12
|
+
* 从 docs/README.md 中使用 MDX 语法调用,必须被包含在 <Features /> 组件内
|
|
13
|
+
* */
|
|
14
|
+
function FeatureItem(props: Feature) {
|
|
15
|
+
return (
|
|
16
|
+
<div className="w-full md:w-1/2 lg:w-1/3 flex flex-row items-center justify-center mb-8 lg:mb-16">
|
|
17
|
+
<div
|
|
18
|
+
className="flex flex-col w-5/6 lg:w-3/4 items-center
|
|
19
|
+
bg-white dark:bg-gray-800 py-12 px-6 justify-center
|
|
20
|
+
border-gray-300 dark:border-gray-500 border transition-all hover:scale-105
|
|
21
|
+
rounded-xl shadow-lg hover:shadow-2xl h-72 lg:h-96 dark:shadow-gray-700"
|
|
22
|
+
>
|
|
23
|
+
<img src={props.icon} className="w-8 h-8" alt="feature-icon" />
|
|
24
|
+
<p
|
|
25
|
+
className="text-3xl font-extrabold
|
|
26
|
+
mt-4 mb-8 text-gray-900 dark:text-gray-200"
|
|
27
|
+
>
|
|
28
|
+
{props.title}
|
|
29
|
+
</p>
|
|
30
|
+
<p className="text-center text-gray-600 text-sm lg:text-base dark:text-gray-400">
|
|
31
|
+
{props.description}
|
|
32
|
+
</p>
|
|
33
|
+
{props.link && (
|
|
34
|
+
<a
|
|
35
|
+
href={props.link}
|
|
36
|
+
target="_blank"
|
|
37
|
+
rel="noreferrer"
|
|
38
|
+
className="mt-8 link-with-underline"
|
|
39
|
+
>
|
|
40
|
+
深入了解
|
|
41
|
+
</a>
|
|
42
|
+
)}
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default FeatureItem;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Features 组件是文档首页第二个 Feature 区块的容器,
|
|
5
|
+
* 从 docs/README.md 中使用 MDX 语法调用,可在内部传入 <FeatureItem /> 组件
|
|
6
|
+
* */
|
|
7
|
+
function Features(
|
|
8
|
+
props: PropsWithChildren<{ title?: string; subtitle?: string }>,
|
|
9
|
+
) {
|
|
10
|
+
return (
|
|
11
|
+
<div className="w-screen py-36 features dark:features-dark min-h-screen">
|
|
12
|
+
{(props.title || props.subtitle) && (
|
|
13
|
+
<div className="mb-24 px-4">
|
|
14
|
+
{props.title && (
|
|
15
|
+
<p
|
|
16
|
+
className="text-4xl lg:text-5xl font-extrabold mb-4 text-center
|
|
17
|
+
text-gray-700 dark:text-gray-300"
|
|
18
|
+
>
|
|
19
|
+
{props.title}
|
|
20
|
+
</p>
|
|
21
|
+
)}
|
|
22
|
+
{props.subtitle && (
|
|
23
|
+
<p
|
|
24
|
+
className="text-lg lg:text-xl text-center
|
|
25
|
+
text-gray-500 dark:text-gray-400"
|
|
26
|
+
>
|
|
27
|
+
{props.subtitle}
|
|
28
|
+
</p>
|
|
29
|
+
)}
|
|
30
|
+
</div>
|
|
31
|
+
)}
|
|
32
|
+
<div className="w-full flex flex-row justify-center">
|
|
33
|
+
<div
|
|
34
|
+
className="w-full flex flex-row flex-wrap
|
|
35
|
+
features pb-12 dark:features-dark container"
|
|
36
|
+
>
|
|
37
|
+
{props.children}
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export default Features;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import cx from 'classnames';
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import { useThemeContext } from '../context';
|
|
4
|
+
import Github from '../icons/github.svg';
|
|
5
|
+
import HeroBackground from '../icons/hero-bg.svg';
|
|
6
|
+
import Star from '../icons/star.png';
|
|
7
|
+
|
|
8
|
+
interface HeroProps {
|
|
9
|
+
title?: string | string[];
|
|
10
|
+
description?: string;
|
|
11
|
+
githubRepo?: string;
|
|
12
|
+
buttons?: {
|
|
13
|
+
label: string;
|
|
14
|
+
href: string;
|
|
15
|
+
}[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function Hero(props: HeroProps) {
|
|
19
|
+
const { components } = useThemeContext()!;
|
|
20
|
+
return (
|
|
21
|
+
<div
|
|
22
|
+
className="w-full h-[calc(100vh-60px)] bg-[rgb(16,37,62)] flex
|
|
23
|
+
flex-row items-center justify-center overflow-hidden"
|
|
24
|
+
>
|
|
25
|
+
<img
|
|
26
|
+
src={HeroBackground}
|
|
27
|
+
className="w-full h-full absolute top-0 left-0
|
|
28
|
+
z-10 object-cover blur-xl"
|
|
29
|
+
alt=""
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
<div className="px-8 container lg:px-32 xl:px-64 z-20">
|
|
33
|
+
<div className="flex flex-col items-center">
|
|
34
|
+
{typeof props.title === 'string' && (
|
|
35
|
+
<h1 className="text-white text-xl lg:text-7xl font-extrabold text-center">
|
|
36
|
+
{props.title}
|
|
37
|
+
</h1>
|
|
38
|
+
)}
|
|
39
|
+
|
|
40
|
+
{props.title instanceof Array &&
|
|
41
|
+
props.title.map((t, i) => (
|
|
42
|
+
<h1
|
|
43
|
+
className="text-white text-xl lg:text-7xl
|
|
44
|
+
font-extrabold text-center"
|
|
45
|
+
key={i}
|
|
46
|
+
>
|
|
47
|
+
{t}
|
|
48
|
+
</h1>
|
|
49
|
+
))}
|
|
50
|
+
|
|
51
|
+
{!props.title && <DefaultTitle />}
|
|
52
|
+
|
|
53
|
+
<p
|
|
54
|
+
className="text-white text-center my-12
|
|
55
|
+
opacity-70 text-lg text-center"
|
|
56
|
+
>
|
|
57
|
+
{props.description}
|
|
58
|
+
</p>
|
|
59
|
+
|
|
60
|
+
<div className="flex flex-row items-center">
|
|
61
|
+
{props.buttons?.map((button, i) => (
|
|
62
|
+
<components.Link to={button.href}>
|
|
63
|
+
<button
|
|
64
|
+
key={i}
|
|
65
|
+
className="text-white text-lg bg-blue-600 py-2 min-w-36 mx-4 px-4 rounded-xl shadow-xl
|
|
66
|
+
shadow-blue-900 hover:shadow-blue-700 transition-all"
|
|
67
|
+
>
|
|
68
|
+
{button.label}
|
|
69
|
+
</button>
|
|
70
|
+
</components.Link>
|
|
71
|
+
))}
|
|
72
|
+
|
|
73
|
+
{props.githubRepo && <GithubStars repo={props.githubRepo} />}
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function DefaultTitle() {
|
|
82
|
+
const [isPlugged, setPlugged] = useState(false);
|
|
83
|
+
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
setTimeout(() => {
|
|
86
|
+
setPlugged(true);
|
|
87
|
+
}, 100);
|
|
88
|
+
}, []);
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<>
|
|
92
|
+
<div className="flex flex-row mb-4">
|
|
93
|
+
<h1
|
|
94
|
+
className="text-white text-5xl lg:text-7xl
|
|
95
|
+
font-extrabold text-center"
|
|
96
|
+
>
|
|
97
|
+
一款
|
|
98
|
+
</h1>
|
|
99
|
+
<h1
|
|
100
|
+
className={cx(
|
|
101
|
+
'text-blue-300 text-5xl lg:text-7xl font-extrabold mx-1',
|
|
102
|
+
'transition-all duration-700 delay-100 text-center',
|
|
103
|
+
!isPlugged && 'translate-y-[-5rem]',
|
|
104
|
+
)}
|
|
105
|
+
>
|
|
106
|
+
插件化
|
|
107
|
+
</h1>
|
|
108
|
+
<h1
|
|
109
|
+
className="text-center text-white text-5xl
|
|
110
|
+
lg:text-7xl font-extrabold"
|
|
111
|
+
>
|
|
112
|
+
的
|
|
113
|
+
</h1>
|
|
114
|
+
</div>
|
|
115
|
+
<h1
|
|
116
|
+
className="text-center text-white text-3xl
|
|
117
|
+
lg:text-7xl font-extrabold"
|
|
118
|
+
>
|
|
119
|
+
企业级前端应用框架
|
|
120
|
+
</h1>
|
|
121
|
+
</>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function GithubStars(props: { repo: string }) {
|
|
126
|
+
const [stars, setStars] = useState<number>();
|
|
127
|
+
|
|
128
|
+
useEffect(() => {
|
|
129
|
+
refresh();
|
|
130
|
+
}, []);
|
|
131
|
+
|
|
132
|
+
async function refresh() {
|
|
133
|
+
try {
|
|
134
|
+
const res = await fetch('https://api.github.com/repos/' + props.repo);
|
|
135
|
+
setStars((await res.json()).stargazers_count);
|
|
136
|
+
} catch (err) {
|
|
137
|
+
console.error(err);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (!stars) return null;
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<div className="flex flex-row items-center">
|
|
145
|
+
<img src={Github} className="w-4 h-4 mr-2 invert" alt="" />
|
|
146
|
+
<p className="text-white">{stars}</p>
|
|
147
|
+
<img src={Star} className="w-4 h-4 ml-2 invert" alt="" />
|
|
148
|
+
</div>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export default Hero;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
enum MessageType {
|
|
4
|
+
Info = 'info',
|
|
5
|
+
Success = 'success',
|
|
6
|
+
Warning = 'warning',
|
|
7
|
+
Error = 'error',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface MessageProps {
|
|
11
|
+
type?: MessageType;
|
|
12
|
+
emoji?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function Message(props: PropsWithChildren<MessageProps>) {
|
|
16
|
+
let bgColor = 'bg-blue-50';
|
|
17
|
+
let textColor = 'text-blue-900';
|
|
18
|
+
|
|
19
|
+
switch (props.type) {
|
|
20
|
+
case MessageType.Success:
|
|
21
|
+
bgColor = 'bg-green-50';
|
|
22
|
+
textColor = 'text-green-900';
|
|
23
|
+
break;
|
|
24
|
+
case MessageType.Warning:
|
|
25
|
+
bgColor = 'bg-orange-50';
|
|
26
|
+
textColor = 'text-orange-900';
|
|
27
|
+
break;
|
|
28
|
+
case MessageType.Error:
|
|
29
|
+
bgColor = 'bg-red-50';
|
|
30
|
+
textColor = 'text-red-900';
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const messageText =
|
|
35
|
+
typeof props.children === 'string'
|
|
36
|
+
? props.children
|
|
37
|
+
: (props.children as React.ReactElement).props.children;
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
<div
|
|
42
|
+
className={`w-full py-3 px-4 ${bgColor} ${textColor} rounded-lg my-4 mdx-message`}
|
|
43
|
+
>
|
|
44
|
+
<p>
|
|
45
|
+
{props.emoji && (
|
|
46
|
+
<span role="img" className="mr-3 inline">
|
|
47
|
+
{props.emoji}
|
|
48
|
+
</span>
|
|
49
|
+
)}
|
|
50
|
+
{messageText}
|
|
51
|
+
</p>
|
|
52
|
+
</div>
|
|
53
|
+
</>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default Message;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface IContext {
|
|
4
|
+
appData: any;
|
|
5
|
+
components: any;
|
|
6
|
+
themeConfig: {
|
|
7
|
+
title: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
github: string;
|
|
10
|
+
// 键盘搜索的快捷键,参考 https://github.com/madrobby/keymaster
|
|
11
|
+
searchHotKey?: string | { macos: string; windows: string };
|
|
12
|
+
logo: string;
|
|
13
|
+
// 在设置文件中声明该项目的国际化功能支持的语言
|
|
14
|
+
i18n?: { locale: string; text: string }[];
|
|
15
|
+
// 插件会从 docs/locales 内将所有 json 文件注入到 themeConfig 中
|
|
16
|
+
// 供 useLanguage 使用
|
|
17
|
+
locales: { [locale: string]: { [key: string]: string } };
|
|
18
|
+
navs: {
|
|
19
|
+
path: string;
|
|
20
|
+
title: string;
|
|
21
|
+
children: any[];
|
|
22
|
+
}[];
|
|
23
|
+
announcement?: {
|
|
24
|
+
title: string;
|
|
25
|
+
link?: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
location: {
|
|
29
|
+
pathname: string;
|
|
30
|
+
search: string;
|
|
31
|
+
hash: string;
|
|
32
|
+
key: string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const ThemeContext = React.createContext<IContext | null>(null);
|
|
37
|
+
|
|
38
|
+
export function useThemeContext(): IContext | null {
|
|
39
|
+
return React.useContext(ThemeContext);
|
|
40
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
FireFox CSS backdrop-filter polyfill
|
|
3
|
+
https://www.cnblogs.com/coco1s/p/14953143.html
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.g-glossy-firefox, .g-glossy-firefox-cover {
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@supports (background: -moz-element(#article-body)) {
|
|
11
|
+
.g-glossy-firefox-cover {
|
|
12
|
+
display: block;
|
|
13
|
+
position: fixed;
|
|
14
|
+
top: var(--anchor-offset);
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 72px;
|
|
17
|
+
z-index: 22;
|
|
18
|
+
background-color: white;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.g-glossy-firefox {
|
|
22
|
+
display: block;
|
|
23
|
+
position: fixed;
|
|
24
|
+
width: 100%;
|
|
25
|
+
top: var(--anchor-offset);
|
|
26
|
+
height: 72px;
|
|
27
|
+
z-index: 24;
|
|
28
|
+
background: -moz-element(#article-body) no-repeat top;
|
|
29
|
+
filter: blur(10px);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns='http://www.w3.org/2000/svg' width='1440' height='560' preserveAspectRatio='none'><g mask='url("#SvgjsMask1023")' fill='none'><path fill='#0e2a47' d='M0 0h1440v560H0z'/><path d='M413.428 557.952c56.349 2.363 117.478-15.272 143.791-65.157 25.203-47.779-1.647-102.82-31.406-147.903-26.052-39.466-65.158-67.501-112.385-69.928-52.104-2.678-107.444 12.546-134.345 57.249-27.571 45.818-17.319 103.386 10.029 149.338 26.661 44.798 72.231 74.217 124.316 76.401' fill='rgba(28, 83, 142, 0.4)' class='triangle-float1'/><path d='M1204.349 663.806c45.235-2.564 80.474-33.126 104.879-71.299 27.068-42.339 51.742-93.018 28.733-137.693-24.374-47.325-80.512-69.705-133.612-65.947-47.494 3.362-80.266 41.77-104.43 82.795-24.665 41.876-46.487 91.325-23.279 134.026 23.938 44.044 77.66 60.954 127.709 58.118' fill='rgba(28, 83, 142, 0.4)' class='triangle-float3'/><path d='M800.877 606.466l107.73-1.88-56.685-160.657zM495.21 345.445l-129.014-20.434-20.434 129.015 129.015 20.434z' fill='rgba(28, 83, 142, 0.4)' class='triangle-float1'/><path d='M1062.305 445.605c37.402.243 75.242-11.039 95.762-42.31 22.551-34.366 27.947-79.249 7.345-114.817-20.56-35.494-62.158-52.911-103.107-50.508-37.151 2.18-65.637 29.169-84.081 61.492-18.245 31.976-27.911 70.692-9.552 102.603 18.397 31.976 56.743 43.301 93.633 43.54' fill='rgba(28, 83, 142, 0.4)' class='triangle-float2'/><path d='M1130.596 71.094L993.43 21.169l-49.925 137.167 137.168 49.925z' fill='rgba(28, 83, 142, 0.4)' class='triangle-float3'/><path d='M806.872 135.494c15.365-.225 23.819-16.184 31.095-29.72 6.744-12.546 12.843-26.879 6.061-39.405-7.025-12.975-22.411-17.487-37.156-18.03-16.009-.589-34.387 1.132-42.219 15.107-7.736 13.804 1.506 29.608 9.506 43.261 7.871 13.432 17.147 29.015 32.713 28.787' fill='rgba(28, 83, 142, 0.4)' class='triangle-float2'/><path d='M-23.83 365.43l114.888 39.56 39.558-114.888L15.73 250.544z' fill='rgba(28, 83, 142, 0.4)' class='triangle-float3'/></g><defs><style>@keyframes float1{0%,to{transform:translate(0,0)}50%{transform:translate(-10px,0)}}@keyframes float2{0%,to{transform:translate(0,0)}50%{transform:translate(-5px,-5px)}}@keyframes float3{0%,to{transform:translate(0,0)}50%{transform:translate(0,-10px)}}.triangle-float1{animation:float1 5s infinite}.triangle-float2{animation:float2 4s infinite}.triangle-float3{animation:float3 6s infinite}</style><mask id='SvgjsMask1023'><path fill='#fff' d='M0 0h1440v560H0z'/></mask></defs></svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './firefox-polyfill.css';
|
|
2
|
+
import './tailwind.out.css';
|
|
3
|
+
// Components
|
|
4
|
+
export { default as FeatureItem } from './components/FeatureItem';
|
|
5
|
+
export { default as Features } from './components/Features';
|
|
6
|
+
export { default as Hero } from './components/Hero';
|
|
7
|
+
export { default as Message } from './components/Message';
|
|
8
|
+
export { default as $Layout } from './Layout';
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
article h1 {
|
|
6
|
+
@apply text-4xl font-bold tracking-tight mt-2 my-4 dark:text-white;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
article h2 {
|
|
10
|
+
@apply text-3xl font-semibold tracking-tight mt-10 dark:text-white;
|
|
11
|
+
@apply pb-1 border-b;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
article h3 {
|
|
15
|
+
@apply text-2xl font-semibold tracking-tight mt-8 dark:text-white;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
article h4 {
|
|
19
|
+
@apply text-xl font-semibold tracking-tight mt-8 dark:text-white;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
article h5 {
|
|
23
|
+
@apply text-lg font-semibold tracking-tight mt-8 dark:text-white;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
article h6 {
|
|
27
|
+
@apply text-base font-semibold tracking-tight mt-8 dark:text-white;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
article p {
|
|
31
|
+
@apply text-base leading-8 mt-4 text-gray-700 dark:text-white;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
article ul {
|
|
35
|
+
@apply list-disc ml-6 mt-6 dark:text-white;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
article li {
|
|
39
|
+
@apply mt-2 dark:text-white;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
article ol {
|
|
43
|
+
@apply list-decimal ml-6 mt-6 dark:text-white;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
article blockquote {
|
|
47
|
+
@apply italic pl-6 border-l-2 border-gray-300 text-gray-700 dark:text-white;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
article h2 a {
|
|
51
|
+
@apply no-underline dark:text-white;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
article code {
|
|
55
|
+
@apply bg-black bg-opacity-5 border border-black border-opacity-5 rounded-md dark:text-white;
|
|
56
|
+
font-size: 0.9em;
|
|
57
|
+
padding: 2px 0.25em;
|
|
58
|
+
box-decoration-break: clone;
|
|
59
|
+
font-feature-settings: 'rlig' 1, 'calt' 1, 'ss01' 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
article inlinecode {
|
|
63
|
+
@apply bg-black bg-opacity-5 border border-black border-opacity-5 rounded-md px-1.5 py-0.5 text-xs dark:text-white dark:bg-gray-700;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
article pre {
|
|
67
|
+
/* content-visibility: auto; */
|
|
68
|
+
contain: paint;
|
|
69
|
+
@apply p-4 bg-slate-100 dark:bg-slate-800 rounded-xl my-8 overflow-x-auto font-medium subpixel-antialiased dark:text-white;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
article pre code {
|
|
73
|
+
line-height: 1.25rem;
|
|
74
|
+
@apply relative p-0 text-sm text-current bg-transparent rounded-none border-none inline-block min-w-full dark:text-white;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
article pre code .line.highlighted {
|
|
78
|
+
@apply before:block before:absolute before:h-5 before:bg-gray-500 before:bg-opacity-10 before:-inset-x-4 before:pointer-events-none before:select-none dark:text-white;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
article a code {
|
|
82
|
+
@apply text-current no-underline dark:text-white;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
article a {
|
|
86
|
+
@apply text-blue-600 mx-1 hover:text-blue-300 transition dark:text-blue-400;
|
|
87
|
+
background-image: linear-gradient(transparent 60%, rgba(130, 199, 255, 0.28) 55%);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.link-with-underline {
|
|
91
|
+
@apply text-blue-600 mx-1 hover:text-blue-300 transition dark:text-blue-400;
|
|
92
|
+
background-image: linear-gradient(transparent 60%, rgba(130, 199, 255, 0.28) 55%);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/*article pre {*/
|
|
96
|
+
/* @apply pt-12;*/
|
|
97
|
+
/*}*/
|
|
98
|
+
|
|
99
|
+
article hr {
|
|
100
|
+
@apply my-8;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.fadeout {
|
|
104
|
+
mask-image: linear-gradient(
|
|
105
|
+
to bottom,
|
|
106
|
+
transparent 0%,
|
|
107
|
+
black 10%,
|
|
108
|
+
black 80%,
|
|
109
|
+
transparent 100%
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
html {
|
|
114
|
+
scroll-behavior: smooth
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
:root {
|
|
118
|
+
--anchor-offset: 28px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Anchor with offset for headings */
|
|
122
|
+
h1, h2, h3, h4, h5, h6 {
|
|
123
|
+
scroll-margin-top: calc(var(--anchor-offset) + 88px);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@layer components {
|
|
127
|
+
|
|
128
|
+
.features-dark {
|
|
129
|
+
@apply bg-gray-900;
|
|
130
|
+
background-image: radial-gradient(#2a2a2a 20%, transparent 20%);
|
|
131
|
+
background-size: 6px 6px;
|
|
132
|
+
width: 100%;
|
|
133
|
+
-ms-overflow-style: none;
|
|
134
|
+
scrollbar-width: none;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.features {
|
|
138
|
+
background-image: radial-gradient(#f8f8f5 20%, transparent 20%);
|
|
139
|
+
background-color: white;
|
|
140
|
+
background-size: 6px 6px;
|
|
141
|
+
width: 100%;
|
|
142
|
+
-ms-overflow-style: none;
|
|
143
|
+
scrollbar-width: none;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.features::-webkit-scrollbar {
|
|
147
|
+
display: none;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.mdx-message > p {
|
|
151
|
+
@apply mt-0;
|
|
152
|
+
}
|
|
153
|
+
}
|