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.
Files changed (146) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +162 -0
  3. package/dist/builtins/Container/index.d.ts +7 -0
  4. package/dist/builtins/Container/index.js +28 -0
  5. package/dist/builtins/Container/style.d.ts +5 -0
  6. package/dist/builtins/Container/style.js +27 -0
  7. package/dist/builtins/Features/index.d.ts +2 -0
  8. package/dist/builtins/Features/index.js +19 -0
  9. package/dist/builtins/Previewer/index.d.ts +8 -0
  10. package/dist/builtins/Previewer/index.js +26 -0
  11. package/dist/builtins/Previewer/style.d.ts +9 -0
  12. package/dist/builtins/Previewer/style.js +18 -0
  13. package/dist/builtins/SourceCode/index.d.ts +7 -0
  14. package/dist/builtins/SourceCode/index.js +17 -0
  15. package/dist/components/ApiHeader/index.d.ts +77 -0
  16. package/dist/components/ApiHeader/index.js +124 -0
  17. package/dist/components/ApiHeader/style.d.ts +7 -0
  18. package/dist/components/ApiHeader/style.js +16 -0
  19. package/dist/components/Favicons/index.d.ts +3 -0
  20. package/dist/components/Favicons/index.js +43 -0
  21. package/dist/components/NativeSelect/SelectItem/index.d.ts +12 -0
  22. package/dist/components/NativeSelect/SelectItem/index.js +37 -0
  23. package/dist/components/NativeSelect/SelectItem/style.d.ts +5 -0
  24. package/dist/components/NativeSelect/SelectItem/style.js +13 -0
  25. package/dist/components/NativeSelect/index.d.ts +17 -0
  26. package/dist/components/NativeSelect/index.js +248 -0
  27. package/dist/components/NativeSelect/style.d.ts +4 -0
  28. package/dist/components/NativeSelect/style.js +13 -0
  29. package/dist/components/StoreUpdater/index.d.ts +1 -0
  30. package/dist/components/StoreUpdater/index.js +91 -0
  31. package/dist/config.d.ts +2 -0
  32. package/dist/config.js +3 -0
  33. package/dist/hooks/useCopied.d.ts +4 -0
  34. package/dist/hooks/useCopied.js +31 -0
  35. package/dist/index.d.ts +3 -0
  36. package/dist/index.js +3 -0
  37. package/dist/layouts/DemoLayout/index.d.ts +3 -0
  38. package/dist/layouts/DemoLayout/index.js +21 -0
  39. package/dist/layouts/DocLayout/GlobalStyle.d.ts +3 -0
  40. package/dist/layouts/DocLayout/GlobalStyle.js +8 -0
  41. package/dist/layouts/DocLayout/index.d.ts +3 -0
  42. package/dist/layouts/DocLayout/index.js +130 -0
  43. package/dist/pages/Changelog/index.d.ts +3 -0
  44. package/dist/pages/Changelog/index.js +58 -0
  45. package/dist/pages/Docs/index.d.ts +3 -0
  46. package/dist/pages/Docs/index.js +52 -0
  47. package/dist/pages/Docs/styles.d.ts +5 -0
  48. package/dist/pages/Docs/styles.js +14 -0
  49. package/dist/pages/Home/index.d.ts +3 -0
  50. package/dist/pages/Home/index.js +20 -0
  51. package/dist/plugin/index.d.ts +3 -0
  52. package/dist/plugin/index.js +77 -0
  53. package/dist/plugin/utils.d.ts +1 -0
  54. package/dist/plugin/utils.js +30 -0
  55. package/dist/slots/ApiHeader/BundlephobiaFilled.d.ts +3 -0
  56. package/dist/slots/ApiHeader/BundlephobiaFilled.js +15 -0
  57. package/dist/slots/ApiHeader/Graph.d.ts +3 -0
  58. package/dist/slots/ApiHeader/Graph.js +14 -0
  59. package/dist/slots/ApiHeader/NpmFilled.d.ts +3 -0
  60. package/dist/slots/ApiHeader/NpmFilled.js +16 -0
  61. package/dist/slots/ApiHeader/PackagePhobia.d.ts +3 -0
  62. package/dist/slots/ApiHeader/PackagePhobia.js +27 -0
  63. package/dist/slots/ApiHeader/Unpkg.d.ts +3 -0
  64. package/dist/slots/ApiHeader/Unpkg.js +14 -0
  65. package/dist/slots/ApiHeader/index.d.ts +3 -0
  66. package/dist/slots/ApiHeader/index.js +53 -0
  67. package/dist/slots/Content/index.d.ts +4 -0
  68. package/dist/slots/Content/index.js +49 -0
  69. package/dist/slots/Content/style.d.ts +3 -0
  70. package/dist/slots/Content/style.js +12 -0
  71. package/dist/slots/ContentFooter/Linker.d.ts +8 -0
  72. package/dist/slots/ContentFooter/Linker.js +65 -0
  73. package/dist/slots/ContentFooter/Linker.style.d.ts +6 -0
  74. package/dist/slots/ContentFooter/Linker.style.js +13 -0
  75. package/dist/slots/ContentFooter/index.d.ts +3 -0
  76. package/dist/slots/ContentFooter/index.js +35 -0
  77. package/dist/slots/ContentTabs/index.d.ts +10 -0
  78. package/dist/slots/ContentTabs/index.js +49 -0
  79. package/dist/slots/ContentTabs/style.d.ts +3 -0
  80. package/dist/slots/ContentTabs/style.js +13 -0
  81. package/dist/slots/Features/index.d.ts +3 -0
  82. package/dist/slots/Features/index.js +19 -0
  83. package/dist/slots/Footer/columns.d.ts +6 -0
  84. package/dist/slots/Footer/columns.js +81 -0
  85. package/dist/slots/Footer/index.d.ts +3 -0
  86. package/dist/slots/Footer/index.js +56 -0
  87. package/dist/slots/Footer/style.d.ts +4 -0
  88. package/dist/slots/Footer/style.js +13 -0
  89. package/dist/slots/Header/Burger.d.ts +3 -0
  90. package/dist/slots/Header/Burger.js +72 -0
  91. package/dist/slots/Header/GithubButton.d.ts +3 -0
  92. package/dist/slots/Header/GithubButton.js +18 -0
  93. package/dist/slots/Header/LangSwitch.d.ts +3 -0
  94. package/dist/slots/Header/LangSwitch.js +133 -0
  95. package/dist/slots/Header/ThemeSwitch.d.ts +3 -0
  96. package/dist/slots/Header/ThemeSwitch.js +18 -0
  97. package/dist/slots/Header/index.d.ts +3 -0
  98. package/dist/slots/Header/index.js +30 -0
  99. package/dist/slots/Hero/index.d.ts +3 -0
  100. package/dist/slots/Hero/index.js +15 -0
  101. package/dist/slots/Logo/index.d.ts +3 -0
  102. package/dist/slots/Logo/index.js +38 -0
  103. package/dist/slots/Logo/style.d.ts +1 -0
  104. package/dist/slots/Logo/style.js +9 -0
  105. package/dist/slots/Navbar/index.d.ts +3 -0
  106. package/dist/slots/Navbar/index.js +55 -0
  107. package/dist/slots/PreviewerActions/index.d.ts +13 -0
  108. package/dist/slots/PreviewerActions/index.js +109 -0
  109. package/dist/slots/PreviewerActions/style.d.ts +4 -0
  110. package/dist/slots/PreviewerActions/style.js +11 -0
  111. package/dist/slots/SearchBar/index.d.ts +3 -0
  112. package/dist/slots/SearchBar/index.js +51 -0
  113. package/dist/slots/SearchBar/style.d.ts +7 -0
  114. package/dist/slots/SearchBar/style.js +16 -0
  115. package/dist/slots/Sidebar/index.d.ts +3 -0
  116. package/dist/slots/Sidebar/index.js +35 -0
  117. package/dist/slots/Sidebar/style.d.ts +4 -0
  118. package/dist/slots/Sidebar/style.js +11 -0
  119. package/dist/slots/Toc/index.d.ts +3 -0
  120. package/dist/slots/Toc/index.js +46 -0
  121. package/dist/store/index.d.ts +17 -0
  122. package/dist/store/index.js +19 -0
  123. package/dist/store/selectors/apiHeader.d.ts +5 -0
  124. package/dist/store/selectors/apiHeader.js +62 -0
  125. package/dist/store/selectors/hero.d.ts +22 -0
  126. package/dist/store/selectors/hero.js +59 -0
  127. package/dist/store/selectors/index.d.ts +23 -0
  128. package/dist/store/selectors/index.js +71 -0
  129. package/dist/store/selectors/siteBasicInfo.d.ts +6 -0
  130. package/dist/store/selectors/siteBasicInfo.js +14 -0
  131. package/dist/store/selectors/token.d.ts +2 -0
  132. package/dist/store/selectors/token.js +5 -0
  133. package/dist/store/useSiteStore.d.ts +36 -0
  134. package/dist/store/useSiteStore.js +48 -0
  135. package/dist/store/useThemeStore.d.ts +20 -0
  136. package/dist/store/useThemeStore.js +9 -0
  137. package/dist/styles/customToken.d.ts +10 -0
  138. package/dist/styles/customToken.js +10 -0
  139. package/dist/types/config.d.ts +101 -0
  140. package/dist/types/config.js +1 -0
  141. package/dist/types/global.d.ts +16 -0
  142. package/dist/types/hero.d.ts +8 -0
  143. package/dist/types/hero.js +1 -0
  144. package/dist/types/index.d.ts +26 -0
  145. package/dist/types/index.js +7 -0
  146. package/package.json +119 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 LobeHub
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,162 @@
1
+ <a name="readme-top"></a>
2
+
3
+ <div align="center">
4
+
5
+ <img height="120" src="https://npm.elemecdn.com/@lobehub/assets-logo@1.0.0/assets/logo-3d.webp">
6
+ <img height="120" src="https://gw.alipayobjects.com/zos/kitchen/qJ3l3EPsdW/split.svg">
7
+ <img height="120" src="https://gw.alipayobjects.com/zos/bmw-prod/d3e3eb39-1cd7-4aa5-827c-877deced6b7e/lalxt4g3_w256_h256.png">
8
+
9
+ <h1>Dumi Theme Lobehub</h1>
10
+
11
+ dumi-theme-lobehub is a documentation site theme package designed for `Dumi 2`.
12
+
13
+ It provides a more beautiful and user-friendly development and reading experience based on `dumi-theme-lobehub`
14
+
15
+ [Changelog](./CHANGELOG.md) · [Report Bug][issues-url] · [Request Feature][issues-url]
16
+
17
+ <!-- SHIELD GROUP -->
18
+
19
+ [![release][release-shield]][release-url]
20
+ [![releaseDate][release-date-shield]][release-date-url]
21
+ [![ciTest][ci-test-shield]][ci-test-url]
22
+ [![ciRelease][ci-release-shield]][ci-release-url] <br/>
23
+ [![contributors][contributors-shield]][contributors-url]
24
+ [![forks][forks-shield]][forks-url]
25
+ [![stargazers][stargazers-shield]][stargazers-url]
26
+ [![issues][issues-shield]][issues-url]
27
+
28
+ ![](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)
29
+
30
+ </div>
31
+
32
+ <details>
33
+ <summary><kbd>Table of contents</kbd></summary>
34
+
35
+ #### TOC
36
+
37
+ - [📦 Installation](#-installation)
38
+ - [⌨️ Local Development](#️-local-development)
39
+ - [🤝 Contributing](#-contributing)
40
+
41
+ ####
42
+
43
+ </details>
44
+
45
+ ## 📦 Installation
46
+
47
+ ```bash
48
+ pnpm add dumi-theme-antd-style -D
49
+ ```
50
+
51
+ <div align="right">
52
+
53
+ [![][back-to-top]](#readme-top)
54
+
55
+ </div>
56
+
57
+ ## ⌨️ Local Development
58
+
59
+ You can use Gitpod for online development:
60
+
61
+ [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)][gitpod-url]
62
+
63
+ Or clone it for local development:
64
+
65
+ ```bash
66
+ $ git clone https://github.com/lobehub/dumi-theme-lobehub.git
67
+ $ cd dumi-theme-lobehub
68
+ $ pnpm install
69
+ $ pnpm start
70
+ ```
71
+
72
+ <div align="right">
73
+
74
+ [![][back-to-top]](#readme-top)
75
+
76
+ </div>
77
+
78
+ ## 🤝 Contributing
79
+
80
+ <!-- CONTRIBUTION GROUP -->
81
+
82
+ > 📊 Total: <kbd>**5**</kbd>
83
+
84
+ <a href="https://github.com/canisminor1990" title="canisminor1990">
85
+ <img src="https://avatars.githubusercontent.com/u/17870709?v=4" width="50" />
86
+ </a>
87
+ <a href="https://github.com/arvinxx" title="arvinxx">
88
+ <img src="https://avatars.githubusercontent.com/u/28616219?v=4" width="50" />
89
+ </a>
90
+ <a href="https://github.com/apps/dependabot" title="dependabot[bot]">
91
+ <img src="https://avatars.githubusercontent.com/in/29110?v=4" width="50" />
92
+ </a>
93
+ <a href="https://github.com/actions-user" title="actions-user">
94
+ <img src="https://avatars.githubusercontent.com/u/65916846?v=4" width="50" />
95
+ </a>
96
+ <a href="https://github.com/meganjohnson96" title="meganjohnson96">
97
+ <img src="https://avatars.githubusercontent.com/u/136729222?v=4" width="50" />
98
+ </a>
99
+
100
+ <!-- CONTRIBUTION END -->
101
+
102
+ <div align="right">
103
+
104
+ [![][back-to-top]](#readme-top)
105
+
106
+ </div>
107
+
108
+ ---
109
+
110
+ #### 📝 License
111
+
112
+ Copyright © 2023 [LobeHub][profile-url]. <br />
113
+ This project is [MIT](./LICENSE) licensed.
114
+
115
+ <!-- LINK GROUP -->
116
+
117
+ [profile-url]: https://github.com/lobehub
118
+ [gitpod-url]: https://gitpod.io/#https://github.com/lobehub/dumi-theme-lobehub
119
+
120
+ <!-- SHIELD LINK GROUP -->
121
+
122
+ [back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square
123
+
124
+ <!-- release -->
125
+
126
+ [release-shield]: https://img.shields.io/npm/v/dumi-theme-lobehub?label=%F0%9F%A4%AF%20NPM
127
+ [release-url]: https://www.npmjs.com/package/dumi-theme-lobehub
128
+
129
+ <!-- releaseDate -->
130
+
131
+ [release-date-shield]: https://img.shields.io/github/release-date/lobehub/dumi-theme-lobehub?style=flat
132
+ [release-date-url]: https://github.com/lobehub/dumi-theme-lobehub/releases
133
+
134
+ <!-- ciTest -->
135
+
136
+ [ci-test-shield]: https://github.com/lobehub/dumi-theme-lobehub/workflows/Test%20CI/badge.svg
137
+ [ci-test-url]: https://github.com/lobehub/dumi-theme-lobehub/actions?query=workflow%3ATest%20CI
138
+
139
+ <!-- ciRelease -->
140
+
141
+ [ci-release-shield]: https://github.com/lobehub/dumi-theme-lobehub/workflows/Release%20CI/badge.svg
142
+ [ci-release-url]: https://github.com/lobehub/dumi-theme-lobehub/actions?query=workflow%3ARelease%20CI
143
+
144
+ <!-- contributors -->
145
+
146
+ [contributors-shield]: https://img.shields.io/github/contributors/lobehub/dumi-theme-lobehub.svg?style=flat
147
+ [contributors-url]: https://github.com/lobehub/dumi-theme-lobehub/graphs/contributors
148
+
149
+ <!-- forks -->
150
+
151
+ [forks-shield]: https://img.shields.io/github/forks/lobehub/dumi-theme-lobehub.svg?style=flat
152
+ [forks-url]: https://github.com/lobehub/dumi-theme-lobehub/network/members
153
+
154
+ <!-- stargazers -->
155
+
156
+ [stargazers-shield]: https://img.shields.io/github/stars/lobehub/dumi-theme-lobehub.svg?style=flat
157
+ [stargazers-url]: https://github.com/lobehub/dumi-theme-lobehub/stargazers
158
+
159
+ <!-- issues -->
160
+
161
+ [issues-shield]: https://img.shields.io/github/issues/lobehub/dumi-theme-lobehub.svg?style=flat
162
+ [issues-url]: https://github.com/lobehub/dumi-theme-lobehub/issues/new/choose
@@ -0,0 +1,7 @@
1
+ import { type FC, type ReactNode } from 'react';
2
+ declare const Container: FC<{
3
+ children: ReactNode;
4
+ title?: string;
5
+ type: 'info' | 'warning' | 'success' | 'error';
6
+ }>;
7
+ export default Container;
@@ -0,0 +1,28 @@
1
+ import { Alert } from 'antd';
2
+ import { useStyles } from "./style";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ var Container = function Container(_ref) {
5
+ var type = _ref.type,
6
+ title = _ref.title,
7
+ children = _ref.children;
8
+ var _useStyles = useStyles(),
9
+ styles = _useStyles.styles,
10
+ cx = _useStyles.cx;
11
+ return /*#__PURE__*/_jsx("div", {
12
+ className: styles.container,
13
+ "data-type": type,
14
+ children: /*#__PURE__*/_jsx(Alert, {
15
+ className: styles.alert,
16
+ description: /*#__PURE__*/_jsx("div", {
17
+ className: cx(styles.desc,
18
+ // 为了让 markdown 的样式生效,需要在这里添加一个额外的 class
19
+ 'markdown'),
20
+ children: children
21
+ }),
22
+ message: title || type.toUpperCase(),
23
+ showIcon: true,
24
+ type: type
25
+ })
26
+ });
27
+ };
28
+ export default Container;
@@ -0,0 +1,5 @@
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ alert: import("antd-style").SerializedStyles;
3
+ container: import("antd-style").SerializedStyles;
4
+ desc: import("antd-style").SerializedStyles;
5
+ }>;
@@ -0,0 +1,27 @@
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
+ var toCamelCase = function toCamelCase(string_) {
5
+ return string_.replaceAll(/( |^)[a-z]/g, function (L) {
6
+ return L.toUpperCase();
7
+ });
8
+ };
9
+ export var useStyles = createStyles(function (_ref) {
10
+ var token = _ref.token,
11
+ prefixCls = _ref.prefixCls,
12
+ css = _ref.css;
13
+ // 把首字母大写
14
+
15
+ var overwriteAlert = function overwriteAlert(type) {
16
+ var tokens = {
17
+ background: token["color".concat(toCamelCase(type), "Bg")],
18
+ text: token["color".concat(toCamelCase(type), "Text")]
19
+ };
20
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", "-alert-", " {\n background: ", ";\n\n .", "-alert-message {\n font-weight: bold;\n color: ", ";\n }\n\n .", "-alert-description {\n .markdown {\n color: ", ";\n }\n }\n }\n "])), prefixCls, type, tokens.background, prefixCls, tokens.text, prefixCls, tokens.text);
21
+ };
22
+ return {
23
+ alert: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border: none;\n\n .", "-alert-message {\n font-weight: bold;\n }\n "])), prefixCls),
24
+ container: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin: 8px 0;\n\n ", "\n\n ", "\n\n ", "\n\n ", "\n "])), overwriteAlert('info'), overwriteAlert('warning'), overwriteAlert('success'), overwriteAlert('error')),
25
+ desc: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n p {\n margin: 0;\n }\n "])))
26
+ };
27
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: () => import("react/jsx-runtime").JSX.Element;
2
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import { Features } from '@lobehub/ui';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export default (function () {
4
+ return /*#__PURE__*/_jsx(Features, {
5
+ items: [{
6
+ description: 'Provides a simple way to customize default themes, you can change the colors, fonts, breakpoints and everything you need.',
7
+ icon: 'Palette',
8
+ title: 'Themeable'
9
+ }, {
10
+ description: 'voids unnecessary styles props at runtime, making it more performant than other UI libraries.',
11
+ icon: 'Zap',
12
+ title: 'Fast'
13
+ }, {
14
+ description: 'Automatic dark mode recognition, NextUI automatically changes the theme when detects HTML theme prop changes.',
15
+ icon: 'MoonStar',
16
+ title: 'Light & Dark UI'
17
+ }]
18
+ });
19
+ });
@@ -0,0 +1,8 @@
1
+ import { IPreviewerProps } from 'dumi/dist/client/theme-api/types';
2
+ export interface PreviewerProps extends IPreviewerProps {
3
+ center?: boolean;
4
+ nopadding?: boolean;
5
+ pure?: boolean;
6
+ }
7
+ declare const _default: ({ center, codePlacement, nopadding, pure, ...props }: PreviewerProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default _default;
@@ -0,0 +1,26 @@
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 = ["center", "codePlacement", "nopadding", "pure"];
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 Previewer from 'dumi/theme-default/builtins/Previewer';
11
+ import { useStyles } from "./style";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ export default (function (_ref) {
14
+ var center = _ref.center,
15
+ codePlacement = _ref.codePlacement,
16
+ nopadding = _ref.nopadding,
17
+ pure = _ref.pure,
18
+ props = _objectWithoutProperties(_ref, _excluded);
19
+ var _useStyles = useStyles(pure),
20
+ styles = _useStyles.styles,
21
+ cx = _useStyles.cx;
22
+ return /*#__PURE__*/_jsx("div", {
23
+ className: cx(styles.container, pure && styles.pure, center && styles.center, nopadding && styles.nopadding, styles[codePlacement]),
24
+ children: /*#__PURE__*/_jsx(Previewer, _objectSpread({}, props))
25
+ });
26
+ });
@@ -0,0 +1,9 @@
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ center: import("antd-style").SerializedStyles;
3
+ container: import("antd-style").SerializedStyles;
4
+ left: import("antd-style").SerializedStyles;
5
+ nopadding: import("antd-style").SerializedStyles;
6
+ pure: import("antd-style").SerializedStyles;
7
+ right: import("antd-style").SerializedStyles;
8
+ top: import("antd-style").SerializedStyles;
9
+ }>;
@@ -0,0 +1,18 @@
1
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
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
+ import { rgba } from 'polished';
5
+ export var useStyles = createStyles(function (_ref) {
6
+ var css = _ref.css,
7
+ token = _ref.token,
8
+ prefixCls = _ref.prefixCls;
9
+ return {
10
+ center: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .dumi-default-previewer-demo {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n "]))),
11
+ container: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .dumi-default-previewer {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n border-color: ", ";\n\n &-demo {\n flex: 1;\n\n &[data-iframe]::before {\n background: ", ";\n }\n }\n\n &-meta {\n flex: 1;\n border-color: ", ";\n\n .", "-highlighter {\n pre {\n border-radius: 0 !important;\n }\n }\n }\n\n &-actions:not(:last-child) {\n border-color: ", ";\n }\n\n &-desc {\n .markdown {\n border-color: ", ";\n }\n\n h5 {\n background: linear-gradient(\n to top,\n ", ",\n ", " 50%,\n ", " 100%\n );\n\n a {\n color: ", ";\n }\n }\n }\n\n &-tabs::after {\n border-color: ", ";\n }\n }\n\n .dumi-default-tabs-tab {\n &-btn {\n color: ", ";\n }\n\n &-active {\n .dumi-default-tabs-tab-btn {\n color: ", ";\n }\n }\n }\n "])), token.colorBorderSecondary, token.colorFillContent, token.colorBorderSecondary, prefixCls, token.colorBorderSecondary, token.colorBorderSecondary, token.colorBgContainer, rgba(token.colorBgContainer, 0.95), rgba(token.colorBgContainer, 0), token.colorText, token.colorBorderSecondary, token.colorTextTertiary, token.colorText),
12
+ left: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .dumi-default-previewer {\n flex-direction: row-reverse;\n\n &-demo {\n width: 50%;\n border-left: 1px solid ", ";\n }\n\n &-meta {\n width: 50%;\n }\n }\n "])), token.colorBorderSecondary),
13
+ nopadding: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .dumi-default-previewer-demo {\n padding: 0;\n }\n "]))),
14
+ pure: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n .dumi-default-previewer {\n margin: 0;\n padding: 0;\n border: none;\n }\n\n .dumi-default-previewer-demo {\n padding: 0;\n }\n\n .dumi-default-previewer-meta {\n display: none;\n }\n "]))),
15
+ right: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .dumi-default-previewer {\n flex-direction: row;\n\n &-demo {\n width: 50%;\n border-right: 1px solid ", ";\n }\n\n &-meta {\n width: 50%;\n }\n }\n "])), token.colorBorderSecondary),
16
+ top: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n .dumi-default-previewer {\n flex-direction: column-reverse;\n\n &-meta {\n display: flex;\n flex-direction: column;\n }\n\n &-actions {\n order: 1;\n }\n\n &-desc {\n order: 2;\n }\n }\n "])))
17
+ };
18
+ });
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ interface SourceCodeProps {
3
+ children: string;
4
+ lang: string;
5
+ }
6
+ declare const SourceCode: FC<SourceCodeProps>;
7
+ export default SourceCode;
@@ -0,0 +1,17 @@
1
+ import { Highlighter } from '@lobehub/ui';
2
+ import { useTheme } from 'antd-style';
3
+ import { rgba } from 'polished';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ var SourceCode = function SourceCode(_ref) {
6
+ var children = _ref.children,
7
+ lang = _ref.lang;
8
+ var theme = useTheme();
9
+ return /*#__PURE__*/_jsx(Highlighter, {
10
+ language: lang,
11
+ style: {
12
+ background: rgba(theme.colorBgLayout, 0.5)
13
+ },
14
+ children: children
15
+ });
16
+ };
17
+ export default SourceCode;
@@ -0,0 +1,77 @@
1
+ import { type ReactNode } from 'react';
2
+ /**
3
+ * @title ApiHeaderProps
4
+ * @category Props
5
+ * @description ApiHeader 组件的 props 类型定义
6
+ */
7
+ export interface ApiHeaderProps {
8
+ /**
9
+ * @title 组件名
10
+ * @description ApiHeader 组件的名称
11
+ */
12
+ componentName?: string;
13
+ /**
14
+ * @title 是否默认导入
15
+ * @description 是否默认导入组件
16
+ * @default false
17
+ */
18
+ defaultImport?: boolean;
19
+ /**
20
+ * @title 描述
21
+ * @description ApiHeader 组件的描述信息
22
+ */
23
+ description?: string;
24
+ /**
25
+ * @title 文档链接
26
+ * @description ApiHeader 组件文档的链接
27
+ */
28
+ docUrl?: string;
29
+ /**
30
+ * @title 包名
31
+ * @description ApiHeader 组件所在的包名
32
+ */
33
+ pkg?: string;
34
+ /**
35
+ * @title 源代码链接
36
+ * @description ApiHeader 组件源代码的链接
37
+ */
38
+ sourceUrl?: string;
39
+ /**
40
+ * @title 标题
41
+ * @description ApiHeader 组件的标题
42
+ */
43
+ title: string;
44
+ }
45
+ /**
46
+ * @title ApiHeader 配置项
47
+ */
48
+ export interface ApiTitleProps extends ApiHeaderProps {
49
+ /**
50
+ * @title 服务列表
51
+ * @description 可选,若存在则展示 API 服务列表
52
+ */
53
+ serviceList?: ServiceItem[];
54
+ /**
55
+ * @title 标题
56
+ */
57
+ title: string;
58
+ }
59
+ export interface ServiceItem {
60
+ /**
61
+ * @title 服务描述
62
+ */
63
+ children: string;
64
+ /**
65
+ * @title 服务图标
66
+ */
67
+ icon: ReactNode;
68
+ /**
69
+ * @title 服务标签
70
+ */
71
+ label: string;
72
+ /**
73
+ * @title 服务链接
74
+ */
75
+ url: string;
76
+ }
77
+ export declare const ApiHeader: import("react").NamedExoticComponent<ApiTitleProps>;
@@ -0,0 +1,124 @@
1
+ import { Icon, Snippet } from '@lobehub/ui';
2
+ import { Divider, Space, Typography } from 'antd';
3
+ import { useResponsive } from 'antd-style';
4
+ import { Edit3, Github } from 'lucide-react';
5
+ import { memo } from 'react';
6
+ import { Flexbox } from 'react-layout-kit';
7
+ import { useStyles } from "./style";
8
+
9
+ /**
10
+ * @title ApiHeaderProps
11
+ * @category Props
12
+ * @description ApiHeader 组件的 props 类型定义
13
+ */
14
+
15
+ /**
16
+ * @title ApiHeader 配置项
17
+ */
18
+ import { jsx as _jsx } from "react/jsx-runtime";
19
+ import { jsxs as _jsxs } from "react/jsx-runtime";
20
+ export var ApiHeader = /*#__PURE__*/memo(function (_ref) {
21
+ var title = _ref.title,
22
+ componentName = _ref.componentName,
23
+ description = _ref.description,
24
+ defaultImport = _ref.defaultImport,
25
+ pkg = _ref.pkg,
26
+ sourceUrl = _ref.sourceUrl,
27
+ docUrl = _ref.docUrl,
28
+ _ref$serviceList = _ref.serviceList,
29
+ serviceList = _ref$serviceList === void 0 ? [] : _ref$serviceList;
30
+ var _useStyles = useStyles(),
31
+ styles = _useStyles.styles;
32
+ var _useResponsive = useResponsive(),
33
+ mobile = _useResponsive.mobile;
34
+ var items = [sourceUrl && {
35
+ children: 'Source',
36
+ icon: /*#__PURE__*/_jsx(Icon, {
37
+ icon: Github
38
+ }),
39
+ url: sourceUrl
40
+ }, docUrl && {
41
+ children: 'Edit',
42
+ icon: /*#__PURE__*/_jsx(Icon, {
43
+ icon: Edit3
44
+ }),
45
+ url: docUrl
46
+ }].filter(Boolean);
47
+ var importString = defaultImport ? "import ".concat(componentName, " from '").concat(pkg, "';") : "import { ".concat(componentName, " } from '").concat(pkg, "';");
48
+ return /*#__PURE__*/_jsxs(Flexbox, {
49
+ id: 'api-header',
50
+ children: [/*#__PURE__*/_jsx(Typography.Title, {
51
+ className: styles.title,
52
+ children: title
53
+ }), description && /*#__PURE__*/_jsx("div", {
54
+ children: /*#__PURE__*/_jsx(Typography.Text, {
55
+ className: styles.desc,
56
+ type: 'secondary',
57
+ children: description
58
+ })
59
+ }), /*#__PURE__*/_jsxs(Flexbox, {
60
+ gap: mobile ? 16 : 24,
61
+ style: {
62
+ marginTop: 16
63
+ },
64
+ children: [componentName && /*#__PURE__*/_jsx("div", {
65
+ style: {
66
+ display: 'flex'
67
+ },
68
+ children: /*#__PURE__*/_jsx(Snippet, {
69
+ spotlight: true,
70
+ children: importString
71
+ })
72
+ }), /*#__PURE__*/_jsx(Divider, {
73
+ dashed: true,
74
+ style: {
75
+ margin: '2px 0'
76
+ }
77
+ }), /*#__PURE__*/_jsxs(Flexbox, {
78
+ distribution: 'space-between',
79
+ gap: mobile ? 24 : 0,
80
+ horizontal: !mobile,
81
+ children: [/*#__PURE__*/_jsx(Space, {
82
+ split: /*#__PURE__*/_jsx(Divider, {
83
+ type: 'vertical'
84
+ }),
85
+ wrap: true,
86
+ children: serviceList.map(function (item) {
87
+ return /*#__PURE__*/_jsx("a", {
88
+ href: item.url,
89
+ rel: "noreferrer",
90
+ target: '_blank',
91
+ title: item.label,
92
+ children: /*#__PURE__*/_jsxs(Flexbox, {
93
+ align: 'center',
94
+ className: styles.text,
95
+ gap: 8,
96
+ horizontal: true,
97
+ children: [item.icon, item.children]
98
+ })
99
+ }, item.label);
100
+ })
101
+ }), /*#__PURE__*/_jsx(Space, {
102
+ className: styles.meta,
103
+ split: /*#__PURE__*/_jsx(Divider, {
104
+ type: 'vertical'
105
+ }),
106
+ children: items.map(function (item, index) {
107
+ return /*#__PURE__*/_jsx("a", {
108
+ href: item.url,
109
+ rel: "noreferrer",
110
+ target: '_blank',
111
+ children: /*#__PURE__*/_jsxs(Flexbox, {
112
+ align: 'center',
113
+ className: styles.text,
114
+ gap: 8,
115
+ horizontal: true,
116
+ children: [item.icon, item.children]
117
+ })
118
+ }, index);
119
+ })
120
+ })]
121
+ })]
122
+ })]
123
+ });
124
+ });
@@ -0,0 +1,7 @@
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ desc: import("antd-style").SerializedStyles;
3
+ label: import("antd-style").SerializedStyles;
4
+ meta: import("antd-style").SerializedStyles;
5
+ text: import("antd-style").SerializedStyles;
6
+ title: import("antd-style").SerializedStyles;
7
+ }>;
@@ -0,0 +1,16 @@
1
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
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
+ token = _ref.token,
7
+ r = _ref.responsive,
8
+ stylish = _ref.stylish;
9
+ return {
10
+ desc: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: ", "px;\n "])), token.fontSizeLG, token.lineHeightLG),
11
+ label: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 80px;\n "]))),
12
+ meta: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral([""]))),
13
+ text: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", "\n "])), stylish.resetLinkColor),
14
+ title: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n ", " {\n margin-block: 0;\n font-size: 32px !important;\n }\n "])), r.mobile)
15
+ };
16
+ });
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const Favicons: import("react").MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
3
+ export default Favicons;
@@ -0,0 +1,43 @@
1
+ import { Helmet } from 'dumi';
2
+ import { memo } from 'react';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
+ var Favicons = /*#__PURE__*/memo(function () {
6
+ return /*#__PURE__*/_jsxs(Helmet, {
7
+ children: [/*#__PURE__*/_jsx("link", {
8
+ href: "https://npm.elemecdn.com/@lobehub/assets-favicons/assets/apple-touch-icon.png",
9
+ rel: "apple-touch-icon",
10
+ sizes: "180x180"
11
+ }), /*#__PURE__*/_jsx("link", {
12
+ href: "https://npm.elemecdn.com/@lobehub/assets-favicons/assets/favicon-32x32.png",
13
+ rel: "icon",
14
+ sizes: "32x32",
15
+ type: "image/png"
16
+ }), /*#__PURE__*/_jsx("link", {
17
+ href: "https://npm.elemecdn.com/@lobehub/assets-favicons/assets/favicon-16x16.png",
18
+ rel: "icon",
19
+ sizes: "16x16",
20
+ type: "image/png"
21
+ }), /*#__PURE__*/_jsx("link", {
22
+ href: "https://npm.elemecdn.com/@lobehub/assets-favicons/assets/site.webmanifest",
23
+ rel: "manifest"
24
+ }), /*#__PURE__*/_jsx("link", {
25
+ color: "#000000",
26
+ href: "https://npm.elemecdn.com/@lobehub/assets-favicons/assets/safari-pinned-tab.svg",
27
+ rel: "mask-icon"
28
+ }), /*#__PURE__*/_jsx("meta", {
29
+ content: "LobeHub",
30
+ name: "apple-mobile-web-app-title"
31
+ }), /*#__PURE__*/_jsx("meta", {
32
+ content: "LobeHub",
33
+ name: "application-name"
34
+ }), /*#__PURE__*/_jsx("meta", {
35
+ content: "#000000",
36
+ name: "msapplication-TileColor"
37
+ }), /*#__PURE__*/_jsx("meta", {
38
+ content: "#000000",
39
+ name: "theme-color"
40
+ })]
41
+ });
42
+ });
43
+ export default Favicons;