editor: export & use AttributeUpdate interface

Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
01zulfi
2026-01-01 15:23:27 +05:00
parent 50666c1307
commit b881b236a0
2 changed files with 3 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ import { Step, StepResult } from "@tiptap/pm/transform";
import { Node, Schema, Fragment } from "@tiptap/pm/model";
import { Mapping } from "@tiptap/pm/transform";
interface AttributeUpdate {
export interface AttributeUpdate {
pos: number;
attrName: string;
value: any;

View File

@@ -30,7 +30,7 @@ import {
changedDescendants,
findParentNodeOfTypeClosestToPos
} from "../../utils/prosemirror.js";
import { BatchAttributeStep } from "./batch-attribute-step.js";
import { AttributeUpdate, BatchAttributeStep } from "./batch-attribute-step.js";
const COLLAPSIBLE_BLOCK_TYPES = [
"paragraph",
@@ -318,7 +318,7 @@ function toggleNodesUnderPos(
let shouldMoveCursor = false;
let insideCollapsedHeading = false;
let nestedHeadingLevel: number | null = null;
const updates: { pos: number; attrName: string; value: any }[] = [];
const updates: AttributeUpdate[] = [];
while (nextPos < doc.content.size) {
const nextNode = doc.nodeAt(nextPos);