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,12 @@
|
|
|
1
|
+
import { ForwardedRef } from 'react';
|
|
2
|
+
interface SelectItemProps {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
isActive?: boolean;
|
|
5
|
+
isSelected?: boolean;
|
|
6
|
+
label: any;
|
|
7
|
+
prefixCls: string;
|
|
8
|
+
ref?: ForwardedRef<HTMLButtonElement>;
|
|
9
|
+
value: any;
|
|
10
|
+
}
|
|
11
|
+
declare const SelectItem: import("react").NamedExoticComponent<SelectItemProps>;
|
|
12
|
+
export default SelectItem;
|
|
@@ -0,0 +1,37 @@
|
|
|
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 = ["value", "label", "prefixCls", "isSelected", "isActive", "disabled"];
|
|
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 { forwardRef, memo } from 'react';
|
|
11
|
+
import { useStyles } from "./style";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
var SelectItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, reference) {
|
|
14
|
+
var _cx;
|
|
15
|
+
var value = _ref.value,
|
|
16
|
+
label = _ref.label,
|
|
17
|
+
prefixCls = _ref.prefixCls,
|
|
18
|
+
isSelected = _ref.isSelected,
|
|
19
|
+
isActive = _ref.isActive,
|
|
20
|
+
disabled = _ref.disabled,
|
|
21
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
+
var _useStyles = useStyles(prefixCls),
|
|
23
|
+
styles = _useStyles.styles,
|
|
24
|
+
cx = _useStyles.cx;
|
|
25
|
+
return /*#__PURE__*/_jsx("button", _objectSpread(_objectSpread({
|
|
26
|
+
"aria-selected": isSelected,
|
|
27
|
+
className: cx(styles.item, (_cx = {}, _defineProperty(_cx, styles.selected, isSelected), _defineProperty(_cx, styles.active, isActive), _cx)),
|
|
28
|
+
disabled: disabled,
|
|
29
|
+
ref: reference,
|
|
30
|
+
role: "option",
|
|
31
|
+
tabIndex: -1,
|
|
32
|
+
type: 'button'
|
|
33
|
+
}, props), {}, {
|
|
34
|
+
children: label
|
|
35
|
+
}), value);
|
|
36
|
+
}));
|
|
37
|
+
export default SelectItem;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
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, prefixCls) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
cx = _ref.cx,
|
|
7
|
+
token = _ref.token;
|
|
8
|
+
return {
|
|
9
|
+
active: cx("".concat(prefixCls, "-item-active"), css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: ", ";\n "])), token.colorFillTertiary)),
|
|
10
|
+
item: cx("".concat(prefixCls, "-item"), css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n all: unset;\n\n user-select: none;\n scroll-margin: 50px;\n\n display: block;\n\n box-sizing: inherit;\n width: 100%;\n padding: 12px 10px;\n\n font-family: ", ";\n font-weight: normal;\n line-height: 1;\n color: ", ";\n\n background: transparent;\n border-radius: 5px;\n\n &:hover {\n background: ", ";\n }\n "])), token.fontFamily, token.colorText, token.colorFillTertiary)),
|
|
11
|
+
selected: cx("".concat(prefixCls, "-item-selected"), css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-weight: bold;\n color: ", ";\n background: ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n "])), token.colorPrimaryText, token.colorPrimaryBg, token.colorPrimaryTextHover, token.colorPrimaryBgHover))
|
|
12
|
+
};
|
|
13
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
interface OptionType {
|
|
3
|
+
icon?: ReactNode;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
value: string | number | null;
|
|
6
|
+
}
|
|
7
|
+
export interface NativeSelectProps {
|
|
8
|
+
onChange?: (index: number) => void;
|
|
9
|
+
options?: OptionType[];
|
|
10
|
+
prefixCls?: string;
|
|
11
|
+
renderItem?: (item: OptionType, index: number) => ReactNode;
|
|
12
|
+
renderValue?: (index: number) => ReactNode;
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
value?: number;
|
|
15
|
+
}
|
|
16
|
+
declare const NativeSelect: import("react").NamedExoticComponent<NativeSelectProps>;
|
|
17
|
+
export default NativeSelect;
|
|
@@ -0,0 +1,248 @@
|
|
|
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
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import { FloatingFocusManager, FloatingOverlay, FloatingPortal, autoUpdate, flip, inner, offset, shift, size, useClick, useDismiss, useFloating, useInnerOffset, useInteractions, useListNavigation, useRole, useTypeahead } from '@floating-ui/react';
|
|
14
|
+
import { memo, useEffect, useRef, useState } from 'react';
|
|
15
|
+
import useControlledState from 'use-merge-value';
|
|
16
|
+
import SelectItem from "./SelectItem";
|
|
17
|
+
import { useStyles } from "./style";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
20
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
var NativeSelect = /*#__PURE__*/memo(function (_ref) {
|
|
22
|
+
var _ref$options = _ref.options,
|
|
23
|
+
options = _ref$options === void 0 ? [] : _ref$options,
|
|
24
|
+
value = _ref.value,
|
|
25
|
+
prefixCls = _ref.prefixCls,
|
|
26
|
+
onChange = _ref.onChange,
|
|
27
|
+
renderValue = _ref.renderValue,
|
|
28
|
+
renderItem = _ref.renderItem,
|
|
29
|
+
style = _ref.style;
|
|
30
|
+
var cls = prefixCls !== null && prefixCls !== void 0 ? prefixCls : 'native-select';
|
|
31
|
+
var _useControlledState = useControlledState(0, {
|
|
32
|
+
onChange: onChange,
|
|
33
|
+
value: value
|
|
34
|
+
}),
|
|
35
|
+
_useControlledState2 = _slicedToArray(_useControlledState, 2),
|
|
36
|
+
selectedIndex = _useControlledState2[0],
|
|
37
|
+
setSelectedIndex = _useControlledState2[1];
|
|
38
|
+
var _useStyles = useStyles(cls),
|
|
39
|
+
styles = _useStyles.styles;
|
|
40
|
+
var listReference = useRef([]);
|
|
41
|
+
var listContentReference = useRef([]);
|
|
42
|
+
var overflowReference = useRef(null);
|
|
43
|
+
var allowSelectReference = useRef(false);
|
|
44
|
+
var allowMouseUpReference = useRef(true);
|
|
45
|
+
var selectTimeoutReference = useRef();
|
|
46
|
+
var scrollReference = useRef(null);
|
|
47
|
+
var _useState = useState(false),
|
|
48
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
49
|
+
open = _useState2[0],
|
|
50
|
+
setOpen = _useState2[1];
|
|
51
|
+
var _useState3 = useState(null),
|
|
52
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
53
|
+
activeIndex = _useState4[0],
|
|
54
|
+
setActiveIndex = _useState4[1];
|
|
55
|
+
var _useState5 = useState(false),
|
|
56
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
57
|
+
fallback = _useState6[0],
|
|
58
|
+
setFallback = _useState6[1];
|
|
59
|
+
var _useState7 = useState(0),
|
|
60
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
61
|
+
innerOffset = _useState8[0],
|
|
62
|
+
setInnerOffset = _useState8[1];
|
|
63
|
+
var _useState9 = useState(false),
|
|
64
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
65
|
+
touch = _useState10[0],
|
|
66
|
+
setTouch = _useState10[1];
|
|
67
|
+
var _useState11 = useState(false),
|
|
68
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
69
|
+
blockSelection = _useState12[0],
|
|
70
|
+
setBlockSelection = _useState12[1];
|
|
71
|
+
if (!open) {
|
|
72
|
+
if (innerOffset !== 0) setInnerOffset(0);
|
|
73
|
+
if (fallback) setFallback(false);
|
|
74
|
+
if (blockSelection) setBlockSelection(false);
|
|
75
|
+
}
|
|
76
|
+
var _useFloating = useFloating({
|
|
77
|
+
middleware: fallback ? [offset(5), touch ? shift({
|
|
78
|
+
crossAxis: true,
|
|
79
|
+
padding: 10
|
|
80
|
+
}) : flip({
|
|
81
|
+
padding: 10
|
|
82
|
+
}), size({
|
|
83
|
+
apply: function apply(_ref2) {
|
|
84
|
+
var _scrollReference$curr, _scrollReference$curr2;
|
|
85
|
+
var availableHeight = _ref2.availableHeight;
|
|
86
|
+
Object.assign((_scrollReference$curr = (_scrollReference$curr2 = scrollReference.current) === null || _scrollReference$curr2 === void 0 ? void 0 : _scrollReference$curr2.style) !== null && _scrollReference$curr !== void 0 ? _scrollReference$curr : {}, {
|
|
87
|
+
maxHeight: "".concat(availableHeight, "px")
|
|
88
|
+
});
|
|
89
|
+
},
|
|
90
|
+
padding: 10
|
|
91
|
+
})] : [inner({
|
|
92
|
+
index: selectedIndex,
|
|
93
|
+
listRef: listReference,
|
|
94
|
+
minItemsVisible: touch ? 8 : 4,
|
|
95
|
+
offset: innerOffset,
|
|
96
|
+
onFallbackChange: setFallback,
|
|
97
|
+
overflowRef: overflowReference,
|
|
98
|
+
padding: 10,
|
|
99
|
+
referenceOverflowThreshold: 20,
|
|
100
|
+
scrollRef: scrollReference
|
|
101
|
+
}), offset({
|
|
102
|
+
crossAxis: -4
|
|
103
|
+
})],
|
|
104
|
+
onOpenChange: setOpen,
|
|
105
|
+
open: open,
|
|
106
|
+
placement: 'bottom-start',
|
|
107
|
+
whileElementsMounted: autoUpdate
|
|
108
|
+
}),
|
|
109
|
+
x = _useFloating.x,
|
|
110
|
+
y = _useFloating.y,
|
|
111
|
+
strategy = _useFloating.strategy,
|
|
112
|
+
refs = _useFloating.refs,
|
|
113
|
+
context = _useFloating.context;
|
|
114
|
+
var _useInteractions = useInteractions([useClick(context, {
|
|
115
|
+
event: 'mousedown'
|
|
116
|
+
}), useDismiss(context), useRole(context, {
|
|
117
|
+
role: 'listbox'
|
|
118
|
+
}), useInnerOffset(context, {
|
|
119
|
+
enabled: !fallback,
|
|
120
|
+
onChange: setInnerOffset,
|
|
121
|
+
overflowRef: overflowReference,
|
|
122
|
+
scrollRef: scrollReference
|
|
123
|
+
}), useListNavigation(context, {
|
|
124
|
+
activeIndex: activeIndex,
|
|
125
|
+
listRef: listReference,
|
|
126
|
+
onNavigate: setActiveIndex,
|
|
127
|
+
selectedIndex: selectedIndex
|
|
128
|
+
}), useTypeahead(context, {
|
|
129
|
+
activeIndex: activeIndex,
|
|
130
|
+
listRef: listContentReference,
|
|
131
|
+
onMatch: open ? setActiveIndex : setSelectedIndex
|
|
132
|
+
})]),
|
|
133
|
+
getReferenceProps = _useInteractions.getReferenceProps,
|
|
134
|
+
getFloatingProps = _useInteractions.getFloatingProps,
|
|
135
|
+
getItemProps = _useInteractions.getItemProps;
|
|
136
|
+
useEffect(function () {
|
|
137
|
+
if (open) {
|
|
138
|
+
selectTimeoutReference.current = setTimeout(function () {
|
|
139
|
+
allowSelectReference.current = true;
|
|
140
|
+
}, 300);
|
|
141
|
+
return function () {
|
|
142
|
+
clearTimeout(selectTimeoutReference.current);
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
allowSelectReference.current = false;
|
|
146
|
+
allowMouseUpReference.current = true;
|
|
147
|
+
}, [open]);
|
|
148
|
+
var _ref3 = options[selectedIndex] || {},
|
|
149
|
+
label = _ref3.label;
|
|
150
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
151
|
+
children: [/*#__PURE__*/_jsx("button", _objectSpread(_objectSpread({
|
|
152
|
+
"aria-label": 'selected-item',
|
|
153
|
+
className: styles.button,
|
|
154
|
+
ref: refs.setReference,
|
|
155
|
+
style: style,
|
|
156
|
+
type: 'button'
|
|
157
|
+
}, getReferenceProps({
|
|
158
|
+
onPointerMove: function onPointerMove(_ref4) {
|
|
159
|
+
var pointerType = _ref4.pointerType;
|
|
160
|
+
if (pointerType === 'mouse') {
|
|
161
|
+
setTouch(false);
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
onTouchStart: function onTouchStart() {
|
|
165
|
+
setTouch(true);
|
|
166
|
+
}
|
|
167
|
+
})), {}, {
|
|
168
|
+
children: renderValue ? renderValue(selectedIndex) : label
|
|
169
|
+
})), /*#__PURE__*/_jsx(FloatingPortal, {
|
|
170
|
+
children: open && /*#__PURE__*/_jsx(FloatingOverlay, {
|
|
171
|
+
lockScroll: !touch,
|
|
172
|
+
style: {
|
|
173
|
+
zIndex: 3000
|
|
174
|
+
},
|
|
175
|
+
children: /*#__PURE__*/_jsx(FloatingFocusManager, {
|
|
176
|
+
context: context,
|
|
177
|
+
initialFocus: -1,
|
|
178
|
+
modal: false,
|
|
179
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
180
|
+
ref: refs.setFloating,
|
|
181
|
+
style: {
|
|
182
|
+
left: x !== null && x !== void 0 ? x : 0,
|
|
183
|
+
position: strategy,
|
|
184
|
+
top: y !== null && y !== void 0 ? y : 0
|
|
185
|
+
},
|
|
186
|
+
children: /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
|
|
187
|
+
className: styles.container,
|
|
188
|
+
ref: scrollReference,
|
|
189
|
+
style: {
|
|
190
|
+
overflowY: 'auto'
|
|
191
|
+
}
|
|
192
|
+
}, getFloatingProps({
|
|
193
|
+
onContextMenu: function onContextMenu(e) {
|
|
194
|
+
e.preventDefault();
|
|
195
|
+
}
|
|
196
|
+
})), {}, {
|
|
197
|
+
children: options.map(function (item, index) {
|
|
198
|
+
return /*#__PURE__*/_jsx(SelectItem, _objectSpread({
|
|
199
|
+
disabled: blockSelection,
|
|
200
|
+
isActive: index === activeIndex,
|
|
201
|
+
isSelected: index === selectedIndex,
|
|
202
|
+
label: renderItem ? renderItem(item, index) : item.label,
|
|
203
|
+
prefixCls: cls,
|
|
204
|
+
ref: function ref(node) {
|
|
205
|
+
listReference.current[index] = node;
|
|
206
|
+
listContentReference.current[index] = item.label;
|
|
207
|
+
},
|
|
208
|
+
value: item.value
|
|
209
|
+
}, getItemProps({
|
|
210
|
+
onClick: function onClick() {
|
|
211
|
+
if (allowSelectReference.current) {
|
|
212
|
+
setSelectedIndex(index);
|
|
213
|
+
setOpen(false);
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
onKeyDown: function onKeyDown() {
|
|
217
|
+
allowSelectReference.current = true;
|
|
218
|
+
},
|
|
219
|
+
onMouseUp: function onMouseUp() {
|
|
220
|
+
if (!allowMouseUpReference.current) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (allowSelectReference.current) {
|
|
224
|
+
setSelectedIndex(index);
|
|
225
|
+
setOpen(false);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// On touch devices, prevent the element from
|
|
229
|
+
// immediately closing `onClick` by deferring it
|
|
230
|
+
clearTimeout(selectTimeoutReference.current);
|
|
231
|
+
selectTimeoutReference.current = setTimeout(function () {
|
|
232
|
+
allowSelectReference.current = true;
|
|
233
|
+
});
|
|
234
|
+
},
|
|
235
|
+
onTouchStart: function onTouchStart() {
|
|
236
|
+
allowSelectReference.current = true;
|
|
237
|
+
allowMouseUpReference.current = false;
|
|
238
|
+
}
|
|
239
|
+
})), item.value);
|
|
240
|
+
})
|
|
241
|
+
}))
|
|
242
|
+
})
|
|
243
|
+
})
|
|
244
|
+
})
|
|
245
|
+
})]
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
export default NativeSelect;
|
|
@@ -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, prefixCls) {
|
|
5
|
+
var css = _ref.css,
|
|
6
|
+
stylish = _ref.stylish,
|
|
7
|
+
cx = _ref.cx,
|
|
8
|
+
token = _ref.token;
|
|
9
|
+
return {
|
|
10
|
+
button: cx("".concat(prefixCls, "-button"), css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n all: unset;\n\n cursor: default;\n user-select: none;\n\n padding: 8px;\n\n font-size: ", "px;\n line-height: 0;\n color: ", ";\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n\n -webkit-tap-highlight-color: transparent;\n\n &:focus-visible {\n border-color: ", ";\n box-shadow: 0 0 0 2px ", ";\n }\n "])), stylish.buttonDefaultHover, token.fontSize, token.colorTextSecondary, token.colorBgContainer, token.colorBorder, token.borderRadius, token.colorPrimary, token.colorPrimaryBg)),
|
|
11
|
+
container: cx(prefixCls, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n user-select: none;\n scrollbar-width: none;\n\n overflow-y: auto;\n overscroll-behavior: contain;\n\n box-sizing: border-box;\n width: 160px;\n padding: 5px;\n\n font-size: ", ";\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: 8px;\n outline: 0;\n box-shadow: ", ";\n\n &::-webkit-scrollbar {\n display: none;\n }\n "])), token.fontSize, token.colorBgElevated, token.colorBorder, token.boxShadowSecondary))
|
|
12
|
+
};
|
|
13
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const StoreUpdater: () => boolean;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
var _excluded = ["setLoading"],
|
|
2
|
+
_excluded2 = ["setLoading"];
|
|
3
|
+
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); }
|
|
4
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
|
+
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."); }
|
|
6
|
+
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); }
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
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; }
|
|
13
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
+
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); }
|
|
15
|
+
import { useDebounceEffect } from 'ahooks';
|
|
16
|
+
import { useLocale, useLocation, useNavData, useRouteMeta, useSidebarData, useSiteData, useTabMeta } from 'dumi';
|
|
17
|
+
import isEqual from 'fast-deep-equal';
|
|
18
|
+
import React, { useEffect } from 'react';
|
|
19
|
+
import { useSiteStore } from "../../store/useSiteStore";
|
|
20
|
+
var isBrowser = typeof window !== 'undefined';
|
|
21
|
+
var SSRInit = {};
|
|
22
|
+
var useReact18xUpdater = function useReact18xUpdater(effect, deps) {
|
|
23
|
+
useEffect(function () {
|
|
24
|
+
React.startTransition(function () {
|
|
25
|
+
effect();
|
|
26
|
+
});
|
|
27
|
+
}, deps);
|
|
28
|
+
};
|
|
29
|
+
var useLegacyUpdater = function useLegacyUpdater(effect, deps) {
|
|
30
|
+
useDebounceEffect(function () {
|
|
31
|
+
effect();
|
|
32
|
+
}, deps, {
|
|
33
|
+
maxWait: 96,
|
|
34
|
+
wait: 32
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var useUpdater = typeof React.startTransition === 'function' ? useReact18xUpdater : useLegacyUpdater;
|
|
38
|
+
var useSyncState = function useSyncState(key, value, updateMethod) {
|
|
39
|
+
var updater = updateMethod ? updateMethod : function (key, value) {
|
|
40
|
+
return useSiteStore.setState(_defineProperty({}, key, value));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// 如果是 Node 环境,直接更新一次 store
|
|
44
|
+
// 但是为了避免多次更新 store,所以加一个标记
|
|
45
|
+
if (!isBrowser && !SSRInit[key]) {
|
|
46
|
+
updater(key, value);
|
|
47
|
+
SSRInit[key] = true;
|
|
48
|
+
}
|
|
49
|
+
useUpdater(function () {
|
|
50
|
+
updater(key, value);
|
|
51
|
+
}, [value]);
|
|
52
|
+
};
|
|
53
|
+
var homeNav = {
|
|
54
|
+
activePath: '/',
|
|
55
|
+
link: '/',
|
|
56
|
+
title: 'Home'
|
|
57
|
+
};
|
|
58
|
+
export var StoreUpdater = function StoreUpdater() {
|
|
59
|
+
var siteData = useSiteData();
|
|
60
|
+
var sidebar = useSidebarData();
|
|
61
|
+
var routeMeta = useRouteMeta();
|
|
62
|
+
var tabMeta = useTabMeta();
|
|
63
|
+
var navData = useNavData();
|
|
64
|
+
var location = useLocation();
|
|
65
|
+
var locale = useLocale();
|
|
66
|
+
useSyncState('siteData', siteData, function () {
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
68
|
+
var setLoading = siteData.setLoading,
|
|
69
|
+
data = _objectWithoutProperties(siteData, _excluded);
|
|
70
|
+
var _useSiteStore$getStat = useSiteStore.getState(),
|
|
71
|
+
_useSiteStore$getStat2 = _useSiteStore$getStat.siteData,
|
|
72
|
+
_ = _useSiteStore$getStat2.setLoading,
|
|
73
|
+
previousData = _objectWithoutProperties(_useSiteStore$getStat2, _excluded2);
|
|
74
|
+
if (isEqual(data, previousData)) return;
|
|
75
|
+
useSiteStore.setState({
|
|
76
|
+
siteData: siteData
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
useSyncState('sidebar', sidebar);
|
|
80
|
+
useSyncState('routeMeta', routeMeta);
|
|
81
|
+
useSyncState('location', location);
|
|
82
|
+
useSyncState('tabMeta', tabMeta);
|
|
83
|
+
useSyncState('locale', locale);
|
|
84
|
+
useSyncState('navData', navData, function () {
|
|
85
|
+
var data = siteData.themeConfig.hideHomeNav ? navData : [homeNav].concat(_toConsumableArray(navData));
|
|
86
|
+
useSiteStore.setState({
|
|
87
|
+
navData: data
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
return false;
|
|
91
|
+
};
|
package/dist/config.d.ts
ADDED
package/dist/config.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
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 { useCallback, useEffect, useMemo, useState } from 'react';
|
|
8
|
+
export var useCopied = function useCopied() {
|
|
9
|
+
var _useState = useState(false),
|
|
10
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
11
|
+
copied = _useState2[0],
|
|
12
|
+
setCopy = _useState2[1];
|
|
13
|
+
useEffect(function () {
|
|
14
|
+
if (!copied) return;
|
|
15
|
+
var timer = setTimeout(function () {
|
|
16
|
+
setCopy(false);
|
|
17
|
+
}, 2000);
|
|
18
|
+
return function () {
|
|
19
|
+
clearTimeout(timer);
|
|
20
|
+
};
|
|
21
|
+
}, [copied]);
|
|
22
|
+
var setCopied = useCallback(function () {
|
|
23
|
+
return setCopy(true);
|
|
24
|
+
}, []);
|
|
25
|
+
return useMemo(function () {
|
|
26
|
+
return {
|
|
27
|
+
copied: copied,
|
|
28
|
+
setCopied: setCopied
|
|
29
|
+
};
|
|
30
|
+
}, [copied]);
|
|
31
|
+
};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ThemeProvider } from '@lobehub/ui';
|
|
2
|
+
import { useOutlet } from 'dumi';
|
|
3
|
+
import isEqual from 'fast-deep-equal';
|
|
4
|
+
import { memo } from 'react';
|
|
5
|
+
import Favicons from "../../components/Favicons";
|
|
6
|
+
import { useThemeStore } from "../../store";
|
|
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
|
+
export default /*#__PURE__*/memo(function () {
|
|
11
|
+
var themeMode = useThemeStore(function (st) {
|
|
12
|
+
return st.themeMode;
|
|
13
|
+
}, isEqual);
|
|
14
|
+
var outlet = useOutlet();
|
|
15
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
16
|
+
children: [/*#__PURE__*/_jsx(Favicons, {}), /*#__PURE__*/_jsx(ThemeProvider, {
|
|
17
|
+
themeMode: themeMode,
|
|
18
|
+
children: outlet
|
|
19
|
+
})]
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
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 { createGlobalStyle } from 'antd-style';
|
|
4
|
+
var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n#nprogress {\n .bar {\n background: ", ";\n }\n\t\n .peg {\n\t display: none !important;\n }\n\n .spinner {\n display: none;\n }\n}\n\n\n\n\n"])), function (_ref) {
|
|
5
|
+
var theme = _ref.theme;
|
|
6
|
+
return theme.colorText;
|
|
7
|
+
});
|
|
8
|
+
export default GlobalStyle;
|