@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
@@ -0,0 +1,196 @@
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
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+
9
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+
11
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12
+
13
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
14
+
15
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
16
+
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+
19
+ import React, { useEffect, useRef, useState } from 'react';
20
+ import { Input, Menu, Tooltip } from 'antd';
21
+ import { useLocale } from 'dumi';
22
+ import { createFromIconfontCN, SearchOutlined, VerticalAlignTopOutlined } from '@ant-design/icons';
23
+ import classNames from 'classnames';
24
+ import { useT } from "../hooks";
25
+ import { filterTreeNode } from "../utils";
26
+ import styles from "./index.module.less"; // menu icon
27
+
28
+ var MenuIcon = createFromIconfontCN({
29
+ scriptUrl: '//at.alicdn.com/t/font_470089_1lnym745udm.js' // generated by iconfont.cn
30
+
31
+ });
32
+
33
+ /**
34
+ * DEMO 预览页面的菜单
35
+ */
36
+ export var ExampleSider = function ExampleSider(props) {
37
+ var currentDemo = props.currentDemo,
38
+ onDemoClicked = props.onDemoClicked,
39
+ exampleTopics = props.exampleTopics; // 菜单栏展开keys
40
+
41
+ var _useState = useState([]),
42
+ _useState2 = _slicedToArray(_useState, 2),
43
+ openKeys = _useState2[0],
44
+ setOpenKeys = _useState2[1];
45
+
46
+ var menuRef = useRef(null); // 初始化点击进来的示例按钮a的dom
47
+
48
+ var _useState3 = useState(),
49
+ _useState4 = _slicedToArray(_useState3, 2),
50
+ aRef = _useState4[0],
51
+ setARef = _useState4[1]; // input 搜索框的value
52
+
53
+
54
+ var _useState5 = useState(''),
55
+ _useState6 = _slicedToArray(_useState5, 2),
56
+ searchValue = _useState6[0],
57
+ setSearchValue = _useState6[1];
58
+
59
+ var locale = useLocale();
60
+
61
+ var getCurrentTopics = function getCurrentTopics() {
62
+ if (searchValue) {
63
+ var res = filterTreeNode({
64
+ id: 'FAKE_ID',
65
+ childrenKey: 'exampleTopics',
66
+ title: {
67
+ 'zh': 'FAKE_TITLE',
68
+ 'en': 'FAKE_TITLE'
69
+ },
70
+ exampleTopics: exampleTopics
71
+ }, searchValue, locale.id);
72
+ return (res === null || res === void 0 ? void 0 : res.exampleTopics) || [];
73
+ }
74
+
75
+ return exampleTopics;
76
+ }; // 初始化菜单栏展开keys
77
+
78
+
79
+ useEffect(function () {
80
+ var targetExample = currentDemo.targetExample,
81
+ targetTopic = currentDemo.targetTopic;
82
+ setOpenKeys(["TOPIC-".concat(targetTopic === null || targetTopic === void 0 ? void 0 : targetTopic.id), "EXAMPLE-".concat(targetExample === null || targetExample === void 0 ? void 0 : targetExample.id)]);
83
+ }, [currentDemo]); // 初始化滚动到中间
84
+
85
+ useEffect(function () {
86
+ if (aRef) {
87
+ aRef.scrollIntoView({
88
+ block: 'center',
89
+ behavior: 'smooth'
90
+ });
91
+ }
92
+ }, [aRef]); // 获取搜索后的文本结构 左文本 + 搜索文本 + 右文本
93
+
94
+ var getSearchValueTitle = function getSearchValueTitle(title) {
95
+ return searchValue && title.match(searchValue) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, title.replace(new RegExp("".concat(searchValue, ".*")), '')), /*#__PURE__*/React.createElement("span", {
96
+ className: styles.searchValue
97
+ }, searchValue), /*#__PURE__*/React.createElement("span", null, title.replace(new RegExp(".*?".concat(searchValue)), ''))) : title;
98
+ }; // 图例按钮 + img + tooltip文本
99
+
100
+
101
+ var renderExampleDemoCard = function renderExampleDemoCard(demo) {
102
+ return /*#__PURE__*/React.createElement(Tooltip, {
103
+ placement: "right",
104
+ title: getSearchValueTitle(demo.title[locale.id] || ''),
105
+ key: demo.id
106
+ }, /*#__PURE__*/React.createElement("a", {
107
+ ref: function ref(dom) {// TODO: DEAL WITH ME
108
+ // if (dom && !aRef && item.value === getPath(currentExample)) {
109
+ // setARef(dom);
110
+ // }
111
+ },
112
+ className: classNames(styles.card, _defineProperty({}, styles.current, currentDemo.id === demo.id))
113
+ }, /*#__PURE__*/React.createElement("div", {
114
+ className: classNames(styles.screenshot),
115
+ style: {
116
+ backgroundImage: "url(".concat(demo.screenshot || 'https://gw.alipayobjects.com/os/s/prod/antv/assets/image/screenshot-placeholder-b8e70.png', ")")
117
+ },
118
+ title: demo.title[locale.id]
119
+ })));
120
+ };
121
+
122
+ var renderSubMenu = function renderSubMenu() {
123
+ return getCurrentTopics().map(function (topic) {
124
+ return /*#__PURE__*/React.createElement(Menu.SubMenu, {
125
+ key: "TOPIC-".concat(topic.id),
126
+ title: /*#__PURE__*/React.createElement("div", null, topic.icon && /*#__PURE__*/React.createElement(MenuIcon, {
127
+ className: styles.menuIcon,
128
+ type: "icon-".concat(topic.icon)
129
+ }), /*#__PURE__*/React.createElement("span", {
130
+ className: classNames(styles.menuTitleContent, styles.subMenuTitleContent)
131
+ }, topic.title && getSearchValueTitle(topic.title[locale.id])))
132
+ }, topic.examples.map(function (example) {
133
+ return /*#__PURE__*/React.createElement(Menu.SubMenu, {
134
+ key: "EXAMPLE-".concat(example.id),
135
+ title: example.title[locale.id]
136
+ }, example.demos.map(function (demo) {
137
+ return /*#__PURE__*/React.createElement(Menu.Item, {
138
+ key: "DEMO-".concat(demo.id),
139
+ style: {
140
+ height: 70,
141
+ padding: 0,
142
+ cursor: 'pointer'
143
+ },
144
+ onClick: function onClick() {
145
+ onDemoClicked(_objectSpread(_objectSpread({}, demo), {}, {
146
+ targetExample: example,
147
+ targetTopic: topic
148
+ }));
149
+ }
150
+ }, /*#__PURE__*/React.createElement("span", {
151
+ className: styles.menuTitleContent
152
+ }, renderExampleDemoCard(demo)));
153
+ }));
154
+ }));
155
+ });
156
+ }; // 搜索栏
157
+
158
+
159
+ var renderSearchBar = function renderSearchBar() {
160
+ return /*#__PURE__*/React.createElement("div", {
161
+ className: styles.searchSider
162
+ }, /*#__PURE__*/React.createElement(Input, {
163
+ size: "small",
164
+ placeholder: useT('搜索…'),
165
+ prefix: /*#__PURE__*/React.createElement(SearchOutlined, null),
166
+ value: searchValue,
167
+ onChange: function onChange(e) {
168
+ return setSearchValue(e.target.value);
169
+ }
170
+ }), /*#__PURE__*/React.createElement(Tooltip, {
171
+ placement: "right",
172
+ title: useT('收起所有')
173
+ }, /*#__PURE__*/React.createElement(VerticalAlignTopOutlined, {
174
+ className: styles.searchSiderIcon,
175
+ onClick: function onClick() {
176
+ return setOpenKeys([]);
177
+ }
178
+ })));
179
+ };
180
+
181
+ return /*#__PURE__*/React.createElement("div", {
182
+ className: classNames(styles.shadowWrapper)
183
+ }, renderSearchBar(), /*#__PURE__*/React.createElement(Menu, {
184
+ ref: menuRef,
185
+ mode: "inline",
186
+ style: {
187
+ width: '100%'
188
+ },
189
+ className: styles.sideBarMenu,
190
+ openKeys: openKeys,
191
+ selectedKeys: ["DEMO-".concat(currentDemo.id)],
192
+ onOpenChange: function onOpenChange(keys) {
193
+ setOpenKeys(keys);
194
+ }
195
+ }, renderSubMenu()));
196
+ };
@@ -0,0 +1,141 @@
1
+ @import '~antd/es/style/themes/default.less';
2
+
3
+ .shadowWrapper {
4
+ position: relative;
5
+ margin-bottom: 12px;
6
+ overflow: auto;
7
+ height: 100%;
8
+
9
+ &::before,
10
+ &::after {
11
+ content: '';
12
+ position: absolute;
13
+ z-index: 1;
14
+ top: 0;
15
+ height: 100%;
16
+ box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0);
17
+ width: 1px;
18
+ transition: all 0.3s;
19
+ }
20
+
21
+ &::before {
22
+ left: -1px;
23
+ }
24
+
25
+ &::after {
26
+ right: -1px;
27
+ }
28
+ }
29
+
30
+ .cards {
31
+ max-width: 100%;
32
+ overflow: hidden;
33
+ white-space: nowrap;
34
+ font-size: 0;
35
+ padding: 1px;
36
+ }
37
+
38
+ .card {
39
+ display: flex;
40
+ width: 100px;
41
+ height: 70px;
42
+ cursor: pointer;
43
+ margin-left: 48px;
44
+ position: relative;
45
+ border: 1px solid #ebedf0;
46
+ transition: all 0.3s;
47
+ user-select: none;
48
+ background-color: #fff;
49
+
50
+ &:after {
51
+ transition: all 0.3s;
52
+ background-color: transparent;
53
+ border: 1px solid transparent;
54
+ content: '';
55
+ position: absolute;
56
+ top: -1px;
57
+ bottom: -1px;
58
+ right: -1px;
59
+ left: -1px;
60
+ }
61
+
62
+ &:hover {
63
+ border-color: @primary-color;
64
+
65
+ &:before {
66
+ transition: all 0.3s;
67
+ content: '';
68
+ position: absolute;
69
+ top: -1px;
70
+ bottom: -1px;
71
+ right: -1px;
72
+ left: -1px;
73
+ background-color: fade(@primary-color, 10%);
74
+ }
75
+ }
76
+
77
+ .screenshot {
78
+ background-size: contain;
79
+ background-repeat: no-repeat;
80
+ background-position: center;
81
+ width: 100%;
82
+ height: 100%;
83
+ display: flex;
84
+ align-items: center;
85
+ justify-content: center;
86
+
87
+ .exampleDemoTitle {
88
+ white-space: pre-wrap;
89
+ line-height: 12px;
90
+ font-size: 10px;
91
+ text-align: center;
92
+ padding: 4px;
93
+ }
94
+ }
95
+
96
+ &:last-child {
97
+ margin-right: 0;
98
+ }
99
+
100
+ &.current::after {
101
+ background-color: fade(@primary-color, 10%);
102
+ border-color: @primary-color;
103
+ }
104
+ }
105
+
106
+ .searchSider {
107
+ height: 50px;
108
+ display: flex;
109
+ padding-left: 24px;
110
+ align-items: center;
111
+ background-color: #fff;
112
+ justify-content: space-between;
113
+
114
+ .searchSiderIcon {
115
+ margin: 0 15px;
116
+ cursor: pointer;
117
+ }
118
+ }
119
+
120
+ .searchValue {
121
+ color: #873bf4;
122
+ font-weight: 500;
123
+ }
124
+
125
+ .sideBarMenu {
126
+ border: none;
127
+
128
+ .menuTitleContent {
129
+ display: inline-block;
130
+ width: 100%;
131
+ vertical-align: bottom;
132
+
133
+ overflow: hidden;
134
+ text-overflow: ellipsis;
135
+ white-space: nowrap;
136
+ }
137
+
138
+ .subMenuTitleContent {
139
+ width: calc(100% - 16px);
140
+ }
141
+ }
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
+ import { IC } from '../../types';
2
3
  interface FeatureProps {
3
4
  icon: string;
4
- title: string;
5
+ title: IC;
5
6
  description: string;
6
7
  }
