@modern-js/main-doc 2.70.5 → 2.70.7

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/package.json CHANGED
@@ -15,14 +15,14 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.70.5",
18
+ "version": "2.70.7",
19
19
  "publishConfig": {
20
20
  "registry": "https://registry.npmjs.org/",
21
21
  "access": "public"
22
22
  },
23
23
  "dependencies": {
24
24
  "mermaid": "^11.4.1",
25
- "@modern-js/sandpack-react": "2.70.5"
25
+ "@modern-js/sandpack-react": "2.70.7"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@rsbuild/plugin-sass": "1.5.0",
package/rspress.config.ts CHANGED
@@ -11,7 +11,7 @@ export default defineConfig({
11
11
  title: 'Modern.js',
12
12
  description:
13
13
  'The Modern.js framework is a progressive web framework based on React. At ByteDance, we use Modern.js to build upper-level frameworks that have supported the development of thousands of web applications.',
14
- base: '/',
14
+ base: '/v2/',
15
15
  logo: 'https://lf-cdn-tos.bytescm.com/obj/static/webinfra/modern-js-website/assets/images/images/modernjs-logo.svg',
16
16
  icon: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/uhbfnupenuhf/favicon.ico',
17
17
  lang: 'en',
package/src/i18n/enUS.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export const EN_US = {
2
+ upgradeBanner: 'Modern.js 3.0 Release',
3
+ upgradeBannerTag: 'New',
2
4
  introduction: 'Introduction',
3
5
  quickStart: 'Quick Start',
4
6
 
package/src/i18n/zhCN.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import type { EN_US } from './enUS';
2
2
 
3
3
  export const ZH_CN: Record<keyof typeof EN_US, string> = {
4
+ upgradeBanner: 'Modern.js 3.0 发布',
5
+ upgradeBannerTag: '新',
4
6
  introduction: '介绍',
5
7
  quickStart: '快速上手',
6
8
 
@@ -31,6 +31,71 @@
31
31
  padding-top: 20vh;
32
32
  }
33
33
 
34
+ .upgradeBanner {
35
+ position: relative;
36
+ display: flex;
37
+ justify-content: center;
38
+ align-items: center;
39
+ gap: 6px;
40
+ height: 49px;
41
+ padding: 0 20px;
42
+ margin-left: 32px;
43
+ border: 1px solid rgba(78, 202, 255, 0.7);
44
+ border-radius: 39px;
45
+ background: linear-gradient(274.85deg, rgba(78, 202, 255, 0.25) 3%, rgba(100, 207, 222, 0.25) 97.17%);
46
+ color: #b0e6ff;
47
+ font-size: 14px;
48
+ font-weight: 500;
49
+ white-space: nowrap;
50
+ text-decoration: none;
51
+ cursor: pointer;
52
+ transition: all 0.3s ease;
53
+
54
+ &:hover {
55
+ background: linear-gradient(274.85deg, rgba(78, 202, 255, 0.35) 3%, rgba(100, 207, 222, 0.35) 97.17%);
56
+ border-color: #84daff;
57
+ color: #d0f0ff;
58
+ text-decoration: none;
59
+ }
60
+ }
61
+
62
+ .upgradeBannerNew {
63
+ position: absolute;
64
+ top: -10px;
65
+ left: -10px;
66
+ padding: 2px 10px 2px 12px;
67
+ font-size: 12px;
68
+ font-weight: 700;
69
+ line-height: 18px;
70
+ color: #000;
71
+ background: linear-gradient(135deg, #ffcf5c 0%, #ff8a44 100%);
72
+ border-radius: 0 4px 4px 0;
73
+ letter-spacing: 0.5px;
74
+ transform: rotate(-12deg);
75
+
76
+ &::before {
77
+ content: '';
78
+ position: absolute;
79
+ left: 0;
80
+ top: 0;
81
+ width: 0;
82
+ height: 0;
83
+ border-top: 11px solid transparent;
84
+ border-bottom: 11px solid transparent;
85
+ border-left: 8px solid #000;
86
+ }
87
+
88
+ }
89
+
90
+ .upgradeBannerArrow {
91
+ font-size: 14px;
92
+ transition: transform 0.3s ease;
93
+
94
+ .upgradeBanner:hover & {
95
+ transform: translateX(3px);
96
+ }
97
+ }
98
+
34
99
  .title {
35
100
  font-style: normal;
36
101
  font-weight: bold;
@@ -146,6 +211,11 @@
146
211
  margin-left: 0;
147
212
  margin-top: 32px;
148
213
  }
214
+ .upgradeBanner {
215
+ margin-left: 0;
216
+ margin-top: 32px;
217
+ width: 100%;
218
+ }
149
219
  .singleImg {
150
220
  max-width: 100%;
151
221
  }
@@ -1,6 +1,6 @@
1
1
  import clsx from 'clsx';
2
2
  import { useEffect } from 'react';
3
- import { Head, useLocation } from 'rspress/runtime';
3
+ import { Head, useLang, useLocation } from 'rspress/runtime';
4
4
  import ContentCard from '../components/ContentCard';
5
5
  import { FeatureLayout } from '../components/FeatureLayout';
6
6
  import Footer from '../components/Footer';
@@ -8,8 +8,15 @@ import SecondaryTitle from '../components/SecondaryTitle';
8
8
  import { useI18n, useUrl } from '../i18n';
9
9
  import styles from './index.module.scss';
10
10
 
11
+ const UPGRADE_LINKS = {
12
+ zh: 'https://modernjs.dev/zh',
13
+ en: 'https://modernjs.dev/',
14
+ } as const;
15
+
11
16
  const HomepageHeader = () => {
12
17
  const t = useI18n();
18
+ const lang = useLang();
19
+ const upgradeHref = UPGRADE_LINKS[lang === 'zh' ? 'zh' : 'en'];
13
20
 
14
21
  return (
15
22
  <div className={styles.header}>
@@ -37,6 +44,18 @@ const HomepageHeader = () => {
37
44
  >
38
45
  {t('quickStart')}
39
46
  </a>
47
+ <a
48
+ href={upgradeHref}
49
+ target="_blank"
50
+ rel="noopener noreferrer"
51
+ className={styles.upgradeBanner}
52
+ >
53
+ <span className={styles.upgradeBannerNew}>
54
+ {t('upgradeBannerTag')}
55
+ </span>
56
+ {t('upgradeBanner')}
57
+ <span className={styles.upgradeBannerArrow}>→</span>
58
+ </a>
40
59
  </div>
41
60
  </header>
42
61
  </div>