@lobehub/ui 1.22.1 → 1.23.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.
@@ -1,9 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { ActionIconProps } from "..";
3
+ import { type MenuProps } from 'antd';
3
4
  import { DivProps } from "../types";
4
5
  export interface ActionIconGroupProps extends DivProps {
5
6
  direction?: 'row' | 'column';
6
- items: ActionIconProps[];
7
+ dropdownMenu?: MenuProps['items'];
8
+ items?: ActionIconProps[];
7
9
  /**
8
10
  * @description The position of the tooltip relative to the target
9
11
  * @enum ["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]
@@ -1,9 +1,11 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["type", "items", "placement", "spotlight", "direction"];
3
+ var _excluded = ["type", "items", "placement", "spotlight", "direction", "dropdownMenu"];
4
4
  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; }
5
5
  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; }
6
6
  import { ActionIcon, Spotlight } from "./..";
7
+ import { Dropdown } from 'antd';
8
+ import { MoreHorizontal } from 'lucide-react';
7
9
  import { memo } from 'react';
8
10
  import { useStyles } from "./style";
9
11
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -11,26 +13,40 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
11
13
  var ActionIconGroup = /*#__PURE__*/memo(function (_ref) {
12
14
  var _ref$type = _ref.type,
13
15
  type = _ref$type === void 0 ? 'block' : _ref$type,
14
- items = _ref.items,
16
+ _ref$items = _ref.items,
17
+ items = _ref$items === void 0 ? [] : _ref$items,
15
18
  placement = _ref.placement,
16
19
  _ref$spotlight = _ref.spotlight,
17
20
  spotlight = _ref$spotlight === void 0 ? true : _ref$spotlight,
18
21
  _ref$direction = _ref.direction,
19
22
  direction = _ref$direction === void 0 ? 'row' : _ref$direction,
23
+ _ref$dropdownMenu = _ref.dropdownMenu,
24
+ dropdownMenu = _ref$dropdownMenu === void 0 ? [] : _ref$dropdownMenu,
20
25
  props = _objectWithoutProperties(_ref, _excluded);
21
26
  var _useStyles = useStyles({
22
27
  direction: direction,
23
28
  type: type
24
29
  }),
25
30
  styles = _useStyles.styles;
31
+ var tooltipsPlacement = placement || (direction === 'column' ? 'right' : 'top');
26
32
  return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
27
33
  className: styles.container
28
34
  }, props), {}, {
29
35
  children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), items.map(function (item, index) {
30
36
  return /*#__PURE__*/_jsx(ActionIcon, _objectSpread({
31
- placement: placement || (direction === 'column' ? 'right' : 'top'),
37
+ placement: tooltipsPlacement,
32
38
  size: "small"
33
39
  }, item), index);
40
+ }), dropdownMenu && /*#__PURE__*/_jsx(Dropdown, {
41
+ menu: {
42
+ items: dropdownMenu
43
+ },
44
+ trigger: ['click'],
45
+ children: /*#__PURE__*/_jsx(ActionIcon, {
46
+ icon: MoreHorizontal,
47
+ placement: tooltipsPlacement,
48
+ size: "small"
49
+ }, "more")
34
50
  })]
35
51
  }));
36
52
  });
@@ -8,7 +8,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
8
8
  cx = _ref.cx;
9
9
  var direction = _ref2.direction,
10
10
  type = _ref2.type;
11
- var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border: 1px solid ", ";\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorder);
11
+ var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border: 1px solid ", ";\n "])), type === 'block' ? token.colorFillTertiary : token.colorFillQuaternary, type === 'block' ? 'transparent' : token.colorBorder);
12
12
  return {
13
13
  container: cx(type !== 'pure' && typeStylish, stylish.blur, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: ", ";\n\n padding: 2px;\n\n border-radius: ", "px;\n "])), direction, token.borderRadius))
14
14
  };
@@ -1,8 +1,9 @@
1
- /// <reference types="react" />
2
1
  import { type AlertProps } from 'antd';
2
+ import { ReactNode } from 'react';
3
3
  import type { DivProps } from "../types";
4
4
  import { MetaData } from "../types/meta";
5
5
  export interface ChatItemProps extends DivProps {
6
+ actions?: ReactNode;
6
7
  /**
7
8
  * @description Whether to show alert and alert config
8
9
  */
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["className", "title", "primary", "borderSpacing", "loading", "message", "placement", "type", "avatar", "alert", "showTitle", "time"];
3
+ var _excluded = ["actions", "className", "title", "primary", "borderSpacing", "loading", "message", "placement", "type", "avatar", "alert", "showTitle", "time"];
4
4
  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; }
5
5
  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; }
6
6
  import { Alert } from 'antd';
@@ -13,7 +13,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
14
  var AVATAR_SIZE = 40;
