import { BaseBoxShapeUtil, HTMLContainer, TLBaseShape, } from "tldraw" import React, { useState, useRef, useEffect, useCallback } from "react" import { holosphereService, HoloSphereService, HolonConnection } from "@/lib/HoloSphereService" import * as h3 from 'h3-js' import { StandardizedToolWrapper } from "../components/StandardizedToolWrapper" import { usePinnedToView } from "../hooks/usePinnedToView" import { useMaximize } from "../hooks/useMaximize" type IHolon = TLBaseShape< "Holon", { w: number h: number name: string description?: string latitude: number longitude: number resolution: number holonId: string isConnected: boolean isEditing?: boolean editingName?: string editingDescription?: string selectedLens?: string data: Record connections: HolonConnection[] lastUpdated: number pinnedToView: boolean tags: string[] } > // Auto-resizing textarea component for editing 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) // Removed auto-focus - textarea will only focus when user explicitly clicks on it // This prevents text boxes from being selected when shapes are created/recreated return (