@antv/dumi-theme-antv 0.5.1 → 0.5.3

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 (43) hide show
  1. package/dist/builtins/Playground/index.d.ts +1 -1
  2. package/dist/builtins/Playground/index.js +1 -1
  3. package/dist/context.d.ts +1 -1
  4. package/dist/layouts/DocLayout.d.ts +1 -2
  5. package/dist/layouts/entry/API.d.ts +1 -1
  6. package/dist/layouts/entry/Index.d.ts +1 -2
  7. package/dist/layouts/entry/Index.js +7 -7
  8. package/dist/layouts/entry/Manual.d.ts +1 -1
  9. package/dist/layouts/entry/Manual.js +3 -3
  10. package/dist/locales/en.json +49 -1
  11. package/dist/locales/zh.json +48 -1
  12. package/dist/pages/404.d.ts +1 -2
  13. package/dist/pages/404.js +4 -4
  14. package/dist/pages/Example/index.js +5 -5
  15. package/dist/pages/Examples/index.d.ts +1 -2
  16. package/dist/pages/Examples/index.js +3 -3
  17. package/dist/plugin/rehypeObservable.js +3 -6
  18. package/dist/slots/404.d.ts +1 -2
  19. package/dist/slots/API/index.d.ts +2 -3
  20. package/dist/slots/Banner/index.d.ts +1 -1
  21. package/dist/slots/CodeEditor/Toolbar.d.ts +1 -1
  22. package/dist/slots/CodeEditor/index.d.ts +1 -1
  23. package/dist/slots/CodeEditor/index.js +1 -1
  24. package/dist/slots/CodePreview/CodeHeader.d.ts +1 -1
  25. package/dist/slots/CodePreview/index.d.ts +1 -1
  26. package/dist/slots/CodeRunner/index.d.ts +1 -1
  27. package/dist/slots/CodeRunner/index.js +3 -3
  28. package/dist/slots/Companies/index.d.ts +1 -1
  29. package/dist/slots/ContentTable/index.d.ts +1 -1
  30. package/dist/slots/Detail/index.d.ts +2 -2
  31. package/dist/slots/Header/Navs.d.ts +3 -3
  32. package/dist/slots/Header/Products/getProducts.d.ts +8 -6
  33. package/dist/slots/Header/Products/getProducts.js +8 -4
  34. package/dist/slots/Header/Products/index.js +21 -11
  35. package/dist/slots/Header/Search/SearchResult.d.ts +2 -2
  36. package/dist/slots/Header/Search/index.d.ts +1 -2
  37. package/dist/slots/Header/index.d.ts +1 -1
  38. package/dist/slots/Loading/index.d.ts +1 -2
  39. package/dist/slots/ManualContent/Preview.d.ts +1 -1
  40. package/dist/slots/ManualContent/index.d.ts +1 -1
  41. package/dist/slots/ManualContent/index.js +2 -2
  42. package/dist/types.d.ts +2 -2
  43. package/package.json +13 -17
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export type PlaygroundProps = {
2
+ export declare type PlaygroundProps = {
3
3
  /**
4
4
  * 代码示例的地址
5
5
  */
@@ -9,7 +9,7 @@ import { get } from 'lodash-es';
9
9
  import React, { useContext } from 'react';
10
10
  import { ErrorBoundary } from 'react-error-boundary';
11
11
  import { ThemeAntVContext } from "../../context";
12
- import { CodeRunner } from "dumi/theme/slots/CodeRunner";
12
+ import { CodeRunner } from "../../slots/CodeRunner";
13
13
  import styles from "./index.module.less";
14
14
  /**
15
15
  * Markdown 标签插件 Playground
package/dist/context.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ExampleTopic } from './types';
3
- export type IThemeAntVContext = {
3
+ export declare type IThemeAntVContext = {
4
4
  exampleTopics?: ExampleTopic[];
5
5
  };
6
6
  export declare const ThemeAntVContext: import("react").Context<IThemeAntVContext>;
@@ -1,8 +1,7 @@
1
- import React from 'react';
2
1
  import '../slots/global';
3
2
  import '../slots/_.less';
4
3
  /**
5
4
  * DocuLayout 是 dumi2 的内置 layout 入口,在这里使用页面路径进行区分成自己不同的 Layout。
6
5
  */
7
- declare const _default: () => React.JSX.Element;
6
+ declare const _default: () => any;
8
7
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export type APIProps = {
2
+ export declare type APIProps = {
3
3
  readonly children: any;
4
4
  };
5
5
  /**
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
1
  /**
3
2
  * Index 路由下的入口
4
3
  * - 获取数据
5
4
  * - 组合 slots 下的木偶组件
6
5
  */
7
- export declare const Index: () => React.JSX.Element;
6
+ export declare const Index: () => JSX.Element;
@@ -6,13 +6,13 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import React from 'react';
8
8
  import { useLocale, useSiteData, FormattedMessage } from 'dumi';
9
- import { SEO } from "dumi/theme/slots/SEO";
10
- import { Header } from "dumi/theme/slots/Header";
11
- import { Detail } from "dumi/theme/slots/Detail";
12
- import { Features } from "dumi/theme/slots/Features";
13
- import { Cases } from "dumi/theme/slots/Cases";
14
- import { Companies } from "dumi/theme/slots/Companies";
15
- import { Footer } from "dumi/theme/slots/Footer";
9
+ import { SEO } from "../../slots/SEO";
10
+ import { Header } from "../../slots/Header";
11
+ import { Detail } from "../../slots/Detail";
12
+ import { Features } from "../../slots/Features";
13
+ import { Cases } from "../../slots/Cases";
14
+ import { Companies } from "../../slots/Companies";
15
+ import { Footer } from "../../slots/Footer";
16
16
  import { isArray, size, get } from 'lodash-es';
17
17
 
18
18
  /**
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export type ManualProps = {
2
+ export declare type ManualProps = {
3
3
  readonly children: any;
4
4
  };
5
5
  /**
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { ManualContent } from "dumi/theme/slots/ManualContent";
3
- import { Header } from "dumi/theme/slots/Header";
4
- import { Footer } from "dumi/theme/slots/Footer";
2
+ import { ManualContent } from "../../slots/ManualContent";
3
+ import { Header } from "../../slots/Header";
4
+ import { Footer } from "../../slots/Footer";
5
5
  /**
6
6
  * Manual 路由下的入口
7
7
  */
@@ -1,4 +1,52 @@
1
1
  {
2
+ "header.search.placeholder": "Type keywords...",
3
+ "header.color.mode.light": "Light Mode",
4
+ "header.color.mode.dark": "Dark Mode",
5
+ "header.color.mode.auto": "Follow System",
6
+ "header.social.github": "GitHub",
7
+ "header.social.weibo": "Weibo",
8
+ "header.social.twitter": "Twitter",
9
+ "header.social.x": "X",
10
+ "header.social.gitlab": "GitLab",
11
+ "header.social.facebook": "Facebook",
12
+ "header.social.zhihu": "Zhihu",
13
+ "header.social.yuque": "Yuque",
14
+ "header.social.linkedin": "Linkedin",
15
+ "previewer.actions.code.expand": "Show Code",
16
+ "previewer.actions.code.shrink": "Hide Code",
17
+ "previewer.actions.code.editable": "Edit code with real-time preview",
18
+ "previewer.actions.code.readonly": "Only index file is editable",
19
+ "previewer.actions.sketch": "Copy to Sketch app",
20
+ "previewer.actions.sketch.group": "Copy as Sketch Group",
21
+ "previewer.actions.sketch.symbol": "Copy as Sketch Symbol",
22
+ "previewer.actions.sketch.divider": "------------------------",
23
+ "previewer.actions.sketch.guide": "How to paste to Sketch?",
24
+ "previewer.actions.codesandbox": "Open in CodeSandbox",
25
+ "previewer.actions.codepen": "Open in CodePen (Not implemented)",
26
+ "previewer.actions.stackblitz": "Open in StackBlitz",
27
+ "previewer.actions.separate": "Open in separate page",
28
+ "404.title": "PAGE NOT FOUND",
29
+ "404.back": "Back to homepage",
30
+ "api.component.name": "Name",
31
+ "api.component.description": "Description",
32
+ "api.component.type": "Type",
33
+ "api.component.default": "Default",
34
+ "api.component.required": "(required)",
35
+ "api.component.release.alpha": "Alpha",
36
+ "api.component.release.beta": "Beta",
37
+ "api.component.release.experimental": "Experimental",
38
+ "api.component.release.deprecated": "Deprecated",
39
+ "api.component.unavailable": "apiParser must be enabled to use auto-generated API",
40
+ "api.component.loading": "Properties definition is resolving, wait a moment...",
41
+ "api.component.not.found": "Properties definition not found for {id} component",
42
+ "content.tabs.default": "Doc",
43
+ "content.footer.last.updated": "Last updated: ",
44
+ "content.footer.actions.edit": "Improve this documentation",
45
+ "content.footer.actions.previous": "PREV",
46
+ "content.footer.actions.next": "NEXT",
47
+ "search.not.found": "No content was found",
48
+ "search.loading": "Loading...",
49
+ "layout.sidebar.btn": "Sidebar",
2
50
  "index.serach": "Search...",
3
51
  "所有产品": "Products",
4
52
  "周边生态": "Ecosystem",
@@ -102,4 +150,4 @@
102
150
  "企业级 Node 开发框架": "Enterprise-class Node development framework",
103
151
  "Sketch 工具集": "Sketch Tool set",
104
152
  "蚂蚁体验科技": "Liven Experience technology"
105
- }
153
+ }
@@ -1,4 +1,51 @@
1
1
  {
2
+ "header.search.placeholder": "输入关键字搜索...",
3
+ "header.color.mode.light": "亮色模式",
4
+ "header.color.mode.dark": "暗色模式",
5
+ "header.color.mode.auto": "跟随系统",
6
+ "header.social.github": "GitHub",
7
+ "header.social.weibo": "微博",
8
+ "header.social.twitter": "Twitter",
9
+ "header.social.x": "X",
10
+ "header.social.gitlab": "GitLab",
11
+ "header.social.facebook": "Facebook",
12
+ "header.social.zhihu": "知乎",
13
+ "header.social.yuque": "语雀",
14
+ "header.social.linkedin": "Linkedin",
15
+ "previewer.actions.code.expand": "展开代码",
16
+ "previewer.actions.code.shrink": "收起代码",
17
+ "previewer.actions.code.editable": "编辑代码可实时预览",
18
+ "previewer.actions.code.readonly": "仅 index 可编辑",
19
+ "previewer.actions.codesandbox": "在 CodeSandbox 中打开",
20
+ "previewer.actions.sketch": "拷贝到 Sketch",
21
+ "previewer.actions.sketch.group": "拷贝为 Sketch Group",
22
+ "previewer.actions.sketch.symbol": "拷贝为 Sketch Symbol",
23
+ "previewer.actions.sketch.divider": "----------------------",
24
+ "previewer.actions.sketch.guide": "如何粘贴到 SKetch?",
25
+ "previewer.actions.stackblitz": "在 StackBlitz 中打开",
26
+ "previewer.actions.separate": "在独立页面中打开",
27
+ "404.title": "页面未找到",
28
+ "404.back": "返回首页",
29
+ "api.component.name": "属性名",
30
+ "api.component.description": "描述",
31
+ "api.component.type": "类型",
32
+ "api.component.default": "默认值",
33
+ "api.component.required": "(必选)",
34
+ "api.component.release.alpha": "Alpha",
35
+ "api.component.release.beta": "Beta",
36
+ "api.component.release.experimental": "实验性",
37
+ "api.component.release.deprecated": "废弃",
38
+ "api.component.unavailable": "必须启用 apiParser 才能使用自动 API 特性",
39
+ "api.component.loading": "属性定义正在解析中,稍等片刻...",
40
+ "api.component.not.found": "未找到 {id} 组件的属性定义",
41
+ "content.tabs.default": "文档",
42
+ "content.footer.last.updated": "最后更新时间:",
43
+ "content.footer.actions.edit": "帮助改进此文档",
44
+ "content.footer.actions.previous": "上一篇",
45
+ "content.footer.actions.next": "下一篇",
46
+ "search.not.found": "未找到相关内容",
47
+ "search.loading": "加载中...",
48
+ "layout.sidebar.btn": "侧边菜单",
2
49
  "index.serach": "index.serach",
3
50
  "所有产品": "所有产品",
4
51
  "周边生态": "周边生态",
@@ -102,4 +149,4 @@
102
149
  "企业级 Node 开发框架": "企业级 Node 开发框架",
103
150
  "Sketch 工具集": "Sketch 工具集",
104
151
  "蚂蚁体验科技": "蚂蚁体验科技"
105
- }
152
+ }
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
1
  /**
3
2
  * 404 页面
4
3
  */
5
- declare const NotFound: () => React.JSX.Element;
4
+ declare const NotFound: () => JSX.Element;
6
5
  export default NotFound;
package/dist/pages/404.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { NotFound as NotFoundPage } from "dumi/theme/slots/404";
3
- import { Footer } from "dumi/theme/slots/Footer";
4
- import { Header } from "dumi/theme/slots/Header";
5
- import { SEO } from "dumi/theme/slots/SEO";
2
+ import { NotFound as NotFoundPage } from "../slots/404";
3
+ import { Footer } from "../slots/Footer";
4
+ import { Header } from "../slots/Header";
5
+ import { SEO } from "../slots/SEO";
6
6
 
7
7
  /**
8
8
  * 404 页面
@@ -12,12 +12,12 @@ import { useLocation, useNavigate, useParams } from 'react-router-dom';
12
12
  import { useSnapshot } from 'valtio';
13
13
  import { ThemeAntVContext } from "../../context";
14
14
  import { store } from "../../model";
15
- import { API } from "dumi/theme/slots/API";
16
- import { CodeRunner } from "dumi/theme/slots/CodeRunner";
15
+ import { API } from "../../slots/API";
16
+ import { CodeRunner } from "../../slots/CodeRunner";
17
17
  import { getDemoInfo } from "../../slots/CodeRunner/utils";
18
- import { ExampleSider } from "dumi/theme/slots/ExampleSider";
19
- import { Header } from "dumi/theme/slots/Header";
20
- import { SEO } from "dumi/theme/slots/SEO";
18
+ import { ExampleSider } from "../../slots/ExampleSider";
19
+ import { Header } from "../../slots/Header";
20
+ import { SEO } from "../../slots/SEO";
21
21
  import { CollapsedIcon } from "./components/CollapsedIcon";
22
22
  import styles from "./index.module.less";
23
23
  import { getCurrentTitle } from "./utils";
@@ -1,8 +1,7 @@
1
- import React from 'react';
2
1
  /**
3
2
  * Examples 页面
4
3
  *
5
4
  * @author YuZhanglong <loveyzl1123@gmail.com>
6
5
  */
7
- declare const Example: () => React.JSX.Element;
6
+ declare const Example: () => JSX.Element;
8
7
  export default Example;
@@ -9,9 +9,9 @@ import { useContext, useEffect } from 'react';
9
9
  import { useNavigate } from 'react-router-dom';
10
10
  import { BackTop, Layout as AntLayout } from 'antd';
11
11
  import { useLocale } from 'dumi';
12
- import { SEO } from "dumi/theme/slots/SEO";
13
- import { Header } from "dumi/theme/slots/Header";
14
- import { Footer } from "dumi/theme/slots/Footer";
12
+ import { SEO } from "../../slots/SEO";
13
+ import { Header } from "../../slots/Header";
14
+ import { Footer } from "../../slots/Footer";
15
15
  import NavigatorBanner from "../../slots/Header/Products/NavigatorBanner";
16
16
  import { VerticalAlignTopOutlined } from '@ant-design/icons';
17
17
  import { Article } from "./components/Article";
@@ -37,18 +37,15 @@ var visit;
37
37
  ({ visit } = await import("unist-util-visit"));
38
38
  })();
