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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) 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 +15 -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 +12 -0
  43. package/dist/plugin/examples.js +91 -0
  44. package/dist/plugin/index.d.ts +3 -0
  45. package/dist/plugin/index.js +100 -0
  46. package/dist/plugin/utils.d.ts +5 -0
  47. package/dist/plugin/utils.js +45 -0
  48. package/dist/slots/404.d.ts +2 -0
  49. package/{es/antv/404/index.js → dist/slots/404.js} +4 -9
  50. package/{es/antv/Cases/Cases.d.ts → dist/slots/Cases/index.d.ts} +4 -4
  51. package/{es/antv/Cases/Cases.js → dist/slots/Cases/index.js} +25 -25
  52. package/{src/antv/Cases/Cases.module.less → dist/slots/Cases/index.module.less} +36 -5
  53. package/dist/slots/CodeEditor/Toolbar.d.ts +67 -0
  54. package/dist/slots/CodeEditor/Toolbar.js +152 -0
  55. package/dist/slots/CodeEditor/Toolbar.module.less +81 -0
  56. package/dist/slots/CodeEditor/index.d.ts +58 -0
  57. package/dist/slots/CodeEditor/index.js +200 -0
  58. package/dist/slots/CodeEditor/index.module.less +11 -0
  59. package/dist/slots/CodeEditor/utils.d.ts +42 -0
  60. package/dist/slots/CodeEditor/utils.js +157 -0
  61. package/dist/slots/CodePreview/CodeHeader.d.ts +19 -0
  62. package/dist/slots/CodePreview/CodeHeader.js +32 -0
  63. package/dist/slots/CodePreview/CodeHeader.module.less +0 -0
  64. package/dist/slots/CodePreview/index.d.ts +17 -0
  65. package/dist/slots/CodePreview/index.js +29 -0
  66. package/dist/slots/CodePreview/index.module.less +42 -0
  67. package/dist/slots/CodeRunner/index.d.ts +14 -0
  68. package/dist/slots/CodeRunner/index.js +76 -0
  69. package/dist/slots/CodeRunner/index.module.less +0 -0
  70. package/dist/slots/CodeRunner/utils.d.ts +10 -0
  71. package/dist/slots/CodeRunner/utils.js +36 -0
  72. package/dist/slots/Companies/index.d.ts +13 -0
  73. package/dist/slots/Companies/index.js +49 -0
  74. package/dist/slots/Companies/index.module.less +82 -0
  75. package/dist/slots/Detail/News.d.ts +9 -0
  76. package/{es/antv/Banner/Notification.js → dist/slots/Detail/News.js} +8 -11
  77. package/{src/antv/Banner/Notification.module.less → dist/slots/Detail/News.module.less} +15 -3
  78. package/dist/slots/Detail/index.d.ts +26 -0
  79. package/dist/slots/Detail/index.js +124 -0
  80. package/{src/antv/Banner/Banner.module.less → dist/slots/Detail/index.module.less} +42 -74
  81. package/dist/slots/ExampleSider/index.d.ts +55 -0
  82. package/dist/slots/ExampleSider/index.js +218 -0
  83. package/dist/slots/ExampleSider/index.module.less +141 -0
  84. package/{es/antv → dist/slots}/Features/FeatureCard.d.ts +1 -1
  85. package/{es/antv → dist/slots}/Features/FeatureCard.js +6 -6
  86. package/{src/antv → dist/slots}/Features/FeatureCard.module.less +8 -1
  87. package/{es/antv → dist/slots}/Features/index.d.ts +2 -2
  88. package/{es/antv → dist/slots}/Features/index.js +17 -25
  89. package/{src/antv/Features/Features.module.less → dist/slots/Features/index.module.less} +34 -3
  90. package/dist/slots/Footer/index.d.ts +18 -0
  91. package/dist/slots/Footer/index.js +187 -0
  92. package/dist/slots/Footer/index.module.less +85 -0
  93. package/dist/slots/Header/Logo.d.ts +7 -0
  94. package/{es/antv → dist/slots}/Header/Logo.js +6 -2
  95. package/dist/slots/Header/LogoWhite.d.ts +7 -0
  96. package/dist/slots/Header/LogoWhite.js +19 -0
  97. package/dist/slots/Header/Navs.d.ts +17 -0
  98. package/dist/slots/Header/Navs.js +46 -0
  99. package/dist/slots/Header/Products/NavigatorBanner.d.ts +10 -0
  100. package/dist/slots/Header/Products/NavigatorBanner.js +34 -0
  101. package/dist/slots/Header/Products/NavigatorBanner.module.less +39 -0
  102. package/{es/antv → dist/slots/Header}/Products/Product.d.ts +3 -3
  103. package/{es/antv → dist/slots/Header}/Products/Product.js +11 -16
  104. package/{src/antv → dist/slots/Header}/Products/Product.module.less +10 -8
  105. package/{es/antv → dist/slots/Header}/Products/getProducts.d.ts +2 -7
  106. package/dist/slots/Header/Products/getProducts.js +67 -0
  107. package/dist/slots/Header/Products/index.d.ts +9 -0
  108. package/{es/antv → dist/slots/Header}/Products/index.js +15 -22
  109. package/dist/slots/Header/Search.d.ts +12 -0
  110. package/dist/slots/Header/Search.js +90 -0
  111. package/dist/slots/Header/Search.module.less +39 -0
  112. package/dist/slots/Header/index.d.ts +66 -0
  113. package/dist/slots/Header/index.js +379 -0
  114. package/dist/slots/Header/index.module.less +382 -0
  115. package/dist/slots/Header/utils.d.ts +1 -0
  116. package/dist/slots/Header/utils.js +26 -0
  117. package/dist/slots/Loading/index.d.ts +2 -0
  118. package/dist/slots/Loading/index.js +65 -0
  119. package/dist/slots/Loading/index.module.less +12 -0
  120. package/dist/slots/Loading.d.ts +5 -0
  121. package/dist/slots/Loading.js +8 -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 +321 -0
  129. package/dist/slots/ManualContent/index.module.less +656 -0
  130. package/dist/slots/TOC.d.ts +5 -0
  131. package/dist/slots/TOC.js +6 -0
  132. package/dist/slots/_.less +83 -0
  133. package/dist/slots/global.d.ts +1 -0
  134. package/dist/slots/global.js +7 -0
  135. package/dist/slots/hooks.d.ts +16 -0
  136. package/{es/antv → dist/slots}/hooks.js +60 -37
  137. package/dist/slots/utils.d.ts +20 -0
  138. package/dist/slots/utils.js +154 -0
  139. package/dist/types.d.ts +3 -0
  140. package/dist/types.js +1 -0
  141. package/dist/typings.d.ts +140 -0
  142. package/package.json +108 -47
  143. package/es/antv/404/index.d.ts +0 -2
  144. package/es/antv/Banner/Banner.module.less +0 -412
  145. package/es/antv/Banner/Notification.d.ts +0 -10
  146. package/es/antv/Banner/Notification.module.less +0 -108
  147. package/es/antv/Banner/index.d.ts +0 -25
  148. package/es/antv/Banner/index.js +0 -104
  149. package/es/antv/Cases/Cases.module.less +0 -203
  150. package/es/antv/Features/FeatureCard.module.less +0 -51
  151. package/es/antv/Features/Features.module.less +0 -169
  152. package/es/antv/Footer/Footer.module.less +0 -36
  153. package/es/antv/Footer/index.d.ts +0 -12
  154. package/es/antv/Footer/index.js +0 -237
  155. package/es/antv/Header/Logo.d.ts +0 -4
  156. package/es/antv/Products/Product.module.less +0 -146
  157. package/es/antv/Products/getNewProducts.d.ts +0 -24
  158. package/es/antv/Products/getNewProducts.js +0 -35
  159. package/es/antv/Products/getProducts.js +0 -460
  160. package/es/antv/Products/index.d.ts +0 -9
  161. package/es/antv/hooks.d.ts +0 -14
  162. package/es/antv/mixins.less +0 -21
  163. package/es/antv/utils.d.ts +0 -5
  164. package/es/antv/utils.js +0 -49
  165. package/es/builtins/API.d.ts +0 -3
  166. package/es/builtins/API.js +0 -37
  167. package/es/builtins/Alert.d.ts +0 -3
  168. package/es/builtins/Alert.js +0 -7
  169. package/es/builtins/Alert.less +0 -62
  170. package/es/builtins/Badge.d.ts +0 -3
  171. package/es/builtins/Badge.js +0 -7
  172. package/es/builtins/Badge.less +0 -31
  173. package/es/builtins/Example.d.ts +0 -5
  174. package/es/builtins/Example.less +0 -47
  175. package/es/builtins/Previewer.d.ts +0 -39
  176. package/es/builtins/Previewer.js +0 -225
  177. package/es/builtins/Previewer.less +0 -406
  178. package/es/builtins/SourceCode.d.ts +0 -10
  179. package/es/builtins/SourceCode.js +0 -70
  180. package/es/builtins/SourceCode.less +0 -103
  181. package/es/builtins/Table.d.ts +0 -4
  182. package/es/builtins/Table.less +0 -43
  183. package/es/builtins/Tree.d.ts +0 -4
  184. package/es/builtins/Tree.js +0 -213
  185. package/es/builtins/Tree.less +0 -159
  186. package/es/components/Dark.d.ts +0 -9
  187. package/es/components/Dark.js +0 -125
  188. package/es/components/Dark.less +0 -121
  189. package/es/components/LocaleSelect.d.ts +0 -6
  190. package/es/components/LocaleSelect.js +0 -53
  191. package/es/components/LocaleSelect.less +0 -59
  192. package/es/components/Navbar.d.ts +0 -10
  193. package/es/components/Navbar.js +0 -155
  194. package/es/components/Navbar.less +0 -180
  195. package/es/components/SearchBar.d.ts +0 -4
  196. package/es/components/SearchBar.js +0 -81
  197. package/es/components/SearchBar.less +0 -165
  198. package/es/components/SideMenu.d.ts +0 -10
  199. package/es/components/SideMenu.js +0 -99
  200. package/es/components/SideMenu.less +0 -379
  201. package/es/components/SlugList.d.ts +0 -7
  202. package/es/components/SlugList.js +0 -38
  203. package/es/components/SlugList.less +0 -18
  204. package/es/declaration.d.ts +0 -1
  205. package/es/layout.d.ts +0 -5
  206. package/es/layout.js +0 -276
  207. package/es/style/layout.less +0 -402
  208. package/es/style/markdown.less +0 -240
  209. package/es/style/variables.less +0 -37
  210. package/src/antv/404/index.tsx +0 -25
  211. package/src/antv/Banner/Notification.tsx +0 -45
  212. package/src/antv/Banner/index.tsx +0 -139
  213. package/src/antv/Cases/Cases.tsx +0 -116
  214. package/src/antv/Features/FeatureCard.tsx +0 -24
  215. package/src/antv/Features/index.tsx +0 -86
  216. package/src/antv/Footer/Footer.module.less +0 -36
  217. package/src/antv/Footer/index.tsx +0 -272
  218. package/src/antv/Header/Logo.tsx +0 -85
  219. package/src/antv/Products/Product.tsx +0 -80
  220. package/src/antv/Products/getNewProducts.tsx +0 -53
  221. package/src/antv/Products/getProducts.tsx +0 -626
  222. package/src/antv/Products/index.tsx +0 -70
  223. package/src/antv/hooks.ts +0 -87
  224. package/src/antv/mixins.less +0 -21
  225. package/src/antv/utils.ts +0 -44
  226. package/src/builtins/API.tsx +0 -57
  227. package/src/builtins/Alert.less +0 -62
  228. package/src/builtins/Alert.tsx +0 -4
  229. package/src/builtins/Badge.less +0 -31
  230. package/src/builtins/Badge.tsx +0 -4
  231. package/src/builtins/Example.less +0 -47
  232. package/src/builtins/Example.tsx +0 -34
  233. package/src/builtins/Previewer.less +0 -406
  234. package/src/builtins/Previewer.tsx +0 -264
  235. package/src/builtins/SourceCode.less +0 -103
  236. package/src/builtins/SourceCode.tsx +0 -55
  237. package/src/builtins/Table.less +0 -43
  238. package/src/builtins/Table.tsx +0 -42
  239. package/src/builtins/Tree.less +0 -159
  240. package/src/builtins/Tree.tsx +0 -130
  241. package/src/components/Dark.less +0 -121
  242. package/src/components/Dark.tsx +0 -78
  243. package/src/components/LocaleSelect.less +0 -59
  244. package/src/components/LocaleSelect.tsx +0 -53
  245. package/src/components/Navbar.less +0 -180
  246. package/src/components/Navbar.tsx +0 -152
  247. package/src/components/SearchBar.less +0 -165
  248. package/src/components/SearchBar.tsx +0 -68
  249. package/src/components/SideMenu.less +0 -379
  250. package/src/components/SideMenu.tsx +0 -148
  251. package/src/components/SlugList.less +0 -18
  252. package/src/components/SlugList.tsx +0 -20
  253. package/src/declaration.d.ts +0 -1
  254. package/src/layout.tsx +0 -225
  255. package/src/style/layout.less +0 -402
  256. package/src/style/markdown.less +0 -240
  257. package/src/style/variables.less +0 -37
  258. package/src/test/SearchBar.test.ts +0 -32
  259. package/src/test/Table.test.tsx +0 -41
  260. package/src/test/index.test.tsx +0 -377
