@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
package/es/layout.js DELETED
@@ -1,276 +0,0 @@
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 { context, Link } from 'dumi/theme';
14
- import i18n from 'i18next';
15
- import React, { useContext, useState } from 'react';
16
- import { initReactI18next } from 'react-i18next';
17
- import NotFoundPage from './antv/404';
18
- import Banner from './antv/Banner/index';
19
- import Cases from './antv/Cases/Cases';
20
- import Ideas from './antv/Features';
21
- import Footer from './antv/Footer';
22
- import Navbar from './components/Navbar';
23
- import SearchBar from './components/SearchBar';
24
- import SideMenu from './components/SideMenu';
25
- import SlugList from './components/SlugList';
26
- import './style/layout.less';
27
- i18n.use(initReactI18next) // passes i18n down to react-i18next
28
- .init({
29
- initImmediate: false,
30
- fallbackLng: 'zh',
31
- keySeparator: false,
32
- react: {
33
- useSuspense: false
34
- }
35
- });
36
-
37
- var isEmpty = function isEmpty(obj) {
38
- return Object.keys(obj).length === 0;
39
- };
40
-
41
- var processRedirect = function processRedirect(context, location) {
42
- var pathname = location.pathname;
43
- var meta = context.meta,
44
- routes = context.routes;
45
- var isEmptyMeta = isEmpty(meta);
46
- var matchRoute = {
47
- meta: {}
48
- };
49
- var needRedirectPath = ['/zh', '/zh/', '/zh-CN', '/zh-CN/', '/en', '/en/', '/en-US', '/en-US/'];
50
- var isInclude = needRedirectPath.some(function (item) {
51
- return item === pathname;
52
- });
53
-
54
- if (isEmptyMeta) {
55
- if (isInclude) {
56
- // 存在重定向需求
57
- var isZh = pathname.slice(1, 3) === 'zh';
58
- var isEn = pathname.slice(1, 3) === 'en';
59
-
60
- if (isZh) {
61
- matchRoute = routes.find(function (item) {
62
- return item.path === '/';
63
- });
64
- }
65
-
66
- if (isEn) {
67
- matchRoute = routes.find(function (item) {
68
- return item.path === '/en-US';
69
- });
70
- }
71
- }
72
- }
73
-
74
- return {
75
- meta: isEmptyMeta ? matchRoute.meta : meta,
76
- isDirect: isInclude
77
- };
78
- };
79
-
80
- var Hero = function Hero(hero) {
81
- return /*#__PURE__*/React.createElement("div", {
82
- className: "__dumi-default-layout-hero"
83
- }, hero.image && /*#__PURE__*/React.createElement("img", {
84
- src: hero.image,
85
- alt: "banner"
86
- }), /*#__PURE__*/React.createElement("h1", null, hero.title), /*#__PURE__*/React.createElement("div", {
87
- dangerouslySetInnerHTML: {
88
- __html: hero.desc
89
- }
90
- }), hero.actions && hero.actions.map(function (action) {
91
- return /*#__PURE__*/React.createElement(Link, {
92
- to: action.link,
93
- key: action.text
94
- }, /*#__PURE__*/React.createElement("button", {
95
- type: "button"
96
- }, action.text));
97
- }));
98
- };
99
-
100
- var BannerPanel = function BannerPanel(banner) {
101
- var image = banner.image,
102
- title = banner.title,
103
- desc = banner.desc,
104
- actions = banner.actions,
105
- notifications = banner.notifications;
106
- var description = /*#__PURE__*/React.createElement("div", {
107
- dangerouslySetInnerHTML: {
108
- __html: desc
109
- }
110
- });
111
- var coverImage = /*#__PURE__*/React.createElement("img", {
112
- alt: "graphin",
113
- style: {
114
- width: '100%',
115
- marginTop: '20%'
116
- },
117
- src: image
118
- });
119
- return /*#__PURE__*/React.createElement(Banner, {
120
- coverImage: coverImage,
121
- title: title,
122
- // @ts-ignore
123
- description: description,
124
- notifications: notifications,
125
- buttons: actions,
126
- className: "banner"
127
- });
128
- };
129
-
130
- var Features = function Features(features) {
131
- return /*#__PURE__*/React.createElement("div", {
132
- className: "__dumi-default-layout-features"
133
- }, features.map(function (feat) {
134
- return /*#__PURE__*/React.createElement("dl", {
135
- key: feat.title,
136
- style: {
137
- backgroundImage: feat.icon ? "url(".concat(feat.icon, ")") : undefined
138
- }
139
- }, feat.link ? /*#__PURE__*/React.createElement(Link, {
140
- to: feat.link
141
- }, /*#__PURE__*/React.createElement("dt", null, feat.title)) : /*#__PURE__*/React.createElement("dt", null, feat.title), /*#__PURE__*/React.createElement("dd", {
142
- dangerouslySetInnerHTML: {
143
- __html: feat.desc
144
- }
145
- }));
146
- }));
147
- };
148
-
149
- var Layout = function Layout(_ref) {
150
- var children = _ref.children,
151
- location = _ref.location;
152
-
153
- var _a, _b;
154
-
155
- var Context = useContext(context);
156
- var _Context$config = Context.config,
157
- mode = _Context$config.mode,
158
- repository = _Context$config.repository,
159
- locale = Context.locale;
160
-
161
- var _processRedirect = processRedirect(Context, location),
162
- meta = _processRedirect.meta,
163
- isDirect = _processRedirect.isDirect;
164
-
165
- var repoUrl = repository.url,
166
- branch = repository.branch,
167
- platform = repository.platform;
168
-
169
- var _useState = useState(true),
170
- _useState2 = _slicedToArray(_useState, 2),
171
- menuCollapsed = _useState2[0],
172
- setMenuCollapsed = _useState2[1];
173
-
174
- var isSiteMode = mode === 'site';
175
- var showHero = isSiteMode && meta.hero;
176
- var showBanner = isSiteMode && meta.banner;
177
- var showCases = isSiteMode && meta.cases;
178
- var showFeatures = isSiteMode && meta.features;
179
- var showIdeas = isSiteMode && meta.ideas;
180
- var showSideMenu = meta.sidemenu !== false && !showHero && !showBanner && !showFeatures && !meta.gapless;
181
- var showSlugs = !showHero && !showBanner && !showFeatures && Boolean((_a = meta.slugs) === null || _a === void 0 ? void 0 : _a.length) && (meta.toc === 'content' || meta.toc === undefined) && !meta.gapless;
182
- var isCN = /^zh|cn$/i.test(locale); // eslint-disable-next-line @typescript-eslint/no-explicit-any
183
-
184
- var updatedTime = new Date(meta.updatedTime).toLocaleString([], {
185
- hour12: false
186
- });
187
- var repoPlatform = {
188
- github: 'GitHub',
189
- gitlab: 'GitLab'
190
- }[((_b = (repoUrl || '').match(/(github|gitlab)/)) === null || _b === void 0 ? void 0 : _b[1]) || 'nothing'] || platform; // 等dumi最新版发布后解决路由匹配问题
191
-
192
- if (isEmpty(meta) && !isDirect) {
193
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
194
- style: {
195
- marginBottom: '60px'
196
- },
197
- className: "__dumi-default-layout home",
198
- "data-route": location.pathname,
199
- "data-show-sidemenu": false,
200
- "data-show-slugs": false,
201
- "data-site-mode": "site",
202
- "data-gapless": String(!!meta.gapless),
203
- onClick: function onClick() {
204
- if (menuCollapsed) return;
205
- setMenuCollapsed(true);
206
- }
207
- }, /*#__PURE__*/React.createElement("div", {
208
- style: {
209
- height: '60px'
210
- }
211
- }), /*#__PURE__*/React.createElement(Navbar, {
212
- location: location,
213
- navPrefix: /*#__PURE__*/React.createElement(SearchBar, null),
214
- onMobileMenuClick: function onMobileMenuClick(ev) {
215
- setMenuCollapsed(function (val) {
216
- return !val;
217
- });
218
- ev.stopPropagation();
219
- }
220
- }), /*#__PURE__*/React.createElement(NotFoundPage, null), /*#__PURE__*/React.createElement(Footer, {
221
- location: window.location,
222
- githubUrl: repoUrl,
223
- rootDomain: "https://antv.vision"
224
- })));
225
- }
226
-
227
- return /*#__PURE__*/React.createElement("div", {
228
- className: "__dumi-default-layout ".concat(showBanner ? 'home' : ''),
229
- "data-route": location.pathname,
230
- "data-show-sidemenu": String(showSideMenu),
231
- "data-show-slugs": String(showSlugs),
232
- "data-site-mode": isSiteMode,
233
- "data-gapless": String(!!meta.gapless),
234
- onClick: function onClick() {
235
- if (menuCollapsed) return;
236
- setMenuCollapsed(true);
237
- }
238
- }, /*#__PURE__*/React.createElement(Navbar, {
239
- location: location,
240
- navPrefix: /*#__PURE__*/React.createElement(SearchBar, null),
241
- onMobileMenuClick: function onMobileMenuClick(ev) {
242
- setMenuCollapsed(function (val) {
243
- return !val;
244
- });
245
- ev.stopPropagation();
246
- }
247
- }), showSideMenu && /*#__PURE__*/React.createElement(SideMenu, {
248
- mobileMenuCollapsed: menuCollapsed,
249
- location: location
250
- }), showSlugs && /*#__PURE__*/React.createElement(SlugList, {
251
- slugs: meta.slugs,
252
- className: "__dumi-default-layout-toc"
253
- }), showBanner && BannerPanel(meta.banner), showHero && Hero(meta.hero), showFeatures && Features(meta.features), showIdeas && /*#__PURE__*/React.createElement(Ideas, {
254
- features: meta.ideas,
255
- style: {
256
- width: '100%'
257
- }
258
- }), showCases && /*#__PURE__*/React.createElement(Cases, {
259
- cases: meta.cases,
260
- className: "graph-cases"
261
- }), /*#__PURE__*/React.createElement("div", {
262
- className: "__dumi-default-layout-content"
263
- }, children, showSideMenu && /*#__PURE__*/React.createElement("div", {
264
- className: "__dumi-default-layout-footer-meta"
265
- }, repoPlatform && /*#__PURE__*/React.createElement(Link, {
266
- to: "".concat(repoUrl, "/edit/").concat(branch, "/").concat(meta.filePath)
267
- }, isCN ? "\u5728 ".concat(repoPlatform, " \u4E0A\u7F16\u8F91\u6B64\u9875") : "Edit this doc on ".concat(repoPlatform)), /*#__PURE__*/React.createElement("span", {
268
- "data-updated-text": isCN ? '最后更新时间:' : 'Last update: '
269
- }, updatedTime)), !showSideMenu && /*#__PURE__*/React.createElement(Footer, {
270
- location: window.location,
271
- githubUrl: repoUrl,
272
- rootDomain: "https://antv.vision"
273
- })));
274
- };
275
-
276
- export default Layout;
@@ -1,402 +0,0 @@
1
- @import "./markdown.less";
2
- @import "./variables.less";
3
-
4
- @s-toc-width: 136px;
5
-
6
- body {
7
- margin: 0;
8
- font-family: -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC,
9
- Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial,
10
- sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
11
- font-variant: tabular-nums;
12
- font-feature-settings: "tnum";
13
- transition: background 0.2s cubic-bezier(0.075, 0.82, 0.165, 1),
14
- color 0.2s cubic-bezier(0.075, 0.82, 0.165, 1);
15
-
16
- [data-prefers-color="dark"] & {
17
- color: @c-text-dark;
18
- background-color: @c-bg-dark;
19
- }
20
- }
21
-
22
- .@{prefix}-layout {
23
- box-sizing: border-box;
24
- min-height: 100vh;
25
- padding: 16px (@s-content-margin + @s-toc-width) 50px @s-menu-width +
26
- @s-content-margin;
27
- &.home {
28
- padding: 0px !important;
29
- }
30
- @media @mobile {
31
- padding-top: 66px !important;
32
- padding-left: 16px !important;
33
- padding-right: 16px !important;
34
- }
35
-
36
- &[data-gapless="true"] {
37
- padding-top: @s-nav-height !important;
38
- padding-right: 0 !important;
39
- padding-left: 0 !important;
40
- padding-bottom: 0;
41
-
42
- @media @mobile {
43
- padding-top: @s-mobile-nav-height !important;
44
- }
45
- }
46
-
47
- &[data-show-sidemenu="false"] {
48
- padding-left: @s-content-margin;
49
- }
50
-
51
- &[data-show-slugs="false"] {
52
- padding-right: @s-content-margin;
53
- }
54
-
55
- &[data-site-mode="true"] {
56
- padding-top: @s-nav-height + 50px;
57
-
58
- &[data-show-sidemenu="true"] {
59
- padding-left: @s-site-menu-width + 50px;
60
- }
61
-
62
- &[data-show-slugs="true"] {
63
- padding-right: @s-content-margin + @s-toc-width + 14;
64
- }
65
-
66
- .@{prefix}-layout-content > .markdown:first-child > *:first-child {
67
- margin-top: 0;
68
- }
69
-
70
- .@{prefix}-layout-toc {
71
- top: 114px;
72
- max-height: calc(90vh - 144px);
73
- }
74
- }
75
-
76
- &-hero {
77
- margin: -50px -58px 0;
78
- padding: 100px 0;
79
- text-align: center;
80
- background-color: #f5f6f8;
81
-
82
- [data-prefers-color="dark"] & {
83
- background-color: @c-light-bg-dark;
84
- }
85
-
86
- @media @mobile {
87
- margin: -16px -16px 0;
88
- padding: 48px 0;
89
- }
90
-
91
- img {
92
- max-width: 100%;
93
- max-height: 200px;
94
- margin-bottom: 1rem;
95
- }
96
-
97
- h1 {
98
- margin: 0 0 16px;
99
- font-size: 48px;
100
- font-weight: 600;
101
- line-height: 56px;
102
- color: #080e29;
103
-
104
- [data-prefers-color="dark"] & {
105
- color: @c-heading-dark;
106
- }
107
-
108
- + div {
109
- margin: 16px 0 32px;
110
- opacity: 0.78;
111
-
112
- .markdown {
113
- font-size: 16px;
114
- }
115
- }
116
- }
117
-
118
- button {
119
- margin-right: 16px;
120
- padding: 0 32px;
121
- height: 44px;
122
- color: @c-primary;
123
- font-size: 16px;
124
- background: transparent;
125
- border: 1px solid @c-primary;
126
- border-radius: 22px;
127
- box-sizing: border-box;
128
- cursor: pointer;
129
- outline: none;
130
- transition: all 0.3s;
131
-
132
- &:hover {
133
- opacity: 0.8;
134
- }
135
-
136
- &:active {
137
- opacity: 0.9;
138
- }
139
- }
140
-
141
- a:last-child button {
142
- margin-right: 0;
143
- color: #fff;
144
- background: @c-primary;
145
- }
146
- }
147
-
148
- &-features {
149
- display: grid;
150
- grid-template-columns: repeat(3, 1fr);
151
- grid-column-gap: 96px;
152
- grid-row-gap: 56px;
153
- padding: 72px 0;
154
-
155
- > dl {
156
- flex: 1;
157
- margin: 0;
158
- text-align: center;
159
- background: no-repeat center top / auto 48px;
160
-
161
- &[style*="background-image"] {
162
- padding-top: 64px;
163
- }
164
-
165
- dt {
166
- margin-bottom: 12px;
167
- font-size: 20px;
168
- line-height: 1;
169
- color: @c-heading;
170
- [data-prefers-color="dark"] & {
171
- color: @c-text-dark;
172
- }
173
- }
174
-
175
- a {
176
- transition-duration: none;
177
- }
178
-
179
- a dt {
180
- color: @c-link;
181
- transition: opacity 0.2s;
182
- &:hover {
183
- opacity: 0.7;
184
- text-decoration: underline;
185
- }
186
-
187
- &:active {
188
- opacity: 0.9;
189
- }
190
- }
191
-
192
- dd {
193
- margin: 0;
194
-
195
- .markdown {
196
- color: @c-secondary;
197
- font-size: 14px;
198
- line-height: 22px;
199
-
200
- [data-prefers-color="dark"] & {
201
- color: @c-secondary-dark;
202
- }
203
-
204
- > p:first-child {
205
- margin-top: 0;
206
- }
207
-
208
- > p:last-child {
209
- margin-bottom: 0;
210
- }
211
- }
212
- }
213
- }
214
-
215
- @media @mobile {
216
- display: block;
217
- padding: 40px 0;
218
-
219
- > dl {
220
- text-align: left;
221
- background-position: left top;
222
-
223
- &[style*="background-image"] {
224
- padding: 0 0 0 60px;
225
- }
226
-
227
- + dl {
228
- margin-top: 32px;
229
- }
230
- }
231
- }
232
- }
233
-
234
- &-features,
235
- &-features + &-content,
236
- &-hero + &-content {
237
- margin-left: auto;
238
- margin-right: auto;
239
- max-width: 960px;
240
- }
241
-
242
- &-hero + &-content {
243
- margin-top: 60px;
244
- }
245
-
246
- &-toc {
247
- list-style: none;
248
- position: fixed;
249
- z-index: 10;
250
- top: 50px;
251
- right: 0;
252
- width: @s-toc-width;
253
- max-height: calc(90vh - 80px);
254
- margin: 0;
255
- padding: 0 24px 0 0;
256
- background-color: #fff;
257
- box-sizing: content-box;
258
- overflow: auto;
259
-
260
- [data-prefers-color="dark"] & {
261
- background-color: @c-bg-dark;
262
- }
263
-
264
- @media @mobile {
265
- display: none;
266
- }
267
-
268
- li {
269
- position: relative;
270
- margin: 0;
271
- padding: 4px 0 4px 6px;
272
- text-indent: 12px;
273
- font-size: 13px;
274
- line-height: 1.40625;
275
- white-space: nowrap;
276
- text-overflow: ellipsis;
277
- overflow: hidden;
278
-
279
- a {
280
- color: @c-text;
281
- text-decoration: none;
282
-
283
- [data-prefers-color="dark"] & {
284
- color: @c-text-dark;
285
- }
286
-
287
- &::before {
288
- content: "";
289
- position: absolute;
290
- top: 0;
291
- left: 0;
292
- bottom: 0;
293
- display: inline-block;
294
- width: 2px;
295
- background: @c-border;
296
- }
297
-
298
- &:hover {
299
- color: lighten(@c-primary, 5%);
300
-
301
- [data-prefers-color="dark"] & {
302
- color: lighten(@c-primary-dark, 5%);
303
- }
304
- }
305
-
306
- &:active {
307
- color: lighten(@c-primary, 3%);
308
-
309
- [data-prefers-color="dark"] & {
310
- color: lighten(@c-primary-dark, 3%);
311
- }
312
- }
313
-
314
- &.active {
315
- color: @c-primary;
316
-
317
- [data-prefers-color="dark"] & {
318
- color: @c-primary-dark;
319
- }
320
-
321
- &::before {
322
- background: @c-primary;
323
-
324
- [data-prefers-color="dark"] & {
325
- background: @c-primary-dark;
326
- }
327
- }
328
- }
329
- }
330
- }
331
- }
332
-
333
- &-footer-meta {
334
- margin-top: 40px;
335
- padding-top: 24px;
336
- display: flex;
337
- color: @c-secondary;
338
- font-size: 14px;
339
- justify-content: space-between;
340
- border-top: 1px solid @c-border;
341
-
342
- [data-prefers-color="dark"] & {
343
- color: @c-secondary-dark;
344
- border-color: @c-border-dark;
345
- }
346
-
347
- @media only screen and (max-width: 960px) {
348
- display: block;
349
- }
350
-
351
- > a {
352
- margin-bottom: 4px;
353
- display: block;
354
- color: @c-primary;
355
- transition: opacity 0.2s;
356
- text-decoration: none;
357
-
358
- [data-prefers-color="dark"] & {
359
- color: @c-primary-dark;
360
- }
361
-
362
- &:hover {
363
- opacity: 0.7;
364
- text-decoration: underline;
365
- }
366
-
367
- &:active {
368
- opacity: 0.9;
369
- }
370
- }
371
-
372
- > span:last-child {
373
- &::before {
374
- content: attr(data-updated-text);
375
- color: @c-primary;
376
-
377
- [data-prefers-color="dark"] & {
378
- color: @c-primary-dark;
379
- }
380
- }
381
- }
382
- }
383
- }
384
-
385
- .__dumi-default-layout-footer {
386
- margin: 72px 0 -32px;
387
- padding-top: 24px;
388
- border-top: 1px solid @c-border;
389
- text-align: center;
390
-
391
- [data-prefers-color="dark"] & {
392
- border-color: @c-border-dark;
393
- }
394
-
395
- .markdown {
396
- color: #b0b1ba;
397
-
398
- [data-prefers-color="dark"] & {
399
- color: rgba(255, 255, 255, 0.45);
400
- }
401
- }
402
- }