From c5c7fa9c0b17bbcee582d4fd788d378a2f7cd243 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Sun, 14 Jun 2020 12:54:38 -0500
Subject: adding list and image types

---
 src/client/views/collections/CollectionSchemaView.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 35f892d65..74f31b428 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -20,7 +20,7 @@ import { undoBatch } from "../../util/UndoManager";
 import { COLLECTION_BORDER_WIDTH } from '../../views/globalCssVariables.scss';
 import { ContextMenu } from "../ContextMenu";
 import '../DocumentDecorations.scss';
-import { CellProps, CollectionSchemaCell, CollectionSchemaCheckboxCell, CollectionSchemaDocCell, CollectionSchemaNumberCell, CollectionSchemaStringCell } from "./CollectionSchemaCells";
+import { CellProps, CollectionSchemaCell, CollectionSchemaCheckboxCell, CollectionSchemaDocCell, CollectionSchemaNumberCell, CollectionSchemaStringCell, CollectionSchemaImageCell, CollectionSchemaListCell } from "./CollectionSchemaCells";
 import { CollectionSchemaAddColumnHeader, CollectionSchemaHeader } from "./CollectionSchemaHeaders";
 import { MovableColumn, MovableRow } from "./CollectionSchemaMovableTableHOC";
 import "./CollectionSchemaView.scss";
@@ -40,6 +40,8 @@ export enum ColumnType {
     String,
     Boolean,
     Doc,
+    Image,
+    List
 }
 // this map should be used for keys that should have a const type of value
 const columnTypes: Map<string, ColumnType> = new Map([
@@ -349,6 +351,8 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
                     if (colType === ColumnType.String) return <CollectionSchemaStringCell {...props} />;
                     if (colType === ColumnType.Boolean) return <CollectionSchemaCheckboxCell {...props} />;
                     if (colType === ColumnType.Doc) return <CollectionSchemaDocCell {...props} />;
+                    if (colType === ColumnType.Image) return <CollectionSchemaImageCell {...props} />;
+                    if (colType === ColumnType.List) return <CollectionSchemaListCell {...props} />;
                     return <CollectionSchemaCell {...props} />;
                 },
                 minWidth: 200,
-- 
cgit v1.2.3-70-g09d2


From 46fa52fa85102d30a3e13a93fb191f12e3e28aa1 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Fri, 19 Jun 2020 17:23:33 -0500
Subject: adding open button and slight change to preview in doc

---
 .../views/collections/CollectionSchemaCells.tsx    | 79 ++++++++++++----------
 .../CollectionSchemaMovableTableHOC.tsx            |  2 +
 .../views/collections/CollectionSchemaView.tsx     |  3 +-
 3 files changed, 47 insertions(+), 37 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index cbee848e6..30278db32 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -3,7 +3,7 @@ import { action, observable, trace, computed } from "mobx";
 import { observer } from "mobx-react";
 import { CellInfo } from "react-table";
 import "react-table/react-table.css";
-import { emptyFunction, returnFalse, returnZero, returnOne, returnEmptyFilter, Utils } from "../../../Utils";
+import { emptyFunction, returnFalse, returnZero, returnOne, returnEmptyFilter, Utils, emptyPath } from "../../../Utils";
 import { Doc, DocListCast, Field, Opt } from "../../../fields/Doc";
 import { Id } from "../../../fields/FieldSymbols";
 import { KeyCodes } from "../../util/KeyCodes";
@@ -31,6 +31,7 @@ import { OverlayView } from "../OverlayView";
 import { DocumentIconContainer } from "../nodes/DocumentIcon";
 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
 import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView";
+import ReactDOM from "react-dom";
 const path = require('path');
 
 library.add(faExpand);
@@ -344,7 +345,7 @@ export class CollectionSchemaDocCell extends CollectionSchemaCell {
         addDocTab: this.props.addDocTab,
         pinToPres: this.props.pinToPres,
         ContentScaling: returnOne,
-        docFilters: []
+        docFilters: returnEmptyFilter
     };
     @observable private _field = this.prop.Document[this.prop.fieldKey];
     @observable private _doc = FieldValue(Cast(this._field, Doc));
@@ -388,6 +389,7 @@ export class CollectionSchemaDocCell extends CollectionSchemaCell {
 
     @action
     onOpenClick = () => {
+        this._preview = false;
         if (this._doc) {
             this.prop.addDocTab(this._doc, "onRight");
             return true;
@@ -415,42 +417,45 @@ export class CollectionSchemaDocCell extends CollectionSchemaCell {
 
 
             return (
-                <div className="collectionSchemaView-cellWrapper" ref={this._focusRef} tabIndex={-1} onPointerDown={this.onPointerDown}>
-                    {this._preview ? <ContentFittingDocumentView
-                        Document={this._doc}
-                        DataDoc={this.prop.DataDoc}
-                        NativeHeight={returnZero}
-                        NativeWidth={returnZero}
-                        fitToBox={true}
-                        FreezeDimensions={true}
-                        focus={emptyFunction}
-                        LibraryPath={this.prop.LibraryPath}
-                        renderDepth={this.props.renderDepth}
-                        rootSelected={() => { return false; }}
-                        PanelWidth={() => { return 200 }}
-                        PanelHeight={() => { return 200 }}
-                        ScreenToLocalTransform={this.getPreviewTransform}
-                        docFilters={this.docFilters}
-                        ContainingCollectionDoc={this.props.CollectionView?.props.Document}
-                        ContainingCollectionView={this.props.CollectionView}
-                        moveDocument={this.props.moveDocument}
-                        //addDocument={this.props.addDocument}
-                        //removeDocument={this.props.removeDocument}
-                        parentActive={this.prop.active}
-                        whenActiveChanged={this.prop.whenActiveChanged}
-                        addDocTab={this.props.addDocTab}
-                        pinToPres={this.props.pinToPres}
-                        bringToFront={returnFalse}
-                        ContentScaling={returnOne}
+                <div className="collectionSchemaView-cellWrapper" ref={this._focusRef} tabIndex={-1} onPointerDown={this.onPointerDown}
+                    onPointerEnter={() => { this.showPreview(true); }}
+                    onPointerLeave={() => { this.showPreview(false); }}>
 
-                    >
-                    </ContentFittingDocumentView> : null}
+                    {this._preview ? <div onClick={this.onOpenClick} style={{
+                        display: 'block', position: 'absolute',
+                        top: '0', bottom: '0', left: '0', right: '0', zIndex: "auto"
+                    }}
+                        ref="overlay"><ContentFittingDocumentView
+                            Document={this._doc}
+                            DataDoc={this.prop.DataDoc}
+                            NativeHeight={returnZero}
+                            NativeWidth={returnZero}
+                            fitToBox={true}
+                            FreezeDimensions={true}
+                            focus={emptyFunction}
+                            LibraryPath={this.prop.LibraryPath}
+                            renderDepth={this.props.renderDepth}
+                            rootSelected={() => false}
+                            PanelWidth={() => 150}
+                            PanelHeight={() => 150}
+                            ScreenToLocalTransform={this.getPreviewTransform}
+                            docFilters={returnEmptyFilter}
+                            ContainingCollectionDoc={this.props.CollectionView?.props.Document}
+                            ContainingCollectionView={this.props.CollectionView}
+                            moveDocument={this.props.moveDocument}
+                            parentActive={this.prop.active}
+                            whenActiveChanged={this.prop.whenActiveChanged}
+                            addDocTab={this.props.addDocTab}
+                            pinToPres={this.props.pinToPres}
+                            bringToFront={returnFalse}
+                            ContentScaling={returnOne}>
+                        </ContentFittingDocumentView></div> : null}
 
                     <div className="collectionSchemaView-cellContents-document"
                         style={{ padding: "5.9px" }}
                         onFocus={this.onFocus} onBlur={() => this._overlayDisposer?.()}
                         ref={this.dropRef}
-                        onClick={() => { this.showPreview(!this._preview) }}>
+                    >
 
                         <EditableView
                             editing={this._isEditing}
@@ -468,8 +473,8 @@ export class CollectionSchemaDocCell extends CollectionSchemaCell {
                             })}
                         />
                     </div >
-                    <button onClick={this.onOpenClick} className="collectionSchemaView-cellContents-docButton">
-                        <FontAwesomeIcon icon="external-link-alt" size="1x" ></FontAwesomeIcon> </button>
+                    <div onClick={this.onOpenClick} className="collectionSchemaView-cellContents-docButton">
+                        <FontAwesomeIcon icon="external-link-alt" size="lg" ></FontAwesomeIcon> </div>
                 </div>
             );
         } else {
@@ -522,7 +527,8 @@ export class CollectionSchemaImageCell extends CollectionSchemaCell {
             NativeWidth: returnZero,
             addDocTab: this.props.addDocTab,
             pinToPres: this.props.pinToPres,
-            ContentScaling: returnOne
+            ContentScaling: returnOne,
+            docFilters: returnEmptyFilter
         };
 
         let image = true;
@@ -600,7 +606,8 @@ export class CollectionSchemaListCell extends CollectionSchemaCell {
         NativeWidth: returnZero,
         addDocTab: this.props.addDocTab,
         pinToPres: this.props.pinToPres,
-        ContentScaling: returnOne
+        ContentScaling: returnOne,
+        docFilters: returnEmptyFilter
     };
     @observable private _field = this.prop.Document[this.prop.fieldKey];
     @observable private _optionsList = this._field as List<any>;
diff --git a/src/client/views/collections/CollectionSchemaMovableTableHOC.tsx b/src/client/views/collections/CollectionSchemaMovableTableHOC.tsx
index b206765e8..b77173b25 100644
--- a/src/client/views/collections/CollectionSchemaMovableTableHOC.tsx
+++ b/src/client/views/collections/CollectionSchemaMovableTableHOC.tsx
@@ -137,6 +137,7 @@ export interface MovableRowProps {
     textWrapRow: (doc: Doc) => void;
     rowWrapped: boolean;
     dropAction: string;
+    addDocTab: any;
 }
 
 export class MovableRow extends React.Component<MovableRowProps> {
@@ -232,6 +233,7 @@ export class MovableRow extends React.Component<MovableRowProps> {
                         <div className="row-dragger">
                             <div className="row-option" onClick={undoBatch(() => this.props.removeDoc(this.props.rowInfo.original))}><FontAwesomeIcon icon="trash" size="sm" /></div>
                             <div className="row-option" style={{ cursor: "grab" }} ref={reference} onPointerDown={onItemDown}><FontAwesomeIcon icon="grip-vertical" size="sm" /></div>
+                            <div className="row-option" onClick={() => this.props.addDocTab(this.props.rowInfo.original, "onRight")}><FontAwesomeIcon icon="external-link-alt" size="sm" /></div>
                         </div>
                         {children}
                     </ReactTableDefaults.TrComponent>
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 86034376d..81dfc9c62 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -407,7 +407,8 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
             rowFocused: !this._headerIsEditing && rowInfo.index === this._focusedCell.row && this.props.isFocused(this.props.Document),
             textWrapRow: this.toggleTextWrapRow,
             rowWrapped: this.textWrappedRows.findIndex(id => rowInfo.original[Id] === id) > -1,
-            dropAction: StrCast(this.props.Document.childDropAction)
+            dropAction: StrCast(this.props.Document.childDropAction),
+            addDocTab: this.props.addDocTab
         };
     }
 
-- 
cgit v1.2.3-70-g09d2


From 884e1f73f6a3ff47d286b13ff58166b62026cc18 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Sun, 21 Jun 2020 19:46:01 -0500
Subject: changed to previews

---
 .../views/collections/CollectionSchemaCells.tsx    | 54 +++++-------------
 .../views/collections/CollectionSchemaView.tsx     | 66 +++++++++++++++++++++-
 2 files changed, 79 insertions(+), 41 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index 30278db32..4231a3941 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -56,6 +56,7 @@ export interface CellProps {
     setPreviewDoc: (doc: Doc) => void;
     setComputed: (script: string, doc: Doc, field: string, row: number, col: number) => boolean;
     getField: (row: number, col?: number) => void;
+    showDoc: (doc: Doc | undefined, dataDoc?: any, screenX?: number, screenY?: number) => void;
 }
 
 @observer
@@ -398,16 +399,18 @@ export class CollectionSchemaDocCell extends CollectionSchemaCell {
     }
 
     @action
-    showPreview = (bool: boolean) => {
-        console.log("show preview");
-        this._preview = bool;
-    }
-
-    getPreviewTransform = (): Transform => {
-        return this.prop.ScreenToLocalTransform().translate(- this.borderWidth - 4 - this.tableWidth, - this.borderWidth);
+    showPreview = (bool: boolean, e: any) => {
+        if (this._isEditing) {
+            this._preview = false;
+        } else {
+            if (bool) {
+                this.props.showDoc(this._doc, this.prop.DataDoc, e.screenX, e.screenY);
+            } else {
+                this.props.showDoc(undefined);
+            }
+        }
     }
 
-
     render() {
 
         const dragRef: React.RefObject<HTMLDivElement> = React.createRef();
@@ -418,38 +421,9 @@ export class CollectionSchemaDocCell extends CollectionSchemaCell {
 
             return (
                 <div className="collectionSchemaView-cellWrapper" ref={this._focusRef} tabIndex={-1} onPointerDown={this.onPointerDown}
-                    onPointerEnter={() => { this.showPreview(true); }}
-                    onPointerLeave={() => { this.showPreview(false); }}>
-
-                    {this._preview ? <div onClick={this.onOpenClick} style={{
-                        display: 'block', position: 'absolute',
-                        top: '0', bottom: '0', left: '0', right: '0', zIndex: "auto"
-                    }}
-                        ref="overlay"><ContentFittingDocumentView
-                            Document={this._doc}
-                            DataDoc={this.prop.DataDoc}
-                            NativeHeight={returnZero}
-                            NativeWidth={returnZero}
-                            fitToBox={true}
-                            FreezeDimensions={true}
-                            focus={emptyFunction}
-                            LibraryPath={this.prop.LibraryPath}
-                            renderDepth={this.props.renderDepth}
-                            rootSelected={() => false}
-                            PanelWidth={() => 150}
-                            PanelHeight={() => 150}
-                            ScreenToLocalTransform={this.getPreviewTransform}
-                            docFilters={returnEmptyFilter}
-                            ContainingCollectionDoc={this.props.CollectionView?.props.Document}
-                            ContainingCollectionView={this.props.CollectionView}
-                            moveDocument={this.props.moveDocument}
-                            parentActive={this.prop.active}
-                            whenActiveChanged={this.prop.whenActiveChanged}
-                            addDocTab={this.props.addDocTab}
-                            pinToPres={this.props.pinToPres}
-                            bringToFront={returnFalse}
-                            ContentScaling={returnOne}>
-                        </ContentFittingDocumentView></div> : null}
+                    onPointerEnter={(e) => { this.showPreview(true, e); }}
+                    onPointerLeave={(e) => { this.showPreview(false, e); }}
+                >
 
                     <div className="collectionSchemaView-cellContents-document"
                         style={{ padding: "5.9px" }}
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 81dfc9c62..334897028 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -27,8 +27,9 @@ import "./CollectionSchemaView.scss";
 import { CollectionSubView } from "./CollectionSubView";
 import { CollectionView } from "./CollectionView";
 import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView";
-import { setupMoveUpEvents, emptyFunction, returnZero, returnOne, returnFalse } from "../../../Utils";
+import { setupMoveUpEvents, emptyFunction, returnZero, returnOne, returnFalse, returnEmptyFilter, emptyPath } from "../../../Utils";
 import { SnappingManager } from "../../util/SnappingManager";
+import ReactDOM from "react-dom";
 
 library.add(faCog, faPlus, faSortUp, faSortDown);
 library.add(faTable);
@@ -228,6 +229,14 @@ export interface SchemaTableProps {
     setPreviewDoc: (document: Doc) => void;
 }
 
+
+
+
+
+
+
+
+
 @observer
 export class SchemaTable extends React.Component<SchemaTableProps> {
     private DIVIDER_WIDTH = 4;
@@ -237,6 +246,10 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
     @observable _focusedCell: { row: number, col: number } = { row: 0, col: 0 };
     @observable _openCollections: Array<string> = [];
 
+    @observable _showDoc: Doc | undefined;
+    @observable _showDataDoc: any = "";
+    @observable _showDocPos: number[] = [];
+
     @computed get previewWidth() { return () => NumCast(this.props.Document.schemaPreviewWidth); }
     @computed get previewHeight() { return () => this.props.PanelHeight() - 2 * this.borderWidth; }
     @computed get tableWidth() { return this.props.PanelWidth() - 2 * this.borderWidth - this.DIVIDER_WIDTH - this.previewWidth(); }
@@ -349,6 +362,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
                         setPreviewDoc: this.props.setPreviewDoc,
                         setComputed: this.setComputed,
                         getField: this.getField,
+                        showDoc: this.showDoc,
                     };
 
                     const colType = this.getColumnType(col);
@@ -756,8 +770,58 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
         return false;
     }
 
+
+    showDoc(doc: Doc | undefined, dataDoc?: Doc, screenX?: number, screenY?: number) {
+        this._showDoc = doc;
+        if (dataDoc && screenX && screenY) {
+            this._showDocPos = this.props.ScreenToLocalTransform().transformPoint(screenX, screenY);
+        }
+    }
+
+    @action
+    onOpenClick = () => {
+        if (this._showDoc) {
+            this.props.addDocTab(this._showDoc, "onRight");
+        }
+    }
+
+    getPreviewTransform = (): Transform => {
+        return this.props.ScreenToLocalTransform().translate(- this.borderWidth - 4 - this.tableWidth, - this.borderWidth);
+    }
+
     render() {
+
+        const preview = "";
+
         return <div className="collectionSchemaView-table" onPointerDown={this.onPointerDown} onWheel={e => this.props.active(true) && e.stopPropagation()} onDrop={e => this.props.onDrop(e, {})} onContextMenu={this.onContextMenu} >
+            {this._showDoc ? <div onClick={() => { this.onOpenClick(); }} style={{
+                position: "absolute", transform: `translate(${this._showDocPos[0]}, ${this._showDocPos[1]})`
+            }}
+                ref="overlay"><ContentFittingDocumentView
+                    Document={this._showDoc}
+                    DataDoc={this._showDataDoc}
+                    NativeHeight={returnZero}
+                    NativeWidth={returnZero}
+                    fitToBox={true}
+                    FreezeDimensions={true}
+                    focus={emptyFunction}
+                    LibraryPath={emptyPath}
+                    renderDepth={this.props.renderDepth}
+                    rootSelected={() => false}
+                    PanelWidth={() => 150}
+                    PanelHeight={() => 150}
+                    ScreenToLocalTransform={this.getPreviewTransform}
+                    docFilters={returnEmptyFilter}
+                    ContainingCollectionDoc={this.props.CollectionView?.props.Document}
+                    ContainingCollectionView={this.props.CollectionView}
+                    moveDocument={this.props.moveDocument}
+                    parentActive={this.props.active}
+                    whenActiveChanged={emptyFunction}
+                    addDocTab={this.props.addDocTab}
+                    pinToPres={this.props.pinToPres}
+                    bringToFront={returnFalse}
+                    ContentScaling={returnOne}>
+                </ContentFittingDocumentView></div> : null}
             {this.reactTable}
             <div className="collectionSchemaView-addRow" onClick={() => this.createRow()}>+ new</div>
         </div>;
-- 
cgit v1.2.3-70-g09d2


From 2e41227b586e6ad7f9f9f83154011ea33b27b38c Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Sun, 21 Jun 2020 22:07:01 -0400
Subject: fixed actions

---
 .../views/collections/CollectionSchemaView.tsx     | 61 ++++++++++------------
 1 file changed, 29 insertions(+), 32 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 334897028..a79b790f5 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -770,7 +770,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
         return false;
     }
 
-
+    @action
     showDoc(doc: Doc | undefined, dataDoc?: Doc, screenX?: number, screenY?: number) {
         this._showDoc = doc;
         if (dataDoc && screenX && screenY) {
@@ -778,7 +778,6 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
         }
     }
 
-    @action
     onOpenClick = () => {
         if (this._showDoc) {
             this.props.addDocTab(this._showDoc, "onRight");
@@ -790,38 +789,36 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
     }
 
     render() {
-
         const preview = "";
-
         return <div className="collectionSchemaView-table" onPointerDown={this.onPointerDown} onWheel={e => this.props.active(true) && e.stopPropagation()} onDrop={e => this.props.onDrop(e, {})} onContextMenu={this.onContextMenu} >
-            {this._showDoc ? <div onClick={() => { this.onOpenClick(); }} style={{
-                position: "absolute", transform: `translate(${this._showDocPos[0]}, ${this._showDocPos[1]})`
-            }}
-                ref="overlay"><ContentFittingDocumentView
-                    Document={this._showDoc}
-                    DataDoc={this._showDataDoc}
-                    NativeHeight={returnZero}
-                    NativeWidth={returnZero}
-                    fitToBox={true}
-                    FreezeDimensions={true}
-                    focus={emptyFunction}
-                    LibraryPath={emptyPath}
-                    renderDepth={this.props.renderDepth}
-                    rootSelected={() => false}
-                    PanelWidth={() => 150}
-                    PanelHeight={() => 150}
-                    ScreenToLocalTransform={this.getPreviewTransform}
-                    docFilters={returnEmptyFilter}
-                    ContainingCollectionDoc={this.props.CollectionView?.props.Document}
-                    ContainingCollectionView={this.props.CollectionView}
-                    moveDocument={this.props.moveDocument}
-                    parentActive={this.props.active}
-                    whenActiveChanged={emptyFunction}
-                    addDocTab={this.props.addDocTab}
-                    pinToPres={this.props.pinToPres}
-                    bringToFront={returnFalse}
-                    ContentScaling={returnOne}>
-                </ContentFittingDocumentView></div> : null}
+            {!this._showDoc ? (null) :
+                <div onClick={() => { this.onOpenClick(); }} style={{ position: "absolute", transform: `translate(${this._showDocPos[0]}, ${this._showDocPos[1]})` }}
+                    ref="overlay"><ContentFittingDocumentView
+                        Document={this._showDoc}
+                        DataDoc={this._showDataDoc}
+                        NativeHeight={returnZero}
+                        NativeWidth={returnZero}
+                        fitToBox={true}
+                        FreezeDimensions={true}
+                        focus={emptyFunction}
+                        LibraryPath={emptyPath}
+                        renderDepth={this.props.renderDepth}
+                        rootSelected={() => false}
+                        PanelWidth={() => 150}
+                        PanelHeight={() => 150}
+                        ScreenToLocalTransform={this.getPreviewTransform}
+                        docFilters={returnEmptyFilter}
+                        ContainingCollectionDoc={this.props.CollectionView?.props.Document}
+                        ContainingCollectionView={this.props.CollectionView}
+                        moveDocument={this.props.moveDocument}
+                        parentActive={this.props.active}
+                        whenActiveChanged={emptyFunction}
+                        addDocTab={this.props.addDocTab}
+                        pinToPres={this.props.pinToPres}
+                        bringToFront={returnFalse}
+                        ContentScaling={returnOne}>
+                    </ContentFittingDocumentView>
+                </div>}
             {this.reactTable}
             <div className="collectionSchemaView-addRow" onClick={() => this.createRow()}>+ new</div>
         </div>;
-- 
cgit v1.2.3-70-g09d2


From e2621ee4e1e1094306f02a5f8db7a80c9c5b1d39 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Sun, 21 Jun 2020 22:45:53 -0400
Subject: fixed schema preview doc bug.

---
 src/client/views/collections/CollectionSchemaView.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index a79b790f5..196ebbdc6 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -771,7 +771,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
     }
 
     @action
-    showDoc(doc: Doc | undefined, dataDoc?: Doc, screenX?: number, screenY?: number) {
+    showDoc = (doc: Doc | undefined, dataDoc?: Doc, screenX?: number, screenY?: number) => {
         this._showDoc = doc;
         if (dataDoc && screenX && screenY) {
             this._showDocPos = this.props.ScreenToLocalTransform().transformPoint(screenX, screenY);
@@ -792,7 +792,8 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
         const preview = "";
         return <div className="collectionSchemaView-table" onPointerDown={this.onPointerDown} onWheel={e => this.props.active(true) && e.stopPropagation()} onDrop={e => this.props.onDrop(e, {})} onContextMenu={this.onContextMenu} >
             {!this._showDoc ? (null) :
-                <div onClick={() => { this.onOpenClick(); }} style={{ position: "absolute", transform: `translate(${this._showDocPos[0]}, ${this._showDocPos[1]})` }}
+                <div onClick={() => { this.onOpenClick(); }}
+                    style={{ position: "absolute", width: 400, height: 300, transform: `translate(${this._showDocPos[0]}px, ${this._showDocPos[1]}px)` }}
                     ref="overlay"><ContentFittingDocumentView
                         Document={this._showDoc}
                         DataDoc={this._showDataDoc}
-- 
cgit v1.2.3-70-g09d2


From cec8cc0d8444b0321ec95a49d91a77a926462900 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Mon, 22 Jun 2020 14:22:23 -0500
Subject: more with previews

---
 .../views/collections/CollectionSchemaCells.tsx    | 35 +++++++++++++++++++---
 .../views/collections/CollectionSchemaView.scss    |  4 +++
 .../views/collections/CollectionSchemaView.tsx     | 11 ++++---
 3 files changed, 42 insertions(+), 8 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index 4231a3941..b9be3b64f 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -404,13 +404,37 @@ export class CollectionSchemaDocCell extends CollectionSchemaCell {
             this._preview = false;
         } else {
             if (bool) {
-                this.props.showDoc(this._doc, this.prop.DataDoc, e.screenX, e.screenY);
+                console.log("show doc");
+                this.props.showDoc(this._doc, this.prop.DataDoc, e.screenX - 230, e.screenY - 570);
             } else {
+                console.log("no doc");
                 this.props.showDoc(undefined);
             }
         }
     }
 
+    onDown = (e: any) => {
+        this.props.changeFocusedCellByIndex(this.props.row, this.props.col);
+        this.props.setPreviewDoc(this.props.rowProps.original);
+
+        let url: string;
+        if (url = StrCast(this.props.rowProps.row.href)) {
+            try {
+                new URL(url);
+                const temp = window.open(url)!;
+                temp.blur();
+                window.focus();
+            } catch { }
+        }
+
+        const field = this.props.rowProps.original[this.props.rowProps.column.id!];
+        const doc = FieldValue(Cast(field, Doc));
+        if (typeof field === "object" && doc) this.props.setPreviewDoc(doc);
+
+        this.showPreview(true, e);
+
+    }
+
     render() {
 
         const dragRef: React.RefObject<HTMLDivElement> = React.createRef();
@@ -420,9 +444,12 @@ export class CollectionSchemaDocCell extends CollectionSchemaCell {
 
 
             return (
-                <div className="collectionSchemaView-cellWrapper" ref={this._focusRef} tabIndex={-1} onPointerDown={this.onPointerDown}
-                    onPointerEnter={(e) => { this.showPreview(true, e); }}
-                    onPointerLeave={(e) => { this.showPreview(false, e); }}
+                <div className="collectionSchemaView-cellWrapper" ref={this._focusRef} tabIndex={-1}
+                    //    onPointerDown={(e) => { this.onDown(e); }}
+                    // onFocus={(e) => this.showPreview(true, e)}
+                    onMouseEnter={(e) => { this.showPreview(true, e); }}
+                    // onBlur={(e) => { console.log("Blur"); this.showPreview(false, e) }}
+                    onMouseLeave={(e) => { this.showPreview(false, e); }}
                 >
 
                     <div className="collectionSchemaView-cellContents-document"
diff --git a/src/client/views/collections/CollectionSchemaView.scss b/src/client/views/collections/CollectionSchemaView.scss
index 50971420d..6f076cbb5 100644
--- a/src/client/views/collections/CollectionSchemaView.scss
+++ b/src/client/views/collections/CollectionSchemaView.scss
@@ -479,6 +479,10 @@ button.add-column {
     background-color: red;
 }
 
+.collectionSchemaView-toolbar {
+    z-index: 1000;
+}
+
 .collectionSchemaView-toolbar {
     height: 30px;
     display: flex;
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 196ebbdc6..574884e86 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -791,9 +791,14 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
     render() {
         const preview = "";
         return <div className="collectionSchemaView-table" onPointerDown={this.onPointerDown} onWheel={e => this.props.active(true) && e.stopPropagation()} onDrop={e => this.props.onDrop(e, {})} onContextMenu={this.onContextMenu} >
+            {this.reactTable}
+            <div className="collectionSchemaView-addRow" onClick={() => this.createRow()}>+ new</div>
             {!this._showDoc ? (null) :
-                <div onClick={() => { this.onOpenClick(); }}
-                    style={{ position: "absolute", width: 400, height: 300, transform: `translate(${this._showDocPos[0]}px, ${this._showDocPos[1]}px)` }}
+                <div className="collectionSchemaView-documentPreview" //onClick={() => { this.onOpenClick(); }}
+                    style={{
+                        position: "absolute", width: 400, height: 300,
+                        transform: `translate(${this._showDocPos[0]}px, ${this._showDocPos[1]}px)`
+                    }}
                     ref="overlay"><ContentFittingDocumentView
                         Document={this._showDoc}
                         DataDoc={this._showDataDoc}
@@ -820,8 +825,6 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
                         ContentScaling={returnOne}>
                     </ContentFittingDocumentView>
                 </div>}
-            {this.reactTable}
-            <div className="collectionSchemaView-addRow" onClick={() => this.createRow()}>+ new</div>
         </div>;
     }
 }
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2


From 97090506ca22ce2f96b0c0cb44bf30b3c17f7b90 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Mon, 22 Jun 2020 17:14:33 -0400
Subject: fixed display of document preview for schema view

---
 src/client/views/collections/CollectionSchemaCells.tsx | 8 ++++----
 src/client/views/collections/CollectionSchemaView.tsx  | 5 +++--
 2 files changed, 7 insertions(+), 6 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index b9be3b64f..7b76a5c84 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -405,7 +405,7 @@ export class CollectionSchemaDocCell extends CollectionSchemaCell {
         } else {
             if (bool) {
                 console.log("show doc");
-                this.props.showDoc(this._doc, this.prop.DataDoc, e.screenX - 230, e.screenY - 570);
+                this.props.showDoc(this._doc, this.prop.DataDoc, e.clientX, e.clientY);
             } else {
                 console.log("no doc");
                 this.props.showDoc(undefined);
@@ -445,11 +445,11 @@ export class CollectionSchemaDocCell extends CollectionSchemaCell {
 
             return (
                 <div className="collectionSchemaView-cellWrapper" ref={this._focusRef} tabIndex={-1}
-                    //    onPointerDown={(e) => { this.onDown(e); }}
+                    onPointerDown={(e) => { this.onDown(e); }}
                     // onFocus={(e) => this.showPreview(true, e)}
-                    onMouseEnter={(e) => { this.showPreview(true, e); }}
+                    onPointerEnter={(e) => { this.showPreview(true, e); }}
                     // onBlur={(e) => { console.log("Blur"); this.showPreview(false, e) }}
-                    onMouseLeave={(e) => { this.showPreview(false, e); }}
+                    onPointerLeave={(e) => { this.showPreview(false, e); }}
                 >
 
                     <div className="collectionSchemaView-cellContents-document"
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 574884e86..03db0377a 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -796,8 +796,9 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
             {!this._showDoc ? (null) :
                 <div className="collectionSchemaView-documentPreview" //onClick={() => { this.onOpenClick(); }}
                     style={{
-                        position: "absolute", width: 400, height: 300,
-                        transform: `translate(${this._showDocPos[0]}px, ${this._showDocPos[1]}px)`
+                        position: "absolute", width: 150, height: 150,
+                        background: "dimGray", display: "block", top: 0, left: 0,
+                        transform: `translate(${this._showDocPos[0]}px, ${this._showDocPos[1] - 180}px)`
                     }}
                     ref="overlay"><ContentFittingDocumentView
                         Document={this._showDoc}
-- 
cgit v1.2.3-70-g09d2


From 45e3384b31ed2816e6846c2ff545fe55dc155339 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Tue, 23 Jun 2020 16:41:07 -0500
Subject: minor changes

---
 .../views/collections/CollectionSchemaCells.tsx    | 33 +++++++++---
 .../views/collections/CollectionSchemaHeaders.tsx  | 10 ++++
 .../views/collections/CollectionSchemaView.scss    |  4 ++
 .../views/collections/CollectionSchemaView.tsx     | 63 +++++++++++++++-------
 4 files changed, 85 insertions(+), 25 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index 6f43a2097..a79360a20 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -94,6 +94,7 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
 
     @action
     onPointerDown = async (e: React.PointerEvent): Promise<void> => {
+
         this.props.changeFocusedCellByIndex(this.props.row, this.props.col);
         this.props.setPreviewDoc(this.props.rowProps.original);
 
@@ -239,10 +240,14 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
         // );   
         trace();
 
+
+
         return (
             <div className="collectionSchemaView-cellContainer" style={{ cursor: fieldIsDoc ? "grab" : "auto" }} ref={dragRef} onPointerDown={this.onPointerDown} onPointerEnter={onPointerEnter} onPointerLeave={onPointerLeave}>
                 <div className={className} ref={this._focusRef} onPointerDown={onItemDown} tabIndex={-1}>
                     <div className="collectionSchemaView-cellContents" ref={type === undefined || type === "document" ? this.dropRef : null} key={props.Document[Id]}>
+
+
                         <EditableView
                             editing={this._isEditing}
                             isEditingCallback={this.isEditingCallback}
@@ -251,28 +256,42 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
                             height={"auto"}
                             maxHeight={Number(MAX_ROW_HEIGHT)}
                             GetValue={() => {
-                                const cfield = ComputedField.WithoutComputed(() => FieldValue(props.Document[props.fieldKey]));
-                                const cscript = cfield instanceof ComputedField ? cfield.script.originalScript : undefined;
-                                const cfinalScript = cscript?.split("return")[cscript.split("return").length - 1];
-                                const val = cscript !== undefined ? `:=${cfinalScript?.substring(0, cfinalScript.length - 2)}` :
-                                    Field.IsField(cfield) ? Field.toScriptString(cfield) : "";
-                                return val;
+                                if (type === "number" && (contents === 0 || contents === "0")) {
+                                    return "0";
+                                } else {
+                                    const cfield = ComputedField.WithoutComputed(() => FieldValue(props.Document[props.fieldKey]));
+                                    console.log(cfield);
+                                    if (type === "number") {
+                                        return StrCast(cfield);
+                                    }
+                                    const cscript = cfield instanceof ComputedField ? cfield.script.originalScript : undefined;
+                                    const cfinalScript = cscript?.split("return")[cscript.split("return").length - 1];
+                                    const val = cscript !== undefined ? `:=${cfinalScript?.substring(0, cfinalScript.length - 2)}` :
+                                        Field.IsField(cfield) ? Field.toScriptString(cfield) : "";
+                                    return val;
+                                }
+
                             }}
                             SetValue={action((value: string) => {
                                 let retVal = false;
+
                                 if (value.startsWith(":=")) {
                                     retVal = this.props.setComputed(value.substring(2), props.Document, this.props.rowProps.column.id!, this.props.row, this.props.col);
                                 } else {
                                     const script = CompileScript(value, { requiredType: type, typecheck: false, editable: true, addReturn: true, params: { this: Doc.name, $r: "number", $c: "number", $: "any" } });
                                     if (script.compiled) {
                                         retVal = this.applyToDoc(props.Document, this.props.row, this.props.col, script.run);
+                                        console.log("compiled");
                                     }
+
                                 }
                                 if (retVal) {
                                     this._isEditing = false; // need to set this here. otherwise, the assignment of the field will invalidate & cause render() to be called with the wrong value for 'editing'
                                     this.props.setIsEditing(false);
                                 }
                                 return retVal;
+
+                                //return true;
                             })}
                             OnFillDown={async (value: string) => {
                                 const script = CompileScript(value, { requiredType: type, typecheck: false, editable: true, addReturn: true, params: { this: Doc.name, $r: "number", $c: "number", $: "any" } });
@@ -284,6 +303,8 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
                                 }
                             }}
                         />
+
+
                     </div >
                     {/* {fieldIsDoc ? docExpander : null} */}
                 </div>
diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx
index 0d6cf4474..d9a27f355 100644
--- a/src/client/views/collections/CollectionSchemaHeaders.tsx
+++ b/src/client/views/collections/CollectionSchemaHeaders.tsx
@@ -73,6 +73,16 @@ export class CollectionSchemaAddColumnHeader extends React.Component<AddColumnHe
     }
 }
 
+
+
+
+
+
+
+
+
+
+
 export interface ColumnMenuProps {
     columnField: SchemaHeaderField;
     // keyValue: string;
diff --git a/src/client/views/collections/CollectionSchemaView.scss b/src/client/views/collections/CollectionSchemaView.scss
index 6f076cbb5..1463cdb3c 100644
--- a/src/client/views/collections/CollectionSchemaView.scss
+++ b/src/client/views/collections/CollectionSchemaView.scss
@@ -62,10 +62,14 @@
         width: calc(100% - 52px);
         margin-left: 50px;
 
+        z-index: 10000;
+
         &.-header {
             font-size: 12px;
             height: 30px;
             box-shadow: none;
+            z-index: 10000;
+            overflow-y: visible;
         }
 
         .rt-resizable-header-content {
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 03db0377a..9c4ec7021 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -1,5 +1,5 @@
 import React = require("react");
-import { library } from '@fortawesome/fontawesome-svg-core';
+import { library, IconProp } from '@fortawesome/fontawesome-svg-core';
 import { faCog, faPlus, faSortDown, faSortUp, faTable } from '@fortawesome/free-solid-svg-icons';
 import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
 import { action, computed, observable, untracked } from "mobx";
@@ -21,7 +21,7 @@ import { COLLECTION_BORDER_WIDTH } from '../../views/globalCssVariables.scss';
 import { ContextMenu } from "../ContextMenu";
 import '../DocumentDecorations.scss';
 import { CellProps, CollectionSchemaCell, CollectionSchemaCheckboxCell, CollectionSchemaDocCell, CollectionSchemaNumberCell, CollectionSchemaStringCell, CollectionSchemaImageCell, CollectionSchemaListCell } from "./CollectionSchemaCells";
-import { CollectionSchemaAddColumnHeader, CollectionSchemaHeader } from "./CollectionSchemaHeaders";
+import { CollectionSchemaAddColumnHeader, CollectionSchemaHeader, CollectionSchemaColumnMenu } from "./CollectionSchemaHeaders";
 import { MovableColumn, MovableRow } from "./CollectionSchemaMovableTableHOC";
 import "./CollectionSchemaView.scss";
 import { CollectionSubView } from "./CollectionSubView";
@@ -233,10 +233,6 @@ export interface SchemaTableProps {
 
 
 
-
-
-
-
 @observer
 export class SchemaTable extends React.Component<SchemaTableProps> {
     private DIVIDER_WIDTH = 4;
@@ -320,19 +316,48 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
         }
 
         const cols = this.columns.map(col => {
-            const header = <CollectionSchemaHeader
-                keyValue={col}
-                possibleKeys={possibleKeys}
-                existingKeys={this.columns.map(c => c.heading)}
-                keyType={this.getColumnType(col)}
-                typeConst={columnTypes.get(col.heading) !== undefined}
-                onSelect={this.changeColumns}
-                setIsEditing={this.setHeaderIsEditing}
-                deleteColumn={this.deleteColumn}
-                setColumnType={this.setColumnType}
-                setColumnSort={this.setColumnSort}
-                setColumnColor={this.setColumnColor}
-            />;
+
+            const icon: IconProp = this.getColumnType(col) === ColumnType.Number ? "hashtag" : this.getColumnType(col) === ColumnType.String ? "font" :
+                this.getColumnType(col) === ColumnType.Boolean ? "check-square" : this.getColumnType(col) === ColumnType.Doc ? "file" :
+                    this.getColumnType(col) === ColumnType.Image ? "image" : this.getColumnType(col) === ColumnType.List ? "list-ul" : "align-justify";
+
+
+
+            const header = <div className="collectionSchemaView-header" style={{ background: col.color }}>
+                <CollectionSchemaColumnMenu
+                    columnField={col}
+                    // keyValue={this.props.keyValue.heading}
+                    possibleKeys={possibleKeys}
+                    existingKeys={this.columns.map(c => c.heading)}
+                    // keyType={this.getColumnType(col)}
+                    typeConst={columnTypes.get(col.heading) !== undefined}
+                    menuButtonContent={<div><FontAwesomeIcon icon={icon} size="sm" />{col.heading}</div>}
+                    addNew={false}
+                    onSelect={this.changeColumns}
+                    setIsEditing={this.setHeaderIsEditing}
+                    deleteColumn={this.deleteColumn}
+                    onlyShowOptions={false}
+                    setColumnType={this.setColumnType}
+                    setColumnSort={this.setColumnSort}
+                    setColumnColor={this.setColumnColor}
+                />
+            </div>;
+
+
+            // <CollectionSchemaHeader
+            //     keyValue={col}
+            //     possibleKeys={possibleKeys}
+            //     existingKeys={this.columns.map(c => c.heading)}
+            //     keyType={this.getColumnType(col)}
+            //     typeConst={columnTypes.get(col.heading) !== undefined}
+            //     onSelect={this.changeColumns}
+            //     setIsEditing={this.setHeaderIsEditing}
+            //     deleteColumn={this.deleteColumn}
+            //     setColumnType={this.setColumnType}
+            //     setColumnSort={this.setColumnSort}
+            //     setColumnColor={this.setColumnColor}
+            // />;
+
 
             return {
                 Header: <MovableColumn columnRenderer={header} columnValue={col} allColumns={this.columns} reorderColumns={this.reorderColumns} ScreenToLocalTransform={this.props.ScreenToLocalTransform} />,
-- 
cgit v1.2.3-70-g09d2


From 161d71258b636178f3e160dc66143d5df1ebb5ed Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Wed, 24 Jun 2020 19:48:09 -0500
Subject: restructure of schema view class and menus

---
 .../views/collections/CollectionSchemaView.scss    |   5 +
 .../views/collections/CollectionSchemaView.tsx     | 943 +++++++++++++++++++--
 2 files changed, 898 insertions(+), 50 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaView.scss b/src/client/views/collections/CollectionSchemaView.scss
index 1463cdb3c..a0bbae88f 100644
--- a/src/client/views/collections/CollectionSchemaView.scss
+++ b/src/client/views/collections/CollectionSchemaView.scss
@@ -63,6 +63,7 @@
         margin-left: 50px;
 
         z-index: 10000;
+        overflow-y: visible;
 
         &.-header {
             font-size: 12px;
@@ -179,11 +180,15 @@
 .collectionSchemaView-header {
     height: 100%;
     color: gray;
+    z-index: 10000;
+    overflow-y: visible;
 
     .collectionSchema-header-menu {
         height: 100%;
+        z-index: 10000;
 
         .collectionSchema-header-toggler {
+            z-index: 10000;
             width: 100%;
             height: 100%;
             padding: 4px;
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 9c4ec7021..18a53541d 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -10,7 +10,7 @@ import { Doc, DocListCast, Field, Opt } from "../../../fields/Doc";
 import { Id } from "../../../fields/FieldSymbols";
 import { List } from "../../../fields/List";
 import { listSpec } from "../../../fields/Schema";
-import { SchemaHeaderField } from "../../../fields/SchemaHeaderField";
+import { SchemaHeaderField, PastelSchemaPalette } from "../../../fields/SchemaHeaderField";
 import { ComputedField } from "../../../fields/ScriptField";
 import { Cast, FieldValue, NumCast, StrCast, BoolCast } from "../../../fields/Types";
 import { Docs, DocumentOptions } from "../../documents/Documents";
@@ -21,7 +21,7 @@ import { COLLECTION_BORDER_WIDTH } from '../../views/globalCssVariables.scss';
 import { ContextMenu } from "../ContextMenu";
 import '../DocumentDecorations.scss';
 import { CellProps, CollectionSchemaCell, CollectionSchemaCheckboxCell, CollectionSchemaDocCell, CollectionSchemaNumberCell, CollectionSchemaStringCell, CollectionSchemaImageCell, CollectionSchemaListCell } from "./CollectionSchemaCells";
-import { CollectionSchemaAddColumnHeader, CollectionSchemaHeader, CollectionSchemaColumnMenu } from "./CollectionSchemaHeaders";
+import { CollectionSchemaAddColumnHeader, CollectionSchemaHeader, CollectionSchemaColumnMenu, KeysDropdown } from "./CollectionSchemaHeaders";
 import { MovableColumn, MovableRow } from "./CollectionSchemaMovableTableHOC";
 import "./CollectionSchemaView.scss";
 import { CollectionSubView } from "./CollectionSubView";
@@ -29,7 +29,6 @@ import { CollectionView } from "./CollectionView";
 import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView";
 import { setupMoveUpEvents, emptyFunction, returnZero, returnOne, returnFalse, returnEmptyFilter, emptyPath } from "../../../Utils";
 import { SnappingManager } from "../../util/SnappingManager";
-import ReactDOM from "react-dom";
 
 library.add(faCog, faPlus, faSortUp, faSortDown);
 library.add(faTable);
@@ -65,6 +64,781 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     @computed get tableWidth() { return this.props.PanelWidth() - 2 * this.borderWidth - this.DIVIDER_WIDTH - this.previewWidth(); }
     @computed get borderWidth() { return Number(COLLECTION_BORDER_WIDTH); }
 
+    @observable pointerX: number = 0;
+    @observable pointerY: number = 0;
+    @computed get menuCoordinates() { return this.props.ScreenToLocalTransform().transformPoint(this.pointerX, this.pointerY); }
+
+    @observable col: any = "";
+    @computed get possibleKeys() { return this.documentKeys.filter(key => this.columns.findIndex(existingKey => existingKey.heading.toUpperCase() === key.toUpperCase()) === -1); }
+
+    @observable menuContent: any = "";
+    @observable headerOpen: boolean = false;
+
+    @observable private _isOpen: boolean = false;
+    @observable private _node: HTMLDivElement | null = null;
+
+    componentDidMount() {
+        document.addEventListener("pointerdown", this.detectClick);
+        document.addEventListener("keydown", this.onKeyDown);
+    }
+
+    componentWillUnmount() {
+        document.removeEventListener("pointerdown", this.detectClick);
+        document.removeEventListener("keydown", this.onKeyDown);
+    }
+
+    detectClick = (e: PointerEvent): void => {
+        if (this._node && this._node.contains(e.target as Node)) {
+        } else {
+            this._isOpen = false;
+            this.setHeaderIsEditing(false);
+        }
+    }
+
+    @action
+    toggleIsOpen = (): void => {
+        this._isOpen = !this._isOpen;
+        this.setHeaderIsEditing(this._isOpen);
+    }
+
+    changeColumnType = (type: ColumnType, col: any): void => {
+        this.setColumnType(col, type);
+    }
+
+    changeColumnSort = (desc: boolean | undefined, col: any): void => {
+        this.setColumnSort(col, desc);
+    }
+
+    changeColumnColor = (color: string, col: any): void => {
+        this.setColumnColor(col, color);
+    }
+
+    @action
+    setNode = (node: HTMLDivElement): void => {
+        if (node) {
+            this._node = node;
+        }
+    }
+
+    renderTypes = (col: any) => {
+        if (columnTypes.get(col.heading)) return <></>;
+
+        const type = col.type;
+        return (
+            <div className="collectionSchema-headerMenu-group">
+                <label>Column type:</label>
+                <div className="columnMenu-types">
+                    <div className={"columnMenu-option" + (type === ColumnType.Any ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Any, col)}>
+                        <FontAwesomeIcon icon={"align-justify"} size="sm" />
+                        Any
+                    </div>
+                    <div className={"columnMenu-option" + (type === ColumnType.Number ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Number, col)}>
+                        <FontAwesomeIcon icon={"hashtag"} size="sm" />
+                        Number
+                    </div>
+                    <div className={"columnMenu-option" + (type === ColumnType.String ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.String, col)}>
+                        <FontAwesomeIcon icon={"font"} size="sm" />
+                        Text
+                    </div>
+                    <div className={"columnMenu-option" + (type === ColumnType.Boolean ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Boolean, col)}>
+                        <FontAwesomeIcon icon={"check-square"} size="sm" />
+                        Checkbox
+                    </div>
+                    <div className={"columnMenu-option" + (type === ColumnType.List ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.List, col)}>
+                        <FontAwesomeIcon icon={"list-ul"} size="sm" />
+                        List
+                    </div>
+                    <div className={"columnMenu-option" + (type === ColumnType.Doc ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Doc, col)}>
+                        <FontAwesomeIcon icon={"file"} size="sm" />
+                        Document
+                    </div>
+                    <div className={"columnMenu-option" + (type === ColumnType.Image ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Image, col)}>
+                        <FontAwesomeIcon icon={"image"} size="sm" />
+                        Image
+                    </div>
+                </div>
+            </div >
+        );
+    }
+
+    renderSorting = (col: any) => {
+        const sort = col.desc;
+        return (
+            <div className="collectionSchema-headerMenu-group">
+                <label>Sort by:</label>
+                <div className="columnMenu-sort">
+                    <div className={"columnMenu-option" + (sort === true ? " active" : "")} onClick={() => this.changeColumnSort(true, col)}>
+                        <FontAwesomeIcon icon="sort-amount-down" size="sm" />
+                        Sort descending
+                    </div>
+                    <div className={"columnMenu-option" + (sort === false ? " active" : "")} onClick={() => this.changeColumnSort(false, col)}>
+                        <FontAwesomeIcon icon="sort-amount-up" size="sm" />
+                        Sort ascending
+                    </div>
+                    <div className="columnMenu-option" onClick={() => this.changeColumnSort(undefined, col)}>
+                        <FontAwesomeIcon icon="times" size="sm" />
+                        Clear sorting
+                    </div>
+                </div>
+            </div>
+        );
+    }
+
+    renderColors = (col: any) => {
+        const selected = col.color;
+
+        const pink = PastelSchemaPalette.get("pink2");
+        const purple = PastelSchemaPalette.get("purple2");
+        const blue = PastelSchemaPalette.get("bluegreen1");
+        const yellow = PastelSchemaPalette.get("yellow4");
+        const red = PastelSchemaPalette.get("red2");
+        const gray = "#f1efeb";
+
+        return (
+            <div className="collectionSchema-headerMenu-group">
+                <label>Color:</label>
+                <div className="columnMenu-colors">
+                    <div className={"columnMenu-colorPicker" + (selected === pink ? " active" : "")} style={{ backgroundColor: pink }} onClick={() => this.changeColumnColor(pink!, col)}></div>
+                    <div className={"columnMenu-colorPicker" + (selected === purple ? " active" : "")} style={{ backgroundColor: purple }} onClick={() => this.changeColumnColor(purple!, col)}></div>
+                    <div className={"columnMenu-colorPicker" + (selected === blue ? " active" : "")} style={{ backgroundColor: blue }} onClick={() => this.changeColumnColor(blue!, col)}></div>
+                    <div className={"columnMenu-colorPicker" + (selected === yellow ? " active" : "")} style={{ backgroundColor: yellow }} onClick={() => this.changeColumnColor(yellow!, col)}></div>
+                    <div className={"columnMenu-colorPicker" + (selected === red ? " active" : "")} style={{ backgroundColor: red }} onClick={() => this.changeColumnColor(red!, col)}></div>
+                    <div className={"columnMenu-colorPicker" + (selected === gray ? " active" : "")} style={{ backgroundColor: gray }} onClick={() => this.changeColumnColor(gray, col)}></div>
+                </div>
+            </div>
+        );
+    }
+
+    renderContent = (col: any) => {
+        return (
+            <div className="collectionSchema-header-menuOptions">
+                <div className="collectionSchema-headerMenu-group">
+                    <label>Key:</label>
+                    <KeysDropdown
+                        keyValue={col.heading}
+                        possibleKeys={this.possibleKeys}
+                        existingKeys={this.columns.map(c => c.heading)}
+                        canAddNew={true}
+                        addNew={false}
+                        onSelect={this.changeColumns}
+                        setIsEditing={this.setHeaderIsEditing}
+                    />
+                </div>
+                {false ? <></> :
+                    <>
+                        {this.renderTypes(col)}
+                        {this.renderSorting(col)}
+                        {this.renderColors(col)}
+                        <div className="collectionSchema-headerMenu-group">
+                            <button onClick={() => this.deleteColumn(col.heading)}>Delete Column</button>
+                        </div>
+                    </>
+                }
+            </div>
+        );
+    }
+
+
+    //anchorPoints.TOP_CENTER 
+
+    @computed get renderMenu() {
+        return (
+            <div className="collectionSchema-header-menu" ref={this.setNode}
+                style={{
+                    position: "absolute", background: "white",
+                    transform: `translate(${this.menuCoordinates[0]}px, ${this.menuCoordinates[1] - 150}px)`
+                }}>
+                {/* <Flyout anchorPoint={anchorPoints.TOP_CENTER} content={this.renderContent(this.col)}>
+                    <div className="collectionSchema-header-toggler" onClick={() => this.toggleIsOpen()}>{this.menuContent}</div>
+                </ Flyout > */}
+                {this.renderContent(this.col)}
+            </div>
+        );
+    }
+
+
+
+
+
+
+
+
+
+
+
+
+
+    // ADDED START HEREE
+    //
+    //
+    //
+
+    @observable _headerIsEditing: boolean = false;
+    @observable _cellIsEditing: boolean = false;
+    @observable _focusedCell: { row: number, col: number } = { row: 0, col: 0 };
+    @observable _openCollections: Array<string> = [];
+
+    @observable _showDoc: Doc | undefined;
+    @observable _showDataDoc: any = "";
+    @observable _showDocPos: number[] = [];
+
+    @computed get columns() {
+        return Cast(this.props.Document.schemaColumns, listSpec(SchemaHeaderField), []);
+    }
+    set columns(columns: SchemaHeaderField[]) {
+        this.props.Document.schemaColumns = new List<SchemaHeaderField>(columns);
+    }
+
+    // @computed get childDocs() {
+    //     if (this.childDocs) return this.childDocs;
+
+    //     const doc = this.props.DataDoc ? this.props.DataDoc : this.props.Document;
+    //     return DocListCast(doc[this.props.fieldKey]);
+    // }
+
+    set childDocs(docs: Doc[]) {
+        const doc = this.props.DataDoc ? this.props.DataDoc : this.props.Document;
+        doc[this.props.fieldKey] = new List<Doc>(docs);
+    }
+
+    @computed get textWrappedRows() {
+        return Cast(this.props.Document.textwrappedSchemaRows, listSpec("string"), []);
+    }
+    set textWrappedRows(textWrappedRows: string[]) {
+        this.props.Document.textwrappedSchemaRows = new List<string>(textWrappedRows);
+    }
+
+    @computed get resized(): { id: string, value: number }[] {
+        return this.columns.reduce((resized, shf) => {
+            (shf.width > -1) && resized.push({ id: shf.heading, value: shf.width });
+            return resized;
+        }, [] as { id: string, value: number }[]);
+    }
+    @computed get sorted(): SortingRule[] {
+        return this.columns.reduce((sorted, shf) => {
+            shf.desc && sorted.push({ id: shf.heading, desc: shf.desc });
+            return sorted;
+        }, [] as SortingRule[]);
+    }
+
+    @action
+    openHeader = (col: any, menu: any) => {
+        this.menuContent = menu;
+        this.col = col;
+        this.headerOpen = !this.headerOpen;
+    }
+
+    @computed get tableColumns(): Column<Doc>[] {
+        const columns: Column<Doc>[] = [];
+        const tableIsFocused = this.isFocused(this.props.Document);
+        const focusedRow = this._focusedCell.row;
+        const focusedCol = this._focusedCell.col;
+        const isEditable = !this._headerIsEditing;
+
+        if (this.childDocs.reduce((found, doc) => found || doc.type === "collection", false)) {
+            columns.push(
+                {
+                    expander: true,
+                    Header: "",
+                    width: 30,
+                    Expander: (rowInfo) => {
+                        if (rowInfo.original.type === "collection") {
+                            if (rowInfo.isExpanded) return <div className="collectionSchemaView-expander" onClick={() => this.onCloseCollection(rowInfo.original)}><FontAwesomeIcon icon={"sort-up"} size="sm" /></div>;
+                            if (!rowInfo.isExpanded) return <div className="collectionSchemaView-expander" onClick={() => this.onExpandCollection(rowInfo.original)}><FontAwesomeIcon icon={"sort-down"} size="sm" /></div>;
+                        } else {
+                            return null;
+                        }
+                    }
+                }
+            );
+        }
+
+        const cols = this.columns.map(col => {
+
+            const icon: IconProp = this.getColumnType(col) === ColumnType.Number ? "hashtag" : this.getColumnType(col) === ColumnType.String ? "font" :
+                this.getColumnType(col) === ColumnType.Boolean ? "check-square" : this.getColumnType(col) === ColumnType.Doc ? "file" :
+                    this.getColumnType(col) === ColumnType.Image ? "image" : this.getColumnType(col) === ColumnType.List ? "list-ul" : "align-justify";
+
+            // this.menuContent = <div><FontAwesomeIcon icon={icon} size="sm" />{col.heading}</div>;
+
+            const menuContent = <div><FontAwesomeIcon icon={icon} size="sm" />{col.heading}</div>;
+
+            // this.col = col;
+
+            const header =
+                <div className="collectionSchemaView-header"
+                    onClick={e => { this.openHeader(col, menuContent); }}
+                    style={{ background: col.color }}>
+                    {menuContent}
+                </div>;
+
+
+            // <CollectionSchemaHeader
+            //     keyValue={col}
+            //     possibleKeys={possibleKeys}
+            //     existingKeys={this.columns.map(c => c.heading)}
+            //     keyType={this.getColumnType(col)}
+            //     typeConst={columnTypes.get(col.heading) !== undefined}
+            //     onSelect={this.changeColumns}
+            //     setIsEditing={this.setHeaderIsEditing}
+            //     deleteColumn={this.deleteColumn}
+            //     setColumnType={this.setColumnType}
+            //     setColumnSort={this.setColumnSort}
+            //     setColumnColor={this.setColumnColor}
+            // />;
+
+
+            return {
+                Header: <MovableColumn columnRenderer={header} columnValue={col} allColumns={this.columns} reorderColumns={this.reorderColumns} ScreenToLocalTransform={this.props.ScreenToLocalTransform} />,
+                accessor: (doc: Doc) => doc ? doc[col.heading] : 0,
+                id: col.heading,
+                Cell: (rowProps: CellInfo) => {
+                    const rowIndex = rowProps.index;
+                    const columnIndex = this.columns.map(c => c.heading).indexOf(rowProps.column.id!);
+                    const isFocused = focusedRow === rowIndex && focusedCol === columnIndex && tableIsFocused;
+
+                    const props: CellProps = {
+                        row: rowIndex,
+                        col: columnIndex,
+                        rowProps: rowProps,
+                        isFocused: isFocused,
+                        changeFocusedCellByIndex: this.changeFocusedCellByIndex,
+                        CollectionView: this.props.CollectionView,
+                        ContainingCollection: this.props.ContainingCollectionView,
+                        Document: this.props.Document,
+                        fieldKey: this.props.fieldKey,
+                        renderDepth: this.props.renderDepth,
+                        addDocTab: this.props.addDocTab,
+                        pinToPres: this.props.pinToPres,
+                        moveDocument: this.props.moveDocument,
+                        setIsEditing: this.setCellIsEditing,
+                        isEditable: isEditable,
+                        setPreviewDoc: this.setPreviewDoc,
+                        setComputed: this.setComputed,
+                        getField: this.getField,
+                        showDoc: this.showDoc,
+                    };
+
+                    const colType = this.getColumnType(col);
+                    if (colType === ColumnType.Number) return <CollectionSchemaNumberCell {...props} />;
+                    if (colType === ColumnType.String) return <CollectionSchemaStringCell {...props} />;
+                    if (colType === ColumnType.Boolean) return <CollectionSchemaCheckboxCell {...props} />;
+                    if (colType === ColumnType.Doc) return <CollectionSchemaDocCell {...props} />;
+                    if (colType === ColumnType.Image) return <CollectionSchemaImageCell {...props} />;
+                    if (colType === ColumnType.List) return <CollectionSchemaListCell {...props} />;
+                    return <CollectionSchemaCell {...props} />;
+                },
+                minWidth: 200,
+            };
+        });
+        columns.push(...cols);
+
+        columns.push({
+            Header: <CollectionSchemaAddColumnHeader createColumn={this.createColumn} />,
+            accessor: (doc: Doc) => 0,
+            id: "add",
+            Cell: (rowProps: CellInfo) => <></>,
+            width: 28,
+            resizable: false
+        });
+        return columns;
+    }
+
+    tableAddDoc = (doc: Doc, relativeTo?: Doc, before?: boolean) => {
+        return Doc.AddDocToList(this.props.Document, this.props.fieldKey, doc, relativeTo, before);
+    }
+
+    private getTrProps: ComponentPropsGetterR = (state, rowInfo) => {
+        return !rowInfo ? {} : {
+            ScreenToLocalTransform: this.props.ScreenToLocalTransform,
+            addDoc: this.tableAddDoc,
+            removeDoc: this.props.removeDocument,
+            rowInfo,
+            rowFocused: !this._headerIsEditing && rowInfo.index === this._focusedCell.row && this.isFocused(this.props.Document),
+            textWrapRow: this.toggleTextWrapRow,
+            rowWrapped: this.textWrappedRows.findIndex(id => rowInfo.original[Id] === id) > -1,
+            dropAction: StrCast(this.props.Document.childDropAction),
+            addDocTab: this.props.addDocTab
+        };
+    }
+
+    private getTdProps: ComponentPropsGetterR = (state, rowInfo, column, instance) => {
+        if (!rowInfo || column) return {};
+
+        const row = rowInfo.index;
+        //@ts-ignore
+        const col = this.columns.map(c => c.heading).indexOf(column!.id);
+        const isFocused = this._focusedCell.row === row && this._focusedCell.col === col && this.isFocused(this.props.Document);
+        // TODO: editing border doesn't work :(
+        return {
+            style: {
+                border: !this._headerIsEditing && isFocused ? "2px solid rgb(255, 160, 160)" : "1px solid #f1efeb"
+            }
+        };
+    }
+
+    @action
+    onCloseCollection = (collection: Doc): void => {
+        const index = this._openCollections.findIndex(col => col === collection[Id]);
+        if (index > -1) this._openCollections.splice(index, 1);
+    }
+
+    @action onExpandCollection = (collection: Doc) => this._openCollections.push(collection[Id]);
+    @action setCellIsEditing = (isEditing: boolean) => this._cellIsEditing = isEditing;
+    @action setHeaderIsEditing = (isEditing: boolean) => this._headerIsEditing = isEditing;
+
+    @action
+    onPointDown = (e: React.PointerEvent): void => {
+        this.setFocused(this.props.Document);
+        if (e.button === 0 && !e.altKey && !e.ctrlKey && !e.metaKey && this.props.isSelected(true)) {
+            e.stopPropagation();
+        }
+        this.pointerY = e.screenY;
+        this.pointerX = e.screenX;
+        this.headerOpen = false;
+    }
+
+    @action
+    onKeyDown = (e: KeyboardEvent): void => {
+        if (!this._cellIsEditing && !this._headerIsEditing && this.isFocused(this.props.Document)) {// && this.props.isSelected(true)) {
+            const direction = e.key === "Tab" ? "tab" : e.which === 39 ? "right" : e.which === 37 ? "left" : e.which === 38 ? "up" : e.which === 40 ? "down" : "";
+            this._focusedCell = this.changeFocusedCellByDirection(direction, this._focusedCell.row, this._focusedCell.col);
+
+            const pdoc = FieldValue(this.childDocs[this._focusedCell.row]);
+            pdoc && this.setPreviewDoc(pdoc);
+        }
+    }
+
+    changeFocusedCellByDirection = (direction: string, curRow: number, curCol: number) => {
+        switch (direction) {
+            case "tab": return { row: (curRow + 1 === this.childDocs.length ? 0 : curRow + 1), col: curCol + 1 === this.columns.length ? 0 : curCol + 1 };
+            case "right": return { row: curRow, col: curCol + 1 === this.columns.length ? curCol : curCol + 1 };
+            case "left": return { row: curRow, col: curCol === 0 ? curCol : curCol - 1 };
+            case "up": return { row: curRow === 0 ? curRow : curRow - 1, col: curCol };
+            case "down": return { row: curRow + 1 === this.childDocs.length ? curRow : curRow + 1, col: curCol };
+        }
+        return this._focusedCell;
+    }
+
+    @action
+    changeFocusedCellByIndex = (row: number, col: number): void => {
+        if (this._focusedCell.row !== row || this._focusedCell.col !== col) {
+            this._focusedCell = { row: row, col: col };
+        }
+        this.setFocused(this.props.Document);
+    }
+
+    @undoBatch
+    createRow = () => {
+        this.props.addDocument(Docs.Create.TextDocument("", { title: "", _width: 100, _height: 30 }));
+    }
+
+    @undoBatch
+    @action
+    createColumn = () => {
+        let index = 0;
+        let found = this.columns.findIndex(col => col.heading.toUpperCase() === "New field".toUpperCase()) > -1;
+        while (found) {
+            index++;
+            found = this.columns.findIndex(col => col.heading.toUpperCase() === ("New field (" + index + ")").toUpperCase()) > -1;
+        }
+        this.columns.push(new SchemaHeaderField(`New field ${index ? "(" + index + ")" : ""}`, "#f1efeb"));
+    }
+
+    @undoBatch
+    @action
+    deleteColumn = (key: string) => {
+        const columns = this.columns;
+        if (columns === undefined) {
+            this.columns = new List<SchemaHeaderField>([]);
+        } else {
+            const index = columns.map(c => c.heading).indexOf(key);
+            if (index > -1) {
+                columns.splice(index, 1);
+                this.columns = columns;
+            }
+        }
+    }
+
+    @undoBatch
+    @action
+    changeColumns = (oldKey: string, newKey: string, addNew: boolean) => {
+        const columns = this.columns;
+        if (columns === undefined) {
+            this.columns = new List<SchemaHeaderField>([new SchemaHeaderField(newKey, "f1efeb")]);
+        } else {
+            if (addNew) {
+                columns.push(new SchemaHeaderField(newKey, "f1efeb"));
+                this.columns = columns;
+            } else {
+                const index = columns.map(c => c.heading).indexOf(oldKey);
+                if (index > -1) {
+                    const column = columns[index];
+                    column.setHeading(newKey);
+                    columns[index] = column;
+                    this.columns = columns;
+                }
+            }
+        }
+    }
+
+    getColumnType = (column: SchemaHeaderField): ColumnType => {
+        // added functionality to convert old column type stuff to new column type stuff -syip
+        if (column.type && column.type !== 0) {
+            return column.type;
+        }
+        if (columnTypes.get(column.heading)) {
+            column.type = columnTypes.get(column.heading)!;
+            return columnTypes.get(column.heading)!;
+        }
+        const typesDoc = FieldValue(Cast(this.props.Document.schemaColumnTypes, Doc));
+        if (!typesDoc) {
+            column.type = ColumnType.Any;
+            return ColumnType.Any;
+        }
+        column.type = NumCast(typesDoc[column.heading]);
+        return NumCast(typesDoc[column.heading]);
+    }
+
+    @undoBatch
+    setColumnType = (columnField: SchemaHeaderField, type: ColumnType): void => {
+        if (columnTypes.get(columnField.heading)) return;
+
+        const columns = this.columns;
+        const index = columns.indexOf(columnField);
+        if (index > -1) {
+            columnField.setType(NumCast(type));
+            columns[index] = columnField;
+            this.columns = columns;
+        }
+    }
+
+    @undoBatch
+    setColumnColor = (columnField: SchemaHeaderField, color: string): void => {
+        const columns = this.columns;
+        const index = columns.indexOf(columnField);
+        if (index > -1) {
+            columnField.setColor(color);
+            columns[index] = columnField;
+            this.columns = columns; // need to set the columns to trigger rerender
+        }
+    }
+
+    @action
+    setColumns = (columns: SchemaHeaderField[]) => this.columns = columns
+
+    @undoBatch
+    reorderColumns = (toMove: SchemaHeaderField, relativeTo: SchemaHeaderField, before: boolean, columnsValues: SchemaHeaderField[]) => {
+        const columns = [...columnsValues];
+        const oldIndex = columns.indexOf(toMove);
+        const relIndex = columns.indexOf(relativeTo);
+        const newIndex = (oldIndex > relIndex && !before) ? relIndex + 1 : (oldIndex < relIndex && before) ? relIndex - 1 : relIndex;
+
+        if (oldIndex === newIndex) return;
+
+        columns.splice(newIndex, 0, columns.splice(oldIndex, 1)[0]);
+        this.columns = columns;
+    }
+
+    @undoBatch
+    @action
+    setColumnSort = (columnField: SchemaHeaderField, descending: boolean | undefined) => {
+        const columns = this.columns;
+        const index = columns.findIndex(c => c.heading === columnField.heading);
+        const column = columns[index];
+        column.setDesc(descending);
+        columns[index] = column;
+        this.columns = columns;
+    }
+
+    get documentKeys() {
+        const docs = this.childDocs;
+        const keys: { [key: string]: boolean } = {};
+        // bcz: ugh.  this is untracked since otherwise a large collection of documents will blast the server for all their fields.
+        //  then as each document's fields come back, we update the documents _proxies.  Each time we do this, the whole schema will be
+        //  invalidated and re-rendered.   This workaround will inquire all of the document fields before the options button is clicked.
+        //  then by the time the options button is clicked, all of the fields should be in place.  If a new field is added while this menu
+        //  is displayed (unlikely) it won't show up until something else changes.
+        //TODO Types
+        untracked(() => docs.map(doc => Doc.GetAllPrototypes(doc).map(proto => Object.keys(proto).forEach(key => keys[key] = false))));
+
+        this.columns.forEach(key => keys[key.heading] = true);
+        return Array.from(Object.keys(keys));
+    }
+
+    @undoBatch
+    @action
+    toggleTextwrap = async () => {
+        const textwrappedRows = Cast(this.props.Document.textwrappedSchemaRows, listSpec("string"), []);
+        if (textwrappedRows.length) {
+            this.props.Document.textwrappedSchemaRows = new List<string>([]);
+        } else {
+            const docs = DocListCast(this.props.Document[this.props.fieldKey]);
+            const allRows = docs instanceof Doc ? [docs[Id]] : docs.map(doc => doc[Id]);
+            this.props.Document.textwrappedSchemaRows = new List<string>(allRows);
+        }
+    }
+
+    @action
+    toggleTextWrapRow = (doc: Doc): void => {
+        const textWrapped = this.textWrappedRows;
+        const index = textWrapped.findIndex(id => doc[Id] === id);
+
+        index > -1 ? textWrapped.splice(index, 1) : textWrapped.push(doc[Id]);
+
+        this.textWrappedRows = textWrapped;
+    }
+
+    @computed
+    get reactTable() {
+        const children = this.childDocs;
+        const hasCollectionChild = children.reduce((found, doc) => found || doc.type === "collection", false);
+        const expandedRowsList = this._openCollections.map(col => children.findIndex(doc => doc[Id] === col).toString());
+        const expanded = {};
+        //@ts-ignore
+        expandedRowsList.forEach(row => expanded[row] = true);
+        const rerender = [...this.textWrappedRows]; // TODO: get component to rerender on text wrap change without needign to console.log :((((
+
+        return <ReactTable
+            style={{ position: "relative" }}
+            data={children}
+            page={0}
+            pageSize={children.length}
+            showPagination={false}
+            columns={this.tableColumns}
+            getTrProps={this.getTrProps}
+            getTdProps={this.getTdProps}
+            sortable={false}
+            TrComponent={MovableRow}
+            sorted={this.sorted}
+            expanded={expanded}
+            resized={this.resized}
+            onResizedChange={this.onResizedChange}
+            SubComponent={!hasCollectionChild ? undefined : row => (row.original.type !== "collection") ? (null) :
+                <div className="reactTable-sub">{this.renderSchemaTable(row.original, undefined, undefined)}</div>}
+        //<div className="reactTable-sub"><SchemaTable {...this.props} Document={row.original} dataDoc={undefined} childDocs={undefined} /></div>}
+
+        />;
+    }
+
+    onResizedChange = (newResized: Resize[], event: any) => {
+        const columns = this.columns;
+        newResized.forEach(resized => {
+            const index = columns.findIndex(c => c.heading === resized.id);
+            const column = columns[index];
+            column.setWidth(resized.value);
+            columns[index] = column;
+        });
+        this.columns = columns;
+    }
+
+    onContextMenu = (e: React.MouseEvent): void => {
+        if (!e.isPropagationStopped() && this.props.Document[Id] !== "mainDoc") { // need to test this because GoldenLayout causes a parallel hierarchy in the React DOM for its children and the main document view7
+            // ContextMenu.Instance.addItem({ description: "Make DB", event: this.makeDB, icon: "table" });
+            ContextMenu.Instance.addItem({ description: "Toggle text wrapping", event: this.toggleTextwrap, icon: "table" });
+        }
+    }
+
+    getField = (row: number, col?: number) => {
+        const docs = this.childDocs;
+
+        row = row % docs.length;
+        while (row < 0) row += docs.length;
+        const columns = this.columns;
+        const doc = docs[row];
+        if (col === undefined) {
+            return doc;
+        }
+        if (col >= 0 && col < columns.length) {
+            const column = this.columns[col].heading;
+            return doc[column];
+        }
+        return undefined;
+    }
+
+    createTransformer = (row: number, col: number): Transformer => {
+        const self = this;
+        const captures: { [name: string]: Field } = {};
+
+        const transformer: ts.TransformerFactory<ts.SourceFile> = context => {
+            return root => {
+                function visit(node: ts.Node) {
+                    node = ts.visitEachChild(node, visit, context);
+                    if (ts.isIdentifier(node)) {
+                        const isntPropAccess = !ts.isPropertyAccessExpression(node.parent) || node.parent.expression === node;
+                        const isntPropAssign = !ts.isPropertyAssignment(node.parent) || node.parent.name !== node;
+                        if (isntPropAccess && isntPropAssign) {
+                            if (node.text === "$r") {
+                                return ts.createNumericLiteral(row.toString());
+                            } else if (node.text === "$c") {
+                                return ts.createNumericLiteral(col.toString());
+                            } else if (node.text === "$") {
+                                if (ts.isCallExpression(node.parent)) {
+                                    // captures.doc = self.props.Document;
+                                    // captures.key = self.props.fieldKey;
+                                }
+                            }
+                        }
+                    }
+
+                    return node;
+                }
+                return ts.visitNode(root, visit);
+            };
+        };
+
+        // const getVars = () => {
+        //     return { capturedVariables: captures };
+        // };
+
+        return { transformer, /*getVars*/ };
+    }
+
+    setComputed = (script: string, doc: Doc, field: string, row: number, col: number): boolean => {
+        script =
+            `const $ = (row:number, col?:number) => {
+                if(col === undefined) {
+                    return (doc as any)[key][row + ${row}];
+                }
+                return (doc as any)[key][row + ${row}][(doc as any).schemaColumns[col + ${col}].heading];
+            }
+            return ${script}`;
+        const compiled = CompileScript(script, { params: { this: Doc.name }, capturedVariables: { doc: this.props.Document, key: this.props.fieldKey }, typecheck: false, transformer: this.createTransformer(row, col) });
+        if (compiled.compiled) {
+            doc[field] = new ComputedField(compiled);
+            return true;
+        }
+        return false;
+    }
+
+    @action
+    showDoc = (doc: Doc | undefined, dataDoc?: Doc, screenX?: number, screenY?: number) => {
+        this._showDoc = doc;
+        if (dataDoc && screenX && screenY) {
+            this._showDocPos = this.props.ScreenToLocalTransform().transformPoint(screenX, screenY);
+        }
+    }
+
+    onOpenClick = () => {
+        if (this._showDoc) {
+            this.props.addDocTab(this._showDoc, "onRight");
+        }
+    }
+
+    getPreviewTransform = (): Transform => {
+        return this.props.ScreenToLocalTransform().translate(- this.borderWidth - this.DIVIDER_WIDTH - this.tableWidth, - this.borderWidth);
+    }
+
+
+
+    // ADDED ENDS HERE
+    //
+    //
+
+
+
+
+
     private createTarget = (ele: HTMLDivElement) => {
         this._previewCont = ele;
         super.CreateDropTarget(ele);
@@ -103,15 +877,12 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
                 this.props.select(false);
             }
         }
+        this.headerOpen = false;
     }
 
     @computed
     get previewDocument(): Doc | undefined { return this.previewDoc; }
 
-    getPreviewTransform = (): Transform => {
-        return this.props.ScreenToLocalTransform().translate(- this.borderWidth - this.DIVIDER_WIDTH - this.tableWidth, - this.borderWidth);
-    }
-
     @computed
     get dividerDragger() {
         return this.previewWidth() === 0 ? (null) :
@@ -152,32 +923,90 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         </div>;
     }
 
+
+    // this is added too
+    renderSchemaTable = (Document: any, dataDoc: any, childDocs: any) => {
+        return <div className="collectionSchemaView-table" onPointerDown={this.onPointDown} onWheel={e => this.props.active(true) && e.stopPropagation()} onDrop={e => this.onExternalDrop(e, {})} onContextMenu={this.onContextMenu} >
+            {this.reactTable}
+            <div className="collectionSchemaView-addRow" onClick={() => this.createRow()}>+ new</div>
+            {!this._showDoc ? (null) :
+                <div className="collectionSchemaView-documentPreview" //onClick={() => { this.onOpenClick(); }}
+                    style={{
+                        position: "absolute", width: 150, height: 150,
+                        background: "dimGray", display: "block", top: 0, left: 0,
+                        transform: `translate(${this._showDocPos[0]}px, ${this._showDocPos[1] - 180}px)`
+                    }}
+                    ref="overlay"><ContentFittingDocumentView
+                        Document={Document}
+                        DataDoc={dataDoc}
+                        NativeHeight={returnZero}
+                        NativeWidth={returnZero}
+                        fitToBox={true}
+                        FreezeDimensions={true}
+                        focus={emptyFunction}
+                        LibraryPath={emptyPath}
+                        renderDepth={this.props.renderDepth}
+                        rootSelected={() => false}
+                        PanelWidth={() => 150}
+                        PanelHeight={() => 150}
+                        ScreenToLocalTransform={this.getPreviewTransform}
+                        docFilters={returnEmptyFilter}
+                        ContainingCollectionDoc={this.props.CollectionView?.props.Document}
+                        ContainingCollectionView={this.props.CollectionView}
+                        moveDocument={this.props.moveDocument}
+                        parentActive={this.props.active}
+                        whenActiveChanged={emptyFunction}
+                        addDocTab={this.props.addDocTab}
+                        pinToPres={this.props.pinToPres}
+                        bringToFront={returnFalse}
+                        ContentScaling={returnOne}>
+                    </ContentFittingDocumentView>
+                </div>}
+        </div>;
+    }
+
+
+    // changed to render schema table
     @computed
     get schemaTable() {
-        return <SchemaTable
-            Document={this.props.Document}
-            PanelHeight={this.props.PanelHeight}
-            PanelWidth={this.props.PanelWidth}
-            childDocs={this.childDocs}
-            CollectionView={this.props.CollectionView}
-            ContainingCollectionView={this.props.ContainingCollectionView}
-            ContainingCollectionDoc={this.props.ContainingCollectionDoc}
-            fieldKey={this.props.fieldKey}
-            renderDepth={this.props.renderDepth}
-            moveDocument={this.props.moveDocument}
-            ScreenToLocalTransform={this.props.ScreenToLocalTransform}
-            active={this.props.active}
-            onDrop={this.onExternalDrop}
-            addDocTab={this.props.addDocTab}
-            pinToPres={this.props.pinToPres}
-            isSelected={this.props.isSelected}
-            isFocused={this.isFocused}
-            setFocused={this.setFocused}
-            setPreviewDoc={this.setPreviewDoc}
-            deleteDocument={this.props.removeDocument}
-            addDocument={this.props.addDocument}
-            dataDoc={this.props.DataDoc}
-        />;
+        const preview = "";
+        return <div className="collectionSchemaView-table" onPointerDown={this.onPointDown} onWheel={e => this.props.active(true) && e.stopPropagation()} onDrop={e => this.onExternalDrop(e, {})} onContextMenu={this.onContextMenu} >
+            {this.reactTable}
+            <div className="collectionSchemaView-addRow" onClick={() => this.createRow()}>+ new</div>
+            {!this._showDoc ? (null) :
+                <div className="collectionSchemaView-documentPreview" //onClick={() => { this.onOpenClick(); }}
+                    style={{
+                        position: "absolute", width: 150, height: 150,
+                        background: "dimGray", display: "block", top: 0, left: 0,
+                        transform: `translate(${this._showDocPos[0]}px, ${this._showDocPos[1] - 180}px)`
+                    }}
+                    ref="overlay"><ContentFittingDocumentView
+                        Document={this._showDoc}
+                        DataDoc={this._showDataDoc}
+                        NativeHeight={returnZero}
+                        NativeWidth={returnZero}
+                        fitToBox={true}
+                        FreezeDimensions={true}
+                        focus={emptyFunction}
+                        LibraryPath={emptyPath}
+                        renderDepth={this.props.renderDepth}
+                        rootSelected={() => false}
+                        PanelWidth={() => 150}
+                        PanelHeight={() => 150}
+                        ScreenToLocalTransform={this.getPreviewTransform}
+                        docFilters={returnEmptyFilter}
+                        ContainingCollectionDoc={this.props.CollectionView?.props.Document}
+                        ContainingCollectionView={this.props.CollectionView}
+                        moveDocument={this.props.moveDocument}
+                        parentActive={this.props.active}
+                        whenActiveChanged={emptyFunction}
+                        addDocTab={this.props.addDocTab}
+                        pinToPres={this.props.pinToPres}
+                        bringToFront={returnFalse}
+                        ContentScaling={returnOne}>
+                    </ContentFittingDocumentView>
+                </div>}
+        </div>;
     }
 
     @computed
@@ -200,10 +1029,21 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
             </div>
             {this.dividerDragger}
             {!this.previewWidth() ? (null) : this.previewPanel}
+            {this.headerOpen ? this.renderMenu : null}
         </div>;
     }
 }
 
+
+
+
+
+
+
+
+
+
+
 export interface SchemaTableProps {
     Document: Doc; // child doc
     dataDoc?: Doc;
@@ -290,6 +1130,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
 
     @computed get borderWidth() { return Number(COLLECTION_BORDER_WIDTH); }
     @computed get tableColumns(): Column<Doc>[] {
+
         const possibleKeys = this.documentKeys.filter(key => this.columns.findIndex(existingKey => existingKey.heading.toUpperCase() === key.toUpperCase()) === -1);
         const columns: Column<Doc>[] = [];
         const tableIsFocused = this.props.isFocused(this.props.Document);
@@ -323,25 +1164,27 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
 
 
 
-            const header = <div className="collectionSchemaView-header" style={{ background: col.color }}>
-                <CollectionSchemaColumnMenu
-                    columnField={col}
-                    // keyValue={this.props.keyValue.heading}
-                    possibleKeys={possibleKeys}
-                    existingKeys={this.columns.map(c => c.heading)}
-                    // keyType={this.getColumnType(col)}
-                    typeConst={columnTypes.get(col.heading) !== undefined}
-                    menuButtonContent={<div><FontAwesomeIcon icon={icon} size="sm" />{col.heading}</div>}
-                    addNew={false}
-                    onSelect={this.changeColumns}
-                    setIsEditing={this.setHeaderIsEditing}
-                    deleteColumn={this.deleteColumn}
-                    onlyShowOptions={false}
-                    setColumnType={this.setColumnType}
-                    setColumnSort={this.setColumnSort}
-                    setColumnColor={this.setColumnColor}
-                />
-            </div>;
+            const header = <div><FontAwesomeIcon icon={icon} size="sm" />{col.heading}</div>;
+
+            // <div className="collectionSchemaView-header" style={{ background: col.color }}>
+            //     <CollectionSchemaColumnMenu
+            //         columnField={col}
+            //         // keyValue={this.props.keyValue.heading}
+            //         possibleKeys={possibleKeys}
+            //         existingKeys={this.columns.map(c => c.heading)}
+            //         // keyType={this.getColumnType(col)}
+            //         typeConst={columnTypes.get(col.heading) !== undefined}
+            //         menuButtonContent={<div><FontAwesomeIcon icon={icon} size="sm" />{col.heading}</div>}
+            //         addNew={false}
+            //         onSelect={this.changeColumns}
+            //         setIsEditing={this.setHeaderIsEditing}
+            //         deleteColumn={this.deleteColumn}
+            //         onlyShowOptions={false}
+            //         setColumnType={this.setColumnType}
+            //         setColumnSort={this.setColumnSort}
+            //         setColumnColor={this.setColumnColor}
+            //     />
+            // </div>;
 
 
             // <CollectionSchemaHeader
-- 
cgit v1.2.3-70-g09d2


From d574ca2449e762fd827eb9fe6e8cbb46134844a7 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Wed, 24 Jun 2020 21:04:42 -0500
Subject: moving things around to schema table

---
 .../views/collections/CollectionSchemaView.tsx     | 1209 +++++---------------
 1 file changed, 281 insertions(+), 928 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 18a53541d..4f87420d2 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -68,6 +68,28 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     @observable pointerY: number = 0;
     @computed get menuCoordinates() { return this.props.ScreenToLocalTransform().transformPoint(this.pointerX, this.pointerY); }
 
+    @computed get columns() {
+        return Cast(this.props.Document.schemaColumns, listSpec(SchemaHeaderField), []);
+    }
+    set columns(columns: SchemaHeaderField[]) {
+        this.props.Document.schemaColumns = new List<SchemaHeaderField>(columns);
+    }
+
+    get documentKeys() {
+        const docs = this.childDocs;
+        const keys: { [key: string]: boolean } = {};
+        // bcz: ugh.  this is untracked since otherwise a large collection of documents will blast the server for all their fields.
+        //  then as each document's fields come back, we update the documents _proxies.  Each time we do this, the whole schema will be
+        //  invalidated and re-rendered.   This workaround will inquire all of the document fields before the options button is clicked.
+        //  then by the time the options button is clicked, all of the fields should be in place.  If a new field is added while this menu
+        //  is displayed (unlikely) it won't show up until something else changes.
+        //TODO Types
+        untracked(() => docs.map(doc => Doc.GetAllPrototypes(doc).map(proto => Object.keys(proto).forEach(key => keys[key] = false))));
+
+        this.columns.forEach(key => keys[key.heading] = true);
+        return Array.from(Object.keys(keys));
+    }
+
     @observable col: any = "";
     @computed get possibleKeys() { return this.documentKeys.filter(key => this.columns.findIndex(existingKey => existingKey.heading.toUpperCase() === key.toUpperCase()) === -1); }
 
@@ -77,16 +99,18 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     @observable private _isOpen: boolean = false;
     @observable private _node: HTMLDivElement | null = null;
 
+    @observable _headerIsEditing: boolean = false;
+
     componentDidMount() {
         document.addEventListener("pointerdown", this.detectClick);
-        document.addEventListener("keydown", this.onKeyDown);
     }
 
     componentWillUnmount() {
         document.removeEventListener("pointerdown", this.detectClick);
-        document.removeEventListener("keydown", this.onKeyDown);
     }
 
+    @action setHeaderIsEditing = (isEditing: boolean) => this._headerIsEditing = isEditing;
+
     detectClick = (e: PointerEvent): void => {
         if (this._node && this._node.contains(e.target as Node)) {
         } else {
@@ -101,6 +125,9 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         this.setHeaderIsEditing(this._isOpen);
     }
 
+
+
+
     changeColumnType = (type: ColumnType, col: any): void => {
         this.setColumnType(col, type);
     }
@@ -113,6 +140,43 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         this.setColumnColor(col, color);
     }
 
+    @undoBatch
+    setColumnType = (columnField: SchemaHeaderField, type: ColumnType): void => {
+        if (columnTypes.get(columnField.heading)) return;
+
+        const columns = this.columns;
+        const index = columns.indexOf(columnField);
+        if (index > -1) {
+            columnField.setType(NumCast(type));
+            columns[index] = columnField;
+            this.columns = columns;
+        }
+    }
+
+    @undoBatch
+    setColumnColor = (columnField: SchemaHeaderField, color: string): void => {
+        const columns = this.columns;
+        const index = columns.indexOf(columnField);
+        if (index > -1) {
+            columnField.setColor(color);
+            columns[index] = columnField;
+            this.columns = columns; // need to set the columns to trigger rerender
+        }
+    }
+
+    @undoBatch
+    @action
+    setColumnSort = (columnField: SchemaHeaderField, descending: boolean | undefined) => {
+        const columns = this.columns;
+        const index = columns.findIndex(c => c.heading === columnField.heading);
+        const column = columns[index];
+        column.setDesc(descending);
+        columns[index] = column;
+        this.columns = columns;
+    }
+
+
+
     @action
     setNode = (node: HTMLDivElement): void => {
         if (node) {
@@ -209,6 +273,35 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         );
     }
 
+    @undoBatch
+    @action
+    changeColumns = (oldKey: string, newKey: string, addNew: boolean) => {
+        const columns = this.columns;
+        if (columns === undefined) {
+            this.columns = new List<SchemaHeaderField>([new SchemaHeaderField(newKey, "f1efeb")]);
+        } else {
+            if (addNew) {
+                columns.push(new SchemaHeaderField(newKey, "f1efeb"));
+                this.columns = columns;
+            } else {
+                const index = columns.map(c => c.heading).indexOf(oldKey);
+                if (index > -1) {
+                    const column = columns[index];
+                    column.setHeading(newKey);
+                    columns[index] = column;
+                    this.columns = columns;
+                }
+            }
+        }
+    }
+
+    @action
+    openHeader = (col: any, menu: any) => {
+        this.menuContent = menu;
+        this.col = col;
+        this.headerOpen = !this.headerOpen;
+    }
+
     renderContent = (col: any) => {
         return (
             <div className="collectionSchema-header-menuOptions">
@@ -238,6 +331,24 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         );
     }
 
+    @undoBatch
+    @action
+    deleteColumn = (key: string) => {
+        const columns = this.columns;
+        if (columns === undefined) {
+            this.columns = new List<SchemaHeaderField>([]);
+        } else {
+            const index = columns.map(c => c.heading).indexOf(key);
+            if (index > -1) {
+                columns.splice(index, 1);
+                this.columns = columns;
+            }
+        }
+    }
+
+    getPreviewTransform = (): Transform => {
+        return this.props.ScreenToLocalTransform().translate(- this.borderWidth - 4 - this.tableWidth, - this.borderWidth);
+    }
 
     //anchorPoints.TOP_CENTER 
 
@@ -256,757 +367,125 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         );
     }
 
-
-
-
-
-
-
-
-
-
-
-
-
-    // ADDED START HEREE
-    //
-    //
-    //
-
-    @observable _headerIsEditing: boolean = false;
-    @observable _cellIsEditing: boolean = false;
-    @observable _focusedCell: { row: number, col: number } = { row: 0, col: 0 };
-    @observable _openCollections: Array<string> = [];
-
-    @observable _showDoc: Doc | undefined;
-    @observable _showDataDoc: any = "";
-    @observable _showDocPos: number[] = [];
-
-    @computed get columns() {
-        return Cast(this.props.Document.schemaColumns, listSpec(SchemaHeaderField), []);
-    }
-    set columns(columns: SchemaHeaderField[]) {
-        this.props.Document.schemaColumns = new List<SchemaHeaderField>(columns);
+    private createTarget = (ele: HTMLDivElement) => {
+        this._previewCont = ele;
+        super.CreateDropTarget(ele);
     }
 
-    // @computed get childDocs() {
-    //     if (this.childDocs) return this.childDocs;
+    isFocused = (doc: Doc): boolean => this.props.isSelected() && doc === this._focusedTable;
 
-    //     const doc = this.props.DataDoc ? this.props.DataDoc : this.props.Document;
-    //     return DocListCast(doc[this.props.fieldKey]);
-    // }
+    @action setFocused = (doc: Doc) => this._focusedTable = doc;
 
-    set childDocs(docs: Doc[]) {
-        const doc = this.props.DataDoc ? this.props.DataDoc : this.props.Document;
-        doc[this.props.fieldKey] = new List<Doc>(docs);
-    }
+    @action setPreviewDoc = (doc: Doc) => this.previewDoc = doc;
 
-    @computed get textWrappedRows() {
-        return Cast(this.props.Document.textwrappedSchemaRows, listSpec("string"), []);
-    }
-    set textWrappedRows(textWrappedRows: string[]) {
-        this.props.Document.textwrappedSchemaRows = new List<string>(textWrappedRows);
+    //toggles preview side-panel of schema
+    @action
+    toggleExpander = () => {
+        this.props.Document.schemaPreviewWidth = this.previewWidth() === 0 ? Math.min(this.tableWidth / 3, 200) : 0;
     }
 
-    @computed get resized(): { id: string, value: number }[] {
-        return this.columns.reduce((resized, shf) => {
-            (shf.width > -1) && resized.push({ id: shf.heading, value: shf.width });
-            return resized;
-        }, [] as { id: string, value: number }[]);
-    }
-    @computed get sorted(): SortingRule[] {
-        return this.columns.reduce((sorted, shf) => {
-            shf.desc && sorted.push({ id: shf.heading, desc: shf.desc });
-            return sorted;
-        }, [] as SortingRule[]);
+    onDividerDown = (e: React.PointerEvent) => {
+        setupMoveUpEvents(this, e, this.onDividerMove, emptyFunction, action(() => this.toggleExpander()));
     }
-
     @action
-    openHeader = (col: any, menu: any) => {
-        this.menuContent = menu;
-        this.col = col;
-        this.headerOpen = !this.headerOpen;
+    onDividerMove = (e: PointerEvent, down: number[], delta: number[]) => {
+        const nativeWidth = this._previewCont!.getBoundingClientRect();
+        const minWidth = 40;
+        const maxWidth = 1000;
+        const movedWidth = this.props.ScreenToLocalTransform().transformDirection(nativeWidth.right - e.clientX, 0)[0];
+        const width = movedWidth < minWidth ? minWidth : movedWidth > maxWidth ? maxWidth : movedWidth;
+        this.props.Document.schemaPreviewWidth = width;
+        return false;
     }
 
-    @computed get tableColumns(): Column<Doc>[] {
-        const columns: Column<Doc>[] = [];
-        const tableIsFocused = this.isFocused(this.props.Document);
-        const focusedRow = this._focusedCell.row;
-        const focusedCol = this._focusedCell.col;
-        const isEditable = !this._headerIsEditing;
-
-        if (this.childDocs.reduce((found, doc) => found || doc.type === "collection", false)) {
-            columns.push(
-                {
-                    expander: true,
-                    Header: "",
-                    width: 30,
-                    Expander: (rowInfo) => {
-                        if (rowInfo.original.type === "collection") {
-                            if (rowInfo.isExpanded) return <div className="collectionSchemaView-expander" onClick={() => this.onCloseCollection(rowInfo.original)}><FontAwesomeIcon icon={"sort-up"} size="sm" /></div>;
-                            if (!rowInfo.isExpanded) return <div className="collectionSchemaView-expander" onClick={() => this.onExpandCollection(rowInfo.original)}><FontAwesomeIcon icon={"sort-down"} size="sm" /></div>;
-                        } else {
-                            return null;
-                        }
-                    }
-                }
-            );
+    onPointerDown = (e: React.PointerEvent): void => {
+        if (e.button === 0 && !e.altKey && !e.ctrlKey && !e.metaKey) {
+            if (this.props.isSelected(true)) e.stopPropagation();
+            else {
+                this.props.select(false);
+            }
         }
+        this.headerOpen = false;
+    }
 
-        const cols = this.columns.map(col => {
-
-            const icon: IconProp = this.getColumnType(col) === ColumnType.Number ? "hashtag" : this.getColumnType(col) === ColumnType.String ? "font" :
-                this.getColumnType(col) === ColumnType.Boolean ? "check-square" : this.getColumnType(col) === ColumnType.Doc ? "file" :
-                    this.getColumnType(col) === ColumnType.Image ? "image" : this.getColumnType(col) === ColumnType.List ? "list-ul" : "align-justify";
-
-            // this.menuContent = <div><FontAwesomeIcon icon={icon} size="sm" />{col.heading}</div>;
-
-            const menuContent = <div><FontAwesomeIcon icon={icon} size="sm" />{col.heading}</div>;
-
-            // this.col = col;
-
-            const header =
-                <div className="collectionSchemaView-header"
-                    onClick={e => { this.openHeader(col, menuContent); }}
-                    style={{ background: col.color }}>
-                    {menuContent}
-                </div>;
-
-
-            // <CollectionSchemaHeader
-            //     keyValue={col}
-            //     possibleKeys={possibleKeys}
-            //     existingKeys={this.columns.map(c => c.heading)}
-            //     keyType={this.getColumnType(col)}
-            //     typeConst={columnTypes.get(col.heading) !== undefined}
-            //     onSelect={this.changeColumns}
-            //     setIsEditing={this.setHeaderIsEditing}
-            //     deleteColumn={this.deleteColumn}
-            //     setColumnType={this.setColumnType}
-            //     setColumnSort={this.setColumnSort}
-            //     setColumnColor={this.setColumnColor}
-            // />;
-
+    @computed
+    get previewDocument(): Doc | undefined { return this.previewDoc; }
 
-            return {
-                Header: <MovableColumn columnRenderer={header} columnValue={col} allColumns={this.columns} reorderColumns={this.reorderColumns} ScreenToLocalTransform={this.props.ScreenToLocalTransform} />,
-                accessor: (doc: Doc) => doc ? doc[col.heading] : 0,
-                id: col.heading,
-                Cell: (rowProps: CellInfo) => {
-                    const rowIndex = rowProps.index;
-                    const columnIndex = this.columns.map(c => c.heading).indexOf(rowProps.column.id!);
-                    const isFocused = focusedRow === rowIndex && focusedCol === columnIndex && tableIsFocused;
-
-                    const props: CellProps = {
-                        row: rowIndex,
-                        col: columnIndex,
-                        rowProps: rowProps,
-                        isFocused: isFocused,
-                        changeFocusedCellByIndex: this.changeFocusedCellByIndex,
-                        CollectionView: this.props.CollectionView,
-                        ContainingCollection: this.props.ContainingCollectionView,
-                        Document: this.props.Document,
-                        fieldKey: this.props.fieldKey,
-                        renderDepth: this.props.renderDepth,
-                        addDocTab: this.props.addDocTab,
-                        pinToPres: this.props.pinToPres,
-                        moveDocument: this.props.moveDocument,
-                        setIsEditing: this.setCellIsEditing,
-                        isEditable: isEditable,
-                        setPreviewDoc: this.setPreviewDoc,
-                        setComputed: this.setComputed,
-                        getField: this.getField,
-                        showDoc: this.showDoc,
-                    };
-
-                    const colType = this.getColumnType(col);
-                    if (colType === ColumnType.Number) return <CollectionSchemaNumberCell {...props} />;
-                    if (colType === ColumnType.String) return <CollectionSchemaStringCell {...props} />;
-                    if (colType === ColumnType.Boolean) return <CollectionSchemaCheckboxCell {...props} />;
-                    if (colType === ColumnType.Doc) return <CollectionSchemaDocCell {...props} />;
-                    if (colType === ColumnType.Image) return <CollectionSchemaImageCell {...props} />;
-                    if (colType === ColumnType.List) return <CollectionSchemaListCell {...props} />;
-                    return <CollectionSchemaCell {...props} />;
-                },
-                minWidth: 200,
-            };
-        });
-        columns.push(...cols);
-
-        columns.push({
-            Header: <CollectionSchemaAddColumnHeader createColumn={this.createColumn} />,
-            accessor: (doc: Doc) => 0,
-            id: "add",
-            Cell: (rowProps: CellInfo) => <></>,
-            width: 28,
-            resizable: false
-        });
-        return columns;
-    }
-
-    tableAddDoc = (doc: Doc, relativeTo?: Doc, before?: boolean) => {
-        return Doc.AddDocToList(this.props.Document, this.props.fieldKey, doc, relativeTo, before);
-    }
-
-    private getTrProps: ComponentPropsGetterR = (state, rowInfo) => {
-        return !rowInfo ? {} : {
-            ScreenToLocalTransform: this.props.ScreenToLocalTransform,
-            addDoc: this.tableAddDoc,
-            removeDoc: this.props.removeDocument,
-            rowInfo,
-            rowFocused: !this._headerIsEditing && rowInfo.index === this._focusedCell.row && this.isFocused(this.props.Document),
-            textWrapRow: this.toggleTextWrapRow,
-            rowWrapped: this.textWrappedRows.findIndex(id => rowInfo.original[Id] === id) > -1,
-            dropAction: StrCast(this.props.Document.childDropAction),
-            addDocTab: this.props.addDocTab
-        };
-    }
-
-    private getTdProps: ComponentPropsGetterR = (state, rowInfo, column, instance) => {
-        if (!rowInfo || column) return {};
-
-        const row = rowInfo.index;
-        //@ts-ignore
-        const col = this.columns.map(c => c.heading).indexOf(column!.id);
-        const isFocused = this._focusedCell.row === row && this._focusedCell.col === col && this.isFocused(this.props.Document);
-        // TODO: editing border doesn't work :(
-        return {
-            style: {
-                border: !this._headerIsEditing && isFocused ? "2px solid rgb(255, 160, 160)" : "1px solid #f1efeb"
-            }
-        };
-    }
-
-    @action
-    onCloseCollection = (collection: Doc): void => {
-        const index = this._openCollections.findIndex(col => col === collection[Id]);
-        if (index > -1) this._openCollections.splice(index, 1);
-    }
-
-    @action onExpandCollection = (collection: Doc) => this._openCollections.push(collection[Id]);
-    @action setCellIsEditing = (isEditing: boolean) => this._cellIsEditing = isEditing;
-    @action setHeaderIsEditing = (isEditing: boolean) => this._headerIsEditing = isEditing;
-
-    @action
-    onPointDown = (e: React.PointerEvent): void => {
-        this.setFocused(this.props.Document);
-        if (e.button === 0 && !e.altKey && !e.ctrlKey && !e.metaKey && this.props.isSelected(true)) {
-            e.stopPropagation();
-        }
-        this.pointerY = e.screenY;
-        this.pointerX = e.screenX;
-        this.headerOpen = false;
-    }
-
-    @action
-    onKeyDown = (e: KeyboardEvent): void => {
-        if (!this._cellIsEditing && !this._headerIsEditing && this.isFocused(this.props.Document)) {// && this.props.isSelected(true)) {
-            const direction = e.key === "Tab" ? "tab" : e.which === 39 ? "right" : e.which === 37 ? "left" : e.which === 38 ? "up" : e.which === 40 ? "down" : "";
-            this._focusedCell = this.changeFocusedCellByDirection(direction, this._focusedCell.row, this._focusedCell.col);
-
-            const pdoc = FieldValue(this.childDocs[this._focusedCell.row]);
-            pdoc && this.setPreviewDoc(pdoc);
-        }
-    }
-
-    changeFocusedCellByDirection = (direction: string, curRow: number, curCol: number) => {
-        switch (direction) {
-            case "tab": return { row: (curRow + 1 === this.childDocs.length ? 0 : curRow + 1), col: curCol + 1 === this.columns.length ? 0 : curCol + 1 };
-            case "right": return { row: curRow, col: curCol + 1 === this.columns.length ? curCol : curCol + 1 };
-            case "left": return { row: curRow, col: curCol === 0 ? curCol : curCol - 1 };
-            case "up": return { row: curRow === 0 ? curRow : curRow - 1, col: curCol };
-            case "down": return { row: curRow + 1 === this.childDocs.length ? curRow : curRow + 1, col: curCol };
-        }
-        return this._focusedCell;
-    }
-
-    @action
-    changeFocusedCellByIndex = (row: number, col: number): void => {
-        if (this._focusedCell.row !== row || this._focusedCell.col !== col) {
-            this._focusedCell = { row: row, col: col };
-        }
-        this.setFocused(this.props.Document);
-    }
-
-    @undoBatch
-    createRow = () => {
-        this.props.addDocument(Docs.Create.TextDocument("", { title: "", _width: 100, _height: 30 }));
-    }
-
-    @undoBatch
-    @action
-    createColumn = () => {
-        let index = 0;
-        let found = this.columns.findIndex(col => col.heading.toUpperCase() === "New field".toUpperCase()) > -1;
-        while (found) {
-            index++;
-            found = this.columns.findIndex(col => col.heading.toUpperCase() === ("New field (" + index + ")").toUpperCase()) > -1;
-        }
-        this.columns.push(new SchemaHeaderField(`New field ${index ? "(" + index + ")" : ""}`, "#f1efeb"));
-    }
-
-    @undoBatch
-    @action
-    deleteColumn = (key: string) => {
-        const columns = this.columns;
-        if (columns === undefined) {
-            this.columns = new List<SchemaHeaderField>([]);
-        } else {
-            const index = columns.map(c => c.heading).indexOf(key);
-            if (index > -1) {
-                columns.splice(index, 1);
-                this.columns = columns;
-            }
-        }
-    }
-
-    @undoBatch
-    @action
-    changeColumns = (oldKey: string, newKey: string, addNew: boolean) => {
-        const columns = this.columns;
-        if (columns === undefined) {
-            this.columns = new List<SchemaHeaderField>([new SchemaHeaderField(newKey, "f1efeb")]);
-        } else {
-            if (addNew) {
-                columns.push(new SchemaHeaderField(newKey, "f1efeb"));
-                this.columns = columns;
-            } else {
-                const index = columns.map(c => c.heading).indexOf(oldKey);
-                if (index > -1) {
-                    const column = columns[index];
-                    column.setHeading(newKey);
-                    columns[index] = column;
-                    this.columns = columns;
-                }
-            }
-        }
-    }
-
-    getColumnType = (column: SchemaHeaderField): ColumnType => {
-        // added functionality to convert old column type stuff to new column type stuff -syip
-        if (column.type && column.type !== 0) {
-            return column.type;
-        }
-        if (columnTypes.get(column.heading)) {
-            column.type = columnTypes.get(column.heading)!;
-            return columnTypes.get(column.heading)!;
-        }
-        const typesDoc = FieldValue(Cast(this.props.Document.schemaColumnTypes, Doc));
-        if (!typesDoc) {
-            column.type = ColumnType.Any;
-            return ColumnType.Any;
-        }
-        column.type = NumCast(typesDoc[column.heading]);
-        return NumCast(typesDoc[column.heading]);
-    }
-
-    @undoBatch
-    setColumnType = (columnField: SchemaHeaderField, type: ColumnType): void => {
-        if (columnTypes.get(columnField.heading)) return;
-
-        const columns = this.columns;
-        const index = columns.indexOf(columnField);
-        if (index > -1) {
-            columnField.setType(NumCast(type));
-            columns[index] = columnField;
-            this.columns = columns;
-        }
-    }
-
-    @undoBatch
-    setColumnColor = (columnField: SchemaHeaderField, color: string): void => {
-        const columns = this.columns;
-        const index = columns.indexOf(columnField);
-        if (index > -1) {
-            columnField.setColor(color);
-            columns[index] = columnField;
-            this.columns = columns; // need to set the columns to trigger rerender
-        }
-    }
-
-    @action
-    setColumns = (columns: SchemaHeaderField[]) => this.columns = columns
-
-    @undoBatch
-    reorderColumns = (toMove: SchemaHeaderField, relativeTo: SchemaHeaderField, before: boolean, columnsValues: SchemaHeaderField[]) => {
-        const columns = [...columnsValues];
-        const oldIndex = columns.indexOf(toMove);
-        const relIndex = columns.indexOf(relativeTo);
-        const newIndex = (oldIndex > relIndex && !before) ? relIndex + 1 : (oldIndex < relIndex && before) ? relIndex - 1 : relIndex;
-
-        if (oldIndex === newIndex) return;
-
-        columns.splice(newIndex, 0, columns.splice(oldIndex, 1)[0]);
-        this.columns = columns;
-    }
-
-    @undoBatch
-    @action
-    setColumnSort = (columnField: SchemaHeaderField, descending: boolean | undefined) => {
-        const columns = this.columns;
-        const index = columns.findIndex(c => c.heading === columnField.heading);
-        const column = columns[index];
-        column.setDesc(descending);
-        columns[index] = column;
-        this.columns = columns;
-    }
-
-    get documentKeys() {
-        const docs = this.childDocs;
-        const keys: { [key: string]: boolean } = {};
-        // bcz: ugh.  this is untracked since otherwise a large collection of documents will blast the server for all their fields.
-        //  then as each document's fields come back, we update the documents _proxies.  Each time we do this, the whole schema will be
-        //  invalidated and re-rendered.   This workaround will inquire all of the document fields before the options button is clicked.
-        //  then by the time the options button is clicked, all of the fields should be in place.  If a new field is added while this menu
-        //  is displayed (unlikely) it won't show up until something else changes.
-        //TODO Types
-        untracked(() => docs.map(doc => Doc.GetAllPrototypes(doc).map(proto => Object.keys(proto).forEach(key => keys[key] = false))));
-
-        this.columns.forEach(key => keys[key.heading] = true);
-        return Array.from(Object.keys(keys));
-    }
-
-    @undoBatch
-    @action
-    toggleTextwrap = async () => {
-        const textwrappedRows = Cast(this.props.Document.textwrappedSchemaRows, listSpec("string"), []);
-        if (textwrappedRows.length) {
-            this.props.Document.textwrappedSchemaRows = new List<string>([]);
-        } else {
-            const docs = DocListCast(this.props.Document[this.props.fieldKey]);
-            const allRows = docs instanceof Doc ? [docs[Id]] : docs.map(doc => doc[Id]);
-            this.props.Document.textwrappedSchemaRows = new List<string>(allRows);
-        }
-    }
-
-    @action
-    toggleTextWrapRow = (doc: Doc): void => {
-        const textWrapped = this.textWrappedRows;
-        const index = textWrapped.findIndex(id => doc[Id] === id);
-
-        index > -1 ? textWrapped.splice(index, 1) : textWrapped.push(doc[Id]);
-
-        this.textWrappedRows = textWrapped;
-    }
-
-    @computed
-    get reactTable() {
-        const children = this.childDocs;
-        const hasCollectionChild = children.reduce((found, doc) => found || doc.type === "collection", false);
-        const expandedRowsList = this._openCollections.map(col => children.findIndex(doc => doc[Id] === col).toString());
-        const expanded = {};
-        //@ts-ignore
-        expandedRowsList.forEach(row => expanded[row] = true);
-        const rerender = [...this.textWrappedRows]; // TODO: get component to rerender on text wrap change without needign to console.log :((((
-
-        return <ReactTable
-            style={{ position: "relative" }}
-            data={children}
-            page={0}
-            pageSize={children.length}
-            showPagination={false}
-            columns={this.tableColumns}
-            getTrProps={this.getTrProps}
-            getTdProps={this.getTdProps}
-            sortable={false}
-            TrComponent={MovableRow}
-            sorted={this.sorted}
-            expanded={expanded}
-            resized={this.resized}
-            onResizedChange={this.onResizedChange}
-            SubComponent={!hasCollectionChild ? undefined : row => (row.original.type !== "collection") ? (null) :
-                <div className="reactTable-sub">{this.renderSchemaTable(row.original, undefined, undefined)}</div>}
-        //<div className="reactTable-sub"><SchemaTable {...this.props} Document={row.original} dataDoc={undefined} childDocs={undefined} /></div>}
-
-        />;
-    }
-
-    onResizedChange = (newResized: Resize[], event: any) => {
-        const columns = this.columns;
-        newResized.forEach(resized => {
-            const index = columns.findIndex(c => c.heading === resized.id);
-            const column = columns[index];
-            column.setWidth(resized.value);
-            columns[index] = column;
-        });
-        this.columns = columns;
-    }
-
-    onContextMenu = (e: React.MouseEvent): void => {
-        if (!e.isPropagationStopped() && this.props.Document[Id] !== "mainDoc") { // need to test this because GoldenLayout causes a parallel hierarchy in the React DOM for its children and the main document view7
-            // ContextMenu.Instance.addItem({ description: "Make DB", event: this.makeDB, icon: "table" });
-            ContextMenu.Instance.addItem({ description: "Toggle text wrapping", event: this.toggleTextwrap, icon: "table" });
-        }
-    }
-
-    getField = (row: number, col?: number) => {
-        const docs = this.childDocs;
-
-        row = row % docs.length;
-        while (row < 0) row += docs.length;
-        const columns = this.columns;
-        const doc = docs[row];
-        if (col === undefined) {
-            return doc;
-        }
-        if (col >= 0 && col < columns.length) {
-            const column = this.columns[col].heading;
-            return doc[column];
-        }
-        return undefined;
-    }
-
-    createTransformer = (row: number, col: number): Transformer => {
-        const self = this;
-        const captures: { [name: string]: Field } = {};
-
-        const transformer: ts.TransformerFactory<ts.SourceFile> = context => {
-            return root => {
-                function visit(node: ts.Node) {
-                    node = ts.visitEachChild(node, visit, context);
-                    if (ts.isIdentifier(node)) {
-                        const isntPropAccess = !ts.isPropertyAccessExpression(node.parent) || node.parent.expression === node;
-                        const isntPropAssign = !ts.isPropertyAssignment(node.parent) || node.parent.name !== node;
-                        if (isntPropAccess && isntPropAssign) {
-                            if (node.text === "$r") {
-                                return ts.createNumericLiteral(row.toString());
-                            } else if (node.text === "$c") {
-                                return ts.createNumericLiteral(col.toString());
-                            } else if (node.text === "$") {
-                                if (ts.isCallExpression(node.parent)) {
-                                    // captures.doc = self.props.Document;
-                                    // captures.key = self.props.fieldKey;
-                                }
-                            }
-                        }
-                    }
-
-                    return node;
-                }
-                return ts.visitNode(root, visit);
-            };
-        };
-
-        // const getVars = () => {
-        //     return { capturedVariables: captures };
-        // };
-
-        return { transformer, /*getVars*/ };
-    }
-
-    setComputed = (script: string, doc: Doc, field: string, row: number, col: number): boolean => {
-        script =
-            `const $ = (row:number, col?:number) => {
-                if(col === undefined) {
-                    return (doc as any)[key][row + ${row}];
-                }
-                return (doc as any)[key][row + ${row}][(doc as any).schemaColumns[col + ${col}].heading];
-            }
-            return ${script}`;
-        const compiled = CompileScript(script, { params: { this: Doc.name }, capturedVariables: { doc: this.props.Document, key: this.props.fieldKey }, typecheck: false, transformer: this.createTransformer(row, col) });
-        if (compiled.compiled) {
-            doc[field] = new ComputedField(compiled);
-            return true;
-        }
-        return false;
-    }
-
-    @action
-    showDoc = (doc: Doc | undefined, dataDoc?: Doc, screenX?: number, screenY?: number) => {
-        this._showDoc = doc;
-        if (dataDoc && screenX && screenY) {
-            this._showDocPos = this.props.ScreenToLocalTransform().transformPoint(screenX, screenY);
-        }
-    }
-
-    onOpenClick = () => {
-        if (this._showDoc) {
-            this.props.addDocTab(this._showDoc, "onRight");
-        }
-    }
-
-    getPreviewTransform = (): Transform => {
-        return this.props.ScreenToLocalTransform().translate(- this.borderWidth - this.DIVIDER_WIDTH - this.tableWidth, - this.borderWidth);
-    }
-
-
-
-    // ADDED ENDS HERE
-    //
-    //
-
-
-
-
-
-    private createTarget = (ele: HTMLDivElement) => {
-        this._previewCont = ele;
-        super.CreateDropTarget(ele);
-    }
-
-    isFocused = (doc: Doc): boolean => this.props.isSelected() && doc === this._focusedTable;
-
-    @action setFocused = (doc: Doc) => this._focusedTable = doc;
-
-    @action setPreviewDoc = (doc: Doc) => this.previewDoc = doc;
-
-    //toggles preview side-panel of schema
-    @action
-    toggleExpander = () => {
-        this.props.Document.schemaPreviewWidth = this.previewWidth() === 0 ? Math.min(this.tableWidth / 3, 200) : 0;
-    }
-
-    onDividerDown = (e: React.PointerEvent) => {
-        setupMoveUpEvents(this, e, this.onDividerMove, emptyFunction, action(() => this.toggleExpander()));
-    }
-    @action
-    onDividerMove = (e: PointerEvent, down: number[], delta: number[]) => {
-        const nativeWidth = this._previewCont!.getBoundingClientRect();
-        const minWidth = 40;
-        const maxWidth = 1000;
-        const movedWidth = this.props.ScreenToLocalTransform().transformDirection(nativeWidth.right - e.clientX, 0)[0];
-        const width = movedWidth < minWidth ? minWidth : movedWidth > maxWidth ? maxWidth : movedWidth;
-        this.props.Document.schemaPreviewWidth = width;
-        return false;
-    }
-
-    onPointerDown = (e: React.PointerEvent): void => {
-        if (e.button === 0 && !e.altKey && !e.ctrlKey && !e.metaKey) {
-            if (this.props.isSelected(true)) e.stopPropagation();
-            else {
-                this.props.select(false);
-            }
-        }
-        this.headerOpen = false;
-    }
-
-    @computed
-    get previewDocument(): Doc | undefined { return this.previewDoc; }
-
-    @computed
-    get dividerDragger() {
-        return this.previewWidth() === 0 ? (null) :
-            <div className="collectionSchemaView-dividerDragger" onPointerDown={this.onDividerDown} style={{ width: `${this.DIVIDER_WIDTH}px` }} />;
-    }
+    @computed
+    get dividerDragger() {
+        return this.previewWidth() === 0 ? (null) :
+            <div className="collectionSchemaView-dividerDragger" onPointerDown={this.onDividerDown} style={{ width: `${this.DIVIDER_WIDTH}px` }} />;
+    }
 
     @computed
     get previewPanel() {
-        return <div ref={this.createTarget} style={{ width: `${this.previewWidth()}px` }}>
-            {!this.previewDocument ? (null) :
-                <ContentFittingDocumentView
-                    Document={this.previewDocument}
-                    DataDoc={undefined}
-                    NativeHeight={returnZero}
-                    NativeWidth={returnZero}
-                    fitToBox={true}
-                    FreezeDimensions={true}
-                    focus={emptyFunction}
-                    LibraryPath={this.props.LibraryPath}
-                    renderDepth={this.props.renderDepth}
-                    rootSelected={this.rootSelected}
-                    PanelWidth={this.previewWidth}
-                    PanelHeight={this.previewHeight}
-                    ScreenToLocalTransform={this.getPreviewTransform}
-                    docFilters={this.docFilters}
-                    ContainingCollectionDoc={this.props.CollectionView?.props.Document}
-                    ContainingCollectionView={this.props.CollectionView}
-                    moveDocument={this.props.moveDocument}
-                    addDocument={this.props.addDocument}
-                    removeDocument={this.props.removeDocument}
-                    parentActive={this.props.active}
-                    whenActiveChanged={this.props.whenActiveChanged}
-                    addDocTab={this.props.addDocTab}
-                    pinToPres={this.props.pinToPres}
-                    bringToFront={returnFalse}
-                    ContentScaling={returnOne}
-                />}
-        </div>;
-    }
-
-
-    // this is added too
-    renderSchemaTable = (Document: any, dataDoc: any, childDocs: any) => {
-        return <div className="collectionSchemaView-table" onPointerDown={this.onPointDown} onWheel={e => this.props.active(true) && e.stopPropagation()} onDrop={e => this.onExternalDrop(e, {})} onContextMenu={this.onContextMenu} >
-            {this.reactTable}
-            <div className="collectionSchemaView-addRow" onClick={() => this.createRow()}>+ new</div>
-            {!this._showDoc ? (null) :
-                <div className="collectionSchemaView-documentPreview" //onClick={() => { this.onOpenClick(); }}
-                    style={{
-                        position: "absolute", width: 150, height: 150,
-                        background: "dimGray", display: "block", top: 0, left: 0,
-                        transform: `translate(${this._showDocPos[0]}px, ${this._showDocPos[1] - 180}px)`
-                    }}
-                    ref="overlay"><ContentFittingDocumentView
-                        Document={Document}
-                        DataDoc={dataDoc}
-                        NativeHeight={returnZero}
-                        NativeWidth={returnZero}
-                        fitToBox={true}
-                        FreezeDimensions={true}
-                        focus={emptyFunction}
-                        LibraryPath={emptyPath}
-                        renderDepth={this.props.renderDepth}
-                        rootSelected={() => false}
-                        PanelWidth={() => 150}
-                        PanelHeight={() => 150}
-                        ScreenToLocalTransform={this.getPreviewTransform}
-                        docFilters={returnEmptyFilter}
-                        ContainingCollectionDoc={this.props.CollectionView?.props.Document}
-                        ContainingCollectionView={this.props.CollectionView}
-                        moveDocument={this.props.moveDocument}
-                        parentActive={this.props.active}
-                        whenActiveChanged={emptyFunction}
-                        addDocTab={this.props.addDocTab}
-                        pinToPres={this.props.pinToPres}
-                        bringToFront={returnFalse}
-                        ContentScaling={returnOne}>
-                    </ContentFittingDocumentView>
-                </div>}
+        return <div ref={this.createTarget} style={{ width: `${this.previewWidth()}px` }}>
+            {!this.previewDocument ? (null) :
+                <ContentFittingDocumentView
+                    Document={this.previewDocument}
+                    DataDoc={undefined}
+                    NativeHeight={returnZero}
+                    NativeWidth={returnZero}
+                    fitToBox={true}
+                    FreezeDimensions={true}
+                    focus={emptyFunction}
+                    LibraryPath={this.props.LibraryPath}
+                    renderDepth={this.props.renderDepth}
+                    rootSelected={this.rootSelected}
+                    PanelWidth={this.previewWidth}
+                    PanelHeight={this.previewHeight}
+                    ScreenToLocalTransform={this.getPreviewTransform}
+                    docFilters={this.docFilters}
+                    ContainingCollectionDoc={this.props.CollectionView?.props.Document}
+                    ContainingCollectionView={this.props.CollectionView}
+                    moveDocument={this.props.moveDocument}
+                    addDocument={this.props.addDocument}
+                    removeDocument={this.props.removeDocument}
+                    parentActive={this.props.active}
+                    whenActiveChanged={this.props.whenActiveChanged}
+                    addDocTab={this.props.addDocTab}
+                    pinToPres={this.props.pinToPres}
+                    bringToFront={returnFalse}
+                    ContentScaling={returnOne}
+                />}
         </div>;
     }
 
-
-    // changed to render schema table
     @computed
     get schemaTable() {
         const preview = "";
-        return <div className="collectionSchemaView-table" onPointerDown={this.onPointDown} onWheel={e => this.props.active(true) && e.stopPropagation()} onDrop={e => this.onExternalDrop(e, {})} onContextMenu={this.onContextMenu} >
-            {this.reactTable}
-            <div className="collectionSchemaView-addRow" onClick={() => this.createRow()}>+ new</div>
-            {!this._showDoc ? (null) :
-                <div className="collectionSchemaView-documentPreview" //onClick={() => { this.onOpenClick(); }}
-                    style={{
-                        position: "absolute", width: 150, height: 150,
-                        background: "dimGray", display: "block", top: 0, left: 0,
-                        transform: `translate(${this._showDocPos[0]}px, ${this._showDocPos[1] - 180}px)`
-                    }}
-                    ref="overlay"><ContentFittingDocumentView
-                        Document={this._showDoc}
-                        DataDoc={this._showDataDoc}
-                        NativeHeight={returnZero}
-                        NativeWidth={returnZero}
-                        fitToBox={true}
-                        FreezeDimensions={true}
-                        focus={emptyFunction}
-                        LibraryPath={emptyPath}
-                        renderDepth={this.props.renderDepth}
-                        rootSelected={() => false}
-                        PanelWidth={() => 150}
-                        PanelHeight={() => 150}
-                        ScreenToLocalTransform={this.getPreviewTransform}
-                        docFilters={returnEmptyFilter}
-                        ContainingCollectionDoc={this.props.CollectionView?.props.Document}
-                        ContainingCollectionView={this.props.CollectionView}
-                        moveDocument={this.props.moveDocument}
-                        parentActive={this.props.active}
-                        whenActiveChanged={emptyFunction}
-                        addDocTab={this.props.addDocTab}
-                        pinToPres={this.props.pinToPres}
-                        bringToFront={returnFalse}
-                        ContentScaling={returnOne}>
-                    </ContentFittingDocumentView>
-                </div>}
-        </div>;
+        return <SchemaTable
+            Document={this.props.Document}
+            PanelHeight={this.props.PanelHeight}
+            PanelWidth={this.props.PanelWidth}
+            childDocs={this.childDocs}
+            CollectionView={this.props.CollectionView}
+            ContainingCollectionView={this.props.ContainingCollectionView}
+            ContainingCollectionDoc={this.props.ContainingCollectionDoc}
+            fieldKey={this.props.fieldKey}
+            renderDepth={this.props.renderDepth}
+            moveDocument={this.props.moveDocument}
+            ScreenToLocalTransform={this.props.ScreenToLocalTransform}
+            active={this.props.active}
+            onDrop={this.onExternalDrop}
+            addDocTab={this.props.addDocTab}
+            pinToPres={this.props.pinToPres}
+            isSelected={this.props.isSelected}
+            isFocused={this.isFocused}
+            setFocused={this.setFocused}
+            setPreviewDoc={this.setPreviewDoc}
+            deleteDocument={this.props.removeDocument}
+            addDocument={this.props.addDocument}
+            dataDoc={this.props.DataDoc}
+            columns={this.columns}
+            documentKeys={this.documentKeys}
+            headerIsEditing={this._headerIsEditing}
+            openHeader={this.openHeader}
+            onPointerDown={this.onTablePointerDown}
+            onResizedChange={this.onResizedChange}
+            setColumns={this.setColumns}
+            reorderColumns={this.reorderColumns}
+        />;
     }
 
     @computed
@@ -1018,6 +497,44 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         </div>;
     }
 
+    @action
+    onTablePointerDown = (e: React.PointerEvent): void => {
+        this.setFocused(this.props.Document);
+        if (e.button === 0 && !e.altKey && !e.ctrlKey && !e.metaKey && this.props.isSelected(true)) {
+            e.stopPropagation();
+        }
+        this.pointerY = e.screenY;
+        this.pointerX = e.screenX;
+        this.headerOpen = false;
+    }
+
+    onResizedChange = (newResized: Resize[], event: any) => {
+        const columns = this.columns;
+        newResized.forEach(resized => {
+            const index = columns.findIndex(c => c.heading === resized.id);
+            const column = columns[index];
+            column.setWidth(resized.value);
+            columns[index] = column;
+        });
+        this.columns = columns;
+    }
+
+    @action
+    setColumns = (columns: SchemaHeaderField[]) => this.columns = columns
+
+    @undoBatch
+    reorderColumns = (toMove: SchemaHeaderField, relativeTo: SchemaHeaderField, before: boolean, columnsValues: SchemaHeaderField[]) => {
+        const columns = [...columnsValues];
+        const oldIndex = columns.indexOf(toMove);
+        const relIndex = columns.indexOf(relativeTo);
+        const newIndex = (oldIndex > relIndex && !before) ? relIndex + 1 : (oldIndex < relIndex && before) ? relIndex - 1 : relIndex;
+
+        if (oldIndex === newIndex) return;
+
+        columns.splice(newIndex, 0, columns.splice(oldIndex, 1)[0]);
+        this.columns = columns;
+    }
+
     render() {
         return <div className="collectionSchemaView-container"
             style={{
@@ -1036,14 +553,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
 
 
 
-
-
-
-
-
-
-
-
 export interface SchemaTableProps {
     Document: Doc; // child doc
     dataDoc?: Doc;
@@ -1067,17 +576,20 @@ export interface SchemaTableProps {
     isFocused: (document: Doc) => boolean;
     setFocused: (document: Doc) => void;
     setPreviewDoc: (document: Doc) => void;
+    columns: SchemaHeaderField[];
+    documentKeys: any[];
+    headerIsEditing: boolean;
+    openHeader: (column: any, menu: any) => void;
+    onPointerDown: (e: React.PointerEvent) => void;
+    onResizedChange: (newResized: Resize[], event: any) => void;
+    setColumns: (columns: SchemaHeaderField[]) => void;
+    reorderColumns: (toMove: SchemaHeaderField, relativeTo: SchemaHeaderField, before: boolean, columnsValues: SchemaHeaderField[]) => void;
 }
 
-
-
-
-
 @observer
 export class SchemaTable extends React.Component<SchemaTableProps> {
     private DIVIDER_WIDTH = 4;
 
-    @observable _headerIsEditing: boolean = false;
     @observable _cellIsEditing: boolean = false;
     @observable _focusedCell: { row: number, col: number } = { row: 0, col: 0 };
     @observable _openCollections: Array<string> = [];
@@ -1090,13 +602,6 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
     @computed get previewHeight() { return () => this.props.PanelHeight() - 2 * this.borderWidth; }
     @computed get tableWidth() { return this.props.PanelWidth() - 2 * this.borderWidth - this.DIVIDER_WIDTH - this.previewWidth(); }
 
-    @computed get columns() {
-        return Cast(this.props.Document.schemaColumns, listSpec(SchemaHeaderField), []);
-    }
-    set columns(columns: SchemaHeaderField[]) {
-        this.props.Document.schemaColumns = new List<SchemaHeaderField>(columns);
-    }
-
     @computed get childDocs() {
         if (this.props.childDocs) return this.props.childDocs;
 
@@ -1116,13 +621,13 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
     }
 
     @computed get resized(): { id: string, value: number }[] {
-        return this.columns.reduce((resized, shf) => {
+        return this.props.columns.reduce((resized, shf) => {
             (shf.width > -1) && resized.push({ id: shf.heading, value: shf.width });
             return resized;
         }, [] as { id: string, value: number }[]);
     }
     @computed get sorted(): SortingRule[] {
-        return this.columns.reduce((sorted, shf) => {
+        return this.props.columns.reduce((sorted, shf) => {
             shf.desc && sorted.push({ id: shf.heading, desc: shf.desc });
             return sorted;
         }, [] as SortingRule[]);
@@ -1131,12 +636,12 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
     @computed get borderWidth() { return Number(COLLECTION_BORDER_WIDTH); }
     @computed get tableColumns(): Column<Doc>[] {
 
-        const possibleKeys = this.documentKeys.filter(key => this.columns.findIndex(existingKey => existingKey.heading.toUpperCase() === key.toUpperCase()) === -1);
+        const possibleKeys = this.props.documentKeys.filter(key => this.props.columns.findIndex(existingKey => existingKey.heading.toUpperCase() === key.toUpperCase()) === -1);
         const columns: Column<Doc>[] = [];
         const tableIsFocused = this.props.isFocused(this.props.Document);
         const focusedRow = this._focusedCell.row;
         const focusedCol = this._focusedCell.col;
-        const isEditable = !this._headerIsEditing;
+        const isEditable = !this.props.headerIsEditing;
 
         if (this.childDocs.reduce((found, doc) => found || doc.type === "collection", false)) {
             columns.push(
@@ -1156,7 +661,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
             );
         }
 
-        const cols = this.columns.map(col => {
+        const cols = this.props.columns.map(col => {
 
             const icon: IconProp = this.getColumnType(col) === ColumnType.Number ? "hashtag" : this.getColumnType(col) === ColumnType.String ? "font" :
                 this.getColumnType(col) === ColumnType.Boolean ? "check-square" : this.getColumnType(col) === ColumnType.Doc ? "file" :
@@ -1164,51 +669,21 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
 
 
 
-            const header = <div><FontAwesomeIcon icon={icon} size="sm" />{col.heading}</div>;
-
-            // <div className="collectionSchemaView-header" style={{ background: col.color }}>
-            //     <CollectionSchemaColumnMenu
-            //         columnField={col}
-            //         // keyValue={this.props.keyValue.heading}
-            //         possibleKeys={possibleKeys}
-            //         existingKeys={this.columns.map(c => c.heading)}
-            //         // keyType={this.getColumnType(col)}
-            //         typeConst={columnTypes.get(col.heading) !== undefined}
-            //         menuButtonContent={<div><FontAwesomeIcon icon={icon} size="sm" />{col.heading}</div>}
-            //         addNew={false}
-            //         onSelect={this.changeColumns}
-            //         setIsEditing={this.setHeaderIsEditing}
-            //         deleteColumn={this.deleteColumn}
-            //         onlyShowOptions={false}
-            //         setColumnType={this.setColumnType}
-            //         setColumnSort={this.setColumnSort}
-            //         setColumnColor={this.setColumnColor}
-            //     />
-            // </div>;
-
-
-            // <CollectionSchemaHeader
-            //     keyValue={col}
-            //     possibleKeys={possibleKeys}
-            //     existingKeys={this.columns.map(c => c.heading)}
-            //     keyType={this.getColumnType(col)}
-            //     typeConst={columnTypes.get(col.heading) !== undefined}
-            //     onSelect={this.changeColumns}
-            //     setIsEditing={this.setHeaderIsEditing}
-            //     deleteColumn={this.deleteColumn}
-            //     setColumnType={this.setColumnType}
-            //     setColumnSort={this.setColumnSort}
-            //     setColumnColor={this.setColumnColor}
-            // />;
-
+            const menuContent = <div><FontAwesomeIcon icon={icon} size="sm" />{col.heading}</div>;
+            const header =
+                <div className="collectionSchemaView-header"
+                    onClick={e => { this.props.openHeader(col, menuContent); }}
+                    style={{ background: col.color }}>
+                    {menuContent}
+                </div>;
 
             return {
-                Header: <MovableColumn columnRenderer={header} columnValue={col} allColumns={this.columns} reorderColumns={this.reorderColumns} ScreenToLocalTransform={this.props.ScreenToLocalTransform} />,
+                Header: <MovableColumn columnRenderer={header} columnValue={col} allColumns={this.props.columns} reorderColumns={this.props.reorderColumns} ScreenToLocalTransform={this.props.ScreenToLocalTransform} />,
                 accessor: (doc: Doc) => doc ? doc[col.heading] : 0,
                 id: col.heading,
                 Cell: (rowProps: CellInfo) => {
                     const rowIndex = rowProps.index;
-                    const columnIndex = this.columns.map(c => c.heading).indexOf(rowProps.column.id!);
+                    const columnIndex = this.props.columns.map(c => c.heading).indexOf(rowProps.column.id!);
                     const isFocused = focusedRow === rowIndex && focusedCol === columnIndex && tableIsFocused;
 
                     const props: CellProps = {
@@ -1286,7 +761,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
             addDoc: this.tableAddDoc,
             removeDoc: this.props.deleteDocument,
             rowInfo,
-            rowFocused: !this._headerIsEditing && rowInfo.index === this._focusedCell.row && this.props.isFocused(this.props.Document),
+            rowFocused: !this.props.headerIsEditing && rowInfo.index === this._focusedCell.row && this.props.isFocused(this.props.Document),
             textWrapRow: this.toggleTextWrapRow,
             rowWrapped: this.textWrappedRows.findIndex(id => rowInfo.original[Id] === id) > -1,
             dropAction: StrCast(this.props.Document.childDropAction),
@@ -1304,7 +779,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
         // TODO: editing border doesn't work :(
         return {
             style: {
-                border: !this._headerIsEditing && isFocused ? "2px solid rgb(255, 160, 160)" : "1px solid #f1efeb"
+                border: !this.props.headerIsEditing && isFocused ? "2px solid rgb(255, 160, 160)" : "1px solid #f1efeb"
             }
         };
     }
@@ -1317,18 +792,10 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
 
     @action onExpandCollection = (collection: Doc) => this._openCollections.push(collection[Id]);
     @action setCellIsEditing = (isEditing: boolean) => this._cellIsEditing = isEditing;
-    @action setHeaderIsEditing = (isEditing: boolean) => this._headerIsEditing = isEditing;
-
-    onPointerDown = (e: React.PointerEvent): void => {
-        this.props.setFocused(this.props.Document);
-        if (e.button === 0 && !e.altKey && !e.ctrlKey && !e.metaKey && this.props.isSelected(true)) {
-            e.stopPropagation();
-        }
-    }
 
     @action
     onKeyDown = (e: KeyboardEvent): void => {
-        if (!this._cellIsEditing && !this._headerIsEditing && this.props.isFocused(this.props.Document)) {// && this.props.isSelected(true)) {
+        if (!this._cellIsEditing && !this.props.headerIsEditing && this.props.isFocused(this.props.Document)) {// && this.props.isSelected(true)) {
             const direction = e.key === "Tab" ? "tab" : e.which === 39 ? "right" : e.which === 37 ? "left" : e.which === 38 ? "up" : e.which === 40 ? "down" : "";
             this._focusedCell = this.changeFocusedCellByDirection(direction, this._focusedCell.row, this._focusedCell.col);
 
@@ -1339,8 +806,8 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
 
     changeFocusedCellByDirection = (direction: string, curRow: number, curCol: number) => {
         switch (direction) {
-            case "tab": return { row: (curRow + 1 === this.childDocs.length ? 0 : curRow + 1), col: curCol + 1 === this.columns.length ? 0 : curCol + 1 };
-            case "right": return { row: curRow, col: curCol + 1 === this.columns.length ? curCol : curCol + 1 };
+            case "tab": return { row: (curRow + 1 === this.childDocs.length ? 0 : curRow + 1), col: curCol + 1 === this.props.columns.length ? 0 : curCol + 1 };
+            case "right": return { row: curRow, col: curCol + 1 === this.props.columns.length ? curCol : curCol + 1 };
             case "left": return { row: curRow, col: curCol === 0 ? curCol : curCol - 1 };
             case "up": return { row: curRow === 0 ? curRow : curRow - 1, col: curCol };
             case "down": return { row: curRow + 1 === this.childDocs.length ? curRow : curRow + 1, col: curCol };
@@ -1365,49 +832,12 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
     @action
     createColumn = () => {
         let index = 0;
-        let found = this.columns.findIndex(col => col.heading.toUpperCase() === "New field".toUpperCase()) > -1;
+        let found = this.props.columns.findIndex(col => col.heading.toUpperCase() === "New field".toUpperCase()) > -1;
         while (found) {
             index++;
-            found = this.columns.findIndex(col => col.heading.toUpperCase() === ("New field (" + index + ")").toUpperCase()) > -1;
-        }
-        this.columns.push(new SchemaHeaderField(`New field ${index ? "(" + index + ")" : ""}`, "#f1efeb"));
-    }
-
-    @undoBatch
-    @action
-    deleteColumn = (key: string) => {
-        const columns = this.columns;
-        if (columns === undefined) {
-            this.columns = new List<SchemaHeaderField>([]);
-        } else {
-            const index = columns.map(c => c.heading).indexOf(key);
-            if (index > -1) {
-                columns.splice(index, 1);
-                this.columns = columns;
-            }
-        }
-    }
-
-    @undoBatch
-    @action
-    changeColumns = (oldKey: string, newKey: string, addNew: boolean) => {
-        const columns = this.columns;
-        if (columns === undefined) {
-            this.columns = new List<SchemaHeaderField>([new SchemaHeaderField(newKey, "f1efeb")]);
-        } else {
-            if (addNew) {
-                columns.push(new SchemaHeaderField(newKey, "f1efeb"));
-                this.columns = columns;
-            } else {
-                const index = columns.map(c => c.heading).indexOf(oldKey);
-                if (index > -1) {
-                    const column = columns[index];
-                    column.setHeading(newKey);
-                    columns[index] = column;
-                    this.columns = columns;
-                }
-            }
+            found = this.props.columns.findIndex(col => col.heading.toUpperCase() === ("New field (" + index + ")").toUpperCase()) > -1;
         }
+        this.props.columns.push(new SchemaHeaderField(`New field ${index ? "(" + index + ")" : ""}`, "#f1efeb"));
     }
 
     getColumnType = (column: SchemaHeaderField): ColumnType => {
@@ -1428,72 +858,6 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
         return NumCast(typesDoc[column.heading]);
     }
 
-    @undoBatch
-    setColumnType = (columnField: SchemaHeaderField, type: ColumnType): void => {
-        if (columnTypes.get(columnField.heading)) return;
-
-        const columns = this.columns;
-        const index = columns.indexOf(columnField);
-        if (index > -1) {
-            columnField.setType(NumCast(type));
-            columns[index] = columnField;
-            this.columns = columns;
-        }
-    }
-
-    @undoBatch
-    setColumnColor = (columnField: SchemaHeaderField, color: string): void => {
-        const columns = this.columns;
-        const index = columns.indexOf(columnField);
-        if (index > -1) {
-            columnField.setColor(color);
-            columns[index] = columnField;
-            this.columns = columns; // need to set the columns to trigger rerender
-        }
-    }
-
-    @action
-    setColumns = (columns: SchemaHeaderField[]) => this.columns = columns
-
-    @undoBatch
-    reorderColumns = (toMove: SchemaHeaderField, relativeTo: SchemaHeaderField, before: boolean, columnsValues: SchemaHeaderField[]) => {
-        const columns = [...columnsValues];
-        const oldIndex = columns.indexOf(toMove);
-        const relIndex = columns.indexOf(relativeTo);
-        const newIndex = (oldIndex > relIndex && !before) ? relIndex + 1 : (oldIndex < relIndex && before) ? relIndex - 1 : relIndex;
-
-        if (oldIndex === newIndex) return;
-
-        columns.splice(newIndex, 0, columns.splice(oldIndex, 1)[0]);
-        this.columns = columns;
-    }
-
-    @undoBatch
-    @action
-    setColumnSort = (columnField: SchemaHeaderField, descending: boolean | undefined) => {
-        const columns = this.columns;
-        const index = columns.findIndex(c => c.heading === columnField.heading);
-        const column = columns[index];
-        column.setDesc(descending);
-        columns[index] = column;
-        this.columns = columns;
-    }
-
-    get documentKeys() {
-        const docs = this.childDocs;
-        const keys: { [key: string]: boolean } = {};
-        // bcz: ugh.  this is untracked since otherwise a large collection of documents will blast the server for all their fields.
-        //  then as each document's fields come back, we update the documents _proxies.  Each time we do this, the whole schema will be
-        //  invalidated and re-rendered.   This workaround will inquire all of the document fields before the options button is clicked.
-        //  then by the time the options button is clicked, all of the fields should be in place.  If a new field is added while this menu
-        //  is displayed (unlikely) it won't show up until something else changes.
-        //TODO Types
-        untracked(() => docs.map(doc => Doc.GetAllPrototypes(doc).map(proto => Object.keys(proto).forEach(key => keys[key] = false))));
-
-        this.columns.forEach(key => keys[key.heading] = true);
-        return Array.from(Object.keys(keys));
-    }
-
     @undoBatch
     @action
     toggleTextwrap = async () => {
@@ -1541,24 +905,13 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
             sorted={this.sorted}
             expanded={expanded}
             resized={this.resized}
-            onResizedChange={this.onResizedChange}
+            onResizedChange={this.props.onResizedChange}
             SubComponent={!hasCollectionChild ? undefined : row => (row.original.type !== "collection") ? (null) :
                 <div className="reactTable-sub"><SchemaTable {...this.props} Document={row.original} dataDoc={undefined} childDocs={undefined} /></div>}
 
         />;
     }
 
-    onResizedChange = (newResized: Resize[], event: any) => {
-        const columns = this.columns;
-        newResized.forEach(resized => {
-            const index = columns.findIndex(c => c.heading === resized.id);
-            const column = columns[index];
-            column.setWidth(resized.value);
-            columns[index] = column;
-        });
-        this.columns = columns;
-    }
-
     onContextMenu = (e: React.MouseEvent): void => {
         if (!e.isPropagationStopped() && this.props.Document[Id] !== "mainDoc") { // need to test this because GoldenLayout causes a parallel hierarchy in the React DOM for its children and the main document view7
             // ContextMenu.Instance.addItem({ description: "Make DB", event: this.makeDB, icon: "table" });
@@ -1571,13 +924,13 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
 
         row = row % docs.length;
         while (row < 0) row += docs.length;
-        const columns = this.columns;
+        const columns = this.props.columns;
         const doc = docs[row];
         if (col === undefined) {
             return doc;
         }
         if (col >= 0 && col < columns.length) {
-            const column = this.columns[col].heading;
+            const column = this.props.columns[col].heading;
             return doc[column];
         }
         return undefined;
@@ -1658,7 +1011,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
 
     render() {
         const preview = "";
-        return <div className="collectionSchemaView-table" onPointerDown={this.onPointerDown} onWheel={e => this.props.active(true) && e.stopPropagation()} onDrop={e => this.props.onDrop(e, {})} onContextMenu={this.onContextMenu} >
+        return <div className="collectionSchemaView-table" onPointerDown={this.props.onPointerDown} onWheel={e => this.props.active(true) && e.stopPropagation()} onDrop={e => this.props.onDrop(e, {})} onContextMenu={this.onContextMenu} >
             {this.reactTable}
             <div className="collectionSchemaView-addRow" onClick={() => this.createRow()}>+ new</div>
             {!this._showDoc ? (null) :
-- 
cgit v1.2.3-70-g09d2


From a0a73c1aeb5f786aa9505103f761e41a293828c7 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Wed, 24 Jun 2020 22:57:48 -0500
Subject: minor UI tweaks

---
 .../views/collections/CollectionSchemaView.tsx     | 35 +++++++++++++++-------
 1 file changed, 25 insertions(+), 10 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 4f87420d2..fae55b775 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -6,7 +6,7 @@ import { action, computed, observable, untracked } from "mobx";
 import { observer } from "mobx-react";
 import ReactTable, { CellInfo, Column, ComponentPropsGetterR, Resize, SortingRule } from "react-table";
 import "react-table/react-table.css";
-import { Doc, DocListCast, Field, Opt } from "../../../fields/Doc";
+import { Doc, DocListCast, Field, Opt, LayoutSym } from "../../../fields/Doc";
 import { Id } from "../../../fields/FieldSymbols";
 import { List } from "../../../fields/List";
 import { listSpec } from "../../../fields/Schema";
@@ -302,6 +302,9 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         this.headerOpen = !this.headerOpen;
     }
 
+    @action
+    closeHeader = () => { this.headerOpen = false; }
+
     renderContent = (col: any) => {
         return (
             <div className="collectionSchema-header-menuOptions">
@@ -323,7 +326,8 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
                         {this.renderSorting(col)}
                         {this.renderColors(col)}
                         <div className="collectionSchema-headerMenu-group">
-                            <button onClick={() => this.deleteColumn(col.heading)}>Delete Column</button>
+                            <button onClick={() => { this.deleteColumn(col.heading); }}
+                            >Delete Column</button>
                         </div>
                     </>
                 }
@@ -344,6 +348,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
                 this.columns = columns;
             }
         }
+        this.closeHeader();
     }
 
     getPreviewTransform = (): Transform => {
@@ -359,9 +364,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
                     position: "absolute", background: "white",
                     transform: `translate(${this.menuCoordinates[0]}px, ${this.menuCoordinates[1] - 150}px)`
                 }}>
-                {/* <Flyout anchorPoint={anchorPoints.TOP_CENTER} content={this.renderContent(this.col)}>
-                    <div className="collectionSchema-header-toggler" onClick={() => this.toggleIsOpen()}>{this.menuContent}</div>
-                </ Flyout > */}
                 {this.renderContent(this.col)}
             </div>
         );
@@ -414,7 +416,9 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     @computed
     get dividerDragger() {
         return this.previewWidth() === 0 ? (null) :
-            <div className="collectionSchemaView-dividerDragger" onPointerDown={this.onDividerDown} style={{ width: `${this.DIVIDER_WIDTH}px` }} />;
+            <div className="collectionSchemaView-dividerDragger"
+                onPointerDown={this.onDividerDown}
+                style={{ width: `${this.DIVIDER_WIDTH}px` }} />;
     }
 
     @computed
@@ -492,7 +496,9 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     public get schemaToolbar() {
         return <div className="collectionSchemaView-toolbar">
             <div className="collectionSchemaView-toolbar-item">
-                <div id="preview-schema-checkbox-div"><input type="checkbox" key={"Show Preview"} checked={this.previewWidth() !== 0} onChange={this.toggleExpander} />Show Preview</div>
+                <div id="preview-schema-checkbox-div"><input type="checkbox"
+                    key={"Show Preview"} checked={this.previewWidth() !== 0}
+                    onChange={this.toggleExpander} />Show Preview</div>
             </div>
         </div>;
     }
@@ -541,7 +547,12 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
                 pointerEvents: !this.props.active() && !SnappingManager.GetIsDragging() ? "none" : undefined,
                 width: this.props.PanelWidth() || "100%", height: this.props.PanelHeight() || "100%"
             }}  >
-            <div className="collectionSchemaView-tableContainer" style={{ width: `calc(100% - ${this.previewWidth()}px)` }} onPointerDown={this.onPointerDown} onWheel={e => this.props.active(true) && e.stopPropagation()} onDrop={e => this.onExternalDrop(e, {})} ref={this.createTarget}>
+            <div className="collectionSchemaView-tableContainer"
+                style={{ width: `calc(100% - ${this.previewWidth()}px)` }}
+                onPointerDown={this.onPointerDown}
+                onWheel={e => this.props.active(true) && e.stopPropagation()}
+                onDrop={e => this.onExternalDrop(e, {})}
+                ref={this.createTarget}>
                 {this.schemaTable}
             </div>
             {this.dividerDragger}
@@ -669,11 +680,15 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
 
 
 
-            const menuContent = <div><FontAwesomeIcon icon={icon} size="sm" />{col.heading}</div>;
+            const menuContent = <div><FontAwesomeIcon icon={icon} size="sm" />  {col.heading}</div>;
             const header =
                 <div className="collectionSchemaView-header"
                     onClick={e => { this.props.openHeader(col, menuContent); }}
-                    style={{ background: col.color }}>
+                    style={{
+                        background: col.color, padding: "4px",
+                        letterSpacing: "2px",
+                        textTransform: "uppercase"
+                    }}>
                     {menuContent}
                 </div>;
 
-- 
cgit v1.2.3-70-g09d2


From 5151b725c0959aeec7168125c3205c1e1962b37c Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Thu, 25 Jun 2020 00:15:32 -0500
Subject: fixed translating with menu

---
 src/client/views/collections/CollectionSchemaView.tsx | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index fae55b775..d7038eaa9 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -116,6 +116,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         } else {
             this._isOpen = false;
             this.setHeaderIsEditing(false);
+            this.closeHeader();
         }
     }
 
@@ -358,11 +359,14 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     //anchorPoints.TOP_CENTER 
 
     @computed get renderMenu() {
+        const scale = this.props.ScreenToLocalTransform().Scale;
         return (
             <div className="collectionSchema-header-menu" ref={this.setNode}
+                onWheel={e => this.props.active(true) && e.stopPropagation()}
                 style={{
-                    position: "absolute", background: "white",
-                    transform: `translate(${this.menuCoordinates[0]}px, ${this.menuCoordinates[1] - 150}px)`
+                    position: "absolute",
+                    background: "white",
+                    transform: `translate(${this.menuCoordinates[0]}px, ${this.menuCoordinates[1] - 160 * scale}px)`
                 }}>
                 {this.renderContent(this.col)}
             </div>
@@ -1026,7 +1030,8 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
 
     render() {
         const preview = "";
-        return <div className="collectionSchemaView-table" onPointerDown={this.props.onPointerDown} onWheel={e => this.props.active(true) && e.stopPropagation()} onDrop={e => this.props.onDrop(e, {})} onContextMenu={this.onContextMenu} >
+        return <div className="collectionSchemaView-table" onPointerDown={this.props.onPointerDown} onWheel={e => this.props.active(true) && e.stopPropagation()}
+            onDrop={e => this.props.onDrop(e, {})} onContextMenu={this.onContextMenu} >
             {this.reactTable}
             <div className="collectionSchemaView-addRow" onClick={() => this.createRow()}>+ new</div>
             {!this._showDoc ? (null) :
-- 
cgit v1.2.3-70-g09d2


From 92ea47bc7c42966f68ccfed4f1da57eb9b352d40 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Thu, 25 Jun 2020 01:50:26 -0400
Subject: fixed placement of menus and interaction with input boxes.

---
 .../views/collections/CollectionSchemaHeaders.tsx  |  6 +++-
 .../views/collections/CollectionSchemaView.tsx     | 36 +++++++++++++++-------
 src/client/views/linking/LinkMenu.tsx              |  2 +-
 3 files changed, 31 insertions(+), 13 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx
index d9a27f355..aaa2e6096 100644
--- a/src/client/views/collections/CollectionSchemaHeaders.tsx
+++ b/src/client/views/collections/CollectionSchemaHeaders.tsx
@@ -374,7 +374,11 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
         return (
             <div className="keys-dropdown">
                 <input className="keys-search" ref={this._inputRef} type="text" value={this._searchTerm} placeholder="Column key" onKeyDown={this.onKeyDown}
-                    onChange={e => this.onChange(e.target.value)} onFocus={this.onFocus} onBlur={this.onBlur}></input>
+                    onChange={e => this.onChange(e.target.value)}
+                    onClick={(e) => {
+                        this._inputRef.current!.select();
+                        e.stopPropagation();
+                    }} onFocus={this.onFocus} onBlur={this.onBlur}></input>
                 <div className="keys-options-wrapper" onPointerEnter={this.onPointerEnter} onPointerLeave={this.onPointerOut}>
                     {this.renderOptions()}
                 </div>
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index fae55b775..feef4fec5 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -29,6 +29,7 @@ import { CollectionView } from "./CollectionView";
 import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView";
 import { setupMoveUpEvents, emptyFunction, returnZero, returnOne, returnFalse, returnEmptyFilter, emptyPath } from "../../../Utils";
 import { SnappingManager } from "../../util/SnappingManager";
+import Measure from "react-measure";
 
 library.add(faCog, faPlus, faSortUp, faSortDown);
 library.add(faTable);
@@ -66,7 +67,11 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
 
     @observable pointerX: number = 0;
     @observable pointerY: number = 0;
-    @computed get menuCoordinates() { return this.props.ScreenToLocalTransform().transformPoint(this.pointerX, this.pointerY); }
+    @computed get menuCoordinates() {
+        const x = Math.max(0, Math.min(document.body.clientWidth - this._menuWidth, this.pointerX));
+        const y = Math.max(0, Math.min(document.body.clientHeight - this._menuHeight, this.pointerY));
+        return this.props.ScreenToLocalTransform().transformPoint(x, y);
+    }
 
     @computed get columns() {
         return Cast(this.props.Document.schemaColumns, listSpec(SchemaHeaderField), []);
@@ -116,6 +121,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         } else {
             this._isOpen = false;
             this.setHeaderIsEditing(false);
+            this.closeHeader();
         }
     }
 
@@ -296,10 +302,12 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     }
 
     @action
-    openHeader = (col: any, menu: any) => {
+    openHeader = (col: any, menu: any, screenx: number, screeny: number) => {
         this.menuContent = menu;
         this.col = col;
         this.headerOpen = !this.headerOpen;
+        this.pointerX = screenx;
+        this.pointerY = screeny;
     }
 
     @action
@@ -357,14 +365,21 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
 
     //anchorPoints.TOP_CENTER 
 
+    @observable _menuWidth = 0
+    @observable _menuHeight = 0;
     @computed get renderMenu() {
         return (
             <div className="collectionSchema-header-menu" ref={this.setNode}
                 style={{
                     position: "absolute", background: "white",
-                    transform: `translate(${this.menuCoordinates[0]}px, ${this.menuCoordinates[1] - 150}px)`
+                    transform: `translate(${this.menuCoordinates[0]}px, ${this.menuCoordinates[1]}px)`
                 }}>
-                {this.renderContent(this.col)}
+                <Measure offset onResize={action((r: any) => {
+                    const dim = this.props.ScreenToLocalTransform().inverse().transformDirection(r.offset.width, r.offset.height);
+                    this._menuWidth = dim[0]; this._menuHeight = dim[1];
+                })}>
+                    {({ measureRef }) => <div ref={measureRef}>{this.renderContent(this.col)}</div>}
+                </Measure>
             </div>
         );
     }
@@ -407,7 +422,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
                 this.props.select(false);
             }
         }
-        this.headerOpen = false;
     }
 
     @computed
@@ -496,9 +510,10 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     public get schemaToolbar() {
         return <div className="collectionSchemaView-toolbar">
             <div className="collectionSchemaView-toolbar-item">
-                <div id="preview-schema-checkbox-div"><input type="checkbox"
-                    key={"Show Preview"} checked={this.previewWidth() !== 0}
-                    onChange={this.toggleExpander} />Show Preview</div>
+                <div id="preview-schema-checkbox-div">
+                    <input type="checkbox"
+                        key={"Show Preview"} checked={this.previewWidth() !== 0}
+                        onChange={this.toggleExpander} />Show Preview</div>
             </div>
         </div>;
     }
@@ -511,7 +526,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         }
         this.pointerY = e.screenY;
         this.pointerX = e.screenX;
-        this.headerOpen = false;
     }
 
     onResizedChange = (newResized: Resize[], event: any) => {
@@ -590,7 +604,7 @@ export interface SchemaTableProps {
     columns: SchemaHeaderField[];
     documentKeys: any[];
     headerIsEditing: boolean;
-    openHeader: (column: any, menu: any) => void;
+    openHeader: (column: any, menu: any, screenx: number, screeny: number) => void;
     onPointerDown: (e: React.PointerEvent) => void;
     onResizedChange: (newResized: Resize[], event: any) => void;
     setColumns: (columns: SchemaHeaderField[]) => void;
@@ -683,7 +697,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
             const menuContent = <div><FontAwesomeIcon icon={icon} size="sm" />  {col.heading}</div>;
             const header =
                 <div className="collectionSchemaView-header"
-                    onClick={e => { this.props.openHeader(col, menuContent); }}
+                    onClick={e => this.props.openHeader(col, menuContent, e.clientX, e.clientY)}
                     style={{
                         background: col.color, padding: "4px",
                         letterSpacing: "2px",
diff --git a/src/client/views/linking/LinkMenu.tsx b/src/client/views/linking/LinkMenu.tsx
index 0fcc0f0b9..de1d60a09 100644
--- a/src/client/views/linking/LinkMenu.tsx
+++ b/src/client/views/linking/LinkMenu.tsx
@@ -28,7 +28,7 @@ export class LinkMenu extends React.Component<Props> {
 
     @action
     onClick = (e: PointerEvent) => {
-        if (!Array.from(this._linkMenuRef?.getElementsByTagName((e.target as HTMLElement).tagName) || []).includes(e.target as any)) {
+        if (this._linkMenuRef?.contains(e.target as any)) {
             DocumentLinksButton.EditLink = undefined;
         }
     }
-- 
cgit v1.2.3-70-g09d2


From 880c818b35b6a40e724d210f4b6134809d5bea4a Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Thu, 25 Jun 2020 02:02:43 -0400
Subject: cleaned up some variables in schemaView

---
 .../views/collections/CollectionSchemaView.tsx     | 61 +++++++++-------------
 1 file changed, 24 insertions(+), 37 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 9b2d05b6a..05c62e288 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -65,11 +65,19 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     @computed get tableWidth() { return this.props.PanelWidth() - 2 * this.borderWidth - this.DIVIDER_WIDTH - this.previewWidth(); }
     @computed get borderWidth() { return Number(COLLECTION_BORDER_WIDTH); }
 
-    @observable pointerX: number = 0;
-    @observable pointerY: number = 0;
+    @observable _menuWidth = 0
+    @observable _menuContent: any = "";
+    @observable _headerOpen = false;
+    @observable _isOpen = false;
+    @observable _node: HTMLDivElement | null = null;
+    @observable _headerIsEditing = false;
+    @observable _col: any = "";
+    @observable _menuHeight = 0;
+    @observable _pointerX = 0;
+    @observable _pointerY = 0;
     @computed get menuCoordinates() {
-        const x = Math.max(0, Math.min(document.body.clientWidth - this._menuWidth, this.pointerX));
-        const y = Math.max(0, Math.min(document.body.clientHeight - this._menuHeight, this.pointerY));
+        const x = Math.max(0, Math.min(document.body.clientWidth - this._menuWidth, this._pointerX));
+        const y = Math.max(0, Math.min(document.body.clientHeight - this._menuHeight, this._pointerY));
         return this.props.ScreenToLocalTransform().transformPoint(x, y);
     }
 
@@ -94,17 +102,8 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         this.columns.forEach(key => keys[key.heading] = true);
         return Array.from(Object.keys(keys));
     }
-
-    @observable col: any = "";
     @computed get possibleKeys() { return this.documentKeys.filter(key => this.columns.findIndex(existingKey => existingKey.heading.toUpperCase() === key.toUpperCase()) === -1); }
 
-    @observable menuContent: any = "";
-    @observable headerOpen: boolean = false;
-
-    @observable private _isOpen: boolean = false;
-    @observable private _node: HTMLDivElement | null = null;
-
-    @observable _headerIsEditing: boolean = false;
 
     componentDidMount() {
         document.addEventListener("pointerdown", this.detectClick);
@@ -131,9 +130,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         this.setHeaderIsEditing(this._isOpen);
     }
 
-
-
-
     changeColumnType = (type: ColumnType, col: any): void => {
         this.setColumnType(col, type);
     }
@@ -181,17 +177,13 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         this.columns = columns;
     }
 
-
-
     @action
     setNode = (node: HTMLDivElement): void => {
-        if (node) {
-            this._node = node;
-        }
+        node && (this._node = node);
     }
 
     renderTypes = (col: any) => {
-        if (columnTypes.get(col.heading)) return <></>;
+        if (columnTypes.get(col.heading)) return (null);
 
         const type = col.type;
         return (
@@ -303,15 +295,15 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
 
     @action
     openHeader = (col: any, menu: any, screenx: number, screeny: number) => {
-        this.menuContent = menu;
-        this.col = col;
-        this.headerOpen = !this.headerOpen;
-        this.pointerX = screenx;
-        this.pointerY = screeny;
+        this._menuContent = menu;
+        this._col = col;
+        this._headerOpen = !this._headerOpen;
+        this._pointerX = screenx;
+        this._pointerY = screeny;
     }
 
     @action
-    closeHeader = () => { this.headerOpen = false; }
+    closeHeader = () => { this._headerOpen = false; }
 
     renderContent = (col: any) => {
         return (
@@ -363,12 +355,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         return this.props.ScreenToLocalTransform().translate(- this.borderWidth - 4 - this.tableWidth, - this.borderWidth);
     }
 
-    //anchorPoints.TOP_CENTER 
-
-    @observable _menuWidth = 0
-    @observable _menuHeight = 0;
     @computed get renderMenu() {
-        const scale = this.props.ScreenToLocalTransform().Scale;
         return (
             <div className="collectionSchema-header-menu" ref={this.setNode}
                 onWheel={e => this.props.active(true) && e.stopPropagation()}
@@ -380,7 +367,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
                     const dim = this.props.ScreenToLocalTransform().inverse().transformDirection(r.offset.width, r.offset.height);
                     this._menuWidth = dim[0]; this._menuHeight = dim[1];
                 })}>
-                    {({ measureRef }) => <div ref={measureRef}>{this.renderContent(this.col)}</div>}
+                    {({ measureRef }) => <div ref={measureRef}>{this.renderContent(this._col)}</div>}
                 </Measure>
             </div>
         );
@@ -526,8 +513,8 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         if (e.button === 0 && !e.altKey && !e.ctrlKey && !e.metaKey && this.props.isSelected(true)) {
             e.stopPropagation();
         }
-        this.pointerY = e.screenY;
-        this.pointerX = e.screenX;
+        this._pointerY = e.screenY;
+        this._pointerX = e.screenX;
     }
 
     onResizedChange = (newResized: Resize[], event: any) => {
@@ -573,7 +560,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
             </div>
             {this.dividerDragger}
             {!this.previewWidth() ? (null) : this.previewPanel}
-            {this.headerOpen ? this.renderMenu : null}
+            {this._headerOpen ? this.renderMenu : null}
         </div>;
     }
 }
-- 
cgit v1.2.3-70-g09d2


From f36c093f7052f755d1c3aba32b8efd29c2d76f6f Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Thu, 25 Jun 2020 09:31:19 -0500
Subject: schema table into own class

---
 .../views/collections/CollectionSchemaView.tsx     | 511 +------------------
 src/client/views/collections/SchemaTable.tsx       | 550 +++++++++++++++++++++
 2 files changed, 554 insertions(+), 507 deletions(-)
 create mode 100644 src/client/views/collections/SchemaTable.tsx

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 05c62e288..332849526 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -22,7 +22,6 @@ import { ContextMenu } from "../ContextMenu";
 import '../DocumentDecorations.scss';
 import { CellProps, CollectionSchemaCell, CollectionSchemaCheckboxCell, CollectionSchemaDocCell, CollectionSchemaNumberCell, CollectionSchemaStringCell, CollectionSchemaImageCell, CollectionSchemaListCell } from "./CollectionSchemaCells";
 import { CollectionSchemaAddColumnHeader, CollectionSchemaHeader, CollectionSchemaColumnMenu, KeysDropdown } from "./CollectionSchemaHeaders";
-import { MovableColumn, MovableRow } from "./CollectionSchemaMovableTableHOC";
 import "./CollectionSchemaView.scss";
 import { CollectionSubView } from "./CollectionSubView";
 import { CollectionView } from "./CollectionView";
@@ -30,6 +29,9 @@ import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView"
 import { setupMoveUpEvents, emptyFunction, returnZero, returnOne, returnFalse, returnEmptyFilter, emptyPath } from "../../../Utils";
 import { SnappingManager } from "../../util/SnappingManager";
 import Measure from "react-measure";
+import { MovableColumn, MovableRow } from "./CollectionSchemaMovableTableHOC";
+import { SchemaTable } from "./SchemaTable";
+//import { SchemaTable } from "./SchemaTable";
 
 library.add(faCog, faPlus, faSortUp, faSortDown);
 library.add(faTable);
@@ -65,7 +67,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     @computed get tableWidth() { return this.props.PanelWidth() - 2 * this.borderWidth - this.DIVIDER_WIDTH - this.previewWidth(); }
     @computed get borderWidth() { return Number(COLLECTION_BORDER_WIDTH); }
 
-    @observable _menuWidth = 0
+    @observable _menuWidth = 0;
     @observable _menuContent: any = "";
     @observable _headerOpen = false;
     @observable _isOpen = false;
@@ -563,509 +565,4 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
             {this._headerOpen ? this.renderMenu : null}
         </div>;
     }
-}
-
-
-
-export interface SchemaTableProps {
-    Document: Doc; // child doc
-    dataDoc?: Doc;
-    PanelHeight: () => number;
-    PanelWidth: () => number;
-    childDocs?: Doc[];
-    CollectionView: Opt<CollectionView>;
-    ContainingCollectionView: Opt<CollectionView>;
-    ContainingCollectionDoc: Opt<Doc>;
-    fieldKey: string;
-    renderDepth: number;
-    deleteDocument: (document: Doc | Doc[]) => boolean;
-    addDocument: (document: Doc | Doc[]) => boolean;
-    moveDocument: (document: Doc | Doc[], targetCollection: Doc | undefined, addDocument: (document: Doc | Doc[]) => boolean) => boolean;
-    ScreenToLocalTransform: () => Transform;
-    active: (outsideReaction: boolean) => boolean;
-    onDrop: (e: React.DragEvent<Element>, options: DocumentOptions, completed?: (() => void) | undefined) => void;
-    addDocTab: (document: Doc, where: string) => boolean;
-    pinToPres: (document: Doc) => void;
-    isSelected: (outsideReaction?: boolean) => boolean;
-    isFocused: (document: Doc) => boolean;
-    setFocused: (document: Doc) => void;
-    setPreviewDoc: (document: Doc) => void;
-    columns: SchemaHeaderField[];
-    documentKeys: any[];
-    headerIsEditing: boolean;
-    openHeader: (column: any, menu: any, screenx: number, screeny: number) => void;
-    onPointerDown: (e: React.PointerEvent) => void;
-    onResizedChange: (newResized: Resize[], event: any) => void;
-    setColumns: (columns: SchemaHeaderField[]) => void;
-    reorderColumns: (toMove: SchemaHeaderField, relativeTo: SchemaHeaderField, before: boolean, columnsValues: SchemaHeaderField[]) => void;
-}
-
-@observer
-export class SchemaTable extends React.Component<SchemaTableProps> {
-    private DIVIDER_WIDTH = 4;
-
-    @observable _cellIsEditing: boolean = false;
-    @observable _focusedCell: { row: number, col: number } = { row: 0, col: 0 };
-    @observable _openCollections: Array<string> = [];
-
-    @observable _showDoc: Doc | undefined;
-    @observable _showDataDoc: any = "";
-    @observable _showDocPos: number[] = [];
-
-    @computed get previewWidth() { return () => NumCast(this.props.Document.schemaPreviewWidth); }
-    @computed get previewHeight() { return () => this.props.PanelHeight() - 2 * this.borderWidth; }
-    @computed get tableWidth() { return this.props.PanelWidth() - 2 * this.borderWidth - this.DIVIDER_WIDTH - this.previewWidth(); }
-
-    @computed get childDocs() {
-        if (this.props.childDocs) return this.props.childDocs;
-
-        const doc = this.props.dataDoc ? this.props.dataDoc : this.props.Document;
-        return DocListCast(doc[this.props.fieldKey]);
-    }
-    set childDocs(docs: Doc[]) {
-        const doc = this.props.dataDoc ? this.props.dataDoc : this.props.Document;
-        doc[this.props.fieldKey] = new List<Doc>(docs);
-    }
-
-    @computed get textWrappedRows() {
-        return Cast(this.props.Document.textwrappedSchemaRows, listSpec("string"), []);
-    }
-    set textWrappedRows(textWrappedRows: string[]) {
-        this.props.Document.textwrappedSchemaRows = new List<string>(textWrappedRows);
-    }
-
-    @computed get resized(): { id: string, value: number }[] {
-        return this.props.columns.reduce((resized, shf) => {
-            (shf.width > -1) && resized.push({ id: shf.heading, value: shf.width });
-            return resized;
-        }, [] as { id: string, value: number }[]);
-    }
-    @computed get sorted(): SortingRule[] {
-        return this.props.columns.reduce((sorted, shf) => {
-            shf.desc && sorted.push({ id: shf.heading, desc: shf.desc });
-            return sorted;
-        }, [] as SortingRule[]);
-    }
-
-    @computed get borderWidth() { return Number(COLLECTION_BORDER_WIDTH); }
-    @computed get tableColumns(): Column<Doc>[] {
-
-        const possibleKeys = this.props.documentKeys.filter(key => this.props.columns.findIndex(existingKey => existingKey.heading.toUpperCase() === key.toUpperCase()) === -1);
-        const columns: Column<Doc>[] = [];
-        const tableIsFocused = this.props.isFocused(this.props.Document);
-        const focusedRow = this._focusedCell.row;
-        const focusedCol = this._focusedCell.col;
-        const isEditable = !this.props.headerIsEditing;
-
-        if (this.childDocs.reduce((found, doc) => found || doc.type === "collection", false)) {
-            columns.push(
-                {
-                    expander: true,
-                    Header: "",
-                    width: 30,
-                    Expander: (rowInfo) => {
-                        if (rowInfo.original.type === "collection") {
-                            if (rowInfo.isExpanded) return <div className="collectionSchemaView-expander" onClick={() => this.onCloseCollection(rowInfo.original)}><FontAwesomeIcon icon={"sort-up"} size="sm" /></div>;
-                            if (!rowInfo.isExpanded) return <div className="collectionSchemaView-expander" onClick={() => this.onExpandCollection(rowInfo.original)}><FontAwesomeIcon icon={"sort-down"} size="sm" /></div>;
-                        } else {
-                            return null;
-                        }
-                    }
-                }
-            );
-        }
-
-        const cols = this.props.columns.map(col => {
-
-            const icon: IconProp = this.getColumnType(col) === ColumnType.Number ? "hashtag" : this.getColumnType(col) === ColumnType.String ? "font" :
-                this.getColumnType(col) === ColumnType.Boolean ? "check-square" : this.getColumnType(col) === ColumnType.Doc ? "file" :
-                    this.getColumnType(col) === ColumnType.Image ? "image" : this.getColumnType(col) === ColumnType.List ? "list-ul" : "align-justify";
-
-
-
-            const menuContent = <div><FontAwesomeIcon icon={icon} size="sm" />  {col.heading}</div>;
-            const header =
-                <div className="collectionSchemaView-header"
-                    onClick={e => this.props.openHeader(col, menuContent, e.clientX, e.clientY)}
-                    style={{
-                        background: col.color, padding: "4px",
-                        letterSpacing: "2px",
-                        textTransform: "uppercase"
-                    }}>
-                    {menuContent}
-                </div>;
-
-            return {
-                Header: <MovableColumn columnRenderer={header} columnValue={col} allColumns={this.props.columns} reorderColumns={this.props.reorderColumns} ScreenToLocalTransform={this.props.ScreenToLocalTransform} />,
-                accessor: (doc: Doc) => doc ? doc[col.heading] : 0,
-                id: col.heading,
-                Cell: (rowProps: CellInfo) => {
-                    const rowIndex = rowProps.index;
-                    const columnIndex = this.props.columns.map(c => c.heading).indexOf(rowProps.column.id!);
-                    const isFocused = focusedRow === rowIndex && focusedCol === columnIndex && tableIsFocused;
-
-                    const props: CellProps = {
-                        row: rowIndex,
-                        col: columnIndex,
-                        rowProps: rowProps,
-                        isFocused: isFocused,
-                        changeFocusedCellByIndex: this.changeFocusedCellByIndex,
-                        CollectionView: this.props.CollectionView,
-                        ContainingCollection: this.props.ContainingCollectionView,
-                        Document: this.props.Document,
-                        fieldKey: this.props.fieldKey,
-                        renderDepth: this.props.renderDepth,
-                        addDocTab: this.props.addDocTab,
-                        pinToPres: this.props.pinToPres,
-                        moveDocument: this.props.moveDocument,
-                        setIsEditing: this.setCellIsEditing,
-                        isEditable: isEditable,
-                        setPreviewDoc: this.props.setPreviewDoc,
-                        setComputed: this.setComputed,
-                        getField: this.getField,
-                        showDoc: this.showDoc,
-                    };
-
-                    const colType = this.getColumnType(col);
-                    if (colType === ColumnType.Number) return <CollectionSchemaNumberCell {...props} />;
-                    if (colType === ColumnType.String) return <CollectionSchemaStringCell {...props} />;
-                    if (colType === ColumnType.Boolean) return <CollectionSchemaCheckboxCell {...props} />;
-                    if (colType === ColumnType.Doc) return <CollectionSchemaDocCell {...props} />;
-                    if (colType === ColumnType.Image) return <CollectionSchemaImageCell {...props} />;
-                    if (colType === ColumnType.List) return <CollectionSchemaListCell {...props} />;
-                    return <CollectionSchemaCell {...props} />;
-                },
-                minWidth: 200,
-            };
-        });
-        columns.push(...cols);
-
-        columns.push({
-            Header: <CollectionSchemaAddColumnHeader createColumn={this.createColumn} />,
-            accessor: (doc: Doc) => 0,
-            id: "add",
-            Cell: (rowProps: CellInfo) => <></>,
-            width: 28,
-            resizable: false
-        });
-        return columns;
-    }
-
-    constructor(props: SchemaTableProps) {
-        super(props);
-        // convert old schema columns (list of strings) into new schema columns (list of schema header fields)
-        const oldSchemaColumns = Cast(this.props.Document.schemaColumns, listSpec("string"), []);
-        if (oldSchemaColumns && oldSchemaColumns.length && typeof oldSchemaColumns[0] !== "object") {
-            const newSchemaColumns = oldSchemaColumns.map(i => typeof i === "string" ? new SchemaHeaderField(i, "#f1efeb") : i);
-            this.props.Document.schemaColumns = new List<SchemaHeaderField>(newSchemaColumns);
-        }
-    }
-
-    componentDidMount() {
-        document.addEventListener("keydown", this.onKeyDown);
-    }
-
-    componentWillUnmount() {
-        document.removeEventListener("keydown", this.onKeyDown);
-    }
-
-    tableAddDoc = (doc: Doc, relativeTo?: Doc, before?: boolean) => {
-        return Doc.AddDocToList(this.props.Document, this.props.fieldKey, doc, relativeTo, before);
-    }
-
-    private getTrProps: ComponentPropsGetterR = (state, rowInfo) => {
-        return !rowInfo ? {} : {
-            ScreenToLocalTransform: this.props.ScreenToLocalTransform,
-            addDoc: this.tableAddDoc,
-            removeDoc: this.props.deleteDocument,
-            rowInfo,
-            rowFocused: !this.props.headerIsEditing && rowInfo.index === this._focusedCell.row && this.props.isFocused(this.props.Document),
-            textWrapRow: this.toggleTextWrapRow,
-            rowWrapped: this.textWrappedRows.findIndex(id => rowInfo.original[Id] === id) > -1,
-            dropAction: StrCast(this.props.Document.childDropAction),
-            addDocTab: this.props.addDocTab
-        };
-    }
-
-    private getTdProps: ComponentPropsGetterR = (state, rowInfo, column, instance) => {
-        if (!rowInfo || column) return {};
-
-        const row = rowInfo.index;
-        //@ts-ignore
-        const col = this.columns.map(c => c.heading).indexOf(column!.id);
-        const isFocused = this._focusedCell.row === row && this._focusedCell.col === col && this.props.isFocused(this.props.Document);
-        // TODO: editing border doesn't work :(
-        return {
-            style: {
-                border: !this.props.headerIsEditing && isFocused ? "2px solid rgb(255, 160, 160)" : "1px solid #f1efeb"
-            }
-        };
-    }
-
-    @action
-    onCloseCollection = (collection: Doc): void => {
-        const index = this._openCollections.findIndex(col => col === collection[Id]);
-        if (index > -1) this._openCollections.splice(index, 1);
-    }
-
-    @action onExpandCollection = (collection: Doc) => this._openCollections.push(collection[Id]);
-    @action setCellIsEditing = (isEditing: boolean) => this._cellIsEditing = isEditing;
-
-    @action
-    onKeyDown = (e: KeyboardEvent): void => {
-        if (!this._cellIsEditing && !this.props.headerIsEditing && this.props.isFocused(this.props.Document)) {// && this.props.isSelected(true)) {
-            const direction = e.key === "Tab" ? "tab" : e.which === 39 ? "right" : e.which === 37 ? "left" : e.which === 38 ? "up" : e.which === 40 ? "down" : "";
-            this._focusedCell = this.changeFocusedCellByDirection(direction, this._focusedCell.row, this._focusedCell.col);
-
-            const pdoc = FieldValue(this.childDocs[this._focusedCell.row]);
-            pdoc && this.props.setPreviewDoc(pdoc);
-        }
-    }
-
-    changeFocusedCellByDirection = (direction: string, curRow: number, curCol: number) => {
-        switch (direction) {
-            case "tab": return { row: (curRow + 1 === this.childDocs.length ? 0 : curRow + 1), col: curCol + 1 === this.props.columns.length ? 0 : curCol + 1 };
-            case "right": return { row: curRow, col: curCol + 1 === this.props.columns.length ? curCol : curCol + 1 };
-            case "left": return { row: curRow, col: curCol === 0 ? curCol : curCol - 1 };
-            case "up": return { row: curRow === 0 ? curRow : curRow - 1, col: curCol };
-            case "down": return { row: curRow + 1 === this.childDocs.length ? curRow : curRow + 1, col: curCol };
-        }
-        return this._focusedCell;
-    }
-
-    @action
-    changeFocusedCellByIndex = (row: number, col: number): void => {
-        if (this._focusedCell.row !== row || this._focusedCell.col !== col) {
-            this._focusedCell = { row: row, col: col };
-        }
-        this.props.setFocused(this.props.Document);
-    }
-
-    @undoBatch
-    createRow = () => {
-        this.props.addDocument(Docs.Create.TextDocument("", { title: "", _width: 100, _height: 30 }));
-    }
-
-    @undoBatch
-    @action
-    createColumn = () => {
-        let index = 0;
-        let found = this.props.columns.findIndex(col => col.heading.toUpperCase() === "New field".toUpperCase()) > -1;
-        while (found) {
-            index++;
-            found = this.props.columns.findIndex(col => col.heading.toUpperCase() === ("New field (" + index + ")").toUpperCase()) > -1;
-        }
-        this.props.columns.push(new SchemaHeaderField(`New field ${index ? "(" + index + ")" : ""}`, "#f1efeb"));
-    }
-
-    getColumnType = (column: SchemaHeaderField): ColumnType => {
-        // added functionality to convert old column type stuff to new column type stuff -syip
-        if (column.type && column.type !== 0) {
-            return column.type;
-        }
-        if (columnTypes.get(column.heading)) {
-            column.type = columnTypes.get(column.heading)!;
-            return columnTypes.get(column.heading)!;
-        }
-        const typesDoc = FieldValue(Cast(this.props.Document.schemaColumnTypes, Doc));
-        if (!typesDoc) {
-            column.type = ColumnType.Any;
-            return ColumnType.Any;
-        }
-        column.type = NumCast(typesDoc[column.heading]);
-        return NumCast(typesDoc[column.heading]);
-    }
-
-    @undoBatch
-    @action
-    toggleTextwrap = async () => {
-        const textwrappedRows = Cast(this.props.Document.textwrappedSchemaRows, listSpec("string"), []);
-        if (textwrappedRows.length) {
-            this.props.Document.textwrappedSchemaRows = new List<string>([]);
-        } else {
-            const docs = DocListCast(this.props.Document[this.props.fieldKey]);
-            const allRows = docs instanceof Doc ? [docs[Id]] : docs.map(doc => doc[Id]);
-            this.props.Document.textwrappedSchemaRows = new List<string>(allRows);
-        }
-    }
-
-    @action
-    toggleTextWrapRow = (doc: Doc): void => {
-        const textWrapped = this.textWrappedRows;
-        const index = textWrapped.findIndex(id => doc[Id] === id);
-
-        index > -1 ? textWrapped.splice(index, 1) : textWrapped.push(doc[Id]);
-
-        this.textWrappedRows = textWrapped;
-    }
-
-    @computed
-    get reactTable() {
-        const children = this.childDocs;
-        const hasCollectionChild = children.reduce((found, doc) => found || doc.type === "collection", false);
-        const expandedRowsList = this._openCollections.map(col => children.findIndex(doc => doc[Id] === col).toString());
-        const expanded = {};
-        //@ts-ignore
-        expandedRowsList.forEach(row => expanded[row] = true);
-        const rerender = [...this.textWrappedRows]; // TODO: get component to rerender on text wrap change without needign to console.log :((((
-
-        return <ReactTable
-            style={{ position: "relative" }}
-            data={children}
-            page={0}
-            pageSize={children.length}
-            showPagination={false}
-            columns={this.tableColumns}
-            getTrProps={this.getTrProps}
-            getTdProps={this.getTdProps}
-            sortable={false}
-            TrComponent={MovableRow}
-            sorted={this.sorted}
-            expanded={expanded}
-            resized={this.resized}
-            onResizedChange={this.props.onResizedChange}
-            SubComponent={!hasCollectionChild ? undefined : row => (row.original.type !== "collection") ? (null) :
-                <div className="reactTable-sub"><SchemaTable {...this.props} Document={row.original} dataDoc={undefined} childDocs={undefined} /></div>}
-
-        />;
-    }
-
-    onContextMenu = (e: React.MouseEvent): void => {
-        if (!e.isPropagationStopped() && this.props.Document[Id] !== "mainDoc") { // need to test this because GoldenLayout causes a parallel hierarchy in the React DOM for its children and the main document view7
-            // ContextMenu.Instance.addItem({ description: "Make DB", event: this.makeDB, icon: "table" });
-            ContextMenu.Instance.addItem({ description: "Toggle text wrapping", event: this.toggleTextwrap, icon: "table" });
-        }
-    }
-
-    getField = (row: number, col?: number) => {
-        const docs = this.childDocs;
-
-        row = row % docs.length;
-        while (row < 0) row += docs.length;
-        const columns = this.props.columns;
-        const doc = docs[row];
-        if (col === undefined) {
-            return doc;
-        }
-        if (col >= 0 && col < columns.length) {
-            const column = this.props.columns[col].heading;
-            return doc[column];
-        }
-        return undefined;
-    }
-
-    createTransformer = (row: number, col: number): Transformer => {
-        const self = this;
-        const captures: { [name: string]: Field } = {};
-
-        const transformer: ts.TransformerFactory<ts.SourceFile> = context => {
-            return root => {
-                function visit(node: ts.Node) {
-                    node = ts.visitEachChild(node, visit, context);
-                    if (ts.isIdentifier(node)) {
-                        const isntPropAccess = !ts.isPropertyAccessExpression(node.parent) || node.parent.expression === node;
-                        const isntPropAssign = !ts.isPropertyAssignment(node.parent) || node.parent.name !== node;
-                        if (isntPropAccess && isntPropAssign) {
-                            if (node.text === "$r") {
-                                return ts.createNumericLiteral(row.toString());
-                            } else if (node.text === "$c") {
-                                return ts.createNumericLiteral(col.toString());
-                            } else if (node.text === "$") {
-                                if (ts.isCallExpression(node.parent)) {
-                                    // captures.doc = self.props.Document;
-                                    // captures.key = self.props.fieldKey;
-                                }
-                            }
-                        }
-                    }
-
-                    return node;
-                }
-                return ts.visitNode(root, visit);
-            };
-        };
-
-        // const getVars = () => {
-        //     return { capturedVariables: captures };
-        // };
-
-        return { transformer, /*getVars*/ };
-    }
-
-    setComputed = (script: string, doc: Doc, field: string, row: number, col: number): boolean => {
-        script =
-            `const $ = (row:number, col?:number) => {
-                if(col === undefined) {
-                    return (doc as any)[key][row + ${row}];
-                }
-                return (doc as any)[key][row + ${row}][(doc as any).schemaColumns[col + ${col}].heading];
-            }
-            return ${script}`;
-        const compiled = CompileScript(script, { params: { this: Doc.name }, capturedVariables: { doc: this.props.Document, key: this.props.fieldKey }, typecheck: false, transformer: this.createTransformer(row, col) });
-        if (compiled.compiled) {
-            doc[field] = new ComputedField(compiled);
-            return true;
-        }
-        return false;
-    }
-
-    @action
-    showDoc = (doc: Doc | undefined, dataDoc?: Doc, screenX?: number, screenY?: number) => {
-        this._showDoc = doc;
-        if (dataDoc && screenX && screenY) {
-            this._showDocPos = this.props.ScreenToLocalTransform().transformPoint(screenX, screenY);
-        }
-    }
-
-    onOpenClick = () => {
-        if (this._showDoc) {
-            this.props.addDocTab(this._showDoc, "onRight");
-        }
-    }
-
-    getPreviewTransform = (): Transform => {
-        return this.props.ScreenToLocalTransform().translate(- this.borderWidth - 4 - this.tableWidth, - this.borderWidth);
-    }
-
-    render() {
-        const preview = "";
-        return <div className="collectionSchemaView-table" onPointerDown={this.props.onPointerDown} onWheel={e => this.props.active(true) && e.stopPropagation()}
-            onDrop={e => this.props.onDrop(e, {})} onContextMenu={this.onContextMenu} >
-            {this.reactTable}
-            <div className="collectionSchemaView-addRow" onClick={() => this.createRow()}>+ new</div>
-            {!this._showDoc ? (null) :
-                <div className="collectionSchemaView-documentPreview" //onClick={() => { this.onOpenClick(); }}
-                    style={{
-                        position: "absolute", width: 150, height: 150,
-                        background: "dimGray", display: "block", top: 0, left: 0,
-                        transform: `translate(${this._showDocPos[0]}px, ${this._showDocPos[1] - 180}px)`
-                    }}
-                    ref="overlay"><ContentFittingDocumentView
-                        Document={this._showDoc}
-                        DataDoc={this._showDataDoc}
-                        NativeHeight={returnZero}
-                        NativeWidth={returnZero}
-                        fitToBox={true}
-                        FreezeDimensions={true}
-                        focus={emptyFunction}
-                        LibraryPath={emptyPath}
-                        renderDepth={this.props.renderDepth}
-                        rootSelected={() => false}
-                        PanelWidth={() => 150}
-                        PanelHeight={() => 150}
-                        ScreenToLocalTransform={this.getPreviewTransform}
-                        docFilters={returnEmptyFilter}
-                        ContainingCollectionDoc={this.props.CollectionView?.props.Document}
-                        ContainingCollectionView={this.props.CollectionView}
-                        moveDocument={this.props.moveDocument}
-                        parentActive={this.props.active}
-                        whenActiveChanged={emptyFunction}
-                        addDocTab={this.props.addDocTab}
-                        pinToPres={this.props.pinToPres}
-                        bringToFront={returnFalse}
-                        ContentScaling={returnOne}>
-                    </ContentFittingDocumentView>
-                </div>}
-        </div>;
-    }
 }
\ No newline at end of file
diff --git a/src/client/views/collections/SchemaTable.tsx b/src/client/views/collections/SchemaTable.tsx
new file mode 100644
index 000000000..97d4bb303
--- /dev/null
+++ b/src/client/views/collections/SchemaTable.tsx
@@ -0,0 +1,550 @@
+import React = require("react");
+import { IconProp } from '@fortawesome/fontawesome-svg-core';
+import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { action, computed, observable } from "mobx";
+import { observer } from "mobx-react";
+import ReactTable, { CellInfo, Column, ComponentPropsGetterR, Resize, SortingRule } from "react-table";
+import "react-table/react-table.css";
+import { Doc, DocListCast, Field, Opt } from "../../../fields/Doc";
+import { Id } from "../../../fields/FieldSymbols";
+import { List } from "../../../fields/List";
+import { listSpec } from "../../../fields/Schema";
+import { SchemaHeaderField } from "../../../fields/SchemaHeaderField";
+import { ComputedField } from "../../../fields/ScriptField";
+import { Cast, FieldValue, NumCast, StrCast, BoolCast } from "../../../fields/Types";
+import { Docs, DocumentOptions } from "../../documents/Documents";
+import { CompileScript, Transformer, ts } from "../../util/Scripting";
+import { Transform } from "../../util/Transform";
+import { undoBatch } from "../../util/UndoManager";
+import { COLLECTION_BORDER_WIDTH } from '../../views/globalCssVariables.scss';
+import { ContextMenu } from "../ContextMenu";
+import '../DocumentDecorations.scss';
+import { CellProps, CollectionSchemaCell, CollectionSchemaCheckboxCell, CollectionSchemaDocCell, CollectionSchemaNumberCell, CollectionSchemaStringCell, CollectionSchemaImageCell, CollectionSchemaListCell } from "./CollectionSchemaCells";
+import { CollectionSchemaAddColumnHeader } from "./CollectionSchemaHeaders";
+import { MovableColumn, MovableRow } from "./CollectionSchemaMovableTableHOC";
+import "./CollectionSchemaView.scss";
+import { CollectionView } from "./CollectionView";
+import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView";
+import { emptyFunction, returnZero, returnOne, returnFalse, returnEmptyFilter, emptyPath } from "../../../Utils";
+
+
+enum ColumnType {
+    Any,
+    Number,
+    String,
+    Boolean,
+    Doc,
+    Image,
+    List
+}
+
+// this map should be used for keys that should have a const type of value
+const columnTypes: Map<string, ColumnType> = new Map([
+    ["title", ColumnType.String],
+    ["x", ColumnType.Number], ["y", ColumnType.Number], ["_width", ColumnType.Number], ["_height", ColumnType.Number],
+    ["_nativeWidth", ColumnType.Number], ["_nativeHeight", ColumnType.Number], ["isPrototype", ColumnType.Boolean],
+    ["page", ColumnType.Number], ["curPage", ColumnType.Number], ["currentTimecode", ColumnType.Number], ["zIndex", ColumnType.Number]
+]);
+
+export interface SchemaTableProps {
+    Document: Doc; // child doc
+    dataDoc?: Doc;
+    PanelHeight: () => number;
+    PanelWidth: () => number;
+    childDocs?: Doc[];
+    CollectionView: Opt<CollectionView>;
+    ContainingCollectionView: Opt<CollectionView>;
+    ContainingCollectionDoc: Opt<Doc>;
+    fieldKey: string;
+    renderDepth: number;
+    deleteDocument: (document: Doc | Doc[]) => boolean;
+    addDocument: (document: Doc | Doc[]) => boolean;
+    moveDocument: (document: Doc | Doc[], targetCollection: Doc | undefined, addDocument: (document: Doc | Doc[]) => boolean) => boolean;
+    ScreenToLocalTransform: () => Transform;
+    active: (outsideReaction: boolean) => boolean;
+    onDrop: (e: React.DragEvent<Element>, options: DocumentOptions, completed?: (() => void) | undefined) => void;
+    addDocTab: (document: Doc, where: string) => boolean;
+    pinToPres: (document: Doc) => void;
+    isSelected: (outsideReaction?: boolean) => boolean;
+    isFocused: (document: Doc) => boolean;
+    setFocused: (document: Doc) => void;
+    setPreviewDoc: (document: Doc) => void;
+    columns: SchemaHeaderField[];
+    documentKeys: any[];
+    headerIsEditing: boolean;
+    openHeader: (column: any, menu: any, screenx: number, screeny: number) => void;
+    onPointerDown: (e: React.PointerEvent) => void;
+    onResizedChange: (newResized: Resize[], event: any) => void;
+    setColumns: (columns: SchemaHeaderField[]) => void;
+    reorderColumns: (toMove: SchemaHeaderField, relativeTo: SchemaHeaderField, before: boolean, columnsValues: SchemaHeaderField[]) => void;
+}
+
+@observer
+export class SchemaTable extends React.Component<SchemaTableProps> {
+    private DIVIDER_WIDTH = 4;
+
+    @observable _cellIsEditing: boolean = false;
+    @observable _focusedCell: { row: number, col: number } = { row: 0, col: 0 };
+    @observable _openCollections: Array<string> = [];
+
+    @observable _showDoc: Doc | undefined;
+    @observable _showDataDoc: any = "";
+    @observable _showDocPos: number[] = [];
+
+    @computed get previewWidth() { return () => NumCast(this.props.Document.schemaPreviewWidth); }
+    @computed get previewHeight() { return () => this.props.PanelHeight() - 2 * this.borderWidth; }
+    @computed get tableWidth() { return this.props.PanelWidth() - 2 * this.borderWidth - this.DIVIDER_WIDTH - this.previewWidth(); }
+
+    @computed get childDocs() {
+        if (this.props.childDocs) return this.props.childDocs;
+
+        const doc = this.props.dataDoc ? this.props.dataDoc : this.props.Document;
+        return DocListCast(doc[this.props.fieldKey]);
+    }
+    set childDocs(docs: Doc[]) {
+        const doc = this.props.dataDoc ? this.props.dataDoc : this.props.Document;
+        doc[this.props.fieldKey] = new List<Doc>(docs);
+    }
+
+    @computed get textWrappedRows() {
+        return Cast(this.props.Document.textwrappedSchemaRows, listSpec("string"), []);
+    }
+    set textWrappedRows(textWrappedRows: string[]) {
+        this.props.Document.textwrappedSchemaRows = new List<string>(textWrappedRows);
+    }
+
+    @computed get resized(): { id: string, value: number }[] {
+        return this.props.columns.reduce((resized, shf) => {
+            (shf.width > -1) && resized.push({ id: shf.heading, value: shf.width });
+            return resized;
+        }, [] as { id: string, value: number }[]);
+    }
+    @computed get sorted(): SortingRule[] {
+        return this.props.columns.reduce((sorted, shf) => {
+            shf.desc && sorted.push({ id: shf.heading, desc: shf.desc });
+            return sorted;
+        }, [] as SortingRule[]);
+    }
+
+    @computed get borderWidth() { return Number(COLLECTION_BORDER_WIDTH); }
+    @computed get tableColumns(): Column<Doc>[] {
+
+        const possibleKeys = this.props.documentKeys.filter(key => this.props.columns.findIndex(existingKey => existingKey.heading.toUpperCase() === key.toUpperCase()) === -1);
+        const columns: Column<Doc>[] = [];
+        const tableIsFocused = this.props.isFocused(this.props.Document);
+        const focusedRow = this._focusedCell.row;
+        const focusedCol = this._focusedCell.col;
+        const isEditable = !this.props.headerIsEditing;
+
+        if (this.childDocs.reduce((found, doc) => found || doc.type === "collection", false)) {
+            columns.push(
+                {
+                    expander: true,
+                    Header: "",
+                    width: 30,
+                    Expander: (rowInfo) => {
+                        if (rowInfo.original.type === "collection") {
+                            if (rowInfo.isExpanded) return <div className="collectionSchemaView-expander" onClick={() => this.onCloseCollection(rowInfo.original)}><FontAwesomeIcon icon={"sort-up"} size="sm" /></div>;
+                            if (!rowInfo.isExpanded) return <div className="collectionSchemaView-expander" onClick={() => this.onExpandCollection(rowInfo.original)}><FontAwesomeIcon icon={"sort-down"} size="sm" /></div>;
+                        } else {
+                            return null;
+                        }
+                    }
+                }
+            );
+        }
+
+        const cols = this.props.columns.map(col => {
+
+            const icon: IconProp = this.getColumnType(col) === ColumnType.Number ? "hashtag" : this.getColumnType(col) === ColumnType.String ? "font" :
+                this.getColumnType(col) === ColumnType.Boolean ? "check-square" : this.getColumnType(col) === ColumnType.Doc ? "file" :
+                    this.getColumnType(col) === ColumnType.Image ? "image" : this.getColumnType(col) === ColumnType.List ? "list-ul" : "align-justify";
+
+
+
+            const menuContent = <div><FontAwesomeIcon icon={icon} size="sm" />  {col.heading}</div>;
+            const header =
+                <div className="collectionSchemaView-header"
+                    onClick={e => this.props.openHeader(col, menuContent, e.clientX, e.clientY)}
+                    style={{
+                        background: col.color, padding: "4px",
+                        letterSpacing: "2px",
+                        textTransform: "uppercase"
+                    }}>
+                    {menuContent}
+                </div>;
+
+            return {
+                Header: <MovableColumn columnRenderer={header} columnValue={col} allColumns={this.props.columns} reorderColumns={this.props.reorderColumns} ScreenToLocalTransform={this.props.ScreenToLocalTransform} />,
+                accessor: (doc: Doc) => doc ? doc[col.heading] : 0,
+                id: col.heading,
+                Cell: (rowProps: CellInfo) => {
+                    const rowIndex = rowProps.index;
+                    const columnIndex = this.props.columns.map(c => c.heading).indexOf(rowProps.column.id!);
+                    const isFocused = focusedRow === rowIndex && focusedCol === columnIndex && tableIsFocused;
+
+                    const props: CellProps = {
+                        row: rowIndex,
+                        col: columnIndex,
+                        rowProps: rowProps,
+                        isFocused: isFocused,
+                        changeFocusedCellByIndex: this.changeFocusedCellByIndex,
+                        CollectionView: this.props.CollectionView,
+                        ContainingCollection: this.props.ContainingCollectionView,
+                        Document: this.props.Document,
+                        fieldKey: this.props.fieldKey,
+                        renderDepth: this.props.renderDepth,
+                        addDocTab: this.props.addDocTab,
+                        pinToPres: this.props.pinToPres,
+                        moveDocument: this.props.moveDocument,
+                        setIsEditing: this.setCellIsEditing,
+                        isEditable: isEditable,
+                        setPreviewDoc: this.props.setPreviewDoc,
+                        setComputed: this.setComputed,
+                        getField: this.getField,
+                        showDoc: this.showDoc,
+                    };
+
+                    const colType = this.getColumnType(col);
+                    if (colType === ColumnType.Number) return <CollectionSchemaNumberCell {...props} />;
+                    if (colType === ColumnType.String) return <CollectionSchemaStringCell {...props} />;
+                    if (colType === ColumnType.Boolean) return <CollectionSchemaCheckboxCell {...props} />;
+                    if (colType === ColumnType.Doc) return <CollectionSchemaDocCell {...props} />;
+                    if (colType === ColumnType.Image) return <CollectionSchemaImageCell {...props} />;
+                    if (colType === ColumnType.List) return <CollectionSchemaListCell {...props} />;
+                    return <CollectionSchemaCell {...props} />;
+                },
+                minWidth: 200,
+            };
+        });
+        columns.push(...cols);
+
+        columns.push({
+            Header: <CollectionSchemaAddColumnHeader createColumn={this.createColumn} />,
+            accessor: (doc: Doc) => 0,
+            id: "add",
+            Cell: (rowProps: CellInfo) => <></>,
+            width: 28,
+            resizable: false
+        });
+        return columns;
+    }
+
+    constructor(props: SchemaTableProps) {
+        super(props);
+        // convert old schema columns (list of strings) into new schema columns (list of schema header fields)
+        const oldSchemaColumns = Cast(this.props.Document.schemaColumns, listSpec("string"), []);
+        if (oldSchemaColumns && oldSchemaColumns.length && typeof oldSchemaColumns[0] !== "object") {
+            const newSchemaColumns = oldSchemaColumns.map(i => typeof i === "string" ? new SchemaHeaderField(i, "#f1efeb") : i);
+            this.props.Document.schemaColumns = new List<SchemaHeaderField>(newSchemaColumns);
+        }
+    }
+
+    componentDidMount() {
+        document.addEventListener("keydown", this.onKeyDown);
+    }
+
+    componentWillUnmount() {
+        document.removeEventListener("keydown", this.onKeyDown);
+    }
+
+    tableAddDoc = (doc: Doc, relativeTo?: Doc, before?: boolean) => {
+        return Doc.AddDocToList(this.props.Document, this.props.fieldKey, doc, relativeTo, before);
+    }
+
+    private getTrProps: ComponentPropsGetterR = (state, rowInfo) => {
+        return !rowInfo ? {} : {
+            ScreenToLocalTransform: this.props.ScreenToLocalTransform,
+            addDoc: this.tableAddDoc,
+            removeDoc: this.props.deleteDocument,
+            rowInfo,
+            rowFocused: !this.props.headerIsEditing && rowInfo.index === this._focusedCell.row && this.props.isFocused(this.props.Document),
+            textWrapRow: this.toggleTextWrapRow,
+            rowWrapped: this.textWrappedRows.findIndex(id => rowInfo.original[Id] === id) > -1,
+            dropAction: StrCast(this.props.Document.childDropAction),
+            addDocTab: this.props.addDocTab
+        };
+    }
+
+    private getTdProps: ComponentPropsGetterR = (state, rowInfo, column, instance) => {
+        if (!rowInfo || column) return {};
+
+        const row = rowInfo.index;
+        //@ts-ignore
+        const col = this.columns.map(c => c.heading).indexOf(column!.id);
+        const isFocused = this._focusedCell.row === row && this._focusedCell.col === col && this.props.isFocused(this.props.Document);
+        // TODO: editing border doesn't work :(
+        return {
+            style: {
+                border: !this.props.headerIsEditing && isFocused ? "2px solid rgb(255, 160, 160)" : "1px solid #f1efeb"
+            }
+        };
+    }
+
+    @action
+    onCloseCollection = (collection: Doc): void => {
+        const index = this._openCollections.findIndex(col => col === collection[Id]);
+        if (index > -1) this._openCollections.splice(index, 1);
+    }
+
+    @action onExpandCollection = (collection: Doc) => this._openCollections.push(collection[Id]);
+    @action setCellIsEditing = (isEditing: boolean) => this._cellIsEditing = isEditing;
+
+    @action
+    onKeyDown = (e: KeyboardEvent): void => {
+        if (!this._cellIsEditing && !this.props.headerIsEditing && this.props.isFocused(this.props.Document)) {// && this.props.isSelected(true)) {
+            const direction = e.key === "Tab" ? "tab" : e.which === 39 ? "right" : e.which === 37 ? "left" : e.which === 38 ? "up" : e.which === 40 ? "down" : "";
+            this._focusedCell = this.changeFocusedCellByDirection(direction, this._focusedCell.row, this._focusedCell.col);
+
+            const pdoc = FieldValue(this.childDocs[this._focusedCell.row]);
+            pdoc && this.props.setPreviewDoc(pdoc);
+        }
+    }
+
+    changeFocusedCellByDirection = (direction: string, curRow: number, curCol: number) => {
+        switch (direction) {
+            case "tab": return { row: (curRow + 1 === this.childDocs.length ? 0 : curRow + 1), col: curCol + 1 === this.props.columns.length ? 0 : curCol + 1 };
+            case "right": return { row: curRow, col: curCol + 1 === this.props.columns.length ? curCol : curCol + 1 };
+            case "left": return { row: curRow, col: curCol === 0 ? curCol : curCol - 1 };
+            case "up": return { row: curRow === 0 ? curRow : curRow - 1, col: curCol };
+            case "down": return { row: curRow + 1 === this.childDocs.length ? curRow : curRow + 1, col: curCol };
+        }
+        return this._focusedCell;
+    }
+
+    @action
+    changeFocusedCellByIndex = (row: number, col: number): void => {
+        if (this._focusedCell.row !== row || this._focusedCell.col !== col) {
+            this._focusedCell = { row: row, col: col };
+        }
+        this.props.setFocused(this.props.Document);
+    }
+
+    @undoBatch
+    createRow = () => {
+        this.props.addDocument(Docs.Create.TextDocument("", { title: "", _width: 100, _height: 30 }));
+    }
+
+    @undoBatch
+    @action
+    createColumn = () => {
+        let index = 0;
+        let found = this.props.columns.findIndex(col => col.heading.toUpperCase() === "New field".toUpperCase()) > -1;
+        while (found) {
+            index++;
+            found = this.props.columns.findIndex(col => col.heading.toUpperCase() === ("New field (" + index + ")").toUpperCase()) > -1;
+        }
+        this.props.columns.push(new SchemaHeaderField(`New field ${index ? "(" + index + ")" : ""}`, "#f1efeb"));
+    }
+
+    getColumnType = (column: SchemaHeaderField): ColumnType => {
+        // added functionality to convert old column type stuff to new column type stuff -syip
+        if (column.type && column.type !== 0) {
+            return column.type;
+        }
+        if (columnTypes.get(column.heading)) {
+            column.type = columnTypes.get(column.heading)!;
+            return columnTypes.get(column.heading)!;
+        }
+        const typesDoc = FieldValue(Cast(this.props.Document.schemaColumnTypes, Doc));
+        if (!typesDoc) {
+            column.type = ColumnType.Any;
+            return ColumnType.Any;
+        }
+        column.type = NumCast(typesDoc[column.heading]);
+        return NumCast(typesDoc[column.heading]);
+    }
+
+    @undoBatch
+    @action
+    toggleTextwrap = async () => {
+        const textwrappedRows = Cast(this.props.Document.textwrappedSchemaRows, listSpec("string"), []);
+        if (textwrappedRows.length) {
+            this.props.Document.textwrappedSchemaRows = new List<string>([]);
+        } else {
+            const docs = DocListCast(this.props.Document[this.props.fieldKey]);
+            const allRows = docs instanceof Doc ? [docs[Id]] : docs.map(doc => doc[Id]);
+            this.props.Document.textwrappedSchemaRows = new List<string>(allRows);
+        }
+    }
+
+    @action
+    toggleTextWrapRow = (doc: Doc): void => {
+        const textWrapped = this.textWrappedRows;
+        const index = textWrapped.findIndex(id => doc[Id] === id);
+
+        index > -1 ? textWrapped.splice(index, 1) : textWrapped.push(doc[Id]);
+
+        this.textWrappedRows = textWrapped;
+    }
+
+    @computed
+    get reactTable() {
+        const children = this.childDocs;
+        const hasCollectionChild = children.reduce((found, doc) => found || doc.type === "collection", false);
+        const expandedRowsList = this._openCollections.map(col => children.findIndex(doc => doc[Id] === col).toString());
+        const expanded = {};
+        //@ts-ignore
+        expandedRowsList.forEach(row => expanded[row] = true);
+        const rerender = [...this.textWrappedRows]; // TODO: get component to rerender on text wrap change without needign to console.log :((((
+
+        return <ReactTable
+            style={{ position: "relative" }}
+            data={children}
+            page={0}
+            pageSize={children.length}
+            showPagination={false}
+            columns={this.tableColumns}
+            getTrProps={this.getTrProps}
+            getTdProps={this.getTdProps}
+            sortable={false}
+            TrComponent={MovableRow}
+            sorted={this.sorted}
+            expanded={expanded}
+            resized={this.resized}
+            onResizedChange={this.props.onResizedChange}
+            SubComponent={!hasCollectionChild ? undefined : row => (row.original.type !== "collection") ? (null) :
+                <div className="reactTable-sub"><SchemaTable {...this.props} Document={row.original} dataDoc={undefined} childDocs={undefined} /></div>}
+
+        />;
+    }
+
+    onContextMenu = (e: React.MouseEvent): void => {
+        if (!e.isPropagationStopped() && this.props.Document[Id] !== "mainDoc") { // need to test this because GoldenLayout causes a parallel hierarchy in the React DOM for its children and the main document view7
+            // ContextMenu.Instance.addItem({ description: "Make DB", event: this.makeDB, icon: "table" });
+            ContextMenu.Instance.addItem({ description: "Toggle text wrapping", event: this.toggleTextwrap, icon: "table" });
+        }
+    }
+
+    getField = (row: number, col?: number) => {
+        const docs = this.childDocs;
+
+        row = row % docs.length;
+        while (row < 0) row += docs.length;
+        const columns = this.props.columns;
+        const doc = docs[row];
+        if (col === undefined) {
+            return doc;
+        }
+        if (col >= 0 && col < columns.length) {
+            const column = this.props.columns[col].heading;
+            return doc[column];
+        }
+        return undefined;
+    }
+
+    createTransformer = (row: number, col: number): Transformer => {
+        const self = this;
+        const captures: { [name: string]: Field } = {};
+
+        const transformer: ts.TransformerFactory<ts.SourceFile> = context => {
+            return root => {
+                function visit(node: ts.Node) {
+                    node = ts.visitEachChild(node, visit, context);
+                    if (ts.isIdentifier(node)) {
+                        const isntPropAccess = !ts.isPropertyAccessExpression(node.parent) || node.parent.expression === node;
+                        const isntPropAssign = !ts.isPropertyAssignment(node.parent) || node.parent.name !== node;
+                        if (isntPropAccess && isntPropAssign) {
+                            if (node.text === "$r") {
+                                return ts.createNumericLiteral(row.toString());
+                            } else if (node.text === "$c") {
+                                return ts.createNumericLiteral(col.toString());
+                            } else if (node.text === "$") {
+                                if (ts.isCallExpression(node.parent)) {
+                                    // captures.doc = self.props.Document;
+                                    // captures.key = self.props.fieldKey;
+                                }
+                            }
+                        }
+                    }
+
+                    return node;
+                }
+                return ts.visitNode(root, visit);
+            };
+        };
+
+        // const getVars = () => {
+        //     return { capturedVariables: captures };
+        // };
+
+        return { transformer, /*getVars*/ };
+    }
+
+    setComputed = (script: string, doc: Doc, field: string, row: number, col: number): boolean => {
+        script =
+            `const $ = (row:number, col?:number) => {
+                if(col === undefined) {
+                    return (doc as any)[key][row + ${row}];
+                }
+                return (doc as any)[key][row + ${row}][(doc as any).schemaColumns[col + ${col}].heading];
+            }
+            return ${script}`;
+        const compiled = CompileScript(script, { params: { this: Doc.name }, capturedVariables: { doc: this.props.Document, key: this.props.fieldKey }, typecheck: false, transformer: this.createTransformer(row, col) });
+        if (compiled.compiled) {
+            doc[field] = new ComputedField(compiled);
+            return true;
+        }
+        return false;
+    }
+
+    @action
+    showDoc = (doc: Doc | undefined, dataDoc?: Doc, screenX?: number, screenY?: number) => {
+        this._showDoc = doc;
+        if (dataDoc && screenX && screenY) {
+            this._showDocPos = this.props.ScreenToLocalTransform().transformPoint(screenX, screenY);
+        }
+    }
+
+    onOpenClick = () => {
+        if (this._showDoc) {
+            this.props.addDocTab(this._showDoc, "onRight");
+        }
+    }
+
+    getPreviewTransform = (): Transform => {
+        return this.props.ScreenToLocalTransform().translate(- this.borderWidth - 4 - this.tableWidth, - this.borderWidth);
+    }
+
+    render() {
+        const preview = "";
+        return <div className="collectionSchemaView-table" onPointerDown={this.props.onPointerDown} onWheel={e => this.props.active(true) && e.stopPropagation()}
+            onDrop={e => this.props.onDrop(e, {})} onContextMenu={this.onContextMenu} >
+            {this.reactTable}
+            <div className="collectionSchemaView-addRow" onClick={() => this.createRow()}>+ new</div>
+            {!this._showDoc ? (null) :
+                <div className="collectionSchemaView-documentPreview" //onClick={() => { this.onOpenClick(); }}
+                    style={{
+                        position: "absolute", width: 150, height: 150,
+                        background: "dimGray", display: "block", top: 0, left: 0,
+                        transform: `translate(${this._showDocPos[0]}px, ${this._showDocPos[1] - 180}px)`
+                    }}
+                    ref="overlay"><ContentFittingDocumentView
+                        Document={this._showDoc}
+                        DataDoc={this._showDataDoc}
+                        NativeHeight={returnZero}
+                        NativeWidth={returnZero}
+                        fitToBox={true}
+                        FreezeDimensions={true}
+                        focus={emptyFunction}
+                        LibraryPath={emptyPath}
+                        renderDepth={this.props.renderDepth}
+                        rootSelected={() => false}
+                        PanelWidth={() => 150}
+                        PanelHeight={() => 150}
+                        ScreenToLocalTransform={this.getPreviewTransform}
+                        docFilters={returnEmptyFilter}
+                        ContainingCollectionDoc={this.props.CollectionView?.props.Document}
+                        ContainingCollectionView={this.props.CollectionView}
+                        moveDocument={this.props.moveDocument}
+                        parentActive={this.props.active}
+                        whenActiveChanged={emptyFunction}
+                        addDocTab={this.props.addDocTab}
+                        pinToPres={this.props.pinToPres}
+                        bringToFront={returnFalse}
+                        ContentScaling={returnOne}>
+                    </ContentFittingDocumentView>
+                </div>}
+        </div>;
+    }
+}
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2


From b32aa12c76d673bb0cf339741398a1fd1441167c Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Thu, 25 Jun 2020 09:45:45 -0500
Subject: minor cleanup

---
 .../views/collections/CollectionSchemaView.tsx     | 23 +++++++---------------
 1 file changed, 7 insertions(+), 16 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 332849526..2e4d10f1d 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -1,37 +1,29 @@
 import React = require("react");
-import { library, IconProp } from '@fortawesome/fontawesome-svg-core';
+import { library } from '@fortawesome/fontawesome-svg-core';
 import { faCog, faPlus, faSortDown, faSortUp, faTable } from '@fortawesome/free-solid-svg-icons';
 import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
 import { action, computed, observable, untracked } from "mobx";
 import { observer } from "mobx-react";
-import ReactTable, { CellInfo, Column, ComponentPropsGetterR, Resize, SortingRule } from "react-table";
+import { Resize } from "react-table";
 import "react-table/react-table.css";
-import { Doc, DocListCast, Field, Opt, LayoutSym } from "../../../fields/Doc";
-import { Id } from "../../../fields/FieldSymbols";
+import { Doc } from "../../../fields/Doc";
 import { List } from "../../../fields/List";
 import { listSpec } from "../../../fields/Schema";
 import { SchemaHeaderField, PastelSchemaPalette } from "../../../fields/SchemaHeaderField";
-import { ComputedField } from "../../../fields/ScriptField";
-import { Cast, FieldValue, NumCast, StrCast, BoolCast } from "../../../fields/Types";
+import { Cast, NumCast, StrCast } from "../../../fields/Types";
 import { Docs, DocumentOptions } from "../../documents/Documents";
-import { CompileScript, Transformer, ts } from "../../util/Scripting";
 import { Transform } from "../../util/Transform";
 import { undoBatch } from "../../util/UndoManager";
 import { COLLECTION_BORDER_WIDTH } from '../../views/globalCssVariables.scss';
-import { ContextMenu } from "../ContextMenu";
 import '../DocumentDecorations.scss';
-import { CellProps, CollectionSchemaCell, CollectionSchemaCheckboxCell, CollectionSchemaDocCell, CollectionSchemaNumberCell, CollectionSchemaStringCell, CollectionSchemaImageCell, CollectionSchemaListCell } from "./CollectionSchemaCells";
-import { CollectionSchemaAddColumnHeader, CollectionSchemaHeader, CollectionSchemaColumnMenu, KeysDropdown } from "./CollectionSchemaHeaders";
+import { KeysDropdown } from "./CollectionSchemaHeaders";
 import "./CollectionSchemaView.scss";
 import { CollectionSubView } from "./CollectionSubView";
-import { CollectionView } from "./CollectionView";
 import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView";
-import { setupMoveUpEvents, emptyFunction, returnZero, returnOne, returnFalse, returnEmptyFilter, emptyPath } from "../../../Utils";
+import { setupMoveUpEvents, emptyFunction, returnZero, returnOne, returnFalse } from "../../../Utils";
 import { SnappingManager } from "../../util/SnappingManager";
 import Measure from "react-measure";
-import { MovableColumn, MovableRow } from "./CollectionSchemaMovableTableHOC";
 import { SchemaTable } from "./SchemaTable";
-//import { SchemaTable } from "./SchemaTable";
 
 library.add(faCog, faPlus, faSortUp, faSortDown);
 library.add(faTable);
@@ -354,7 +346,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     }
 
     getPreviewTransform = (): Transform => {
-        return this.props.ScreenToLocalTransform().translate(- this.borderWidth - 4 - this.tableWidth, - this.borderWidth);
+        return this.props.ScreenToLocalTransform().translate(- this.borderWidth - NumCast(COLLECTION_BORDER_WIDTH) - this.tableWidth, - this.borderWidth);
     }
 
     @computed get renderMenu() {
@@ -462,7 +454,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
 
     @computed
     get schemaTable() {
-        const preview = "";
         return <SchemaTable
             Document={this.props.Document}
             PanelHeight={this.props.PanelHeight}
-- 
cgit v1.2.3-70-g09d2


From 381a2b87a7dd9d6e3629d89dec692a8e5d9d0662 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Thu, 25 Jun 2020 16:44:52 -0500
Subject: slight fix to zooming w menu

---
 src/client/views/collections/CollectionSchemaView.tsx | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 2e4d10f1d..128423014 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -349,13 +349,22 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         return this.props.ScreenToLocalTransform().translate(- this.borderWidth - NumCast(COLLECTION_BORDER_WIDTH) - this.tableWidth, - this.borderWidth);
     }
 
+    @action
+    onWheel(e: React.WheelEvent) {
+        const scale = this.props.ScreenToLocalTransform().Scale;
+        this.props.active(true) && e.stopPropagation();
+        this.menuCoordinates[0] += e.screenX * scale;
+        this.menuCoordinates[1] += e.screenY * scale;
+    }
+
     @computed get renderMenu() {
+        const scale = this.props.ScreenToLocalTransform().Scale;
         return (
             <div className="collectionSchema-header-menu" ref={this.setNode}
                 onWheel={e => this.props.active(true) && e.stopPropagation()}
                 style={{
                     position: "absolute", background: "white",
-                    transform: `translate(${this.menuCoordinates[0]}px, ${this.menuCoordinates[1]}px)`
+                    transform: `translate(${this.menuCoordinates[0]}px, ${this.menuCoordinates[1] - 100 / scale}px)`
                 }}>
                 <Measure offset onResize={action((r: any) => {
                     const dim = this.props.ScreenToLocalTransform().inverse().transformDirection(r.offset.width, r.offset.height);
-- 
cgit v1.2.3-70-g09d2


From 8292aae00bb7fd7716110df21faafa53fd35738d Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Thu, 25 Jun 2020 17:28:21 -0500
Subject: menu text selection and more movement tweaks

---
 src/client/views/collections/CollectionSchemaView.tsx | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 128423014..9cd13058f 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -349,12 +349,18 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         return this.props.ScreenToLocalTransform().translate(- this.borderWidth - NumCast(COLLECTION_BORDER_WIDTH) - this.tableWidth, - this.borderWidth);
     }
 
+    @action
+    onHeaderClick = (e: React.PointerEvent) => {
+        this.props.active(true);
+        e.stopPropagation();
+    }
+
     @action
     onWheel(e: React.WheelEvent) {
         const scale = this.props.ScreenToLocalTransform().Scale;
         this.props.active(true) && e.stopPropagation();
-        this.menuCoordinates[0] += e.screenX * scale;
-        this.menuCoordinates[1] += e.screenY * scale;
+        this.menuCoordinates[0] -= e.screenX / scale;
+        this.menuCoordinates[1] -= e.screenY / scale;
     }
 
     @computed get renderMenu() {
@@ -362,9 +368,10 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         return (
             <div className="collectionSchema-header-menu" ref={this.setNode}
                 onWheel={e => this.props.active(true) && e.stopPropagation()}
+                onPointerDown={e => this.onHeaderClick(e)}
                 style={{
                     position: "absolute", background: "white",
-                    transform: `translate(${this.menuCoordinates[0]}px, ${this.menuCoordinates[1] - 100 / scale}px)`
+                    transform: `translate(${this.menuCoordinates[0] * scale}px, ${this.menuCoordinates[1] / scale}px)`
                 }}>
                 <Measure offset onResize={action((r: any) => {
                     const dim = this.props.ScreenToLocalTransform().inverse().transformDirection(r.offset.width, r.offset.height);
-- 
cgit v1.2.3-70-g09d2


From 4b68d25cc3718a6b9fffdd60d04707cbcc8fc2b2 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Thu, 25 Jun 2020 22:33:50 -0500
Subject: adjusting menu trigger

---
 .../views/collections/CollectionSchemaHeaders.tsx  |  2 +-
 .../views/collections/CollectionSchemaView.scss    |  3 +++
 .../views/collections/CollectionSchemaView.tsx     | 22 +++++++++++++---------
 src/client/views/collections/SchemaTable.tsx       |  7 ++++++-
 4 files changed, 23 insertions(+), 11 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx
index aaa2e6096..b84b75172 100644
--- a/src/client/views/collections/CollectionSchemaHeaders.tsx
+++ b/src/client/views/collections/CollectionSchemaHeaders.tsx
@@ -376,7 +376,7 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
                 <input className="keys-search" ref={this._inputRef} type="text" value={this._searchTerm} placeholder="Column key" onKeyDown={this.onKeyDown}
                     onChange={e => this.onChange(e.target.value)}
                     onClick={(e) => {
-                        this._inputRef.current!.select();
+                        //this._inputRef.current!.select();
                         e.stopPropagation();
                     }} onFocus={this.onFocus} onBlur={this.onBlur}></input>
                 <div className="keys-options-wrapper" onPointerEnter={this.onPointerEnter} onPointerLeave={this.onPointerOut}>
diff --git a/src/client/views/collections/CollectionSchemaView.scss b/src/client/views/collections/CollectionSchemaView.scss
index a0bbae88f..a21249c58 100644
--- a/src/client/views/collections/CollectionSchemaView.scss
+++ b/src/client/views/collections/CollectionSchemaView.scss
@@ -182,6 +182,9 @@
     color: gray;
     z-index: 10000;
     overflow-y: visible;
+    display: flex;
+    justify-content: space-between;
+    flex-wrap: wrap;
 
     .collectionSchema-header-menu {
         height: 100%;
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 9cd13058f..900949b94 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -299,20 +299,24 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     @action
     closeHeader = () => { this._headerOpen = false; }
 
+    renderKeysDropDown = (col: any) => {
+        return <KeysDropdown
+            keyValue={col.heading}
+            possibleKeys={this.possibleKeys}
+            existingKeys={this.columns.map(c => c.heading)}
+            canAddNew={true}
+            addNew={false}
+            onSelect={this.changeColumns}
+            setIsEditing={this.setHeaderIsEditing}
+        />;
+    }
+
     renderContent = (col: any) => {
         return (
             <div className="collectionSchema-header-menuOptions">
                 <div className="collectionSchema-headerMenu-group">
                     <label>Key:</label>
-                    <KeysDropdown
-                        keyValue={col.heading}
-                        possibleKeys={this.possibleKeys}
-                        existingKeys={this.columns.map(c => c.heading)}
-                        canAddNew={true}
-                        addNew={false}
-                        onSelect={this.changeColumns}
-                        setIsEditing={this.setHeaderIsEditing}
-                    />
+                    {this.renderKeysDropDown(col)}
                 </div>
                 {false ? <></> :
                     <>
diff --git a/src/client/views/collections/SchemaTable.tsx b/src/client/views/collections/SchemaTable.tsx
index 97d4bb303..b9df2fe6b 100644
--- a/src/client/views/collections/SchemaTable.tsx
+++ b/src/client/views/collections/SchemaTable.tsx
@@ -163,15 +163,20 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
 
 
             const menuContent = <div><FontAwesomeIcon icon={icon} size="sm" />  {col.heading}</div>;
+
             const header =
                 <div className="collectionSchemaView-header"
-                    onClick={e => this.props.openHeader(col, menuContent, e.clientX, e.clientY)}
+                    //onClick={e => this.props.openHeader(col, menuContent, e.clientX, e.clientY)}
                     style={{
                         background: col.color, padding: "4px",
                         letterSpacing: "2px",
                         textTransform: "uppercase"
                     }}>
                     {menuContent}
+                    <div onClick={e => this.props.openHeader(col, menuContent, e.clientX, e.clientY)}
+                        style={{ float: "right" }}>
+                        <FontAwesomeIcon icon={"caret-down"} size="2x" />
+                    </div>
                 </div>;
 
             return {
-- 
cgit v1.2.3-70-g09d2


From bd6dd6a04edf441a819f6f5bdff3aa03b4298d9a Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Fri, 26 Jun 2020 15:22:31 -0500
Subject: editable text in header

---
 .../views/collections/CollectionSchemaHeaders.tsx  | 12 +++--
 .../views/collections/CollectionSchemaView.scss    |  5 +-
 .../views/collections/CollectionSchemaView.tsx     | 10 ++--
 src/client/views/collections/SchemaTable.tsx       | 53 +++++++++++++++++-----
 4 files changed, 59 insertions(+), 21 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx
index b84b75172..8494f3dca 100644
--- a/src/client/views/collections/CollectionSchemaHeaders.tsx
+++ b/src/client/views/collections/CollectionSchemaHeaders.tsx
@@ -285,6 +285,7 @@ export interface KeysDropdownProps {
     addNew: boolean;
     onSelect: (oldKey: string, newKey: string, addnew: boolean) => void;
     setIsEditing: (isEditing: boolean) => void;
+    width?: string;
 }
 @observer
 export class KeysDropdown extends React.Component<KeysDropdownProps> {
@@ -357,12 +358,13 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
             this.props.existingKeys.findIndex(key => key.toUpperCase() === this._searchTerm.toUpperCase()) > -1;
 
         const options = keyOptions.map(key => {
-            return <div key={key} className="key-option" onPointerDown={e => e.stopPropagation()} onClick={() => { this.onSelect(key); this.setSearchTerm(""); }}>{key}</div>;
+            return <div key={key} className="key-option" style={{ border: "1px solid lightgray" }}
+                onPointerDown={e => e.stopPropagation()} onClick={() => { this.onSelect(key); this.setSearchTerm(""); }}>{key}</div>;
         });
 
         // if search term does not already exist as a group type, give option to create new group type
         if (!exactFound && this._searchTerm !== "" && this.props.canAddNew) {
-            options.push(<div key={""} className="key-option"
+            options.push(<div key={""} className="key-option" style={{ border: "1px solid lightgray" }}
                 onClick={() => { this.onSelect(this._searchTerm); this.setSearchTerm(""); }}>
                 Create "{this._searchTerm}" key</div>);
         }
@@ -373,13 +375,15 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
     render() {
         return (
             <div className="keys-dropdown">
-                <input className="keys-search" ref={this._inputRef} type="text" value={this._searchTerm} placeholder="Column key" onKeyDown={this.onKeyDown}
+                <input className="keys-search" style={{ width: this.props.width }}
+                    ref={this._inputRef} type="text" value={this._searchTerm} placeholder="Column key" onKeyDown={this.onKeyDown}
                     onChange={e => this.onChange(e.target.value)}
                     onClick={(e) => {
                         //this._inputRef.current!.select();
                         e.stopPropagation();
                     }} onFocus={this.onFocus} onBlur={this.onBlur}></input>
-                <div className="keys-options-wrapper" onPointerEnter={this.onPointerEnter} onPointerLeave={this.onPointerOut}>
+                <div className="keys-options-wrapper" style={{ backgroundColor: "white" }}
+                    onPointerEnter={this.onPointerEnter} onPointerLeave={this.onPointerOut}>
                     {this.renderOptions()}
                 </div>
             </div >
diff --git a/src/client/views/collections/CollectionSchemaView.scss b/src/client/views/collections/CollectionSchemaView.scss
index a21249c58..5608cb7ab 100644
--- a/src/client/views/collections/CollectionSchemaView.scss
+++ b/src/client/views/collections/CollectionSchemaView.scss
@@ -266,6 +266,7 @@ button.add-column {
     .keys-dropdown {
         position: relative;
         width: 100%;
+        background-color: white;
 
         input {
             border: 2px solid $light-color-secondary;
@@ -285,9 +286,11 @@ button.add-column {
             position: absolute;
             top: 28px;
             box-shadow: 0 10px 16px rgba(0, 0, 0, 0.1);
+            background-color: white;
 
             .key-option {
-                background-color: $light-color;
+                //background-color: $light-color;
+                background-color: white;
                 border: 1px solid lightgray;
                 padding: 2px 3px;
 
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 900949b94..a9c599e0e 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -60,7 +60,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     @computed get borderWidth() { return Number(COLLECTION_BORDER_WIDTH); }
 
     @observable _menuWidth = 0;
-    @observable _menuContent: any = "";
     @observable _headerOpen = false;
     @observable _isOpen = false;
     @observable _node: HTMLDivElement | null = null;
@@ -288,8 +287,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     }
 
     @action
-    openHeader = (col: any, menu: any, screenx: number, screeny: number) => {
-        this._menuContent = menu;
+    openHeader = (col: any, screenx: number, screeny: number) => {
         this._col = col;
         this._headerOpen = !this._headerOpen;
         this._pointerX = screenx;
@@ -363,8 +361,8 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     onWheel(e: React.WheelEvent) {
         const scale = this.props.ScreenToLocalTransform().Scale;
         this.props.active(true) && e.stopPropagation();
-        this.menuCoordinates[0] -= e.screenX / scale;
-        this.menuCoordinates[1] -= e.screenY / scale;
+        //this.menuCoordinates[0] -= e.screenX / scale;
+        //this.menuCoordinates[1] -= e.screenY / scale;
     }
 
     @computed get renderMenu() {
@@ -505,6 +503,8 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
             onResizedChange={this.onResizedChange}
             setColumns={this.setColumns}
             reorderColumns={this.reorderColumns}
+            changeColumns={this.changeColumns}
+            setHeaderIsEditing={this.setHeaderIsEditing}
         />;
     }
 
diff --git a/src/client/views/collections/SchemaTable.tsx b/src/client/views/collections/SchemaTable.tsx
index b9df2fe6b..5df0a676e 100644
--- a/src/client/views/collections/SchemaTable.tsx
+++ b/src/client/views/collections/SchemaTable.tsx
@@ -20,12 +20,13 @@ import { COLLECTION_BORDER_WIDTH } from '../../views/globalCssVariables.scss';
 import { ContextMenu } from "../ContextMenu";
 import '../DocumentDecorations.scss';
 import { CellProps, CollectionSchemaCell, CollectionSchemaCheckboxCell, CollectionSchemaDocCell, CollectionSchemaNumberCell, CollectionSchemaStringCell, CollectionSchemaImageCell, CollectionSchemaListCell } from "./CollectionSchemaCells";
-import { CollectionSchemaAddColumnHeader } from "./CollectionSchemaHeaders";
+import { CollectionSchemaAddColumnHeader, KeysDropdown } from "./CollectionSchemaHeaders";
 import { MovableColumn, MovableRow } from "./CollectionSchemaMovableTableHOC";
 import "./CollectionSchemaView.scss";
 import { CollectionView } from "./CollectionView";
 import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView";
 import { emptyFunction, returnZero, returnOne, returnFalse, returnEmptyFilter, emptyPath } from "../../../Utils";
+import { TouchScrollableMenuItem } from "../TouchScrollableMenu";
 
 
 enum ColumnType {
@@ -72,11 +73,13 @@ export interface SchemaTableProps {
     columns: SchemaHeaderField[];
     documentKeys: any[];
     headerIsEditing: boolean;
-    openHeader: (column: any, menu: any, screenx: number, screeny: number) => void;
+    openHeader: (column: any, screenx: number, screeny: number) => void;
     onPointerDown: (e: React.PointerEvent) => void;
     onResizedChange: (newResized: Resize[], event: any) => void;
     setColumns: (columns: SchemaHeaderField[]) => void;
     reorderColumns: (toMove: SchemaHeaderField, relativeTo: SchemaHeaderField, before: boolean, columnsValues: SchemaHeaderField[]) => void;
+    changeColumns: (oldKey: string, newKey: string, addNew: boolean) => void;
+    setHeaderIsEditing: (isEditing: boolean) => void;
 }
 
 @observer
@@ -91,6 +94,8 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
     @observable _showDataDoc: any = "";
     @observable _showDocPos: number[] = [];
 
+    @observable _showTitleDropdown: boolean = false;
+
     @computed get previewWidth() { return () => NumCast(this.props.Document.schemaPreviewWidth); }
     @computed get previewHeight() { return () => this.props.PanelHeight() - 2 * this.borderWidth; }
     @computed get tableWidth() { return this.props.PanelWidth() - 2 * this.borderWidth - this.DIVIDER_WIDTH - this.previewWidth(); }
@@ -126,6 +131,9 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
         }, [] as SortingRule[]);
     }
 
+    @action
+    changeDropdown = () => { console.log("header clicked"); this._showTitleDropdown = !this._showTitleDropdown; }
+
     @computed get borderWidth() { return Number(COLLECTION_BORDER_WIDTH); }
     @computed get tableColumns(): Column<Doc>[] {
 
@@ -156,26 +164,48 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
 
         const cols = this.props.columns.map(col => {
 
+            const keysDropdown = <KeysDropdown
+                keyValue={col.heading}
+                possibleKeys={possibleKeys}
+                existingKeys={this.props.columns.map(c => c.heading)}
+                canAddNew={true}
+                addNew={false}
+                // i think issue is with these two props
+                onSelect={this.props.changeColumns}
+                setIsEditing={this.props.setHeaderIsEditing}
+                width={"100%"}
+            />;
+
             const icon: IconProp = this.getColumnType(col) === ColumnType.Number ? "hashtag" : this.getColumnType(col) === ColumnType.String ? "font" :
                 this.getColumnType(col) === ColumnType.Boolean ? "check-square" : this.getColumnType(col) === ColumnType.Doc ? "file" :
                     this.getColumnType(col) === ColumnType.Image ? "image" : this.getColumnType(col) === ColumnType.List ? "list-ul" : "align-justify";
 
+            const headerText = this._showTitleDropdown ? keysDropdown : col.heading;
 
-
-            const menuContent = <div><FontAwesomeIcon icon={icon} size="sm" />  {col.heading}</div>;
+            const menuContent = <div style={{
+                display: "flex", justifyContent: "space-between", width: "90%"
+            }}>
+                <FontAwesomeIcon icon={icon} size="lg" style={{ display: "inline", paddingLeft: "7px" }} />
+                <div className="keys-dropdown"
+                    style={{ display: "inline", zIndex: 10000 }}>
+                    {keysDropdown}
+                </div>
+            </div>;
 
             const header =
-                <div className="collectionSchemaView-header"
+                <div //className="collectionSchemaView-header"
                     //onClick={e => this.props.openHeader(col, menuContent, e.clientX, e.clientY)}
+                    className="collectionSchemaView-menuOptions"
                     style={{
-                        background: col.color, padding: "4px",
-                        letterSpacing: "2px",
-                        textTransform: "uppercase"
+                        background: col.color, padding: "2px",
+                        // letterSpacing: "2px",
+                        // textTransform: "uppercase",
+                        display: "flex"
                     }}>
                     {menuContent}
-                    <div onClick={e => this.props.openHeader(col, menuContent, e.clientX, e.clientY)}
-                        style={{ float: "right" }}>
-                        <FontAwesomeIcon icon={"caret-down"} size="2x" />
+                    <div onClick={e => this.props.openHeader(col, e.clientX, e.clientY)}
+                        style={{ float: "right", paddingRight: "6px" }}>
+                        <FontAwesomeIcon icon={"caret-down"} id={"down arrow"} size="2x" />
                     </div>
                 </div>;
 
@@ -342,6 +372,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
         this.props.columns.push(new SchemaHeaderField(`New field ${index ? "(" + index + ")" : ""}`, "#f1efeb"));
     }
 
+    @action
     getColumnType = (column: SchemaHeaderField): ColumnType => {
         // added functionality to convert old column type stuff to new column type stuff -syip
         if (column.type && column.type !== 0) {
-- 
cgit v1.2.3-70-g09d2


From fa4612e7dfeaecc09e205c5d6fa37743d23f9298 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Sat, 27 Jun 2020 02:37:22 -0500
Subject: moved sorting into header

---
 .../views/collections/CollectionSchemaHeaders.tsx  | 15 +++++--
 .../views/collections/CollectionSchemaView.scss    |  1 +
 .../views/collections/CollectionSchemaView.tsx     |  1 +
 src/client/views/collections/SchemaTable.tsx       | 51 +++++++++++++++++++---
 4 files changed, 58 insertions(+), 10 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx
index 8494f3dca..096b45bee 100644
--- a/src/client/views/collections/CollectionSchemaHeaders.tsx
+++ b/src/client/views/collections/CollectionSchemaHeaders.tsx
@@ -358,13 +358,19 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
             this.props.existingKeys.findIndex(key => key.toUpperCase() === this._searchTerm.toUpperCase()) > -1;
 
         const options = keyOptions.map(key => {
-            return <div key={key} className="key-option" style={{ border: "1px solid lightgray" }}
+            return <div key={key} className="key-option" style={{
+                border: "1px solid lightgray",
+                maxWidth: this.props.width, overflowX: "hidden"
+            }}
                 onPointerDown={e => e.stopPropagation()} onClick={() => { this.onSelect(key); this.setSearchTerm(""); }}>{key}</div>;
         });
 
         // if search term does not already exist as a group type, give option to create new group type
         if (!exactFound && this._searchTerm !== "" && this.props.canAddNew) {
-            options.push(<div key={""} className="key-option" style={{ border: "1px solid lightgray" }}
+            options.push(<div key={""} className="key-option" style={{
+                border: "1px solid lightgray",
+                maxWidth: this.props.width, overflowX: "hidden"
+            }}
                 onClick={() => { this.onSelect(this._searchTerm); this.setSearchTerm(""); }}>
                 Create "{this._searchTerm}" key</div>);
         }
@@ -382,7 +388,10 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
                         //this._inputRef.current!.select();
                         e.stopPropagation();
                     }} onFocus={this.onFocus} onBlur={this.onBlur}></input>
-                <div className="keys-options-wrapper" style={{ backgroundColor: "white" }}
+                <div className="keys-options-wrapper" style={{
+                    backgroundColor: "white",
+                    width: this.props.width, overflowX: "hidden"
+                }}
                     onPointerEnter={this.onPointerEnter} onPointerLeave={this.onPointerOut}>
                     {this.renderOptions()}
                 </div>
diff --git a/src/client/views/collections/CollectionSchemaView.scss b/src/client/views/collections/CollectionSchemaView.scss
index 5608cb7ab..9c5f2e8ac 100644
--- a/src/client/views/collections/CollectionSchemaView.scss
+++ b/src/client/views/collections/CollectionSchemaView.scss
@@ -293,6 +293,7 @@ button.add-column {
                 background-color: white;
                 border: 1px solid lightgray;
                 padding: 2px 3px;
+                overflow-x: hidden;
 
                 &:not(:first-child) {
                     border-top: 0;
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index a9c599e0e..61581aec1 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -505,6 +505,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
             reorderColumns={this.reorderColumns}
             changeColumns={this.changeColumns}
             setHeaderIsEditing={this.setHeaderIsEditing}
+            changeColumnSort={this.setColumnSort}
         />;
     }
 
diff --git a/src/client/views/collections/SchemaTable.tsx b/src/client/views/collections/SchemaTable.tsx
index 5df0a676e..5d1dcf199 100644
--- a/src/client/views/collections/SchemaTable.tsx
+++ b/src/client/views/collections/SchemaTable.tsx
@@ -80,6 +80,7 @@ export interface SchemaTableProps {
     reorderColumns: (toMove: SchemaHeaderField, relativeTo: SchemaHeaderField, before: boolean, columnsValues: SchemaHeaderField[]) => void;
     changeColumns: (oldKey: string, newKey: string, addNew: boolean) => void;
     setHeaderIsEditing: (isEditing: boolean) => void;
+    changeColumnSort: (columnField: SchemaHeaderField, descending: boolean | undefined) => void;
 }
 
 @observer
@@ -132,7 +133,22 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
     }
 
     @action
-    changeDropdown = () => { console.log("header clicked"); this._showTitleDropdown = !this._showTitleDropdown; }
+    changeSorting = (col: any) => {
+        console.log(col.heading);
+        if (col.desc === undefined) {
+            // no sorting
+            this.props.changeColumnSort(col, true);
+        } else if (col.desc === true) {
+            // descending sort
+            this.props.changeColumnSort(col, false);
+        } else if (col.desc === false) {
+            // ascending sort
+            this.props.changeColumnSort(col, undefined);
+        }
+    }
+
+    @action
+    changeTitleMode = () => { console.log("header clicked"); this._showTitleDropdown = !this._showTitleDropdown; }
 
     @computed get borderWidth() { return Number(COLLECTION_BORDER_WIDTH); }
     @computed get tableColumns(): Column<Doc>[] {
@@ -180,7 +196,17 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
                 this.getColumnType(col) === ColumnType.Boolean ? "check-square" : this.getColumnType(col) === ColumnType.Doc ? "file" :
                     this.getColumnType(col) === ColumnType.Image ? "image" : this.getColumnType(col) === ColumnType.List ? "list-ul" : "align-justify";
 
-            const headerText = this._showTitleDropdown ? keysDropdown : col.heading;
+            const headerText = this._showTitleDropdown ? keysDropdown : <div
+                onClick={this.changeTitleMode}
+                style={{
+                    background: col.color, padding: "2px",
+                    letterSpacing: "2px",
+                    textTransform: "uppercase",
+                    display: "flex"
+                }}>
+                {col.heading}</div>;
+
+            const sortIcon = col.desc === undefined ? "circle" : col.desc === true ? "caret-down" : "caret-up";
 
             const menuContent = <div style={{
                 display: "flex", justifyContent: "space-between", width: "90%"
@@ -195,17 +221,28 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
             const header =
                 <div //className="collectionSchemaView-header"
                     //onClick={e => this.props.openHeader(col, menuContent, e.clientX, e.clientY)}
-                    className="collectionSchemaView-menuOptions"
+                    className="collectionSchemaView-menuOptions-wrapper"
                     style={{
                         background: col.color, padding: "2px",
-                        // letterSpacing: "2px",
-                        // textTransform: "uppercase",
                         display: "flex"
                     }}>
-                    {menuContent}
+
+                    <div style={{
+                        display: "flex", justifyContent: "space-between", width: "90%"
+                    }}>
+                        <FontAwesomeIcon icon={icon} size="lg" style={{ display: "inline", paddingLeft: "7px" }} /></div>
+                    <div className="keys-dropdown"
+                        style={{ display: "inline", zIndex: 10000 }}>
+                        {keysDropdown}
+                    </div>
+
+                    <div onClick={e => this.changeSorting(col)}
+                        style={{ paddingRight: "6px" }}>
+                        <FontAwesomeIcon icon={sortIcon} size="sm" />
+                    </div>
                     <div onClick={e => this.props.openHeader(col, e.clientX, e.clientY)}
                         style={{ float: "right", paddingRight: "6px" }}>
-                        <FontAwesomeIcon icon={"caret-down"} id={"down arrow"} size="2x" />
+                        <FontAwesomeIcon icon={"compass"} size="sm" />
                     </div>
                 </div>;
 
-- 
cgit v1.2.3-70-g09d2


From e5385f9421b23d4119ac8704c9d127f1f296ac54 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Sun, 28 Jun 2020 01:53:35 -0500
Subject: partial dropdown for types

---
 .../views/collections/CollectionSchemaHeaders.tsx  |   8 +-
 .../views/collections/CollectionSchemaView.scss    |   4 +-
 .../views/collections/CollectionSchemaView.tsx     | 157 ++++++++++++++++-----
 src/client/views/collections/SchemaTable.tsx       |  22 +--
 4 files changed, 135 insertions(+), 56 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx
index 096b45bee..80c265ba6 100644
--- a/src/client/views/collections/CollectionSchemaHeaders.tsx
+++ b/src/client/views/collections/CollectionSchemaHeaders.tsx
@@ -360,7 +360,7 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
         const options = keyOptions.map(key => {
             return <div key={key} className="key-option" style={{
                 border: "1px solid lightgray",
-                maxWidth: this.props.width, overflowX: "hidden"
+                width: this.props.width, overflowX: "hidden"
             }}
                 onPointerDown={e => e.stopPropagation()} onClick={() => { this.onSelect(key); this.setSearchTerm(""); }}>{key}</div>;
         });
@@ -369,7 +369,7 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
         if (!exactFound && this._searchTerm !== "" && this.props.canAddNew) {
             options.push(<div key={""} className="key-option" style={{
                 border: "1px solid lightgray",
-                maxWidth: this.props.width, overflowX: "hidden"
+                width: this.props.width, overflowX: "hidden"
             }}
                 onClick={() => { this.onSelect(this._searchTerm); this.setSearchTerm(""); }}>
                 Create "{this._searchTerm}" key</div>);
@@ -380,8 +380,8 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
 
     render() {
         return (
-            <div className="keys-dropdown">
-                <input className="keys-search" style={{ width: this.props.width }}
+            <div className="keys-dropdown" style={{ width: this.props.width }}>
+                <input className="keys-search" style={{ width: this.props.width, maxWidth: "1000" }}
                     ref={this._inputRef} type="text" value={this._searchTerm} placeholder="Column key" onKeyDown={this.onKeyDown}
                     onChange={e => this.onChange(e.target.value)}
                     onClick={(e) => {
diff --git a/src/client/views/collections/CollectionSchemaView.scss b/src/client/views/collections/CollectionSchemaView.scss
index 9c5f2e8ac..2926a8f6f 100644
--- a/src/client/views/collections/CollectionSchemaView.scss
+++ b/src/client/views/collections/CollectionSchemaView.scss
@@ -265,7 +265,7 @@ button.add-column {
 
     .keys-dropdown {
         position: relative;
-        width: 100%;
+        //width: 100%;
         background-color: white;
 
         input {
@@ -273,6 +273,8 @@ button.add-column {
             padding: 3px;
             height: 28px;
             font-weight: bold;
+            letter-spacing: "2px";
+            text-transform: "uppercase";
 
             &:focus {
                 font-weight: normal;
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 61581aec1..bfd5fa96f 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -24,6 +24,7 @@ import { setupMoveUpEvents, emptyFunction, returnZero, returnOne, returnFalse }
 import { SnappingManager } from "../../util/SnappingManager";
 import Measure from "react-measure";
 import { SchemaTable } from "./SchemaTable";
+import { civicinfo } from "googleapis/build/src/apis/civicinfo";
 
 library.add(faCog, faPlus, faSortUp, faSortDown);
 library.add(faTable);
@@ -68,6 +69,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     @observable _menuHeight = 0;
     @observable _pointerX = 0;
     @observable _pointerY = 0;
+    @observable _openTypes: boolean = false;
     @computed get menuCoordinates() {
         const x = Math.max(0, Math.min(document.body.clientWidth - this._menuWidth, this._pointerX));
         const y = Math.max(0, Math.min(document.body.clientHeight - this._menuHeight, this._pointerY));
@@ -123,7 +125,9 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         this.setHeaderIsEditing(this._isOpen);
     }
 
+    @action
     changeColumnType = (type: ColumnType, col: any): void => {
+        this._openTypes = false;
         this.setColumnType(col, type);
     }
 
@@ -175,43 +179,74 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         node && (this._node = node);
     }
 
+    @action
+    typesDropdownChange = (bool: boolean) => {
+        this._openTypes = bool;
+    }
+
+    @action
     renderTypes = (col: any) => {
         if (columnTypes.get(col.heading)) return (null);
 
         const type = col.type;
+
+        const anyType = <div className={"columnMenu-option" + (type === ColumnType.Any ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Any, col)}>
+            <FontAwesomeIcon icon={"align-justify"} size="sm" />
+                Any
+            </div>;
+
+        const numType = <div className={"columnMenu-option" + (type === ColumnType.Number ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Number, col)}>
+            <FontAwesomeIcon icon={"hashtag"} size="sm" />
+                Number
+            </div>;
+
+        const textType = <div className={"columnMenu-option" + (type === ColumnType.String ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.String, col)}>
+            <FontAwesomeIcon icon={"font"} size="sm" />
+            Text
+            </div>;
+
+        const boolType = <div className={"columnMenu-option" + (type === ColumnType.Boolean ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Boolean, col)}>
+            <FontAwesomeIcon icon={"check-square"} size="sm" />
+            Checkbox
+            </div>;
+
+        const listType = <div className={"columnMenu-option" + (type === ColumnType.List ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.List, col)}>
+            <FontAwesomeIcon icon={"list-ul"} size="sm" />
+            List
+            </div>;
+
+        const docType = <div className={"columnMenu-option" + (type === ColumnType.Doc ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Doc, col)}>
+            <FontAwesomeIcon icon={"file"} size="sm" />
+            Document
+            </div>;
+
+        const imageType = <div className={"columnMenu-option" + (type === ColumnType.Image ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Image, col)}>
+            <FontAwesomeIcon icon={"image"} size="sm" />
+            Image
+            </div>;
+
+
+        const allColumnTypes = <div className="columnMenu-types">
+            {anyType}
+            {numType}
+            {textType}
+            {boolType}
+            {listType}
+            {docType}
+            {imageType}
+        </div>;
+
+        const justColType = type === ColumnType.Any ? anyType : type === ColumnType.Number ? numType :
+            type === ColumnType.String ? textType : type === ColumnType.Boolean ? boolType :
+                type === ColumnType.List ? listType : type === ColumnType.Doc ? docType : imageType;
+
         return (
             <div className="collectionSchema-headerMenu-group">
-                <label>Column type:</label>
-                <div className="columnMenu-types">
-                    <div className={"columnMenu-option" + (type === ColumnType.Any ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Any, col)}>
-                        <FontAwesomeIcon icon={"align-justify"} size="sm" />
-                        Any
-                    </div>
-                    <div className={"columnMenu-option" + (type === ColumnType.Number ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Number, col)}>
-                        <FontAwesomeIcon icon={"hashtag"} size="sm" />
-                        Number
-                    </div>
-                    <div className={"columnMenu-option" + (type === ColumnType.String ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.String, col)}>
-                        <FontAwesomeIcon icon={"font"} size="sm" />
-                        Text
-                    </div>
-                    <div className={"columnMenu-option" + (type === ColumnType.Boolean ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Boolean, col)}>
-                        <FontAwesomeIcon icon={"check-square"} size="sm" />
-                        Checkbox
-                    </div>
-                    <div className={"columnMenu-option" + (type === ColumnType.List ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.List, col)}>
-                        <FontAwesomeIcon icon={"list-ul"} size="sm" />
-                        List
-                    </div>
-                    <div className={"columnMenu-option" + (type === ColumnType.Doc ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Doc, col)}>
-                        <FontAwesomeIcon icon={"file"} size="sm" />
-                        Document
-                    </div>
-                    <div className={"columnMenu-option" + (type === ColumnType.Image ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Image, col)}>
-                        <FontAwesomeIcon icon={"image"} size="sm" />
-                        Image
-                    </div>
+                <div onClick={() => this.typesDropdownChange(!this._openTypes)}>
+                    <label>Column type:</label>
+                    <FontAwesomeIcon icon={"caret-down"} size="sm" style={{ float: "right" }} />
                 </div>
+                {this._openTypes ? allColumnTypes : justColType}
             </div >
         );
     }
@@ -288,6 +323,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
 
     @action
     openHeader = (col: any, screenx: number, screeny: number) => {
+        console.log("header opening");
         this._col = col;
         this._headerOpen = !this._headerOpen;
         this._pointerX = screenx;
@@ -309,6 +345,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         />;
     }
 
+    @action
     renderContent = (col: any) => {
         return (
             <div className="collectionSchema-header-menuOptions">
@@ -365,7 +402,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         //this.menuCoordinates[1] -= e.screenY / scale;
     }
 
-    @computed get renderMenu() {
+    @action renderMenu() {
         const scale = this.props.ScreenToLocalTransform().Scale;
         return (
             <div className="collectionSchema-header-menu" ref={this.setNode}
@@ -379,7 +416,26 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
                     const dim = this.props.ScreenToLocalTransform().inverse().transformDirection(r.offset.width, r.offset.height);
                     this._menuWidth = dim[0]; this._menuHeight = dim[1];
                 })}>
-                    {({ measureRef }) => <div ref={measureRef}>{this.renderContent(this._col)}</div>}
+                    {({ measureRef }) => <div ref={measureRef}>
+                        <div className="collectionSchema-header-menuOptions">
+                            <div className="collectionSchema-headerMenu-group">
+                                <label>Key:</label>
+                                {this.renderKeysDropDown(this._col)}
+                            </div>
+                            {false ? <></> :
+                                <>
+                                    {this.renderTypes(this._col)}
+                                    {this.renderSorting(this._col)}
+                                    {this.renderColors(this._col)}
+                                    <div className="collectionSchema-headerMenu-group">
+                                        <button onClick={() => { this.deleteColumn(this._col.heading); }}
+                                        >Delete Column</button>
+                                    </div>
+                                </>
+                            }
+                        </div>
+
+                    </div>}
                 </Measure>
             </div>
         );
@@ -559,6 +615,41 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     }
 
     render() {
+        const scale = this.props.ScreenToLocalTransform().Scale;
+        const menu = <div className="collectionSchema-header-menu" ref={this.setNode}
+            onWheel={e => this.props.active(true) && e.stopPropagation()}
+            onPointerDown={e => this.onHeaderClick(e)}
+            style={{
+                position: "absolute", background: "white",
+                transform: `translate(${this.menuCoordinates[0] * scale}px, ${this.menuCoordinates[1] / scale}px)`
+            }}>
+            <Measure offset onResize={action((r: any) => {
+                const dim = this.props.ScreenToLocalTransform().inverse().transformDirection(r.offset.width, r.offset.height);
+                this._menuWidth = dim[0]; this._menuHeight = dim[1];
+            })}>
+                {({ measureRef }) => <div ref={measureRef}>
+                    <div className="collectionSchema-header-menuOptions">
+                        <div className="collectionSchema-headerMenu-group">
+                            <label>Key:</label>
+                            {this.renderKeysDropDown(this._col)}
+                        </div>
+                        {false ? <></> :
+                            <>
+                                {this.renderTypes(this._col)}
+                                {this.renderSorting(this._col)}
+                                {this.renderColors(this._col)}
+                                <div className="collectionSchema-headerMenu-group">
+                                    <button onClick={() => { this.deleteColumn(this._col.heading); }}
+                                    >Delete Column</button>
+                                </div>
+                            </>
+                        }
+                    </div>
+
+                </div>}
+            </Measure>
+        </div>;
+
         return <div className="collectionSchemaView-container"
             style={{
                 pointerEvents: !this.props.active() && !SnappingManager.GetIsDragging() ? "none" : undefined,
@@ -574,7 +665,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
             </div>
             {this.dividerDragger}
             {!this.previewWidth() ? (null) : this.previewPanel}
-            {this._headerOpen ? this.renderMenu : null}
+            {this._headerOpen ? menu : null}
         </div>;
     }
 }
\ No newline at end of file
diff --git a/src/client/views/collections/SchemaTable.tsx b/src/client/views/collections/SchemaTable.tsx
index 5d1dcf199..176091661 100644
--- a/src/client/views/collections/SchemaTable.tsx
+++ b/src/client/views/collections/SchemaTable.tsx
@@ -186,9 +186,10 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
                 existingKeys={this.props.columns.map(c => c.heading)}
                 canAddNew={true}
                 addNew={false}
-                // i think issue is with these two props
                 onSelect={this.props.changeColumns}
                 setIsEditing={this.props.setHeaderIsEditing}
+
+                // try commenting this out
                 width={"100%"}
             />;
 
@@ -208,16 +209,6 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
 
             const sortIcon = col.desc === undefined ? "circle" : col.desc === true ? "caret-down" : "caret-up";
 
-            const menuContent = <div style={{
-                display: "flex", justifyContent: "space-between", width: "90%"
-            }}>
-                <FontAwesomeIcon icon={icon} size="lg" style={{ display: "inline", paddingLeft: "7px" }} />
-                <div className="keys-dropdown"
-                    style={{ display: "inline", zIndex: 10000 }}>
-                    {keysDropdown}
-                </div>
-            </div>;
-
             const header =
                 <div //className="collectionSchemaView-header"
                     //onClick={e => this.props.openHeader(col, menuContent, e.clientX, e.clientY)}
@@ -226,18 +217,13 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
                         background: col.color, padding: "2px",
                         display: "flex"
                     }}>
-
-                    <div style={{
-                        display: "flex", justifyContent: "space-between", width: "90%"
-                    }}>
-                        <FontAwesomeIcon icon={icon} size="lg" style={{ display: "inline", paddingLeft: "7px" }} /></div>
+                    <FontAwesomeIcon icon={icon} size="lg" style={{ display: "inline", paddingLeft: "7px" }} />
                     <div className="keys-dropdown"
                         style={{ display: "inline", zIndex: 10000 }}>
                         {keysDropdown}
                     </div>
-
                     <div onClick={e => this.changeSorting(col)}
-                        style={{ paddingRight: "6px" }}>
+                        style={{ paddingRight: "6px", display: "inline" }}>
                         <FontAwesomeIcon icon={sortIcon} size="sm" />
                     </div>
                     <div onClick={e => this.props.openHeader(col, e.clientX, e.clientY)}
-- 
cgit v1.2.3-70-g09d2


From fd613140e169912f44966fdc6f25fafd85bae7a1 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Sun, 28 Jun 2020 02:31:02 -0500
Subject: started adding date types

---
 package-lock.json                                  | 2154 +-------------------
 package.json                                       |    2 +
 .../views/collections/CollectionSchemaCells.tsx    |   49 +-
 .../views/collections/CollectionSchemaHeaders.tsx  |   11 +-
 .../views/collections/CollectionSchemaView.tsx     |   12 +-
 src/client/views/collections/SchemaTable.tsx       |    9 +-
 6 files changed, 151 insertions(+), 2086 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/package-lock.json b/package-lock.json
index 8db732a8e..6c364530b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1004,6 +1004,17 @@
                 "@types/reactcss": "*"
             }
         },
+        "@types/react-datepicker": {
+            "version": "3.0.2",
+            "resolved": "https://registry.npmjs.org/@types/react-datepicker/-/react-datepicker-3.0.2.tgz",
+            "integrity": "sha512-xW04NZRF+9ZnzOD3XrlIzBEKgUsN6LVgZJJsXH8NIUlVjyPh+sdtLPfVoDp+GQzGq1M0TuMLNZsv0sJ3N9XwDA==",
+            "dev": true,
+            "requires": {
+                "@types/react": "*",
+                "date-fns": "^2.0.1",
+                "popper.js": "^1.14.1"
+            }
+        },
         "@types/react-dom": {
             "version": "16.9.8",
             "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.8.tgz",
@@ -4368,6 +4379,11 @@
                 "whatwg-url": "^7.0.0"
             }
         },
+        "date-fns": {
+            "version": "2.14.0",
+            "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.14.0.tgz",
+            "integrity": "sha512-1zD+68jhFgDIM0rF05rcwYO8cExdNqxjq4xP1QKM60Q45mnO6zaMWB4tOzrIr4M4GSLntsKeE4c9Bdl2jhL/yw=="
+        },
         "dateformat": {
             "version": "1.0.12",
             "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz",
@@ -4429,7 +4445,6 @@
             "version": "1.1.1",
             "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.1.tgz",
             "integrity": "sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==",
-            "dev": true,
             "requires": {
                 "is-arguments": "^1.0.4",
                 "is-date-object": "^1.0.1",
@@ -7380,8 +7395,7 @@
         "is-arguments": {
             "version": "1.0.4",
             "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz",
-            "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==",
-            "dev": true
+            "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA=="
         },
         "is-arrayish": {
             "version": "0.2.1",
@@ -9345,12 +9359,7 @@
             "dependencies": {
                 "JSONStream": {
                     "version": "1.3.5",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz",
-                    "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "jsonparse": "^1.2.0",
                         "through": ">=2.2.7 <3"
@@ -9358,45 +9367,25 @@
                 },
                 "abbrev": {
                     "version": "1.1.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
-                    "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="
-                },
-                "agent-base": {
-                    "version": "4.3.0",
-                    "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz",
-                    "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==",
-=======
                     "bundled": true
                 },
                 "agent-base": {
                     "version": "4.3.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "es6-promisify": "^5.0.0"
                     }
                 },
                 "agentkeepalive": {
                     "version": "3.5.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-3.5.2.tgz",
-                    "integrity": "sha512-e0L/HNe6qkQ7H19kTlRRqUibEAwDK5AFk6y3PtMsuut2VAH6+Q4xZml1tNDJD7kSAyqmbG/K08K5WEJYtUrSlQ==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "humanize-ms": "^1.2.1"
                     }
                 },
                 "ajv": {
                     "version": "5.5.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
-                    "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "co": "^4.6.0",
                         "fast-deep-equal": "^1.0.0",
@@ -9406,63 +9395,24 @@
                 },
                 "ansi-align": {
                     "version": "2.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz",
-                    "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "string-width": "^2.0.0"
                     }
                 },
                 "ansi-regex": {
                     "version": "2.1.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
-                    "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
-                },
-                "ansi-styles": {
-                    "version": "3.2.1",
-                    "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
-                    "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
-=======
                     "bundled": true
                 },
                 "ansi-styles": {
                     "version": "3.2.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "color-convert": "^1.9.0"
                     }
                 },
                 "ansicolors": {
                     "version": "0.3.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz",
-                    "integrity": "sha1-ZlWX3oap/+Oqm/vmyuXG6kJrSXk="
-                },
-                "ansistyles": {
-                    "version": "0.1.3",
-                    "resolved": "https://registry.npmjs.org/ansistyles/-/ansistyles-0.1.3.tgz",
-                    "integrity": "sha1-XeYEFb2gcbs3EnhUyGT0GyMlRTk="
-                },
-                "aproba": {
-                    "version": "2.0.0",
-                    "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz",
-                    "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ=="
-                },
-                "archy": {
-                    "version": "1.0.0",
-                    "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz",
-                    "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA="
-                },
-                "are-we-there-yet": {
-                    "version": "1.1.4",
-                    "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz",
-                    "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=",
-=======
                     "bundled": true
                 },
                 "ansistyles": {
@@ -9480,7 +9430,6 @@
                 "are-we-there-yet": {
                     "version": "1.1.4",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "delegates": "^1.0.0",
                         "readable-stream": "^2.0.6"
@@ -9488,12 +9437,7 @@
                     "dependencies": {
                         "readable-stream": {
                             "version": "2.3.6",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
-                            "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "core-util-is": "~1.0.0",
                                 "inherits": "~2.0.3",
@@ -9506,12 +9450,7 @@
                         },
                         "string_decoder": {
                             "version": "1.1.1",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
-                            "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "safe-buffer": "~5.1.0"
                             }
@@ -9520,56 +9459,17 @@
                 },
                 "asap": {
                     "version": "2.0.6",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
-                    "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY="
-                },
-                "asn1": {
-                    "version": "0.2.4",
-                    "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
-                    "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==",
-=======
                     "bundled": true
                 },
                 "asn1": {
                     "version": "0.2.4",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "safer-buffer": "~2.1.0"
                     }
                 },
                 "assert-plus": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
-                    "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU="
-                },
-                "asynckit": {
-                    "version": "0.4.0",
-                    "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
-                    "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
-                },
-                "aws-sign2": {
-                    "version": "0.7.0",
-                    "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
-                    "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
-                },
-                "aws4": {
-                    "version": "1.8.0",
-                    "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz",
-                    "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ=="
-                },
-                "balanced-match": {
-                    "version": "1.0.0",
-                    "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
-                    "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
-                },
-                "bcrypt-pbkdf": {
-                    "version": "1.0.2",
-                    "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
-                    "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
-=======
                     "bundled": true
                 },
                 "asynckit": {
@@ -9591,7 +9491,6 @@
                 "bcrypt-pbkdf": {
                     "version": "1.0.2",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "optional": true,
                     "requires": {
                         "tweetnacl": "^0.14.3"
@@ -9599,12 +9498,7 @@
                 },
                 "bin-links": {
                     "version": "1.1.7",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/bin-links/-/bin-links-1.1.7.tgz",
-                    "integrity": "sha512-/eaLaTu7G7/o7PV04QPy1HRT65zf+1tFkPGv0sPTV0tRwufooYBQO3zrcyGgm+ja+ZtBf2GEuKjDRJ2pPG+yqA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "bluebird": "^3.5.3",
                         "cmd-shim": "^3.0.0",
@@ -9616,21 +9510,11 @@
                 },
                 "bluebird": {
                     "version": "3.5.5",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz",
-                    "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w=="
-                },
-                "boxen": {
-                    "version": "1.3.0",
-                    "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz",
-                    "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==",
-=======
                     "bundled": true
                 },
                 "boxen": {
                     "version": "1.3.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "ansi-align": "^2.0.0",
                         "camelcase": "^4.0.0",
@@ -9643,12 +9527,7 @@
                 },
                 "brace-expansion": {
                     "version": "1.1.11",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
-                    "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "balanced-match": "^1.0.0",
                         "concat-map": "0.0.1"
@@ -9656,30 +9535,6 @@
                 },
                 "buffer-from": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz",
-                    "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA=="
-                },
-                "builtins": {
-                    "version": "1.0.3",
-                    "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz",
-                    "integrity": "sha1-y5T662HIaWRR2zZTThQi+U8K7og="
-                },
-                "byline": {
-                    "version": "5.0.0",
-                    "resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz",
-                    "integrity": "sha1-dBxSFkaOrcRXsDQQEYrXfejB3bE="
-                },
-                "byte-size": {
-                    "version": "5.0.1",
-                    "resolved": "https://registry.npmjs.org/byte-size/-/byte-size-5.0.1.tgz",
-                    "integrity": "sha512-/XuKeqWocKsYa/cBY1YbSJSWWqTi4cFgr9S6OyM7PBaPbr9zvNGwWP33vt0uqGhwDdN+y3yhbXVILEUpnwEWGw=="
-                },
-                "cacache": {
-                    "version": "12.0.3",
-                    "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.3.tgz",
-                    "integrity": "sha512-kqdmfXEGFepesTuROHMs3MpFLWrPkSSpRqOw80RCflZXy/khxaArvFrQ7uJxSUduzAufc6G0g1VUCOZXxWavPw==",
-=======
                     "bundled": true
                 },
                 "builtins": {
@@ -9697,7 +9552,6 @@
                 "cacache": {
                     "version": "12.0.3",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "bluebird": "^3.5.5",
                         "chownr": "^1.1.1",
@@ -9718,30 +9572,6 @@
                 },
                 "call-limit": {
                     "version": "1.1.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/call-limit/-/call-limit-1.1.1.tgz",
-                    "integrity": "sha512-5twvci5b9eRBw2wCfPtN0GmlR2/gadZqyFpPhOK6CvMFoFgA+USnZ6Jpu1lhG9h85pQ3Ouil3PfXWRD4EUaRiQ=="
-                },
-                "camelcase": {
-                    "version": "4.1.0",
-                    "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
-                    "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0="
-                },
-                "capture-stack-trace": {
-                    "version": "1.0.0",
-                    "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz",
-                    "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0="
-                },
-                "caseless": {
-                    "version": "0.12.0",
-                    "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
-                    "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
-                },
-                "chalk": {
-                    "version": "2.4.1",
-                    "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
-                    "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
-=======
                     "bundled": true
                 },
                 "camelcase": {
@@ -9759,7 +9589,6 @@
                 "chalk": {
                     "version": "2.4.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "ansi-styles": "^3.2.1",
                         "escape-string-regexp": "^1.0.5",
@@ -9772,42 +9601,22 @@
                 },
                 "ci-info": {
                     "version": "2.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz",
-                    "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ=="
-                },
-                "cidr-regex": {
-                    "version": "2.0.10",
-                    "resolved": "https://registry.npmjs.org/cidr-regex/-/cidr-regex-2.0.10.tgz",
-                    "integrity": "sha512-sB3ogMQXWvreNPbJUZMRApxuRYd+KoIo4RGQ81VatjmMW6WJPo+IJZ2846FGItr9VzKo5w7DXzijPLGtSd0N3Q==",
-=======
                     "bundled": true
                 },
                 "cidr-regex": {
                     "version": "2.0.10",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "ip-regex": "^2.1.0"
                     }
                 },
                 "cli-boxes": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz",
-                    "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM="
-                },
-                "cli-columns": {
-                    "version": "3.1.2",
-                    "resolved": "https://registry.npmjs.org/cli-columns/-/cli-columns-3.1.2.tgz",
-                    "integrity": "sha1-ZzLZcpee/CrkRKHwjgj6E5yWoY4=",
-=======
                     "bundled": true
                 },
                 "cli-columns": {
                     "version": "3.1.2",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "string-width": "^2.0.0",
                         "strip-ansi": "^3.0.1"
@@ -9815,12 +9624,7 @@
                 },
                 "cli-table3": {
                     "version": "0.5.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz",
-                    "integrity": "sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "colors": "^1.1.2",
                         "object-assign": "^4.1.0",
@@ -9829,12 +9633,7 @@
                 },
                 "cliui": {
                     "version": "4.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz",
-                    "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "string-width": "^2.1.1",
                         "strip-ansi": "^4.0.0",
@@ -9843,21 +9642,11 @@
                     "dependencies": {
                         "ansi-regex": {
                             "version": "3.0.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
-                            "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
-                        },
-                        "strip-ansi": {
-                            "version": "4.0.0",
-                            "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
-                            "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
-=======
                             "bundled": true
                         },
                         "strip-ansi": {
                             "version": "4.0.0",
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "ansi-regex": "^3.0.0"
                             }
@@ -9866,21 +9655,11 @@
                 },
                 "clone": {
                     "version": "1.0.4",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
-                    "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4="
-                },
-                "cmd-shim": {
-                    "version": "3.0.3",
-                    "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-3.0.3.tgz",
-                    "integrity": "sha512-DtGg+0xiFhQIntSBRzL2fRQBnmtAVwXIDo4Qq46HPpObYquxMaZS4sb82U9nH91qJrlosC1wa9gwr0QyL/HypA==",
-=======
                     "bundled": true
                 },
                 "cmd-shim": {
                     "version": "3.0.3",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "graceful-fs": "^4.1.2",
                         "mkdirp": "~0.5.0"
@@ -9888,20 +9667,6 @@
                 },
                 "co": {
                     "version": "4.6.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
-                    "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ="
-                },
-                "code-point-at": {
-                    "version": "1.1.0",
-                    "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
-                    "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
-                },
-                "color-convert": {
-                    "version": "1.9.1",
-                    "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz",
-                    "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==",
-=======
                     "bundled": true
                 },
                 "code-point-at": {
@@ -9911,38 +9676,22 @@
                 "color-convert": {
                     "version": "1.9.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "color-name": "^1.1.1"
                     }
                 },
                 "color-name": {
                     "version": "1.1.3",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
-                    "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
-                },
-                "colors": {
-                    "version": "1.3.3",
-                    "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.3.tgz",
-                    "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==",
-=======
                     "bundled": true
                 },
                 "colors": {
                     "version": "1.3.3",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "optional": true
                 },
                 "columnify": {
                     "version": "1.5.4",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz",
-                    "integrity": "sha1-Rzfd8ce2mop8NAVweC6UfuyOeLs=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "strip-ansi": "^3.0.0",
                         "wcwidth": "^1.0.0"
@@ -9950,33 +9699,18 @@
                 },
                 "combined-stream": {
                     "version": "1.0.6",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz",
-                    "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "delayed-stream": "~1.0.0"
                     }
                 },
                 "concat-map": {
                     "version": "0.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
-                    "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
-                },
-                "concat-stream": {
-                    "version": "1.6.2",
-                    "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
-                    "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
-=======
                     "bundled": true
                 },
                 "concat-stream": {
                     "version": "1.6.2",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "buffer-from": "^1.0.0",
                         "inherits": "^2.0.3",
@@ -9986,12 +9720,7 @@
                     "dependencies": {
                         "readable-stream": {
                             "version": "2.3.6",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
-                            "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "core-util-is": "~1.0.0",
                                 "inherits": "~2.0.3",
@@ -10004,12 +9733,7 @@
                         },
                         "string_decoder": {
                             "version": "1.1.1",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
-                            "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "safe-buffer": "~5.1.0"
                             }
@@ -10018,12 +9742,7 @@
                 },
                 "config-chain": {
                     "version": "1.1.12",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.12.tgz",
-                    "integrity": "sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "ini": "^1.3.4",
                         "proto-list": "~1.2.1"
@@ -10031,12 +9750,7 @@
                 },
                 "configstore": {
                     "version": "3.1.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz",
-                    "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "dot-prop": "^4.1.0",
                         "graceful-fs": "^4.1.2",
@@ -10048,21 +9762,11 @@
                 },
                 "console-control-strings": {
                     "version": "1.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
-                    "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4="
-                },
-                "copy-concurrently": {
-                    "version": "1.0.5",
-                    "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz",
-                    "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==",
-=======
                     "bundled": true
                 },
                 "copy-concurrently": {
                     "version": "1.0.5",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "aproba": "^1.1.1",
                         "fs-write-stream-atomic": "^1.0.8",
@@ -10074,53 +9778,28 @@
                     "dependencies": {
                         "aproba": {
                             "version": "1.2.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
-                            "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw=="
-                        },
-                        "iferr": {
-                            "version": "0.1.5",
-                            "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz",
-                            "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE="
-=======
                             "bundled": true
                         },
                         "iferr": {
                             "version": "0.1.5",
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
                 "core-util-is": {
                     "version": "1.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
-                    "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
-                },
-                "create-error-class": {
-                    "version": "3.0.2",
-                    "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz",
-                    "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=",
-=======
                     "bundled": true
                 },
                 "create-error-class": {
                     "version": "3.0.2",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "capture-stack-trace": "^1.0.0"
                     }
                 },
                 "cross-spawn": {
                     "version": "5.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
-                    "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "lru-cache": "^4.0.1",
                         "shebang-command": "^1.2.0",
@@ -10129,12 +9808,7 @@
                     "dependencies": {
                         "lru-cache": {
                             "version": "4.1.5",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
-                            "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "pseudomap": "^1.0.2",
                                 "yallist": "^2.1.2"
@@ -10142,31 +9816,12 @@
                         },
                         "yallist": {
                             "version": "2.1.2",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
-                            "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
-=======
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
                 "crypto-random-string": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz",
-                    "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4="
-                },
-                "cyclist": {
-                    "version": "0.2.2",
-                    "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz",
-                    "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA="
-                },
-                "dashdash": {
-                    "version": "1.14.1",
-                    "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
-                    "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
-=======
                     "bundled": true
                 },
                 "cyclist": {
@@ -10176,50 +9831,25 @@
                 "dashdash": {
                     "version": "1.14.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "assert-plus": "^1.0.0"
                     }
                 },
                 "debug": {
                     "version": "3.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
-                    "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "ms": "2.0.0"
                     },
                     "dependencies": {
                         "ms": {
                             "version": "2.0.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
-                            "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
-=======
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
                 "debuglog": {
                     "version": "1.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz",
-                    "integrity": "sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI="
-                },
-                "decamelize": {
-                    "version": "1.2.0",
-                    "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
-                    "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
-                },
-                "decode-uri-component": {
-                    "version": "0.2.0",
-                    "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
-                    "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU="
-=======
                     "bundled": true
                 },
                 "decamelize": {
@@ -10229,7 +9859,6 @@
                 "decode-uri-component": {
                     "version": "0.2.0",
                     "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                 },
                 "deep-extend": {
                     "version": "0.6.0",
@@ -10237,54 +9866,20 @@
                 },
                 "defaults": {
                     "version": "1.0.3",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz",
-                    "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "clone": "^1.0.2"
                     }
                 },
                 "define-properties": {
                     "version": "1.1.3",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
-                    "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "object-keys": "^1.0.12"
                     }
                 },
                 "delayed-stream": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
-                    "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
-                },
-                "delegates": {
-                    "version": "1.0.0",
-                    "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
-                    "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o="
-                },
-                "detect-indent": {
-                    "version": "5.0.0",
-                    "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-5.0.0.tgz",
-                    "integrity": "sha1-OHHMCmoALow+Wzz38zYmRnXwa50="
-                },
-                "detect-newline": {
-                    "version": "2.1.0",
-                    "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz",
-                    "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I="
-                },
-                "dezalgo": {
-                    "version": "1.0.3",
-                    "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.3.tgz",
-                    "integrity": "sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=",
-=======
                     "bundled": true
                 },
                 "delegates": {
@@ -10302,7 +9897,6 @@
                 "dezalgo": {
                     "version": "1.0.3",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "asap": "^2.0.0",
                         "wrappy": "1"
@@ -10310,32 +9904,13 @@
                 },
                 "dot-prop": {
                     "version": "4.2.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz",
-                    "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "is-obj": "^1.0.0"
                     }
                 },
                 "dotenv": {
                     "version": "5.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-5.0.1.tgz",
-                    "integrity": "sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow=="
-                },
-                "duplexer3": {
-                    "version": "0.1.4",
-                    "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz",
-                    "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI="
-                },
-                "duplexify": {
-                    "version": "3.6.0",
-                    "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz",
-                    "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==",
-=======
                     "bundled": true
                 },
                 "duplexer3": {
@@ -10345,7 +9920,6 @@
                 "duplexify": {
                     "version": "3.6.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "end-of-stream": "^1.0.0",
                         "inherits": "^2.0.1",
@@ -10355,12 +9929,7 @@
                     "dependencies": {
                         "readable-stream": {
                             "version": "2.3.6",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
-                            "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "core-util-is": "~1.0.0",
                                 "inherits": "~2.0.3",
@@ -10373,12 +9942,7 @@
                         },
                         "string_decoder": {
                             "version": "1.1.1",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
-                            "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "safe-buffer": "~5.1.0"
                             }
@@ -10387,12 +9951,7 @@
                 },
                 "ecc-jsbn": {
                     "version": "0.1.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
-                    "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "optional": true,
                     "requires": {
                         "jsbn": "~0.1.0",
@@ -10401,53 +9960,24 @@
                 },
                 "editor": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/editor/-/editor-1.0.0.tgz",
-                    "integrity": "sha1-YMf4e9YrzGqJT6jM1q+3gjok90I="
-                },
-                "encoding": {
-                    "version": "0.1.12",
-                    "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz",
-                    "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=",
-=======
                     "bundled": true
                 },
                 "encoding": {
                     "version": "0.1.12",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "iconv-lite": "~0.4.13"
                     }
                 },
                 "end-of-stream": {
                     "version": "1.4.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
-                    "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "once": "^1.4.0"
                     }
                 },
                 "env-paths": {
                     "version": "2.2.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.0.tgz",
-                    "integrity": "sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA=="
-                },
-                "err-code": {
-                    "version": "1.1.2",
-                    "resolved": "https://registry.npmjs.org/err-code/-/err-code-1.1.2.tgz",
-                    "integrity": "sha1-BuARbTAo9q70gGhJ6w6mp0iuaWA="
-                },
-                "errno": {
-                    "version": "0.1.7",
-                    "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz",
-                    "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==",
-=======
                     "bundled": true
                 },
                 "err-code": {
@@ -10457,19 +9987,13 @@
                 "errno": {
                     "version": "0.1.7",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "prr": "~1.0.1"
                     }
                 },
                 "es-abstract": {
                     "version": "1.12.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz",
-                    "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "es-to-primitive": "^1.1.1",
                         "function-bind": "^1.1.1",
@@ -10480,12 +10004,7 @@
                 },
                 "es-to-primitive": {
                     "version": "1.2.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz",
-                    "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "is-callable": "^1.1.4",
                         "is-date-object": "^1.0.1",
@@ -10494,42 +10013,22 @@
                 },
                 "es6-promise": {
                     "version": "4.2.8",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
-                    "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
-                },
-                "es6-promisify": {
-                    "version": "5.0.0",
-                    "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
-                    "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=",
-=======
                     "bundled": true
                 },
                 "es6-promisify": {
                     "version": "5.0.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "es6-promise": "^4.0.3"
                     }
                 },
                 "escape-string-regexp": {
                     "version": "1.0.5",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
-                    "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
-                },
-                "execa": {
-                    "version": "0.7.0",
-                    "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz",
-                    "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=",
-=======
                     "bundled": true
                 },
                 "execa": {
                     "version": "0.7.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "cross-spawn": "^5.0.1",
                         "get-stream": "^3.0.0",
@@ -10542,51 +10041,12 @@
                     "dependencies": {
                         "get-stream": {
                             "version": "3.0.0",
-<<<<<<< HEAD
-                            "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
-                            "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ="
-=======
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
                 "extend": {
                     "version": "3.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
-                    "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
-                },
-                "extsprintf": {
-                    "version": "1.3.0",
-                    "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
-                    "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
-                },
-                "fast-deep-equal": {
-                    "version": "1.1.0",
-                    "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
-                    "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ="
-                },
-                "fast-json-stable-stringify": {
-                    "version": "2.0.0",
-                    "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
-                    "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
-                },
-                "figgy-pudding": {
-                    "version": "3.5.1",
-                    "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz",
-                    "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w=="
-                },
-                "find-npm-prefix": {
-                    "version": "1.0.2",
-                    "resolved": "https://registry.npmjs.org/find-npm-prefix/-/find-npm-prefix-1.0.2.tgz",
-                    "integrity": "sha512-KEftzJ+H90x6pcKtdXZEPsQse8/y/UnvzRKrOSQFprnrGaFuJ62fVkP34Iu2IYuMvyauCyoLTNkJZgrrGA2wkA=="
-                },
-                "find-up": {
-                    "version": "2.1.0",
-                    "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
-                    "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
-=======
                     "bundled": true
                 },
                 "extsprintf": {
@@ -10612,19 +10072,13 @@
                 "find-up": {
                     "version": "2.1.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "locate-path": "^2.0.0"
                     }
                 },
                 "flush-write-stream": {
                     "version": "1.0.3",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz",
-                    "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "inherits": "^2.0.1",
                         "readable-stream": "^2.0.4"
@@ -10632,12 +10086,7 @@
                     "dependencies": {
                         "readable-stream": {
                             "version": "2.3.6",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
-                            "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "core-util-is": "~1.0.0",
                                 "inherits": "~2.0.3",
@@ -10650,12 +10099,7 @@
                         },
                         "string_decoder": {
                             "version": "1.1.1",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
-                            "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "safe-buffer": "~5.1.0"
                             }
@@ -10664,21 +10108,11 @@
                 },
                 "forever-agent": {
                     "version": "0.6.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
-                    "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE="
-                },
-                "form-data": {
-                    "version": "2.3.2",
-                    "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz",
-                    "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=",
-=======
                     "bundled": true
                 },
                 "form-data": {
                     "version": "2.3.2",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "asynckit": "^0.4.0",
                         "combined-stream": "1.0.6",
@@ -10687,12 +10121,7 @@
                 },
                 "from2": {
                     "version": "2.3.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz",
-                    "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "inherits": "^2.0.1",
                         "readable-stream": "^2.0.0"
@@ -10700,12 +10129,7 @@
                     "dependencies": {
                         "readable-stream": {
                             "version": "2.3.6",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
-                            "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "core-util-is": "~1.0.0",
                                 "inherits": "~2.0.3",
@@ -10718,12 +10142,7 @@
                         },
                         "string_decoder": {
                             "version": "1.1.1",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
-                            "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "safe-buffer": "~5.1.0"
                             }
@@ -10732,24 +10151,14 @@
                 },
                 "fs-minipass": {
                     "version": "1.2.7",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz",
-                    "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "minipass": "^2.6.0"
                     },
                     "dependencies": {
                         "minipass": {
                             "version": "2.9.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz",
-                            "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "safe-buffer": "^5.1.2",
                                 "yallist": "^3.0.0"
@@ -10759,12 +10168,7 @@
                 },
                 "fs-vacuum": {
                     "version": "1.2.10",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.10.tgz",
-                    "integrity": "sha1-t2Kb7AekAxolSP35n17PHMizHjY=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "graceful-fs": "^4.1.2",
                         "path-is-inside": "^1.0.1",
@@ -10773,12 +10177,7 @@
                 },
                 "fs-write-stream-atomic": {
                     "version": "1.0.10",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz",
-                    "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "graceful-fs": "^4.1.2",
                         "iferr": "^0.1.5",
@@ -10788,21 +10187,11 @@
                     "dependencies": {
                         "iferr": {
                             "version": "0.1.5",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz",
-                            "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE="
-                        },
-                        "readable-stream": {
-                            "version": "2.3.6",
-                            "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
-                            "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
-=======
                             "bundled": true
                         },
                         "readable-stream": {
                             "version": "2.3.6",
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "core-util-is": "~1.0.0",
                                 "inherits": "~2.0.3",
@@ -10815,12 +10204,7 @@
                         },
                         "string_decoder": {
                             "version": "1.1.1",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
-                            "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "safe-buffer": "~5.1.0"
                             }
@@ -10829,20 +10213,6 @@
                 },
                 "fs.realpath": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
-                    "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
-                },
-                "function-bind": {
-                    "version": "1.1.1",
-                    "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
-                    "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
-                },
-                "gauge": {
-                    "version": "2.7.4",
-                    "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
-                    "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
-=======
                     "bundled": true
                 },
                 "function-bind": {
@@ -10852,7 +10222,6 @@
                 "gauge": {
                     "version": "2.7.4",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "aproba": "^1.0.3",
                         "console-control-strings": "^1.0.0",
@@ -10866,21 +10235,11 @@
                     "dependencies": {
                         "aproba": {
                             "version": "1.2.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
-                            "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw=="
-                        },
-                        "string-width": {
-                            "version": "1.0.2",
-                            "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
-                            "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
-=======
                             "bundled": true
                         },
                         "string-width": {
                             "version": "1.0.2",
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "code-point-at": "^1.0.0",
                                 "is-fullwidth-code-point": "^1.0.0",
@@ -10891,21 +10250,11 @@
                 },
                 "genfun": {
                     "version": "5.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/genfun/-/genfun-5.0.0.tgz",
-                    "integrity": "sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA=="
-                },
-                "gentle-fs": {
-                    "version": "2.3.0",
-                    "resolved": "https://registry.npmjs.org/gentle-fs/-/gentle-fs-2.3.0.tgz",
-                    "integrity": "sha512-3k2CgAmPxuz7S6nKK+AqFE2AdM1QuwqKLPKzIET3VRwK++3q96MsNFobScDjlCrq97ZJ8y5R725MOlm6ffUCjg==",
-=======
                     "bundled": true
                 },
                 "gentle-fs": {
                     "version": "2.3.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "aproba": "^1.1.2",
                         "chownr": "^1.1.2",
@@ -10922,53 +10271,28 @@
                     "dependencies": {
                         "aproba": {
                             "version": "1.2.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
-                            "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw=="
-                        },
-                        "iferr": {
-                            "version": "0.1.5",
-                            "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz",
-                            "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE="
-=======
                             "bundled": true
                         },
                         "iferr": {
                             "version": "0.1.5",
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
                 "get-caller-file": {
                     "version": "1.0.3",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
-                    "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w=="
-                },
-                "get-stream": {
-                    "version": "4.1.0",
-                    "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
-                    "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
-=======
                     "bundled": true
                 },
                 "get-stream": {
                     "version": "4.1.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "pump": "^3.0.0"
                     }
                 },
                 "getpass": {
                     "version": "0.1.7",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
-                    "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "assert-plus": "^1.0.0"
                     }
@@ -10987,24 +10311,14 @@
                 },
                 "global-dirs": {
                     "version": "0.1.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz",
-                    "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "ini": "^1.3.4"
                     }
                 },
                 "got": {
                     "version": "6.7.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz",
-                    "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "create-error-class": "^3.0.0",
                         "duplexer3": "^0.1.4",
@@ -11021,12 +10335,7 @@
                     "dependencies": {
                         "get-stream": {
                             "version": "3.0.0",
-<<<<<<< HEAD
-                            "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz",
-                            "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ="
-=======
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
@@ -11036,21 +10345,11 @@
                 },
                 "har-schema": {
                     "version": "2.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
-                    "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
-                },
-                "har-validator": {
-                    "version": "5.1.0",
-                    "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz",
-                    "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==",
-=======
                     "bundled": true
                 },
                 "har-validator": {
                     "version": "5.1.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "ajv": "^5.3.0",
                         "har-schema": "^2.0.0"
@@ -11058,32 +10357,13 @@
                 },
                 "has": {
                     "version": "1.0.3",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
-                    "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "function-bind": "^1.1.1"
                     }
                 },
                 "has-flag": {
                     "version": "3.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
-                    "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0="
-                },
-                "has-symbols": {
-                    "version": "1.0.0",
-                    "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz",
-                    "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q="
-                },
-                "has-unicode": {
-                    "version": "2.0.1",
-                    "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
-                    "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
-=======
                     "bundled": true
                 },
                 "has-symbols": {
@@ -11093,7 +10373,6 @@
                 "has-unicode": {
                     "version": "2.0.1",
                     "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                 },
                 "hosted-git-info": {
                     "version": "2.8.8",
@@ -11101,21 +10380,11 @@
                 },
                 "http-cache-semantics": {
                     "version": "3.8.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-3.8.1.tgz",
-                    "integrity": "sha512-5ai2iksyV8ZXmnZhHH4rWPoxxistEexSi5936zIQ1bnNTW5VnA85B6P/VpXiRM017IgRvb2kKo1a//y+0wSp3w=="
-                },
-                "http-proxy-agent": {
-                    "version": "2.1.0",
-                    "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz",
-                    "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==",
-=======
                     "bundled": true
                 },
                 "http-proxy-agent": {
                     "version": "2.1.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "agent-base": "4",
                         "debug": "3.1.0"
@@ -11123,12 +10392,7 @@
                 },
                 "http-signature": {
                     "version": "1.2.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
-                    "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "assert-plus": "^1.0.0",
                         "jsprim": "^1.2.2",
@@ -11137,12 +10401,7 @@
                 },
                 "https-proxy-agent": {
                     "version": "2.2.4",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz",
-                    "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "agent-base": "^4.3.0",
                         "debug": "^3.1.0"
@@ -11150,70 +10409,31 @@
                 },
                 "humanize-ms": {
                     "version": "1.2.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz",
-                    "integrity": "sha1-xG4xWaKT9riW2ikxbYtv6Lt5u+0=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "ms": "^2.0.0"
                     }
                 },
                 "iconv-lite": {
                     "version": "0.4.23",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz",
-                    "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "safer-buffer": ">= 2.1.2 < 3"
                     }
                 },
                 "iferr": {
                     "version": "1.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/iferr/-/iferr-1.0.2.tgz",
-                    "integrity": "sha512-9AfeLfji44r5TKInjhz3W9DyZI1zR1JAf2hVBMGhddAKPqBsupb89jGfbCTHIGZd6fGZl9WlHdn4AObygyMKwg=="
-                },
-                "ignore-walk": {
-                    "version": "3.0.3",
-                    "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz",
-                    "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==",
-=======
                     "bundled": true
                 },
                 "ignore-walk": {
                     "version": "3.0.3",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "minimatch": "^3.0.4"
                     }
                 },
                 "import-lazy": {
                     "version": "2.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz",
-                    "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM="
-                },
-                "imurmurhash": {
-                    "version": "0.1.4",
-                    "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
-                    "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o="
-                },
-                "infer-owner": {
-                    "version": "1.0.4",
-                    "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz",
-                    "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A=="
-                },
-                "inflight": {
-                    "version": "1.0.6",
-                    "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
-                    "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
-=======
                     "bundled": true
                 },
                 "imurmurhash": {
@@ -11227,7 +10447,6 @@
                 "inflight": {
                     "version": "1.0.6",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "once": "^1.3.0",
                         "wrappy": "1"
@@ -11235,20 +10454,6 @@
                 },
                 "inherits": {
                     "version": "2.0.4",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
-                    "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
-                },
-                "ini": {
-                    "version": "1.3.5",
-                    "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
-                    "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
-                },
-                "init-package-json": {
-                    "version": "1.10.3",
-                    "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.10.3.tgz",
-                    "integrity": "sha512-zKSiXKhQveNteyhcj1CoOP8tqp1QuxPIPBl8Bid99DGLFqA1p87M6lNgfjJHSBoWJJlidGOv5rWjyYKEB3g2Jw==",
-=======
                     "bundled": true
                 },
                 "ini": {
@@ -11258,7 +10463,6 @@
                 "init-package-json": {
                     "version": "1.10.3",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "glob": "^7.1.1",
                         "npm-package-arg": "^4.0.0 || ^5.0.0 || ^6.0.0",
@@ -11272,25 +10476,6 @@
                 },
                 "invert-kv": {
                     "version": "2.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz",
-                    "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA=="
-                },
-                "ip": {
-                    "version": "1.1.5",
-                    "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz",
-                    "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo="
-                },
-                "ip-regex": {
-                    "version": "2.1.0",
-                    "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz",
-                    "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk="
-                },
-                "is-callable": {
-                    "version": "1.1.4",
-                    "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz",
-                    "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA=="
-=======
                     "bundled": true
                 },
                 "ip": {
@@ -11304,7 +10489,6 @@
                 "is-callable": {
                     "version": "1.1.4",
                     "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                 },
                 "is-ci": {
                     "version": "1.2.1",
@@ -11315,56 +10499,31 @@
                     "dependencies": {
                         "ci-info": {
                             "version": "1.6.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz",
-                            "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A=="
-=======
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
                 "is-cidr": {
                     "version": "3.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/is-cidr/-/is-cidr-3.0.0.tgz",
-                    "integrity": "sha512-8Xnnbjsb0x462VoYiGlhEi+drY8SFwrHiSYuzc/CEwco55vkehTaxAyIjEdpi3EMvLPPJAJi9FlzP+h+03gp0Q==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "cidr-regex": "^2.0.10"
                     }
                 },
                 "is-date-object": {
                     "version": "1.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz",
-                    "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY="
-                },
-                "is-fullwidth-code-point": {
-                    "version": "1.0.0",
-                    "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
-                    "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
-=======
                     "bundled": true
                 },
                 "is-fullwidth-code-point": {
                     "version": "1.0.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "number-is-nan": "^1.0.0"
                     }
                 },
                 "is-installed-globally": {
                     "version": "0.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz",
-                    "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "global-dirs": "^0.1.0",
                         "is-path-inside": "^1.0.0"
@@ -11372,20 +10531,6 @@
                 },
                 "is-npm": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz",
-                    "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ="
-                },
-                "is-obj": {
-                    "version": "1.0.1",
-                    "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz",
-                    "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8="
-                },
-                "is-path-inside": {
-                    "version": "1.0.1",
-                    "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz",
-                    "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=",
-=======
                     "bundled": true
                 },
                 "is-obj": {
@@ -11395,28 +10540,17 @@
                 "is-path-inside": {
                     "version": "1.0.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "path-is-inside": "^1.0.1"
                     }
                 },
                 "is-redirect": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz",
-                    "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ="
-                },
-                "is-regex": {
-                    "version": "1.0.4",
-                    "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz",
-                    "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=",
-=======
                     "bundled": true
                 },
                 "is-regex": {
                     "version": "1.0.4",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "has": "^1.0.1"
                     }
@@ -11427,51 +10561,17 @@
                 },
                 "is-stream": {
                     "version": "1.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
-                    "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ="
-                },
-                "is-symbol": {
-                    "version": "1.0.2",
-                    "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz",
-                    "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==",
-=======
                     "bundled": true
                 },
                 "is-symbol": {
                     "version": "1.0.2",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "has-symbols": "^1.0.0"
                     }
                 },
                 "is-typedarray": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
-                    "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
-                },
-                "isarray": {
-                    "version": "1.0.0",
-                    "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
-                    "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
-                },
-                "isexe": {
-                    "version": "2.0.0",
-                    "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
-                    "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA="
-                },
-                "isstream": {
-                    "version": "0.1.2",
-                    "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
-                    "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
-                },
-                "jsbn": {
-                    "version": "0.1.1",
-                    "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
-                    "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
-=======
                     "bundled": true
                 },
                 "isarray": {
@@ -11489,40 +10589,10 @@
                 "jsbn": {
                     "version": "0.1.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "optional": true
                 },
                 "json-parse-better-errors": {
                     "version": "1.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
-                    "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw=="
-                },
-                "json-schema": {
-                    "version": "0.2.3",
-                    "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
-                    "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM="
-                },
-                "json-schema-traverse": {
-                    "version": "0.3.1",
-                    "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
-                    "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A="
-                },
-                "json-stringify-safe": {
-                    "version": "5.0.1",
-                    "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
-                    "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
-                },
-                "jsonparse": {
-                    "version": "1.3.1",
-                    "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz",
-                    "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA="
-                },
-                "jsprim": {
-                    "version": "1.4.1",
-                    "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
-                    "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
-=======
                     "bundled": true
                 },
                 "json-schema": {
@@ -11544,7 +10614,6 @@
                 "jsprim": {
                     "version": "1.4.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "assert-plus": "1.0.0",
                         "extsprintf": "1.3.0",
@@ -11554,45 +10623,25 @@
                 },
                 "latest-version": {
                     "version": "3.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz",
-                    "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "package-json": "^4.0.0"
                     }
                 },
                 "lazy-property": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/lazy-property/-/lazy-property-1.0.0.tgz",
-                    "integrity": "sha1-hN3Es3Bnm6i9TNz6TAa0PVcREUc="
-                },
-                "lcid": {
-                    "version": "2.0.0",
-                    "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
-                    "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
-=======
                     "bundled": true
                 },
                 "lcid": {
                     "version": "2.0.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "invert-kv": "^2.0.0"
                     }
                 },
                 "libcipm": {
                     "version": "4.0.7",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/libcipm/-/libcipm-4.0.7.tgz",
-                    "integrity": "sha512-fTq33otU3PNXxxCTCYCYe7V96o59v/o7bvtspmbORXpgFk+wcWrGf5x6tBgui5gCed/45/wtPomBsZBYm5KbIw==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "bin-links": "^1.1.2",
                         "bluebird": "^3.5.1",
@@ -11613,12 +10662,7 @@
                 },
                 "libnpm": {
                     "version": "3.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/libnpm/-/libnpm-3.0.1.tgz",
-                    "integrity": "sha512-d7jU5ZcMiTfBqTUJVZ3xid44fE5ERBm9vBnmhp2ECD2Ls+FNXWxHSkO7gtvrnbLO78gwPdNPz1HpsF3W4rjkBQ==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "bin-links": "^1.1.2",
                         "bluebird": "^3.5.3",
@@ -11644,12 +10688,7 @@
                 },
                 "libnpmaccess": {
                     "version": "3.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-3.0.2.tgz",
-                    "integrity": "sha512-01512AK7MqByrI2mfC7h5j8N9V4I7MHJuk9buo8Gv+5QgThpOgpjB7sQBDDkeZqRteFb1QM/6YNdHfG7cDvfAQ==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "aproba": "^2.0.0",
                         "get-stream": "^4.0.0",
@@ -11659,12 +10698,7 @@
                 },
                 "libnpmconfig": {
                     "version": "1.2.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/libnpmconfig/-/libnpmconfig-1.2.1.tgz",
-                    "integrity": "sha512-9esX8rTQAHqarx6qeZqmGQKBNZR5OIbl/Ayr0qQDy3oXja2iFVQQI81R6GZ2a02bSNZ9p3YOGX1O6HHCb1X7kA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "figgy-pudding": "^3.5.1",
                         "find-up": "^3.0.0",
@@ -11673,24 +10707,14 @@
                     "dependencies": {
                         "find-up": {
                             "version": "3.0.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
-                            "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "locate-path": "^3.0.0"
                             }
                         },
                         "locate-path": {
                             "version": "3.0.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
-                            "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "p-locate": "^3.0.0",
                                 "path-exists": "^3.0.0"
@@ -11698,47 +10722,27 @@
                         },
                         "p-limit": {
                             "version": "2.2.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
-                            "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "p-try": "^2.0.0"
                             }
                         },
                         "p-locate": {
                             "version": "3.0.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
-                            "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "p-limit": "^2.0.0"
                             }
                         },
                         "p-try": {
                             "version": "2.2.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
-                            "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="
-=======
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
                 "libnpmhook": {
                     "version": "5.0.3",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/libnpmhook/-/libnpmhook-5.0.3.tgz",
-                    "integrity": "sha512-UdNLMuefVZra/wbnBXECZPefHMGsVDTq5zaM/LgKNE9Keyl5YXQTnGAzEo+nFOpdRqTWI9LYi4ApqF9uVCCtuA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "aproba": "^2.0.0",
                         "figgy-pudding": "^3.4.1",
@@ -11748,12 +10752,7 @@
                 },
                 "libnpmorg": {
                     "version": "1.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/libnpmorg/-/libnpmorg-1.0.1.tgz",
-                    "integrity": "sha512-0sRUXLh+PLBgZmARvthhYXQAWn0fOsa6T5l3JSe2n9vKG/lCVK4nuG7pDsa7uMq+uTt2epdPK+a2g6btcY11Ww==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "aproba": "^2.0.0",
                         "figgy-pudding": "^3.4.1",
@@ -11763,12 +10762,7 @@
                 },
                 "libnpmpublish": {
                     "version": "1.1.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-1.1.2.tgz",
-                    "integrity": "sha512-2yIwaXrhTTcF7bkJKIKmaCV9wZOALf/gsTDxVSu/Gu/6wiG3fA8ce8YKstiWKTxSFNC0R7isPUb6tXTVFZHt2g==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "aproba": "^2.0.0",
                         "figgy-pudding": "^3.5.1",
@@ -11783,12 +10777,7 @@
                 },
                 "libnpmsearch": {
                     "version": "2.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/libnpmsearch/-/libnpmsearch-2.0.2.tgz",
-                    "integrity": "sha512-VTBbV55Q6fRzTdzziYCr64+f8AopQ1YZ+BdPOv16UegIEaE8C0Kch01wo4s3kRTFV64P121WZJwgmBwrq68zYg==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "figgy-pudding": "^3.5.1",
                         "get-stream": "^4.0.0",
@@ -11797,12 +10786,7 @@
                 },
                 "libnpmteam": {
                     "version": "1.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/libnpmteam/-/libnpmteam-1.0.2.tgz",
-                    "integrity": "sha512-p420vM28Us04NAcg1rzgGW63LMM6rwe+6rtZpfDxCcXxM0zUTLl7nPFEnRF3JfFBF5skF/yuZDUthTsHgde8QA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "aproba": "^2.0.0",
                         "figgy-pudding": "^3.4.1",
@@ -11812,12 +10796,7 @@
                 },
                 "libnpx": {
                     "version": "10.2.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/libnpx/-/libnpx-10.2.2.tgz",
-                    "integrity": "sha512-ujaYToga1SAX5r7FU5ShMFi88CWpY75meNZtr6RtEyv4l2ZK3+Wgvxq2IqlwWBiDZOqhumdeiocPS1aKrCMe3A==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "dotenv": "^5.0.1",
                         "npm-package-arg": "^6.0.0",
@@ -11831,12 +10810,7 @@
                 },
                 "locate-path": {
                     "version": "2.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
-                    "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "p-locate": "^2.0.0",
                         "path-exists": "^3.0.0"
@@ -11844,12 +10818,7 @@
                 },
                 "lock-verify": {
                     "version": "2.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/lock-verify/-/lock-verify-2.1.0.tgz",
-                    "integrity": "sha512-vcLpxnGvrqisKvLQ2C2v0/u7LVly17ak2YSgoK4PrdsYBXQIax19vhKiLfvKNFx7FRrpTnitrpzF/uuCMuorIg==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "npm-package-arg": "^6.1.0",
                         "semver": "^5.4.1"
@@ -11857,33 +10826,18 @@
                 },
                 "lockfile": {
                     "version": "1.0.4",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.4.tgz",
-                    "integrity": "sha512-cvbTwETRfsFh4nHsL1eGWapU1XFi5Ot9E85sWAwia7Y7EgB7vfqcZhTKZ+l7hCGxSPoushMv5GKhT5PdLv03WA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "signal-exit": "^3.0.2"
                     }
                 },
                 "lodash._baseindexof": {
                     "version": "3.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz",
-                    "integrity": "sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw="
-                },
-                "lodash._baseuniq": {
-                    "version": "4.6.0",
-                    "resolved": "https://registry.npmjs.org/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz",
-                    "integrity": "sha1-DrtE5FaBSveQXGIS+iybLVG4Qeg=",
-=======
                     "bundled": true
                 },
                 "lodash._baseuniq": {
                     "version": "4.6.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "lodash._createset": "~4.0.0",
                         "lodash._root": "~3.0.0"
@@ -11891,20 +10845,6 @@
                 },
                 "lodash._bindcallback": {
                     "version": "3.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz",
-                    "integrity": "sha1-5THCdkTPi1epnhftlbNcdIeJOS4="
-                },
-                "lodash._cacheindexof": {
-                    "version": "3.0.2",
-                    "resolved": "https://registry.npmjs.org/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz",
-                    "integrity": "sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI="
-                },
-                "lodash._createcache": {
-                    "version": "3.1.2",
-                    "resolved": "https://registry.npmjs.org/lodash._createcache/-/lodash._createcache-3.1.2.tgz",
-                    "integrity": "sha1-VtagZAF2JeeevKa4AY4XRAvc8JM=",
-=======
                     "bundled": true
                 },
                 "lodash._cacheindexof": {
@@ -11914,62 +10854,12 @@
                 "lodash._createcache": {
                     "version": "3.1.2",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "lodash._getnative": "^3.0.0"
                     }
                 },
                 "lodash._createset": {
                     "version": "4.0.3",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/lodash._createset/-/lodash._createset-4.0.3.tgz",
-                    "integrity": "sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY="
-                },
-                "lodash._getnative": {
-                    "version": "3.9.1",
-                    "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz",
-                    "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U="
-                },
-                "lodash._root": {
-                    "version": "3.0.1",
-                    "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz",
-                    "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI="
-                },
-                "lodash.clonedeep": {
-                    "version": "4.5.0",
-                    "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
-                    "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8="
-                },
-                "lodash.restparam": {
-                    "version": "3.6.1",
-                    "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz",
-                    "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU="
-                },
-                "lodash.union": {
-                    "version": "4.6.0",
-                    "resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz",
-                    "integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg="
-                },
-                "lodash.uniq": {
-                    "version": "4.5.0",
-                    "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz",
-                    "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M="
-                },
-                "lodash.without": {
-                    "version": "4.4.0",
-                    "resolved": "https://registry.npmjs.org/lodash.without/-/lodash.without-4.4.0.tgz",
-                    "integrity": "sha1-PNRXSgC2e643OpS3SHcmQFB7eqw="
-                },
-                "lowercase-keys": {
-                    "version": "1.0.1",
-                    "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz",
-                    "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA=="
-                },
-                "lru-cache": {
-                    "version": "5.1.1",
-                    "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
-                    "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
-=======
                     "bundled": true
                 },
                 "lodash._getnative": {
@@ -12007,31 +10897,20 @@
                 "lru-cache": {
                     "version": "5.1.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "yallist": "^3.0.2"
                     }
                 },
                 "make-dir": {
                     "version": "1.3.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
-                    "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "pify": "^3.0.0"
                     }
                 },
                 "make-fetch-happen": {
                     "version": "5.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-5.0.2.tgz",
-                    "integrity": "sha512-07JHC0r1ykIoruKO8ifMXu+xEU8qOXDFETylktdug6vJDACnP+HKevOu3PXyNPzFyTSlz8vrBYlBO1JZRe8Cag==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "agentkeepalive": "^3.4.1",
                         "cacache": "^12.0.0",
@@ -12048,33 +10927,18 @@
                 },
                 "map-age-cleaner": {
                     "version": "0.1.3",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz",
-                    "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "p-defer": "^1.0.0"
                     }
                 },
                 "meant": {
                     "version": "1.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/meant/-/meant-1.0.1.tgz",
-                    "integrity": "sha512-UakVLFjKkbbUwNWJ2frVLnnAtbb7D7DsloxRd3s/gDpI8rdv8W5Hp3NaDb+POBI1fQdeussER6NB8vpcRURvlg=="
-                },
-                "mem": {
-                    "version": "4.3.0",
-                    "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz",
-                    "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==",
-=======
                     "bundled": true
                 },
                 "mem": {
                     "version": "4.3.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "map-age-cleaner": "^0.1.1",
                         "mimic-fn": "^2.0.0",
@@ -12083,68 +10947,38 @@
                     "dependencies": {
                         "mimic-fn": {
                             "version": "2.1.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
-                            "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="
-=======
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
                 "mime-db": {
                     "version": "1.35.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz",
-                    "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg=="
-                },
-                "mime-types": {
-                    "version": "2.1.19",
-                    "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz",
-                    "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==",
-=======
                     "bundled": true
                 },
                 "mime-types": {
                     "version": "2.1.19",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "mime-db": "~1.35.0"
                     }
                 },
                 "minimatch": {
                     "version": "3.0.4",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
-                    "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "brace-expansion": "^1.1.7"
                     }
                 },
                 "minizlib": {
                     "version": "1.3.3",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz",
-                    "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "minipass": "^2.9.0"
                     },
                     "dependencies": {
                         "minipass": {
                             "version": "2.9.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz",
-                            "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "safe-buffer": "^5.1.2",
                                 "yallist": "^3.0.0"
@@ -12154,12 +10988,7 @@
                 },
                 "mississippi": {
                     "version": "3.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz",
-                    "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "concat-stream": "^1.5.0",
                         "duplexify": "^3.4.2",
@@ -12174,14 +11003,8 @@
                     }
                 },
                 "mkdirp": {
-<<<<<<< HEAD
-                    "version": "0.5.4",
-                    "resolved": false,
-                    "integrity": "sha512-iG9AK/dJLtJ0XNgTuDbSyNS3zECqDlAhnQW4CsNxBG3LQJBbHmRX1egw39DmtOdCAqY+dKXV+sgPgilNWUKMVw==",
-=======
                     "version": "0.5.5",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "minimist": "^1.2.5"
                     },
@@ -12194,12 +11017,7 @@
                 },
                 "move-concurrently": {
                     "version": "1.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",
-                    "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "aproba": "^1.1.1",
                         "copy-concurrently": "^1.0.0",
@@ -12211,36 +11029,12 @@
                     "dependencies": {
                         "aproba": {
                             "version": "1.2.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
-                            "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw=="
-=======
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
                 "ms": {
                     "version": "2.1.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
-                    "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
-                },
-                "mute-stream": {
-                    "version": "0.0.7",
-                    "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
-                    "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s="
-                },
-                "nice-try": {
-                    "version": "1.0.5",
-                    "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
-                    "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
-                },
-                "node-fetch-npm": {
-                    "version": "2.0.2",
-                    "resolved": "https://registry.npmjs.org/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz",
-                    "integrity": "sha512-nJIxm1QmAj4v3nfCvEeCrYSoVwXyxLnaPBK5W1W5DGEJwjlKuC2VEUycGw5oxk+4zZahRrB84PUJJgEmhFTDFw==",
-=======
                     "bundled": true
                 },
                 "mute-stream": {
@@ -12254,7 +11048,6 @@
                 "node-fetch-npm": {
                     "version": "2.0.2",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "encoding": "^0.1.11",
                         "json-parse-better-errors": "^1.0.0",
@@ -12288,12 +11081,7 @@
                 },
                 "normalize-package-data": {
                     "version": "2.5.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
-                    "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "hosted-git-info": "^2.1.4",
                         "resolve": "^1.10.0",
@@ -12303,12 +11091,7 @@
                     "dependencies": {
                         "resolve": {
                             "version": "1.10.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz",
-                            "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "path-parse": "^1.0.6"
                             }
@@ -12317,12 +11100,7 @@
                 },
                 "npm-audit-report": {
                     "version": "1.3.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/npm-audit-report/-/npm-audit-report-1.3.2.tgz",
-                    "integrity": "sha512-abeqS5ONyXNaZJPGAf6TOUMNdSe1Y6cpc9MLBRn+CuUoYbfdca6AxOyXVlfIv9OgKX+cacblbG5w7A6ccwoTPw==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "cli-table3": "^0.5.0",
                         "console-control-strings": "^1.1.0"
@@ -12330,45 +11108,25 @@
                 },
                 "npm-bundled": {
                     "version": "1.1.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz",
-                    "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "npm-normalize-package-bin": "^1.0.1"
                     }
                 },
                 "npm-cache-filename": {
                     "version": "1.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/npm-cache-filename/-/npm-cache-filename-1.0.2.tgz",
-                    "integrity": "sha1-3tMGxbC/yHCp6fr4I7xfKD4FrhE="
-                },
-                "npm-install-checks": {
-                    "version": "3.0.2",
-                    "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-3.0.2.tgz",
-                    "integrity": "sha512-E4kzkyZDIWoin6uT5howP8VDvkM+E8IQDcHAycaAxMbwkqhIg5eEYALnXOl3Hq9MrkdQB/2/g1xwBINXdKSRkg==",
-=======
                     "bundled": true
                 },
                 "npm-install-checks": {
                     "version": "3.0.2",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "semver": "^2.3.0 || 3.x || 4 || 5"
                     }
                 },
                 "npm-lifecycle": {
                     "version": "3.1.4",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/npm-lifecycle/-/npm-lifecycle-3.1.4.tgz",
-                    "integrity": "sha512-tgs1PaucZwkxECGKhC/stbEgFyc3TGh2TJcg2CDr6jbvQRdteHNhmMeljRzpe4wgFAXQADoy1cSqqi7mtiAa5A==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "byline": "^5.0.0",
                         "graceful-fs": "^4.1.15",
@@ -12382,20 +11140,6 @@
                 },
                 "npm-logical-tree": {
                     "version": "1.2.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/npm-logical-tree/-/npm-logical-tree-1.2.1.tgz",
-                    "integrity": "sha512-AJI/qxDB2PWI4LG1CYN579AY1vCiNyWfkiquCsJWqntRu/WwimVrC8yXeILBFHDwxfOejxewlmnvW9XXjMlYIg=="
-                },
-                "npm-normalize-package-bin": {
-                    "version": "1.0.1",
-                    "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz",
-                    "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA=="
-                },
-                "npm-package-arg": {
-                    "version": "6.1.1",
-                    "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.1.tgz",
-                    "integrity": "sha512-qBpssaL3IOZWi5vEKUKW0cO7kzLeT+EQO9W8RsLOZf76KF9E/K9+wH0C7t06HXPpaH8WH5xF1MExLuCwbTqRUg==",
-=======
                     "bundled": true
                 },
                 "npm-normalize-package-bin": {
@@ -12405,7 +11149,6 @@
                 "npm-package-arg": {
                     "version": "6.1.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "hosted-git-info": "^2.7.1",
                         "osenv": "^0.1.5",
@@ -12424,12 +11167,7 @@
                 },
                 "npm-pick-manifest": {
                     "version": "3.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz",
-                    "integrity": "sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "figgy-pudding": "^3.5.1",
                         "npm-package-arg": "^6.0.0",
@@ -12446,14 +11184,8 @@
                     }
                 },
                 "npm-registry-fetch": {
-<<<<<<< HEAD
-                    "version": "4.0.3",
-                    "resolved": false,
-                    "integrity": "sha512-WGvUx0lkKFhu9MbiGFuT9nG2NpfQ+4dCJwRwwtK2HK5izJEvwDxMeUyqbuMS7N/OkpVCqDorV6rO5E4V9F8lJw==",
-=======
                     "version": "4.0.4",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "JSONStream": "^1.3.4",
                         "bluebird": "^3.5.1",
@@ -12466,44 +11198,24 @@
                     "dependencies": {
                         "safe-buffer": {
                             "version": "5.2.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
-                            "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg=="
-=======
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
                 "npm-run-path": {
                     "version": "2.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
-                    "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "path-key": "^2.0.0"
                     }
                 },
                 "npm-user-validate": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-1.0.0.tgz",
-                    "integrity": "sha1-jOyg9c6gTU6TUZ73LQVXp1Ei6VE="
-                },
-                "npmlog": {
-                    "version": "4.1.2",
-                    "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
-                    "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
-=======
                     "bundled": true
                 },
                 "npmlog": {
                     "version": "4.1.2",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "are-we-there-yet": "~1.1.2",
                         "console-control-strings": "~1.1.0",
@@ -12513,30 +11225,6 @@
                 },
                 "number-is-nan": {
                     "version": "1.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
-                    "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
-                },
-                "oauth-sign": {
-                    "version": "0.9.0",
-                    "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
-                    "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
-                },
-                "object-assign": {
-                    "version": "4.1.1",
-                    "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
-                    "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
-                },
-                "object-keys": {
-                    "version": "1.0.12",
-                    "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz",
-                    "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag=="
-                },
-                "object.getownpropertydescriptors": {
-                    "version": "2.0.3",
-                    "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz",
-                    "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=",
-=======
                     "bundled": true
                 },
                 "oauth-sign": {
@@ -12554,7 +11242,6 @@
                 "object.getownpropertydescriptors": {
                     "version": "2.0.3",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "define-properties": "^1.1.2",
                         "es-abstract": "^1.5.1"
@@ -12562,32 +11249,13 @@
                 },
                 "once": {
                     "version": "1.4.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
-                    "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "wrappy": "1"
                     }
                 },
                 "opener": {
                     "version": "1.5.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.1.tgz",
-                    "integrity": "sha512-goYSy5c2UXE4Ra1xixabeVh1guIX/ZV/YokJksb6q2lubWu6UbvPQ20p542/sFIll1nl8JnCyK9oBaOcCWXwvA=="
-                },
-                "os-homedir": {
-                    "version": "1.0.2",
-                    "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
-                    "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="
-                },
-                "os-locale": {
-                    "version": "3.1.0",
-                    "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz",
-                    "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==",
-=======
                     "bundled": true
                 },
                 "os-homedir": {
@@ -12597,7 +11265,6 @@
                 "os-locale": {
                     "version": "3.1.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "execa": "^1.0.0",
                         "lcid": "^2.0.0",
@@ -12606,12 +11273,7 @@
                     "dependencies": {
                         "cross-spawn": {
                             "version": "6.0.5",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
-                            "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "nice-try": "^1.0.4",
                                 "path-key": "^2.0.1",
@@ -12622,12 +11284,7 @@
                         },
                         "execa": {
                             "version": "1.0.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
-                            "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "cross-spawn": "^6.0.0",
                                 "get-stream": "^4.0.0",
@@ -12642,21 +11299,11 @@
                 },
                 "os-tmpdir": {
                     "version": "1.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
-                    "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ="
-                },
-                "osenv": {
-                    "version": "0.1.5",
-                    "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz",
-                    "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
-=======
                     "bundled": true
                 },
                 "osenv": {
                     "version": "0.1.5",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "os-homedir": "^1.0.0",
                         "os-tmpdir": "^1.0.0"
@@ -12664,25 +11311,6 @@
                 },
                 "p-defer": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz",
-                    "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww="
-                },
-                "p-finally": {
-                    "version": "1.0.0",
-                    "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
-                    "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4="
-                },
-                "p-is-promise": {
-                    "version": "2.1.0",
-                    "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz",
-                    "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg=="
-                },
-                "p-limit": {
-                    "version": "1.2.0",
-                    "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz",
-                    "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==",
-=======
                     "bundled": true
                 },
                 "p-finally": {
@@ -12696,40 +11324,24 @@
                 "p-limit": {
                     "version": "1.2.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "p-try": "^1.0.0"
                     }
                 },
                 "p-locate": {
                     "version": "2.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
-                    "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "p-limit": "^1.1.0"
                     }
                 },
                 "p-try": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
-                    "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M="
-                },
-                "package-json": {
-                    "version": "4.0.1",
-                    "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz",
-                    "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=",
-=======
                     "bundled": true
                 },
                 "package-json": {
                     "version": "4.0.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "got": "^6.7.1",
                         "registry-auth-token": "^3.0.1",
@@ -12739,12 +11351,7 @@
                 },
                 "pacote": {
                     "version": "9.5.12",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/pacote/-/pacote-9.5.12.tgz",
-                    "integrity": "sha512-BUIj/4kKbwWg4RtnBncXPJd15piFSVNpTzY0rysSr3VnMowTYgkGKcaHrbReepAkjTr8lH2CVWRi58Spg2CicQ==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "bluebird": "^3.5.3",
                         "cacache": "^12.0.2",
@@ -12780,12 +11387,7 @@
                     "dependencies": {
                         "minipass": {
                             "version": "2.9.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz",
-                            "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "safe-buffer": "^5.1.2",
                                 "yallist": "^3.0.0"
@@ -12795,12 +11397,7 @@
                 },
                 "parallel-transform": {
                     "version": "1.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz",
-                    "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "cyclist": "~0.2.2",
                         "inherits": "^2.0.3",
@@ -12809,12 +11406,7 @@
                     "dependencies": {
                         "readable-stream": {
                             "version": "2.3.6",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
-                            "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "core-util-is": "~1.0.0",
                                 "inherits": "~2.0.3",
@@ -12827,12 +11419,7 @@
                         },
                         "string_decoder": {
                             "version": "1.1.1",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
-                            "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "safe-buffer": "~5.1.0"
                             }
@@ -12841,60 +11428,6 @@
                 },
                 "path-exists": {
                     "version": "3.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
-                    "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU="
-                },
-                "path-is-absolute": {
-                    "version": "1.0.1",
-                    "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
-                    "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
-                },
-                "path-is-inside": {
-                    "version": "1.0.2",
-                    "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz",
-                    "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM="
-                },
-                "path-key": {
-                    "version": "2.0.1",
-                    "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
-                    "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A="
-                },
-                "path-parse": {
-                    "version": "1.0.6",
-                    "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
-                    "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw=="
-                },
-                "performance-now": {
-                    "version": "2.1.0",
-                    "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
-                    "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
-                },
-                "pify": {
-                    "version": "3.0.0",
-                    "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
-                    "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
-                },
-                "prepend-http": {
-                    "version": "1.0.4",
-                    "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz",
-                    "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw="
-                },
-                "process-nextick-args": {
-                    "version": "2.0.0",
-                    "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
-                    "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw=="
-                },
-                "promise-inflight": {
-                    "version": "1.0.1",
-                    "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz",
-                    "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM="
-                },
-                "promise-retry": {
-                    "version": "1.1.1",
-                    "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-1.1.1.tgz",
-                    "integrity": "sha1-ZznpaOMFHaIM5kl/srUPaRHfPW0=",
-=======
                     "bundled": true
                 },
                 "path-is-absolute": {
@@ -12936,7 +11469,6 @@
                 "promise-retry": {
                     "version": "1.1.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "err-code": "^1.0.0",
                         "retry": "^0.10.0"
@@ -12944,69 +11476,30 @@
                     "dependencies": {
                         "retry": {
                             "version": "0.10.1",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz",
-                            "integrity": "sha1-52OI0heZLCUnUCQdPTlW/tmNj/Q="
-=======
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
                 "promzard": {
                     "version": "0.3.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz",
-                    "integrity": "sha1-JqXW7ox97kyxIggwWs+5O6OCqe4=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "read": "1"
                     }
                 },
                 "proto-list": {
                     "version": "1.2.4",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz",
-                    "integrity": "sha1-IS1b/hMYMGpCD2QCuOJv85ZHqEk="
-                },
-                "protoduck": {
-                    "version": "5.0.1",
-                    "resolved": "https://registry.npmjs.org/protoduck/-/protoduck-5.0.1.tgz",
-                    "integrity": "sha512-WxoCeDCoCBY55BMvj4cAEjdVUFGRWed9ZxPlqTKYyw1nDDTQ4pqmnIMAGfJlg7Dx35uB/M+PHJPTmGOvaCaPTg==",
-=======
                     "bundled": true
                 },
                 "protoduck": {
                     "version": "5.0.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "genfun": "^5.0.0"
                     }
                 },
                 "prr": {
                     "version": "1.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
-                    "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY="
-                },
-                "pseudomap": {
-                    "version": "1.0.2",
-                    "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
-                    "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM="
-                },
-                "psl": {
-                    "version": "1.1.29",
-                    "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz",
-                    "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ=="
-                },
-                "pump": {
-                    "version": "3.0.0",
-                    "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
-                    "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
-=======
                     "bundled": true
                 },
                 "pseudomap": {
@@ -13020,7 +11513,6 @@
                 "pump": {
                     "version": "3.0.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "end-of-stream": "^1.1.0",
                         "once": "^1.3.1"
@@ -13028,12 +11520,7 @@
                 },
                 "pumpify": {
                     "version": "1.5.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz",
-                    "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "duplexify": "^3.6.0",
                         "inherits": "^2.0.3",
@@ -13042,12 +11529,7 @@
                     "dependencies": {
                         "pump": {
                             "version": "2.0.1",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz",
-                            "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "end-of-stream": "^1.1.0",
                                 "once": "^1.3.1"
@@ -13057,25 +11539,6 @@
                 },
                 "punycode": {
                     "version": "1.4.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
-                    "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4="
-                },
-                "qrcode-terminal": {
-                    "version": "0.12.0",
-                    "resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz",
-                    "integrity": "sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ=="
-                },
-                "qs": {
-                    "version": "6.5.2",
-                    "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
-                    "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
-                },
-                "query-string": {
-                    "version": "6.8.2",
-                    "resolved": "https://registry.npmjs.org/query-string/-/query-string-6.8.2.tgz",
-                    "integrity": "sha512-J3Qi8XZJXh93t2FiKyd/7Ec6GNifsjKXUsVFkSBj/kjLsDylWhnCz4NT1bkPcKotttPW+QbKGqqPH8OoI2pdqw==",
-=======
                     "bundled": true
                 },
                 "qrcode-terminal": {
@@ -13089,7 +11552,6 @@
                 "query-string": {
                     "version": "6.8.2",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "decode-uri-component": "^0.2.0",
                         "split-on-first": "^1.0.0",
@@ -13098,12 +11560,7 @@
                 },
                 "qw": {
                     "version": "1.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/qw/-/qw-1.0.1.tgz",
-                    "integrity": "sha1-77/cdA+a0FQwRCassYNBLMi5ltQ="
-=======
                     "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                 },
                 "rc": {
                     "version": "1.2.8",
@@ -13123,36 +11580,21 @@
                 },
                 "read": {
                     "version": "1.0.7",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz",
-                    "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "mute-stream": "~0.0.4"
                     }
                 },
                 "read-cmd-shim": {
                     "version": "1.0.5",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-1.0.5.tgz",
-                    "integrity": "sha512-v5yCqQ/7okKoZZkBQUAfTsQ3sVJtXdNfbPnI5cceppoxEVLYA3k+VtV2omkeo8MS94JCy4fSiUwlRBAwCVRPUA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "graceful-fs": "^4.1.2"
                     }
                 },
                 "read-installed": {
                     "version": "4.0.3",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/read-installed/-/read-installed-4.0.3.tgz",
-                    "integrity": "sha1-/5uLZ/GH0eTCm5/rMfayI6zRkGc=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "debuglog": "^1.0.1",
                         "graceful-fs": "^4.1.2",
@@ -13165,12 +11607,7 @@
                 },
                 "read-package-json": {
                     "version": "2.1.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.1.1.tgz",
-                    "integrity": "sha512-dAiqGtVc/q5doFz6096CcnXhpYk0ZN8dEKVkGLU0CsASt8SrgF6SF7OTKAYubfvFhWaqofl+Y8HK19GR8jwW+A==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "glob": "^7.1.1",
                         "graceful-fs": "^4.1.2",
@@ -13181,12 +11618,7 @@
                 },
                 "read-package-tree": {
                     "version": "5.3.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.3.1.tgz",
-                    "integrity": "sha512-mLUDsD5JVtlZxjSlPPx1RETkNjjvQYuweKwNVt1Sn8kP5Jh44pvYuUHCp6xSVDZWbNxVxG5lyZJ921aJH61sTw==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "read-package-json": "^2.0.0",
                         "readdir-scoped-modules": "^1.0.0",
@@ -13204,12 +11636,7 @@
                 },
                 "readdir-scoped-modules": {
                     "version": "1.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.1.0.tgz",
-                    "integrity": "sha512-asaikDeqAQg7JifRsZn1NJZXo9E+VwlyCfbkZhwyISinqk5zNS6266HS5kah6P0SaQKGF6SkNnZVHUzHFYxYDw==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "debuglog": "^1.0.1",
                         "dezalgo": "^1.0.0",
@@ -13227,24 +11654,14 @@
                 },
                 "registry-url": {
                     "version": "3.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz",
-                    "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "rc": "^1.0.1"
                     }
                 },
                 "request": {
                     "version": "2.88.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz",
-                    "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "aws-sign2": "~0.7.0",
                         "aws4": "^1.8.0",
@@ -13270,25 +11687,6 @@
                 },
                 "require-directory": {
                     "version": "2.1.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
-                    "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
-                },
-                "require-main-filename": {
-                    "version": "1.0.1",
-                    "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
-                    "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE="
-                },
-                "resolve-from": {
-                    "version": "4.0.0",
-                    "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
-                    "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="
-                },
-                "retry": {
-                    "version": "0.12.0",
-                    "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz",
-                    "integrity": "sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs="
-=======
                     "bundled": true
                 },
                 "require-main-filename": {
@@ -13302,7 +11700,6 @@
                 "retry": {
                     "version": "0.12.0",
                     "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                 },
                 "rimraf": {
                     "version": "2.7.1",
@@ -13313,48 +11710,19 @@
                 },
                 "run-queue": {
                     "version": "1.0.3",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz",
-                    "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "aproba": "^1.1.1"
                     },
                     "dependencies": {
                         "aproba": {
                             "version": "1.2.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
-                            "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw=="
-=======
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
                 "safe-buffer": {
                     "version": "5.1.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
-                    "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
-                },
-                "safer-buffer": {
-                    "version": "2.1.2",
-                    "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
-                    "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
-                },
-                "semver": {
-                    "version": "5.7.1",
-                    "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
-                    "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
-                },
-                "semver-diff": {
-                    "version": "2.1.0",
-                    "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz",
-                    "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=",
-=======
                     "bundled": true
                 },
                 "safer-buffer": {
@@ -13368,70 +11736,30 @@
                 "semver-diff": {
                     "version": "2.1.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "semver": "^5.0.3"
                     }
                 },
                 "set-blocking": {
                     "version": "2.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
-                    "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
-                },
-                "sha": {
-                    "version": "3.0.0",
-                    "resolved": "https://registry.npmjs.org/sha/-/sha-3.0.0.tgz",
-                    "integrity": "sha512-DOYnM37cNsLNSGIG/zZWch5CKIRNoLdYUQTQlcgkRkoYIUwDYjqDyye16YcDZg/OPdcbUgTKMjc4SY6TB7ZAPw==",
-=======
                     "bundled": true
                 },
                 "sha": {
                     "version": "3.0.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "graceful-fs": "^4.1.2"
                     }
                 },
                 "shebang-command": {
                     "version": "1.2.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
-                    "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "shebang-regex": "^1.0.0"
                     }
                 },
                 "shebang-regex": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
-                    "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM="
-                },
-                "signal-exit": {
-                    "version": "3.0.2",
-                    "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
-                    "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0="
-                },
-                "slide": {
-                    "version": "1.1.6",
-                    "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz",
-                    "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc="
-                },
-                "smart-buffer": {
-                    "version": "4.1.0",
-                    "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.1.0.tgz",
-                    "integrity": "sha512-iVICrxOzCynf/SNaBQCw34eM9jROU/s5rzIhpOvzhzuYHfJR/DhZfDkXiZSgKXfgv26HT3Yni3AV/DGw0cGnnw=="
-                },
-                "socks": {
-                    "version": "2.3.3",
-                    "resolved": "https://registry.npmjs.org/socks/-/socks-2.3.3.tgz",
-                    "integrity": "sha512-o5t52PCNtVdiOvzMry7wU4aOqYWL0PeCXRWBEiJow4/i/wr+wpsJQ9awEu1EonLIqsfGd5qSgDdxEOvCdmBEpA==",
-=======
                     "bundled": true
                 },
                 "signal-exit": {
@@ -13449,7 +11777,6 @@
                 "socks": {
                     "version": "2.3.3",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "ip": "1.1.5",
                         "smart-buffer": "^4.1.0"
@@ -13457,12 +11784,7 @@
                 },
                 "socks-proxy-agent": {
                     "version": "4.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-4.0.2.tgz",
-                    "integrity": "sha512-NT6syHhI9LmuEMSK6Kd2V7gNv5KFZoLE7V5udWmn0de+3Mkj3UMA/AJPLyeNUVmElCurSHtUdM3ETpR3z770Wg==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "agent-base": "~4.2.1",
                         "socks": "~2.3.2"
@@ -13470,12 +11792,7 @@
                     "dependencies": {
                         "agent-base": {
                             "version": "4.2.1",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz",
-                            "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "es6-promisify": "^5.0.0"
                             }
@@ -13484,21 +11801,11 @@
                 },
                 "sorted-object": {
                     "version": "2.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/sorted-object/-/sorted-object-2.0.1.tgz",
-                    "integrity": "sha1-fWMfS9OnmKJK8d/8+/6DM3pd9fw="
-                },
-                "sorted-union-stream": {
-                    "version": "2.1.3",
-                    "resolved": "https://registry.npmjs.org/sorted-union-stream/-/sorted-union-stream-2.1.3.tgz",
-                    "integrity": "sha1-x3lMfgd4gAUv9xqNSi27Sppjisc=",
-=======
                     "bundled": true
                 },
                 "sorted-union-stream": {
                     "version": "2.1.3",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "from2": "^1.3.0",
                         "stream-iterate": "^1.1.0"
@@ -13506,12 +11813,7 @@
                     "dependencies": {
                         "from2": {
                             "version": "1.3.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/from2/-/from2-1.3.0.tgz",
-                            "integrity": "sha1-iEE7qqX5pZfP3pIh2GmGzTwGHf0=",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "inherits": "~2.0.1",
                                 "readable-stream": "~1.1.10"
@@ -13519,21 +11821,11 @@
                         },
                         "isarray": {
                             "version": "0.0.1",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
-                            "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
-                        },
-                        "readable-stream": {
-                            "version": "1.1.14",
-                            "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
-                            "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
-=======
                             "bundled": true
                         },
                         "readable-stream": {
                             "version": "1.1.14",
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "core-util-is": "~1.0.0",
                                 "inherits": "~2.0.1",
@@ -13543,23 +11835,13 @@
                         },
                         "string_decoder": {
                             "version": "0.10.31",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
-                            "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
-=======
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
                 "spdx-correct": {
                     "version": "3.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz",
-                    "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "spdx-expression-parse": "^3.0.0",
                         "spdx-license-ids": "^3.0.0"
@@ -13567,21 +11849,11 @@
                 },
                 "spdx-exceptions": {
                     "version": "2.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz",
-                    "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg=="
-                },
-                "spdx-expression-parse": {
-                    "version": "3.0.0",
-                    "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
-                    "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
-=======
                     "bundled": true
                 },
                 "spdx-expression-parse": {
                     "version": "3.0.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "spdx-exceptions": "^2.1.0",
                         "spdx-license-ids": "^3.0.0"
@@ -13589,20 +11861,6 @@
                 },
                 "spdx-license-ids": {
                     "version": "3.0.3",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz",
-                    "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g=="
-                },
-                "split-on-first": {
-                    "version": "1.1.0",
-                    "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz",
-                    "integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw=="
-                },
-                "sshpk": {
-                    "version": "1.14.2",
-                    "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz",
-                    "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=",
-=======
                     "bundled": true
                 },
                 "split-on-first": {
@@ -13612,7 +11870,6 @@
                 "sshpk": {
                     "version": "1.14.2",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "asn1": "~0.2.3",
                         "assert-plus": "^1.0.0",
@@ -13627,24 +11884,14 @@
                 },
                 "ssri": {
                     "version": "6.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
-                    "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "figgy-pudding": "^3.5.1"
                     }
                 },
                 "stream-each": {
                     "version": "1.2.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.2.tgz",
-                    "integrity": "sha512-mc1dbFhGBxvTM3bIWmAAINbqiuAk9TATcfIQC8P+/+HJefgaiTlMn2dHvkX8qlI12KeYKSQ1Ua9RrIqrn1VPoA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "end-of-stream": "^1.1.0",
                         "stream-shift": "^1.0.0"
@@ -13652,12 +11899,7 @@
                 },
                 "stream-iterate": {
                     "version": "1.2.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/stream-iterate/-/stream-iterate-1.2.0.tgz",
-                    "integrity": "sha1-K9fHcpbBcCpGSIuK1B95hl7s1OE=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "readable-stream": "^2.1.5",
                         "stream-shift": "^1.0.0"
@@ -13665,12 +11907,7 @@
                     "dependencies": {
                         "readable-stream": {
                             "version": "2.3.6",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
-                            "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "core-util-is": "~1.0.0",
                                 "inherits": "~2.0.3",
@@ -13683,12 +11920,7 @@
                         },
                         "string_decoder": {
                             "version": "1.1.1",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
-                            "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "safe-buffer": "~5.1.0"
                             }
@@ -13697,20 +11929,6 @@
                 },
                 "stream-shift": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz",
-                    "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI="
-                },
-                "strict-uri-encode": {
-                    "version": "2.0.0",
-                    "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz",
-                    "integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY="
-                },
-                "string-width": {
-                    "version": "2.1.1",
-                    "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
-                    "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
-=======
                     "bundled": true
                 },
                 "strict-uri-encode": {
@@ -13720,7 +11938,6 @@
                 "string-width": {
                     "version": "2.1.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "is-fullwidth-code-point": "^2.0.0",
                         "strip-ansi": "^4.0.0"
@@ -13728,20 +11945,6 @@
                     "dependencies": {
                         "ansi-regex": {
                             "version": "3.0.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
-                            "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg="
-                        },
-                        "is-fullwidth-code-point": {
-                            "version": "2.0.0",
-                            "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
-                            "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8="
-                        },
-                        "strip-ansi": {
-                            "version": "4.0.0",
-                            "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
-                            "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
-=======
                             "bundled": true
                         },
                         "is-fullwidth-code-point": {
@@ -13751,7 +11954,6 @@
                         "strip-ansi": {
                             "version": "4.0.0",
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "ansi-regex": "^3.0.0"
                             }
@@ -13773,41 +11975,17 @@
                 },
                 "stringify-package": {
                     "version": "1.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/stringify-package/-/stringify-package-1.0.1.tgz",
-                    "integrity": "sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg=="
-                },
-                "strip-ansi": {
-                    "version": "3.0.1",
-                    "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
-                    "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
-=======
                     "bundled": true
                 },
                 "strip-ansi": {
                     "version": "3.0.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "ansi-regex": "^2.0.0"
                     }
                 },
                 "strip-eof": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
-                    "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8="
-                },
-                "strip-json-comments": {
-                    "version": "2.0.1",
-                    "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
-                    "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo="
-                },
-                "supports-color": {
-                    "version": "5.4.0",
-                    "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
-                    "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
-=======
                     "bundled": true
                 },
                 "strip-json-comments": {
@@ -13817,19 +11995,13 @@
                 "supports-color": {
                     "version": "5.4.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "has-flag": "^3.0.0"
                     }
                 },
                 "tar": {
                     "version": "4.4.13",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz",
-                    "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "chownr": "^1.1.1",
                         "fs-minipass": "^1.2.5",
@@ -13842,12 +12014,7 @@
                     "dependencies": {
                         "minipass": {
                             "version": "2.9.0",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz",
-                            "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "safe-buffer": "^5.1.2",
                                 "yallist": "^3.0.0"
@@ -13857,32 +12024,13 @@
                 },
                 "term-size": {
                     "version": "1.2.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz",
-                    "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "execa": "^0.7.0"
                     }
                 },
                 "text-table": {
                     "version": "0.2.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
-                    "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ="
-                },
-                "through": {
-                    "version": "2.3.8",
-                    "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
-                    "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU="
-                },
-                "through2": {
-                    "version": "2.0.3",
-                    "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz",
-                    "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=",
-=======
                     "bundled": true
                 },
                 "through": {
@@ -13892,7 +12040,6 @@
                 "through2": {
                     "version": "2.0.3",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "readable-stream": "^2.1.5",
                         "xtend": "~4.0.1"
@@ -13900,12 +12047,7 @@
                     "dependencies": {
                         "readable-stream": {
                             "version": "2.3.6",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
-                            "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "core-util-is": "~1.0.0",
                                 "inherits": "~2.0.3",
@@ -13918,12 +12060,7 @@
                         },
                         "string_decoder": {
                             "version": "1.1.1",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
-                            "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "safe-buffer": "~5.1.0"
                             }
@@ -13932,20 +12069,6 @@
                 },
                 "timed-out": {
                     "version": "4.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz",
-                    "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8="
-                },
-                "tiny-relative-date": {
-                    "version": "1.3.0",
-                    "resolved": "https://registry.npmjs.org/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz",
-                    "integrity": "sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A=="
-                },
-                "tough-cookie": {
-                    "version": "2.4.3",
-                    "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
-                    "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
-=======
                     "bundled": true
                 },
                 "tiny-relative-date": {
@@ -13955,7 +12078,6 @@
                 "tough-cookie": {
                     "version": "2.4.3",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "psl": "^1.1.24",
                         "punycode": "^1.4.1"
@@ -13963,47 +12085,18 @@
                 },
                 "tunnel-agent": {
                     "version": "0.6.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
-                    "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "safe-buffer": "^5.0.1"
                     }
                 },
                 "tweetnacl": {
                     "version": "0.14.5",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
-                    "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "optional": true
                 },
                 "typedarray": {
                     "version": "0.0.6",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
-                    "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
-                },
-                "uid-number": {
-                    "version": "0.0.6",
-                    "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz",
-                    "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE="
-                },
-                "umask": {
-                    "version": "1.1.0",
-                    "resolved": "https://registry.npmjs.org/umask/-/umask-1.1.0.tgz",
-                    "integrity": "sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0="
-                },
-                "unique-filename": {
-                    "version": "1.1.1",
-                    "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz",
-                    "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==",
-=======
                     "bundled": true
                 },
                 "uid-number": {
@@ -14017,51 +12110,26 @@
                 "unique-filename": {
                     "version": "1.1.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "unique-slug": "^2.0.0"
                     }
                 },
                 "unique-slug": {
                     "version": "2.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.0.tgz",
-                    "integrity": "sha1-22Z258fMBimHj/GWCXx4hVrp9Ks=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "imurmurhash": "^0.1.4"
                     }
                 },
                 "unique-string": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz",
-                    "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "crypto-random-string": "^1.0.0"
                     }
                 },
                 "unpipe": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
-                    "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
-                },
-                "unzip-response": {
-                    "version": "2.0.1",
-                    "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz",
-                    "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c="
-                },
-                "update-notifier": {
-                    "version": "2.5.0",
-                    "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz",
-                    "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==",
-=======
                     "bundled": true
                 },
                 "unzip-response": {
@@ -14071,7 +12139,6 @@
                 "update-notifier": {
                     "version": "2.5.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "boxen": "^1.2.1",
                         "chalk": "^2.0.1",
@@ -14087,32 +12154,13 @@
                 },
                 "url-parse-lax": {
                     "version": "1.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz",
-                    "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "prepend-http": "^1.0.1"
                     }
                 },
                 "util-deprecate": {
                     "version": "1.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
-                    "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
-                },
-                "util-extend": {
-                    "version": "1.0.3",
-                    "resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.3.tgz",
-                    "integrity": "sha1-p8IW0mdUUWljeztu3GypEZ4v+T8="
-                },
-                "util-promisify": {
-                    "version": "2.1.0",
-                    "resolved": "https://registry.npmjs.org/util-promisify/-/util-promisify-2.1.0.tgz",
-                    "integrity": "sha1-PCI2R2xNMsX/PEcAKt18E7moKlM=",
-=======
                     "bundled": true
                 },
                 "util-extend": {
@@ -14122,28 +12170,17 @@
                 "util-promisify": {
                     "version": "2.1.0",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "object.getownpropertydescriptors": "^2.0.3"
                     }
                 },
                 "uuid": {
                     "version": "3.3.3",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
-                    "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ=="
-                },
-                "validate-npm-package-license": {
-                    "version": "3.0.4",
-                    "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
-                    "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
-=======
                     "bundled": true
                 },
                 "validate-npm-package-license": {
                     "version": "3.0.4",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "spdx-correct": "^3.0.0",
                         "spdx-expression-parse": "^3.0.0"
@@ -14151,24 +12188,14 @@
                 },
                 "validate-npm-package-name": {
                     "version": "3.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz",
-                    "integrity": "sha1-X6kS2B630MdK/BQN5zF/DKffQ34=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "builtins": "^1.0.3"
                     }
                 },
                 "verror": {
                     "version": "1.10.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
-                    "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "assert-plus": "^1.0.0",
                         "core-util-is": "1.0.2",
@@ -14177,57 +12204,32 @@
                 },
                 "wcwidth": {
                     "version": "1.0.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz",
-                    "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "defaults": "^1.0.3"
                     }
                 },
                 "which": {
                     "version": "1.3.1",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
-                    "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "isexe": "^2.0.0"
                     }
                 },
                 "which-module": {
                     "version": "2.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
-                    "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="
-                },
-                "wide-align": {
-                    "version": "1.1.2",
-                    "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz",
-                    "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==",
-=======
                     "bundled": true
                 },
                 "wide-align": {
                     "version": "1.1.2",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "string-width": "^1.0.2"
                     },
                     "dependencies": {
                         "string-width": {
                             "version": "1.0.2",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
-                            "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "code-point-at": "^1.0.0",
                                 "is-fullwidth-code-point": "^1.0.0",
@@ -14245,24 +12247,14 @@
                 },
                 "worker-farm": {
                     "version": "1.7.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz",
-                    "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "errno": "~0.1.7"
                     }
                 },
                 "wrap-ansi": {
                     "version": "2.1.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
-                    "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "string-width": "^1.0.1",
                         "strip-ansi": "^3.0.1"
@@ -14270,12 +12262,7 @@
                     "dependencies": {
                         "string-width": {
                             "version": "1.0.2",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
-                            "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
-=======
                             "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                             "requires": {
                                 "code-point-at": "^1.0.0",
                                 "is-fullwidth-code-point": "^1.0.0",
@@ -14286,21 +12273,11 @@
                 },
                 "wrappy": {
                     "version": "1.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
-                    "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
-                },
-                "write-file-atomic": {
-                    "version": "2.4.3",
-                    "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz",
-                    "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==",
-=======
                     "bundled": true
                 },
                 "write-file-atomic": {
                     "version": "2.4.3",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "graceful-fs": "^4.1.11",
                         "imurmurhash": "^0.1.4",
@@ -14309,30 +12286,6 @@
                 },
                 "xdg-basedir": {
                     "version": "3.0.0",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz",
-                    "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ="
-                },
-                "xtend": {
-                    "version": "4.0.1",
-                    "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
-                    "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68="
-                },
-                "y18n": {
-                    "version": "4.0.0",
-                    "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
-                    "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w=="
-                },
-                "yallist": {
-                    "version": "3.0.3",
-                    "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz",
-                    "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A=="
-                },
-                "yargs": {
-                    "version": "11.1.1",
-                    "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.1.tgz",
-                    "integrity": "sha512-PRU7gJrJaXv3q3yQZ/+/X6KBswZiaQ+zOmdprZcouPYtQgvNU35i+68M4b1ZHLZtYFT5QObFLV+ZkmJYcwKdiw==",
-=======
                     "bundled": true
                 },
                 "xtend": {
@@ -14350,7 +12303,6 @@
                 "yargs": {
                     "version": "11.1.1",
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "cliui": "^4.0.0",
                         "decamelize": "^1.1.1",
@@ -14368,23 +12320,13 @@
                     "dependencies": {
                         "y18n": {
                             "version": "3.2.1",
-<<<<<<< HEAD
-                            "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
-                            "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
-=======
                             "bundled": true
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                         }
                     }
                 },
                 "yargs-parser": {
                     "version": "9.0.2",
-<<<<<<< HEAD
-                    "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz",
-                    "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=",
-=======
                     "bundled": true,
->>>>>>> 99d2b19dba130353ac3b021bc7eab079bb125408
                     "requires": {
                         "camelcase": "^4.1.0"
                     }
@@ -14514,7 +12456,6 @@
             "version": "1.1.2",
             "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.2.tgz",
             "integrity": "sha512-5lHCz+0uufF6wZ7CRFWJN3hp8Jqblpgve06U5CMQ3f//6iDjPr2PEo9MWCjEssDsa+UZEL4PkFpr+BMop6aKzQ==",
-            "dev": true,
             "requires": {
                 "define-properties": "^1.1.3",
                 "es-abstract": "^1.17.5"
@@ -15129,6 +13070,11 @@
             "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==",
             "dev": true
         },
+        "popper.js": {
+            "version": "1.16.1",
+            "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.16.1.tgz",
+            "integrity": "sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ=="
+        },
         "portfinder": {
             "version": "1.0.26",
             "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.26.tgz",
@@ -15866,6 +13812,18 @@
                 "warning": "^3.0.0"
             }
         },
+        "react-datepicker": {
+            "version": "3.0.0",
+            "resolved": "https://registry.npmjs.org/react-datepicker/-/react-datepicker-3.0.0.tgz",
+            "integrity": "sha512-Yrxan1tERAiWS0EzitpiaiXOIz0APTUtV75uWbaS+jSaKoGCR6wUN2FDwr1ACGlnEoGhR9QQ2Vq3odnWtgJsOA==",
+            "requires": {
+                "classnames": "^2.2.6",
+                "date-fns": "^2.0.1",
+                "prop-types": "^15.7.2",
+                "react-onclickoutside": "^6.9.0",
+                "react-popper": "^1.3.4"
+            }
+        },
         "react-dock": {
             "version": "0.2.4",
             "resolved": "https://registry.npmjs.org/react-dock/-/react-dock-0.2.4.tgz",
@@ -15991,6 +13949,44 @@
                 }
             }
         },
+        "react-onclickoutside": {
+            "version": "6.9.0",
+            "resolved": "https://registry.npmjs.org/react-onclickoutside/-/react-onclickoutside-6.9.0.tgz",
+            "integrity": "sha512-8ltIY3bC7oGhj2nPAvWOGi+xGFybPNhJM0V1H8hY/whNcXgmDeaeoCMPPd8VatrpTsUWjb/vGzrmu6SrXVty3A=="
+        },
+        "react-popper": {
+            "version": "1.3.7",
+            "resolved": "https://registry.npmjs.org/react-popper/-/react-popper-1.3.7.tgz",
+            "integrity": "sha512-nmqYTx7QVjCm3WUZLeuOomna138R1luC4EqkW3hxJUrAe+3eNz3oFCLYdnPwILfn0mX1Ew2c3wctrjlUMYYUww==",
+            "requires": {
+                "@babel/runtime": "^7.1.2",
+                "create-react-context": "^0.3.0",
+                "deep-equal": "^1.1.1",
+                "popper.js": "^1.14.4",
+                "prop-types": "^15.6.1",
+                "typed-styles": "^0.0.7",
+                "warning": "^4.0.2"
+            },
+            "dependencies": {
+                "create-react-context": {
+                    "version": "0.3.0",
+                    "resolved": "https://registry.npmjs.org/create-react-context/-/create-react-context-0.3.0.tgz",
+                    "integrity": "sha512-dNldIoSuNSvlTJ7slIKC/ZFGKexBMBrrcc+TTe1NdmROnaASuLPvqpwj9v4XS4uXZ8+YPu0sNmShX2rXI5LNsw==",
+                    "requires": {
+                        "gud": "^1.0.0",
+                        "warning": "^4.0.3"
+                    }
+                },
+                "warning": {
+                    "version": "4.0.3",
+                    "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz",
+                    "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==",
+                    "requires": {
+                        "loose-envify": "^1.0.0"
+                    }
+                }
+            }
+        },
         "react-resizable": {
             "version": "1.10.1",
             "resolved": "https://registry.npmjs.org/react-resizable/-/react-resizable-1.10.1.tgz",
@@ -16185,7 +14181,6 @@
             "version": "1.3.0",
             "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz",
             "integrity": "sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==",
-            "dev": true,
             "requires": {
                 "define-properties": "^1.1.3",
                 "es-abstract": "^1.17.0-next.1"
@@ -18518,6 +16513,11 @@
                 "mime-types": "~2.1.24"
             }
         },
+        "typed-styles": {
+            "version": "0.0.7",
+            "resolved": "https://registry.npmjs.org/typed-styles/-/typed-styles-0.0.7.tgz",
+            "integrity": "sha512-pzP0PWoZUhsECYjABgCGQlRGL1n7tOHsgwYv3oIiEpJwGhFTuty/YNeduxQYzXXa3Ge5BdT6sHYIQYpl4uJ+5Q=="
+        },
         "typedarray": {
             "version": "0.0.6",
             "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
diff --git a/package.json b/package.json
index 683f181c3..fa0f6d425 100644
--- a/package.json
+++ b/package.json
@@ -66,6 +66,7 @@
         "@types/react": "^16.9.41",
         "@types/react-autosuggest": "^9.3.14",
         "@types/react-color": "^2.17.4",
+        "@types/react-datepicker": "^3.0.2",
         "@types/react-dom": "^16.9.8",
         "@types/react-grid-layout": "^0.17.1",
         "@types/react-measure": "^2.0.6",
@@ -210,6 +211,7 @@
         "react-autosuggest": "^9.4.3",
         "react-color": "^2.18.1",
         "react-compound-slider": "^2.5.0",
+        "react-datepicker": "^3.0.0",
         "react-dom": "^16.12.0",
         "react-grid-layout": "^0.18.3",
         "react-image-lightbox-with-rotate": "^5.1.1",
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index 593962e73..0a2c538c2 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -16,7 +16,7 @@ import { EditableView } from "../EditableView";
 import { FieldView, FieldViewProps } from "../nodes/FieldView";
 import "./CollectionSchemaView.scss";
 import { CollectionView, Flyout } from "./CollectionView";
-import { NumCast, StrCast, BoolCast, FieldValue, Cast } from "../../../fields/Types";
+import { NumCast, StrCast, BoolCast, FieldValue, Cast, DateCast } from "../../../fields/Types";
 import { Docs } from "../../documents/Documents";
 import { library } from '@fortawesome/fontawesome-svg-core';
 import { faExpand } from '@fortawesome/free-solid-svg-icons';
@@ -32,6 +32,8 @@ import { DocumentIconContainer } from "../nodes/DocumentIcon";
 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
 import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView";
 import ReactDOM from "react-dom";
+import DatePicker from "react-datepicker";
+import "react-datepicker/dist/react-datepicker.css";
 const path = require('path');
 
 library.add(faExpand);
@@ -225,6 +227,9 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
         if (type === "list") {
             contents = typeof field === "object" ? doc ? StrCast(field) === "" ? "--" : StrCast(field) : `--${typeof field}--` : `--${typeof field}--`;
         }
+        if (type === "date") {
+            contents = typeof field === "object" ? doc ? StrCast(field) === "" ? "--" : StrCast(field) : `--${typeof field}--` : `--${typeof field}--`;
+        }
 
 
         let className = "collectionSchemaView-cellWrapper";
@@ -340,6 +345,48 @@ export class CollectionSchemaStringCell extends CollectionSchemaCell {
     }
 }
 
+@observer
+export class CollectionSchemaDateCell extends CollectionSchemaCell {
+    private prop: FieldViewProps = {
+        Document: this.props.rowProps.original,
+        DataDoc: this.props.rowProps.original,
+        LibraryPath: [],
+        dropAction: "alias",
+        bringToFront: emptyFunction,
+        rootSelected: returnFalse,
+        fieldKey: this.props.rowProps.column.id as string,
+        ContainingCollectionView: this.props.CollectionView,
+        ContainingCollectionDoc: this.props.CollectionView && this.props.CollectionView.props.Document,
+        isSelected: returnFalse,
+        select: emptyFunction,
+        renderDepth: this.props.renderDepth + 1,
+        ScreenToLocalTransform: Transform.Identity,
+        focus: emptyFunction,
+        active: returnFalse,
+        whenActiveChanged: emptyFunction,
+        PanelHeight: returnZero,
+        PanelWidth: returnZero,
+        NativeHeight: returnZero,
+        NativeWidth: returnZero,
+        addDocTab: this.props.addDocTab,
+        pinToPres: this.props.pinToPres,
+        ContentScaling: returnOne,
+        docFilters: returnEmptyFilter
+    };
+    @observable private _field = this.prop.Document[this.prop.fieldKey];
+
+    handleChange = (date: any) => {
+        this.prop.Document[this.prop.fieldKey] = date;
+    }
+
+    render() {
+        return <DatePicker
+            selected={Cast(this.prop.Document[this.prop.fieldKey], Date)}
+            onChange={this.handleChange}
+        />;
+    }
+}
+
 @observer
 export class CollectionSchemaDocCell extends CollectionSchemaCell {
 
diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx
index 80c265ba6..fc7c2400d 100644
--- a/src/client/views/collections/CollectionSchemaHeaders.tsx
+++ b/src/client/views/collections/CollectionSchemaHeaders.tsx
@@ -2,7 +2,7 @@ import React = require("react");
 import { action, observable } from "mobx";
 import { observer } from "mobx-react";
 import "./CollectionSchemaView.scss";
-import { faPlus, faFont, faHashtag, faAlignJustify, faCheckSquare, faToggleOn, faSortAmountDown, faSortAmountUp, faTimes, faImage, faListUl } from '@fortawesome/free-solid-svg-icons';
+import { faPlus, faFont, faHashtag, faAlignJustify, faCheckSquare, faToggleOn, faSortAmountDown, faSortAmountUp, faTimes, faImage, faListUl, faCalendar } from '@fortawesome/free-solid-svg-icons';
 import { library, IconProp } from "@fortawesome/fontawesome-svg-core";
 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
 import { ColumnType } from "./CollectionSchemaView";
@@ -13,7 +13,7 @@ const higflyout = require("@hig/flyout");
 export const { anchorPoints } = higflyout;
 export const Flyout = higflyout.default;
 
-library.add(faPlus, faFont, faHashtag, faAlignJustify, faCheckSquare, faToggleOn, faFile as any, faSortAmountDown, faSortAmountUp, faTimes, faImage, faListUl);
+library.add(faPlus, faFont, faHashtag, faAlignJustify, faCheckSquare, faToggleOn, faFile as any, faSortAmountDown, faSortAmountUp, faTimes, faImage, faListUl, faCalendar);
 
 export interface HeaderProps {
     keyValue: SchemaHeaderField;
@@ -34,7 +34,8 @@ export class CollectionSchemaHeader extends React.Component<HeaderProps> {
     render() {
         const icon: IconProp = this.props.keyType === ColumnType.Number ? "hashtag" : this.props.keyType === ColumnType.String ? "font" :
             this.props.keyType === ColumnType.Boolean ? "check-square" : this.props.keyType === ColumnType.Doc ? "file" :
-                this.props.keyType === ColumnType.Image ? "image" : this.props.keyType === ColumnType.List ? "list-ul" : "align-justify";
+                this.props.keyType === ColumnType.Image ? "image" : this.props.keyType === ColumnType.List ? "list-ul" : this.props.keyType === ColumnType.Date ? "calendar" :
+                    "align-justify";
         return (
             <div className="collectionSchemaView-header" style={{ background: this.props.keyValue.color }}>
                 <CollectionSchemaColumnMenu
@@ -183,6 +184,10 @@ export class CollectionSchemaColumnMenu extends React.Component<ColumnMenuProps>
                         <FontAwesomeIcon icon={"image"} size="sm" />
                         Image
                     </div>
+                    <div className={"columnMenu-option" + (type === ColumnType.Date ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Date)}>
+                        <FontAwesomeIcon icon={"calendar"} size="sm" />
+                        Date
+                    </div>
                 </div>
             </div >
         );
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index bfd5fa96f..7e8455149 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -37,7 +37,8 @@ export enum ColumnType {
     Boolean,
     Doc,
     Image,
-    List
+    List,
+    Date
 }
 // this map should be used for keys that should have a const type of value
 const columnTypes: Map<string, ColumnType> = new Map([
@@ -225,6 +226,11 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
             Image
             </div>;
 
+        const dateType = <div className={"columnMenu-option" + (type === ColumnType.Date ? " active" : "")} onClick={() => this.changeColumnType(ColumnType.Date, col)}>
+            <FontAwesomeIcon icon={"calendar"} size="sm" />
+                Date
+                </div>;
+
 
         const allColumnTypes = <div className="columnMenu-types">
             {anyType}
@@ -234,11 +240,13 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
             {listType}
             {docType}
             {imageType}
+            {dateType}
         </div>;
 
         const justColType = type === ColumnType.Any ? anyType : type === ColumnType.Number ? numType :
             type === ColumnType.String ? textType : type === ColumnType.Boolean ? boolType :
-                type === ColumnType.List ? listType : type === ColumnType.Doc ? docType : imageType;
+                type === ColumnType.List ? listType : type === ColumnType.Doc ? docType :
+                    type === ColumnType.Date ? dateType : imageType;
 
         return (
             <div className="collectionSchema-headerMenu-group">
diff --git a/src/client/views/collections/SchemaTable.tsx b/src/client/views/collections/SchemaTable.tsx
index 176091661..eb0d234c0 100644
--- a/src/client/views/collections/SchemaTable.tsx
+++ b/src/client/views/collections/SchemaTable.tsx
@@ -19,7 +19,7 @@ import { undoBatch } from "../../util/UndoManager";
 import { COLLECTION_BORDER_WIDTH } from '../../views/globalCssVariables.scss';
 import { ContextMenu } from "../ContextMenu";
 import '../DocumentDecorations.scss';
-import { CellProps, CollectionSchemaCell, CollectionSchemaCheckboxCell, CollectionSchemaDocCell, CollectionSchemaNumberCell, CollectionSchemaStringCell, CollectionSchemaImageCell, CollectionSchemaListCell } from "./CollectionSchemaCells";
+import { CellProps, CollectionSchemaCell, CollectionSchemaCheckboxCell, CollectionSchemaDocCell, CollectionSchemaNumberCell, CollectionSchemaStringCell, CollectionSchemaImageCell, CollectionSchemaListCell, CollectionSchemaDateCell } from "./CollectionSchemaCells";
 import { CollectionSchemaAddColumnHeader, KeysDropdown } from "./CollectionSchemaHeaders";
 import { MovableColumn, MovableRow } from "./CollectionSchemaMovableTableHOC";
 import "./CollectionSchemaView.scss";
@@ -36,7 +36,8 @@ enum ColumnType {
     Boolean,
     Doc,
     Image,
-    List
+    List,
+    Date
 }
 
 // this map should be used for keys that should have a const type of value
@@ -195,7 +196,8 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
 
             const icon: IconProp = this.getColumnType(col) === ColumnType.Number ? "hashtag" : this.getColumnType(col) === ColumnType.String ? "font" :
                 this.getColumnType(col) === ColumnType.Boolean ? "check-square" : this.getColumnType(col) === ColumnType.Doc ? "file" :
-                    this.getColumnType(col) === ColumnType.Image ? "image" : this.getColumnType(col) === ColumnType.List ? "list-ul" : "align-justify";
+                    this.getColumnType(col) === ColumnType.Image ? "image" : this.getColumnType(col) === ColumnType.List ? "list-ul" :
+                        this.getColumnType(col) === ColumnType.Date ? "calendar" : "align-justify";
 
             const headerText = this._showTitleDropdown ? keysDropdown : <div
                 onClick={this.changeTitleMode}
@@ -270,6 +272,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
                     if (colType === ColumnType.Doc) return <CollectionSchemaDocCell {...props} />;
                     if (colType === ColumnType.Image) return <CollectionSchemaImageCell {...props} />;
                     if (colType === ColumnType.List) return <CollectionSchemaListCell {...props} />;
+                    if (colType === ColumnType.Date) return <CollectionSchemaDateCell {...props} />;
                     return <CollectionSchemaCell {...props} />;
                 },
                 minWidth: 200,
-- 
cgit v1.2.3-70-g09d2


From 85311e4096a3e3842d0f8a9f39e7436401455aa3 Mon Sep 17 00:00:00 2001
From: Bob Zeleznik <zzzman@gmail.com>
Date: Sun, 28 Jun 2020 16:52:17 -0400
Subject: fixed drop down menus in schema collection view menu

---
 package-lock.json                                  |  44 +++------
 .../views/collections/CollectionSchemaCells.tsx    |   4 -
 .../views/collections/CollectionSchemaView.scss    |  38 ++++----
 .../views/collections/CollectionSchemaView.tsx     | 108 ++++-----------------
 4 files changed, 52 insertions(+), 142 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/package-lock.json b/package-lock.json
index 6c364530b..735cff1a6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2946,8 +2946,7 @@
                         },
                         "ansi-regex": {
                             "version": "2.1.1",
-                            "bundled": true,
-                            "optional": true
+                            "bundled": true
                         },
                         "aproba": {
                             "version": "1.2.0",
@@ -2965,13 +2964,11 @@
                         },
                         "balanced-match": {
                             "version": "1.0.0",
-                            "bundled": true,
-                            "optional": true
+                            "bundled": true
                         },
                         "brace-expansion": {
                             "version": "1.1.11",
                             "bundled": true,
-                            "optional": true,
                             "requires": {
                                 "balanced-match": "^1.0.0",
                                 "concat-map": "0.0.1"
@@ -2984,18 +2981,15 @@
                         },
                         "code-point-at": {
                             "version": "1.1.0",
-                            "bundled": true,
-                            "optional": true
+                            "bundled": true
                         },
                         "concat-map": {
                             "version": "0.0.1",
-                            "bundled": true,
-                            "optional": true
+                            "bundled": true
                         },
                         "console-control-strings": {
                             "version": "1.1.0",
-                            "bundled": true,
-                            "optional": true
+                            "bundled": true
                         },
                         "core-util-is": {
                             "version": "1.0.2",
@@ -3098,8 +3092,7 @@
                         },
                         "inherits": {
                             "version": "2.0.4",
-                            "bundled": true,
-                            "optional": true
+                            "bundled": true
                         },
                         "ini": {
                             "version": "1.3.5",
@@ -3109,7 +3102,6 @@
                         "is-fullwidth-code-point": {
                             "version": "1.0.0",
                             "bundled": true,
-                            "optional": true,
                             "requires": {
                                 "number-is-nan": "^1.0.0"
                             }
@@ -3122,20 +3114,17 @@
                         "minimatch": {
                             "version": "3.0.4",
                             "bundled": true,
-                            "optional": true,
                             "requires": {
                                 "brace-expansion": "^1.1.7"
                             }
                         },
                         "minimist": {
                             "version": "1.2.5",
-                            "bundled": true,
-                            "optional": true
+                            "bundled": true
                         },
                         "minipass": {
                             "version": "2.9.0",
                             "bundled": true,
-                            "optional": true,
                             "requires": {
                                 "safe-buffer": "^5.1.2",
                                 "yallist": "^3.0.0"
@@ -3152,7 +3141,6 @@
                         "mkdirp": {
                             "version": "0.5.3",
                             "bundled": true,
-                            "optional": true,
                             "requires": {
                                 "minimist": "^1.2.5"
                             }
@@ -3208,8 +3196,7 @@
                         },
                         "npm-normalize-package-bin": {
                             "version": "1.0.1",
-                            "bundled": true,
-                            "optional": true
+                            "bundled": true
                         },
                         "npm-packlist": {
                             "version": "1.4.8",
@@ -3234,8 +3221,7 @@
                         },
                         "number-is-nan": {
                             "version": "1.0.1",
-                            "bundled": true,
-                            "optional": true
+                            "bundled": true
                         },
                         "object-assign": {
                             "version": "4.1.1",
@@ -3245,7 +3231,6 @@
                         "once": {
                             "version": "1.4.0",
                             "bundled": true,
-                            "optional": true,
                             "requires": {
                                 "wrappy": "1"
                             }
@@ -3314,8 +3299,7 @@
                         },
                         "safe-buffer": {
                             "version": "5.1.2",
-                            "bundled": true,
-                            "optional": true
+                            "bundled": true
                         },
                         "safer-buffer": {
                             "version": "2.1.2",
@@ -3345,7 +3329,6 @@
                         "string-width": {
                             "version": "1.0.2",
                             "bundled": true,
-                            "optional": true,
                             "requires": {
                                 "code-point-at": "^1.0.0",
                                 "is-fullwidth-code-point": "^1.0.0",
@@ -3363,7 +3346,6 @@
                         "strip-ansi": {
                             "version": "3.0.1",
                             "bundled": true,
-                            "optional": true,
                             "requires": {
                                 "ansi-regex": "^2.0.0"
                             }
@@ -3402,13 +3384,11 @@
                         },
                         "wrappy": {
                             "version": "1.0.2",
-                            "bundled": true,
-                            "optional": true
+                            "bundled": true
                         },
                         "yallist": {
                             "version": "3.1.1",
-                            "bundled": true,
-                            "optional": true
+                            "bundled": true
                         }
                     }
                 }
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index 0026ab927..034ba27cf 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -26,15 +26,11 @@ import { SnappingManager } from "../../util/SnappingManager";
 import { ComputedField } from "../../../fields/ScriptField";
 import { ImageField } from "../../../fields/URLField";
 import { List } from "../../../fields/List";
-import { LinkBox } from "../nodes/LinkBox";
 import { OverlayView } from "../OverlayView";
 import { DocumentIconContainer } from "../nodes/DocumentIcon";
 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView";
-import ReactDOM from "react-dom";
 import DatePicker from "react-datepicker";
 import "react-datepicker/dist/react-datepicker.css";
-import { DateField } from "../../../fields/DateField";
 const path = require('path');
 
 library.add(faExpand);
diff --git a/src/client/views/collections/CollectionSchemaView.scss b/src/client/views/collections/CollectionSchemaView.scss
index fa1f01448..2330fcc8a 100644
--- a/src/client/views/collections/CollectionSchemaView.scss
+++ b/src/client/views/collections/CollectionSchemaView.scss
@@ -177,6 +177,26 @@
 }
 
 
+.collectionSchema-header-menu {
+    height: 100%;
+    z-index: 100;
+    position: absolute;
+    background:white;
+
+    .collectionSchema-header-toggler {
+        z-index: 100;
+        width: 100%;
+        height: 100%;
+        padding: 4px;
+        letter-spacing: 2px;
+        text-transform: uppercase;
+
+        svg {
+            margin-right: 4px;
+        }
+    }
+}
+
 .collectionSchemaView-header {
     height: 100%;
     color: gray;
@@ -185,24 +205,6 @@
     display: flex;
     justify-content: space-between;
     flex-wrap: wrap;
-
-    .collectionSchema-header-menu {
-        height: 100%;
-        z-index: 100;
-
-        .collectionSchema-header-toggler {
-            z-index: 100;
-            width: 100%;
-            height: 100%;
-            padding: 4px;
-            letter-spacing: 2px;
-            text-transform: uppercase;
-
-            svg {
-                margin-right: 4px;
-            }
-        }
-    }
 }
 
 button.add-column {
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 7e8455149..857d8cb50 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -11,7 +11,6 @@ import { List } from "../../../fields/List";
 import { listSpec } from "../../../fields/Schema";
 import { SchemaHeaderField, PastelSchemaPalette } from "../../../fields/SchemaHeaderField";
 import { Cast, NumCast, StrCast } from "../../../fields/Types";
-import { Docs, DocumentOptions } from "../../documents/Documents";
 import { Transform } from "../../util/Transform";
 import { undoBatch } from "../../util/UndoManager";
 import { COLLECTION_BORDER_WIDTH } from '../../views/globalCssVariables.scss';
@@ -23,8 +22,8 @@ import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView"
 import { setupMoveUpEvents, emptyFunction, returnZero, returnOne, returnFalse } from "../../../Utils";
 import { SnappingManager } from "../../util/SnappingManager";
 import Measure from "react-measure";
-import { SchemaTable } from "./SchemaTable";
-import { civicinfo } from "googleapis/build/src/apis/civicinfo";
+import { SchemaTable } from "./SchemaTable"
+import { TraceMobx } from "../../../fields/util";
 
 library.add(faCog, faPlus, faSortUp, faSortDown);
 library.add(faTable);
@@ -185,7 +184,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         this._openTypes = bool;
     }
 
-    @action
     renderTypes = (col: any) => {
         if (columnTypes.get(col.heading)) return (null);
 
@@ -353,29 +351,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         />;
     }
 
-    @action
-    renderContent = (col: any) => {
-        return (
-            <div className="collectionSchema-header-menuOptions">
-                <div className="collectionSchema-headerMenu-group">
-                    <label>Key:</label>
-                    {this.renderKeysDropDown(col)}
-                </div>
-                {false ? <></> :
-                    <>
-                        {this.renderTypes(col)}
-                        {this.renderSorting(col)}
-                        {this.renderColors(col)}
-                        <div className="collectionSchema-headerMenu-group">
-                            <button onClick={() => { this.deleteColumn(col.heading); }}
-                            >Delete Column</button>
-                        </div>
-                    </>
-                }
-            </div>
-        );
-    }
-
     @undoBatch
     @action
     deleteColumn = (key: string) => {
@@ -410,45 +385,22 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         //this.menuCoordinates[1] -= e.screenY / scale;
     }
 
-    @action renderMenu() {
-        const scale = this.props.ScreenToLocalTransform().Scale;
-        return (
-            <div className="collectionSchema-header-menu" ref={this.setNode}
-                onWheel={e => this.props.active(true) && e.stopPropagation()}
-                onPointerDown={e => this.onHeaderClick(e)}
-                style={{
-                    position: "absolute", background: "white",
-                    transform: `translate(${this.menuCoordinates[0] * scale}px, ${this.menuCoordinates[1] / scale}px)`
-                }}>
-                <Measure offset onResize={action((r: any) => {
-                    const dim = this.props.ScreenToLocalTransform().inverse().transformDirection(r.offset.width, r.offset.height);
-                    this._menuWidth = dim[0]; this._menuHeight = dim[1];
-                })}>
-                    {({ measureRef }) => <div ref={measureRef}>
-                        <div className="collectionSchema-header-menuOptions">
-                            <div className="collectionSchema-headerMenu-group">
-                                <label>Key:</label>
-                                {this.renderKeysDropDown(this._col)}
-                            </div>
-                            {false ? <></> :
-                                <>
-                                    {this.renderTypes(this._col)}
-                                    {this.renderSorting(this._col)}
-                                    {this.renderColors(this._col)}
-                                    <div className="collectionSchema-headerMenu-group">
-                                        <button onClick={() => { this.deleteColumn(this._col.heading); }}
-                                        >Delete Column</button>
-                                    </div>
-                                </>
-                            }
-                        </div>
-
-                    </div>}
-                </Measure>
+    @computed get renderMenuContent() {
+        TraceMobx();
+        return <div className="collectionSchema-header-menuOptions">
+            <div className="collectionSchema-headerMenu-group">
+                <label>Key:</label>
+                {this.renderKeysDropDown(this._col)}
             </div>
-        );
+            {this.renderTypes(this._col)}
+            {this.renderSorting(this._col)}
+            {this.renderColors(this._col)}
+            <div className="collectionSchema-headerMenu-group">
+                <button onClick={() => { this.deleteColumn(this._col.heading); }}
+                >Delete Column</button>
+            </div>
+        </div>;
     }
-
     private createTarget = (ele: HTMLDivElement) => {
         this._previewCont = ele;
         super.CreateDropTarget(ele);
@@ -623,38 +575,18 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     }
 
     render() {
+        TraceMobx();
+        const menuContent = this.renderMenuContent;
         const scale = this.props.ScreenToLocalTransform().Scale;
         const menu = <div className="collectionSchema-header-menu" ref={this.setNode}
             onWheel={e => this.props.active(true) && e.stopPropagation()}
             onPointerDown={e => this.onHeaderClick(e)}
-            style={{
-                position: "absolute", background: "white",
-                transform: `translate(${this.menuCoordinates[0] * scale}px, ${this.menuCoordinates[1] / scale}px)`
-            }}>
+            style={{ transform: `translate(${this.menuCoordinates[0] * scale}px, ${this.menuCoordinates[1] / scale}px)` }}>
             <Measure offset onResize={action((r: any) => {
                 const dim = this.props.ScreenToLocalTransform().inverse().transformDirection(r.offset.width, r.offset.height);
                 this._menuWidth = dim[0]; this._menuHeight = dim[1];
             })}>
-                {({ measureRef }) => <div ref={measureRef}>
-                    <div className="collectionSchema-header-menuOptions">
-                        <div className="collectionSchema-headerMenu-group">
-                            <label>Key:</label>
-                            {this.renderKeysDropDown(this._col)}
-                        </div>
-                        {false ? <></> :
-                            <>
-                                {this.renderTypes(this._col)}
-                                {this.renderSorting(this._col)}
-                                {this.renderColors(this._col)}
-                                <div className="collectionSchema-headerMenu-group">
-                                    <button onClick={() => { this.deleteColumn(this._col.heading); }}
-                                    >Delete Column</button>
-                                </div>
-                            </>
-                        }
-                    </div>
-
-                </div>}
+                {({ measureRef }) => <div ref={measureRef}> {menuContent} </div>}
             </Measure>
         </div>;
 
-- 
cgit v1.2.3-70-g09d2


From 9f7d5a2fd3fca855ed51f4f4178966106ccdbefe Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Sun, 28 Jun 2020 23:54:26 -0500
Subject: adjustments to date

---
 .../views/collections/CollectionSchemaCells.tsx    | 40 ++++------------------
 .../views/collections/CollectionSchemaView.tsx     |  2 +-
 2 files changed, 8 insertions(+), 34 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index 034ba27cf..a0c5fcde4 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -31,6 +31,7 @@ import { DocumentIconContainer } from "../nodes/DocumentIcon";
 import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
 import DatePicker from "react-datepicker";
 import "react-datepicker/dist/react-datepicker.css";
+import { DateField } from "../../../fields/DateField";
 const path = require('path');
 
 library.add(faExpand);
@@ -344,49 +345,22 @@ export class CollectionSchemaStringCell extends CollectionSchemaCell {
 
 @observer
 export class CollectionSchemaDateCell extends CollectionSchemaCell {
-    private prop: FieldViewProps = {
-        Document: this.props.rowProps.original,
-        DataDoc: this.props.rowProps.original,
-        LibraryPath: [],
-        dropAction: "alias",
-        bringToFront: emptyFunction,
-        rootSelected: returnFalse,
-        fieldKey: this.props.rowProps.column.id as string,
-        ContainingCollectionView: this.props.CollectionView,
-        ContainingCollectionDoc: this.props.CollectionView && this.props.CollectionView.props.Document,
-        isSelected: returnFalse,
-        select: emptyFunction,
-        renderDepth: this.props.renderDepth + 1,
-        ScreenToLocalTransform: Transform.Identity,
-        focus: emptyFunction,
-        active: returnFalse,
-        whenActiveChanged: emptyFunction,
-        PanelHeight: returnZero,
-        PanelWidth: returnZero,
-        NativeHeight: returnZero,
-        NativeWidth: returnZero,
-        addDocTab: this.props.addDocTab,
-        pinToPres: this.props.pinToPres,
-        ContentScaling: returnOne,
-        docFilters: returnEmptyFilter
-    };
-    @observable private _field = this.prop.Document[this.prop.fieldKey];
-    @observable private _date = new Date();
+    @observable private _date: Date = this.props.rowProps.original[this.props.rowProps.column.id as string] instanceof DateField ? DateCast(this.props.rowProps.original[this.props.rowProps.column.id as string]).date : new Date();
 
     @action
     handleChange = (date: any) => {
         this._date = date;
-        this.prop.Document[this.prop.fieldKey] = DateCast(date);
-        this._field = DateCast(date);
+        const script = CompileScript(date.toString(), { requiredType: "Date", addReturn: true, params: { this: Doc.name } });
+        if (script.compiled) {
+            this.applyToDoc(this._document, this.props.row, this.props.col, script.run);
+        }
     }
 
     render() {
         return <DatePicker
-            selected={this._field ? DateCast(this.prop.Document[this.prop.fieldKey]).date : this._date}
+            selected={this._date}
             onSelect={date => this.handleChange(date)}
             onChange={date => this.handleChange(date)}
-            showTimeSelect
-            dateFormat="Pp"
         />;
     }
 }
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 857d8cb50..efbe97a8e 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -22,7 +22,7 @@ import { ContentFittingDocumentView } from "../nodes/ContentFittingDocumentView"
 import { setupMoveUpEvents, emptyFunction, returnZero, returnOne, returnFalse } from "../../../Utils";
 import { SnappingManager } from "../../util/SnappingManager";
 import Measure from "react-measure";
-import { SchemaTable } from "./SchemaTable"
+import { SchemaTable } from "./SchemaTable";
 import { TraceMobx } from "../../../fields/util";
 
 library.add(faCog, faPlus, faSortUp, faSortDown);
-- 
cgit v1.2.3-70-g09d2


From bc075fbd50200169e8d04b2385516272f24b0a29 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Mon, 29 Jun 2020 09:48:20 -0500
Subject: more merge fixes

---
 src/client/views/collections/CollectionSchemaView.tsx |  4 ++--
 src/client/views/collections/SchemaTable.tsx          | 12 +++++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index 7e8455149..dc4e75443 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -78,10 +78,10 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     }
 
     @computed get columns() {
-        return Cast(this.props.Document.schemaColumns, listSpec(SchemaHeaderField), []);
+        return Cast(this.props.Document._schemaHeaders, listSpec(SchemaHeaderField), []);
     }
     set columns(columns: SchemaHeaderField[]) {
-        this.props.Document.schemaColumns = new List<SchemaHeaderField>(columns);
+        this.props.Document._schemaHeaders = new List<SchemaHeaderField>(columns);
     }
 
     get documentKeys() {
diff --git a/src/client/views/collections/SchemaTable.tsx b/src/client/views/collections/SchemaTable.tsx
index eb0d234c0..5152b16b0 100644
--- a/src/client/views/collections/SchemaTable.tsx
+++ b/src/client/views/collections/SchemaTable.tsx
@@ -294,10 +294,12 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
     constructor(props: SchemaTableProps) {
         super(props);
         // convert old schema columns (list of strings) into new schema columns (list of schema header fields)
-        const oldSchemaColumns = Cast(this.props.Document.schemaColumns, listSpec("string"), []);
-        if (oldSchemaColumns && oldSchemaColumns.length && typeof oldSchemaColumns[0] !== "object") {
-            const newSchemaColumns = oldSchemaColumns.map(i => typeof i === "string" ? new SchemaHeaderField(i, "#f1efeb") : i);
-            this.props.Document.schemaColumns = new List<SchemaHeaderField>(newSchemaColumns);
+        const oldSchemaHeaders = Cast(this.props.Document._schemaHeaders, listSpec("string"), []);
+        if (oldSchemaHeaders?.length && typeof oldSchemaHeaders[0] !== "object") {
+            const newSchemaHeaders = oldSchemaHeaders.map(i => typeof i === "string" ? new SchemaHeaderField(i, "#f1efeb") : i);
+            this.props.Document._schemaHeaders = new List<SchemaHeaderField>(newSchemaHeaders);
+        } else if (this.props.Document._schemaHeaders === undefined) {
+            this.props.Document._schemaHeaders = new List<SchemaHeaderField>([new SchemaHeaderField("title", "#f1efeb")]);
         }
     }
 
@@ -539,7 +541,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
                 if(col === undefined) {
                     return (doc as any)[key][row + ${row}];
                 }
-                return (doc as any)[key][row + ${row}][(doc as any).schemaColumns[col + ${col}].heading];
+                return (doc as any)[key][row + ${row}][(doc as any)._schemaHeaders[col + ${col}].heading];
             }
             return ${script}`;
         const compiled = CompileScript(script, { params: { this: Doc.name }, capturedVariables: { doc: this.props.Document, key: this.props.fieldKey }, typecheck: false, transformer: this.createTransformer(row, col) });
-- 
cgit v1.2.3-70-g09d2


From d6828dba3dc1fd809d0e1449e8230656bb7c5360 Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Mon, 29 Jun 2020 10:28:31 -0500
Subject: UI fix and little restructure

---
 .../views/collections/CollectionSchemaHeaders.tsx  | 10 +--
 .../views/collections/CollectionSchemaView.scss    |  2 +-
 .../views/collections/CollectionSchemaView.tsx     | 99 ++++------------------
 .../views/collections/CollectionViewChromes.scss   |  1 +
 src/client/views/collections/SchemaTable.tsx       |  2 +-
 5 files changed, 26 insertions(+), 88 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaHeaders.tsx b/src/client/views/collections/CollectionSchemaHeaders.tsx
index fc7c2400d..efff4db98 100644
--- a/src/client/views/collections/CollectionSchemaHeaders.tsx
+++ b/src/client/views/collections/CollectionSchemaHeaders.tsx
@@ -365,7 +365,7 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
         const options = keyOptions.map(key => {
             return <div key={key} className="key-option" style={{
                 border: "1px solid lightgray",
-                width: this.props.width, overflowX: "hidden"
+                width: this.props.width, maxWidth: this.props.width, overflowX: "hidden"
             }}
                 onPointerDown={e => e.stopPropagation()} onClick={() => { this.onSelect(key); this.setSearchTerm(""); }}>{key}</div>;
         });
@@ -374,7 +374,7 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
         if (!exactFound && this._searchTerm !== "" && this.props.canAddNew) {
             options.push(<div key={""} className="key-option" style={{
                 border: "1px solid lightgray",
-                width: this.props.width, overflowX: "hidden"
+                width: this.props.width, maxWidth: this.props.width, overflowX: "hidden"
             }}
                 onClick={() => { this.onSelect(this._searchTerm); this.setSearchTerm(""); }}>
                 Create "{this._searchTerm}" key</div>);
@@ -385,8 +385,8 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
 
     render() {
         return (
-            <div className="keys-dropdown" style={{ width: this.props.width }}>
-                <input className="keys-search" style={{ width: this.props.width, maxWidth: "1000" }}
+            <div className="keys-dropdown" style={{ width: this.props.width, maxWidth: this.props.width, overflowX: "hidden" }}>
+                <input className="keys-search" //style={{ width: this.props.width, maxWidth: "1000" }}
                     ref={this._inputRef} type="text" value={this._searchTerm} placeholder="Column key" onKeyDown={this.onKeyDown}
                     onChange={e => this.onChange(e.target.value)}
                     onClick={(e) => {
@@ -395,7 +395,7 @@ export class KeysDropdown extends React.Component<KeysDropdownProps> {
                     }} onFocus={this.onFocus} onBlur={this.onBlur}></input>
                 <div className="keys-options-wrapper" style={{
                     backgroundColor: "white",
-                    width: this.props.width, overflowX: "hidden"
+                    width: this.props.width, maxWidth: this.props.width, overflowX: "hidden"
                 }}
                     onPointerEnter={this.onPointerEnter} onPointerLeave={this.onPointerOut}>
                     {this.renderOptions()}
diff --git a/src/client/views/collections/CollectionSchemaView.scss b/src/client/views/collections/CollectionSchemaView.scss
index 2330fcc8a..5226a60f1 100644
--- a/src/client/views/collections/CollectionSchemaView.scss
+++ b/src/client/views/collections/CollectionSchemaView.scss
@@ -500,7 +500,7 @@ button.add-column {
 }
 
 .collectionSchemaView-toolbar {
-    z-index: 1000;
+    z-index: 100;
 }
 
 .collectionSchemaView-toolbar {
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index dc4e75443..c75012595 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -24,7 +24,7 @@ import { setupMoveUpEvents, emptyFunction, returnZero, returnOne, returnFalse }
 import { SnappingManager } from "../../util/SnappingManager";
 import Measure from "react-measure";
 import { SchemaTable } from "./SchemaTable";
-import { civicinfo } from "googleapis/build/src/apis/civicinfo";
+import { TraceMobx } from "../../../fields/util";
 
 library.add(faCog, faPlus, faSortUp, faSortDown);
 library.add(faTable);
@@ -185,7 +185,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         this._openTypes = bool;
     }
 
-    @action
     renderTypes = (col: any) => {
         if (columnTypes.get(col.heading)) return (null);
 
@@ -353,29 +352,6 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         />;
     }
 
-    @action
-    renderContent = (col: any) => {
-        return (
-            <div className="collectionSchema-header-menuOptions">
-                <div className="collectionSchema-headerMenu-group">
-                    <label>Key:</label>
-                    {this.renderKeysDropDown(col)}
-                </div>
-                {false ? <></> :
-                    <>
-                        {this.renderTypes(col)}
-                        {this.renderSorting(col)}
-                        {this.renderColors(col)}
-                        <div className="collectionSchema-headerMenu-group">
-                            <button onClick={() => { this.deleteColumn(col.heading); }}
-                            >Delete Column</button>
-                        </div>
-                    </>
-                }
-            </div>
-        );
-    }
-
     @undoBatch
     @action
     deleteColumn = (key: string) => {
@@ -410,43 +386,21 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         //this.menuCoordinates[1] -= e.screenY / scale;
     }
 
-    @action renderMenu() {
-        const scale = this.props.ScreenToLocalTransform().Scale;
-        return (
-            <div className="collectionSchema-header-menu" ref={this.setNode}
-                onWheel={e => this.props.active(true) && e.stopPropagation()}
-                onPointerDown={e => this.onHeaderClick(e)}
-                style={{
-                    position: "absolute", background: "white",
-                    transform: `translate(${this.menuCoordinates[0] * scale}px, ${this.menuCoordinates[1] / scale}px)`
-                }}>
-                <Measure offset onResize={action((r: any) => {
-                    const dim = this.props.ScreenToLocalTransform().inverse().transformDirection(r.offset.width, r.offset.height);
-                    this._menuWidth = dim[0]; this._menuHeight = dim[1];
-                })}>
-                    {({ measureRef }) => <div ref={measureRef}>
-                        <div className="collectionSchema-header-menuOptions">
-                            <div className="collectionSchema-headerMenu-group">
-                                <label>Key:</label>
-                                {this.renderKeysDropDown(this._col)}
-                            </div>
-                            {false ? <></> :
-                                <>
-                                    {this.renderTypes(this._col)}
-                                    {this.renderSorting(this._col)}
-                                    {this.renderColors(this._col)}
-                                    <div className="collectionSchema-headerMenu-group">
-                                        <button onClick={() => { this.deleteColumn(this._col.heading); }}
-                                        >Delete Column</button>
-                                    </div>
-                                </>
-                            }
-                        </div>
-
-                    </div>}
-                </Measure>
+    @computed get renderMenuContent() {
+        TraceMobx();
+        return <div className="collectionSchema-header-menuOptions">
+            <div className="collectionSchema-headerMenu-group">
+                <label>Key:</label>
+                {this.renderKeysDropDown(this._col)}
             </div>
-        );
+            {this.renderTypes(this._col)}
+            {this.renderSorting(this._col)}
+            {this.renderColors(this._col)}
+            <div className="collectionSchema-headerMenu-group">
+                <button onClick={() => { this.deleteColumn(this._col.heading); }}
+                >Delete Column</button>
+            </div>
+        </div>;
     }
 
     private createTarget = (ele: HTMLDivElement) => {
@@ -623,6 +577,8 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
     }
 
     render() {
+        TraceMobx();
+        const menuContent = this.renderMenuContent;
         const scale = this.props.ScreenToLocalTransform().Scale;
         const menu = <div className="collectionSchema-header-menu" ref={this.setNode}
             onWheel={e => this.props.active(true) && e.stopPropagation()}
@@ -635,26 +591,7 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
                 const dim = this.props.ScreenToLocalTransform().inverse().transformDirection(r.offset.width, r.offset.height);
                 this._menuWidth = dim[0]; this._menuHeight = dim[1];
             })}>
-                {({ measureRef }) => <div ref={measureRef}>
-                    <div className="collectionSchema-header-menuOptions">
-                        <div className="collectionSchema-headerMenu-group">
-                            <label>Key:</label>
-                            {this.renderKeysDropDown(this._col)}
-                        </div>
-                        {false ? <></> :
-                            <>
-                                {this.renderTypes(this._col)}
-                                {this.renderSorting(this._col)}
-                                {this.renderColors(this._col)}
-                                <div className="collectionSchema-headerMenu-group">
-                                    <button onClick={() => { this.deleteColumn(this._col.heading); }}
-                                    >Delete Column</button>
-                                </div>
-                            </>
-                        }
-                    </div>
-
-                </div>}
+                {({ measureRef }) => <div ref={measureRef}> {menuContent} </div>}
             </Measure>
         </div>;
 
diff --git a/src/client/views/collections/CollectionViewChromes.scss b/src/client/views/collections/CollectionViewChromes.scss
index 2885ac763..822e15aed 100644
--- a/src/client/views/collections/CollectionViewChromes.scss
+++ b/src/client/views/collections/CollectionViewChromes.scss
@@ -16,6 +16,7 @@
         height: 32px;
         border-bottom: .5px solid rgb(180, 180, 180);
         overflow: visible;
+        z-index: 9001;
 
         .collectionViewBaseChrome {
             display: flex;
diff --git a/src/client/views/collections/SchemaTable.tsx b/src/client/views/collections/SchemaTable.tsx
index 5152b16b0..9e3b4d961 100644
--- a/src/client/views/collections/SchemaTable.tsx
+++ b/src/client/views/collections/SchemaTable.tsx
@@ -221,7 +221,7 @@ export class SchemaTable extends React.Component<SchemaTableProps> {
                     }}>
                     <FontAwesomeIcon icon={icon} size="lg" style={{ display: "inline", paddingLeft: "7px" }} />
                     <div className="keys-dropdown"
-                        style={{ display: "inline", zIndex: 10000 }}>
+                        style={{ display: "inline", zIndex: 1000 }}>
                         {keysDropdown}
                     </div>
                     <div onClick={e => this.changeSorting(col)}
-- 
cgit v1.2.3-70-g09d2


From f78d9d038c3f08615784c6b09b6d925838c8113c Mon Sep 17 00:00:00 2001
From: anika-ahluwalia <anika.ahluwalia@gmail.com>
Date: Mon, 29 Jun 2020 12:09:51 -0500
Subject: menu positioning getting better

---
 .../views/collections/CollectionSchemaView.tsx     | 23 ++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

(limited to 'src/client/views/collections/CollectionSchemaView.tsx')

diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index c75012595..23e8a4d49 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -77,6 +77,8 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         return this.props.ScreenToLocalTransform().transformPoint(x, y);
     }
 
+    @observable scale = this.props.ScreenToLocalTransform().Scale;
+
     @computed get columns() {
         return Cast(this.props.Document._schemaHeaders, listSpec(SchemaHeaderField), []);
     }
@@ -576,16 +578,29 @@ export class CollectionSchemaView extends CollectionSubView(doc => doc) {
         this.columns = columns;
     }
 
+    onZoomMenu = (e: React.WheelEvent) => {
+        this.props.active(true) && e.stopPropagation();
+        if (this.menuCoordinates[0] > e.screenX) {
+            this.menuCoordinates[0] -= e.screenX //* this.scale;
+        } else {
+            this.menuCoordinates[0] += e.screenX //* this.scale;
+        }
+        if (this.menuCoordinates[1] > e.screenY) {
+            this.menuCoordinates[1] -= e.screenY //* this.scale;
+        } else {
+            this.menuCoordinates[1] += e.screenY //* this.scale;
+        }
+    }
+
     render() {
         TraceMobx();
         const menuContent = this.renderMenuContent;
-        const scale = this.props.ScreenToLocalTransform().Scale;
         const menu = <div className="collectionSchema-header-menu" ref={this.setNode}
-            onWheel={e => this.props.active(true) && e.stopPropagation()}
+            onWheel={e => this.onZoomMenu(e)}
             onPointerDown={e => this.onHeaderClick(e)}
             style={{
-                position: "absolute", background: "white",
-                transform: `translate(${this.menuCoordinates[0] * scale}px, ${this.menuCoordinates[1] / scale}px)`
+                position: "fixed", background: "white",
+                transform: `translate(${this.menuCoordinates[0] / this.scale}px, ${this.menuCoordinates[1] / this.scale}px)`
             }}>
             <Measure offset onResize={action((r: any) => {
                 const dim = this.props.ScreenToLocalTransform().inverse().transformDirection(r.offset.width, r.offset.height);
-- 
cgit v1.2.3-70-g09d2

