1 |
|
2 |
|
3 | import { NotebookModel } from './model';
|
4 |
|
5 |
|
6 |
|
7 | export class NotebookModelFactory {
|
8 | |
9 |
|
10 |
|
11 | constructor(options = {}) {
|
12 | var _a, _b;
|
13 | this._disposed = false;
|
14 | this._disableDocumentWideUndoRedo =
|
15 | (_a = options.disableDocumentWideUndoRedo) !== null && _a !== void 0 ? _a : true;
|
16 | this._collaborative = (_b = options.collaborative) !== null && _b !== void 0 ? _b : true;
|
17 | }
|
18 | |
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | get disableDocumentWideUndoRedo() {
|
25 | return this._disableDocumentWideUndoRedo;
|
26 | }
|
27 | set disableDocumentWideUndoRedo(disableDocumentWideUndoRedo) {
|
28 | this._disableDocumentWideUndoRedo = disableDocumentWideUndoRedo;
|
29 | }
|
30 | |
31 |
|
32 |
|
33 | get name() {
|
34 | return 'notebook';
|
35 | }
|
36 | |
37 |
|
38 |
|
39 | get contentType() {
|
40 | return 'notebook';
|
41 | }
|
42 | |
43 |
|
44 |
|
45 | get fileFormat() {
|
46 | return 'json';
|
47 | }
|
48 | |
49 |
|
50 |
|
51 | get collaborative() {
|
52 | return this._collaborative;
|
53 | }
|
54 | |
55 |
|
56 |
|
57 | get isDisposed() {
|
58 | return this._disposed;
|
59 | }
|
60 | |
61 |
|
62 |
|
63 | dispose() {
|
64 | this._disposed = true;
|
65 | }
|
66 | |
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 | createNew(options = {}) {
|
74 | return new NotebookModel({
|
75 | languagePreference: options.languagePreference,
|
76 | sharedModel: options.sharedModel,
|
77 | collaborationEnabled: options.collaborationEnabled && this.collaborative,
|
78 | disableDocumentWideUndoRedo: this._disableDocumentWideUndoRedo
|
79 | });
|
80 | }
|
81 | |
82 |
|
83 |
|
84 | preferredLanguage(path) {
|
85 | return '';
|
86 | }
|
87 | }
|
88 |
|
\ | No newline at end of file |