@lobehub/ui 1.7.1 → 1.7.3

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.
@@ -10,6 +10,6 @@ export var useStyles = createStyles(function (_ref) {
10
10
  return {
11
11
  shiki: cx("".concat(prefix, "-shiki"), css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .shiki {\n overflow-x: scroll;\n background: none !important;\n }\n "])))),
12
12
  prism: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n pre {\n overflow-x: scroll;\n font-family: ", " !important;\n }\n "])), token.fontFamilyCode),
13
- loading: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n right: 0;\n color: ", ";\n padding: 4px 8px;\n backdrop-filter: saturate(180%) blur(10px);\n border-radius: ", ";\n "])), token.colorTextTertiary, token.borderRadiusSM)
13
+ loading: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n right: 0;\n\n padding: 4px 8px;\n\n color: ", ";\n\n backdrop-filter: saturate(180%) blur(10px);\n border-radius: ", ";\n "])), token.colorTextTertiary, token.borderRadiusSM)
14
14
  };
15
15
  });
@@ -11,7 +11,7 @@ export var useStyles = createStyles(function (_ref, type) {
11
11
  var buttonHoverCls = "".concat(prefix, "-hover-btn");
12
12
  var langHoverCls = "".concat(prefix, "-hover-lang");
13
13
  return {
14
- container: cx(prefix, css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n overflow: auto;\n position: relative;\n transition: background-color 100ms ", ";\n background-color: ", ";\n border-radius: ", "px;\n\n ", "\n\n &:hover {\n background-color: ", ";\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\n &:hover {\n .", " {\n opacity: 1;\n }\n\n .", " {\n opacity: 1;\n }\n }\n "])), token.motionEaseOut, type === 'block' ? rgba(token.colorBgElevated, 0.6) : 'transparent', token.borderRadius, type === 'ghost' && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n "])), token.colorBorder), type === 'prue' ? 'transparent' : token.colorFillTertiary, type === 'prue' ? 0 : "16px 24px", buttonHoverCls, langHoverCls)),
14
+ 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' ? rgba(token.colorBgElevated, 0.6) : '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")),
15
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 "])))),
16
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))
17
17
  };
package/es/Logo/style.js CHANGED
@@ -5,6 +5,6 @@ export var useStyles = createStyles(function (_ref) {
5
5
  var css = _ref.css;
6
6
  return {
7
7
  flexCenter: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n "]))),
8
- extraTitle: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n white-space: nowrap;\n font-weight: 300;\n "])))
8
+ extraTitle: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-weight: 300;\n white-space: nowrap;\n "])))
9
9
  };
10
10
  });
@@ -1,10 +1,11 @@
1
1
  import { Divider, Typography } from 'antd';
2
+ import pangu from 'pangu';
2
3
  import { memo } from 'react';
3
4
  import ReactMarkdown from 'react-markdown';
4
5
  import remarkGfm from 'remark-gfm';
5
- import { useStyles } from "./style";
6
6
  import Code from "./Code";
7
7
  import CodeBlock from "./CodeBlock";
8
+ import { useStyles } from "./style";
8
9
  import { jsx as _jsx } from "react/jsx-runtime";
9
10
  var Markdown = /*#__PURE__*/memo(function (_ref) {
10
11
  var children = _ref.children,
@@ -23,7 +24,7 @@ var Markdown = /*#__PURE__*/memo(function (_ref) {
23
24
  className: cx(styles.container, className),
24
25
  components: components,
25
26
  remarkPlugins: [remarkGfm],
26
- children: children
27
+ children: pangu.spacing(children)
27
28
  })
28
29
  });
29
30
  });
@@ -6,7 +6,7 @@ export var useStyles = createStyles(function (_ref) {
6
6
  token = _ref.token,
7
7
  isDarkMode = _ref.isDarkMode;
8
8
  return {
9
- container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n\n\n\n p {\n margin: 20px auto;\n line-height: 2;\n word-wrap: break-word;\n font-size: 14px;\n color: ", ";\n\n &:not(:last-child) {\n margin-bottom: 1em;\n }\n }\n\n // hyperlink\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 // inline code\n > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n color: ", ";\n background: ", ";\n border-radius: 4px;\n }\n\n\n // table\n table {\n width: 100%;\n border-spacing: 0;\n border: 1px solid ", ";\n border-radius: ", "px;\n padding: 8px;\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n }\n\n th {\n\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 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 // blockquote\n blockquote {\n margin: 16px 0;\n padding: 0 12px;\n p {\n font-style: italic;\n color: ", ";\n }\n }\n\n // list\n ul li {\n line-height: 1.8;\n }\n }\n "])), isDarkMode ? token.colorTextSecondary : token.colorText, token.colorText, token.colorLink, token.colorLinkHover, token.colorLinkActive, isDarkMode ? token['cyan-7'] : token.colorPrimaryText, isDarkMode ? token['cyan-1'] : token.colorPrimaryBg, token.colorBorder, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius, token.colorTextDescription),
9
+ container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n\n p {\n margin: 20px auto;\n\n font-size: 14px;\n line-height: 2;\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 > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n color: ", ";\n background: ", ";\n border-radius: 4px;\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, isDarkMode ? token['cyan-7'] : token.colorPrimaryText, isDarkMode ? token['cyan-1'] : token.colorPrimaryBg, token.colorBorder, token.borderRadius, token.colorFillTertiary, token.borderRadius, token.borderRadius, token.borderRadius, token.borderRadius),
10
10
  code: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 2px 4px;\n font-family: ", " !important;\n color: ", ";\n border-radius: 4px;\n "])), token.fontFamilyCode, isDarkMode ? token.cyan8 : token.pink7)
11
11
  };
12
12
  });
