import { BaseBoxShapeUtil, HTMLContainer, TLBaseShape, } from "tldraw" import React, { useState, useRef, useEffect, useMemo, useCallback } from "react" import { useWhisperTranscription } from "../hooks/useWhisperTranscriptionSimple" import { useWebSpeechTranscription } from "../hooks/useWebSpeechTranscription" import { StandardizedToolWrapper } from "../components/StandardizedToolWrapper" import { usePinnedToView } from "../hooks/usePinnedToView" type ITranscription = TLBaseShape< "Transcription", { w: number h: number text: string isEditing?: boolean editingContent?: string isTranscribing?: boolean isPaused?: boolean fixedHeight?: boolean // New property to control resizing pinnedToView: boolean tags: string[] } > // Auto-resizing textarea component (similar to ObsNoteShape) const AutoResizeTextarea: React.FC<{ value: string onChange: (value: string) => void onBlur: () => void onKeyDown: (e: React.KeyboardEvent) => void style: React.CSSProperties placeholder?: string onPointerDown?: (e: React.PointerEvent) => void onWheel?: (e: React.WheelEvent) => void }> = ({ value, onChange, onBlur, onKeyDown, style, placeholder, onPointerDown, onWheel }) => { const textareaRef = useRef(null) useEffect(() => { // Focus the textarea when it mounts if (textareaRef.current) { textareaRef.current.focus() } }, [value]) return (