aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes')
-rw-r--r--src/client/views/nodes/CollectionFreeFormDocumentView.tsx90
-rw-r--r--src/client/views/nodes/ContentFittingDocumentView.tsx1
-rw-r--r--src/client/views/nodes/DocHolderBox.tsx2
-rw-r--r--src/client/views/nodes/DocumentView.tsx6
-rw-r--r--src/client/views/nodes/FieldView.tsx1
-rw-r--r--src/client/views/nodes/FilterBox.tsx1
-rw-r--r--src/client/views/nodes/KeyValuePair.tsx1
-rw-r--r--src/client/views/nodes/LinkDocPreview.tsx1
-rw-r--r--src/client/views/nodes/formattedText/DashDocView.tsx1
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx2
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx1
-rw-r--r--src/client/views/nodes/formattedText/RichTextSchema.tsx1
12 files changed, 45 insertions, 63 deletions
diff --git a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
index 942182191..a17816705 100644
--- a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
+++ b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
@@ -116,7 +116,7 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
public static gotoKeyframe(docs: Doc[]) {
docs.forEach(doc => doc._viewTransition = doc.dataTransition = "all 1s");
- setTimeout(() => docs.forEach(doc => { doc._viewTransition = undefined; doc.dataTransition = "inherit" }), 1010);
+ setTimeout(() => docs.forEach(doc => { doc._viewTransition = undefined; doc.dataTransition = "inherit"; }), 1010);
}
public static setupZoom(doc: Doc, targDoc: Doc) {
@@ -153,41 +153,41 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
}
@computed get freeformNodeDiv() {
- const node = <DocumentView {...this.props}
- nudge={this.nudge}
- dragDivName={"collectionFreeFormDocumentView-container"}
- ContentScaling={this.contentScaling}
- ScreenToLocalTransform={this.getTransform}
- styleProvider={this.props.styleProvider}
- opacity={this.opacity}
- layerProvider={this.props.layerProvider}
- NativeHeight={this.NativeHeight}
- NativeWidth={this.NativeWidth}
- PanelWidth={this.panelWidth}
- PanelHeight={this.panelHeight} />;
- if (PresBox.Instance && this.layoutDoc === PresBox.Instance.childDocs[PresBox.Instance.itemIndex]?.presentationTargetDoc) {
- const effectProps = {
- left: this.layoutDoc.presEffectDirection === PresEffect.Left,
- right: this.layoutDoc.presEffectDirection === PresEffect.Right,
- top: this.layoutDoc.presEffectDirection === PresEffect.Top,
- bottom: this.layoutDoc.presEffectDirection === PresEffect.Bottom,
- opposite: true,
- delay: this.layoutDoc.presTransition,
- // when: this.layoutDoc === PresBox.Instance.childDocs[PresBox.Instance.itemIndex]?.presentationTargetDoc,
- };
- switch (this.layoutDoc.presEffect) {
- case "Zoom": return (<Zoom {...effectProps}>{node}</Zoom>); break;
- case PresEffect.Fade: return (<Fade {...effectProps}>{node}</Fade>); break;
- case PresEffect.Flip: return (<Flip {...effectProps}>{node}</Flip>); break;
- case PresEffect.Rotate: return (<Rotate {...effectProps}>{node}</Rotate>); break;
- case PresEffect.Bounce: return (<Bounce {...effectProps}>{node}</Bounce>); break;
- case PresEffect.Roll: return (<Roll {...effectProps}>{node}</Roll>); break;
- case "LightSpeed": return (<LightSpeed {...effectProps}>{node}</LightSpeed>); break;
- case PresEffect.None: return node; break;
- default: return node; break;
- }
- } else {
- return node;
+ const divProps = {
+ ...this.props,
+ nudge: this.nudge,
+ dragDivName: "collectionFreeFormDocumentView-container",
+ opacity: this.opacity,
+ ScreenToLocalTransform: this.getTransform,
+ NativeHeight: this.NativeHeight,
+ NativeWidth: this.NativeWidth,
+ PanelWidth: this.panelWidth,
+ PanelHeight: this.panelHeight
+ };
+ return this.props.fitToBox ?
+ <ContentFittingDocumentView {...divProps} ref={action((r: ContentFittingDocumentView | null) => this._contentView = r)} /> :
+ <DocumentView {...divProps} ContentScaling={this.contentScaling} />;
+ }
+ @computed get effectsNodeDiv() {
+ const effectProps = {
+ left: this.layoutDoc.presEffectDirection === PresEffect.Left,
+ right: this.layoutDoc.presEffectDirection === PresEffect.Right,
+ top: this.layoutDoc.presEffectDirection === PresEffect.Top,
+ bottom: this.layoutDoc.presEffectDirection === PresEffect.Bottom,
+ opposite: true,
+ delay: this.layoutDoc.presTransition,
+ // when: this.layoutDoc === PresBox.Instance.childDocs[PresBox.Instance.itemIndex]?.presentationTargetDoc,
+ };
+ switch (this.layoutDoc.presEffect) {
+ case "Zoom": return (<Zoom {...effectProps}>{this.freeformNodeDiv}</Zoom>);
+ case PresEffect.Fade: return (<Fade {...effectProps}>{this.freeformNodeDiv}</Fade>);
+ case PresEffect.Flip: return (<Flip {...effectProps}>{this.freeformNodeDiv}</Flip>);
+ case PresEffect.Rotate: return (<Rotate {...effectProps}>{this.freeformNodeDiv}</Rotate>);
+ case PresEffect.Bounce: return (<Bounce {...effectProps}>{this.freeformNodeDiv}</Bounce>);
+ case PresEffect.Roll: return (<Roll {...effectProps}>{this.freeformNodeDiv}</Roll>);
+ case "LightSpeed": return (<LightSpeed {...effectProps}>{this.freeformNodeDiv}</LightSpeed>);
+ case PresEffect.None:
+ default: return this.freeformNodeDiv;
}
}
@@ -207,6 +207,7 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
TraceMobx();
const backgroundColor = this.props.styleProvider?.(this.Document, this.props, "backgroundColor", this.props.layerProvider);
const borderRounding = StrCast(Doc.Layout(this.layoutDoc).borderRounding) || StrCast(this.layoutDoc.borderRounding) || StrCast(this.Document.borderRounding) || undefined;
+
return <div className="collectionFreeFormDocumentView-container"
style={{
boxShadow:
@@ -236,18 +237,11 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
</svg>
</div>}
- {!this.props.fitToBox ?
- <>{this.freeformNodeDiv}</>
- : <ContentFittingDocumentView {...this.props}
- ref={action((r: ContentFittingDocumentView | null) => this._contentView = r)}
- ContainingCollectionDoc={this.props.ContainingCollectionDoc}
- DataDoc={this.props.DataDoc}
- ScreenToLocalTransform={this.getTransform}
- NativeHeight={this.NativeHeight}
- NativeWidth={this.NativeWidth}
- PanelWidth={this.panelWidth}
- PanelHeight={this.panelHeight}
- />}
+ {PresBox.Instance && this.layoutDoc === PresBox.Instance.childDocs[PresBox.Instance.itemIndex]?.presentationTargetDoc ?
+ this.effectsNodeDiv
+ :
+ this.freeformNodeDiv
+ }
</div>;
}
}
diff --git a/src/client/views/nodes/ContentFittingDocumentView.tsx b/src/client/views/nodes/ContentFittingDocumentView.tsx
index a54479f55..74d7cb24e 100644
--- a/src/client/views/nodes/ContentFittingDocumentView.tsx
+++ b/src/client/views/nodes/ContentFittingDocumentView.tsx
@@ -71,7 +71,6 @@ export class ContentFittingDocumentView extends React.Component<DocumentViewProp
DataDoc={this.props.DataDoc}
LayoutTemplate={this.props.LayoutTemplate}
LayoutTemplateString={this.props.LayoutTemplateString}
- LibraryPath={this.props.LibraryPath}
PanelWidth={this.PanelWidth}
PanelHeight={this.PanelHeight}
ContentScaling={returnOne}
diff --git a/src/client/views/nodes/DocHolderBox.tsx b/src/client/views/nodes/DocHolderBox.tsx
index f0a1a3278..8231cf89e 100644
--- a/src/client/views/nodes/DocHolderBox.tsx
+++ b/src/client/views/nodes/DocHolderBox.tsx
@@ -118,7 +118,6 @@ export class DocHolderBox extends ViewBoxAnnotatableComponent<FieldViewProps, Do
<DocumentView
Document={containedDoc}
DataDoc={undefined}
- LibraryPath={emptyPath}
docFilters={this.props.docFilters}
docRangeFilters={this.props.docRangeFilters}
searchFilterDocs={this.props.searchFilterDocs}
@@ -147,7 +146,6 @@ export class DocHolderBox extends ViewBoxAnnotatableComponent<FieldViewProps, Do
<ContentFittingDocumentView
Document={containedDoc}
DataDoc={undefined}
- LibraryPath={emptyPath}
docFilters={this.props.docFilters}
docRangeFilters={this.props.docRangeFilters}
searchFilterDocs={this.props.searchFilterDocs}
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 126f330ab..53d6c0ddb 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -62,7 +62,6 @@ export interface DocumentViewProps {
getView?: (view: DocumentView) => any;
LayoutTemplateString?: string;
LayoutTemplate?: () => Opt<Doc>;
- LibraryPath: Doc[];
fitToBox?: boolean;
ignoreAutoHeight?: boolean;
contextMenuItems?: () => { script: ScriptField, label: string }[];
@@ -90,7 +89,7 @@ export interface DocumentViewProps {
parentActive: (outsideReaction: boolean) => boolean;
whenActiveChanged: (isActive: boolean) => void;
bringToFront: (doc: Doc, sendToBack?: boolean) => void;
- addDocTab: (doc: Doc, where: string, libraryPath?: Doc[]) => boolean;
+ addDocTab: (doc: Doc, where: string) => boolean;
pinToPres: (document: Doc) => void;
backgroundHalo?: (doc: Doc) => boolean;
styleProvider?: (doc: Opt<Doc>, props: DocumentViewProps, property: string, layerProvider?: (doc: Doc, assign?: boolean) => boolean) => any;
@@ -386,7 +385,7 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
// depending on the followLinkLocation property of the source (or the link itself as a fallback);
public static followLinkClick = async (linkDoc: Opt<Doc>, sourceDoc: Doc, docView: {
focus: DocFocusFunc,
- addDocTab: (doc: Doc, where: string, libraryPath?: Doc[]) => boolean,
+ addDocTab: (doc: Doc, where: string) => boolean,
ContainingCollectionDoc?: Doc
}, shiftKey: boolean, altKey: boolean) => {
const batch = UndoManager.StartBatch("follow link click");
@@ -933,7 +932,6 @@ export class DocumentView extends DocComponent<DocumentViewProps, Document>(Docu
backgroundHalo={this.props.backgroundHalo}
dontRegisterView={this.props.dontRegisterView}
fitToBox={this.props.fitToBox}
- LibraryPath={this.props.LibraryPath}
addDocument={this.props.addDocument}
removeDocument={this.props.removeDocument}
moveDocument={this.props.moveDocument}
diff --git a/src/client/views/nodes/FieldView.tsx b/src/client/views/nodes/FieldView.tsx
index ed91cf47d..f2fdf7a6b 100644
--- a/src/client/views/nodes/FieldView.tsx
+++ b/src/client/views/nodes/FieldView.tsx
@@ -25,7 +25,6 @@ export interface FieldViewProps {
ContainingCollectionDoc: Opt<Doc>;
Document: Doc;
DataDoc?: Doc;
- LibraryPath: Doc[];
layerProvider?: (doc: Doc, assign?: boolean) => boolean;
contentsActive?: (setActive: () => boolean) => void;
onClick?: () => ScriptField;
diff --git a/src/client/views/nodes/FilterBox.tsx b/src/client/views/nodes/FilterBox.tsx
index 6f0828a7d..0161f51fd 100644
--- a/src/client/views/nodes/FilterBox.tsx
+++ b/src/client/views/nodes/FilterBox.tsx
@@ -193,7 +193,6 @@ export class FilterBox extends ViewBoxBaseComponent<FieldViewProps, FilterBoxDoc
ContainingCollectionView={this.props.ContainingCollectionView}
PanelWidth={this.props.PanelWidth}
PanelHeight={this.props.PanelHeight}
- LibraryPath={emptyPath}
rootSelected={this.props.rootSelected}
renderDepth={1}
dropAction={this.props.dropAction}
diff --git a/src/client/views/nodes/KeyValuePair.tsx b/src/client/views/nodes/KeyValuePair.tsx
index 5e1f8fcea..aaf544c50 100644
--- a/src/client/views/nodes/KeyValuePair.tsx
+++ b/src/client/views/nodes/KeyValuePair.tsx
@@ -55,7 +55,6 @@ export class KeyValuePair extends React.Component<KeyValuePairProps> {
const props: FieldViewProps = {
Document: this.props.doc,
DataDoc: this.props.doc,
- LibraryPath: [],
docFilters: returnEmptyFilter,
docRangeFilters: returnEmptyFilter,
searchFilterDocs: returnEmptyDoclist,
diff --git a/src/client/views/nodes/LinkDocPreview.tsx b/src/client/views/nodes/LinkDocPreview.tsx
index c4bb2b8d8..5017b3a71 100644
--- a/src/client/views/nodes/LinkDocPreview.tsx
+++ b/src/client/views/nodes/LinkDocPreview.tsx
@@ -94,7 +94,6 @@ export class LinkDocPreview extends React.Component<Props> {
:
<ContentFittingDocumentView
Document={this._targetDoc}
- LibraryPath={emptyPath}
fitToBox={true}
moveDocument={returnFalse}
rootSelected={returnFalse}
diff --git a/src/client/views/nodes/formattedText/DashDocView.tsx b/src/client/views/nodes/formattedText/DashDocView.tsx
index 67bfd435b..450f0b6bc 100644
--- a/src/client/views/nodes/formattedText/DashDocView.tsx
+++ b/src/client/views/nodes/formattedText/DashDocView.tsx
@@ -228,7 +228,6 @@ export class DashDocView extends React.Component<IDashDocView> {
<DocumentView
Document={finalLayout}
DataDoc={resolvedDataDoc}
- LibraryPath={this._textBox.props.LibraryPath}
fitToBox={BoolCast(dashDoc._fitToBox)}
addDocument={returnFalse}
rootSelected={this._textBox.props.isSelected}
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index 6768acce4..59909cea1 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -99,7 +99,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
private _currentTime: number = 0;
private _linkTime: number | null = null;
private _pause: boolean = false;
- private _animatingScroll: numher = 0; // hack to prevent scroll values from being written to document when scroll is animating
+ private _animatingScroll: number = 0; // hack to prevent scroll values from being written to document when scroll is animating
@computed get _recording() { return this.dataDoc?.audioState === "recording"; }
set _recording(value) {
diff --git a/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx b/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx
index 3e5a40084..1d7b7ec91 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBoxComment.tsx
@@ -297,7 +297,6 @@ export class FormattedTextBoxComment {
<div className="FormattedTextBoxComment-preview-wrapper">
<ContentFittingDocumentView
Document={target}
- LibraryPath={emptyPath}
fitToBox={true}
moveDocument={returnFalse}
rootSelected={returnFalse}
diff --git a/src/client/views/nodes/formattedText/RichTextSchema.tsx b/src/client/views/nodes/formattedText/RichTextSchema.tsx
index b5d984aac..bb544e5e8 100644
--- a/src/client/views/nodes/formattedText/RichTextSchema.tsx
+++ b/src/client/views/nodes/formattedText/RichTextSchema.tsx
@@ -136,7 +136,6 @@ export class DashDocView {
ReactDOM.render(<DocumentView
Document={finalLayout}
DataDoc={resolvedDataDoc}
- LibraryPath={this._textBox.props.LibraryPath}
fitToBox={BoolCast(dashDoc._fitToBox)}
addDocument={returnFalse}
rootSelected={this._textBox.props.isSelected}