@@ -5,5 +5,5 @@ import { rgba } from 'polished';
5
5
  export var useStyles = createStyles(function (_ref, type) {
6
6
  var css = _ref.css,
7
7
  token = _ref.token;
8
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n max-width: 100%;\n position: relative;\n align-items: center;\n border-radius: ", "px;\n gap: 8px;\n padding: 0 8px 0 12px;\n height: 36px;\n transition: background-color 100ms ", ";\n\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 background: none !important;\n padding-top: 6px; !important;\n margin: 0 !important;\n line-height: 1;\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 "])), rgba(token.colorBgElevated, 0.6)) : css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n "])), token.colorBorder), token.colorFillTertiary);
8
+ 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 "])), rgba(token.colorBgElevated, 0.6)) : css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n "])), token.colorBorder), token.colorFillTertiary);
9
9
  });
@@ -7,8 +7,8 @@ export var useStyles = createStyles(function (_ref, _ref2) {
7
7
  var noPadding = _ref2.noPadding,
8
8
  mobile = _ref2.mobile;
9
9
  return {
10
- editor: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: stretch;\n justify-content: stretch;\n width: inherit;\n min-height: inherit;\n ", "\n "])), mobile && css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex-direction: column;\n "])))),
11
- left: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: auto;\n ", "\n "])), !noPadding && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 40px 24px;\n "])))),
12
- right: 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 padding: 6px 0;\n background: ", ";\n > div {\n background: transparent;\n > div {\n background: transparent;\n }\n }\n input:checked + label > svg {\n stroke: ", ";\n }\n "])), token.colorFillSecondary, token.colorFillSecondary, token.colorPrimary, token.colorPrimaryHover, token.colorPrimaryActive, token.colorTextTertiary, token.colorTextSecondary, token.colorText, token.colorWarning, token.colorBgLayout, token.colorBorder)
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
+ left: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: auto;\n display: flex;\n flex: 1;\n align-items: center;\n justify-content: center;\n\n ", "\n "])), !noPadding && css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 40px 24px;\n "])))),
12
+ right: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n --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\n padding: 6px 0;\n background: ", ";\n > div {\n background: transparent;\n > div {\n background: transparent;\n }\n }\n input:checked + label > svg {\n stroke: ", ";\n }\n "])), token.colorFillSecondary, token.colorFillSecondary, token.colorPrimary, token.colorPrimaryHover, token.colorPrimaryActive, token.colorTextTertiary, token.colorTextSecondary, token.colorText, token.colorWarning, token.colorBgLayout, token.colorBorder)
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 body {\n font-family: ", ";\n font-size: ", "px;\n line-height: 1;\n color: ", ";\n\n margin: 0;\n padding: 0;\n background-color: ", ";\n\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n }\n\n * {\n box-sizing: border-box;\n }\n\n #root {\n\t min-height: 100vh;\n }\n /* \u5B9A\u4E49\u6EDA\u52A8\u69FD\u7684\u6837\u5F0F */\n ::-webkit-scrollbar {\n width: 0;\n height: 4px;\n margin-right: 4px;\n background-color: transparent; // \u5B9A\u4E49\u6EDA\u52A8\u69FD\u7684\u80CC\u666F\u8272\n\n &-thumb {\n background-color: ", "; // \u5B9A\u4E49\u6EDA\u52A8\u5757\u7684\u80CC\u666F\u8272\n border-radius: 4px; // \u5B9A\u4E49\u6EDA\u52A8\u5757\u7684\u5706\u89D2\u534A\u5F84\n }\n\n &-corner {\n display: none;\n }\n }\n"])), function (_ref) {
4
+ var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\n html,body {\n --font-settings: \"cv01\";\n --font-variations: \"opsz\" auto;\n\n overflow-x: hidden;\n\n margin: 0;\n padding: 0;\n\n font-family: ", ";\n font-size: ", "px;\n font-feature-settings: var(--font-settings);\n font-variation-settings: var(--font-variations);\n line-height: 1;\n color: ", ";\n text-size-adjust: none;\n text-rendering: optimizelegibility;\n vertical-align: baseline;\n\n color-scheme: dark;\n background-color: ", ";\n\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n -webkit-tap-highlight-color: transparent;\n }\n\n\n * {\n box-sizing: border-box;\n vertical-align: baseline;\n }\n\n #root {\n\t min-height: 100vh;\n }\n\n ::-webkit-scrollbar {\n width: 0;\n height: 4px;\n background-color: transparent;\n\n &-thumb {\n background-color: ", ";\n border-radius: 4px;\n }\n\n &-corner {\n display: none;\n }\n }\n\n p {\n text-align: justify;\n word-wrap: break-word;\n }\n"])), function (_ref) {
5
5
  var theme = _ref.theme;
6
6
  return theme.fontFamily;
7
7
  }, function (_ref2) {
@@ -10,10 +10,11 @@ var GlobalStyle = createGlobalStyle(_templateObject || (_templateObject = _tagge
10
10
  }, function (_ref3) {
11
11
  var theme = _ref3.theme;
12
12
  return theme.colorTextBase;
13
- }, function (p) {
14
- return p.theme.colorBgLayout;
15
13
  }, function (_ref4) {
16
14
  var theme = _ref4.theme;
15
+ return theme.colorBgLayout;
16
+ }, function (_ref5) {
17
+ var theme = _ref5.theme;
17
18
  return theme.colorFill;
18
19
  });
19
20
  export default GlobalStyle;
@@ -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 background-color: ", ";\n color: ", ";\n padding: 4px 8px;\n border-radius: ", "px;\n min-height: unset;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .ant-tooltip-arrow {\n &:before,\n &:after {\n background: ", ";\n }\n }\n "])), token.colorText, token.colorBgLayout, 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 .ant-tooltip-arrow {\n &:before,\n &:after {\n background: ", ";\n }\n }\n "])), token.colorBgLayout, token.colorText, token.borderRadiusSM, token.colorText)
9
9
  };
