From 762ac2bf354e4cc2c4b15f42502da939f5061646 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Fri, 9 Aug 2024 16:48:18 -0400
Subject: a bunch more typing fixes.

---
 src/client/views/collections/CollectionView.tsx | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

(limited to 'src/client/views/collections/CollectionView.tsx')

diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx
index 5c304b4a9..c9ab5f661 100644
--- a/src/client/views/collections/CollectionView.tsx
+++ b/src/client/views/collections/CollectionView.tsx
@@ -48,7 +48,7 @@ export class CollectionView extends ViewBoxAnnotatableComponent<CollectionViewPr
     private reactionDisposer: IReactionDisposer | undefined;
     @observable _isContentActive: boolean | undefined = undefined;
 
-    constructor(props: any) {
+    constructor(props: CollectionViewProps) {
         super(props);
         makeObservable(this);
         this._annotationKeySuffix = returnEmptyString;
@@ -72,7 +72,7 @@ export class CollectionView extends ViewBoxAnnotatableComponent<CollectionViewPr
     }
 
     get collectionViewType(): CollectionViewType | undefined {
-        const viewField = StrCast(this.layoutDoc._type_collection) as any as CollectionViewType;
+        const viewField = StrCast(this.layoutDoc._type_collection) as CollectionViewType;
         if (CollectionView._safeMode) {
             switch (viewField) { 
                 case CollectionViewType.Freeform:
@@ -132,7 +132,7 @@ export class CollectionView extends ViewBoxAnnotatableComponent<CollectionViewPr
             ];
 
             const existingVm = ContextMenu.Instance.findByDescription(category);
-            const catItems = existingVm && 'subitems' in existingVm ? existingVm.subitems : [];
+            const catItems = existingVm?.subitems ?? [];
             catItems.push({ description: 'Add a Perspective...', addDivider: true, noexpand: true, subitems: subItems, icon: 'eye' });
             !existingVm && ContextMenu.Instance.addItem({ description: category, subitems: catItems, icon: 'eye' });
         }
@@ -151,7 +151,7 @@ export class CollectionView extends ViewBoxAnnotatableComponent<CollectionViewPr
                 });
 
             const options = cm.findByDescription('Options...');
