A client-side `` wrapper that routes chat-rendered links (markdown bodies, source chips, inline references) through the active `ChatRuntime`, applying consistent new-tab logic and panel-close behavior. ## Key Components ### `NavLinkAnchorViaRuntimeProps` | Prop | Type | Description | |---|---|---| | `href` | `string` | Raw link URL | | `path` | `string \| null` | Optional internal path override | | `targetPlatform` | `string \| null` | Platform hint for new-tab resolution | | `className` | `string` | Optional CSS class | | `children` | `ReactNode` | Link content (optional — empty anchors are valid) | ### `NavLinkAnchorViaRuntime` Primary export. Resolves the final href and new-tab decision at runtime, then delegates click handling to shared utilities: - **`resolveHrefForRuntime`** — adapts the raw `href` for the active runtime context - **`computeIsNewTab`** — applies embed-mode short-circuit → `runtime.navigation.decideNewTab` → lib fallback chain - **`newTabAnchorAttrs`** — produces correct `target` / `rel` attributes - **`handleChatNavClick`** — unified click handler shared with source chips and inline cards - **`useChatPanel`** — closes the chat panel on same-tab navigation; leaves it open for new-tab clicks > **Chat-only contract:** Uses `useRequiredChatRuntime`, which **throws** if mounted outside a ``. This is intentional — silent fallback when the runtime is absent is never acceptable. ## Usage Example ```typescript // Inside a chat markdown renderer or source chip import { NavLinkAnchorViaRuntime } from './nav-link-anchor-via-runtime' function ChatMarkdownLink({ href, children }) { return ( {children} ) } ``` > For links **outside** the chat tree (header chrome, marketing pages), use the hub's own `useNavLink`-based anchor instead — this component will throw in those contexts by design. ## Source [`nav-link-anchor-via-runtime.tsx`](https://github.com/flamingo-stack/openframe-oss-lib/blob/main/nav-link-anchor-via-runtime.tsx)