10
10
  });
@@ -11,9 +11,9 @@ export var getCustomStylish = function getCustomStylish(_ref) {
11
11
  heroButtonGradient: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n background: linear-gradient(90deg, ", " 0%, ", " 100%);\n "])), token.gradientColor1, token.gradientColor2),
12
12
  heroGradient: css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-image: ", ";\n background-size: 300% 300%;\n "])), token.gradientHeroBgG),
13
13
  heroGradientFlow: css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n animation: flow 5s ease infinite;\n\n @keyframes flow {\n 0% {\n background-position: 0 0;\n }\n\n 50% {\n background-position: 100% 100%;\n }\n\n 100% {\n background-position: 0 0;\n }\n }\n "]))),
14
- heroTextShadow: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n will-change: transform;\n\n text-shadow: 0 8px 20px ", ",\n 0 8px 60px ", ",\n 0 8px 80px ", ";\n "])), rgba(token.gradientColor2, 0.2), rgba(token.gradientColor3, 0.2), rgba(token.cyan, isDarkMode ? 0.2 : 0.4)),
15
- heroBlurBall: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n filter: blur(69px);\n will-change: transform;\n background: linear-gradient(\n 135deg,\n ", " 0%,\n ", " 30%,\n ", " 70%,\n ", " 100%\n );\n background-size: 200% 200%;\n animation: glow 10s ease infinite;\n\n @keyframes glow {\n 0% {\n background-position: 0 -100%;\n }\n\n 50% {\n background-position: 200% 50%;\n }\n\n 100% {\n background-position: 0 -100%;\n }\n }\n "])), token.gradientColor3, token.gradientColor1, token.red, token.cyan),
16
- iconGradientDefault: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n radial-gradient(\n 100% 100% at 50% 0,\n ", " 0,\n ", " 100%\n )"])), rgba(token.colorSolid, 0.2), rgba(token.colorSolid, 0.1)),
17
- blur: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n backdrop-filter: blur(7px);\n // background: ", ";\n "])), rgba(token.colorBgBase, 0.5))
14
+ heroTextShadow: css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n will-change: transform;\n text-shadow: 0 8px 20px ", ",\n 0 8px 60px ", ",\n 0 8px 80px ", ";\n "])), rgba(token.gradientColor2, 0.2), rgba(token.gradientColor3, 0.2), rgba(token.cyan, isDarkMode ? 0.2 : 0.4)),
15
+ heroBlurBall: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n will-change: transform;\n\n background: linear-gradient(\n 135deg,\n ", " 0%,\n ", " 30%,\n ", " 70%,\n ", " 100%\n );\n background-size: 200% 200%;\n filter: blur(69px);\n\n animation: glow 10s ease infinite;\n\n @keyframes glow {\n 0% {\n background-position: 0 -100%;\n }\n\n 50% {\n background-position: 200% 50%;\n }\n\n 100% {\n background-position: 0 -100%;\n }\n }\n "])), token.gradientColor3, token.gradientColor1, token.red, token.cyan),
16
+ iconGradientDefault: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n background-image: radial-gradient(\n 100% 100% at 50% 0,\n ", " 0,\n ", " 100%\n );\n "])), rgba(token.colorSolid, 0.2), rgba(token.colorSolid, 0.1)),
17
+ blur: css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n backdrop-filter: blur(7px);\n "])))
18
18
  };
