From f59e343553878029d846e5eae2963fc9c3481b13 Mon Sep 17 00:00:00 2001
From: Sophie Zhang <sophie_zhang@brown.edu>
Date: Wed, 6 Dec 2023 22:06:16 -0500
Subject: types

---
 .../collectionFreeForm/CollectionFreeFormView.tsx   | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)

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

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index f5ba0de96..2ac8f6291 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -52,7 +52,7 @@ import { CollectionFreeFormRemoteCursors } from './CollectionFreeFormRemoteCurso
 import './CollectionFreeFormView.scss';
 import { MarqueeView } from './MarqueeView';
 import React = require('react');
-import { DocumentWithColor, GeneratedResponse, generatePalette } from '../../../apis/gpt/customization';
+import { DocumentWithColor, GeneratedResponse, generatePalette, StyleInput, StyleInputDocument } from '../../../apis/gpt/customization';
 import { PropertiesView } from '../../PropertiesView';
 import { MainView } from '../../MainView';
 import { ExtractColors } from '../../ExtractColors';
@@ -1824,6 +1824,8 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
         this.openProperties();
         PropertiesView.Instance.setGeneratedStyles([]);
         PropertiesView.Instance.selectedStyle = -1;
+        PropertiesView.Instance.useImageData = false;
+
         console.log('Title', this.rootDoc.title);
         console.log('bgcolor', this.layoutDoc._backgroundColor);
         // doc.backgroundColor
@@ -1842,7 +1844,7 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
         PropertiesView.Instance?.setInputDocs(inputDocs);
 
         // also pass it colors
-        const gptInput = inputDocs.map((doc, i) => ({
+        const gptInput: StyleInputDocument[] = inputDocs.map((doc, i) => ({
             id: i,
             textContent: (doc.text as RichTextField)?.Text,
             textSize: 16,
@@ -1858,21 +1860,6 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
 
         PropertiesView.Instance.styleInput = styleInput;
         PropertiesView.Instance.gptStyling();
-
-        // try {
-        //     const res = await generatePalette(styleInput);
-        //     if (typeof res === 'string') {
-        //         console.log(res);
-        //         const resObj = JSON.parse(res) as GeneratedResponse[];
-        //         PropertiesView.Instance.setGeneratedStyles(resObj);
-        //         // const resObj = JSON.parse(res) as GeneratedResponse;
-        //         // console.log('Result ', resObj);
-        //         // this.rootDoc.backgroundColor = resObj.collectionBackgroundColor;
-        //         // (resObj.documentsWithColors).forEach((elem, i) => (inputDocs[i].backgroundColor = elem.color));
-        //     }
-        // } catch (err) {
-        //     console.error(err);
-        // }
     };
 
     onContextMenu = (e: React.MouseEvent) => {
-- 
cgit v1.2.3-70-g09d2

