@antv/dumi-theme-antv 0.2.2 → 0.3.0-beta.10

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.
Files changed (265) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -33
  3. package/dist/builtins/Playground/index.d.ts +21 -0
  4. package/dist/builtins/Playground/index.js +69 -0
  5. package/dist/builtins/Playground/index.module.less +15 -0
  6. package/dist/context.d.ts +6 -0
  7. package/dist/context.js +2 -0
  8. package/dist/layouts/DocLayout.d.ts +7 -0
  9. package/dist/layouts/DocLayout.js +48 -0
  10. package/dist/layouts/entry/API.d.ts +10 -0
  11. package/dist/layouts/entry/API.js +12 -0
  12. package/dist/layouts/entry/Index.d.ts +7 -0
  13. package/dist/layouts/entry/Index.js +79 -0
  14. package/dist/layouts/entry/Manual.d.ts +8 -0
  15. package/dist/layouts/entry/Manual.js +13 -0
  16. package/dist/locales/en.json +98 -0
  17. package/dist/locales/zh.json +98 -0
  18. package/dist/pages/404.d.ts +6 -0
  19. package/dist/pages/404.js +18 -0
  20. package/dist/pages/Example/index.d.ts +6 -0
  21. package/dist/pages/Example/index.js +115 -0
  22. package/dist/pages/Example/index.module.less +82 -0
  23. package/dist/pages/Example/utils.d.ts +1 -0
  24. package/dist/pages/Example/utils.js +9 -0
  25. package/dist/pages/Examples/components/Accouncement/index.d.ts +6 -0
  26. package/dist/pages/Examples/components/Accouncement/index.js +60 -0
  27. package/dist/pages/Examples/components/Accouncement/index.module.less +9 -0
  28. package/dist/pages/Examples/components/Article/index.d.ts +2 -0
  29. package/dist/pages/Examples/components/Article/index.js +8 -0
  30. package/dist/pages/Examples/components/Article/index.module.less +2 -0
  31. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.d.ts +10 -0
  32. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.js +74 -0
  33. package/dist/pages/Examples/components/ExampleTopicMenu/index.d.ts +9 -0
  34. package/{es/builtins/Example.js → dist/pages/Examples/components/ExampleTopicMenu/index.js} +47 -33
  35. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.d.ts +10 -0
  36. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.js +33 -0
  37. package/dist/pages/Examples/components/GalleryPageContent/index.d.ts +10 -0
  38. package/dist/pages/Examples/components/GalleryPageContent/index.js +81 -0
  39. package/dist/pages/Examples/index.d.ts +8 -0
  40. package/dist/pages/Examples/index.js +95 -0
  41. package/dist/pages/Examples/index.module.less +607 -0
  42. package/dist/pages/Examples/types.d.ts +34 -0
  43. package/dist/pages/Examples/types.js +1 -0
  44. package/dist/plugin/examples.d.ts +21 -0
  45. package/dist/plugin/examples.js +105 -0
  46. package/dist/plugin/index.d.ts +3 -0
  47. package/dist/plugin/index.js +113 -0
  48. package/dist/plugin/utils.d.ts +5 -0
  49. package/dist/plugin/utils.js +46 -0
  50. package/dist/slots/404.d.ts +2 -0
  51. package/{es/antv/404/index.js → dist/slots/404.js} +4 -9
  52. package/{es/antv/Cases/Cases.d.ts → dist/slots/Cases/index.d.ts} +5 -4
  53. package/{es/antv/Cases/Cases.js → dist/slots/Cases/index.js} +25 -25
  54. package/{src/antv/Cases/Cases.module.less → dist/slots/Cases/index.module.less} +36 -5
  55. package/dist/slots/CodeEditor/Toolbar.d.ts +67 -0
  56. package/dist/slots/CodeEditor/Toolbar.js +140 -0
  57. package/dist/slots/CodeEditor/Toolbar.module.less +81 -0
  58. package/dist/slots/CodeEditor/index.d.ts +58 -0
  59. package/dist/slots/CodeEditor/index.js +226 -0
  60. package/dist/slots/CodeEditor/index.module.less +11 -0
  61. package/dist/slots/CodeEditor/utils.d.ts +42 -0
  62. package/dist/slots/CodeEditor/utils.js +157 -0
  63. package/dist/slots/CodePreview/CodeHeader.d.ts +19 -0
  64. package/dist/slots/CodePreview/CodeHeader.js +32 -0
  65. package/dist/slots/CodePreview/CodeHeader.module.less +0 -0
  66. package/dist/slots/CodePreview/index.d.ts +17 -0
  67. package/dist/slots/CodePreview/index.js +29 -0
  68. package/dist/slots/CodePreview/index.module.less +43 -0
  69. package/dist/slots/CodeRunner/index.d.ts +15 -0
  70. package/dist/slots/CodeRunner/index.js +79 -0
  71. package/dist/slots/CodeRunner/index.module.less +0 -0
  72. package/dist/slots/CodeRunner/utils.d.ts +11 -0
  73. package/dist/slots/CodeRunner/utils.js +36 -0
  74. package/dist/slots/Companies/index.d.ts +13 -0
  75. package/dist/slots/Companies/index.js +49 -0
  76. package/dist/slots/Companies/index.module.less +82 -0
  77. package/dist/slots/Detail/News.d.ts +10 -0
  78. package/{es/antv/Banner/Notification.js → dist/slots/Detail/News.js} +8 -11
  79. package/{src/antv/Banner/Notification.module.less → dist/slots/Detail/News.module.less} +15 -3
  80. package/dist/slots/Detail/index.d.ts +27 -0
  81. package/dist/slots/Detail/index.js +124 -0
  82. package/{src/antv/Banner/Banner.module.less → dist/slots/Detail/index.module.less} +42 -74
  83. package/dist/slots/ExampleSider/index.d.ts +21 -0
  84. package/dist/slots/ExampleSider/index.js +196 -0
  85. package/dist/slots/ExampleSider/index.module.less +141 -0
  86. package/{es/antv → dist/slots}/Features/FeatureCard.d.ts +2 -1
  87. package/{es/antv → dist/slots}/Features/FeatureCard.js +6 -6
  88. package/{src/antv → dist/slots}/Features/FeatureCard.module.less +8 -1
  89. package/{es/antv → dist/slots}/Features/index.d.ts +2 -2
  90. package/{es/antv → dist/slots}/Features/index.js +19 -26
  91. package/{src/antv/Features/Features.module.less → dist/slots/Features/index.module.less} +34 -3
  92. package/dist/slots/Footer/index.d.ts +18 -0
  93. package/dist/slots/Footer/index.js +188 -0
  94. package/dist/slots/Footer/index.module.less +86 -0
  95. package/dist/slots/Header/Logo.d.ts +7 -0
  96. package/{es/antv → dist/slots}/Header/Logo.js +6 -2
  97. package/dist/slots/Header/LogoWhite.d.ts +7 -0
  98. package/dist/slots/Header/LogoWhite.js +19 -0
  99. package/dist/slots/Header/Navs.d.ts +26 -0
  100. package/dist/slots/Header/Navs.js +63 -0
  101. package/dist/slots/Header/Products/NavigatorBanner.d.ts +10 -0
  102. package/dist/slots/Header/Products/NavigatorBanner.js +34 -0
  103. package/dist/slots/Header/Products/NavigatorBanner.module.less +39 -0
  104. package/{es/antv → dist/slots/Header}/Products/Product.d.ts +3 -3
  105. package/{es/antv → dist/slots/Header}/Products/Product.js +11 -16
  106. package/{src/antv → dist/slots/Header}/Products/Product.module.less +10 -8
  107. package/{es/antv → dist/slots/Header}/Products/getProducts.d.ts +2 -7
  108. package/dist/slots/Header/Products/getProducts.js +67 -0
  109. package/dist/slots/Header/Products/index.d.ts +9 -0
  110. package/{es/antv → dist/slots/Header}/Products/index.js +15 -22
  111. package/dist/slots/Header/Search.d.ts +12 -0
  112. package/dist/slots/Header/Search.js +90 -0
  113. package/dist/slots/Header/Search.module.less +39 -0
  114. package/dist/slots/Header/index.d.ts +66 -0
  115. package/dist/slots/Header/index.js +380 -0
  116. package/dist/slots/Header/index.module.less +382 -0
  117. package/dist/slots/Header/utils.d.ts +1 -0
  118. package/dist/slots/Header/utils.js +26 -0
  119. package/dist/slots/Loading/index.d.ts +7 -0
  120. package/dist/slots/Loading/index.js +79 -0
  121. package/dist/slots/Loading/index.module.less +279 -0
  122. package/dist/slots/ManualContent/NavigatorBanner.d.ts +9 -0
  123. package/dist/slots/ManualContent/NavigatorBanner.js +36 -0
  124. package/dist/slots/ManualContent/NavigatorBanner.module.less +39 -0
  125. package/dist/slots/ManualContent/ReadingTime.d.ts +3 -0
  126. package/dist/slots/ManualContent/ReadingTime.js +10 -0
  127. package/dist/slots/ManualContent/index.d.ts +9 -0
  128. package/dist/slots/ManualContent/index.js +344 -0
  129. package/dist/slots/ManualContent/index.module.less +668 -0
  130. package/dist/slots/ManualContent/utils.d.ts +3 -0
  131. package/dist/slots/ManualContent/utils.js +35 -0
  132. package/dist/slots/SEO.d.ts +10 -0
  133. package/dist/slots/SEO.js +59 -0
  134. package/dist/slots/TOC.d.ts +5 -0
  135. package/dist/slots/TOC.js +6 -0
  136. package/dist/slots/_.less +83 -0
  137. package/dist/slots/global.d.ts +1 -0
  138. package/dist/slots/global.js +7 -0
  139. package/dist/slots/hooks.d.ts +16 -0
  140. package/{es/antv → dist/slots}/hooks.js +60 -37
  141. package/dist/slots/utils.d.ts +5 -0
  142. package/dist/slots/utils.js +112 -0
  143. package/dist/types.d.ts +86 -0
  144. package/dist/types.js +1 -0
  145. package/dist/typings.d.ts +24 -0
  146. package/package.json +110 -47
  147. package/es/antv/404/index.d.ts +0 -2
  148. package/es/antv/Banner/Banner.module.less +0 -412
  149. package/es/antv/Banner/Notification.d.ts +0 -10
  150. package/es/antv/Banner/Notification.module.less +0 -108
  151. package/es/antv/Banner/index.d.ts +0 -25
  152. package/es/antv/Banner/index.js +0 -104
  153. package/es/antv/Cases/Cases.module.less +0 -203
  154. package/es/antv/Features/FeatureCard.module.less +0 -51
  155. package/es/antv/Features/Features.module.less +0 -169
  156. package/es/antv/Footer/Footer.module.less +0 -36
  157. package/es/antv/Footer/index.d.ts +0 -12
  158. package/es/antv/Footer/index.js +0 -237
  159. package/es/antv/Header/Logo.d.ts +0 -4
  160. package/es/antv/Products/Product.module.less +0 -146
  161. package/es/antv/Products/getNewProducts.d.ts +0 -24
  162. package/es/antv/Products/getNewProducts.js +0 -35
  163. package/es/antv/Products/getProducts.js +0 -460
  164. package/es/antv/Products/index.d.ts +0 -9
  165. package/es/antv/hooks.d.ts +0 -14
  166. package/es/antv/mixins.less +0 -21
  167. package/es/antv/utils.d.ts +0 -5
  168. package/es/antv/utils.js +0 -49
  169. package/es/builtins/API.d.ts +0 -3
  170. package/es/builtins/API.js +0 -37
  171. package/es/builtins/Alert.d.ts +0 -3
  172. package/es/builtins/Alert.js +0 -7
  173. package/es/builtins/Alert.less +0 -62
  174. package/es/builtins/Badge.d.ts +0 -3
  175. package/es/builtins/Badge.js +0 -7
  176. package/es/builtins/Badge.less +0 -31
  177. package/es/builtins/Example.d.ts +0 -5
  178. package/es/builtins/Example.less +0 -47
  179. package/es/builtins/Previewer.d.ts +0 -39
  180. package/es/builtins/Previewer.js +0 -225
  181. package/es/builtins/Previewer.less +0 -406
  182. package/es/builtins/SourceCode.d.ts +0 -10
  183. package/es/builtins/SourceCode.js +0 -70
  184. package/es/builtins/SourceCode.less +0 -103
  185. package/es/builtins/Table.d.ts +0 -4
  186. package/es/builtins/Table.js +0 -56
  187. package/es/builtins/Table.less +0 -43
  188. package/es/builtins/Tree.d.ts +0 -4
  189. package/es/builtins/Tree.js +0 -213
  190. package/es/builtins/Tree.less +0 -159
  191. package/es/components/Dark.d.ts +0 -9
  192. package/es/components/Dark.js +0 -125
  193. package/es/components/Dark.less +0 -121
  194. package/es/components/LocaleSelect.d.ts +0 -6
  195. package/es/components/LocaleSelect.js +0 -53
  196. package/es/components/LocaleSelect.less +0 -59
  197. package/es/components/Navbar.d.ts +0 -10
  198. package/es/components/Navbar.js +0 -155
  199. package/es/components/Navbar.less +0 -180
  200. package/es/components/SearchBar.d.ts +0 -4
  201. package/es/components/SearchBar.js +0 -81
  202. package/es/components/SearchBar.less +0 -165
  203. package/es/components/SideMenu.d.ts +0 -10
  204. package/es/components/SideMenu.js +0 -99
  205. package/es/components/SideMenu.less +0 -379
  206. package/es/components/SlugList.d.ts +0 -7
  207. package/es/components/SlugList.js +0 -38
  208. package/es/components/SlugList.less +0 -18
  209. package/es/declaration.d.ts +0 -1
  210. package/es/layout.d.ts +0 -5
  211. package/es/layout.js +0 -276
  212. package/es/style/layout.less +0 -402
  213. package/es/style/markdown.less +0 -240
  214. package/es/style/variables.less +0 -37
  215. package/src/antv/404/index.tsx +0 -25
  216. package/src/antv/Banner/Notification.tsx +0 -45
  217. package/src/antv/Banner/index.tsx +0 -139
  218. package/src/antv/Cases/Cases.tsx +0 -116
  219. package/src/antv/Features/FeatureCard.tsx +0 -24
  220. package/src/antv/Features/index.tsx +0 -86
  221. package/src/antv/Footer/Footer.module.less +0 -36
  222. package/src/antv/Footer/index.tsx +0 -272
  223. package/src/antv/Header/Logo.tsx +0 -85
  224. package/src/antv/Products/Product.tsx +0 -80
  225. package/src/antv/Products/getNewProducts.tsx +0 -53
  226. package/src/antv/Products/getProducts.tsx +0 -626
  227. package/src/antv/Products/index.tsx +0 -70
  228. package/src/antv/hooks.ts +0 -87
  229. package/src/antv/mixins.less +0 -21
  230. package/src/antv/utils.ts +0 -44
  231. package/src/builtins/API.tsx +0 -57
  232. package/src/builtins/Alert.less +0 -62
  233. package/src/builtins/Alert.tsx +0 -4
  234. package/src/builtins/Badge.less +0 -31
  235. package/src/builtins/Badge.tsx +0 -4
  236. package/src/builtins/Example.less +0 -47
  237. package/src/builtins/Example.tsx +0 -34
  238. package/src/builtins/Previewer.less +0 -406
  239. package/src/builtins/Previewer.tsx +0 -264
  240. package/src/builtins/SourceCode.less +0 -103
  241. package/src/builtins/SourceCode.tsx +0 -55
  242. package/src/builtins/Table.less +0 -43
  243. package/src/builtins/Table.tsx +0 -42
  244. package/src/builtins/Tree.less +0 -159
  245. package/src/builtins/Tree.tsx +0 -130
  246. package/src/components/Dark.less +0 -121
  247. package/src/components/Dark.tsx +0 -78
  248. package/src/components/LocaleSelect.less +0 -59
  249. package/src/components/LocaleSelect.tsx +0 -53
  250. package/src/components/Navbar.less +0 -180
  251. package/src/components/Navbar.tsx +0 -152
  252. package/src/components/SearchBar.less +0 -165
  253. package/src/components/SearchBar.tsx +0 -68
  254. package/src/components/SideMenu.less +0 -379
  255. package/src/components/SideMenu.tsx +0 -148
  256. package/src/components/SlugList.less +0 -18
  257. package/src/components/SlugList.tsx +0 -20
  258. package/src/declaration.d.ts +0 -1
  259. package/src/layout.tsx +0 -225
  260. package/src/style/layout.less +0 -402
  261. package/src/style/markdown.less +0 -240
  262. package/src/style/variables.less +0 -37
  263. package/src/test/SearchBar.test.ts +0 -32
  264. package/src/test/Table.test.tsx +0 -41
  265. package/src/test/index.test.tsx +0 -377
