aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-04-30 17:59:40 -0400
committerbobzel <zzzman@gmail.com>2024-04-30 17:59:40 -0400
commit776c9cd88fc0799426ced87f36cb215dfdc1854b (patch)
tree7197f88a6417eec0a0c94a6c51002ec7e1411958 /src/client/views/nodes/CollectionFreeFormDocumentView.tsx
parentdaeae9db15372b8bd5f5aab387988051341c9209 (diff)
unwinding some import cycles. added PinFuncs and .from(dv:DocumentView) for CollectionFreeForm stiuff
Diffstat (limited to 'src/client/views/nodes/CollectionFreeFormDocumentView.tsx')
-rw-r--r--src/client/views/nodes/CollectionFreeFormDocumentView.tsx5
1 files changed, 5 insertions, 0 deletions
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}