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

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 (258) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -33
  3. package/dist/builtins/Playground/index.d.ts +24 -0
  4. package/{es/builtins/Example.js → dist/builtins/Playground/index.js} +40 -33
  5. package/dist/builtins/Playground/index.module.less +15 -0
  6. package/dist/context.d.ts +5 -0
  7. package/dist/context.js +2 -0
  8. package/dist/layouts/DocLayout.d.ts +7 -0
  9. package/dist/layouts/DocLayout.js +38 -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 +71 -0
  14. package/dist/layouts/entry/Manual.d.ts +8 -0
  15. package/dist/layouts/entry/Manual.js +14 -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 +14 -0
  20. package/dist/pages/Example/index.d.ts +6 -0
  21. package/dist/pages/Example/index.js +139 -0
  22. package/dist/pages/Example/index.module.less +40 -0
  23. package/dist/pages/Examples/components/Accouncement/index.d.ts +6 -0
  24. package/dist/pages/Examples/components/Accouncement/index.js +60 -0
  25. package/dist/pages/Examples/components/Accouncement/index.module.less +9 -0
  26. package/dist/pages/Examples/components/Article/index.d.ts +2 -0
  27. package/dist/pages/Examples/components/Article/index.js +8 -0
  28. package/dist/pages/Examples/components/Article/index.module.less +2 -0
  29. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.d.ts +10 -0
  30. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.js +74 -0
  31. package/dist/pages/Examples/components/ExampleTopicMenu/index.d.ts +9 -0
  32. package/{es/builtins/Table.js → dist/pages/Examples/components/ExampleTopicMenu/index.js} +47 -41
  33. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.d.ts +10 -0
  34. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.js +33 -0
  35. package/dist/pages/Examples/components/GalleryPageContent/index.d.ts +10 -0
  36. package/dist/pages/Examples/components/GalleryPageContent/index.js +81 -0
  37. package/dist/pages/Examples/index.d.ts +8 -0
  38. package/dist/pages/Examples/index.js +75 -0
  39. package/dist/pages/Examples/index.module.less +605 -0
  40. package/dist/pages/Examples/types.d.ts +33 -0
  41. package/dist/pages/Examples/types.js +1 -0
  42. package/dist/plugin/examples.d.ts +7 -0
  43. package/dist/plugin/examples.js +83 -0
  44. package/dist/plugin/index.d.ts +3 -0
  45. package/dist/plugin/index.js +103 -0
  46. package/dist/slots/404.d.ts +2 -0
  47. package/{es/antv/404/index.js → dist/slots/404.js} +4 -9
  48. package/{es/antv/Cases/Cases.d.ts → dist/slots/Cases/index.d.ts} +4 -4
  49. package/{es/antv/Cases/Cases.js → dist/slots/Cases/index.js} +25 -25
  50. package/{src/antv/Cases/Cases.module.less → dist/slots/Cases/index.module.less} +36 -5
  51. package/dist/slots/CodeEditor/Toolbar.d.ts +67 -0
  52. package/dist/slots/CodeEditor/Toolbar.js +152 -0
  53. package/dist/slots/CodeEditor/Toolbar.module.less +81 -0
  54. package/dist/slots/CodeEditor/index.d.ts +58 -0
  55. package/dist/slots/CodeEditor/index.js +200 -0
  56. package/dist/slots/CodeEditor/index.module.less +11 -0
  57. package/dist/slots/CodeEditor/utils.d.ts +42 -0
  58. package/dist/slots/CodeEditor/utils.js +157 -0
  59. package/dist/slots/CodePreview/CodeHeader.d.ts +19 -0
  60. package/dist/slots/CodePreview/CodeHeader.js +32 -0
  61. package/dist/slots/CodePreview/CodeHeader.module.less +0 -0
  62. package/dist/slots/CodePreview/index.d.ts +17 -0
  63. package/dist/slots/CodePreview/index.js +29 -0
  64. package/dist/slots/CodePreview/index.module.less +42 -0
  65. package/dist/slots/CodeRunner/index.d.ts +14 -0
  66. package/dist/slots/CodeRunner/index.js +76 -0
  67. package/dist/slots/CodeRunner/index.module.less +0 -0
  68. package/dist/slots/CodeRunner/utils.d.ts +10 -0
  69. package/dist/slots/CodeRunner/utils.js +36 -0
  70. package/dist/slots/Companies/index.d.ts +13 -0
  71. package/dist/slots/Companies/index.js +49 -0
  72. package/dist/slots/Companies/index.module.less +82 -0
  73. package/dist/slots/Detail/News.d.ts +9 -0
  74. package/{es/antv/Banner/Notification.js → dist/slots/Detail/News.js} +8 -11
  75. package/{src/antv/Banner/Notification.module.less → dist/slots/Detail/News.module.less} +15 -3
  76. package/dist/slots/Detail/index.d.ts +26 -0
  77. package/dist/slots/Detail/index.js +124 -0
  78. package/{src/antv/Banner/Banner.module.less → dist/slots/Detail/index.module.less} +42 -74
  79. package/dist/slots/ExampleSider/index.d.ts +55 -0
  80. package/dist/slots/ExampleSider/index.js +218 -0
  81. package/dist/slots/ExampleSider/index.module.less +141 -0
  82. package/{es/antv → dist/slots}/Features/FeatureCard.d.ts +1 -1
  83. package/{es/antv → dist/slots}/Features/FeatureCard.js +6 -6
  84. package/{src/antv → dist/slots}/Features/FeatureCard.module.less +8 -1
  85. package/{es/antv → dist/slots}/Features/index.d.ts +2 -2
  86. package/{es/antv → dist/slots}/Features/index.js +17 -25
  87. package/{src/antv/Features/Features.module.less → dist/slots/Features/index.module.less} +34 -3
  88. package/dist/slots/Footer/index.d.ts +18 -0
  89. package/dist/slots/Footer/index.js +187 -0
  90. package/dist/slots/Footer/index.module.less +85 -0
  91. package/dist/slots/Header/Logo.d.ts +7 -0
  92. package/{es/antv → dist/slots}/Header/Logo.js +6 -2
  93. package/dist/slots/Header/LogoWhite.d.ts +7 -0
  94. package/dist/slots/Header/LogoWhite.js +19 -0
  95. package/dist/slots/Header/Navs.d.ts +17 -0
  96. package/dist/slots/Header/Navs.js +46 -0
  97. package/dist/slots/Header/Products/NavigatorBanner.d.ts +10 -0
  98. package/dist/slots/Header/Products/NavigatorBanner.js +34 -0
  99. package/dist/slots/Header/Products/NavigatorBanner.module.less +39 -0
  100. package/{es/antv → dist/slots/Header}/Products/Product.d.ts +3 -3
  101. package/{es/antv → dist/slots/Header}/Products/Product.js +11 -16
  102. package/{src/antv → dist/slots/Header}/Products/Product.module.less +10 -8
  103. package/{es/antv → dist/slots/Header}/Products/getProducts.d.ts +2 -7
  104. package/dist/slots/Header/Products/getProducts.js +67 -0
  105. package/dist/slots/Header/Products/index.d.ts +9 -0
  106. package/{es/antv → dist/slots/Header}/Products/index.js +15 -22
  107. package/dist/slots/Header/Search.d.ts +12 -0
  108. package/dist/slots/Header/Search.js +90 -0
  109. package/dist/slots/Header/Search.module.less +39 -0
  110. package/dist/slots/Header/index.d.ts +66 -0
  111. package/dist/slots/Header/index.js +379 -0
  112. package/dist/slots/Header/index.module.less +382 -0
  113. package/dist/slots/Header/utils.d.ts +1 -0
  114. package/dist/slots/Header/utils.js +26 -0
  115. package/dist/slots/Loading/index.d.ts +2 -0
  116. package/dist/slots/Loading/index.js +65 -0
  117. package/dist/slots/Loading/index.module.less +12 -0
  118. package/dist/slots/Loading.d.ts +5 -0
  119. package/dist/slots/Loading.js +8 -0
  120. package/dist/slots/ManualContent/NavigatorBanner.d.ts +9 -0
  121. package/dist/slots/ManualContent/NavigatorBanner.js +36 -0
  122. package/dist/slots/ManualContent/NavigatorBanner.module.less +39 -0
  123. package/dist/slots/ManualContent/ReadingTime.d.ts +3 -0
  124. package/dist/slots/ManualContent/ReadingTime.js +10 -0
  125. package/dist/slots/ManualContent/index.d.ts +9 -0
  126. package/dist/slots/ManualContent/index.js +321 -0
  127. package/dist/slots/ManualContent/index.module.less +656 -0
  128. package/dist/slots/TOC.d.ts +5 -0
  129. package/dist/slots/TOC.js +6 -0
  130. package/dist/slots/_.less +83 -0
  131. package/dist/slots/global.d.ts +1 -0
  132. package/dist/slots/global.js +7 -0
  133. package/dist/slots/hooks.d.ts +16 -0
  134. package/{es/antv → dist/slots}/hooks.js +60 -37
  135. package/dist/slots/utils.d.ts +20 -0
  136. package/dist/slots/utils.js +154 -0
  137. package/dist/types.d.ts +3 -0
  138. package/dist/types.js +1 -0
  139. package/dist/typings.d.ts +137 -0
  140. package/package.json +108 -47
  141. package/es/antv/404/index.d.ts +0 -2
  142. package/es/antv/Banner/Banner.module.less +0 -412
  143. package/es/antv/Banner/Notification.d.ts +0 -10
  144. package/es/antv/Banner/Notification.module.less +0 -108
  145. package/es/antv/Banner/index.d.ts +0 -25
  146. package/es/antv/Banner/index.js +0 -104
  147. package/es/antv/Cases/Cases.module.less +0 -203
  148. package/es/antv/Features/FeatureCard.module.less +0 -51
  149. package/es/antv/Features/Features.module.less +0 -169
  150. package/es/antv/Footer/Footer.module.less +0 -36
  151. package/es/antv/Footer/index.d.ts +0 -12
  152. package/es/antv/Footer/index.js +0 -237
  153. package/es/antv/Header/Logo.d.ts +0 -4
  154. package/es/antv/Products/Product.module.less +0 -146
  155. package/es/antv/Products/getNewProducts.d.ts +0 -24
  156. package/es/antv/Products/getNewProducts.js +0 -35
  157. package/es/antv/Products/getProducts.js +0 -460
  158. package/es/antv/Products/index.d.ts +0 -9
  159. package/es/antv/hooks.d.ts +0 -14
  160. package/es/antv/mixins.less +0 -21
  161. package/es/antv/utils.d.ts +0 -5
  162. package/es/antv/utils.js +0 -49
  163. package/es/builtins/API.d.ts +0 -3
  164. package/es/builtins/API.js +0 -37
  165. package/es/builtins/Alert.d.ts +0 -3
  166. package/es/builtins/Alert.js +0 -7
  167. package/es/builtins/Alert.less +0 -62
  168. package/es/builtins/Badge.d.ts +0 -3
  169. package/es/builtins/Badge.js +0 -7
  170. package/es/builtins/Badge.less +0 -31
  171. package/es/builtins/Example.d.ts +0 -5
  172. package/es/builtins/Example.less +0 -47
  173. package/es/builtins/Previewer.d.ts +0 -39
  174. package/es/builtins/Previewer.js +0 -225
  175. package/es/builtins/Previewer.less +0 -406
  176. package/es/builtins/SourceCode.d.ts +0 -10
  177. package/es/builtins/SourceCode.js +0 -70
  178. package/es/builtins/SourceCode.less +0 -103
  179. package/es/builtins/Table.d.ts +0 -4
  180. package/es/builtins/Table.less +0 -43
  181. package/es/builtins/Tree.d.ts +0 -4
  182. package/es/builtins/Tree.js +0 -213
  183. package/es/builtins/Tree.less +0 -159
  184. package/es/components/Dark.d.ts +0 -9
  185. package/es/components/Dark.js +0 -125
  186. package/es/components/Dark.less +0 -121
  187. package/es/components/LocaleSelect.d.ts +0 -6
  188. package/es/components/LocaleSelect.js +0 -53
  189. package/es/components/LocaleSelect.less +0 -59
  190. package/es/components/Navbar.d.ts +0 -10
  191. package/es/components/Navbar.js +0 -155
  192. package/es/components/Navbar.less +0 -180
  193. package/es/components/SearchBar.d.ts +0 -4
  194. package/es/components/SearchBar.js +0 -81
  195. package/es/components/SearchBar.less +0 -165
  196. package/es/components/SideMenu.d.ts +0 -10
  197. package/es/components/SideMenu.js +0 -99
  198. package/es/components/SideMenu.less +0 -379
  199. package/es/components/SlugList.d.ts +0 -7
  200. package/es/components/SlugList.js +0 -38
  201. package/es/components/SlugList.less +0 -18
  202. package/es/declaration.d.ts +0 -1
  203. package/es/layout.d.ts +0 -5
  204. package/es/layout.js +0 -276
  205. package/es/style/layout.less +0 -402
  206. package/es/style/markdown.less +0 -240
  207. package/es/style/variables.less +0 -37
  208. package/src/antv/404/index.tsx +0 -25
  209. package/src/antv/Banner/Notification.tsx +0 -45
  210. package/src/antv/Banner/index.tsx +0 -139
  211. package/src/antv/Cases/Cases.tsx +0 -116
  212. package/src/antv/Features/FeatureCard.tsx +0 -24
  213. package/src/antv/Features/index.tsx +0 -86
  214. package/src/antv/Footer/Footer.module.less +0 -36
  215. package/src/antv/Footer/index.tsx +0 -272
  216. package/src/antv/Header/Logo.tsx +0 -85
  217. package/src/antv/Products/Product.tsx +0 -80
  218. package/src/antv/Products/getNewProducts.tsx +0 -53
  219. package/src/antv/Products/getProducts.tsx +0 -626
  220. package/src/antv/Products/index.tsx +0 -70
  221. package/src/antv/hooks.ts +0 -87
  222. package/src/antv/mixins.less +0 -21
  223. package/src/antv/utils.ts +0 -44
  224. package/src/builtins/API.tsx +0 -57
  225. package/src/builtins/Alert.less +0 -62
  226. package/src/builtins/Alert.tsx +0 -4
  227. package/src/builtins/Badge.less +0 -31
  228. package/src/builtins/Badge.tsx +0 -4
  229. package/src/builtins/Example.less +0 -47
  230. package/src/builtins/Example.tsx +0 -34
  231. package/src/builtins/Previewer.less +0 -406
  232. package/src/builtins/Previewer.tsx +0 -264
  233. package/src/builtins/SourceCode.less +0 -103
  234. package/src/builtins/SourceCode.tsx +0 -55
  235. package/src/builtins/Table.less +0 -43
  236. package/src/builtins/Table.tsx +0 -42
  237. package/src/builtins/Tree.less +0 -159
  238. package/src/builtins/Tree.tsx +0 -130
  239. package/src/components/Dark.less +0 -121
  240. package/src/components/Dark.tsx +0 -78
  241. package/src/components/LocaleSelect.less +0 -59
  242. package/src/components/LocaleSelect.tsx +0 -53
  243. package/src/components/Navbar.less +0 -180
  244. package/src/components/Navbar.tsx +0 -152
  245. package/src/components/SearchBar.less +0 -165
  246. package/src/components/SearchBar.tsx +0 -68
  247. package/src/components/SideMenu.less +0 -379
  248. package/src/components/SideMenu.tsx +0 -148
  249. package/src/components/SlugList.less +0 -18
  250. package/src/components/SlugList.tsx +0 -20
  251. package/src/declaration.d.ts +0 -1
  252. package/src/layout.tsx +0 -225
  253. package/src/style/layout.less +0 -402
  254. package/src/style/markdown.less +0 -240
  255. package/src/style/variables.less +0 -37
  256. package/src/test/SearchBar.test.ts +0 -32
  257. package/src/test/Table.test.tsx +0 -41
  258. package/src/test/index.test.tsx +0 -377
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,55 +1,54 @@
1
- # dumi-theme-antv
1
+ # @antv/dumi-theme-antv
2
2
 
