@icos-react/largemodel 1.0.22 → 1.0.24

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.
package/dist/index.js CHANGED
@@ -3473,16 +3473,15 @@ var createChatStyles = (width, height, padding = 0) => {
3473
3473
  padding-left: 8px;
3474
3474
  margin: 16px 0px 8px 0px;
3475
3475
 
3476
- && p {
3476
+ p {
3477
3477
  margin: 0;
3478
- color: #ffffffad;
3479
- font-size: 13px;
3480
- line-height: 22px;
3478
+ font-size: inherit;
3479
+ line-height: inherit;
3480
+ color: inherit;
3481
3481
  }
3482
3482
 
3483
- /* 所有子元素继承颜色 */
3484
- && * {
3485
- color: #ffffffad;
3483
+ * {
3484
+ color: inherit;
3486
3485
  }
3487
3486
  `,
3488
3487
  LeftContainer: css`
@@ -4529,16 +4528,20 @@ var ThinkingContent = ({
4529
4528
  }) => {
4530
4529
  const useStyles5 = createChatStyles();
4531
4530
  const { styles } = useStyles5();
4532
- const [isExpanded, setIsExpanded] = (0, import_react20.useState)(true);
4531
+ const [isExpanded, setIsExpanded] = (0, import_react20.useState)(!!isAccumulatingThinking);
4533
4532
  const prevAccumulatingRef = (0, import_react20.useRef)(isAccumulatingThinking);
4534
4533
  (0, import_react20.useEffect)(() => {
4535
- if (prevAccumulatingRef.current === true && isAccumulatingThinking === false) {
4536
- if (temporarilyDisableScroll) {
4537
- temporarilyDisableScroll(500, "thinking-auto-collapse");
4534
+ if (prevAccumulatingRef.current !== isAccumulatingThinking) {
4535
+ if (isAccumulatingThinking) {
4536
+ setIsExpanded(true);
4537
+ } else if (prevAccumulatingRef.current === true) {
4538
+ if (temporarilyDisableScroll) {
4539
+ temporarilyDisableScroll(500, "thinking-auto-collapse");
4540
+ }
4541
+ setIsExpanded(false);
4538
4542
  }
4539
- setIsExpanded(false);
4543
+ prevAccumulatingRef.current = isAccumulatingThinking;
4540
4544
  }
4541
- prevAccumulatingRef.current = isAccumulatingThinking;
4542
4545
  }, [isAccumulatingThinking, temporarilyDisableScroll]);
4543
4546
  const formatTime = (ms) => {
4544
4547
  if (ms < 1e3) {
@@ -4592,8 +4595,9 @@ var ThinkingContent = ({
4592
4595
  ), isExpanded && /* @__PURE__ */ import_react20.default.createElement(
4593
4596
  "div",
4594
4597
  {
4595
- className: styles.thinkingContent,
4596
- style: customStyle?.thinkingContent
4598
+ className: `${styles.thinkingContent} thinking-content-area`,
4599
+ style: customStyle?.thinkingContent,
4600
+ "data-custom-color": ""
4597
4601
  },
4598
4602
  /* @__PURE__ */ import_react20.default.createElement(import_react_markdown2.default, { components: markdownComponents, rehypePlugins: [import_rehype_raw.default] }, content)
4599
4603
  ));
package/dist/index.mjs CHANGED
@@ -3424,16 +3424,15 @@ var createChatStyles = (width, height, padding = 0) => {
3424
3424
  padding-left: 8px;
3425
3425
  margin: 16px 0px 8px 0px;
3426
3426
 
3427
- && p {
3427
+ p {
3428
3428
  margin: 0;
3429
- color: #ffffffad;
3430
- font-size: 13px;
3431
- line-height: 22px;
3429
+ font-size: inherit;
3430
+ line-height: inherit;
3431
+ color: inherit;
3432
3432
  }
3433
3433
 
3434
- /* 所有子元素继承颜色 */
3435
- && * {
3436
- color: #ffffffad;
3434
+ * {
3435
+ color: inherit;
3437
3436
  }
3438
3437
  `,
3439
3438
  LeftContainer: css`
@@ -4480,16 +4479,20 @@ var ThinkingContent = ({
4480
4479
  }) => {
4481
4480
  const useStyles5 = createChatStyles();
4482
4481
  const { styles } = useStyles5();
4483
- const [isExpanded, setIsExpanded] = useState8(true);
4482
+ const [isExpanded, setIsExpanded] = useState8(!!isAccumulatingThinking);
4484
4483
  const prevAccumulatingRef = useRef9(isAccumulatingThinking);
4485
4484
  useEffect8(() => {
4486
- if (prevAccumulatingRef.current === true && isAccumulatingThinking === false) {
4487
- if (temporarilyDisableScroll) {
4488
- temporarilyDisableScroll(500, "thinking-auto-collapse");
4485
+ if (prevAccumulatingRef.current !== isAccumulatingThinking) {
4486
+ if (isAccumulatingThinking) {
4487
+ setIsExpanded(true);
4488
+ } else if (prevAccumulatingRef.current === true) {
4489
+ if (temporarilyDisableScroll) {
4490
+ temporarilyDisableScroll(500, "thinking-auto-collapse");
4491
+ }
4492
+ setIsExpanded(false);
4489
4493
  }
4490
- setIsExpanded(false);
4494
+ prevAccumulatingRef.current = isAccumulatingThinking;
4491
4495
  }
4492
- prevAccumulatingRef.current = isAccumulatingThinking;
4493
4496
  }, [isAccumulatingThinking, temporarilyDisableScroll]);
4494
4497
  const formatTime = (ms) => {
4495
4498
  if (ms < 1e3) {
@@ -4543,8 +4546,9 @@ var ThinkingContent = ({
4543
4546
  ), isExpanded && /* @__PURE__ */ React10.createElement(
4544
4547
  "div",
4545
4548
  {
4546
- className: styles.thinkingContent,
4547
- style: customStyle?.thinkingContent
4549
+ className: `${styles.thinkingContent} thinking-content-area`,
4550
+ style: customStyle?.thinkingContent,
4551
+ "data-custom-color": ""
4548
4552
  },
4549
4553
  /* @__PURE__ */ React10.createElement(ReactMarkdown2, { components: markdownComponents, rehypePlugins: [rehypeRaw] }, content)
4550
4554
  ));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icos-react/largemodel",
3
3
  "displayName": "大模型组件",
4
- "version": "1.0.22",
4
+ "version": "1.0.24",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",