mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-09 01:18:50 +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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
checkNestingDown(my: Node, target: Node | NodeSchema) {
|
checkNestingDown(my: Node, target: Node | NodeSchema | NodeSchema[]) {
|
||||||
// 检查父子关系,直接约束型,在画布中拖拽直接掠过目标容器
|
// 检查父子关系,直接约束型,在画布中拖拽直接掠过目标容器
|
||||||
if (this.childWhitelist) {
|
if (this.childWhitelist) {
|
||||||
if (!isNode(target)) {
|
const _target: any = !Array.isArray(target) ? [target] : target;
|
||||||
target = new Node(my.document, target);
|
return _target.every((item: Node | NodeSchema) => {
|
||||||
}
|
const _item = !isNode(item) ? new Node(my.document, item) : item;
|
||||||
return this.childWhitelist(target, my);
|
return this.childWhitelist && this.childWhitelist(_item, my);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -151,7 +151,7 @@ hotkey.bind(['command+v', 'ctrl+v'], (e) => {
|
|||||||
}
|
}
|
||||||
clipboard.waitPasteData(e, ({ componentsTree }) => {
|
clipboard.waitPasteData(e, ({ componentsTree }) => {
|
||||||
if (componentsTree) {
|
if (componentsTree) {
|
||||||
const { target, index } = designer.getSuitableInsertion() || {};
|
const { target, index } = designer.getSuitableInsertion(componentsTree) || {};
|
||||||
if (!target) {
|
if (!target) {
|
||||||
return;
|
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;
|
const activedDoc = this.project.currentDocument;
|
||||||
if (!activedDoc) {
|
if (!activedDoc) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -4,15 +4,15 @@
|
|||||||
"build-plugin-component",
|
"build-plugin-component",
|
||||||
{
|
{
|
||||||
"filename": "editor-preset-general",
|
"filename": "editor-preset-general",
|
||||||
"library": "LowcodeEditor",
|
"library": "AliLowCodeEngine",
|
||||||
"libraryTarget": "umd",
|
"libraryTarget": "umd",
|
||||||
"externals": {
|
"externals": {
|
||||||
"react": "var window.React",
|
"react": "var window.React",
|
||||||
"react-dom": "var window.ReactDOM",
|
"react-dom": "var window.ReactDOM",
|
||||||
"prop-types": "var window.PropTypes",
|
"prop-types": "var window.PropTypes",
|
||||||
"monaco-editor/esm/vs/editor/editor.api":"var window.monaco",
|
"@alifd/next": "var window.Next",
|
||||||
"monaco-editor/esm/vs/editor/editor.main.js":"var window.monaco"
|
"@ali/visualengine": "var window.VisualEngine",
|
||||||
|
"@ali/visualengine-utils": "var window.VisualEngineUtils"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
import { render } from 'react-dom';
|
import { render } from 'react-dom';
|
||||||
import { createElement } from 'react';
|
import { createElement } from 'react';
|
||||||
import '@ali/lowcode-editor-setters';
|
import builtinSetters from '@ali/lowcode-editor-setters';
|
||||||
import DesignerPlugin from '@ali/lowcode-plugin-designer';
|
import DesignerPlugin from '@ali/lowcode-plugin-designer';
|
||||||
import { Designer, LiveEditing } from '@ali/lowcode-designer';
|
import { Designer, LiveEditing } from '@ali/lowcode-designer';
|
||||||
import { globalContext, Editor } from '@ali/lowcode-editor-core';
|
import { globalContext, Editor, registerSetter } from '@ali/lowcode-editor-core';
|
||||||
import { OutlineBackupPane, getTreeMaster } from '@ali/lowcode-plugin-outline-pane';
|
import { OutlinePane, OutlineBackupPane, getTreeMaster } from '@ali/lowcode-plugin-outline-pane';
|
||||||
import { Workbench, Skeleton, SettingsPrimaryPane, registerDefaults } from '@ali/lowcode-editor-skeleton';
|
import { Workbench, Skeleton, SettingsPrimaryPane, registerDefaults } from '@ali/lowcode-editor-skeleton';
|
||||||
|
|
||||||
import { version } from '../package.json';
|
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-editor-skeleton';
|
||||||
export * from '@ali/lowcode-designer';
|
export * from '@ali/lowcode-designer';
|
||||||
|
|
||||||
|
registerSetter(builtinSetters);
|
||||||
|
|
||||||
export const editor = new Editor();
|
export const editor = new Editor();
|
||||||
globalContext.register(editor, Editor);
|
globalContext.register(editor, Editor);
|
||||||
|
|
||||||
@ -28,6 +30,21 @@ export const designer = new Designer({ editor });
|
|||||||
editor.set(Designer, designer);
|
editor.set(Designer, designer);
|
||||||
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({
|
skeleton.add({
|
||||||
area: 'mainArea',
|
area: 'mainArea',
|
||||||
name: 'designer',
|
name: 'designer',
|
||||||
@ -52,12 +69,15 @@ skeleton.add({
|
|||||||
content: OutlineBackupPane,
|
content: OutlineBackupPane,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default function GeneralWorkbench(props: any) {
|
export function GeneralWorkbench(props: any) {
|
||||||
return createElement(Workbench, {
|
return createElement(Workbench, {
|
||||||
skeleton,
|
skeleton,
|
||||||
...props,
|
...props,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default GeneralWorkbench;
|
||||||
|
|
||||||
window.__ctx = {
|
window.__ctx = {
|
||||||
editor,
|
editor,
|
||||||
appHelper: editor,
|
appHelper: editor,
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export interface IconProps {
|
|||||||
|
|
||||||
export function SVGIcon({
|
export function SVGIcon({
|
||||||
fill,
|
fill,
|
||||||
size = 'medium',
|
size = 'large',
|
||||||
viewBox,
|
viewBox,
|
||||||
style,
|
style,
|
||||||
children,
|
children,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user