mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-24 18:49:40 +00:00
Merge commit '87b57ab4f1edee7b2efffab132f39d0049a6d027' into def_releases_2021081610154444_ali-lowcode_ali-lowcode-engine/1.0.63
This commit is contained in:
commit
15bc705e56
@ -55,6 +55,10 @@ export interface EngineOptions {
|
|||||||
* 打开画布的锁定操作,默认值:false
|
* 打开画布的锁定操作,默认值:false
|
||||||
*/
|
*/
|
||||||
enableCanvasLock: boolean;
|
enableCanvasLock: boolean;
|
||||||
|
/**
|
||||||
|
* 当选中节点切换时,是否停留在相同的设置 tab 上,默认值:false
|
||||||
|
*/
|
||||||
|
stayOnTheSameSettingTab: boolean;
|
||||||
/**
|
/**
|
||||||
* Vision-polyfill settings
|
* Vision-polyfill settings
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Tab, Breadcrumb } from '@alifd/next';
|
import { Tab, Breadcrumb } from '@alifd/next';
|
||||||
import { Title, observer, Editor, obx, globalContext } from '@ali/lowcode-editor-core';
|
import { Title, observer, Editor, obx, globalContext, engineConfig } from '@ali/lowcode-editor-core';
|
||||||
import { Node, isSettingField, SettingField, Designer } from '@ali/lowcode-designer';
|
import { Node, isSettingField, SettingField, Designer } from '@ali/lowcode-designer';
|
||||||
import { SettingsMain } from './main';
|
import { SettingsMain } from './main';
|
||||||
import { SettingsPane } from './settings-pane';
|
import { SettingsPane } from './settings-pane';
|
||||||
@ -24,7 +24,9 @@ export class SettingsPrimaryPane extends Component<{ editor: Editor; config: any
|
|||||||
this.setShouldIgnoreRoot();
|
this.setShouldIgnoreRoot();
|
||||||
|
|
||||||
this.props.editor.on('designer.selection.change', () => {
|
this.props.editor.on('designer.selection.change', () => {
|
||||||
this._activeKey = null;
|
if (!engineConfig.get('stayOnTheSameSettingTab', false)) {
|
||||||
|
this._activeKey = null;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -175,7 +175,10 @@ plugins.register((ctx: ILowCodePluginContext) => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
let engineInited = false;
|
||||||
export async function init(container?: HTMLElement, options?: EngineOptions) {
|
export async function init(container?: HTMLElement, options?: EngineOptions) {
|
||||||
|
if (engineInited) return;
|
||||||
|
engineInited = true;
|
||||||
let engineOptions = null;
|
let engineOptions = null;
|
||||||
let engineContainer = null;
|
let engineContainer = null;
|
||||||
if (isPlainObject(container)) {
|
if (isPlainObject(container)) {
|
||||||
|
|||||||
@ -29,6 +29,11 @@ export function reactFindDOMNodes(elem: ReactInstance | null): Array<Element | T
|
|||||||
}
|
}
|
||||||
const elements: Array<Element | Text> = [];
|
const elements: Array<Element | Text> = [];
|
||||||
const fiberNode = (elem as any)[FIBER_KEY];
|
const fiberNode = (elem as any)[FIBER_KEY];
|
||||||
elementsFromFiber(fiberNode.child, elements);
|
elementsFromFiber(fiberNode?.child, elements);
|
||||||
return elements.length > 0 ? elements : [findDOMNode(elem)];
|
if (elements.length > 0) return elements;
|
||||||
|
try {
|
||||||
|
return [findDOMNode(elem)];
|
||||||
|
} catch (e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user