Question about Copy and Paste

For Paste Icon , Additional click needs to be performed in New Tab -
I have copied a notation in one tab and i wanted to paste it in another tab without clicking on canvas. This is my requirement. I tried to get the solution for it. Can any one help on it?

What tabs are you referring to?

i am referring design tabs.
image

Are you referring to the two step process of pasting? The keyboard shortcut initiates pasting, you can then click somewhere on the canvas to paste the elements.You can skip the second step if you provide a position for the elements to be pasted at:

const targetElement = elementRegistry.get('Process_1');

copyPaste.paste({
  element: targetElement,
  point: { x: 100, y: 100 }
});

Source: https://github.com/bpmn-io/diagram-js/blob/develop/lib/features/copy-paste/CopyPaste.js#L230

You’d have to override the editor action that triggers pasting when the keyboard shortcut is used: https://github.com/bpmn-io/diagram-js/blob/develop/lib/features/editor-actions/EditorActions.js#L98

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

Could you please provide an example how to override the editorActions.js file

Actually i want to write the below higlighted logic ,

when the x & y co ordinates are undefined

`
if (mouseTracking && copyPaste) {
this.register(‘paste’, function () {
var context = mouseTracking.getHoverContext();

  if (isNaN(context.point.x)) {
    context.point.x = 200;
  }

  if (isNaN(context.point.y)) {
    context.point.y = 100;
  }
  copyPaste.paste(context);
});

}
`