7
8
  declare const FeatureCard: React.FC<FeatureProps>;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import classNames from 'classnames'; // @ts-ignore
3
-
4
- import styles from './FeatureCard.module.less';
2
+ import cx from 'classnames';
3
+ import { ic } from "../hooks";
4
+ import styles from "./FeatureCard.module.less";
5
5
 
6
6
  var FeatureCard = function FeatureCard(_ref) {
7
7
  var icon = _ref.icon,
@@ -12,14 +12,14 @@ var FeatureCard = function FeatureCard(_ref) {
12
12
  }, /*#__PURE__*/React.createElement("div", {
13
13
  className: styles.content
14
14
  }, /*#__PURE__*/React.createElement("img", {
15
- className: classNames(styles.icon, 'feature-logo'),
15
+ className: cx(styles.icon, 'feature-logo'),
16
16
  src: icon,
17
17
  alt: "advantage"
18
18
  }), /*#__PURE__*/React.createElement("p", {
19
19
  className: styles.title
20
- }, title), /*#__PURE__*/React.createElement("p", {
20
+ }, ic(title)), /*#__PURE__*/React.createElement("p", {
21
21
  className: styles.description
22
- }, description)));
22
+ }, ic(description))));
23
23
  };
24
24
 
25
25
  export default FeatureCard;
