1- import { getNodeFragment } from '@udecode/plate-common' ;
2- import { type Range , Path } from 'slate' ;
1+ import { NodeApi , type Path , PathApi , type Range } from '@udecode/plate' ;
32
43import { findParentCell } from '../queries' ;
54import type { TablesEditor } from '../TablesEditor' ;
@@ -15,14 +14,14 @@ export function withTablesCopyPasteBehavior<T extends TablesEditor>(editor: T):
1514 const [ cell , cellPath ] = cellEntry ;
1615 const { focus, anchor } = editor . selection ;
1716
18- return getNodeFragment ( cell , {
17+ return NodeApi . fragment ( cell , {
1918 anchor : {
2019 offset : anchor . offset ,
21- path : Path . relative ( anchor . path , cellPath ) ,
20+ path : PathApi . relative ( anchor . path , cellPath ) ,
2221 } ,
2322 focus : {
2423 offset : focus . offset ,
25- path : Path . relative ( focus . path , cellPath ) ,
24+ path : PathApi . relative ( focus . path , cellPath ) ,
2625 } ,
2726 } ) ;
2827 }
@@ -35,5 +34,8 @@ export function withTablesCopyPasteBehavior<T extends TablesEditor>(editor: T):
3534}
3635
3736function isRangeInside ( selection : Range , path : Path ) {
38- return Path . isCommon ( path , selection . anchor . path ) && Path . isCommon ( path , selection . focus . path ) ;
37+ return (
38+ PathApi . isCommon ( path , selection . anchor . path ) &&
39+ PathApi . isCommon ( path , selection . focus . path )
40+ ) ;
3941}
0 commit comments