json-joy
Version:
Collection of libraries for building collaborative editing apps.
44 lines (43 loc) • 1.49 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.DebugState = void 0;
const sync_store_1 = require("../../../../util/events/sync-store");
class DebugState {
constructor() {
this.enabled = new sync_store_1.ValueSyncStore(false);
this.showSliceOutlines = new sync_store_1.ValueSyncStore(true);
this.showSliceInfo = new sync_store_1.ValueSyncStore(true);
this.showCursorInfo = new sync_store_1.ValueSyncStore(true);
}
toggleDebugMode() {
const { enabled, showSliceOutlines, showSliceInfo, showCursorInfo } = this;
if (!enabled.value) {
enabled.next(true);
showSliceOutlines.next(true);
showSliceInfo.next(true);
showCursorInfo.next(true);
}
else {
if (showSliceOutlines.value) {
showSliceOutlines.next(false);
}
else if (showSliceInfo.value) {
showSliceInfo.next(false);
}
else if (showCursorInfo.value) {
showCursorInfo.next(false);
}
else {
enabled.next(false);
showSliceOutlines.next(true);
showSliceInfo.next(true);
showCursorInfo.next(true);
}
}
}
/** ------------------------------------------- {@link UiLifeCycles} */
start() {
return () => { };
}
}
exports.DebugState = DebugState;
;