19
19
  };
@@ -1,3 +1,7 @@
1
+ var FONT_EMOJI = "\"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Apple Color Emoji\", \"Twemoji Mozilla\", \"Noto Color Emoji\", \"Android Emoji\"";
2
+ var FONT_EN = "\"Segoe UI\", \"SF Pro Display\",-apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, \"Open Sans\", \"Helvetica Neue\", sans-serif";
3
+ var FONT_CN = "\"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft Yahei UI\", \"Microsoft Yahei\", \"Source Han Sans CN\", sans-serif";
4
+ var FONT_CODE = "\"Hack Nerd Font Mono\", Hack, \"SFMono Regular\", Consolas, \"Liberation Mono\", Menlo, Courier, monospace";
1
5
  export var baseTheme = {
2
6
  token: {
3
7
  colorInfo: '#0070f3',
@@ -9,7 +13,7 @@ export var baseTheme = {
9
13
  borderRadiusSM: 3,
10
14
  borderRadiusLG: 8,
11
15
  controlHeight: 36,
12
- fontFamily: "'Segoe UI', SegoeUI, -apple-system ,BlinkMacSystemFont,Roboto,'Helvetica Neue',Arial,'Noto Sans',sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji'",
13
- fontFamilyCode: "'Hack Nerd Font Mono', 'Hack', 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace"
16
+ fontFamily: [FONT_EN, FONT_CN, FONT_EMOJI].join(','),
17
+ fontFamilyCode: FONT_CODE
14
18
  }
15
19
  };
@@ -45,8 +45,11 @@ var useStyles = (0, import_antd_style.createStyles)(({ css, token, cx, prefixCls
45
45
  position: absolute;
46
46
  top: 0;
47
47
  right: 0;
48
- color: ${token.colorTextTertiary};
48
+
49
49
  padding: 4px 8px;
50
+
51
+ color: ${token.colorTextTertiary};
52
+
50
53
  backdrop-filter: saturate(180%) blur(10px);
51
54
  border-radius: ${token.borderRadiusSM};
52
55
  `
@@ -33,18 +33,26 @@ var useStyles = (0, import_antd_style.createStyles)(
33
33
  container: cx(
34
34
  prefix,
35
35
  css`
36
- overflow: auto;
37
36
  position: relative;
38
- transition: background-color 100ms ${token.motionEaseOut};
37
+
38
+ overflow: auto;
39
+
39
40
  background-color: ${type === "block" ? (0, import_polished.rgba)(token.colorBgElevated, 0.6) : "transparent"};
40
41
  border-radius: ${token.borderRadius}px;
41
42
 
43
+ transition: background-color 100ms ${token.motionEaseOut};
42
44
  ${type === "ghost" && css`
43
45
  border: 1px solid ${token.colorBorder};
44
46
  `}
45
-
46
47
  &:hover {
47
48
  background-color: ${type === "prue" ? "transparent" : token.colorFillTertiary};
49
+ .${buttonHoverCls} {
50
+ opacity: 1;
51
+ }
52
+
53
+ .${langHoverCls} {
54
+ opacity: 1;
55
+ }
48
56
  }
49
57
 
50
58
  .prism-code {
@@ -60,16 +68,6 @@ var useStyles = (0, import_antd_style.createStyles)(
60
68
  code {
61
69
  background: transparent !important;
62
70
  }
63
-
64
- &:hover {
65
- .${buttonHoverCls} {
66
- opacity: 1;
67
- }
68
-
69
- .${langHoverCls} {
70
- opacity: 1;
71
- }
72
- }
73
71
  `
74
72
  ),
75
73
  button: cx(
package/lib/Logo/style.js CHANGED
@@ -30,8 +30,8 @@ var useStyles = (0, import_antd_style.createStyles)(({ css }) => {
30
30
  align-items: center;
31
31
  `,
32
32
  extraTitle: css`
33
- white-space: nowrap;
34
33
  font-weight: 300;
34
+ white-space: nowrap;
35
35
  `
36
36
  };
37
37
  });
@@ -33,12 +33,13 @@ __export(Markdown_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(Markdown_exports);
35
35
  var import_antd = require("antd");
36
+ var import_pangu = __toESM(require("pangu"));
36
37
  var import_react = require("react");
37
38
  var import_react_markdown = __toESM(require("react-markdown"));
38
39
  var import_remark_gfm = __toESM(require("remark-gfm"));
39
- var import_style = require("./style");
40
40
  var import_Code = __toESM(require("./Code"));
41
41
  var import_CodeBlock = __toESM(require("./CodeBlock"));
42
+ var import_style = require("./style");
42
43
  var Markdown = (0, import_react.memo)(({ children, className }) => {
43
44
  const { styles, cx } = (0, import_style.useStyles)();
44
45
  const components = { pre: import_CodeBlock.default, code: import_Code.default, hr: import_antd.Divider, a: import_antd.Typography.Link };
@@ -49,7 +50,7 @@ var Markdown = (0, import_react.memo)(({ children, className }) => {
49
50
  components,
50
51
  remarkPlugins: [import_remark_gfm.default]
51
52
  },
52
- children
53
+ import_pangu.default.spacing(children)
53
54
  ));
54
55
  });
55
56
  var Markdown_default = Markdown;
@@ -26,23 +26,31 @@ var import_antd_style = require("antd-style");
26
26
  var useStyles = (0, import_antd_style.createStyles)(({ css, token, isDarkMode }) => {
27
27
  return {
28
28
  container: css`
29
- color: ${isDarkMode ? token.colorTextSecondary : token.colorText};
30
-
31
-
29
+ color: ${isDarkMode ? token.colorTextSecondary : token.colorText};
32
30
 
33
31
  p {
34
32
  margin: 20px auto;
35
- line-height: 2;
36
- word-wrap: break-word;
33
+
37
34
  font-size: 14px;
35
+ line-height: 2;
38
36
  color: ${token.colorText};
37
+ text-align: justify;
38
+ word-wrap: break-word;
39
+ }
39
40
 
40
- &:not(:last-child) {
41
- margin-bottom: 1em;
41
+ blockquote {
42
+ margin: 16px 0;
43
+ padding: 0 12px;
44
+ p {
45
+ font-style: italic;
46
+ color: ${token.colorTextDescription};
42
47
  }
43
48
  }
44
49
 
45
- // hyperlink
50
+ p:not(:last-child) {
51
+ margin-bottom: 1em;
52
+ }
53
+
46
54
  a {
47
55
  color: ${token.colorLink};
48
56
 
@@ -59,7 +67,6 @@ var useStyles = (0, import_antd_style.createStyles)(({ css, token, isDarkMode })
59
67
  max-width: 100%;
60
68
  }
61
69
 
62
- // inline code
63
70
  > :not([data-code-type='highlighter']) code {
64
71
  padding: 2px 6px;
65
72
  color: ${isDarkMode ? token["cyan-7"] : token.colorPrimaryText};
@@ -67,22 +74,26 @@ var useStyles = (0, import_antd_style.createStyles)(({ css, token, isDarkMode })
67
74
  border-radius: 4px;
68
75
  }
69
76
 
70
-
71
- // table
72
77
  table {
73
- width: 100%;
74
78
  border-spacing: 0;
75
- border: 1px solid ${token.colorBorder};
76
- border-radius: ${token.borderRadius}px;
77
- padding: 8px;
79
+
80
+ width: 100%;
78
81
  margin-block-start: 1em;
79
82
  margin-block-end: 1em;
80
83
  margin-inline-start: 0px;
81
84
  margin-inline-end: 0px;
82
- }
85
+ padding: 8px;
83
86
 
84
- th {
87
+ border: 1px solid ${token.colorBorder};
88
+ border-radius: ${token.borderRadius}px;
89
+ }
85
90
 
91
+ th,
92
+ td {
93
+ padding-block-start: 10px;
94
+ padding-block-end: 10px;
95
+ padding-inline-start: 16px;
96
+ padding-inline-end: 16px;
86
97
  }
87
98
 
88
99
  thead {
@@ -101,29 +112,9 @@ var useStyles = (0, import_antd_style.createStyles)(({ css, token, isDarkMode })
101
112
  }
102
113
  }
103
114
 
104
- th,
105
- td {
106
- padding-block-start: 10px;
107
- padding-block-end: 10px;
108
- padding-inline-start: 16px;
109
- padding-inline-end: 16px;
110
- }
111
-
112
- // blockquote
113
- blockquote {
114
- margin: 16px 0;
115
- padding: 0 12px;
116
- p {
117
- font-style: italic;
118
- color: ${token.colorTextDescription};
119
- }
120
- }
121
-
122
- // list
123
115
  ul li {
124
116
  line-height: 1.8;
125
117
  }
126
- }
127
118
  `,
128
119
  code: css`
129
120
  padding: 2px 4px;
@@ -26,21 +26,24 @@ var import_antd_style = require("antd-style");
26
26
  var import_polished = require("polished");
27
27
  var useStyles = (0, import_antd_style.createStyles)(
28
28
  ({ css, token }, type) => css`
29
- display: flex;
30
- max-width: 100%;
31
29
  position: relative;
32
- align-items: center;
33
- border-radius: ${token.borderRadius}px;
30
+
31
+ display: flex;
34
32
  gap: 8px;
35
- padding: 0 8px 0 12px;
33
+ align-items: center;
34
+
35
+ max-width: 100%;
36
36
  height: 36px;
37
- transition: background-color 100ms ${token.motionEaseOut};
37
+ padding: 0 8px 0 12px;
38
+
39
+ border-radius: ${token.borderRadius}px;
38
40
 
41
+ transition: background-color 100ms ${token.motionEaseOut};
39
42
  ${type === "block" ? css`
40
- background-color: ${(0, import_polished.rgba)(token.colorBgElevated, 0.6)};
41
- ` : css`
42
- border: 1px solid ${token.colorBorder};
43
- `}
43
+ background-color: ${(0, import_polished.rgba)(token.colorBgElevated, 0.6)};
44
+ ` : css`
45
+ border: 1px solid ${token.colorBorder};
46
+ `}
44
47
 
45
48
  &:hover {
46
49
  background-color: ${token.colorFillTertiary};
@@ -55,11 +58,12 @@ var useStyles = (0, import_antd_style.createStyles)(
55
58
  }
56
59
 
57
60
  pre {
58
- background: none !important;
59
- padding-top: 6px; !important;
60
61
  margin: 0 !important;
62
+ padding-top: 6px !important;
61
63
  line-height: 1;
64
+ background: none !important;
62
65
  }
66
+
63
67
  code[class*='language-'] {
64
68
  background: none !important;
65
69
  }
@@ -30,6 +30,7 @@ var useStyles = (0, import_antd_style.createStyles)(
30
30
  display: flex;
31
31
  align-items: stretch;
32
32
  justify-content: stretch;
33
+
33
34
  width: inherit;
34
35
  min-height: inherit;
35
36
  ${mobile && css`
@@ -37,11 +38,12 @@ var useStyles = (0, import_antd_style.createStyles)(
37
38
  `}
38
39
  `,
39
40
  left: css`
40
- flex: 1;
41
+ overflow: auto;
41
42
  display: flex;
43
+ flex: 1;
42
44
  align-items: center;
43
45
  justify-content: center;
44
- overflow: auto;
46
+
45
47
  ${!noPadding && css`
46
48
  padding: 40px 24px;
47
49
  `}
@@ -60,6 +62,7 @@ var useStyles = (0, import_antd_style.createStyles)(
60
62
  --leva-colors-vivid1: ${token.colorWarning};
61
63
  --leva-shadows-level1: unset;
62
64
  --leva-shadows-level2: unset;
65
+
63
66
  padding: 6px 0;
64
67
  background: ${token.colorBgLayout};
65
68
  > div {
@@ -25,43 +25,62 @@ module.exports = __toCommonJS(GlobalStyle_exports);
25
25
  var import_antd_style = require("antd-style");
26
26
  var GlobalStyle = import_antd_style.createGlobalStyle`
27
27
 
28
- body {
28
+ html,body {
29
+ --font-settings: "cv01";
30
+ --font-variations: "opsz" auto;
31
+
32
+ overflow-x: hidden;
33
+
34
+ margin: 0;
35
+ padding: 0;
36
+
29
37
  font-family: ${({ theme }) => theme.fontFamily};
30
38
  font-size: ${({ theme }) => theme.fontSize}px;
39
+ font-feature-settings: var(--font-settings);
40
+ font-variation-settings: var(--font-variations);
31
41
  line-height: 1;
32
42
  color: ${({ theme }) => theme.colorTextBase};
43
+ text-size-adjust: none;
44
+ text-rendering: optimizelegibility;
45
+ vertical-align: baseline;
33
46
 
34
- margin: 0;
35
- padding: 0;
36
- background-color: ${(p) => p.theme.colorBgLayout};
47
+ color-scheme: dark;
48
+ background-color: ${({ theme }) => theme.colorBgLayout};
37
49
 
38
50
  -webkit-font-smoothing: antialiased;
39
51
  -moz-osx-font-smoothing: grayscale;
52
+ -webkit-tap-highlight-color: transparent;
40
53
  }
41
54
 
55
+
42
56
  * {
43
57
  box-sizing: border-box;
58
+ vertical-align: baseline;
44
59
  }
45
60
 
46
61
  #root {
47
62
  min-height: 100vh;
48
63
  }
49
- /* 定义滚动槽的样式 */
64
+
50
65
  ::-webkit-scrollbar {
51
66
  width: 0;
52
67
  height: 4px;
53
- margin-right: 4px;
54
- background-color: transparent; // 定义滚动槽的背景色
68
+ background-color: transparent;
55
69
 
56
70
  &-thumb {
57
- background-color: ${({ theme }) => theme.colorFill}; // 定义滚动块的背景色
58
- border-radius: 4px; // 定义滚动块的圆角半径
71
+ background-color: ${({ theme }) => theme.colorFill};
72
+ border-radius: 4px;
59
73
  }
60
74
 
61
75
  &-corner {
62
76
  display: none;
63
77
  }
64
78
  }
79
+
80
+ p {
81
+ text-align: justify;
82
+ word-wrap: break-word;
83
+ }
65
84
  `;
66
85
  var GlobalStyle_default = GlobalStyle;
67
86
  // Annotate the CommonJS export names for ESM import in node:
@@ -27,14 +27,17 @@ var useStyles = (0, import_antd_style.createStyles)(({ css, token }) => {
27
27
  return {
28
28
  tooltip: css`
29
29
  .ant-tooltip-inner {
30
- background-color: ${token.colorText};
31
- color: ${token.colorBgLayout};
32
- padding: 4px 8px;
33
- border-radius: ${token.borderRadiusSM}px;
34
- min-height: unset;
35
30
  display: flex;
36
31
  align-items: center;
37
32
  justify-content: center;
33
+
34
+ min-height: unset;
35
+ padding: 4px 8px;
36
+
37
+ color: ${token.colorBgLayout};
38
+
39
+ background-color: ${token.colorText};
40
+ border-radius: ${token.borderRadiusSM}px;
38
41
  }
39
42
  .ant-tooltip-arrow {
40
43
  &:before,
@@ -67,14 +67,13 @@ var getCustomStylish = ({ css, token, isDarkMode }) => {
67
67
  `,
68
68
  heroTextShadow: css`
69
69
  will-change: transform;
70
-
71
70
  text-shadow: 0 8px 20px ${(0, import_polished.rgba)(token.gradientColor2, 0.2)},
72
71
  0 8px 60px ${(0, import_polished.rgba)(token.gradientColor3, 0.2)},
73
72
  0 8px 80px ${(0, import_polished.rgba)(token.cyan, isDarkMode ? 0.2 : 0.4)};
74
73
  `,
75
74
  heroBlurBall: css`
76
- filter: blur(69px);
77
75
  will-change: transform;
76
+
78
77
  background: linear-gradient(
79
78
  135deg,
80
79
  ${token.gradientColor3} 0%,
@@ -83,6 +82,8 @@ var getCustomStylish = ({ css, token, isDarkMode }) => {
83
82
  ${token.cyan} 100%
84
83
  );
85
84
  background-size: 200% 200%;
85
+ filter: blur(69px);
86
+
86
87
  animation: glow 10s ease infinite;
87
88
 
88
89
  @keyframes glow {
@@ -100,14 +101,14 @@ var getCustomStylish = ({ css, token, isDarkMode }) => {
100
101
  }
101
102
  `,
102
103
  iconGradientDefault: css`
103
- radial-gradient(
104
+ background-image: radial-gradient(
104
105
  100% 100% at 50% 0,
105
106
  ${(0, import_polished.rgba)(token.colorSolid, 0.2)} 0,
106
107
  ${(0, import_polished.rgba)(token.colorSolid, 0.1)} 100%
107
- )`,
108
+ );
109
+ `,
108
110
  blur: css`
109
111
  backdrop-filter: blur(7px);
110
- // background: ${(0, import_polished.rgba)(token.colorBgBase, 0.5)};
111
112
  `
112
113
  };
113
114
  };
@@ -22,6 +22,10 @@ __export(base_exports, {
22
22
  baseTheme: () => baseTheme
23
23
  });
24
24
  module.exports = __toCommonJS(base_exports);
25
+ var FONT_EMOJI = `"Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Android Emoji"`;
26
+ var FONT_EN = `"Segoe UI", "SF Pro Display",-apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif`;
27
+ var FONT_CN = `"PingFang SC", "Hiragino Sans GB", "Microsoft Yahei UI", "Microsoft Yahei", "Source Han Sans CN", sans-serif`;
28
+ var FONT_CODE = `"Hack Nerd Font Mono", Hack, "SFMono Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace`;
25
29
  var baseTheme = {
26
30
  token: {
27
31
  colorInfo: "#0070f3",
@@ -33,8 +37,8 @@ var baseTheme = {
33
37
  borderRadiusSM: 3,
34
38
  borderRadiusLG: 8,
35
39
  controlHeight: 36,
36
- fontFamily: `'Segoe UI', SegoeUI, -apple-system ,BlinkMacSystemFont,Roboto,'Helvetica Neue',Arial,'Noto Sans',sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol','Noto Color Emoji'`,
37
- fontFamilyCode: `'Hack Nerd Font Mono', 'Hack', 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace`
40
+ fontFamily: [FONT_EN, FONT_CN, FONT_EMOJI].join(","),
41
+ fontFamilyCode: FONT_CODE
38
42
  }
39
43
  };
40
44
  // Annotate the CommonJS export names for ESM import in node:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "description": "Lobe UI is an open-source UI component library for building chatbot web apps",
5
5
  "keywords": [
6
6
  "lobehub",
@@ -38,12 +38,14 @@
38
38
  "docs:build": "npm run build:theme && dumi build",
39
39
  "doctor": "father doctor",
40
40
  "lint": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
41
+ "lint:fix": "npm run lint --fix",
41
42
  "prepare": "husky install && npm run setup",
42
43
  "prepublishOnly": "father doctor && npm run build",
43
44
  "prettier": "prettier -c --write \"**/**\"",
44
45
  "release": "semantic-release",
45
46
  "setup": "dumi setup",
46
47
  "start": "dumi dev",
48
+ "stylelint": "stylelint \"{src,test}/**/*.{js,jsx,ts,tsx}\" --fix",
47
49
  "test": "vitest --passWithNoTests",
48
50
  "test:coverage": "vitest run --coverage --passWithNoTests",
49
51
  "test:update": "vitest -u",
@@ -55,10 +57,12 @@
55
57
  ],
56
58
  "*.{js,jsx}": [
57
59
  "eslint --fix",
60
+ "stylelint --fix",
58
61
  "prettier --write"
59
62
  ],
60
63
  "*.{ts,tsx}": [
61
64
  "eslint --fix",
65
+ "stylelint --fix",
62
66
  "prettier --parser=typescript --write"
63
67
  ]
64
68
  },
@@ -74,16 +78,17 @@
74
78
  "dayjs": "^1",
75
79
  "fast-deep-equal": "^3",
76
80
  "immer": "^10",
77
- "leva": "^0.9.34",
81
+ "leva": "^0.9",
78
82
  "lodash": "^4",
79
83
  "lucide-react": "latest",
84
+ "pangu": "^4",
80
85
  "polished": "^4",
81
86
  "prism-react-renderer": "^2",
82
87
  "re-resizable": "^6",
83
88
  "react-layout-kit": "^1",
84
89
  "react-markdown": "^8",
85
90
  "react-rnd": "^10",
86
- "remark-gfm": "^3.0.1",
91
+ "remark-gfm": "^3",
87
92
  "shiki-es": "^0.2",
88
93
  "styled-components": "^6.0.0-rc.1",
89
94
  "ts-md5": "^1",
@@ -97,6 +102,7 @@
97
102
  "@testing-library/react": "^14",
98
103
  "@types/chroma-js": "^2",
99
104
  "@types/lodash": "^4",
105
+ "@types/pangu": "^4",
100
106
  "@types/react": "^18",
101
107
  "@types/react-dom": "^18",
102
108
  "@umijs/lint": "^4",
@@ -106,7 +112,7 @@
106
112
  "commitlint-config-gitmoji": "^2",
107
113
  "concurrently": "^8",
108
114
  "cross-env": "^7",
109
- "dumi": "^2",
115
+ "dumi": "2",
110
116
  "dumi-assets-types": "^1",
111
117
  "dumi-theme-lobehub": "latest",
112
118
  "eslint": "^8",
@@ -116,6 +122,7 @@
116
122
  "husky": "^8",
117
123
  "jsdom": "^22",
118
124
  "lint-staged": "^13",
125
+ "postcss-styled-syntax": "^0.4",
119
126
  "prettier": "^2",
120
127
  "prettier-plugin-organize-imports": "^3",
121
128
  "prettier-plugin-packagejson": "^2",
@@ -124,6 +131,9 @@
124
131
  "semantic-release": "^21",
125
132
  "semantic-release-config-gitmoji": "^1",
126
133
  "stylelint": "^15",
134
+ "stylelint-config-clean-order": "^5",
135
+ "stylelint-config-recommended": "^12",
136
+ "stylelint-order": "^6",
127
137
  "typescript": "^5",
128
138
  "vitest": "latest"
129
139
  },