39
39
  function isObservable(node) {
40
- if (!node.data)
41
- return;
40
+ if (!node.data) return;
42
41
  const { meta } = node.data;
43
- if (!meta)
44
- return;
42
+ if (!meta) return;
45
43
  return meta.match(/\|\s*ob\s*{*/);
46
44
  }
47
45
  function rehypeObservable() {
48
46
  return async (tree) => {
49
47
  visit(tree, "element", (node, i, parent) => {
50
- if (!isObservable(node))
51
- return;
48
+ if (!isObservable(node)) return;
52
49
  if (node.tagName === "SourceCode") {
53
50
  parent.children.splice(i, 1, {
54
51
  type: "element",
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const NotFound: () => React.JSX.Element;
1
+ export declare const NotFound: () => JSX.Element;
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
1
  import { ExampleTopic } from '../../types';
3
- type APIProps = {
2
+ declare type APIProps = {
4
3
  isPlayground?: boolean;
5
4
  topic: string;
6
5
  example: string;
@@ -11,5 +10,5 @@ type APIProps = {
11
10
  /**
12
11
  * API 预览
13
12
  */
14
- export declare const API: ({ exampleTopics, topic, example, demo, language, }: APIProps) => React.JSX.Element;
13
+ export declare const API: ({ exampleTopics, topic, example, demo, language, }: APIProps) => JSX.Element;
15
14
  export {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { NotificationProps } from './Notification';
3
3
  import 'video-react/dist/video-react.css';
4
- type BannerButtonShape = 'round' | 'square';
4
+ declare type BannerButtonShape = 'round' | 'square';
5
5
  interface BannerButton {
6
6
  text: string;
7
7
  link: string;
@@ -4,7 +4,7 @@ export declare enum EDITOR_TABS {
4
4
  SPEC = "Spec",
5
5
  DATA = "Data"
6
6
  }
7
- type ToolbarProps = {
7
+ declare type ToolbarProps = {
8
8
  /**
9
9
  * 源码文件,用于传入到三方代码平台
10
10
  */
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export type CodeEditorProps = {
2
+ export declare type CodeEditorProps = {
3
3
  /**
4
4
  * 标题
5
5
  */
@@ -21,7 +21,7 @@ import { format } from 'prettier';
21
21
  import parserBabel from 'prettier/parser-babel';
22
22
  import React, { useCallback, useEffect, useRef, useState } from 'react';
23
23
  import { bind, clear } from 'size-sensor';
24
- import Loading from "dumi/theme/slots/Loading";
24
+ import Loading from "../Loading";
25
25
  import { EDITOR_TABS, Toolbar } from "./Toolbar";
26
26
  import styles from "./index.module.less";
27
27
  import { compile, execute, replaceInsertCss } from "./utils";
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export type CodeHeaderProps = {
2
+ export declare type CodeHeaderProps = {
3
3
  /**
4
4
  * 代码的标题
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export type CodePreviewProps = {
2
+ export declare type CodePreviewProps = {
3
3
  /**
4
4
  * 在文档中预览
5
5
  */
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { ExampleTopic } from '../../types';
3
- type CodeRunnerProps = {
3
+ declare type CodeRunnerProps = {
4
4
  isPlayground?: boolean;
5
5
  topic: string;
6
6
  example: string;
@@ -8,11 +8,11 @@ import React, { useState } from 'react';
8
8
  import { useSiteData, useLocale } from 'dumi';
9
9
  import { noop } from 'lodash-es';
10
10
  import SplitPane from 'react-split-pane';
11
- import { CodeEditor } from "dumi/theme/slots/CodeEditor";
12
- import { CodePreview } from "dumi/theme/slots/CodePreview";
11
+ import { CodeEditor } from "../CodeEditor";
12
+ import { CodePreview } from "../CodePreview";
13
13
  import { CodeHeader } from "../CodePreview/CodeHeader";
14
14
  import { getDemoInfo } from "./utils";
15
- import { NotFound } from "dumi/theme/slots/404";
15
+ import { NotFound } from "../404";
16
16
  import { ic } from "../hooks";
17
17
  /**
18
18
  * 代码编辑器 + 代码预览区域
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- type Company = {
2
+ declare type Company = {
3
3
  name: string;
4
4
  img: string;
5
5
  };
@@ -3,4 +3,4 @@ import './index.module.less';
3
3
  /**
4
4
  * 文档右侧的指示器(table of content)
5
5
  */
6
- export declare const ContentTable: React.FC;
6
+ export declare const ContentTable: React.FC<{}>;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { IC } from '../../types';
3
3
  import { NewsProps } from './News';
4
- type DetailButtonProps = {
4
+ declare type DetailButtonProps = {
5
5
  text: IC;
6
6
  link: string;
7
7
  style?: React.CSSProperties;
@@ -9,7 +9,7 @@ type DetailButtonProps = {
9
9
  shape?: 'round' | 'square';
10
10
  icon?: string;
11
11
  };
12
- type DetailProps = {
12
+ declare type DetailProps = {
13
13
  className?: string;
14
14
  style?: React.CSSProperties;
15
15
  title: IC;
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
- type dropdownItem = {
2
+ declare type dropdownItem = {
3
3
  name: {
4
4
  [key: string]: string;
5
5
  };
6
6
  url: string;
7
7
  target?: '_blank';
8
8
  };
9
- export type INav = {
9
+ export declare type INav = {
10
10
  slug?: string;
11
11
  order: number;
12
12
  title: {
@@ -16,7 +16,7 @@ export type INav = {
16
16
  notPage?: boolean;
17
17
  dropdownItems?: dropdownItem[];
18
18
  };
19
- export type NavProps = {
19
+ export declare type NavProps = {
20
20
  navs: INav[];
21
21
  path: string;
22
22
  };
@@ -1,5 +1,10 @@
1
1
  import React from 'react';
2
2
  declare const Categories: ["basic", "extension", "ecology"];
3
+ export interface ProductCategory {
4
+ type: (typeof CATEGORY_TYPE)[number];
5
+ name: string;
6
+ products: ProductType[];
7
+ }
3
8
  export interface ProductItem {
4
9
  title: string;
5
10
  icon?: React.ReactNode;
@@ -13,13 +18,10 @@ export interface ProductItem {
13
18
  openExternal?: boolean;
14
19
  }>;
15
20
  }
16
- export type ValuesOf<T extends any[]> = T[number];
21
+ export declare type ValuesOf<T extends any[]> = T[number];
17
22
  declare const CATEGORY_TYPE: ["basic", "extension", "mobile", "ecology"];
18
- export declare const CATEGORIES: Array<{
19
- type: typeof CATEGORY_TYPE[number];
20
- name: string;
21
- }>;
22
- export type ProductType = {
23
+ export declare const CATEGORIES: Array<ProductCategory>;
24
+ export declare type ProductType = {
23
25
  links: {
24
26
  /** 产品首页 */
25
27
  readonly home?: {
@@ -17,16 +17,20 @@ var ANTV_DOMAIN = 'antv.vision';
17
17
  var CATEGORY_TYPE = tuple('basic', 'extension', 'mobile', 'ecology');
18
18
  export var CATEGORIES = [{
19
19
  type: 'basic',
20
- name: '标准版基础产品'
20
+ name: '标准版基础产品',
21
+ products: []
21
22
  }, {
22
23
  type: 'extension',
23
- name: '标准版扩展产品'
24
+ name: '标准版扩展产品',
25
+ products: []
24
26
  }, {
25
27
  type: 'mobile',
26
- name: '移动定制(F版)产品'
28
+ name: '移动定制(F版)产品',
29
+ products: []
27
30
  }, {
28
31
  type: 'ecology',
29
- name: '周边生态'
32
+ name: '周边生态',
33
+ products: []
30
34
  }];
31
35
  export function getNewProducts(_ref) {
32
36
  var language = _ref.language,
@@ -24,9 +24,9 @@ export var Products = function Products(_ref) {
24
24
  var _useChinaMirrorHost = useChinaMirrorHost(),
25
25
  _useChinaMirrorHost2 = _slicedToArray(_useChinaMirrorHost, 1),
26
26
  isChinaMirrorHost = _useChinaMirrorHost2[0];
27
- var _React$useState = React.useState([]),
27
+ var _React$useState = React.useState(CATEGORIES),
28
28
  _React$useState2 = _slicedToArray(_React$useState, 2),
29
- products = _React$useState2[0],
29
+ productsCategoty = _React$useState2[0],
30
30
  setProducts = _React$useState2[1];
31
31
  var lang = locale.id === 'zh' ? 'zh' : 'en';
32
32
  React.useEffect(function () {
@@ -34,23 +34,33 @@ export var Products = function Products(_ref) {
34
34
  language: lang,
35
35
  isChinaMirrorHost: isChinaMirrorHost
36
36
  }).then(function (data) {
37
- setProducts(data);
37
+ var newProducts = CATEGORIES.map(function (_ref2) {
38
+ var name = _ref2.name,
39
+ type = _ref2.type;
40
+ return {
41
+ name: name,
42
+ type: type,
43
+ products: data.filter(function (item) {
44
+ return item.category === type;
45
+ })
46
+ };
47
+ });
48
+ setProducts(newProducts);
38
49
  });
39
50
  }, [lang, isChinaMirrorHost]);
40
51
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
41
52
  className: cx(styles.products, className, _defineProperty(_defineProperty({}, styles.show, !!show), styles.bannerVisible, !!bannerVisible))
42
53
  }, /*#__PURE__*/React.createElement("div", {
43
54
  className: styles.container
44
- }, CATEGORIES.map(function (_ref2, idx) {
45
- var name = _ref2.name,
46
- type = _ref2.type;
47
- return /*#__PURE__*/React.createElement(React.Fragment, {
55
+ }, productsCategoty.map(function (_ref3, idx) {
56
+ var name = _ref3.name,
57
+ type = _ref3.type,
58
+ products = _ref3.products;
59
+ return products.length ? /*#__PURE__*/React.createElement(React.Fragment, {
48
60
  key: idx
49
61
  }, /*#__PURE__*/React.createElement("h3", null, /*#__PURE__*/React.createElement(FormattedMessage, {
50
62
  id: name
51
- })), /*#__PURE__*/React.createElement("ul", null, products.filter(function (item) {
52
- return item.category === type;
53
- }).map(function (product) {
63
+ })), /*#__PURE__*/React.createElement("ul", null, products.map(function (product) {
54
64
  var _product$links;
55
65
  return /*#__PURE__*/React.createElement(Product, {
56
66
  key: product.title,
@@ -62,7 +72,7 @@ export var Products = function Products(_ref) {
62
72
  links: product.links,
63
73
  language: language || locale.id
64
74
  });
65
- })));
75
+ }))) : null;
66
76
  }))), /*#__PURE__*/React.createElement("div", {
67
77
  className: styles.mask
68
78
  }));
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- export type ITextSegment = {
2
+ export declare type ITextSegment = {
3
3
  text: string;
4
4
  highlighted?: boolean;
5
5
  };
6
- export type ISearchResult = {
6
+ export declare type ISearchResult = {
7
7
  /**
8
8
  * 搜索结果的主题,显示在最左边,一般是页面的标题。
9
9
  */
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const Search: () => React.JSX.Element;
1
+ export declare const Search: () => JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { INav } from './Navs';
3
3
  import type { IC } from '../../types';
4
- export type HeaderProps = {
4
+ export declare type HeaderProps = {
5
5
  pathPrefix?: string;
6
6
  /** 子标题 */
7
7
  subTitle?: React.ReactNode;
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
1
  /**
3
2
  * Loading
4
3
  */
5
- declare const Loading: () => React.JSX.Element;
4
+ declare const Loading: () => JSX.Element;
6
5
  export default Loading;
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- export type PreviewProps = {
2
+ export declare type PreviewProps = {
3
3
  source: string;
4
4
  pin: boolean;
5
5
  code: HTMLDivElement;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import 'rc-drawer/assets/index.css';
3
- export type ManualContent = {
3
+ export declare type ManualContent = {
4
4
  readonly children: any;
5
5
  };
6
6
  /**
@@ -21,8 +21,8 @@ import { useNavigate } from 'react-router-dom';
21
21
  import { useMedia } from 'react-use';
22
22
  import readingTime from 'reading-time';
23
23
  import URI from 'uri-parse';
24
- import { ContentTable } from "dumi/theme/slots/ContentTable";
25
- import { SEO } from "dumi/theme/slots/SEO";
24
+ import { ContentTable } from "../ContentTable";
25
+ import { SEO } from "../SEO";
26
26
  import { useScrollToTop } from "../hooks";
27
27
  import { NavigatorBanner } from "./NavigatorBanner";
28
28
  import ReadingTime from "./ReadingTime";
package/dist/types.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  export interface IThemeConfig {
2
2
  [key: string]: any;
3
3
  }
4
- export type Status = 'responded' | 'error' | 'timeout';
4
+ export declare type Status = 'responded' | 'error' | 'timeout';
5
5
  /**
6
6
  * 配置文件中的国际化配置
7
7
  */
8
- export type IC = string | {
8
+ export declare type IC = string | {
9
9
  zh: string;
10
10
  en: string;
11
11
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/dumi-theme-antv",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
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"
@@ -77,8 +67,8 @@
77
67
  "prettier": "^2.7.1",
78
68
  "rc-drawer": "^4.0.0",
79
69
  "rc-footer": "^0.6.6",
80
- "react": "^18.2.0",
81
- "react-dom": "^18.2.0",
70
+ "react": "^18.0.0",
71
+ "react-dom": "^18.0.0",
82
72
  "react-error-boundary": "^3.1.4",
83
73
  "react-github-button": "^0.1.11",
84
74
  "react-helmet": "^6.1.0",
@@ -120,8 +110,6 @@
120
110
  "lint-staged": "^13.0.3",
121
111
  "prettier-plugin-organize-imports": "^3.0.0",
122
112
  "prettier-plugin-packagejson": "^2.2.18",
123
- "react": "^18.0.0",
124
- "react-dom": "^18.0.0",
125
113
  "stylelint": "^14.9.1"
126
114
  },
127
115
  "peerDependencies": {
@@ -135,5 +123,13 @@
135
123
  "authors": [
136
124
  "dumi",
137
125
  "antv"
138
- ]
139
- }
126
+ ],
127
+ "scripts": {
128
+ "build": "npm run prepare && father build",
129
+ "dev": "father dev",
130
+ "lint": "npm run lint:es && npm run lint:css",
131
+ "lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
132
+ "lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
133
+ "start": "cd example && npm run start"
134
+ }
135
+ }