diff options
Diffstat (limited to 'src/client/views/DocComponent.tsx')
-rw-r--r-- | src/client/views/DocComponent.tsx | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/client/views/DocComponent.tsx b/src/client/views/DocComponent.tsx index 483b92957..9ff27d9a0 100644 --- a/src/client/views/DocComponent.tsx +++ b/src/client/views/DocComponent.tsx @@ -1,16 +1,15 @@ import { action, computed, observable } from 'mobx'; import { DateField } from '../../fields/DateField'; -import { Doc, DocListCast, HierarchyMapping, Opt, ReverseHierarchyMap } from '../../fields/Doc'; -import { AclAdmin, AclAugment, AclEdit, AclPrivate, AclReadonly, DocAcl, DocData } from '../../fields/DocSymbols'; +import { Doc, DocListCast, Opt } from '../../fields/Doc'; +import { AclAdmin, AclAugment, AclEdit, AclPrivate, AclReadonly, DocData } from '../../fields/DocSymbols'; import { List } from '../../fields/List'; -import { Cast, DocCast, StrCast } from '../../fields/Types'; -import { distributeAcls, GetEffectiveAcl, inheritParentAcls, SharingPermissions } from '../../fields/util'; +import { Cast } from '../../fields/Types'; +import { GetEffectiveAcl, inheritParentAcls } from '../../fields/util'; import { returnFalse } from '../../Utils'; import { DocUtils } from '../documents/Documents'; import { DocumentType } from '../documents/DocumentTypes'; -import { InteractionUtils } from '../util/InteractionUtils'; import { DocumentView } from './nodes/DocumentView'; -import { Touchable } from './Touchable'; +import * as React from 'react'; /// DocComponent returns a generic React base class used by views that don't have 'fieldKey' props (e.g.,CollectionFreeFormDocumentView, DocumentView) export interface DocComponentProps { @@ -20,7 +19,7 @@ export interface DocComponentProps { LayoutTemplateString?: string; } export function DocComponent<P extends DocComponentProps>() { - class Component extends Touchable<P> { + class Component extends React.Component<React.PropsWithChildren<P>> { //TODO This might be pretty inefficient if doc isn't observed, because computed doesn't cache then @computed get Document() { return this.props.Document; @@ -41,8 +40,6 @@ export function DocComponent<P extends DocComponentProps>() { @computed get fieldKey() { return this.props.fieldKey; } - - protected _multiTouchDisposer?: InteractionUtils.MultiTouchEventDisposer; } return Component; } @@ -53,13 +50,13 @@ interface ViewBoxBaseProps { DataDoc?: Doc; DocumentView?: () => DocumentView; fieldKey: string; - isSelected: (outsideReaction?: boolean) => boolean; + isSelected: () => boolean; isContentActive: () => boolean | undefined; renderDepth: number; - rootSelected: (outsideReaction?: boolean) => boolean; + rootSelected: () => boolean; } export function ViewBoxBaseComponent<P extends ViewBoxBaseProps>() { - class Component extends Touchable<P> { + class Component extends React.Component<React.PropsWithChildren<P>> { //TODO This might be pretty inefficient if doc isn't observed, because computed doesn't cache then //@computed get Document(): T { return schemaCtor(this.props.Document); } @@ -79,8 +76,6 @@ export function ViewBoxBaseComponent<P extends ViewBoxBaseProps>() { @computed get fieldKey() { return this.props.fieldKey; } - - protected _multiTouchDisposer?: InteractionUtils.MultiTouchEventDisposer; } return Component; } @@ -94,13 +89,13 @@ export interface ViewBoxAnnotatableProps { isContentActive: () => boolean | undefined; select: (isCtrlPressed: boolean) => void; whenChildContentsActiveChanged: (isActive: boolean) => void; - isSelected: (outsideReaction?: boolean) => boolean; - rootSelected: (outsideReaction?: boolean) => boolean; + isSelected: () => boolean; + rootSelected: () => boolean; renderDepth: number; isAnnotationOverlay?: boolean; } export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps>() { - class Component extends Touchable<P> { + class Component extends React.Component<React.PropsWithChildren<P>> { @observable _annotationKeySuffix = () => 'annotations'; @observable _isAnyChildContentActive = false; //TODO This might be pretty inefficient if doc isn't observed, because computed doesn't cache then @@ -127,8 +122,6 @@ export function ViewBoxAnnotatableComponent<P extends ViewBoxAnnotatableProps>() isAnyChildContentActive = () => this._isAnyChildContentActive; - protected _multiTouchDisposer?: InteractionUtils.MultiTouchEventDisposer; - @computed public get annotationKey() { return this.fieldKey + (this._annotationKeySuffix() ? '_' + this._annotationKeySuffix() : ''); } |