aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index 2562c48e4..da277826a 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -907,7 +907,6 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FieldViewProps
animateRes = (resIndex: number, newText: string) => {
if (resIndex < newText.length) {
const marks = this._editorView?.state.storedMarks ?? [];
- // if (!marks) return;
this._editorView?.dispatch(this._editorView.state.tr.setStoredMarks(marks).insertText(newText[resIndex]).setStoredMarks(marks));
setTimeout(() => {
this.animateRes(resIndex + 1, newText);
@@ -915,19 +914,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FieldViewProps
}
};
- // breakupdictiation for reference
- // prepareForTyping
- // stored marks - userMark and timestamp, setStoredMarks
- // the._editorView.dispatch(state.tr.setSelection(updated).insertText('\n, to))
-
askGPT = action(async () => {
- // const state = this._editorView?.state;
- // if (!state) return;
- // const to = state.selection.to;
- // const updated = TextSelection.create(state.doc, to, to);
- // this._editorView?.dispatch(state.tr.setSelection(updated).insertText('\n', to));
- // this._editorView?.dispatch(this._editorView.state.tr.setStoredMarks(marks).insertText('\nTesting').setStoredMarks(marks));
- // console.log('After ', this._editorView?.state.storedMarks);
try {
let res = await gptAPICall((this.dataDoc.text as RichTextField)?.Text, GPTCallType.COMPLETION);
if (!res) {
@@ -1243,13 +1230,6 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FieldViewProps
RichTextMenu.Instance?.updateMenu(this._editorView, undefined, this.props);
setTimeout(this.autoLink, 20);
}
- // // Accessing editor and text doc for gpt assisted text edits
- // if (this._editorView && selected) {
- // console.log('Setting');
- // GPTPopup.Instance?.setTextAnchor(this.getAnchor(false));
- // // AnchorMenu.Instance?.setEditorView(this._editorView);
- // // AnchorMenu.Instance?.setTextDoc(this.dataDoc);
- // }
}),
{ fireImmediately: true }
);