prosemirror-utils
Advanced tools
Comparing version
@@ -208,4 +208,4 @@ // src/selection.ts | ||
// src/selection.ts | ||
var findParentNode = (predicate) => ({ $from, $to }) => { | ||
if (!$from.sameParent($to)) { | ||
var findParentNode = (predicate) => ({ $from, $to }, validateSameParent = false) => { | ||
if (validateSameParent && !$from.sameParent($to)) { | ||
let depth = Math.min($from.depth, $to.depth); | ||
@@ -212,0 +212,0 @@ while (depth >= 0) { |
@@ -208,4 +208,4 @@ // src/selection.ts | ||
// src/selection.ts | ||
var findParentNode = (predicate) => ({ $from, $to }) => { | ||
if (!$from.sameParent($to)) { | ||
var findParentNode = (predicate) => ({ $from, $to }, validateSameParent = false) => { | ||
if (validateSameParent && !$from.sameParent($to)) { | ||
let depth = Math.min($from.depth, $to.depth); | ||
@@ -212,0 +212,0 @@ while (depth >= 0) { |
import type { ResolvedPos } from 'prosemirror-model'; | ||
import { Selection } from 'prosemirror-state'; | ||
import type { FindPredicate, FindResult, DomAtPos, NodeTypeParam } from './types'; | ||
export declare const findParentNode: (predicate: FindPredicate) => ({ $from, $to }: Selection) => FindResult; | ||
export declare const findParentNode: (predicate: FindPredicate) => ({ $from, $to }: Selection, validateSameParent?: boolean) => FindResult; | ||
export declare const findParentNodeClosestToPos: ($pos: ResolvedPos, predicate: FindPredicate) => FindResult; | ||
@@ -6,0 +6,0 @@ export declare const findParentDomRef: (predicate: FindPredicate, domAtPos: DomAtPos) => (selection: Selection) => Node | undefined; |
{ | ||
"name": "prosemirror-utils", | ||
"version": "1.1.8", | ||
"version": "1.2.0", | ||
"description": "Utils library for ProseMirror", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
163373
0.28%