forked from alibaba/lowcode-plugins
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.tsx
More file actions
58 lines (54 loc) · 1.47 KB
/
index.tsx
File metadata and controls
58 lines (54 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import * as React from 'react';
import { IPublicModelPluginContext } from '@alilc/lowcode-types';
import PluginSchema from './editor';
import { enUS, zhCN } from './locale';
const plugin = (ctx: IPublicModelPluginContext, options: any) => {
return {
// 插件的初始化函数,在引擎初始化之后会立刻调用
init() {
const { intl, intlNode, getLocale } = ctx.common.utils.createIntl({
'en-US': enUS,
'zh-CN': zhCN,
});
ctx.intl = intl;
ctx.intlNode = intlNode;
ctx.getLocale = getLocale;
const isProjectSchema = (options && options['isProjectSchema']) === true;
// 往引擎增加面板
ctx.skeleton.add({
area: 'leftArea',
name: 'LowcodePluginAliLowcodePluginSchema',
type: 'PanelDock',
props: {
align: 'bottom',
icon: 'ellipsis',
description: 'Schema',
},
panelProps: {
width: 'calc(100% - 50px)',
},
content: () => (
<PluginSchema
pluginContext={ctx}
showProjectSchema={isProjectSchema}
/>
),
})
},
};
};
plugin.pluginName = 'LowcodePluginAliLowcodePluginSchema';
plugin.meta = {
preferenceDeclaration: {
title: 'schema 面板配置',
properties: [
{
key: 'isProjectSchema',
type: 'boolean',
description: '是否是项目级 schema',
default: false,
},
],
},
};
export default plugin;