@@ -3,17 +3,18 @@ import { useState, useRef, useCallback, useEffect, useLayoutEffect } from 'react
33import MonacoEditor from '@alilc/lowcode-plugin-base-monaco-editor' ;
44
55import { Dialog , Message , Button } from '@alifd/next' ;
6- import { IPublicApiProject , IPublicApiSkeleton , IPublicEnumTransformStage } from '@alilc/lowcode-types' ;
6+ import { IPublicEnumTransformStage , IPublicModelPluginContext } from '@alilc/lowcode-types' ;
77import { IEditorInstance } from '@alilc/lowcode-plugin-base-monaco-editor/lib/helper' ;
88
99interface PluginCodeDiffProps {
10- project : IPublicApiProject ;
11- skeleton : IPublicApiSkeleton ;
10+ pluginContext : IPublicModelPluginContext ;
1211 // 是否显示项目级 schema
1312 showProjectSchema : boolean ;
1413}
1514
16- export default function PluginSchema ( { project, skeleton, showProjectSchema = false } : PluginCodeDiffProps ) {
15+ export default function PluginSchema ( { pluginContext, showProjectSchema = false } : PluginCodeDiffProps ) {
16+ const { project, skeleton } = pluginContext ;
17+
1718 const [ editorSize , setEditorSize ] = useState ( { width : 0 , height : 0 } ) ;
1819 const [ schemaValue , setSchemaValue ] = useState ( ( ) => {
1920 const schema = project . exportSchema ( IPublicEnumTransformStage . Save ) ;
@@ -82,7 +83,7 @@ export default function PluginSchema({ project, skeleton, showProjectSchema = fa
8283 onClick = { onSave }
8384 style = { { position : 'absolute' , right : 68 , zIndex : 100 , top : - 38 } }
8485 >
85- 保存 Schema
86+ { pluginContext . intl ( 'Save Schema' ) }
8687 </ Button >
8788 < MonacoEditor
8889 height = { editorSize . height }
0 commit comments