@@ -31,7 +31,7 @@ export type AgentStep = {
3131export function getStepsAsAgent ( inputTr : Transform ) {
3232 const pmSchema = getPmSchema ( inputTr ) ;
3333
34- const { modification } = pmSchema . marks ;
34+ const modification = pmSchema . marks [ "y-attributed-format" ] ;
3535
3636 const agentSteps : AgentStep [ ] = [ ] ;
3737
@@ -188,9 +188,13 @@ export function getStepsAsAgent(inputTr: Transform) {
188188 const $pos = tr . doc . resolve ( tr . mapping . map ( from ) ) ;
189189 if ( $pos . nodeAfter ?. isBlock ) {
190190 // mark the entire node as deleted. This can be needed for inline nodes or table cells
191- tr . addNodeMark ( $pos . pos , pmSchema . mark ( "deletion " , { } ) ) ;
191+ tr . addNodeMark ( $pos . pos , pmSchema . mark ( "y-attributed-delete " , { } ) ) ;
192192 }
193- tr . addMark ( $pos . pos , replaceEnd , pmSchema . mark ( "deletion" , { } ) ) ;
193+ tr . addMark (
194+ $pos . pos ,
195+ replaceEnd ,
196+ pmSchema . mark ( "y-attributed-delete" , { } ) ,
197+ ) ;
194198 replaceEnd = tr . mapping . map ( to ) ;
195199 }
196200
@@ -203,7 +207,7 @@ export function getStepsAsAgent(inputTr: Transform) {
203207 tr . replace ( replaceFrom , replaceEnd , replacement ) . addMark (
204208 replaceFrom ,
205209 replaceFrom + replacement . content . size ,
206- pmSchema . mark ( "insertion " , { } ) ,
210+ pmSchema . mark ( "y-attributed-insert " , { } ) ,
207211 ) ;
208212
209213 tr . doc . nodesBetween (
@@ -217,7 +221,7 @@ export function getStepsAsAgent(inputTr: Transform) {
217221 return true ;
218222 }
219223 if ( node . isBlock ) {
220- tr . addNodeMark ( pos , pmSchema . mark ( "insertion " , { } ) ) ;
224+ tr . addNodeMark ( pos , pmSchema . mark ( "y-attributed-insert " , { } ) ) ;
221225 }
222226 return false ;
223227 } ,
0 commit comments