dumi-theme-lobehub 1.0.0
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 +162 -0
- package/dist/builtins/Container/index.d.ts +7 -0
- package/dist/builtins/Container/index.js +28 -0
- package/dist/builtins/Container/style.d.ts +5 -0
- package/dist/builtins/Container/style.js +27 -0
- package/dist/builtins/Features/index.d.ts +2 -0
- package/dist/builtins/Features/index.js +19 -0
- package/dist/builtins/Previewer/index.d.ts +8 -0
- package/dist/builtins/Previewer/index.js +26 -0
- package/dist/builtins/Previewer/style.d.ts +9 -0
- package/dist/builtins/Previewer/style.js +18 -0
- package/dist/builtins/SourceCode/index.d.ts +7 -0
- package/dist/builtins/SourceCode/index.js +17 -0
- package/dist/components/ApiHeader/index.d.ts +77 -0
- package/dist/components/ApiHeader/index.js +124 -0
- package/dist/components/ApiHeader/style.d.ts +7 -0
- package/dist/components/ApiHeader/style.js +16 -0
- package/dist/components/Favicons/index.d.ts +3 -0
- package/dist/components/Favicons/index.js +43 -0
- package/dist/components/NativeSelect/SelectItem/index.d.ts +12 -0
- package/dist/components/NativeSelect/SelectItem/index.js +37 -0
- package/dist/components/NativeSelect/SelectItem/style.d.ts +5 -0
- package/dist/components/NativeSelect/SelectItem/style.js +13 -0
- package/dist/components/NativeSelect/index.d.ts +17 -0
- package/dist/components/NativeSelect/index.js +248 -0
- package/dist/components/NativeSelect/style.d.ts +4 -0
- package/dist/components/NativeSelect/style.js +13 -0
- package/dist/components/StoreUpdater/index.d.ts +1 -0
- package/dist/components/StoreUpdater/index.js +91 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.js +3 -0
- package/dist/hooks/useCopied.d.ts +4 -0
- package/dist/hooks/useCopied.js +31 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/layouts/DemoLayout/index.d.ts +3 -0
- package/dist/layouts/DemoLayout/index.js +21 -0
- package/dist/layouts/DocLayout/GlobalStyle.d.ts +3 -0
- package/dist/layouts/DocLayout/GlobalStyle.js +8 -0
- package/dist/layouts/DocLayout/index.d.ts +3 -0
- package/dist/layouts/DocLayout/index.js +130 -0
- package/dist/pages/Changelog/index.d.ts +3 -0
- package/dist/pages/Changelog/index.js +58 -0
- package/dist/pages/Docs/index.d.ts +3 -0
- package/dist/pages/Docs/index.js +52 -0
- package/dist/pages/Docs/styles.d.ts +5 -0
- package/dist/pages/Docs/styles.js +14 -0
- package/dist/pages/Home/index.d.ts +3 -0
- package/dist/pages/Home/index.js +20 -0
- package/dist/plugin/index.d.ts +3 -0
- package/dist/plugin/index.js +77 -0
- package/dist/plugin/utils.d.ts +1 -0
- package/dist/plugin/utils.js +30 -0
- package/dist/slots/ApiHeader/BundlephobiaFilled.d.ts +3 -0
- package/dist/slots/ApiHeader/BundlephobiaFilled.js +15 -0
- package/dist/slots/ApiHeader/Graph.d.ts +3 -0
- package/dist/slots/ApiHeader/Graph.js +14 -0
- package/dist/slots/ApiHeader/NpmFilled.d.ts +3 -0
- package/dist/slots/ApiHeader/NpmFilled.js +16 -0
- package/dist/slots/ApiHeader/PackagePhobia.d.ts +3 -0
- package/dist/slots/ApiHeader/PackagePhobia.js +27 -0
- package/dist/slots/ApiHeader/Unpkg.d.ts +3 -0
- package/dist/slots/ApiHeader/Unpkg.js +14 -0
- package/dist/slots/ApiHeader/index.d.ts +3 -0
- package/dist/slots/ApiHeader/index.js +53 -0
- package/dist/slots/Content/index.d.ts +4 -0
- package/dist/slots/Content/index.js +49 -0
- package/dist/slots/Content/style.d.ts +3 -0
- package/dist/slots/Content/style.js +12 -0
- package/dist/slots/ContentFooter/Linker.d.ts +8 -0
- package/dist/slots/ContentFooter/Linker.js +65 -0
- package/dist/slots/ContentFooter/Linker.style.d.ts +6 -0
- package/dist/slots/ContentFooter/Linker.style.js +13 -0
- package/dist/slots/ContentFooter/index.d.ts +3 -0
- package/dist/slots/ContentFooter/index.js +35 -0
- package/dist/slots/ContentTabs/index.d.ts +10 -0
- package/dist/slots/ContentTabs/index.js +49 -0
- package/dist/slots/ContentTabs/style.d.ts +3 -0
- package/dist/slots/ContentTabs/style.js +13 -0
- package/dist/slots/Features/index.d.ts +3 -0
- package/dist/slots/Features/index.js +19 -0
- package/dist/slots/Footer/columns.d.ts +6 -0
- package/dist/slots/Footer/columns.js +81 -0
- package/dist/slots/Footer/index.d.ts +3 -0
- package/dist/slots/Footer/index.js +56 -0
- package/dist/slots/Footer/style.d.ts +4 -0
- package/dist/slots/Footer/style.js +13 -0
- package/dist/slots/Header/Burger.d.ts +3 -0
- package/dist/slots/Header/Burger.js +72 -0
- package/dist/slots/Header/GithubButton.d.ts +3 -0
- package/dist/slots/Header/GithubButton.js +18 -0
- package/dist/slots/Header/LangSwitch.d.ts +3 -0
- package/dist/slots/Header/LangSwitch.js +133 -0
- package/dist/slots/Header/ThemeSwitch.d.ts +3 -0
- package/dist/slots/Header/ThemeSwitch.js +18 -0
- package/dist/slots/Header/index.d.ts +3 -0
- package/dist/slots/Header/index.js +30 -0
- package/dist/slots/Hero/index.d.ts +3 -0
- package/dist/slots/Hero/index.js +15 -0
- package/dist/slots/Logo/index.d.ts +3 -0
- package/dist/slots/Logo/index.js +38 -0
- package/dist/slots/Logo/style.d.ts +1 -0
- package/dist/slots/Logo/style.js +9 -0
- package/dist/slots/Navbar/index.d.ts +3 -0
- package/dist/slots/Navbar/index.js +55 -0
- package/dist/slots/PreviewerActions/index.d.ts +13 -0
- package/dist/slots/PreviewerActions/index.js +109 -0
- package/dist/slots/PreviewerActions/style.d.ts +4 -0
- package/dist/slots/PreviewerActions/style.js +11 -0
- package/dist/slots/SearchBar/index.d.ts +3 -0
- package/dist/slots/SearchBar/index.js +51 -0
- package/dist/slots/SearchBar/style.d.ts +7 -0
- package/dist/slots/SearchBar/style.js +16 -0
- package/dist/slots/Sidebar/index.d.ts +3 -0
- package/dist/slots/Sidebar/index.js +35 -0
- package/dist/slots/Sidebar/style.d.ts +4 -0
- package/dist/slots/Sidebar/style.js +11 -0
- package/dist/slots/Toc/index.d.ts +3 -0
- package/dist/slots/Toc/index.js +46 -0
- package/dist/store/index.d.ts +17 -0
- package/dist/store/index.js +19 -0
- package/dist/store/selectors/apiHeader.d.ts +5 -0
- package/dist/store/selectors/apiHeader.js +62 -0
- package/dist/store/selectors/hero.d.ts +22 -0
- package/dist/store/selectors/hero.js +59 -0
- package/dist/store/selectors/index.d.ts +23 -0
- package/dist/store/selectors/index.js +71 -0
- package/dist/store/selectors/siteBasicInfo.d.ts +6 -0
- package/dist/store/selectors/siteBasicInfo.js +14 -0
- package/dist/store/selectors/token.d.ts +2 -0
- package/dist/store/selectors/token.js +5 -0
- package/dist/store/useSiteStore.d.ts +36 -0
- package/dist/store/useSiteStore.js +48 -0
- package/dist/store/useThemeStore.d.ts +20 -0
- package/dist/store/useThemeStore.js +9 -0
- package/dist/styles/customToken.d.ts +10 -0
- package/dist/styles/customToken.js +10 -0
- package/dist/types/config.d.ts +101 -0
- package/dist/types/config.js +1 -0
- package/dist/types/global.d.ts +16 -0
- package/dist/types/hero.d.ts +8 -0
- package/dist/types/hero.js +1 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/index.js +7 -0
- package/package.json +119 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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
|
+
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
|
+
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(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { Toc as T } from '@lobehub/ui';
|
|
8
|
+
import { useResponsive, useTheme } from 'antd-style';
|
|
9
|
+
import isEqual from 'fast-deep-equal';
|
|
10
|
+
import { memo, useEffect, useState } from 'react';
|
|
11
|
+
import { tocAnchorItemSel, useSiteStore } from "../../store";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
var GAP = 48;
|
|
16
|
+
var Toc = /*#__PURE__*/memo(function () {
|
|
17
|
+
var items = useSiteStore(tocAnchorItemSel, isEqual);
|
|
18
|
+
var _useResponsive = useResponsive(),
|
|
19
|
+
mobile = _useResponsive.mobile;
|
|
20
|
+
var theme = useTheme();
|
|
21
|
+
var _useState = useState(GAP),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
spacing = _useState2[0],
|
|
24
|
+
setSpacing = _useState2[1];
|
|
25
|
+
useEffect(function () {
|
|
26
|
+
var ApiTitle = document.querySelector('#api-header');
|
|
27
|
+
if (ApiTitle) setSpacing(ApiTitle.clientHeight + GAP);
|
|
28
|
+
}, [window.location.href, items]);
|
|
29
|
+
if ((items === null || items === void 0 ? void 0 : items.length) < 1) return;
|
|
30
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
31
|
+
children: [!mobile && /*#__PURE__*/_jsx("div", {
|
|
32
|
+
style: {
|
|
33
|
+
height: spacing
|
|
34
|
+
}
|
|
35
|
+
}), /*#__PURE__*/_jsx(T, {
|
|
36
|
+
getContainer: function getContainer() {
|
|
37
|
+
return document.body;
|
|
38
|
+
},
|
|
39
|
+
headerHeight: theme.headerHeight,
|
|
40
|
+
isMobile: mobile,
|
|
41
|
+
items: items,
|
|
42
|
+
tocWidth: theme.tocWidth
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
export default Toc;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './selectors';
|
|
2
|
+
export * from './useSiteStore';
|
|
3
|
+
export * from './useThemeStore';
|
|
4
|
+
/**
|
|
5
|
+
* @title 数据选择器
|
|
6
|
+
*/
|
|
7
|
+
export declare const siteSelectors: {
|
|
8
|
+
/**
|
|
9
|
+
* @title API 头部选择器
|
|
10
|
+
*/
|
|
11
|
+
apiHeader: (s: import("./useSiteStore").SiteStore) => import("../components/ApiHeader").ApiHeaderProps;
|
|
12
|
+
/**
|
|
13
|
+
* @title 扁平化侧边栏选择器
|
|
14
|
+
*/
|
|
15
|
+
flattenSidebar: (s: import("./useSiteStore").SiteStore) => import("dumi/dist/client/theme-api/types").ISidebarItem[];
|
|
16
|
+
token: (s: import("./useSiteStore").SiteStore) => any;
|
|
17
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { apiHeaderSel, flattenSidebarSel, tokenSel } from "./selectors";
|
|
2
|
+
export * from "./selectors";
|
|
3
|
+
export * from "./useSiteStore";
|
|
4
|
+
export * from "./useThemeStore";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @title 数据选择器
|
|
8
|
+
*/
|
|
9
|
+
export var siteSelectors = {
|
|
10
|
+
/**
|
|
11
|
+
* @title API 头部选择器
|
|
12
|
+
*/
|
|
13
|
+
apiHeader: apiHeaderSel,
|
|
14
|
+
/**
|
|
15
|
+
* @title 扁平化侧边栏选择器
|
|
16
|
+
*/
|
|
17
|
+
flattenSidebar: flattenSidebarSel,
|
|
18
|
+
token: tokenSel
|
|
19
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ApiHeaderProps } from '../../components/ApiHeader';
|
|
2
|
+
import type { SiteStore } from '../useSiteStore';
|
|
3
|
+
export * from './hero';
|
|
4
|
+
export declare const isApiPageSel: (s: SiteStore) => boolean;
|
|
5
|
+
export declare const apiHeaderSel: (s: SiteStore) => ApiHeaderProps;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
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."); }
|
|
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
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
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; }
|
|
7
|
+
import { githubSel } from "./siteBasicInfo";
|
|
8
|
+
export * from "./hero";
|
|
9
|
+
var haseUrl = function haseUrl(config) {
|
|
10
|
+
if (config === false) return false;
|
|
11
|
+
return typeof config === 'string';
|
|
12
|
+
};
|
|
13
|
+
export var isApiPageSel = function isApiPageSel(s) {
|
|
14
|
+
var _s$siteData$themeConf;
|
|
15
|
+
var fm = s.routeMeta.frontmatter;
|
|
16
|
+
if (s.siteData.themeConfig.apiHeader === false || fm.apiHeader === false) return false;
|
|
17
|
+
if (fm.apiHeader) return true;
|
|
18
|
+
var baseMatch = ['/api', '/components'].concat(_toConsumableArray(((_s$siteData$themeConf = s.siteData.themeConfig.apiHeader) === null || _s$siteData$themeConf === void 0 ? void 0 : _s$siteData$themeConf.match) || []));
|
|
19
|
+
return baseMatch.some(function (path) {
|
|
20
|
+
return s.location.pathname.startsWith(path);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
export var apiHeaderSel = function apiHeaderSel(s) {
|
|
24
|
+
var _fm$apiHeader, _fm$apiHeader2, _fm$apiHeader3, _fm$apiHeader4;
|
|
25
|
+
var REPO_BASE = githubSel(s);
|
|
26
|
+
var fm = s.routeMeta.frontmatter;
|
|
27
|
+
var localeId = s.locale.id;
|
|
28
|
+
|
|
29
|
+
// 统一的路径匹配替换方法
|
|
30
|
+
var replaceUrl = function replaceUrl(rawString) {
|
|
31
|
+
return rawString.replace('{github}', REPO_BASE).replace('{atomId}', fm.atomId || '').replace('{title}', fm.title).replace('{locale}', localeId);
|
|
32
|
+
};
|
|
33
|
+
var _ref = s.siteData.themeConfig.apiHeader || {},
|
|
34
|
+
_ref$pkg = _ref.pkg,
|
|
35
|
+
package_ = _ref$pkg === void 0 ? s.siteData.pkg.name : _ref$pkg,
|
|
36
|
+
sourceUrlMatch = _ref.sourceUrl,
|
|
37
|
+
documentUrlMatch = _ref.docUrl;
|
|
38
|
+
|
|
39
|
+
// 1. 兜底默认使用文档的 apiHeader.pkg
|
|
40
|
+
// 2. 如果 themeConfig 里配置了 pkg, 则使用配置的 pkg
|
|
41
|
+
// 3. 兜底使用 package.json 中的 name
|
|
42
|
+
var displayPackage = ((_fm$apiHeader = fm.apiHeader) === null || _fm$apiHeader === void 0 ? void 0 : _fm$apiHeader.pkg) || package_;
|
|
43
|
+
|
|
44
|
+
// 1. 默认使用文档的 fm.atomId
|
|
45
|
+
// 2. 兜底到文档 title
|
|
46
|
+
var componentName = fm.atomId || fm.title;
|
|
47
|
+
|
|
48
|
+
// 1. 优先选择使用文档 apiHeader.defaultImport
|
|
49
|
+
// 2. 默认使用 false
|
|
50
|
+
var defaultImport = ((_fm$apiHeader2 = fm.apiHeader) === null || _fm$apiHeader2 === void 0 ? void 0 : _fm$apiHeader2.defaultImport) || false;
|
|
51
|
+
var sourceUrl = ((_fm$apiHeader3 = fm.apiHeader) === null || _fm$apiHeader3 === void 0 ? void 0 : _fm$apiHeader3.sourceUrl) || (haseUrl(sourceUrlMatch) ? replaceUrl(sourceUrlMatch) : undefined);
|
|
52
|
+
var documentUrl = ((_fm$apiHeader4 = fm.apiHeader) === null || _fm$apiHeader4 === void 0 ? void 0 : _fm$apiHeader4.docUrl) || (haseUrl(documentUrlMatch) ? replaceUrl(documentUrlMatch) : undefined);
|
|
53
|
+
return {
|
|
54
|
+
componentName: componentName,
|
|
55
|
+
defaultImport: defaultImport,
|
|
56
|
+
description: fm.description,
|
|
57
|
+
docUrl: documentUrl,
|
|
58
|
+
pkg: displayPackage,
|
|
59
|
+
sourceUrl: sourceUrl,
|
|
60
|
+
title: fm.title
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type FeatureItem } from '@lobehub/ui';
|
|
2
|
+
import { SiteStore } from '../useSiteStore';
|
|
3
|
+
export declare const isHeroPageSel: (s: SiteStore) => boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Hero Title 选择器
|
|
6
|
+
* 选择逻辑:优先使用 hero 配置的 title, 再兜底到 themeConfig 中的 name
|
|
7
|
+
*/
|
|
8
|
+
export declare const heroTitleSel: (s: SiteStore) => any;
|
|
9
|
+
/**
|
|
10
|
+
* Hero description 选择器
|
|
11
|
+
* 选择逻辑:优先使用 hero 配置的 description, 再兜底到 themeConfig 中的 name
|
|
12
|
+
*/
|
|
13
|
+
export declare const heroDescSel: (s: SiteStore) => any;
|
|
14
|
+
/**
|
|
15
|
+
* Hero Action 选择器
|
|
16
|
+
* 选择逻辑:优先使用 hero 配置的 actions, 再兜底到 themeConfig 中的 actions
|
|
17
|
+
*/
|
|
18
|
+
export declare const heroActionsSel: (s: SiteStore) => any;
|
|
19
|
+
/**
|
|
20
|
+
* Features 选择器
|
|
21
|
+
*/
|
|
22
|
+
export declare const featuresSel: (s: SiteStore) => FeatureItem[];
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export var isHeroPageSel = function isHeroPageSel(s) {
|
|
2
|
+
return Boolean(s.routeMeta.frontmatter.hero);
|
|
3
|
+
};
|
|
4
|
+
var localeValueSel = function localeValueSel(s, value) {
|
|
5
|
+
if (!value) return;
|
|
6
|
+
if (value[s.locale.id]) return value[s.locale.id];
|
|
7
|
+
return value;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Hero Title 选择器
|
|
12
|
+
* 选择逻辑:优先使用 hero 配置的 title, 再兜底到 themeConfig 中的 name
|
|
13
|
+
*/
|
|
14
|
+
export var heroTitleSel = function heroTitleSel(s) {
|
|
15
|
+
var _s$routeMeta$frontmat, _localeValueSel;
|
|
16
|
+
return ((_s$routeMeta$frontmat = s.routeMeta.frontmatter.hero) === null || _s$routeMeta$frontmat === void 0 ? void 0 : _s$routeMeta$frontmat.title) || ( // 从 hero 的 title 中选择
|
|
17
|
+
(_localeValueSel = localeValueSel(s, s.siteData.themeConfig.hero)) === null || _localeValueSel === void 0 ? void 0 : _localeValueSel.title) ||
|
|
18
|
+
// @deprecated 1.0 正式版本移除
|
|
19
|
+
// 从 hero 的 title 中选择
|
|
20
|
+
localeValueSel(s, s.siteData.themeConfig.title) || s.siteData.themeConfig.name;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Hero description 选择器
|
|
25
|
+
* 选择逻辑:优先使用 hero 配置的 description, 再兜底到 themeConfig 中的 name
|
|
26
|
+
*/
|
|
27
|
+
export var heroDescSel = function heroDescSel(s) {
|
|
28
|
+
var _s$routeMeta$frontmat2, _localeValueSel2;
|
|
29
|
+
return ((_s$routeMeta$frontmat2 = s.routeMeta.frontmatter.hero) === null || _s$routeMeta$frontmat2 === void 0 ? void 0 : _s$routeMeta$frontmat2.description) || ( // 从 hero 的 description 中选择
|
|
30
|
+
(_localeValueSel2 = localeValueSel(s, s.siteData.themeConfig.hero)) === null || _localeValueSel2 === void 0 ? void 0 : _localeValueSel2.description) ||
|
|
31
|
+
// @deprecated 1.0 正式版本移除
|
|
32
|
+
// 从 hero 的 description 中选择
|
|
33
|
+
localeValueSel(s, s.siteData.themeConfig.description);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Hero Action 选择器
|
|
38
|
+
* 选择逻辑:优先使用 hero 配置的 actions, 再兜底到 themeConfig 中的 actions
|
|
39
|
+
*/
|
|
40
|
+
export var heroActionsSel = function heroActionsSel(s) {
|
|
41
|
+
var _s$routeMeta$frontmat3, _localeValueSel3;
|
|
42
|
+
return ((_s$routeMeta$frontmat3 = s.routeMeta.frontmatter.hero) === null || _s$routeMeta$frontmat3 === void 0 ? void 0 : _s$routeMeta$frontmat3.actions) || ( // 从 hero 的 actions 中选择
|
|
43
|
+
(_localeValueSel3 = localeValueSel(s, s.siteData.themeConfig.hero)) === null || _localeValueSel3 === void 0 ? void 0 : _localeValueSel3.actions) ||
|
|
44
|
+
// @deprecated 1.0 正式版本移除
|
|
45
|
+
localeValueSel(s, s.siteData.themeConfig.actions);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Features 选择器
|
|
50
|
+
*/
|
|
51
|
+
export var featuresSel = function featuresSel(s) {
|
|
52
|
+
var _localeValueSel4;
|
|
53
|
+
if (!isHeroPageSel(s)) return [];
|
|
54
|
+
return ((_localeValueSel4 = localeValueSel(s, s.siteData.themeConfig.hero)) === null || _localeValueSel4 === void 0 ? void 0 : _localeValueSel4.features) ||
|
|
55
|
+
// @deprecated 1.0 正式版本移除
|
|
56
|
+
localeValueSel(s, s.siteData.themeConfig.features) ||
|
|
57
|
+
// 在themeConfig 没有配置的话,尝试兜底到 frontmatter 中的配置
|
|
58
|
+
s.routeMeta.frontmatter.features || [];
|
|
59
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ISidebarItem } from 'dumi/dist/client/theme-api/types';
|
|
2
|
+
import { AnchorItem } from '../../types';
|
|
3
|
+
import { SiteStore } from '../useSiteStore';
|
|
4
|
+
export * from './apiHeader';
|
|
5
|
+
export * from './hero';
|
|
6
|
+
export * from './siteBasicInfo';
|
|
7
|
+
export * from './token';
|
|
8
|
+
export declare const activePathSel: (s: SiteStore) => string;
|
|
9
|
+
/**
|
|
10
|
+
* toc 锚点选择器
|
|
11
|
+
* @param s
|
|
12
|
+
*/
|
|
13
|
+
export declare const tocAnchorItemSel: (s: SiteStore) => AnchorItem[];
|
|
14
|
+
/**
|
|
15
|
+
* 将 sidebar 信息扁平化
|
|
16
|
+
* @param s
|
|
17
|
+
*/
|
|
18
|
+
export declare const flattenSidebarSel: (s: SiteStore) => ISidebarItem[];
|
|
19
|
+
export declare const contentBottomSel: (s: SiteStore) => {
|
|
20
|
+
currentIndex: number;
|
|
21
|
+
next: ISidebarItem;
|
|
22
|
+
prev: ISidebarItem;
|
|
23
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
export * from "./apiHeader";
|
|
8
|
+
export * from "./hero";
|
|
9
|
+
export * from "./siteBasicInfo";
|
|
10
|
+
export * from "./token";
|
|
11
|
+
export var activePathSel = function activePathSel(s) {
|
|
12
|
+
if (s.location.pathname === '/') return '/';
|
|
13
|
+
var item = s.navData.filter(function (index) {
|
|
14
|
+
return index.link !== '/';
|
|
15
|
+
}).find(function (index) {
|
|
16
|
+
return s.location.pathname.startsWith(String(index.activePath || index.link));
|
|
17
|
+
});
|
|
18
|
+
return (item === null || item === void 0 ? void 0 : item.activePath) || (item === null || item === void 0 ? void 0 : item.link) || '';
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* toc 锚点选择器
|
|
23
|
+
* @param s
|
|
24
|
+
*/
|
|
25
|
+
export var tocAnchorItemSel = function tocAnchorItemSel(s) {
|
|
26
|
+
var _s$tabMeta, _s$tabMeta2;
|
|
27
|
+
var _s$routeMeta = s.routeMeta,
|
|
28
|
+
toc = _s$routeMeta.toc,
|
|
29
|
+
frontmatter = _s$routeMeta.frontmatter;
|
|
30
|
+
if ((_s$tabMeta = s.tabMeta) !== null && _s$tabMeta !== void 0 && _s$tabMeta.toc) toc = s.tabMeta.toc;
|
|
31
|
+
if ((_s$tabMeta2 = s.tabMeta) !== null && _s$tabMeta2 !== void 0 && _s$tabMeta2.frontmatter) frontmatter = s.tabMeta.frontmatter;
|
|
32
|
+
var shouldKeepWith = function shouldKeepWith(depth) {
|
|
33
|
+
if (!frontmatter.tocDepth) return true;
|
|
34
|
+
if (typeof frontmatter.tocDepth === 'number' && frontmatter.tocDepth > depth - 1) return true;
|
|
35
|
+
};
|
|
36
|
+
return toc.reduce(function (result, item) {
|
|
37
|
+
if (item.depth === 2 && shouldKeepWith(2)) {
|
|
38
|
+
result.push(_objectSpread({}, item));
|
|
39
|
+
} else if (item.depth === 3 && shouldKeepWith(3)) {
|
|
40
|
+
var parent = result.at(-1);
|
|
41
|
+
if (parent) {
|
|
42
|
+
parent.children = parent.children || [];
|
|
43
|
+
parent.children.push(_objectSpread({}, item));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
}, []);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 将 sidebar 信息扁平化
|
|
52
|
+
* @param s
|
|
53
|
+
*/
|
|
54
|
+
export var flattenSidebarSel = function flattenSidebarSel(s) {
|
|
55
|
+
var _s$sidebar;
|
|
56
|
+
return ((_s$sidebar = s.sidebar) === null || _s$sidebar === void 0 ? void 0 : _s$sidebar.map(function (index) {
|
|
57
|
+
return index.children;
|
|
58
|
+
}).flat()) || [];
|
|
59
|
+
};
|
|
60
|
+
export var contentBottomSel = function contentBottomSel(s) {
|
|
61
|
+
var dataFlatten = flattenSidebarSel(s);
|
|
62
|
+
var path = s.location.pathname;
|
|
63
|
+
var currentIndex = dataFlatten.findIndex(function (item) {
|
|
64
|
+
return item.link === path;
|
|
65
|
+
});
|
|
66
|
+
return {
|
|
67
|
+
currentIndex: currentIndex,
|
|
68
|
+
next: dataFlatten[currentIndex + 1],
|
|
69
|
+
prev: dataFlatten[currentIndex - 1]
|
|
70
|
+
};
|
|
71
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 站点标题选择器
|
|
3
|
+
*/
|
|
4
|
+
export var siteTitleSel = function siteTitleSel(s) {
|
|
5
|
+
return s.siteData.themeConfig.title;
|
|
6
|
+
};
|
|
7
|
+
export var githubSel = function githubSel(s) {
|
|
8
|
+
var _s$siteData$themeConf;
|
|
9
|
+
return (
|
|
10
|
+
// 优先取 socialLinks 里的 github
|
|
11
|
+
// TODO: 后面的 github 在 1.0 里废弃
|
|
12
|
+
((_s$siteData$themeConf = s.siteData.themeConfig.socialLinks) === null || _s$siteData$themeConf === void 0 ? void 0 : _s$siteData$themeConf.github) || s.siteData.themeConfig.github
|
|
13
|
+
);
|
|
14
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AtomAsset } from 'dumi-assets-types';
|
|
2
|
+
import { ILocale, ILocalesConfig, INavItem, IPreviewerProps, IRouteMeta, ISidebarGroup, IThemeConfig } from 'dumi/dist/client/theme-api/types';
|
|
3
|
+
import { PICKED_PKG_FIELDS } from 'dumi/dist/constants';
|
|
4
|
+
import type { Location } from 'history';
|
|
5
|
+
import { ComponentType } from 'react';
|
|
6
|
+
export declare type NavData = (INavItem & {
|
|
7
|
+
children?: INavItem[] | undefined;
|
|
8
|
+
})[];
|
|
9
|
+
export interface ISiteData {
|
|
10
|
+
components: Record<string, AtomAsset>;
|
|
11
|
+
demos: Record<string, {
|
|
12
|
+
asset: IPreviewerProps['asset'];
|
|
13
|
+
component: ComponentType;
|
|
14
|
+
routeId: string;
|
|
15
|
+
}>;
|
|
16
|
+
entryExports: Record<string, any>;
|
|
17
|
+
loading: boolean;
|
|
18
|
+
locales: ILocalesConfig;
|
|
19
|
+
pkg: Partial<Record<keyof typeof PICKED_PKG_FIELDS, any>>;
|
|
20
|
+
setLoading: (status: boolean) => void;
|
|
21
|
+
themeConfig: IThemeConfig;
|
|
22
|
+
}
|
|
23
|
+
export interface SiteStore {
|
|
24
|
+
locale: ILocale;
|
|
25
|
+
location: Location;
|
|
26
|
+
navData: NavData;
|
|
27
|
+
routeMeta: IRouteMeta;
|
|
28
|
+
sidebar?: ISidebarGroup[];
|
|
29
|
+
siteData: ISiteData;
|
|
30
|
+
tabMeta?: NonNullable<IRouteMeta['tabs']>[0]['meta'];
|
|
31
|
+
}
|
|
32
|
+
export declare const useSiteStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SiteStore>, "setState"> & {
|
|
33
|
+
setState<A extends string | {
|
|
34
|
+
type: unknown;
|
|
35
|
+
}>(partial: SiteStore | Partial<SiteStore> | ((state: SiteStore) => SiteStore | Partial<SiteStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
36
|
+
}>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
import { create } from 'zustand';
|
|
8
|
+
import { devtools } from 'zustand/middleware';
|
|
9
|
+
var initialState = {
|
|
10
|
+
locale: {
|
|
11
|
+
id: 'zh-CN',
|
|
12
|
+
name: '中文',
|
|
13
|
+
suffix: ''
|
|
14
|
+
},
|
|
15
|
+
location: {
|
|
16
|
+
hash: '',
|
|
17
|
+
key: '',
|
|
18
|
+
pathname: '',
|
|
19
|
+
search: '',
|
|
20
|
+
state: ''
|
|
21
|
+
},
|
|
22
|
+
navData: [],
|
|
23
|
+
routeMeta: {
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
frontmatter: {},
|
|
26
|
+
tabs: undefined,
|
|
27
|
+
texts: [],
|
|
28
|
+
toc: []
|
|
29
|
+
},
|
|
30
|
+
sidebar: [],
|
|
31
|
+
siteData: {
|
|
32
|
+
components: {},
|
|
33
|
+
demos: {},
|
|
34
|
+
entryExports: {},
|
|
35
|
+
loading: true,
|
|
36
|
+
locales: [],
|
|
37
|
+
pkg: {},
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
setLoading: undefined,
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
themeConfig: {}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
export var useSiteStore = create()(devtools(function () {
|
|
45
|
+
return _objectSpread({}, initialState);
|
|
46
|
+
}, {
|
|
47
|
+
name: '@'
|
|
48
|
+
}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ThemeMode } from 'antd-style';
|
|
2
|
+
interface Store {
|
|
3
|
+
themeMode: ThemeMode;
|
|
4
|
+
}
|
|
5
|
+
export declare const useThemeStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<Store>, "persist"> & {
|
|
6
|
+
persist: {
|
|
7
|
+
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<Store, {
|
|
8
|
+
themeMode: ThemeMode;
|
|
9
|
+
}>>) => void;
|
|
10
|
+
clearStorage: () => void;
|
|
11
|
+
rehydrate: () => void | Promise<void>;
|
|
12
|
+
hasHydrated: () => boolean;
|
|
13
|
+
onHydrate: (fn: (state: Store) => void) => () => void;
|
|
14
|
+
onFinishHydration: (fn: (state: Store) => void) => () => void;
|
|
15
|
+
getOptions: () => Partial<import("zustand/middleware").PersistOptions<Store, {
|
|
16
|
+
themeMode: ThemeMode;
|
|
17
|
+
}>>;
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GetCustomToken } from 'antd-style';
|
|
2
|
+
export interface SiteCustomToken {
|
|
3
|
+
contentMaxWidth: number;
|
|
4
|
+
footerHeight: number;
|
|
5
|
+
headerHeight: number;
|
|
6
|
+
sidebarWidth: number;
|
|
7
|
+
tocWidth: number;
|
|
8
|
+
}
|
|
9
|
+
declare const generateCustomToken: GetCustomToken<SiteCustomToken>;
|
|
10
|
+
export default generateCustomToken;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { FooterColumn } from 'rc-footer/es/column';
|
|
2
|
+
import { SiteCustomToken } from '../styles/customToken';
|
|
3
|
+
import { IHero } from './hero';
|
|
4
|
+
export interface ApiHeaderConfig {
|
|
5
|
+
/**
|
|
6
|
+
* @title 文档链接
|
|
7
|
+
* @description 点击 ApiHeader 组件的文档链接跳转的地址
|
|
8
|
+
*/
|
|
9
|
+
docUrl?: string | false;
|
|
10
|
+
/**
|
|
11
|
+
* @title 匹配路由
|
|
12
|
+
* @description ApiHeader 组件的匹配路由
|
|
13
|
+
* @default ["/api", "/components"]
|
|
14
|
+
*/
|
|
15
|
+
match?: string[];
|
|
16
|
+
/**
|
|
17
|
+
* @title 组件库包名
|
|
18
|
+
* @description 可以从 package.json 中引入名称
|
|
19
|
+
*/
|
|
20
|
+
pkg?: string;
|
|
21
|
+
/**
|
|
22
|
+
* @title 源代码链接
|
|
23
|
+
* @description 点击 ApiHeader 组件的源代码链接跳转的地址
|
|
24
|
+
*/
|
|
25
|
+
sourceUrl?: string | false;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @title 页面底部 Footer 组件的配置
|
|
29
|
+
*/
|
|
30
|
+
export interface IFooter {
|
|
31
|
+
/**
|
|
32
|
+
* @title 底部内容
|
|
33
|
+
*/
|
|
34
|
+
bottom?: string;
|
|
35
|
+
/**
|
|
36
|
+
* @title 列配置
|
|
37
|
+
*/
|
|
38
|
+
columns?: FooterColumn[] | false;
|
|
39
|
+
/**
|
|
40
|
+
* @title 主题
|
|
41
|
+
* @enum ['dark', 'light']
|
|
42
|
+
* @enumNames ['黑色', '白色']
|
|
43
|
+
*/
|
|
44
|
+
theme?: 'dark' | 'light';
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 网站主题配置
|
|
48
|
+
*/
|
|
49
|
+
export interface SiteThemeConfig {
|
|
50
|
+
/**
|
|
51
|
+
* API 文档页头部配置
|
|
52
|
+
* @type ApiHeaderConfig | false
|
|
53
|
+
*/
|
|
54
|
+
apiHeader?: ApiHeaderConfig | false;
|
|
55
|
+
/**
|
|
56
|
+
* 网站页脚
|
|
57
|
+
* @type string | false
|
|
58
|
+
*/
|
|
59
|
+
footer?: string | false;
|
|
60
|
+
/**
|
|
61
|
+
* 网站页脚配置
|
|
62
|
+
* @type IFooter
|
|
63
|
+
*/
|
|
64
|
+
footerConfig?: IFooter;
|
|
65
|
+
/**
|
|
66
|
+
* 导航栏 Github 图标链接,如不配置该字段,则不展示。
|
|
67
|
+
*/
|
|
68
|
+
github?: string;
|
|
69
|
+
/**
|
|
70
|
+
* 网站首页头部
|
|
71
|
+
* @type IHero | Record<string, IHero>
|
|
72
|
+
*/
|
|
73
|
+
hero?: IHero | Record<string, IHero>;
|
|
74
|
+
/**
|
|
75
|
+
* 是否隐藏首页的 nav tab,配置为 `false` 则不展示首页的 tab
|
|
76
|
+
*/
|
|
77
|
+
hideHomeNav?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* 网站 logo 图片链接
|
|
80
|
+
*/
|
|
81
|
+
logo?: string;
|
|
82
|
+
/**
|
|
83
|
+
* 网站名称
|
|
84
|
+
*/
|
|
85
|
+
name?: string;
|
|
86
|
+
/**
|
|
87
|
+
* 网站主题 Token 配置
|
|
88
|
+
*/
|
|
89
|
+
siteToken?: SiteConfigToken;
|
|
90
|
+
socialLinks?: {
|
|
91
|
+
facebook?: string;
|
|
92
|
+
github?: string;
|
|
93
|
+
gitlab?: string;
|
|
94
|
+
linkedin?: string;
|
|
95
|
+
twitter?: string;
|
|
96
|
+
weibo?: string;
|
|
97
|
+
yueque?: string;
|
|
98
|
+
zhihu?: string;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
export declare type SiteConfigToken = Partial<Pick<SiteCustomToken, 'headerHeight' | 'footerHeight' | 'sidebarWidth' | 'tocWidth' | 'contentMaxWidth'>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LobeCustomStylish, LobeCustomToken } from '@lobehub/ui';
|
|
2
|
+
import 'antd-style';
|
|
3
|
+
import { AntdToken } from 'antd-style/lib/types/theme';
|
|
4
|
+
|
|
5
|
+
import { SiteCustomToken } from '@/styles/customToken';
|
|
6
|
+
|
|
7
|
+
declare module 'antd-style' {
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
9
|
+
export interface CustomToken extends LobeCustomToken, SiteCustomToken {}
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
11
|
+
export interface CustomStylish extends LobeCustomStylish {}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare module 'styled-components' {
|
|
15
|
+
export interface DefaultTheme extends AntdToken, LobeCustomToken, SiteCustomToken {}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|