dumi-theme-lobehub 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/layouts/DemoLayout/index.js +29 -35
- package/dist/layouts/DocLayout/DocumentLayout.d.ts +3 -1
- package/dist/layouts/DocLayout/DocumentLayout.js +9 -2
- package/dist/layouts/DocLayout/ThemeProvider.d.ts +1 -0
- package/dist/layouts/DocLayout/ThemeProvider.js +11 -15
- package/dist/layouts/DocLayout/index.js +29 -25
- package/dist/pages/Changelog/index.d.ts +3 -1
- package/dist/pages/Changelog/index.js +3 -4
- package/dist/pages/Docs/index.d.ts +3 -1
- package/dist/pages/Docs/index.js +3 -4
- package/dist/pages/Home/index.d.ts +3 -1
- package/dist/pages/Home/index.js +3 -4
- package/dist/store/useSiteStore.d.ts +4 -1
- package/package.json +7 -7
|
@@ -1,33 +1,16 @@
|
|
|
1
|
-
import { ThemeProvider } from '@lobehub/ui';
|
|
2
1
|
import { useLocale, useLocation, useNavData, useOutlet, useRouteMeta, useSidebarData, useSiteData, useTabMeta } from 'dumi';
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import { Provider, createStore as _createStore, useThemeStore } from "../../store";
|
|
6
|
-
import AntdV5MonkeyPatch from "../DocLayout/AntdV5MonkeyPatch";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
import { Provider, createStore as _createStore } from "../../store";
|
|
7
4
|
import Analytics from "../DocLayout/Head/Analytics";
|
|
8
5
|
import Favicons from "../DocLayout/Head/Favicons";
|
|
9
6
|
import Og from "../DocLayout/Head/Og";
|
|
10
7
|
import StructuredData from "../DocLayout/Head/StructuredData";
|
|
8
|
+
import ThemeProvider from "../DocLayout/ThemeProvider";
|
|
11
9
|
import GlobalStyle from "./GlobalStyle";
|
|
12
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var themeMode = useThemeStore(function (st) {
|
|
17
|
-
return st.themeMode;
|
|
18
|
-
}, isEqual);
|
|
19
|
-
var outlet = useOutlet();
|
|
20
|
-
return /*#__PURE__*/_jsxs(Provider, {
|
|
21
|
-
createStore: function createStore() {
|
|
22
|
-
return _createStore(initState);
|
|
23
|
-
},
|
|
24
|
-
children: [/*#__PURE__*/_jsx(Favicons, {}), /*#__PURE__*/_jsx(Og, {}), /*#__PURE__*/_jsx(Analytics, {}), /*#__PURE__*/_jsx(StructuredData, {}), /*#__PURE__*/_jsxs(ThemeProvider, {
|
|
25
|
-
themeMode: themeMode,
|
|
26
|
-
children: [/*#__PURE__*/_jsx(GlobalStyle, {}), outlet]
|
|
27
|
-
}), /*#__PURE__*/_jsx(AntdV5MonkeyPatch, {})]
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
export default /*#__PURE__*/memo(function () {
|
|
12
|
+
var DemoProvider = /*#__PURE__*/memo(function (_ref) {
|
|
13
|
+
var children = _ref.children;
|
|
31
14
|
var siteData = useSiteData();
|
|
32
15
|
var sidebar = useSidebarData();
|
|
33
16
|
var routeMeta = useRouteMeta();
|
|
@@ -35,18 +18,29 @@ export default /*#__PURE__*/memo(function () {
|
|
|
35
18
|
var navData = useNavData();
|
|
36
19
|
var location = useLocation();
|
|
37
20
|
var locale = useLocale();
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
21
|
+
return /*#__PURE__*/_jsxs(Provider, {
|
|
22
|
+
createStore: function createStore() {
|
|
23
|
+
return (
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
_createStore({
|
|
26
|
+
locale: locale,
|
|
27
|
+
location: location,
|
|
28
|
+
navData: navData,
|
|
29
|
+
routeMeta: routeMeta,
|
|
30
|
+
sidebar: sidebar,
|
|
31
|
+
siteData: siteData,
|
|
32
|
+
tabMeta: tabMeta
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
},
|
|
36
|
+
children: [/*#__PURE__*/_jsx(Favicons, {}), /*#__PURE__*/_jsx(Og, {}), /*#__PURE__*/_jsx(Analytics, {}), /*#__PURE__*/_jsx(StructuredData, {}), /*#__PURE__*/_jsxs(ThemeProvider, {
|
|
37
|
+
children: [/*#__PURE__*/_jsx(GlobalStyle, {}), children]
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
export default /*#__PURE__*/memo(function () {
|
|
42
|
+
var outlet = useOutlet();
|
|
43
|
+
return /*#__PURE__*/_jsx(DemoProvider, {
|
|
44
|
+
children: outlet
|
|
51
45
|
});
|
|
52
46
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const DocumentLayout: import("react").
|
|
2
|
+
declare const DocumentLayout: import("react").NamedExoticComponent<{
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
}>;
|
|
3
5
|
export default DocumentLayout;
|
|
@@ -14,7 +14,8 @@ import { heroSelectors, siteSelectors, useSiteStore } from "../../store";
|
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
|
-
var DocumentLayout = /*#__PURE__*/memo(function () {
|
|
17
|
+
var DocumentLayout = /*#__PURE__*/memo(function (_ref) {
|
|
18
|
+
var children = _ref.children;
|
|
18
19
|
var intl = useIntl();
|
|
19
20
|
var _useLocation = useLocation(),
|
|
20
21
|
hash = _useLocation.hash;
|
|
@@ -104,7 +105,13 @@ var DocumentLayout = /*#__PURE__*/memo(function () {
|
|
|
104
105
|
sidebar: hideSidebar ? undefined : /*#__PURE__*/_jsx(Sidebar, {}),
|
|
105
106
|
toc: hideToc ? undefined : /*#__PURE__*/_jsx(Toc, {}),
|
|
106
107
|
tocWidth: hideToc ? 0 : theme.tocWidth,
|
|
107
|
-
children: [page === 'home' && /*#__PURE__*/_jsx(Home, {
|
|
108
|
+
children: [page === 'home' && /*#__PURE__*/_jsx(Home, {
|
|
109
|
+
children: children
|
|
110
|
+
}), page === 'changelog' && /*#__PURE__*/_jsx(Changelog, {
|
|
111
|
+
children: children
|
|
112
|
+
}), page === 'docs' && /*#__PURE__*/_jsx(Docs, {
|
|
113
|
+
children: children
|
|
114
|
+
})]
|
|
108
115
|
})]
|
|
109
116
|
});
|
|
110
117
|
});
|
|
@@ -1,31 +1,27 @@
|
|
|
1
1
|
import { ThemeProvider } from '@lobehub/ui';
|
|
2
|
-
import
|
|
2
|
+
import 'antd/dist/reset.css';
|
|
3
3
|
import isEqual from 'fast-deep-equal';
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
import GlobalStyle from "./GlobalStyle";
|
|
6
6
|
import { siteSelectors, useSiteStore, useThemeStore } from "../../store";
|
|
7
7
|
import _customToken from "../../styles/customToken";
|
|
8
|
-
import AntdV5MonkeyPatch from "./AntdV5MonkeyPatch";
|
|
9
|
-
|
|
10
|
-
//@ts-ignore
|
|
11
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
global.__ANTD_CACHE__ = extractStaticStyle.cache;
|
|
14
10
|
export default /*#__PURE__*/memo(function (_ref) {
|
|
15
11
|
var children = _ref.children;
|
|
16
12
|
var themeMode = useThemeStore(function (st) {
|
|
17
13
|
return st.themeMode;
|
|
18
14
|
});
|
|
19
15
|
var userToken = useSiteStore(siteSelectors.token, isEqual);
|
|
20
|
-
return /*#__PURE__*/_jsxs(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
return /*#__PURE__*/_jsxs(ThemeProvider, {
|
|
17
|
+
appearance: themeMode !== 'auto' ? themeMode : undefined,
|
|
18
|
+
customToken: function customToken(themeToken) {
|
|
19
|
+
return Object.assign({}, _customToken(themeToken), userToken);
|
|
20
|
+
},
|
|
21
|
+
theme: {
|
|
22
|
+
cssVar: true
|
|
23
|
+
},
|
|
24
|
+
themeMode: themeMode,
|
|
25
|
+
children: [/*#__PURE__*/_jsx(GlobalStyle, {}), children]
|
|
30
26
|
});
|
|
31
27
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { useOutlet } from "../../../example/.dumi/tmp/exports";
|
|
1
2
|
import { useLocale, useLocation, useNavData, useRouteMeta, useSidebarData, useSiteData, useTabMeta } from 'dumi';
|
|
2
|
-
import { memo
|
|
3
|
+
import { memo } from 'react';
|
|
3
4
|
import { StoreUpdater } from "../../components/StoreUpdater";
|
|
4
5
|
import { Provider, createStore as _createStore } from "../../store";
|
|
5
6
|
import DocumentLayout from "./DocumentLayout";
|
|
@@ -10,37 +11,40 @@ import StructuredData from "./Head/StructuredData";
|
|
|
10
11
|
import ThemeProvider from "./ThemeProvider";
|
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
var
|
|
14
|
-
var
|
|
14
|
+
var DocProvider = /*#__PURE__*/memo(function (_ref) {
|
|
15
|
+
var children = _ref.children;
|
|
16
|
+
var siteData = useSiteData();
|
|
17
|
+
var sidebar = useSidebarData();
|
|
18
|
+
var routeMeta = useRouteMeta();
|
|
19
|
+
var tabMeta = useTabMeta();
|
|
20
|
+
var navData = useNavData();
|
|
21
|
+
var location = useLocation();
|
|
22
|
+
var locale = useLocale();
|
|
15
23
|
return /*#__PURE__*/_jsxs(Provider, {
|
|
16
24
|
createStore: function createStore() {
|
|
17
|
-
return
|
|
25
|
+
return (
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
_createStore({
|
|
28
|
+
locale: locale,
|
|
29
|
+
location: location,
|
|
30
|
+
navData: navData,
|
|
31
|
+
routeMeta: routeMeta,
|
|
32
|
+
sidebar: sidebar,
|
|
33
|
+
siteData: siteData,
|
|
34
|
+
tabMeta: tabMeta
|
|
35
|
+
})
|
|
36
|
+
);
|
|
18
37
|
},
|
|
19
38
|
children: [/*#__PURE__*/_jsx(Favicons, {}), /*#__PURE__*/_jsx(Og, {}), /*#__PURE__*/_jsx(Analytics, {}), /*#__PURE__*/_jsx(StructuredData, {}), /*#__PURE__*/_jsx(StoreUpdater, {}), /*#__PURE__*/_jsx(ThemeProvider, {
|
|
20
|
-
children: /*#__PURE__*/_jsx(DocumentLayout, {
|
|
39
|
+
children: /*#__PURE__*/_jsx(DocumentLayout, {
|
|
40
|
+
children: children
|
|
41
|
+
})
|
|
21
42
|
})]
|
|
22
43
|
});
|
|
23
44
|
});
|
|
24
45
|
export default /*#__PURE__*/memo(function () {
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var tabMeta = useTabMeta();
|
|
29
|
-
var navData = useNavData();
|
|
30
|
-
var location = useLocation();
|
|
31
|
-
var locale = useLocale();
|
|
32
|
-
var initState = useMemo(function () {
|
|
33
|
-
return {
|
|
34
|
-
locale: locale,
|
|
35
|
-
location: location,
|
|
36
|
-
navData: navData,
|
|
37
|
-
routeMeta: routeMeta,
|
|
38
|
-
sidebar: sidebar,
|
|
39
|
-
siteData: siteData,
|
|
40
|
-
tabMeta: tabMeta
|
|
41
|
-
};
|
|
42
|
-
}, []);
|
|
43
|
-
return /*#__PURE__*/_jsx(App, {
|
|
44
|
-
initState: initState
|
|
46
|
+
var outlet = useOutlet();
|
|
47
|
+
return /*#__PURE__*/_jsx(DocProvider, {
|
|
48
|
+
children: outlet
|
|
45
49
|
});
|
|
46
50
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const Changelog: import("react").
|
|
2
|
+
declare const Changelog: import("react").NamedExoticComponent<{
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
}>;
|
|
3
5
|
export default Changelog;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useResponsive } from 'antd-style';
|
|
2
|
-
import { useOutlet } from 'dumi';
|
|
3
2
|
import isEqual from 'fast-deep-equal';
|
|
4
3
|
import { memo, useEffect } from 'react';
|
|
5
4
|
import { Center } from 'react-layout-kit';
|
|
@@ -9,8 +8,8 @@ import Content from "dumi/theme/slots/Content";
|
|
|
9
8
|
import { siteSelectors, useSiteStore } from "../../store";
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
var Changelog = /*#__PURE__*/memo(function () {
|
|
13
|
-
var
|
|
11
|
+
var Changelog = /*#__PURE__*/memo(function (_ref) {
|
|
12
|
+
var children = _ref.children;
|
|
14
13
|
var _useResponsive = useResponsive(),
|
|
15
14
|
mobile = _useResponsive.mobile;
|
|
16
15
|
var repoBase = useSiteStore(siteSelectors.github);
|
|
@@ -38,7 +37,7 @@ var Changelog = /*#__PURE__*/memo(function () {
|
|
|
38
37
|
title: fm.title
|
|
39
38
|
}), /*#__PURE__*/_jsx(Content, {
|
|
40
39
|
className: styles.changelog,
|
|
41
|
-
children:
|
|
40
|
+
children: children
|
|
42
41
|
})]
|
|
43
42
|
});
|
|
44
43
|
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const Documents: import("react").
|
|
2
|
+
declare const Documents: import("react").NamedExoticComponent<{
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
}>;
|
|
3
5
|
export default Documents;
|
package/dist/pages/Docs/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Giscus } from '@lobehub/ui/awesome';
|
|
2
2
|
import { useResponsive } from 'antd-style';
|
|
3
|
-
import { useOutlet } from 'dumi';
|
|
4
3
|
import { memo, useCallback, useEffect } from 'react';
|
|
5
4
|
import { Center } from 'react-layout-kit';
|
|
6
5
|
import ApiHeader from "dumi/theme/slots/ApiHeader";
|
|
@@ -9,8 +8,8 @@ import { apiHeaderSelectors, siteSelectors, useSiteStore } from "../../store";
|
|
|
9
8
|
import { useStyles } from "./styles";
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
var Documents = /*#__PURE__*/memo(function () {
|
|
13
|
-
var
|
|
11
|
+
var Documents = /*#__PURE__*/memo(function (_ref) {
|
|
12
|
+
var children = _ref.children;
|
|
14
13
|
var _useResponsive = useResponsive(),
|
|
15
14
|
mobile = _useResponsive.mobile;
|
|
16
15
|
var _useSiteStore = useSiteStore(function (s) {
|
|
@@ -54,7 +53,7 @@ var Documents = /*#__PURE__*/memo(function () {
|
|
|
54
53
|
children: [isApiPage && /*#__PURE__*/_jsx(ApiHeader, {
|
|
55
54
|
padding: mobile ? 16 : 0
|
|
56
55
|
}), /*#__PURE__*/_jsxs(Content, {
|
|
57
|
-
children: [
|
|
56
|
+
children: [children, giscus && /*#__PURE__*/_jsx(Comment, {})]
|
|
58
57
|
})]
|
|
59
58
|
});
|
|
60
59
|
});
|
package/dist/pages/Home/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { useOutlet } from 'dumi';
|
|
2
1
|
import { memo, useEffect } from 'react';
|
|
3
2
|
import { Flexbox } from 'react-layout-kit';
|
|
4
3
|
import Features from "dumi/theme/slots/Features";
|
|
5
4
|
import Hero from "dumi/theme/slots/Hero";
|
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
var Home = /*#__PURE__*/memo(function () {
|
|
9
|
-
var
|
|
7
|
+
var Home = /*#__PURE__*/memo(function (_ref) {
|
|
8
|
+
var children = _ref.children;
|
|
10
9
|
useEffect(function () {
|
|
11
10
|
var _window, _document;
|
|
12
11
|
(_window = window) === null || _window === void 0 || _window.scrollTo(0, 0);
|
|
@@ -19,7 +18,7 @@ var Home = /*#__PURE__*/memo(function () {
|
|
|
19
18
|
minHeight: '64vh',
|
|
20
19
|
padding: '64px 24px'
|
|
21
20
|
},
|
|
22
|
-
children: [/*#__PURE__*/_jsx(Hero, {}), /*#__PURE__*/_jsx(Features, {}),
|
|
21
|
+
children: [/*#__PURE__*/_jsx(Hero, {}), /*#__PURE__*/_jsx(Features, {}), children]
|
|
23
22
|
});
|
|
24
23
|
});
|
|
25
24
|
export default Home;
|
|
@@ -19,7 +19,7 @@ export interface SiteStore {
|
|
|
19
19
|
siteData: ISiteData;
|
|
20
20
|
tabMeta?: NonNullable<IRouteMeta['tabs']>[0]['meta'];
|
|
21
21
|
}
|
|
22
|
-
export declare const createStore: (initState: SiteStore) => import("zustand/traditional").UseBoundStoreWithEqualityFn<Omit<StoreApi<SiteStore>, "setState"> & {
|
|
22
|
+
export declare const createStore: (initState: SiteStore) => import("zustand/traditional").UseBoundStoreWithEqualityFn<Omit<StoreApi<SiteStore>, "setState" | "devtools"> & {
|
|
23
23
|
setState(partial: SiteStore | Partial<SiteStore> | ((state: SiteStore) => SiteStore | Partial<SiteStore>), replace?: false | undefined, action?: (string | {
|
|
24
24
|
[x: string]: unknown;
|
|
25
25
|
[x: number]: unknown;
|
|
@@ -32,6 +32,9 @@ export declare const createStore: (initState: SiteStore) => import("zustand/trad
|
|
|
32
32
|
[x: symbol]: unknown;
|
|
33
33
|
type: string;
|
|
34
34
|
}) | undefined): void;
|
|
35
|
+
devtools: {
|
|
36
|
+
cleanup: () => void;
|
|
37
|
+
};
|
|
35
38
|
}>;
|
|
36
39
|
declare const useStore: import("zustand-utils").UseContextStore<StoreApi<SiteStore>>, useStoreApi: () => {
|
|
37
40
|
setState: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dumi-theme-lobehub",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "dumi-theme-lobehub is a documentation site theme package designed for dumi2. It provides a more beautiful and user-friendly development and reading experience based on @lobehub/ui",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@floating-ui/react": "^0.27.
|
|
28
|
+
"@floating-ui/react": "^0.27.15",
|
|
29
29
|
"@giscus/react": "^3.1.0",
|
|
30
|
-
"@lobehub/ui": "^2.
|
|
31
|
-
"ahooks": "^3.
|
|
30
|
+
"@lobehub/ui": "^2.9.4",
|
|
31
|
+
"ahooks": "^3.9.3",
|
|
32
32
|
"animated-scroll-to": "^2.3.2",
|
|
33
33
|
"antd-style": "^3.7.1",
|
|
34
34
|
"chalk": "^4.1.2",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"lucide-react": "^0.469.0",
|
|
38
38
|
"polished": "^4.3.1",
|
|
39
39
|
"rc-footer": "^0.6.8",
|
|
40
|
-
"react-layout-kit": "^1.9.
|
|
41
|
-
"swr": "^2.3.
|
|
40
|
+
"react-layout-kit": "^1.9.2",
|
|
41
|
+
"swr": "^2.3.6",
|
|
42
42
|
"url-join": "^5.0.0",
|
|
43
43
|
"use-merge-value": "^1.2.0",
|
|
44
|
-
"zustand": "^5.0.
|
|
44
|
+
"zustand": "^5.0.7",
|
|
45
45
|
"zustand-utils": "^1.3.2"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|