@lobehub/ui 1.18.1 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +28 -4
  2. package/es/ActionIcon/index.d.ts +9 -0
  3. package/es/ActionIcon/index.js +9 -5
  4. package/es/ActionIcon/style.js +1 -1
  5. package/es/Chat/store/index.d.ts +1 -1
  6. package/es/ColorScales/ScaleRow.js +1 -1
  7. package/es/ColorScales/style.js +1 -1
  8. package/es/ContextMenu/MenuItem/style.js +2 -2
  9. package/es/ContextMenu/index.js +1 -1
  10. package/es/Conversation/InputArea/index.js +1 -1
  11. package/es/Conversation/index.js +1 -1
  12. package/es/DraggablePanel/style.js +3 -3
  13. package/es/Highlighter/SyntaxHighlighter/style.js +1 -1
  14. package/es/Highlighter/index.js +1 -1
  15. package/es/Highlighter/style.js +2 -1
  16. package/es/Input/style.d.ts +2 -2
  17. package/es/Input/style.js +6 -4
  18. package/es/List/ListItem/time.js +1 -1
  19. package/es/Markdown/CodeBlock.js +1 -1
  20. package/es/SearchBar/index.d.ts +5 -0
  21. package/es/SearchBar/index.js +5 -4
  22. package/es/SearchBar/style.js +2 -2
  23. package/es/Snippet/index.d.ts +5 -0
  24. package/es/Snippet/index.js +4 -4
  25. package/es/Snippet/style.d.ts +1 -1
  26. package/es/Snippet/style.js +4 -2
  27. package/es/Spotlight/index.d.ts +7 -0
  28. package/es/Spotlight/index.js +68 -0
  29. package/es/Spotlight/style.d.ts +8 -0
  30. package/es/Spotlight/style.js +17 -0
  31. package/es/StroyBook/style.js +1 -1
  32. package/es/TabsNav/style.js +1 -1
  33. package/es/ThemeProvider/GlobalStyle.js +1 -1
  34. package/es/ThemeProvider/index.d.ts +1 -1
  35. package/es/ThemeProvider/index.js +1 -1
  36. package/es/Tooltip/style.js +1 -1
  37. package/es/hooks/useHighlight.d.ts +1 -1
  38. package/es/index.d.ts +3 -0
  39. package/es/index.js +1 -0
  40. package/es/styles/algorithms/generateCustomStylish.js +1 -1
  41. package/es/types/global.d.ts +0 -1
  42. package/package.json +9 -21
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <a name="readme-top"></a>
2
2
 
3
3
  <div align="center">
4
-
4
+
5
5
  <img width="160" src="https://raw.githubusercontent.com/lobehub/.github/main/profile/Logo.webp">
6
6
 
7
7
  <h1>Lobe UI</h1>
@@ -15,8 +15,7 @@ Lobe UI is an open-source UI component library for building _AIGC_ web apps
15
15
  [![release][release-shield]][release-url]
16
16
  [![releaseDate][release-date-shield]][release-date-url]
17
17
  [![ciTest][ci-test-shield]][ci-test-url]
18
- [![ciRelease][ci-release-shield]][ci-release-url]
19
- <br/>
18
+ [![ciRelease][ci-release-shield]][ci-release-url] <br/>
20
19
  [![contributors][contributors-shield]][contributors-url]
21
20
  [![forks][forks-shield]][forks-url]
22
21
  [![stargazers][stargazers-shield]][stargazers-url]
@@ -26,6 +25,25 @@ Lobe UI is an open-source UI component library for building _AIGC_ web apps
26
25
 
27
26
  </div>
28
27
 
