{"version":3,"file":"LineNumberColumn.DdbZuaSS.mjs","names":["useRef","useState","useMemo"],"sources":["https:/framerusercontent.com/modules/3n4CrOZiXYkZLJYsEG6h/0WNT6Ffm3y7SpFSuvbq2/LineNumberColumn.js"],"sourcesContent":["// Create a narrow vertical column on the left side of the page that automatically generates line numbers based on the height of the page. Numbers use monospaced font, #6A6A6A, 12-14px. Align with rows on right and update on resize. Scrollable when needed.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useRef,useState,useEffect,startTransition,useMemo}from\"react\";/**\n * LineNumberColumn – auto-generating line numbers column\n *\n * @framerIntrinsicWidth 40\n * @framerIntrinsicHeight 100\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function LineNumberColumn(props){const{lineHeight,textColor,font,startNumber,style}=props;const containerRef=useRef(null);const[count,setCount]=useState(1);const isStatic=useIsStaticRenderer();// Update count when height or lineHeight changes\nuseEffect(()=>{if(!containerRef.current)return;const updateCount=()=>{let h=containerRef.current?.getBoundingClientRect().height||0;if(typeof document!==\"undefined\"){// Account for full document height, not just body scroll height\nconst doc=document.documentElement;const docHeight=Math.max(doc.scrollHeight,doc.offsetHeight,document.body?.scrollHeight||0,document.body?.offsetHeight||0,window.innerHeight||0);h=Math.max(h,docHeight);}const newCount=Math.max(1,Math.ceil(h/Math.max(4,lineHeight)));startTransition(()=>setCount(newCount));};updateCount();const observers=[];if(typeof ResizeObserver!==\"undefined\"){const ro=new ResizeObserver(updateCount);ro.observe(containerRef.current);observers.push(()=>ro.disconnect());// Also observe documentElement to capture page height changes\nro.observe(document.documentElement);}// Fallback: listen to window resize events for environments without ResizeObserver on document\nconst onResize=()=>updateCount();window.addEventListener(\"resize\",onResize);observers.push(()=>window.removeEventListener(\"resize\",onResize));return()=>{observers.forEach(disconnect=>disconnect());};},[lineHeight]);const numbers=useMemo(()=>{return Array.from({length:count},(_,i)=>startNumber+i);},[count,startNumber]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflowY:\"hidden\",background:\"transparent\",...style},children:/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:\"column\",alignItems:\"flex-end\",paddingRight:8,boxSizing:\"border-box\"},children:numbers.map(n=>/*#__PURE__*/_jsx(\"span\",{style:{height:lineHeight,lineHeight:`${lineHeight}px`,color:textColor,whiteSpace:\"pre\",fontFamily:font?.fontFamily,fontSize:font?.fontSize||12,letterSpacing:font?.letterSpacing,fontWeight:font?.fontWeight,fontStyle:font?.fontStyle,textAlign:\"right\",userSelect:\"none\"},children:n},n))})});}addPropertyControls(LineNumberColumn,{lineHeight:{type:ControlType.Number,title:\"Line Height\",defaultValue:20,min:8,max:40,unit:\"px\"},startNumber:{type:ControlType.Number,title:\"Start\",defaultValue:1,min:0,step:1},textColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#6A6A6A\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"monospace\",defaultValue:{fontSize:\"12px\",variant:\"Regular\",letterSpacing:\"0em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LineNumberColumn\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"40\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"100\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LineNumberColumn.map"],"mappings":"uNASG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,aAAW,YAAU,OAAK,cAAY,SAAO,EAAY,EAAaA,EAAO,KAAK,CAAM,CAAC,EAAM,GAAUC,EAAS,EAAE,CAAgB,GAAqB,CAClN,MAAc,CAAC,GAAG,CAAC,EAAa,QAAQ,OAAO,I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