@antv/dumi-theme-antv 0.2.2 → 0.3.0-beta.2
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/LICENSE +21 -0
- package/README.md +32 -33
- package/dist/builtins/Playground/index.d.ts +24 -0
- package/{es/builtins/Example.js → dist/builtins/Playground/index.js} +40 -33
- package/dist/builtins/Playground/index.module.less +15 -0
- package/dist/context.d.ts +5 -0
- package/dist/context.js +2 -0
- package/dist/layouts/DocLayout.d.ts +7 -0
- package/dist/layouts/DocLayout.js +38 -0
- package/dist/layouts/entry/API.d.ts +10 -0
- package/dist/layouts/entry/API.js +12 -0
- package/dist/layouts/entry/Index.d.ts +7 -0
- package/dist/layouts/entry/Index.js +71 -0
- package/dist/layouts/entry/Manual.d.ts +8 -0
- package/dist/layouts/entry/Manual.js +14 -0
- package/dist/locales/en.json +98 -0
- package/dist/locales/zh.json +98 -0
- package/dist/pages/404.d.ts +6 -0
- package/dist/pages/404.js +15 -0
- package/dist/pages/Example/index.d.ts +6 -0
- package/dist/pages/Example/index.js +139 -0
- package/dist/pages/Example/index.module.less +40 -0
- package/dist/pages/Examples/components/Accouncement/index.d.ts +6 -0
- package/dist/pages/Examples/components/Accouncement/index.js +60 -0
- package/dist/pages/Examples/components/Accouncement/index.module.less +9 -0
- package/dist/pages/Examples/components/Article/index.d.ts +2 -0
- package/dist/pages/Examples/components/Article/index.js +8 -0
- package/dist/pages/Examples/components/Article/index.module.less +2 -0
- package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.d.ts +10 -0
- package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.js +74 -0
- package/dist/pages/Examples/components/ExampleTopicMenu/index.d.ts +9 -0
- package/{es/builtins/Table.js → dist/pages/Examples/components/ExampleTopicMenu/index.js} +47 -41
- package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.d.ts +10 -0
- package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.js +33 -0
- package/dist/pages/Examples/components/GalleryPageContent/index.d.ts +10 -0
- package/dist/pages/Examples/components/GalleryPageContent/index.js +81 -0
- package/dist/pages/Examples/index.d.ts +8 -0
- package/dist/pages/Examples/index.js +75 -0
- package/dist/pages/Examples/index.module.less +605 -0
- package/dist/pages/Examples/types.d.ts +33 -0
- package/dist/pages/Examples/types.js +1 -0
- package/dist/plugin/examples.d.ts +12 -0
- package/dist/plugin/examples.js +91 -0
- package/dist/plugin/index.d.ts +3 -0
- package/dist/plugin/index.js +100 -0
- package/dist/plugin/utils.d.ts +5 -0
- package/dist/plugin/utils.js +45 -0
- package/dist/slots/404.d.ts +2 -0
- package/{es/antv/404/index.js → dist/slots/404.js} +4 -9
- package/{es/antv/Cases/Cases.d.ts → dist/slots/Cases/index.d.ts} +4 -4
- package/{es/antv/Cases/Cases.js → dist/slots/Cases/index.js} +25 -25
- package/{src/antv/Cases/Cases.module.less → dist/slots/Cases/index.module.less} +36 -5
- package/dist/slots/CodeEditor/Toolbar.d.ts +67 -0
- package/dist/slots/CodeEditor/Toolbar.js +152 -0
- package/dist/slots/CodeEditor/Toolbar.module.less +81 -0
- package/dist/slots/CodeEditor/index.d.ts +58 -0
- package/dist/slots/CodeEditor/index.js +200 -0
- package/dist/slots/CodeEditor/index.module.less +11 -0
- package/dist/slots/CodeEditor/utils.d.ts +42 -0
- package/dist/slots/CodeEditor/utils.js +157 -0
- package/dist/slots/CodePreview/CodeHeader.d.ts +19 -0
- package/dist/slots/CodePreview/CodeHeader.js +32 -0
- package/dist/slots/CodePreview/CodeHeader.module.less +0 -0
- package/dist/slots/CodePreview/index.d.ts +17 -0
- package/dist/slots/CodePreview/index.js +29 -0
- package/dist/slots/CodePreview/index.module.less +42 -0
- package/dist/slots/CodeRunner/index.d.ts +14 -0
- package/dist/slots/CodeRunner/index.js +76 -0
- package/dist/slots/CodeRunner/index.module.less +0 -0
- package/dist/slots/CodeRunner/utils.d.ts +10 -0
- package/dist/slots/CodeRunner/utils.js +36 -0
- package/dist/slots/Companies/index.d.ts +13 -0
- package/dist/slots/Companies/index.js +49 -0
- package/dist/slots/Companies/index.module.less +82 -0
- package/dist/slots/Detail/News.d.ts +9 -0
- package/{es/antv/Banner/Notification.js → dist/slots/Detail/News.js} +8 -11
- package/{src/antv/Banner/Notification.module.less → dist/slots/Detail/News.module.less} +15 -3
- package/dist/slots/Detail/index.d.ts +26 -0
- package/dist/slots/Detail/index.js +124 -0
- package/{src/antv/Banner/Banner.module.less → dist/slots/Detail/index.module.less} +42 -74
- package/dist/slots/ExampleSider/index.d.ts +55 -0
- package/dist/slots/ExampleSider/index.js +218 -0
- package/dist/slots/ExampleSider/index.module.less +141 -0
- package/{es/antv → dist/slots}/Features/FeatureCard.d.ts +1 -1
- package/{es/antv → dist/slots}/Features/FeatureCard.js +6 -6
- package/{src/antv → dist/slots}/Features/FeatureCard.module.less +8 -1
- package/{es/antv → dist/slots}/Features/index.d.ts +2 -2
- package/{es/antv → dist/slots}/Features/index.js +17 -25
- package/{src/antv/Features/Features.module.less → dist/slots/Features/index.module.less} +34 -3
- package/dist/slots/Footer/index.d.ts +18 -0
- package/dist/slots/Footer/index.js +187 -0
- package/dist/slots/Footer/index.module.less +85 -0
- package/dist/slots/Header/Logo.d.ts +7 -0
- package/{es/antv → dist/slots}/Header/Logo.js +6 -2
- package/dist/slots/Header/LogoWhite.d.ts +7 -0
- package/dist/slots/Header/LogoWhite.js +19 -0
- package/dist/slots/Header/Navs.d.ts +17 -0
- package/dist/slots/Header/Navs.js +46 -0
- package/dist/slots/Header/Products/NavigatorBanner.d.ts +10 -0
- package/dist/slots/Header/Products/NavigatorBanner.js +34 -0
- package/dist/slots/Header/Products/NavigatorBanner.module.less +39 -0
- package/{es/antv → dist/slots/Header}/Products/Product.d.ts +3 -3
- package/{es/antv → dist/slots/Header}/Products/Product.js +11 -16
- package/{src/antv → dist/slots/Header}/Products/Product.module.less +10 -8
- package/{es/antv → dist/slots/Header}/Products/getProducts.d.ts +2 -7
- package/dist/slots/Header/Products/getProducts.js +67 -0
- package/dist/slots/Header/Products/index.d.ts +9 -0
- package/{es/antv → dist/slots/Header}/Products/index.js +15 -22
- package/dist/slots/Header/Search.d.ts +12 -0
- package/dist/slots/Header/Search.js +90 -0
- package/dist/slots/Header/Search.module.less +39 -0
- package/dist/slots/Header/index.d.ts +66 -0
- package/dist/slots/Header/index.js +379 -0
- package/dist/slots/Header/index.module.less +382 -0
- package/dist/slots/Header/utils.d.ts +1 -0
- package/dist/slots/Header/utils.js +26 -0
- package/dist/slots/Loading/index.d.ts +2 -0
- package/dist/slots/Loading/index.js +65 -0
- package/dist/slots/Loading/index.module.less +12 -0
- package/dist/slots/Loading.d.ts +5 -0
- package/dist/slots/Loading.js +8 -0
- package/dist/slots/ManualContent/NavigatorBanner.d.ts +9 -0
- package/dist/slots/ManualContent/NavigatorBanner.js +36 -0
- package/dist/slots/ManualContent/NavigatorBanner.module.less +39 -0
- package/dist/slots/ManualContent/ReadingTime.d.ts +3 -0
- package/dist/slots/ManualContent/ReadingTime.js +10 -0
- package/dist/slots/ManualContent/index.d.ts +9 -0
- package/dist/slots/ManualContent/index.js +321 -0
- package/dist/slots/ManualContent/index.module.less +656 -0
- package/dist/slots/TOC.d.ts +5 -0
- package/dist/slots/TOC.js +6 -0
- package/dist/slots/_.less +83 -0
- package/dist/slots/global.d.ts +1 -0
- package/dist/slots/global.js +7 -0
- package/dist/slots/hooks.d.ts +16 -0
- package/{es/antv → dist/slots}/hooks.js +60 -37
- package/dist/slots/utils.d.ts +20 -0
- package/dist/slots/utils.js +154 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.js +1 -0
- package/dist/typings.d.ts +140 -0
- package/package.json +108 -47
- package/es/antv/404/index.d.ts +0 -2
- package/es/antv/Banner/Banner.module.less +0 -412
- package/es/antv/Banner/Notification.d.ts +0 -10
- package/es/antv/Banner/Notification.module.less +0 -108
- package/es/antv/Banner/index.d.ts +0 -25
- package/es/antv/Banner/index.js +0 -104
- package/es/antv/Cases/Cases.module.less +0 -203
- package/es/antv/Features/FeatureCard.module.less +0 -51
- package/es/antv/Features/Features.module.less +0 -169
- package/es/antv/Footer/Footer.module.less +0 -36
- package/es/antv/Footer/index.d.ts +0 -12
- package/es/antv/Footer/index.js +0 -237
- package/es/antv/Header/Logo.d.ts +0 -4
- package/es/antv/Products/Product.module.less +0 -146
- package/es/antv/Products/getNewProducts.d.ts +0 -24
- package/es/antv/Products/getNewProducts.js +0 -35
- package/es/antv/Products/getProducts.js +0 -460
- package/es/antv/Products/index.d.ts +0 -9
- package/es/antv/hooks.d.ts +0 -14
- package/es/antv/mixins.less +0 -21
- package/es/antv/utils.d.ts +0 -5
- package/es/antv/utils.js +0 -49
- package/es/builtins/API.d.ts +0 -3
- package/es/builtins/API.js +0 -37
- package/es/builtins/Alert.d.ts +0 -3
- package/es/builtins/Alert.js +0 -7
- package/es/builtins/Alert.less +0 -62
- package/es/builtins/Badge.d.ts +0 -3
- package/es/builtins/Badge.js +0 -7
- package/es/builtins/Badge.less +0 -31
- package/es/builtins/Example.d.ts +0 -5
- package/es/builtins/Example.less +0 -47
- package/es/builtins/Previewer.d.ts +0 -39
- package/es/builtins/Previewer.js +0 -225
- package/es/builtins/Previewer.less +0 -406
- package/es/builtins/SourceCode.d.ts +0 -10
- package/es/builtins/SourceCode.js +0 -70
- package/es/builtins/SourceCode.less +0 -103
- package/es/builtins/Table.d.ts +0 -4
- package/es/builtins/Table.less +0 -43
- package/es/builtins/Tree.d.ts +0 -4
- package/es/builtins/Tree.js +0 -213
- package/es/builtins/Tree.less +0 -159
- package/es/components/Dark.d.ts +0 -9
- package/es/components/Dark.js +0 -125
- package/es/components/Dark.less +0 -121
- package/es/components/LocaleSelect.d.ts +0 -6
- package/es/components/LocaleSelect.js +0 -53
- package/es/components/LocaleSelect.less +0 -59
- package/es/components/Navbar.d.ts +0 -10
- package/es/components/Navbar.js +0 -155
- package/es/components/Navbar.less +0 -180
- package/es/components/SearchBar.d.ts +0 -4
- package/es/components/SearchBar.js +0 -81
- package/es/components/SearchBar.less +0 -165
- package/es/components/SideMenu.d.ts +0 -10
- package/es/components/SideMenu.js +0 -99
- package/es/components/SideMenu.less +0 -379
- package/es/components/SlugList.d.ts +0 -7
- package/es/components/SlugList.js +0 -38
- package/es/components/SlugList.less +0 -18
- package/es/declaration.d.ts +0 -1
- package/es/layout.d.ts +0 -5
- package/es/layout.js +0 -276
- package/es/style/layout.less +0 -402
- package/es/style/markdown.less +0 -240
- package/es/style/variables.less +0 -37
- package/src/antv/404/index.tsx +0 -25
- package/src/antv/Banner/Notification.tsx +0 -45
- package/src/antv/Banner/index.tsx +0 -139
- package/src/antv/Cases/Cases.tsx +0 -116
- package/src/antv/Features/FeatureCard.tsx +0 -24
- package/src/antv/Features/index.tsx +0 -86
- package/src/antv/Footer/Footer.module.less +0 -36
- package/src/antv/Footer/index.tsx +0 -272
- package/src/antv/Header/Logo.tsx +0 -85
- package/src/antv/Products/Product.tsx +0 -80
- package/src/antv/Products/getNewProducts.tsx +0 -53
- package/src/antv/Products/getProducts.tsx +0 -626
- package/src/antv/Products/index.tsx +0 -70
- package/src/antv/hooks.ts +0 -87
- package/src/antv/mixins.less +0 -21
- package/src/antv/utils.ts +0 -44
- package/src/builtins/API.tsx +0 -57
- package/src/builtins/Alert.less +0 -62
- package/src/builtins/Alert.tsx +0 -4
- package/src/builtins/Badge.less +0 -31
- package/src/builtins/Badge.tsx +0 -4
- package/src/builtins/Example.less +0 -47
- package/src/builtins/Example.tsx +0 -34
- package/src/builtins/Previewer.less +0 -406
- package/src/builtins/Previewer.tsx +0 -264
- package/src/builtins/SourceCode.less +0 -103
- package/src/builtins/SourceCode.tsx +0 -55
- package/src/builtins/Table.less +0 -43
- package/src/builtins/Table.tsx +0 -42
- package/src/builtins/Tree.less +0 -159
- package/src/builtins/Tree.tsx +0 -130
- package/src/components/Dark.less +0 -121
- package/src/components/Dark.tsx +0 -78
- package/src/components/LocaleSelect.less +0 -59
- package/src/components/LocaleSelect.tsx +0 -53
- package/src/components/Navbar.less +0 -180
- package/src/components/Navbar.tsx +0 -152
- package/src/components/SearchBar.less +0 -165
- package/src/components/SearchBar.tsx +0 -68
- package/src/components/SideMenu.less +0 -379
- package/src/components/SideMenu.tsx +0 -148
- package/src/components/SlugList.less +0 -18
- package/src/components/SlugList.tsx +0 -20
- package/src/declaration.d.ts +0 -1
- package/src/layout.tsx +0 -225
- package/src/style/layout.less +0 -402
- package/src/style/markdown.less +0 -240
- package/src/style/variables.less +0 -37
- package/src/test/SearchBar.test.ts +0 -32
- package/src/test/Table.test.tsx +0 -41
- package/src/test/index.test.tsx +0 -377
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import '../
|
|
1
|
+
@import '../_.less';
|
|
2
2
|
|
|
3
3
|
.wrapper {
|
|
4
4
|
display: flex;
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
background: rgb(240, 245, 250);
|
|
10
10
|
height: auto;
|
|
11
11
|
overflow-x: hidden;
|
|
12
|
+
|
|
12
13
|
.content {
|
|
13
14
|
width: 95.8%;
|
|
14
15
|
height: 100%;
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
position: relative;
|
|
18
19
|
.container1440;
|
|
19
20
|
}
|
|
21
|
+
|
|
20
22
|
.title {
|
|
21
23
|
font-size: 2.8em;
|
|
22
24
|
padding-left: 4.06%;
|
|
@@ -26,24 +28,32 @@
|
|
|
26
28
|
height: min-content;
|
|
27
29
|
color: #fff;
|
|
28
30
|
}
|
|
31
|
+
|
|
29
32
|
.slicerbarv {
|
|
30
33
|
display: none;
|
|
31
34
|
}
|
|
35
|
+
|
|
32
36
|
.slicerbarv2 {
|
|
33
37
|
display: none;
|
|
34
38
|
}
|
|
39
|
+
|
|
35
40
|
.lefttop {
|
|
36
|
-
background: linear-gradient(130deg,
|
|
41
|
+
background: linear-gradient(130deg,
|
|
42
|
+
fade(@primary-color, 70%),
|
|
43
|
+
shade(@primary-color, 20%));
|
|
37
44
|
width: 100%;
|
|
38
45
|
top: 0;
|
|
39
46
|
position: absolute;
|
|
40
47
|
}
|
|
48
|
+
|
|
41
49
|
.lefttopWithTitle {
|
|
42
50
|
height: 60%;
|
|
43
51
|
}
|
|
52
|
+
|
|
44
53
|
.lefttopWithoutTitle {
|
|
45
54
|
height: 75%;
|
|
46
55
|
}
|
|
56
|
+
|
|
47
57
|
.rightbottom {
|
|
48
58
|
position: absolute;
|
|
49
59
|
width: 95.83%;
|
|
@@ -53,15 +63,18 @@
|
|
|
53
63
|
height: 65%;
|
|
54
64
|
box-shadow: -5px 5px 15px rgba(0, 0, 0, 0.1);
|
|
55
65
|
}
|
|
66
|
+
|
|
56
67
|
.rightbottomWithoutTitle {
|
|
57
68
|
top: 48px;
|
|
58
69
|
height: 75%;
|
|
59
70
|
}
|
|
71
|
+
|
|
60
72
|
.cardsContainer {
|
|
61
73
|
width: 100%;
|
|
62
74
|
height: 65%;
|
|
63
75
|
margin-top: 48px;
|
|
64
76
|
position: relative;
|
|
77
|
+
|
|
65
78
|
.cards {
|
|
66
79
|
display: flex;
|
|
67
80
|
text-align: center;
|
|
@@ -69,9 +82,11 @@
|
|
|
69
82
|
width: -webkit-fill-available;
|
|
70
83
|
flex-wrap: wrap;
|
|
71
84
|
margin-left: 4.06%;
|
|
85
|
+
|
|
72
86
|
.cardWrapper {
|
|
73
87
|
margin: 68px 0 93px 0;
|
|
74
88
|
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
|
89
|
+
|
|
75
90
|
&:last-child {
|
|
76
91
|
border-right: 0px;
|
|
77
92
|
}
|
|
@@ -79,6 +94,7 @@
|
|
|
79
94
|
}
|
|
80
95
|
}
|
|
81
96
|
}
|
|
97
|
+
|
|
82
98
|
.dot {
|
|
83
99
|
position: absolute;
|
|
84
100
|
width: 3px;
|
|
@@ -91,14 +107,17 @@
|
|
|
91
107
|
@media (max-width: 768px) {
|
|
92
108
|
.wrapper {
|
|
93
109
|
width: 100%;
|
|
110
|
+
|
|
94
111
|
.lefttop {
|
|
95
112
|
left: 0px;
|
|
96
113
|
height: 100%;
|
|
97
114
|
width: 100%;
|
|
98
115
|
}
|
|
116
|
+
|
|
99
117
|
.rightbottom {
|
|
100
118
|
height: 79.5%;
|
|
101
119
|
margin-top: 48px;
|
|
120
|
+
|
|
102
121
|
.slicerbarv {
|
|
103
122
|
position: absolute;
|
|
104
123
|
background-color: #f2f4f5;
|
|
@@ -108,9 +127,11 @@
|
|
|
108
127
|
display: block;
|
|
109
128
|
z-index: 1;
|
|
110
129
|
}
|
|
130
|
+
|
|
111
131
|
.slicerbarv2 {
|
|
112
132
|
margin-left: 92.2%; // 1 - (0.96 * 0.04 + 0.04)
|
|
113
133
|
}
|
|
134
|
+
|
|
114
135
|
.slicerbarh {
|
|
115
136
|
position: absolute;
|
|
116
137
|
background-color: #f2f4f5;
|
|
@@ -119,12 +140,15 @@
|
|
|
119
140
|
display: block;
|
|
120
141
|
margin-top: 45px;
|
|
121
142
|
}
|
|
143
|
+
|
|
122
144
|
.slicerbarh2 {
|
|
123
145
|
margin-top: 395px;
|
|
124
146
|
}
|
|
147
|
+
|
|
125
148
|
.slicerbarh3 {
|
|
126
149
|
margin-top: 745px;
|
|
127
150
|
}
|
|
151
|
+
|
|
128
152
|
.slicerbarh4 {
|
|
129
153
|
margin-top: 1095px;
|
|
130
154
|
}
|
|
@@ -134,24 +158,30 @@
|
|
|
134
158
|
top: 48px;
|
|
135
159
|
height: 86.5%;
|
|
136
160
|
}
|
|
161
|
+
|
|
137
162
|
.lefttopWithTitle {
|
|
138
163
|
height: 95.73%;
|
|
139
164
|
}
|
|
165
|
+
|
|
140
166
|
.lefttopWithoutTitle {
|
|
141
167
|
height: 95.73%;
|
|
142
168
|
}
|
|
169
|
+
|
|
143
170
|
.content {
|
|
144
171
|
.title {
|
|
145
172
|
font-size: 2.143rem;
|
|
146
173
|
margin: 80px 0 60px 0;
|
|
147
174
|
}
|
|
175
|
+
|
|
148
176
|
.cardsContainer {
|
|
149
177
|
margin-bottom: 70px;
|
|
178
|
+
|
|
150
179
|
.cards {
|
|
151
180
|
margin-top: 60px;
|
|
152
181
|
margin-left: 3.34%;
|
|
153
182
|
padding-top: 45px;
|
|
154
183
|
padding-bottom: 45px;
|
|
184
|
+
|
|
155
185
|
.cardWrapper {
|
|
156
186
|
margin: 68px 0 68px 0;
|
|
157
187
|
width: 100%;
|
|
@@ -162,8 +192,9 @@
|
|
|
162
192
|
}
|
|
163
193
|
}
|
|
164
194
|
}
|
|
195
|
+
|
|
165
196
|
.dot {
|
|
166
197
|
display: block;
|
|
167
198
|
z-index: 2;
|
|
168
199
|
}
|
|
169
|
-
}
|
|
200
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FooterProps as RcFooterProps } from 'rc-footer';
|
|
3
|
+
import 'rc-footer/assets/index.less';
|
|
4
|
+
interface FooterProps extends RcFooterProps {
|
|
5
|
+
rootDomain?: string;
|
|
6
|
+
language?: string;
|
|
7
|
+
githubUrl?: string;
|
|
8
|
+
/**
|
|
9
|
+
* 是否为动态 footer
|
|
10
|
+
*/
|
|
11
|
+
isDynamicFooter?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 底部菜单
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare const Footer: React.FC<FooterProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
var _excluded = ["columns", "bottom", "theme", "language", "isDynamicFooter", "rootDomain"];
|
|
2
|
+
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
7
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8
|
+
|
|
9
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { default as RCFooter } from 'rc-footer';
|
|
13
|
+
import { GithubOutlined, WeiboOutlined, ZhihuOutlined, QuestionCircleOutlined } from '@ant-design/icons';
|
|
14
|
+
import { omit } from 'lodash-es';
|
|
15
|
+
import classnames from 'classnames';
|
|
16
|
+
import { useLocale } from 'dumi';
|
|
17
|
+
import { useT } from "../hooks";
|
|
18
|
+
import 'rc-footer/assets/index.less';
|
|
19
|
+
import styles from "./index.module.less";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 底部菜单
|
|
23
|
+
* @returns
|
|
24
|
+
*/
|
|
25
|
+
export var Footer = function Footer(props) {
|
|
26
|
+
var columns = props.columns,
|
|
27
|
+
bottom = props.bottom,
|
|
28
|
+
_props$theme = props.theme,
|
|
29
|
+
theme = _props$theme === void 0 ? 'dark' : _props$theme,
|
|
30
|
+
language = props.language,
|
|
31
|
+
isDynamicFooter = props.isDynamicFooter,
|
|
32
|
+
_props$rootDomain = props.rootDomain,
|
|
33
|
+
rootDomain = _props$rootDomain === void 0 ? '' : _props$rootDomain,
|
|
34
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
35
|
+
|
|
36
|
+
var locale = useLocale();
|
|
37
|
+
var lang = locale.id;
|
|
38
|
+
|
|
39
|
+
var getColumns = function getColumns() {
|
|
40
|
+
// 如果外部没有传入 columns,则默认展示 antv footer
|
|
41
|
+
var col1 = {
|
|
42
|
+
title: 'Resources',
|
|
43
|
+
items: [{
|
|
44
|
+
title: 'Ant Design',
|
|
45
|
+
url: 'https://ant.design',
|
|
46
|
+
openExternal: true
|
|
47
|
+
}, {
|
|
48
|
+
title: 'Ant Design Mobile',
|
|
49
|
+
url: 'https://mobile.ant.design',
|
|
50
|
+
openExternal: true
|
|
51
|
+
}, {
|
|
52
|
+
title: 'Umi',
|
|
53
|
+
description: useT('React 应用开发框架'),
|
|
54
|
+
url: 'https://umijs.org',
|
|
55
|
+
openExternal: true
|
|
56
|
+
}, {
|
|
57
|
+
title: 'Dumi',
|
|
58
|
+
description: useT('组件/文档研发工具'),
|
|
59
|
+
url: 'https://d.umijs.org',
|
|
60
|
+
openExternal: true
|
|
61
|
+
}, {
|
|
62
|
+
title: 'ahooks',
|
|
63
|
+
description: useT('React Hooks 库'),
|
|
64
|
+
url: 'https://github.com/alibaba/hooks',
|
|
65
|
+
openExternal: true
|
|
66
|
+
}, {
|
|
67
|
+
title: useT('国内镜像'),
|
|
68
|
+
url: 'https://antv.antgroup.com/'
|
|
69
|
+
}]
|
|
70
|
+
};
|
|
71
|
+
var col2 = {
|
|
72
|
+
title: useT('社区'),
|
|
73
|
+
items: [{
|
|
74
|
+
icon: /*#__PURE__*/React.createElement(ZhihuOutlined, {
|
|
75
|
+
style: {
|
|
76
|
+
color: '#0084ff'
|
|
77
|
+
}
|
|
78
|
+
}),
|
|
79
|
+
title: useT('体验科技专栏'),
|
|
80
|
+
url: 'http://zhuanlan.zhihu.com/xtech',
|
|
81
|
+
openExternal: true
|
|
82
|
+
}, {
|
|
83
|
+
icon: /*#__PURE__*/React.createElement("img", {
|
|
84
|
+
src: "https://gw.alipayobjects.com/zos/rmsportal/mZBWtboYbnMkTBaRIuWQ.png",
|
|
85
|
+
alt: "seeconf"
|
|
86
|
+
}),
|
|
87
|
+
title: 'SEE Conf',
|
|
88
|
+
description: useT('蚂蚁体验科技大会'),
|
|
89
|
+
url: 'https://seeconf.antfin.com/',
|
|
90
|
+
openExternal: true
|
|
91
|
+
}]
|
|
92
|
+
};
|
|
93
|
+
var col3 = {
|
|
94
|
+
title: useT('帮助'),
|
|
95
|
+
items: [{
|
|
96
|
+
icon: /*#__PURE__*/React.createElement(GithubOutlined, null),
|
|
97
|
+
title: 'GitHub',
|
|
98
|
+
url: 'https://github.com/antvis',
|
|
99
|
+
openExternal: true
|
|
100
|
+
}, {
|
|
101
|
+
icon: /*#__PURE__*/React.createElement(QuestionCircleOutlined, null),
|
|
102
|
+
title: useT('StackOverflow'),
|
|
103
|
+
url: 'http://stackoverflow.com/questions/tagged/antv',
|
|
104
|
+
openExternal: true
|
|
105
|
+
}]
|
|
106
|
+
};
|
|
107
|
+
var more = {
|
|
108
|
+
icon: /*#__PURE__*/React.createElement("img", {
|
|
109
|
+
src: "https://gw.alipayobjects.com/zos/rmsportal/nBVXkrFdWHxbZlmMbsaH.svg",
|
|
110
|
+
alt: "more products"
|
|
111
|
+
}),
|
|
112
|
+
title: '更多产品',
|
|
113
|
+
items: [{
|
|
114
|
+
icon: /*#__PURE__*/React.createElement("img", {
|
|
115
|
+
src: "https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg",
|
|
116
|
+
alt: "Ant Design"
|
|
117
|
+
}),
|
|
118
|
+
title: 'Ant Design',
|
|
119
|
+
url: 'https://ant.design',
|
|
120
|
+
description: '企业级 UI 设计语言',
|
|
121
|
+
openExternal: true
|
|
122
|
+
}, {
|
|
123
|
+
icon: /*#__PURE__*/React.createElement("img", {
|
|
124
|
+
src: "https://gw.alipayobjects.com/zos/rmsportal/XuVpGqBFxXplzvLjJBZB.svg",
|
|
125
|
+
alt: "yuque"
|
|
126
|
+
}),
|
|
127
|
+
title: '语雀',
|
|
128
|
+
url: 'https://yuque.com',
|
|
129
|
+
description: '知识创作与分享工具',
|
|
130
|
+
openExternal: true
|
|
131
|
+
}, {
|
|
132
|
+
icon: /*#__PURE__*/React.createElement("img", {
|
|
133
|
+
src: "https://gw.alipayobjects.com/zos/antfincdn/v2%24rh7lqpu/82f338dd-b0a6-41bc-9a86-58aaa9df217b.png",
|
|
134
|
+
alt: "Egg"
|
|
135
|
+
}),
|
|
136
|
+
title: 'Egg',
|
|
137
|
+
url: 'https://eggjs.org',
|
|
138
|
+
description: '企业级 Node 开发框架',
|
|
139
|
+
openExternal: true
|
|
140
|
+
}, {
|
|
141
|
+
icon: /*#__PURE__*/React.createElement("img", {
|
|
142
|
+
src: "https://gw.alipayobjects.com/zos/rmsportal/DMDOlAUhmktLyEODCMBR.ico",
|
|
143
|
+
alt: "kitchen"
|
|
144
|
+
}),
|
|
145
|
+
title: 'Kitchen',
|
|
146
|
+
description: 'Sketch 工具集',
|
|
147
|
+
url: 'https://kitchen.alipay.com',
|
|
148
|
+
openExternal: true
|
|
149
|
+
}, {
|
|
150
|
+
icon: /*#__PURE__*/React.createElement("img", {
|
|
151
|
+
src: "https://gw.alipayobjects.com/zos/rmsportal/nBVXkrFdWHxbZlmMbsaH.svg",
|
|
152
|
+
alt: "xtech"
|
|
153
|
+
}),
|
|
154
|
+
title: '蚂蚁体验科技',
|
|
155
|
+
url: 'https://xtech.antfin.com/',
|
|
156
|
+
openExternal: true
|
|
157
|
+
}]
|
|
158
|
+
};
|
|
159
|
+
return [col1, col2, col3, more];
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
return /*#__PURE__*/React.createElement(RCFooter, _extends({
|
|
163
|
+
maxColumnsPerRow: 5,
|
|
164
|
+
theme: theme,
|
|
165
|
+
columns: columns || getColumns(),
|
|
166
|
+
className: classnames(styles.footer, _defineProperty({}, styles.withMenu, isDynamicFooter)),
|
|
167
|
+
bottom: bottom || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
168
|
+
className: styles.bottom
|
|
169
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("a", {
|
|
170
|
+
href: "https://weibo.com/antv2017",
|
|
171
|
+
target: "_blank",
|
|
172
|
+
rel: "noopener noreferrer"
|
|
173
|
+
}, /*#__PURE__*/React.createElement(WeiboOutlined, null)), /*#__PURE__*/React.createElement("a", {
|
|
174
|
+
href: "https://zhuanlan.zhihu.com/aiux-antv",
|
|
175
|
+
target: "_blank",
|
|
176
|
+
rel: "noopener noreferrer"
|
|
177
|
+
}, /*#__PURE__*/React.createElement(ZhihuOutlined, null)), /*#__PURE__*/React.createElement("a", {
|
|
178
|
+
href: "https://github.com/antvis",
|
|
179
|
+
target: "_blank",
|
|
180
|
+
rel: "noopener noreferrer"
|
|
181
|
+
}, /*#__PURE__*/React.createElement(GithubOutlined, null)), /*#__PURE__*/React.createElement("a", {
|
|
182
|
+
href: "".concat(rootDomain, "/").concat(lang, "/about")
|
|
183
|
+
}, useT('关于我们'))), /*#__PURE__*/React.createElement("div", null, "\xA9 ", new Date().getFullYear(), " Made with \u2764 by", ' ', /*#__PURE__*/React.createElement("a", {
|
|
184
|
+
href: "https://xtech.antfin.com/"
|
|
185
|
+
}, "AntV"))))
|
|
186
|
+
}, omit(restProps, ['githubUrl'])));
|
|
187
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
@import '~antd/es/style/themes/default.less';
|
|
2
|
+
@import '../_.less';
|
|
3
|
+
|
|
4
|
+
.footer {
|
|
5
|
+
font-family: Avenir, @font-family;
|
|
6
|
+
|
|
7
|
+
:global(.rc-footer-container),
|
|
8
|
+
:global(.rc-footer-bottom-container) {
|
|
9
|
+
.container1440;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.description {
|
|
13
|
+
opacity: 0.6;
|
|
14
|
+
font-weight: normal;
|
|
15
|
+
margin-left: 0.5em;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.more {
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: center;
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.25);
|
|
23
|
+
margin-bottom: 16px;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
padding-bottom: 16px;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
|
|
29
|
+
.title {
|
|
30
|
+
font-size: 15px;
|
|
31
|
+
color: #fff;
|
|
32
|
+
margin-right: 8px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
:global(.anticon),
|
|
36
|
+
a {
|
|
37
|
+
margin-right: 5px;
|
|
38
|
+
color: #fff;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
img {
|
|
42
|
+
width: 14px;
|
|
43
|
+
height: 14px;
|
|
44
|
+
margin-right: 4px;
|
|
45
|
+
position: relative;
|
|
46
|
+
top: -2px;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.bottom {
|
|
51
|
+
display: flex;
|
|
52
|
+
justify-content: space-between;
|
|
53
|
+
font-size: 14px;
|
|
54
|
+
|
|
55
|
+
:global(.anticon),
|
|
56
|
+
a {
|
|
57
|
+
margin-right: 8px;
|
|
58
|
+
color: rgba(255, 255, 255, 0.6);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media only screen and (max-width: 767.99px) {
|
|
64
|
+
.footer {
|
|
65
|
+
.bottom {
|
|
66
|
+
display: block;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.withMenu {
|
|
72
|
+
margin-left: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@media only screen and (min-width: 767.99px) {
|
|
76
|
+
.withMenu {
|
|
77
|
+
margin-left: 240px;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media only screen and (min-width: 991.99px) {
|
|
82
|
+
.withMenu {
|
|
83
|
+
margin-left: 280px;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Header.LOGO
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export var Logo = function Logo(_ref) {
|
|
3
7
|
var style = _ref.style;
|
|
4
8
|
return /*#__PURE__*/React.createElement("svg", {
|
|
5
9
|
width: "94",
|
|
@@ -127,4 +131,4 @@ export default (function (_ref) {
|
|
|
127
131
|
fill: "url(#linearGradient-4)",
|
|
128
132
|
d: "M19.8878401,7.40978464 C19.7383064,7.15620152 19.4618641,6.99998235 19.1626937,7.00000003 L12.8373895,7.00000003 C12.5382281,6.9999242 12.261761,7.15608029 12.1121725,7.40962229 C11.962584,7.66316428 11.9626109,7.97555472 12.112243,8.22907204 L15.2751831,13.5903738 C15.4247323,13.8438523 15.7011,14 16.0001856,14 C16.2992712,14 16.5756388,13.8438523 16.725188,13.5903738 L19.8878401,8.22935388 C20.0373866,7.97586547 20.0373866,7.66355488 19.8878401,7.41006648 L19.8878401,7.40978464 Z"
|
|
129
133
|
})))));
|
|
130
|
-
}
|
|
134
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Header.LogoWhite
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export var LogoWhite = function LogoWhite(_ref) {
|
|
7
|
+
var style = _ref.style;
|
|
8
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
9
|
+
viewBox: "0 0 94 28",
|
|
10
|
+
style: style,
|
|
11
|
+
version: "1.1",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
width: "94",
|
|
14
|
+
height: "28"
|
|
15
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
16
|
+
d: "M651.186899 0c30.027294 0 57.825882 20.510118 62.674823 50.115765a60.295529 60.295529 0 0 1-55.055058 70.204235L654.439605 120.470588H181.050428c-9.035294 0-14.968471 8.975059-12.107294 17.016471l1.024 2.16847 389.451294 674.544942c4.487529 7.770353 15.058824 8.463059 20.630588 2.108235l1.505883-2.108235 232.538353-402.733177c15.751529-27.256471 49.754353-40.809412 78.516706-27.858823a60.235294 60.235294 0 0 1 29.665882 81.106823l-2.108235 4.035765-290.725647 503.567059a68.306824 68.306824 0 0 1-58.910118 34.032941c-22.588235 0-43.670588-11.294118-56.229647-29.756235l-2.740706-4.397177L9.078664 102.038588a68.216471 68.216471 0 0 1 0-68.005647A68.246588 68.246588 0 0 1 62.898899 0.210824L68.018899 0H651.186899z m1542.806588 369.302588c97.942588 0 158.900706 57.584941 162.002824 152.877177l0.12047 7.408941v277.202823c-5.421176 21.504-24.094118 36.502588-45.447529 36.502589-19.907765 0-37.496471-13.040941-44.152471-32.286118l-1.264941-4.216471v-260.999529c0-65.716706-36.080941-102.339765-102.580706-102.339765s-111.013647 42.616471-113.754353 107.218824l-0.12047 6.324706v249.795764c-5.481412 21.473882-24.094118 36.382118-45.417412 36.382118-19.877647 0-37.436235-13.010824-44.122353-32.165647l-1.264941-4.216471V374.091294h86.497882v72.944941h1.656471c27.648-50.989176 77.462588-77.703529 147.847529-77.703529zM1593.929487 196.065882c20.781176 0 39.574588 12.348235 48.730353 31.472942l1.807059 4.21647 218.202353 574.945882c-8.071529 21.202824-27.708235 35.087059-49.603765 35.087059a53.187765 53.187765 0 0 1-47.826823-30.930823l-1.746824-4.156236-55.416471-155.346823h-229.918117l-55.416471 155.346823-1.927529 4.306824c-9.035294 18.070588-27.015529 29.605647-46.832941 29.605647a52.585412 52.585412 0 0 1-46.832942-29.605647L1325.21984 806.671059l218.172235-574.945883 1.807059-4.21647a54.241882 54.241882 0 0 1 48.730353-31.472941z m968.432941 83.365647c17.468235 0 33.551059 9.306353 42.857412 24.425412l2.198588 3.915294h0.301177v97.28h87.250823c10.782118 7.800471 17.257412 20.510118 17.257412 34.123294 0 12.047059-5.12 23.491765-13.854118 31.201883l-3.403294 2.740706h-86.949647v241.995294c0 37.647059 17.347765 54.994824 55.416471 54.994823 8.252235 0 20.841412-0.873412 27.979294-1.596235l3.041882-0.391529c10.631529 7.920941 16.956235 20.600471 16.956236 34.123294a42.164706 42.164706 0 0 1-13.552942 31.171764l-3.403294 2.740706-10.149647 1.686589c-13.552941 1.957647-27.226353 2.861176-40.96 2.710588-88.335059 0-124.024471-31.232-125.952-109.869177l-0.090353-6.836706v-250.608941h-62.765176a41.562353 41.562353 0 0 1-17.016471-33.792c0-11.986824 5.029647-23.311059 13.613177-31.021176l3.403294-2.770824v-0.602353h62.765176v-97.28l2.198588-3.915294a50.447059 50.447059 0 0 1 42.857412-24.395294zM2830.289016 180.705882c20.871529 0 39.815529 12.318118 49.091765 31.503059l1.807059 4.216471h-0.301176l164.562823 474.563764h2.499765l165.285647-474.563764 1.776941-4.186353a53.428706 53.428706 0 0 1 48.097882-31.232c20.570353 0 39.152941 12.227765 48.097883 31.232l1.776941 4.21647-215.401412 574.945883c-5.752471 24.696471-26.985412 42.104471-51.410823 42.10447-22.889412 0-42.977882-15.299765-50.176-37.586823l-1.234824-4.517647-215.401412-574.945883 1.837177-4.246588A54.784 54.784 0 0 1 2830.289016 180.705882zM1594.170428 327.499294h-2.499764l-90.051765 252.084706 182.603294 0.120471-90.051765-252.205177zM689.737487 274.642824c24.576 0 40.357647 25.419294 30.539294 47.134117l-1.596235 3.072-108.93553 188.717177a33.490824 33.490824 0 0 1-55.777882 3.343058l-2.198588-3.312941-108.93553-188.747294a33.490824 33.490824 0 0 1 25.539765-50.025412l3.433412-0.180705h217.931294zM1072.954428 0c24.274824 0 46.802824 13.040941 58.940236 34.032941 11.143529 19.335529 11.986824 43.068235 2.529882 63.096471l-2.590118 4.909176-119.205647 206.516706a60.144941 60.144941 0 0 1-89.569882 17.106824c-22.618353-17.769412-27.708235-49.904941-15.450353-75.685647l2.499765-4.758589 60.928-105.562353a12.8 12.8 0 0 0-8.673883-18.974117L959.953016 120.470588h-105.953882c-29.997176 0-57.825882-20.510118-62.644706-50.115764a60.325647 60.325647 0 0 1 55.115294-70.174118L850.776546 0h222.147765z",
|
|
17
|
+
fill: "#ffffff"
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare type INav = {
|
|
3
|
+
slug: string;
|
|
4
|
+
order: number;
|
|
5
|
+
title: {
|
|
6
|
+
[key: string]: string;
|
|
7
|
+
};
|
|
8
|
+
target?: '_blank';
|
|
9
|
+
};
|
|
10
|
+
export declare type NavProps = {
|
|
11
|
+
navs: INav[];
|
|
12
|
+
path: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Header 中的导航菜单
|
|
16
|
+
*/
|
|
17
|
+
export declare const Navs: React.FC<NavProps>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import cx from 'classnames';
|
|
5
|
+
import { isEqual } from 'lodash-es';
|
|
6
|
+
import { LinkOutlined } from '@ant-design/icons';
|
|
7
|
+
import { Link, useLocale } from 'dumi';
|
|
8
|
+
import styles from "./index.module.less";
|
|
9
|
+
|
|
10
|
+
var getDocument = function getDocument(navs) {
|
|
11
|
+
var slug = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
12
|
+
return navs.find(function (doc) {
|
|
13
|
+
return doc.slug === slug;
|
|
14
|
+
}) || {
|
|
15
|
+
title: {}
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Header 中的导航菜单
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
export var Navs = function Navs(_ref) {
|
|
24
|
+
var navs = _ref.navs,
|
|
25
|
+
path = _ref.path;
|
|
26
|
+
var locale = useLocale();
|
|
27
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, navs.map(function (nav) {
|
|
28
|
+
var href = nav.slug.startsWith('http') ? nav.slug : "/".concat(nav.slug);
|
|
29
|
+
var title = getDocument(navs, nav.slug).title[locale.id];
|
|
30
|
+
|
|
31
|
+
if (window.location.pathname.includes('en')) {
|
|
32
|
+
href = "/en".concat(href);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var className = cx('header-menu-item-active', _defineProperty({}, styles.activeItem, path.startsWith(href) || isEqual(path.split('/').slice(0, 4), href.split('/').slice(0, 4))));
|
|
36
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
37
|
+
key: title,
|
|
38
|
+
className: className
|
|
39
|
+
}, nav.target === '_blank' || href.startsWith('http') ? /*#__PURE__*/React.createElement("a", {
|
|
40
|
+
href: href,
|
|
41
|
+
target: "_blank"
|
|
42
|
+
}, title, /*#__PURE__*/React.createElement(LinkOutlined, null)) : /*#__PURE__*/React.createElement(Link, {
|
|
43
|
+
to: href
|
|
44
|
+
}, title));
|
|
45
|
+
}));
|
|
46
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { Link } from 'dumi';
|
|
4
|
+
import styles from "./NavigatorBanner.module.less";
|
|
5
|
+
import { useT } from "../../hooks";
|
|
6
|
+
|
|
7
|
+
var NavigatorBanner = function NavigatorBanner(_ref) {
|
|
8
|
+
var post = _ref.post,
|
|
9
|
+
type = _ref.type;
|
|
10
|
+
|
|
11
|
+
if (!post) {
|
|
12
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
className: classNames(styles.button, styles.hidden)
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var slug = post.slug,
|
|
18
|
+
title = post.title;
|
|
19
|
+
|
|
20
|
+
if (!slug || !title) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return /*#__PURE__*/React.createElement(Link, {
|
|
25
|
+
to: slug,
|
|
26
|
+
className: classNames(styles.button, styles[type])
|
|
27
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: styles.label
|
|
29
|
+
}, useT(type === 'prev' ? '上一篇' : '下一篇')), /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: styles.title
|
|
31
|
+
}, title));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default NavigatorBanner;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
.button {
|
|
2
|
+
width: 50%;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
margin-top: 32px;
|
|
5
|
+
padding: 32px 0 0;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
border-top: 1px solid #e8e8e8;
|
|
8
|
+
line-height: 1.5;
|
|
9
|
+
vertical-align: top;
|
|
10
|
+
|
|
11
|
+
&.hidden {
|
|
12
|
+
height: 86px;
|
|
13
|
+
cursor: auto;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.label {
|
|
17
|
+
margin-bottom: 8px;
|
|
18
|
+
font-size: 14px;
|
|
19
|
+
color: #bfbfbf;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.title {
|
|
23
|
+
font-size: 16px;
|
|
24
|
+
font-weight: 500;
|
|
25
|
+
color: #333;
|
|
26
|
+
transition: all 0.3s;
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
text-overflow: ellipsis;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&:hover .title {
|
|
33
|
+
color: #000;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.next {
|
|
37
|
+
text-align: right;
|
|
38
|
+
}
|
|
39
|
+
}
|