@@ -0,0 +1,75 @@
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 } from 'react';
15
+ import { BackTop, Layout as AntLayout } from 'antd';
16
+ import { Header } from "../../slots/Header";
17
+ import { Footer } from "../../slots/Footer";
18
+ import NavigatorBanner from "../../slots/Header/Products/NavigatorBanner";
19
+ import { VerticalAlignTopOutlined } from '@ant-design/icons';
20
+ import { Article } from "./components/Article";
21
+ import { ExampleTopicMenu } from "./components/ExampleTopicMenu";
22
+ import { GalleryPageContent } from "./components/GalleryPageContent";
23
+ import { usePrevAndNext } from "../../slots/hooks";
24
+ import { ThemeAntVContext } from "../../context";
25
+ import styles from "./index.module.less";
26
+ /**
27
+ * Examples 页面
28
+ *
29
+ * @author YuZhanglong <loveyzl1123@gmail.com>
30
+ */
31
+
32
+ var Example = function Example() {
33
+ /** 示例页面的元数据信息 */
34
+ var metaData = useContext(ThemeAntVContext);
35
+ var exampleTopics = metaData.meta.exampleTopics;
36
+
37
+ var _usePrevAndNext = usePrevAndNext(),
38
+ _usePrevAndNext2 = _slicedToArray(_usePrevAndNext, 2),
39
+ prev = _usePrevAndNext2[0],
40
+ next = _usePrevAndNext2[1];
41
+
42
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, {
43
+ isHomePage: false
44
+ }), /*#__PURE__*/React.createElement(AntLayout, {
45
+ hasSider: true,
46
+ className: styles.layout
47
+ }, /*#__PURE__*/React.createElement(ExampleTopicMenu, {
48
+ exampleTopics: exampleTopics
49
+ }), /*#__PURE__*/React.createElement(Article, {
50
+ className: styles.markdown
51
+ }, /*#__PURE__*/React.createElement("div", {
52
+ className: styles.main,
53
+ style: {
54
+ width: '100%'
55
+ }
56
+ }, /*#__PURE__*/React.createElement(GalleryPageContent, {
57
+ exampleTopics: exampleTopics
58
+ }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(NavigatorBanner, {
59
+ type: "prev",
60
+ post: prev
61
+ }), /*#__PURE__*/React.createElement(NavigatorBanner, {
62
+ type: "next",
63
+ post: next
64
+ })), /*#__PURE__*/React.createElement(BackTop, {
65
+ style: {
66
+ right: 32
67
+ }
68
+ }, /*#__PURE__*/React.createElement("div", {
69
+ className: styles.backTop
70
+ }, /*#__PURE__*/React.createElement(VerticalAlignTopOutlined, null)))))), /*#__PURE__*/React.createElement(Footer, {
71
+ isDynamicFooter: true
72
+ }));
73
+ };
74
+
75
+ export default Example;
@@ -0,0 +1,605 @@
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
+
272
+ // menu 滚动
273
+ :global {
274
+ .ant-layout-sider-children {
275
+ overflow: hidden;
276
+
277
+ &:hover {
278
+ overflow-y: auto;
279
+ }
280
+ }
281
+ }
282
+ }
283
+
284
+ .affix {
285
+ & > div {
286
+ height: 100%;
287
+ }
288
+ }
289
+
290
+ .menuIcon {
291
+ opacity: 0.6;
292
+ font-size: 16px !important;
293
+ position: relative;
294
+ top: 1px;
295
+ margin-right: 8px !important;
296
+ }
297
+
298
+ .menuDrawer {
299
+ :global(.drawer) {
300
+ z-index: 9;
301
+ }
302
+
303
+ :global(.ant-menu) {
304
+ border-right: 0;
305
+ }
306
+
307
+ .menuSwitch {
308
+ position: absolute;
309
+ top: 72px;
310
+ right: -40px;
311
+ width: 40px;
312
+ height: 40px;
313
+ cursor: pointer;
314
+ z-index: 0;
315
+ text-align: center;
316
+ line-height: 40px;
317
+ font-size: 16px;
318
+ display: flex;
319
+ justify-content: center;
320
+ align-items: center;
321
+ background: #fff;
322
+ box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
323
+ border-radius: 0 4px 4px 0;
324
+ }
325
+ }
326
+
327
+ .gallery {
328
+ display: flex;
329
+ flex-direction: row-reverse;
330
+
331
+ .galleryContent {
332
+ flex: 1;
333
+ }
334
+
335
+ .anchor {
336
+ width: @toc-width;
337
+ padding-left: 24px;
338
+
339
+ :global {
340
+ .ant-anchor {
341
+ font-size: 12px;
342
+ }
343
+
344
+ .ant-anchor-link {
345
+ padding-top: 5px;
346
+ padding-bottom: 5px;
347
+ }
348
+ }
349
+ }
350
+
351
+ .galleryList {
352
+ list-style: none;
353
+ margin: 0 -12px !important;
354
+ }
355
+
356
+ .galleryCard {
357
+ display: inline-block;
358
+ vertical-align: top;
359
+ width: 25%;
360
+ margin: 0 !important;
361
+ padding: 0 !important;
362
+
363
+ .galleryCardLink {
364
+ display: block;
365
+ position: relative;
366
+ cursor: pointer;
367
+ transition: all 0.3s;
368
+ margin: 12px;
369
+
370
+ > div {
371
+ border: 1px solid @border-color-split;
372
+ border-radius: 6px;
373
+ overflow: hidden;
374
+ height: calc(100vw / 9 - 20px);
375
+ min-height: 130px;
376
+ max-height: 280px;
377
+ object-fit: cover;
378
+ transition: all 0.3s;
379
+ display: flex;
380
+ justify-content: center;
381
+
382
+ img {
383
+ max-width: 100%;
384
+ max-height: 100%;
385
+ object-fit: scale-down;
386
+ }
387
+ }
388
+
389
+ &:hover > div {
390
+ transform: translateY(-4px);
391
+ border-color: transparent;
392
+ box-shadow: 0 6px 16px rgba(107, 147, 224, 0.14);
393
+ }
394
+
395
+ h4 {
396
+ margin: 16px 0 0;
397
+ text-align: center;
398
+ color: #101424;
399
+ font-size: 16px;
400
+ line-height: 22px;
401
+ overflow: hidden;
402
+ text-overflow: ellipsis;
403
+ white-space: nowrap;
404
+ }
405
+ }
406
+
407
+ // 自定义上新徽章
408
+ .customRibbon {
409
+ transform: rotate(45deg) translate(5px, -12px);
410
+ border-radius: 0;
411
+ width: 65px;
412
+ height: 18px;
413
+ font-size: 14px;
414
+ font-weight: 500;
415
+ line-height: 18px;
416
+ text-align: center;
417
+
418
+ :global {
419
+ .ant-ribbon-corner {
420
+ display: none;
421
+ }
422
+ }
423
+ }
424
+ }
425
+ }
426
+
427
+ .apiStructure {
428
+ padding: 0;
429
+ }
430
+
431
+ .editOnGtiHubButton {
432
+ margin-left: 0.5em;
433
+ font-size: 16px;
434
+ color: #999;
435
+ vertical-align: middle;
436
+ position: relative;
437
+ top: -2px;
438
+ }
439
+
440
+ .exampleContent {
441
+ margin-top: -24px;
442
+
443
+ :global {
444
+ .SplitPane {
445
+ overflow: auto;
446
+ left: 0px;
447
+ height: calc(100vh - 64px) !important;
448
+ }
449
+
450
+ .Pane2 {
451
+ overflow: auto;
452
+ }
453
+
454
+ .ant-collapse-extra {
455
+ margin-left: 16px;
456
+ display: inline-block;
457
+ float: none !important;
458
+ }
459
+ }
460
+ }
461
+
462
+ @media only screen and (max-width: 1199.99px) {
463
+ .gallery {
464
+ .galleryCard {
465
+ width: 33.3%;
466
+ }
467
+ }
468
+ }
469
+
470
+ @media only screen and (max-width: 991.99px) {
471
+ .markdown {
472
+ .main {
473
+ width: 100vw !important;
474
+ padding-left: 32px;
475
+ padding-right: 32px;
476
+ }
477
+
478
+ .toc {
479
+ display: none;
480
+ }
481
+ }
482
+
483
+ .sider {
484
+ width: 240px !important;
485
+ }
486
+
487
+ .gallery {
488
+ .galleryCard {
489
+ width: 50%;
490
+ }
491
+
492
+ .anchor {
493
+ display: none;
494
+ }
495
+ }
496
+ }
497
+
498
+ @media only screen and (max-width: 767.99px) {
499
+ .layout {
500
+ flex-direction: column !important;
501
+ }
502
+
503
+ .sider {
504
+ width: 100% !important;
505
+ margin-bottom: 32px;
506
+ padding-bottom: 32px;
507
+ border-bottom: 1px solid #e8e8e8;
508
+ display: none;
509
+ }
510
+
511
+ .markdown {
512
+ .main {
513
+ margin-top: 30px;
514
+ padding-left: 24px;
515
+ padding-right: 24px;
516
+ }
517
+ }
518
+ }
519
+
520
+ @media only screen and (max-width: 575.99px) {
521
+ .gallery {
522
+ .galleryCard {
523
+ width: 100%;
524
+ }
525
+ }
526
+ }
527
+
528
+ .galleryAnchor {
529
+ overflow-x: hidden;
530
+ overflow-y: hidden;
531
+
532
+ &:hover {
533
+ overflow-y: auto;
534
+ }
535
+
536
+ :global(.ant-anchor-link) {
537
+ width: 100%;
538
+ height: 100%;
539
+ padding: 0;
540
+ display: flex;
541
+ align-items: center;
542
+ }
543
+
544
+ :global(.ant-anchor-ink) {
545
+ display: none;
546
+ }
547
+
548
+ :global(.ant-anchor-link-title) {
549
+ width: 100%;
550
+ height: 100%;
551
+ padding: 0;
552
+ display: flex;
553
+ align-items: center;
554
+ }
555
+ }
556
+
557
+ .apiAnchor {
558
+ padding-left: 14px;
559
+ overflow: hidden;
560
+
561
+ &:hover {
562
+ overflow-y: auto;
563
+ }
564
+
565
+ :global(.ant-anchor-ink-ball) {
566
+ width: 2px;
567
+ height: 24px;
568
+ background-color: #873bf4;
569
+ border: none;
570
+ border-radius: 0;
571
+ transform: translateX(-50%) translateY(-8px);
572
+ }
573
+
574
+ :global(.anticon) {
575
+ position: absolute;
576
+ padding-top: 5px;
577
+ font-size: 12px;
578
+ color: red;
579
+ }
580
+
581
+ .parent {
582
+ padding: 5px 0 5px 14px;
583
+ font-size: 12px;
584
+ }
585
+
586
+ .children {
587
+ padding: 5px 0 5px 14px;
588
+ font-size: 12px;
589
+ }
590
+ }
591
+
592
+ .backTop {
593
+ transition: color 0.3s;
594
+ color: #868484;
595
+ background-color: #fff;
596
+ box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12),
597
+ 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
598
+ transition: color 0.3s;
599
+ width: 44px;
600
+ height: 44px;
601
+ line-height: 44px;
602
+ font-size: 22px;
603
+ border-radius: 50%;
604
+ text-align: center;
605
+ }
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ export interface AnnouncementProps {
3
+ message: React.ReactNode;
4
+ localStorageId: string;
5
+ bannerId: string;
6
+ style?: React.CSSProperties;
7
+ }
8
+ export interface GalleryPageContentProps {
9
+ /**
10
+ * 案例主题列表
11
+ */
12
+ exampleTopics: ExamplesPage.ExampleTopic[];
13
+ }
14
+ export interface LeftMenuProps {
15
+ /**
16
+ * 案例主题列表
17
+ */
18
+ exampleTopics: ExamplesPage.ExampleTopic[];
19
+ }
20
+ export interface ExampleWithTopic extends ExamplesPage.Example {
21
+ targetTopic: ExamplesPage.ExampleTopic;
22
+ }
23
+ export interface DemoCardProps {
24
+ demo: ExamplesPage.Demo;
25
+ topicId: string;
26
+ exampleId: string;
27
+ }
28
+ export interface LeftMenuProps {
29
+ /**
30
+ * 案例主题列表
31
+ */
32
+ exampleTopics: ExamplesPage.ExampleTopic[];
33
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * 获取案例页面的所有主题
3
+ *
4
+ * @returns {ExamplesPage.ExampleTopic[]} 案例主题列表
5
+ * @author YuZhanglong <loveyzl1123@gmail.com>
6
+ */
7
+ export declare const getExamplesPageTopics: (exampleTopics: ExamplesPage.ExampleTopic[]) => {
8
+ id: string;
9
+ title: ExamplesPage.ExampleTopic;
10
+ icon: ExamplesPage.ExampleTopic;
11
+ examples: ExamplesPage.Example[];
12
+ }[];