dumi-theme-lobehub 1.7.7 → 1.8.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/README.md CHANGED
@@ -43,6 +43,9 @@ dumi-theme-lobehub is a documentation site theme package designed for `Dumi 2`.
43
43
 
44
44
  </details>
45
45
 
46
+ > \[!WARNING]
47
+ > Not Support Dumi >= 2.3 yet
48
+
46
49
  ## ✨ Features
47
50
 
48
51
  - [x] 🤯 **Modern Theme Style:** This theme package adopts modern design techniques such as gradient colors, frosted glass, lighting effects, and natural animations to present the interface in a more concise and visually appealing way, making the documents more intuitive, readable, and user-friendly.
@@ -1,4 +1,4 @@
1
- import { Icon, Snippet } from '@lobehub/ui';
1
+ import { Icon, Markdown, Snippet } from '@lobehub/ui';
2
2
  import { Divider, Space, Typography } from 'antd';
3
3
  import { useResponsive } from 'antd-style';
4
4
  import { Edit3, Github } from 'lucide-react';
@@ -49,15 +49,15 @@ export var ApiHeader = /*#__PURE__*/memo(function (_ref) {
49
49
  var importString = defaultImport ? "import ".concat(componentName, " from '").concat(pkg, "';") : "import { ".concat(componentName, " } from '").concat(pkg, "';");
50
50
  return /*#__PURE__*/_jsxs(Flexbox, {
51
51
  id: 'api-header',
52
+ style: {
53
+ marginBottom: 24
54
+ },
52
55
  children: [/*#__PURE__*/_jsx(Typography.Title, {
53
56
  className: styles.title,
54
57
  children: title
55
- }), description && /*#__PURE__*/_jsx("div", {
56
- children: /*#__PURE__*/_jsx(Typography.Text, {
57
- className: styles.desc,
58
- type: 'secondary',
59
- children: description
60
- })
58
+ }), description && /*#__PURE__*/_jsx(Markdown, {
59
+ className: styles.desc,
60
+ children: description
61
61
  }), !isDoc && /*#__PURE__*/_jsxs(Flexbox, {
62
62
  gap: mobile ? 16 : 24,
63
63
  style: {
@@ -8,5 +8,5 @@ interface SelectItemProps {
8
8
  ref?: ForwardedRef<HTMLButtonElement>;
9
9
  value: any;
10
10
  }
11
- declare const SelectItem: import("react").NamedExoticComponent<SelectItemProps>;
11
+ declare const SelectItem: import("react").ForwardRefExoticComponent<Omit<SelectItemProps, "ref"> & import("react").RefAttributes<any>>;
12
12
  export default SelectItem;
@@ -7,10 +7,10 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
7
7
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
8
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
9
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
- import { forwardRef, memo } from 'react';
10
+ import { forwardRef } from 'react';
11
11
  import { useStyles } from "./style";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- var SelectItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, reference) {
13
+ var SelectItem = /*#__PURE__*/forwardRef(function (_ref, reference) {
14
14
  var value = _ref.value,
15
15
  label = _ref.label,
16
16
  prefixCls = _ref.prefixCls,
@@ -32,5 +32,5 @@ var SelectItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, refe
32
32
  }, props), {}, {
33
33
  children: label
34
34
  }), value);
35
- }));
35
+ });
36
36
  export default SelectItem;
@@ -41,8 +41,7 @@ var SSRPlugin = (api) => {
41
41
  api.describe({
42
42
  key: "@"
43
43
  });
44
- if (!api.userConfig.ssr)
45
- return;
44
+ if (!api.userConfig.ssr) return;
46
45
  api.logger.info("detect ssr config, when building html will extract css.");
47
46
  const writeCSSFile = (key, hashKey, cssString) => {
48
47
  const fileName = `ssr-${key}.${(0, import_utils.getHash)(hashKey)}.css`;
@@ -7,6 +7,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
7
7
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
8
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
9
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
+ import { Typography } from '@lobehub/ui';
10
11
  import { Skeleton } from 'antd';
11
12
  import { useResponsive } from 'antd-style';
12
13
  import isEqual from 'fast-deep-equal';
@@ -37,20 +38,13 @@ var Content = /*#__PURE__*/memo(function (_ref) {
37
38
  gap: mobile ? 0 : 24,
38
39
  width: '100%'
39
40
  }, props), {}, {
40
- children: [/*#__PURE__*/_jsx("div", {
41
- style: {
42
- height: 0
43
- }
44
- }), /*#__PURE__*/_jsxs("div", {
41
+ children: [/*#__PURE__*/_jsxs("div", {
45
42
  className: cx('dumi-antd-style-content', styles.content),
46
43
  children: [/*#__PURE__*/_jsx(Skeleton, {
47
44
  active: true,
48
45
  loading: loading,
49
- paragraph: true,
50
- style: {
51
- minHeight: '50vh'
52
- }
53
- }), /*#__PURE__*/_jsx("div", {
46
+ paragraph: true
47
+ }), /*#__PURE__*/_jsx(Typography, {
54
48
  style: {
55
49
  display: loading ? 'none' : undefined
56
50
  },
@@ -5,9 +5,8 @@ export var useStyles = createStyles(function (_ref, isPure) {
5
5
  var cx = _ref.cx,
6
6
  token = _ref.token,
7
7
  responsive = _ref.responsive,
8
- css = _ref.css,
9
- stylish = _ref.stylish;
8
+ css = _ref.css;
10
9
  return {
11
- content: cx(!isPure && css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 24px 48px;\n background-color: ", ";\n border-radius: 10px;\n\n ", " {\n padding: 8px 16px;\n border-radius: 0;\n }\n "])), token.colorBgContainer, responsive.mobile), css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1;\n box-sizing: border-box;\n width: 100%;\n min-height: 400px;\n\n &:has([data-page-tabs='true']) {\n padding-top: 8px;\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 "])), stylish.markdown, token.colorText, token.motionEaseOut, token.colorText, token.colorTextTertiary, token.colorText))
10
+ content: cx(!isPure && css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 24px 48px;\n background-color: ", ";\n border-radius: 10px;\n\n ", " {\n padding: 8px 16px;\n border-radius: 0;\n }\n "])), token.colorBgContainer, responsive.mobile), css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1;\n box-sizing: border-box;\n width: 100%;\n min-height: 400px;\n\n &:has([data-page-tabs='true']) {\n padding-top: 8px;\n }\n "]))))
12
11
  };
13
12
  });
@@ -10,9 +10,9 @@ var Features = /*#__PURE__*/memo(function () {
10
10
  if (!(features !== null && features !== void 0 && features.length)) return;
11
11
  return /*#__PURE__*/_jsx(F, {
12
12
  items: features,
13
+ maxWidth: theme.contentMaxWidth,
13
14
  style: {
14
- margin: '0 16px',
15
- maxWidth: theme.contentMaxWidth
15
+ margin: '0 16px'
16
16
  }
17
17
  });
18
18
  });
@@ -2,7 +2,7 @@ var _templateObject, _templateObject2;
2
2
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
3
3
  import { TabsNav } from '@lobehub/ui';
4
4
  import { createStyles } from 'antd-style';
5
- import { Link } from 'dumi';
5
+ import { Link, history } from 'dumi';
6
6
  import NavbarExtra from 'dumi/theme-default/slots/NavbarExtra';
7
7
  import { memo } from 'react';
8
8
  import { shallow } from 'zustand/shallow';
@@ -47,7 +47,15 @@ var Navbar = /*#__PURE__*/memo(function () {
47
47
  children: item.title
48
48
  })
49
49
  };
50
- })
50
+ }),
51
+ onChange: function onChange(path) {
52
+ var _nav$find;
53
+ var url = (_nav$find = nav.find(function (index) {
54
+ return index.activePath === path || index.link === path;
55
+ })) === null || _nav$find === void 0 ? void 0 : _nav$find.link;
56
+ if (!url) return;
57
+ history.push(url);
58
+ }
51
59
  }), /*#__PURE__*/_jsx(NavbarExtra, {})]
