diff options
Diffstat (limited to 'src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx')
-rw-r--r-- | src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx index 245a8124c..0d2f4c538 100644 --- a/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx +++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu.tsx @@ -30,6 +30,7 @@ import { CollectionViewType } from '../../../documents/DocumentTypes'; import { dropActionType } from '../../../util/DropActionTypes'; import { ImageBox } from '../ImageBox'; import { a } from '@react-spring/web'; +import { RichTextMenu } from '../formattedText/RichTextMenu'; export enum LayoutType { Stacked = 'stacked', @@ -427,7 +428,7 @@ export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> { // this.createEmptyTemplate(temp, assignments); - console.log(this.assignColsToFields([TemplateLayouts.FourField001, TemplateLayouts.FourField002], this.fieldsInfos)); + this.generatePresetTemplates([TemplateLayouts.FourField001, TemplateLayouts.FourField002], this.fieldsInfos); }; @action addField = () => { @@ -646,7 +647,6 @@ export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> { const res = await gptAPICall(prompt, GPTCallType.TEMPLATE); if (res && this._callCount === origCount) { - console.log('first stage') this._GPTLoading = false; const assignments: {[templateTitle: string]: {[field: string]: string}} = JSON.parse(res); console.log(assignments); @@ -673,7 +673,10 @@ export class DocCreatorMenu extends ObservableReactComponent<FieldViewProps> { }; generatePresetTemplates = async(templates: TemplateDocInfos[], cols: Col[]) => { - + const assignments: [TemplateDocInfos, {[field: number]: Col}][] = await this.assignColsToFields(templates, cols); + assignments.forEach(([template, assignments]) => { + this.createEmptyTemplate(template, assignments); + }); } get templatesPreviewContents(){ @@ -1268,7 +1271,7 @@ export class FieldFuncs { y: coord.y, _text_fontSize: `${height/2}` , backgroundColor: opts.backgroundColor ?? '', - color: opts.color, + text_fontColor: opts.color, _layout_borderRounding: `${opts.cornerRounding}px` ?? '0px', borderColor: opts.borderColor, borderWidth: opts.borderWidth, @@ -1285,7 +1288,7 @@ export class FieldFuncs { const bool = true; - const docWithBasicOpts = (Docs.Create.TextDocument)(content, { + const docWithBasicOpts = (Docs.Create.TextDocument)('hi', { _height: height, _width: width, title: title, @@ -1293,6 +1296,7 @@ export class FieldFuncs { y: coord.y, _text_fontSize: `${height/2}` , backgroundColor: opts.backgroundColor ?? '', + text_fontColor: opts.color, color: opts.color, _layout_borderRounding: `${opts.cornerRounding}px` ?? '0px', borderColor: opts.borderColor, @@ -1302,6 +1306,8 @@ export class FieldFuncs { _rotation: opts.rotation, }); + //setTimeout(() => {console.log('called', RichTextMenu.Instance), RichTextMenu.Instance?.setFontField('#4CE4D4', 'fontColor')}, 2000); + return docWithBasicOpts; } @@ -1316,7 +1322,7 @@ export class FieldFuncs { y: coord.y, _text_fontSize: `${height/2}` , backgroundColor: opts.backgroundColor ?? '', - color: opts.color, + text_fontColor: opts.color, _layout_borderRounding: `${opts.cornerRounding}px` ?? '0px', borderColor: opts.borderColor, borderWidth: opts.borderWidth, @@ -1375,6 +1381,8 @@ export class TemplateLayouts { description: 'A title field for very short text that contextualizes the content.', opts: { backgroundColor: 'transparent', + color: '#2DBEAD', + contentXCentering: 'center', } }, { tl: [-.87, -.83], |