forked from 77media/video-flow
优化文本框对话解析
This commit is contained in:
parent
47a85428f5
commit
aee30ee881
@ -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
|
||||
]
|
||||
};
|
||||
|
||||
@ -171,7 +171,7 @@ export const ShotsEditor = forwardRef<any, ShotsEditorProps>(function ShotsEdito
|
||||
avatar: ''
|
||||
}
|
||||
},
|
||||
{ type: 'text', text: ' says:' }
|
||||
{ type: 'readonlyText', attrs: { text: ':' } }
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user