@incremark/chat-vue 0.4.0-alpha.2 → 1.0.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.
|
@@ -34,3 +34,5 @@ export { Welcome } from './welcome';
|
|
|
34
34
|
export type { WelcomeProps } from './welcome';
|
|
35
35
|
export { MessageList } from './message-list';
|
|
36
36
|
export type { MessageListProps, MessageListExposed } from './message-list';
|
|
37
|
+
export { IncremarkCode, IncremarkContent } from '@incremark/vue';
|
|
38
|
+
export type { ComponentMap, IncremarkContentProps } from '@incremark/vue';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { Component } from 'vue';
|
|
5
5
|
import type { TextPart } from '@incremark/chat-core';
|
|
6
|
-
import type { UseIncremarkOptions } from '@incremark/vue';
|
|
6
|
+
import type { UseIncremarkOptions, ComponentMap } from '@incremark/vue';
|
|
7
7
|
/**
|
|
8
8
|
* 代码块配置
|
|
9
9
|
*/
|
|
@@ -21,6 +21,8 @@ export interface TextMessageProps {
|
|
|
21
21
|
streaming?: boolean;
|
|
22
22
|
/** Incremark 渲染选项 */
|
|
23
23
|
incremarkOptions?: UseIncremarkOptions;
|
|
24
|
+
/** 覆盖 Incremark 默认的节点类型渲染组件 */
|
|
25
|
+
components?: ComponentMap;
|
|
24
26
|
/** 自定义容器组件映射 */
|
|
25
27
|
customContainers?: Record<string, Component>;
|
|
26
28
|
/** 自定义代码块组件映射 */
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { Icon } from '@iconify/vue';
|
|
|
4
4
|
import { offset, flip, shift, arrow, useFloating, autoUpdate } from '@floating-ui/vue';
|
|
5
5
|
import { onClickOutside } from '@vueuse/core';
|
|
6
6
|
import { IncremarkContent, AutoScrollContainer } from '@incremark/vue';
|
|
7
|
+
export { IncremarkCode, IncremarkContent } from '@incremark/vue';
|
|
7
8
|
import { TOOL_CALL_STATES } from '@incremark/chat-core';
|
|
8
9
|
import { useEditor, EditorContent } from '@tiptap/vue-3';
|
|
9
10
|
import { Document } from '@tiptap/extension-document';
|
|
@@ -613,6 +614,7 @@ var text_message_default = /* @__PURE__ */ defineComponent({
|
|
|
613
614
|
part: { type: null, required: true },
|
|
614
615
|
streaming: { type: Boolean, required: false, default: false },
|
|
615
616
|
incremarkOptions: { type: null, required: false },
|
|
617
|
+
components: { type: null, required: false },
|
|
616
618
|
customContainers: { type: Object, required: false },
|
|
617
619
|
customCodeBlocks: { type: Object, required: false },
|
|
618
620
|
codeBlockConfigs: { type: Object, required: false },
|
|
@@ -648,11 +650,12 @@ function render7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
648
650
|
content: $props.part.content,
|
|
649
651
|
"is-finished": !$props.streaming,
|
|
650
652
|
"incremark-options": $setup.incremarkOptions,
|
|
653
|
+
components: $props.components,
|
|
651
654
|
"custom-containers": $props.customContainers,
|
|
652
655
|
"custom-code-blocks": $props.customCodeBlocks,
|
|
653
656
|
"code-block-configs": $props.codeBlockConfigs,
|
|
654
657
|
"pending-class": $props.pendingClass
|
|
655
|
-
}, null, 8, ["content", "is-finished", "incremark-options", "custom-containers", "custom-code-blocks", "code-block-configs", "pending-class"])) : (openBlock(), createElementBlock(
|
|
658
|
+
}, null, 8, ["content", "is-finished", "incremark-options", "components", "custom-containers", "custom-code-blocks", "code-block-configs", "pending-class"])) : (openBlock(), createElementBlock(
|
|
656
659
|
Fragment,
|
|
657
660
|
{ key: 1 },
|
|
658
661
|
[
|