-            const optionItems = options && 'subitems' in options ? options.subitems : [];
+            const optionItems = options?.subitems ?? [];
             !Doc.noviceMode ? optionItems.splice(0, 0, { description: `${this.Document.forceActive ? 'Select' : 'Force'} Contents Active`, event: () => {this.Document.forceActive = !this.Document.forceActive}, icon: 'project-diagram' }) : null; // prettier-ignore
             if (this.Document.childLayout instanceof Doc) {
                 optionItems.push({ description: 'View Child Layout', event: () => this._props.addDocTab(this.Document.childLayout as Doc, OpenWhere.addRight), icon: 'project-diagram' });
@@ -165,7 +165,7 @@ export class CollectionView extends ViewBoxAnnotatableComponent<CollectionViewPr
 
             if (!Doc.noviceMode && !this.Document.annotationOn && !this._props.hideClickBehaviors) {
                 const existingOnClick = cm.findByDescription('OnClick...');
-                const onClicks = existingOnClick && 'subitems' in existingOnClick ? existingOnClick.subitems : [];
+                const onClicks = existingOnClick?.subitems ?? [];
                 const funcs = [
                     { key: 'onChildClick', name: 'On Child Clicked' },
                     { key: 'onChildDoubleClick', name: 'On Child Double Clicked' },
@@ -195,7 +195,7 @@ export class CollectionView extends ViewBoxAnnotatableComponent<CollectionViewPr
 
             if (!Doc.noviceMode) {
                 const more = cm.findByDescription('More...');
-                const moreItems = more && 'subitems' in more ? more.subitems : [];
+                const moreItems = more?.subitems ?? [];
                 moreItems.push({ description: 'Export Image Hierarchy', icon: 'columns', event: () => ImageUtils.ExportHierarchyToFileSystem(this.Document) });
                 !more && cm.addItem({ description: 'More...', subitems: moreItems, icon: 'hand-point-right' });
             }
-- 
cgit v1.2.3-70-g09d2


From 69e9940f4fa24fd1ab1d9715f60b27d9e1f1221a Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 20 Aug 2024 21:34:58 -0400
Subject: from last

---
 src/client/views/collections/CollectionView.tsx | 3 +--
 src/client/views/nodes/ImageBox.tsx             | 8 +-------
 2 files changed, 2 insertions(+), 9 deletions(-)

(limited to 'src/client/views/collections/CollectionView.tsx')

diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx
index 66c4896c0..ab93abab6 100644
--- a/src/client/views/collections/CollectionView.tsx
+++ b/src/client/views/collections/CollectionView.tsx
@@ -17,6 +17,7 @@ import { ViewBoxAnnotatableComponent } from '../DocComponent';
 import { FieldView } from '../nodes/FieldView';
 import { OpenWhere } from '../nodes/OpenWhere';
 import { CollectionCalendarView } from './CollectionCalendarView';
+import { CollectionCardView } from './CollectionCardDeckView';
 import { CollectionCarousel3DView } from './CollectionCarousel3DView';
 import { CollectionCarouselView } from './CollectionCarouselView';
 import { CollectionDockingView } from './CollectionDockingView';
@@ -33,8 +34,6 @@ import { CollectionLinearView } from './collectionLinear';
 import { CollectionMulticolumnView } from './collectionMulticolumn/CollectionMulticolumnView';
 import { CollectionMultirowView } from './collectionMulticolumn/CollectionMultirowView';
 import { CollectionSchemaView } from './collectionSchema/CollectionSchemaView';
-import { CollectionCardView } from './CollectionCardDeckView';
-import { DocData } from '../../../fields/DocSymbols';
 
 @observer
 export class CollectionView extends ViewBoxAnnotatableComponent<CollectionViewProps>() {
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index 7d8a4ee49..d0a7fc6ac 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -1,6 +1,5 @@
 import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
 import { Tooltip } from '@mui/material';
-import zIndex from '@mui/material/styles/zIndex';
 import { Colors } from 'browndash-components';
 import { action, computed, IReactionDisposer, makeObservable, observable, ObservableMap, reaction } from 'mobx';
 import { observer } from 'mobx-react';
@@ -11,7 +10,6 @@ import { Doc, DocListCast, Opt } from '../../../fields/Doc';
 import { DocData } from '../../../fields/DocSymbols';
 import { Id } from '../../../fields/FieldSymbols';
 import { InkTool } from '../../../fields/InkField';
-import { List } from '../../../fields/List';
 import { ObjectField } from '../../../fields/ObjectField';
 import { Cast, ImageCast, NumCast, StrCast } from '../../../fields/Types';
 import { ImageField } from '../../../fields/URLField';
@@ -22,6 +20,7 @@ import { DocumentType } from '../../documents/DocumentTypes';
 import { DocUtils } from '../../documents/DocUtils';
 import { Networking } from '../../Network';
 import { DragManager } from '../../util/DragManager';
+import { SnappingManager } from '../../util/SnappingManager';
 import { undoBatch } from '../../util/UndoManager';
 import { CollectionFreeFormView } from '../collections/collectionFreeForm/CollectionFreeFormView';
 import { ContextMenu } from '../ContextMenu';
@@ -37,7 +36,6 @@ import { FieldView, FieldViewProps } from './FieldView';
 import { FocusViewOptions } from './FocusViewOptions';
 import './ImageBox.scss';
 import { OpenWhere } from './OpenWhere';
-import { SnappingManager } from '../../util/SnappingManager';
 
 export class ImageEditorData {
     // eslint-disable-next-line no-use-before-define
@@ -176,10 +174,6 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
                     Doc.SetNativeHeight(this.dataDoc, Doc.NativeHeight(targetDoc), this.fieldKey);
                 }
             }
-            const layoutDoc = de.complete.docDragData?.draggedDocuments[0];
-            const targetField = Doc.LayoutFieldKey(layoutDoc);
-            const targetDoc = layoutDoc[DocData];
-            console.log(targetDoc[targetField]);
             added === false && e.preventDefault();
             added !== undefined && e.stopPropagation();
             return added;
-- 
cgit v1.2.3-70-g09d2

