@icos-react/largemodel 1.0.25 → 1.0.27

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
@@ -3809,6 +3809,17 @@ function parseCustomTagsFromFullText(text, genSegmentId) {
3809
3809
  }
3810
3810
  return finalized;
3811
3811
  }
3812
+ function appendAnchorToCustomTagStream(stream, anchorMark) {
3813
+ if (!stream.length || !anchorMark)
3814
+ return false;
3815
+ const exists = stream.some(
3816
+ (p) => p.kind === "text" && p.text.includes(anchorMark)
3817
+ );
3818
+ if (exists)
3819
+ return false;
3820
+ stream.push({ kind: "text", text: anchorMark });
3821
+ return true;
3822
+ }
3812
3823
  function rootPlainFromStream(stream) {
3813
3824
  return stream.filter((p) => p.kind === "text").map((p) => p.text).join("");
3814
3825
  }
@@ -4021,15 +4032,12 @@ var processStreamData = (aiMessageId, jsonData, setChatMessages, conversationId,
4021
4032
  };
4022
4033
  }
4023
4034
  if (customTagUpdate && customTagUpdate.stream.length > 0) {
4024
- for (let j = customTagUpdate.stream.length - 1; j >= 0; j--) {
4025
- const part = customTagUpdate.stream[j];
4026
- if (part.kind === "text") {
4027
- if (!part.text.includes(anchorMark)) {
4028
- part.text += anchorMark;
4029
- hasChanges = true;
4030
- }
4031
- break;
4032
- }
4035
+ const inserted = appendAnchorToCustomTagStream(
4036
+ customTagUpdate.stream,
4037
+ anchorMark
4038
+ );
4039
+ if (inserted) {
4040
+ hasChanges = true;
4033
4041
  }
4034
4042
  }
4035
4043
  }
@@ -4247,15 +4255,7 @@ var processHistoryRecords = (history, chatMessages, setChatMessages, setConversa
4247
4255
  if (actionItem.anchorId && historyCustomTagState.stream.length > 0) {
4248
4256
  const anchorMark = `
4249
4257
  [ANCHOR:${actionItem.anchorId}]`;
4250
- for (let j = historyCustomTagState.stream.length - 1; j >= 0; j--) {
4251
- const part = historyCustomTagState.stream[j];
4252
- if (part.kind === "text") {
4253
- if (!part.text.includes(anchorMark)) {
4254
- part.text += anchorMark;
4255
- }
4256
- break;
4257
- }
4258
- }
4258
+ appendAnchorToCustomTagStream(historyCustomTagState.stream, anchorMark);
4259
4259
  }
4260
4260
  });
4261
4261
  }
@@ -8973,6 +8973,11 @@ var ChatButton = (0, import_react25.forwardRef)(
8973
8973
  const leftVal = typeof windowPosition.left === "number" ? windowPosition.left : parseFloat(String(windowPosition.left)) || 0;
8974
8974
  base.left = leftVal - gap - humanW;
8975
8975
  }
8976
+ const winCustom = customStyle?.window;
8977
+ if (winCustom?.marginTop !== void 0)
8978
+ base.marginTop = winCustom.marginTop;
8979
+ if (winCustom?.marginBottom !== void 0)
8980
+ base.marginBottom = winCustom.marginBottom;
8976
8981
  if (windowPosition.bottom !== void 0) {
8977
8982
  base.bottom = typeof windowPosition.bottom === "number" ? windowPosition.bottom : windowPosition.bottom;
8978
8983
  } else if (windowPosition.top !== void 0) {
package/dist/index.mjs CHANGED
@@ -3760,6 +3760,17 @@ function parseCustomTagsFromFullText(text, genSegmentId) {
3760
3760
  }
3761
3761
  return finalized;
3762
3762
  }
3763
+ function appendAnchorToCustomTagStream(stream, anchorMark) {
3764
+ if (!stream.length || !anchorMark)
3765
+ return false;
3766
+ const exists = stream.some(
3767
+ (p) => p.kind === "text" && p.text.includes(anchorMark)
3768
+ );
3769
+ if (exists)
3770
+ return false;
3771
+ stream.push({ kind: "text", text: anchorMark });
3772
+ return true;
3773
+ }
3763
3774
  function rootPlainFromStream(stream) {
3764
3775
  return stream.filter((p) => p.kind === "text").map((p) => p.text).join("");
3765
3776
  }
@@ -3972,15 +3983,12 @@ var processStreamData = (aiMessageId, jsonData, setChatMessages, conversationId,
3972
3983
  };
3973
3984
  }
3974
3985
  if (customTagUpdate && customTagUpdate.stream.length > 0) {
3975
- for (let j = customTagUpdate.stream.length - 1; j >= 0; j--) {
3976
- const part = customTagUpdate.stream[j];
3977
- if (part.kind === "text") {
3978
- if (!part.text.includes(anchorMark)) {
3979
- part.text += anchorMark;
3980
- hasChanges = true;
3981
- }
3982
- break;
3983
- }
3986
+ const inserted = appendAnchorToCustomTagStream(
3987
+ customTagUpdate.stream,
3988
+ anchorMark
3989
+ );
3990
+ if (inserted) {
3991
+ hasChanges = true;
3984
3992
  }
3985
3993
  }
3986
3994
  }
@@ -4198,15 +4206,7 @@ var processHistoryRecords = (history, chatMessages, setChatMessages, setConversa
4198
4206
  if (actionItem.anchorId && historyCustomTagState.stream.length > 0) {
4199
4207
  const anchorMark = `
4200
4208
  [ANCHOR:${actionItem.anchorId}]`;
4201
- for (let j = historyCustomTagState.stream.length - 1; j >= 0; j--) {
4202
- const part = historyCustomTagState.stream[j];
4203
- if (part.kind === "text") {
4204
- if (!part.text.includes(anchorMark)) {
4205
- part.text += anchorMark;
4206
- }
4207
- break;
4208
- }
4209
- }
4209
+ appendAnchorToCustomTagStream(historyCustomTagState.stream, anchorMark);
4210
4210
  }
4211
4211
  });
4212
4212
  }
@@ -8939,6 +8939,11 @@ var ChatButton = forwardRef8(
8939
8939
  const leftVal = typeof windowPosition.left === "number" ? windowPosition.left : parseFloat(String(windowPosition.left)) || 0;
8940
8940
  base.left = leftVal - gap - humanW;
8941
8941
  }
8942
+ const winCustom = customStyle?.window;
8943
+ if (winCustom?.marginTop !== void 0)
8944
+ base.marginTop = winCustom.marginTop;
8945
+ if (winCustom?.marginBottom !== void 0)
8946
+ base.marginBottom = winCustom.marginBottom;
8942
8947
  if (windowPosition.bottom !== void 0) {
8943
8948
  base.bottom = typeof windowPosition.bottom === "number" ? windowPosition.bottom : windowPosition.bottom;
8944
8949
  } else if (windowPosition.top !== void 0) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icos-react/largemodel",
3
3
  "displayName": "大模型组件",
4
- "version": "1.0.25",
4
+ "version": "1.0.27",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",