diff options
| author | Sophie Zhang <sophie_zhang@brown.edu> | 2023-12-06 22:06:16 -0500 |
|---|---|---|
| committer | Sophie Zhang <sophie_zhang@brown.edu> | 2023-12-06 22:06:16 -0500 |
| commit | f59e343553878029d846e5eae2963fc9c3481b13 (patch) | |
| tree | c8fc80a059841664aeb79f09f26217737494aa4c /src/client/views/collections/collectionFreeForm | |
| parent | 7bde1b066a68fca6202b3f42c1cb54aa85c13890 (diff) | |
types
Diffstat (limited to 'src/client/views/collections/collectionFreeForm')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 21 |
1 files changed, 4 insertions, 17 deletions
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) => { |
