@antv/dumi-theme-antv 0.5.3 → 0.5.4-beta.1

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 (90) hide show
  1. package/dist/builtins/Playground/index.js +1 -1
  2. package/dist/common/Link.js +78 -0
  3. package/dist/common/SEO.js +61 -0
  4. package/dist/hooks/useMenu.js +122 -0
  5. package/dist/layouts/DocLayout.js +6 -7
  6. package/dist/layouts/entry/API.js +1 -0
  7. package/dist/layouts/entry/Index.js +12 -25
  8. package/dist/layouts/entry/Manual.js +7 -5
  9. package/dist/pages/404.js +4 -5
  10. package/dist/pages/Example/index.js +6 -7
  11. package/dist/pages/Examples/index.js +6 -5
  12. package/dist/plugin/rehypeObservable.js +6 -3
  13. package/dist/slots/CodeEditor/index.js +1 -1
  14. package/dist/slots/CodeRunner/index.js +3 -3
  15. package/dist/slots/ManualContent/Main.js +90 -0
  16. package/dist/slots/ManualContent/Sidebar.js +77 -0
  17. package/dist/slots/ManualContent/index.js +8 -305
  18. package/dist/slots/ManualContent/index.module.less +63 -29
  19. package/dist/slots/ManualContent/utils.js +19 -15
  20. package/dist/slots/utils.js +7 -0
  21. package/dist/utils/menu.js +46 -0
  22. package/package.json +47 -43
  23. package/dist/builtins/Playground/index.d.ts +0 -21
  24. package/dist/context.d.ts +0 -6
  25. package/dist/layouts/DocLayout.d.ts +0 -7
  26. package/dist/layouts/entry/API.d.ts +0 -10
  27. package/dist/layouts/entry/Index.d.ts +0 -6
  28. package/dist/layouts/entry/Manual.d.ts +0 -8
  29. package/dist/model/index.d.ts +0 -5
  30. package/dist/pages/404.d.ts +0 -5
  31. package/dist/pages/Example/components/CollapsedIcon/index.d.ts +0 -8
  32. package/dist/pages/Example/index.d.ts +0 -6
  33. package/dist/pages/Example/utils.d.ts +0 -1
  34. package/dist/pages/Examples/components/Accouncement/index.d.ts +0 -6
  35. package/dist/pages/Examples/components/Article/index.d.ts +0 -2
  36. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.d.ts +0 -10
  37. package/dist/pages/Examples/components/ExampleTopicMenu/index.d.ts +0 -9
  38. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.d.ts +0 -10
  39. package/dist/pages/Examples/components/GalleryPageContent/index.d.ts +0 -10
  40. package/dist/pages/Examples/index.d.ts +0 -7
  41. package/dist/pages/Examples/types.d.ts +0 -34
  42. package/dist/pages/Examples/utils.d.ts +0 -1
  43. package/dist/plugin/api.d.ts +0 -7
  44. package/dist/plugin/examples.d.ts +0 -21
  45. package/dist/plugin/index.d.ts +0 -3
  46. package/dist/plugin/rehypeObservable.d.ts +0 -1
  47. package/dist/slots/404.d.ts +0 -1
  48. package/dist/slots/API/index.d.ts +0 -14
  49. package/dist/slots/Article/index.d.ts +0 -3
  50. package/dist/slots/Banner/Notification.d.ts +0 -10
  51. package/dist/slots/Banner/index.d.ts +0 -26
  52. package/dist/slots/Cases/index.d.ts +0 -19
  53. package/dist/slots/CodeEditor/Toolbar.d.ts +0 -72
  54. package/dist/slots/CodeEditor/index.d.ts +0 -62
  55. package/dist/slots/CodeEditor/utils.d.ts +0 -42
  56. package/dist/slots/CodePreview/CodeHeader.d.ts +0 -19
  57. package/dist/slots/CodePreview/index.d.ts +0 -25
  58. package/dist/slots/CodeRunner/index.d.ts +0 -17
  59. package/dist/slots/CodeRunner/utils.d.ts +0 -11
  60. package/dist/slots/Companies/index.d.ts +0 -13
  61. package/dist/slots/ContentTable/index.d.ts +0 -6
  62. package/dist/slots/Detail/News.d.ts +0 -12
  63. package/dist/slots/Detail/index.d.ts +0 -30
  64. package/dist/slots/ExampleSider/index.d.ts +0 -21
  65. package/dist/slots/Features/FeatureCard.d.ts +0 -9
  66. package/dist/slots/Features/index.d.ts +0 -15
  67. package/dist/slots/Footer/index.d.ts +0 -18
  68. package/dist/slots/Header/Navs.d.ts +0 -27
  69. package/dist/slots/Header/Products/NavigatorBanner.d.ts +0 -10
  70. package/dist/slots/Header/Products/Product.d.ts +0 -14
  71. package/dist/slots/Header/Products/getProducts.d.ts +0 -48
  72. package/dist/slots/Header/Products/index.d.ts +0 -10
  73. package/dist/slots/Header/Search/SearchResult.d.ts +0 -21
  74. package/dist/slots/Header/Search/helper.d.ts +0 -8
  75. package/dist/slots/Header/Search/index.d.ts +0 -1
  76. package/dist/slots/Header/index.d.ts +0 -84
  77. package/dist/slots/Header/utils.d.ts +0 -10
  78. package/dist/slots/Loading/index.d.ts +0 -5
  79. package/dist/slots/ManualContent/NavigatorBanner.d.ts +0 -9
  80. package/dist/slots/ManualContent/Preview.d.ts +0 -7
  81. package/dist/slots/ManualContent/ReadingTime.d.ts +0 -3
  82. package/dist/slots/ManualContent/index.d.ts +0 -9
  83. package/dist/slots/ManualContent/usePreview.d.ts +0 -1
  84. package/dist/slots/ManualContent/utils.d.ts +0 -19
  85. package/dist/slots/SEO.d.ts +0 -10
  86. package/dist/slots/SEO.js +0 -57
  87. package/dist/slots/global.d.ts +0 -1
  88. package/dist/slots/hooks.d.ts +0 -16
  89. package/dist/slots/utils.d.ts +0 -5
  90. package/dist/types.d.ts +0 -86
