dumi 2.4.28 → 2.4.30
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/compiled/@umijs/plugins/index.js +1 -1
- package/compiled/@umijs/plugins/package.json +1 -1
- package/dist/client/misc/reactDemoCompiler.js +2 -2
- package/dist/client/theme-api/AtomRenderer.js +6 -6
- package/dist/client/theme-api/DumiDemo/index.js +1 -1
- package/dist/client/theme-api/DumiDemoGrid.js +1 -1
- package/dist/client/theme-api/DumiPage.js +1 -1
- package/dist/client/theme-api/openCodeSandbox.d.ts +1 -0
- package/dist/client/theme-api/openCodeSandbox.js +1 -1
- package/dist/client/theme-api/openStackBlitz.d.ts +1 -0
- package/dist/client/theme-api/openStackBlitz.js +1 -1
- package/dist/client/theme-api/types.d.ts +1 -1
- package/dist/client/theme-api/useLiveDemo.js +4 -4
- package/dist/client/theme-api/useLocale.js +1 -1
- package/dist/client/theme-api/useNavData.js +6 -6
- package/dist/client/theme-api/usePrefersColor.js +4 -4
- package/dist/client/theme-api/useRenderer.js +6 -6
- package/dist/client/theme-api/useRouteMeta.js +2 -2
- package/dist/client/theme-api/useSidebarData.js +7 -7
- package/dist/client/theme-api/useSiteSearch/index.js +1 -1
- package/dist/client/theme-api/useSiteSearch/useSearchData.js +7 -7
- package/dist/client/theme-api/useTabMeta.js +2 -2
- package/dist/client/theme-api/utils.d.ts +2 -2
- package/dist/client/theme-api/utils.js +4 -4
- package/dist/constants.d.ts +2 -2
- package/dist/features/assets.js +2 -1
- package/dist/features/compile/makoHooks.d.ts +2 -1
- package/dist/features/sitemap.js +5 -2
- package/dist/features/tabs.js +7 -4
- package/dist/features/theme/index.js +6 -4
- package/dist/loaders/markdown/index.js +19 -11
- package/dist/templates/meta/index.ts.tpl +4 -2
- package/dumi-types.d.ts +115 -0
- package/index.d.ts +64 -5
- package/package.json +11 -8
- package/theme-api.d.ts +319 -0
- package/theme-default/builtins/API/index.js +8 -8
- package/theme-default/builtins/CodeGroup/index.js +1 -1
- package/theme-default/builtins/Container/index.js +1 -1
- package/theme-default/builtins/Previewer/index.js +1 -1
- package/theme-default/builtins/SourceCode/index.js +1 -1
- package/theme-default/builtins/Table/index.js +1 -1
- package/theme-default/builtins/Tree/index.js +17 -17
- package/theme-default/layouts/DocLayout/index.js +1 -1
- package/theme-default/slots/ColorSwitch/index.js +1 -1
- package/theme-default/slots/ContentFooter/index.js +1 -1
- package/theme-default/slots/Header/index.js +6 -3
- package/theme-default/slots/LangSwitch/index.js +1 -1
- package/theme-default/slots/Navbar/index.js +1 -1
- package/theme-default/slots/PreviewerActions/index.js +6 -6
- package/theme-default/slots/RtlSwitch/index.js +1 -1
- package/theme-default/slots/SearchBar/Input.d.ts +1 -1
- package/theme-default/slots/SearchBar/Mask.js +1 -1
- package/theme-default/slots/SearchBar/index.js +2 -2
- package/theme-default/slots/SearchResult/index.js +3 -3
- package/theme-default/slots/SocialIcon/index.d.ts +4 -2
- package/theme-default/slots/SourceCodeEditor/index.d.ts +1 -0
- package/theme-default/slots/SourceCodeEditor/index.js +3 -3
- package/theme-default/slots/Toc/index.js +1 -1
- package/theme-modules.d.ts +62 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dumi",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.30",
|
|
4
4
|
"description": "📖 Documentation Generator of React Component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"generator",
|
|
@@ -30,7 +30,10 @@
|
|
|
30
30
|
"dist",
|
|
31
31
|
"compiled",
|
|
32
32
|
"theme-default",
|
|
33
|
+
"dumi-types.d.ts",
|
|
33
34
|
"index.d.ts",
|
|
35
|
+
"theme-api.d.ts",
|
|
36
|
+
"theme-modules.d.ts",
|
|
34
37
|
"plugin-utils.js",
|
|
35
38
|
"plugin-utils.d.ts",
|
|
36
39
|
"tech-stack-utils.js",
|
|
@@ -65,9 +68,9 @@
|
|
|
65
68
|
"@swc/core": "1.9.2",
|
|
66
69
|
"@types/hast": "^2.3.5",
|
|
67
70
|
"@types/mdast": "^3.0.12",
|
|
68
|
-
"@umijs/bundler-utils": "^4.6.
|
|
69
|
-
"@umijs/core": "^4.6.
|
|
70
|
-
"@umijs/utils": "^4.6.
|
|
71
|
+
"@umijs/bundler-utils": "^4.6.61",
|
|
72
|
+
"@umijs/core": "^4.6.61",
|
|
73
|
+
"@umijs/utils": "^4.6.61",
|
|
71
74
|
"animated-scroll-to": "^2.3.0",
|
|
72
75
|
"classnames": "2.3.2",
|
|
73
76
|
"codesandbox-import-utils": "^2.2.3",
|
|
@@ -119,7 +122,7 @@
|
|
|
119
122
|
"sass": "^1.64.1",
|
|
120
123
|
"sitemap": "^7.1.1",
|
|
121
124
|
"sucrase": "^3.34.0",
|
|
122
|
-
"umi": "^4.6.
|
|
125
|
+
"umi": "^4.6.61",
|
|
123
126
|
"unified": "^10.1.2",
|
|
124
127
|
"unist-util-visit": "^4.1.2",
|
|
125
128
|
"unist-util-visit-parents": "^5.1.3",
|
|
@@ -142,12 +145,12 @@
|
|
|
142
145
|
"@types/react": "^18.2.17",
|
|
143
146
|
"@types/react-copy-to-clipboard": "^5.0.4",
|
|
144
147
|
"@types/react-dom": "^18.2.7",
|
|
145
|
-
"@umijs/lint": "^4.6.
|
|
146
|
-
"@umijs/plugins": "4.
|
|
148
|
+
"@umijs/lint": "^4.6.61",
|
|
149
|
+
"@umijs/plugins": "4.6.61",
|
|
147
150
|
"eslint": "^8.46.0",
|
|
148
151
|
"esno": "^4.7.0",
|
|
149
152
|
"fast-glob": "^3.3.1",
|
|
150
|
-
"father": "^4.
|
|
153
|
+
"father": "^4.6.21",
|
|
151
154
|
"git-repo-info": "^2.1.1",
|
|
152
155
|
"highlight-words-core": "^1.2.2",
|
|
153
156
|
"husky": "^8.0.3",
|
package/theme-api.d.ts
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AtomAsset,
|
|
3
|
+
AtomComponentAsset,
|
|
4
|
+
ExampleBlockAsset,
|
|
5
|
+
ExamplePresetAsset,
|
|
6
|
+
} from 'dumi-assets-types';
|
|
7
|
+
import type { TypeMap } from 'dumi-assets-types/typings/atom/props/types';
|
|
8
|
+
import type {
|
|
9
|
+
FC,
|
|
10
|
+
ComponentType as ReactComponentType,
|
|
11
|
+
ReactNode,
|
|
12
|
+
RefObject,
|
|
13
|
+
} from 'react';
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
FormattedDate,
|
|
17
|
+
FormattedDateParts,
|
|
18
|
+
FormattedDisplayName,
|
|
19
|
+
FormattedList,
|
|
20
|
+
FormattedMessage,
|
|
21
|
+
FormattedNumber,
|
|
22
|
+
FormattedNumberParts,
|
|
23
|
+
FormattedPlural,
|
|
24
|
+
FormattedRelativeTime,
|
|
25
|
+
FormattedTime,
|
|
26
|
+
FormattedTimeParts,
|
|
27
|
+
IntlContext,
|
|
28
|
+
IntlProvider,
|
|
29
|
+
RawIntlProvider,
|
|
30
|
+
createIntlCache,
|
|
31
|
+
defineMessages,
|
|
32
|
+
injectIntl,
|
|
33
|
+
useIntl,
|
|
34
|
+
} from 'react-intl';
|
|
35
|
+
|
|
36
|
+
export interface IPreviewerProps {
|
|
37
|
+
title?: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
filename?: string;
|
|
40
|
+
iframe?: boolean | number;
|
|
41
|
+
debug?: boolean;
|
|
42
|
+
defaultShowCode?: boolean;
|
|
43
|
+
demoUrl: string;
|
|
44
|
+
compact?: boolean;
|
|
45
|
+
transform?: boolean;
|
|
46
|
+
background?: string;
|
|
47
|
+
asset: ExampleBlockAsset;
|
|
48
|
+
children: ReactNode;
|
|
49
|
+
_live_in_iframe?: boolean;
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface IRouteMeta {
|
|
54
|
+
frontmatter: {
|
|
55
|
+
title: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
keywords?: string[];
|
|
58
|
+
nav?:
|
|
59
|
+
| string
|
|
60
|
+
| {
|
|
61
|
+
title?: string;
|
|
62
|
+
order?: number;
|
|
63
|
+
second?: Omit<IRouteMeta['frontmatter']['nav'], 'second'>;
|
|
64
|
+
};
|
|
65
|
+
group?: string | { title?: string; order?: number };
|
|
66
|
+
order?: number;
|
|
67
|
+
hero?: {
|
|
68
|
+
title?: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
background?: string;
|
|
71
|
+
actions?: { text: string; link: string }[];
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
};
|
|
74
|
+
features?: {
|
|
75
|
+
emoji?: string;
|
|
76
|
+
title?: string;
|
|
77
|
+
link?: string;
|
|
78
|
+
description?: string;
|
|
79
|
+
[key: string]: any;
|
|
80
|
+
}[];
|
|
81
|
+
toc?: boolean | 'content' | 'menu';
|
|
82
|
+
demo?: {
|
|
83
|
+
cols?: number;
|
|
84
|
+
tocDepth?: number;
|
|
85
|
+
};
|
|
86
|
+
atomId?: string;
|
|
87
|
+
filename?: string;
|
|
88
|
+
lastUpdated?: number;
|
|
89
|
+
debug?: boolean;
|
|
90
|
+
sidebar?: boolean;
|
|
91
|
+
[key: string]: any;
|
|
92
|
+
};
|
|
93
|
+
toc: { id: string; depth: number; title: string; _debug_demo?: boolean }[];
|
|
94
|
+
texts: {
|
|
95
|
+
type?: 'content';
|
|
96
|
+
value: string;
|
|
97
|
+
paraId: number;
|
|
98
|
+
tocIndex?: number;
|
|
99
|
+
}[];
|
|
100
|
+
tabs?: {
|
|
101
|
+
key: string;
|
|
102
|
+
title?: string;
|
|
103
|
+
titleIntlId?: string;
|
|
104
|
+
components: {
|
|
105
|
+
default: ReactComponentType;
|
|
106
|
+
Extra: ReactComponentType;
|
|
107
|
+
Action: ReactComponentType;
|
|
108
|
+
};
|
|
109
|
+
meta: {
|
|
110
|
+
frontmatter: Omit<
|
|
111
|
+
IRouteMeta['frontmatter'],
|
|
112
|
+
'description' | 'keywords' | 'nav' | 'group' | 'hero' | 'features'
|
|
113
|
+
>;
|
|
114
|
+
toc: IRouteMeta['toc'];
|
|
115
|
+
texts: IRouteMeta['texts'];
|
|
116
|
+
[key: string]: any;
|
|
117
|
+
};
|
|
118
|
+
}[];
|
|
119
|
+
_atom_route?: boolean;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
type IBasicLocale = { id: string; name: string };
|
|
123
|
+
export type ILocale =
|
|
124
|
+
| (IBasicLocale & { base: string })
|
|
125
|
+
| (IBasicLocale & { suffix: string });
|
|
126
|
+
export type ILocalesConfig = ILocale[];
|
|
127
|
+
export interface INavItem {
|
|
128
|
+
title: string;
|
|
129
|
+
link?: string;
|
|
130
|
+
order?: number;
|
|
131
|
+
activePath?: string;
|
|
132
|
+
[key: string]: any;
|
|
133
|
+
}
|
|
134
|
+
export interface ISidebarItem {
|
|
135
|
+
title: string;
|
|
136
|
+
link: string;
|
|
137
|
+
order?: number;
|
|
138
|
+
frontmatter?: IRouteMeta['frontmatter'];
|
|
139
|
+
[key: string]: any;
|
|
140
|
+
}
|
|
141
|
+
export interface ISidebarGroup {
|
|
142
|
+
title?: string;
|
|
143
|
+
children: ISidebarItem[];
|
|
144
|
+
[key: string]: any;
|
|
145
|
+
}
|
|
146
|
+
export type SocialTypes =
|
|
147
|
+
| 'github'
|
|
148
|
+
| 'weibo'
|
|
149
|
+
| 'twitter'
|
|
150
|
+
| 'x'
|
|
151
|
+
| 'gitlab'
|
|
152
|
+
| 'facebook'
|
|
153
|
+
| 'zhihu'
|
|
154
|
+
| 'yuque'
|
|
155
|
+
| 'linkedin';
|
|
156
|
+
export type INavItems = (INavItem & { children?: INavItem[] })[];
|
|
157
|
+
export type IUserNavItem = Pick<INavItem, 'title' | 'link' | 'activePath'>;
|
|
158
|
+
export type IUserNavMode = 'override' | 'append' | 'prepend';
|
|
159
|
+
export type IUserNavItems = (IUserNavItem & { children?: IUserNavItem[] })[];
|
|
160
|
+
export type IUserNavValue = IUserNavItems | Record<string, IUserNavItems>;
|
|
161
|
+
export type NavWithMode<T extends IUserNavValue> = {
|
|
162
|
+
mode: IUserNavMode;
|
|
163
|
+
value: T;
|
|
164
|
+
};
|
|
165
|
+
export interface IThemeConfig {
|
|
166
|
+
name?: string;
|
|
167
|
+
logo?: string | false;
|
|
168
|
+
nav?: IUserNavValue | NavWithMode<IUserNavValue>;
|
|
169
|
+
sidebar?: Record<string, ISidebarGroup[]>;
|
|
170
|
+
footer?: string | false;
|
|
171
|
+
showLineNum?: boolean;
|
|
172
|
+
prefersColor: {
|
|
173
|
+
default: 'light' | 'dark' | 'auto';
|
|
174
|
+
switch: boolean;
|
|
175
|
+
};
|
|
176
|
+
nprogress?: boolean;
|
|
177
|
+
socialLinks?: { [key in SocialTypes]?: string };
|
|
178
|
+
editLink?: boolean | string;
|
|
179
|
+
sourceLink?: boolean | string;
|
|
180
|
+
lastUpdated?: boolean;
|
|
181
|
+
[key: string]: any;
|
|
182
|
+
}
|
|
183
|
+
export type IRoutesById = Record<
|
|
184
|
+
string,
|
|
185
|
+
{
|
|
186
|
+
path?: string;
|
|
187
|
+
parentId?: string;
|
|
188
|
+
meta?: IRouteMeta;
|
|
189
|
+
id: string;
|
|
190
|
+
redirect?: string;
|
|
191
|
+
[key: string]: any;
|
|
192
|
+
}
|
|
193
|
+
>;
|
|
194
|
+
export type AgnosticComponentModule = { default?: any; [key: string]: any };
|
|
195
|
+
export type AgnosticComponentType =
|
|
196
|
+
| Promise<AgnosticComponentModule>
|
|
197
|
+
| AgnosticComponentModule;
|
|
198
|
+
export type IDemoCompileFn = (
|
|
199
|
+
code: string,
|
|
200
|
+
opts: { filename: string },
|
|
201
|
+
) => Promise<string>;
|
|
202
|
+
export type IDemoCancelableFn = (
|
|
203
|
+
canvas: HTMLElement,
|
|
204
|
+
component: AgnosticComponentModule,
|
|
205
|
+
) => (() => void) | Promise<() => void>;
|
|
206
|
+
export type IDemoPreflightFn = (
|
|
207
|
+
component: AgnosticComponentModule,
|
|
208
|
+
) => Promise<void>;
|
|
209
|
+
export type IDemoData = {
|
|
210
|
+
component: ReactComponentType | AgnosticComponentType;
|
|
211
|
+
asset: IPreviewerProps['asset'];
|
|
212
|
+
routeId: string;
|
|
213
|
+
context?: Record<string, unknown>;
|
|
214
|
+
renderOpts?: {
|
|
215
|
+
compile?: IDemoCompileFn;
|
|
216
|
+
renderer?: IDemoCancelableFn;
|
|
217
|
+
preflight?: IDemoPreflightFn;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
export interface ISiteContext {
|
|
221
|
+
pkg: Record<string, any>;
|
|
222
|
+
historyType: 'browser' | 'hash' | 'memory';
|
|
223
|
+
entryExports: Record<string, any>;
|
|
224
|
+
demos: Record<string, IDemoData>;
|
|
225
|
+
components: Record<string, AtomComponentAsset>;
|
|
226
|
+
locales: ILocalesConfig;
|
|
227
|
+
themeConfig: IThemeConfig;
|
|
228
|
+
hostname?: string;
|
|
229
|
+
loading: boolean;
|
|
230
|
+
setLoading: (status: boolean) => void;
|
|
231
|
+
_2_level_nav_available: boolean;
|
|
232
|
+
[key: string]: any;
|
|
233
|
+
}
|
|
234
|
+
export interface IDumiDemoProps {
|
|
235
|
+
demo: { id: string; inline?: boolean };
|
|
236
|
+
previewerProps: Omit<IPreviewerProps, 'asset' | 'children'>;
|
|
237
|
+
}
|
|
238
|
+
export interface IDumiDemoGridProps {
|
|
239
|
+
items: IDumiDemoProps[];
|
|
240
|
+
demoRender?: (item: IDumiDemoProps) => ReactNode;
|
|
241
|
+
}
|
|
242
|
+
export type IColorValue = 'light' | 'dark';
|
|
243
|
+
export type IPrefersColorValue = IColorValue | 'auto';
|
|
244
|
+
export interface IHighlightText {
|
|
245
|
+
highlighted?: boolean;
|
|
246
|
+
text: string;
|
|
247
|
+
}
|
|
248
|
+
export interface ISearchNavResult {
|
|
249
|
+
title?: string;
|
|
250
|
+
priority: number;
|
|
251
|
+
hints: {
|
|
252
|
+
type: 'page' | 'title' | 'demo' | 'content';
|
|
253
|
+
link: string;
|
|
254
|
+
priority: number;
|
|
255
|
+
pageTitle: string;
|
|
256
|
+
highlightTitleTexts: IHighlightText[];
|
|
257
|
+
highlightTexts: IHighlightText[];
|
|
258
|
+
}[];
|
|
259
|
+
}
|
|
260
|
+
export type ISearchResult = ISearchNavResult[];
|
|
261
|
+
export interface IAtomRendererProps {
|
|
262
|
+
type: AtomAsset['type'];
|
|
263
|
+
value: ExamplePresetAsset['value'];
|
|
264
|
+
processor?: (
|
|
265
|
+
entity: TypeMap['element'] | TypeMap['function'] | TypeMap['dom'],
|
|
266
|
+
entryExports: Record<string, any>,
|
|
267
|
+
) => any;
|
|
268
|
+
}
|
|
269
|
+
export declare const AtomRenderer: FC<IAtomRendererProps>;
|
|
270
|
+
export declare const DumiDemo: FC<IDumiDemoProps>;
|
|
271
|
+
export declare const DumiDemoGrid: FC<IDumiDemoGridProps>;
|
|
272
|
+
export declare const DumiPage: FC<{ children: ReactNode }>;
|
|
273
|
+
export declare const useSiteData: () => ISiteContext;
|
|
274
|
+
export declare const useAtomAssets: () => {
|
|
275
|
+
components: Record<string, AtomComponentAsset>;
|
|
276
|
+
};
|
|
277
|
+
export declare const useLiveDemo: (
|
|
278
|
+
id: string,
|
|
279
|
+
opts?: { containerRef?: RefObject<HTMLElement>; iframe?: boolean },
|
|
280
|
+
) => {
|
|
281
|
+
node: ReactNode;
|
|
282
|
+
loading: boolean;
|
|
283
|
+
error: Error | null;
|
|
284
|
+
setSource: (source: Record<string, string>) => void;
|
|
285
|
+
};
|
|
286
|
+
export declare const useLocale: () => ILocale;
|
|
287
|
+
export declare const useNavData: () => INavItems;
|
|
288
|
+
export declare const usePrefersColor: () => [
|
|
289
|
+
IColorValue,
|
|
290
|
+
IPrefersColorValue,
|
|
291
|
+
(value: IPrefersColorValue) => void,
|
|
292
|
+
];
|
|
293
|
+
export declare const useMatchedRoute: () => IRoutesById[string];
|
|
294
|
+
export declare const useRouteMeta: () => IRouteMeta;
|
|
295
|
+
export declare const useFullSidebarData: () => NonNullable<
|
|
296
|
+
IThemeConfig['sidebar']
|
|
297
|
+
>;
|
|
298
|
+
export declare const useSidebarData: () => ISidebarGroup[];
|
|
299
|
+
export declare const useSiteSearch: () => {
|
|
300
|
+
keywords: string;
|
|
301
|
+
setKeywords: (keywords: string) => void;
|
|
302
|
+
result: ISearchResult;
|
|
303
|
+
loading: boolean;
|
|
304
|
+
load: () => Promise<void>;
|
|
305
|
+
};
|
|
306
|
+
export declare const useTabMeta: () =>
|
|
307
|
+
| NonNullable<IRouteMeta['tabs']>[number]['meta']
|
|
308
|
+
| undefined;
|
|
309
|
+
export declare const openCodeSandbox: (data: IPreviewerProps) => void;
|
|
310
|
+
export declare const openStackBlitz: (data: IPreviewerProps) => void;
|
|
311
|
+
export declare function useDemo(id: string): IDemoData | undefined;
|
|
312
|
+
export declare function getFullDemos(): Promise<Record<string, IDemoData>>;
|
|
313
|
+
export declare function getRouteMetaById<T extends { syncOnly?: boolean }>(
|
|
314
|
+
id: string,
|
|
315
|
+
opts?: T,
|
|
316
|
+
): T extends { syncOnly: true } ? IRouteMeta | undefined : Promise<IRouteMeta>;
|
|
317
|
+
export declare function getFullRoutesMeta(): Promise<
|
|
318
|
+
Record<string, IRouteMeta>
|
|
319
|
+
>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
function _typeof(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
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
4
|
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); }
|
|
5
5
|
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; }
|
|
6
|
-
function _iterableToArrayLimit(
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
-
function ownKeys(
|
|
9
|
-
function _objectSpread(
|
|
8
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10
10
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
-
function _toPropertyKey(
|
|
12
|
-
function _toPrimitive(
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
12
|
+
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); }
|
|
13
13
|
import { useAtomAssets, useIntl, useRouteMeta, useSiteData } from 'dumi';
|
|
14
14
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
15
15
|
import Badge from "../Badge";
|
|
@@ -198,12 +198,12 @@ function getReleaseAndVersionInfo(props) {
|
|
|
198
198
|
schema = _ref6[1];
|
|
199
199
|
var modiferTags = (_schema$tags = schema.tags) === null || _schema$tags === void 0 ? void 0 : _schema$tags.modifierTags;
|
|
200
200
|
var blockTags = (_schema$tags2 = schema.tags) === null || _schema$tags2 === void 0 ? void 0 : _schema$tags2.blockTags;
|
|
201
|
-
modiferTags === null || modiferTags === void 0
|
|
201
|
+
modiferTags === null || modiferTags === void 0 || modiferTags.forEach(function (tag) {
|
|
202
202
|
if (tag === 'alpha' || tag === 'beta' || tag === 'experimental') {
|
|
203
203
|
releaseInfo[prop] = [tag];
|
|
204
204
|
}
|
|
205
205
|
});
|
|
206
|
-
blockTags === null || blockTags === void 0
|
|
206
|
+
blockTags === null || blockTags === void 0 || blockTags.forEach(function (_ref7) {
|
|
207
207
|
var tag = _ref7.tag,
|
|
208
208
|
content = _ref7.content;
|
|
209
209
|
if (tag === 'deprecated' || tag === 'since') {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _typeof(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
import Tabs from "../../slots/Tabs";
|
|
3
3
|
import SourceCode from 'dumi/theme/builtins/SourceCode';
|
|
4
4
|
import toArray from 'rc-util/lib/Children/toArray';
|
|
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
2
2
|
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."); }
|
|
3
3
|
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); }
|
|
4
4
|
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; }
|
|
5
|
-
function _iterableToArrayLimit(
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { ReactComponent as IconSuccess } from '@ant-design/icons-svg/inline-svg/outlined/check-circle.svg';
|
|
8
8
|
import { ReactComponent as IconError } from '@ant-design/icons-svg/inline-svg/outlined/close-circle.svg';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
function _typeof(
|
|
2
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
3
|
import { ReactComponent as IconError } from '@ant-design/icons-svg/inline-svg/filled/close-circle.svg';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
5
|
import { useLiveDemo, useLocation } from 'dumi';
|
|
@@ -3,7 +3,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
3
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
4
|
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); }
|
|
5
5
|
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; }
|
|
6
|
-
function _iterableToArrayLimit(
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
8
|
import { ReactComponent as IconCheck } from '@ant-design/icons-svg/inline-svg/outlined/check.svg';
|
|
9
9
|
import { ReactComponent as IconCopy } from '@ant-design/icons-svg/inline-svg/outlined/copy.svg';
|
|
@@ -3,7 +3,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
3
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
4
|
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); }
|
|
5
5
|
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; }
|
|
6
|
-
function _iterableToArrayLimit(
|
|
6
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
7
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
function _typeof(
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(
|
|
6
|
-
function _toPrimitive(
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
8
|
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."); }
|
|
9
|
-
function _iterableToArrayLimit(
|
|
9
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
12
12
|
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."); }
|
|
@@ -25,33 +25,33 @@ import "./index.less";
|
|
|
25
25
|
function getTreeFromList(nodes) {
|
|
26
26
|
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
27
27
|
var data = [];
|
|
28
|
-
|
|
28
|
+
React.Children.toArray(nodes).forEach(function (node, i) {
|
|
29
|
+
if (! /*#__PURE__*/React.isValidElement(node)) return;
|
|
29
30
|
var key = "".concat(prefix ? "".concat(prefix, "-") : '').concat(i);
|
|
31
|
+
var children = node.props.children;
|
|
30
32
|
switch (node === null || node === void 0 ? void 0 : node.type) {
|
|
31
33
|
case 'ul':
|
|
32
34
|
{
|
|
33
35
|
var _data;
|
|
34
36
|
var parent = ((_data = data[data.length - 1]) === null || _data === void 0 ? void 0 : _data.children) || data;
|
|
35
|
-
var ulLeafs = getTreeFromList(
|
|
37
|
+
var ulLeafs = getTreeFromList(children || [], key);
|
|
36
38
|
parent.push.apply(parent, _toConsumableArray(ulLeafs));
|
|
37
39
|
break;
|
|
38
40
|
}
|
|
39
41
|
case 'li':
|
|
40
42
|
{
|
|
41
|
-
var
|
|
42
|
-
|
|
43
|
-
var _child$props$children;
|
|
44
|
-
return child.type === 'ul' && !((_child$props$children = child.props.children) !== null && _child$props$children !== void 0 && _child$props$children.length);
|
|
43
|
+
var hasEmptyUl = React.Children.toArray(children).some(function (child) {
|
|
44
|
+
return /*#__PURE__*/React.isValidElement(child) && child.type === 'ul' && !React.Children.count(child.props.children);
|
|
45
45
|
});
|
|
46
|
-
var title =
|
|
47
|
-
return child.type !== 'ul';
|
|
46
|
+
var title = React.Children.toArray(children).filter(function (child) {
|
|
47
|
+
return ! /*#__PURE__*/React.isValidElement(child) || child.type !== 'ul';
|
|
48
48
|
});
|
|
49
|
-
var
|
|
49
|
+
var treeChildren = hasEmptyUl ? [] : getTreeFromList(children, key);
|
|
50
50
|
data.push({
|
|
51
51
|
title: title,
|
|
52
52
|
key: key,
|
|
53
|
-
children:
|
|
54
|
-
isLeaf: !hasEmptyUl && !
|
|
53
|
+
children: treeChildren,
|
|
54
|
+
isLeaf: !hasEmptyUl && !treeChildren.length,
|
|
55
55
|
switcherIcon: hasEmptyUl ? /*#__PURE__*/React.createElement("span", {
|
|
56
56
|
className: "tree-switcher-leaf-line"
|
|
57
57
|
}) : undefined
|
|
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
2
2
|
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."); }
|
|
3
3
|
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); }
|
|
4
4
|
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; }
|
|
5
|
-
function _iterableToArrayLimit(
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { ReactComponent as IconSidebar } from '@ant-design/icons-svg/inline-svg/outlined/align-left.svg';
|
|
8
8
|
import animateScrollTo from 'animated-scroll-to';
|
|
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
2
2
|
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."); }
|
|
3
3
|
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); }
|
|
4
4
|
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; }
|
|
5
|
-
function _iterableToArrayLimit(
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { useIntl, usePrefersColor, useSiteData } from 'dumi';
|
|
8
8
|
import React from 'react';
|
|
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
2
2
|
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."); }
|
|
3
3
|
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); }
|
|
4
4
|
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; }
|
|
5
|
-
function _iterableToArrayLimit(
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { ReactComponent as IconLeft } from '@ant-design/icons-svg/inline-svg/outlined/arrow-left.svg';
|
|
8
8
|
import { ReactComponent as IconClock } from '@ant-design/icons-svg/inline-svg/outlined/clock-circle.svg';
|
|
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
2
2
|
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."); }
|
|
3
3
|
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); }
|
|
4
4
|
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; }
|
|
5
|
-
function _iterableToArrayLimit(
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { ReactComponent as IconClose } from '@ant-design/icons-svg/inline-svg/outlined/close.svg';
|
|
8
8
|
import { ReactComponent as IconMenu } from '@ant-design/icons-svg/inline-svg/outlined/menu.svg';
|
|
@@ -27,11 +27,14 @@ var Header = function Header() {
|
|
|
27
27
|
var _useSiteData = useSiteData(),
|
|
28
28
|
themeConfig = _useSiteData.themeConfig;
|
|
29
29
|
var socialIcons = useMemo(function () {
|
|
30
|
-
|
|
30
|
+
var socialLinks = themeConfig.socialLinks;
|
|
31
|
+
return socialLinks ? Object.keys(socialLinks).slice(0, 5).map(function (key) {
|
|
31
32
|
return {
|
|
32
33
|
icon: key,
|
|
33
|
-
link:
|
|
34
|
+
link: socialLinks[key]
|
|
34
35
|
};
|
|
36
|
+
}).filter(function (item) {
|
|
37
|
+
return Boolean(item.link);
|
|
35
38
|
}) : [];
|
|
36
39
|
}, [themeConfig.socialLinks]);
|
|
37
40
|
return /*#__PURE__*/React.createElement("div", {
|