mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-02-09 07:35:38 +00:00
25 lines
581 B
TypeScript
25 lines
581 B
TypeScript
import { Node } from '@ali/lowcode-designer';
|
|
import { designer } from './editor';
|
|
|
|
export default {
|
|
select: (node: Node) => {
|
|
if (!node) {
|
|
return designer.currentSelection?.clear();
|
|
}
|
|
designer.currentSelection?.select(node.id);
|
|
},
|
|
getSelected: () => {
|
|
const nodes = designer.currentSelection?.getNodes();
|
|
return nodes?.[0];
|
|
},
|
|
/**
|
|
* TODO dirty fix
|
|
*/
|
|
onIntoView(func: (node: any, insertion: any) => any) {
|
|
// this.emitter.on('intoview', func);
|
|
return () => {
|
|
// this.emitter.removeListener('intoview', func);
|
|
};
|
|
}
|
|
}
|