From 4574b7f03ccc85c4bebdbfd9475788456086704f Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 8 Aug 2024 12:27:40 -0400
Subject: many changes to add typing in place of 'any's etc

---
 src/client/views/collections/CollectionSubView.tsx | 23 ++--------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

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

diff --git a/src/client/views/collections/CollectionSubView.tsx b/src/client/views/collections/CollectionSubView.tsx
index b7169ece0..5782d407e 100644
--- a/src/client/views/collections/CollectionSubView.tsx
+++ b/src/client/views/collections/CollectionSubView.tsx
@@ -22,7 +22,7 @@ import { DragManager } from '../../util/DragManager';
 import { dropActionType } from '../../util/DropActionTypes';
 import { ImageUtils } from '../../util/Import & Export/ImageUtils';
 import { SnappingManager } from '../../util/SnappingManager';
-import { UndoManager, undoBatch } from '../../util/UndoManager';
+import { UndoManager } from '../../util/UndoManager';
 import { ViewBoxBaseComponent } from '../DocComponent';
 import { FieldViewProps } from '../nodes/FieldView';
 import { DocumentView } from '../nodes/DocumentView';
@@ -227,7 +227,6 @@ export function CollectionSubView<X>() {
             }
         }
 
-        @undoBatch
         // eslint-disable-next-line @typescript-eslint/no-unused-vars
         protected onGesture(e: Event, ge: GestureUtils.GestureEvent) {}
 
@@ -294,7 +293,6 @@ export function CollectionSubView<X>() {
             return false;
         }
 
-        @undoBatch
         protected async onExternalDrop(e: React.DragEvent, options: DocumentOptions, completed?: (docs: Doc[]) => void) {
             if (e.ctrlKey) {
                 e.stopPropagation(); // bcz: this is a hack to stop propagation when dropping an image on a text document with shift+ctrl
@@ -386,7 +384,7 @@ export function CollectionSubView<X>() {
                         addDocument(htmlDoc);
                         if (srcWeb) {
                             const iframe = DocumentView.Selected()[0].ContentDiv?.getElementsByTagName('iframe')?.[0];
-                            const focusNode = iframe?.contentDocument?.getSelection()?.focusNode as any;
+                            const focusNode = iframe?.contentDocument?.getSelection()?.focusNode;
                             if (focusNode) {
                                 const anchor = srcWeb?.ComponentView?.getAnchor?.(true);
                                 anchor && DocUtils.MakeLink(htmlDoc, anchor, {});
@@ -465,23 +463,6 @@ export function CollectionSubView<X>() {
                 if (item.kind === 'file') {
                     const file = item.getAsFile();
                     file?.type && files.push(file);
-
-                    file?.type === 'application/json' &&
-                        ClientUtils.readUploadedFileAsText(file).then(result => {
-                            const json = JSON.parse(result as string);
-                            addDocument(
-                                Docs.Create.TreeDocument(
-                                    json['rectangular-puzzle'].crossword.clues[0].clue.map((c: any) => {
-                                        const label = Docs.Create.LabelDocument({ title: c['#text'], _width: 120, _height: 20 });
-                                        const proto = Doc.GetProto(label);
-                                        proto._width = 120;
-                                        proto._height = 20;
-                                        return proto;
-                                    }),
-                                    { _width: 150, _height: 600, title: 'across', backgroundColor: 'white', _createDocOnCR: true }
-                                )
-                            );
-                        });
                 }
             }
             this.slowLoadDocuments(files, options, generatedDocuments, text, completed, addDocument).then(batch.end);
-- 
cgit v1.2.3-70-g09d2

