@yuntijs/ui 1.0.0-beta.96 → 1.0.0-beta.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,9 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
1
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
3
  import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
3
- var _templateObject, _templateObject2, _templateObject3;
4
+ var _templateObject, _templateObject2;
5
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
7
  import { Icon, Markdown } from '@lobehub/ui';
5
8
  import { createStyles } from 'antd-style';
6
9
  import { ChevronDown, ChevronRight, Sparkles } from 'lucide-react';
@@ -13,11 +16,16 @@ var useStyles = createStyles(function (_ref) {
13
16
  token = _ref.token,
14
17
  isDarkMode = _ref.isDarkMode;
15
18
  return {
16
- container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n padding-block: 12px;\n color: ", ";\n "])), token.colorTextTertiary),
17
- titlebox: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 8px;\n color: ", ";\n background: ", ";\n border-radius: 8px;\n\n &:hover {\n background: ", ";\n }\n "])), token.colorTextSecondary, token.colorFillTertiary, isDarkMode ? '' : token.colorFillSecondary),
18
- title: css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow: hidden;\n display: box;\n -webkit-box-orient: vertical;\n\n font-size: 12px;\n text-overflow: ellipsis;\n\n -webkit-line-clamp: 1;\n "])))
19
+ container: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n padding-block: 12px;\n color: ", ";\n "])), token.colorTextSecondary),
20
+ titlebox: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 8px 12px;\n\n font-size: 12px;\n color: ", ";\n\n background: ", ";\n border-radius: 8px;\n "])), token.colorText, isDarkMode ? token.colorFillTertiary : '#f3f5fc')
19
21
  };
20
22
  });
23
+ var mProps = {
24
+ fontSize: 12,
25
+ lineHeight: 1.625,
26
+ headerMultiple: 0.2,
27
+ marginMultiple: 0.6
28
+ };
21
29
  var Render = /*#__PURE__*/memo(function (_ref2) {
22
30
  var children = _ref2.children,
23
31
  second = _ref2.second,
@@ -45,13 +53,13 @@ var Render = /*#__PURE__*/memo(function (_ref2) {
45
53
  children: [/*#__PURE__*/_jsx(Icon, {
46
54
  color: theme.purple,
47
55
  icon: Sparkles
48
- }), done ? "\u5DF2\u6DF1\u5EA6\u601D\u8003\uFF08\u7528\u65F6 ".concat(second || 0, " \u79D2\uFF09") : '思考中...']
56
+ }), done ? "\u5DF2\u6DF1\u5EA6\u601D\u8003".concat(second ? '(用时 ' + second + ' s)' : '', " ") : '思考中...']
49
57
  }), /*#__PURE__*/_jsx(Icon, {
50
58
  icon: showDetail ? ChevronDown : ChevronRight
51
59
  })]
52
- }), showDetail && /*#__PURE__*/_jsx(Markdown, {
60
+ }), showDetail && /*#__PURE__*/_jsx(Markdown, _objectSpread(_objectSpread({}, mProps), {}, {
53
61
  children: children
54
- })]
62
+ }))]
55
63
  });
56
64
  });
57
65
  export default Render;
@@ -1,8 +1,8 @@
1
1
  // 预处理函数:确保 think 标签前后有两个换行符
2
2
  export var normalizeThinkTags = function normalizeThinkTags(markdown) {
3
- return markdown
3
+ return (markdown || ''
4
4
  // 确保 <think> 标签前后有两个换行符
5
- .replaceAll(/([^\n])\s*<think>/g, '$1\n\n<think>').replaceAll(/<think>\s*([^\n])/g, '<think>\n\n$1')
5
+ ).replaceAll(/([^\n])\s*<think>/g, '$1\n\n<think>').replaceAll(/<think>\s*([^\n])/g, '<think>\n\n$1')
6
6
  // 确保 </think> 标签前后有两个换行符
7
7
  .replaceAll(/([^\n])\s*<\/think>/g, '$1\n\n</think>').replaceAll(/<\/think>\s*([^\n])/g, '</think>\n\n$1')
8
8
  // 处理可能产生的多余换行符
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuntijs/ui",
3
- "version": "1.0.0-beta.96",
3
+ "version": "1.0.0-beta.98",
4
4
  "description": "☁️ Yunti UI - an open-source UI component library for building Cloud Native web apps",
5
5
  "keywords": [
6
6
  "yuntijs",