@@ -1,626 +0,0 @@
1
- import {
2
- AreaChartOutlined,
3
- DingdingOutlined,
4
- GithubOutlined,
5
- HistoryOutlined,
6
- HomeOutlined,
7
- PieChartOutlined,
8
- ReadOutlined,
9
- YuqueOutlined,
10
- } from "@ant-design/icons";
11
- import { each } from "lodash";
12
- import React from "react";
13
- import { getChinaMirrorHost } from "../utils";
14
-
15
- const tuple = <T extends string[]>(...args: T) => args;
16
- const Categories = tuple("basic", "extension", "ecology");
17
- const Link = tuple("home", "example", "api");
18
-
19
- export interface ProductItem {
20
- title: string;
21
- icon?: React.ReactNode;
22
- slogan?: string;
23
- description: string;
24
- category: typeof Categories[number];
25
- links?: Array<{
26
- icon?: React.ReactNode;
27
- title: React.ReactNode;
28
- url?: string;
29
- openExternal?: boolean;
30
- }>;
31
- }
32
-
33
- const ANTV_DOMAIN = "antv.vision";
34
-
35
- export type ValuesOf<T extends any[]> = T[number];
36
-
37
- export const getProducts = ({
38
- t,
39
- language,
40
- isChinaMirrorHost = false,
41
- }: {
42
- t: (key: string) => string;
43
- language: string;
44
- isChinaMirrorHost?: boolean;
45
- }): ProductItem[] => {
46
- const hosts: { [name: string]: string } = {};
47
- [
48
- "g2",
49
- "g2plot",
50
- "g6",
51
- "l7",
52
- "f2",
53
- "f2native",
54
- "graphin",
55
- "g",
56
- "x6",
57
- "ava",
58
- ].forEach((name: string) => {
59
- hosts[name] = isChinaMirrorHost
60
- ? getChinaMirrorHost(`${name}.${ANTV_DOMAIN}`)
61
- : `${name}.${ANTV_DOMAIN}`;
62
- });
63
- const products = [
64
- {
65
- title: "G2",
66
- icon:
67
- "https://gw.alipayobjects.com/zos/antfincdn/trEfLRh5pc/G2%252520keshihuatuxingyufa.svg",
68
- slogan: t("可视化引擎"),
69
- description: t("数据驱动,高度易用,可扩展的可视化图形语法。"),
70
- category: Categories[0],
71
- links: [
72
- {
73
- icon: <HomeOutlined />,
74
- title: t("产品首页"),
75
- url: `https://${hosts.g2}/${language}`,
76
- },
77
- {
78
- icon: <PieChartOutlined />,
79
- title: t("图表示例"),
80
- url: `https://${hosts.g2}/${language}/examples`,
81
- },
82
- {
83
- icon: <ReadOutlined />,
84
- title: t("使用文档"),
85
- url: `https://${hosts.g2}/${language}/docs/manual`,
86
- },
87
- {
88
- icon: <ReadOutlined />,
89
- title: t("API 文档"),
90
- url: `https://${hosts.g2}/${language}/docs/api`,
91
- },
92
- {
93
- icon: <HistoryOutlined />,
94
- title: t("更新日志"),
95
- url: `https://github.com/antvis/g2/blob/master/CHANGELOG.md`,
96
- openExternal: true,
97
- },
98
- {
99
- icon: <GithubOutlined />,
100
- title: t("GitHub 仓库"),
101
- url: `https://github.com/antvis/g2`,
102
- openExternal: true,
103
- },
104
- {
105
- icon: "🇨🇳",
106
- title: t("国内镜像"),
107
- url: `https://antv-g2.gitee.io`,
108
- openExternal: true,
109
- },
110
- ],
111
- },
112
- {
113
- title: "F2",
114
- icon:
115
- "https://gw.alipayobjects.com/zos/antfincdn/D%26fDbWqVkv/F2%252520yidongduankeshihuafangan.svg",
116
- slogan: t("移动可视化方案"),
117
- description: t(
118
- "专注于移动端的可视化解决方案,兼容 H5/小程序/Weex 等多端环境"
119
- ),
120
- category: Categories[0],
121
- links: [
122
- {
123
- icon: <HomeOutlined />,
124
- title: t("产品首页"),
125
- url: `https://${hosts.f2}/${language}`,
126
- },
127
- {
128
- icon: <PieChartOutlined />,
129
- title: t("图表示例"),
130
- url: `https://${hosts.f2}/${language}/examples`,
131
- },
132
- {
133
- icon: <ReadOutlined />,
134
- title: t("使用文档"),
135
- url: `https://${hosts.f2}/${language}/docs/tutorial/getting-started`,
136
- },
137
- {
138
- icon: <ReadOutlined />,
139
- title: t("API 文档"),
140
- url: `https://${hosts.f2}/${language}/docs/api`,
141
- },
142
- {
143
- icon: <HistoryOutlined />,
144
- title: t("更新日志"),
145
- url: `https://github.com/antvis/f2/blob/master/CHANGELOG.md`,
146
- openExternal: true,
147
- },
148
- {
149
- icon: <GithubOutlined />,
150
- title: t("GitHub 仓库"),
151
- url: `https://github.com/antvis/f2`,
152
- openExternal: true,
153
- },
154
- {
155
- icon: "🇨🇳",
156
- title: t("国内镜像"),
157
- url: `https://antv-f2.gitee.io`,
158
- openExternal: true,
159
- },
160
- ],
161
- },
162
- {
163
- title: "G6",
164
- icon:
165
- "https://gw.alipayobjects.com/zos/antfincdn/zS1wZZJVcJ/G6%252520tukeshihuayinqing.svg",
166
- slogan: t("图可视化引擎"),
167
- description: t("便捷的关系数据可视化引擎与图分析工具。"),
168
- category: Categories[0],
169
- links: [
170
- {
171
- icon: <HomeOutlined />,
172
- title: t("产品首页"),
173
- url: `https://${hosts.g6}/${language}`,
174
- },
175
- {
176
- icon: <PieChartOutlined />,
177
- title: t("图表示例"),
178
- url: `https://${hosts.g6}/${language}/examples`,
179
- },
180
- {
181
- icon: <ReadOutlined />,
182
- title: t("使用文档"),
183
- url: `https://${hosts.g6}/${language}/docs/manual`,
184
- },
185
- {
186
- icon: <ReadOutlined />,
187
- title: t("API 文档"),
188
- url: `https://${hosts.g6}/${language}/docs/api`,
189
- },
190
- {
191
- icon: <HistoryOutlined />,
192
- title: t("更新日志"),
193
- url: `https://github.com/antvis/g6/blob/master/CHANGELOG.md`,
194
- openExternal: true,
195
- },
196
- {
197
- icon: <GithubOutlined />,
198
- title: t("GitHub 仓库"),
199
- url: `https://github.com/antvis/g6`,
200
- openExternal: true,
201
- },
202
- {
203
- icon: "🇨🇳",
204
- title: t("国内镜像"),
205
- url: `https://antv-g6.gitee.io`,
206
- openExternal: true,
207
- },
208
- ],
209
- },
210
- {
211
- title: "X6",
212
- icon:
213
- "https://gw.alipayobjects.com/zos/bmw-prod/1d5e84d0-d153-4648-81c0-397b3d383d2c.svg",
214
- slogan: t("图编辑引擎"),
215
- description: t("极易定制、开箱即用、数据驱动的图编辑引擎"),
216
- category: Categories[0],
217
- links: [
218
- {
219
- icon: <HomeOutlined />,
220
- title: t("产品首页"),
221
- url: `https://${hosts.x6}/${language}`,
222
- },
223
- {
224
- icon: <PieChartOutlined />,
225
- title: t("图表示例"),
226
- url: `https://${hosts.x6}/${language}/examples`,
227
- },
228
- {
229
- icon: <ReadOutlined />,
230
- title: t("使用文档"),
231
- url: `https://${hosts.x6}/${language}/docs/tutorial/about/`,
232
- },
233
- {
234
- icon: <ReadOutlined />,
235
- title: t("API 文档"),
236
- url: `https://${hosts.x6}/${language}/docs/api/graph/`,
237
- },
238
- {
239
- icon: <GithubOutlined />,
240
- title: t("GitHub 仓库"),
241
- url: `https://github.com/antvis/x6`,
242
- openExternal: true,
243
- },
244
- {
245
- icon: "🇨🇳",
246
- title: t("国内镜像"),
247
- url: `https://antv-x6.gitee.io`,
248
- openExternal: true,
249
- },
250
- ],
251
- },
252
- {
253
- title: "L7",
254
- icon:
255
- "https://gw.alipayobjects.com/zos/antfincdn/OI%26h7HXH33/L7%252520dilikongjianshujukeshihua.svg",
256
- slogan: t("地理空间数据可视化"),
257
- description: t("高性能/高渲染质量的地理空间数据可视化框架。"),
258
- category: Categories[0],
259
- links: [
260
- {
261
- icon: <HomeOutlined />,
262
- title: t("产品首页"),
263
- url: `https://${hosts.l7}/${language}`,
264
- },
265
- {
266
- icon: <PieChartOutlined />,
267
- title: t("图表示例"),
268
- url: `https://${hosts.l7}/${language}/examples`,
269
- },
270
- {
271
- icon: <ReadOutlined />,
272
- title: t("使用文档"),
273
- url: `https://${hosts.l7}/${language}/docs/tutorial`,
274
- },
275
- {
276
- icon: <ReadOutlined />,
277
- title: t("API 文档"),
278
- url: `https://${hosts.l7}/${language}/docs/api/l7`,
279
- },
280
- {
281
- icon: <HistoryOutlined />,
282
- title: t("更新日志"),
283
- url: `https://github.com/antvis/L7/blob/master/CHANGELOG.md`,
284
- openExternal: true,
285
- },
286
- {
287
- icon: <GithubOutlined />,
288
- title: t("GitHub 仓库"),
289
- url: `https://github.com/antvis/L7`,
290
- openExternal: true,
291
- },
292
- {
293
- icon: "🇨🇳",
294
- title: t("国内镜像"),
295
- url: `https://antv-l7.gitee.io`,
296
- openExternal: true,
297
- },
298
- ],
299
- },
300
- {
301
- title: "G2Plot",
302
- icon: "https://gw.alipayobjects.com/zos/antfincdn/SlbIagEvT7/G2plot.svg",
303
- slogan: t("开箱即用的图表库"),
304
- description: t("开箱即用、易于配置、极致体验的通用图表库。"),
305
- category: Categories[1],
306
- links: [
307
- {
308
- icon: <HomeOutlined />,
309
- title: t("产品首页"),
310
- url: `https://${hosts.g2plot}/${language}`,
311
- },
312
- {
313
- icon: <PieChartOutlined />,
314
- title: t("图表示例"),
315
- url: `https://${hosts.g2plot}/${language}/examples`,
316
- },
317
- {
318
- icon: <ReadOutlined />,
319
- title: t("使用文档"),
320
- url: `https://${hosts.g2plot}/${language}/docs/manual`,
321
- },
322
- {
323
- icon: <ReadOutlined />,
324
- title: t("API 文档"),
325
- url: `https://${hosts.g2plot}/${language}/docs/api`,
326
- },
327
- {
328
- icon: <HistoryOutlined />,
329
- title: t("更新日志"),
330
- url: `https://github.com/antvis/g2plot/blob/master/CHANGELOG.md`,
331
- openExternal: true,
332
- },
333
- {
334
- icon: <GithubOutlined />,
335
- title: t("GitHub 仓库"),
336
- url: `https://github.com/antvis/g2plot`,
337
- openExternal: true,
338
- },
339
- {
340
- icon: "🇨🇳",
341
- title: t("国内镜像"),
342
- url: `https://antv-g2plot.gitee.io`,
343
- openExternal: true,
344
- },
345
- ],
346
- },
347
-
348
- {
349
- title: "F2Native",
350
- icon:
351
- "https://gw.alipayobjects.com/zos/antfincdn/D%26fDbWqVkv/F2%252520yidongduankeshihuafangan.svg",
352
- slogan: t("移动可视化方案"),
353
- description: t(
354
- "跨平台高性能的移动端可视化解决方案,满足你的各种图表需求。"
355
- ),
356
- category: Categories[1],
357
- links: [
358
- {
359
- icon: <HomeOutlined />,
360
- title: t("产品首页"),
361
- url: `https://${hosts.f2native}/${language}`,
362
- },
363
- {
364
- icon: <PieChartOutlined />,
365
- title: t("图表示例"),
366
- url: `https://${hosts.f2native}/${language}/docs/examples`,
367
- },
368
- {
369
- icon: <ReadOutlined />,
370
- title: t("使用文档"),
371
- url: `https://${hosts.f2native}/${language}/docs/tutorial/getting-started`,
372
- },
373
- {
374
- icon: <ReadOutlined />,
375
- title: t("API 文档"),
376
- url: `https://${hosts.f2native}/${language}/docs/api/API`,
377
- },
378
- {
379
- icon: <GithubOutlined />,
380
- title: t("GitHub 仓库"),
381
- url: `https://github.com/antvis/f2`,
382
- openExternal: true,
383
- },
384
- {
385
- icon: "🇨🇳",
386
- title: t("国内镜像"),
387
- url: `https://antv-f2.gitee.io`,
388
- openExternal: true,
389
- },
390
- ],
391
- },
392
-
393
- {
394
- title: "Graphin",
395
- icon: "https://gw.alipayobjects.com/zos/antfincdn/0b4HzOcEJY/Graphin.svg",
396
- slogan: t(""),
397
- description: t("基于 G6 封装的图分析应用组件。"),
398
- category: Categories[1],
399
- links: [
400
- {
401
- icon: <HomeOutlined />,
402
- title: t("产品首页"),
403
- url: `https://${hosts.graphin}/${language}`,
404
- },
405
- {
406
- icon: <PieChartOutlined />,
407
- title: t("组件示例"),
408
- url: `https://${hosts.graphin}/${language}/examples`,
409
- },
410
- {
411
- icon: <ReadOutlined />,
412
- title: t("使用文档"),
413
- url: `https://${hosts.graphin}/${language}/docs/manual/introduction`,
414
- },
415
- {
416
- icon: <ReadOutlined />,
417
- title: t("API 文档"),
418
- url: `https://${hosts.graphin}/${language}/docs/api/graphin`,
419
- },
420
- {
421
- icon: <HistoryOutlined />,
422
- title: t("更新日志"),
423
- url: `https://github.com/antvis/graphin/blob/master/CHANGELOG.md`,
424
- openExternal: true,
425
- },
426
- {
427
- icon: <GithubOutlined />,
428
- title: t("GitHub 仓库"),
429
- url: `https://github.com/antvis/graphin`,
430
- openExternal: true,
431
- },
432
- {
433
- icon: "🇨🇳",
434
- title: t("国内镜像"),
435
- url: `https://antv-graphin.gitee.io`,
436
- openExternal: true,
437
- },
438
- ],
439
- },
440
-
441
- {
442
- title: "AVA",
443
- icon:
444
- "https://gw.alipayobjects.com/zos/bmw-prod/1069c628-7460-4b09-a649-0f2ad64dfc78.svg",
445
- slogan: t(""),
446
- description: t("AVA 是为了更简便的可视分析而生的技术框架。"),
447
- category: Categories[1],
448
- links: [
449
- {
450
- icon: <HomeOutlined />,
451
- title: t("产品首页"),
452
- url: `https://${hosts.ava}/${language}`,
453
- },
454
- {
455
- icon: <PieChartOutlined />,
456
- title: t("图表示例"),
457
- url: `https://${hosts.ava}/${language}/examples`,
458
- },
459
- {
460
- icon: <ReadOutlined />,
461
- title: t("使用文档"),
462
- url: `https://${hosts.ava}/${language}/docs/guide`,
463
- },
464
- {
465
- icon: <ReadOutlined />,
466
- title: t("API 文档"),
467
- url: `https://${hosts.ava}/${language}/docs/api`,
468
- },
469
- {
470
- icon: <GithubOutlined />,
471
- title: t("GitHub 仓库"),
472
- url: `https://github.com/antvis/ava`,
473
- openExternal: true,
474
- },
475
- {
476
- icon: "🇨🇳",
477
- title: t("国内镜像"),
478
- url: `https://antv-ava.gitee.io`,
479
- openExternal: true,
480
- },
481
- ],
482
- },
483
- {
484
- title: "ChartCube",
485
- icon:
486
- "https://gw.alipayobjects.com/zos/antfincdn/Zr74jx8YNX/chartcube.svg",
487
- slogan: t("图表魔方"),
488
- description: t("AntV 在线图表制作利器。"),
489
- category: Categories[1],
490
- links: [
491
- {
492
- icon: <HomeOutlined />,
493
- title: t("产品首页"),
494
- url: `https://chartcube.alipay.com`,
495
- openExternal: true,
496
- },
497
- {
498
- icon: <AreaChartOutlined />,
499
- title: t("生成图表"),
500
- url: `https://chartcube.alipay.com/guide`,
501
- openExternal: true,
502
- },
503
- {
504
- icon: <YuqueOutlined />,
505
- title: t("语雀社区"),
506
- url: `https://www.yuque.com/chartcube`,
507
- openExternal: true,
508
- },
509
- {
510
- icon: <DingdingOutlined />,
511
- title: t("钉钉服务群"),
512
- url: `dingtalk://dingtalkclient/action/joingroup?cid=8305538734`,
513
- openExternal: true,
514
- },
515
- ],
516
- },
517
- {
518
- title: t("墨者学院"),
519
- icon:
520
- "https://gw.alipayobjects.com/zos/antfincdn/12j36RPVldO/mozhexueyuan.svg",
521
- description: t("数据可视化社团"),
522
- category: Categories[2],
523
- links: [
524
- {
525
- title: t("学院首页"),
526
- url: `https://www.yuque.com/mo-college`,
527
- openExternal: true,
528
- },
529
- ],
530
- },
531
- {
532
- title: "BizCharts",
533
- icon:
534
- "https://gw.alipayobjects.com/zos/antfincdn/Q1pbg%26O2TM/BizCharts.svg",
535
- description: t("基于商业场景下的数据可视化解决方案"),
536
- category: Categories[2],
537
- links: [
538
- {
539
- title: t("产品首页"),
540
- url: "https://bizcharts.net",
541
- openExternal: true,
542
- },
543
- ],
544
- },
545
- {
546
- title: "Ant Design Charts",
547
- icon:
548
- "https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg",
549
- description: t("基于 G2Plot 实现的 React 可视化图表库"),
550
- category: Categories[2],
551
- links: [
552
- {
553
- title: t("产品首页"),
554
- url: `https://charts.ant.design/`,
555
- openExternal: true,
556
- },
557
- ],
558
- },
559
- ];
560
-
561
- return products;
562
- };
563
-
564
- const CATEGORY_TYPE = tuple("basic", "extension", "mobile", "ecology");
565
- export const CATEGORIES: Array<{
566
- type: typeof CATEGORY_TYPE[number];
567
- name: string;
568
- }> = [
569
- { type: "basic", name: "标准版基础产品" },
570
- { type: "extension", name: "标准版扩展产品" },
571
- { type: "mobile", name: "移动定制(F版)产品" },
572
- { type: "ecology", name: "周边生态" },
573
- ];
574
-
575
- export type ProductType = {
576
- links: {
577
- /** 产品首页 */
578
- readonly home?: { url: string; title?: string };
579
- /** 图表示例 */
580
- readonly example?: { url: string; title?: string };
581
- /** 使用文档 */
582
- readonly api?: { url: string; title?: string };
583
- };
584
- [k: string]: any;
585
- };
586
-
587
- export function getNewProducts({
588
- language,
589
- isChinaMirrorHost,
590
- }: {
591
- language: "zh" | "en";
592
- isChinaMirrorHost: boolean;
593
- }): Promise<ProductType[]> {
594
- // 如需要修改产品信息,请到 https://yuyan.antfin-inc.com/datavprod/antv-site-datas/schemas/site-products-h5data/console 修改区块内容
595
- return fetch(
596
- "https://render.alipay.com/p/h5data/antv-site-datas_site-products-h5data.json"
597
- )
598
- .then((res) => res.json())
599
- .then((products: ProductType[]) => {
600
- return products
601
- .filter((d) => d.lang === language)
602
- .map((d) => {
603
- const links =
604
- typeof d.links === "string" ? JSON.parse(d.links) : { ...d.links };
605
- const newLinks: any = {};
606
-
607
- each(links, (value, k: string) => {
608
- let actualUrl = value?.url || "";
609
- if (isChinaMirrorHost) {
610
- // g2plot.antv.vision => antv-g2plot.gitee.io
611
- const match = actualUrl.match(
612
- /([http|https]):\/\/(.*)\.antv\.vision/
613
- );
614
- if (match && match[2]) {
615
- actualUrl = actualUrl.replace(
616
- `${match[2]}.antv.vision`,
617
- `antv-${match[2]}.gitee.io`
618
- );
619
- }
620
- }
621
- newLinks[k] = { ...value, url: actualUrl };
622
- });
623
- return { ...d, links: newLinks };
624
- });
625
- });
626
- }
@@ -1,70 +0,0 @@
1
- import classNames from "classnames";
2
- import React from "react";
3
- import { useTranslation } from "react-i18next";
4
- import { useChinaMirrorHost } from "../hooks";
5
- import { CATEGORIES, getNewProducts, ProductType } from "./getProducts";
6
- import Product from "./Product";
7
- //@ts-ignore
8
- import styles from "./Product.module.less";
9
-
10
- interface ProductsProps {
11
- show: boolean;
12
- rootDomain: string;
13
- language?: "zh" | "en";
14
- className?: string;
15
- }
16
-
17
- const Products: React.FC<ProductsProps> = ({ show, language, className }) => {
18
- const { t, i18n } = useTranslation();
19
- const [isChinaMirrorHost] = useChinaMirrorHost();
20
- const [products, setProducts] = React.useState<ProductType[]>([]);
21
-
22
- const lang = i18n.language === "zh" ? "zh" : "en";
23
- React.useEffect(() => {
24
- getNewProducts({
25
- language: lang,
26
- isChinaMirrorHost,
27
- }).then((data) => {
28
- setProducts(data);
29
- });
30
- }, [lang, isChinaMirrorHost]);
31
-
32
- return (
33
- <>
34
- <div
35
- className={classNames(styles.products, className, {
36
- [styles.show]: !!show,
37
- })}
38
- >
39
- <div className={styles.container}>
40
- {CATEGORIES.map(({ name, type }, idx) => {
41
- return (
42
- <React.Fragment key={idx}>
43
- <h3>{t(name)}</h3>
44
- <ul>
45
- {products
46
- .filter((item) => item.category === type)
47
- .map((product) => (
48
- <Product
49
- key={product.title}
50
- name={product.title}
51
- slogan={product.slogan || ""}
52
- description={product.description}
53
- url={product.links?.home?.url}
54
- icon={product.icon as string}
55
- links={product.links}
56
- language={language || i18n.language}
57
- />
58
- ))}
59
- </ul>
60
- </React.Fragment>
61
- );
62
- })}
63
- </div>
64
- </div>
65
- <div className={styles.mask} />
66
- </>
67
- );
68
- };
69
-
70
- export default Products;