@fv-ui/ai-chat 0.9.0 → 0.9.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/es/index.mjs CHANGED
@@ -6099,9 +6099,15 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
6099
6099
  });
6100
6100
  const hasReasoning = computed(() => !!props.message.reasoning);
6101
6101
  const hasToolSteps = computed(() => (props.message.toolSteps?.length ?? 0) > 0);
6102
- const useTypewriter = computed(
6103
- () => !isUser.value && !!props.typing && (props.message.status === "pending" || props.message.status === "streaming")
6102
+ const wasStreaming = ref(false);
6103
+ watch(
6104
+ () => props.message.status,
6105
+ (s) => {
6106
+ if (s === "pending" || s === "streaming") wasStreaming.value = true;
6107
+ },
6108
+ { immediate: true }
6104
6109
  );
6110
+ const useTypewriter = computed(() => !isUser.value && !!props.typing && wasStreaming.value);
6105
6111
  const toolChainItems = computed(() => {
6106
6112
  const steps = props.message.toolSteps ?? [];
6107
6113
  const running = props.message.status === "pending" || props.message.status === "streaming";
package/lib/index.js CHANGED
@@ -6115,9 +6115,15 @@ ${fileParts.join("\n")}` });
6115
6115
  });
6116
6116
  const hasReasoning = vue.computed(() => !!props.message.reasoning);
6117
6117
  const hasToolSteps = vue.computed(() => (props.message.toolSteps?.length ?? 0) > 0);
6118
- const useTypewriter = vue.computed(
6119
- () => !isUser.value && !!props.typing && (props.message.status === "pending" || props.message.status === "streaming")
6118
+ const wasStreaming = vue.ref(false);
6119
+ vue.watch(
6120
+ () => props.message.status,
6121
+ (s) => {
6122
+ if (s === "pending" || s === "streaming") wasStreaming.value = true;
6123
+ },
6124
+ { immediate: true }
6120
6125
  );
6126
+ const useTypewriter = vue.computed(() => !isUser.value && !!props.typing && wasStreaming.value);
6121
6127
  const toolChainItems = vue.computed(() => {
6122
6128
  const steps = props.message.toolSteps ?? [];
6123
6129
  const running = props.message.status === "pending" || props.message.status === "streaming";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fv-ui/ai-chat",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "基于 Vue3 + Element Plus 的 AI 对话组件库",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",