@antv/dumi-theme-antv 0.2.1 → 0.3.0-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.
- package/LICENSE +21 -0
- package/README.md +32 -33
- package/dist/builtins/Playground/index.d.ts +24 -0
- package/{es/builtins/Example.js → dist/builtins/Playground/index.js} +40 -33
- package/dist/builtins/Playground/index.module.less +15 -0
- package/dist/context.d.ts +5 -0
- package/dist/context.js +2 -0
- package/dist/layouts/DocLayout.d.ts +7 -0
- package/dist/layouts/DocLayout.js +38 -0
- package/dist/layouts/entry/API.d.ts +10 -0
- package/dist/layouts/entry/API.js +12 -0
- package/dist/layouts/entry/Index.d.ts +7 -0
- package/dist/layouts/entry/Index.js +71 -0
- package/dist/layouts/entry/Manual.d.ts +8 -0
- package/dist/layouts/entry/Manual.js +14 -0
- package/dist/locales/en.json +98 -0
- package/dist/locales/zh.json +98 -0
- package/dist/pages/404.d.ts +6 -0
- package/dist/pages/404.js +14 -0
- package/dist/pages/Example/index.d.ts +6 -0
- package/dist/pages/Example/index.js +139 -0
- package/dist/pages/Example/index.module.less +40 -0
- package/dist/pages/Examples/components/Accouncement/index.d.ts +6 -0
- package/dist/pages/Examples/components/Accouncement/index.js +60 -0
- package/dist/pages/Examples/components/Accouncement/index.module.less +9 -0
- package/dist/pages/Examples/components/Article/index.d.ts +2 -0
- package/dist/pages/Examples/components/Article/index.js +8 -0
- package/dist/pages/Examples/components/Article/index.module.less +2 -0
- package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.d.ts +10 -0
- package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.js +74 -0
- package/dist/pages/Examples/components/ExampleTopicMenu/index.d.ts +9 -0
- package/{es/builtins/Table.js → dist/pages/Examples/components/ExampleTopicMenu/index.js} +47 -41
- package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.d.ts +10 -0
- package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.js +33 -0
- package/dist/pages/Examples/components/GalleryPageContent/index.d.ts +10 -0
- package/dist/pages/Examples/components/GalleryPageContent/index.js +81 -0
- package/dist/pages/Examples/index.d.ts +8 -0
- package/dist/pages/Examples/index.js +75 -0
- package/dist/pages/Examples/index.module.less +605 -0
- package/dist/pages/Examples/types.d.ts +33 -0
- package/dist/pages/Examples/types.js +1 -0
- package/dist/plugin/examples.d.ts +7 -0
- package/dist/plugin/examples.js +83 -0
- package/dist/plugin/index.d.ts +3 -0
- package/dist/plugin/index.js +103 -0
- package/dist/slots/404.d.ts +2 -0
- package/{es/antv/404/index.js → dist/slots/404.js} +4 -9
- package/{es/antv/Cases/Cases.d.ts → dist/slots/Cases/index.d.ts} +4 -4
- package/{es/antv/Cases/Cases.js → dist/slots/Cases/index.js} +25 -25
- package/{src/antv/Cases/Cases.module.less → dist/slots/Cases/index.module.less} +36 -5
- package/dist/slots/CodeEditor/Toolbar.d.ts +67 -0
- package/dist/slots/CodeEditor/Toolbar.js +152 -0
- package/dist/slots/CodeEditor/Toolbar.module.less +81 -0
- package/dist/slots/CodeEditor/index.d.ts +58 -0
- package/dist/slots/CodeEditor/index.js +200 -0
- package/dist/slots/CodeEditor/index.module.less +11 -0
- package/dist/slots/CodeEditor/utils.d.ts +42 -0
- package/dist/slots/CodeEditor/utils.js +157 -0
- package/dist/slots/CodePreview/CodeHeader.d.ts +19 -0
- package/dist/slots/CodePreview/CodeHeader.js +32 -0
- package/dist/slots/CodePreview/CodeHeader.module.less +0 -0
- package/dist/slots/CodePreview/index.d.ts +17 -0
- package/dist/slots/CodePreview/index.js +29 -0
- package/dist/slots/CodePreview/index.module.less +42 -0
- package/dist/slots/CodeRunner/index.d.ts +14 -0
- package/dist/slots/CodeRunner/index.js +76 -0
- package/dist/slots/CodeRunner/index.module.less +0 -0
- package/dist/slots/CodeRunner/utils.d.ts +10 -0
- package/dist/slots/CodeRunner/utils.js +36 -0
- package/dist/slots/Companies/index.d.ts +13 -0
- package/dist/slots/Companies/index.js +49 -0
- package/dist/slots/Companies/index.module.less +82 -0
- package/dist/slots/Detail/News.d.ts +9 -0
- package/{es/antv/Banner/Notification.js → dist/slots/Detail/News.js} +8 -11
- package/{src/antv/Banner/Notification.module.less → dist/slots/Detail/News.module.less} +15 -3
- package/dist/slots/Detail/index.d.ts +26 -0
- package/dist/slots/Detail/index.js +124 -0
- package/{src/antv/Banner/Banner.module.less → dist/slots/Detail/index.module.less} +42 -74
- package/dist/slots/ExampleSider/index.d.ts +55 -0
- package/dist/slots/ExampleSider/index.js +218 -0
- package/dist/slots/ExampleSider/index.module.less +141 -0
- package/{es/antv → dist/slots}/Features/FeatureCard.d.ts +1 -1
- package/{es/antv → dist/slots}/Features/FeatureCard.js +6 -6
- package/{src/antv → dist/slots}/Features/FeatureCard.module.less +8 -1
- package/{es/antv → dist/slots}/Features/index.d.ts +2 -2
- package/{es/antv → dist/slots}/Features/index.js +17 -25
- package/{src/antv/Features/Features.module.less → dist/slots/Features/index.module.less} +34 -3
- package/dist/slots/Footer/index.d.ts +18 -0
- package/dist/slots/Footer/index.js +187 -0
- package/dist/slots/Footer/index.module.less +85 -0
- package/dist/slots/Header/Logo.d.ts +7 -0
- package/{es/antv → dist/slots}/Header/Logo.js +6 -2
- package/dist/slots/Header/LogoWhite.d.ts +7 -0
- package/dist/slots/Header/LogoWhite.js +19 -0
- package/dist/slots/Header/Navs.d.ts +17 -0
- package/dist/slots/Header/Navs.js +46 -0
- package/dist/slots/Header/Products/NavigatorBanner.d.ts +10 -0
- package/dist/slots/Header/Products/NavigatorBanner.js +34 -0
- package/dist/slots/Header/Products/NavigatorBanner.module.less +39 -0
- package/{es/antv → dist/slots/Header}/Products/Product.d.ts +3 -3
- package/{es/antv → dist/slots/Header}/Products/Product.js +11 -16
- package/{src/antv → dist/slots/Header}/Products/Product.module.less +10 -8
- package/{es/antv → dist/slots/Header}/Products/getProducts.d.ts +2 -7
- package/dist/slots/Header/Products/getProducts.js +67 -0
- package/dist/slots/Header/Products/index.d.ts +9 -0
- package/{es/antv → dist/slots/Header}/Products/index.js +15 -22
- package/dist/slots/Header/Search.d.ts +12 -0
- package/dist/slots/Header/Search.js +90 -0
- package/dist/slots/Header/Search.module.less +39 -0
- package/dist/slots/Header/index.d.ts +66 -0
- package/dist/slots/Header/index.js +379 -0
- package/dist/slots/Header/index.module.less +382 -0
- package/dist/slots/Header/utils.d.ts +1 -0
- package/dist/slots/Header/utils.js +26 -0
- package/dist/slots/Loading/index.d.ts +2 -0
- package/dist/slots/Loading/index.js +65 -0
- package/dist/slots/Loading/index.module.less +12 -0
- package/dist/slots/Loading.d.ts +5 -0
- package/dist/slots/Loading.js +8 -0
- package/dist/slots/ManualContent/NavigatorBanner.d.ts +9 -0
- package/dist/slots/ManualContent/NavigatorBanner.js +36 -0
- package/dist/slots/ManualContent/NavigatorBanner.module.less +39 -0
- package/dist/slots/ManualContent/ReadingTime.d.ts +3 -0
- package/dist/slots/ManualContent/ReadingTime.js +10 -0
- package/dist/slots/ManualContent/index.d.ts +9 -0
- package/dist/slots/ManualContent/index.js +321 -0
- package/dist/slots/ManualContent/index.module.less +656 -0
- package/dist/slots/TOC.d.ts +5 -0
- package/dist/slots/TOC.js +6 -0
- package/dist/slots/_.less +83 -0
- package/dist/slots/global.d.ts +1 -0
- package/dist/slots/global.js +7 -0
- package/dist/slots/hooks.d.ts +16 -0
- package/{es/antv → dist/slots}/hooks.js +60 -37
- package/dist/slots/utils.d.ts +20 -0
- package/dist/slots/utils.js +154 -0
- package/dist/types.d.ts +3 -0
- package/dist/types.js +1 -0
- package/dist/typings.d.ts +137 -0
- package/package.json +108 -47
- package/es/antv/404/index.d.ts +0 -2
- package/es/antv/Banner/Banner.module.less +0 -412
- package/es/antv/Banner/Notification.d.ts +0 -10
- package/es/antv/Banner/Notification.module.less +0 -108
- package/es/antv/Banner/index.d.ts +0 -25
- package/es/antv/Banner/index.js +0 -104
- package/es/antv/Cases/Cases.module.less +0 -203
- package/es/antv/Features/FeatureCard.module.less +0 -51
- package/es/antv/Features/Features.module.less +0 -169
- package/es/antv/Footer/Footer.module.less +0 -36
- package/es/antv/Footer/index.d.ts +0 -12
- package/es/antv/Footer/index.js +0 -237
- package/es/antv/Header/Logo.d.ts +0 -4
- package/es/antv/Products/Product.module.less +0 -146
- package/es/antv/Products/getNewProducts.d.ts +0 -24
- package/es/antv/Products/getNewProducts.js +0 -35
- package/es/antv/Products/getProducts.js +0 -460
- package/es/antv/Products/index.d.ts +0 -9
- package/es/antv/hooks.d.ts +0 -14
- package/es/antv/mixins.less +0 -21
- package/es/antv/utils.d.ts +0 -5
- package/es/antv/utils.js +0 -49
- package/es/builtins/API.d.ts +0 -3
- package/es/builtins/API.js +0 -37
- package/es/builtins/Alert.d.ts +0 -3
- package/es/builtins/Alert.js +0 -7
- package/es/builtins/Alert.less +0 -62
- package/es/builtins/Badge.d.ts +0 -3
- package/es/builtins/Badge.js +0 -7
- package/es/builtins/Badge.less +0 -31
- package/es/builtins/Example.d.ts +0 -5
- package/es/builtins/Example.less +0 -47
- package/es/builtins/Previewer.d.ts +0 -39
- package/es/builtins/Previewer.js +0 -225
- package/es/builtins/Previewer.less +0 -406
- package/es/builtins/SourceCode.d.ts +0 -10
- package/es/builtins/SourceCode.js +0 -70
- package/es/builtins/SourceCode.less +0 -103
- package/es/builtins/Table.d.ts +0 -4
- package/es/builtins/Table.less +0 -43
- package/es/builtins/Tree.d.ts +0 -4
- package/es/builtins/Tree.js +0 -213
- package/es/builtins/Tree.less +0 -159
- package/es/components/Dark.d.ts +0 -9
- package/es/components/Dark.js +0 -125
- package/es/components/Dark.less +0 -121
- package/es/components/LocaleSelect.d.ts +0 -6
- package/es/components/LocaleSelect.js +0 -53
- package/es/components/LocaleSelect.less +0 -59
- package/es/components/Navbar.d.ts +0 -10
- package/es/components/Navbar.js +0 -155
- package/es/components/Navbar.less +0 -180
- package/es/components/SearchBar.d.ts +0 -4
- package/es/components/SearchBar.js +0 -81
- package/es/components/SearchBar.less +0 -165
- package/es/components/SideMenu.d.ts +0 -10
- package/es/components/SideMenu.js +0 -99
- package/es/components/SideMenu.less +0 -379
- package/es/components/SlugList.d.ts +0 -7
- package/es/components/SlugList.js +0 -38
- package/es/components/SlugList.less +0 -18
- package/es/declaration.d.ts +0 -1
- package/es/layout.d.ts +0 -5
- package/es/layout.js +0 -277
- package/es/style/layout.less +0 -402
- package/es/style/markdown.less +0 -240
- package/es/style/variables.less +0 -37
- package/src/antv/404/index.tsx +0 -25
- package/src/antv/Banner/Notification.tsx +0 -45
- package/src/antv/Banner/index.tsx +0 -139
- package/src/antv/Cases/Cases.tsx +0 -116
- package/src/antv/Features/FeatureCard.tsx +0 -24
- package/src/antv/Features/index.tsx +0 -86
- package/src/antv/Footer/Footer.module.less +0 -36
- package/src/antv/Footer/index.tsx +0 -272
- package/src/antv/Header/Logo.tsx +0 -85
- package/src/antv/Products/Product.tsx +0 -80
- package/src/antv/Products/getNewProducts.tsx +0 -53
- package/src/antv/Products/getProducts.tsx +0 -626
- package/src/antv/Products/index.tsx +0 -70
- package/src/antv/hooks.ts +0 -87
- package/src/antv/mixins.less +0 -21
- package/src/antv/utils.ts +0 -44
- package/src/builtins/API.tsx +0 -57
- package/src/builtins/Alert.less +0 -62
- package/src/builtins/Alert.tsx +0 -4
- package/src/builtins/Badge.less +0 -31
- package/src/builtins/Badge.tsx +0 -4
- package/src/builtins/Example.less +0 -47
- package/src/builtins/Example.tsx +0 -34
- package/src/builtins/Previewer.less +0 -406
- package/src/builtins/Previewer.tsx +0 -264
- package/src/builtins/SourceCode.less +0 -103
- package/src/builtins/SourceCode.tsx +0 -55
- package/src/builtins/Table.less +0 -43
- package/src/builtins/Table.tsx +0 -42
- package/src/builtins/Tree.less +0 -159
- package/src/builtins/Tree.tsx +0 -130
- package/src/components/Dark.less +0 -121
- package/src/components/Dark.tsx +0 -78
- package/src/components/LocaleSelect.less +0 -59
- package/src/components/LocaleSelect.tsx +0 -53
- package/src/components/Navbar.less +0 -180
- package/src/components/Navbar.tsx +0 -152
- package/src/components/SearchBar.less +0 -165
- package/src/components/SearchBar.tsx +0 -68
- package/src/components/SideMenu.less +0 -379
- package/src/components/SideMenu.tsx +0 -148
- package/src/components/SlugList.less +0 -18
- package/src/components/SlugList.tsx +0 -20
- package/src/declaration.d.ts +0 -1
- package/src/layout.tsx +0 -226
- package/src/style/layout.less +0 -402
- package/src/style/markdown.less +0 -240
- package/src/style/variables.less +0 -37
- package/src/test/SearchBar.test.ts +0 -32
- package/src/test/Table.test.tsx +0 -41
- package/src/test/index.test.tsx +0 -377
package/src/antv/hooks.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
export interface NavigatorBannerProps {
|
|
3
|
-
post?: {
|
|
4
|
-
slug?: string;
|
|
5
|
-
title?: string;
|
|
6
|
-
};
|
|
7
|
-
type: "prev" | "next";
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const useChinaMirrorHost = (): [boolean] => {
|
|
11
|
-
const [isChinaMirrorHost, setIsChinaMirrorHost] = useState(false);
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
if (
|
|
14
|
-
window.location.host.includes("gitee.io") &&
|
|
15
|
-
window.location.host.includes("antv")
|
|
16
|
-
) {
|
|
17
|
-
setIsChinaMirrorHost(true);
|
|
18
|
-
}
|
|
19
|
-
}, []);
|
|
20
|
-
return [isChinaMirrorHost];
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const usePrevAndNext = (): NavigatorBannerProps["post"][] => {
|
|
24
|
-
const [prevAndNext, setPrevAndNext] = useState<
|
|
25
|
-
NavigatorBannerProps["post"][]
|
|
26
|
-
>([]);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
const menuNodes = document.querySelectorAll("aside .ant-menu-item a");
|
|
29
|
-
const currentMenuNode = document.querySelector(
|
|
30
|
-
"aside .ant-menu-item-selected a"
|
|
31
|
-
);
|
|
32
|
-
const currentIndex = Array.from(menuNodes).findIndex(
|
|
33
|
-
(node) => node === currentMenuNode
|
|
34
|
-
);
|
|
35
|
-
const prevNode =
|
|
36
|
-
currentIndex - 1 >= 0 ? menuNodes[currentIndex - 1] : undefined;
|
|
37
|
-
const nextNode =
|
|
38
|
-
currentIndex + 1 < menuNodes.length
|
|
39
|
-
? menuNodes[currentIndex + 1]
|
|
40
|
-
: undefined;
|
|
41
|
-
const prev = prevNode
|
|
42
|
-
? {
|
|
43
|
-
slug: prevNode.getAttribute("href") || undefined,
|
|
44
|
-
title: prevNode.textContent || undefined,
|
|
45
|
-
}
|
|
46
|
-
: undefined;
|
|
47
|
-
const next = nextNode
|
|
48
|
-
? {
|
|
49
|
-
slug: nextNode.getAttribute("href") || undefined,
|
|
50
|
-
title: nextNode.textContent || undefined,
|
|
51
|
-
}
|
|
52
|
-
: undefined;
|
|
53
|
-
setPrevAndNext([prev, next]);
|
|
54
|
-
}, []);
|
|
55
|
-
return prevAndNext;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export const useLogoLink = ({
|
|
59
|
-
link = "",
|
|
60
|
-
siteUrl = "",
|
|
61
|
-
lang = "",
|
|
62
|
-
}: {
|
|
63
|
-
link?: string;
|
|
64
|
-
siteUrl?: string;
|
|
65
|
-
lang?: string;
|
|
66
|
-
}): [string] => {
|
|
67
|
-
let defaultLogoLink;
|
|
68
|
-
if (link) {
|
|
69
|
-
defaultLogoLink = link;
|
|
70
|
-
} else if (siteUrl === "https://antv.vision") {
|
|
71
|
-
defaultLogoLink = `/${lang}`;
|
|
72
|
-
} else {
|
|
73
|
-
defaultLogoLink = `https://antv.vision/${lang}`;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const [giteeLogoLink, setGiteeLogoLink] = useState("");
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
if (
|
|
79
|
-
window.location.host.includes("gitee.io") &&
|
|
80
|
-
window.location.host.includes("antv")
|
|
81
|
-
) {
|
|
82
|
-
setGiteeLogoLink(`https://antv.gitee.io/${lang}`);
|
|
83
|
-
}
|
|
84
|
-
}, []);
|
|
85
|
-
|
|
86
|
-
return [giteeLogoLink || defaultLogoLink];
|
|
87
|
-
};
|
package/src/antv/mixins.less
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
@import "~antd/es/style/themes/default.less";
|
|
2
|
-
@primaryColor: #873bf4;
|
|
3
|
-
|
|
4
|
-
.container1440() {
|
|
5
|
-
width: 1440px;
|
|
6
|
-
max-width: calc(100% - 80px);
|
|
7
|
-
margin-left: auto;
|
|
8
|
-
margin-right: auto;
|
|
9
|
-
|
|
10
|
-
@media only screen and (max-width: 931.99px) {
|
|
11
|
-
& {
|
|
12
|
-
max-width: calc(100% - 60px);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@media only screen and (max-width: 767.99px) {
|
|
17
|
-
& {
|
|
18
|
-
max-width: calc(100% - 32px);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
package/src/antv/utils.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
type Status = 'responded' | 'error' | 'timeout';
|
|
2
|
-
|
|
3
|
-
export const ping = (callback: (status: Status) => void): NodeJS.Timeout => {
|
|
4
|
-
const url =
|
|
5
|
-
'https://private-a' +
|
|
6
|
-
'lipay' +
|
|
7
|
-
'objects.alip' +
|
|
8
|
-
'ay.com/alip' +
|
|
9
|
-
'ay-rmsdeploy-image/rmsportal/RKuAiriJqrUhyqW.png';
|
|
10
|
-
const img = new Image();
|
|
11
|
-
let done = false;
|
|
12
|
-
const finish = (status: Status) => {
|
|
13
|
-
if (!done) {
|
|
14
|
-
done = true;
|
|
15
|
-
img.src = '';
|
|
16
|
-
callback(status);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
img.onload = () => finish('responded');
|
|
20
|
-
img.onerror = () => finish('error');
|
|
21
|
-
img.src = url;
|
|
22
|
-
return setTimeout(() => finish('timeout'), 1500);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const capitalize = (s: string): string => {
|
|
26
|
-
if (typeof s !== 'string') {
|
|
27
|
-
return '';
|
|
28
|
-
}
|
|
29
|
-
return s.charAt(0).toUpperCase() + s.slice(1);
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const getChinaMirrorHost = (host?: string): string => {
|
|
33
|
-
const hostString = typeof host === 'undefined' ? window.location.host : host;
|
|
34
|
-
// antv.vision => antv.gitee.io
|
|
35
|
-
if (hostString === 'antv.vision') {
|
|
36
|
-
return 'antv.gitee.io';
|
|
37
|
-
}
|
|
38
|
-
// g2plot.antv.vision => antv-g2plot.gitee.io
|
|
39
|
-
const match = hostString.match(/(.*)\.antv\.vision/);
|
|
40
|
-
if (match && match[1]) {
|
|
41
|
-
return `antv-${match[1]}.gitee.io`;
|
|
42
|
-
}
|
|
43
|
-
return hostString;
|
|
44
|
-
};
|
package/src/builtins/API.tsx
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React, { useContext } from 'react';
|
|
2
|
-
import type { IApiComponentProps} from 'dumi/theme';
|
|
3
|
-
import { context, useApiData, AnchorLink } from 'dumi/theme';
|
|
4
|
-
|
|
5
|
-
const LOCALE_TEXTS = {
|
|
6
|
-
'zh-CN': {
|
|
7
|
-
name: '属性名',
|
|
8
|
-
description: '描述',
|
|
9
|
-
type: '类型',
|
|
10
|
-
default: '默认值',
|
|
11
|
-
required: '(必选)',
|
|
12
|
-
},
|
|
13
|
-
'en-US': {
|
|
14
|
-
name: 'Name',
|
|
15
|
-
description: 'Description',
|
|
16
|
-
type: 'Type',
|
|
17
|
-
default: 'Default',
|
|
18
|
-
required: '(required)',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default ({ identifier, export: expt }: IApiComponentProps) => {
|
|
23
|
-
const data = useApiData(identifier);
|
|
24
|
-
const { locale } = useContext(context);
|
|
25
|
-
const texts = /^zh|cn$/i.test(locale) ? LOCALE_TEXTS['zh-CN'] : LOCALE_TEXTS['en-US'];
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<>
|
|
29
|
-
{data && (
|
|
30
|
-
<table style={{ marginTop: 24 }}>
|
|
31
|
-
<thead>
|
|
32
|
-
<tr>
|
|
33
|
-
<th>{texts.name}</th>
|
|
34
|
-
<th>{texts.description}</th>
|
|
35
|
-
<th>{texts.type}</th>
|
|
36
|
-
<th>{texts.default}</th>
|
|
37
|
-
</tr>
|
|
38
|
-
</thead>
|
|
39
|
-
<tbody>
|
|
40
|
-
{data[expt].map(row => (
|
|
41
|
-
<tr key={row.identifier}>
|
|
42
|
-
<td>{row.identifier}</td>
|
|
43
|
-
<td>{row.description || '--'}</td>
|
|
44
|
-
<td>
|
|
45
|
-
<code>{row.type}</code>
|
|
46
|
-
</td>
|
|
47
|
-
<td>
|
|
48
|
-
<code>{row.default || (row.required && texts.required) || '--'}</code>
|
|
49
|
-
</td>
|
|
50
|
-
</tr>
|
|
51
|
-
))}
|
|
52
|
-
</tbody>
|
|
53
|
-
</table>
|
|
54
|
-
)}
|
|
55
|
-
</>
|
|
56
|
-
);
|
|
57
|
-
};
|
package/src/builtins/Alert.less
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
@import (reference) '../style/variables.less';
|
|
2
|
-
|
|
3
|
-
.@{prefix}-alert {
|
|
4
|
-
@s-border-right: 3px;
|
|
5
|
-
|
|
6
|
-
position: relative;
|
|
7
|
-
margin: 24px 0;
|
|
8
|
-
padding: 10px 20px;
|
|
9
|
-
color: @c-text;
|
|
10
|
-
font-size: 14px;
|
|
11
|
-
line-height: 20px;
|
|
12
|
-
border-left: 0;
|
|
13
|
-
background: #ffffff;
|
|
14
|
-
box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.06);
|
|
15
|
-
border-radius: 1px;
|
|
16
|
-
|
|
17
|
-
[data-prefers-color=dark] & {
|
|
18
|
-
color: @c-text-dark;
|
|
19
|
-
background: @c-bg-dark;
|
|
20
|
-
box-shadow: 0 1px 2px -2px rgba(0,0,0,0.64), 0 3px 6px 0 rgba(0,0,0,0.48), 0 5px 12px 4px rgba(0,0,0,0.36);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&::after {
|
|
24
|
-
content: '';
|
|
25
|
-
position: absolute;
|
|
26
|
-
display: inline-block;
|
|
27
|
-
top: 0;
|
|
28
|
-
left: 0;
|
|
29
|
-
bottom: 0;
|
|
30
|
-
width: @s-border-right;
|
|
31
|
-
border-radius: 1px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
&:first-child {
|
|
35
|
-
margin-top: 0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
&:not([type]),
|
|
39
|
-
&[type='warning'] {
|
|
40
|
-
&::after {
|
|
41
|
-
background: #ffc121;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&[type='info'] {
|
|
46
|
-
&::after {
|
|
47
|
-
background: #69b9ff;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
&[type='success'] {
|
|
52
|
-
&::after {
|
|
53
|
-
background: #8cd225;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&[type='error'] {
|
|
58
|
-
&::after {
|
|
59
|
-
background: #ff4646;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
package/src/builtins/Alert.tsx
DELETED
package/src/builtins/Badge.less
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
@import (reference) '../style/variables.less';
|
|
2
|
-
|
|
3
|
-
.@{prefix}-badge {
|
|
4
|
-
display: inline-block;
|
|
5
|
-
margin-left: 6px;
|
|
6
|
-
padding: 1px 7px;
|
|
7
|
-
color: #fff;
|
|
8
|
-
font-size: 13px;
|
|
9
|
-
line-height: 20px;
|
|
10
|
-
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1);
|
|
11
|
-
box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.06);
|
|
12
|
-
border-radius: 1px;
|
|
13
|
-
vertical-align: top;
|
|
14
|
-
|
|
15
|
-
&:not([type]),
|
|
16
|
-
&[type='info'] {
|
|
17
|
-
background: #4569d4;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
&[type='warning'] {
|
|
21
|
-
background: #ffc121;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&[type='success'] {
|
|
25
|
-
background: #8cd225;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&[type='error'] {
|
|
29
|
-
background: #ff4646;
|
|
30
|
-
}
|
|
31
|
-
}
|
package/src/builtins/Badge.tsx
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
@import (reference) '../style/variables.less';
|
|
2
|
-
|
|
3
|
-
.@{prefix}-example-wrapper {
|
|
4
|
-
padding-top: 16px;
|
|
5
|
-
height: calc(100vh - @s-nav-height - 2px);
|
|
6
|
-
|
|
7
|
-
@media @mobile {
|
|
8
|
-
padding-top: 16px;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
&-toolbar {
|
|
12
|
-
display: flex;
|
|
13
|
-
color: @c-heading;
|
|
14
|
-
font-size: 16px;
|
|
15
|
-
font-weight: 500;
|
|
16
|
-
justify-content: space-between;
|
|
17
|
-
margin-bottom: 16px;
|
|
18
|
-
border-bottom: 1px solid @c-border;
|
|
19
|
-
|
|
20
|
-
button,
|
|
21
|
-
a {
|
|
22
|
-
display: inline-block;
|
|
23
|
-
margin: 6px 0 6px 12px;
|
|
24
|
-
width: 16px;
|
|
25
|
-
height: 16px;
|
|
26
|
-
font-weight: 400;
|
|
27
|
-
border: 0;
|
|
28
|
-
outline: none;
|
|
29
|
-
vertical-align: middle;
|
|
30
|
-
cursor: pointer;
|
|
31
|
-
|
|
32
|
-
&:first-child {
|
|
33
|
-
background-position-x: -144px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&:nth-child(2) {
|
|
37
|
-
background-position-x: -126px;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
iframe {
|
|
43
|
-
width: 100%;
|
|
44
|
-
min-height: 100%;
|
|
45
|
-
border: 0;
|
|
46
|
-
}
|
|
47
|
-
}
|
package/src/builtins/Example.tsx
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React, { useRef, useEffect, useState } from 'react';
|
|
2
|
-
import './Example.less';
|
|
3
|
-
|
|
4
|
-
export default (props: { route: any }) => {
|
|
5
|
-
const elm = useRef<HTMLIFrameElement>();
|
|
6
|
-
const [height, setHeight] = useState(0);
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
setHeight(elm.current.contentWindow.document.documentElement.scrollHeight);
|
|
10
|
-
}, [elm]);
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
props.route.meta.examplePath && (
|
|
14
|
-
<div className="__dumi-default-example-wrapper">
|
|
15
|
-
<div className="__dumi-default-example-wrapper-toolbar">
|
|
16
|
-
{props.route.meta.description || props.route.meta.title}
|
|
17
|
-
<span>
|
|
18
|
-
<button
|
|
19
|
-
className="__dumi-default-icon"
|
|
20
|
-
onClick={() => elm.current.contentWindow.location.reload()}
|
|
21
|
-
/>
|
|
22
|
-
<a
|
|
23
|
-
target="_blank"
|
|
24
|
-
rel="noopener noreferrer"
|
|
25
|
-
href={props.route.meta.examplePath}
|
|
26
|
-
className="__dumi-default-icon"
|
|
27
|
-
/>
|
|
28
|
-
</span>
|
|
29
|
-
</div>
|
|
30
|
-
<iframe src={props.route.meta.examplePath} ref={elm} style={{ height }} title="dumi" />
|
|
31
|
-
</div>
|
|
32
|
-
)
|
|
33
|
-
);
|
|
34
|
-
};
|