{"version":3,"file":"ArticleSchema.DcMHmVSS.mjs","names":[],"sources":["https:/framerusercontent.com/modules/PAQQByJsYgafCvwmPaBo/wzVF2LBrciGsh7lTngqT/ArticleSchema.js"],"sourcesContent":["// Article Schema Markup for Milemarker Blog Posts\n// Auto-reads article data from the page DOM so it works without CMS prop bindings.\n// Falls back to property control values if DOM reading fails.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * Article Schema Markup\n * Injects JSON-LD structured data for blog posts and articles.\n * Auto-reads headline, description, date, and image from the page DOM.\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ArticleSchema(props){const{authorName=\"Jud Mackrill\",authorUrl=\"https://www.milemarker.co/leadership\",fallbackCategory=\"Wealth Management Technology\",fallbackKeywords=\"wealth management, data integration, AI, wealthtech\",domain=\"https://www.milemarker.co\",enabled=true}=props;useEffect(()=>{if(!enabled)return;if(RenderTarget.current()===RenderTarget.canvas)return;if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const timer=setTimeout(()=>{try{// Read headline from H1\nconst h1=document.querySelector(\"h1\");const headline=h1?.textContent?.trim()||\"\";if(!headline)return;// Read description from first substantial paragraph\nlet description=\"\";const paragraphs=document.querySelectorAll(\"p\");for(const p of paragraphs){const text=p.textContent?.trim()||\"\";if(text.length>60&&!text.match(/^\\w+\\s\\d{1,2},\\s\\d{4}$/)){description=text;break;}}if(description.length>200){description=description.substring(0,200).replace(/\\s+\\S*$/,\"\")+\"...\";}if(!description){description=`${headline} — insights from Milemarker on wealth management technology and data infrastructure.`;}// Read date from time element or text pattern\nlet datePublished=\"\";const timeEl=document.querySelector(\"time\");if(timeEl){datePublished=timeEl.getAttribute(\"datetime\")||timeEl.textContent?.trim()||\"\";}if(!datePublished){// Try to find date-like text (e.g., \"March 6, 2026\")\nconst allText=document.body.innerText;const dateMatch=allText.match(/(?:January|February|March|April|May|June|July|August|September|October|November|December)\\s+\\d{1,2},\\s+\\d{4}/);if(dateMatch){const parsed=new Date(dateMatch[0]);if(!isNaN(parsed.getTime())){datePublished=parsed.toISOString().split(\"T\")[0];}}}if(!datePublished){datePublished=new Date().toISOString().split(\"T\")[0];}// Read image from og:image or first article image\nlet imageUrl=\"\";const ogImage=document.querySelector('meta[property=\"og:image\"]');if(ogImage?.content){imageUrl=ogImage.content;}else{const img=document.querySelector(\"article img, main img, [data-framer-name] img\");if(img?.src)imageUrl=img.src;}// Build canonical URL\nconst path=window.location.pathname.replace(/\\/$/,\"\");const articleUrl=domain+path;// Read keywords from meta tag if available\nlet keywords=fallbackKeywords;const metaKeywords=document.querySelector('meta[name=\"keywords\"]');if(metaKeywords?.content){keywords=metaKeywords.content;}const keywordArray=keywords.split(\",\").map(k=>k.trim()).filter(Boolean);const schema={\"@context\":\"https://schema.org\",\"@type\":\"Article\",headline,description,url:articleUrl,author:{\"@type\":\"Person\",name:authorName,url:authorUrl},publisher:{\"@type\":\"Organization\",name:\"Milemarker\",url:\"https://www.milemarker.co\",logo:{\"@type\":\"ImageObject\",url:\"https://www.milemarker.co/images/milemarker-logo.svg\"}},datePublished,dateModified:datePublished,articleSection:fallbackCategory,keywords:keywordArray,mainEntityOfPage:{\"@type\":\"WebPage\",\"@id\":articleUrl},inLanguage:\"en-US\"};// Only add image if we found one\nif(imageUrl){schema.image={\"@type\":\"ImageObject\",url:imageUrl};}// Check if script already exists\nconst existingScript=document.querySelector('script[data-schema=\"article\"]');if(existingScript){existingScript.innerHTML=JSON.stringify(schema);return;}// Create and inject script\nconst script=document.createElement(\"script\");script.type=\"application/ld+json\";script.setAttribute(\"data-schema\",\"article\");script.innerHTML=JSON.stringify(schema);document.head.appendChild(script);return()=>{const scriptToRemove=document.querySelector('script[data-schema=\"article\"]');if(scriptToRemove){scriptToRemove.remove();}};}catch(e){// Silently fail — schema is enhancement, not critical\n}},200)// Slightly longer delay to ensure CMS content renders\n;return()=>clearTimeout(timer);},[enabled,authorName,authorUrl,fallbackCategory,fallbackKeywords,domain]);// Show visual indicator only in canvas\nif(RenderTarget.current()===RenderTarget.canvas){return /*#__PURE__*/_jsx(\"div\",{style:{width:200,height:40,backgroundColor:enabled?\"rgba(249, 115, 22, 0.1)\":\"rgba(156, 163, 175, 0.1)\",border:`1px dashed ${enabled?\"rgb(249, 115, 22)\":\"rgb(156, 163, 175)\"}`,borderRadius:8,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",fontSize:12,color:enabled?\"rgb(249, 115, 22)\":\"rgb(156, 163, 175)\",fontFamily:\"system-ui, sans-serif\"},children:enabled?\"Article Schema: Active\":\"Article Schema: Off\"});}return null;}addPropertyControls(ArticleSchema,{enabled:{type:ControlType.Boolean,title:\"Enabled\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},authorName:{type:ControlType.String,title:\"Author Name\",defaultValue:\"Jud Mackrill\"},authorUrl:{type:ControlType.String,title:\"Author URL\",defaultValue:\"https://www.milemarker.co/leadership\"},domain:{type:ControlType.String,title:\"Domain\",defaultValue:\"https://www.milemarker.co\"},fallbackCategory:{type:ControlType.String,title:\"Category\",defaultValue:\"Wealth Management Technology\"},fallbackKeywords:{type:ControlType.String,title:\"Keywords\",defaultValue:\"wealth management, data integration, AI, wealthtech\",placeholder:\"Comma-separated keywords\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ArticleSchema\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ArticleSchema.map"],"mappings":"+LAUG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,aAAW,eAAe,YAAU,uCAAuC,mBAAiB,+BAA+B,mBAAiB,sDAAsD,SAAO,4BAA4B,UAAQ,IAAM,EAa4M,OAbtM,MAAc,CAA2E,GAAvE,CAAC,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