mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 12:12:54 +01:00
editor: export & use AttributeUpdate interface
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user