@lobehub/ui 1.26.0 → 1.26.2

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 (138) hide show
  1. package/es/ActionIcon/index.d.ts +1 -1
  2. package/es/ActionIcon/index.js +30 -18
  3. package/es/Avatar/index.js +11 -11
  4. package/es/Chat/store/initialState.d.ts +3 -3
  5. package/es/Chat/store/initialState.js +4 -4
  6. package/es/Chat/store/messageReducer.js +71 -49
  7. package/es/Chat/store/selectors.d.ts +3 -3
  8. package/es/Chat/store/selectors.js +3 -3
  9. package/es/Chat/store/store.d.ts +1 -1
  10. package/es/Chat/store/store.js +110 -110
  11. package/es/Chat/types.d.ts +1 -1
  12. package/es/Chat/utils/fetch.d.ts +1 -1
  13. package/es/Chat/utils/fetch.js +4 -4
  14. package/es/ChatInputArea/index.js +2 -1
  15. package/es/ChatInputArea/style.d.ts +3 -3
  16. package/es/ChatInputArea/style.js +5 -5
  17. package/es/ChatItem/index.js +12 -10
  18. package/es/ChatItem/style.d.ts +3 -3
  19. package/es/ChatItem/style.js +7 -7
  20. package/es/ChatList/ActionsBar.d.ts +1 -1
  21. package/es/ChatList/ActionsBar.js +12 -11
  22. package/es/ChatList/index.d.ts +1 -1
  23. package/es/ChatList/index.js +1 -1
  24. package/es/ColorScales/ScaleRow.js +20 -14
  25. package/es/ColorScales/index.js +6 -4
  26. package/es/ColorScales/style.d.ts +2 -2
  27. package/es/ColorScales/style.js +7 -7
  28. package/es/ContextMenu/MenuItem/index.js +14 -14
  29. package/es/ContextMenu/MenuItem/style.d.ts +2 -2
  30. package/es/ContextMenu/MenuItem/style.js +5 -5
  31. package/es/ContextMenu/index.js +42 -42
  32. package/es/ContextMenu/style.d.ts +1 -1
  33. package/es/ContextMenu/style.js +2 -2
  34. package/es/Conversation/App.js +2 -2
  35. package/es/Conversation/ChatList/MessageItem/Content.js +15 -15
  36. package/es/Conversation/ChatList/MessageItem/Toolbar.js +3 -3
  37. package/es/Conversation/ChatList/MessageItem/index.js +14 -14
  38. package/es/Conversation/ChatList/index.js +5 -5
  39. package/es/Conversation/InputArea/ActionBar.d.ts +2 -2
  40. package/es/Conversation/InputArea/ActionBar.js +2 -2
  41. package/es/Conversation/InputArea/index.d.ts +2 -2
  42. package/es/Conversation/InputArea/index.js +10 -12
  43. package/es/Conversation/StoreUpdater.js +1 -1
  44. package/es/Conversation/index.js +2 -2
  45. package/es/CopyButton/index.d.ts +4 -2
  46. package/es/CopyButton/index.js +4 -3
  47. package/es/DraggablePanel/index.d.ts +2 -2
  48. package/es/DraggablePanel/index.js +50 -42
  49. package/es/DraggablePanel/style.d.ts +9 -9
  50. package/es/DraggablePanel/style.js +17 -17
  51. package/es/DraggablePanel/utils.js +12 -4
  52. package/es/EditableMessage/index.js +4 -4
  53. package/es/EditableMessageList/index.js +20 -19
  54. package/es/EditableText/index.js +1 -1
  55. package/es/Features/Item.js +5 -5
  56. package/es/Features/Item.style.d.ts +2 -2
  57. package/es/Features/Item.style.js +4 -4
  58. package/es/Features/index.js +3 -3
  59. package/es/Features/style.js +2 -2
  60. package/es/FontLoader/index.d.ts +6 -0
  61. package/es/FontLoader/index.js +16 -0
  62. package/es/Footer/index.js +2 -2
  63. package/es/GradientButton/style.d.ts +1 -1
  64. package/es/GradientButton/style.js +2 -2
  65. package/es/Header/index.js +2 -2
  66. package/es/Header/style.d.ts +1 -1
  67. package/es/Header/style.js +2 -2
  68. package/es/Hero/style.d.ts +3 -3
  69. package/es/Hero/style.js +14 -13
  70. package/es/Highlighter/SyntaxHighlighter/Prism.js +7 -7
  71. package/es/Highlighter/SyntaxHighlighter/index.js +1 -1
  72. package/es/Highlighter/SyntaxHighlighter/style.d.ts +2 -2
  73. package/es/Highlighter/SyntaxHighlighter/style.js +2 -2
  74. package/es/Highlighter/index.d.ts +1 -2
  75. package/es/Highlighter/index.js +4 -3
  76. package/es/Highlighter/style.d.ts +1 -1
  77. package/es/Highlighter/style.js +2 -2
  78. package/es/Highlighter/theme.js +22 -22
  79. package/es/Icon/index.js +24 -16
  80. package/es/Input/index.js +4 -4
  81. package/es/Layout/index.js +1 -1
  82. package/es/Layout/style.d.ts +5 -5
  83. package/es/Layout/style.js +7 -7
  84. package/es/List/ListItem/index.d.ts +1 -1
  85. package/es/List/ListItem/index.js +21 -42
  86. package/es/List/ListItem/style.d.ts +9 -0
  87. package/es/List/ListItem/style.js +21 -0
  88. package/es/List/index.d.ts +1 -1
  89. package/es/Logo/index.d.ts +2 -2
  90. package/es/Logo/index.js +48 -38
  91. package/es/Logo/style.d.ts +1 -1
  92. package/es/Logo/style.js +2 -2
  93. package/es/Markdown/CodeBlock.d.ts +1 -1
  94. package/es/Markdown/CodeBlock.js +7 -7
  95. package/es/Markdown/index.js +3 -3
  96. package/es/Markdown/style.d.ts +1 -1
  97. package/es/Markdown/style.js +2 -2
  98. package/es/MessageInput/index.d.ts +1 -1
  99. package/es/MessageInput/index.js +5 -5
  100. package/es/MessageModal/index.js +8 -6
  101. package/es/MessageModal/style.d.ts +1 -1
  102. package/es/MessageModal/style.js +2 -2
  103. package/es/SearchBar/index.d.ts +1 -1
  104. package/es/SearchBar/index.js +13 -11
  105. package/es/SearchBar/style.d.ts +2 -2
  106. package/es/SearchBar/style.js +3 -3
  107. package/es/Snippet/index.js +5 -3
  108. package/es/Spotlight/index.js +13 -13
  109. package/es/Spotlight/style.js +1 -1
  110. package/es/StroyBook/index.d.ts +1 -2
  111. package/es/StroyBook/index.js +3 -3
  112. package/es/StroyBook/style.d.ts +1 -1
  113. package/es/StroyBook/style.js +2 -2
  114. package/es/Swatches/index.d.ts +1 -1
  115. package/es/Swatches/index.js +9 -9
  116. package/es/ThemeProvider/index.d.ts +2 -2
  117. package/es/ThemeProvider/index.js +3 -4
  118. package/es/ThemeSwitch/index.js +8 -8
  119. package/es/Toc/TocMobile.d.ts +4 -4
  120. package/es/Toc/TocMobile.js +15 -15
  121. package/es/Toc/style.d.ts +2 -2
  122. package/es/Toc/style.js +3 -3
  123. package/es/TokenTag/style.js +12 -7
  124. package/es/components/ControlInput.d.ts +1 -1
  125. package/es/components/ControlInput.js +7 -6
  126. package/es/hooks/useHighlight.js +14 -14
  127. package/es/index.d.ts +1 -0
  128. package/es/index.js +1 -0
  129. package/es/styles/algorithms/generateColorPalette.js +10 -10
  130. package/es/styles/algorithms/generateCustomStylish.js +5 -5
  131. package/es/styles/algorithms/generateCustomToken.js +42 -17
  132. package/es/styles/algorithms/generateTheme.js +4 -4
  133. package/es/styles/colors.js +65 -65
  134. package/es/styles/theme/base.js +2 -2
  135. package/es/styles/theme/dark.js +16 -16
  136. package/es/styles/theme/light.js +16 -16
  137. package/es/types/llm.d.ts +1 -1
  138. package/package.json +3 -3
