diff --git a/app/service/adapter/textToShot.ts b/app/service/adapter/textToShot.ts index 6315f72..6de8cf2 100644 --- a/app/service/adapter/textToShot.ts +++ b/app/service/adapter/textToShot.ts @@ -25,8 +25,16 @@ interface HighlightNode { attrs: HighlightAttributes; } +// 定义只读文本节点接口 +interface ReadonlyTextNode { + type: 'readonlyText'; + attrs: { + text: string; + }; +} + // 定义内容节点类型(文本或角色标记) -type ContentNode = TextNode | CharacterTokenNode | HighlightNode; +type ContentNode = TextNode | CharacterTokenNode | HighlightNode | ReadonlyTextNode; // 定义段落接口 interface Paragraph { @@ -217,6 +225,12 @@ export class TextToShotAdapter { attrs: { ...roleMatch }}, + { + type: 'readonlyText', + attrs: { + text: ':' + } + }, ...dialogNodes ] }; diff --git a/components/ui/shot-editor/ShotsEditor.tsx b/components/ui/shot-editor/ShotsEditor.tsx index 4d80bf2..a670393 100644 --- a/components/ui/shot-editor/ShotsEditor.tsx +++ b/components/ui/shot-editor/ShotsEditor.tsx @@ -171,7 +171,7 @@ export const ShotsEditor = forwardRef(function ShotsEdito avatar: '' } }, - { type: 'text', text: ' says:' } + { type: 'readonlyText', attrs: { text: ':' } } ] };