@lobehub/ui 1.10.0 → 1.11.1
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/es/ActionIcon/style.js +1 -1
- package/es/Highlighter/style.js +1 -2
- package/es/Input/index.js +7 -5
- package/es/Input/style.js +2 -3
- package/es/Markdown/style.js +1 -1
- package/es/SearchBar/index.js +2 -1
- package/es/Snippet/style.js +1 -2
- package/es/StroyBook/style.js +1 -1
- package/es/ThemeProvider/index.d.ts +2 -6
- package/es/ThemeProvider/index.js +8 -18
- package/es/styles/algorithms/generateColorPalette.d.ts +11 -0
- package/es/styles/algorithms/generateColorPalette.js +31 -0
- package/es/styles/{customStylish.d.ts → algorithms/generateCustomStylish.d.ts} +1 -1
- package/es/styles/{customStylish.js → algorithms/generateCustomStylish.js} +1 -1
- package/es/styles/algorithms/generateCustomToken.d.ts +3 -0
- package/es/styles/algorithms/generateCustomToken.js +57 -0
- package/es/styles/algorithms/generateTheme.d.ts +5 -0
- package/es/styles/algorithms/generateTheme.js +18 -0
- package/es/styles/colors.d.ts +38 -0
- package/es/styles/colors.js +176 -0
- package/es/styles/index.d.ts +3 -3
- package/es/styles/index.js +3 -3
- package/es/styles/theme/base.d.ts +2 -2
- package/es/styles/theme/base.js +8 -14
- package/es/styles/theme/dark.d.ts +3 -4
- package/es/styles/theme/dark.js +40 -71
- package/es/styles/theme/light.d.ts +3 -4
- package/es/styles/theme/light.js +41 -32
- package/es/types/customToken.d.ts +1027 -0
- package/es/types/global.d.ts +12 -0
- package/es/types/index.d.ts +5 -28
- package/es/types/index.js +1 -0
- package/lib/ActionIcon/index.js +77 -79
- package/lib/ActionIcon/style.js +17 -61
- package/lib/Avatar/index.js +62 -67
- package/lib/Chat/const.js +6 -27
- package/lib/Chat/index.js +24 -28
- package/lib/Chat/store/index.js +46 -40
- package/lib/Chat/store/initialState.js +6 -27
- package/lib/Chat/store/messageReducer.js +51 -58
- package/lib/Chat/store/selectors.js +44 -46
- package/lib/Chat/store/store.js +242 -115
- package/lib/Chat/types.js +4 -16
- package/lib/Chat/utils/fetch.js +104 -68
- package/lib/ContextMenu/MenuItem/icons.js +48 -66
- package/lib/ContextMenu/MenuItem/index.js +73 -66
- package/lib/ContextMenu/MenuItem/style.js +19 -89
- package/lib/ContextMenu/index.js +194 -178
- package/lib/ContextMenu/style.js +17 -85
- package/lib/ContextMenu/types/index.js +15 -18
- package/lib/ContextMenu/types/menuItem.js +4 -16
- package/lib/Conversation/App.js +47 -50
- package/lib/Conversation/ChatList/MessageItem/Content.js +98 -93
- package/lib/Conversation/ChatList/MessageItem/Toolbar.js +94 -104
- package/lib/Conversation/ChatList/MessageItem/index.js +125 -157
- package/lib/Conversation/ChatList/index.js +64 -58
- package/lib/Conversation/InputArea/ActionBar.js +74 -92
- package/lib/Conversation/InputArea/index.js +103 -142
- package/lib/Conversation/StoreUpdater.js +28 -48
- package/lib/Conversation/index.js +30 -42
- package/lib/CopyButton/index.js +37 -62
- package/lib/DraggablePanel/index.js +192 -207
- package/lib/DraggablePanel/style.js +30 -278
- package/lib/DraggablePanel/utils.js +14 -35
- package/lib/EditableMessage/index.js +66 -89
- package/lib/EditableMessageList/index.js +97 -112
- package/lib/EditableText/index.js +36 -49
- package/lib/Highlighter/SyntaxHighlighter/Prism.js +43 -38
- package/lib/Highlighter/SyntaxHighlighter/index.js +62 -53
- package/lib/Highlighter/SyntaxHighlighter/style.js +18 -56
- package/lib/Highlighter/index.js +52 -58
- package/lib/Highlighter/style.js +22 -102
- package/lib/Icon/index.js +29 -36
- package/lib/Input/index.js +45 -39
- package/lib/Input/style.js +17 -68
- package/lib/List/ListItem/index.js +108 -150
- package/lib/List/ListItem/time.js +15 -47
- package/lib/List/index.js +9 -37
- package/lib/Logo/Divider.js +21 -34
- package/lib/Logo/Logo3D.js +17 -33
- package/lib/Logo/LogoFlat.js +108 -118
- package/lib/Logo/LogoHighContrast.js +30 -33
- package/lib/Logo/LogoText.js +21 -34
- package/lib/Logo/index.js +97 -59
- package/lib/Logo/style.js +13 -36
- package/lib/Markdown/Code.js +16 -30
- package/lib/Markdown/CodeBlock.js +33 -65
- package/lib/Markdown/index.js +35 -54
- package/lib/Markdown/style.js +15 -125
- package/lib/MessageInput/index.js +60 -56
- package/lib/MessageModal/index.js +80 -91
- package/lib/SearchBar/index.js +86 -72
- package/lib/SearchBar/style.js +18 -46
- package/lib/SideNav/index.js +43 -31
- package/lib/SideNav/style.js +13 -43
- package/lib/Snippet/index.js +42 -45
- package/lib/Snippet/style.js +13 -72
- package/lib/StroyBook/index.js +60 -61
- package/lib/StroyBook/style.js +19 -87
- package/lib/Swatches/index.js +35 -53
- package/lib/TabsNav/index.js +23 -31
- package/lib/TabsNav/style.js +17 -60
- package/lib/ThemeProvider/GlobalStyle.js +29 -92
- package/lib/ThemeProvider/index.d.ts +2 -6
- package/lib/ThemeProvider/index.js +44 -69
- package/lib/ThemeSwitch/index.js +62 -46
- package/lib/Tooltip/index.js +26 -31
- package/lib/Tooltip/style.js +13 -49
- package/lib/components/ControlInput.js +86 -87
- package/lib/hooks/useCopied.js +27 -37
- package/lib/hooks/useHighlight.js +65 -70
- package/lib/index.js +211 -120
- package/lib/styles/algorithms/generateColorPalette.d.ts +11 -0
- package/lib/styles/algorithms/generateColorPalette.js +40 -0
- package/lib/styles/{customStylish.d.ts → algorithms/generateCustomStylish.d.ts} +1 -1
- package/lib/styles/algorithms/generateCustomStylish.js +27 -0
- package/lib/styles/algorithms/generateCustomToken.d.ts +3 -0
- package/lib/styles/algorithms/generateCustomToken.js +65 -0
- package/lib/styles/algorithms/generateTheme.d.ts +5 -0
- package/lib/styles/algorithms/generateTheme.js +28 -0
- package/lib/styles/colors.d.ts +38 -0
- package/lib/styles/colors.js +183 -0
- package/lib/styles/index.d.ts +3 -3
- package/lib/styles/index.js +25 -20
- package/lib/styles/theme/base.d.ts +2 -2
- package/lib/styles/theme/base.js +17 -44
- package/lib/styles/theme/dark.d.ts +3 -4
- package/lib/styles/theme/dark.js +45 -119
- package/lib/styles/theme/light.d.ts +3 -4
- package/lib/styles/theme/light.js +47 -61
- package/lib/types/customToken.d.ts +1027 -0
- package/lib/types/global.d.ts +12 -0
- package/lib/types/index.d.ts +5 -28
- package/lib/types/index.js +5 -0
- package/lib/utils/colorUtils.js +14 -48
- package/package.json +1 -1
- package/es/styles/algorithms/colorRelationship.d.ts +0 -6
- package/es/styles/algorithms/colorRelationship.js +0 -88
- package/es/styles/algorithms/index.d.ts +0 -15
- package/es/styles/algorithms/index.js +0 -66
- package/es/styles/algorithms/paletteGenerator.d.ts +0 -51
- package/es/styles/algorithms/paletteGenerator.js +0 -74
- package/es/styles/antdTheme.d.ts +0 -2
- package/es/styles/antdTheme.js +0 -4
- package/es/styles/customToken.d.ts +0 -65
- package/es/styles/customToken.js +0 -24
- package/es/styles/theme/index.d.ts +0 -2
- package/es/styles/theme/index.js +0 -2
- package/lib/styles/algorithms/colorRelationship.d.ts +0 -6
- package/lib/styles/algorithms/colorRelationship.js +0 -87
- package/lib/styles/algorithms/index.d.ts +0 -15
- package/lib/styles/algorithms/index.js +0 -81
- package/lib/styles/algorithms/paletteGenerator.d.ts +0 -51
- package/lib/styles/algorithms/paletteGenerator.js +0 -91
- package/lib/styles/antdTheme.d.ts +0 -2
- package/lib/styles/antdTheme.js +0 -30
- package/lib/styles/customStylish.js +0 -118
- package/lib/styles/customToken.d.ts +0 -65
- package/lib/styles/customToken.js +0 -54
- package/lib/styles/theme/index.d.ts +0 -2
- package/lib/styles/theme/index.js +0 -32
package/lib/Swatches/index.js
CHANGED
|
@@ -1,68 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
18
2
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
__export(Swatches_exports, {
|
|
22
|
-
default: () => Swatches_default
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
23
5
|
});
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _antdStyle = require("antd-style");
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _reactLayoutKit = require("react-layout-kit");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
var Swatches = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
12
|
+
var colors = _ref.colors,
|
|
13
|
+
activeColor = _ref.activeColor,
|
|
14
|
+
onSelect = _ref.onSelect;
|
|
15
|
+
var theme = (0, _antdStyle.useTheme)();
|
|
16
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactLayoutKit.Flexbox, {
|
|
17
|
+
horizontal: true,
|
|
18
|
+
gap: 8,
|
|
19
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLayoutKit.Flexbox, {
|
|
33
20
|
style: {
|
|
34
21
|
width: 24,
|
|
35
22
|
height: 24,
|
|
36
23
|
background: theme.colorBgContainer,
|
|
37
|
-
boxShadow:
|
|
38
|
-
borderRadius:
|
|
39
|
-
cursor:
|
|
24
|
+
boxShadow: "inset 0 0 0px 2px ".concat(!activeColor ? theme.colorPrimary : 'rgba(0,0,0,0.1)'),
|
|
25
|
+
borderRadius: '50%',
|
|
26
|
+
cursor: 'pointer'
|
|
40
27
|
},
|
|
41
|
-
onClick: ()
|
|
42
|
-
onSelect
|
|
28
|
+
onClick: function onClick() {
|
|
29
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(null);
|
|
43
30
|
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return /* @__PURE__ */ React.createElement(
|
|
48
|
-
import_react_layout_kit.Flexbox,
|
|
49
|
-
{
|
|
50
|
-
key: c,
|
|
31
|
+
}), colors.map(function (c) {
|
|
32
|
+
var borderColor = c === activeColor ? theme.colorPrimary : 'rgba(0,0,0,0.1)';
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLayoutKit.Flexbox, {
|
|
51
34
|
style: {
|
|
52
35
|
width: 24,
|
|
53
36
|
height: 24,
|
|
54
37
|
background: c,
|
|
55
|
-
boxShadow:
|
|
56
|
-
borderRadius:
|
|
57
|
-
cursor:
|
|
38
|
+
boxShadow: "inset 0 0 0px 2px ".concat(borderColor),
|
|
39
|
+
borderRadius: '50%',
|
|
40
|
+
cursor: 'pointer'
|
|
58
41
|
},
|
|
59
|
-
onClick: ()
|
|
60
|
-
onSelect
|
|
42
|
+
onClick: function onClick() {
|
|
43
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(c);
|
|
61
44
|
}
|
|
62
|
-
}
|
|
63
|
-
)
|
|
64
|
-
})
|
|
45
|
+
}, c);
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
65
48
|
});
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
0 && (module.exports = {});
|
|
49
|
+
var _default = Swatches;
|
|
50
|
+
exports.default = _default;
|
package/lib/TabsNav/index.js
CHANGED
|
@@ -1,34 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
18
2
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
default: () => TabsNav_default
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
23
6
|
});
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _antd = require("antd");
|
|
11
|
+
var _react = require("react");
|
|
12
|
+
var _style = require("./style");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
var _excluded = ["className"];
|
|
15
|
+
var TabsNav = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
16
|
+
var className = _ref.className,
|
|
17
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
18
|
+
var _useStyles = (0, _style.useStyles)(),
|
|
19
|
+
styles = _useStyles.styles,
|
|
20
|
+
cx = _useStyles.cx;
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tabs, (0, _objectSpread2.default)({
|
|
22
|
+
className: cx(styles.tabs, className)
|
|
23
|
+
}, props));
|
|
31
24
|
});
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
0 && (module.exports = {});
|
|
25
|
+
var _default = TabsNav;
|
|
26
|
+
exports.default = _default;
|
package/lib/TabsNav/style.js
CHANGED
|
@@ -1,65 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
18
2
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
useStyles: () => useStyles
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
23
6
|
});
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
exports.useStyles = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
+
var _antdStyle = require("antd-style");
|
|
10
|
+
var _templateObject;
|
|
11
|
+
var useStyles = (0, _antdStyle.createStyles)(function (_ref) {
|
|
12
|
+
var css = _ref.css,
|
|
13
|
+
token = _ref.token,
|
|
14
|
+
prefixCls = _ref.prefixCls;
|
|
15
|
+
var prefix = ".".concat(prefixCls, "-tabs");
|
|
16
|
+
var marginHoriz = 16;
|
|
17
|
+
var paddingVertical = 6;
|
|
30
18
|
return {
|
|
31
|
-
tabs: css
|
|
32
|
-
${prefix}-tab + ${prefix}-tab {
|
|
33
|
-
margin: ${marginHoriz}px 4px !important;
|
|
34
|
-
padding: 0 12px !important;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
${prefix}-tab {
|
|
38
|
-
color: ${token.colorTextSecondary};
|
|
39
|
-
transition: background-color 100ms ease-out;
|
|
40
|
-
|
|
41
|
-
&:first-child {
|
|
42
|
-
margin: ${marginHoriz}px 4px ${marginHoriz}px 0;
|
|
43
|
-
padding: ${paddingVertical}px 12px !important;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
&:hover {
|
|
47
|
-
color: ${token.colorText} !important;
|
|
48
|
-
background: ${token.colorFillTertiary};
|
|
49
|
-
border-radius: ${token.borderRadius}px;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
${prefix}-nav {
|
|
54
|
-
margin-bottom: 0;
|
|
55
|
-
&::before {
|
|
56
|
-
display: none;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
`
|
|
19
|
+
tabs: css(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n ", "-tab + ", "-tab {\n margin: ", "px 4px !important;\n padding: 0 12px !important;\n }\n\n ", "-tab {\n color: ", ";\n transition: background-color 100ms ease-out;\n\n &:first-child {\n margin: ", "px 4px ", "px 0;\n padding: ", "px 12px !important;\n }\n\n &:hover {\n color: ", " !important;\n background: ", ";\n border-radius: ", "px;\n }\n }\n\n ", "-nav {\n margin-bottom: 0;\n &::before {\n display: none;\n }\n }\n "])), prefix, prefix, marginHoriz, prefix, token.colorTextSecondary, marginHoriz, marginHoriz, paddingVertical, token.colorText, token.colorFillTertiary, token.borderRadius, prefix)
|
|
60
20
|
};
|
|
61
21
|
});
|
|
62
|
-
|
|
63
|
-
0 && (module.exports = {
|
|
64
|
-
useStyles
|
|
65
|
-
});
|
|
22
|
+
exports.useStyles = useStyles;
|
|
@@ -1,94 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
18
2
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
default: () => GlobalStyle_default
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
23
6
|
});
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
html,body {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
-webkit-font-smoothing: antialiased;
|
|
51
|
-
-moz-osx-font-smoothing: grayscale;
|
|
52
|
-
-webkit-tap-highlight-color: transparent;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
* {
|
|
57
|
-
box-sizing: border-box;
|
|
58
|
-
vertical-align: baseline;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
#root {
|
|
62
|
-
min-height: 100vh;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
::-webkit-scrollbar {
|
|
66
|
-
width: 0;
|
|
67
|
-
height: 4px;
|
|
68
|
-
background-color: transparent;
|
|
69
|
-
|
|
70
|
-
&-thumb {
|
|
71
|
-
background-color: ${({ theme }) => theme.colorFill};
|
|
72
|
-
border-radius: 4px;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
&-corner {
|
|
76
|
-
display: none;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
p {
|
|
81
|
-
text-align: justify;
|
|
82
|
-
word-wrap: break-word;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
code {
|
|
86
|
-
font-family: ${({ theme }) => theme.fontFamilyCode} !important;
|
|
87
|
-
* {
|
|
88
|
-
font-family: inherit !important;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
`;
|
|
92
|
-
var GlobalStyle_default = GlobalStyle;
|
|
93
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
94
|
-
0 && (module.exports = {});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
|
+
var _antdStyle = require("antd-style");
|
|
10
|
+
var _templateObject;
|
|
11
|
+
var GlobalStyle = (0, _antdStyle.createGlobalStyle)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\n html,body {\n --font-settings: \"cv01\", \"tnum\", \"kern\";\n --font-variations: \"opsz\" auto, tabular-nums;\n\n overflow-x: hidden;\n\n margin: 0;\n padding: 0;\n\n font-family: ", ";\n font-size: ", "px;\n font-feature-settings: var(--font-settings);\n font-variation-settings: var(--font-variations);\n line-height: 1;\n color: ", ";\n text-size-adjust: none;\n text-rendering: optimizelegibility;\n vertical-align: baseline;\n\n color-scheme: dark;\n background-color: ", ";\n\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-tap-highlight-color: transparent;\n }\n\n\n * {\n box-sizing: border-box;\n vertical-align: baseline;\n }\n\n #root {\n\t min-height: 100vh;\n }\n\n ::-webkit-scrollbar {\n width: 0;\n height: 4px;\n background-color: transparent;\n\n &-thumb {\n background-color: ", ";\n border-radius: 4px;\n }\n\n &-corner {\n display: none;\n }\n }\n\n p {\n text-align: justify;\n word-wrap: break-word;\n }\n\n code {\n\t font-family: ", " !important;\n\t * {\n\t\t font-family: inherit !important;\n\t }\n }\n"])), function (_ref) {
|
|
12
|
+
var theme = _ref.theme;
|
|
13
|
+
return theme.fontFamily;
|
|
14
|
+
}, function (_ref2) {
|
|
15
|
+
var theme = _ref2.theme;
|
|
16
|
+
return theme.fontSize;
|
|
17
|
+
}, function (_ref3) {
|
|
18
|
+
var theme = _ref3.theme;
|
|
19
|
+
return theme.colorTextBase;
|
|
20
|
+
}, function (_ref4) {
|
|
21
|
+
var theme = _ref4.theme;
|
|
22
|
+
return theme.colorBgLayout;
|
|
23
|
+
}, function (_ref5) {
|
|
24
|
+
var theme = _ref5.theme;
|
|
25
|
+
return theme.colorFill;
|
|
26
|
+
}, function (_ref6) {
|
|
27
|
+
var theme = _ref6.theme;
|
|
28
|
+
return theme.fontFamilyCode;
|
|
29
|
+
});
|
|
30
|
+
var _default = GlobalStyle;
|
|
31
|
+
exports.default = _default;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { extractStaticStyle, type ThemeMode } from 'antd-style';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
export interface ThemeProviderProps {
|
|
4
|
-
/**
|
|
5
|
-
* @description Custom tokens to be used in the theme
|
|
6
|
-
*/
|
|
7
|
-
token?: any;
|
|
8
4
|
/**
|
|
9
5
|
* @description The children of the ThemeProvider component
|
|
10
6
|
*/
|
|
@@ -22,5 +18,5 @@ export interface ThemeProviderProps {
|
|
|
22
18
|
*/
|
|
23
19
|
cache?: typeof extractStaticStyle.cache;
|
|
24
20
|
}
|
|
25
|
-
declare const ThemeProvider:
|
|
21
|
+
declare const ThemeProvider: import("react").NamedExoticComponent<ThemeProviderProps>;
|
|
26
22
|
export default ThemeProvider;
|
|
@@ -1,71 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
28
2
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
default: () => ThemeProvider_default
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
33
6
|
});
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _styles = require("../styles");
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
var _antdStyle = require("antd-style");
|
|
11
|
+
var _react = require("react");
|
|
12
|
+
var _reactFontLoader = _interopRequireDefault(require("react-font-loader"));
|
|
13
|
+
var _styledComponents = require("styled-components");
|
|
14
|
+
var _GlobalStyle = _interopRequireDefault(require("./GlobalStyle"));
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
|
|
18
|
+
var ThemeProvider = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
19
|
+
var children = _ref.children,
|
|
20
|
+
themeMode = _ref.themeMode;
|
|
21
|
+
(0, _antdStyle.setupStyled)({
|
|
22
|
+
ThemeContext: _styledComponents.ThemeContext
|
|
23
|
+
});
|
|
24
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antdStyle.StyleProvider, {
|
|
25
|
+
speedy: process.env.NODE_ENV === 'production',
|
|
26
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antdStyle.ThemeProvider, {
|
|
27
|
+
themeMode: themeMode,
|
|
28
|
+
theme: _styles.lobeTheme,
|
|
29
|
+
customStylish: _styles.lobeCustomStylish,
|
|
30
|
+
customToken: _styles.lobeCustomToken,
|
|
31
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontLoader.default, {
|
|
32
|
+
url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans.css"
|
|
33
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontLoader.default, {
|
|
34
|
+
url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans_sc.css"
|
|
35
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GlobalStyle.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.App, {
|
|
36
|
+
style: {
|
|
37
|
+
minHeight: 'inherit',
|
|
38
|
+
width: 'inherit'
|
|
39
|
+
},
|
|
40
|
+
children: children
|
|
41
|
+
})]
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
var _default = ThemeProvider;
|
|
46
|
+
exports.default = _default;
|
package/lib/ThemeSwitch/index.js
CHANGED
|
@@ -1,50 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";
|
|
18
2
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
default: () => ThemeSwitch_default
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
23
6
|
});
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
+
var _ = require("./..");
|
|
11
|
+
var _antd = require("antd");
|
|
12
|
+
var _lucideReact = require("lucide-react");
|
|
13
|
+
var _react = require("react");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
var _excluded = ["size", "themeMode", "onThemeSwitch"];
|
|
29
16
|
var icons = {
|
|
30
|
-
auto:
|
|
31
|
-
light:
|
|
32
|
-
dark:
|
|
17
|
+
auto: _lucideReact.Monitor,
|
|
18
|
+
light: _lucideReact.Sun,
|
|
19
|
+
dark: _lucideReact.Moon
|
|
33
20
|
};
|
|
34
|
-
var items = [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
0
|
|
21
|
+
var items = [{
|
|
22
|
+
label: 'System',
|
|
23
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Icon, {
|
|
24
|
+
size: "small",
|
|
25
|
+
icon: icons.auto
|
|
26
|
+
}),
|
|
27
|
+
key: 'auto'
|
|
28
|
+
}, {
|
|
29
|
+
label: 'Light',
|
|
30
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Icon, {
|
|
31
|
+
size: "small",
|
|
32
|
+
icon: icons.light
|
|
33
|
+
}),
|
|
34
|
+
key: 'light'
|
|
35
|
+
}, {
|
|
36
|
+
label: 'Dark',
|
|
37
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.Icon, {
|
|
38
|
+
size: "small",
|
|
39
|
+
icon: icons.dark
|
|
40
|
+
}),
|
|
41
|
+
key: 'dark'
|
|
42
|
+
}];
|
|
43
|
+
var ThemeSwitch = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
44
|
+
var _ref$size = _ref.size,
|
|
45
|
+
size = _ref$size === void 0 ? 'site' : _ref$size,
|
|
46
|
+
themeMode = _ref.themeMode,
|
|
47
|
+
onThemeSwitch = _ref.onThemeSwitch,
|
|
48
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
49
|
+
var menuProps = {
|
|
50
|
+
items: items,
|
|
51
|
+
onClick: function onClick(e) {
|
|
52
|
+
return onThemeSwitch(e.key);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Dropdown, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
56
|
+
menu: menuProps,
|
|
57
|
+
trigger: ['click']
|
|
58
|
+
}, props), {}, {
|
|
59
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ActionIcon, {
|
|
60
|
+
size: size,
|
|
61
|
+
icon: icons[themeMode]
|
|
62
|
+
})
|
|
63
|
+
}));
|
|
64
|
+
});
|
|
65
|
+
var _default = ThemeSwitch;
|
|
66
|
+
exports.default = _default;
|