@antv/dumi-theme-antv 0.5.2 → 0.5.4-beta.0

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 (88) hide show
  1. package/dist/common/Link.js +78 -0
  2. package/dist/common/SEO.js +61 -0
  3. package/dist/hooks/useMenu.js +117 -0
  4. package/dist/layouts/DocLayout.js +6 -7
  5. package/dist/layouts/entry/API.js +1 -0
  6. package/dist/layouts/entry/Index.js +9 -22
  7. package/dist/layouts/entry/Manual.js +6 -4
  8. package/dist/locales/en.json +49 -1
  9. package/dist/locales/zh.json +48 -1
  10. package/dist/pages/404.js +1 -2
  11. package/dist/pages/Example/index.js +2 -3
  12. package/dist/pages/Examples/index.js +4 -3
  13. package/dist/slots/ManualContent/Main.js +90 -0
  14. package/dist/slots/ManualContent/Sidebar.js +77 -0
  15. package/dist/slots/ManualContent/index.js +8 -305
  16. package/dist/slots/ManualContent/index.module.less +63 -29
  17. package/dist/slots/ManualContent/utils.js +19 -15
  18. package/dist/slots/utils.js +7 -0
  19. package/dist/utils/menu.js +46 -0
  20. package/package.json +56 -56
  21. package/dist/builtins/Playground/index.d.ts +0 -21
  22. package/dist/context.d.ts +0 -6
  23. package/dist/layouts/DocLayout.d.ts +0 -8
  24. package/dist/layouts/entry/API.d.ts +0 -10
  25. package/dist/layouts/entry/Index.d.ts +0 -7
  26. package/dist/layouts/entry/Manual.d.ts +0 -8
  27. package/dist/model/index.d.ts +0 -5
  28. package/dist/pages/404.d.ts +0 -6
  29. package/dist/pages/Example/components/CollapsedIcon/index.d.ts +0 -8
  30. package/dist/pages/Example/index.d.ts +0 -6
  31. package/dist/pages/Example/utils.d.ts +0 -1
  32. package/dist/pages/Examples/components/Accouncement/index.d.ts +0 -6
  33. package/dist/pages/Examples/components/Article/index.d.ts +0 -2
  34. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.d.ts +0 -10
  35. package/dist/pages/Examples/components/ExampleTopicMenu/index.d.ts +0 -9
  36. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.d.ts +0 -10
  37. package/dist/pages/Examples/components/GalleryPageContent/index.d.ts +0 -10
  38. package/dist/pages/Examples/index.d.ts +0 -8
  39. package/dist/pages/Examples/types.d.ts +0 -34
  40. package/dist/pages/Examples/utils.d.ts +0 -1
  41. package/dist/plugin/api.d.ts +0 -7
  42. package/dist/plugin/examples.d.ts +0 -21
  43. package/dist/plugin/index.d.ts +0 -3
  44. package/dist/plugin/rehypeObservable.d.ts +0 -1
  45. package/dist/slots/404.d.ts +0 -2
  46. package/dist/slots/API/index.d.ts +0 -15
  47. package/dist/slots/Article/index.d.ts +0 -3
  48. package/dist/slots/Banner/Notification.d.ts +0 -10
  49. package/dist/slots/Banner/index.d.ts +0 -26
  50. package/dist/slots/Cases/index.d.ts +0 -19
  51. package/dist/slots/CodeEditor/Toolbar.d.ts +0 -72
  52. package/dist/slots/CodeEditor/index.d.ts +0 -62
  53. package/dist/slots/CodeEditor/utils.d.ts +0 -42
  54. package/dist/slots/CodePreview/CodeHeader.d.ts +0 -19
  55. package/dist/slots/CodePreview/index.d.ts +0 -25
  56. package/dist/slots/CodeRunner/index.d.ts +0 -17
  57. package/dist/slots/CodeRunner/utils.d.ts +0 -11
  58. package/dist/slots/Companies/index.d.ts +0 -13
  59. package/dist/slots/ContentTable/index.d.ts +0 -6
  60. package/dist/slots/Detail/News.d.ts +0 -12
  61. package/dist/slots/Detail/index.d.ts +0 -30
  62. package/dist/slots/ExampleSider/index.d.ts +0 -21
  63. package/dist/slots/Features/FeatureCard.d.ts +0 -9
  64. package/dist/slots/Features/index.d.ts +0 -15
  65. package/dist/slots/Footer/index.d.ts +0 -18
  66. package/dist/slots/Header/Navs.d.ts +0 -27
  67. package/dist/slots/Header/Products/NavigatorBanner.d.ts +0 -10
  68. package/dist/slots/Header/Products/Product.d.ts +0 -14
  69. package/dist/slots/Header/Products/getProducts.d.ts +0 -48
  70. package/dist/slots/Header/Products/index.d.ts +0 -10
  71. package/dist/slots/Header/Search/SearchResult.d.ts +0 -21
  72. package/dist/slots/Header/Search/helper.d.ts +0 -8
  73. package/dist/slots/Header/Search/index.d.ts +0 -2
  74. package/dist/slots/Header/index.d.ts +0 -84
  75. package/dist/slots/Header/utils.d.ts +0 -10
  76. package/dist/slots/Loading/index.d.ts +0 -6
  77. package/dist/slots/ManualContent/NavigatorBanner.d.ts +0 -9
  78. package/dist/slots/ManualContent/Preview.d.ts +0 -7
  79. package/dist/slots/ManualContent/ReadingTime.d.ts +0 -3
  80. package/dist/slots/ManualContent/index.d.ts +0 -9
  81. package/dist/slots/ManualContent/usePreview.d.ts +0 -1
  82. package/dist/slots/ManualContent/utils.d.ts +0 -19
  83. package/dist/slots/SEO.d.ts +0 -10
  84. package/dist/slots/SEO.js +0 -57
  85. package/dist/slots/global.d.ts +0 -1
  86. package/dist/slots/hooks.d.ts +0 -16
  87. package/dist/slots/utils.d.ts +0 -5
  88. package/dist/types.d.ts +0 -86
