{"version":3,"file":"CodeBlock.DSh4ikjp.mjs","names":["useState","startTransition"],"sources":["https:/framerusercontent.com/modules/0JEoOlBclhkCR8Qd8e5P/b995qvsWbwbv6EUkmzD4/CodeBlock.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Matches the article spec: Inter Variable for UI, 13px monospace for the copyable text.\nconst UI_FONT='\"Inter Variable\", \"Inter\", \"Inter Placeholder\", sans-serif';const MONO='ui-monospace, SFMono-Regular, Menlo, Consolas, \"Liberation Mono\", monospace';const LINE=\"rgb(235, 235, 235)\";/**\n * Code Block — a copyable plain-text block (e.g. a brief template) with a \"Copy\" button.\n * Renders a real <pre> so the text stays crawlable; long lines wrap on mobile.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */function CodeBlockInner(props){const{code=\"Template text\",label=\"Template\",copyLabel=\"Copy\",style}=props;const[copied,setCopied]=useState(false);const copy=async()=>{if(typeof navigator===\"undefined\"||!navigator.clipboard)return;try{await navigator.clipboard.writeText(code);startTransition(()=>setCopied(true));window.setTimeout(()=>startTransition(()=>setCopied(false)),2e3);}catch(e){// Clipboard can be blocked (e.g. insecure context); leave the text selectable.\n}};return /*#__PURE__*/_jsxs(\"figure\",{style:{...style,position:\"relative\",width:\"100%\",margin:0,border:`1px solid ${LINE}`,borderRadius:12,background:\"rgb(247, 247, 247)\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsxs(\"figcaption\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",gap:12,padding:\"10px 12px 10px 16px\",borderBottom:`1px solid ${LINE}`,fontFamily:UI_FONT,fontSize:13,fontWeight:560,letterSpacing:\"-0.09px\",color:\"rgba(17, 17, 17, 0.6)\"},children:[/*#__PURE__*/_jsx(\"span\",{children:label}),/*#__PURE__*/_jsx(\"button\",{type:\"button\",onClick:copy,\"aria-live\":\"polite\",style:{fontFamily:UI_FONT,fontSize:13,fontWeight:560,color:\"#111\",background:\"#fff\",border:\"1px solid rgba(17, 17, 17, 0.15)\",borderRadius:300,padding:\"5px 14px\",cursor:\"pointer\",minWidth:\"max-content\"},children:copied?\"Copied\":copyLabel})]}),/*#__PURE__*/_jsx(\"pre\",{style:{margin:0,padding:\"16px\",fontFamily:MONO,fontSize:13,lineHeight:\"20px\",color:\"#111\",whiteSpace:\"pre-wrap\",overflowWrap:\"anywhere\"},children:/*#__PURE__*/_jsx(\"code\",{children:code})})]});}/**\n * Code Block — a copyable plain-text block (e.g. a brief template) with a \"Copy\" button.\n * Renders a real <pre> so the text stays crawlable; long lines wrap on mobile.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */export default function CodeBlock(props){const{blockSpacing=0,style,...rest}=props;if(!blockSpacing)return /*#__PURE__*/_jsx(CodeBlockInner,{...props});// Extra vertical room when embedded in CMS rich text, matching the 24px gap used on canvas pages.\nreturn /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",width:\"100%\",paddingTop:blockSpacing,paddingBottom:blockSpacing},children:/*#__PURE__*/_jsx(CodeBlockInner,{...rest})});}addPropertyControls(CodeBlock,{code:{type:ControlType.String,title:\"Code\",displayTextArea:true,defaultValue:\"Template text\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Template\"},copyLabel:{type:ControlType.String,title:\"Button\",defaultValue:\"Copy\"},blockSpacing:{type:ControlType.Number,title:\"Block Spacing\",defaultValue:0,min:0,max:64,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CodeBlock\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CodeBlock.map"],"mappings":"6MAOG,SAAS,EAAe,EAAM,CAAC,GAAK,CA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