From 776c9cd88fc0799426ced87f36cb215dfdc1854b Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 30 Apr 2024 17:59:40 -0400
Subject: unwinding some import cycles.  added PinFuncs and
 .from(dv:DocumentView) for CollectionFreeForm stiuff

---
 src/client/views/nodes/CollectionFreeFormDocumentView.tsx | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'src/client/views/nodes/CollectionFreeFormDocumentView.tsx')

diff --git a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
index 7b1847ae4..9c4d748bd 100644
--- a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
+++ b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
@@ -38,6 +38,7 @@ interface freeFormProps {
     highlight?: boolean;
     transition?: string;
 }
+
 export interface CollectionFreeFormDocumentViewProps extends DocumentViewProps {
     RenderCutoffProvider: (doc: Doc) => boolean;
     CollectionFreeFormView: CollectionFreeFormView;
@@ -63,6 +64,9 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
     ]; // fields that are configured to be animatable using animation frames
     public static animStringFields = ['backgroundColor', 'color', 'fillColor']; // fields that are configured to be animatable using animation frames
     public static animDataFields = (doc: Doc) => (Doc.LayoutFieldKey(doc) ? [Doc.LayoutFieldKey(doc)] : []); // fields that are configured to be animatable using animation frames
+    public static from(dv?: DocumentView) {
+        return dv?._props.parent instanceof CollectionFreeFormDocumentView ? dv._props.parent : undefined;
+    }
 
     constructor(props: CollectionFreeFormDocumentViewProps & freeFormProps) {
         super(props);
@@ -273,6 +277,7 @@ export class CollectionFreeFormDocumentView extends DocComponent<CollectionFreeF
                     <div style={{ position: 'absolute', width: this.PanelWidth(), height: this.PanelHeight(), background: 'lightGreen' }} />
                 ) : (
                     <DocumentView
+                        parent={this}
                         // eslint-disable-next-line react/jsx-props-no-spreading
                         {...OmitKeys(this._props,this.WrapperKeys.map(val => val.lower)).omit} // prettier-ignore
                         DataTransition={this.DataTransition}
-- 
cgit v1.2.3-70-g09d2

