UNPKG

@atlaskit/editor-plugin-mentions

Version:

Mentions plugin for @atlaskit/editor-core

19 lines (18 loc) 900 B
import type { DocNode } from '@atlaskit/adf-schema'; import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model'; /** * Returns the direct parent content of an inserted agent mention as prompt ADF. * * The chat input supports only a subset of editor inline ADF, so this keeps prompt content * intentionally narrow: * - `text`, `inlineCard`, and `hardBreak` pass through unchanged. * - people mentions pass through unchanged. * - only the invoked agent mention is kept, identified by `localId`; other agent mentions are dropped. * - `status` becomes its label text. * - `date` becomes ISO date text. * - everything else is dropped. * * This only reads direct parent content. It does not recursively pull content out of nested or * unsupported nodes. */ export declare const getAgentMentionParentContext: (parentNode: PMNode, agentMentionLocalId?: string | null) => DocNode;