diff options
| author | bobzel <zzzman@gmail.com> | 2025-03-06 16:17:47 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2025-03-06 16:17:47 -0500 |
| commit | 5ad858090f3006631062877d90120e3cc505fada (patch) | |
| tree | 9f87a8e1e7098a1025f6f4aac332dbc854db5be3 /src/client/views/DocumentButtonBar.tsx | |
| parent | 9c2a7c14fd9d0e44609aab30c6323583162009db (diff) | |
| parent | adaa107aac8558fa6f46e6ba1263c650c212d506 (diff) | |
Merge branch 'master' into aarav_edit
Diffstat (limited to 'src/client/views/DocumentButtonBar.tsx')
| -rw-r--r-- | src/client/views/DocumentButtonBar.tsx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx index a9f03a658..b17dbc93d 100644 --- a/src/client/views/DocumentButtonBar.tsx +++ b/src/client/views/DocumentButtonBar.tsx @@ -28,6 +28,7 @@ import { DocumentLinksButton } from './nodes/DocumentLinksButton'; import { DocumentView } from './nodes/DocumentView'; import { OpenWhere } from './nodes/OpenWhere'; import { DashFieldView } from './nodes/formattedText/DashFieldView'; +import { SmartDrawHandler } from './smartdraw/SmartDrawHandler'; @observer export class DocumentButtonBar extends ObservableReactComponent<{ views: () => (DocumentView | undefined)[]; stack?: unknown }> { @@ -319,7 +320,22 @@ export class DocumentButtonBar extends ObservableReactComponent<{ views: () => ( const targetDoc = this.view0?.Document; return !targetDoc ? null : ( <Tooltip title={<div className="dash-ai-editor-button">Edit with AI</div>}> - <div className="documentButtonBar-icon" style={{ color: 'white' }} onClick={undoable(() => this.view0?.toggleAIEditor(), 'toggle AI editor')}> + <div + className="documentButtonBar-icon" + style={{ color: 'white' }} + onPointerDown={e => + setupMoveUpEvents( + this, + e, + me => { + this.view0?.docViewPath().slice(-2)[0]?.ComponentView?.showSmartDraw?.(me.x, me.y, true); + SmartDrawHandler.Instance.startDragging(me); + return true; + }, + emptyFunction, + undoable(() => this.view0?.toggleAIEditor(), 'toggle AI editor') + ) + }> <FontAwesomeIcon className="documentdecorations-icon" icon="robot" /> </div> </Tooltip> |
