File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -761,6 +761,22 @@ export default {
761761 console .debug (editor .getHTML ())
762762 },
763763
764+ /**
765+ * Helper method to debug yjs issues
766+ */
767+ debugYjs () {
768+ const yjsData = {
769+ clientId: this .$ydoc .clientID ,
770+ pendingStructs: this .$ydoc .store .pendingStructs ,
771+ clientVectors: [],
772+ documentState: this .$syncService .getDocumentState (),
773+ }
774+ for (const client of this .$ydoc .store .clients .values ()) {
775+ yjsData .clientVectors .push (client .at (- 1 ).id )
776+ }
777+ console .debug (' Yjs data' , JSON .stringify (yjsData))
778+ },
779+
764780 outlineToggled (visible ) {
765781 this .emit (' outline-toggled' , visible)
766782 },
Original file line number Diff line number Diff line change @@ -132,6 +132,10 @@ class TextEditorEmbed {
132132 this . #getEditorComponent( ) . $editor . commands . focus ( )
133133 }
134134
135+ debugYjs ( ) {
136+ this . #getEditorComponent( ) . debugYjs ( )
137+ }
138+
135139 #registerDebug( ) {
136140 if ( window ?. _oc_debug ) {
137141 this . vm = this . #vm
You can’t perform that action at this time.
0 commit comments