* feat: New table of contents * fix: Hide TOC in edit mode * feat: Highlight follows scroll position * scroll tracking * UI * fix: Unrelated css fix with long doc titles * Improve responsiveness * feat: Add keyboard shortcut access to TOC * fix: Headings should reflect content correctly when viewing old document revision * flow * fix: Persist TOC choice between sessions
22 lines
423 B
JavaScript
22 lines
423 B
JavaScript
// @flow
|
|
import { computed } from 'mobx';
|
|
import getHeadingsForText from 'shared/utils/getHeadingsForText';
|
|
import BaseModel from './BaseModel';
|
|
import User from './User';
|
|
|
|
class Revision extends BaseModel {
|
|
id: string;
|
|
documentId: string;
|
|
title: string;
|
|
text: string;
|
|
createdAt: string;
|
|
createdBy: User;
|
|
|
|
@computed
|
|
get headings() {
|
|
return getHeadingsForText(this.text);
|
|
}
|
|
}
|
|
|
|
export default Revision;
|