package/es/Logo/index.js CHANGED
@@ -30,48 +30,58 @@ var Logo = /*#__PURE__*/memo(function (_ref) {
30
30
  var logoComponent;
31
31
  switch (type) {
32
32
  case '3d':
33
- return /*#__PURE__*/_jsx(Logo3D, _objectSpread({
34
- style: _objectSpread({
35
- height: size,
36
- width: size
37
- }, style)
38
- }, props));
33
+ {
34
+ return /*#__PURE__*/_jsx(Logo3D, _objectSpread({
35
+ style: _objectSpread({
36
+ height: size,
37
+ width: size
38
+ }, style)
39
+ }, props));
40
+ }
39
41
  case 'flat':
40
- return /*#__PURE__*/_jsx(LogoFlat, _objectSpread({
41
- style: _objectSpread({
42
- height: size,
43
- width: size
44
- }, style)
45
- }, props));
42
+ {
43
+ return /*#__PURE__*/_jsx(LogoFlat, _objectSpread({
44
+ style: _objectSpread({
45
+ height: size,
46
+ width: size
47
+ }, style)
48
+ }, props));
49
+ }
46
50
  case 'high-contrast':
47
- return /*#__PURE__*/_jsx(LogoHighContrast, _objectSpread({
48
- style: _objectSpread({
49
- height: size,
50
- width: size
51
- }, style)
52
- }, props));
53
- case 'text':
54
- return /*#__PURE__*/_jsx(LogoText, _objectSpread({
55
- style: _objectSpread({
56
- height: size,
57
- width: 'auto'
58
- }, style)
59
- }, props));
60
- case 'combine':
61
- logoComponent = /*#__PURE__*/_jsxs(_Fragment, {
62
- children: [/*#__PURE__*/_jsx(Logo3D, {
63
- style: {
51
+ {
52
+ return /*#__PURE__*/_jsx(LogoHighContrast, _objectSpread({
53
+ style: _objectSpread({
64
54
  height: size,
65
55
  width: size
66
- }
67
- }), /*#__PURE__*/_jsx(LogoText, {
68
- style: {
69
- marginLeft: Math.round(size / 4),
56
+ }, style)
57
+ }, props));
58
+ }
59
+ case 'text':
60
+ {
61
+ return /*#__PURE__*/_jsx(LogoText, _objectSpread({
62
+ style: _objectSpread({
70
63
  height: size,
71
64
  width: 'auto'
72
- }
73
- })]
74
- });
65
+ }, style)
66
+ }, props));
67
+ }
68
+ case 'combine':
69
+ {
70
+ logoComponent = /*#__PURE__*/_jsxs(_Fragment, {
71
+ children: [/*#__PURE__*/_jsx(Logo3D, {
72
+ style: {
73
+ height: size,
74
+ width: size
75
+ }
76
+ }), /*#__PURE__*/_jsx(LogoText, {
77
+ style: {
78
+ height: size,
79
+ marginLeft: Math.round(size / 4),
80
+ width: 'auto'
81
+ }
82
+ })]
83
+ });
84
+ }
75
85
  }
76
86
  var extraSize = Math.round(size / 3 * 1.9);
77
87
  return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
@@ -81,9 +91,9 @@ var Logo = /*#__PURE__*/memo(function (_ref) {
81
91
  children: [logoComponent, extra && /*#__PURE__*/_jsxs(_Fragment, {
82
92
  children: [/*#__PURE__*/_jsx(Divider, {
83
93
  style: {
94
+ color: theme.colorBorder,
84
95
  height: extraSize,
85
- width: extraSize,
86
- color: theme.colorBorder
96
+ width: extraSize
87
97
  }
88
98
  }), /*#__PURE__*/_jsx("div", {
89
99
  className: styles.extraTitle,
@@ -1,4 +1,4 @@
1
1
  export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- flexCenter: import("antd-style").SerializedStyles;
3
2
  extraTitle: import("antd-style").SerializedStyles;
3
+ flexCenter: import("antd-style").SerializedStyles;
4
4
  }>;
package/es/Logo/style.js CHANGED
@@ -4,7 +4,7 @@ import { createStyles } from 'antd-style';
4
4
  export var useStyles = createStyles(function (_ref) {
5
5
  var css = _ref.css;
6
6
  return {
7
- flexCenter: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n "]))),
8
- extraTitle: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-weight: 300;\n white-space: nowrap;\n "])))
7
+ extraTitle: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-weight: 300;\n white-space: nowrap;\n "]))),
8
+ flexCenter: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n "])))
9
9
  };
10
10
  });
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- declare const Code: import("react").MemoExoticComponent<(props: any) => import("react/jsx-runtime").JSX.Element | null>;
2
+ declare const Code: import("react").NamedExoticComponent<any>;
3
3
  export default Code;
@@ -8,22 +8,22 @@ var useStyles = createStyles(function (_ref) {
8
8
  var css = _ref.css;
9
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
- var Code = /*#__PURE__*/memo(function (props) {
11
+ var Code = /*#__PURE__*/memo(function (properties) {
12
12
  var _useStyles = useStyles(),
13
13
  styles = _useStyles.styles,
14
14
  theme = _useStyles.theme;
15
- if (!props.children[0]) return null;
16
- var _props$children$0$pro = props.children[0].props,
17
- children = _props$children$0$pro.children,
18
- className = _props$children$0$pro.className;
19
- if (!children) return null;
15
+ if (!properties.children[0]) return;
16
+ var _properties$children$ = properties.children[0].props,
17
+ children = _properties$children$.children,
18
+ className = _properties$children$.className;
19
+ if (!children) return;
20
20
  return /*#__PURE__*/_jsx(Highlighter, {
21
21
  className: styles,
22
22
  language: (className === null || className === void 0 ? void 0 : className.replace('language-', '')) || 'markdown',
23
23
  spotlight: true,
24
24
  theme: theme.appearance,
25
25
  type: "block",
26
- children: children instanceof Array ? children[0] : children
26
+ children: Array.isArray(children) ? children[0] : children
27
27
  });
28
28
  });
29
29
  export default Code;
@@ -14,11 +14,11 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
14
14
  styles = _useStyles.styles,
15
15
  cx = _useStyles.cx;
16
16
  var components = {
17
- pre: CodeBlock,
17
+ a: Typography.Link,
18
18
  code: Code,
19
+ details: Collapse,
19
20
  hr: Divider,
20
- a: Typography.Link,
21
- details: Collapse
21
+ pre: CodeBlock
22
22
  };
23
23
  return /*#__PURE__*/_jsx(Typography, {
24
24
  children: /*#__PURE__*/_jsx(ReactMarkdown, {
@@ -1,4 +1,4 @@
1
1
  export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- markdown: any;
3
2
  code: import("antd-style").SerializedStyles;
3
+ markdown: any;
4
4
  }>;
@@ -7,7 +7,7 @@ export var useStyles = createStyles(function (_ref) {
7
7
  isDarkMode = _ref.isDarkMode,
8
8
  stylish = _ref.stylish;
9
9
  return {
10
- markdown: stylish.markdown,
11
- code: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 2px 4px;\n font-family: ", " !important;\n color: ", ";\n border-radius: 4px;\n "])), token.fontFamilyCode, isDarkMode ? token.cyan8 : token.pink7)
10
+ code: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 2px 4px;\n font-family: ", " !important;\n color: ", ";\n border-radius: 4px;\n "])), token.fontFamilyCode, isDarkMode ? token.cyan8 : token.pink7),
11
+ markdown: stylish.markdown
12
12
  };
13
13
  });
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ButtonProps } from 'antd';
3
- import { type TextAreaProps } from "../index";
3
+ import { type TextAreaProps } from "../Input";
4
4
  /**
5
5
  * @title MessageInputProps
6
6
  * @category Props
@@ -6,7 +6,7 @@ import { Button } from 'antd';
6
6
  import { cx } from 'antd-style';
7
7
  import { memo, useState } from 'react';
8
8
  import { Flexbox } from 'react-layout-kit';
9
- import { TextArea } from "./..";
9
+ import { TextArea } from "../Input";
10
10
 
11
11
  /**
12
12
  * @title MessageInputProps
@@ -26,7 +26,7 @@ var MessageInput = /*#__PURE__*/memo(function (_ref) {
26
26
  className = _ref.className;
27
27
  var _useState = useState(defaultValue || ''),
28
28
  _useState2 = _slicedToArray(_useState, 2),
29
- tempSystemRole = _useState2[0],
29
+ temporarySystemRole = _useState2[0],
30
30
  setRole = _useState2[1];
31
31
  return /*#__PURE__*/_jsxs(Flexbox, {
32
32
  gap: 8,
@@ -40,16 +40,16 @@ var MessageInput = /*#__PURE__*/memo(function (_ref) {
40
40
  height: height !== null && height !== void 0 ? height : 200
41
41
  },
42
42
  type: type,
43
- value: tempSystemRole
43
+ value: temporarySystemRole
44
44
  }), /*#__PURE__*/_jsx(Flexbox, {
45
45
  direction: 'horizontal-reverse',
46
46
  gap: 8,
47
- children: renderButtons ? renderButtons(tempSystemRole).map(function (buttonProps, index) {
47
+ children: renderButtons ? renderButtons(temporarySystemRole).map(function (buttonProps, index) {
48
48
  return /*#__PURE__*/_jsx(Button, _objectSpread({}, buttonProps), index);
49
49
  }) : /*#__PURE__*/_jsxs(_Fragment, {
50
50
  children: [/*#__PURE__*/_jsx(Button, {
51
51
  onClick: function onClick() {
52
- onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(tempSystemRole);
52
+ onConfirm === null || onConfirm === void 0 ? void 0 : onConfirm(temporarySystemRole);
53
53
  },
54
54
  type: "primary",
55
55
  children: "Confirm"
@@ -4,7 +4,9 @@ import { X } from 'lucide-react';
4
4
  import { memo } from 'react';
5
5
  import { Flexbox } from 'react-layout-kit';
6
6
  import useControlledState from 'use-merge-value';
7
- import { Icon, Markdown, MessageInput } from "./..";
7
+ import Icon from "../Icon";
8
+ import Markdown from "../Markdown";
9
+ import MessageInput from "../MessageInput";
8
10
  import { useStyles } from "./style";
9
11
  import { jsx as _jsx } from "react/jsx-runtime";
10
12
  var MessageModal = /*#__PURE__*/memo(function (_ref) {
@@ -17,15 +19,15 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
17
19
  var _useStyles = useStyles(),
18
20
  styles = _useStyles.styles;
19
21
  var _useControlledState = useControlledState(false, {
20
- value: editing,
21
- onChange: onEditingChange
22
+ onChange: onEditingChange,
23
+ value: editing
22
24
  }),
23
25
  _useControlledState2 = _slicedToArray(_useControlledState, 2),
24
26
  isEdit = _useControlledState2[0],
25
27
  setTyping = _useControlledState2[1];
26
28
  var _useControlledState3 = useControlledState(false, {
27
- value: open,
28
- onChange: onOpenChange
29
+ onChange: onOpenChange,
30
+ value: open
29
31
  }),
30
32
  _useControlledState4 = _slicedToArray(_useControlledState3, 2),
31
33
  expand = _useControlledState4[0],
@@ -36,7 +38,7 @@ var MessageModal = /*#__PURE__*/memo(function (_ref) {
36
38
  closeIcon: /*#__PURE__*/_jsx(Icon, {
37
39
  icon: X
38
40
  }),
39
- footer: isEdit ? null : undefined,
41
+ footer: isEdit ? undefined : undefined,
40
42
  okText: 'Edit',
41
43
  onCancel: function onCancel() {
42
44
  return setExpand(false);
@@ -1,4 +1,4 @@
1
1
  export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- modal: import("antd-style").SerializedStyles;
3
2
  body: import("antd-style").SerializedStyles;
3
+ modal: import("antd-style").SerializedStyles;
4
4
  }>;
@@ -5,7 +5,7 @@ export var useStyles = createStyles(function (_ref) {
5
5
  var css = _ref.css,
6
6
  prefixCls = _ref.prefixCls;
7
7
  return {
8
- modal: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: 70%;\n .", "-modal-header {\n margin-bottom: 24px;\n }\n "])), prefixCls),
9
- body: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow-y: scroll;\n max-height: 70vh;\n "])))
8
+ body: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow-y: scroll;\n max-height: 70vh;\n "]))),
9
+ modal: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: 70%;\n .", "-modal-header {\n margin-bottom: 24px;\n }\n "])), prefixCls)
10
10
  };
11
11
  });
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { InputProps } from "../index";
2
+ import { type InputProps } from "../Input";
3
3
  export interface SearchBarProps extends InputProps {
4
4
  /**
5
5
  * @description Whether to enable the shortcut key to focus on the input
@@ -8,11 +8,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
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, Spotlight } from "./..";
11
+ import Icon from "../Icon";
12
+ import { Input } from "../Input";
13
+ import Spotlight from "../Spotlight";
12
14
  import { useStyles } from "./style";
13
15
  import { jsx as _jsx } from "react/jsx-runtime";
14
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
15
- var isAppleDevice = /(mac|iphone|ipod|ipad)/i.test(typeof navigator !== 'undefined' ? (_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.platform : '');
17
+ var isAppleDevice = /(mac|iphone|ipod|ipad)/i.test(typeof navigator === 'undefined' ? '' : (_navigator = navigator) === null || _navigator === void 0 ? void 0 : _navigator.platform);
16
18
  var symbol = isAppleDevice ? '⌘' : 'Ctrl';
17
19
  var SearchBar = /*#__PURE__*/memo(function (_ref) {
18
20
  var spotlight = _ref.spotlight,
@@ -23,7 +25,7 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
23
25
  enableShortKey = _ref.enableShortKey,
24
26
  _ref$shortKey = _ref.shortKey,
25
27
  shortKey = _ref$shortKey === void 0 ? 'f' : _ref$shortKey,
26
- props = _objectWithoutProperties(_ref, _excluded);
28
+ properties = _objectWithoutProperties(_ref, _excluded);
27
29
  var _useState = useState(true),
28
30
  _useState2 = _slicedToArray(_useState, 2),
29
31
  showTag = _useState2[0],
@@ -35,14 +37,14 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
35
37
  var _useStyles = useStyles(),
36
38
  styles = _useStyles.styles,
37
39
  cx = _useStyles.cx;
38
- var inputRef = useRef(null);
40
+ var inputReference = useRef();
39
41
  useEffect(function () {
40
42
  if (!enableShortKey) return;
41
- var handler = function handler(ev) {
42
- if ((isAppleDevice ? ev.metaKey : ev.ctrlKey) && ev.key === shortKey) {
43
- var _inputRef$current;
44
- ev.preventDefault();
45
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
43
+ var handler = function handler(event_) {
44
+ if ((isAppleDevice ? event_.metaKey : event_.ctrlKey) && event_.key === shortKey) {
45
+ var _inputReference$curre;
46
+ event_.preventDefault();
47
+ (_inputReference$curre = inputReference.current) === null || _inputReference$curre === void 0 ? void 0 : _inputReference$curre.focus();
46
48
  }
47
49
  };
48
50
  document.addEventListener('keydown', handler);
@@ -75,9 +77,9 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
75
77
  marginRight: 4
76
78
  }
77
79
  }),
78
- ref: inputRef,
80
+ ref: inputReference,
79
81
  value: value
80
- }, props)), enableShortKey && showTag && !inputValue && /*#__PURE__*/_jsxs(Tag, {
82
+ }, properties)), enableShortKey && showTag && !inputValue && /*#__PURE__*/_jsxs(Tag, {
81
83
  className: styles.tag,
82
84
  children: [symbol, " ", shortKey.toUpperCase()]
83
85
  })]
@@ -1,6 +1,6 @@
1
1
  export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
- search: import("antd-style").SerializedStyles;
2
+ icon: import("antd-style").SerializedStyles;
3
3
  input: import("antd-style").SerializedStyles;
4
+ search: import("antd-style").SerializedStyles;
4
5
  tag: import("antd-style").SerializedStyles;
5
- icon: import("antd-style").SerializedStyles;
6
6
  }>;
@@ -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
+ icon: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorTextPlaceholder),
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\n background: ", ";\n "])), token.colorBgContainer),
11
- icon: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n "])), token.colorTextPlaceholder)
10
+ search: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n max-width: 100%;\n "]))),
11
+ tag: css(_templateObject4 || (_templateObject4 = _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)
12
12
  };
13
13
  });
@@ -4,7 +4,9 @@ var _excluded = ["symbol", "language", "children", "copyable", "type", "spotligh
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, Spotlight, SyntaxHighlighter } from "./..";
7
+ import CopyButton from "../CopyButton";
8
+ import SyntaxHighlighter from "../Highlighter/SyntaxHighlighter";
9
+ import Spotlight from "../Spotlight";
8
10
  import { useStyles } from "./style";
9
11
  import { jsx as _jsx } from "react/jsx-runtime";
10
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -30,8 +32,8 @@ var Snippet = /*#__PURE__*/memo(function (_ref) {
30
32
  }), copyable && /*#__PURE__*/_jsx(CopyButton, {
31
33
  content: children,
32
34
  size: {
33
- fontSize: 14,
34
- blockSize: 24
35
+ blockSize: 24,
36
+ fontSize: 14
35
37
  }
36
38
  })]
37
39
  }));
@@ -16,14 +16,14 @@ var useMouseOffset = function useMouseOffset() {
16
16
  _useState4 = _slicedToArray(_useState3, 2),
17
17
  outside = _useState4[0],
18
18
  setOutside = _useState4[1];
19
- var ref = useRef(null);
19
+ var reference = useRef();
20
20
  useEffect(function () {
21
- if (ref.current && ref.current.parentElement) {
22
- var el = ref.current.parentElement;
21
+ if (reference.current && reference.current.parentElement) {
22
+ var element = reference.current.parentElement;
23
23
 
24
24
  // debounce?
25
25
  var onMouseMove = function onMouseMove(e) {
26
- var bound = el.getBoundingClientRect();
26
+ var bound = element.getBoundingClientRect();
27
27
  setOffset({
28
28
  x: e.clientX - bound.x,
29
29
  y: e.clientY - bound.y
@@ -33,26 +33,26 @@ var useMouseOffset = function useMouseOffset() {
33
33
  var onMouseLeave = function onMouseLeave() {
34
34
  setOutside(true);
35
35
  };
36
- el.addEventListener('mousemove', onMouseMove);
37
- el.addEventListener('mouseleave', onMouseLeave);
36
+ element.addEventListener('mousemove', onMouseMove);
37
+ element.addEventListener('mouseleave', onMouseLeave);
38
38
  return function () {
39
- el.removeEventListener('mousemove', onMouseMove);
40
- el.removeEventListener('mouseleave', onMouseLeave);
39
+ element.removeEventListener('mousemove', onMouseMove);
40
+ element.removeEventListener('mouseleave', onMouseLeave);
41
41
  };
42
42
  }
43
43
  }, []);
44
- return [offset, outside, ref];
44
+ return [offset, outside, reference];
45
45
  };
46
46
  var Spotlight = /*#__PURE__*/memo(function (_ref) {
47
47
  var className = _ref.className,
48
48
  _ref$size = _ref.size,
49
49
  size = _ref$size === void 0 ? 64 : _ref$size,
50
- props = _objectWithoutProperties(_ref, _excluded);
50
+ properties = _objectWithoutProperties(_ref, _excluded);
51
51
  var _useMouseOffset = useMouseOffset(),
52
52
  _useMouseOffset2 = _slicedToArray(_useMouseOffset, 3),
53
53
  offset = _useMouseOffset2[0],
54
54
  outside = _useMouseOffset2[1],
55
- ref = _useMouseOffset2[2];
55
+ reference = _useMouseOffset2[2];
56
56
  var _useStyles = useStyles({
57
57
  offset: offset,
58
58
  outside: outside,
@@ -62,7 +62,7 @@ var Spotlight = /*#__PURE__*/memo(function (_ref) {
62
62
  cx = _useStyles.cx;
63
63
  return /*#__PURE__*/_jsx("div", _objectSpread({
64
64
  className: cx(styles, className),
65
- ref: ref
66
- }, props));
65
+ ref: reference
66
+ }, properties));
67
67
  });
68
68
  export default Spotlight;
@@ -13,5 +13,5 @@ export var useStyles = createStyles(function (_ref, _ref2) {
13
13
  var spotlightY = ((_offset$y = offset === null || offset === void 0 ? void 0 : offset.y) !== null && _offset$y !== void 0 ? _offset$y : 0) + 'px';
14
14
  var spotlightOpacity = outside ? '0' : '.1';
15
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 ", "\n );\n border-radius: inherit;\n\n transition: all 0.2s;\n "])), spotlightOpacity, spotlightSize, spotlightX, spotlightY, isDarkMode ? token.colorText : '#fff', !isDarkMode ? token.colorTextQuaternary : 'transparent');
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 ", "\n );\n border-radius: inherit;\n\n transition: all 0.2s;\n "])), spotlightOpacity, spotlightSize, spotlightX, spotlightY, isDarkMode ? token.colorText : '#fff', isDarkMode ? 'transparent' : token.colorTextQuaternary);
17
17
  });
@@ -1,7 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { useControls, useCreateStore } from 'leva';
3
2
  import { DivProps } from "../types";
4
- export { useControls, useCreateStore };
5
3
  export interface StroyBookProps extends DivProps {
6
4
  /**
7
5
  * @description The Leva store instance to be used by the component
@@ -15,3 +13,4 @@ export interface StroyBookProps extends DivProps {
15
13
  }
16
14
  export declare const StroyBook: import("react").NamedExoticComponent<StroyBookProps>;
17
15
  export default StroyBook;
16
+ export { useControls, useCreateStore } from 'leva';
@@ -4,13 +4,12 @@ var _excluded = ["levaStore", "noPadding", "className", "children"];
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 { useResponsive } from 'antd-style';
7
- import { LevaPanel, useControls, useCreateStore } from 'leva';
7
+ import { LevaPanel } from 'leva';
8
8
  import { memo } from 'react';
9
9
  import DraggablePanel from "../DraggablePanel";
10
10
  import { useStyles } from "./style";
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
13
- export { useControls, useCreateStore };
14
13
  export var StroyBook = /*#__PURE__*/memo(function (_ref) {
15
14
  var levaStore = _ref.levaStore,
16
15
  noPadding = _ref.noPadding,
@@ -44,4 +43,5 @@ export var StroyBook = /*#__PURE__*/memo(function (_ref) {
44
43
  })]
45
44
  }));
46
45
  });
47
- export default StroyBook;
46
+ export default StroyBook;
47
+ export { useControls, useCreateStore } from 'leva';
@@ -1,6 +1,6 @@
1
1
  export declare const useStyles: (props?: boolean | undefined) => import("antd-style").ReturnStyles<{
2
2
  editor: import("antd-style").SerializedStyles;
3
3
  left: import("antd-style").SerializedStyles;
4
- right: import("antd-style").SerializedStyles;
5
4
  leva: import("antd-style").SerializedStyles;
5
+ right: import("antd-style").SerializedStyles;
6
6
  }>;
@@ -8,7 +8,7 @@ export var useStyles = createStyles(function (_ref, noPadding) {
8
8
  return {
9
9
  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 ", " {\n flex-direction: column;\n }\n "])), responsive.mobile),
10
10
  left: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow: auto;\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n\n ", "\n "])), !noPadding && css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n padding: 40px 24px;\n "])))),
11
- right: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background: ", ";\n\n ", " {\n .draggable-panel-fixed {\n width: 100% !important;\n }\n }\n "])), token.colorBgLayout, responsive.mobile),
12
- leva: css(_templateObject5 || (_templateObject5 = _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)
11
+ leva: css(_templateObject4 || (_templateObject4 = _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),
12
+ right: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background: ", ";\n\n ", " {\n .draggable-panel-fixed {\n width: 100% !important;\n }\n }\n "])), token.colorBgLayout, responsive.mobile)
13
13
  };
14
14
  });
@@ -13,7 +13,7 @@ export interface SwatchesProps {
13
13
  * @description A function to be called when a swatch is selected
14
14
  * @default undefined
15
15
  */
16
- onSelect?: (c: string | null) => void;
16
+ onSelect?: (c?: string | undefined) => void;
17
17
  }
18
18
  declare const Swatches: import("react").NamedExoticComponent<SwatchesProps>;
19
19
  export default Swatches;
@@ -13,15 +13,15 @@ var Swatches = /*#__PURE__*/memo(function (_ref) {
13
13
  horizontal: true,
14
14
  children: [/*#__PURE__*/_jsx(Flexbox, {
15
15
  onClick: function onClick() {
16
- onSelect === null || onSelect === void 0 ? void 0 : onSelect(null);
16
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect();
17
17
  },
18
18
  style: {
19
- width: 24,
20
- height: 24,
21
19
  background: theme.colorBgContainer,
22
- boxShadow: "inset 0 0 0px 2px ".concat(!activeColor ? theme.colorPrimary : 'rgba(0,0,0,0.1)'),
23
20
  borderRadius: '50%',
24
- cursor: 'pointer'
21
+ boxShadow: "inset 0 0 0px 2px ".concat(activeColor ? 'rgba(0,0,0,0.1)' : theme.colorPrimary),
22
+ cursor: 'pointer',
23
+ height: 24,
24
+ width: 24
25
25
  }
26
26
  }), colors.map(function (c) {
27
27
  var borderColor = c === activeColor ? theme.colorPrimary : 'rgba(0,0,0,0.1)';
@@ -30,12 +30,12 @@ var Swatches = /*#__PURE__*/memo(function (_ref) {
30
30
  onSelect === null || onSelect === void 0 ? void 0 : onSelect(c);
31
31
  },
32
32
  style: {
33
- width: 24,
34
- height: 24,
35
33
  background: c,
36
- boxShadow: "inset 0 0 0px 2px ".concat(borderColor),
37
34
  borderRadius: '50%',
38
- cursor: 'pointer'
35
+ boxShadow: "inset 0 0 0px 2px ".concat(borderColor),
36
+ cursor: 'pointer',
37
+ height: 24,
38
+ width: 24
39
39
  }
40
40
  }, c);
41
41
  })]
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
1
  import { type ThemeMode, extractStaticStyle } from 'antd-style';
3
2
  import type { CustomStylishParams, CustomTokenParams } from 'antd-style/lib/types/function';
3
+ import { type ReactNode } from 'react';
4
4
  export interface ThemeProviderProps {
5
5
  /**
6
6
  * @description Cache for the extracted static styles
@@ -9,7 +9,7 @@ export interface ThemeProviderProps {
9
9
  /**
10
10
  * @description The children of the ThemeProvider component
11
11
  */
12
- children: React.ReactNode;
12
+ children: ReactNode;
13
13
  /**
14
14
  * @description Custom stylish
15
15
  */