MCPcopy
hub / github.com/alibaba/lowcode-engine / action

Function action

packages/engine/src/inner-plugins/default-context-menu.ts:77–90  ·  view source on GitHub ↗
(nodes)

Source from the content-addressed store, hash-verified

75 return nodes?.length === 1;
76 },
77 action(nodes) {
78 const node = nodes?.[0];
79 if (!node) {
80 return;
81 }
82 const { document: doc, parent, index } = node;
83 const data = getNodesSchema(nodes);
84 clipboard.setData(data);
85
86 if (parent) {
87 const newNode = doc?.insertNode(parent, node, (index ?? 0) + 1, true);
88 newNode?.select();
89 }
90 },
91 });
92
93 material.addContextMenuOption({

Callers

nothing calls this directly

Calls 13

getNodesSchemaFunction · 0.85
getClipboardTextFunction · 0.85
pushMethod · 0.80
setDataMethod · 0.65
insertNodeMethod · 0.65
selectMethod · 0.65
filterMethod · 0.65
checkNestingMethod · 0.65
errorMethod · 0.65
mapMethod · 0.65
forEachMethod · 0.65
selectAllMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…