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,49 @@
|
|
|
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
|
+
var _excluded = ["children"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
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); }
|
|
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
|
+
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; }
|
|
10
|
+
import { Skeleton, Typography } from 'antd';
|
|
11
|
+
import { useResponsive } from 'antd-style';
|
|
12
|
+
import { memo } from 'react';
|
|
13
|
+
import { Flexbox } from 'react-layout-kit';
|
|
14
|
+
import ContentFooter from "dumi/theme/slots/ContentFooter";
|
|
15
|
+
import { useSiteStore } from "../../store";
|
|
16
|
+
import { useStyles } from "./style";
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
var Content = /*#__PURE__*/memo(function (_ref) {
|
|
20
|
+
var children = _ref.children,
|
|
21
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
var loading = useSiteStore(function (s) {
|
|
23
|
+
return s.siteData.loading;
|
|
24
|
+
});
|
|
25
|
+
var _useStyles = useStyles(),
|
|
26
|
+
styles = _useStyles.styles,
|
|
27
|
+
cx = _useStyles.cx;
|
|
28
|
+
var _useResponsive = useResponsive(),
|
|
29
|
+
mobile = _useResponsive.mobile;
|
|
30
|
+
return /*#__PURE__*/_jsxs(Flexbox, _objectSpread(_objectSpread({
|
|
31
|
+
gap: mobile ? 0 : 24,
|
|
32
|
+
width: '100%'
|
|
33
|
+
}, props), {}, {
|
|
34
|
+
children: [/*#__PURE__*/_jsx(Typography, {}), /*#__PURE__*/_jsxs("div", {
|
|
35
|
+
className: cx('dumi-antd-style-content', styles.content),
|
|
36
|
+
children: [/*#__PURE__*/_jsx(Skeleton, {
|
|
37
|
+
active: true,
|
|
38
|
+
loading: loading,
|
|
39
|
+
paragraph: true
|
|
40
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
41
|
+
style: {
|
|
42
|
+
display: loading ? 'none' : undefined
|
|
43
|
+
},
|
|
44
|
+
children: children
|
|
45
|
+
})]
|
|
46
|
+
}), /*#__PURE__*/_jsx(ContentFooter, {})]
|
|
47
|
+
}));
|
|
48
|
+
});
|
|
49
|
+
export default Content;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref) {
|
|
5
|
+
var token = _ref.token,
|
|
6
|
+
responsive = _ref.responsive,
|
|
7
|
+
css = _ref.css,
|
|
8
|
+
stylish = _ref.stylish;
|
|
9
|
+
return {
|
|
10
|
+
content: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex: 1;\n\n box-sizing: border-box;\n width: 100%;\n min-height: 400px;\n padding: 24px 48px;\n\n background-color: ", ";\n border-radius: 10px;\n\n &:has([data-page-tabs='true']) {\n padding-top: 8px;\n }\n\n ", " {\n padding: 8px 16px;\n border-radius: 0;\n }\n\n .markdown {\n ", ";\n h2,\n h3 {\n &[id^='version'] {\n color: ", ";\n }\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n transition: all 400ms ", ";\n\n > a[aria-hidden]:first-child {\n float: left;\n\n width: 20px;\n margin-inline-start: -24px;\n padding-inline-end: 4px;\n\n font-size: inherit;\n line-height: inherit;\n color: ", ";\n text-align: right;\n\n &:hover {\n border: 0;\n }\n\n > .icon-link::before {\n content: '#';\n font-size: inherit;\n color: ", ";\n }\n }\n\n &:hover {\n color: ", ";\n }\n\n &:not(:hover) > a[aria-hidden]:first-child > .icon-link {\n visibility: hidden;\n }\n }\n\n ol,\n ul {\n padding-inline-start: 18px;\n }\n }\n "])), token.colorBgContainer, responsive.mobile, stylish.markdown, token.colorText, token.motionEaseOut, token.colorText, token.colorTextTertiary, token.colorText)
|
|
11
|
+
};
|
|
12
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Icon } from '@lobehub/ui';
|
|
2
|
+
import { Link } from 'dumi';
|
|
3
|
+
import { ArrowLeft, ArrowRight } from 'lucide-react';
|
|
4
|
+
import { memo, useMemo } from 'react';
|
|
5
|
+
import { Flexbox } from 'react-layout-kit';
|
|
6
|
+
import { useStyles } from "./Linker.style";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
var Linker = /*#__PURE__*/memo(function (_ref) {
|
|
11
|
+
var title = _ref.title,
|
|
12
|
+
link = _ref.link,
|
|
13
|
+
type = _ref.type;
|
|
14
|
+
var _useStyles = useStyles(),
|
|
15
|
+
styles = _useStyles.styles,
|
|
16
|
+
cx = _useStyles.cx;
|
|
17
|
+
var navContent = useMemo(function () {
|
|
18
|
+
switch (type) {
|
|
19
|
+
case 'prev':
|
|
20
|
+
{
|
|
21
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
22
|
+
children: [/*#__PURE__*/_jsx(Icon, {
|
|
23
|
+
icon: ArrowLeft
|
|
24
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
25
|
+
style: {
|
|
26
|
+
lineHeight: 1
|
|
27
|
+
},
|
|
28
|
+
children: "Previous"
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
case 'next':
|
|
33
|
+
{
|
|
34
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
35
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
36
|
+
style: {
|
|
37
|
+
lineHeight: 1
|
|
38
|
+
},
|
|
39
|
+
children: "Next"
|
|
40
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
41
|
+
icon: ArrowRight
|
|
42
|
+
})]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, [type]);
|
|
47
|
+
return /*#__PURE__*/_jsx(Link, {
|
|
48
|
+
to: link,
|
|
49
|
+
children: /*#__PURE__*/_jsxs(Flexbox, {
|
|
50
|
+
className: styles.container,
|
|
51
|
+
gap: 8,
|
|
52
|
+
children: [/*#__PURE__*/_jsx(Flexbox, {
|
|
53
|
+
className: cx(styles.nav, type === 'next' && styles.alignmentEnd),
|
|
54
|
+
gap: 4,
|
|
55
|
+
horizontal: true,
|
|
56
|
+
children: navContent
|
|
57
|
+
}), /*#__PURE__*/_jsx(Flexbox, {
|
|
58
|
+
className: cx(styles.title, type === 'next' && styles.alignmentEnd),
|
|
59
|
+
horizontal: true,
|
|
60
|
+
children: title
|
|
61
|
+
})]
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
export default Linker;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
2
|
+
alignmentEnd: import("antd-style").SerializedStyles;
|
|
3
|
+
container: import("antd-style").SerializedStyles;
|
|
4
|
+
nav: import("antd-style").SerializedStyles;
|
|
5
|
+
title: import("antd-style").SerializedStyles;
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
2
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref) {
|
|
5
|
+
var token = _ref.token,
|
|
6
|
+
css = _ref.css;
|
|
7
|
+
return {
|
|
8
|
+
alignmentEnd: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n justify-content: flex-end;\n "]))),
|
|
9
|
+
container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n\n min-width: 250px;\n padding: 16px 24px;\n\n background: ", ";\n border-radius: 8px;\n\n &:hover {\n background: ", ";\n }\n "])), token.colorBgContainer, token.colorFillTertiary),
|
|
10
|
+
nav: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-size: 12px;\n color: ", ";\n "])), token.colorTextTertiary),
|
|
11
|
+
title: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n font-size: 16px;\n "])))
|
|
12
|
+
};
|
|
13
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
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 { useResponsive } from 'antd-style';
|
|
8
|
+
import isEqual from 'fast-deep-equal';
|
|
9
|
+
import { memo } from 'react';
|
|
10
|
+
import { Flexbox } from 'react-layout-kit';
|
|
11
|
+
import { contentBottomSel, useSiteStore } from "../../store";
|
|
12
|
+
import Linker from "./Linker";
|
|
13
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
var ContentFooter = /*#__PURE__*/memo(function () {
|
|
16
|
+
var _useSiteStore = useSiteStore(contentBottomSel, isEqual),
|
|
17
|
+
prev = _useSiteStore.prev,
|
|
18
|
+
next = _useSiteStore.next;
|
|
19
|
+
var _useResponsive = useResponsive(),
|
|
20
|
+
mobile = _useResponsive.mobile;
|
|
21
|
+
return /*#__PURE__*/_jsxs(Flexbox, {
|
|
22
|
+
distribution: 'space-between',
|
|
23
|
+
gap: mobile ? 12 : 0,
|
|
24
|
+
horizontal: !mobile,
|
|
25
|
+
style: {
|
|
26
|
+
margin: mobile ? 12 : 0
|
|
27
|
+
},
|
|
28
|
+
children: [prev ? /*#__PURE__*/_jsx(Linker, _objectSpread({
|
|
29
|
+
type: 'prev'
|
|
30
|
+
}, prev)) : /*#__PURE__*/_jsx("div", {}), next ? /*#__PURE__*/_jsx(Linker, _objectSpread({
|
|
31
|
+
type: 'next'
|
|
32
|
+
}, next)) : /*#__PURE__*/_jsx("div", {})]
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
export default ContentFooter;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { useRouteMeta } from 'dumi';
|
|
3
|
+
declare type IContentTabs = ReturnType<typeof useRouteMeta>['tabs'];
|
|
4
|
+
export interface ContentTabsProps {
|
|
5
|
+
onChange: (tab?: NonNullable<IContentTabs>[0]) => void;
|
|
6
|
+
tabKey: string | undefined;
|
|
7
|
+
tabs: IContentTabs;
|
|
8
|
+
}
|
|
9
|
+
declare const ContentTabs: import("react").NamedExoticComponent<ContentTabsProps>;
|
|
10
|
+
export default ContentTabs;
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { Tabs } from 'antd';
|
|
8
|
+
import { useIntl } from 'dumi';
|
|
9
|
+
import { memo } from 'react';
|
|
10
|
+
import { useStyles } from "./style";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
var ContentTabs = /*#__PURE__*/memo(function (_ref) {
|
|
13
|
+
var tabs = _ref.tabs,
|
|
14
|
+
key = _ref.tabKey,
|
|
15
|
+
_onChange = _ref.onChange;
|
|
16
|
+
var intl = useIntl();
|
|
17
|
+
var _useStyles = useStyles(),
|
|
18
|
+
styles = _useStyles.styles;
|
|
19
|
+
// TODO: tab.Extra & tab.Action render
|
|
20
|
+
|
|
21
|
+
return tabs && (tabs === null || tabs === void 0 ? void 0 : tabs.length) > 0 ? /*#__PURE__*/_jsx(Tabs, {
|
|
22
|
+
activeKey: key || 'default',
|
|
23
|
+
className: styles.cls,
|
|
24
|
+
"data-page-tabs": true,
|
|
25
|
+
items: [{
|
|
26
|
+
key: 'default',
|
|
27
|
+
label: '文档',
|
|
28
|
+
value: 'default'
|
|
29
|
+
}].concat(_toConsumableArray(tabs.map(function (tab) {
|
|
30
|
+
return {
|
|
31
|
+
key: tab.key,
|
|
32
|
+
label: tab.titleIntlId ? intl.formatMessage({
|
|
33
|
+
id: tab.titleIntlId
|
|
34
|
+
}) : tab.meta.frontmatter.title,
|
|
35
|
+
value: tab.key
|
|
36
|
+
};
|
|
37
|
+
}))),
|
|
38
|
+
onChange: function onChange(key) {
|
|
39
|
+
if (key === 'default') {
|
|
40
|
+
_onChange();
|
|
41
|
+
} else {
|
|
42
|
+
_onChange(tabs.find(function (t) {
|
|
43
|
+
return t.key === key;
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}) : undefined;
|
|
48
|
+
});
|
|
49
|
+
export default ContentTabs;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var _templateObject;
|
|
2
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref) {
|
|
5
|
+
var token = _ref.token,
|
|
6
|
+
prefixCls = _ref.prefixCls,
|
|
7
|
+
css = _ref.css;
|
|
8
|
+
var prefix = ".".concat(prefixCls, "-tabs");
|
|
9
|
+
var marginBlock = 8;
|
|
10
|
+
return {
|
|
11
|
+
cls: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "-tab + ", "-tab {\n margin: 8px 4px !important;\n margin-block: ", "px;\n padding: 0 12px !important;\n }\n\n ", "-tab {\n color: ", ";\n transition: background-color 150ms ease-out;\n\n &:first-child {\n margin-block: ", "px;\n margin-inline: 0 4px;\n padding: 4px 12px !important;\n }\n\n &:hover {\n color: ", " !important;\n background: ", ";\n border-radius: 6px;\n }\n }\n "])), prefix, prefix, marginBlock, prefix, token.colorTextSecondary, marginBlock, token.colorText, token.colorFillTertiary)
|
|
12
|
+
};
|
|
13
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Features as F } from '@lobehub/ui';
|
|
2
|
+
import { useTheme } from 'antd-style';
|
|
3
|
+
import isEqual from 'fast-deep-equal';
|
|
4
|
+
import { memo } from 'react';
|
|
5
|
+
import { featuresSel, useSiteStore } from "../../store";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
var Features = /*#__PURE__*/memo(function () {
|
|
8
|
+
var features = useSiteStore(featuresSel, isEqual);
|
|
9
|
+
var theme = useTheme();
|
|
10
|
+
if (!(features !== null && features !== void 0 && features.length)) return;
|
|
11
|
+
return /*#__PURE__*/_jsx(F, {
|
|
12
|
+
contentMaxWidth: theme.contentMaxWidth,
|
|
13
|
+
items: features,
|
|
14
|
+
style: {
|
|
15
|
+
margin: '0 16px'
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
export default Features;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Icon } from '@lobehub/ui';
|
|
2
|
+
import { Link } from 'dumi';
|
|
3
|
+
import { Bug, FileClock, GitFork, Github } from 'lucide-react';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
export var getColumns = function getColumns(_ref) {
|
|
6
|
+
var github = _ref.github;
|
|
7
|
+
var resources = {
|
|
8
|
+
items: [{
|
|
9
|
+
description: 'AIGC Components',
|
|
10
|
+
openExternal: true,
|
|
11
|
+
title: 'Lobe UI',
|
|
12
|
+
url: 'https://github.com/lobehub/lobe-ui'
|
|
13
|
+
}, {
|
|
14
|
+
description: 'Chatbot Client',
|
|
15
|
+
openExternal: true,
|
|
16
|
+
title: 'Lobe Chat',
|
|
17
|
+
url: 'https://github.com/lobehub/lobe-chat'
|
|
18
|
+
}, {
|
|
19
|
+
description: 'Node Flow Editor',
|
|
20
|
+
openExternal: true,
|
|
21
|
+
title: 'Lobe Flow',
|
|
22
|
+
url: 'https://github.com/lobehub/lobe-flow'
|
|
23
|
+
}],
|
|
24
|
+
title: 'Resources'
|
|
25
|
+
};
|
|
26
|
+
var community = {
|
|
27
|
+
items: [github && {
|
|
28
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
29
|
+
icon: Bug,
|
|
30
|
+
size: "small"
|
|
31
|
+
}),
|
|
32
|
+
openExternal: true,
|
|
33
|
+
title: 'Report Bug',
|
|
34
|
+
url: "".concat(github, "/issues/new/choose")
|
|
35
|
+
}, github && {
|
|
36
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
37
|
+
icon: GitFork,
|
|
38
|
+
size: "small"
|
|
39
|
+
}),
|
|
40
|
+
openExternal: true,
|
|
41
|
+
title: 'Request Feature',
|
|
42
|
+
url: "".concat(github, "/issues/new/choose")
|
|
43
|
+
}].filter(Boolean),
|
|
44
|
+
title: 'Community'
|
|
45
|
+
};
|
|
46
|
+
var help = {
|
|
47
|
+
items: [github && {
|
|
48
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
49
|
+
icon: Github,
|
|
50
|
+
size: "small"
|
|
51
|
+
}),
|
|
52
|
+
openExternal: true,
|
|
53
|
+
title: 'GitHub',
|
|
54
|
+
url: github
|
|
55
|
+
}, {
|
|
56
|
+
LinkComponent: Link,
|
|
57
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
|
58
|
+
icon: FileClock,
|
|
59
|
+
size: "small"
|
|
60
|
+
}),
|
|
61
|
+
title: 'Changelog',
|
|
62
|
+
url: '/changelog'
|
|
63
|
+
}].filter(Boolean),
|
|
64
|
+
title: 'Help'
|
|
65
|
+
};
|
|
66
|
+
var more = {
|
|
67
|
+
items: [{
|
|
68
|
+
description: 'AI Commit CLI',
|
|
69
|
+
openExternal: true,
|
|
70
|
+
title: '💌 Lobe Commit',
|
|
71
|
+
url: 'https://github.com/lobehub/lobe-commit'
|
|
72
|
+
}, {
|
|
73
|
+
description: 'Lint Config',
|
|
74
|
+
openExternal: true,
|
|
75
|
+
title: '📐 Lobe Lint',
|
|
76
|
+
url: 'https://github.com/lobehub/lobe-lint'
|
|
77
|
+
}],
|
|
78
|
+
title: 'More Products'
|
|
79
|
+
};
|
|
80
|
+
return [resources, community, help, more];
|
|
81
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Footer as Foot } from '@lobehub/ui';
|
|
2
|
+
import { Divider } from 'antd';
|
|
3
|
+
import { useResponsive } from 'antd-style';
|
|
4
|
+
import isEqual from 'fast-deep-equal';
|
|
5
|
+
import { memo } from 'react';
|
|
6
|
+
import { Center, Flexbox } from 'react-layout-kit';
|
|
7
|
+
import { shallow } from 'zustand/shallow';
|
|
8
|
+
import { githubSel, useSiteStore } from "../../store";
|
|
9
|
+
import { getColumns } from "./columns";
|
|
10
|
+
import { useStyles } from "./style";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
var Footer = /*#__PURE__*/memo(function () {
|
|
14
|
+
var _useSiteStore = useSiteStore(function (s) {
|
|
15
|
+
return s.siteData;
|
|
16
|
+
}, isEqual),
|
|
17
|
+
themeConfig = _useSiteStore.themeConfig,
|
|
18
|
+
pkg = _useSiteStore.pkg;
|
|
19
|
+
var githubUrl = useSiteStore(githubSel, shallow);
|
|
20
|
+
var _useStyles = useStyles(),
|
|
21
|
+
styles = _useStyles.styles,
|
|
22
|
+
theme = _useStyles.theme;
|
|
23
|
+
var _useResponsive = useResponsive(),
|
|
24
|
+
mobile = _useResponsive.mobile;
|
|
25
|
+
if (!themeConfig.footer) return;
|
|
26
|
+
var footer = themeConfig.footerConfig;
|
|
27
|
+
var columns = (footer === null || footer === void 0 ? void 0 : footer.columns) === false ? undefined : getColumns({
|
|
28
|
+
github: githubUrl || pkg.homepage
|
|
29
|
+
});
|
|
30
|
+
var bottomFooter = (footer === null || footer === void 0 ? void 0 : footer.bottom) || themeConfig.footer;
|
|
31
|
+
return /*#__PURE__*/_jsx(Foot, {
|
|
32
|
+
bottom: mobile ? /*#__PURE__*/_jsxs(Center, {
|
|
33
|
+
className: styles.container,
|
|
34
|
+
children: ["Copyright \xA9 2022-", new Date().getFullYear(), /*#__PURE__*/_jsx(Flexbox, {
|
|
35
|
+
align: 'center',
|
|
36
|
+
dangerouslySetInnerHTML: {
|
|
37
|
+
__html: bottomFooter
|
|
38
|
+
},
|
|
39
|
+
horizontal: true
|
|
40
|
+
})]
|
|
41
|
+
}) : /*#__PURE__*/_jsxs(Center, {
|
|
42
|
+
horizontal: true,
|
|
43
|
+
children: ["Copyright \xA9 2022-", new Date().getFullYear(), " ", /*#__PURE__*/_jsx(Divider, {
|
|
44
|
+
type: 'vertical'
|
|
45
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
46
|
+
dangerouslySetInnerHTML: {
|
|
47
|
+
__html: bottomFooter
|
|
48
|
+
}
|
|
49
|
+
})]
|
|
50
|
+
}),
|
|
51
|
+
columns: columns,
|
|
52
|
+
contentMaxWidth: theme.contentMaxWidth,
|
|
53
|
+
theme: (footer === null || footer === void 0 ? void 0 : footer.theme) || theme.appearance
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
export default Footer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var _templateObject, _templateObject2;
|
|
2
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
3
|
+
import { createStyles } from 'antd-style';
|
|
4
|
+
export var useStyles = createStyles(function (_ref) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
responsive = _ref.responsive,
|
|
7
|
+
token = _ref.token;
|
|
8
|
+
var prefix = "rc-footer";
|
|
9
|
+
return {
|
|
10
|
+
container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n grid-area: footer;\n align-self: stretch;\n\n color: ", ";\n text-align: center;\n\n border-top: 1px solid ", ";\n\n ", " {\n flex-direction: column;\n border: none;\n }\n "])), token.colorTextDescription, token.colorSplit, responsive.mobile),
|
|
11
|
+
footer: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-size: 14px;\n line-height: 1.5;\n color: ", ";\n background-color: ", ";\n\n &.", " {\n a {\n color: ", ";\n text-decoration: none;\n transition: all 0.3s;\n\n &:hover {\n color: ", ";\n }\n }\n }\n\n .", " {\n &-container {\n width: 100%;\n max-width: ", "px;\n margin: auto;\n padding: 60px 0 20px;\n }\n\n &-columns {\n display: flex;\n justify-content: space-around;\n }\n\n &-column {\n h2 {\n position: relative;\n\n margin: 0 auto;\n\n font-size: 16px;\n font-weight: 500;\n color: ", ";\n }\n\n &-icon {\n position: relative;\n top: -1px;\n\n display: inline-block;\n\n width: 22px;\n margin-inline-end: 0.5em;\n\n text-align: center;\n vertical-align: middle;\n\n > span,\n > svg,\n img {\n display: block;\n width: 100%;\n }\n }\n }\n\n &-item {\n margin: 12px 0;\n\n &-icon {\n position: relative;\n top: -1px;\n\n display: inline-block;\n\n width: 16px;\n margin-inline-end: 0.4em;\n\n text-align: center;\n vertical-align: middle;\n\n > span,\n > svg,\n img {\n display: block;\n width: 100%;\n }\n }\n\n &-separator {\n margin: 0 0.3em;\n }\n }\n\n &-bottom {\n &-container {\n width: 100%;\n max-width: 1200px;\n margin: 0 auto;\n padding: 16px 0;\n\n font-size: 16px;\n line-height: 32px;\n text-align: center;\n\n border-top: 1px solid ", ";\n }\n }\n\n &-light {\n color: rgba(0, 0, 0, 85%);\n background-color: transparent;\n\n h2,\n a {\n color: rgba(0, 0, 0, 85%);\n }\n }\n\n &-light &-bottom-container {\n border-top-color: #e8e8e8;\n }\n\n &-light &-item-separator,\n &-light &-item-description {\n color: rgba(0, 0, 0, 45%);\n }\n }\n\n ", " {\n .", " {\n text-align: center;\n\n &-container {\n padding: 40px 0;\n }\n\n &-columns {\n display: block;\n }\n\n &-column {\n display: block;\n margin-bottom: 40px;\n\n &:last-child {\n margin-bottom: 0;\n }\n }\n }\n }\n "])), token.colorTextSecondary, token.colorBgLayout, prefix, token.colorTextTertiary, token.colorLinkHover, prefix, token.contentMaxWidth, token.colorText, token.colorBorderSecondary, responsive.mobile, prefix)
|
|
12
|
+
};
|
|
13
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
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 { Burger as Menu } from '@lobehub/ui';
|
|
8
|
+
import { Link } from 'dumi';
|
|
9
|
+
import isEqual from 'fast-deep-equal';
|
|
10
|
+
import { uniq } from 'lodash-es';
|
|
11
|
+
import { memo, useMemo, useState } from 'react';
|
|
12
|
+
import { shallow } from 'zustand/shallow';
|
|
13
|
+
import { activePathSel, useSiteStore } from "../../store";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
var Burger = /*#__PURE__*/memo(function () {
|
|
16
|
+
var _useState = useState(false),
|
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
+
opened = _useState2[0],
|
|
19
|
+
setOpened = _useState2[1];
|
|
20
|
+
var nav = useSiteStore(function (s) {
|
|
21
|
+
return s.navData;
|
|
22
|
+
}, isEqual);
|
|
23
|
+
var sidebar = useSiteStore(function (s) {
|
|
24
|
+
return s.sidebar;
|
|
25
|
+
}, isEqual);
|
|
26
|
+
var _useSiteStore = useSiteStore(function (s) {
|
|
27
|
+
return {
|
|
28
|
+
activePath: activePathSel(s),
|
|
29
|
+
pathname: s.location.pathname
|
|
30
|
+
};
|
|
31
|
+
}, shallow),
|
|
32
|
+
pathname = _useSiteStore.pathname,
|
|
33
|
+
activePath = _useSiteStore.activePath;
|
|
34
|
+
var items = useMemo(function () {
|
|
35
|
+
var sidebarItems = sidebar === null || sidebar === void 0 ? void 0 : sidebar.map(function (group) {
|
|
36
|
+
return !group.link && {
|
|
37
|
+
children: group.children.map(function (item) {
|
|
38
|
+
return {
|
|
39
|
+
key: "s-".concat(item.link),
|
|
40
|
+
label: /*#__PURE__*/_jsx(Link, {
|
|
41
|
+
onClick: function onClick() {
|
|
42
|
+
setOpened(false);
|
|
43
|
+
},
|
|
44
|
+
to: item.link,
|
|
45
|
+
children: item.title
|
|
46
|
+
})
|
|
47
|
+
};
|
|
48
|
+
}),
|
|
49
|
+
label: group.title,
|
|
50
|
+
type: 'group'
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
return nav.map(function (item) {
|
|
54
|
+
return {
|
|
55
|
+
children: (item.activePath || item.link) === activePath && sidebarItems,
|
|
56
|
+
key: item.activePath || item.link,
|
|
57
|
+
label: /*#__PURE__*/_jsx(Link, {
|
|
58
|
+
to: String(item.link),
|
|
59
|
+
children: item.title
|
|
60
|
+
})
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
}, [nav, activePath, sidebar]);
|
|
64
|
+
return /*#__PURE__*/_jsx(Menu, {
|
|
65
|
+
items: items,
|
|
66
|
+
openKeys: [activePath],
|
|
67
|
+
opened: opened,
|
|
68
|
+
selectedKeys: uniq([activePath, "s-".concat(pathname)]),
|
|
69
|
+
setOpened: setOpened
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
export default Burger;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ActionIcon } from '@lobehub/ui';
|
|
2
|
+
import { Github } from 'lucide-react';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { githubSel, useSiteStore } from "../../store";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
var GithubButton = /*#__PURE__*/memo(function () {
|
|
7
|
+
var repoUrl = useSiteStore(githubSel);
|
|
8
|
+
return repoUrl ? /*#__PURE__*/_jsx("a", {
|
|
9
|
+
href: repoUrl,
|
|
10
|
+
rel: "noreferrer",
|
|
11
|
+
target: '_blank',
|
|
12
|
+
children: /*#__PURE__*/_jsx(ActionIcon, {
|
|
13
|
+
icon: Github,
|
|
14
|
+
size: "site"
|
|
15
|
+
})
|
|
16
|
+
}) : undefined;
|
|
17
|
+
});
|
|
18
|
+
export default GithubButton;
|