UNPKG

collaborative-ui

Version:

React component library for building real-time collaborative editing applications.

30 lines (29 loc) 1.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.JsonCrdtModelState = void 0; const rxjs_1 = require("rxjs"); const JsonBlockState_1 = require("../JsonBlock/JsonBlockState"); class JsonCrdtModelState { constructor() { this.showModel$ = new rxjs_1.BehaviorSubject(true); this.showDisplay$ = new rxjs_1.BehaviorSubject(true); this.showView$ = new rxjs_1.BehaviorSubject(false); this.showDisplayOutlines$ = new rxjs_1.BehaviorSubject(false); this.viewState = new JsonBlockState_1.JsonBlockState(); this.modelView$ = new rxjs_1.BehaviorSubject('interactive'); this.readonly$ = new rxjs_1.BehaviorSubject(false); this.toggleShowModel = () => { this.showModel$.next(!this.showModel$.getValue()); }; this.toggleShowView = () => { this.showView$.next(!this.showView$.getValue()); }; this.toggleShowDisplay = () => { this.showDisplay$.next(!this.showDisplay$.getValue()); }; this.setModelView = (view) => { this.modelView$.next(view); }; } } exports.JsonCrdtModelState = JsonCrdtModelState;