@modern-js/main-doc 2.14.0 → 2.16.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +26 -0
- package/docs/en/about/contributing-guide.mdx +268 -0
- package/docs/en/about/releases.mdx +31 -0
- package/docs/en/about/showcase.mdx +15 -0
- package/docs/en/about/team.mdx +29 -0
- package/docs/en/configure/app/output/disable-svgr.mdx +13 -0
- package/docs/en/guides/basic-features/env-vars.mdx +14 -6
- package/docs/en/guides/troubleshooting/dependencies.mdx +110 -0
- package/docs/zh/about/contributing-guide.mdx +267 -0
- package/docs/zh/about/releases.mdx +31 -0
- package/docs/zh/about/showcase.mdx +15 -0
- package/docs/zh/about/team.mdx +29 -0
- package/docs/zh/configure/app/output/disable-svgr.mdx +13 -0
- package/docs/zh/guides/basic-features/env-vars.mdx +14 -5
- package/docs/zh/guides/troubleshooting/dependencies.mdx +16 -5
- package/modern.config.ts +6 -0
- package/package.json +10 -6
- package/src/.eslintrc.json +3 -0
- package/src/components/RandomMemberList/index.module.scss +35 -0
- package/src/components/RandomMemberList/index.tsx +122 -0
- package/src/components/ShowcaseList/index.module.scss +80 -0
- package/src/components/ShowcaseList/index.tsx +39 -0
- package/src/components/ShowcaseList/useShowcases.ts +73 -0
- package/src/i18n/enUS.ts +8 -0
- package/src/i18n/zhCN.ts +8 -0
- package/docs/zh/community/index.mdx +0 -3
@@ -0,0 +1,80 @@
|
|
1
|
+
.wrapper {
|
2
|
+
display: grid;
|
3
|
+
grid-template-columns: repeat(2, 1fr);
|
4
|
+
grid-gap: 32px;
|
5
|
+
}
|
6
|
+
|
7
|
+
@media (max-width: 1100px) {
|
8
|
+
.wrapper {
|
9
|
+
grid-template-columns: repeat(1, 1fr);
|
10
|
+
}
|
11
|
+
}
|
12
|
+
|
13
|
+
.card {
|
14
|
+
display: block;
|
15
|
+
cursor: pointer;
|
16
|
+
age-break-inside: avoid;
|
17
|
+
break-inside: avoid;
|
18
|
+
border-radius: 20px;
|
19
|
+
overflow: hidden;
|
20
|
+
transition: 0.15s ease-in;
|
21
|
+
border: 1px solid var(--modern-c-divider-light);
|
22
|
+
|
23
|
+
&:hover {
|
24
|
+
border-color: var(--modern-c-brand);
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
.preview {
|
29
|
+
display: block;
|
30
|
+
width: 100%;
|
31
|
+
aspect-ratio: 1.84;
|
32
|
+
object-fit: contain;
|
33
|
+
cursor: pointer;
|
34
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
35
|
+
pointer-events: none;
|
36
|
+
background-color: var(--modern-c-bg-soft);
|
37
|
+
}
|
38
|
+
|
39
|
+
.bottom {
|
40
|
+
padding: 12px 18px 14px;
|
41
|
+
}
|
42
|
+
|
43
|
+
.name {
|
44
|
+
display: flex;
|
45
|
+
justify-content: space-between;
|
46
|
+
font-weight: 600;
|
47
|
+
font-size: 17px;
|
48
|
+
line-height: 28px;
|
49
|
+
color: var(--modern-c-text-1);
|
50
|
+
}
|
51
|
+
|
52
|
+
.type {
|
53
|
+
display: block;
|
54
|
+
color: #fff;
|
55
|
+
font-size: 12px;
|
56
|
+
background: -webkit-linear-gradient(
|
57
|
+
305deg,
|
58
|
+
hsl(166deg, 77%, 43%) 10%,
|
59
|
+
hsl(198deg, 100%, 50%)
|
60
|
+
);
|
61
|
+
background-clip: text;
|
62
|
+
-webkit-background-clip: text;
|
63
|
+
-webkit-text-fill-color: transparent;
|
64
|
+
}
|
65
|
+
|
66
|
+
:global(.dark) .type {
|
67
|
+
background: -webkit-linear-gradient(
|
68
|
+
305deg,
|
69
|
+
hsl(166deg, 77%, 53%) 10%,
|
70
|
+
hsl(198deg, 100%, 60%)
|
71
|
+
);
|
72
|
+
background-clip: text;
|
73
|
+
-webkit-background-clip: text;
|
74
|
+
}
|
75
|
+
|
76
|
+
.domain {
|
77
|
+
font-size: 13px;
|
78
|
+
line-height: 24px;
|
79
|
+
color: var(--modern-c-text-2);
|
80
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { useShowcases } from './useShowcases';
|
2
|
+
import styles from './index.module.scss';
|
3
|
+
|
4
|
+
const getDomain = (url: string) => new URL(url).hostname;
|
5
|
+
|
6
|
+
const TYPE_MAP = {
|
7
|
+
doc: 'Modern.js Doc',
|
8
|
+
module: 'Modern.js Module',
|
9
|
+
builder: 'Modern.js Builder',
|
10
|
+
framework: 'Modern.js Framework',
|
11
|
+
};
|
12
|
+
|
13
|
+
export const ShowcaseList = () => {
|
14
|
+
const showcases = useShowcases();
|
15
|
+
|
16
|
+
return (
|
17
|
+
<div className={styles.wrapper}>
|
18
|
+
{showcases.map(item => {
|
19
|
+
return (
|
20
|
+
<a
|
21
|
+
key={item.url}
|
22
|
+
href={item.url}
|
23
|
+
target="_blank"
|
24
|
+
className={styles.card}
|
25
|
+
>
|
26
|
+
<img src={item.preview} className={styles.preview} />
|
27
|
+
<div className={styles.bottom}>
|
28
|
+
<div className={styles.name}>
|
29
|
+
{item.name}
|
30
|
+
<span className={styles.type}>{TYPE_MAP[item.type]}</span>
|
31
|
+
</div>
|
32
|
+
<div className={styles.domain}>{getDomain(item.url)}</div>
|
33
|
+
</div>
|
34
|
+
</a>
|
35
|
+
);
|
36
|
+
})}
|
37
|
+
</div>
|
38
|
+
);
|
39
|
+
};
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import { useI18n } from '../../i18n';
|
2
|
+
|
3
|
+
export type ShowcaseType = 'framework' | 'builder' | 'doc' | 'module';
|
4
|
+
|
5
|
+
export type ShowcaseItem = {
|
6
|
+
url: string;
|
7
|
+
name: string;
|
8
|
+
preview: string;
|
9
|
+
type: ShowcaseType;
|
10
|
+
};
|
11
|
+
|
12
|
+
export const useShowcases = (): ShowcaseItem[] => {
|
13
|
+
const t = useI18n();
|
14
|
+
|
15
|
+
return [
|
16
|
+
{
|
17
|
+
name: t('volctrans'),
|
18
|
+
url: 'https://translate.volcengine.com/',
|
19
|
+
preview:
|
20
|
+
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/volctrans-0424.jpeg',
|
21
|
+
type: 'framework',
|
22
|
+
},
|
23
|
+
{
|
24
|
+
name: t('writingo'),
|
25
|
+
url: 'https://writingo.net/',
|
26
|
+
preview:
|
27
|
+
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/writingo-0424.jpeg',
|
28
|
+
type: 'framework',
|
29
|
+
},
|
30
|
+
{
|
31
|
+
name: 'Rspack',
|
32
|
+
url: 'https://rspack.dev/',
|
33
|
+
preview:
|
34
|
+
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/rspack-0424.jpeg',
|
35
|
+
type: 'doc',
|
36
|
+
},
|
37
|
+
{
|
38
|
+
name: 'Modern.js',
|
39
|
+
url: 'https://modernjs.dev/en/',
|
40
|
+
preview:
|
41
|
+
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/modernjs-dev-0425.jpeg',
|
42
|
+
type: 'doc',
|
43
|
+
},
|
44
|
+
{
|
45
|
+
name: t('shidianbaike'),
|
46
|
+
url: 'https://shidian.baike.com/',
|
47
|
+
preview:
|
48
|
+
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/shidianbaike-0424.jpeg',
|
49
|
+
type: 'framework',
|
50
|
+
},
|
51
|
+
{
|
52
|
+
name: t('xiaohe'),
|
53
|
+
url: 'https://xiaohe.cn/',
|
54
|
+
preview:
|
55
|
+
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/xiaohe-0424.png',
|
56
|
+
type: 'framework',
|
57
|
+
},
|
58
|
+
{
|
59
|
+
name: t('dongchedi'),
|
60
|
+
url: 'https://m.dcdapp.com/motor/feoffline/usedcar_channel/channel.html',
|
61
|
+
preview:
|
62
|
+
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/dongchedi-0425.png',
|
63
|
+
type: 'builder',
|
64
|
+
},
|
65
|
+
{
|
66
|
+
name: t('volcengineDeveloper'),
|
67
|
+
url: 'https://developer.volcengine.com/',
|
68
|
+
preview:
|
69
|
+
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/developer-volcengine-0425.png',
|
70
|
+
type: 'framework',
|
71
|
+
},
|
72
|
+
];
|
73
|
+
};
|
package/src/i18n/enUS.ts
CHANGED
@@ -47,4 +47,12 @@ export const EN_US = {
|
|
47
47
|
projectGenerator: 'Project Generator',
|
48
48
|
githubDiscussion: 'Github Discussion',
|
49
49
|
changelog: 'Changelog',
|
50
|
+
|
51
|
+
// Showcases
|
52
|
+
writingo: 'Writingo',
|
53
|
+
volctrans: 'Volctrans',
|
54
|
+
shidianbaike: 'Shidian Baike',
|
55
|
+
xiaohe: 'Xiaohe',
|
56
|
+
dongchedi: 'Dongchedi',
|
57
|
+
volcengineDeveloper: 'Volcengine Developer',
|
50
58
|
} as const;
|
package/src/i18n/zhCN.ts
CHANGED
@@ -47,4 +47,12 @@ export const ZH_CN: Record<keyof typeof EN_US, string> = {
|
|
47
47
|
projectGenerator: '项目生成器',
|
48
48
|
githubDiscussion: 'Github 讨论区',
|
49
49
|
changelog: '更新日志',
|
50
|
+
|
51
|
+
// Showcase
|
52
|
+
writingo: '火山写作',
|
53
|
+
volctrans: '火山翻译',
|
54
|
+
shidianbaike: '识典百科',
|
55
|
+
xiaohe: '小荷健康',
|
56
|
+
dongchedi: '懂车帝',
|
57
|
+
volcengineDeveloper: '火山引擎开发者社区',
|
50
58
|
};
|