52
60
  });
53
61
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dumi-theme-lobehub",
3
- "version": "1.7.7",
3
+ "version": "1.8.0",
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,23 +25,22 @@
25
25
  "dist"
26
26
  ],
27
27
  "dependencies": {
28
- "@floating-ui/react": "^0",
29
- "@giscus/react": "^2",
30
- "@lobehub/ui": "^1",
31
- "ahooks": "^3",
32
- "antd": "^5",
33
- "antd-style": "^3",
34
- "chalk": "^4",
35
- "fast-deep-equal": "^3",
36
- "history": "^5",
37
- "lodash-es": "^4",
38
- "lucide-react": "latest",
39
- "polished": "^4",
40
- "rc-footer": "^0",
41
- "react-layout-kit": "^1",
42
- "styled-components": "latest",
43
- "use-merge-value": "^1",
44
- "zustand": "^4"
28
+ "@floating-ui/react": "^0.26.17",
29
+ "@giscus/react": "^2.4.0",
30
+ "@lobehub/ui": "^1.142.4",
31
+ "ahooks": "^3.8.0",
32
+ "antd": "^5.18.2",
33
+ "antd-style": "^3.6.2",
34
+ "chalk": "^4.1.2",
35
+ "fast-deep-equal": "^3.1.3",
36
+ "history": "^5.3.0",
37
+ "lodash-es": "^4.17.21",
38
+ "lucide-react": "^0.395.0",
39
+ "polished": "^4.3.1",
40
+ "rc-footer": "^0.6.8",
41
+ "react-layout-kit": "^1.9.0",
42
+ "use-merge-value": "^1.2.0",
43
+ "zustand": "^4.5.2"
45
44
  },
46
45
  "peerDependencies": {
47
46
  "antd": ">=5",