3
- dumi theme for antv site
3
+ [![NPM version](https://img.shields.io/npm/v/@antv/dumi-theme-antv.svg?style=flat)](https://npmjs.org/package/@antv/dumi-theme-antv)
4
+ [![NPM downloads](http://img.shields.io/npm/dm/@antv/dumi-theme-antv.svg?style=flat)](https://npmjs.org/package/@antv/dumi-theme-antv)
4
5
 
5
- ## Install
6
+ A theme package for the [dumi](https://next.d.umijs.org) framework.
6
7
 
7
- ```
8
- yarn add @antv/dumi-theme-antv --save-dev
8
+ ## Usage
9
9
 
10
- ```
10
+ Install this theme into `devDependencies`:
11
11
 
12
- ## Usage
12
+ ```bash
13
+ $ npm i @antv/dumi-theme-antv -D
14
+ ```
13
15
 
14
- > Refer to the documentation for the [Dumi theme](https://d.umijs.org/zh-CN/config#themeconfig)
16
+ Configure it in dumi config file `.dumirc.ts`:
15
17
 
16
- <strong >note ⚠️<strong>
17
- Since `*.module.less` is used in `@antv/dumi-theme-antv`, extraBabelIncludes needs to be configured:
18
+ ```ts
19
+ import { defineConfig } from 'dumi';
18
20
 
19
- ```tsx
20
- export default {
21
- //...
22
- mode: "site",
23
- extraBabelIncludes: ["@antv/dumi-theme-antv"],
24
- };
21
+ export defineConfig({
22
+ themeConfig: {
23
+ ...
24
+ },
25
+ });
25
26
  ```
26
27
 
27
- ## Contributing
28
+ That's all, now you can execute `dumi dev` and enjoy this theme.
28
29
 
29
- ### Development install
30
+ ## Options
30
31
 
31
- - start `@antv/dumi-theme-antv`
32
+ TODO
32
33
 
33
- ```bash
34
- - 1. git clone https://github.com/antvis/dumi-theme-antv.git
35
- - 2. yarn // install deps
36
- - 3. npm run start //start dev
34
+ ## Development
37
35
 
36
+ ```bash
37
+ $ tnpm install
38
38
  ```
39
39
 
40
- - start demo of antv sub product site
40
+ After the dependencies are installed, a symlink from `example/.dumi/theme` to `../../src` will be created automatically, the symlink makes dumi load our theme package as a local theme, so we can start the example directly, HMR is also available:
41
41
 
42
42
  ```bash
43
+ # switch to example directory
44
+ $ cd example
43
45
 
44
- - 1. npm link
45
-
46
- - 2. cd site
47
-
48
- - 3. note: remove `@antv/dumi-theme-antv` from `devDependencies` in `package.json`
46
+ # start dev server to preview
47
+ npm run dev
48
+ ```
49
49
 
50
- - 4. yarn // install deps
50
+ dumi theme development documentation: https://next.d.umijs.org/theme
51
51
 
52
- - 5. npm link @antv/dumi-theme-antv
52
+ ## LICENSE
53
53
 
54
- - 6. npm run start
55
- ```
54
+ MIT
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ export declare type PlaygroundProps = {
3
+ /**
4
+ * 代码示例的地址
5
+ */
6
+ path: string;
7
+ /**
8
+ * 渲染容器的 id,默认为 container
9
+ */
10
+ rid?: string;
11
+ /**
12
+ * 预览区、代码区的宽度占比,默认为 0.62
13
+ */
14
+ ratio?: number;
15
+ /**
16
+ * 容器的高度,默认为 400px
17
+ */
18
+ height?: number;
19
+ };
20
+ /**
21
+ * Markdown 标签插件 Playground
22
+ */
23
+ declare const Playground: React.FC<PlaygroundProps>;
24
+ export default Playground;
@@ -10,39 +10,46 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
10
10
 
11
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
- import React, { useRef, useEffect, useState } from 'react';
14
- import './Example.less';
15
- export default (function (props) {
16
- var elm = useRef();
17
-
18
- var _useState = useState(0),
19
- _useState2 = _slicedToArray(_useState, 2),
20
- height = _useState2[0],
21
- setHeight = _useState2[1];
22
-
23
- useEffect(function () {
24
- setHeight(elm.current.contentWindow.document.documentElement.scrollHeight);
25
- }, [elm]);
26
- return props.route.meta.examplePath && /*#__PURE__*/React.createElement("div", {
27
- className: "__dumi-default-example-wrapper"
28
- }, /*#__PURE__*/React.createElement("div", {
29
- className: "__dumi-default-example-wrapper-toolbar"
30
- }, props.route.meta.description || props.route.meta.title, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("button", {
31
- className: "__dumi-default-icon",
32
- onClick: function onClick() {
33
- return elm.current.contentWindow.location.reload();
34
- }
35
- }), /*#__PURE__*/React.createElement("a", {
36
- target: "_blank",
37
- rel: "noopener noreferrer",
38
- href: props.route.meta.examplePath,
39
- className: "__dumi-default-icon"
40
- }))), /*#__PURE__*/React.createElement("iframe", {
41
- src: props.route.meta.examplePath,
42
- ref: elm,
13
+ import React, { useContext } from 'react';
14
+ import { ThemeAntVContext } from "../../context";
15
+ import { CodeRunner } from "../../slots/CodeRunner";
16
+ import styles from "./index.module.less";
17
+
18
+ /**
19
+ * Markdown 标签插件 Playground
20
+ */
21
+ var Playground = function Playground(_ref) {
22
+ var rid = _ref.rid,
23
+ path = _ref.path,
24
+ _ref$ratio = _ref.ratio,
25
+ ratio = _ref$ratio === void 0 ? 0.62 : _ref$ratio,
26
+ _ref$height = _ref.height,
27
+ height = _ref$height === void 0 ? 400 : _ref$height;
28
+
29
+ /** 示例页面的元数据信息 */
30
+ var _useContext = useContext(ThemeAntVContext),
31
+ meta = _useContext.meta;
32
+
33
+ var exampleTopics = meta.exampleTopics; // '/case/area/demo/area5.ts'
34
+
35
+ var _ref2 = path.match(/\/([\w-]+)\/([\w-]+)\/demo\/([\w-]+)/i),
36
+ _ref3 = _slicedToArray(_ref2, 4),
37
+ _ = _ref3[0],
38
+ topic = _ref3[1],
39
+ example = _ref3[2],
40
+ demo = _ref3[3];
41
+
42
+ return /*#__PURE__*/React.createElement("div", {
43
+ className: styles.container,
43
44
  style: {
44
45
  height: height
45
- },
46
- title: "dumi"
46
+ }
47
+ }, /*#__PURE__*/React.createElement(CodeRunner, {
48
+ exampleTopics: exampleTopics,
49
+ topic: topic,
50
+ example: example,
51
+ demo: demo
47
52
  }));
48
- });
53
+ };
54
+
55
+ export default Playground;
@@ -0,0 +1,15 @@
1
+ @import 'antd/es/style/themes/default.less';
2
+ @import '../../slots/_.less';
3
+
4
+ .container {
5
+ width: 100%;
6
+ height: 400px;
7
+ position: relative;
8
+
9
+ margin: 0;
10
+ padding: 0;
11
+ border: 1px solid #f0f0f0;
12
+ border-radius: 4px;
13
+ background: #fff;
14
+ overflow: hidden;
15
+ }
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export declare type IThemeAntVContext = {
3
+ exampleTopics?: ExamplesPage.ExampleTopic[];
4
+ };
5
+ export declare const ThemeAntVContext: import("react").Context<IThemeAntVContext>;
@@ -0,0 +1,2 @@
1
+ import { createContext } from 'react';
2
+ export var ThemeAntVContext = /*#__PURE__*/createContext({});
@@ -0,0 +1,7 @@
1
+ import '../slots/global';
2
+ import '../slots/_.less';
3
+ /**
4
+ * DocuLayout 是 dumi2 的内置 layout 入口,在这里使用页面路径进行区分成自己不同的 Layout。
5
+ */
6
+ declare const _default: () => any;
7
+ export default _default;
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { useOutlet, useLocation } from 'dumi';
3
+ import { Index } from "./entry/Index";
4
+ import { API } from "./entry/API";
5
+ import { Manual } from "./entry/Manual"; // 用户手动添加自己的
6
+
7
+ import "../slots/global";
8
+ import "../slots/_.less";
9
+ /**
10
+ * DocuLayout 是 dumi2 的内置 layout 入口,在这里使用页面路径进行区分成自己不同的 Layout。
11
+ */
12
+
13
+ export default (function () {
14
+ var outlet = useOutlet();
15
+
16
+ var _useLocation = useLocation(),
17
+ pathname = _useLocation.pathname;
18
+
19
+ var p = pathname.toLowerCase(); // @todo 南洋
20
+ // 做一些跳转,比如:/zh/examples/xxx -> /examples/xxx
21
+ // 首页
22
+
23
+ if (p === '/' || p === '/en' || p === '/en/') return /*#__PURE__*/React.createElement(Index, null); // API 页面
24
+
25
+ if (p.startsWith('/api') || p.startsWith('/en/api') || // 这两个是兼容之前的
26
+ p.startsWith('/zh/docs/api') || p.startsWith('/en/docs/api')) {
27
+ return /*#__PURE__*/React.createElement(API, null, " ", outlet, " ");
28
+ } // 教程页面
29
+
30
+
31
+ if (p.startsWith('/manual') || p.startsWith('/en/manual') || // 这两个是兼容之前的
32
+ p.startsWith('/zh/docs/manual/') || p.startsWith('/en/docs/manual/')) {
33
+ return /*#__PURE__*/React.createElement(Manual, null, " ", outlet, " ");
34
+ } // More router, add here...
35
+
36
+
37
+ return outlet;
38
+ });
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export declare type APIProps = {
3
+ readonly children: any;
4
+ };
5
+ /**
6
+ * API 路由下的入口
7
+ * - 读取 API markdown 文件
8
+ * - 渲染 UI
9
+ */
10
+ export declare const API: React.FC<APIProps>;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { Manual } from "./Manual";
3
+
4
+ /**
5
+ * API 路由下的入口
6
+ * - 读取 API markdown 文件
7
+ * - 渲染 UI
8
+ */
9
+ export var API = function API(_ref) {
10
+ var children = _ref.children;
11
+ return /*#__PURE__*/React.createElement(Manual, null, children);
12
+ };
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * Index 路由下的入口
4
+ * - 获取数据
5
+ * - 组合 slots 下的木偶组件
6
+ */
7
+ export declare const Index: () => JSX.Element;
@@ -0,0 +1,71 @@
1
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2
+
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
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
+ import React from 'react';
8
+ import { useSiteData } from 'dumi';
9
+ import { Header } from "../../slots/Header";
10
+ import { Detail } from "../../slots/Detail";
11
+ import { Features } from "../../slots/Features";
12
+ import { Cases } from "../../slots/Cases";
13
+ import { Companies } from "../../slots/Companies";
14
+ import { Footer } from "../../slots/Footer";
15
+ import { useT } from "../../slots/hooks";
16
+ /**
17
+ * Index 路由下的入口
18
+ * - 获取数据
19
+ * - 组合 slots 下的木偶组件
20
+ */
21
+
22
+ export var Index = function Index() {
23
+ var _useSiteData = useSiteData(),
24
+ themeConfig = _useSiteData.themeConfig;
25
+
26
+ var title = themeConfig.title,
27
+ siteUrl = themeConfig.siteUrl,
28
+ githubUrl = themeConfig.githubUrl,
29
+ isAntVSite = themeConfig.isAntVSite,
30
+ showSearch = themeConfig.showSearch,
31
+ showGithubCorner = themeConfig.showGithubCorner,
32
+ showGithubStars = themeConfig.showGithubStars,
33
+ showLanguageSwitcher = themeConfig.showLanguageSwitcher,
34
+ showWxQrcode = themeConfig.showWxQrcode,
35
+ defaultLanguage = themeConfig.defaultLanguage,
36
+ showAntVProductsCard = themeConfig.showAntVProductsCard,
37
+ versions = themeConfig.versions,
38
+ ecosystems = themeConfig.ecosystems,
39
+ navs = themeConfig.navs,
40
+ detail = themeConfig.detail,
41
+ news = themeConfig.news,
42
+ companies = themeConfig.companies,
43
+ features = themeConfig.features,
44
+ cases = themeConfig.cases,
45
+ className = themeConfig.className,
46
+ style = themeConfig.style,
47
+ id = themeConfig.id;
48
+
49
+ var detailProps = _objectSpread({
50
+ githubUrl: githubUrl,
51
+ showGithubStars: showGithubStars,
52
+ news: news
53
+ }, detail);
54
+
55
+ var featuresProps = {
56
+ title: title,
57
+ features: features,
58
+ className: className,
59
+ style: style,
60
+ id: id
61
+ };
62
+ var casesProps = {
63
+ cases: cases,
64
+ style: style,
65
+ className: className
66
+ };
67
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, null), /*#__PURE__*/React.createElement(Detail, detailProps), /*#__PURE__*/React.createElement(Features, featuresProps), /*#__PURE__*/React.createElement(Cases, casesProps), /*#__PURE__*/React.createElement(Companies, {
68
+ title: useT("感谢信赖"),
69
+ companies: companies
70
+ }), /*#__PURE__*/React.createElement(Footer, null));
71
+ };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare type ManualProps = {
3
+ readonly children: any;
4
+ };
5
+ /**
6
+ * Manual 路由下的入口
7
+ */
8
+ export declare const Manual: React.FC<ManualProps>;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { ManualContent } from "../../slots/ManualContent";
3
+ import { Header } from "../../slots/Header";
4
+ import { Footer } from "../../slots/Footer";
5
+
6
+ /**
7
+ * Manual 路由下的入口
8
+ */
9
+ export var Manual = function Manual(_ref) {
10
+ var children = _ref.children;
11
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, {
12
+ isHomePage: false
13
+ }), /*#__PURE__*/React.createElement(ManualContent, null, " ", children, " "), /*#__PURE__*/React.createElement(Footer, null));
14
+ };
@@ -0,0 +1,98 @@
1
+ {
2
+ "index.serach": "Search...",
3
+ "所有产品": "Products",
4
+ "周边生态": "Ecosystem",
5
+ "在 GitHub 上编辑": "Edit on GitHub",
6
+ "贡献者": "Contributors",
7
+ "演示": "Examples",
8
+ "代码演示": "Examples",
9
+ "设计指引": "Design Guide",
10
+ "搜索…": "Search…",
11
+ "description": "Collapse all",
12
+ "经典布局": "Classic",
13
+ "三栏布局": "Three Cloumn",
14
+ "两栏布局": "Two Cloumn",
15
+ "分类色板": "Qualitative Palette",
16
+ "顺序色板": "Sequential Palette",
17
+ "发散色板": "Diverging Palette",
18
+ "查看更多色板用法": "For More Useage",
19
+ "切换至电脑视图": "Change to desktop view",
20
+ "切换至平板视图": "Change to tablet view",
21
+ "切换至移动端视图": "Change to mobile view",
22
+ "进入全屏": "Enter Fullscreen",
23
+ "离开全屏": "Exit Fullscreen",
24
+ "产品首页": "Home Page",
25
+ "图表示例": "Examples",
26
+ "现在开始使用": "Getting Started",
27
+ "使用文档": "Manual",
28
+ "组件示例": "Examples",
29
+ "基础产品": "Basic Products",
30
+ "拓展产品": "Extension Products",
31
+ "API 文档": "API",
32
+ "正在施工中...": "Coming Soon...",
33
+ "更新日志": "Changelog",
34
+ "GitHub 仓库": "GitHub Repository",
35
+ "国内镜像": "China Mirror",
36
+ "蚂蚁数据可视化": "Liven Data Lively",
37
+ "AntV 是蚂蚁集团全新一代数据可视化解决方案,致力于提供一套简单方便、专业可靠、无限可能的数据可视化最佳实践。": "AntV is a new generation of data visualization technique from Ant Group. We provide best practices of data visualization with simplicity, convenience, profession, reliability, and infinite possibilities.",
38
+ "可视化引擎": "Visualization Engine",
39
+ "图可视化引擎": "Graph Visualization",
40
+ "移动可视化方案": "Mobile Charts",
41
+ "跨平台高性能的移动端可视化解决方案,满足你的各种图表需求。": "An elegant, interactive and flexible native charting library for mobile.",
42
+ "地理空间数据可视化": "Geospatial Visualization",
43
+ "开箱即用的图表库": "A Charting Library",
44
+ "X6 图编辑引擎": "X6 JavaScript Diagramming Library",
45
+ "图编辑引擎": "JavaScript Diagramming Library",
46
+ "AVA 是为了更简便的可视分析而生的技术框架。": "AVA is a framework for more convenient Visual Analytics.",
47
+ "开箱即用、易于配置、极致体验的通用图表库。": "Pretty interactive charts out of box",
48
+ "图表魔方": "Charts Maker",
49
+ "生成图表": "Create charts",
50
+ "AntV 在线图表制作利器。": "Create pretty charts without code",
51
+ "数据驱动,高度易用,可扩展的可视化图形语法。": "Data-driven visual language with a high level of usability and scalability",
52
+ "便捷的关系数据可视化引擎与图分析工具。": "A Graph Visualization Framework in JavaScript",
53
+ "高性能/高渲染质量的地理空间数据可视化框架。": "Large-scale WebGL-powered Geospatial Data Visualization",
54
+ "专注于移动端的可视化解决方案,兼容 H5/小程序/Weex 等多端环境": "An elegant, interactive and flexible charting library for mobile",
55
+ "基于 G6 封装的图分析应用组件。": "A react toolkit for graph analysis based on G6",
56
+ "极易定制、开箱即用、数据驱动的图编辑引擎": "Data-driven diagramming library with a high level of usability and customization.",
57
+ "跨平台高性能的移动端可视化解决方案,满足你的各种图表需求": "An elegant, interactive and flexible native charting library for mobile.",
58
+ "墨者学院": "Mohist Academy",
59
+ "基于商业场景下的数据可视化解决方案": "Business visualization solution",
60
+ "基于 G2Plot 实现的 React 可视化图表库": "A React chart library based on G2Plot",
61
+ "学院首页": "Home Page",
62
+ "数据可视化社团": "Visualization Community",
63
+ "语雀社区": "Yuque",
64
+ "钉钉服务群": "DingTalk Group",
65
+ "扫码进 ChartCube 服务群": "Scan QRCode",
66
+ "欢迎进入 2020 可视化智能研发时代": "New era of intelligent VIS",
67
+ "AntV 11-22 品牌日:知源·致远": "11-22, AntV brand day!",
68
+ "G2Plot 图表库发布": "G2Plot is released",
69
+ "执行代码": "Run code",
70
+ "在 CodeSandbox 中打开": "Open in CodeSandbox",
71
+ "在 Riddle 中打开": "Open in Riddle",
72
+ "在 StackBlitz 中打开": "Open in StackBlitz",
73
+ "HTML 代码": "Html Source Code",
74
+ "取消": "Cancel",
75
+ "关于我们": "About us",
76
+ "返回旧版": "Old site",
77
+ "查看详情": "More",
78
+ "上新啦,点击直达:": "New demos online. Click to visit: ",
79
+ "React 应用开发框架": "React Application Framework",
80
+ "组件/文档研发工具": "Component doc generator",
81
+ "React Hooks 库": "React Hooks Library",
82
+ "设计动效": "Motion Solution",
83
+ "社区": "Community",
84
+ "StackOverflow": "StackOverflow",
85
+ "体验科技专栏": "Ant Financial Experience Tech",
86
+ "帮助": "Help",
87
+ "蚂蚁体验科技大会": "Experience Tech Conference",
88
+ "标准版基础产品": "Standard basic products",
89
+ "标准版扩展产品": "Standard extended products",
90
+ "移动定制(F版)产品": "Mobile (F series) products",
91
+ "感谢信赖":"WE ARE TRUSTED BY",
92
+ "更多产品":"More Productions",
93
+ "上一篇":"Previous",
94
+ "下一篇":"Next",
95
+ "演示代码报错,请检查": "演示代码报错,请检查",
96
+ "阅读时间约":"Reading needs",
97
+ "分钟":"minutes"
98
+ }
@@ -0,0 +1,98 @@
1
+ {
2
+ "index.serach": "index.serach",
3
+ "所有产品": "所有产品",
4
+ "周边生态": "周边生态",
5
+ "在 GitHub 上编辑": "在 GitHub 上编辑",
6
+ "贡献者": "贡献者",
7
+ "演示": "演示",
8
+ "代码演示": "代码演示",
9
+ "设计指引": "设计指引",
10
+ "搜索…": "搜索…",
11
+ "收起所有": "收起所有",
12
+ "经典布局": "经典布局",
13
+ "三栏布局": "三栏布局",
14
+ "两栏布局": "两栏布局",
15
+ "分类色板": "分类色板",
16
+ "顺序色板": "顺序色板",
17
+ "发散色板": "发散色板",
18
+ "查看更多色板用法": "查看更多色板用法",
19
+ "切换至电脑视图": "切换至电脑视图",
20
+ "切换至平板视图": "切换至平板视图",
21
+ "切换至移动端视图": "切换至移动端视图",
22
+ "进入全屏": "进入全屏",
23
+ "离开全屏": "离开全屏",
24
+ "产品首页": "产品首页",
25
+ "图表示例": "图表示例",
26
+ "现在开始使用": "现在开始使用",
27
+ "使用文档": "使用文档",
28
+ "组件示例": "组件示例",
29
+ "基础产品": "基础产品",
30
+ "拓展产品": "拓展产品",
31
+ "API 文档": "API 文档",
32
+ "正在施工中...": "正在施工中...",
33
+ "更新日志": "更新日志",
34
+ "GitHub 仓库": "GitHub 仓库",
35
+ "国内镜像": "国内镜像",
36
+ "蚂蚁数据可视化": "蚂蚁数据可视化",
37
+ "AntV 是蚂蚁集团全新一代数据可视化解决方案,致力于提供一套简单方便、专业可靠、无限可能的数据可视化最佳实践。": "AntV 是蚂蚁集团全新一代数据可视化解决方案,致力于提供一套简单方便、专业可靠、无限可能的数据可视化最佳实践。",
38
+ "可视化引擎": "可视化引擎",
39
+ "图可视化引擎": "图可视化引擎",
40
+ "移动可视化方案": "移动可视化方案",
41
+ "跨平台高性能的移动端可视化解决方案,满足你的各种图表需求。": "跨平台高性能的移动端可视化解决方案,满足你的各种图表需求。",
42
+ "地理空间数据可视化": "地理空间数据可视化",
43
+ "开箱即用的图表库": "开箱即用的图表库",
44
+ "X6 图编辑引擎": "X6 图编辑引擎",
45
+ "图编辑引擎": "图编辑引擎",
46
+ "AVA 是为了更简便的可视分析而生的技术框架。": "AVA 是为了更简便的可视分析而生的技术框架。",
47
+ "开箱即用、易于配置、极致体验的通用图表库。": "开箱即用、易于配置、极致体验的通用图表库。",
48
+ "图表魔方": "图表魔方",
49
+ "生成图表": "生成图表",
50
+ "AntV 在线图表制作利器。": "AntV 在线图表制作利器。",
51
+ "数据驱动,高度易用,可扩展的可视化图形语法。": "数据驱动,高度易用,可扩展的可视化图形语法。",
52
+ "便捷的关系数据可视化引擎与图分析工具。": "便捷的关系数据可视化引擎与图分析工具。",
53
+ "高性能/高渲染质量的地理空间数据可视化框架。": "高性能/高渲染质量的地理空间数据可视化框架。",
54
+ "专注于移动端的可视化解决方案,兼容 H5/小程序/Weex 等多端环境": "专注于移动端的可视化解决方案,兼容 H5/小程序/Weex 等多端环境",
55
+ "基于 G6 封装的图分析应用组件。": "基于 G6 封装的图分析应用组件。",
56
+ "极易定制、开箱即用、数据驱动的图编辑引擎": "极易定制、开箱即用、数据驱动的图编辑引擎",
57
+ "跨平台高性能的移动端可视化解决方案,满足你的各种图表需求": "跨平台高性能的移动端可视化解决方案,满足你的各种图表需求",
58
+ "墨者学院": "墨者学院",
59
+ "基于商业场景下的数据可视化解决方案": "基于商业场景下的数据可视化解决方案",
60
+ "基于 G2Plot 实现的 React 可视化图表库": "基于 G2Plot 实现的 React 可视化图表库",
61
+ "学院首页": "学院首页",
62
+ "数据可视化社团": "数据可视化社团",
63
+ "语雀社区": "语雀社区",
64
+ "钉钉服务群": "钉钉服务群",
65
+ "扫码进 ChartCube 服务群": "扫码进 ChartCube 服务群",
66
+ "欢迎进入 2020 可视化智能研发时代": "欢迎进入 2020 可视化智能研发时代",
67
+ "AntV 11-22 品牌日:知源·致远": "AntV 11-22 品牌日:知源·致远",
68
+ "G2Plot 图表库发布": "G2Plot 图表库发布",
69
+ "执行代码": "执行代码",
70
+ "在 CodeSandbox 中打开": "在 CodeSandbox 中打开",
71
+ "在 Riddle 中打开": "在 Riddle 中打开",
72
+ "在 StackBlitz 中打开": "在 StackBlitz 中打开",
73
+ "HTML 代码": "HTML 代码",
74
+ "取消": "取消",
75
+ "关于我们": "关于我们",
76
+ "返回旧版": "返回旧版",
77
+ "查看详情": "查看详情",
78
+ "上新啦,点击直达:": "上新啦,点击直达:",
79
+ "React 应用开发框架": "React 应用开发框架",
80
+ "组件/文档研发工具": "组件/文档研发工具",
81
+ "React Hooks 库": "React Hooks 库",
82
+ "设计动效": "设计动效",
83
+ "社区": "社区",
84
+ "StackOverflow": "StackOverflow",
85
+ "体验科技专栏": "体验科技专栏",
86
+ "帮助": "帮助",
87
+ "蚂蚁体验科技大会": "蚂蚁体验科技大会",
88
+ "标准版基础产品": "标准版基础产品",
89
+ "标准版扩展产品": "标准版扩展产品",
90
+ "移动定制(F版)产品": "移动定制(F版)产品",
91
+ "感谢信赖": "感谢信赖",
92
+ "更多产品": "更多产品",
93
+ "上一篇": "上一篇",
94
+ "下一篇": "下一篇",
95
+ "演示代码报错,请检查": "演示代码报错,请检查",
96
+ "阅读时间约":"阅读时间约",
97
+ "分钟":"分钟"
98
+ }
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * 404 页面
4
+ */
5
+ declare const NotFound: () => JSX.Element;
6
+ export default NotFound;
@@ -0,0 +1,14 @@
1
+ import { Header } from "../slots/Header";
2
+ import { NotFound as NotFoundPage } from "../slots/404";
3
+ import { Footer } from "../slots/Footer";
4
+ /**
5
+ * 404 页面
6
+ */
7
+
8
+ var NotFound = function NotFound() {
9
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, {
10
+ isHomePage: false
11
+ }), /*#__PURE__*/React.createElement(NotFoundPage, null), /*#__PURE__*/React.createElement(Footer, null));
12
+ };
13
+
14
+ export default NotFound;