From 78ac87b8acf63079071e5e8805692ed8c30042ce Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 23 Apr 2025 22:02:36 -0400 Subject: lots of typechecking fixes. --- src/client/views/newlightbox/ExploreView/ExploreView.tsx | 4 +--- src/client/views/newlightbox/NewLightboxView.tsx | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'src/client/views/newlightbox') diff --git a/src/client/views/newlightbox/ExploreView/ExploreView.tsx b/src/client/views/newlightbox/ExploreView/ExploreView.tsx index f8c07cc43..7f9a13549 100644 --- a/src/client/views/newlightbox/ExploreView/ExploreView.tsx +++ b/src/client/views/newlightbox/ExploreView/ExploreView.tsx @@ -1,5 +1,3 @@ -/* eslint-disable jsx-a11y/no-static-element-interactions */ -/* eslint-disable jsx-a11y/click-events-have-key-events */ import * as React from 'react'; import { StrCast } from '../../../../fields/Types'; import { NewLightboxView } from '../NewLightboxView'; @@ -19,7 +17,7 @@ export function ExploreView(props: IExploreView) { const x = (rec.embedding.x / xBound) * 50; const y = (rec.embedding.y / yBound) * 50; return ( -
{}} style={{ top: `calc(50% + ${y}%)`, left: `calc(50% + ${x}%)` }}> +
{}} style={{ top: `calc(50% + ${y}%)`, left: `calc(50% + ${x}%)` }}> {rec.title}
); diff --git a/src/client/views/newlightbox/NewLightboxView.tsx b/src/client/views/newlightbox/NewLightboxView.tsx index 87cef01d2..7ec45d0dd 100644 --- a/src/client/views/newlightbox/NewLightboxView.tsx +++ b/src/client/views/newlightbox/NewLightboxView.tsx @@ -5,7 +5,7 @@ import { returnEmptyFilter, returnTrue } from '../../../ClientUtils'; import { emptyFunction } from '../../../Utils'; import { CreateLinkToActiveAudio, Doc, DocListCast, Opt, returnEmptyDoclist } from '../../../fields/Doc'; import { InkTool } from '../../../fields/InkField'; -import { Cast, NumCast, StrCast, toList } from '../../../fields/Types'; +import { Cast, DocCast, NumCast, StrCast, toList } from '../../../fields/Types'; import { SnappingManager } from '../../util/SnappingManager'; import { Transform } from '../../util/Transform'; import { GestureOverlay } from '../GestureOverlay'; @@ -100,7 +100,7 @@ export class NewLightboxView extends React.Component { SnappingManager.SetExploreMode(false); } else { const l = CreateLinkToActiveAudio(() => doc).lastElement(); - l && (Cast(l.link_anchor_2, Doc, null).backgroundColor = 'lightgreen'); + DocCast(l?.link_anchor_2) && (DocCast(l!.link_anchor_2)!.backgroundColor = 'lightgreen'); DocumentView.CurrentlyPlaying?.forEach(dv => dv.ComponentView?.Pause?.()); // DocumentView.PinDoc(doc, { hidePresBox: true }); this._history ? this._history.push({ doc, target }) : (this._history = [{ doc, target }]); @@ -142,7 +142,7 @@ export class NewLightboxView extends React.Component { const targetDocView = target && DocumentView.getLightboxDocumentView(target); if (targetDocView && target) { const l = CreateLinkToActiveAudio(() => targetDocView.ComponentView?.getAnchor?.(true) || target).lastElement(); - l && (Cast(l.link_anchor_2, Doc, null).backgroundColor = 'lightgreen'); + DocCast(l?.link_anchor_2) && (DocCast(l!.link_anchor_2)!.backgroundColor = 'lightgreen'); DocumentView.showDocument(target, { willZoomCentered: true, zoomScale: 0.9 }); if (NewLightboxView._history?.lastElement().target !== target) NewLightboxView._history?.push({ doc, target }); } else if (!target && NewLightboxView.path.length) { @@ -326,7 +326,6 @@ export class NewLightboxView extends React.Component { } interface NewLightboxTourBtnProps { navBtn: (left: Opt, bottom: Opt, top: number, icon: string, display: () => string, click: (e: React.MouseEvent) => void, color?: string) => JSX.Element; - // eslint-disable-next-line react/no-unused-prop-types future: () => Opt; stepInto: () => void; } -- cgit v1.2.3-70-g09d2