@@ -1,18 +1,22 @@
1
1
  .card {
2
2
  background-color: #fff;
3
3
  height: auto;
4
+
4
5
  .content {
5
6
  padding-left: 15.9%;
6
7
  padding-right: 15.9%;
8
+
7
9
  .icon {
8
10
  height: 60px;
9
11
  }
12
+
10
13
  .title {
11
14
  font-size: 1.714em;
12
15
  color: #000;
13
16
  margin-top: 40px;
14
17
  margin-bottom: 0;
15
18
  }
19
+
16
20
  .description {
17
21
  opacity: 0.6;
18
22
  width: 100%;
@@ -30,14 +34,17 @@
30
34
  .cardWrapper {
31
35
  .card {
32
36
  margin: 84px 19px 80px 19px;
37
+
33
38
  .content {
34
39
  .icon {
35
40
  width: 25.6%;
36
41
  }
42
+
37
43
  .title {
38
44
  font-size: 1.4em;
39
45
  margin-top: 28px;
40
46
  }
47
+
41
48
  .description {
42
49
  font-size: 1em;
43
50
  padding-bottom: 0px;
@@ -48,4 +55,4 @@
48
55
  }
49
56
  }
50
57
  }
51
- }
58
+ }
@@ -11,5 +11,5 @@ interface FeaturesProps {
11
11
  style?: React.CSSProperties;
12
12
  id?: string;
13
13
  }
14
- declare const Features: React.FC<FeaturesProps>;
15
- export default Features;
14
+ export declare const Features: React.FC<FeaturesProps>;
15
+ export {};
@@ -1,12 +1,10 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
1
  import React from 'react';
3
2
  import { Row, Col } from 'antd';
4
- import classNames from 'classnames';
5
- import FeatureCard from './FeatureCard'; // @ts-ignore
6
-
7
- import styles from './Features.module.less';
8
-
9
- var Features = function Features(_ref) {
3
+ import cx from 'classnames';
4
+ import FeatureCard from "./FeatureCard";
5
+ import styles from "./index.module.less";
6
+ import { ic } from "../hooks";
7
+ export var Features = function Features(_ref) {
10
8
  var title = _ref.title,
11
9
  _ref$features = _ref.features,
12
10
  features = _ref$features === void 0 ? [] : _ref$features,
@@ -18,10 +16,10 @@ var Features = function Features(_ref) {
18
16
  var children = features.map(function (card) {
19
17
  return /*#__PURE__*/React.createElement(Col, {
20
18
  className: styles.cardWrapper,
21
- key: card.title,
19
+ key: ic(card.title),
22
20
  md: 8,
23
21
  xs: 24
24
- }, /*#__PURE__*/React.createElement(FeatureCard, Object.assign({}, card)));
22
+ }, /*#__PURE__*/React.createElement(FeatureCard, card));
25
23
  });
26
24
  return children;
27
25
  }; // for small screen
@@ -63,40 +61,35 @@ var Features = function Features(_ref) {
63
61
 
64
62
  return /*#__PURE__*/React.createElement("div", {
65
63
  id: id,
66
- className: classNames(styles.wrapper, className),
64
+ className: cx(styles.wrapper, className),
67
65
  style: style
68
66
  }, title ? /*#__PURE__*/React.createElement("div", {
69
- className: classNames(styles.lefttopWithTitle, styles.lefttop)
67
+ className: cx(styles.lefttopWithTitle, styles.lefttop)
70
68
  }) : /*#__PURE__*/React.createElement("div", {
71
- className: classNames(styles.lefttopWithoutTitle, styles.lefttop)
69
+ className: cx(styles.lefttopWithoutTitle, styles.lefttop)
72
70
  }), /*#__PURE__*/React.createElement("div", {
73
- className: title ? styles.rightbottom : classNames(styles.rightbottomWithoutTitle, styles.rightbottom)
71
+ className: cx(styles.rightbottomWithoutTitle, styles.rightbottom)
74
72
  }, /*#__PURE__*/React.createElement("div", {
75
- className: classNames(styles.slicerbar, styles.slicerbarv, styles.slicerbarv1)
73
+ className: cx(styles.slicerbar, styles.slicerbarv, styles.slicerbarv1)
76
74
  }), /*#__PURE__*/React.createElement("div", {
77
- className: classNames(styles.slicerbar, styles.slicerbarv, styles.slicerbarv2)
75
+ className: cx(styles.slicerbar, styles.slicerbarv, styles.slicerbarv2)
78
76
  }), /*#__PURE__*/React.createElement("div", {
79
- className: classNames(styles.slicerbar, styles.slicerbarh, styles.slicerbarh1)
77
+ className: cx(styles.slicerbar, styles.slicerbarh, styles.slicerbarh1)
80
78
  }), /*#__PURE__*/React.createElement("div", {
81
- className: classNames(styles.slicerbar, styles.slicerbarh, styles.slicerbarh2)
79
+ className: cx(styles.slicerbar, styles.slicerbarh, styles.slicerbarh2)
82
80
  }), /*#__PURE__*/React.createElement("div", {
83
- className: classNames(styles.slicerbar, styles.slicerbarh, styles.slicerbarh3)
81
+ className: cx(styles.slicerbar, styles.slicerbarh, styles.slicerbarh3)
84
82
  }), /*#__PURE__*/React.createElement("div", {
85
- className: classNames(styles.slicerbar, styles.slicerbarh, styles.slicerbarh4)
83
+ className: cx(styles.slicerbar, styles.slicerbarh, styles.slicerbarh4)
86
84
  }), getDots()), /*#__PURE__*/React.createElement("div", {
87
85
  className: styles.content
88
86
  }, /*#__PURE__*/React.createElement("div", {
89
87
  key: "content"
90
- }, /*#__PURE__*/React.createElement("p", {
91
- key: "title",
92
- className: styles.title
93
- }, title), /*#__PURE__*/React.createElement("div", {
88
+ }, /*#__PURE__*/React.createElement("div", {
94
89
  key: "block",
95
90
  className: styles.cardsContainer
96
91
  }, /*#__PURE__*/React.createElement(Row, {
97
92
  key: "cards",
98
93
  className: styles.cards
99
94
  }, getCards())))));
100
- };
101
-
102
- export default Features;
95
+ };
@@ -1,4 +1,4 @@
1
- @import '../mixins';
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, fade(@primary-color, 70%), shade(@primary-color, 20%));
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
+ }