@fv-ui/ai-chat 0.10.0 → 0.10.1

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.d.ts CHANGED
@@ -873,6 +873,15 @@ interface ThoughtChainItem {
873
873
  description?: string;
874
874
  /** 追加到链项的修饰类(如 is-text 标记文案步,消费方可定制样式) */
875
875
  class?: string;
876
+ /** 打字机:思考文案步流式期间逐字打出(正文同款;透传 FvTypewriter typing 配置)。
877
+ * 标记移除(消息落定)后打完积压即回落静态渲染,恢复折叠测量 */
878
+ typing?: boolean | {
879
+ step?: number;
880
+ interval?: number;
881
+ };
882
+ /** 思考段步已封口(text 步专用):tool 事件/正文 delta 到达时由数据层置位,
883
+ * 该步后续不再增长;与打字完成态联合判定提前回落静态 */
884
+ closed?: boolean;
876
885
  }
877
886
  type __VLS_Props$9 = {
878
887
  /** 步骤列表 */
@@ -889,7 +898,11 @@ declare var __VLS_45$1: {
889
898
  type __VLS_Slots$8 = {} & {
890
899
  content?: (props: typeof __VLS_45$1) => any;
891
900
  };
892
- declare const __VLS_base$8: vue.DefineComponent<__VLS_Props$9, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<__VLS_Props$9> & Readonly<{}>, {
901
+ declare const __VLS_base$8: vue.DefineComponent<__VLS_Props$9, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
902
+ typing: () => any;
903
+ }, string, vue.PublicProps, Readonly<__VLS_Props$9> & Readonly<{
904
+ onTyping?: (() => any) | undefined;
905
+ }>, {
893
906
  items: ThoughtChainItem[];
894
907
  direction: "vertical" | "horizontal";
895
908
  collapsible: boolean;
@@ -1911,7 +1924,7 @@ declare var __VLS_22: {
1911
1924
  message: MessageNode;
1912
1925
  files: ChatFile[];
1913
1926
  };
1914
- declare var __VLS_60: {
1927
+ declare var __VLS_62: {
1915
1928
  message: MessageNode;
1916
1929
  };
1917
1930
  type __VLS_Slots = {} & {
@@ -1927,7 +1940,7 @@ type __VLS_Slots = {} & {
1927
1940
  } & {
1928
1941
  'message-files'?: (props: typeof __VLS_22) => any;
1929
1942
  } & {
1930
- 'message-actions'?: (props: typeof __VLS_60) => any;
1943
+ 'message-actions'?: (props: typeof __VLS_62) => any;
1931
1944
  };
1932
1945
  declare const __VLS_base: vue.DefineComponent<__VLS_Props$1, {
1933
1946
  message: vue.ComputedRef<MessageNode>;
package/es/index.mjs CHANGED
@@ -4533,7 +4533,10 @@ const _hoisted_2$9 = {
4533
4533
  class: "fv-chain-dot"
4534
4534
  };
4535
4535
  const _hoisted_3$9 = { class: "fv-chain-main" };
4536
- const _hoisted_4$8 = { class: "fv-chain-title-text" };
4536
+ const _hoisted_4$8 = {
4537
+ key: 1,
4538
+ class: "fv-chain-title-text"
4539
+ };
4537
4540
  const _hoisted_5$4 = ["aria-label", "onClick"];
4538
4541
  const _hoisted_6$3 = {
4539
4542
  key: 0,
@@ -4551,8 +4554,10 @@ var _sfc_main$9 = /* @__PURE__ */ defineComponent({
4551
4554
  direction: { type: String, required: false, default: "vertical" },
4552
4555
  collapsible: { type: Boolean, required: false, default: false }
4553
4556
  },
4554
- setup(__props) {
4557
+ emits: ["typing"],
4558
+ setup(__props, { emit: __emit }) {
4555
4559
  const props = __props;
4560
+ const emit = __emit;
4556
4561
  function statusClass(status) {
4557
4562
  return status ? `status-${status}` : "status-pending";
4558
4563
  }
@@ -4560,6 +4565,36 @@ var _sfc_main$9 = /* @__PURE__ */ defineComponent({
4560
4565
  function normalizeTitle(title) {
4561
4566
  return title ? title.replace(/\n{2,}/g, "\n") : "";
4562
4567
  }
4568
+ const typedKeys = ref(/* @__PURE__ */ new Set());
4569
+ const doneKeys = ref(/* @__PURE__ */ new Set());
4570
+ const typingConfigs = ref(/* @__PURE__ */ new Map());
4571
+ function markTyped(key, typing) {
4572
+ if (!typedKeys.value.has(key)) typedKeys.value = new Set(typedKeys.value).add(key);
4573
+ if (typing) {
4574
+ const next = new Map(typingConfigs.value);
4575
+ next.set(key, typing);
4576
+ typingConfigs.value = next;
4577
+ }
4578
+ }
4579
+ function markDone(key) {
4580
+ if (!doneKeys.value.has(key)) doneKeys.value = new Set(doneKeys.value).add(key);
4581
+ }
4582
+ watch(() => props.items, (items) => {
4583
+ for (const it of items) if (it.typing) markTyped(it.key, it.typing);
4584
+ }, { immediate: true, deep: true });
4585
+ function typingOf(item) {
4586
+ return typingConfigs.value.get(item.key) ?? true;
4587
+ }
4588
+ function isTypingItem(item) {
4589
+ if (item.typing) {
4590
+ return !(item.closed && doneKeys.value.has(item.key));
4591
+ }
4592
+ return typedKeys.value.has(item.key) && !doneKeys.value.has(item.key);
4593
+ }
4594
+ function onTypeFinish(key) {
4595
+ markDone(key);
4596
+ void nextTick(measure);
4597
+ }
4563
4598
  const titleEls = /* @__PURE__ */ new Map();
4564
4599
  const overflowKeys = ref(/* @__PURE__ */ new Set());
4565
4600
  const clampLens = ref(/* @__PURE__ */ new Map());
@@ -4631,6 +4666,7 @@ var _sfc_main$9 = /* @__PURE__ */ defineComponent({
4631
4666
  if (props.collapsible) {
4632
4667
  titleEls.forEach((el, key) => {
4633
4668
  if (expandedKeys.value.has(key)) return;
4669
+ if (isTypingKey(key)) return;
4634
4670
  const n = computeClamp(key, el);
4635
4671
  if (n === null) return;
4636
4672
  if (n < fullTitle(key).length) {
@@ -4642,6 +4678,10 @@ var _sfc_main$9 = /* @__PURE__ */ defineComponent({
4642
4678
  overflowKeys.value = nextOverflow;
4643
4679
  clampLens.value = nextLens;
4644
4680
  }
4681
+ function isTypingKey(key) {
4682
+ const item = props.items.find((i) => i.key === key);
4683
+ return !!item && isTypingItem(item);
4684
+ }
4645
4685
  function showToggle(key) {
4646
4686
  return overflowKeys.value.has(key) || expandedKeys.value.has(key);
4647
4687
  }
@@ -4740,7 +4780,7 @@ var _sfc_main$9 = /* @__PURE__ */ defineComponent({
4740
4780
  /* STABLE */
4741
4781
  })) : (openBlock(), createElementBlock("span", _hoisted_2$9))
4742
4782
  ]),
4743
- createCommentVNode(" \u5185\u5BB9:#content \u4F5C\u7528\u57DF\u63D2\u69FD\u8986\u76D6\u9ED8\u8BA4 title/description;\r\n title \u8FDE\u7EED\u6362\u884C\u5408\u5E76\u4E3A\u4E00\u4E2A;collapsible \u5F00\u542F\u65F6\u8D85 3 \u884C\u622A\u65AD,\u56FE\u6807\u6309\u94AE\u62FC\u5728\u7B2C\u4E09\u884C\u6587\u5B57\u672B "),
4783
+ createCommentVNode(" \u5185\u5BB9:#content \u4F5C\u7528\u57DF\u63D2\u69FD\u8986\u76D6\u9ED8\u8BA4 title/description;\r\n title \u8FDE\u7EED\u6362\u884C\u5408\u5E76\u4E3A\u4E00\u4E2A;collapsible \u5F00\u542F\u65F6\u8D85 3 \u884C\u622A\u65AD,\u56FE\u6807\u6309\u94AE\u62FC\u5728\u7B2C\u4E09\u884C\u6587\u5B57\u672B;\r\n \u601D\u8003\u6587\u6848\u6B65\u6D41\u5F0F\u671F\u95F4\u7ECF Typewriter \u9010\u5B57\u6253\u51FA(\u4E0E\u6B63\u6587\u540C\u6B3E),\u56DE\u843D\u65F6\u673A\u89C1 isTypingItem "),
4744
4784
  createElementVNode("div", _hoisted_3$9, [
4745
4785
  renderSlot(_ctx.$slots, "content", {
4746
4786
  item,
@@ -4755,15 +4795,21 @@ var _sfc_main$9 = /* @__PURE__ */ defineComponent({
4755
4795
  },
4756
4796
  [
4757
4797
  createCommentVNode(" \u622A\u65AD\u7531 JS \u6D4B\u91CF(displayTitle \u524D\u7F00\u539F\u6587):\u6309\u94AE\u4E3A\u5185\u8054\u5143\u7D20\u81EA\u7136\u7D27\u8DDF\r\n \u7B2C\u4E09\u884C\u6587\u5B57\u672B(\u6536\u8D77)/\u5168\u91CF\u672B\u5B57(\u5C55\u5F00);\u65E0\u5E03\u5C40\u73AF\u5883\u4E0D\u88C1\u4E0D\u663E\u6309\u94AE "),
4758
- createElementVNode(
4798
+ isTypingItem(item) ? (openBlock(), createBlock(_sfc_main$h, {
4799
+ key: 0,
4800
+ content: normalizeTitle(item.title),
4801
+ typing: typingOf(item),
4802
+ onWriting: _cache[0] || (_cache[0] = ($event) => emit("typing")),
4803
+ onFinish: ($event) => onTypeFinish(item.key)
4804
+ }, null, 8, ["content", "typing", "onFinish"])) : (openBlock(), createElementBlock(
4759
4805
  "span",
4760
4806
  _hoisted_4$8,
4761
4807
  toDisplayString(displayTitle(item.title, item.key)),
4762
4808
  1
4763
4809
  /* TEXT */
4764
- ),
4810
+ )),
4765
4811
  __props.collapsible && showToggle(item.key) ? (openBlock(), createElementBlock("button", {
4766
- key: 0,
4812
+ key: 2,
4767
4813
  type: "button",
4768
4814
  class: "fv-chain-expand",
4769
4815
  "aria-label": expandedKeys.value.has(item.key) ? "\u6536\u8D77" : "\u5C55\u5F00",
@@ -6332,7 +6378,13 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
6332
6378
  const running = props.message.status === "pending" || props.message.status === "streaming";
6333
6379
  return steps.map((s) => {
6334
6380
  if (s.kind === "text") {
6335
- return { ...s, status: void 0, icon: textStepIcon, class: "is-text" };
6381
+ return {
6382
+ ...s,
6383
+ status: void 0,
6384
+ icon: textStepIcon,
6385
+ class: "is-text",
6386
+ ...running && useTypewriter.value ? { typing: props.typing } : {}
6387
+ };
6336
6388
  }
6337
6389
  if (running) {
6338
6390
  const loading = s.status !== "error" && s.status !== "success";
@@ -6456,7 +6508,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
6456
6508
  !isUser.value && (hasToolSteps.value || hasReasoning.value) ? (openBlock(), createBlock(_sfc_main$a, {
6457
6509
  key: 2,
6458
6510
  modelValue: toolsExpanded.value,
6459
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => toolsExpanded.value = $event),
6511
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => toolsExpanded.value = $event),
6460
6512
  status: hasToolSteps.value ? toolThinkingStatus.value : thinkingStatus.value,
6461
6513
  "auto-collapse": false,
6462
6514
  class: "fv-msg-tools"
@@ -6465,13 +6517,14 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
6465
6517
  hasToolSteps.value ? (openBlock(), createBlock(_sfc_main$9, {
6466
6518
  key: 0,
6467
6519
  items: toolChainItems.value,
6468
- collapsible: __props.collapsible
6520
+ collapsible: __props.collapsible,
6521
+ onTyping: _cache[0] || (_cache[0] = ($event) => emit("typing"))
6469
6522
  }, null, 8, ["items", "collapsible"])) : hasReasoning.value && useTypewriter.value ? (openBlock(), createBlock(_sfc_main$h, {
6470
6523
  key: 1,
6471
6524
  content: __props.message.reasoning ?? "",
6472
6525
  "is-markdown": "",
6473
6526
  typing: __props.typing,
6474
- onWriting: _cache[0] || (_cache[0] = ($event) => emit("typing"))
6527
+ onWriting: _cache[1] || (_cache[1] = ($event) => emit("typing"))
6475
6528
  }, null, 8, ["content", "typing"])) : hasReasoning.value ? (openBlock(), createBlock(_sfc_main$i, {
6476
6529
  key: 2,
6477
6530
  content: __props.message.reasoning ?? ""
@@ -6493,7 +6546,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
6493
6546
  content: __props.message.content,
6494
6547
  "is-markdown": "",
6495
6548
  typing: __props.typing,
6496
- onWriting: _cache[2] || (_cache[2] = ($event) => emit("typing"))
6549
+ onWriting: _cache[3] || (_cache[3] = ($event) => emit("typing"))
6497
6550
  }, null, 8, ["content", "typing"])) : __props.message.content ? (openBlock(), createBlock(_sfc_main$i, {
6498
6551
  key: 2,
6499
6552
  content: __props.message.content
@@ -6633,7 +6686,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
6633
6686
  class: "fv-msg-action",
6634
6687
  disabled: __props.branch.index <= 1,
6635
6688
  "aria-label": "\u4E0A\u4E00\u5206\u652F",
6636
- onClick: _cache[3] || (_cache[3] = ($event) => onBranch("prev"))
6689
+ onClick: _cache[4] || (_cache[4] = ($event) => onBranch("prev"))
6637
6690
  }, {
6638
6691
  default: withCtx(() => [
6639
6692
  createVNode(unref(ElIcon), null, {
@@ -6660,7 +6713,7 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
6660
6713
  class: "fv-msg-action",
6661
6714
  disabled: __props.branch.index >= __props.branch.count,
6662
6715
  "aria-label": "\u4E0B\u4E00\u5206\u652F",
6663
- onClick: _cache[4] || (_cache[4] = ($event) => onBranch("next"))
6716
+ onClick: _cache[5] || (_cache[5] = ($event) => onBranch("next"))
6664
6717
  }, {
6665
6718
  default: withCtx(() => [
6666
6719
  createVNode(unref(ElIcon), null, {
package/lib/index.js CHANGED
@@ -4549,7 +4549,10 @@
4549
4549
  class: "fv-chain-dot"
4550
4550
  };
4551
4551
  const _hoisted_3$9 = { class: "fv-chain-main" };
4552
- const _hoisted_4$8 = { class: "fv-chain-title-text" };
4552
+ const _hoisted_4$8 = {
4553
+ key: 1,
4554
+ class: "fv-chain-title-text"
4555
+ };
4553
4556
  const _hoisted_5$4 = ["aria-label", "onClick"];
4554
4557
  const _hoisted_6$3 = {
4555
4558
  key: 0,
@@ -4567,8 +4570,10 @@
4567
4570
  direction: { type: String, required: false, default: "vertical" },
4568
4571
  collapsible: { type: Boolean, required: false, default: false }
4569
4572
  },
4570
- setup(__props) {
4573
+ emits: ["typing"],
4574
+ setup(__props, { emit: __emit }) {
4571
4575
  const props = __props;
4576
+ const emit = __emit;
4572
4577
  function statusClass(status) {
4573
4578
  return status ? `status-${status}` : "status-pending";
4574
4579
  }
@@ -4576,6 +4581,36 @@
4576
4581
  function normalizeTitle(title) {
4577
4582
  return title ? title.replace(/\n{2,}/g, "\n") : "";
4578
4583
  }
4584
+ const typedKeys = vue.ref(/* @__PURE__ */ new Set());
4585
+ const doneKeys = vue.ref(/* @__PURE__ */ new Set());
4586
+ const typingConfigs = vue.ref(/* @__PURE__ */ new Map());
4587
+ function markTyped(key, typing) {
4588
+ if (!typedKeys.value.has(key)) typedKeys.value = new Set(typedKeys.value).add(key);
4589
+ if (typing) {
4590
+ const next = new Map(typingConfigs.value);
4591
+ next.set(key, typing);
4592
+ typingConfigs.value = next;
4593
+ }
4594
+ }
4595
+ function markDone(key) {
4596
+ if (!doneKeys.value.has(key)) doneKeys.value = new Set(doneKeys.value).add(key);
4597
+ }
4598
+ vue.watch(() => props.items, (items) => {
4599
+ for (const it of items) if (it.typing) markTyped(it.key, it.typing);
4600
+ }, { immediate: true, deep: true });
4601
+ function typingOf(item) {
4602
+ return typingConfigs.value.get(item.key) ?? true;
4603
+ }
4604
+ function isTypingItem(item) {
4605
+ if (item.typing) {
4606
+ return !(item.closed && doneKeys.value.has(item.key));
4607
+ }
4608
+ return typedKeys.value.has(item.key) && !doneKeys.value.has(item.key);
4609
+ }
4610
+ function onTypeFinish(key) {
4611
+ markDone(key);
4612
+ void vue.nextTick(measure);
4613
+ }
4579
4614
  const titleEls = /* @__PURE__ */ new Map();
4580
4615
  const overflowKeys = vue.ref(/* @__PURE__ */ new Set());
4581
4616
  const clampLens = vue.ref(/* @__PURE__ */ new Map());
@@ -4647,6 +4682,7 @@
4647
4682
  if (props.collapsible) {
4648
4683
  titleEls.forEach((el, key) => {
4649
4684
  if (expandedKeys.value.has(key)) return;
4685
+ if (isTypingKey(key)) return;
4650
4686
  const n = computeClamp(key, el);
4651
4687
  if (n === null) return;
4652
4688
  if (n < fullTitle(key).length) {
@@ -4658,6 +4694,10 @@
4658
4694
  overflowKeys.value = nextOverflow;
4659
4695
  clampLens.value = nextLens;
4660
4696
  }
4697
+ function isTypingKey(key) {
4698
+ const item = props.items.find((i) => i.key === key);
4699
+ return !!item && isTypingItem(item);
4700
+ }
4661
4701
  function showToggle(key) {
4662
4702
  return overflowKeys.value.has(key) || expandedKeys.value.has(key);
4663
4703
  }
@@ -4756,7 +4796,7 @@
4756
4796
  /* STABLE */
4757
4797
  })) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$9))
4758
4798
  ]),
4759
- vue.createCommentVNode(" \u5185\u5BB9:#content \u4F5C\u7528\u57DF\u63D2\u69FD\u8986\u76D6\u9ED8\u8BA4 title/description;\r\n title \u8FDE\u7EED\u6362\u884C\u5408\u5E76\u4E3A\u4E00\u4E2A;collapsible \u5F00\u542F\u65F6\u8D85 3 \u884C\u622A\u65AD,\u56FE\u6807\u6309\u94AE\u62FC\u5728\u7B2C\u4E09\u884C\u6587\u5B57\u672B "),
4799
+ vue.createCommentVNode(" \u5185\u5BB9:#content \u4F5C\u7528\u57DF\u63D2\u69FD\u8986\u76D6\u9ED8\u8BA4 title/description;\r\n title \u8FDE\u7EED\u6362\u884C\u5408\u5E76\u4E3A\u4E00\u4E2A;collapsible \u5F00\u542F\u65F6\u8D85 3 \u884C\u622A\u65AD,\u56FE\u6807\u6309\u94AE\u62FC\u5728\u7B2C\u4E09\u884C\u6587\u5B57\u672B;\r\n \u601D\u8003\u6587\u6848\u6B65\u6D41\u5F0F\u671F\u95F4\u7ECF Typewriter \u9010\u5B57\u6253\u51FA(\u4E0E\u6B63\u6587\u540C\u6B3E),\u56DE\u843D\u65F6\u673A\u89C1 isTypingItem "),
4760
4800
  vue.createElementVNode("div", _hoisted_3$9, [
4761
4801
  vue.renderSlot(_ctx.$slots, "content", {
4762
4802
  item,
@@ -4771,15 +4811,21 @@
4771
4811
  },
4772
4812
  [
4773
4813
  vue.createCommentVNode(" \u622A\u65AD\u7531 JS \u6D4B\u91CF(displayTitle \u524D\u7F00\u539F\u6587):\u6309\u94AE\u4E3A\u5185\u8054\u5143\u7D20\u81EA\u7136\u7D27\u8DDF\r\n \u7B2C\u4E09\u884C\u6587\u5B57\u672B(\u6536\u8D77)/\u5168\u91CF\u672B\u5B57(\u5C55\u5F00);\u65E0\u5E03\u5C40\u73AF\u5883\u4E0D\u88C1\u4E0D\u663E\u6309\u94AE "),
4774
- vue.createElementVNode(
4814
+ isTypingItem(item) ? (vue.openBlock(), vue.createBlock(_sfc_main$h, {
4815
+ key: 0,
4816
+ content: normalizeTitle(item.title),
4817
+ typing: typingOf(item),
4818
+ onWriting: _cache[0] || (_cache[0] = ($event) => emit("typing")),
4819
+ onFinish: ($event) => onTypeFinish(item.key)
4820
+ }, null, 8, ["content", "typing", "onFinish"])) : (vue.openBlock(), vue.createElementBlock(
4775
4821
  "span",
4776
4822
  _hoisted_4$8,
4777
4823
  vue.toDisplayString(displayTitle(item.title, item.key)),
4778
4824
  1
4779
4825
  /* TEXT */
4780
- ),
4826
+ )),
4781
4827
  __props.collapsible && showToggle(item.key) ? (vue.openBlock(), vue.createElementBlock("button", {
4782
- key: 0,
4828
+ key: 2,
4783
4829
  type: "button",
4784
4830
  class: "fv-chain-expand",
4785
4831
  "aria-label": expandedKeys.value.has(item.key) ? "\u6536\u8D77" : "\u5C55\u5F00",
@@ -6348,7 +6394,13 @@ ${fileParts.join("\n")}` });
6348
6394
  const running = props.message.status === "pending" || props.message.status === "streaming";
6349
6395
  return steps.map((s) => {
6350
6396
  if (s.kind === "text") {
6351
- return { ...s, status: void 0, icon: textStepIcon, class: "is-text" };
6397
+ return {
6398
+ ...s,
6399
+ status: void 0,
6400
+ icon: textStepIcon,
6401
+ class: "is-text",
6402
+ ...running && useTypewriter.value ? { typing: props.typing } : {}
6403
+ };
6352
6404
  }
6353
6405
  if (running) {
6354
6406
  const loading = s.status !== "error" && s.status !== "success";
@@ -6472,7 +6524,7 @@ ${fileParts.join("\n")}` });
6472
6524
  !isUser.value && (hasToolSteps.value || hasReasoning.value) ? (vue.openBlock(), vue.createBlock(_sfc_main$a, {
6473
6525
  key: 2,
6474
6526
  modelValue: toolsExpanded.value,
6475
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => toolsExpanded.value = $event),
6527
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => toolsExpanded.value = $event),
6476
6528
  status: hasToolSteps.value ? toolThinkingStatus.value : thinkingStatus.value,
6477
6529
  "auto-collapse": false,
6478
6530
  class: "fv-msg-tools"
@@ -6481,13 +6533,14 @@ ${fileParts.join("\n")}` });
6481
6533
  hasToolSteps.value ? (vue.openBlock(), vue.createBlock(_sfc_main$9, {
6482
6534
  key: 0,
6483
6535
  items: toolChainItems.value,
6484
- collapsible: __props.collapsible
6536
+ collapsible: __props.collapsible,
6537
+ onTyping: _cache[0] || (_cache[0] = ($event) => emit("typing"))
6485
6538
  }, null, 8, ["items", "collapsible"])) : hasReasoning.value && useTypewriter.value ? (vue.openBlock(), vue.createBlock(_sfc_main$h, {
6486
6539
  key: 1,
6487
6540
  content: __props.message.reasoning ?? "",
6488
6541
  "is-markdown": "",
6489
6542
  typing: __props.typing,
6490
- onWriting: _cache[0] || (_cache[0] = ($event) => emit("typing"))
6543
+ onWriting: _cache[1] || (_cache[1] = ($event) => emit("typing"))
6491
6544
  }, null, 8, ["content", "typing"])) : hasReasoning.value ? (vue.openBlock(), vue.createBlock(_sfc_main$i, {
6492
6545
  key: 2,
6493
6546
  content: __props.message.reasoning ?? ""
@@ -6509,7 +6562,7 @@ ${fileParts.join("\n")}` });
6509
6562
  content: __props.message.content,
6510
6563
  "is-markdown": "",
6511
6564
  typing: __props.typing,
6512
- onWriting: _cache[2] || (_cache[2] = ($event) => emit("typing"))
6565
+ onWriting: _cache[3] || (_cache[3] = ($event) => emit("typing"))
6513
6566
  }, null, 8, ["content", "typing"])) : __props.message.content ? (vue.openBlock(), vue.createBlock(_sfc_main$i, {
6514
6567
  key: 2,
6515
6568
  content: __props.message.content
@@ -6649,7 +6702,7 @@ ${fileParts.join("\n")}` });
6649
6702
  class: "fv-msg-action",
6650
6703
  disabled: __props.branch.index <= 1,
6651
6704
  "aria-label": "\u4E0A\u4E00\u5206\u652F",
6652
- onClick: _cache[3] || (_cache[3] = ($event) => onBranch("prev"))
6705
+ onClick: _cache[4] || (_cache[4] = ($event) => onBranch("prev"))
6653
6706
  }, {
6654
6707
  default: vue.withCtx(() => [
6655
6708
  vue.createVNode(vue.unref(elementPlus.ElIcon), null, {
@@ -6676,7 +6729,7 @@ ${fileParts.join("\n")}` });
6676
6729
  class: "fv-msg-action",
6677
6730
  disabled: __props.branch.index >= __props.branch.count,
6678
6731
  "aria-label": "\u4E0B\u4E00\u5206\u652F",
6679
- onClick: _cache[4] || (_cache[4] = ($event) => onBranch("next"))
6732
+ onClick: _cache[5] || (_cache[5] = ($event) => onBranch("next"))
6680
6733
  }, {
6681
6734
  default: vue.withCtx(() => [
6682
6735
  vue.createVNode(vue.unref(elementPlus.ElIcon), null, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fv-ui/ai-chat",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "基于 Vue3 + Element Plus 的 AI 对话组件库",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",