|
|
@@ -24,19 +24,19 @@ type Props = CodeMirrorEditorProps & {
|
|
|
user?: IUserHasId,
|
|
|
pageId?: string,
|
|
|
initialValue?: string,
|
|
|
- isEditorMode: boolean,
|
|
|
+ enableCollaboration?: boolean,
|
|
|
onEditorsUpdated?: (userList: IUserHasId[]) => void,
|
|
|
}
|
|
|
|
|
|
export const CodeMirrorEditorMain = (props: Props): JSX.Element => {
|
|
|
const {
|
|
|
- user, pageId, initialValue, isEditorMode, cmProps,
|
|
|
+ user, pageId, initialValue, enableCollaboration = false, cmProps,
|
|
|
onSave, onEditorsUpdated, ...otherProps
|
|
|
} = props;
|
|
|
|
|
|
const { data: codeMirrorEditor } = useCodeMirrorEditorIsolated(GlobalCodeMirrorEditorKey.MAIN);
|
|
|
|
|
|
- useCollaborativeEditorMode(isEditorMode, user, pageId, initialValue, onEditorsUpdated, codeMirrorEditor);
|
|
|
+ useCollaborativeEditorMode(enableCollaboration, user, pageId, initialValue, onEditorsUpdated, codeMirrorEditor);
|
|
|
|
|
|
// setup additional extensions
|
|
|
useEffect(() => {
|