import { PluginKey } from 'prosemirror-state'; /** * SD-3432: invariant guard for note story sessions (footnote/endnote * editing). No top-level paragraph may end a transaction without its note * paragraph style. * * The per-command wrappers (splitBlock, joinBackward, joinForward, * createParagraphNear, liftEmptyBlock) preserve the style on the paths they * cover, but two creators slip through them: * * - createParagraphNear/liftEmptyBlock fired from a gap or node selection: * there is no source paragraph at the selection, so the restore wrapper * has no styleId to stamp and passes the default-attrs paragraph through. * - WebKit DOM-observer reparses: `paragraphProperties` is not rendered to * the DOM (`rendered: false` in the paragraph extension), so a reparse * that crosses a paragraph boundary recreates the paragraph with default * attributes. * * Both depend on async selection sync and mutation batching, which makes the * loss flaky and timing-sensitive. This appendTransaction is the single net * under all of them: any top-level paragraph left without a styleId after a * doc change is re-stamped with the paragraphProperties of its nearest * styled sibling (preferring the previous one, matching Word's continuation * semantics and the restore wrappers' source choice). Nested paragraphs * (e.g. inside tables) keep their own styles and are not touched. * * @param {import('../../core/Editor.js').Editor} editor The owning editor. * @returns {import('prosemirror-state').Plugin} */ export function createNoteStyleGuardPlugin(editor: import('../../core/Editor.js').Editor): import('prosemirror-state').Plugin; export const noteStyleGuardPluginKey: PluginKey; //# sourceMappingURL=noteStyleGuardPlugin.d.ts.map