diff options
Diffstat (limited to 'src/client/views')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 1e0840495..19948b7eb 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -1649,15 +1649,22 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection return url.href.replace(ext, '_m' + ext); } + @action + smartLayout = async () => {}; + + roundToRoundNumber = (num: number) => { + return Math.round(num / 10) * 10; + }; + // gpt layout @action gptLayout = async () => { const docLayouts = this.childDocs.map(doc => ({ - width: NumCast(doc.width), - height: NumCast(doc.height), - content: StrCast(doc.title), + width: this.roundToRoundNumber(NumCast(doc.width)), + height: this.roundToRoundNumber(NumCast(doc.height)), + // content: StrCast(doc.title), })); - console.log(docLayouts); + console.log('Doc layouts', docLayouts); const res = await smartLayout2(docLayouts); console.log('Smart layout result', res); @@ -1752,6 +1759,7 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection // Want to condense into a Smart Organize button this._props.renderDepth && optionItems.push({ description: 'Style with AI', event: this.gptStyling, icon: 'paint-brush' }); this._props.renderDepth && optionItems.push({ description: 'Smart Layout', event: this.gptLayout, icon: 'object-group' }); + // this._props.renderDepth && optionItems.push({ description: 'Smart Organize', event: this.smartOrganize, icon: 'object-group' }); if (!Doc.noviceMode) { optionItems.push({ description: (!Doc.NativeWidth(this.layoutDoc) || !Doc.NativeHeight(this.layoutDoc) ? 'Freeze' : 'Unfreeze') + ' Aspect', event: this.toggleNativeDimensions, icon: 'snowflake' }); } |