@@ -4,6 +4,15 @@
4
4
  // 参考 yuque 右侧 tabOfContent 宽度
5
5
  @toc-width: 260px;
6
6
 
7
+ .mainContainer {
8
+ display: flex;
9
+ }
10
+
11
+ .layout {
12
+ margin: 24px 0 32px;
13
+ min-height: 100vh;
14
+ }
15
+
7
16
  .markdown {
8
17
  font-size: 14px;
9
18
  line-height: 2;
@@ -76,7 +85,7 @@
76
85
  margin: 0.6em 0;
77
86
  }
78
87
 
79
- pre>code[class*='language-'] {
88
+ pre > code[class*='language-'] {
80
89
  line-height: 1.8;
81
90
  }
82
91
 
@@ -125,7 +134,7 @@
125
134
  padding: 0;
126
135
  }
127
136
 
128
- ul:not(:global(.ant-skeleton-paragraph))>li {
137
+ ul:not(:global(.ant-skeleton-paragraph)) > li {
129
138
  margin-left: 20px;
130
139
  padding-left: 4px;
131
140
  list-style-type: circle;
@@ -135,14 +144,14 @@
135
144
  }
136
145
  }
137
146
 
138
- ol>li {
147
+ ol > li {
139
148
  margin-left: 20px;
140
149
  padding-left: 4px;
141
150
  list-style-type: decimal;
142
151
  }
143
152
 
144
- ul>li>p,
145
- ol>li>p {
153
+ ul > li > p,
154
+ ol > li > p {
146
155
  margin: 0.2em 0;
147
156
  }
148
157
 
@@ -201,8 +210,8 @@
201
210
  margin: 0;
202
211
  }
203
212
 
204
- >br,
205
- >p>br {
213
+ > br,
214
+ > p > br {
206
215
  clear: both;
207
216
  }
208
217
 
@@ -211,10 +220,6 @@
211
220
  }
212
221
  }
213
222
 
