aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/Palette.tsx
blob: 3649cccfe9dca4dad397dab87347053811aacb28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import * as React from "react";
import "./Palette.scss";
import { PointData } from "../../new_fields/InkField";
import { Doc } from "../../new_fields/Doc";
import { Docs } from "../documents/Documents";
import { ScriptField, ComputedField } from "../../new_fields/ScriptField";
import { List } from "../../new_fields/List";
import { DocumentView } from "./nodes/DocumentView";
import { emptyPath, returnFalse, emptyFunction, returnOne, returnEmptyString, returnTrue } from "../../Utils";
import { CurrentUserUtils } from "../../server/authentication/models/current_user_utils";
import { Transform } from "../util/Transform";
import { computed, action } from "mobx";
import { FieldValue, Cast } from "../../new_fields/Types";
import { observer } from "mobx-react";
import { DocumentContentsView } from "./nodes/DocumentContentsView";
import { CollectionStackingView } from "./collections/CollectionStackingView";
import { CollectionView } from "./collections/CollectionView";

export interface PaletteProps {
    x: number;
    y: number;
    thumb: number[];
    thumbDoc: Doc;
}

@observer
export default class Palette extends React.Component<PaletteProps> {
    render() {
        return (
            <div className="palette-container" style={{ transform: `translate(${this.props.x}px, ${this.props.y}px)` }}>
                <div className="palette-thumb" style={{ transform: `translate(${this.props.thumb[0] - this.props.x}px, ${this.props.thumb[1] - this.props.y}px)` }}>
                    <div className="palette-thumbContent">
                        <DocumentView
                            Document={this.props.thumbDoc}
                            DataDoc={undefined}
                            LibraryPath={emptyPath}
                            addDocument={undefined}
                            addDocTab={returnFalse}
                            pinToPres={emptyFunction}
                            removeDocument={undefined}
                            ruleProvider={undefined}
                            onClick={undefined}
                            ScreenToLocalTransform={Transform.Identity}
                            ContentScaling={returnOne}
                            PanelWidth={() => window.screen.width}
                            PanelHeight={() => window.screen.height}
                            renderDepth={0}
                            focus={emptyFunction}
                            backgroundColor={returnEmptyString}
                            parentActive={returnTrue}
                            whenActiveChanged={emptyFunction}
                            bringToFront={emptyFunction}
                            ContainingCollectionView={undefined}
                            ContainingCollectionDoc={undefined}
                            zoomToScale={emptyFunction}
                            getScale={returnOne}>
                        </DocumentView>
                    </div>
                </div>
            </div>
        );
    }
}