{"version":3,"file":"Side_ruler.BAbprzrd.mjs","names":["useRef","useState","useLayoutEffect","useEffect"],"sources":["https:/framerusercontent.com/modules/skl08NaZWjPs9CKG281Q/qLZ1wvIWAhZ772g82wuV/Side_ruler.js"],"sourcesContent":["// Sidebar Ruler\n// Created by Frankie from Framer-Expert.com\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useLayoutEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// useLayoutEffect warns during SSR; fall back to useEffect on the server.\nconst useIsomorphicLayoutEffect=typeof window!==\"undefined\"?useLayoutEffect:useEffect;export default function SidebarRuler({color=\"#ea4324\",backgroundColor=\"#f4f1eb\",width=48,rowHeight=10,labelEvery=100,side=\"right\",borderTop=false,borderBottom=false,borderLeft=false,borderRight=true}){// Previously this rendered a fixed 20000px worth of labels on every page, so\n// ~150 of them sat below the content and were clipped by overflow: hidden.\n// Measure the rendered height instead and emit only the labels that exist.\nconst hostRef=useRef(null);const[renderedHeight,setRenderedHeight]=useState(1200);useIsomorphicLayoutEffect(()=>{const host=hostRef.current;if(!host)return;const measure=()=>setRenderedHeight(host.offsetHeight);measure();if(typeof ResizeObserver===\"undefined\")return;const observer=new ResizeObserver(measure);observer.observe(host);return()=>observer.disconnect();},[labelEvery]);const labelRows=Array.from({length:Math.max(0,Math.ceil(renderedHeight/labelEvery))},(_,i)=>i*labelEvery);const line=`1px solid ${color}`;return /*#__PURE__*/_jsx(\"div\",{ref:hostRef,style:{width,// fill whatever container it's placed in\nheight:\"100%\",minHeight:\"100%\",backgroundColor,borderTop:borderTop?line:\"none\",borderBottom:borderBottom?line:\"none\",borderLeft:borderLeft?line:\"none\",borderRight:borderRight?line:\"none\",flexShrink:0,position:\"relative\",overflow:\"hidden\",backgroundImage:`repeating-linear-gradient(\n                    to bottom,\n                    ${color} 0px,\n                    ${color} 1px,\n                    transparent 1px,\n                    transparent ${rowHeight}px\n                )`,backgroundRepeat:\"repeat-y\",backgroundSize:\"100% auto\",boxSizing:\"border-box\"},children:labelRows.map(px=>/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:px,left:0,width:\"100%\",height:rowHeight,display:\"flex\",alignItems:\"center\",justifyContent:side===\"right\"?\"flex-end\":\"flex-start\",paddingRight:side===\"right\"?4:0,paddingLeft:side===\"left\"?4:0,boxSizing:\"border-box\",zIndex:1},children:/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:\"monospace\",fontSize:8,lineHeight:1,color,opacity:.55,userSelect:\"none\",backgroundColor,padding:\"0 1px\"},children:px})},px))});}SidebarRuler.defaultProps={color:\"#ea4324\",backgroundColor:\"#f4f1eb\",width:48,rowHeight:10,labelEvery:100,side:\"right\",borderTop:false,borderBottom:false,borderLeft:false,borderRight:true};addPropertyControls(SidebarRuler,{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#ea4324\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#f4f1eb\"},width:{type:ControlType.Number,title:\"Width\",defaultValue:48,min:24,max:120,step:4,displayStepper:true},rowHeight:{type:ControlType.Number,title:\"Row Height (px)\",defaultValue:10,min:4,max:40,step:2,displayStepper:true},labelEvery:{type:ControlType.Number,title:\"Label Every (px)\",defaultValue:100,min:20,max:500,step:20,displayStepper:true},side:{type:ControlType.Enum,title:\"Label Side\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"],defaultValue:\"right\"},borderTop:{type:ControlType.Boolean,title:\"Border Top\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},borderBottom:{type:ControlType.Boolean,title:\"Border Bottom\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},borderLeft:{type:ControlType.Boolean,title:\"Border Left\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},borderRight:{type:ControlType.Boolean,title:\"Border Right\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"}});SidebarRuler.displayName=\"Sidebar Ruler\";\nexport const __FramerMetadata__ = {\"exports\":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