28
+ <details>
29
+ <summary><kbd>Table of contents</kbd></summary>
30
+
31
+ #### TOC
32
+
33
+ - [📦 Installation](#-installation)
34
+
35
+ - [🤯 Usage](#-usage)
36
+
37
+ - [Compile with NextJS](#compile-with-nextjs)
38
+
39
+ - [⌨️ Local Development](#️-local-development)
40
+
41
+ - [🤝 Contributing](#-contributing)
42
+
43
+ ####
44
+
45
+ </details>
46
+
29
47
  ## 📦 Installation
30
48
 
31
49
  This package is [ESM only](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).
@@ -36,7 +54,13 @@ To install Lobe UI, run the following command:
36
54
  pnpm add @lobehub/ui
37
55
  ```
38
56
 
39
- ## Usage
57
+ <div align="right">
58
+
59
+ [![][back-to-top]](#readme-top)
60
+
61
+ </div>
62
+
63
+ ## 🤯 Usage
40
64
 
41
65
  ### Compile with NextJS
42
66
 
@@ -29,6 +29,10 @@ export interface ActionIconProps extends DivProps {
29
29
  * @type LucideIcon
30
30
  */
31
31
  icon: LucideIcon;
32
+ /**
33
+ * @description Handle click action
34
+ */
35
+ onClick?: () => void;
32
36
  /**
33
37
  * @description The position of the tooltip relative to the target
34
38
  * @enum ["top","left","right","bottom","topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]
@@ -40,6 +44,11 @@ export interface ActionIconProps extends DivProps {
40
44
  * @default 'normal'
41
45
  */
42
46
  size?: ActionIconSize;
47
+ /**
48
+ * @description Whether add spotlight background
49
+ * @default false
50
+ */
51
+ spotlight?: boolean;
43
52
  /**
44
53
  * @description The text shown in the tooltip
45
54
  */
@@ -1,12 +1,13 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["className", "active", "icon", "size", "style", "glass", "title", "placement", "arrow"];
3
+ var _excluded = ["className", "active", "icon", "size", "style", "glass", "title", "placement", "arrow", "spotlight", "onClick"];
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 { memo } from 'react';
7
- import { Icon, Tooltip } from "./..";
7
+ import { Icon, Spotlight, Tooltip } from "./..";
8
8
  import { useStyles } from "./style";
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
11
  var ActionIcon = /*#__PURE__*/memo(function (_ref) {
11
12
  var className = _ref.className,
12
13
  active = _ref.active,
@@ -19,6 +20,8 @@ var ActionIcon = /*#__PURE__*/memo(function (_ref) {
19
20
  placement = _ref.placement,
20
21
  _ref$arrow = _ref.arrow,
21
22
  arrow = _ref$arrow === void 0 ? false : _ref$arrow,
23
+ spotlight = _ref.spotlight,
24
+ onClick = _ref.onClick,
22
25
  props = _objectWithoutProperties(_ref, _excluded);
23
26
  var _useStyles = useStyles({
24
27
  active: Boolean(active),
@@ -50,18 +53,19 @@ var ActionIcon = /*#__PURE__*/memo(function (_ref) {
50
53
  borderRadius = (size === null || size === void 0 ? void 0 : size.borderRadius) || 5;
51
54
  break;
52
55
  }
53
- var actionIconBlock = /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
56
+ var actionIconBlock = /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
54
57
  className: cx(styles.block, className),
58
+ onClick: onClick,
55
59
  style: _objectSpread({
56
60
  width: blockSize,
57
61
  height: blockSize,
58
62
  borderRadius: borderRadius
59
63
  }, style)
60
64
  }, props), {}, {
61
- children: /*#__PURE__*/_jsx(Icon, {
65
+ children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), /*#__PURE__*/_jsx(Icon, {
62
66
  icon: icon,
63
67
  size: size === 'site' ? 'normal' : size
64
- })
68
+ })]
65
69
  }));
66
70
  if (!title) return actionIconBlock;
67
71
  return /*#__PURE__*/_jsx(Tooltip, {
@@ -9,6 +9,6 @@ export var useStyles = createStyles(function (_ref, _ref2) {
9
9
  var active = _ref2.active,
10
10
  glass = _ref2.glass;
11
11
  return {
12
- block: cx(glass && stylish.blur, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n color: ", ";\n\n background: ", ";\n\n transition: color 600ms ", ",\n background-color 100ms ", ";\n\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n\n &:active {\n color: ", ";\n background-color: ", ";\n }\n "])), active ? token.colorText : token.colorTextTertiary, active ? token.colorFillTertiary : 'transparent', token.motionEaseOut, token.motionEaseOut, token.colorText, token.colorFillSecondary, token.colorText, token.colorFill))
12
+ block: cx(glass && stylish.blur, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n\n color: ", ";\n\n background: ", ";\n\n transition: color 600ms ", ", transform 400ms ", ",\n background-color 100ms ", ";\n\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n\n &:active {\n transform: scale(0.8);\n color: ", ";\n background-color: ", ";\n }\n "])), active ? token.colorText : token.colorTextTertiary, active ? token.colorFillTertiary : 'transparent', token.motionEaseOut, token.motionEaseOut, token.motionEaseOut, token.colorText, token.colorFillSecondary, token.colorText, token.colorFill))
13
13
  };
14
14
  });
@@ -15,6 +15,6 @@ export declare const Provider: ({ createStore, children }: {
15
15
  subscribe: (listener: (state: ChatStore, prevState: ChatStore) => void) => () => void;
16
16
  destroy: () => void;
17
17
  };
18
- export { messagesReducer, type MessageDispatch } from './messageReducer';
18
+ export { type MessageDispatch, messagesReducer } from './messageReducer';
19
19
  export * from './selectors';
20
20
  export type { ChatStore } from './store';
@@ -1,4 +1,4 @@
1
- import { message, Space } from 'antd';
1
+ import { Space, message } from 'antd';
2
2
  import copy from 'copy-to-clipboard';
3
3
  import { memo } from 'react';
4
4
  import { alphaBg, useStyles } from "./style";
@@ -9,7 +9,7 @@ export var useStyles = createStyles(function (_ref) {
9
9
  var css = _ref.css;
10
10
  return {
11
11
  view: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n "]))),
12
- scaleBox: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n width: 48px;\n height: 32px;\n\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n background-size: 16px 16px;\n &:active {\n transform: scale(0.95);\n }\n "]))),
12
+ scaleBox: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n cursor: pointer;\n\n position: relative;\n\n width: 48px;\n height: 32px;\n\n background-position: 0 0, 0 8px, 8px -8px, -8px 0;\n background-size: 16px 16px;\n\n &:active {\n transform: scale(0.95);\n }\n "]))),
13
13
  scaleItem: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n justify-content: center;\n\n width: 100%;\n height: 100%;\n "]))),
14
14
  scaleRowTitle: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n width: 64px;\n height: 32px;\n "]))),
15
15
  text: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n opacity: 0.5;\n "])))
@@ -5,9 +5,9 @@ export var useStyles = createStyles(function (_ref, prefixCls) {
5
5
  var css = _ref.css,
6
6
  cx = _ref.cx,
7
7
  token = _ref.token;
8
- var selected = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-weight: bold;\n color: ", ";\n background: ", ";\n &:hover {\n color: ", ";\n background: ", ";\n }\n "])), token.colorPrimaryText, token.colorPrimaryBg, token.colorPrimaryTextHover, token.colorPrimaryBgHover);
8
+ var selected = css(_templateObject || (_templateObject = _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);
9
9
  return {
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: flex;\n align-items: center;\n justify-content: space-between;\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 &:hover {\n background: ", ";\n }\n "])), token.fontFamily, token.colorText, 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: flex;\n align-items: center;\n justify-content: space-between;\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
11
  selected: cx("".concat(prefixCls, "-item-selected"), selected),
12
12
  active: cx("".concat(prefixCls, "-item-active"), css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: ", ";\n "])), token.colorFillTertiary)),
13
13
  arrow: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorTextTertiary),
@@ -4,7 +4,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
4
4
  var _excluded = ["items", "label", "container"];
5
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
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 { autoUpdate, flip, FloatingFocusManager, FloatingNode, FloatingPortal, FloatingTree, offset, safePolygon, shift, useClick, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useFloatingTree, useHover, useInteractions, useListNavigation, useMergeRefs, useRole, useTypeahead } from '@floating-ui/react';
7
+ import { FloatingFocusManager, FloatingNode, FloatingPortal, FloatingTree, autoUpdate, flip, offset, safePolygon, shift, useClick, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useFloatingTree, useHover, useInteractions, useListNavigation, useMergeRefs, useRole, useTypeahead } from '@floating-ui/react';
8
8
  import { Divider } from 'antd';
9
9
  import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
10
10
  import MenuItem from "./MenuItem";
@@ -20,7 +20,7 @@ var useStyles = createStyles(function (_ref) {
20
20
  container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: sticky;\n z-index: ", ";\n bottom: 0;\n\n padding-top: 12px;\n padding-bottom: 24px;\n\n background-image: linear-gradient(to top, ", " 88%, transparent 100%);\n\n ", " {\n width: 100%;\n }\n "])), token.zIndexPopupBase, token.colorBgLayout, responsive.mobile),
21
21
  boxShadow: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n border-radius: 8px;\n box-shadow: ", ";\n "])), token.boxShadowSecondary),
22
22
  input: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 100%;\n border-radius: 8px;\n "]))),
23
- btn: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 10;\n right: 8px;\n bottom: 8px;\n\n color: ", ";\n &:hover {\n color: ", ";\n }\n "])), token.colorTextTertiary, token.colorTextSecondary),
23
+ btn: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 10;\n right: 8px;\n bottom: 8px;\n\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n "])), token.colorTextTertiary, token.colorTextSecondary),
24
24
  extra: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorTextTertiary)
25
25
  };
26
26
  });
@@ -4,7 +4,7 @@ var _excluded = ["readonly", "devtools", "includeSystem"];
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 { memo, useRef } from 'react';
7
- import { createChatStore, Provider } from "../Chat/store";
7
+ import { Provider, createChatStore } from "../Chat/store";
8
8
  import ChatContainer from "./App";
9
9
  import StoreUpdater from "./StoreUpdater";
10
10
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -6,7 +6,7 @@ var toggleLength = 40;
6
6
  var toggleShort = 16;
7
7
  export var useStyle = createStyles(function (_ref, prefix) {
8
8
  var token = _ref.token;
9
- var commonHandle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n &::before {\n content: '';\n position: absolute;\n z-index: 50;\n transition: all 0.2s ", ";\n }\n\n &:hover,\n &:active {\n &::before {\n background: ", " !important;\n }\n }\n "])), token.motionEaseOut, token.colorPrimary);
9
+ var commonHandle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n &::before {\n content: '';\n position: absolute;\n z-index: 50;\n transition: all 0.2s ", ";\n }\n\n &:hover,\n &:active {\n &::before {\n background: ", " !important;\n }\n }\n "])), token.motionEaseOut, token.colorPrimary);
10
10
  var commonToggle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 1001;\n opacity: 0;\n transition: all 0.2s ", ";\n\n &:hover {\n opacity: 1 !important;\n }\n\n &:active {\n opacity: 1 !important;\n }\n\n > div {\n cursor: pointer;\n\n position: absolute;\n\n color: ", ";\n\n background: ", ";\n border-color: ", ";\n border-style: solid;\n border-width: 1px;\n border-radius: 4px;\n\n transition: all 0.2s ", ";\n\n &:hover {\n color: ", ";\n background: ", ";\n }\n\n &:active {\n color: ", ";\n background: ", ";\n }\n }\n "])), token.motionEaseOut, token.colorTextTertiary, token.colorFillTertiary, token.colorBorderSecondary, token.motionEaseOut, token.colorTextSecondary, token.colorFillSecondary, token.colorText, token.colorFill);
11
11
  var float = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 2000;\n "])));
12
12
  return {
@@ -16,8 +16,8 @@ export var useStyle = createStyles(function (_ref, prefix) {
16
16
  rightFloat: cx(float, css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n top: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n "])))),
17
17
  topFloat: cx(float, css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n top: 0;\n right: 0;\n left: 0;\n width: 100%;\n "])))),
18
18
  bottomFloat: cx(float, css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n right: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n "])))),
19
- toggleLeft: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-left"), commonToggle, css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n left: -", "px;\n width: ", "px;\n height: 100%;\n > div {\n top: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-top: -20px;\n\n border-radius: 4px 0 0 4px;\n }\n "])), offset, toggleShort, toggleShort, toggleLength)),
20
- toggleRight: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-right"), commonToggle, css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n right: -", "px;\n width: ", "px;\n height: 100%;\n > div {\n top: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-top: -20px;\n\n border-radius: 0 4px 4px 0;\n }\n "])), offset, toggleShort, toggleShort, toggleLength)),
19
+ toggleLeft: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-left"), commonToggle, css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n left: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n top: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-top: -20px;\n\n border-radius: 4px 0 0 4px;\n }\n "])), offset, toggleShort, toggleShort, toggleLength)),
20
+ toggleRight: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-right"), commonToggle, css(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["\n right: -", "px;\n width: ", "px;\n height: 100%;\n\n > div {\n top: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-top: -20px;\n\n border-radius: 0 4px 4px 0;\n }\n "])), offset, toggleShort, toggleShort, toggleLength)),
21
21
  toggleTop: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-top"), commonToggle, css(_templateObject12 || (_templateObject12 = _taggedTemplateLiteral(["\n top: -", "px;\n width: 100%;\n height: ", "px;\n\n > div {\n left: 50%;\n\n width: ", "px;\n height: ", "px;\n margin-left: -20px;\n\n border-radius: 4px 4px 0 0;\n }\n "])), offset, toggleShort, toggleLength, toggleShort)),
22
22
  toggleBottom: cx("".concat(prefix, "-toggle"), "".concat(prefix, "-toggle-bottom"), commonToggle, css(_templateObject13 || (_templateObject13 = _taggedTemplateLiteral(["\n bottom: -", "px;\n width: 100%;\n height: ", "px;\n\n > div {\n left: 50%;\n\n width: ", "px;\n height: 16px;\n margin-left: -20px;\n\n border-radius: 0 0 4px 4px;\n }\n "])), offset, toggleShort, toggleLength)),
23
23
  panel: cx("".concat(prefix, "-fixed"), css(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n overflow: hidden;\n transition: all 0.2s ", ";\n "])), token.motionEaseOut)),
@@ -11,6 +11,6 @@ export var useStyles = createStyles(function (_ref) {
11
11
  return {
12
12
  shiki: cx("".concat(prefix, "-shiki"), css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .shiki {\n overflow-x: scroll;\n background: none !important;\n }\n "])))),
13
13
  prism: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n pre {\n overflow-x: scroll;\n font-family: ", " !important;\n }\n "])), token.fontFamilyCode),
14
- loading: cx(stylish.blur, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n right: 0;\n\n padding: 4px 8px;\n\n color: ", ";\n\n border-radius: ", ";\n "])), token.colorTextTertiary, token.borderRadiusSM))
14
+ loading: cx(stylish.blur, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 10;\n top: 0;\n right: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n height: 34px;\n padding: 0 8px;\n\n font-family: ", ";\n color: ", ";\n\n border-radius: ", ";\n "])), token.fontFamilyCode, token.colorTextTertiary, token.borderRadius))
15
15
  };
16
16
  });
@@ -1,7 +1,7 @@
1
1
  import { memo } from 'react';
2
2
  import CopyButton from "../CopyButton";
3
- import { useStyles } from "./style";
4
3
  import SyntaxHighlighter from "./SyntaxHighlighter";
4
+ import { useStyles } from "./style";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
7
  export { SyntaxHighlighter };
@@ -9,8 +9,9 @@ export var useStyles = createStyles(function (_ref, type) {
9
9
  var prefix = "".concat(prefixCls, "-highlighter");
10
10
  var buttonHoverCls = "".concat(prefix, "-hover-btn");
11
11
  var langHoverCls = "".concat(prefix, "-hover-lang");
12
+ var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border: 1px solid ", ";\n\n &:hover {\n background-color: ", ";\n }\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorder, type === 'prue' ? 'transparent' : token.colorFillTertiary);
12
13
  return {
13
- container: cx(prefix, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n overflow: auto;\n\n background-color: ", ";\n border-radius: ", "px;\n\n transition: background-color 100ms ", ";\n ", "\n &:hover {\n background-color: ", ";\n .", " {\n opacity: 1;\n }\n\n .", " {\n opacity: 1;\n }\n }\n\n .prism-code {\n background: none !important;\n }\n\n pre {\n margin: 0 !important;\n padding: ", " !important;\n background: none !important;\n }\n\n code {\n background: transparent !important;\n }\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', token.borderRadius, token.motionEaseOut, type === 'ghost' && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n "])), token.colorBorder), type === 'prue' ? 'transparent' : token.colorFillTertiary, buttonHoverCls, langHoverCls, type === 'prue' ? 0 : "16px 24px")),
14
+ container: cx(prefix, typeStylish, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n overflow: auto;\n border-radius: ", "px;\n transition: background-color 100ms ", ";\n\n &:hover {\n .", " {\n opacity: 1;\n }\n\n .", " {\n opacity: 1;\n }\n }\n\n .prism-code {\n background: none !important;\n }\n\n pre {\n margin: 0 !important;\n padding: ", " !important;\n background: none !important;\n }\n\n code {\n background: transparent !important;\n }\n "])), token.borderRadius, token.motionEaseOut, buttonHoverCls, langHoverCls, type === 'prue' ? 0 : "16px 24px")),
14
15
  button: cx(buttonHoverCls, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 51;\n top: 8px;\n right: 8px;\n\n opacity: 0;\n "])))),
15
16
  lang: cx(langHoverCls, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 50;\n right: 8px;\n bottom: 8px;\n\n color: ", ";\n\n opacity: 0;\n\n transition: opacity 0.1s;\n "])), token.colorTextPlaceholder))
16
17
  };
@@ -1,6 +1,6 @@
1
1
  export declare const useStyles: (props?: {
2
2
  type: 'ghost' | 'block';
3
3
  } | undefined) => import("antd-style").ReturnStyles<{
4
- input: import("antd-style").SerializedStyles;
5
- textarea: import("antd-style").SerializedStyles;
4
+ input: string;
5
+ textarea: string;
6
6
  }>;
package/es/Input/style.js CHANGED
@@ -1,12 +1,14 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2;
2
+ var _templateObject, _templateObject2, _templateObject3;
3
3
  import { createStyles } from 'antd-style';
4
4
  export var useStyles = createStyles(function (_ref, _ref2) {
5
- var css = _ref.css,
5
+ var cx = _ref.cx,
6
+ css = _ref.css,
6
7
  token = _ref.token;
7
8
  var type = _ref2.type;
9
+ var typeStylish = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background-color: ", ";\n border: 1px solid ", ";\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorder);
8
10
  return {
9
- input: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n\n max-width: 100%;\n height: 36px;\n padding: 0 12px;\n\n background-color: ", ";\n border: 1px solid ", ";\n\n transition: background-color 100ms ", ";\n\n input {\n background: transparent;\n }\n\n &:hover {\n background-color: ", ";\n }\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorder, token.motionEaseOut, token.colorFillTertiary),
10
- textarea: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n max-width: 100%;\n padding: 8px 12px;\n\n background-color: ", ";\n border: 1px solid ", ";\n\n transition: background-color 100ms ", ";\n\n textarea {\n background: transparent;\n }\n\n &:hover {\n background-color: ", ";\n }\n "])), type === 'block' ? token.colorFillTertiary : 'transparent', type === 'block' ? 'transparent' : token.colorBorder, token.motionEaseOut, token.colorFillTertiary)
11
+ input: cx(typeStylish, css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n\n max-width: 100%;\n height: 36px;\n padding: 0 12px;\n\n transition: background-color 100ms ", ";\n\n input {\n background: transparent;\n }\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:focus {\n border-color: ", ";\n }\n "])), token.motionEaseOut, token.colorFillTertiary, token.colorBorder, token.colorTextQuaternary)),
12
+ textarea: cx(typeStylish, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n padding: 8px 12px;\n transition: background-color 100ms ", ";\n\n textarea {\n background: transparent;\n }\n\n &:hover {\n background-color: ", ";\n border-color: ", ";\n }\n\n &:focus {\n border-color: ", ";\n }\n "])), token.motionEaseOut, token.colorFillTertiary, token.colorBorder, token.colorTextQuaternary))
11
13
  };
12
14
  });
@@ -1,5 +1,5 @@
1
- import 'dayjs/locale/zh-cn';
2
1
  import dayjs from 'dayjs';
2
+ import 'dayjs/locale/zh-cn';
3
3
  dayjs.locale('zh-cn');
4
4
  export var getChatItemTime = function getChatItemTime(updateAt) {
5
5
  var time = dayjs(updateAt);
@@ -6,7 +6,7 @@ import Highlighter from "../Highlighter";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  var useStyles = createStyles(function (_ref) {
8
8
  var css = _ref.css;
9
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :not(:last-child) {\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n }\n "])));
9
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :not(:last-child) {\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0;\n margin-inline-end: 0;\n }\n "])));
10
10
  });
11
11
  var Code = /*#__PURE__*/memo(function (props) {
12
12
  var _useStyles = useStyles(),
@@ -11,6 +11,11 @@ export interface SearchBarProps extends InputProps {
11
11
  * @default 'f'
12
12
  */
13
13
  shortKey?: string;
14
+ /**
15
+ * @description Whether add spotlight background
16
+ * @default false
17
+ */
18
+ spotlight?: boolean;
14
19
  }
15
20
  declare const SearchBar: import("react").NamedExoticComponent<SearchBarProps>;
16
21
  export default SearchBar;
@@ -1,21 +1,22 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
- var _excluded = ["className", "value", "onChange", "placeholder", "enableShortKey", "shortKey"];
4
+ var _excluded = ["spotlight", "className", "value", "onChange", "placeholder", "enableShortKey", "shortKey"];
5
5
  var _navigator;
6
6
  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; }
7
7
  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; }
8
8
  import { Tag } from 'antd';
9
9
  import { Search } from 'lucide-react';
10
10
  import { memo, useEffect, useRef, useState } from 'react';
11
- import { Icon, Input } from "./..";
11
+ import { Icon, Input, Spotlight } from "./..";
12
12
  import { useStyles } from "./style";
13
13
  import { jsx as _jsx } from "react/jsx-runtime";
14
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
15
  var isAppleDevice = /(mac|iphone|ipod|ipad)/i.test(typeof navigator !== 'undefined' ? (_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.platform : '');
16
16
  var symbol = isAppleDevice ? '⌘' : 'Ctrl';
17
17
  var SearchBar = /*#__PURE__*/memo(function (_ref) {
18
- var className = _ref.className,
18
+ var spotlight = _ref.spotlight,
19
+ className = _ref.className,
19
20
  value = _ref.value,
20
21
  _onChange = _ref.onChange,
21
22
  placeholder = _ref.placeholder,
@@ -51,7 +52,7 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
51
52
  }, []);
52
53
  return /*#__PURE__*/_jsxs("div", {
53
54
  className: styles.search,
54
- children: [/*#__PURE__*/_jsx(Input, _objectSpread({
55
+ children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), /*#__PURE__*/_jsx(Input, _objectSpread({
55
56
  allowClear: true,
56
57
  className: cx(styles.input, className),
57
58
  onBlur: function onBlur() {
@@ -5,9 +5,9 @@ export var useStyles = createStyles(function (_ref) {
5
5
  var css = _ref.css,
6
6
  token = _ref.token;
7
7
  return {
8
- search: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n "]))),
8
+ search: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n\n .ant-input-affix-wrapper {\n &:hover {\n border-color: ", ";\n }\n }\n\n .ant-input-affix-wrapper-focused {\n border-color: ", ";\n\n &:hover {\n border-color: ", ";\n }\n }\n "])), token.colorBorder, token.colorTextQuaternary, token.colorTextQuaternary),
9
9
  input: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n padding: 0 8px 0 12px;\n "]))),
10
- tag: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\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 "]))),
11
11
  icon: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorTextPlaceholder)
12
12
  };
13
13
  });
@@ -15,6 +15,11 @@ export interface SnippetProps extends DivProps {
15
15
  * @default 'tsx'
16
16
  */
17
17
  language?: string;
18
+ /**
19
+ * @description Whether add spotlight background
20
+ * @default false
21
+ */
22
+ spotlight?: boolean;
18
23
  /**
19
24
  * @description The symbol to be displayed before the content inside the Snippet component
20
25
  */
@@ -1,11 +1,10 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["symbol", "language", "children", "copyable", "type"];
3
+ var _excluded = ["symbol", "language", "children", "copyable", "type", "spotlight"];
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 { memo } from 'react';
7
- import CopyButton from "../CopyButton";
8
- import { SyntaxHighlighter } from "../Highlighter";
7
+ import { CopyButton, Spotlight, SyntaxHighlighter } from "./..";
9
8
  import { useStyles } from "./style";
10
9
  import { jsx as _jsx } from "react/jsx-runtime";
11
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -18,13 +17,14 @@ var Snippet = /*#__PURE__*/memo(function (_ref) {
18
17
  copyable = _ref$copyable === void 0 ? true : _ref$copyable,
19
18
  _ref$type = _ref.type,
20
19
  type = _ref$type === void 0 ? 'ghost' : _ref$type,
20
+ spotlight = _ref.spotlight,
21
21
  props = _objectWithoutProperties(_ref, _excluded);
22
22
  var _useStyles = useStyles(type),
23
23
  styles = _useStyles.styles;
24
24
  return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
25
25
  className: styles
26
26
  }, props), {}, {
27
- children: [/*#__PURE__*/_jsx(SyntaxHighlighter, {
27
+ children: [spotlight && /*#__PURE__*/_jsx(Spotlight, {}), /*#__PURE__*/_jsx(SyntaxHighlighter, {
28
28
  language: language,
29
29
  children: [symbol, children].filter(Boolean).join(' ')
30
30
  }), copyable && /*#__PURE__*/_jsx(CopyButton, {
@@ -1 +1 @@
1
- export declare const useStyles: (props?: "block" | "ghost" | undefined) => import("antd-style").ReturnStyles<import("antd-style").SerializedStyles>;
1
+ export declare const useStyles: (props?: "block" | "ghost" | undefined) => import("antd-style").ReturnStyles<string>;
@@ -1,8 +1,10 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
- var _templateObject, _templateObject2, _templateObject3;
2
+ var _templateObject, _templateObject2;
3
3
  import { createStyles } from 'antd-style';
4
4
  export var useStyles = createStyles(function (_ref, type) {
5
5
  var css = _ref.css,
6
+ cx = _ref.cx,
6
7
  token = _ref.token;
7
- return css(_templateObject || (_templateObject = _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\n &:hover {\n background-color: ", ";\n }\n\n .ant-highlighter-shiki {\n overflow: auto;\n flex: 1;\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, type === 'block' ? css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background-color: ", ";\n "])), token.colorFillTertiary) : css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n "])), token.colorBorder), token.colorFillTertiary);
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));
8
10
  });
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { DivProps } from "../types";
3
+ export interface SpotlightProps extends DivProps {
4
+ size?: number;
5
+ }
6
+ declare const Spotlight: import("react").NamedExoticComponent<SpotlightProps>;
7
+ export default Spotlight;
@@ -0,0 +1,68 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
+ var _excluded = ["className", "size"];
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 { memo, useEffect, useRef, useState } from 'react';
8
+ import { useStyles } from "./style";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ var useMouseOffset = function useMouseOffset() {
11
+ var _useState = useState(),
12
+ _useState2 = _slicedToArray(_useState, 2),
13
+ offset = _useState2[0],
14
+ setOffset = _useState2[1];
15
+ var _useState3 = useState(true),
16
+ _useState4 = _slicedToArray(_useState3, 2),
17
+ outside = _useState4[0],
18
+ setOutside = _useState4[1];
19
+ var ref = useRef(null);
20
+ useEffect(function () {
21
+ if (ref.current && ref.current.parentElement) {
22
+ var el = ref.current.parentElement;
23
+
24
+ // debounce?
25
+ var onMouseMove = function onMouseMove(e) {
26
+ var bound = el.getBoundingClientRect();
27
+ setOffset({
28
+ x: e.clientX - bound.x,
29
+ y: e.clientY - bound.y
30
+ });
31
+ setOutside(false);
32
+ };
33
+ var onMouseLeave = function onMouseLeave() {
34
+ setOutside(true);
35
+ };
36
+ el.addEventListener('mousemove', onMouseMove);
37
+ el.addEventListener('mouseleave', onMouseLeave);
38
+ return function () {
39
+ el.removeEventListener('mousemove', onMouseMove);
40
+ el.removeEventListener('mouseleave', onMouseLeave);
41
+ };
42
+ }
43
+ }, []);
44
+ return [offset, outside, ref];
45
+ };
46
+ var Spotlight = /*#__PURE__*/memo(function (_ref) {
47
+ var className = _ref.className,
48
+ _ref$size = _ref.size,
49
+ size = _ref$size === void 0 ? 64 : _ref$size,
50
+ props = _objectWithoutProperties(_ref, _excluded);
51
+ var _useMouseOffset = useMouseOffset(),
52
+ _useMouseOffset2 = _slicedToArray(_useMouseOffset, 3),
53
+ offset = _useMouseOffset2[0],
54
+ outside = _useMouseOffset2[1],
55
+ ref = _useMouseOffset2[2];
56
+ var _useStyles = useStyles({
57
+ offset: offset,
58
+ outside: outside,
59
+ size: size
60
+ }),
61
+ styles = _useStyles.styles,
62
+ cx = _useStyles.cx;
63
+ return /*#__PURE__*/_jsx("div", _objectSpread({
64
+ className: cx(styles, className),
65
+ ref: ref
66
+ }, props));
67
+ });
68
+ export default Spotlight;
@@ -0,0 +1,8 @@
1
+ export declare const useStyles: (props?: {
2
+ offset: {
3
+ x: number;
4
+ y: number;
5
+ };
6
+ outside: boolean;
7
+ size: number;
8
+ } | undefined) => import("antd-style").ReturnStyles<import("antd-style").SerializedStyles>;
@@ -0,0 +1,17 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
2
+ var _templateObject;
3
+ import { createStyles } from 'antd-style';
4
+ export var useStyles = createStyles(function (_ref, _ref2) {
5
+ var _offset$x, _offset$y;
6
+ var css = _ref.css,
7
+ token = _ref.token,
8
+ isDarkMode = _ref.isDarkMode;
9
+ var offset = _ref2.offset,
10
+ outside = _ref2.outside,
11
+ size = _ref2.size;
12
+ var spotlightX = ((_offset$x = offset === null || offset === void 0 ? void 0 : offset.x) !== null && _offset$x !== void 0 ? _offset$x : 0) + 'px';
13
+ var spotlightY = ((_offset$y = offset === null || offset === void 0 ? void 0 : offset.y) !== null && _offset$y !== void 0 ? _offset$y : 0) + 'px';
14
+ var spotlightOpacity = outside ? '0' : isDarkMode ? '.1' : '0.07';
15
+ var spotlightSize = size + 'px';
16
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n pointer-events: none;\n\n position: absolute;\n z-index: 1;\n inset: 0;\n\n opacity: ", ";\n background: radial-gradient(\n ", " circle at ", " ", ",\n ", ",\n transparent\n );\n border-radius: inherit;\n\n transition: all 0.2s;\n "])), spotlightOpacity, spotlightSize, spotlightX, spotlightY, token.colorText);
17
+ });
@@ -10,6 +10,6 @@ export var useStyles = createStyles(function (_ref, _ref2) {
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
12
  right: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: ", ";\n "])), token.colorBgLayout),
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 > 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)
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
  });
@@ -9,6 +9,6 @@ export var useStyles = createStyles(function (_ref) {
9
9
  var marginHoriz = 16;
10
10
  var paddingVertical = 6;
11
11
  return {
12
- tabs: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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)
12
+ tabs: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\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\n &::before {\n display: none;\n }\n }\n "])), prefix, prefix, marginHoriz, prefix, token.colorTextSecondary, marginHoriz, marginHoriz, paddingVertical, token.colorText, token.colorFillTertiary, token.borderRadius, prefix)
13
13
  };
14
14
  });
@@ -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 ::-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\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\n * {\n\t box-sizing: border-box;\n\t vertical-align: baseline;\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) {
5
5
  var theme = _ref.theme;
6
6
  return theme.fontFamily;
7
7
  }, function (_ref2) {
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { extractStaticStyle, type ThemeMode } from 'antd-style';
2
+ import { type ThemeMode, extractStaticStyle } from 'antd-style';
3
3
  import type { CustomStylishParams, CustomTokenParams } from 'antd-style/lib/types/function';
4
4
  export interface ThemeProviderProps {
5
5
  /**
@@ -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 { setupStyled, StyleProvider, ThemeProvider as AntdThemeProvider } from 'antd-style';
5
+ import { ThemeProvider as AntdThemeProvider, StyleProvider, setupStyled } from 'antd-style';
6
6
  import { memo } from 'react';
7
7
  // @ts-ignore
8
8
  import ReactFontLoader from 'react-font-loader';
@@ -5,6 +5,6 @@ export var useStyles = createStyles(function (_ref) {
5
5
  var css = _ref.css,
6
6
  token = _ref.token;
7
7
  return {
8
- tooltip: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-tooltip-inner {\n display: flex;\n align-items: center;\n justify-content: center;\n\n min-height: unset;\n padding: 4px 8px;\n\n color: ", ";\n\n background-color: ", ";\n border-radius: ", "px;\n }\n .ant-tooltip-arrow {\n &:before,\n &:after {\n background: ", ";\n }\n }\n "])), token.colorBgLayout, token.colorText, token.borderRadiusSM, token.colorText)
8
+ tooltip: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-tooltip-inner {\n display: flex;\n align-items: center;\n justify-content: center;\n\n min-height: unset;\n padding: 4px 8px;\n\n color: ", ";\n\n background-color: ", ";\n border-radius: ", "px;\n }\n\n .ant-tooltip-arrow {\n &::before,\n &::after {\n background: ", ";\n }\n }\n "])), token.colorBgLayout, token.colorText, token.borderRadiusSM, token.colorText)
9
9
  };
10
10
  });
@@ -1,4 +1,4 @@
1
- import { Highlighter } from 'shiki-es';
1
+ import { type Highlighter } from 'shiki-es';
2
2
  export declare const languageMap: readonly ["javascript", "js", "jsx", "json", "markdown", "md", "less", "css", "typescript", "ts", "tsx", "diff", "bash"];
3
3
  /**
4
4
  * @title 代码高亮的存储对象
package/es/index.d.ts CHANGED
@@ -20,6 +20,7 @@ export { default as MessageModal, type MessageModalProps } from './MessageModal'
20
20
  export { default as SearchBar, type SearchBarProps } from './SearchBar';
21
21
  export { default as SideNav, type SideNavProps } from './SideNav';
22
22
  export { default as Snippet, type SnippetProps } from './Snippet';
23
+ export { default as Spotlight, type SpotlightProps } from './Spotlight';
23
24
  export { default as StroyBook, type StroyBookProps, useControls, useCreateStore, } from './StroyBook';
24
25
  export { colorScales as colors } from './styles/colors';
25
26
  export { default as Swatches, type SwatchesProps } from './Swatches';
@@ -27,3 +28,5 @@ export { default as TabsNav, type TabsNavProps } from './TabsNav';
27
28
  export { default as ThemeProvider } from './ThemeProvider';
28
29
  export { default as ThemeSwitch, type ThemeSwitchProps } from './ThemeSwitch';
29
30
  export { default as Tooltip, type TooltipProps } from './Tooltip';
31
+ export { type LobeCustomStylish } from './types/customStylish';
32
+ export { type LobeCustomToken } from './types/customToken';
package/es/index.js CHANGED
@@ -19,6 +19,7 @@ export { default as MessageModal } from "./MessageModal";
19
19
  export { default as SearchBar } from "./SearchBar";
20
20
  export { default as SideNav } from "./SideNav";
21
21
  export { default as Snippet } from "./Snippet";
22
+ export { default as Spotlight } from "./Spotlight";
22
23
  export { default as StroyBook, useControls, useCreateStore } from "./StroyBook";
23
24
  export { colorScales as colors } from "./styles/colors";
24
25
  export { default as Swatches } from "./Swatches";
@@ -6,6 +6,6 @@ export var generateCustomStylish = function generateCustomStylish(_ref) {
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: 20px auto;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-wrap: break-word;\n }\n\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\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-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: 0px;\n margin-inline-end: 0px;\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 &:first-child {\n border-top-left-radius: ", "px;\n border-bottom-left-radius: ", "px;\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
+ 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: 20px auto;\n\n font-size: 14px;\n line-height: 1.8;\n color: ", ";\n text-align: justify;\n word-wrap: break-word;\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-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)
10
10
  };
11
11
  };
@@ -1,5 +1,4 @@
1
1
  import 'antd-style';
2
-
3
2
  import { AntdToken } from 'antd-style/lib/types/theme';
4
3
 
5
4
  import { LobeCustomStylish } from './customStylish';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.18.1",
3
+ "version": "1.19.0",
4
4
  "description": "Lobe UI is an open-source UI component library for building chatbot web apps",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -18,7 +18,7 @@
18
18
  "url": "https://github.com/lobehub/lobe-ui.git"
19
19
  },
20
20
  "license": "MIT",
21
- "author": "LobeHub",
21
+ "author": "LobeHub <i@lobehub.com>",
22
22
  "sideEffects": false,
23
23
  "main": "es/index.js",
24
24
  "module": "es/index.js",
@@ -37,11 +37,11 @@
37
37
  "docs:build": "npm run build:theme && dumi build",
38
38
  "doctor": "father doctor",
39
39
  "lint": "eslint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\" --fix",
40
- "lint:md": "remark . -f -q",
40
+ "lint:md": "remark . --quiet --frail --output",
41
41
  "lint:style": "stylelint \"{src,tests,packages}/**/*.{js,jsx,ts,tsx}\" --fix",
42
42
  "prepare": "husky install && npm run setup",
43
43
  "prepublishOnly": "father doctor && npm run build",
44
- "prettier": "prettier -c --write \"**/**\"",
44
+ "prettier": "prettier -c --write --no-error-on-unmatched-pattern \"**/**\"",
45
45
  "release": "semantic-release",
46
46
  "setup": "dumi setup",
47
47
  "start": "dumi dev",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "lint-staged": {
54
54
  "*.md": [
55
- "remark -f -q",
55
+ "remark --quiet --output --",
56
56
  "prettier --write --no-error-on-unmatched-pattern"
57
57
  ],
58
58
  "*.json": [
@@ -60,10 +60,12 @@
60
60
  ],
61
61
  "*.{js,jsx}": [
62
62
  "prettier --write",
63
+ "stylelint --fix",
63
64
  "eslint --fix"
64
65
  ],
65
66
  "*.{ts,tsx}": [
66
67
  "prettier --parser=typescript --write",
68
+ "stylelint --fix",
67
69
  "eslint --fix"
68
70
  ]
69
71
  },
@@ -100,13 +102,14 @@
100
102
  "devDependencies": {
101
103
  "@ant-design/colors": "^7",
102
104
  "@commitlint/cli": "^17",
105
+ "@lobehub/lint": "latest",
106
+ "@react-spring/web": "^9",
103
107
  "@testing-library/react": "^14",
104
108
  "@types/chroma-js": "^2",
105
109
  "@types/lodash-es": "^4",
106
110
  "@types/pangu": "^4",
107
111
  "@types/react": "^18",
108
112
  "@types/react-dom": "^18",
109
- "@umijs/lint": "^4",
110
113
  "@vitest/coverage-c8": "latest",
111
114
  "antd": "^5",
112
115
  "antd-style": "^3",
@@ -118,32 +121,17 @@
118
121
  "dumi-assets-types": "^1",
119
122
  "dumi-theme-lobehub": "workspace:latest",
120
123
  "eslint": "^8",
121
- "eslint-import-resolver-alias": "^1",
122
- "eslint-import-resolver-typescript": "^3",
123
- "eslint-plugin-import": "^2",
124
- "eslint-plugin-simple-import-sort": "^10",
125
- "eslint-plugin-typescript-sort-keys": "^2",
126
124
  "father": "^4",
127
125
  "husky": "^8",
128
126
  "jsdom": "^22",
129
127
  "lint-staged": "^13",
130
- "postcss-styled-syntax": "^0",
131
128
  "prettier": "^2",
132
- "prettier-plugin-organize-imports": "^3",
133
- "prettier-plugin-packagejson": "^2",
134
129
  "react": "^18",
135
130
  "react-dom": "^18",
136
131
  "remark": "^14",
137
132
  "remark-cli": "^11",
138
- "remark-lint": "^9",
139
- "remark-lint-list-item-indent": "^3",
140
- "remark-preset-lint-recommended": "^6",
141
133
  "semantic-release": "^21",
142
- "semantic-release-config-gitmoji": "^1",
143
134
  "stylelint": "^15",
144
- "stylelint-config-clean-order": "^5",
145
- "stylelint-config-recommended": "^12",
146
- "stylelint-order": "^6",
147
135
  "typescript": "^5",
148
136
  "vitest": "latest"
149
137
  },