15
15
  var ChatItem = /*#__PURE__*/memo(function (_ref) {
16
- var className = _ref.className,
16
+ var actions = _ref.actions,
17
+ className = _ref.className,
17
18
  title = _ref.title,
18
19
  primary = _ref.primary,
19
20
  _ref$borderSpacing = _ref.borderSpacing,
@@ -35,7 +36,8 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
35
36
  title: title,
36
37
  primary: primary,
37
38
  avatarSize: AVATAR_SIZE,
38
- showTitle: showTitle
39
+ showTitle: showTitle,
40
+ borderSpacing: borderSpacing
39
41
  }),
40
42
  cx = _useStyles.cx,
41
43
  styles = _useStyles.styles;
@@ -65,7 +67,7 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
65
67
  children: [/*#__PURE__*/_jsxs("div", {
66
68
  className: cx(styles.name, 'chat-item-name'),
67
69
  children: [showTitle ? avatar.title || 'untitled' : null, time && /*#__PURE__*/_jsx("span", {
68
- className: cx(type === 'pure' && !showTitle && styles.time, 'chat-item-time'),
70
+ className: "chat-item-time",
69
71
  children: formatTime(time)
70
72
  })]
71
73
  }), alert ? /*#__PURE__*/_jsx(Alert, _objectSpread({
@@ -75,6 +77,9 @@ var ChatItem = /*#__PURE__*/memo(function (_ref) {
75
77
  children: /*#__PURE__*/_jsx(Markdown, {
76
78
  children: String(message || '...')
77
79
  })
80
+ }), /*#__PURE__*/_jsx("div", {
81
+ className: cx(styles.actions, 'chat-item-actions'),
82
+ children: actions
78
83
  })]
79
84
  }), borderSpacing && /*#__PURE__*/_jsx("div", {
80
85
  style: {
@@ -1,5 +1,6 @@
1
1
  export declare const useStyles: (props?: {
2
2
  avatarSize: number;
3
+ borderSpacing: boolean;
3
4
  placement?: "left" | "right" | undefined;
4
5
  primary?: boolean | undefined;
5
6
  showTitle?: boolean | undefined;
@@ -11,6 +12,6 @@ export declare const useStyles: (props?: {
11
12
  avatarContainer: import("antd-style").SerializedStyles;
12
13
  messageContainer: import("antd-style").SerializedStyles;
13
14
  name: import("antd-style").SerializedStyles;
14
- time: string;
15
15
  message: string;
16
+ actions: string;
16
17
  }>;
@@ -1,28 +1,28 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
3
3
  import { createStyles } from 'antd-style';
4
4
  export var useStyles = createStyles(function (_ref, _ref2) {
5
5
  var cx = _ref.cx,
6
6
  css = _ref.css,
7
- token = _ref.token,
8
- stylish = _ref.stylish;
7
+ token = _ref.token;
9
8
  var placement = _ref2.placement,
10
9
  type = _ref2.type,
11
10
  title = _ref2.title,
12
11
  primary = _ref2.primary,
13
12
  avatarSize = _ref2.avatarSize,
14
- showTitle = _ref2.showTitle;
13
+ showTitle = _ref2.showTitle,
14
+ borderSpacing = _ref2.borderSpacing;
15
15
  var blockStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 8px 12px;\n background-color: ", ";\n border-radius: ", "px;\n transition: background-color 100ms ", ";\n "])), primary ? token.colorFillSecondary : token.colorFillTertiary, token.borderRadiusLG, token.motionEaseOut);
16
16
  var pureStylish = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding-top: ", ";\n "])), title ? 0 : '6px');
17
- var pureContainerStylish = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-radius: ", "px;\n transition: background-color 100ms ", ";\n\n &:hover {\n background-color: ", ";\n }\n "])), token.borderRadiusLG, token.motionEaseOut, token.colorFillTertiary);
17
+ var pureContainerStylish = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n transition: background-color 100ms ", ";\n "])), token.motionEaseOut);
18
18
  var typeStylish = type === 'block' ? blockStylish : pureStylish;
19
19
  return {
20
- container: cx(type === 'pure' && pureContainerStylish, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: ", ";\n gap: 12px;\n align-items: flex-start;\n justify-content: revert;\n\n width: 100%;\n padding: 12px;\n\n .chat-item-time {\n display: none;\n }\n\n &:hover {\n .chat-item-time {\n display: inline-block;\n }\n }\n "])), placement === 'left' ? 'row' : 'row-reverse')),
20
+ container: cx(type === 'pure' && pureContainerStylish, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n flex-direction: ", ";\n gap: 12px;\n align-items: flex-start;\n justify-content: revert;\n\n width: 100%;\n padding: 12px;\n\n .chat-item-time,\n .chat-item-actions {\n display: none;\n }\n\n &:hover {\n .chat-item-time {\n display: inline-block;\n }\n\n .chat-item-actions {\n display: flex;\n }\n }\n "])), placement === 'left' ? 'row' : 'row-reverse')),
21
21
  loading: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: absolute;\n right: ", ";\n bottom: 0;\n left: ", ";\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 16px;\n height: 16px;\n\n color: ", ";\n\n background: ", ";\n border-radius: 50%;\n "])), placement === 'left' ? '-4px' : 'unset', placement === 'right' ? '-4px' : 'unset', token.colorBgLayout, token.colorPrimary),
22
22
  avatarContainer: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: relative;\n flex: none;\n width: ", "px;\n height: ", "px;\n "])), avatarSize, avatarSize),
23
23
  messageContainer: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n\n .ant-alert-with-description {\n padding-block: 12px;\n padding-inline: 12px;\n }\n "]))),
24
24
  name: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n position: ", ";\n top: ", ";\n right: ", ";\n left: ", ";\n\n display: flex;\n flex-direction: ", ";\n gap: 4px;\n\n margin-bottom: 6px;\n\n font-size: 12px;\n line-height: 1;\n color: ", ";\n text-align: ", ";\n "])), showTitle ? 'relative' : 'absolute', showTitle ? 'unset' : '-16px', placement === 'right' ? '0' : 'unset', placement === 'left' ? '0' : 'unset', placement === 'left' ? 'row' : 'row-reverse', token.colorTextDescription, placement === 'left' ? 'left' : 'right'),
25
- time: cx(stylish.blur, css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n padding: 4px 6px;\n\n line-height: 1;\n\n background: ", ";\n border-radius: ", "px;\n "])), token.colorFillQuaternary, token.borderRadius)),
26
- message: cx(typeStylish, css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: relative;\n "]))))
25
+ message: cx(typeStylish, css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n position: relative;\n "])))),
26
+ actions: cx(css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n align-items: flex-start;\n justify-content: ", ";\n "])), placement === 'left' ? 'flex-end' : 'flex-start'), type === 'block' && borderSpacing ? css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n right: ", ";\n bottom: 0;\n left: ", ";\n transform: translateX(", ");\n "])), placement === 'left' ? '-4px' : 'unset', placement === 'right' ? '-4px' : 'unset', placement === 'left' ? '100%' : '-100%') : css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n right: ", ";\n bottom: ", ";\n left: ", ";\n "])), placement === 'left' ? '0' : 'unset', type === 'block' ? '-40px' : '-32px', placement === 'right' ? '0' : 'unset'))
27
27
  };
28
28
  });
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { type ActionIconGroupProps } from "../index";
3
+ export interface ActionsBarProps extends ActionIconGroupProps {
4
+ primary?: boolean;
5
+ }
6
+ declare const ActionsBar: import("react").NamedExoticComponent<ActionsBarProps>;
7
+ export default ActionsBar;
@@ -0,0 +1,72 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
+ var _excluded = ["primary", "items", "dropdownMenu"];
5
+ 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; }
6
+ 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; }
7
+ import { Copy, Edit, RotateCw, Trash } from 'lucide-react';
8
+ import { memo, useMemo } from 'react';
9
+ import { ActionIconGroup, Icon } from "./..";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ var ActionsBar = /*#__PURE__*/memo(function (_ref) {
12
+ var primary = _ref.primary,
13
+ _ref$items = _ref.items,
14
+ items = _ref$items === void 0 ? [] : _ref$items,
15
+ _ref$dropdownMenu = _ref.dropdownMenu,
16
+ dropdownMenu = _ref$dropdownMenu === void 0 ? [] : _ref$dropdownMenu,
17
+ props = _objectWithoutProperties(_ref, _excluded);
18
+ var groupItems = useMemo(function () {
19
+ return [primary ? {
20
+ icon: Edit,
21
+ title: 'Edit',
22
+ onClick: function onClick() {
23
+ return console.log('click Edit');
24
+ }
25
+ } : {
26
+ icon: RotateCw,
27
+ title: 'Regenerate',
28
+ onClick: function onClick() {
29
+ return console.log('click Regenerate');
30
+ }
31
+ }].concat(_toConsumableArray(items)).filter(Boolean);
32
+ }, [primary, items]);
33
+ var groupDropdownMenu = useMemo(function () {
34
+ return dropdownMenu.concat([{
35
+ key: 'Edit',
36
+ icon: /*#__PURE__*/_jsx(Icon, {
37
+ icon: Edit,
38
+ size: "small"
39
+ }),
40
+ label: 'Edit'
41
+ }, {
42
+ key: 'Copy',
43
+ icon: /*#__PURE__*/_jsx(Icon, {
44
+ icon: Copy,
45
+ size: "small"
46
+ }),
47
+ label: 'Copy'
48
+ }, {
49
+ key: 'Regenerate',
50
+ icon: /*#__PURE__*/_jsx(Icon, {
51
+ icon: RotateCw,
52
+ size: "small"
53
+ }),
54
+ label: 'Regenerate'
55
+ }, {
56
+ type: 'divider'
57
+ }, {
58
+ key: 'Delete',
59
+ icon: /*#__PURE__*/_jsx(Icon, {
60
+ icon: Trash,
61
+ size: "small"
62
+ }),
63
+ label: 'Delete'
64
+ }]).filter(Boolean);
65
+ }, [primary, dropdownMenu]);
66
+ return /*#__PURE__*/_jsx(ActionIconGroup, _objectSpread({
67
+ dropdownMenu: groupDropdownMenu,
68
+ items: groupItems,
69
+ type: "ghost"
70
+ }, props));
71
+ });
72
+ export default ActionsBar;
@@ -5,6 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
5
5
  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; }
6
6
  import { memo } from 'react';
7
7
  import { ChatItem } from "./..";
8
+ import ActionsBar from "./ActionsBar";
8
9
  import { useStyles } from "./style";
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
10
11
  var ChatList = /*#__PURE__*/memo(function (_ref) {
@@ -22,6 +23,9 @@ var ChatList = /*#__PURE__*/memo(function (_ref) {
22
23
  }, props), {}, {
23
24
  children: data.map(function (item) {
24
25
  return /*#__PURE__*/_jsx(ChatItem, {
26
+ actions: /*#__PURE__*/_jsx(ActionsBar, {
27
+ primary: item.role === 'user'
28
+ }),
25
29
  avatar: item.meta,
26
30
  borderSpacing: type === 'chat',
27
31
  message: item.content,
@@ -0,0 +1,15 @@
1
+ import { ReactNode } from 'react';
2
+ export interface LayoutProps {
3
+ asideWidth?: number;
4
+ children?: ReactNode;
5
+ content?: ReactNode;
6
+ footer?: ReactNode;
7
+ header?: ReactNode;
8
+ headerHeight?: number;
9
+ helmet?: ReactNode;
10
+ sidebar?: ReactNode;
11
+ toc?: ReactNode;
12
+ tocWidth?: number;
13
+ }
14
+ declare const Layout: import("react").NamedExoticComponent<LayoutProps>;
15
+ export default Layout;
@@ -0,0 +1,81 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
+ import { useResponsive } from 'antd-style';
3
+ import { memo, useEffect, useState } from 'react';
4
+ import { DraggablePanel } from "./..";
5
+ import { useStyles } from "./style";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ import { Fragment as _Fragment } from "react/jsx-runtime";
9
+ var Layout = /*#__PURE__*/memo(function (_ref) {
10
+ var helmet = _ref.helmet,
11
+ _ref$headerHeight = _ref.headerHeight,
12
+ headerHeight = _ref$headerHeight === void 0 ? 64 : _ref$headerHeight,
13
+ header = _ref.header,
14
+ footer = _ref.footer,
15
+ sidebar = _ref.sidebar,
16
+ asideWidth = _ref.asideWidth,
17
+ toc = _ref.toc,
18
+ children = _ref.children,
19
+ tocWidth = _ref.tocWidth;
20
+ var _useStyles = useStyles(headerHeight),
21
+ styles = _useStyles.styles;
22
+ var _useResponsive = useResponsive(),
23
+ mobile = _useResponsive.mobile,
24
+ laptop = _useResponsive.laptop;
25
+ var _useState = useState(true),
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ expand = _useState2[0],
28
+ setExpand = _useState2[1];
29
+ useEffect(function () {
30
+ setExpand(Boolean(laptop));
31
+ }, [laptop]);
32
+ return /*#__PURE__*/_jsxs(_Fragment, {
33
+ children: [helmet, header && /*#__PURE__*/_jsxs("header", {
34
+ className: styles.header,
35
+ style: {
36
+ height: headerHeight
37
+ },
38
+ children: [/*#__PURE__*/_jsx("div", {
39
+ className: styles.glass
40
+ }), header, mobile && toc && /*#__PURE__*/_jsx("nav", {
41
+ className: styles.toc,
42
+ children: toc
43
+ })]
44
+ }), /*#__PURE__*/_jsxs("main", {
45
+ className: styles.main,
46
+ children: [!mobile && !sidebar && /*#__PURE__*/_jsx("nav", {
47
+ style: {
48
+ width: tocWidth
49
+ }
50
+ }), !mobile && sidebar && /*#__PURE__*/_jsx("aside", {
51
+ className: styles.aside,
52
+ style: {
53
+ top: headerHeight
54
+ },
55
+ children: /*#__PURE__*/_jsx(DraggablePanel, {
56
+ expand: expand,
57
+ maxWidth: asideWidth,
58
+ onExpandChange: setExpand,
59
+ placement: "left",
60
+ children: /*#__PURE__*/_jsx("div", {
61
+ className: styles.asideInner,
62
+ children: sidebar
63
+ })
64
+ })
65
+ }), /*#__PURE__*/_jsx("section", {
66
+ className: styles.content,
67
+ children: children
68
+ }), !mobile && toc && /*#__PURE__*/_jsx("nav", {
69
+ className: styles.toc,
70
+ style: {
71
+ width: tocWidth
72
+ },
73
+ children: toc
74
+ })]
75
+ }), footer && /*#__PURE__*/_jsx("footer", {
76
+ className: styles.footer,
77
+ children: footer
78
+ })]
79
+ });
80
+ });
81
+ export default Layout;
@@ -0,0 +1,11 @@
1
+ export declare const useStyles: (props?: number | undefined) => import("antd-style").ReturnStyles<{
2
+ app: import("antd-style").SerializedStyles;
3
+ header: import("antd-style").SerializedStyles;
4
+ glass: import("antd-style").SerializedStyles;
5
+ main: import("antd-style").SerializedStyles;
6
+ content: import("antd-style").SerializedStyles;
7
+ footer: import("antd-style").SerializedStyles;
8
+ aside: import("antd-style").SerializedStyles;
9
+ asideInner: import("antd-style").SerializedStyles;
10
+ toc: import("antd-style").SerializedStyles;
11
+ }>;
@@ -0,0 +1,19 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
3
+ import { createStyles } from 'antd-style';
4
+ export var useStyles = createStyles(function (_ref, headerHeight) {
5
+ var css = _ref.css,
6
+ stylish = _ref.stylish;
7
+ var baseGlass = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n pointer-events: none;\n content: '';\n user-select: none;\n\n position: absolute;\n z-index: -1;\n inset: -1px 0 -50%;\n "])));
8
+ return {
9
+ app: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow-x: hidden;\n overflow-y: auto;\n height: 100vh;\n "]))),
10
+ header: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: sticky;\n z-index: 999;\n top: 0;\n max-width: 100%;\n "]))),
11
+ glass: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n z-index: 0;\n\n &::before {\n ", ";\n ", ";\n mask-image: linear-gradient(to bottom, black ", "px, transparent);\n }\n\n &::after {\n ", ";\n }\n "])), stylish.blur, baseGlass, headerHeight, baseGlass),
12
+ main: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n display: flex;\n align-items: stretch;\n max-width: 100vw;\n "]))),
13
+ content: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: relative;\n flex: 1;\n max-width: 100%;\n "]))),
14
+ footer: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n "]))),
15
+ aside: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n position: sticky;\n z-index: 2;\n height: 100%;\n "]))),
16
+ asideInner: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n overflow-x: hidden;\n overflow-y: auto;\n width: 100%;\n height: calc(100vh - 64px);\n "]))),
17
+ toc: css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral([""])))
18
+ };
19
+ });
@@ -1,4 +1,4 @@
1
- import { Divider, Typography } from 'antd';
1
+ import { Collapse, Divider, Typography } from 'antd';
2
2
  import pangu from 'pangu';
3
3
  import { memo } from 'react';
4
4
  import ReactMarkdown from 'react-markdown';
@@ -17,7 +17,8 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
17
17
  pre: CodeBlock,
18
18
  code: Code,
19
19
  hr: Divider,
20
- a: Typography.Link
20
+ a: Typography.Link,
21
+ details: Collapse
21
22
  };
22
23
  return /*#__PURE__*/_jsx(Typography, {
23
24
  children: /*#__PURE__*/_jsx(ReactMarkdown, {
@@ -7,7 +7,7 @@ export var useStyles = createStyles(function (_ref) {
7
7
  return {
8
8
  search: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n "]))),
9
9
  input: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n padding: 0 8px 0 12px;\n "]))),
10
- tag: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n pointer-events: none;\n\n position: absolute;\n z-index: 5;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n "]))),
10
+ tag: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n pointer-events: none;\n\n position: absolute;\n z-index: 5;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n\n background: ", ";\n "])), token.colorBgContainer),
11
11
  icon: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorTextPlaceholder)
12
12
  };
13
13
  });
@@ -6,5 +6,5 @@ export var useStyles = createStyles(function (_ref, type) {
6
6
  cx = _ref.cx,
7
7
  token = _ref.token;
8
8
  var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border: 1px solid ", ";\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorder);
9
- return cx(typeStylish, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n gap: 8px;\n align-items: center;\n\n max-width: 100%;\n height: 36px;\n padding: 0 8px 0 12px;\n\n border-radius: ", "px;\n\n transition: background-color 100ms ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n .ant-highlighter-shiki {\n overflow: auto;\n flex: 1;\n }\n\n .prism-code {\n background: none !important;\n }\n\n pre {\n margin: 0 !important;\n padding-top: 6px !important;\n line-height: 1;\n background: none !important;\n }\n\n code[class*='language-'] {\n background: none !important;\n }\n "])), token.borderRadius, token.motionEaseOut, token.colorFillTertiary));
9
+ return cx(typeStylish, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n display: flex;\n gap: 8px;\n align-items: center;\n\n max-width: 100%;\n height: 36px;\n padding: 0 8px 0 12px;\n\n border-radius: ", "px;\n\n transition: background-color 100ms ", ";\n\n &:hover {\n background-color: ", ";\n }\n\n .ant-highlighter-shiki {\n overflow: auto;\n flex: 1;\n }\n\n .prism-code {\n background: none !important;\n }\n\n pre {\n margin: 0 !important;\n line-height: 1;\n background: none !important;\n }\n\n code[class*='language-'] {\n background: none !important;\n }\n "])), token.borderRadius, token.motionEaseOut, token.colorFillTertiary));
10
10
  });
@@ -9,7 +9,7 @@ export var useStyles = createStyles(function (_ref, _ref2) {
9
9
  return {
10
10
  editor: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n\n width: inherit;\n min-height: inherit;\n ", "\n "])), mobile && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-direction: column;\n "])))),
11
11
  left: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: auto;\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n\n ", "\n "])), !noPadding && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 40px 24px;\n "])))),
12
- right: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: ", ";\n "])), token.colorBgLayout),
12
+ right: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: ", ";\n\n .draggable-panel-fixed {\n width: 100% !important;\n }\n "])), token.colorBgLayout),
13
13
  leva: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n --leva-sizes-controlWidth: 66%;\n --leva-colors-elevation1: ", ";\n --leva-colors-elevation2: transparent;\n --leva-colors-elevation3: ", ";\n --leva-colors-accent1: ", ";\n --leva-colors-accent2: ", ";\n --leva-colors-accent3: ", ";\n --leva-colors-highlight1: ", ";\n --leva-colors-highlight2: ", ";\n --leva-colors-highlight3: ", ";\n --leva-colors-vivid1: ", ";\n --leva-shadows-level1: unset;\n --leva-shadows-level2: unset;\n --leva-fonts-mono: ", ";\n\n overflow: auto;\n width: 100%;\n height: 100%;\n padding: 6px 0;\n\n > div {\n background: transparent;\n\n > div {\n background: transparent;\n }\n }\n\n input:checked + label > svg {\n stroke: ", ";\n }\n\n button {\n --leva-colors-accent2: ", ";\n }\n "])), token.colorFillSecondary, token.colorFillSecondary, token.colorPrimary, token.colorPrimaryHover, token.colorPrimaryActive, token.colorTextTertiary, token.colorTextSecondary, token.colorText, token.colorWarning, token.fontFamilyCode, token.colorBgLayout, token.colorFillSecondary)
14
14
  };
15
15
  });
@@ -1,7 +1,7 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
2
  var _templateObject;
3
3
  import { createGlobalStyle } from 'antd-style';
4
- var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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\t box-sizing: border-box;\n\t vertical-align: baseline;\n }\n\n ::selection {\n color: #000;\n background: ", ";\n }\n\n ::-webkit-scrollbar {\n\t width: 0;\n\t height: 4px;\n\t background-color: transparent;\n\n\t &-thumb {\n\t\t background-color: transparent;\n\t\t border-radius: 4px;\n\t\t transition: background-color 500ms ", ";\n\t }\n\n\t &-corner {\n\t\t display: none;\n\t }\n }\n\n #root {\n\t min-height: 100vh;\n }\n\n p {\n text-align: justify;\n word-wrap: break-word;\n }\n\n code {\n\t font-family: ", " !important;\n\n\t * {\n\t\t font-family: inherit !important;\n\t }\n }\n\n *:hover, *:focus {\n\t ::-webkit-scrollbar {\n\t\t &-thumb {\n\t\t\t background-color: ", ";\n\t\t }\n\t }\n }\n"])), function (_ref) {
4
+ var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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 body {\n overflow-x: hidden;\n overflow-y: auto;\n height: 100vh;\n }\n\n\n * {\n\t box-sizing: border-box;\n\t vertical-align: baseline;\n }\n\n ::selection {\n color: #000;\n background: ", ";\n }\n\n\n #root {\n\t min-height: 100vh;\n }\n\n p {\n text-align: justify;\n word-wrap: break-word;\n }\n\n code {\n\t font-family: ", " !important;\n\n\t * {\n\t\t font-family: inherit !important;\n\t }\n }\n"])), function (_ref) {
5
5
  var theme = _ref.theme;
6
6
  return theme.fontFamily;
7
7
  }, function (_ref2) {
@@ -18,12 +18,6 @@ var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _tagge
18
18
  return theme.yellow9;
19
19
  }, function (_ref6) {
20
20
  var theme = _ref6.theme;
21
- return theme.motionEaseOut;
22
- }, function (_ref7) {
23
- var theme = _ref7.theme;
24
21
  return theme.fontFamilyCode;
25
- }, function (_ref8) {
26
- var theme = _ref8.theme;
27
- return theme.colorFill;
28
22
  });
29
23
  export default GlobalStyle;
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
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
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
4
  import { App } from 'antd';
5
- import { ThemeProvider as AntdThemeProvider, StyleProvider, setupStyled } from 'antd-style';
5
+ import { ThemeProvider as AntdThemeProvider, StyleProvider, createStyles, setupStyled } from 'antd-style';
6
6
  import { memo } from 'react';
7
7
  // @ts-ignore
8
8
  import ReactFontLoader from 'react-font-loader';
@@ -11,20 +11,27 @@ import { lobeCustomStylish, lobeCustomToken, lobeTheme } from "../styles";
11
11
  import GlobalStyle from "./GlobalStyle";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
- var ThemeProvider = /*#__PURE__*/memo(function (_ref) {
15
- var children = _ref.children,
16
- themeMode = _ref.themeMode,
17
- _ref$customStylish = _ref.customStylish,
18
- _customStylish = _ref$customStylish === void 0 ? function () {
14
+ var useStyled = createStyles(function (_ref) {
15
+ var stylish = _ref.stylish,
16
+ responsive = _ref.responsive;
17
+ return responsive.mobile ? stylish.noScrollbar : "";
18
+ });
19
+ var ThemeProvider = /*#__PURE__*/memo(function (_ref2) {
20
+ var children = _ref2.children,
21
+ themeMode = _ref2.themeMode,
22
+ _ref2$customStylish = _ref2.customStylish,
23
+ _customStylish = _ref2$customStylish === void 0 ? function () {
19
24
  return {};
20
- } : _ref$customStylish,
21
- _ref$customToken = _ref.customToken,
22
- _customToken = _ref$customToken === void 0 ? function () {
25
+ } : _ref2$customStylish,
26
+ _ref2$customToken = _ref2.customToken,
27
+ _customToken = _ref2$customToken === void 0 ? function () {
23
28
  return {};
24
- } : _ref$customToken;
29
+ } : _ref2$customToken;
25
30
  setupStyled({
26
31
  ThemeContext: ThemeContext
27
32
  });
33
+ var _useStyled = useStyled(),
34
+ styles = _useStyled.styles;
28
35
  return /*#__PURE__*/_jsx(StyleProvider, {
29
36
  speedy: process.env.NODE_ENV === 'production',
30
37
  children: /*#__PURE__*/_jsxs(AntdThemeProvider, {
@@ -41,6 +48,7 @@ var ThemeProvider = /*#__PURE__*/memo(function (_ref) {
41
48
  }), /*#__PURE__*/_jsx(ReactFontLoader, {
42
49
  url: "https://raw.githubusercontent.com/IKKI2000/harmonyos-fonts/main/css/harmonyos_sans_sc.css"
43
50
  }), /*#__PURE__*/_jsx(GlobalStyle, {}), /*#__PURE__*/_jsx(App, {
51
+ className: styles,
44
52
  style: {
45
53
  minHeight: 'inherit',
46
54
  width: 'inherit'
package/es/index.d.ts CHANGED
@@ -15,6 +15,7 @@ export { default as EditableText, type EditableTextProps } from './EditableText'
15
15
  export { default as Highlighter, type HighlighterProps, SyntaxHighlighter, type SyntaxHighlighterProps, } from './Highlighter';
16
16
  export { default as Icon, type IconProps, type IconSize } from './Icon';
17
17
  export { Input, type InputProps, TextArea, type TextAreaProps } from './Input';
18
+ export { default as Layout, type LayoutProps } from './Layout';
18
19
  export { default as List } from './List';
19
20
  export { default as Logo, type LogoProps } from './Logo';
20
21
  export { default as Markdown, type MarkdownProps } from './Markdown';
package/es/index.js CHANGED
@@ -14,6 +14,7 @@ export { default as EditableText } from "./EditableText";
14
14
  export { default as Highlighter, SyntaxHighlighter } from "./Highlighter";
15
15
  export { default as Icon } from "./Icon";
16
16
  export { Input, TextArea } from "./Input";
17
+ export { default as Layout } from "./Layout";
17
18
  export { default as List } from "./List";
18
19
  export { default as Logo } from "./Logo";
19
20
  export { default as Markdown } from "./Markdown";
@@ -1,11 +1,13 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2;
2
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
3
3
  export var generateCustomStylish = function generateCustomStylish(_ref) {
4
4
  var css = _ref.css,
5
5
  token = _ref.token,
6
6
  isDarkMode = _ref.isDarkMode;
7
7
  return {
8
8
  blur: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n backdrop-filter: saturate(180%) blur(10px);\n "]))),
9
- markdown: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin-block-start: 0;\n margin-block-end: 0;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-wrap: break-word;\n\n + * {\n margin-block-end: 0.5em;\n }\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n\n p {\n font-style: italic;\n color: ", ";\n }\n }\n\n p:not(:last-child) {\n margin-bottom: 1em;\n }\n\n a {\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n\n img {\n max-width: 100%;\n }\n\n pre {\n border: none;\n border-radius: ", "px;\n }\n\n > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n\n font-size: ", "px;\n color: ", ";\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n table {\n border-spacing: 0;\n\n width: 100%;\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0;\n margin-inline-end: 0;\n padding: 8px;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n th,\n td {\n padding-block-start: 10px;\n padding-block-end: 10px;\n padding-inline-start: 16px;\n padding-inline-end: 16px;\n }\n\n thead {\n tr {\n th {\n background: ", ";\n\n &:first-child {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n\n &:last-child {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n }\n\n ul li {\n line-height: 1.8;\n }\n "])), isDarkMode ? token.colorTextSecondary : token.colorText, token.colorText, token.colorTextDescription, token.colorLink, token.colorLinkHover, token.colorLinkActive, token.borderRadius, token.fontSizeSM, isDarkMode ? token.cyan9A : token.cyan10A, isDarkMode ? token.cyan1A : token.cyan3A, isDarkMode ? token.cyan1A : token.cyan4A, token.borderRadiusSM, token.colorBorderSecondary, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius)
9
+ noScrollbar: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ::-webkit-scrollbar {\n display: none;\n width: 0;\n height: 0;\n background-color: transparent;\n }\n "]))),
10
+ bottomScrollbar: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ::-webkit-scrollbar {\n width: 0;\n height: 4px;\n background-color: transparent;\n\n &-thumb {\n background-color: ", ";\n border-radius: 4px;\n transition: background-color 500ms ", ";\n }\n\n &-corner {\n display: none;\n width: 0;\n height: 0;\n }\n }\n "])), token.colorFill, token.motionEaseOut),
11
+ markdown: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n\n h1,\n h2,\n h3,\n h4,\n h5 {\n font-weight: 600;\n }\n\n p {\n margin-block-start: 0;\n margin-block-end: 0;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-wrap: break-word;\n\n + * {\n margin-block-end: 0.5em;\n }\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n\n p {\n font-style: italic;\n color: ", ";\n }\n }\n\n p:not(:last-child) {\n margin-bottom: 1em;\n }\n\n a {\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n }\n\n img {\n max-width: 100%;\n }\n\n pre {\n border: none;\n border-radius: ", "px;\n }\n\n > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n\n font-size: ", "px;\n color: ", ";\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n table {\n border-spacing: 0;\n\n width: 100%;\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0;\n margin-inline-end: 0;\n padding: 8px;\n\n border: 1px solid ", ";\n border-radius: ", "px;\n }\n\n th,\n td {\n padding-block-start: 10px;\n padding-block-end: 10px;\n padding-inline-start: 16px;\n padding-inline-end: 16px;\n }\n\n thead {\n tr {\n th {\n background: ", ";\n\n &:first-child {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\n }\n\n &:last-child {\n border-top-right-radius: ", "px;\n border-bottom-right-radius: ", "px;\n }\n }\n }\n }\n\n li {\n line-height: 1.8;\n\n &::marker {\n color: ", ";\n }\n }\n\n details {\n margin-bottom: 1em;\n padding: 12px 16px;\n\n background: ", ";\n border: 1px solid ", ";\n border-radius: ", "px;\n\n transition: all 400ms ", ";\n }\n\n details[open] {\n summary {\n padding-bottom: 12px;\n border-bottom: 1px solid ", ";\n }\n }\n "])), isDarkMode ? token.colorTextSecondary : token.colorText, token.colorText, token.colorTextDescription, token.colorLink, token.colorLinkHover, token.colorLinkActive, token.borderRadius, token.fontSizeSM, isDarkMode ? token.cyan9A : token.cyan10A, isDarkMode ? token.cyan1A : token.cyan3A, isDarkMode ? token.cyan1A : token.cyan4A, token.borderRadiusSM, token.colorBorderSecondary, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, isDarkMode ? token.cyan9A : token.cyan10A, token.colorFillTertiary, token.colorBorderSecondary, token.borderRadiusLG, token.motionEaseOut, token.colorBorder)
10
12
  };
11
13
  };
@@ -1,4 +1,6 @@
1
1
  export interface LobeCustomStylish {
2
2
  blur: string;
3
+ bottomScrollbar: string;
3
4
  markdown: string;
5
+ noScrollbar: string;
4
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.22.1",
3
+ "version": "1.23.1",
4
4
  "description": "Lobe UI is an open-source UI component library for building chatbot web apps",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -110,7 +110,7 @@
110
110
  "@types/pangu": "^4",
111
111
  "@types/react": "^18",
112
112
  "@types/react-dom": "^18",
113
- "@vitest/coverage-c8": "latest",
113
+ "@vitest/coverage-v8": "latest",
114
114
  "antd": "^5",
115
115
  "antd-style": "^3",
116
116
  "commitlint": "^17",