package/dist/slots/SEO.js DELETED
@@ -1,57 +0,0 @@
1
- import { useSiteData } from 'dumi';
2
- import React from 'react';
3
- import { Helmet } from 'react-helmet';
4
- export var SEO = function SEO(_ref) {
5
- var description = _ref.description,
6
- _ref$lang = _ref.lang,
7
- lang = _ref$lang === void 0 ? '' : _ref$lang,
8
- _ref$meta = _ref.meta,
9
- meta = _ref$meta === void 0 ? [] : _ref$meta,
10
- title = _ref.title,
11
- titleSuffix = _ref.titleSuffix;
12
- var _useSiteData = useSiteData(),
13
- themeConfig = _useSiteData.themeConfig;
14
- var defaultTitle = themeConfig.title,
15
- defaultDescription = themeConfig.defaultDescription;
16
- var metaDescription = description || defaultDescription;
17
- return /*#__PURE__*/React.createElement(Helmet, {
18
- htmlAttributes: {
19
- lang: lang
20
- },
21
- title: title,
22
- titleTemplate: "%s | ".concat(titleSuffix || defaultTitle),
23
- meta: [{
24
- name: "description",
25
- content: metaDescription
26
- }, {
27
- property: "og:title",
28
- content: title
29
- }, {
30
- property: "og:description",
31
- content: metaDescription
32
- }, {
33
- property: "og:image",
34
- content: 'https://gw.alipayobjects.com/zos/antfincdn/FLrTNDvlna/antv.png'
35
- }, {
36
- property: "og:type",
37
- content: "website"
38
- }, {
39
- name: "twitter:card",
40
- content: "summary"
41
- }, {
42
- name: "twitter:title",
43
- content: title
44
- }, {
45
- name: "twitter:description",
46
- content: metaDescription
47
- }, {
48
- property: "twitter:image",
49
- content: 'https://gw.alipayobjects.com/zos/antfincdn/FLrTNDvlna/antv.png'
50
- }].concat(meta)
51
- });
52
- };
53
- SEO.defaultProps = {
54
- lang: "zh",
55
- meta: [],
56
- description: ""
57
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- import { NavigatorBannerProps } from './ManualContent/NavigatorBanner';
2
- export declare const useChinaMirrorHost: () => [boolean];
3
- export declare const useScrollToTop: () => void;
4
- export declare const useLogoLink: ({ link, siteUrl, lang, }: {
5
- link?: string;
6
- siteUrl?: string;
7
- lang?: string;
8
- }) => [string];
9
- export declare const usePrevAndNext: () => NavigatorBannerProps['post'][];
10
- /**
11
- * i18n .umirc config
12
- * 如果是 object,则取 locale,否则直接用
13
- * @param v
14
- */
15
- export declare function ic(v: string | object): any;
16
- export declare function icWithLocale(v: string | object, locale: any): any;
@@ -1,5 +0,0 @@
1
- import { Status, TreeNode } from '../types';
2
- export declare function ping(): Promise<Status>;
3
- export declare const getChinaMirrorHost: (host?: string) => string;
4
- export declare function getGithubSourceURL(githubUrl: string, relativePath: string, prefix?: string): string;
5
- export declare const filterTreeNode: (treeNode: TreeNode, keyValue: string, locale: string) => TreeNode;
package/dist/types.d.ts DELETED
@@ -1,86 +0,0 @@
1
- export interface IThemeConfig {
2
- [key: string]: any;
3
- }
4
- export declare type Status = 'responded' | 'error' | 'timeout';
5
- /**
6
- * 配置文件中的国际化配置
7
- */
8
- export declare type IC = string | {
9
- zh: string;
10
- en: string;
11
- };
12
- export interface TreeNode {
13
- /**
14
- * id
15
- */
16
- id: string;
17
- /**
18
- * 孩子节点 key
19
- */
20
- childrenKey?: string;
21
- /**
22
- * 标题(支持国际化)
23
- */
24
- title: {
25
- zh: string;
26
- en: string;
27
- };
28
- [key: string]: any;
29
- }
30
- /** 案例 DEMO */
31
- export interface Demo extends TreeNode {
32
- /**
33
- * 截图
34
- */
35
- screenshot: string;
36
- /**
37
- * TypeScript 源码文件
38
- */
39
- source: string;
40
- /**
41
- * DEMO 代码文件名称
42
- */
43
- filename: string;
44
- /**
45
- * 衍生属性,通过 topic.id + example.id + demo.id 可以计算获取
46
- */
47
- relativePath?: string;
48
- /**
49
- * 是否为新品
50
- */
51
- isNew?: boolean;
52
- /**
53
- * 目标 example
54
- */
55
- targetExample?: Example;
56
- /**
57
- * 目标主题
58
- */
59
- targetTopic?: ExampleTopic;
60
- }
61
- /** 示例 */
62
- export interface Example extends TreeNode {
63
- /**
64
- * 图标
65
- */
66
- icon: string;
67
- /**
68
- * DEMO
69
- */
70
- demos: Demo[];
71
- }
72
- /** 案例主题 */
73
- export interface ExampleTopic extends TreeNode {
74
- /**
75
- * 图标
76
- */
77
- icon: string;
78
- /**
79
- * slug 和 id 一样,兼容旧配置
80
- */
81
- slug?: string;
82
- /**
83
- * 所有案例
84
- */
85
- examples: Example[];
86
- }