mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-04-20 04:18:05 +00:00
merge general-demo
This commit is contained in:
commit
26d16e7abc
@ -1,15 +1,13 @@
|
|||||||
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
|
||||||
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
|
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
|
||||||
|
|
||||||
|
|
||||||
module.exports = ({ onGetWebpackConfig }) => {
|
module.exports = ({ onGetWebpackConfig }) => {
|
||||||
onGetWebpackConfig((config) => {
|
onGetWebpackConfig((config) => {
|
||||||
config.resolve
|
config.resolve.plugin('tsconfigpaths').use(TsconfigPathsPlugin, [
|
||||||
.plugin('tsconfigpaths')
|
{
|
||||||
.use(TsconfigPathsPlugin, [{
|
configFile: './tsconfig.json',
|
||||||
configFile: "./tsconfig.json"
|
},
|
||||||
}]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
config
|
config
|
||||||
// 定义插件名称
|
// 定义插件名称
|
||||||
|
|||||||
@ -65,6 +65,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
align: 'top',
|
align: 'top',
|
||||||
icon: 'zujianku',
|
icon: 'zujianku',
|
||||||
|
description: '资源面板',
|
||||||
panelProps: {
|
panelProps: {
|
||||||
floatable: true,
|
floatable: true,
|
||||||
defaultWidth: 500,
|
defaultWidth: 500,
|
||||||
|
|||||||
47
packages/demo/src/editor/editor.ts
Normal file
47
packages/demo/src/editor/editor.ts
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import { globalContext, Editor } from '@ali/lowcode-editor-core';
|
||||||
|
import { Designer, addBuiltinComponentAction } from '@ali/lowcode-designer';
|
||||||
|
import Outline from '@ali/lowcode-plugin-outline-pane';
|
||||||
|
|
||||||
|
import DesignerPlugin from '@ali/lowcode-plugin-designer';
|
||||||
|
import { Skeleton, SettingsPrimaryPane } from '@ali/lowcode-editor-skeleton';
|
||||||
|
|
||||||
|
import { InstanceNodeSelector } from './components';
|
||||||
|
|
||||||
|
export const editor = new Editor();
|
||||||
|
globalContext.register(editor, Editor);
|
||||||
|
|
||||||
|
export const skeleton = new Skeleton(editor);
|
||||||
|
editor.set(Skeleton, skeleton);
|
||||||
|
|
||||||
|
export const designer = new Designer({ editor: editor });
|
||||||
|
editor.set(Designer, designer);
|
||||||
|
|
||||||
|
skeleton.add({
|
||||||
|
area: 'mainArea',
|
||||||
|
name: 'designer',
|
||||||
|
type: 'Widget',
|
||||||
|
content: DesignerPlugin,
|
||||||
|
});
|
||||||
|
skeleton.add({
|
||||||
|
area: 'rightArea',
|
||||||
|
name: 'settingsPane',
|
||||||
|
type: 'Panel',
|
||||||
|
content: SettingsPrimaryPane,
|
||||||
|
});
|
||||||
|
skeleton.add({
|
||||||
|
area: 'leftArea',
|
||||||
|
name: 'outlinePane',
|
||||||
|
type: 'PanelDock',
|
||||||
|
content: Outline,
|
||||||
|
panelProps: {
|
||||||
|
area: 'leftFixedArea',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// 实例节点选择器,线框高亮
|
||||||
|
addBuiltinComponentAction({
|
||||||
|
name: 'instance-node-selector',
|
||||||
|
content: InstanceNodeSelector,
|
||||||
|
important: true,
|
||||||
|
condition: 'always',
|
||||||
|
});
|
||||||
@ -6,8 +6,4 @@ import './global.scss';
|
|||||||
|
|
||||||
const LCE_CONTAINER = document.getElementById('lce-container');
|
const LCE_CONTAINER = document.getElementById('lce-container');
|
||||||
|
|
||||||
if (!LCE_CONTAINER) {
|
|
||||||
throw new Error('当前页面不存在 <div id="lce-container"></div> 节点.');
|
|
||||||
}
|
|
||||||
|
|
||||||
render(<GeneralWorkbench config={config} components={components} />, LCE_CONTAINER);
|
render(<GeneralWorkbench config={config} components={components} />, LCE_CONTAINER);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user