dumi 2.4.27 → 2.4.29

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 (174) hide show
  1. package/compiled/@umijs/plugins/index.js +1 -1
  2. package/compiled/@umijs/plugins/package.json +1 -1
  3. package/compiled/crates/swc_plugin_react_demo.wasm +0 -0
  4. package/dist/client/misc/reactDemoCompiler.js +2 -2
  5. package/dist/client/theme-api/AtomRenderer.js +6 -6
  6. package/dist/client/theme-api/DumiDemo/index.js +1 -1
  7. package/dist/client/theme-api/DumiDemoGrid.js +1 -1
  8. package/dist/client/theme-api/DumiPage.js +1 -1
  9. package/dist/client/theme-api/openCodeSandbox.js +1 -1
  10. package/dist/client/theme-api/openStackBlitz.js +1 -1
  11. package/dist/client/theme-api/useLiveDemo.js +4 -4
  12. package/dist/client/theme-api/useLocale.js +1 -1
  13. package/dist/client/theme-api/useNavData.js +6 -6
  14. package/dist/client/theme-api/usePrefersColor.js +4 -4
  15. package/dist/client/theme-api/useRenderer.js +6 -6
  16. package/dist/client/theme-api/useRouteMeta.js +2 -2
  17. package/dist/client/theme-api/useSidebarData.js +7 -7
  18. package/dist/client/theme-api/useSiteSearch/index.js +1 -1
  19. package/dist/client/theme-api/useSiteSearch/useSearchData.js +7 -7
  20. package/dist/client/theme-api/useTabMeta.js +2 -2
  21. package/dist/client/theme-api/utils.js +4 -4
  22. package/dist/features/compile/index.js +1 -1
  23. package/dist/features/compile/utoopackLoaders.js +4 -4
  24. package/dist/loaders/markdown/index.js +19 -11
  25. package/dist/templates/meta/index.ts.tpl +4 -2
  26. package/package.json +8 -8
  27. package/theme-default/builtins/API/index.js +8 -8
  28. package/theme-default/builtins/CodeGroup/index.js +1 -1
  29. package/theme-default/builtins/Container/index.js +1 -1
  30. package/theme-default/builtins/Previewer/index.js +1 -1
  31. package/theme-default/builtins/SourceCode/index.js +1 -1
  32. package/theme-default/builtins/Table/index.js +1 -1
  33. package/theme-default/builtins/Tree/index.js +7 -7
  34. package/theme-default/layouts/DocLayout/index.js +1 -1
  35. package/theme-default/slots/ColorSwitch/index.js +1 -1
  36. package/theme-default/slots/ContentFooter/index.js +1 -1
  37. package/theme-default/slots/Header/index.js +1 -1
  38. package/theme-default/slots/LangSwitch/index.js +1 -1
  39. package/theme-default/slots/Navbar/index.js +1 -1
  40. package/theme-default/slots/PreviewerActions/index.js +6 -6
  41. package/theme-default/slots/RtlSwitch/index.js +1 -1
  42. package/theme-default/slots/SearchBar/Mask.js +1 -1
  43. package/theme-default/slots/SearchBar/index.js +2 -2
  44. package/theme-default/slots/SearchResult/index.js +3 -3
  45. package/theme-default/slots/SourceCodeEditor/index.js +3 -3
  46. package/theme-default/slots/Toc/index.js +1 -1
  47. package/dist/assetParsers/BaseParser.d.ts +0 -55
  48. package/dist/assetParsers/atom.d.ts +0 -21
  49. package/dist/assetParsers/block.d.ts +0 -25
  50. package/dist/assetParsers/utils.d.ts +0 -79
  51. package/dist/cli.d.ts +0 -1
  52. package/dist/client/misc/reactDemoCompiler.d.ts +0 -3
  53. package/dist/client/pages/404.d.ts +0 -1
  54. package/dist/client/pages/Demo/index.d.ts +0 -4
  55. package/dist/client/pages/Loading.d.ts +0 -1
  56. package/dist/client/theme-api/AtomRenderer.d.ts +0 -13
  57. package/dist/client/theme-api/DumiDemo/DemoErrorBoundary.d.ts +0 -5
  58. package/dist/client/theme-api/DumiDemo/index.d.ts +0 -10
  59. package/dist/client/theme-api/DumiDemoGrid.d.ts +0 -7
  60. package/dist/client/theme-api/DumiPage.d.ts +0 -4
  61. package/dist/client/theme-api/context.d.ts +0 -22
  62. package/dist/client/theme-api/index.d.ts +0 -18
  63. package/dist/client/theme-api/openCodeSandbox.d.ts +0 -9
  64. package/dist/client/theme-api/openStackBlitz.d.ts +0 -1
  65. package/dist/client/theme-api/types.d.ts +0 -258
  66. package/dist/client/theme-api/useAtomAssets.d.ts +0 -4
  67. package/dist/client/theme-api/useLiveDemo.d.ts +0 -10
  68. package/dist/client/theme-api/useLocale.d.ts +0 -2
  69. package/dist/client/theme-api/useNavData.d.ts +0 -5
  70. package/dist/client/theme-api/usePrefersColor.d.ts +0 -7
  71. package/dist/client/theme-api/useRenderer.d.ts +0 -12
  72. package/dist/client/theme-api/useRouteMeta.d.ts +0 -17
  73. package/dist/client/theme-api/useSidebarData.d.ts +0 -29
  74. package/dist/client/theme-api/useSiteSearch/index.d.ts +0 -24
  75. package/dist/client/theme-api/useSiteSearch/useSearchData.d.ts +0 -12
  76. package/dist/client/theme-api/useTabMeta.d.ts +0 -4
  77. package/dist/client/theme-api/utils.d.ts +0 -31
  78. package/dist/constants.d.ts +0 -23
  79. package/dist/features/assets.d.ts +0 -20
  80. package/dist/features/autoAlias.d.ts +0 -3
  81. package/dist/features/compile/babelLoaderCustomize.d.ts +0 -4
  82. package/dist/features/compile/index.d.ts +0 -4
  83. package/dist/features/compile/makoHooks.d.ts +0 -8
  84. package/dist/features/compile/utils.d.ts +0 -2
  85. package/dist/features/compile/utoopackLoaders.d.ts +0 -8
  86. package/dist/features/configPlugins/index.d.ts +0 -3
  87. package/dist/features/configPlugins/schema.d.ts +0 -4
  88. package/dist/features/derivative.d.ts +0 -11
  89. package/dist/features/exportStatic.d.ts +0 -3
  90. package/dist/features/exports.d.ts +0 -3
  91. package/dist/features/html2sketch.d.ts +0 -3
  92. package/dist/features/locales.d.ts +0 -3
  93. package/dist/features/meta.d.ts +0 -5
  94. package/dist/features/parser.d.ts +0 -3
  95. package/dist/features/routes.d.ts +0 -3
  96. package/dist/features/sideEffects/docSideEffectsWebpackPlugin.d.ts +0 -14
  97. package/dist/features/sideEffects/index.d.ts +0 -7
  98. package/dist/features/sitemap.d.ts +0 -3
  99. package/dist/features/tabs.d.ts +0 -17
  100. package/dist/features/theme/index.d.ts +0 -3
  101. package/dist/features/theme/loader.d.ts +0 -55
  102. package/dist/index.d.ts +0 -6
  103. package/dist/loaders/demo/index.d.ts +0 -6
  104. package/dist/loaders/markdown/index.d.ts +0 -27
  105. package/dist/loaders/markdown/transformer/index.d.ts +0 -69
  106. package/dist/loaders/markdown/transformer/rehypeDemo.d.ts +0 -15
  107. package/dist/loaders/markdown/transformer/rehypeDesc.d.ts +0 -6
  108. package/dist/loaders/markdown/transformer/rehypeEnhancedTag.d.ts +0 -3
  109. package/dist/loaders/markdown/transformer/rehypeHighlightLine.d.ts +0 -4
  110. package/dist/loaders/markdown/transformer/rehypeImg.d.ts +0 -6
  111. package/dist/loaders/markdown/transformer/rehypeIsolation.d.ts +0 -7
  112. package/dist/loaders/markdown/transformer/rehypeJsxify.d.ts +0 -2
  113. package/dist/loaders/markdown/transformer/rehypeLink.d.ts +0 -6
  114. package/dist/loaders/markdown/transformer/rehypeRaw.d.ts +0 -6
  115. package/dist/loaders/markdown/transformer/rehypeSlug.d.ts +0 -4
  116. package/dist/loaders/markdown/transformer/rehypeStrip.d.ts +0 -3
  117. package/dist/loaders/markdown/transformer/rehypeText.d.ts +0 -4
  118. package/dist/loaders/markdown/transformer/remarkBreaks.d.ts +0 -3
  119. package/dist/loaders/markdown/transformer/remarkContainer.d.ts +0 -3
  120. package/dist/loaders/markdown/transformer/remarkEmbed.d.ts +0 -4
  121. package/dist/loaders/markdown/transformer/remarkMeta.d.ts +0 -8
  122. package/dist/loaders/null/index.d.ts +0 -2
  123. package/dist/loaders/page/index.d.ts +0 -1
  124. package/dist/loaders/post-raw/index.d.ts +0 -4
  125. package/dist/loaders/pre-raw/index.d.ts +0 -4
  126. package/dist/preset.d.ts +0 -5
  127. package/dist/registerMethods.d.ts +0 -3
  128. package/dist/service/cli.d.ts +0 -5
  129. package/dist/service/constants.d.ts +0 -4
  130. package/dist/service/dev.d.ts +0 -1
  131. package/dist/service/forkedDev.d.ts +0 -1
  132. package/dist/service/printHelp.d.ts +0 -1
  133. package/dist/service/service.d.ts +0 -13
  134. package/dist/techStacks/react.d.ts +0 -7
  135. package/dist/techStacks/utils.d.ts +0 -40
  136. package/dist/types.d.ts +0 -159
  137. package/dist/utils.d.ts +0 -67
  138. package/theme-default/builtins/API/index.d.ts +0 -7
  139. package/theme-default/builtins/Badge/index.d.ts +0 -7
  140. package/theme-default/builtins/CodeGroup/index.d.ts +0 -3
  141. package/theme-default/builtins/Container/index.d.ts +0 -8
  142. package/theme-default/builtins/Previewer/index.d.ts +0 -5
  143. package/theme-default/builtins/SourceCode/index.d.ts +0 -14
  144. package/theme-default/builtins/Table/index.d.ts +0 -6
  145. package/theme-default/builtins/Tree/index.d.ts +0 -5
  146. package/theme-default/layouts/DocLayout/index.d.ts +0 -4
  147. package/theme-default/slots/ColorSwitch/index.d.ts +0 -4
  148. package/theme-default/slots/Content/index.d.ts +0 -7
  149. package/theme-default/slots/ContentFooter/index.d.ts +0 -4
  150. package/theme-default/slots/ContentTabs/index.d.ts +0 -11
  151. package/theme-default/slots/Features/index.d.ts +0 -4
  152. package/theme-default/slots/Footer/index.d.ts +0 -4
  153. package/theme-default/slots/Header/index.d.ts +0 -4
  154. package/theme-default/slots/HeaderExtra/index.d.ts +0 -3
  155. package/theme-default/slots/Hero/index.d.ts +0 -4
  156. package/theme-default/slots/HeroTitle/index.d.ts +0 -6
  157. package/theme-default/slots/LangSwitch/index.d.ts +0 -4
  158. package/theme-default/slots/Loading/index.d.ts +0 -5
  159. package/theme-default/slots/Logo/index.d.ts +0 -4
  160. package/theme-default/slots/Navbar/index.d.ts +0 -4
  161. package/theme-default/slots/NavbarExtra/index.d.ts +0 -3
  162. package/theme-default/slots/NotFound/index.d.ts +0 -4
  163. package/theme-default/slots/PreviewerActions/index.d.ts +0 -27
  164. package/theme-default/slots/PreviewerActionsExtra/index.d.ts +0 -4
  165. package/theme-default/slots/RtlSwitch/index.d.ts +0 -4
  166. package/theme-default/slots/SearchBar/Input.d.ts +0 -6
  167. package/theme-default/slots/SearchBar/Mask.d.ts +0 -9
  168. package/theme-default/slots/SearchBar/index.d.ts +0 -6
  169. package/theme-default/slots/SearchResult/index.d.ts +0 -10
  170. package/theme-default/slots/Sidebar/index.d.ts +0 -4
  171. package/theme-default/slots/SocialIcon/index.d.ts +0 -13
  172. package/theme-default/slots/SourceCodeEditor/index.d.ts +0 -19
  173. package/theme-default/slots/Tabs/index.d.ts +0 -6
  174. package/theme-default/slots/Toc/index.d.ts +0 -4