214
- .layout {
215
- margin: 24px 0 32px;
216
- }
217
-
218
223
  .main {
219
224
  width: 100%;
220
225
  padding-left: 48px;
@@ -228,23 +233,21 @@
228
233
  .contentReset() {
229
234
  min-height: 400px;
230
235
 
231
- >img,
232
- >p>img {
236
+ > img,
237
+ > p > img {
233
238
  max-width: 100%;
234
239
  margin: 0.5em 0;
235
240
  }
236
241
 
237
- >br,
238
- >p>br {
242
+ > br,
243
+ > p > br {
239
244
  clear: both;
240
245
  }
241
246
  }
242
-
243
-
244
247
  }
245
248
 
246
249
  .tocSider {
247
- width: @toc-width ! important;
250
+ width: @toc-width !important;
248
251
  }
249
252
 
250
253
  // reference yuque UI
@@ -259,7 +262,7 @@
259
262
  position: sticky;
260
263
  top: 0;
261
264
 
262
- ul>li {
265
+ ul > li {
263
266
  list-style: none !important;
264
267
  padding: 0 !important;
265
268
  margin-left: -1px !important;
@@ -280,7 +283,21 @@
280
283
  margin-bottom: 20px;
281
284
  font-weight: 500;
282
285
  font-size: 30px;
283
- font-family: Avenir, -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
286
+ font-family:
287
+ Avenir,
288
+ -apple-system,
289
+ BlinkMacSystemFont,
290
+ Segoe UI,
291
+ PingFang SC,
292
+ Hiragino Sans GB,
293
+ Microsoft YaHei,
294
+ Helvetica Neue,
295
+ Helvetica,
296
+ Arial,
297
+ sans-serif,
298
+ Apple Color Emoji,
299
+ Segoe UI Emoji,
300
+ Segoe UI Symbol;
284
301
  line-height: 38px;
285
302
  }
286
303
 
@@ -301,7 +318,7 @@
301
318
  }
302
319
 
303
320
  .affix {
304
- &>div {
321
+ & > div {
305
322
  height: 100%;
306
323
  }
307
324
 
@@ -404,7 +421,7 @@
404
421
  transition: all 0.3s;
405
422
  margin: 12px;
406
423
 
407
- >div {
424
+ > div {
408
425
  border: 1px solid @border-color-split;
409
426
  border-radius: 6px;
410
427
  overflow: hidden;
@@ -423,7 +440,7 @@
423
440
  }
424
441
  }
425
442
 
426
- &:hover>div {
443
+ &:hover > div {
427
444
  transform: translateY(-4px);
428
445
  border-color: transparent;
429
446
  box-shadow: 0 6px 16px rgba(107, 147, 224, 0.14);
@@ -624,8 +641,10 @@
624
641
  transition: color 0.3s;
625
642
  color: #868484;
626
643
  background-color: #fff;
627
- box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12),
628
- 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
644
+ box-shadow:
645
+ 0 3px 6px -4px rgba(0, 0, 0, 0.12),
646
+ 0 6px 16px 0 rgba(0, 0, 0, 0.08),
647
+ 0 9px 28px 8px rgba(0, 0, 0, 0.05);
629
648
  transition: color 0.3s;
630
649
  width: 44px;
631
650
  height: 44px;
@@ -648,6 +667,7 @@
648
667
  width: 100% !important;
649
668
  min-width: 400px;
650
669
  justify-content: center;
670
+ background-color: #fff;
651
671
  }
652
672
 
653
673
  .menuSwitch {
@@ -677,8 +697,8 @@
677
697
  color: #0d1a26;
678
698
  line-height: 1.5715;
679
699
  list-style: none;
680
- -webkit-font-feature-settings: "tnum";
681
- font-feature-settings: "tnum";
700
+ -webkit-font-feature-settings: 'tnum';
701
+ font-feature-settings: 'tnum';
682
702
  display: inline-block;
683
703
  height: auto;
684
704
  margin: 0 8px 0 0;
@@ -690,7 +710,21 @@
690
710
  border: 1px solid #d9d9d9;
691
711
  border-radius: 2px;
692
712
  opacity: 1;
693
- transition: all .3s;
713
+ transition: all 0.3s;
694
714
  background-color: #fff;
695
- font-family: Avenir, -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
715
+ font-family:
716
+ Avenir,
717
+ -apple-system,
718
+ BlinkMacSystemFont,
719
+ Segoe UI,
720
+ PingFang SC,
721
+ Hiragino Sans GB,
722
+ Microsoft YaHei,
723
+ Helvetica Neue,
724
+ Helvetica,
725
+ Arial,
726
+ sans-serif,
727
+ Apple Color Emoji,
728
+ Segoe UI Emoji,
729
+ Segoe UI Symbol;
696
730
  }
@@ -1,33 +1,37 @@
1
+ import { isEmpty } from "lodash-es";
1
2
  export function getOpenKeys() {
2
- var pathname = window.location.pathname.replace('/docs/', '/').replace('/zh/', '/');
3
- var pathArr = pathname.split('/');
3
+ var pathname = window.location.pathname.replace("/docs/", "/").replace("/zh/", "/");
4
+ var pathArr = pathname.split("/");
4
5
  var openKeys = [];
5
6
  for (var i = pathArr.length; i > 0; i--) {
6
7
  var tem = pathArr.slice(0, i);
7
- openKeys.push(tem.join('/'));
8
+ openKeys.push(tem.join("/"));
8
9
  }
9
10
  return openKeys;
10
11
  }
12
+
13
+ /**
14
+ * /api/xxx --> /api
15
+ * /en/api --> /en/api
16
+ */
11
17
  export function getBaseRoute() {
12
18
  var matchRoute = window.location.pathname;
13
19
  // 兼容 zh
14
- matchRoute = matchRoute.replace('/zh/', '/');
20
+ matchRoute = matchRoute.replace("/zh/", "/");
15
21
  // 兼容带有docs的route
16
- matchRoute = matchRoute.replace('/docs', '');
22
+ matchRoute = matchRoute.replace("/docs", "");
17
23
  // 查找 baseRoute
18
- var reg = window.location.pathname.startsWith('/en') ? /(\/[A-z]*\/?\/[A-z]*)\/?/ : /(\/[A-z]*)\/?/;
24
+ var reg = window.location.pathname.startsWith("/en") ? /(\/[A-z]*\/?\/[A-z]*)\/?/ : /(\/[A-z]*)\/?/;
19
25
  var mainRoute = matchRoute.match(reg);
20
26
  return mainRoute[1];
21
27
  }
22
- export function getIndexRoute(MenuData) {
23
- var defaultOpenKeys = [];
24
- var topRoute = MenuData[0];
25
- defaultOpenKeys.push(topRoute.key);
26
- while (topRoute.children) {
28
+ export function getIndexRoute(menuData) {
29
+ if (isEmpty(menuData)) return undefined;
30
+ var topRoute = menuData[0];
31
+ while (!isEmpty(topRoute.children)) {
27
32
  topRoute = topRoute.children[0];
28
- defaultOpenKeys.push(topRoute.key);
29
33
  }
30
- return defaultOpenKeys[defaultOpenKeys.length - 1];
34
+ return topRoute.key;
31
35
  }
32
36
 
33
37
  /**
@@ -46,8 +50,8 @@ export function getIndexRoute(MenuData) {
46
50
  */
47
51
  export function getNavigateUrl(pathname, first, siderbarMenu) {
48
52
  // 兜底 如果 nav 指定有误则自动重定向到 indexDocRoute
49
- if (pathname.includes('/docs/') || pathname.includes('/zh/')) {
50
- return pathname.replace('/docs/', '/').replace('/zh/', '/');
53
+ if (pathname.includes("/docs/") || pathname.includes("/zh/")) {
54
+ return pathname.replace("/docs/", "/").replace("/zh/", "/");
51
55
  }
52
56
  if (siderbarMenu.every(function (item) {
53
57
  var itemLowerCase = "".concat(item).toLowerCase();
@@ -9,6 +9,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
9
9
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
10
10
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
11
11
  import { icWithLocale } from "./hooks";
12
+
13
+ /**
14
+ * 统一去掉中英文前缀
15
+ */
16
+ export function getCurrentPathname() {
17
+ return window.location.pathname.replace('/zh/', '/').replace('/en/', '/');
18
+ }
12
19
  export function ping() {
13
20
  return _ping.apply(this, arguments);
14
21
  }
@@ -0,0 +1,46 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6
+ 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); }
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
+ export var getAncestorMenuItems = function getAncestorMenuItems(items, key) {
9
+ if (!items) return [];
10
+ var findAncestors = function findAncestors(items, key) {
11
+ var ancestors = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
12
+ var _iterator = _createForOfIteratorHelper(items),
13
+ _step;
14
+ try {
15
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
16
+ var item = _step.value;
17
+ if (item.key === key) return ancestors;
18
+ if (item.children) {
19
+ var result = findAncestors(item.children, key, [].concat(_toConsumableArray(ancestors), [item]));
20
+ if (result) return result;
21
+ }
22
+ }
23
+ } catch (err) {
24
+ _iterator.e(err);
25
+ } finally {
26
+ _iterator.f();
27
+ }
28
+ return null;
29
+ };
30
+ return findAncestors(items, key) || [];
31
+ };
32
+ export var flattenMenu = function flattenMenu(menuItems) {
33
+ if (Array.isArray(menuItems)) {
34
+ return menuItems.reduce(function (acc, item) {
35
+ if (!item) {
36
+ return acc;
37
+ }
38
+ if ('children' in item && item.children) {
39
+ var _flattenMenu;
40
+ return acc.concat((_flattenMenu = flattenMenu(item.children)) !== null && _flattenMenu !== void 0 ? _flattenMenu : []);
41
+ }
42
+ return acc.concat(item);
43
+ }, []);
44
+ }
45
+ return null;
46
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/dumi-theme-antv",
3
- "version": "0.5.2",
3
+ "version": "0.5.4-beta.0",
4
4
  "description": "AntV website theme based on dumi2.",
5
5
  "keywords": [
6
6
  "dumi",
@@ -20,16 +20,6 @@
20
20
  "files": [
21
21
  "dist"
22
22
  ],
23
- "scripts": {
24
- "build": "npm run prepare && father build",
25
- "dev": "father dev",
26
- "lint": "npm run lint:es && npm run lint:css",
27
- "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
28
- "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
29
- "prepare": "father link-dev-theme",
30
- "prepublishOnly": "npm run build",
31
- "start": "cd example && npm run start"
32
- },
33
23
  "commitlint": {
34
24
  "extends": [
35
25
  "@commitlint/config-conventional"
@@ -53,76 +43,77 @@
53
43
  ]
54
44
  },
55
45
  "dependencies": {
56
- "@ant-design/icons": "^4.7.0",
46
+ "@ant-design/icons": "^4.8.3",
57
47
  "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6",
58
- "@babel/standalone": "^7.19.5",
59
- "@docsearch/css": "^3.3.0",
60
- "@docsearch/react": "^3.3.0",
61
- "@monaco-editor/react": "^4.4.6",
62
- "@stackblitz/sdk": "^1.8.0",
63
- "antd": "^4.23.5",
64
- "classnames": "^2.3.2",
48
+ "@babel/standalone": "^7.26.2",
49
+ "@docsearch/css": "^3.8.0",
50
+ "@docsearch/react": "^3.8.0",
51
+ "@monaco-editor/react": "^4.6.0",
52
+ "@stackblitz/sdk": "^1.11.0",
53
+ "antd": "^4.24.16",
54
+ "classnames": "^2.5.1",
65
55
  "codesandbox": "^2.2.3",
66
56
  "d3-dsv": "^3.0.1",
67
57
  "docsearch.js": "^2.6.3",
68
58
  "front-matter": "^4.0.2",
69
59
  "fs-extra": "^10.1.0",
70
- "glob": "^8.0.3",
60
+ "glob": "^8.1.0",
71
61
  "hast": "^1.0.0",
72
62
  "indent-string": "^5.0.0",
73
63
  "insert-css": "^2.0.0",
74
64
  "lodash-es": "^4.17.21",
75
- "monaco-editor": "^0.25.0",
76
- "parse-github-url": "^1.0.2",
77
- "prettier": "^2.7.1",
78
- "rc-drawer": "^4.0.0",
79
- "rc-footer": "^0.6.6",
80
- "react": "^18.2.0",
81
- "react-dom": "^18.2.0",
65
+ "monaco-editor": "^0.25.2",
66
+ "nprogress": "^0.2.0",
67
+ "parse-github-url": "^1.0.3",
68
+ "prettier": "^2.8.8",
69
+ "rc-drawer": "^4.4.3",
70
+ "rc-footer": "^0.6.8",
71
+ "react": "^18.3.1",
72
+ "react-dom": "^18.3.1",
82
73
  "react-error-boundary": "^3.1.4",
83
74
  "react-github-button": "^0.1.11",
84
75
  "react-helmet": "^6.1.0",
85
76
  "react-markdown": "^9.0.1",
86
- "react-router-dom": "^6.4.2",
77
+ "react-router-dom": "^6.28.0",
87
78
  "react-slick": "^0.29.0",
88
79
  "react-split-pane": "^0.1.92",
89
- "react-use": "^17.4.0",
80
+ "react-use": "^17.5.1",
90
81
  "reading-time": "^1.5.0",
91
82
  "rehype-raw": "^7.0.0",
92
83
  "remark-gfm": "^4.0.0",
93
- "semver": "^7.3.8",
94
- "size-sensor": "^1.0.1",
84
+ "semver": "^7.6.3",
85
+ "size-sensor": "^1.0.2",
95
86
  "slick-carousel": "^1.8.1",
96
87
  "unified": "^10.1.2",
97
88
  "unist-util-visit": "^4.1.2",
98
89
  "uri-parse": "^1.0.0",
99
- "valtio": "^1.12.1",
90
+ "valtio": "^1.13.2",
100
91
  "video-react": "^0.16.0"
101
92
  },
102
93
  "devDependencies": {
103
- "@commitlint/cli": "^17.1.2",
104
- "@commitlint/config-conventional": "^17.1.0",
105
- "@types/classnames": "^2.3.1",
94
+ "@commitlint/cli": "^17.8.1",
95
+ "@commitlint/config-conventional": "^17.8.1",
96
+ "@types/antd": "^1.0.4",
97
+ "@types/classnames": "^2.3.4",
106
98
  "@types/fs-extra": "^9.0.13",
107
- "@types/glob": "^8.0.0",
108
- "@types/hast": "^2.3.5",
109
- "@types/lodash-es": "^4.17.6",
110
- "@types/node": "^18.11.3",
111
- "@types/react": "^18.0.21",
99
+ "@types/glob": "^8.1.0",
100
+ "@types/hast": "^2.3.10",
101
+ "@types/lodash-es": "^4.17.12",
102
+ "@types/node": "^18.19.64",
103
+ "@types/nprogress": "^0.2.3",
104
+ "@types/react": "^18.3.12",
112
105
  "@types/react-router-dom": "^5.3.3",
113
- "@types/react-slick": "^0.23.10",
114
- "@umijs/lint": "^4.0.0",
115
- "dumi": "^2.0.0",
116
- "eslint": "^8.23.0",
117
- "father": "^4.1.0",
118
- "father-plugin-dumi-theme": "^1.0.0-beta.1",
119
- "husky": "^8.0.1",
120
- "lint-staged": "^13.0.3",
121
- "prettier-plugin-organize-imports": "^3.0.0",
122
- "prettier-plugin-packagejson": "^2.2.18",
123
- "react": "^18.0.0",
124
- "react-dom": "^18.0.0",
125
- "stylelint": "^14.9.1"
106
+ "@types/react-slick": "^0.23.13",
107
+ "@umijs/lint": "^4.3.34",
108
+ "dumi": "^2.4.13",
109
+ "eslint": "^8.57.1",
110
+ "father": "^4.5.1",
111
+ "father-plugin-dumi-theme": "1.0.0-rc.1",
112
+ "husky": "^8.0.3",
113
+ "lint-staged": "^13.3.0",
114
+ "prettier-plugin-organize-imports": "^3.2.4",
115
+ "prettier-plugin-packagejson": "^2.5.3",
116
+ "stylelint": "^14.16.1"
126
117
  },
127
118
  "peerDependencies": {
128
119
  "dumi": "^2.0.0",
@@ -130,10 +121,19 @@
130
121
  "react-dom": ">=16.9.0"
131
122
  },
132
123
  "publishConfig": {
133
- "access": "public"
124
+ "access": "public",
125
+ "tag": "beta"
134
126
  },
135
127
  "authors": [
136
128
  "dumi",
137
129
  "antv"
138
- ]
139
- }
130
+ ],
131
+ "scripts": {
132
+ "build": "npm run prepare && father build",
133
+ "dev": "father dev",
134
+ "lint": "npm run lint:es && npm run lint:css",
135
+ "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
136
+ "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
137
+ "start": "cd example && npm run dev"
138
+ }
139
+ }
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- export type PlaygroundProps = {
3
- /**
4
- * 代码示例的地址
5
- */
6
- path: string;
7
- /**
8
- * 渲染容器的 id,默认为 container
9
- */
10
- rid?: string;
11
- /**
12
- * 预览区、代码区的宽度占比,默认为 0.38
13
- */
14
- ratio?: number;
15
- /**
16
- * 容器的高度,默认为 400px
17
- */
18
- height?: number;
19
- };
20
- declare const _default: React.FC<PlaygroundProps>;
21
- export default _default;
package/dist/context.d.ts DELETED
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import { ExampleTopic } from './types';
3
- export type IThemeAntVContext = {
4
- exampleTopics?: ExampleTopic[];
5
- };
6
- export declare const ThemeAntVContext: import("react").Context<IThemeAntVContext>;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import '../slots/global';
3
- import '../slots/_.less';
4
- /**
5
- * DocuLayout 是 dumi2 的内置 layout 入口,在这里使用页面路径进行区分成自己不同的 Layout。
6
- */
7
- declare const _default: () => React.JSX.Element;
8
- export default _default;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- export type APIProps = {
3
- readonly children: any;
4
- };
5
- /**
6
- * API 路由下的入口
7
- * - 读取 API markdown 文件
8
- * - 渲染 UI
9
- */
10
- export declare const API: React.FC<APIProps>;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * Index 路由下的入口
4
- * - 获取数据
5
- * - 组合 slots 下的木偶组件
6
- */
7
- export declare const Index: () => React.JSX.Element;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- export type ManualProps = {
3
- readonly children: any;
4
- };
5
- /**
6
- * Manual 路由下的入口
7
- */
8
- export declare const Manual: React.FC<ManualProps>;
@@ -1,5 +0,0 @@
1
- export declare const store: {
2
- hideMenu: boolean;
3
- showAPI: boolean;
4
- apiContainerWidth: number;
5
- };
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * 404 页面
4
- */
5
- declare const NotFound: () => React.JSX.Element;
6
- export default NotFound;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- interface CollapsedProps {
3
- isCollapsed: boolean;
4
- style?: React.CSSProperties;
5
- onClick?: (isCollapsed: boolean) => void;
6
- }
7
- export declare const CollapsedIcon: React.FC<CollapsedProps>;
8
- export {};
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * 具体单个案例的页面
4
- */
5
- declare const Example: React.FC;
6
- export default Example;
@@ -1 +0,0 @@
1
- export declare function getCurrentTitle(exampleTopics: any, topic: any, example: any): any;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { AnnouncementProps } from '../../types';
3
- /**
4
- * 通用公告组件,根据 bannerId 来更新 localStorage
5
- */
6
- export declare const Announcement: React.FC<AnnouncementProps>;
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const Article: React.FC<any>;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { LeftMenuProps } from '../../../../types';
3
- /**
4
- * LeftMenu
5
- *
6
- * @param {LeftMenuProps} props 相关参数,详见类型定义
7
- * @returns {React.FC} React.FC
8
- * @author YuZhanglong <loveyzl1123@gmail.com>
9
- */
10
- export declare const LeftMenu: React.FC<LeftMenuProps>;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { LeftMenuProps } from '../../types';
3
- /**
4
- * Examples 左侧 LeftMenu
5
- *
6
- * @param {LeftMenuProps} props 相关参数,详见类型定义
7
- * @returns {React.FC} React.FC
8
- */
9
- export declare const ExampleTopicMenu: React.FC<LeftMenuProps>;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { DemoCardProps } from '../../../types';
3
- /**
4
- * DEMO 的卡片预览
5
- *
6
- * @param {DemoCardProps} props 相关参数,详见类型定义
7
- * @returns {React.FC} React.FC
8
- * @author YuZhanglong <loveyzl1123@gmail.com>
9
- */
10
- export declare const DemoCard: React.FC<DemoCardProps>;