@@ -660,7 +660,7 @@ export class YBaseCell<Metadata extends nbformat.IBaseCellMetadata>
660
660
events : Y . YEvent < any > [ ] ,
661
661
transaction : Y . Transaction
662
662
) => {
663
- if ( transaction . origin !== 'modeldb ' ) {
663
+ if ( transaction . origin !== 'silent-change ' ) {
664
664
this . _changed . emit ( this . getChanges ( events ) ) ;
665
665
}
666
666
} ;
@@ -771,27 +771,28 @@ export class YCodeCell
771
771
772
772
createOutputs ( outputs : Array < nbformat . IOutput > ) : Array < Y . Map < any > > {
773
773
const newOutputs : Array < Y . Map < any > > = [ ] ;
774
- for ( const output of outputs ) {
775
- let _newOutput : { [ id : string ] : any } ;
776
- const newOutput = new Y . Map ( ) ;
774
+ for ( const output of JSONExt . deepCopy ( outputs ) ) {
775
+ let _newOutput1 : { [ id : string ] : any } ;
777
776
if ( output . output_type === 'stream' ) {
778
777
// Set the text field as a Y.Text
779
778
const { text, ...outputWithoutText } = output ;
780
- _newOutput = outputWithoutText ;
779
+ _newOutput1 = outputWithoutText ;
781
780
const newText = new Y . Text ( ) ;
782
781
let length = 0 ;
783
782
// text is a list of strings
784
783
for ( const str of text as string [ ] ) {
785
784
newText . insert ( length , str ) ;
786
785
length += str . length ;
787
786
}
788
- _newOutput [ 'text' ] = newText ;
787
+ _newOutput1 [ 'text' ] = newText ;
789
788
} else {
790
- _newOutput = output ;
789
+ _newOutput1 = output ;
791
790
}
792
- for ( const [ key , value ] of Object . entries ( _newOutput ) ) {
793
- newOutput . set ( key , value ) ;
791
+ const _newOutput2 : [ string , any ] [ ] = [ ] ;
792
+ for ( const [ key , value ] of Object . entries ( _newOutput1 ) ) {
793
+ _newOutput2 . push ( [ key , value ] ) ;
794
794
}
795
+ const newOutput = new Y . Map ( _newOutput2 ) ;
795
796
newOutputs . push ( newOutput ) ;
796
797
}
797
798
return newOutputs ;
0 commit comments