From 23d4470b3f6a0bd862f3f5f9c775be039d479d81 Mon Sep 17 00:00:00 2001 From: bobzel Date: Mon, 6 May 2024 19:09:02 -0400 Subject: eslint cleanup --- src/client/views/StyleProvider.tsx | 19 ++++++++-------- .../views/collections/CollectionCarousel3DView.tsx | 2 +- .../views/collections/CollectionCarouselView.tsx | 2 +- .../views/collections/CollectionNoteTakingView.tsx | 6 ++--- .../collections/CollectionStackedTimeline.tsx | 4 ++-- .../views/collections/CollectionStackingView.tsx | 4 ++-- src/client/views/collections/TreeView.tsx | 4 ++-- .../collectionFreeForm/CollectionFreeFormView.tsx | 4 ++-- .../collectionSchema/CollectionSchemaView.tsx | 2 +- src/client/views/nodes/DocumentView.tsx | 26 +++++++++++----------- src/client/views/nodes/FieldView.tsx | 4 ++-- src/client/views/nodes/ImageBox.tsx | 6 ++--- src/client/views/nodes/LinkDocPreview.tsx | 2 +- src/client/views/nodes/PDFBox.tsx | 5 ++--- src/client/views/nodes/VideoBox.tsx | 4 ++-- 15 files changed, 47 insertions(+), 47 deletions(-) (limited to 'src') diff --git a/src/client/views/StyleProvider.tsx b/src/client/views/StyleProvider.tsx index 3ecfc8ba3..e6e95e86c 100644 --- a/src/client/views/StyleProvider.tsx +++ b/src/client/views/StyleProvider.tsx @@ -83,6 +83,7 @@ export function DefaultStyleProvider(doc: Opt, props: Opt, props: Opt layoutDoc?._layout_isSvg && !LayoutTemplateString; const lockedPosition = () => doc && BoolCast(doc._lockedPosition); @@ -149,7 +150,7 @@ export function DefaultStyleProvider(doc: Opt, props: Opt, props: Opt, props: Opt, props: Opt ); const paint = () => !doc?.onPaint ? null : ( -
togglePaintView(e, doc, props)}> +
togglePaintView(e, doc, props)}>
); diff --git a/src/client/views/collections/CollectionCarousel3DView.tsx b/src/client/views/collections/CollectionCarousel3DView.tsx index 7617f2a52..27c85533f 100644 --- a/src/client/views/collections/CollectionCarousel3DView.tsx +++ b/src/client/views/collections/CollectionCarousel3DView.tsx @@ -78,7 +78,7 @@ export class CollectionCarousel3DView extends CollectionSubView() { // suppressSetHeight={true} NativeWidth={returnZero} NativeHeight={returnZero} - layout_fitWidth={undefined} + fitWidth={undefined} onDoubleClickScript={this.onChildDoubleClick} renderDepth={this._props.renderDepth + 1} LayoutTemplate={this._props.childLayoutTemplate} diff --git a/src/client/views/collections/CollectionCarouselView.tsx b/src/client/views/collections/CollectionCarouselView.tsx index 9d3657995..45b64d3e6 100644 --- a/src/client/views/collections/CollectionCarouselView.tsx +++ b/src/client/views/collections/CollectionCarouselView.tsx @@ -74,7 +74,7 @@ export class CollectionCarouselView extends CollectionSubView() { {...this._props} NativeWidth={returnZero} NativeHeight={returnZero} - layout_fitWidth={undefined} + fitWidth={undefined} setContentViewBox={undefined} onDoubleClickScript={this.onContentDoubleClick} onClickScript={this.onContentClick} diff --git a/src/client/views/collections/CollectionNoteTakingView.tsx b/src/client/views/collections/CollectionNoteTakingView.tsx index 3f9eed1d6..53211be77 100644 --- a/src/client/views/collections/CollectionNoteTakingView.tsx +++ b/src/client/views/collections/CollectionNoteTakingView.tsx @@ -269,7 +269,7 @@ export class CollectionNoteTakingView extends CollectionSubView() { PanelHeight={height} styleProvider={this.styleProvider} containerViewPath={this.childContainerViewPath} - layout_fitWidth={this._props.childLayoutFitWidth} + fitWidth={this._props.childLayoutFitWidth} isContentActive={emptyFunction} onKey={this.onKeyDown} // TODO: change this from a prop to a parameter passed into a function @@ -282,7 +282,7 @@ export class CollectionNoteTakingView extends CollectionSubView() { dontCenter={this._props.childIgnoreNativeSize ? 'xy' : undefined} dontRegisterView={dataDoc ? true : BoolCast(this.layoutDoc.childDontRegisterViews, this._props.dontRegisterView)} rootSelected={this.rootSelected} - layout_showTitle={this._props.childlayout_showTitle} + showTitle={this._props.childlayout_showTitle} dragAction={StrCast(this.layoutDoc.childDragAction) as dropActionType} onClickScript={this.onChildClickHandler} onDoubleClickScript={this.onChildDoubleClickHandler} @@ -528,7 +528,7 @@ export class CollectionNoteTakingView extends CollectionSubView() { }); refList = () => this._refList; - backgroundColor = () => this._props.DocumentView?.().backgroundColor(); + backgroundColor = () => this.DocumentView?.()?.backgroundColor(); // sectionNoteTaking returns a CollectionNoteTakingViewColumn (which is an individual column) sectionNoteTaking = (heading: SchemaHeaderField | undefined, docList: Doc[]) => ( diff --git a/src/client/views/collections/CollectionStackedTimeline.tsx b/src/client/views/collections/CollectionStackedTimeline.tsx index f9b123bb6..1604920f6 100644 --- a/src/client/views/collections/CollectionStackedTimeline.tsx +++ b/src/client/views/collections/CollectionStackedTimeline.tsx @@ -855,7 +855,7 @@ class StackedTimelineAnchor extends ObservableReactComponent {inner.view} - {!inner.anchor.view || !inner.anchor.view.IsSelected ? null : ( + {!inner.anchor.view?.IsSelected ? null : ( <>
this.onAnchorDown(e, this._props.mark, true)} />
this.onAnchorDown(e, this._props.mark, false)} /> diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx index 3f12a281e..07aa0f4f0 100644 --- a/src/client/views/collections/CollectionStackingView.tsx +++ b/src/client/views/collections/CollectionStackingView.tsx @@ -336,7 +336,7 @@ export class CollectionStackingView extends CollectionSubView { } })} Document={this.Document} - layout_fitWidth={returnTrue} + fitWidth={returnTrue} scriptContext={this} hideDecorations hideClickBehaviors @@ -1122,7 +1122,7 @@ export class TreeView extends ObservableReactComponent { this._dref = r; })} Document={this.Document} - layout_fitWidth={this.fitWidthFilter} + fitWidth={this.fitWidthFilter} PanelWidth={this.embeddedPanelWidth} PanelHeight={this.embeddedPanelHeight} LayoutTemplateString={asText ? FormattedTextBox.LayoutString('text') : undefined} diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 21a069bd8..74de6524b 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -183,7 +183,7 @@ export class CollectionFreeFormView extends CollectionSubView diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx index b684b65e5..fd57f3d13 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx @@ -1234,7 +1234,7 @@ class CollectionSchemaViewDoc extends ObservableReactComponent ); } diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 3191e04db..03cdc8472 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -122,14 +122,14 @@ export class DocumentViewInternal extends DocComponent this._animateScaleTime ?? 100; style = (doc: Doc, sprop: StyleProp | string) => this._props.styleProvider?.(doc, this._props, sprop); - @computed get layout_showTitle() { return this.style(this.layoutDoc, StyleProp.ShowTitle) as Opt; } // prettier-ignore + @computed get showTitle() { return this.style(this.layoutDoc, StyleProp.ShowTitle) as Opt; } // prettier-ignore @computed get opacity() { return this.style(this.layoutDoc, StyleProp.Opacity); } // prettier-ignore @computed get boxShadow() { return this.style(this.layoutDoc, StyleProp.BoxShadow); } // prettier-ignore @computed get borderRounding() { return this.style(this.layoutDoc, StyleProp.BorderRounding); } // prettier-ignore @computed get widgetDecorations() { return this.style(this.layoutDoc, StyleProp.Decorations); } // prettier-ignore @computed get backgroundBoxColor() { return this.style(this.layoutDoc, StyleProp.BackgroundColor + ':box'); } // prettier-ignore @computed get headerMargin() { return this.style(this.layoutDoc, StyleProp.HeaderMargin) ?? 0; } // prettier-ignore - @computed get layout_showCaption() { return this.style(this.layoutDoc, StyleProp.ShowCaption) ?? 0; } // prettier-ignore + @computed get showCaption() { return this.style(this.layoutDoc, StyleProp.ShowCaption) ?? 0; } // prettier-ignore @computed get titleHeight() { return this.style(this.layoutDoc, StyleProp.TitleHeight) ?? 0; } // prettier-ignore @computed get docContents() { return this.style(this.Document, StyleProp.DocContents); } // prettier-ignore @computed get highlighting() { return this.style(this.Document, StyleProp.Highlighting); } // prettier-ignore @@ -762,7 +762,7 @@ export class DocumentViewInternal extends DocComponent { if (this.layoutDoc.layout_showTitle) { this.layoutDoc._layout_showTitle = field; - } else if (!this._props.layout_showTitle) { + } else if (!this._props.showTitle) { Doc.UserDoc().layout_showTitle = field; } this._changingTitleField = false; @@ -776,8 +776,8 @@ export class DocumentViewInternal extends DocComponent { TraceMobx(); - const showTitle = this.layout_showTitle?.split(':')[0]; + const showTitle = this.showTitle?.split(':')[0]; return !DocCast(this.Document) || GetEffectiveAcl(this.dataDoc) === AclPrivate ? null : this.docContents ?? ( @@ -895,7 +895,7 @@ export class DocumentViewInternal extends DocComponent - {this._props.hideTitle || (!showTitle && !this.layout_showCaption) ? ( + {this._props.hideTitle || (!showTitle && !this.showCaption) ? ( this.viewBoxContents ) : (
@@ -1124,7 +1124,7 @@ export class DocumentView extends DocComponent() { } @computed get layout_fitWidth() { - return this._props.layout_fitWidth?.(this.layoutDoc) ?? this.layoutDoc?.layout_fitWidth; + return this._props.fitWidth?.(this.layoutDoc) ?? this.layoutDoc?.layout_fitWidth; } @computed get anchorViewDoc() { return this._props.LayoutTemplateString?.includes('link_anchor_2') ? DocCast(this.Document.link_anchor_2) : this._props.LayoutTemplateString?.includes('link_anchor_1') ? DocCast(this.Document.link_anchor_1) : undefined; @@ -1329,7 +1329,7 @@ export class DocumentView extends DocComponent() { zoomTime: 500, }); } - //} + // } }; backgroundColor = () => this._docViewInternal?.backgroundBoxColor; DataTransition = () => this._props.DataTransition?.() || StrCast(this.Document.dataTransition); @@ -1415,7 +1415,7 @@ export class DocumentView extends DocComponent() { NativeDimScaling={this.NativeDimScaling} isSelected={this.isSelected} select={this.select} - layout_fitWidth={this.layout_fitWidthFunc} + fitWidth={this.layout_fitWidthFunc} ScreenToLocalTransform={this.screenToContentsTransform} focus={this._props.focus || emptyFunction} ref={action((r: DocumentViewInternal | null) => { diff --git a/src/client/views/nodes/FieldView.tsx b/src/client/views/nodes/FieldView.tsx index 8a37000f7..66b134889 100644 --- a/src/client/views/nodes/FieldView.tsx +++ b/src/client/views/nodes/FieldView.tsx @@ -61,9 +61,9 @@ export interface FieldViewSharedProps { onPointerUpScript?: () => ScriptField; // eslint-disable-next-line no-use-before-define onKey?: (e: React.KeyboardEvent, fieldProps: FieldViewProps) => boolean | undefined; - layout_fitWidth?: (doc: Doc) => boolean | undefined; + fitWidth?: (doc: Doc) => boolean | undefined; searchFilterDocs: () => Doc[]; - layout_showTitle?: () => string; + showTitle?: () => string; whenChildContentsActiveChanged: (isActive: boolean) => void; rootSelected?: () => boolean; // whether the root of a template has been selected addDocTab: (doc: Doc | Doc[], where: OpenWhere) => boolean; diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index 3d10408d6..e4b3a1b9b 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -24,7 +24,7 @@ import { undoBatch } from '../../util/UndoManager'; import { CollectionFreeFormView } from '../collections/collectionFreeForm/CollectionFreeFormView'; import { ContextMenu } from '../ContextMenu'; import { ContextMenuProps } from '../ContextMenuItem'; -import { ViewBoxAnnotatableComponent, ViewBoxInterface } from '../DocComponent'; +import { ViewBoxAnnotatableComponent } from '../DocComponent'; import { MarqueeAnnotator } from '../MarqueeAnnotator'; import { OverlayView } from '../OverlayView'; import { AnchorMenu } from '../pdf/AnchorMenu'; @@ -291,7 +291,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent() { const ext = extname(url.href); return url.href.replace(ext, (this._error ? '_o' : this._curSuffix) + ext); }; - getScrollHeight = () => (this._props.layout_fitWidth?.(this.Document) !== false && NumCast(this.layoutDoc._freeform_scale, 1) === NumCast(this.dataDoc._freeform_scaleMin, 1) ? this.nativeSize.nativeHeight : undefined); + getScrollHeight = () => (this._props.fitWidth?.(this.Document) !== false && NumCast(this.layoutDoc._freeform_scale, 1) === NumCast(this.dataDoc._freeform_scaleMin, 1) ? this.nativeSize.nativeHeight : undefined); @computed get nativeSize() { TraceMobx(); @@ -472,7 +472,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent() { height: this._props.PanelWidth() ? undefined : `100%`, pointerEvents: this.layoutDoc._lockedPosition ? 'none' : undefined, borderRadius, - overflow: this.layoutDoc.layout_fitWidth || this._props.layout_fitWidth?.(this.Document) ? 'auto' : undefined, + overflow: this.layoutDoc.layout_fitWidth || this._props.fitWidth?.(this.Document) ? 'auto' : undefined, }}> () { setPdfViewer = (pdfViewer: PDFViewer) => { this._pdfViewer = pdfViewer; - const docView = this.DocumentView?.(); - if (this._initialScrollTarget && docView) { + if (this._initialScrollTarget) { this.focus(this._initialScrollTarget, { instant: true }); this._initialScrollTarget = undefined; } @@ -559,7 +558,7 @@ export class PDFBox extends ViewBoxAnnotatableComponent() { removeDocument={this.removeDocument} /> ) : ( -
setupMoveUpEvents(this, e, returnFalse, emptyFunction, () => DocumentView.SelectView(this.DocumentView?.()!, false), true)}> +
setupMoveUpEvents(this, e, returnFalse, emptyFunction, () => this._props.select(false), true)}> () implements ViewBoxInterface { +export class VideoBox extends ViewBoxAnnotatableComponent() { public static LayoutString(fieldKey: string) { return FieldView.LayoutString(VideoBox, fieldKey); } -- cgit v1.2.3-70-g09d2