@@ -1,258 +0,0 @@
1
- import type { ExampleBlockAsset } from 'dumi-assets-types';
2
- import type { ComponentType as ReactComponentType, ReactNode } from 'react';
3
- export interface IPreviewerProps {
4
- /**
5
- * title of current demo
6
- */
7
- title?: string;
8
- /**
9
- * description of current demo
10
- */
11
- description?: string;
12
- /**
13
- * filename of current demo
14
- */
15
- filename?: string;
16
- /**
17
- * use iframe to render demo
18
- */
19
- iframe?: boolean | number;
20
- /**
21
- * debug mark (will only render in dev by default)
22
- */
23
- debug?: boolean;
24
- /**
25
- * display the source code or not by default
26
- */
27
- defaultShowCode?: boolean;
28
- /**
29
- * url for render current demo in a single page
30
- */
31
- demoUrl: string;
32
- /**
33
- * disable demo content padding
34
- */
35
- compact?: boolean;
36
- /**
37
- * add transform property for handle absolute/fixed position element
38
- */
39
- transform?: boolean;
40
- /**
41
- * background color for demo content
42
- */
43
- background?: string;
44
- /**
45
- * asset metadata of current demo
46
- */
47
- asset: ExampleBlockAsset;
48
- /**
49
- * react node of current demo
50
- */
51
- children: ReactNode;
52
- /**
53
- * private field, do not use it in your code
54
- */
55
- _live_in_iframe: boolean;
56
- [key: string]: any;
57
- }
58
- export interface IRouteMeta {
59
- frontmatter: {
60
- title: string;
61
- description?: string;
62
- keywords?: string[];
63
- nav?: string | {
64
- title?: string;
65
- order?: number;
66
- second?: Omit<IRouteMeta['frontmatter']['nav'], 'second'>;
67
- };
68
- group?: string | {
69
- title?: string;
70
- order?: number;
71
- };
72
- order?: number;
73
- hero?: {
74
- title?: string;
75
- description?: string;
76
- background?: string;
77
- actions?: {
78
- text: string;
79
- link: string;
80
- }[];
81
- [key: string]: any;
82
- };
83
- features?: {
84
- emoji?: string;
85
- title?: string;
86
- link?: string;
87
- description?: string;
88
- [key: string]: any;
89
- }[];
90
- toc?: boolean | 'content' | 'menu';
91
- demo?: {
92
- cols?: number;
93
- tocDepth?: number;
94
- };
95
- atomId?: string;
96
- filename?: string;
97
- lastUpdated?: number;
98
- debug?: boolean;
99
- /**
100
- * Control the display of the sidebar menu.
101
- * @default true
102
- */
103
- sidebar?: boolean;
104
- [key: string]: any;
105
- };
106
- toc: {
107
- id: string;
108
- depth: number;
109
- title: string;
110
- /**
111
- * private field, do not use it in your code
112
- */
113
- _debug_demo?: boolean;
114
- }[];
115
- texts: {
116
- type?: 'content';
117
- value: string;
118
- /**
119
- * paragraph index
120
- */
121
- paraId: number;
122
- /**
123
- * title index in toc
124
- */
125
- tocIndex?: number;
126
- }[];
127
- tabs?: {
128
- key: string;
129
- title?: string;
130
- titleIntlId?: string;
131
- components: {
132
- default: ReactComponentType;
133
- Extra: ReactComponentType;
134
- Action: ReactComponentType;
135
- };
136
- meta: {
137
- frontmatter: Omit<IRouteMeta['frontmatter'], 'description' | 'keywords' | 'nav' | 'group' | 'hero' | 'features'>;
138
- toc: IRouteMeta['toc'];
139
- texts: IRouteMeta['texts'];
140
- [key: string]: any;
141
- };
142
- }[];
143
- /**
144
- * private field, do not use it in your code
145
- */
146
- _atom_route?: boolean;
147
- }
148
- type IBasicLocale = {
149
- id: string;
150
- name: string;
151
- };
152
- export type ILocale = (IBasicLocale & {
153
- base: string;
154
- }) | (IBasicLocale & {
155
- suffix: string;
156
- });
157
- export type ILocalesConfig = ILocale[];
158
- export interface INavItem {
159
- title: string;
160
- link?: string;
161
- order?: number;
162
- activePath?: string;
163
- [key: string]: any;
164
- }
165
- export interface ISidebarItem {
166
- title: string;
167
- link: string;
168
- order?: number;
169
- frontmatter?: IRouteMeta['frontmatter'];
170
- [key: string]: any;
171
- }
172
- export interface ISidebarGroup {
173
- title?: string;
174
- children: ISidebarItem[];
175
- [key: string]: any;
176
- }
177
- export type SocialTypes = 'github' | 'weibo' | 'twitter' | 'x' | 'gitlab' | 'facebook' | 'zhihu' | 'yuque' | 'linkedin';
178
- export type INavItems = (INavItem & {
179
- children?: INavItem[];
180
- })[];
181
- export type INav = INavItems | Record<string, INavItems>;
182
- type IUserNavItem = Pick<INavItem, 'title' | 'link' | 'activePath'>;
183
- export type IUserNavMode = 'override' | 'append' | 'prepend';
184
- export type IUserNavItems = (IUserNavItem & {
185
- children?: IUserNavItem[];
186
- })[];
187
- export type IUserNavValue = IUserNavItems | Record<string, IUserNavItems>;
188
- export type NavWithMode<T extends IUserNavValue> = {
189
- /**
190
- * 扩展导航的模式
191
- * @description
192
- * - 'override': 用 value 中配置的导航直接覆盖约定路由的导航
193
- * - 'append': 将 value 中配置的导航追加到约定路由导航后面
194
- * - 'prepend': 将 value 中配置的导航添加到约定路由导航前面
195
- */
196
- mode: IUserNavMode;
197
- value: T;
198
- };
199
- export interface IThemeConfig {
200
- name?: string;
201
- logo?: string | false;
202
- nav?: IUserNavValue | NavWithMode<IUserNavValue>;
203
- sidebar?: Record<string, ISidebarGroup[]>;
204
- footer?: string | false;
205
- showLineNum?: boolean;
206
- prefersColor: {
207
- default: 'light' | 'dark' | 'auto';
208
- switch: boolean;
209
- };
210
- nprogress?: boolean;
211
- socialLinks?: {
212
- [key in SocialTypes]?: string;
213
- };
214
- editLink?: boolean | string;
215
- sourceLink?: boolean | string;
216
- lastUpdated?: boolean;
217
- [key: string]: any;
218
- }
219
- export type IRoutesById = Record<string, {
220
- path?: string;
221
- parentId?: string;
222
- meta?: IRouteMeta;
223
- id: string;
224
- redirect?: string;
225
- [key: string]: any;
226
- }>;
227
- export type AgnosticComponentModule = {
228
- default?: any;
229
- [key: string]: any;
230
- };
231
- export type AgnosticComponentType = Promise<AgnosticComponentModule> | AgnosticComponentModule;
232
- export type IDemoCompileFn = (code: string, opts: {
233
- filename: string;
234
- }) => Promise<string>;
235
- export type IDemoCancelableFn = (canvas: HTMLElement, component: AgnosticComponentModule) => (() => void) | Promise<() => void>;
236
- export type IDemoPreflightFn = (component: AgnosticComponentModule) => Promise<void>;
237
- export type IDemoData = {
238
- component: ReactComponentType | AgnosticComponentType;
239
- asset: IPreviewerProps['asset'];
240
- routeId: string;
241
- context?: Record<string, unknown>;
242
- renderOpts?: {
243
- /**
244
- * provide a runtime compile function for compile demo code for live preview
245
- */
246
- compile?: IDemoCompileFn;
247
- /**
248
- * Component rendering function, used to manage the creation and unmount of components
249
- */
250
- renderer?: IDemoCancelableFn;
251
- /**
252
- * Used to detect initialization errors of components in advance
253
- * (if there is an error, the component will not be mounted)
254
- */
255
- preflight?: IDemoPreflightFn;
256
- };
257
- };
258
- export {};
@@ -1,4 +0,0 @@
1
- import { AtomComponentAsset } from 'dumi-assets-types';
2
- export declare const useAtomAssets: () => {
3
- components: Record<string, AtomComponentAsset>;
4
- };
@@ -1,10 +0,0 @@
1
- import { type ReactNode, type RefObject } from 'react';
2
- export declare const useLiveDemo: (id: string, opts?: {
3
- containerRef?: RefObject<HTMLElement>;
4
- iframe?: boolean;
5
- }) => {
6
- node: ReactNode;
7
- loading: boolean;
8
- error: Error | null;
9
- setSource: (source: Record<string, string>) => Promise<void>;
10
- };
@@ -1,2 +0,0 @@
1
- import type { ILocale } from './types';
2
- export declare const useLocale: () => ILocale;
@@ -1,5 +0,0 @@
1
- import type { INavItems } from './types';
2
- /**
3
- * hook for get nav data
4
- */
5
- export declare const useNavData: () => INavItems;
@@ -1,7 +0,0 @@
1
- export type IColorValue = 'light' | 'dark';
2
- export type IPrefersColorValue = IColorValue | 'auto';
3
- /**
4
- * hook for get/set prefers-color-schema, use to control color mode for theme package
5
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
6
- */
7
- export declare const usePrefersColor: () => [IColorValue, IPrefersColorValue, (val: IPrefersColorValue) => void];
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import type { AgnosticComponentType, IDemoData } from './types';
3
- export interface UseRendererOptions {
4
- id: string;
5
- component?: AgnosticComponentType;
6
- renderOpts: IDemoData['renderOpts'];
7
- onResolved?: () => void;
8
- }
9
- export declare const useRenderer: ({ id, component, renderOpts, onResolved, }: UseRendererOptions) => {
10
- canvasRef: import("react").RefObject<HTMLDivElement>;
11
- setComponent: import("react").Dispatch<import("react").SetStateAction<AgnosticComponentType | null>>;
12
- };
@@ -1,17 +0,0 @@
1
- import type { IRouteMeta } from './types';
2
- /**
3
- * hook for get matched route
4
- * @internal internal use. Do not use in your production code.
5
- */
6
- export declare const useMatchedRoute: () => {
7
- [key: string]: any;
8
- path?: string | undefined;
9
- parentId?: string | undefined;
10
- meta?: IRouteMeta | undefined;
11
- id: string;
12
- redirect?: string | undefined;
13
- };
14
- /**
15
- * hook for get matched route meta
16
- */
17
- export declare const useRouteMeta: () => IRouteMeta;
@@ -1,29 +0,0 @@
1
- import type { ILocalesConfig, IRouteMeta, ISidebarGroup } from './types';
2
- export declare const getLocaleClearPath: (routePath: string, locale: ILocalesConfig[0]) => string;
3
- /**
4
- * get parent path from route path
5
- */
6
- export declare function getRouteParentPath(path: string, { meta, is2LevelNav, locale, }: {
7
- meta?: IRouteMeta;
8
- is2LevelNav: boolean;
9
- locale: ILocalesConfig[0];
10
- }): string;
11
- /**
12
- * hook for get sidebar data for all nav
13
- */
14
- export declare const useFullSidebarData: () => Record<string, ISidebarGroup[]>;
15
- interface ITreeSidebarLeaf {
16
- path: string;
17
- title: string;
18
- order: number;
19
- children: (ITreeSidebarLeaf | ISidebarGroup)[];
20
- }
21
- /**
22
- * hook for get full sidebar data in tree structure
23
- */
24
- export declare const useTreeSidebarData: () => ITreeSidebarLeaf[];
25
- /**
26
- * hook for get sidebar data for current nav
27
- */
28
- export declare const useSidebarData: () => ISidebarGroup[];
29
- export {};
@@ -1,24 +0,0 @@
1
- export interface IHighlightText {
2
- highlighted?: boolean;
3
- text: string;
4
- }
5
- export interface ISearchNavResult {
6
- title?: string;
7
- priority: number;
8
- hints: {
9
- type: 'page' | 'title' | 'demo' | 'content';
10
- link: string;
11
- priority: number;
12
- pageTitle: string;
13
- highlightTitleTexts: IHighlightText[];
14
- highlightTexts: IHighlightText[];
15
- }[];
16
- }
17
- export type ISearchResult = ISearchNavResult[];
18
- export declare const useSiteSearch: () => {
19
- keywords: string;
20
- setKeywords: (val: string) => void;
21
- result: ISearchResult;
22
- loading: boolean;
23
- load: () => Promise<void>;
24
- };
@@ -1,12 +0,0 @@
1
- import { getFullDemos } from 'dumi';
2
- import { useLocaleDocRoutes } from '../utils';
3
- type IDemosData = Record<string, Partial<Awaited<ReturnType<typeof getFullDemos>>[string]>>;
4
- type ISearchData = [
5
- routes: ReturnType<typeof useLocaleDocRoutes>,
6
- demos: IDemosData
7
- ];
8
- export default function useSearchData(): [
9
- ISearchData | null,
10
- () => Promise<void>
11
- ];
12
- export {};
@@ -1,4 +0,0 @@
1
- import type { IRouteMeta } from './types';
2
- export declare const TAB_QUERY_KEY = "tab";
3
- export declare const useTabQueryState: () => [string | null, (val?: string) => void];
4
- export declare const useTabMeta: () => NonNullable<IRouteMeta['tabs']>[0]['meta'] | undefined;
@@ -1,31 +0,0 @@
1
- import { PluginManager } from 'dumi';
2
- import { useLayoutEffect } from 'react';
3
- import type { AgnosticComponentModule, IDemoData, ILocale, INav, INavItem, IRouteMeta, IRoutesById, IUserNavValue } from './types';
4
- /**
5
- * private instance, do not use it in your code
6
- */
7
- export declare let pluginManager: PluginManager;
8
- export declare const setPluginManager: (pm: PluginManager) => void;
9
- export declare const useLocaleDocRoutes: () => IRoutesById;
10
- /**
11
- * 在 react 18 中需要新的 render 方式,这个函数用来处理不同的 jsx 模式。
12
- * @param version react version
13
- * @returns code string
14
- */
15
- export declare const genReactRenderCode: (version: string) => string;
16
- export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
17
- /**
18
- * common comparer for sidebar/nav items
19
- */
20
- export declare const useRouteDataComparer: <T extends {
21
- order?: number | undefined;
22
- link?: string | undefined;
23
- path?: string | undefined;
24
- title?: string | undefined;
25
- }>() => (a: T, b: T) => number;
26
- /**
27
- * common util for pick meta to sort sidebar/nav items
28
- */
29
- export declare const pickRouteSortMeta: (original: Partial<Pick<INavItem, 'order' | 'title'>>, field: 'nav' | 'nav.second' | 'group', fm: IRouteMeta['frontmatter']) => Partial<Pick<INavItem, "title" | "order">>;
30
- export declare function getLocaleNav(nav: IUserNavValue | INav, locale: ILocale): import("./types").IUserNavItems;
31
- export declare function getAgnosticComponentModule(component: IDemoData['component']): Promise<AgnosticComponentModule>;
@@ -1,23 +0,0 @@
1
- export declare const LOCAL_DUMI_DIR = ".dumi";
2
- export declare const LOCAL_THEME_DIR: string;
3
- export declare const LOCAL_PAGES_DIR: string;
4
- export declare const THEME_PREFIX = "dumi-theme-";
5
- export declare const SP_ROUTE_PREFIX = "~";
6
- export declare const PREFERS_COLOR_ATTR = "data-prefers-color";
7
- export declare const PREFERS_COLOR_LS_KEY = "dumi:prefers-color";
8
- export declare const PICKED_PKG_FIELDS: {
9
- name: string;
10
- description: string;
11
- version: string;
12
- license: string;
13
- repository: string;
14
- author: string;
15
- authors: string;
16
- };
17
- export declare const USELESS_TMP_FILES: string[];
18
- export declare const VERSION_2_LEVEL_NAV = "^2.2.0";
19
- export declare const VERSION_2_DEPRECATE_SOFT_BREAKS = "^2.2.0";
20
- export declare const DEFAULT_DEMO_MODULE_EXTENSIONS: string[];
21
- export declare const DEFAULT_DEMO_PLAIN_TEXT_EXTENSIONS: string[];
22
- export declare const FS_CACHE_DIR = "node_modules/.cache/dumi";
23
- export declare const SHOULD_SKIP_LIVEDEMO_ERROR: string[];
@@ -1,20 +0,0 @@
1
- import type { IApi } from "../types";
2
- import type { AtomAsset, ExampleAsset } from 'dumi-assets-types';
3
- declare const examples: ExampleAsset[];
4
- /**
5
- * internal function to add example assets
6
- */
7
- export declare function addExampleAssets(data: typeof examples): void;
8
- /**
9
- * internal function to get atom assets
10
- */
11
- export declare function getExampleAssets(): ExampleAsset[];
12
- /**
13
- * internal function to add meta for atom
14
- */
15
- export declare function addAtomMeta(atomId: string, data: Partial<AtomAsset>): void;
16
- /**
17
- * plugin for generate assets.json
18
- */
19
- declare const _default: (api: IApi) => void;
20
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { IApi } from "../types";
2
- declare const _default: (api: IApi) => void;
3
- export default _default;
@@ -1,4 +0,0 @@
1
- import type { PartialConfig } from '@umijs/bundler-utils/compiled/@babel/core';
2
- export default function babelLoaderCustomize(): {
3
- config(config: PartialConfig): import("@umijs/bundler-utils/compiled/@babel/core").TransformOptions;
4
- };
@@ -1,4 +0,0 @@
1
- import type { IApi, IDumiTechStack } from "../../types";
2
- export declare const techStacks: IDumiTechStack[];
3
- declare const _default: (api: IApi) => void;
4
- export default _default;
@@ -1,8 +0,0 @@
1
- import type { IApi } from "../../types";
2
- export declare const getLoadHook: (api: IApi) => (filePath: string) => Promise<{
3
- content: Buffer | null;
4
- type: "css" | "js" | "jsx";
5
- } | {
6
- content: string;
7
- type: string;
8
- } | undefined>;
@@ -1,2 +0,0 @@
1
- import { IApi } from 'umi';
2
- export declare const shouldDisabledLiveDemo: (api: IApi) => boolean;
@@ -1,8 +0,0 @@
1
- import type { IApi, IDumiTechStack } from "../../types";
2
- export declare const UTOOPACK_LOADER_CTX_KEY = "__dumiLoaderContextPath";
3
- export declare const LOADER_CTX_FILENAME = "dumi-loader-ctx.cjs";
4
- export declare function buildLoaderContextContent(techStacks: IDumiTechStack[], builtins?: Record<string, {
5
- specifier: string;
6
- source: string;
7
- }>, routes?: Record<string, unknown>): string;
8
- export declare const getUtoopackRules: (api: IApi) => Record<string, unknown>;
@@ -1,3 +0,0 @@
1
- import type { IApi } from "../../types";
2
- declare const _default: (api: IApi) => void;
3
- export default _default;
@@ -1,4 +0,0 @@
1
- import type { IApi } from 'umi';
2
- type JoiRoot = Parameters<NonNullable<NonNullable<Parameters<IApi['describe']>[0]['config']>['schema']>>[0];
3
- export declare function getSchemas(): Record<string, (Joi: JoiRoot) => any>;
4
- export {};
@@ -1,11 +0,0 @@
1
- import type { IApi } from "../types";
2
- /**
3
- * exclude pre-compiling modules in mfsu mode
4
- * and make sure there has no multiple instances problem (such as react)
5
- */
6
- export declare function safeExcludeInMFSU(api: IApi, excludes: RegExp[]): void;
7
- /**
8
- * plugin for derive default behaviors from umi
9
- */
10
- declare const _default: (api: IApi) => void;
11
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { IApi } from "../types";
2
- declare const _default: (api: IApi) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { IApi } from "../types";
2
- declare const _default: (api: IApi) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { IApi } from '../types';
2
- declare const _default: (api: IApi) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { IApi } from "../types";
2
- declare const _default: (api: IApi) => void;
3
- export default _default;
@@ -1,5 +0,0 @@
1
- import type { IApi } from "../types";
2
- export declare const TABS_META_PATH = "dumi/meta/tabs.ts";
3
- export declare const ATOMS_META_PATH = "dumi/meta/atoms.ts";
4
- declare const _default: (api: IApi) => void;
5
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { IApi } from "../types";
2
- declare const _default: (api: IApi) => void;
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { IApi } from "../types";
2
- declare const _default: (api: IApi) => void;
3
- export default _default;
@@ -1,14 +0,0 @@
1
- import type { webpack } from 'umi';
2
- interface IOpts {
3
- sideEffects: string[];
4
- pkgPath: string;
5
- }
6
- /**
7
- * webpack plugin for add extra sideEffects item if user configured sideEffects in package.json
8
- */
9
- export default class docSideEffectsWebpackPlugin {
10
- opts: IOpts;
11
- constructor(opts: IOpts);
12
- apply(compiler: webpack.Compiler): void;
13
- }
14
- export {};
@@ -1,7 +0,0 @@
1
- import type { IApi } from 'umi';
2
- /**
3
- * plugin for register the doc side-effects webpack plugin
4
- * to avoid tree-shaking for .umi & .dumi/theme directory if package.json has sideEffects: false
5
- */
6
- declare const _default: (api: IApi) => void;
7
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { IApi } from "../types";
2
- declare const _default: (api: IApi) => void;
3
- export default _default;
@@ -1,17 +0,0 @@
1
- import type { IApi } from "../types";
2
- export interface IContentTab {
3
- key: string;
4
- id?: string;
5
- test?: RegExp;
6
- title?: string;
7
- titleIntlId?: string;
8
- component: string;
9
- }
10
- export declare function isTabRouteFile(file: string): boolean;
11
- export declare function getTabKeyFromFile(file: string): string;
12
- export declare function getHostForTabRouteFile(file: string): string;
13
- /**
14
- * plugin for add conventional tab and plugin tab into page content
15
- */
16
- declare const _default: (api: IApi) => void;
17
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { IApi } from "../../types";
2
- declare const _default: (api: IApi) => void;
3
- export default _default;