import { Extension } from '@tiptap/core'; /** * TipTap extension that opens links in a new tab when the user * holds Ctrl (Windows/Linux) or Cmd (Mac) while clicking. * * Without a modifier key, clicking a link selects it for editing * (standard editor behaviour). This mirrors the UX pattern used by * Google Docs, Notion, and other rich-text editors. * * How it works: * 1. A ProseMirror plugin registers a `handleClick` prop. * 2. On every click the handler checks for the modifier key. * 3. If modifier is held, it resolves the document position to find * a `link` mark and reads its `href` attribute. * 4. The URL is opened in a new tab with `noopener,noreferrer` for security. * 5. The event is consumed (`return true`) to prevent the editor * from also acting on the click. * * Requires `@tiptap/extension-link` to be registered so that the * `link` mark type exists in the schema. * * @see https://github.com/ueberdosis/tiptap/issues/3389 */ declare const openLinkOnModClickExtension: Extension; export default openLinkOnModClickExtension;