diff options
author | Tyler Schicke <tyler_schicke@brown.edu> | 2019-05-02 01:31:03 -0400 |
---|---|---|
committer | Tyler Schicke <tyler_schicke@brown.edu> | 2019-05-02 01:31:03 -0400 |
commit | eebe58b47acfe3b13c22407b98763cdbd6e1eb58 (patch) | |
tree | e2e6d0e9ffd6b74c9b0e70ba190a33cf3cbc7732 /src | |
parent | be3719bbbede85b4dd099f436b4f7d3bade157cb (diff) |
"Fixed" proto access issue
This is actually cause by import order, which I didn't really fix yet but which needs to be fixed
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/DocumentView.tsx | 4 | ||||
-rw-r--r-- | src/new_fields/Doc.ts | 5 | ||||
-rw-r--r-- | src/new_fields/List.ts | 2 | ||||
-rw-r--r-- | src/new_fields/Schema.ts | 2 | ||||
-rw-r--r-- | src/new_fields/Types.ts | 2 |
5 files changed, 7 insertions, 8 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index b35d68c4b..f58dc4a02 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -198,9 +198,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu CollectionDockingView.Instance.AddRightSplit(kvp); } fullScreenClicked = (e: React.MouseEvent): void => { - const doc = Doc.MakeDelegate(FieldValue(this.props.Document.proto)); - // bcz .. should this work? - // const doc = Doc.MakeDelegate(FieldValue(this.Document.proto)); + const doc = Doc.MakeDelegate(FieldValue(this.Document.proto)); if (doc) { CollectionDockingView.Instance.OpenFullScreen(doc); } diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 6162b3c76..8dd293f2d 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -9,7 +9,7 @@ import { listSpec } from "./Schema"; import { List } from "./List"; import { ObjectField, Parent, OnUpdate } from "./ObjectField"; import { RefField, FieldId, Id, HandleUpdate } from "./RefField"; -import { Docs } from "../client/documents/Documents"; +// import { Docs } from "../client/documents/Documents"; export function IsField(field: any): field is Field { return (typeof field === "string") @@ -183,7 +183,8 @@ export namespace Doc { export function MakeLink(source: Doc, target: Doc) { UndoManager.RunInBatch(() => { - let linkDoc = Docs.TextDocument({ width: 100, height: 30, borderRounding: -1 }); + // let linkDoc = Docs.TextDocument({ width: 100, height: 30, borderRounding: -1 }); + let linkDoc = new Doc; linkDoc.title = "-link name-"; linkDoc.linkDescription = ""; linkDoc.linkTags = "Default"; diff --git a/src/new_fields/List.ts b/src/new_fields/List.ts index ff10a3f73..1c4b96c81 100644 --- a/src/new_fields/List.ts +++ b/src/new_fields/List.ts @@ -2,7 +2,7 @@ import { Deserializable, autoObject } from "../client/util/SerializationHelper"; import { Field, Update, Self, FieldResult } from "./Doc"; import { setter, getter, deleteProperty } from "./util"; import { serializable, alias, list } from "serializr"; -import { observable, observe, IArrayChange, IArraySplice, IObservableArray, Lambda, reaction } from "mobx"; +import { observable } from "mobx"; import { ObjectField, OnUpdate, Copy } from "./ObjectField"; import { RefField } from "./RefField"; import { ProxyField } from "./Proxy"; diff --git a/src/new_fields/Schema.ts b/src/new_fields/Schema.ts index 7444878fe..b821baec9 100644 --- a/src/new_fields/Schema.ts +++ b/src/new_fields/Schema.ts @@ -10,7 +10,7 @@ export const emptySchema = createSchema({}); export const Document = makeInterface(emptySchema); export type Document = makeInterface<[typeof emptySchema]>; -export type makeInterface<T extends Interface[]> = Partial<AllToInterface<T>> & Doc; +export type makeInterface<T extends Interface[]> = Partial<AllToInterface<T>> & Doc & { proto: Doc | undefined }; // export function makeInterface<T extends Interface[], U extends Doc>(schemas: T): (doc: U) => All<T, U>; // export function makeInterface<T extends Interface, U extends Doc>(schema: T): (doc: U) => makeInterface<T, U>; export function makeInterface<T extends Interface[]>(...schemas: T): (doc?: Doc) => makeInterface<T> { diff --git a/src/new_fields/Types.ts b/src/new_fields/Types.ts index e179c2602..60f08dc90 100644 --- a/src/new_fields/Types.ts +++ b/src/new_fields/Types.ts @@ -18,7 +18,7 @@ export type ToConstructor<T extends Field> = new (...args: any[]) => T; export type ToInterface<T extends Interface> = { - [P in keyof T]: FieldResult<ToType<T[P]>>; + [P in Exclude<keyof T, "proto">]: FieldResult<ToType<T[P]>>; }; // type ListSpec<T extends Field[]> = { List: ToContructor<Head<T>> | ListSpec<Tail<T>> }; |