forked from opentiny/tiny-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregistry.js
More file actions
190 lines (185 loc) · 6.58 KB
/
Copy pathregistry.js
File metadata and controls
190 lines (185 loc) · 6.58 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
/* eslint-disable no-undef */
import {
Breadcrumb,
Fullscreen,
Lang,
ViewSetting,
// Logo,
Lock,
Media,
Redoundo,
Save,
Clean,
ThemeSwitch,
Preview,
GenerateCode,
Upload,
Refresh,
Collaboration,
Materials,
State,
Script,
Tree,
Help,
Schema,
Page,
I18n,
Bridge,
Block,
Datasource,
Robot,
Resource,
ModelManager,
Props,
Events,
Styles,
Layout,
Canvas,
GenerateCodeService,
GlobalService,
ThemeSwitchService,
HttpService,
McpService,
User,
ApplicationCenter,
TemplateCenter
} from './re-export'
const isDevelopEnv = import.meta.env.MODE?.includes('dev')
const useAuth = import.meta.env.VITE_AUTH === 'true'
window.__TINY_ENGINE_REMOVED_REGISTRY = {}
export default {
root: {
id: 'engine.root',
metas: [HttpService, GenerateCodeService, GlobalService, ThemeSwitchService, McpService] // GlobalService 依赖 HttpService,HttpService需要在前面处理
},
config: {
id: 'engine.config',
// TODO: 主题支持传入主题 package 或者是 url。
theme: 'light',
// 物料链接
material: [],
// 画布依赖的 script、styles 链接。TODO: 解耦后添加默认 tinyvue 的链接
canvasDependencies: {
styles: [],
scripts: []
},
dslMode: 'Vue',
platformId: 1,
// TODO: 声明周期相关配置拆分到页面管理的配置项里面
// 生命周期函数
lifeCyclesOptions: {
Angular: [
'_constructor_',
'ngOnInit',
'ngOnChanges',
'ngDoCheck',
'ngAfterContentInit',
'ngAfterContentChecked',
'ngAfterViewInit',
'ngAfterViewChecked',
'ngOnDestroy'
],
Vue: [
'setup',
'onBeforeMount',
'onMounted',
'onBeforeUpdate',
'onUpdated',
'onBeforeUnmount',
'onUnmounted',
'onErrorCaptured',
'onActivated',
'onDeactivated'
],
HTML: [],
React: [
'componentWillMount',
'componentDidMount',
'componentWillReceiveProps',
'shouldComponentUpdate',
'componentWillUpdate',
'componentDidUpdate',
'componentWillUnmount'
]
},
// 生命周期使用提示
lifeCycleTips: {
Vue: '通过Vue解构出来的方法都可以在setup这里使用,比如watch、computed、watchEffect等'
},
themesList: [
{
id: 'engine.theme.light',
text: '浅色主题',
type: 'light',
icon: 'light',
oppositeTheme: 'dark'
},
{
id: 'engine.theme.dark',
text: '深色主题',
type: 'dark',
icon: 'dark',
oppositeTheme: 'light'
}
],
enableTailwindCSS: true,
enableLogin: useAuth || !isDevelopEnv
},
layout: __TINY_ENGINE_REMOVED_REGISTRY['engine.layout'] === false ? null : Layout,
toolbars: [
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.themeSwitch'] === false ? null : ThemeSwitch,
//__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.logo'] === false ? null : Logo,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.breadcrumb'] === false ? null : Breadcrumb,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.lock'] === false ? null : Lock,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.media'] === false ? null : Media,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.redoundo'] === false ? null : Redoundo,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.collaboration'] === false ? null : Collaboration,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.clean'] === false ? null : Clean,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.preview'] === false ? null : Preview,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.refresh'] === false ? null : Refresh,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.generate-code'] === false ? null : GenerateCode,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.upload'] === false ? null : Upload,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.save'] === false ? null : Save,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.fullscreen'] === false ? null : Fullscreen,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.lang'] === false ? null : Lang,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.viewSetting'] === false ? null : ViewSetting,
__TINY_ENGINE_REMOVED_REGISTRY['engine.toolbars.user'] === false ? null : User
],
plugins: [
__TINY_ENGINE_REMOVED_REGISTRY['engine.plugins.materials'] === false ? null : Materials,
__TINY_ENGINE_REMOVED_REGISTRY['engine.plugins.outlinetree'] === false ? null : Tree,
__TINY_ENGINE_REMOVED_REGISTRY['engine.plugins.appmanage'] === false ? null : Page,
__TINY_ENGINE_REMOVED_REGISTRY['engine.plugins.blockmanage'] === false ? null : Block,
__TINY_ENGINE_REMOVED_REGISTRY['engine.plugins.collections'] === false ? null : Datasource,
__TINY_ENGINE_REMOVED_REGISTRY['engine.plugins.bridge'] === false ? null : Bridge,
__TINY_ENGINE_REMOVED_REGISTRY['engine.plugins.i18n'] === false ? null : I18n,
__TINY_ENGINE_REMOVED_REGISTRY['engine.plugins.pagecontroller'] === false ? null : Script,
__TINY_ENGINE_REMOVED_REGISTRY['engine.plugins.state'] === false ? null : State,
__TINY_ENGINE_REMOVED_REGISTRY['engine.plugins.schema'] === false ? null : Schema,
__TINY_ENGINE_REMOVED_REGISTRY['engine.plugins.editorhelp'] === false ? null : Help,
__TINY_ENGINE_REMOVED_REGISTRY['engine.plugins.robot'] === false ? null : Robot,
__TINY_ENGINE_REMOVED_REGISTRY['engine.plugins.resource'] === false ? null : Resource,
__TINY_ENGINE_REMOVED_REGISTRY['engine.plugins.modelmanager'] === false ? null : ModelManager
],
settings: [
__TINY_ENGINE_REMOVED_REGISTRY['engine.setting.props'] === false ? null : Props,
__TINY_ENGINE_REMOVED_REGISTRY['engine.setting.styles'] === false ? null : Styles,
__TINY_ENGINE_REMOVED_REGISTRY['engine.setting.event'] === false ? null : Events
],
workspace: [
__TINY_ENGINE_REMOVED_REGISTRY['engine.workspace.application-center'] === false ? null : ApplicationCenter,
__TINY_ENGINE_REMOVED_REGISTRY['engine.workspace.template-center'] === false ? null : TemplateCenter
],
canvas: Canvas
}