mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
Merge branch 'release/1.0.24' of gitlab.alibaba-inc.com:ali-lowcode/ali-lowcode-engine into release/1.0.24
This commit is contained in:
commit
aa69f5be8f
@ -277,13 +277,14 @@ export class ComponentMeta {
|
||||
return true;
|
||||
}
|
||||
|
||||
checkNestingDown(my: Node, target: Node | NodeSchema) {
|
||||
checkNestingDown(my: Node, target: Node | NodeSchema | NodeSchema[]) {
|
||||
// 检查父子关系,直接约束型,在画布中拖拽直接掠过目标容器
|
||||
if (this.childWhitelist) {
|
||||
if (!isNode(target)) {
|
||||
target = new Node(my.document, target);
|
||||
}
|
||||
return this.childWhitelist(target, my);
|
||||
const _target: any = !Array.isArray(target) ? [target] : target;
|
||||
return _target.every((item: Node | NodeSchema) => {
|
||||
const _item = !isNode(item) ? new Node(my.document, item) : item;
|
||||
return this.childWhitelist && this.childWhitelist(_item, my);
|
||||
});
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@ hotkey.bind(['command+v', 'ctrl+v'], (e) => {
|
||||
}
|
||||
clipboard.waitPasteData(e, ({ componentsTree }) => {
|
||||
if (componentsTree) {
|
||||
const { target, index } = designer.getSuitableInsertion() || {};
|
||||
const { target, index } = designer.getSuitableInsertion(componentsTree) || {};
|
||||
if (!target) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -295,7 +295,7 @@ export class Designer {
|
||||
/**
|
||||
* 获得合适的插入位置
|
||||
*/
|
||||
getSuitableInsertion(insertNode?: Node | NodeSchema): { target: ParentalNode; index?: number } | null {
|
||||
getSuitableInsertion(insertNode?: Node | NodeSchema | NodeSchema[]): { target: ParentalNode; index?: number } | null {
|
||||
const activedDoc = this.project.currentDocument;
|
||||
if (!activedDoc) {
|
||||
return null;
|
||||
|
||||
@ -4,15 +4,15 @@
|
||||
"build-plugin-component",
|
||||
{
|
||||
"filename": "editor-preset-general",
|
||||
"library": "LowcodeEditor",
|
||||
"library": "AliLowCodeEngine",
|
||||
"libraryTarget": "umd",
|
||||
"externals": {
|
||||
"react": "var window.React",
|
||||
"react-dom": "var window.ReactDOM",
|
||||
"prop-types": "var window.PropTypes",
|
||||
"monaco-editor/esm/vs/editor/editor.api":"var window.monaco",
|
||||
"monaco-editor/esm/vs/editor/editor.main.js":"var window.monaco"
|
||||
|
||||
"@alifd/next": "var window.Next",
|
||||
"@ali/visualengine": "var window.VisualEngine",
|
||||
"@ali/visualengine-utils": "var window.VisualEngineUtils"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { render } from 'react-dom';
|
||||
import { createElement } from 'react';
|
||||
import '@ali/lowcode-editor-setters';
|
||||
import builtinSetters from '@ali/lowcode-editor-setters';
|
||||
import DesignerPlugin from '@ali/lowcode-plugin-designer';
|
||||
import { Designer, LiveEditing } from '@ali/lowcode-designer';
|
||||
import { globalContext, Editor } from '@ali/lowcode-editor-core';
|
||||
import { OutlineBackupPane, getTreeMaster } from '@ali/lowcode-plugin-outline-pane';
|
||||
import { globalContext, Editor, registerSetter } from '@ali/lowcode-editor-core';
|
||||
import { OutlinePane, OutlineBackupPane, getTreeMaster } from '@ali/lowcode-plugin-outline-pane';
|
||||
import { Workbench, Skeleton, SettingsPrimaryPane, registerDefaults } from '@ali/lowcode-editor-skeleton';
|
||||
|
||||
import { version } from '../package.json';
|
||||
@ -16,6 +16,8 @@ export * from '@ali/lowcode-editor-core';
|
||||
export * from '@ali/lowcode-editor-skeleton';
|
||||
export * from '@ali/lowcode-designer';
|
||||
|
||||
registerSetter(builtinSetters);
|
||||
|
||||
export const editor = new Editor();
|
||||
globalContext.register(editor, Editor);
|
||||
|
||||
@ -28,6 +30,21 @@ export const designer = new Designer({ editor });
|
||||
editor.set(Designer, designer);
|
||||
editor.set('designer', designer);
|
||||
|
||||
skeleton.add({
|
||||
area: 'leftArea',
|
||||
name: 'outline',
|
||||
type: 'PanelDock',
|
||||
props: {
|
||||
align: 'top',
|
||||
icon: 'shuxingkongjian',
|
||||
description: '大纲树',
|
||||
},
|
||||
panelProps: {
|
||||
area: 'leftFixedArea',
|
||||
},
|
||||
contentProps: {},
|
||||
content: OutlinePane,
|
||||
});
|
||||
skeleton.add({
|
||||
area: 'mainArea',
|
||||
name: 'designer',
|
||||
@ -52,12 +69,15 @@ skeleton.add({
|
||||
content: OutlineBackupPane,
|
||||
});
|
||||
|
||||
export default function GeneralWorkbench(props: any) {
|
||||
export function GeneralWorkbench(props: any) {
|
||||
return createElement(Workbench, {
|
||||
skeleton,
|
||||
...props,
|
||||
});
|
||||
}
|
||||
|
||||
export default GeneralWorkbench;
|
||||
|
||||
window.__ctx = {
|
||||
editor,
|
||||
appHelper: editor,
|
||||
|
||||
@ -18,7 +18,7 @@ export interface IconProps {
|
||||
|
||||
export function SVGIcon({
|
||||
fill,
|
||||
size = 'medium',
|
||||
size = 'large',
|
||||
viewBox,
|
||||
style,
|
||||
children,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user