@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,95 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+
3
+ 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."); }
4
+
5
+ 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); }
6
+
7
+ 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; }
8
+
9
+ 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; }
10
+
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+
13
+ import React from 'react';
14
+ import { useContext, useEffect } from 'react';
15
+ import { useNavigate } from 'react-router-dom';
16
+ import { BackTop, Layout as AntLayout } from 'antd';
17
+ import { useLocale } from 'dumi';
18
+ import { SEO } from "../../slots/SEO";
19
+ import { Header } from "../../slots/Header";
20
+ import { Footer } from "../../slots/Footer";
21
+ import NavigatorBanner from "../../slots/Header/Products/NavigatorBanner";
22
+ import { VerticalAlignTopOutlined } from '@ant-design/icons';
23
+ import { Article } from "./components/Article";
24
+ import { ExampleTopicMenu } from "./components/ExampleTopicMenu";
25
+ import { GalleryPageContent } from "./components/GalleryPageContent";
26
+ import { usePrevAndNext } from "../../slots/hooks";
27
+ import { ThemeAntVContext } from "../../context";
28
+ import styles from "./index.module.less";
29
+ /**
30
+ * Examples 页面
31
+ *
32
+ * @author YuZhanglong <loveyzl1123@gmail.com>
33
+ */
34
+
35
+ var Example = function Example() {
36
+ var nav = useNavigate();
37
+ var locale = useLocale();
38
+ /** 示例页面的元数据信息 */
39
+
40
+ var metaData = useContext(ThemeAntVContext);
41
+ var exampleTopics = metaData.meta.exampleTopics;
42
+
43
+ var _usePrevAndNext = usePrevAndNext(),
44
+ _usePrevAndNext2 = _slicedToArray(_usePrevAndNext, 2),
45
+ prev = _usePrevAndNext2[0],
46
+ next = _usePrevAndNext2[1];
47
+
48
+ var title = {
49
+ zh: '所有图表',
50
+ en: "Gallery"
51
+ }; // 为 zh 做兜底
52
+
53
+ useEffect(function () {
54
+ var p = window.location.pathname;
55
+
56
+ if (p.includes('/zh/')) {
57
+ nav(p.replace('/zh/', '/'));
58
+ }
59
+ }, []);
60
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SEO, {
61
+ title: title[locale.id]
62
+ }), /*#__PURE__*/React.createElement(Header, {
63
+ isHomePage: false
64
+ }), /*#__PURE__*/React.createElement(AntLayout, {
65
+ hasSider: true,
66
+ className: styles.layout
67
+ }, /*#__PURE__*/React.createElement(ExampleTopicMenu, {
68
+ exampleTopics: exampleTopics
69
+ }), /*#__PURE__*/React.createElement(Article, {
70
+ className: styles.markdown
71
+ }, /*#__PURE__*/React.createElement("div", {
72
+ className: styles.main,
73
+ style: {
74
+ width: '100%'
75
+ }
76
+ }, /*#__PURE__*/React.createElement(GalleryPageContent, {
77
+ exampleTopics: exampleTopics
78
+ }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(NavigatorBanner, {
79
+ type: "prev",
80
+ post: prev
81
+ }), /*#__PURE__*/React.createElement(NavigatorBanner, {
82
+ type: "next",
83
+ post: next
84
+ })), /*#__PURE__*/React.createElement(BackTop, {
85
+ style: {
86
+ right: 32
87
+ }
88
+ }, /*#__PURE__*/React.createElement("div", {
89
+ className: styles.backTop
90
+ }, /*#__PURE__*/React.createElement(VerticalAlignTopOutlined, null)))))), /*#__PURE__*/React.createElement(Footer, {
91
+ isDynamicFooter: true
92
+ }));
93
+ };
94
+
95
+ export default Example;
@@ -0,0 +1,607 @@
1
+ @import 'antd/es/style/themes/default.less';
2
+
3
+ // 参考 yuque 右侧 tabOfContent 宽度
4
+ @toc-width: 260px;
5
+
6
+ .markdown {
7
+ font-size: 14px;
8
+ line-height: 2;
9
+
10
+ h1 {
11
+ margin-bottom: 20px;
12
+ font-weight: 500;
13
+ font-size: 30px;
14
+ font-family: Avenir, @font-family, sans-serif;
15
+ line-height: 38px;
16
+ }
17
+
18
+ h1:first-child {
19
+ margin-top: 8px;
20
+ }
21
+
22
+ h2 {
23
+ font-size: 24px;
24
+ line-height: 32px;
25
+ }
26
+
27
+ h2,
28
+ h3,
29
+ h4,
30
+ h5,
31
+ h6 {
32
+ clear: both;
33
+ margin: 1em 0 0.3em;
34
+ font-weight: 500;
35
+ font-family: Avenir, @font-family, sans-serif;
36
+ }
37
+
38
+ h3 {
39
+ font-size: 20px;
40
+ margin-bottom: 4px;
41
+ font-weight: 600;
42
+ line-height: 30px;
43
+ border-bottom: 1px solid @border-color-split;
44
+ }
45
+
46
+ h4 {
47
+ font-size: 16px;
48
+ font-weight: 600;
49
+ margin: 0;
50
+ }
51
+
52
+ h5 {
53
+ font-size: 14px;
54
+ }
55
+
56
+ h6 {
57
+ font-size: 12px;
58
+ }
59
+
60
+ hr {
61
+ clear: both;
62
+ height: 1px;
63
+ margin: 56px 0;
64
+ background: @border-color-split;
65
+ border: 0;
66
+ }
67
+
68
+ p {
69
+ line-height: 32px;
70
+ }
71
+
72
+ p,
73
+ pre {
74
+ margin: 0.6em 0;
75
+ }
76
+
77
+ pre > code[class*='language-'] {
78
+ line-height: 1.8;
79
+ }
80
+
81
+ pre[class*='language-'] {
82
+ background-color: rgba(0, 0, 0, 0.03);
83
+ }
84
+
85
+ code[class*='language-'] {
86
+ background: none;
87
+ }
88
+
89
+ code[class*='language-text'] {
90
+ white-space: break-spaces;
91
+ word-break: break-word;
92
+ }
93
+
94
+ code.language-sign,
95
+ pre.language-sign {
96
+ background: #e6f7ff;
97
+ }
98
+
99
+ pre.language-sign {
100
+ border: 1px solid #91d5ff;
101
+ }
102
+
103
+ :global(.gatsby-highlight-code-line) {
104
+ background-color: #f9f0ff;
105
+ border-left: 2px solid #873bf4;
106
+ }
107
+
108
+ .description {
109
+ opacity: 0.68;
110
+ }
111
+
112
+ ul,
113
+ ol {
114
+ margin: 0;
115
+ padding: 0;
116
+ }
117
+
118
+ ul:not(:global(.ant-skeleton-paragraph)) > li {
119
+ margin-left: 20px;
120
+ padding-left: 4px;
121
+ list-style-type: circle;
122
+
123
+ &:empty {
124
+ display: none;
125
+ }
126
+ }
127
+
128
+ ol > li {
129
+ margin-left: 20px;
130
+ padding-left: 4px;
131
+ list-style-type: decimal;
132
+ }
133
+
134
+ ul > li > p,
135
+ ol > li > p {
136
+ margin: 0.2em 0;
137
+ }
138
+
139
+ strong,
140
+ b {
141
+ font-weight: 500;
142
+ }
143
+
144
+ table {
145
+ width: 100%;
146
+ margin: 24px 0;
147
+ empty-cells: show;
148
+ border: 1px solid @border-color-split;
149
+ border-collapse: collapse;
150
+ border-spacing: 0;
151
+
152
+ img {
153
+ max-width: 100%;
154
+ }
155
+ }
156
+
157
+ table th {
158
+ color: #5c6b77;
159
+ font-weight: 500;
160
+ background: rgba(0, 0, 0, 0.02);
161
+ }
162
+
163
+ table th,
164
+ table td {
165
+ padding: 4px 12px;
166
+ text-align: left;
167
+ border: 1px solid @border-color-split;
168
+ line-height: 24px;
169
+ }
170
+
171
+ table img {
172
+ max-height: 100px;
173
+ }
174
+
175
+ table td:first-child {
176
+ width: 20%;
177
+ font-weight: 500;
178
+ background: #fcfcfc;
179
+ color: rgba(0, 0, 0, 0.85);
180
+ }
181
+
182
+ blockquote {
183
+ margin: 0.5em 0;
184
+ padding-left: 0.8em;
185
+ color: @text-color-secondary;
186
+ font-size: 90%;
187
+ border-left: 4px solid @border-color-split;
188
+ }
189
+
190
+ blockquote p {
191
+ margin: 0;
192
+ }
193
+
194
+ > br,
195
+ > p > br {
196
+ clear: both;
197
+ }
198
+ }
199
+
200
+ .layout {
201
+ margin: 24px 0 32px;
202
+ }
203
+
204
+ .main {
205
+ background-color: #ffffff;
206
+ width: calc(100% - @toc-width);
207
+ padding-left: 48px;
208
+ padding-right: 24px;
209
+ overflow: hidden;
210
+
211
+ .meta {
212
+ margin-bottom: 1.2em;
213
+ }
214
+
215
+ .contentReset() {
216
+ min-height: 400px;
217
+
218
+ > img,
219
+ > p > img {
220
+ max-width: 100%;
221
+ margin: 0.5em 0;
222
+ }
223
+
224
+ > br,
225
+ > p > br {
226
+ clear: both;
227
+ }
228
+ }
229
+
230
+ .content {
231
+ .contentReset;
232
+
233
+ > div {
234
+ .contentReset;
235
+ }
236
+ }
237
+ }
238
+
239
+ // reference yuque UI
240
+ .toc {
241
+ width: @toc-width;
242
+ float: right;
243
+ font-size: 12px;
244
+ background: #fff;
245
+ max-height: 100vh;
246
+ overflow: scroll;
247
+
248
+ position: sticky;
249
+ top: 0;
250
+ padding: 8px 0;
251
+
252
+ ul > li {
253
+ list-style: none !important;
254
+ padding: 0 !important;
255
+ margin-left: 1em !important;
256
+
257
+ // 超出部分省略号显示
258
+ text-overflow: ellipsis;
259
+ overflow: hidden;
260
+ white-space: nowrap;
261
+
262
+ a {
263
+ color: @text-color;
264
+ }
265
+ }
266
+ }
267
+
268
+ .sider {
269
+ width: 280px !important;
270
+ height: inherit;
271
+ background-color: #fff;
272
+
273
+ // menu 滚动
274
+ :global {
275
+ .ant-layout-sider-children {
276
+ overflow: hidden;
277
+
278
+ &:hover {
279
+ overflow-y: auto;
280
+ }
281
+ }
282
+ }
283
+ }
284
+
285
+ .affix {
286
+ background-color: #fff;
287
+ & > div {
288
+ height: 100%;
289
+ }
290
+ }
291
+
292
+ .menuIcon {
293
+ opacity: 0.6;
294
+ font-size: 16px !important;
295
+ position: relative;
296
+ top: 1px;
297
+ margin-right: 8px !important;
298
+ }
299
+
300
+ .menuDrawer {
301
+ :global(.drawer) {
302
+ z-index: 9;
303
+ }
304
+
305
+ :global(.ant-menu) {
306
+ border-right: 0;
307
+ }
308
+
309
+ .menuSwitch {
310
+ position: absolute;
311
+ top: 72px;
312
+ right: -40px;
313
+ width: 40px;
314
+ height: 40px;
315
+ cursor: pointer;
316
+ z-index: 0;
317
+ text-align: center;
318
+ line-height: 40px;
319
+ font-size: 16px;
320
+ display: flex;
321
+ justify-content: center;
322
+ align-items: center;
323
+ background: #fff;
324
+ box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
325
+ border-radius: 0 4px 4px 0;
326
+ }
327
+ }
328
+
329
+ .gallery {
330
+ display: flex;
331
+ flex-direction: row-reverse;
332
+
333
+ .galleryContent {
334
+ flex: 1;
335
+ }
336
+
337
+ .anchor {
338
+ width: @toc-width;
339
+ padding-left: 24px;
340
+
341
+ :global {
342
+ .ant-anchor {
343
+ font-size: 12px;
344
+ }
345
+
346
+ .ant-anchor-link {
347
+ padding-top: 5px;
348
+ padding-bottom: 5px;
349
+ }
350
+ }
351
+ }
352
+
353
+ .galleryList {
354
+ list-style: none;
355
+ margin: 0 -12px !important;
356
+ }
357
+
358
+ .galleryCard {
359
+ display: inline-block;
360
+ vertical-align: top;
361
+ width: 25%;
362
+ margin: 0 !important;
363
+ padding: 0 !important;
364
+
365
+ .galleryCardLink {
366
+ display: block;
367
+ position: relative;
368
+ cursor: pointer;
369
+ transition: all 0.3s;
370
+ margin: 12px;
371
+
372
+ > div {
373
+ border: 1px solid @border-color-split;
374
+ border-radius: 6px;
375
+ overflow: hidden;
376
+ height: calc(100vw / 9 - 20px);
377
+ min-height: 130px;
378
+ max-height: 280px;
379
+ object-fit: cover;
380
+ transition: all 0.3s;
381
+ display: flex;
382
+ justify-content: center;
383
+
384
+ img {
385
+ max-width: 100%;
386
+ max-height: 100%;
387
+ object-fit: scale-down;
388
+ }
389
+ }
390
+
391
+ &:hover > div {
392
+ transform: translateY(-4px);
393
+ border-color: transparent;
394
+ box-shadow: 0 6px 16px rgba(107, 147, 224, 0.14);
395
+ }
396
+
397
+ h4 {
398
+ margin: 16px 0 0;
399
+ text-align: center;
400
+ color: #101424;
401
+ font-size: 16px;
402
+ line-height: 22px;
403
+ overflow: hidden;
404
+ text-overflow: ellipsis;
405
+ white-space: nowrap;
406
+ }
407
+ }
408
+
409
+ // 自定义上新徽章
410
+ .customRibbon {
411
+ transform: rotate(45deg) translate(5px, -12px);
412
+ border-radius: 0;
413
+ width: 65px;
414
+ height: 18px;
415
+ font-size: 14px;
416
+ font-weight: 500;
417
+ line-height: 18px;
418
+ text-align: center;
419
+
420
+ :global {
421
+ .ant-ribbon-corner {
422
+ display: none;
423
+ }
424
+ }
425
+ }
426
+ }
427
+ }
428
+
429
+ .apiStructure {
430
+ padding: 0;
431
+ }
432
+
433
+ .editOnGtiHubButton {
434
+ margin-left: 0.5em;
435
+ font-size: 16px;
436
+ color: #999;
437
+ vertical-align: middle;
438
+ position: relative;
439
+ top: -2px;
440
+ }
441
+
442
+ .exampleContent {
443
+ margin-top: -24px;
444
+
445
+ :global {
446
+ .SplitPane {
447
+ overflow: auto;
448
+ left: 0px;
449
+ height: calc(100vh - 64px) !important;
450
+ }
451
+
452
+ .Pane2 {
453
+ overflow: auto;
454
+ }
455
+
456
+ .ant-collapse-extra {
457
+ margin-left: 16px;
458
+ display: inline-block;
459
+ float: none !important;
460
+ }
461
+ }
462
+ }
463
+
464
+ @media only screen and (max-width: 1199.99px) {
465
+ .gallery {
466
+ .galleryCard {
467
+ width: 33.3%;
468
+ }
469
+ }
470
+ }
471
+
472
+ @media only screen and (max-width: 991.99px) {
473
+ .markdown {
474
+ .main {
475
+ width: 100vw !important;
476
+ padding-left: 32px;
477
+ padding-right: 32px;
478
+ }
479
+
480
+ .toc {
481
+ display: none;
482
+ }
483
+ }
484
+
485
+ .sider {
486
+ width: 240px !important;
487
+ }
488
+
489
+ .gallery {
490
+ .galleryCard {
491
+ width: 50%;
492
+ }
493
+
494
+ .anchor {
495
+ display: none;
496
+ }
497
+ }
498
+ }
499
+
500
+ @media only screen and (max-width: 767.99px) {
501
+ .layout {
502
+ flex-direction: column !important;
503
+ }
504
+
505
+ .sider {
506
+ width: 100% !important;
507
+ margin-bottom: 32px;
508
+ padding-bottom: 32px;
509
+ border-bottom: 1px solid #e8e8e8;
510
+ display: none;
511
+ }
512
+
513
+ .markdown {
514
+ .main {
515
+ margin-top: 30px;
516
+ padding-left: 24px;
517
+ padding-right: 24px;
518
+ }
519
+ }
520
+ }
521
+
522
+ @media only screen and (max-width: 575.99px) {
523
+ .gallery {
524
+ .galleryCard {
525
+ width: 100%;
526
+ }
527
+ }
528
+ }
529
+
530
+ .galleryAnchor {
531
+ overflow-x: hidden;
532
+ overflow-y: hidden;
533
+
534
+ &:hover {
535
+ overflow-y: auto;
536
+ }
537
+
538
+ :global(.ant-anchor-link) {
539
+ width: 100%;
540
+ height: 100%;
541
+ padding: 0;
542
+ display: flex;
543
+ align-items: center;
544
+ }
545
+
546
+ :global(.ant-anchor-ink) {
547
+ display: none;
548
+ }
549
+
550
+ :global(.ant-anchor-link-title) {
551
+ width: 100%;
552
+ height: 100%;
553
+ padding: 0;
554
+ display: flex;
555
+ align-items: center;
556
+ }
557
+ }
558
+
559
+ .apiAnchor {
560
+ padding-left: 14px;
561
+ overflow: hidden;
562
+
563
+ &:hover {
564
+ overflow-y: auto;
565
+ }
566
+
567
+ :global(.ant-anchor-ink-ball) {
568
+ width: 2px;
569
+ height: 24px;
570
+ background-color: #873bf4;
571
+ border: none;
572
+ border-radius: 0;
573
+ transform: translateX(-50%) translateY(-8px);
574
+ }
575
+
576
+ :global(.anticon) {
577
+ position: absolute;
578
+ padding-top: 5px;
579
+ font-size: 12px;
580
+ color: red;
581
+ }
582
+
583
+ .parent {
584
+ padding: 5px 0 5px 14px;
585
+ font-size: 12px;
586
+ }
587
+
588
+ .children {
589
+ padding: 5px 0 5px 14px;
590
+ font-size: 12px;
591
+ }
592
+ }
593
+
594
+ .backTop {
595
+ transition: color 0.3s;
596
+ color: #868484;
597
+ background-color: #fff;
598
+ box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12),
599
+ 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
600
+ transition: color 0.3s;
601
+ width: 44px;
602
+ height: 44px;
603
+ line-height: 44px;
604
+ font-size: 22px;
605
+ border-radius: 50%;
606
+ text-align: center;
607
+ }
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { ExampleTopic, Example, Demo } from '../../types';
3
+ export interface AnnouncementProps {
4
+ message: React.ReactNode;
5
+ localStorageId: string;
6
+ bannerId: string;
7
+ style?: React.CSSProperties;
8
+ }
9
+ export interface GalleryPageContentProps {
10
+ /**
11
+ * 案例主题列表
12
+ */
13
+ exampleTopics: ExampleTopic[];
14
+ }
15
+ export interface LeftMenuProps {
16
+ /**
17
+ * 案例主题列表
18
+ */
19
+ exampleTopics: ExampleTopic[];
20
+ }
21
+ export interface ExampleWithTopic extends Example {
22
+ targetTopic: ExampleTopic;
23
+ }
24
+ export interface DemoCardProps {
25
+ demo: Demo;
26
+ topicId: string;
27
+ exampleId: string;
28
+ }
29
+ export interface LeftMenuProps {
30
+ /**
31
+ * 案例主题列表
32
+ */
33
+ exampleTopics: ExampleTopic[];
34
+ }
@@ -0,0 +1 @@
1
+ export {};