// 添加到 EditorProps
{
shortcuts(shortcutsRegistry, ctx) {
// 按住 cmmand + a,选中所有节点
shortcutsRegistry.addHandlers({
commandId: 'selectAll',
shortcuts: ['meta a', 'ctrl a'],
isEnabled: (...args) => true,
execute(...args) {
const allNodes = ctx.document.getAllNodes();
ctx.playground.selectionService.selection = allNodes;
},
});
},
}