LinkContextMenu

A context menu for hyperlink operations (edit, copy, remove).

Constructor

new LinkContextMenu(x, y, callbacks)

Parameters:
NameTypeDescription
xnumberPreferred left position in viewport pixels.
ynumberPreferred top position in viewport pixels.
callbacksobjectCallback functions for menu actions.
Properties
NameTypeAttributesDescription
onEditfunction<optional>
Called when "Edit link" is clicked.
onCopyfunction<optional>
Called when "Copy link" is clicked.
onRemovefunction<optional>
Called when "Remove link" is clicked.
onDismissfunction<optional>
Called when the menu is dismissed.
infoObject | null<optional>
Info widget config passed to the base ContextMenu.
Example
new LinkContextMenu(event.clientX, event.clientY, {
  onEdit:    () => openEditDialog(linkId),
  onCopy:    () => navigator.clipboard.writeText(url),
  onRemove:  () => removeLink(linkId),
  onDismiss: () => {},
});

Classes

LinkContextMenu