File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
examples/07-collaboration/01-partykit Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -30,5 +30,12 @@ export default function App() {
30
30
} ) ;
31
31
32
32
// Renders the editor instance.
33
- return < BlockNoteView editor = { editor } /> ;
33
+ return (
34
+ < BlockNoteView
35
+ editor = { editor }
36
+ onChange = { ( e , { getChanges } ) => {
37
+ console . log ( getChanges ( ) ) ;
38
+ } }
39
+ />
40
+ ) ;
34
41
}
Original file line number Diff line number Diff line change @@ -87,7 +87,15 @@ export type BlockChangeSource =
87
87
/**
88
88
* When an event is triggered by a remote user, the source is "remote".
89
89
*/
90
- type : "remote" ;
90
+ type : "yjs-remote" ;
91
+ /**
92
+ * Whether the change is from this client or another client.
93
+ */
94
+ isChangeOrigin : boolean ;
95
+ /**
96
+ * Whether the change is an undo or redo operation.
97
+ */
98
+ isUndoRedoOperation : boolean ;
91
99
} ;
92
100
93
101
export type BlocksChanged <
@@ -147,7 +155,11 @@ export function getBlocksChangedByTransaction<
147
155
type : transaction . getMeta ( "history$" ) . redo ? "redo" : "undo" ,
148
156
} ;
149
157
} else if ( transaction . getMeta ( "y-sync$" ) ) {
150
- source = { type : "remote" } ;
158
+ source = {
159
+ type : "yjs-remote" ,
160
+ isChangeOrigin : transaction . getMeta ( "y-sync$" ) . isChangeOrigin ,
161
+ isUndoRedoOperation : transaction . getMeta ( "y-sync$" ) . isUndoRedoOperation ,
162
+ } ;
151
163
}
152
164
153
165
const changes : BlocksChanged < BSchema , ISchema , SSchema > = [ ] ;
You can’t perform that action at this time.
0 commit comments