diff options
| author | eleanor-park <eleanor_park@brown.edu> | 2024-08-28 22:03:12 -0400 |
|---|---|---|
| committer | eleanor-park <eleanor_park@brown.edu> | 2024-08-28 22:03:12 -0400 |
| commit | f7cdcb654e83d7fdbfd0b1cfc80c485bb9554f08 (patch) | |
| tree | 4c01c7190246073f3da70278bf0c3be836ce2377 /src/client/views/smartdraw/AnnotationPalette.tsx | |
| parent | f5b04341893da68e50b0cbc72d77795209bfee3e (diff) | |
final changes, ready for pull request
Diffstat (limited to 'src/client/views/smartdraw/AnnotationPalette.tsx')
| -rw-r--r-- | src/client/views/smartdraw/AnnotationPalette.tsx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/client/views/smartdraw/AnnotationPalette.tsx b/src/client/views/smartdraw/AnnotationPalette.tsx index b57907152..c296138a8 100644 --- a/src/client/views/smartdraw/AnnotationPalette.tsx +++ b/src/client/views/smartdraw/AnnotationPalette.tsx @@ -1,4 +1,3 @@ -import { faLaptopHouse } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Slider, Switch } from '@mui/material'; import { Button } from 'browndash-components'; @@ -16,9 +15,8 @@ import { Docs } from '../../documents/Documents'; import { makeUserTemplateImage } from '../../util/DropConverter'; import { SettingsManager } from '../../util/SettingsManager'; import { Transform } from '../../util/Transform'; -import { undoable, undoBatch } from '../../util/UndoManager'; -import { CollectionFreeFormView, MarqueeOptionsMenu, MarqueeView } from '../collections/collectionFreeForm'; -import { ActiveArrowEnd, ActiveArrowStart, ActiveDash, ActiveFillColor, ActiveInkBezierApprox, ActiveInkColor, ActiveIsInkMask, DocumentView, DocumentViewInternal } from '../nodes/DocumentView'; +import { undoBatch } from '../../util/UndoManager'; +import { DocumentView, DocumentViewInternal } from '../nodes/DocumentView'; import { FieldView } from '../nodes/FieldView'; import { ObservableReactComponent } from '../ObservableReactComponent'; import { DefaultStyleProvider } from '../StyleProvider'; @@ -26,7 +24,6 @@ import './AnnotationPalette.scss'; import { DrawingOptions, SmartDrawHandler } from './SmartDrawHandler'; import { DocumentType } from '../../documents/DocumentTypes'; import { ImageField } from '../../../fields/URLField'; -import { CollectionCarousel3DView } from '../collections/CollectionCarousel3DView'; import { Copy } from '../../../fields/FieldSymbols'; interface AnnotationPaletteProps { @@ -45,7 +42,7 @@ export class AnnotationPalette extends ObservableReactComponent<AnnotationPalett @observable private _opts: DrawingOptions = { text: '', complexity: 5, size: 200, autoColor: true, x: 0, y: 0 }; private _gptRes: string[] = []; - constructor(props: any) { + constructor(props: AnnotationPaletteProps) { super(props); makeObservable(this); } @@ -140,7 +137,7 @@ export class AnnotationPalette extends ObservableReactComponent<AnnotationPalett generateDrawings = action(async () => { this._isLoading = true; this._props.Document[DocData].data = undefined; - for (var i = 0; i < 3; i++) { + for (let i = 0; i < 3; i++) { try { SmartDrawHandler.Instance.AddDrawing = this.addDrawing; this._canInteract = false; @@ -150,9 +147,10 @@ export class AnnotationPalette extends ObservableReactComponent<AnnotationPalett await SmartDrawHandler.Instance.drawWithGPT({ X: 0, Y: 0 }, this._userInput, this._opts.complexity, this._opts.size, this._opts.autoColor); } } catch (e) { - console.log('Error generating drawing'); + console.log('Error generating drawing', e); } } + // eslint-disable-next-line @typescript-eslint/no-unused-expressions this._opts.text !== '' ? (this._opts.text = `${this._opts.text} ~~~ ${this._userInput}`) : (this._opts.text = this._userInput); this._userInput = ''; this._isLoading = false; |
