@dsaplatform/content-sdk 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +54 -0
- package/dist/headless.d.mts +23 -0
- package/dist/headless.d.ts +23 -0
- package/dist/index.d.mts +27 -3
- package/dist/index.d.ts +27 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/server.d.mts +23 -0
- package/dist/server.d.ts +23 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
var P=class{constructor(t){this.apiUrl=t.apiUrl.replace(/\/+$/,""),this.apiKey=t.apiKey,this.cacheStrategy=t.cacheStrategy==="revalidate"?"default":t.cacheStrategy==="force-cache"?"force-cache":"no-cache",this.revalidateSeconds=t.revalidateSeconds}async request(t,a){let s=new URL(`${this.apiUrl}${t}`);a&&Object.entries(a).forEach(([i,c])=>{c!=null&&c!==""&&s.searchParams.set(i,String(c))}),s.searchParams.set("site_key",this.apiKey);let r={method:"GET",headers:{"X-API-Key":this.apiKey},cache:this.cacheStrategy};this.revalidateSeconds&&this.cacheStrategy!=="no-cache"&&(r.next={revalidate:this.revalidateSeconds});let o=await fetch(s.toString(),r);if(!o.ok){let i=await o.text().catch(()=>"");throw new Error(`DSA Content API error ${o.status}: ${i||o.statusText}`)}return o.json()}normalizeArticle(t){return{...t,headings:t.headings??[],faq:t.faq??[],internal_links:t.internal_links??[],secondary_keywords:t.secondary_keywords??[],schema_json:t.schema_json??null,content_json:t.content_json??null}}async getArticles(t){let a=await this.request("/api/public/articles",{page:t?.page,per_page:t?.per_page,pillar:t?.pillar,cluster:t?.cluster,content_type:t?.content_type,search:t?.search});return{items:a.items??a.data??[],total:a.total??0,page:a.page??1,per_page:a.per_page??20,total_pages:a.total_pages??a.pages??1}}async getArticleBySlug(t){let a=await this.request(`/api/public/articles/${encodeURIComponent(t)}`);return this.normalizeArticle(a)}async getRelatedArticles(t,a=3){let s=await this.request(`/api/public/articles/${encodeURIComponent(t)}/related`,{limit:a});return s.items??(Array.isArray(s)?s:[])}async getCategories(){let t=await this.request("/api/public/categories");return t.items??(Array.isArray(t)?t:[])}async getSitemap(){let t=await this.request("/api/public/sitemap");return t.items??(Array.isArray(t)?t:[])}};import{createContext as te,useContext as ae,useMemo as re}from"react";import{jsx as se}from"react/jsx-runtime";var M=te(null);function oe({config:e,children:t}){let a=re(()=>new P(e),[e.apiUrl,e.apiKey]);return se(M.Provider,{value:a,children:t})}function R(){let e=ae(M);if(!e)throw new Error("useDsaContent() must be used inside <DsaContentProvider>");return e}import{useState as N,useEffect as q,useCallback as T}from"react";function ie(e){let t=R(),[a,s]=N({articles:[],loading:!0,error:null,pagination:{page:1,per_page:10,total:0,total_pages:0}}),r=T(()=>{s(o=>({...o,loading:!0,error:null})),t.getArticles(e).then(o=>s({articles:o.items,loading:!1,error:null,pagination:{page:o.page,per_page:o.per_page,total:o.total,total_pages:o.total_pages}})).catch(o=>s(i=>({...i,loading:!1,error:o instanceof Error?o:new Error(String(o))})))},[t,e?.page,e?.per_page,e?.pillar,e?.cluster,e?.content_type,e?.search]);return q(()=>{r()},[r]),{...a,refetch:r}}function ne(e){let t=R(),[a,s]=N({article:null,loading:!0,error:null}),r=T(()=>{if(!e){s({article:null,loading:!1,error:null});return}s(o=>({...o,loading:!0,error:null})),t.getArticleBySlug(e).then(o=>s({article:o,loading:!1,error:null})).catch(o=>s({article:null,loading:!1,error:o instanceof Error?o:new Error(String(o))}))},[t,e]);return q(()=>{r()},[r]),{...a,refetch:r}}function de(e,t=3){let a=R(),[s,r]=N({articles:[],loading:!0,error:null}),o=T(()=>{if(!e){r({articles:[],loading:!1,error:null});return}r(i=>({...i,loading:!0,error:null})),a.getRelatedArticles(e,t).then(i=>r({articles:i,loading:!1,error:null})).catch(i=>r({articles:[],loading:!1,error:i instanceof Error?i:new Error(String(i))}))},[a,e,t]);return q(()=>{o()},[o]),{...s,refetch:o}}function le(){let e=R(),[t,a]=N({categories:[],loading:!0,error:null}),s=T(()=>{a(r=>({...r,loading:!0,error:null})),e.getCategories().then(r=>a({categories:r,loading:!1,error:null})).catch(r=>a({categories:[],loading:!1,error:r instanceof Error?r:new Error(String(r))}))},[e]);return q(()=>{s()},[s]),{...t,refetch:s}}import{useState as $,useCallback as j}from"react";function H(e){let[t,a]=$(!1),[s,r]=$(!1),[o,i]=$(null),c=j(async p=>{a(!0),i(null);try{let x=`${e.webhookUrl.replace(/\/+$/,"")}/api/webhook/form/${encodeURIComponent(e.projectSlug)}?token=${encodeURIComponent(e.webhookToken)}`,d={...p};!d.source_url&&typeof window<"u"&&(d.source_url=window.location.href);let u=await fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)}),f=await u.json().catch(()=>({}));if(!u.ok){let w=f.error||`Submission failed (${u.status})`;throw new Error(w)}return r(!0),{ok:!0,message:f.message}}catch(y){let x=y instanceof Error?y:new Error(String(y));return i(x),{ok:!1,error:x.message}}finally{a(!1)}},[e.webhookUrl,e.projectSlug,e.webhookToken]),n=j(()=>{a(!1),r(!1),i(null)},[]);return{submitting:t,submitted:s,error:o,submit:c,reset:n}}import O from"react";import{jsx as S,jsxs as D}from"react/jsx-runtime";var ce={light:{"--dsa-text":"#111827","--dsa-text-muted":"#6b7280","--dsa-text-faint":"#9ca3af","--dsa-card-bg":"#fff","--dsa-card-border":"#e5e7eb","--dsa-badge-bg":"#f3f4f6","--dsa-badge-text":"#4b5563","--dsa-hover-shadow":"0 4px 12px rgba(0,0,0,0.08)"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#9ca3af","--dsa-text-faint":"#6b7280","--dsa-card-bg":"#1f2937","--dsa-card-border":"#374151","--dsa-badge-bg":"#374151","--dsa-badge-text":"#d1d5db","--dsa-hover-shadow":"0 4px 12px rgba(0,0,0,0.3)"}};function me({article:e,layout:t,showExcerpt:a,showImage:s,showMeta:r,onClick:o}){let i=t==="grid",[c,n]=O.useState(!1),p={...i?{border:"1px solid var(--dsa-card-border)",borderRadius:"0.75rem",overflow:"hidden",background:"var(--dsa-card-bg)",cursor:"pointer",transition:"box-shadow 0.2s"}:{display:"flex",border:"1px solid var(--dsa-card-border)",borderRadius:"0.75rem",overflow:"hidden",background:"var(--dsa-card-bg)",cursor:"pointer",transition:"box-shadow 0.2s"},...c?{boxShadow:"var(--dsa-hover-shadow)"}:{}};return D("article",{style:p,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),onClick:o,role:"link",tabIndex:0,onKeyDown:y=>y.key==="Enter"&&o?.(),children:[s&&e.featured_image_url&&S("img",{src:e.featured_image_url,alt:e.featured_image_alt||e.title,style:i?{width:"100%",height:"200px",objectFit:"cover",display:"block"}:{width:"240px",minHeight:"160px",objectFit:"cover",flexShrink:0},loading:"lazy"}),D("div",{style:i?{padding:"1.25rem"}:{padding:"1.25rem",flex:1},children:[S("h3",{style:{margin:"0 0 0.5rem",fontSize:"1.125rem",fontWeight:600,lineHeight:1.3,color:"var(--dsa-text)"},children:e.title}),a&&e.excerpt&&S("p",{style:{margin:"0 0 0.75rem",fontSize:"0.875rem",color:"var(--dsa-text-muted)",lineHeight:1.5},children:e.excerpt}),r&&D("div",{style:{display:"flex",gap:"0.75rem",fontSize:"0.75rem",color:"var(--dsa-text-faint)",flexWrap:"wrap"},children:[e.pillar_name&&S("span",{style:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-bg)",fontSize:"0.75rem",color:"var(--dsa-badge-text)"},children:e.pillar_name}),e.content_type&&S("span",{style:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-bg)",fontSize:"0.75rem",color:"var(--dsa-badge-text)"},children:e.content_type.replace(/_/g," ")}),e.reading_time_minutes&&D("span",{children:[e.reading_time_minutes," min read"]}),e.published_at&&S("span",{children:new Date(e.published_at).toLocaleDateString()})]})]})]})}function K({articles:e,layout:t="grid",columns:a=3,showExcerpt:s=!0,showImage:r=!0,showMeta:o=!0,onArticleClick:i,className:c,theme:n="light",renderArticle:p}){let y=t==="grid"?`repeat(${a}, 1fr)`:"1fr",x=n!=="inherit"?ce[n]:{};return S("div",{className:c,style:{display:"grid",gap:"1.5rem",gridTemplateColumns:y,...x},children:(e??[]).map(d=>p?S(O.Fragment,{children:p(d)},d.id):S(me,{article:d,layout:t,showExcerpt:s,showImage:r,showMeta:o,onClick:()=>i?.(d.slug)},d.id))})}import be from"react";import{useState as pe}from"react";import{jsx as _,jsxs as z}from"react/jsx-runtime";var ge={light:{"--dsa-text":"#111827","--dsa-text-muted":"#4b5563","--dsa-text-faint":"#9ca3af","--dsa-divider":"#e5e7eb"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#d1d5db","--dsa-text-faint":"#6b7280","--dsa-divider":"#374151"}};function fe({item:e,collapsible:t,defaultOpen:a}){let[s,r]=pe(a);return t?z("div",{style:{borderBottom:"1px solid var(--dsa-divider)",padding:"0.75rem 0"},children:[z("button",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",background:"none",border:"none",width:"100%",textAlign:"left",padding:"0.5rem 0",fontSize:"1rem",fontWeight:600,color:"var(--dsa-text)",fontFamily:"inherit"},onClick:()=>r(!s),"aria-expanded":s,children:[_("span",{children:e.question}),_("span",{style:{flexShrink:0,marginLeft:"1rem",transition:"transform 0.2s",fontSize:"1.25rem",color:"var(--dsa-text-faint)",transform:s?"rotate(180deg)":"rotate(0deg)"},children:"\u25BC"})]}),s&&_("div",{style:{fontSize:"0.9375rem",color:"var(--dsa-text-muted)",lineHeight:1.6,paddingTop:"0.5rem"},children:e.answer})]}):z("div",{style:{borderBottom:"1px solid var(--dsa-divider)",padding:"0.75rem 0"},children:[_("p",{style:{fontSize:"1rem",fontWeight:600,color:"var(--dsa-text)",margin:"0 0 0.5rem"},children:e.question}),_("div",{style:{fontSize:"0.9375rem",color:"var(--dsa-text-muted)",lineHeight:1.6},children:e.answer})]})}function I({items:e,collapsible:t=!0,defaultOpen:a=!1,className:s,title:r="Frequently Asked Questions",theme:o="light"}){if(!e||e.length===0)return null;let i=o!=="inherit"?ge[o]:{},c={"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(n=>({"@type":"Question",name:n.question,acceptedAnswer:{"@type":"Answer",text:n.answer}}))};return z("section",{className:s,style:{marginTop:"1rem",...i},children:[_("h2",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--dsa-text)",margin:"0 0 1rem"},children:r}),e.map((n,p)=>_(fe,{item:n,collapsible:t,defaultOpen:a},p)),_("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(c)}})]})}import{jsx as L,jsxs as W}from"react/jsx-runtime";var ue={light:{"--dsa-text":"#111827","--dsa-text-muted":"#6b7280","--dsa-card-bg":"#fff","--dsa-card-border":"#e5e7eb"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#9ca3af","--dsa-card-bg":"#1f2937","--dsa-card-border":"#374151"}};function E({articles:e,title:t="Related Articles",limit:a=3,onArticleClick:s,className:r,theme:o="light"}){let i=(e??[]).slice(0,a);if(i.length===0)return null;let c=o!=="inherit"?ue[o]:{};return W("section",{className:r,style:{marginTop:"1rem",...c},children:[L("h3",{style:{fontSize:"1.25rem",fontWeight:700,color:"var(--dsa-text)",margin:"0 0 1rem"},children:t}),L("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:"1rem"},children:i.map(n=>W("div",{style:{border:"1px solid var(--dsa-card-border)",borderRadius:"0.5rem",overflow:"hidden",cursor:"pointer",transition:"box-shadow 0.2s",background:"var(--dsa-card-bg)"},onClick:()=>s?.(n.slug),role:"link",tabIndex:0,onKeyDown:p=>p.key==="Enter"&&s?.(n.slug),children:[n.featured_image_url&&L("img",{src:n.featured_image_url,alt:n.featured_image_alt||n.title,style:{width:"100%",height:"140px",objectFit:"cover",display:"block"},loading:"lazy"}),W("div",{style:{padding:"1rem"},children:[L("h4",{style:{fontSize:"0.9375rem",fontWeight:600,color:"var(--dsa-text)",margin:0,lineHeight:1.3},children:n.title}),n.excerpt&&L("p",{style:{fontSize:"0.8125rem",color:"var(--dsa-text-muted)",marginTop:"0.5rem",lineHeight:1.4},children:n.excerpt})]})]},n.id))})]})}import{Fragment as G,jsx as l,jsxs as k}from"react/jsx-runtime";var he={light:{"--dsa-text":"#111827","--dsa-text-muted":"#6b7280","--dsa-text-faint":"#9ca3af","--dsa-card-bg":"#fff","--dsa-card-border":"#e5e7eb","--dsa-toc-bg":"#f9fafb","--dsa-badge-bg":"#eff6ff","--dsa-badge-text":"#2563eb","--dsa-badge-alt-bg":"#f0fdf4","--dsa-badge-alt-text":"#16a34a","--dsa-content-text":"#374151","--dsa-h2-text":"#111827","--dsa-h3-text":"#1f2937","--dsa-h4-text":"#1f2937","--dsa-link":"#2563eb","--dsa-link-hover":"#1d4ed8","--dsa-blockquote-border":"#d1d5db","--dsa-blockquote-text":"#4b5563","--dsa-pre-bg":"#f3f4f6","--dsa-table-border":"#e5e7eb","--dsa-table-header-bg":"#f9fafb","--dsa-divider":"#e5e7eb"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#9ca3af","--dsa-text-faint":"#6b7280","--dsa-card-bg":"#1f2937","--dsa-card-border":"#374151","--dsa-toc-bg":"#111827","--dsa-badge-bg":"#1e3a5f","--dsa-badge-text":"#93c5fd","--dsa-badge-alt-bg":"#14532d","--dsa-badge-alt-text":"#86efac","--dsa-content-text":"#d1d5db","--dsa-h2-text":"#f3f4f6","--dsa-h3-text":"#e5e7eb","--dsa-h4-text":"#e5e7eb","--dsa-link":"#60a5fa","--dsa-link-hover":"#93c5fd","--dsa-blockquote-border":"#4b5563","--dsa-blockquote-text":"#9ca3af","--dsa-pre-bg":"#111827","--dsa-table-border":"#374151","--dsa-table-header-bg":"#111827","--dsa-divider":"#374151"}},V="dsa-article-prose",ye=`
|
|
2
|
+
var L=class{constructor(t){this.apiUrl=t.apiUrl.replace(/\/+$/,""),this.apiKey=t.apiKey,this.cacheStrategy=t.cacheStrategy==="revalidate"?"default":t.cacheStrategy==="force-cache"?"force-cache":"no-cache",this.revalidateSeconds=t.revalidateSeconds}async request(t,a){let o=new URL(`${this.apiUrl}${t}`);a&&Object.entries(a).forEach(([n,c])=>{c!=null&&c!==""&&o.searchParams.set(n,String(c))}),o.searchParams.set("site_key",this.apiKey);let r={method:"GET",headers:{"X-API-Key":this.apiKey},cache:this.cacheStrategy};this.revalidateSeconds&&this.cacheStrategy!=="no-cache"&&(r.next={revalidate:this.revalidateSeconds});let s=await fetch(o.toString(),r);if(!s.ok){let n=await s.text().catch(()=>"");throw new Error(`DSA Content API error ${s.status}: ${n||s.statusText}`)}return s.json()}normalizeArticle(t){return{...t,headings:t.headings??[],faq:t.faq??[],internal_links:t.internal_links??[],secondary_keywords:t.secondary_keywords??[],schema_json:t.schema_json??null,content_json:t.content_json??null}}async getArticles(t){let a=await this.request("/api/public/articles",{page:t?.page,per_page:t?.per_page,pillar:t?.pillar,cluster:t?.cluster,content_type:t?.content_type,search:t?.search});return{items:a.items??a.data??[],total:a.total??0,page:a.page??1,per_page:a.per_page??20,total_pages:a.total_pages??a.pages??1}}async getArticleBySlug(t){let a=await this.request(`/api/public/articles/${encodeURIComponent(t)}`);return this.normalizeArticle(a)}async getRelatedArticles(t,a=3){let o=await this.request(`/api/public/articles/${encodeURIComponent(t)}/related`,{limit:a});return o.items??(Array.isArray(o)?o:[])}async getCategories(){let t=await this.request("/api/public/categories");return t.items??(Array.isArray(t)?t:[])}async getSitemap(){let t=await this.request("/api/public/sitemap");return t.items??(Array.isArray(t)?t:[])}};import{createContext as ae,useContext as re,useMemo as oe}from"react";import{jsx as ne}from"react/jsx-runtime";var W=ae(null);function se({config:e,children:t}){let a=oe(()=>new L(e),[e.apiUrl,e.apiKey]);return ne(W.Provider,{value:a,children:t})}function R(){let e=re(W);if(!e)throw new Error("useDsaContent() must be used inside <DsaContentProvider>");return e}import{useState as N,useEffect as q,useCallback as T}from"react";function ie(e){let t=R(),[a,o]=N({articles:[],loading:!0,error:null,pagination:{page:1,per_page:10,total:0,total_pages:0}}),r=T(()=>{o(s=>({...s,loading:!0,error:null})),t.getArticles(e).then(s=>o({articles:s.items,loading:!1,error:null,pagination:{page:s.page,per_page:s.per_page,total:s.total,total_pages:s.total_pages}})).catch(s=>o(n=>({...n,loading:!1,error:s instanceof Error?s:new Error(String(s))})))},[t,e?.page,e?.per_page,e?.pillar,e?.cluster,e?.content_type,e?.search]);return q(()=>{r()},[r]),{...a,refetch:r}}function de(e){let t=R(),[a,o]=N({article:null,loading:!0,error:null}),r=T(()=>{if(!e){o({article:null,loading:!1,error:null});return}o(s=>({...s,loading:!0,error:null})),t.getArticleBySlug(e).then(s=>o({article:s,loading:!1,error:null})).catch(s=>o({article:null,loading:!1,error:s instanceof Error?s:new Error(String(s))}))},[t,e]);return q(()=>{r()},[r]),{...a,refetch:r}}function le(e,t=3){let a=R(),[o,r]=N({articles:[],loading:!0,error:null}),s=T(()=>{if(!e){r({articles:[],loading:!1,error:null});return}r(n=>({...n,loading:!0,error:null})),a.getRelatedArticles(e,t).then(n=>r({articles:n,loading:!1,error:null})).catch(n=>r({articles:[],loading:!1,error:n instanceof Error?n:new Error(String(n))}))},[a,e,t]);return q(()=>{s()},[s]),{...o,refetch:s}}function ce(){let e=R(),[t,a]=N({categories:[],loading:!0,error:null}),o=T(()=>{a(r=>({...r,loading:!0,error:null})),e.getCategories().then(r=>a({categories:r,loading:!1,error:null})).catch(r=>a({categories:[],loading:!1,error:r instanceof Error?r:new Error(String(r))}))},[e]);return q(()=>{o()},[o]),{...t,refetch:o}}import{useState as B,useCallback as M}from"react";function j(e){let[t,a]=B(!1),[o,r]=B(!1),[s,n]=B(null),c=M(async p=>{a(!0),n(null);try{let x=`${e.webhookUrl.replace(/\/+$/,"")}/api/webhook/form/${encodeURIComponent(e.projectSlug)}?token=${encodeURIComponent(e.webhookToken)}`,i={...p};!i.source_url&&typeof window<"u"&&(i.source_url=window.location.href);let f=await fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),g=await f.json().catch(()=>({}));if(!f.ok){let F=g.error||`Submission failed (${f.status})`;throw new Error(F)}return r(!0),{ok:!0,message:g.message}}catch(y){let x=y instanceof Error?y:new Error(String(y));return n(x),{ok:!1,error:x.message}}finally{a(!1)}},[e.webhookUrl,e.projectSlug,e.webhookToken]),d=M(()=>{a(!1),r(!1),n(null)},[]);return{submitting:t,submitted:o,error:s,submit:c,reset:d}}import O from"react";import{jsx as _,jsxs as D}from"react/jsx-runtime";var me={light:{"--dsa-text":"#111827","--dsa-text-muted":"#6b7280","--dsa-text-faint":"#9ca3af","--dsa-card-bg":"#fff","--dsa-card-border":"#e5e7eb","--dsa-badge-bg":"#f3f4f6","--dsa-badge-text":"#4b5563","--dsa-hover-shadow":"0 4px 12px rgba(0,0,0,0.08)"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#9ca3af","--dsa-text-faint":"#6b7280","--dsa-card-bg":"#1f2937","--dsa-card-border":"#374151","--dsa-badge-bg":"#374151","--dsa-badge-text":"#d1d5db","--dsa-hover-shadow":"0 4px 12px rgba(0,0,0,0.3)"}};function pe({article:e,layout:t,showExcerpt:a,showImage:o,showMeta:r,onClick:s}){let n=t==="grid",[c,d]=O.useState(!1),p={...n?{border:"1px solid var(--dsa-card-border)",borderRadius:"0.75rem",overflow:"hidden",background:"var(--dsa-card-bg)",cursor:"pointer",transition:"box-shadow 0.2s"}:{display:"flex",border:"1px solid var(--dsa-card-border)",borderRadius:"0.75rem",overflow:"hidden",background:"var(--dsa-card-bg)",cursor:"pointer",transition:"box-shadow 0.2s"},...c?{boxShadow:"var(--dsa-hover-shadow)"}:{}};return D("article",{style:p,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:s,role:"link",tabIndex:0,onKeyDown:y=>y.key==="Enter"&&s?.(),children:[o&&e.featured_image_url&&_("img",{src:e.featured_image_url,alt:e.featured_image_alt||e.title,style:n?{width:"100%",height:"200px",objectFit:"cover",display:"block"}:{width:"240px",minHeight:"160px",objectFit:"cover",flexShrink:0},loading:"lazy"}),D("div",{style:n?{padding:"1.25rem"}:{padding:"1.25rem",flex:1},children:[_("h3",{style:{margin:"0 0 0.5rem",fontSize:"1.125rem",fontWeight:600,lineHeight:1.3,color:"var(--dsa-text)"},children:e.title}),a&&e.excerpt&&_("p",{style:{margin:"0 0 0.75rem",fontSize:"0.875rem",color:"var(--dsa-text-muted)",lineHeight:1.5},children:e.excerpt}),r&&D("div",{style:{display:"flex",gap:"0.75rem",fontSize:"0.75rem",color:"var(--dsa-text-faint)",flexWrap:"wrap"},children:[e.pillar_name&&_("span",{style:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-bg)",fontSize:"0.75rem",color:"var(--dsa-badge-text)"},children:e.pillar_name}),e.content_type&&_("span",{style:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-bg)",fontSize:"0.75rem",color:"var(--dsa-badge-text)"},children:e.content_type.replace(/_/g," ")}),e.reading_time_minutes&&D("span",{children:[e.reading_time_minutes," min read"]}),e.published_at&&_("span",{children:new Date(e.published_at).toLocaleDateString()})]})]})]})}function K({articles:e,layout:t="grid",columns:a=3,showExcerpt:o=!0,showImage:r=!0,showMeta:s=!0,onArticleClick:n,className:c,theme:d="light",renderArticle:p}){let y=t==="grid"?`repeat(${a}, 1fr)`:"1fr",x=d!=="inherit"?me[d]:{};return _("div",{className:c,style:{display:"grid",gap:"1.5rem",gridTemplateColumns:y,...x},children:(e??[]).map(i=>p?_(O.Fragment,{children:p(i)},i.id):_(pe,{article:i,layout:t,showExcerpt:o,showImage:r,showMeta:s,onClick:()=>n?.(i.slug)},i.id))})}import be from"react";import{useState as ue}from"react";import{jsx as A,jsxs as z}from"react/jsx-runtime";var ge={light:{"--dsa-text":"#111827","--dsa-text-muted":"#4b5563","--dsa-text-faint":"#9ca3af","--dsa-divider":"#e5e7eb"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#d1d5db","--dsa-text-faint":"#6b7280","--dsa-divider":"#374151"}};function fe({item:e,collapsible:t,defaultOpen:a}){let[o,r]=ue(a);return t?z("div",{style:{borderBottom:"1px solid var(--dsa-divider)",padding:"0.75rem 0"},children:[z("button",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",background:"none",border:"none",width:"100%",textAlign:"left",padding:"0.5rem 0",fontSize:"1rem",fontWeight:600,color:"var(--dsa-text)",fontFamily:"inherit"},onClick:()=>r(!o),"aria-expanded":o,children:[A("span",{children:e.question}),A("span",{style:{flexShrink:0,marginLeft:"1rem",transition:"transform 0.2s",fontSize:"1.25rem",color:"var(--dsa-text-faint)",transform:o?"rotate(180deg)":"rotate(0deg)"},children:"\u25BC"})]}),o&&A("div",{style:{fontSize:"0.9375rem",color:"var(--dsa-text-muted)",lineHeight:1.6,paddingTop:"0.5rem"},children:e.answer})]}):z("div",{style:{borderBottom:"1px solid var(--dsa-divider)",padding:"0.75rem 0"},children:[A("p",{style:{fontSize:"1rem",fontWeight:600,color:"var(--dsa-text)",margin:"0 0 0.5rem"},children:e.question}),A("div",{style:{fontSize:"0.9375rem",color:"var(--dsa-text-muted)",lineHeight:1.6},children:e.answer})]})}function I({items:e,collapsible:t=!0,defaultOpen:a=!1,className:o,title:r="Frequently Asked Questions",theme:s="light"}){if(!e||e.length===0)return null;let n=s!=="inherit"?ge[s]:{},c={"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(d=>({"@type":"Question",name:d.question,acceptedAnswer:{"@type":"Answer",text:d.answer}}))};return z("section",{className:o,style:{marginTop:"1rem",...n},children:[A("h2",{style:{fontSize:"1.5rem",fontWeight:700,color:"var(--dsa-text)",margin:"0 0 1rem"},children:r}),e.map((d,p)=>A(fe,{item:d,collapsible:t,defaultOpen:a},p)),A("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(c)}})]})}import{jsx as P,jsxs as H}from"react/jsx-runtime";var he={light:{"--dsa-text":"#111827","--dsa-text-muted":"#6b7280","--dsa-card-bg":"#fff","--dsa-card-border":"#e5e7eb"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#9ca3af","--dsa-card-bg":"#1f2937","--dsa-card-border":"#374151"}};function E({articles:e,title:t="Related Articles",limit:a=3,onArticleClick:o,className:r,theme:s="light"}){let n=(e??[]).slice(0,a);if(n.length===0)return null;let c=s!=="inherit"?he[s]:{};return H("section",{className:r,style:{marginTop:"1rem",...c},children:[P("h3",{style:{fontSize:"1.25rem",fontWeight:700,color:"var(--dsa-text)",margin:"0 0 1rem"},children:t}),P("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:"1rem"},children:n.map(d=>H("div",{style:{border:"1px solid var(--dsa-card-border)",borderRadius:"0.5rem",overflow:"hidden",cursor:"pointer",transition:"box-shadow 0.2s",background:"var(--dsa-card-bg)"},onClick:()=>o?.(d.slug),role:"link",tabIndex:0,onKeyDown:p=>p.key==="Enter"&&o?.(d.slug),children:[d.featured_image_url&&P("img",{src:d.featured_image_url,alt:d.featured_image_alt||d.title,style:{width:"100%",height:"140px",objectFit:"cover",display:"block"},loading:"lazy"}),H("div",{style:{padding:"1rem"},children:[P("h4",{style:{fontSize:"0.9375rem",fontWeight:600,color:"var(--dsa-text)",margin:0,lineHeight:1.3},children:d.title}),d.excerpt&&P("p",{style:{fontSize:"0.8125rem",color:"var(--dsa-text-muted)",marginTop:"0.5rem",lineHeight:1.4},children:d.excerpt})]})]},d.id))})]})}import{Fragment as G,jsx as l,jsxs as v}from"react/jsx-runtime";var ye={light:{"--dsa-text":"#111827","--dsa-text-muted":"#6b7280","--dsa-text-faint":"#9ca3af","--dsa-card-bg":"#fff","--dsa-card-border":"#e5e7eb","--dsa-toc-bg":"#f9fafb","--dsa-badge-bg":"#eff6ff","--dsa-badge-text":"#2563eb","--dsa-badge-alt-bg":"#f0fdf4","--dsa-badge-alt-text":"#16a34a","--dsa-content-text":"#374151","--dsa-h2-text":"#111827","--dsa-h3-text":"#1f2937","--dsa-h4-text":"#1f2937","--dsa-link":"#2563eb","--dsa-link-hover":"#1d4ed8","--dsa-blockquote-border":"#d1d5db","--dsa-blockquote-text":"#4b5563","--dsa-pre-bg":"#f3f4f6","--dsa-table-border":"#e5e7eb","--dsa-table-header-bg":"#f9fafb","--dsa-divider":"#e5e7eb"},dark:{"--dsa-text":"#f3f4f6","--dsa-text-muted":"#9ca3af","--dsa-text-faint":"#6b7280","--dsa-card-bg":"#1f2937","--dsa-card-border":"#374151","--dsa-toc-bg":"#111827","--dsa-badge-bg":"#1e3a5f","--dsa-badge-text":"#93c5fd","--dsa-badge-alt-bg":"#14532d","--dsa-badge-alt-text":"#86efac","--dsa-content-text":"#d1d5db","--dsa-h2-text":"#f3f4f6","--dsa-h3-text":"#e5e7eb","--dsa-h4-text":"#e5e7eb","--dsa-link":"#60a5fa","--dsa-link-hover":"#93c5fd","--dsa-blockquote-border":"#4b5563","--dsa-blockquote-text":"#9ca3af","--dsa-pre-bg":"#111827","--dsa-table-border":"#374151","--dsa-table-header-bg":"#111827","--dsa-divider":"#374151"}},V="dsa-article-prose",xe=`
|
|
3
3
|
[data-dsa-article-body] h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; color: var(--dsa-h2-text, #111827); margin: 2rem 0 0.75rem; }
|
|
4
4
|
[data-dsa-article-body] h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; color: var(--dsa-h3-text, #1f2937); margin: 1.75rem 0 0.5rem; }
|
|
5
5
|
[data-dsa-article-body] h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; color: var(--dsa-h4-text, #1f2937); margin: 1.5rem 0 0.5rem; }
|
|
@@ -22,5 +22,5 @@ var P=class{constructor(t){this.apiUrl=t.apiUrl.replace(/\/+$/,""),this.apiKey=t
|
|
|
22
22
|
[data-dsa-article-body] hr { border: none; border-top: 1px solid var(--dsa-divider, #e5e7eb); margin: 2rem 0; }
|
|
23
23
|
[data-dsa-article-body] > *:first-child { margin-top: 0; }
|
|
24
24
|
[data-dsa-article-body] > *:last-child { margin-bottom: 0; }
|
|
25
|
-
`.trim();function xe(e){be.useEffect(()=>{if(!e||typeof document>"u"||document.getElementById(V))return;let t=document.createElement("style");t.id=V,t.textContent=ye,document.head.appendChild(t)},[e])}function ve({headings:e}){return!e||e.length===0?null:k("nav",{className:"dsa-toc","data-dsa-toc":"",style:{background:"var(--dsa-toc-bg, #f9fafb)",border:"1px solid var(--dsa-card-border, #e5e7eb)",borderRadius:"0.75rem",padding:"1.25rem",marginBottom:"2rem"},children:[l("p",{style:{fontSize:"0.875rem",fontWeight:600,color:"var(--dsa-text-muted, #374151)",margin:"0 0 0.75rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Table of Contents"}),l("ul",{style:{listStyle:"none",padding:0,margin:0},children:e.map((t,a)=>l("li",{style:{padding:"0.25rem 0",paddingLeft:`${(t.level-2)*1}rem`},children:l("a",{href:`#${t.id}`,style:{color:"var(--dsa-text-muted, #4b5563)",textDecoration:"none",fontSize:"0.875rem"},children:t.text})},a))})]})}function Se({headings:e}){return!e||e.length===0?null:k("nav",{className:"dsa-toc","data-dsa-toc":"",children:[l("p",{className:"dsa-toc-title",children:"Table of Contents"}),l("ul",{className:"dsa-toc-list",children:e.map((t,a)=>l("li",{className:"dsa-toc-item",style:{paddingLeft:`${(t.level-2)*1}rem`},children:l("a",{href:`#${t.id}`,className:"dsa-toc-link",children:t.text})},a))})]})}function J({article:e,showFaq:t=!0,showTableOfContents:a=!0,showMeta:s=!0,showRelated:r=!1,relatedArticles:o,onRelatedClick:i,className:c,contentClassName:n,theme:p="light",disableProseStyles:y=!1,components:x}){let d=p==="inherit";xe(!d&&!y);let u=x?.H1||(d?({children:m})=>l("h1",{className:"dsa-h1",children:m}):({children:m})=>l("h1",{className:"dsa-h1",style:{fontSize:"2.25rem",fontWeight:700,lineHeight:1.2,color:"var(--dsa-text)",margin:"0 0 1rem"},children:m})),f=x?.Toc||(d?Se:ve),w=x?.Faq||I,U=d?{}:he[p],B=["dsa-article-body",n].filter(Boolean).join(" ");return k("article",{className:c,"data-dsa-theme":p,style:d?void 0:{maxWidth:"48rem",margin:"0 auto",fontFamily:"system-ui, -apple-system, sans-serif",...U},children:[s&&k("div",{className:"dsa-meta","data-dsa-meta":"",style:d?void 0:{display:"flex",gap:"1rem",flexWrap:"wrap",fontSize:"0.875rem",color:"var(--dsa-text-muted)",marginBottom:"1.5rem"},children:[e.pillar_name&&l("span",{className:"dsa-badge",style:d?void 0:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-bg)",color:"var(--dsa-badge-text)",fontSize:"0.75rem"},children:e.pillar_name}),e.content_type&&l("span",{className:"dsa-badge dsa-badge--alt",style:d?void 0:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-alt-bg, var(--dsa-badge-bg))",color:"var(--dsa-badge-alt-text, var(--dsa-badge-text))",fontSize:"0.75rem"},children:e.content_type.replace(/_/g," ")}),e.reading_time_minutes&&k("span",{className:"dsa-reading-time",children:[e.reading_time_minutes," min read"]}),e.published_at&&l("span",{className:"dsa-published-at",children:new Date(e.published_at).toLocaleDateString()})]}),l(u,{children:e.h1||e.title}),e.featured_image_url&&l("img",{className:"dsa-featured-image",src:e.featured_image_url,alt:e.featured_image_alt||e.title,style:d?void 0:{width:"100%",borderRadius:"0.75rem",marginBottom:"2rem"}}),a&&(e.headings??[]).length>0&&l(f,{headings:e.headings}),l("div",{className:B,"data-dsa-article-body":"",style:d?void 0:{lineHeight:1.75,color:"var(--dsa-content-text)",fontSize:"1.0625rem"},dangerouslySetInnerHTML:{__html:e.content_html}}),t&&(e.faq??[]).length>0&&k(G,{children:[l("hr",{className:"dsa-divider",style:d?void 0:{border:"none",borderTop:"1px solid var(--dsa-divider)",margin:"2.5rem 0"}}),l(w,{items:e.faq})]}),e.schema_json&&l("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e.schema_json)}}),r&&o&&o.length>0&&k(G,{children:[l("hr",{className:"dsa-divider",style:d?void 0:{border:"none",borderTop:"1px solid var(--dsa-divider)",margin:"2.5rem 0"}}),l(E,{articles:o,onArticleClick:i,theme:p})]})]})}import{jsx as _e}from"react/jsx-runtime";function Y(e,t){let a=t?`${t.replace(/\/+$/,"")}/blog/${e.slug}`:void 0;return{title:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",openGraph:{title:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",type:"article",publishedTime:e.published_at||void 0,modifiedTime:e.updated_at||void 0,...a?{url:a}:{},...e.featured_image_url?{images:[{url:e.featured_image_url,alt:e.featured_image_alt||e.title}]}:{}},twitter:{card:"summary_large_image",title:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",...e.featured_image_url?{images:[e.featured_image_url]}:{}},...e.canonical_url?{alternates:{canonical:e.canonical_url}}:a?{alternates:{canonical:a}}:{}}}function Q({article:e,siteUrl:t}){let a=e.schema_json||{"@context":"https://schema.org","@type":"Article",headline:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",datePublished:e.published_at||void 0,dateModified:e.updated_at||e.published_at||void 0,...e.featured_image_url?{image:e.featured_image_url}:{},...t?{url:`${t.replace(/\/+$/,"")}/blog/${e.slug}`}:{},...e.target_keyword?{keywords:[e.target_keyword,...e.secondary_keywords||[]].join(", ")}:{}};return _e("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(a)}})}import{useState as Ce}from"react";import{Fragment as Z,jsx as v,jsxs as C}from"react/jsx-runtime";var X={name:{label:"Name",placeholder:"Your name",type:"text",required:!1},email:{label:"Email",placeholder:"you@company.com",type:"email",required:!0},phone:{label:"Phone",placeholder:"+1 (555) 000-0000",type:"tel",required:!1},company:{label:"Company",placeholder:"Company name",type:"text",required:!1},website:{label:"Website",placeholder:"https://...",type:"url",required:!1},message:{label:"Message",placeholder:"How can we help?",type:"textarea",required:!1},city:{label:"City",placeholder:"City",type:"text",required:!1},country:{label:"Country",placeholder:"Country",type:"text",required:!1}};function Fe(e){if(typeof e=="string"){let a=X[e];return{name:e,...a}}return{...X[e.name],...e}}function ee({webhookUrl:e,projectSlug:t,webhookToken:a,fields:s=["name","email"],leadMagnet:r,ctaText:o="Submit",thankYouMessage:i,theme:c="light",className:n,onSuccess:p,onError:y,sourceUrl:x,children:d}){let u=H({webhookUrl:e,projectSlug:t,webhookToken:a}),[f,w]=Ce({}),U=s.map(Fe);if(d)return v(Z,{children:d({...u})});let B=async g=>{g.preventDefault();let A={email:f.email||"",name:f.name,phone:f.phone,company:f.company,website:f.website,message:f.message,city:f.city,country:f.country,source_url:x},F=await u.submit(A);F.ok?p?.(A):F.error&&y?.(new Error(F.error))},m=c==="inherit",b=c==="dark",h=m?{}:{wrapper:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',backgroundColor:b?"#1e293b":"#ffffff",border:`1px solid ${b?"#334155":"#e2e8f0"}`,borderRadius:"12px",padding:"24px",maxWidth:"480px",color:b?"#f1f5f9":"#0f172a"},heading:{margin:"0 0 4px 0",fontSize:"18px",fontWeight:700,color:b?"#f1f5f9":"#0f172a"},description:{margin:"0 0 16px 0",fontSize:"14px",color:b?"#94a3b8":"#64748b"},label:{display:"block",fontSize:"13px",fontWeight:500,marginBottom:"4px",color:b?"#cbd5e1":"#374151"},input:{display:"block",width:"100%",padding:"8px 12px",fontSize:"14px",border:`1px solid ${b?"#475569":"#d1d5db"}`,borderRadius:"8px",backgroundColor:b?"#0f172a":"#ffffff",color:b?"#f1f5f9":"#0f172a",outline:"none",boxSizing:"border-box"},textarea:{display:"block",width:"100%",padding:"8px 12px",fontSize:"14px",border:`1px solid ${b?"#475569":"#d1d5db"}`,borderRadius:"8px",backgroundColor:b?"#0f172a":"#ffffff",color:b?"#f1f5f9":"#0f172a",outline:"none",minHeight:"80px",resize:"vertical",fontFamily:"inherit",boxSizing:"border-box"},button:{width:"100%",padding:"10px 20px",fontSize:"14px",fontWeight:600,color:"#ffffff",backgroundColor:"#2563eb",border:"none",borderRadius:"8px",cursor:"pointer",marginTop:"4px",opacity:u.submitting?.7:1},fieldGroup:{marginBottom:"12px"},error:{fontSize:"13px",color:"#ef4444",marginTop:"8px"},success:{textAlign:"center",padding:"16px 0"},successTitle:{fontSize:"18px",fontWeight:700,color:b?"#34d399":"#059669",marginBottom:"8px"},successText:{fontSize:"14px",color:b?"#94a3b8":"#64748b",marginBottom:"16px"},downloadLink:{display:"inline-block",padding:"10px 24px",fontSize:"14px",fontWeight:600,color:"#ffffff",backgroundColor:"#2563eb",borderRadius:"8px",textDecoration:"none"}};return u.submitted?v("div",{className:`dsa-lead-form dsa-lead-form--success ${n||""}`,"data-dsa-lead-form":!0,"data-theme":c,style:m?void 0:h.wrapper,children:C("div",{style:m?void 0:h.success,children:[v("div",{style:m?void 0:h.successTitle,children:i||"Thank you!"}),r?.downloadUrl&&C(Z,{children:[v("p",{style:m?void 0:h.successText,children:"Your download is ready:"}),C("a",{href:r.downloadUrl,target:"_blank",rel:"noopener noreferrer",className:"dsa-lead-form__download",style:m?void 0:h.downloadLink,children:["Download ",r.title]})]})]})}):C("div",{className:`dsa-lead-form ${n||""}`,"data-dsa-lead-form":!0,"data-theme":c,style:m?void 0:h.wrapper,children:[r&&C("div",{className:"dsa-lead-form__magnet",style:{marginBottom:"16px"},children:[r.imageUrl&&v("img",{src:r.imageUrl,alt:r.title,style:m?void 0:{width:"100%",borderRadius:"8px",marginBottom:"12px",display:"block"},className:"dsa-lead-form__magnet-image"}),v("h3",{className:"dsa-lead-form__magnet-title",style:m?void 0:h.heading,children:r.title}),r.description&&v("p",{className:"dsa-lead-form__magnet-description",style:m?void 0:h.description,children:r.description})]}),C("form",{onSubmit:B,className:"dsa-lead-form__form",noValidate:!0,children:[U.map(g=>C("div",{className:"dsa-lead-form__field",style:m?void 0:h.fieldGroup,children:[C("label",{className:"dsa-lead-form__label",style:m?void 0:h.label,children:[g.label,g.required&&" *"]}),g.type==="textarea"?v("textarea",{name:g.name,placeholder:g.placeholder,required:g.required,value:f[g.name]||"",onChange:A=>w(F=>({...F,[g.name]:A.target.value})),className:"dsa-lead-form__textarea",style:m?void 0:h.textarea}):v("input",{type:g.type||"text",name:g.name,placeholder:g.placeholder,required:g.required,value:f[g.name]||"",onChange:A=>w(F=>({...F,[g.name]:A.target.value})),className:"dsa-lead-form__input",style:m?void 0:h.input})]},g.name)),v("button",{type:"submit",disabled:u.submitting,className:"dsa-lead-form__submit",style:m?void 0:h.button,children:u.submitting?"Sending...":o}),u.error&&v("p",{className:"dsa-lead-form__error",style:m?void 0:h.error,children:u.error.message})]})]})}export{K as ArticleFeed,J as ArticlePage,P as ContentClient,oe as DsaContentProvider,ee as DsaLeadForm,I as FaqBlock,E as RelatedArticles,Q as SeoMetaBridge,Y as generateArticleMetadata,ne as useArticle,ie as useArticles,le as useCategories,R as useDsaContent,H as useDsaLeadForm,de as useRelatedArticles};
|
|
25
|
+
`.trim();function ve(e){be.useEffect(()=>{if(!e||typeof document>"u"||document.getElementById(V))return;let t=document.createElement("style");t.id=V,t.textContent=xe,document.head.appendChild(t)},[e])}function Se({headings:e}){return!e||e.length===0?null:v("nav",{className:"dsa-toc","data-dsa-toc":"",style:{background:"var(--dsa-toc-bg, #f9fafb)",border:"1px solid var(--dsa-card-border, #e5e7eb)",borderRadius:"0.75rem",padding:"1.25rem",marginBottom:"2rem"},children:[l("p",{style:{fontSize:"0.875rem",fontWeight:600,color:"var(--dsa-text-muted, #374151)",margin:"0 0 0.75rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Table of Contents"}),l("ul",{style:{listStyle:"none",padding:0,margin:0},children:e.map((t,a)=>l("li",{style:{padding:"0.25rem 0",paddingLeft:`${(t.level-2)*1}rem`},children:l("a",{href:`#${t.id}`,style:{color:"var(--dsa-text-muted, #4b5563)",textDecoration:"none",fontSize:"0.875rem"},children:t.text})},a))})]})}function _e({headings:e}){return!e||e.length===0?null:v("nav",{className:"dsa-toc","data-dsa-toc":"",children:[l("p",{className:"dsa-toc-title",children:"Table of Contents"}),l("ul",{className:"dsa-toc-list",children:e.map((t,a)=>l("li",{className:"dsa-toc-item",style:{paddingLeft:`${(t.level-2)*1}rem`},children:l("a",{href:`#${t.id}`,className:"dsa-toc-link",children:t.text})},a))})]})}function J({article:e,showFaq:t=!0,showTableOfContents:a=!0,showMeta:o=!0,showRelated:r=!1,relatedArticles:s,onRelatedClick:n,className:c,contentClassName:d,theme:p="light",disableProseStyles:y=!1,components:x}){let i=p==="inherit";ve(!i&&!y);let f=x?.H1||(i?({children:m})=>l("h1",{className:"dsa-h1",children:m}):({children:m})=>l("h1",{className:"dsa-h1",style:{fontSize:"2.25rem",fontWeight:700,lineHeight:1.2,color:"var(--dsa-text)",margin:"0 0 1rem"},children:m})),g=x?.Toc||(i?_e:Se),F=x?.Faq||I,U=i?{}:ye[p],$=["dsa-article-body",d].filter(Boolean).join(" ");return v("article",{className:c,"data-dsa-theme":p,style:i?void 0:{maxWidth:"48rem",margin:"0 auto",fontFamily:"system-ui, -apple-system, sans-serif",...U},children:[o&&v("div",{className:"dsa-meta","data-dsa-meta":"",style:i?void 0:{display:"flex",gap:"1rem",flexWrap:"wrap",fontSize:"0.875rem",color:"var(--dsa-text-muted)",marginBottom:"1.5rem"},children:[e.pillar_name&&l("span",{className:"dsa-badge",style:i?void 0:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-bg)",color:"var(--dsa-badge-text)",fontSize:"0.75rem"},children:e.pillar_name}),e.content_type&&l("span",{className:"dsa-badge dsa-badge--alt",style:i?void 0:{display:"inline-block",padding:"0.125rem 0.5rem",borderRadius:"9999px",background:"var(--dsa-badge-alt-bg, var(--dsa-badge-bg))",color:"var(--dsa-badge-alt-text, var(--dsa-badge-text))",fontSize:"0.75rem"},children:e.content_type.replace(/_/g," ")}),e.reading_time_minutes&&v("span",{className:"dsa-reading-time",children:[e.reading_time_minutes," min read"]}),e.published_at&&l("span",{className:"dsa-published-at",children:new Date(e.published_at).toLocaleDateString()})]}),l(f,{children:e.h1||e.title}),e.author?.name&&v("div",{className:"dsa-author","data-dsa-author":"",style:i?void 0:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"1.5rem"},children:[e.author.image_url&&l("img",{className:"dsa-author-avatar",src:e.author.image_url,alt:e.author.name,style:i?void 0:{width:"2.5rem",height:"2.5rem",borderRadius:"9999px",objectFit:"cover"}}),v("div",{children:[v("div",{style:i?void 0:{fontSize:"0.875rem",fontWeight:600,color:"var(--dsa-text)"},children:[e.author.url?l("a",{href:e.author.url,className:"dsa-author-link",rel:"author",style:i?void 0:{color:"inherit",textDecoration:"none"},children:e.author.name}):e.author.name,e.author.job_title&&v("span",{className:"dsa-author-title",style:i?void 0:{fontWeight:400,color:"var(--dsa-text-muted)",marginLeft:"0.25rem"},children:[" ","\xB7 ",e.author.job_title]})]}),e.author.bio&&l("p",{className:"dsa-author-bio",style:i?void 0:{fontSize:"0.75rem",color:"var(--dsa-text-muted)",margin:"0.125rem 0 0"},children:e.author.bio})]})]}),e.featured_image_url&&l("img",{className:"dsa-featured-image",src:e.featured_image_url,alt:e.featured_image_alt||e.title,style:i?void 0:{width:"100%",borderRadius:"0.75rem",marginBottom:"2rem"}}),a&&(e.headings??[]).length>0&&l(g,{headings:e.headings}),l("div",{className:$,"data-dsa-article-body":"",style:i?void 0:{lineHeight:1.75,color:"var(--dsa-content-text)",fontSize:"1.0625rem"},dangerouslySetInnerHTML:{__html:e.content_html}}),t&&(e.faq??[]).length>0&&v(G,{children:[l("hr",{className:"dsa-divider",style:i?void 0:{border:"none",borderTop:"1px solid var(--dsa-divider)",margin:"2.5rem 0"}}),l(F,{items:e.faq})]}),e.schema_json&&l("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(e.schema_json)}}),r&&s&&s.length>0&&v(G,{children:[l("hr",{className:"dsa-divider",style:i?void 0:{border:"none",borderTop:"1px solid var(--dsa-divider)",margin:"2.5rem 0"}}),l(E,{articles:s,onArticleClick:n,theme:p})]})]})}import{Fragment as ke,jsx as Q,jsxs as Fe}from"react/jsx-runtime";function Y(e,t){let a=t?`${t.replace(/\/+$/,"")}/blog/${e.slug}`:void 0,o={title:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",openGraph:{title:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",type:"article",publishedTime:e.published_at||void 0,modifiedTime:e.updated_at||void 0,...a?{url:a}:{},...e.featured_image_url?{images:[{url:e.featured_image_url,alt:e.featured_image_alt||e.title}]}:{}},twitter:{card:"summary_large_image",title:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",...e.featured_image_url?{images:[e.featured_image_url]}:{}},...e.canonical_url?{alternates:{canonical:e.canonical_url}}:a?{alternates:{canonical:a}}:{}};return e.author?.name&&(o.authors=[{name:e.author.name,url:e.author.url||void 0}]),o}function Ae(e,t){if(e.schema_json&&e.schema_json["@context"])return e.schema_json;let a=t?`${t.replace(/\/+$/,"")}/blog/${e.slug}`:void 0,o={"@context":"https://schema.org","@type":"Article",headline:e.meta_title||e.title,description:e.meta_description||e.excerpt||"",datePublished:e.published_at||void 0,dateModified:e.updated_at||e.published_at||void 0,...e.featured_image_url?{image:e.featured_image_url}:{},...a?{url:a}:{},...e.target_keyword?{keywords:[e.target_keyword,...e.secondary_keywords||[]].join(", ")}:{}};if(e.author?.name){let r={"@type":"Person",name:e.author.name};e.author.url&&(r.url=e.author.url),e.author.image_url&&(r.image=e.author.image_url),e.author.job_title&&(r.jobTitle=e.author.job_title);let s=[];if(e.author.url&&s.push(e.author.url),e.author.socials)for(let n of Object.values(e.author.socials))n&&n.startsWith("http")&&s.push(n);s.length&&(r.sameAs=s),o.author=r}if(e.publisher?.name){let r={"@type":"Organization",name:e.publisher.name};e.publisher.url&&(r.url=e.publisher.url),e.publisher.logo_url&&(r.logo={"@type":"ImageObject",url:e.publisher.logo_url}),o.publisher=r}return o.speakable={"@type":"SpeakableSpecification",cssSelector:["[data-speakable]",".dsa-article-body > p:first-of-type"]},e.faq?.length&&(o.mainEntity=e.faq.map(r=>({"@type":"Question",name:r.question,acceptedAnswer:{"@type":"Answer",text:r.answer}}))),o}function Ce(e,t){if(!t)return null;let a=t.replace(/\/+$/,""),o=[{name:"Home",url:a},{name:"Blog",url:`${a}/blog`}];return e.pillar_name&&o.push({name:e.pillar_name,url:`${a}/blog?pillar=${encodeURIComponent(e.pillar_name)}`}),o.push({name:e.h1||e.title,url:`${a}/blog/${e.slug}`}),{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:o.map((r,s)=>({"@type":"ListItem",position:s+1,name:r.name,item:r.url}))}}function X({article:e,siteUrl:t}){let a=Ae(e,t),o=Ce(e,t);return Fe(ke,{children:[Q("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(a)}}),o&&Q("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(o)}})]})}import{useState as we}from"react";import{Fragment as ee,jsx as S,jsxs as C}from"react/jsx-runtime";var Z={name:{label:"Name",placeholder:"Your name",type:"text",required:!1},email:{label:"Email",placeholder:"you@company.com",type:"email",required:!0},phone:{label:"Phone",placeholder:"+1 (555) 000-0000",type:"tel",required:!1},company:{label:"Company",placeholder:"Company name",type:"text",required:!1},website:{label:"Website",placeholder:"https://...",type:"url",required:!1},message:{label:"Message",placeholder:"How can we help?",type:"textarea",required:!1},city:{label:"City",placeholder:"City",type:"text",required:!1},country:{label:"Country",placeholder:"Country",type:"text",required:!1}};function Re(e){if(typeof e=="string"){let a=Z[e];return{name:e,...a}}return{...Z[e.name],...e}}function te({webhookUrl:e,projectSlug:t,webhookToken:a,fields:o=["name","email"],leadMagnet:r,ctaText:s="Submit",thankYouMessage:n,theme:c="light",className:d,onSuccess:p,onError:y,sourceUrl:x,children:i}){let f=j({webhookUrl:e,projectSlug:t,webhookToken:a}),[g,F]=we({}),U=o.map(Re);if(i)return S(ee,{children:i({...f})});let $=async u=>{u.preventDefault();let w={email:g.email||"",name:g.name,phone:g.phone,company:g.company,website:g.website,message:g.message,city:g.city,country:g.country,source_url:x},k=await f.submit(w);k.ok?p?.(w):k.error&&y?.(new Error(k.error))},m=c==="inherit",h=c==="dark",b=m?{}:{wrapper:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',backgroundColor:h?"#1e293b":"#ffffff",border:`1px solid ${h?"#334155":"#e2e8f0"}`,borderRadius:"12px",padding:"24px",maxWidth:"480px",color:h?"#f1f5f9":"#0f172a"},heading:{margin:"0 0 4px 0",fontSize:"18px",fontWeight:700,color:h?"#f1f5f9":"#0f172a"},description:{margin:"0 0 16px 0",fontSize:"14px",color:h?"#94a3b8":"#64748b"},label:{display:"block",fontSize:"13px",fontWeight:500,marginBottom:"4px",color:h?"#cbd5e1":"#374151"},input:{display:"block",width:"100%",padding:"8px 12px",fontSize:"14px",border:`1px solid ${h?"#475569":"#d1d5db"}`,borderRadius:"8px",backgroundColor:h?"#0f172a":"#ffffff",color:h?"#f1f5f9":"#0f172a",outline:"none",boxSizing:"border-box"},textarea:{display:"block",width:"100%",padding:"8px 12px",fontSize:"14px",border:`1px solid ${h?"#475569":"#d1d5db"}`,borderRadius:"8px",backgroundColor:h?"#0f172a":"#ffffff",color:h?"#f1f5f9":"#0f172a",outline:"none",minHeight:"80px",resize:"vertical",fontFamily:"inherit",boxSizing:"border-box"},button:{width:"100%",padding:"10px 20px",fontSize:"14px",fontWeight:600,color:"#ffffff",backgroundColor:"#2563eb",border:"none",borderRadius:"8px",cursor:"pointer",marginTop:"4px",opacity:f.submitting?.7:1},fieldGroup:{marginBottom:"12px"},error:{fontSize:"13px",color:"#ef4444",marginTop:"8px"},success:{textAlign:"center",padding:"16px 0"},successTitle:{fontSize:"18px",fontWeight:700,color:h?"#34d399":"#059669",marginBottom:"8px"},successText:{fontSize:"14px",color:h?"#94a3b8":"#64748b",marginBottom:"16px"},downloadLink:{display:"inline-block",padding:"10px 24px",fontSize:"14px",fontWeight:600,color:"#ffffff",backgroundColor:"#2563eb",borderRadius:"8px",textDecoration:"none"}};return f.submitted?S("div",{className:`dsa-lead-form dsa-lead-form--success ${d||""}`,"data-dsa-lead-form":!0,"data-theme":c,style:m?void 0:b.wrapper,children:C("div",{style:m?void 0:b.success,children:[S("div",{style:m?void 0:b.successTitle,children:n||"Thank you!"}),r?.downloadUrl&&C(ee,{children:[S("p",{style:m?void 0:b.successText,children:"Your download is ready:"}),C("a",{href:r.downloadUrl,target:"_blank",rel:"noopener noreferrer",className:"dsa-lead-form__download",style:m?void 0:b.downloadLink,children:["Download ",r.title]})]})]})}):C("div",{className:`dsa-lead-form ${d||""}`,"data-dsa-lead-form":!0,"data-theme":c,style:m?void 0:b.wrapper,children:[r&&C("div",{className:"dsa-lead-form__magnet",style:{marginBottom:"16px"},children:[r.imageUrl&&S("img",{src:r.imageUrl,alt:r.title,style:m?void 0:{width:"100%",borderRadius:"8px",marginBottom:"12px",display:"block"},className:"dsa-lead-form__magnet-image"}),S("h3",{className:"dsa-lead-form__magnet-title",style:m?void 0:b.heading,children:r.title}),r.description&&S("p",{className:"dsa-lead-form__magnet-description",style:m?void 0:b.description,children:r.description})]}),C("form",{onSubmit:$,className:"dsa-lead-form__form",noValidate:!0,children:[U.map(u=>C("div",{className:"dsa-lead-form__field",style:m?void 0:b.fieldGroup,children:[C("label",{className:"dsa-lead-form__label",style:m?void 0:b.label,children:[u.label,u.required&&" *"]}),u.type==="textarea"?S("textarea",{name:u.name,placeholder:u.placeholder,required:u.required,value:g[u.name]||"",onChange:w=>F(k=>({...k,[u.name]:w.target.value})),className:"dsa-lead-form__textarea",style:m?void 0:b.textarea}):S("input",{type:u.type||"text",name:u.name,placeholder:u.placeholder,required:u.required,value:g[u.name]||"",onChange:w=>F(k=>({...k,[u.name]:w.target.value})),className:"dsa-lead-form__input",style:m?void 0:b.input})]},u.name)),S("button",{type:"submit",disabled:f.submitting,className:"dsa-lead-form__submit",style:m?void 0:b.button,children:f.submitting?"Sending...":s}),f.error&&S("p",{className:"dsa-lead-form__error",style:m?void 0:b.error,children:f.error.message})]})]})}export{K as ArticleFeed,J as ArticlePage,L as ContentClient,se as DsaContentProvider,te as DsaLeadForm,I as FaqBlock,E as RelatedArticles,X as SeoMetaBridge,Y as generateArticleMetadata,de as useArticle,ie as useArticles,ce as useCategories,R as useDsaContent,j as useDsaLeadForm,le as useRelatedArticles};
|
|
26
26
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/client.ts","../src/provider.tsx","../src/hooks.ts","../src/lead-form-hook.ts","../src/components/ArticleFeed.tsx","../src/components/ArticlePage.tsx","../src/components/FaqBlock.tsx","../src/components/RelatedArticles.tsx","../src/components/SeoMetaBridge.tsx","../src/components/DsaLeadForm.tsx"],"sourcesContent":["import type {\n DsaContentConfig,\n Article,\n ArticleListItem,\n ArticleFilters,\n PaginatedResponse,\n Category,\n SitemapEntry,\n} from './types';\n\n/**\n * ContentClient — HTTP client for DSA Content Engine Public API.\n * Works in both Node.js (SSR) and browser environments.\n */\nexport class ContentClient {\n private apiUrl: string;\n private apiKey: string;\n private cacheStrategy: RequestCache;\n private revalidateSeconds?: number;\n\n constructor(config: DsaContentConfig) {\n this.apiUrl = config.apiUrl.replace(/\\/+$/, '');\n this.apiKey = config.apiKey;\n this.cacheStrategy =\n config.cacheStrategy === 'revalidate'\n ? 'default'\n : config.cacheStrategy === 'force-cache'\n ? 'force-cache'\n : 'no-cache';\n this.revalidateSeconds = config.revalidateSeconds;\n }\n\n private async request<T>(path: string, params?: Record<string, string | number | undefined>): Promise<T> {\n const url = new URL(`${this.apiUrl}${path}`);\n if (params) {\n Object.entries(params).forEach(([k, v]) => {\n if (v !== undefined && v !== null && v !== '') {\n url.searchParams.set(k, String(v));\n }\n });\n }\n url.searchParams.set('site_key', this.apiKey);\n\n const fetchOptions: RequestInit & { next?: { revalidate?: number } } = {\n method: 'GET',\n headers: { 'X-API-Key': this.apiKey },\n cache: this.cacheStrategy,\n };\n\n // Next.js ISR revalidation\n if (this.revalidateSeconds && this.cacheStrategy !== 'no-cache') {\n fetchOptions.next = { revalidate: this.revalidateSeconds };\n }\n\n const res = await fetch(url.toString(), fetchOptions);\n\n if (!res.ok) {\n const text = await res.text().catch(() => '');\n throw new Error(`DSA Content API error ${res.status}: ${text || res.statusText}`);\n }\n\n return res.json() as Promise<T>;\n }\n\n /** Normalize article array fields to guarantee they're never null/undefined */\n private normalizeArticle(article: Article): Article {\n return {\n ...article,\n headings: article.headings ?? [],\n faq: article.faq ?? [],\n internal_links: article.internal_links ?? [],\n secondary_keywords: article.secondary_keywords ?? [],\n schema_json: article.schema_json ?? null,\n content_json: article.content_json ?? null,\n };\n }\n\n /** Get paginated list of published articles */\n async getArticles(filters?: ArticleFilters): Promise<PaginatedResponse<ArticleListItem>> {\n const raw = await this.request<Record<string, any>>('/api/public/articles', {\n page: filters?.page,\n per_page: filters?.per_page,\n pillar: filters?.pillar,\n cluster: filters?.cluster,\n content_type: filters?.content_type,\n search: filters?.search,\n });\n return {\n items: raw.items ?? raw.data ?? [],\n total: raw.total ?? 0,\n page: raw.page ?? 1,\n per_page: raw.per_page ?? 20,\n total_pages: raw.total_pages ?? raw.pages ?? 1,\n };\n }\n\n /** Get a single article by slug */\n async getArticleBySlug(slug: string): Promise<Article> {\n const article = await this.request<Article>(`/api/public/articles/${encodeURIComponent(slug)}`);\n return this.normalizeArticle(article);\n }\n\n /** Get related articles for a given slug */\n async getRelatedArticles(slug: string, limit = 3): Promise<ArticleListItem[]> {\n const raw = await this.request<Record<string, any>>(\n `/api/public/articles/${encodeURIComponent(slug)}/related`,\n { limit },\n );\n return raw.items ?? (Array.isArray(raw) ? raw : []);\n }\n\n /** Get all categories (pillars + clusters) with article counts */\n async getCategories(): Promise<Category[]> {\n const raw = await this.request<Record<string, any>>('/api/public/categories');\n return raw.items ?? (Array.isArray(raw) ? raw : []);\n }\n\n /** Get sitemap data for all published articles */\n async getSitemap(): Promise<SitemapEntry[]> {\n const raw = await this.request<Record<string, any>>('/api/public/sitemap');\n return raw.items ?? (Array.isArray(raw) ? raw : []);\n }\n}\n","'use client';\n\nimport React, { createContext, useContext, useMemo } from 'react';\nimport { ContentClient } from './client';\nimport type { DsaContentConfig } from './types';\n\nconst ContentContext = createContext<ContentClient | null>(null);\n\nexport interface DsaContentProviderProps {\n config: DsaContentConfig;\n children: React.ReactNode;\n}\n\n/**\n * Wrap your app (or a subtree) with DsaContentProvider to enable\n * the useDsaContent() hook and all data-fetching hooks.\n *\n * ```tsx\n * <DsaContentProvider config={{ apiUrl: \"...\", apiKey: \"...\" }}>\n * <App />\n * </DsaContentProvider>\n * ```\n */\nexport function DsaContentProvider({ config, children }: DsaContentProviderProps) {\n const client = useMemo(() => new ContentClient(config), [config.apiUrl, config.apiKey]);\n return <ContentContext.Provider value={client}>{children}</ContentContext.Provider>;\n}\n\n/**\n * Access the ContentClient instance from context.\n * Must be called inside a DsaContentProvider.\n */\nexport function useDsaContent(): ContentClient {\n const client = useContext(ContentContext);\n if (!client) {\n throw new Error('useDsaContent() must be used inside <DsaContentProvider>');\n }\n return client;\n}\n","'use client';\n\nimport { useState, useEffect, useCallback } from 'react';\nimport { useDsaContent } from './provider';\nimport type {\n ArticleFilters,\n UseArticlesState,\n UseArticleState,\n UseArticleListState,\n UseCategoriesState,\n} from './types';\n\n/**\n * Fetch a paginated list of published articles.\n *\n * ```tsx\n * const { articles, loading, error, pagination } = useArticles({ page: 1, per_page: 10 });\n * ```\n */\nexport function useArticles(filters?: ArticleFilters): UseArticlesState & { refetch: () => void } {\n const client = useDsaContent();\n const [state, setState] = useState<UseArticlesState>({\n articles: [],\n loading: true,\n error: null,\n pagination: { page: 1, per_page: 10, total: 0, total_pages: 0 },\n });\n\n const fetch = useCallback(() => {\n setState((s) => ({ ...s, loading: true, error: null }));\n client\n .getArticles(filters)\n .then((res) =>\n setState({\n articles: res.items,\n loading: false,\n error: null,\n pagination: {\n page: res.page,\n per_page: res.per_page,\n total: res.total,\n total_pages: res.total_pages,\n },\n }),\n )\n .catch((err) =>\n setState((s) => ({ ...s, loading: false, error: err instanceof Error ? err : new Error(String(err)) })),\n );\n }, [client, filters?.page, filters?.per_page, filters?.pillar, filters?.cluster, filters?.content_type, filters?.search]);\n\n useEffect(() => { fetch(); }, [fetch]);\n\n return { ...state, refetch: fetch };\n}\n\n/**\n * Fetch a single article by slug.\n *\n * ```tsx\n * const { article, loading, error } = useArticle(\"my-article-slug\");\n * ```\n */\nexport function useArticle(slug: string | undefined): UseArticleState & { refetch: () => void } {\n const client = useDsaContent();\n const [state, setState] = useState<UseArticleState>({ article: null, loading: true, error: null });\n\n const fetch = useCallback(() => {\n if (!slug) {\n setState({ article: null, loading: false, error: null });\n return;\n }\n setState((s) => ({ ...s, loading: true, error: null }));\n client\n .getArticleBySlug(slug)\n .then((article) => setState({ article, loading: false, error: null }))\n .catch((err) =>\n setState({ article: null, loading: false, error: err instanceof Error ? err : new Error(String(err)) }),\n );\n }, [client, slug]);\n\n useEffect(() => { fetch(); }, [fetch]);\n\n return { ...state, refetch: fetch };\n}\n\n/**\n * Fetch related articles for a given slug.\n *\n * ```tsx\n * const { articles, loading } = useRelatedArticles(\"my-article-slug\", 4);\n * ```\n */\nexport function useRelatedArticles(slug: string | undefined, limit = 3): UseArticleListState & { refetch: () => void } {\n const client = useDsaContent();\n const [state, setState] = useState<UseArticleListState>({ articles: [], loading: true, error: null });\n\n const fetch = useCallback(() => {\n if (!slug) {\n setState({ articles: [], loading: false, error: null });\n return;\n }\n setState((s) => ({ ...s, loading: true, error: null }));\n client\n .getRelatedArticles(slug, limit)\n .then((articles) => setState({ articles, loading: false, error: null }))\n .catch((err) =>\n setState({ articles: [], loading: false, error: err instanceof Error ? err : new Error(String(err)) }),\n );\n }, [client, slug, limit]);\n\n useEffect(() => { fetch(); }, [fetch]);\n\n return { ...state, refetch: fetch };\n}\n\n/**\n * Fetch all categories (pillars + clusters).\n *\n * ```tsx\n * const { categories, loading } = useCategories();\n * ```\n */\nexport function useCategories(): UseCategoriesState & { refetch: () => void } {\n const client = useDsaContent();\n const [state, setState] = useState<UseCategoriesState>({ categories: [], loading: true, error: null });\n\n const fetch = useCallback(() => {\n setState((s) => ({ ...s, loading: true, error: null }));\n client\n .getCategories()\n .then((categories) => setState({ categories, loading: false, error: null }))\n .catch((err) =>\n setState({ categories: [], loading: false, error: err instanceof Error ? err : new Error(String(err)) }),\n );\n }, [client]);\n\n useEffect(() => { fetch(); }, [fetch]);\n\n return { ...state, refetch: fetch };\n}\n","'use client';\n\nimport { useState, useCallback } from 'react';\nimport type {\n DsaLeadFormConfig,\n LeadFormPayload,\n LeadFormSubmitResult,\n UseLeadFormState,\n} from './types';\n\n/**\n * Headless hook for lead capture — handles submission to DSA webhook.\n * Use this when you want full control over form UI.\n *\n * ```tsx\n * const { submitting, submitted, error, submit, reset } = useDsaLeadForm({\n * webhookUrl: \"https://api.example.com\",\n * projectSlug: \"my-project\",\n * webhookToken: \"abc123\",\n * });\n *\n * const handleSubmit = (e) => {\n * e.preventDefault();\n * submit({ email: \"user@example.com\", name: \"John\" });\n * };\n * ```\n */\nexport function useDsaLeadForm(config: DsaLeadFormConfig): UseLeadFormState {\n const [submitting, setSubmitting] = useState(false);\n const [submitted, setSubmitted] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const submit = useCallback(\n async (data: LeadFormPayload): Promise<LeadFormSubmitResult> => {\n setSubmitting(true);\n setError(null);\n try {\n const baseUrl = config.webhookUrl.replace(/\\/+$/, '');\n const url = `${baseUrl}/api/webhook/form/${encodeURIComponent(config.projectSlug)}?token=${encodeURIComponent(config.webhookToken)}`;\n\n const body: Record<string, string> = { ...data } as any;\n if (!body.source_url && typeof window !== 'undefined') {\n body.source_url = window.location.href;\n }\n\n const res = await fetch(url, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body),\n });\n\n const json = await res.json().catch(() => ({}));\n\n if (!res.ok) {\n const msg = json.error || `Submission failed (${res.status})`;\n throw new Error(msg);\n }\n\n setSubmitted(true);\n return { ok: true, message: json.message };\n } catch (err) {\n const e = err instanceof Error ? err : new Error(String(err));\n setError(e);\n return { ok: false, error: e.message };\n } finally {\n setSubmitting(false);\n }\n },\n [config.webhookUrl, config.projectSlug, config.webhookToken],\n );\n\n const reset = useCallback(() => {\n setSubmitting(false);\n setSubmitted(false);\n setError(null);\n }, []);\n\n return { submitting, submitted, error, submit, reset };\n}\n","'use client';\n\nimport React from 'react';\nimport type { ArticleListItem } from '../types';\n\nexport interface ArticleFeedProps {\n articles: ArticleListItem[];\n layout?: 'grid' | 'list';\n columns?: 1 | 2 | 3;\n showExcerpt?: boolean;\n showImage?: boolean;\n showMeta?: boolean;\n onArticleClick?: (slug: string) => void;\n className?: string;\n /** \"light\" | \"dark\" | \"inherit\" — sets CSS variable defaults. Use \"inherit\" to control via your own CSS vars. */\n theme?: 'light' | 'dark' | 'inherit';\n renderArticle?: (article: ArticleListItem) => React.ReactNode;\n}\n\nconst themeVars = {\n light: {\n '--dsa-text': '#111827',\n '--dsa-text-muted': '#6b7280',\n '--dsa-text-faint': '#9ca3af',\n '--dsa-card-bg': '#fff',\n '--dsa-card-border': '#e5e7eb',\n '--dsa-badge-bg': '#f3f4f6',\n '--dsa-badge-text': '#4b5563',\n '--dsa-hover-shadow': '0 4px 12px rgba(0,0,0,0.08)',\n },\n dark: {\n '--dsa-text': '#f3f4f6',\n '--dsa-text-muted': '#9ca3af',\n '--dsa-text-faint': '#6b7280',\n '--dsa-card-bg': '#1f2937',\n '--dsa-card-border': '#374151',\n '--dsa-badge-bg': '#374151',\n '--dsa-badge-text': '#d1d5db',\n '--dsa-hover-shadow': '0 4px 12px rgba(0,0,0,0.3)',\n },\n} as const;\n\nfunction DefaultCard({\n article,\n layout,\n showExcerpt,\n showImage,\n showMeta,\n onClick,\n}: {\n article: ArticleListItem;\n layout: 'grid' | 'list';\n showExcerpt: boolean;\n showImage: boolean;\n showMeta: boolean;\n onClick?: () => void;\n}) {\n const isGrid = layout === 'grid';\n const [hovered, setHovered] = React.useState(false);\n\n const cardStyle: React.CSSProperties = {\n ...(isGrid\n ? { border: '1px solid var(--dsa-card-border)', borderRadius: '0.75rem', overflow: 'hidden', background: 'var(--dsa-card-bg)', cursor: 'pointer', transition: 'box-shadow 0.2s' }\n : { display: 'flex', border: '1px solid var(--dsa-card-border)', borderRadius: '0.75rem', overflow: 'hidden', background: 'var(--dsa-card-bg)', cursor: 'pointer', transition: 'box-shadow 0.2s' }),\n ...(hovered ? { boxShadow: 'var(--dsa-hover-shadow)' } : {}),\n };\n\n return (\n <article\n style={cardStyle}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onClick={onClick}\n role=\"link\"\n tabIndex={0}\n onKeyDown={(e) => e.key === 'Enter' && onClick?.()}\n >\n {showImage && article.featured_image_url && (\n <img\n src={article.featured_image_url}\n alt={article.featured_image_alt || article.title}\n style={isGrid\n ? { width: '100%', height: '200px', objectFit: 'cover' as const, display: 'block' }\n : { width: '240px', minHeight: '160px', objectFit: 'cover' as const, flexShrink: 0 }}\n loading=\"lazy\"\n />\n )}\n <div style={isGrid ? { padding: '1.25rem' } : { padding: '1.25rem', flex: 1 }}>\n <h3 style={{ margin: '0 0 0.5rem', fontSize: '1.125rem', fontWeight: 600, lineHeight: 1.3, color: 'var(--dsa-text)' }}>\n {article.title}\n </h3>\n {showExcerpt && article.excerpt && (\n <p style={{ margin: '0 0 0.75rem', fontSize: '0.875rem', color: 'var(--dsa-text-muted)', lineHeight: 1.5 }}>\n {article.excerpt}\n </p>\n )}\n {showMeta && (\n <div style={{ display: 'flex', gap: '0.75rem', fontSize: '0.75rem', color: 'var(--dsa-text-faint)', flexWrap: 'wrap' as const }}>\n {article.pillar_name && (\n <span style={{ display: 'inline-block', padding: '0.125rem 0.5rem', borderRadius: '9999px', background: 'var(--dsa-badge-bg)', fontSize: '0.75rem', color: 'var(--dsa-badge-text)' }}>\n {article.pillar_name}\n </span>\n )}\n {article.content_type && (\n <span style={{ display: 'inline-block', padding: '0.125rem 0.5rem', borderRadius: '9999px', background: 'var(--dsa-badge-bg)', fontSize: '0.75rem', color: 'var(--dsa-badge-text)' }}>\n {article.content_type.replace(/_/g, ' ')}\n </span>\n )}\n {article.reading_time_minutes && <span>{article.reading_time_minutes} min read</span>}\n {article.published_at && <span>{new Date(article.published_at).toLocaleDateString()}</span>}\n </div>\n )}\n </div>\n </article>\n );\n}\n\n/**\n * Renders a grid or list of article cards.\n * Supports theme=\"light\" | \"dark\" | \"inherit\" via CSS variables.\n *\n * CSS variables (override in your own CSS for full control):\n * --dsa-text, --dsa-text-muted, --dsa-text-faint,\n * --dsa-card-bg, --dsa-card-border,\n * --dsa-badge-bg, --dsa-badge-text, --dsa-hover-shadow\n */\nexport function ArticleFeed({\n articles,\n layout = 'grid',\n columns = 3,\n showExcerpt = true,\n showImage = true,\n showMeta = true,\n onArticleClick,\n className,\n theme = 'light',\n renderArticle,\n}: ArticleFeedProps) {\n const gridTemplateColumns = layout === 'grid' ? `repeat(${columns}, 1fr)` : '1fr';\n const vars = theme !== 'inherit' ? themeVars[theme] : {};\n\n return (\n <div\n className={className}\n style={{ display: 'grid', gap: '1.5rem', gridTemplateColumns, ...vars } as React.CSSProperties}\n >\n {(articles ?? []).map((article) =>\n renderArticle ? (\n <React.Fragment key={article.id}>{renderArticle(article)}</React.Fragment>\n ) : (\n <DefaultCard\n key={article.id}\n article={article}\n layout={layout}\n showExcerpt={showExcerpt}\n showImage={showImage}\n showMeta={showMeta}\n onClick={() => onArticleClick?.(article.slug)}\n />\n ),\n )}\n </div>\n );\n}\n","'use client';\n\nimport React from 'react';\nimport type { Article, ArticleListItem, FaqItem } from '../types';\nimport { FaqBlock } from './FaqBlock';\nimport { RelatedArticles } from './RelatedArticles';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type ArticleTheme = 'light' | 'dark' | 'inherit';\n\nexport interface ArticlePageProps {\n article: Article;\n showFaq?: boolean;\n showTableOfContents?: boolean;\n showMeta?: boolean;\n showRelated?: boolean;\n relatedArticles?: ArticleListItem[];\n onRelatedClick?: (slug: string) => void;\n className?: string;\n /** Extra class(es) on the `<div>` that wraps `content_html`. */\n contentClassName?: string;\n /**\n * `\"light\"` / `\"dark\"` — SDK applies inline styles + CSS vars + built-in prose rules.\n * `\"inherit\"` — SDK applies NO inline styles; only CSS classes and\n * `data-*` attributes are rendered so the host site has full control.\n *\n * In all modes the content body div has:\n * - `className=\"dsa-article-body\"`\n * - `data-dsa-article-body`\n *\n * @default \"light\"\n */\n theme?: ArticleTheme;\n /** Disable built-in prose styles injected via `<style>`. Works only in light/dark themes. */\n disableProseStyles?: boolean;\n components?: {\n H1?: React.ComponentType<{ children: React.ReactNode }>;\n Toc?: React.ComponentType<{ headings: Article['headings'] }>;\n Faq?: React.ComponentType<{ items: FaqItem[] }>;\n };\n}\n\n// ---------------------------------------------------------------------------\n// Theme CSS variable presets\n// ---------------------------------------------------------------------------\n\nconst themeVars = {\n light: {\n '--dsa-text': '#111827',\n '--dsa-text-muted': '#6b7280',\n '--dsa-text-faint': '#9ca3af',\n '--dsa-card-bg': '#fff',\n '--dsa-card-border': '#e5e7eb',\n '--dsa-toc-bg': '#f9fafb',\n '--dsa-badge-bg': '#eff6ff',\n '--dsa-badge-text': '#2563eb',\n '--dsa-badge-alt-bg': '#f0fdf4',\n '--dsa-badge-alt-text': '#16a34a',\n '--dsa-content-text': '#374151',\n '--dsa-h2-text': '#111827',\n '--dsa-h3-text': '#1f2937',\n '--dsa-h4-text': '#1f2937',\n '--dsa-link': '#2563eb',\n '--dsa-link-hover': '#1d4ed8',\n '--dsa-blockquote-border': '#d1d5db',\n '--dsa-blockquote-text': '#4b5563',\n '--dsa-pre-bg': '#f3f4f6',\n '--dsa-table-border': '#e5e7eb',\n '--dsa-table-header-bg': '#f9fafb',\n '--dsa-divider': '#e5e7eb',\n },\n dark: {\n '--dsa-text': '#f3f4f6',\n '--dsa-text-muted': '#9ca3af',\n '--dsa-text-faint': '#6b7280',\n '--dsa-card-bg': '#1f2937',\n '--dsa-card-border': '#374151',\n '--dsa-toc-bg': '#111827',\n '--dsa-badge-bg': '#1e3a5f',\n '--dsa-badge-text': '#93c5fd',\n '--dsa-badge-alt-bg': '#14532d',\n '--dsa-badge-alt-text': '#86efac',\n '--dsa-content-text': '#d1d5db',\n '--dsa-h2-text': '#f3f4f6',\n '--dsa-h3-text': '#e5e7eb',\n '--dsa-h4-text': '#e5e7eb',\n '--dsa-link': '#60a5fa',\n '--dsa-link-hover': '#93c5fd',\n '--dsa-blockquote-border': '#4b5563',\n '--dsa-blockquote-text': '#9ca3af',\n '--dsa-pre-bg': '#111827',\n '--dsa-table-border': '#374151',\n '--dsa-table-header-bg': '#111827',\n '--dsa-divider': '#374151',\n },\n} as const;\n\n// ---------------------------------------------------------------------------\n// Built-in prose stylesheet (injected once via <style>)\n// ---------------------------------------------------------------------------\n\nconst PROSE_STYLE_ID = 'dsa-article-prose';\n\nconst proseCSS = /* css */ `\n[data-dsa-article-body] h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; color: var(--dsa-h2-text, #111827); margin: 2rem 0 0.75rem; }\n[data-dsa-article-body] h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; color: var(--dsa-h3-text, #1f2937); margin: 1.75rem 0 0.5rem; }\n[data-dsa-article-body] h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; color: var(--dsa-h4-text, #1f2937); margin: 1.5rem 0 0.5rem; }\n[data-dsa-article-body] p { margin: 0 0 1.25rem; }\n[data-dsa-article-body] ul,\n[data-dsa-article-body] ol { margin: 0 0 1.25rem; padding-left: 1.5rem; }\n[data-dsa-article-body] li { margin: 0 0 0.375rem; }\n[data-dsa-article-body] li > ul,\n[data-dsa-article-body] li > ol { margin: 0.375rem 0 0; }\n[data-dsa-article-body] blockquote { margin: 1.5rem 0; padding: 0.75rem 1.25rem; border-left: 4px solid var(--dsa-blockquote-border, #d1d5db); color: var(--dsa-blockquote-text, #4b5563); font-style: italic; }\n[data-dsa-article-body] pre { margin: 1.5rem 0; padding: 1rem; background: var(--dsa-pre-bg, #f3f4f6); border-radius: 0.5rem; overflow-x: auto; font-size: 0.875rem; }\n[data-dsa-article-body] code { font-size: 0.875em; }\n[data-dsa-article-body] table { width: 100%; margin: 1.5rem 0; border-collapse: collapse; font-size: 0.9375rem; }\n[data-dsa-article-body] th,\n[data-dsa-article-body] td { padding: 0.5rem 0.75rem; border: 1px solid var(--dsa-table-border, #e5e7eb); text-align: left; }\n[data-dsa-article-body] th { background: var(--dsa-table-header-bg, #f9fafb); font-weight: 600; }\n[data-dsa-article-body] img { max-width: 100%; height: auto; border-radius: 0.5rem; margin: 1.5rem 0; }\n[data-dsa-article-body] a { color: var(--dsa-link, #2563eb); text-decoration: underline; text-underline-offset: 2px; }\n[data-dsa-article-body] a:hover { color: var(--dsa-link-hover, #1d4ed8); }\n[data-dsa-article-body] hr { border: none; border-top: 1px solid var(--dsa-divider, #e5e7eb); margin: 2rem 0; }\n[data-dsa-article-body] > *:first-child { margin-top: 0; }\n[data-dsa-article-body] > *:last-child { margin-bottom: 0; }\n`.trim();\n\nfunction useProseStyles(enabled: boolean) {\n React.useEffect(() => {\n if (!enabled) return;\n if (typeof document === 'undefined') return;\n if (document.getElementById(PROSE_STYLE_ID)) return;\n const el = document.createElement('style');\n el.id = PROSE_STYLE_ID;\n el.textContent = proseCSS;\n document.head.appendChild(el);\n }, [enabled]);\n}\n\n// ---------------------------------------------------------------------------\n// Sub-components\n// ---------------------------------------------------------------------------\n\nfunction DefaultToc({ headings }: { headings: Article['headings'] }) {\n if (!headings || headings.length === 0) return null;\n return (\n <nav className=\"dsa-toc\" data-dsa-toc=\"\" style={{ background: 'var(--dsa-toc-bg, #f9fafb)', border: '1px solid var(--dsa-card-border, #e5e7eb)', borderRadius: '0.75rem', padding: '1.25rem', marginBottom: '2rem' }}>\n <p style={{ fontSize: '0.875rem', fontWeight: 600, color: 'var(--dsa-text-muted, #374151)', margin: '0 0 0.75rem', textTransform: 'uppercase' as const, letterSpacing: '0.05em' }}>\n Table of Contents\n </p>\n <ul style={{ listStyle: 'none', padding: 0, margin: 0 }}>\n {headings.map((h, i) => (\n <li key={i} style={{ padding: '0.25rem 0', paddingLeft: `${(h.level - 2) * 1}rem` }}>\n <a href={`#${h.id}`} style={{ color: 'var(--dsa-text-muted, #4b5563)', textDecoration: 'none', fontSize: '0.875rem' }}>\n {h.text}\n </a>\n </li>\n ))}\n </ul>\n </nav>\n );\n}\n\nfunction InheritToc({ headings }: { headings: Article['headings'] }) {\n if (!headings || headings.length === 0) return null;\n return (\n <nav className=\"dsa-toc\" data-dsa-toc=\"\">\n <p className=\"dsa-toc-title\">Table of Contents</p>\n <ul className=\"dsa-toc-list\">\n {headings.map((h, i) => (\n <li key={i} className=\"dsa-toc-item\" style={{ paddingLeft: `${(h.level - 2) * 1}rem` }}>\n <a href={`#${h.id}`} className=\"dsa-toc-link\">\n {h.text}\n </a>\n </li>\n ))}\n </ul>\n </nav>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Main component\n// ---------------------------------------------------------------------------\n\n/**\n * Full article page with optional TOC, FAQ, related articles, and JSON-LD.\n *\n * **light / dark** — SDK applies inline styles with `--dsa-*` CSS variable\n * overrides, plus built-in prose rules for the article body.\n *\n * **inherit** — SDK renders only semantic HTML with stable CSS classes\n * and `data-*` attributes. No inline styles, no injected `<style>`.\n *\n * ### Stable CSS selectors (always present)\n *\n * | Element | Class | Data attribute |\n * |---------|-------|----------------|\n * | Root | `className` prop | `data-dsa-theme` |\n * | Body | `dsa-article-body` + `contentClassName` | `data-dsa-article-body` |\n * | TOC | `dsa-toc` | `data-dsa-toc` |\n * | Meta | `dsa-meta` | `data-dsa-meta` |\n *\n * ```tsx\n * // Works out of the box\n * <ArticlePage article={article} />\n *\n * // Inherit — host site provides all styles\n * <ArticlePage article={article} theme=\"inherit\" contentClassName=\"prose dark:prose-invert\" />\n * ```\n */\nexport function ArticlePage({\n article,\n showFaq = true,\n showTableOfContents = true,\n showMeta = true,\n showRelated = false,\n relatedArticles,\n onRelatedClick,\n className,\n contentClassName,\n theme = 'light',\n disableProseStyles = false,\n components,\n}: ArticlePageProps) {\n const inherit = theme === 'inherit';\n useProseStyles(!inherit && !disableProseStyles);\n\n const H1 = components?.H1 || (inherit\n ? ({ children }: { children: React.ReactNode }) => <h1 className=\"dsa-h1\">{children}</h1>\n : ({ children }: { children: React.ReactNode }) => (\n <h1 className=\"dsa-h1\" style={{ fontSize: '2.25rem', fontWeight: 700, lineHeight: 1.2, color: 'var(--dsa-text)', margin: '0 0 1rem' }}>{children}</h1>\n ));\n const Toc = components?.Toc || (inherit ? InheritToc : DefaultToc);\n const FaqComponent = components?.Faq || FaqBlock;\n const vars = !inherit ? themeVars[theme] : {};\n const bodyClasses = ['dsa-article-body', contentClassName].filter(Boolean).join(' ');\n\n return (\n <article\n className={className}\n data-dsa-theme={theme}\n style={inherit ? undefined : { maxWidth: '48rem', margin: '0 auto', fontFamily: 'system-ui, -apple-system, sans-serif', ...vars } as React.CSSProperties}\n >\n {showMeta && (\n <div className=\"dsa-meta\" data-dsa-meta=\"\" style={inherit ? undefined : { display: 'flex', gap: '1rem', flexWrap: 'wrap' as const, fontSize: '0.875rem', color: 'var(--dsa-text-muted)', marginBottom: '1.5rem' }}>\n {article.pillar_name && (\n <span className=\"dsa-badge\" style={inherit ? undefined : { display: 'inline-block', padding: '0.125rem 0.5rem', borderRadius: '9999px', background: 'var(--dsa-badge-bg)', color: 'var(--dsa-badge-text)', fontSize: '0.75rem' }}>\n {article.pillar_name}\n </span>\n )}\n {article.content_type && (\n <span className=\"dsa-badge dsa-badge--alt\" style={inherit ? undefined : { display: 'inline-block', padding: '0.125rem 0.5rem', borderRadius: '9999px', background: 'var(--dsa-badge-alt-bg, var(--dsa-badge-bg))', color: 'var(--dsa-badge-alt-text, var(--dsa-badge-text))', fontSize: '0.75rem' }}>\n {article.content_type.replace(/_/g, ' ')}\n </span>\n )}\n {article.reading_time_minutes && <span className=\"dsa-reading-time\">{article.reading_time_minutes} min read</span>}\n {article.published_at && <span className=\"dsa-published-at\">{new Date(article.published_at).toLocaleDateString()}</span>}\n </div>\n )}\n\n <H1>{article.h1 || article.title}</H1>\n\n {article.featured_image_url && (\n <img\n className=\"dsa-featured-image\"\n src={article.featured_image_url}\n alt={article.featured_image_alt || article.title}\n style={inherit ? undefined : { width: '100%', borderRadius: '0.75rem', marginBottom: '2rem' }}\n />\n )}\n\n {showTableOfContents && (article.headings ?? []).length > 0 && (\n <Toc headings={article.headings} />\n )}\n\n {/* Article body */}\n <div\n className={bodyClasses}\n data-dsa-article-body=\"\"\n style={inherit ? undefined : { lineHeight: 1.75, color: 'var(--dsa-content-text)', fontSize: '1.0625rem' }}\n dangerouslySetInnerHTML={{ __html: article.content_html }}\n />\n\n {showFaq && (article.faq ?? []).length > 0 && (\n <>\n <hr className=\"dsa-divider\" style={inherit ? undefined : { border: 'none', borderTop: '1px solid var(--dsa-divider)', margin: '2.5rem 0' }} />\n <FaqComponent items={article.faq} />\n </>\n )}\n\n {article.schema_json && (\n <script\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{ __html: JSON.stringify(article.schema_json) }}\n />\n )}\n\n {showRelated && relatedArticles && relatedArticles.length > 0 && (\n <>\n <hr className=\"dsa-divider\" style={inherit ? undefined : { border: 'none', borderTop: '1px solid var(--dsa-divider)', margin: '2.5rem 0' }} />\n <RelatedArticles articles={relatedArticles} onArticleClick={onRelatedClick} theme={theme} />\n </>\n )}\n </article>\n );\n}\n","'use client';\n\nimport React, { useState } from 'react';\nimport type { FaqItem } from '../types';\n\nexport interface FaqBlockProps {\n items: FaqItem[];\n collapsible?: boolean;\n defaultOpen?: boolean;\n className?: string;\n title?: string;\n /** \"light\" | \"dark\" | \"inherit\" */\n theme?: 'light' | 'dark' | 'inherit';\n}\n\nconst themeVars = {\n light: {\n '--dsa-text': '#111827',\n '--dsa-text-muted': '#4b5563',\n '--dsa-text-faint': '#9ca3af',\n '--dsa-divider': '#e5e7eb',\n },\n dark: {\n '--dsa-text': '#f3f4f6',\n '--dsa-text-muted': '#d1d5db',\n '--dsa-text-faint': '#6b7280',\n '--dsa-divider': '#374151',\n },\n} as const;\n\nfunction FaqItemComponent({\n item,\n collapsible,\n defaultOpen,\n}: {\n item: FaqItem;\n collapsible: boolean;\n defaultOpen: boolean;\n}) {\n const [open, setOpen] = useState(defaultOpen);\n\n if (!collapsible) {\n return (\n <div style={{ borderBottom: '1px solid var(--dsa-divider)', padding: '0.75rem 0' }}>\n <p style={{ fontSize: '1rem', fontWeight: 600, color: 'var(--dsa-text)', margin: '0 0 0.5rem' }}>{item.question}</p>\n <div style={{ fontSize: '0.9375rem', color: 'var(--dsa-text-muted)', lineHeight: 1.6 }}>{item.answer}</div>\n </div>\n );\n }\n\n return (\n <div style={{ borderBottom: '1px solid var(--dsa-divider)', padding: '0.75rem 0' }}>\n <button\n style={{\n display: 'flex', justifyContent: 'space-between', alignItems: 'center',\n cursor: 'pointer', background: 'none', border: 'none', width: '100%',\n textAlign: 'left' as const, padding: '0.5rem 0', fontSize: '1rem',\n fontWeight: 600, color: 'var(--dsa-text)', fontFamily: 'inherit',\n }}\n onClick={() => setOpen(!open)}\n aria-expanded={open}\n >\n <span>{item.question}</span>\n <span style={{ flexShrink: 0, marginLeft: '1rem', transition: 'transform 0.2s', fontSize: '1.25rem', color: 'var(--dsa-text-faint)', transform: open ? 'rotate(180deg)' : 'rotate(0deg)' }}>\n ▼\n </span>\n </button>\n {open && <div style={{ fontSize: '0.9375rem', color: 'var(--dsa-text-muted)', lineHeight: 1.6, paddingTop: '0.5rem' }}>{item.answer}</div>}\n </div>\n );\n}\n\n/**\n * FAQ block with Schema.org FAQPage markup.\n * Supports theme=\"light\" | \"dark\" | \"inherit\" via CSS variables.\n */\nexport function FaqBlock({\n items,\n collapsible = true,\n defaultOpen = false,\n className,\n title = 'Frequently Asked Questions',\n theme = 'light',\n}: FaqBlockProps) {\n if (!items || items.length === 0) return null;\n const vars = theme !== 'inherit' ? themeVars[theme] : {};\n\n const schemaData = {\n '@context': 'https://schema.org',\n '@type': 'FAQPage',\n mainEntity: items.map((item) => ({\n '@type': 'Question',\n name: item.question,\n acceptedAnswer: { '@type': 'Answer', text: item.answer },\n })),\n };\n\n return (\n <section className={className} style={{ marginTop: '1rem', ...vars } as React.CSSProperties}>\n <h2 style={{ fontSize: '1.5rem', fontWeight: 700, color: 'var(--dsa-text)', margin: '0 0 1rem' }}>{title}</h2>\n {items.map((item, i) => (\n <FaqItemComponent key={i} item={item} collapsible={collapsible} defaultOpen={defaultOpen} />\n ))}\n <script\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaData) }}\n />\n </section>\n );\n}\n","'use client';\n\nimport React from 'react';\nimport type { ArticleListItem } from '../types';\n\nexport interface RelatedArticlesProps {\n articles: ArticleListItem[];\n title?: string;\n limit?: number;\n onArticleClick?: (slug: string) => void;\n className?: string;\n /** \"light\" | \"dark\" | \"inherit\" */\n theme?: 'light' | 'dark' | 'inherit';\n}\n\nconst themeVars = {\n light: {\n '--dsa-text': '#111827',\n '--dsa-text-muted': '#6b7280',\n '--dsa-card-bg': '#fff',\n '--dsa-card-border': '#e5e7eb',\n },\n dark: {\n '--dsa-text': '#f3f4f6',\n '--dsa-text-muted': '#9ca3af',\n '--dsa-card-bg': '#1f2937',\n '--dsa-card-border': '#374151',\n },\n} as const;\n\n/**\n * Related articles widget.\n * Supports theme=\"light\" | \"dark\" | \"inherit\" via CSS variables.\n */\nexport function RelatedArticles({\n articles,\n title = 'Related Articles',\n limit = 3,\n onArticleClick,\n className,\n theme = 'light',\n}: RelatedArticlesProps) {\n const displayed = (articles ?? []).slice(0, limit);\n if (displayed.length === 0) return null;\n const vars = theme !== 'inherit' ? themeVars[theme] : {};\n\n return (\n <section className={className} style={{ marginTop: '1rem', ...vars } as React.CSSProperties}>\n <h3 style={{ fontSize: '1.25rem', fontWeight: 700, color: 'var(--dsa-text)', margin: '0 0 1rem' }}>{title}</h3>\n <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(250px, 1fr))', gap: '1rem' }}>\n {displayed.map((a) => (\n <div\n key={a.id}\n style={{ border: '1px solid var(--dsa-card-border)', borderRadius: '0.5rem', overflow: 'hidden', cursor: 'pointer', transition: 'box-shadow 0.2s', background: 'var(--dsa-card-bg)' }}\n onClick={() => onArticleClick?.(a.slug)}\n role=\"link\"\n tabIndex={0}\n onKeyDown={(e) => e.key === 'Enter' && onArticleClick?.(a.slug)}\n >\n {a.featured_image_url && (\n <img\n src={a.featured_image_url}\n alt={a.featured_image_alt || a.title}\n style={{ width: '100%', height: '140px', objectFit: 'cover' as const, display: 'block' }}\n loading=\"lazy\"\n />\n )}\n <div style={{ padding: '1rem' }}>\n <h4 style={{ fontSize: '0.9375rem', fontWeight: 600, color: 'var(--dsa-text)', margin: 0, lineHeight: 1.3 }}>{a.title}</h4>\n {a.excerpt && <p style={{ fontSize: '0.8125rem', color: 'var(--dsa-text-muted)', marginTop: '0.5rem', lineHeight: 1.4 }}>{a.excerpt}</p>}\n </div>\n </div>\n ))}\n </div>\n </section>\n );\n}\n","import type { Article } from '../types';\n\n/**\n * Generate Next.js App Router Metadata object from an Article.\n * Use in page.tsx generateMetadata():\n *\n * ```ts\n * import { generateArticleMetadata } from \"@dsa/content-sdk/server\";\n *\n * export async function generateMetadata({ params }) {\n * const article = await fetchArticleBySlug(config, params.slug);\n * return generateArticleMetadata(article, \"https://example.com\");\n * }\n * ```\n */\nexport function generateArticleMetadata(\n article: Article,\n siteUrl?: string,\n): Record<string, any> {\n const url = siteUrl\n ? `${siteUrl.replace(/\\/+$/, '')}/blog/${article.slug}`\n : undefined;\n\n return {\n title: article.meta_title || article.title,\n description: article.meta_description || article.excerpt || '',\n openGraph: {\n title: article.meta_title || article.title,\n description: article.meta_description || article.excerpt || '',\n type: 'article',\n publishedTime: article.published_at || undefined,\n modifiedTime: article.updated_at || undefined,\n ...(url ? { url } : {}),\n ...(article.featured_image_url\n ? {\n images: [\n {\n url: article.featured_image_url,\n alt: article.featured_image_alt || article.title,\n },\n ],\n }\n : {}),\n },\n twitter: {\n card: 'summary_large_image',\n title: article.meta_title || article.title,\n description: article.meta_description || article.excerpt || '',\n ...(article.featured_image_url ? { images: [article.featured_image_url] } : {}),\n },\n ...(article.canonical_url\n ? { alternates: { canonical: article.canonical_url } }\n : url\n ? { alternates: { canonical: url } }\n : {}),\n };\n}\n\n/**\n * Renders JSON-LD structured data for an article.\n * Include this component in your article page layout for SEO.\n *\n * ```tsx\n * <SeoMetaBridge article={article} siteUrl=\"https://example.com\" />\n * ```\n */\nexport function SeoMetaBridge({\n article,\n siteUrl,\n}: {\n article: Article;\n siteUrl?: string;\n}) {\n const schema = article.schema_json || {\n '@context': 'https://schema.org',\n '@type': 'Article',\n headline: article.meta_title || article.title,\n description: article.meta_description || article.excerpt || '',\n datePublished: article.published_at || undefined,\n dateModified: article.updated_at || article.published_at || undefined,\n ...(article.featured_image_url ? { image: article.featured_image_url } : {}),\n ...(siteUrl ? { url: `${siteUrl.replace(/\\/+$/, '')}/blog/${article.slug}` } : {}),\n ...(article.target_keyword\n ? { keywords: [article.target_keyword, ...(article.secondary_keywords || [])].join(', ') }\n : {}),\n };\n\n return (\n <script\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{ __html: JSON.stringify(schema) }}\n />\n );\n}\n","'use client';\n\nimport React, { useState, type FormEvent } from 'react';\nimport { useDsaLeadForm } from '../lead-form-hook';\nimport type {\n DsaLeadFormConfig,\n LeadFormField,\n LeadFormFieldName,\n LeadFormPayload,\n LeadMagnetConfig,\n} from '../types';\n\nexport type { LeadFormField, LeadFormFieldName, LeadMagnetConfig };\n\n/** Theme for the lead form */\nexport type LeadFormTheme = 'light' | 'dark' | 'inherit';\n\nexport interface DsaLeadFormProps extends DsaLeadFormConfig {\n /** Form fields to display. Shorthand: pass an array of field names. */\n fields?: (LeadFormFieldName | LeadFormField)[];\n /** Lead magnet to promote above the form / show after submission */\n leadMagnet?: LeadMagnetConfig;\n /** CTA button text */\n ctaText?: string;\n /** Thank-you message shown after successful submission */\n thankYouMessage?: string;\n /** Theme: \"light\" | \"dark\" | \"inherit\" (no styles) */\n theme?: LeadFormTheme;\n /** Additional CSS class on the wrapper */\n className?: string;\n /** Called after successful submission */\n onSuccess?: (data: LeadFormPayload) => void;\n /** Called on submission error */\n onError?: (error: Error) => void;\n /** Override source_url (defaults to window.location.href) */\n sourceUrl?: string;\n /** Render prop for full custom rendering */\n children?: (state: {\n submitting: boolean;\n submitted: boolean;\n error: Error | null;\n submit: (data: LeadFormPayload) => void;\n reset: () => void;\n }) => React.ReactNode;\n}\n\ntype FieldType = NonNullable<LeadFormField['type']>;\n\nconst FIELD_DEFAULTS: Record<LeadFormFieldName, { label: string; placeholder: string; type: FieldType; required: boolean }> = {\n name: { label: 'Name', placeholder: 'Your name', type: 'text', required: false },\n email: { label: 'Email', placeholder: 'you@company.com', type: 'email', required: true },\n phone: { label: 'Phone', placeholder: '+1 (555) 000-0000', type: 'tel', required: false },\n company: { label: 'Company', placeholder: 'Company name', type: 'text', required: false },\n website: { label: 'Website', placeholder: 'https://...', type: 'url', required: false },\n message: { label: 'Message', placeholder: 'How can we help?', type: 'textarea', required: false },\n city: { label: 'City', placeholder: 'City', type: 'text', required: false },\n country: { label: 'Country', placeholder: 'Country', type: 'text', required: false },\n};\n\nfunction normalizeField(f: LeadFormFieldName | LeadFormField): LeadFormField & { name: LeadFormFieldName } {\n if (typeof f === 'string') {\n const def = FIELD_DEFAULTS[f];\n return { name: f, ...def };\n }\n const def = FIELD_DEFAULTS[f.name];\n return { ...def, ...f };\n}\n\n/**\n * Ready-to-use lead capture form with built-in DSA webhook integration.\n *\n * ```tsx\n * <DsaLeadForm\n * webhookUrl=\"https://api.example.com\"\n * projectSlug=\"my-project\"\n * webhookToken=\"abc123\"\n * fields={['name', 'email', 'company']}\n * ctaText=\"Get Free Audit\"\n * leadMagnet={{ title: \"SEO Audit Checklist\", description: \"47-point checklist\" }}\n * theme=\"dark\"\n * />\n * ```\n */\nexport function DsaLeadForm({\n webhookUrl,\n projectSlug,\n webhookToken,\n fields = ['name', 'email'],\n leadMagnet,\n ctaText = 'Submit',\n thankYouMessage,\n theme = 'light',\n className,\n onSuccess,\n onError,\n sourceUrl,\n children,\n}: DsaLeadFormProps) {\n const form = useDsaLeadForm({ webhookUrl, projectSlug, webhookToken });\n const [values, setValues] = useState<Record<string, string>>({});\n\n const normalizedFields = fields.map(normalizeField);\n\n // Render prop mode\n if (children) {\n return <>{children({ ...form })}</>;\n }\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n const payload: LeadFormPayload = {\n email: values.email || '',\n name: values.name,\n phone: values.phone,\n company: values.company,\n website: values.website,\n message: values.message,\n city: values.city,\n country: values.country,\n source_url: sourceUrl,\n };\n const result = await form.submit(payload);\n if (result.ok) {\n onSuccess?.(payload);\n } else if (result.error) {\n onError?.(new Error(result.error));\n }\n };\n\n const isInherit = theme === 'inherit';\n const isDark = theme === 'dark';\n\n const styles = isInherit ? {} : {\n wrapper: {\n fontFamily: '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n backgroundColor: isDark ? '#1e293b' : '#ffffff',\n border: `1px solid ${isDark ? '#334155' : '#e2e8f0'}`,\n borderRadius: '12px',\n padding: '24px',\n maxWidth: '480px',\n color: isDark ? '#f1f5f9' : '#0f172a',\n } as React.CSSProperties,\n heading: {\n margin: '0 0 4px 0',\n fontSize: '18px',\n fontWeight: 700,\n color: isDark ? '#f1f5f9' : '#0f172a',\n } as React.CSSProperties,\n description: {\n margin: '0 0 16px 0',\n fontSize: '14px',\n color: isDark ? '#94a3b8' : '#64748b',\n } as React.CSSProperties,\n label: {\n display: 'block',\n fontSize: '13px',\n fontWeight: 500,\n marginBottom: '4px',\n color: isDark ? '#cbd5e1' : '#374151',\n } as React.CSSProperties,\n input: {\n display: 'block',\n width: '100%',\n padding: '8px 12px',\n fontSize: '14px',\n border: `1px solid ${isDark ? '#475569' : '#d1d5db'}`,\n borderRadius: '8px',\n backgroundColor: isDark ? '#0f172a' : '#ffffff',\n color: isDark ? '#f1f5f9' : '#0f172a',\n outline: 'none',\n boxSizing: 'border-box' as const,\n } as React.CSSProperties,\n textarea: {\n display: 'block',\n width: '100%',\n padding: '8px 12px',\n fontSize: '14px',\n border: `1px solid ${isDark ? '#475569' : '#d1d5db'}`,\n borderRadius: '8px',\n backgroundColor: isDark ? '#0f172a' : '#ffffff',\n color: isDark ? '#f1f5f9' : '#0f172a',\n outline: 'none',\n minHeight: '80px',\n resize: 'vertical' as const,\n fontFamily: 'inherit',\n boxSizing: 'border-box' as const,\n } as React.CSSProperties,\n button: {\n width: '100%',\n padding: '10px 20px',\n fontSize: '14px',\n fontWeight: 600,\n color: '#ffffff',\n backgroundColor: '#2563eb',\n border: 'none',\n borderRadius: '8px',\n cursor: 'pointer',\n marginTop: '4px',\n opacity: form.submitting ? 0.7 : 1,\n } as React.CSSProperties,\n fieldGroup: {\n marginBottom: '12px',\n } as React.CSSProperties,\n error: {\n fontSize: '13px',\n color: '#ef4444',\n marginTop: '8px',\n } as React.CSSProperties,\n success: {\n textAlign: 'center' as const,\n padding: '16px 0',\n } as React.CSSProperties,\n successTitle: {\n fontSize: '18px',\n fontWeight: 700,\n color: isDark ? '#34d399' : '#059669',\n marginBottom: '8px',\n } as React.CSSProperties,\n successText: {\n fontSize: '14px',\n color: isDark ? '#94a3b8' : '#64748b',\n marginBottom: '16px',\n } as React.CSSProperties,\n downloadLink: {\n display: 'inline-block',\n padding: '10px 24px',\n fontSize: '14px',\n fontWeight: 600,\n color: '#ffffff',\n backgroundColor: '#2563eb',\n borderRadius: '8px',\n textDecoration: 'none',\n } as React.CSSProperties,\n };\n\n // ── Success state ──\n if (form.submitted) {\n return (\n <div\n className={`dsa-lead-form dsa-lead-form--success ${className || ''}`}\n data-dsa-lead-form\n data-theme={theme}\n style={isInherit ? undefined : styles.wrapper}\n >\n <div style={isInherit ? undefined : styles.success}>\n <div style={isInherit ? undefined : styles.successTitle}>\n {thankYouMessage || 'Thank you!'}\n </div>\n {leadMagnet?.downloadUrl && (\n <>\n <p style={isInherit ? undefined : styles.successText}>\n Your download is ready:\n </p>\n <a\n href={leadMagnet.downloadUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"dsa-lead-form__download\"\n style={isInherit ? undefined : styles.downloadLink}\n >\n Download {leadMagnet.title}\n </a>\n </>\n )}\n </div>\n </div>\n );\n }\n\n // ── Form state ──\n return (\n <div\n className={`dsa-lead-form ${className || ''}`}\n data-dsa-lead-form\n data-theme={theme}\n style={isInherit ? undefined : styles.wrapper}\n >\n {/* Lead magnet promo header */}\n {leadMagnet && (\n <div className=\"dsa-lead-form__magnet\" style={{ marginBottom: '16px' }}>\n {leadMagnet.imageUrl && (\n <img\n src={leadMagnet.imageUrl}\n alt={leadMagnet.title}\n style={isInherit ? undefined : {\n width: '100%',\n borderRadius: '8px',\n marginBottom: '12px',\n display: 'block',\n }}\n className=\"dsa-lead-form__magnet-image\"\n />\n )}\n <h3 className=\"dsa-lead-form__magnet-title\" style={isInherit ? undefined : styles.heading}>\n {leadMagnet.title}\n </h3>\n {leadMagnet.description && (\n <p className=\"dsa-lead-form__magnet-description\" style={isInherit ? undefined : styles.description}>\n {leadMagnet.description}\n </p>\n )}\n </div>\n )}\n\n <form onSubmit={handleSubmit} className=\"dsa-lead-form__form\" noValidate>\n {normalizedFields.map((field) => (\n <div key={field.name} className=\"dsa-lead-form__field\" style={isInherit ? undefined : styles.fieldGroup}>\n <label className=\"dsa-lead-form__label\" style={isInherit ? undefined : styles.label}>\n {field.label}{field.required && ' *'}\n </label>\n {field.type === 'textarea' ? (\n <textarea\n name={field.name}\n placeholder={field.placeholder}\n required={field.required}\n value={values[field.name] || ''}\n onChange={(e) => setValues((v) => ({ ...v, [field.name]: e.target.value }))}\n className=\"dsa-lead-form__textarea\"\n style={isInherit ? undefined : styles.textarea}\n />\n ) : (\n <input\n type={field.type || 'text'}\n name={field.name}\n placeholder={field.placeholder}\n required={field.required}\n value={values[field.name] || ''}\n onChange={(e) => setValues((v) => ({ ...v, [field.name]: e.target.value }))}\n className=\"dsa-lead-form__input\"\n style={isInherit ? undefined : styles.input}\n />\n )}\n </div>\n ))}\n\n <button\n type=\"submit\"\n disabled={form.submitting}\n className=\"dsa-lead-form__submit\"\n style={isInherit ? undefined : styles.button}\n >\n {form.submitting ? 'Sending...' : ctaText}\n </button>\n\n {form.error && (\n <p className=\"dsa-lead-form__error\" style={isInherit ? undefined : styles.error}>\n {form.error.message}\n </p>\n )}\n </form>\n </div>\n );\n}\n"],"mappings":";AAcO,IAAMA,EAAN,KAAoB,CAMzB,YAAYC,EAA0B,CACpC,KAAK,OAASA,EAAO,OAAO,QAAQ,OAAQ,EAAE,EAC9C,KAAK,OAASA,EAAO,OACrB,KAAK,cACHA,EAAO,gBAAkB,aACrB,UACAA,EAAO,gBAAkB,cACvB,cACA,WACR,KAAK,kBAAoBA,EAAO,iBAClC,CAEA,MAAc,QAAWC,EAAcC,EAAkE,CACvG,IAAMC,EAAM,IAAI,IAAI,GAAG,KAAK,MAAM,GAAGF,CAAI,EAAE,EACvCC,GACF,OAAO,QAAQA,CAAM,EAAE,QAAQ,CAAC,CAACE,EAAGC,CAAC,IAAM,CAClBA,GAAM,MAAQA,IAAM,IACzCF,EAAI,aAAa,IAAIC,EAAG,OAAOC,CAAC,CAAC,CAErC,CAAC,EAEHF,EAAI,aAAa,IAAI,WAAY,KAAK,MAAM,EAE5C,IAAMG,EAAiE,CACrE,OAAQ,MACR,QAAS,CAAE,YAAa,KAAK,MAAO,EACpC,MAAO,KAAK,aACd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,KAAM,EAAE,EAC1E,UAAU,uBACV,MAAOG,EAAY,OAAYE,EAAO,MACxC,IAxBMC,EAAM,IA0BhB,CACD,EAEDjC,EAAC,UACC,KAAK,SACL,SAAUoB,EAAK,WACf,UAAU,wBACV,MAAOU,EAAY,OAAYE,EAAO,OAErC,SAAAZ,EAAK,WAAa,aAAeR,EACpC,EAECQ,EAAK,OACJpB,EAAC,KAAE,UAAU,uBAAuB,MAAO8B,EAAY,OAAYE,EAAO,MACvE,SAAAZ,EAAK,MAAM,QACd,GAEJ,GACF,CAEJ","names":["ContentClient","config","path","params","url","k","v","fetchOptions","res","text","article","filters","raw","slug","limit","createContext","useContext","useMemo","jsx","ContentContext","createContext","DsaContentProvider","config","children","client","useMemo","ContentClient","useDsaContent","useContext","useState","useEffect","useCallback","useArticles","filters","client","useDsaContent","state","setState","useState","fetch","useCallback","s","res","err","useEffect","useArticle","slug","article","useRelatedArticles","limit","articles","useCategories","categories","useState","useCallback","useDsaLeadForm","config","submitting","setSubmitting","submitted","setSubmitted","error","setError","submit","data","url","body","res","json","msg","err","e","reset","React","jsx","jsxs","themeVars","DefaultCard","article","layout","showExcerpt","showImage","showMeta","onClick","isGrid","hovered","setHovered","cardStyle","e","ArticleFeed","articles","columns","onArticleClick","className","theme","renderArticle","gridTemplateColumns","vars","React","useState","jsx","jsxs","themeVars","FaqItemComponent","item","collapsible","defaultOpen","open","setOpen","FaqBlock","items","className","title","theme","vars","schemaData","i","jsx","jsxs","themeVars","RelatedArticles","articles","title","limit","onArticleClick","className","theme","displayed","vars","a","e","Fragment","jsx","jsxs","themeVars","PROSE_STYLE_ID","proseCSS","useProseStyles","enabled","React","el","DefaultToc","headings","h","i","InheritToc","ArticlePage","article","showFaq","showTableOfContents","showMeta","showRelated","relatedArticles","onRelatedClick","className","contentClassName","theme","disableProseStyles","components","inherit","H1","children","Toc","FaqComponent","FaqBlock","vars","bodyClasses","RelatedArticles","jsx","generateArticleMetadata","article","siteUrl","url","SeoMetaBridge","schema","useState","Fragment","jsx","jsxs","FIELD_DEFAULTS","normalizeField","f","def","DsaLeadForm","webhookUrl","projectSlug","webhookToken","fields","leadMagnet","ctaText","thankYouMessage","theme","className","onSuccess","onError","sourceUrl","children","form","useDsaLeadForm","values","setValues","useState","normalizedFields","handleSubmit","e","payload","result","isInherit","isDark","styles","field","v"]}
|
|
1
|
+
{"version":3,"sources":["../src/client.ts","../src/provider.tsx","../src/hooks.ts","../src/lead-form-hook.ts","../src/components/ArticleFeed.tsx","../src/components/ArticlePage.tsx","../src/components/FaqBlock.tsx","../src/components/RelatedArticles.tsx","../src/components/SeoMetaBridge.tsx","../src/components/DsaLeadForm.tsx"],"sourcesContent":["import type {\n DsaContentConfig,\n Article,\n ArticleListItem,\n ArticleFilters,\n PaginatedResponse,\n Category,\n SitemapEntry,\n} from './types';\n\n/**\n * ContentClient — HTTP client for DSA Content Engine Public API.\n * Works in both Node.js (SSR) and browser environments.\n */\nexport class ContentClient {\n private apiUrl: string;\n private apiKey: string;\n private cacheStrategy: RequestCache;\n private revalidateSeconds?: number;\n\n constructor(config: DsaContentConfig) {\n this.apiUrl = config.apiUrl.replace(/\\/+$/, '');\n this.apiKey = config.apiKey;\n this.cacheStrategy =\n config.cacheStrategy === 'revalidate'\n ? 'default'\n : config.cacheStrategy === 'force-cache'\n ? 'force-cache'\n : 'no-cache';\n this.revalidateSeconds = config.revalidateSeconds;\n }\n\n private async request<T>(path: string, params?: Record<string, string | number | undefined>): Promise<T> {\n const url = new URL(`${this.apiUrl}${path}`);\n if (params) {\n Object.entries(params).forEach(([k, v]) => {\n if (v !== undefined && v !== null && v !== '') {\n url.searchParams.set(k, String(v));\n }\n });\n }\n url.searchParams.set('site_key', this.apiKey);\n\n const fetchOptions: RequestInit & { next?: { revalidate?: number } } = {\n method: 'GET',\n headers: { 'X-API-Key': this.apiKey },\n cache: this.cacheStrategy,\n };\n\n // Next.js ISR revalidation\n if (this.revalidateSeconds && this.cacheStrategy !== 'no-cache') {\n fetchOptions.next = { revalidate: this.revalidateSeconds };\n }\n\n const res = await fetch(url.toString(), fetchOptions);\n\n if (!res.ok) {\n const text = await res.text().catch(() => '');\n throw new Error(`DSA Content API error ${res.status}: ${text || res.statusText}`);\n }\n\n return res.json() as Promise<T>;\n }\n\n /** Normalize article array fields to guarantee they're never null/undefined */\n private normalizeArticle(article: Article): Article {\n return {\n ...article,\n headings: article.headings ?? [],\n faq: article.faq ?? [],\n internal_links: article.internal_links ?? [],\n secondary_keywords: article.secondary_keywords ?? [],\n schema_json: article.schema_json ?? null,\n content_json: article.content_json ?? null,\n };\n }\n\n /** Get paginated list of published articles */\n async getArticles(filters?: ArticleFilters): Promise<PaginatedResponse<ArticleListItem>> {\n const raw = await this.request<Record<string, any>>('/api/public/articles', {\n page: filters?.page,\n per_page: filters?.per_page,\n pillar: filters?.pillar,\n cluster: filters?.cluster,\n content_type: filters?.content_type,\n search: filters?.search,\n });\n return {\n items: raw.items ?? raw.data ?? [],\n total: raw.total ?? 0,\n page: raw.page ?? 1,\n per_page: raw.per_page ?? 20,\n total_pages: raw.total_pages ?? raw.pages ?? 1,\n };\n }\n\n /** Get a single article by slug */\n async getArticleBySlug(slug: string): Promise<Article> {\n const article = await this.request<Article>(`/api/public/articles/${encodeURIComponent(slug)}`);\n return this.normalizeArticle(article);\n }\n\n /** Get related articles for a given slug */\n async getRelatedArticles(slug: string, limit = 3): Promise<ArticleListItem[]> {\n const raw = await this.request<Record<string, any>>(\n `/api/public/articles/${encodeURIComponent(slug)}/related`,\n { limit },\n );\n return raw.items ?? (Array.isArray(raw) ? raw : []);\n }\n\n /** Get all categories (pillars + clusters) with article counts */\n async getCategories(): Promise<Category[]> {\n const raw = await this.request<Record<string, any>>('/api/public/categories');\n return raw.items ?? (Array.isArray(raw) ? raw : []);\n }\n\n /** Get sitemap data for all published articles */\n async getSitemap(): Promise<SitemapEntry[]> {\n const raw = await this.request<Record<string, any>>('/api/public/sitemap');\n return raw.items ?? (Array.isArray(raw) ? raw : []);\n }\n}\n","'use client';\n\nimport React, { createContext, useContext, useMemo } from 'react';\nimport { ContentClient } from './client';\nimport type { DsaContentConfig } from './types';\n\nconst ContentContext = createContext<ContentClient | null>(null);\n\nexport interface DsaContentProviderProps {\n config: DsaContentConfig;\n children: React.ReactNode;\n}\n\n/**\n * Wrap your app (or a subtree) with DsaContentProvider to enable\n * the useDsaContent() hook and all data-fetching hooks.\n *\n * ```tsx\n * <DsaContentProvider config={{ apiUrl: \"...\", apiKey: \"...\" }}>\n * <App />\n * </DsaContentProvider>\n * ```\n */\nexport function DsaContentProvider({ config, children }: DsaContentProviderProps) {\n const client = useMemo(() => new ContentClient(config), [config.apiUrl, config.apiKey]);\n return <ContentContext.Provider value={client}>{children}</ContentContext.Provider>;\n}\n\n/**\n * Access the ContentClient instance from context.\n * Must be called inside a DsaContentProvider.\n */\nexport function useDsaContent(): ContentClient {\n const client = useContext(ContentContext);\n if (!client) {\n throw new Error('useDsaContent() must be used inside <DsaContentProvider>');\n }\n return client;\n}\n","'use client';\n\nimport { useState, useEffect, useCallback } from 'react';\nimport { useDsaContent } from './provider';\nimport type {\n ArticleFilters,\n UseArticlesState,\n UseArticleState,\n UseArticleListState,\n UseCategoriesState,\n} from './types';\n\n/**\n * Fetch a paginated list of published articles.\n *\n * ```tsx\n * const { articles, loading, error, pagination } = useArticles({ page: 1, per_page: 10 });\n * ```\n */\nexport function useArticles(filters?: ArticleFilters): UseArticlesState & { refetch: () => void } {\n const client = useDsaContent();\n const [state, setState] = useState<UseArticlesState>({\n articles: [],\n loading: true,\n error: null,\n pagination: { page: 1, per_page: 10, total: 0, total_pages: 0 },\n });\n\n const fetch = useCallback(() => {\n setState((s) => ({ ...s, loading: true, error: null }));\n client\n .getArticles(filters)\n .then((res) =>\n setState({\n articles: res.items,\n loading: false,\n error: null,\n pagination: {\n page: res.page,\n per_page: res.per_page,\n total: res.total,\n total_pages: res.total_pages,\n },\n }),\n )\n .catch((err) =>\n setState((s) => ({ ...s, loading: false, error: err instanceof Error ? err : new Error(String(err)) })),\n );\n }, [client, filters?.page, filters?.per_page, filters?.pillar, filters?.cluster, filters?.content_type, filters?.search]);\n\n useEffect(() => { fetch(); }, [fetch]);\n\n return { ...state, refetch: fetch };\n}\n\n/**\n * Fetch a single article by slug.\n *\n * ```tsx\n * const { article, loading, error } = useArticle(\"my-article-slug\");\n * ```\n */\nexport function useArticle(slug: string | undefined): UseArticleState & { refetch: () => void } {\n const client = useDsaContent();\n const [state, setState] = useState<UseArticleState>({ article: null, loading: true, error: null });\n\n const fetch = useCallback(() => {\n if (!slug) {\n setState({ article: null, loading: false, error: null });\n return;\n }\n setState((s) => ({ ...s, loading: true, error: null }));\n client\n .getArticleBySlug(slug)\n .then((article) => setState({ article, loading: false, error: null }))\n .catch((err) =>\n setState({ article: null, loading: false, error: err instanceof Error ? err : new Error(String(err)) }),\n );\n }, [client, slug]);\n\n useEffect(() => { fetch(); }, [fetch]);\n\n return { ...state, refetch: fetch };\n}\n\n/**\n * Fetch related articles for a given slug.\n *\n * ```tsx\n * const { articles, loading } = useRelatedArticles(\"my-article-slug\", 4);\n * ```\n */\nexport function useRelatedArticles(slug: string | undefined, limit = 3): UseArticleListState & { refetch: () => void } {\n const client = useDsaContent();\n const [state, setState] = useState<UseArticleListState>({ articles: [], loading: true, error: null });\n\n const fetch = useCallback(() => {\n if (!slug) {\n setState({ articles: [], loading: false, error: null });\n return;\n }\n setState((s) => ({ ...s, loading: true, error: null }));\n client\n .getRelatedArticles(slug, limit)\n .then((articles) => setState({ articles, loading: false, error: null }))\n .catch((err) =>\n setState({ articles: [], loading: false, error: err instanceof Error ? err : new Error(String(err)) }),\n );\n }, [client, slug, limit]);\n\n useEffect(() => { fetch(); }, [fetch]);\n\n return { ...state, refetch: fetch };\n}\n\n/**\n * Fetch all categories (pillars + clusters).\n *\n * ```tsx\n * const { categories, loading } = useCategories();\n * ```\n */\nexport function useCategories(): UseCategoriesState & { refetch: () => void } {\n const client = useDsaContent();\n const [state, setState] = useState<UseCategoriesState>({ categories: [], loading: true, error: null });\n\n const fetch = useCallback(() => {\n setState((s) => ({ ...s, loading: true, error: null }));\n client\n .getCategories()\n .then((categories) => setState({ categories, loading: false, error: null }))\n .catch((err) =>\n setState({ categories: [], loading: false, error: err instanceof Error ? err : new Error(String(err)) }),\n );\n }, [client]);\n\n useEffect(() => { fetch(); }, [fetch]);\n\n return { ...state, refetch: fetch };\n}\n","'use client';\n\nimport { useState, useCallback } from 'react';\nimport type {\n DsaLeadFormConfig,\n LeadFormPayload,\n LeadFormSubmitResult,\n UseLeadFormState,\n} from './types';\n\n/**\n * Headless hook for lead capture — handles submission to DSA webhook.\n * Use this when you want full control over form UI.\n *\n * ```tsx\n * const { submitting, submitted, error, submit, reset } = useDsaLeadForm({\n * webhookUrl: \"https://api.example.com\",\n * projectSlug: \"my-project\",\n * webhookToken: \"abc123\",\n * });\n *\n * const handleSubmit = (e) => {\n * e.preventDefault();\n * submit({ email: \"user@example.com\", name: \"John\" });\n * };\n * ```\n */\nexport function useDsaLeadForm(config: DsaLeadFormConfig): UseLeadFormState {\n const [submitting, setSubmitting] = useState(false);\n const [submitted, setSubmitted] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const submit = useCallback(\n async (data: LeadFormPayload): Promise<LeadFormSubmitResult> => {\n setSubmitting(true);\n setError(null);\n try {\n const baseUrl = config.webhookUrl.replace(/\\/+$/, '');\n const url = `${baseUrl}/api/webhook/form/${encodeURIComponent(config.projectSlug)}?token=${encodeURIComponent(config.webhookToken)}`;\n\n const body: Record<string, string> = { ...data } as any;\n if (!body.source_url && typeof window !== 'undefined') {\n body.source_url = window.location.href;\n }\n\n const res = await fetch(url, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body),\n });\n\n const json = await res.json().catch(() => ({}));\n\n if (!res.ok) {\n const msg = json.error || `Submission failed (${res.status})`;\n throw new Error(msg);\n }\n\n setSubmitted(true);\n return { ok: true, message: json.message };\n } catch (err) {\n const e = err instanceof Error ? err : new Error(String(err));\n setError(e);\n return { ok: false, error: e.message };\n } finally {\n setSubmitting(false);\n }\n },\n [config.webhookUrl, config.projectSlug, config.webhookToken],\n );\n\n const reset = useCallback(() => {\n setSubmitting(false);\n setSubmitted(false);\n setError(null);\n }, []);\n\n return { submitting, submitted, error, submit, reset };\n}\n","'use client';\n\nimport React from 'react';\nimport type { ArticleListItem } from '../types';\n\nexport interface ArticleFeedProps {\n articles: ArticleListItem[];\n layout?: 'grid' | 'list';\n columns?: 1 | 2 | 3;\n showExcerpt?: boolean;\n showImage?: boolean;\n showMeta?: boolean;\n onArticleClick?: (slug: string) => void;\n className?: string;\n /** \"light\" | \"dark\" | \"inherit\" — sets CSS variable defaults. Use \"inherit\" to control via your own CSS vars. */\n theme?: 'light' | 'dark' | 'inherit';\n renderArticle?: (article: ArticleListItem) => React.ReactNode;\n}\n\nconst themeVars = {\n light: {\n '--dsa-text': '#111827',\n '--dsa-text-muted': '#6b7280',\n '--dsa-text-faint': '#9ca3af',\n '--dsa-card-bg': '#fff',\n '--dsa-card-border': '#e5e7eb',\n '--dsa-badge-bg': '#f3f4f6',\n '--dsa-badge-text': '#4b5563',\n '--dsa-hover-shadow': '0 4px 12px rgba(0,0,0,0.08)',\n },\n dark: {\n '--dsa-text': '#f3f4f6',\n '--dsa-text-muted': '#9ca3af',\n '--dsa-text-faint': '#6b7280',\n '--dsa-card-bg': '#1f2937',\n '--dsa-card-border': '#374151',\n '--dsa-badge-bg': '#374151',\n '--dsa-badge-text': '#d1d5db',\n '--dsa-hover-shadow': '0 4px 12px rgba(0,0,0,0.3)',\n },\n} as const;\n\nfunction DefaultCard({\n article,\n layout,\n showExcerpt,\n showImage,\n showMeta,\n onClick,\n}: {\n article: ArticleListItem;\n layout: 'grid' | 'list';\n showExcerpt: boolean;\n showImage: boolean;\n showMeta: boolean;\n onClick?: () => void;\n}) {\n const isGrid = layout === 'grid';\n const [hovered, setHovered] = React.useState(false);\n\n const cardStyle: React.CSSProperties = {\n ...(isGrid\n ? { border: '1px solid var(--dsa-card-border)', borderRadius: '0.75rem', overflow: 'hidden', background: 'var(--dsa-card-bg)', cursor: 'pointer', transition: 'box-shadow 0.2s' }\n : { display: 'flex', border: '1px solid var(--dsa-card-border)', borderRadius: '0.75rem', overflow: 'hidden', background: 'var(--dsa-card-bg)', cursor: 'pointer', transition: 'box-shadow 0.2s' }),\n ...(hovered ? { boxShadow: 'var(--dsa-hover-shadow)' } : {}),\n };\n\n return (\n <article\n style={cardStyle}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onClick={onClick}\n role=\"link\"\n tabIndex={0}\n onKeyDown={(e) => e.key === 'Enter' && onClick?.()}\n >\n {showImage && article.featured_image_url && (\n <img\n src={article.featured_image_url}\n alt={article.featured_image_alt || article.title}\n style={isGrid\n ? { width: '100%', height: '200px', objectFit: 'cover' as const, display: 'block' }\n : { width: '240px', minHeight: '160px', objectFit: 'cover' as const, flexShrink: 0 }}\n loading=\"lazy\"\n />\n )}\n <div style={isGrid ? { padding: '1.25rem' } : { padding: '1.25rem', flex: 1 }}>\n <h3 style={{ margin: '0 0 0.5rem', fontSize: '1.125rem', fontWeight: 600, lineHeight: 1.3, color: 'var(--dsa-text)' }}>\n {article.title}\n </h3>\n {showExcerpt && article.excerpt && (\n <p style={{ margin: '0 0 0.75rem', fontSize: '0.875rem', color: 'var(--dsa-text-muted)', lineHeight: 1.5 }}>\n {article.excerpt}\n </p>\n )}\n {showMeta && (\n <div style={{ display: 'flex', gap: '0.75rem', fontSize: '0.75rem', color: 'var(--dsa-text-faint)', flexWrap: 'wrap' as const }}>\n {article.pillar_name && (\n <span style={{ display: 'inline-block', padding: '0.125rem 0.5rem', borderRadius: '9999px', background: 'var(--dsa-badge-bg)', fontSize: '0.75rem', color: 'var(--dsa-badge-text)' }}>\n {article.pillar_name}\n </span>\n )}\n {article.content_type && (\n <span style={{ display: 'inline-block', padding: '0.125rem 0.5rem', borderRadius: '9999px', background: 'var(--dsa-badge-bg)', fontSize: '0.75rem', color: 'var(--dsa-badge-text)' }}>\n {article.content_type.replace(/_/g, ' ')}\n </span>\n )}\n {article.reading_time_minutes && <span>{article.reading_time_minutes} min read</span>}\n {article.published_at && <span>{new Date(article.published_at).toLocaleDateString()}</span>}\n </div>\n )}\n </div>\n </article>\n );\n}\n\n/**\n * Renders a grid or list of article cards.\n * Supports theme=\"light\" | \"dark\" | \"inherit\" via CSS variables.\n *\n * CSS variables (override in your own CSS for full control):\n * --dsa-text, --dsa-text-muted, --dsa-text-faint,\n * --dsa-card-bg, --dsa-card-border,\n * --dsa-badge-bg, --dsa-badge-text, --dsa-hover-shadow\n */\nexport function ArticleFeed({\n articles,\n layout = 'grid',\n columns = 3,\n showExcerpt = true,\n showImage = true,\n showMeta = true,\n onArticleClick,\n className,\n theme = 'light',\n renderArticle,\n}: ArticleFeedProps) {\n const gridTemplateColumns = layout === 'grid' ? `repeat(${columns}, 1fr)` : '1fr';\n const vars = theme !== 'inherit' ? themeVars[theme] : {};\n\n return (\n <div\n className={className}\n style={{ display: 'grid', gap: '1.5rem', gridTemplateColumns, ...vars } as React.CSSProperties}\n >\n {(articles ?? []).map((article) =>\n renderArticle ? (\n <React.Fragment key={article.id}>{renderArticle(article)}</React.Fragment>\n ) : (\n <DefaultCard\n key={article.id}\n article={article}\n layout={layout}\n showExcerpt={showExcerpt}\n showImage={showImage}\n showMeta={showMeta}\n onClick={() => onArticleClick?.(article.slug)}\n />\n ),\n )}\n </div>\n );\n}\n","'use client';\n\nimport React from 'react';\nimport type { Article, ArticleListItem, FaqItem } from '../types';\nimport { FaqBlock } from './FaqBlock';\nimport { RelatedArticles } from './RelatedArticles';\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport type ArticleTheme = 'light' | 'dark' | 'inherit';\n\nexport interface ArticlePageProps {\n article: Article;\n showFaq?: boolean;\n showTableOfContents?: boolean;\n showMeta?: boolean;\n showRelated?: boolean;\n relatedArticles?: ArticleListItem[];\n onRelatedClick?: (slug: string) => void;\n className?: string;\n /** Extra class(es) on the `<div>` that wraps `content_html`. */\n contentClassName?: string;\n /**\n * `\"light\"` / `\"dark\"` — SDK applies inline styles + CSS vars + built-in prose rules.\n * `\"inherit\"` — SDK applies NO inline styles; only CSS classes and\n * `data-*` attributes are rendered so the host site has full control.\n *\n * In all modes the content body div has:\n * - `className=\"dsa-article-body\"`\n * - `data-dsa-article-body`\n *\n * @default \"light\"\n */\n theme?: ArticleTheme;\n /** Disable built-in prose styles injected via `<style>`. Works only in light/dark themes. */\n disableProseStyles?: boolean;\n components?: {\n H1?: React.ComponentType<{ children: React.ReactNode }>;\n Toc?: React.ComponentType<{ headings: Article['headings'] }>;\n Faq?: React.ComponentType<{ items: FaqItem[] }>;\n };\n}\n\n// ---------------------------------------------------------------------------\n// Theme CSS variable presets\n// ---------------------------------------------------------------------------\n\nconst themeVars = {\n light: {\n '--dsa-text': '#111827',\n '--dsa-text-muted': '#6b7280',\n '--dsa-text-faint': '#9ca3af',\n '--dsa-card-bg': '#fff',\n '--dsa-card-border': '#e5e7eb',\n '--dsa-toc-bg': '#f9fafb',\n '--dsa-badge-bg': '#eff6ff',\n '--dsa-badge-text': '#2563eb',\n '--dsa-badge-alt-bg': '#f0fdf4',\n '--dsa-badge-alt-text': '#16a34a',\n '--dsa-content-text': '#374151',\n '--dsa-h2-text': '#111827',\n '--dsa-h3-text': '#1f2937',\n '--dsa-h4-text': '#1f2937',\n '--dsa-link': '#2563eb',\n '--dsa-link-hover': '#1d4ed8',\n '--dsa-blockquote-border': '#d1d5db',\n '--dsa-blockquote-text': '#4b5563',\n '--dsa-pre-bg': '#f3f4f6',\n '--dsa-table-border': '#e5e7eb',\n '--dsa-table-header-bg': '#f9fafb',\n '--dsa-divider': '#e5e7eb',\n },\n dark: {\n '--dsa-text': '#f3f4f6',\n '--dsa-text-muted': '#9ca3af',\n '--dsa-text-faint': '#6b7280',\n '--dsa-card-bg': '#1f2937',\n '--dsa-card-border': '#374151',\n '--dsa-toc-bg': '#111827',\n '--dsa-badge-bg': '#1e3a5f',\n '--dsa-badge-text': '#93c5fd',\n '--dsa-badge-alt-bg': '#14532d',\n '--dsa-badge-alt-text': '#86efac',\n '--dsa-content-text': '#d1d5db',\n '--dsa-h2-text': '#f3f4f6',\n '--dsa-h3-text': '#e5e7eb',\n '--dsa-h4-text': '#e5e7eb',\n '--dsa-link': '#60a5fa',\n '--dsa-link-hover': '#93c5fd',\n '--dsa-blockquote-border': '#4b5563',\n '--dsa-blockquote-text': '#9ca3af',\n '--dsa-pre-bg': '#111827',\n '--dsa-table-border': '#374151',\n '--dsa-table-header-bg': '#111827',\n '--dsa-divider': '#374151',\n },\n} as const;\n\n// ---------------------------------------------------------------------------\n// Built-in prose stylesheet (injected once via <style>)\n// ---------------------------------------------------------------------------\n\nconst PROSE_STYLE_ID = 'dsa-article-prose';\n\nconst proseCSS = /* css */ `\n[data-dsa-article-body] h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.3; color: var(--dsa-h2-text, #111827); margin: 2rem 0 0.75rem; }\n[data-dsa-article-body] h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; color: var(--dsa-h3-text, #1f2937); margin: 1.75rem 0 0.5rem; }\n[data-dsa-article-body] h4 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; color: var(--dsa-h4-text, #1f2937); margin: 1.5rem 0 0.5rem; }\n[data-dsa-article-body] p { margin: 0 0 1.25rem; }\n[data-dsa-article-body] ul,\n[data-dsa-article-body] ol { margin: 0 0 1.25rem; padding-left: 1.5rem; }\n[data-dsa-article-body] li { margin: 0 0 0.375rem; }\n[data-dsa-article-body] li > ul,\n[data-dsa-article-body] li > ol { margin: 0.375rem 0 0; }\n[data-dsa-article-body] blockquote { margin: 1.5rem 0; padding: 0.75rem 1.25rem; border-left: 4px solid var(--dsa-blockquote-border, #d1d5db); color: var(--dsa-blockquote-text, #4b5563); font-style: italic; }\n[data-dsa-article-body] pre { margin: 1.5rem 0; padding: 1rem; background: var(--dsa-pre-bg, #f3f4f6); border-radius: 0.5rem; overflow-x: auto; font-size: 0.875rem; }\n[data-dsa-article-body] code { font-size: 0.875em; }\n[data-dsa-article-body] table { width: 100%; margin: 1.5rem 0; border-collapse: collapse; font-size: 0.9375rem; }\n[data-dsa-article-body] th,\n[data-dsa-article-body] td { padding: 0.5rem 0.75rem; border: 1px solid var(--dsa-table-border, #e5e7eb); text-align: left; }\n[data-dsa-article-body] th { background: var(--dsa-table-header-bg, #f9fafb); font-weight: 600; }\n[data-dsa-article-body] img { max-width: 100%; height: auto; border-radius: 0.5rem; margin: 1.5rem 0; }\n[data-dsa-article-body] a { color: var(--dsa-link, #2563eb); text-decoration: underline; text-underline-offset: 2px; }\n[data-dsa-article-body] a:hover { color: var(--dsa-link-hover, #1d4ed8); }\n[data-dsa-article-body] hr { border: none; border-top: 1px solid var(--dsa-divider, #e5e7eb); margin: 2rem 0; }\n[data-dsa-article-body] > *:first-child { margin-top: 0; }\n[data-dsa-article-body] > *:last-child { margin-bottom: 0; }\n`.trim();\n\nfunction useProseStyles(enabled: boolean) {\n React.useEffect(() => {\n if (!enabled) return;\n if (typeof document === 'undefined') return;\n if (document.getElementById(PROSE_STYLE_ID)) return;\n const el = document.createElement('style');\n el.id = PROSE_STYLE_ID;\n el.textContent = proseCSS;\n document.head.appendChild(el);\n }, [enabled]);\n}\n\n// ---------------------------------------------------------------------------\n// Sub-components\n// ---------------------------------------------------------------------------\n\nfunction DefaultToc({ headings }: { headings: Article['headings'] }) {\n if (!headings || headings.length === 0) return null;\n return (\n <nav className=\"dsa-toc\" data-dsa-toc=\"\" style={{ background: 'var(--dsa-toc-bg, #f9fafb)', border: '1px solid var(--dsa-card-border, #e5e7eb)', borderRadius: '0.75rem', padding: '1.25rem', marginBottom: '2rem' }}>\n <p style={{ fontSize: '0.875rem', fontWeight: 600, color: 'var(--dsa-text-muted, #374151)', margin: '0 0 0.75rem', textTransform: 'uppercase' as const, letterSpacing: '0.05em' }}>\n Table of Contents\n </p>\n <ul style={{ listStyle: 'none', padding: 0, margin: 0 }}>\n {headings.map((h, i) => (\n <li key={i} style={{ padding: '0.25rem 0', paddingLeft: `${(h.level - 2) * 1}rem` }}>\n <a href={`#${h.id}`} style={{ color: 'var(--dsa-text-muted, #4b5563)', textDecoration: 'none', fontSize: '0.875rem' }}>\n {h.text}\n </a>\n </li>\n ))}\n </ul>\n </nav>\n );\n}\n\nfunction InheritToc({ headings }: { headings: Article['headings'] }) {\n if (!headings || headings.length === 0) return null;\n return (\n <nav className=\"dsa-toc\" data-dsa-toc=\"\">\n <p className=\"dsa-toc-title\">Table of Contents</p>\n <ul className=\"dsa-toc-list\">\n {headings.map((h, i) => (\n <li key={i} className=\"dsa-toc-item\" style={{ paddingLeft: `${(h.level - 2) * 1}rem` }}>\n <a href={`#${h.id}`} className=\"dsa-toc-link\">\n {h.text}\n </a>\n </li>\n ))}\n </ul>\n </nav>\n );\n}\n\n// ---------------------------------------------------------------------------\n// Main component\n// ---------------------------------------------------------------------------\n\n/**\n * Full article page with optional TOC, FAQ, related articles, and JSON-LD.\n *\n * **light / dark** — SDK applies inline styles with `--dsa-*` CSS variable\n * overrides, plus built-in prose rules for the article body.\n *\n * **inherit** — SDK renders only semantic HTML with stable CSS classes\n * and `data-*` attributes. No inline styles, no injected `<style>`.\n *\n * ### Stable CSS selectors (always present)\n *\n * | Element | Class | Data attribute |\n * |---------|-------|----------------|\n * | Root | `className` prop | `data-dsa-theme` |\n * | Body | `dsa-article-body` + `contentClassName` | `data-dsa-article-body` |\n * | TOC | `dsa-toc` | `data-dsa-toc` |\n * | Meta | `dsa-meta` | `data-dsa-meta` |\n *\n * ```tsx\n * // Works out of the box\n * <ArticlePage article={article} />\n *\n * // Inherit — host site provides all styles\n * <ArticlePage article={article} theme=\"inherit\" contentClassName=\"prose dark:prose-invert\" />\n * ```\n */\nexport function ArticlePage({\n article,\n showFaq = true,\n showTableOfContents = true,\n showMeta = true,\n showRelated = false,\n relatedArticles,\n onRelatedClick,\n className,\n contentClassName,\n theme = 'light',\n disableProseStyles = false,\n components,\n}: ArticlePageProps) {\n const inherit = theme === 'inherit';\n useProseStyles(!inherit && !disableProseStyles);\n\n const H1 = components?.H1 || (inherit\n ? ({ children }: { children: React.ReactNode }) => <h1 className=\"dsa-h1\">{children}</h1>\n : ({ children }: { children: React.ReactNode }) => (\n <h1 className=\"dsa-h1\" style={{ fontSize: '2.25rem', fontWeight: 700, lineHeight: 1.2, color: 'var(--dsa-text)', margin: '0 0 1rem' }}>{children}</h1>\n ));\n const Toc = components?.Toc || (inherit ? InheritToc : DefaultToc);\n const FaqComponent = components?.Faq || FaqBlock;\n const vars = !inherit ? themeVars[theme] : {};\n const bodyClasses = ['dsa-article-body', contentClassName].filter(Boolean).join(' ');\n\n return (\n <article\n className={className}\n data-dsa-theme={theme}\n style={inherit ? undefined : { maxWidth: '48rem', margin: '0 auto', fontFamily: 'system-ui, -apple-system, sans-serif', ...vars } as React.CSSProperties}\n >\n {showMeta && (\n <div className=\"dsa-meta\" data-dsa-meta=\"\" style={inherit ? undefined : { display: 'flex', gap: '1rem', flexWrap: 'wrap' as const, fontSize: '0.875rem', color: 'var(--dsa-text-muted)', marginBottom: '1.5rem' }}>\n {article.pillar_name && (\n <span className=\"dsa-badge\" style={inherit ? undefined : { display: 'inline-block', padding: '0.125rem 0.5rem', borderRadius: '9999px', background: 'var(--dsa-badge-bg)', color: 'var(--dsa-badge-text)', fontSize: '0.75rem' }}>\n {article.pillar_name}\n </span>\n )}\n {article.content_type && (\n <span className=\"dsa-badge dsa-badge--alt\" style={inherit ? undefined : { display: 'inline-block', padding: '0.125rem 0.5rem', borderRadius: '9999px', background: 'var(--dsa-badge-alt-bg, var(--dsa-badge-bg))', color: 'var(--dsa-badge-alt-text, var(--dsa-badge-text))', fontSize: '0.75rem' }}>\n {article.content_type.replace(/_/g, ' ')}\n </span>\n )}\n {article.reading_time_minutes && <span className=\"dsa-reading-time\">{article.reading_time_minutes} min read</span>}\n {article.published_at && <span className=\"dsa-published-at\">{new Date(article.published_at).toLocaleDateString()}</span>}\n </div>\n )}\n\n <H1>{article.h1 || article.title}</H1>\n\n {/* Author byline (E-E-A-T) */}\n {article.author?.name && (\n <div className=\"dsa-author\" data-dsa-author=\"\" style={inherit ? undefined : { display: 'flex', alignItems: 'center', gap: '0.75rem', marginBottom: '1.5rem' }}>\n {article.author.image_url && (\n <img\n className=\"dsa-author-avatar\"\n src={article.author.image_url}\n alt={article.author.name}\n style={inherit ? undefined : { width: '2.5rem', height: '2.5rem', borderRadius: '9999px', objectFit: 'cover' as const }}\n />\n )}\n <div>\n <div style={inherit ? undefined : { fontSize: '0.875rem', fontWeight: 600, color: 'var(--dsa-text)' }}>\n {article.author.url ? (\n <a href={article.author.url} className=\"dsa-author-link\" rel=\"author\" style={inherit ? undefined : { color: 'inherit', textDecoration: 'none' }}>\n {article.author.name}\n </a>\n ) : article.author.name}\n {article.author.job_title && (\n <span className=\"dsa-author-title\" style={inherit ? undefined : { fontWeight: 400, color: 'var(--dsa-text-muted)', marginLeft: '0.25rem' }}>\n {' '}· {article.author.job_title}\n </span>\n )}\n </div>\n {article.author.bio && (\n <p className=\"dsa-author-bio\" style={inherit ? undefined : { fontSize: '0.75rem', color: 'var(--dsa-text-muted)', margin: '0.125rem 0 0' }}>\n {article.author.bio}\n </p>\n )}\n </div>\n </div>\n )}\n\n {article.featured_image_url && (\n <img\n className=\"dsa-featured-image\"\n src={article.featured_image_url}\n alt={article.featured_image_alt || article.title}\n style={inherit ? undefined : { width: '100%', borderRadius: '0.75rem', marginBottom: '2rem' }}\n />\n )}\n\n {showTableOfContents && (article.headings ?? []).length > 0 && (\n <Toc headings={article.headings} />\n )}\n\n {/* Article body */}\n <div\n className={bodyClasses}\n data-dsa-article-body=\"\"\n style={inherit ? undefined : { lineHeight: 1.75, color: 'var(--dsa-content-text)', fontSize: '1.0625rem' }}\n dangerouslySetInnerHTML={{ __html: article.content_html }}\n />\n\n {showFaq && (article.faq ?? []).length > 0 && (\n <>\n <hr className=\"dsa-divider\" style={inherit ? undefined : { border: 'none', borderTop: '1px solid var(--dsa-divider)', margin: '2.5rem 0' }} />\n <FaqComponent items={article.faq} />\n </>\n )}\n\n {article.schema_json && (\n <script\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{ __html: JSON.stringify(article.schema_json) }}\n />\n )}\n\n {showRelated && relatedArticles && relatedArticles.length > 0 && (\n <>\n <hr className=\"dsa-divider\" style={inherit ? undefined : { border: 'none', borderTop: '1px solid var(--dsa-divider)', margin: '2.5rem 0' }} />\n <RelatedArticles articles={relatedArticles} onArticleClick={onRelatedClick} theme={theme} />\n </>\n )}\n </article>\n );\n}\n","'use client';\n\nimport React, { useState } from 'react';\nimport type { FaqItem } from '../types';\n\nexport interface FaqBlockProps {\n items: FaqItem[];\n collapsible?: boolean;\n defaultOpen?: boolean;\n className?: string;\n title?: string;\n /** \"light\" | \"dark\" | \"inherit\" */\n theme?: 'light' | 'dark' | 'inherit';\n}\n\nconst themeVars = {\n light: {\n '--dsa-text': '#111827',\n '--dsa-text-muted': '#4b5563',\n '--dsa-text-faint': '#9ca3af',\n '--dsa-divider': '#e5e7eb',\n },\n dark: {\n '--dsa-text': '#f3f4f6',\n '--dsa-text-muted': '#d1d5db',\n '--dsa-text-faint': '#6b7280',\n '--dsa-divider': '#374151',\n },\n} as const;\n\nfunction FaqItemComponent({\n item,\n collapsible,\n defaultOpen,\n}: {\n item: FaqItem;\n collapsible: boolean;\n defaultOpen: boolean;\n}) {\n const [open, setOpen] = useState(defaultOpen);\n\n if (!collapsible) {\n return (\n <div style={{ borderBottom: '1px solid var(--dsa-divider)', padding: '0.75rem 0' }}>\n <p style={{ fontSize: '1rem', fontWeight: 600, color: 'var(--dsa-text)', margin: '0 0 0.5rem' }}>{item.question}</p>\n <div style={{ fontSize: '0.9375rem', color: 'var(--dsa-text-muted)', lineHeight: 1.6 }}>{item.answer}</div>\n </div>\n );\n }\n\n return (\n <div style={{ borderBottom: '1px solid var(--dsa-divider)', padding: '0.75rem 0' }}>\n <button\n style={{\n display: 'flex', justifyContent: 'space-between', alignItems: 'center',\n cursor: 'pointer', background: 'none', border: 'none', width: '100%',\n textAlign: 'left' as const, padding: '0.5rem 0', fontSize: '1rem',\n fontWeight: 600, color: 'var(--dsa-text)', fontFamily: 'inherit',\n }}\n onClick={() => setOpen(!open)}\n aria-expanded={open}\n >\n <span>{item.question}</span>\n <span style={{ flexShrink: 0, marginLeft: '1rem', transition: 'transform 0.2s', fontSize: '1.25rem', color: 'var(--dsa-text-faint)', transform: open ? 'rotate(180deg)' : 'rotate(0deg)' }}>\n ▼\n </span>\n </button>\n {open && <div style={{ fontSize: '0.9375rem', color: 'var(--dsa-text-muted)', lineHeight: 1.6, paddingTop: '0.5rem' }}>{item.answer}</div>}\n </div>\n );\n}\n\n/**\n * FAQ block with Schema.org FAQPage markup.\n * Supports theme=\"light\" | \"dark\" | \"inherit\" via CSS variables.\n */\nexport function FaqBlock({\n items,\n collapsible = true,\n defaultOpen = false,\n className,\n title = 'Frequently Asked Questions',\n theme = 'light',\n}: FaqBlockProps) {\n if (!items || items.length === 0) return null;\n const vars = theme !== 'inherit' ? themeVars[theme] : {};\n\n const schemaData = {\n '@context': 'https://schema.org',\n '@type': 'FAQPage',\n mainEntity: items.map((item) => ({\n '@type': 'Question',\n name: item.question,\n acceptedAnswer: { '@type': 'Answer', text: item.answer },\n })),\n };\n\n return (\n <section className={className} style={{ marginTop: '1rem', ...vars } as React.CSSProperties}>\n <h2 style={{ fontSize: '1.5rem', fontWeight: 700, color: 'var(--dsa-text)', margin: '0 0 1rem' }}>{title}</h2>\n {items.map((item, i) => (\n <FaqItemComponent key={i} item={item} collapsible={collapsible} defaultOpen={defaultOpen} />\n ))}\n <script\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaData) }}\n />\n </section>\n );\n}\n","'use client';\n\nimport React from 'react';\nimport type { ArticleListItem } from '../types';\n\nexport interface RelatedArticlesProps {\n articles: ArticleListItem[];\n title?: string;\n limit?: number;\n onArticleClick?: (slug: string) => void;\n className?: string;\n /** \"light\" | \"dark\" | \"inherit\" */\n theme?: 'light' | 'dark' | 'inherit';\n}\n\nconst themeVars = {\n light: {\n '--dsa-text': '#111827',\n '--dsa-text-muted': '#6b7280',\n '--dsa-card-bg': '#fff',\n '--dsa-card-border': '#e5e7eb',\n },\n dark: {\n '--dsa-text': '#f3f4f6',\n '--dsa-text-muted': '#9ca3af',\n '--dsa-card-bg': '#1f2937',\n '--dsa-card-border': '#374151',\n },\n} as const;\n\n/**\n * Related articles widget.\n * Supports theme=\"light\" | \"dark\" | \"inherit\" via CSS variables.\n */\nexport function RelatedArticles({\n articles,\n title = 'Related Articles',\n limit = 3,\n onArticleClick,\n className,\n theme = 'light',\n}: RelatedArticlesProps) {\n const displayed = (articles ?? []).slice(0, limit);\n if (displayed.length === 0) return null;\n const vars = theme !== 'inherit' ? themeVars[theme] : {};\n\n return (\n <section className={className} style={{ marginTop: '1rem', ...vars } as React.CSSProperties}>\n <h3 style={{ fontSize: '1.25rem', fontWeight: 700, color: 'var(--dsa-text)', margin: '0 0 1rem' }}>{title}</h3>\n <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(250px, 1fr))', gap: '1rem' }}>\n {displayed.map((a) => (\n <div\n key={a.id}\n style={{ border: '1px solid var(--dsa-card-border)', borderRadius: '0.5rem', overflow: 'hidden', cursor: 'pointer', transition: 'box-shadow 0.2s', background: 'var(--dsa-card-bg)' }}\n onClick={() => onArticleClick?.(a.slug)}\n role=\"link\"\n tabIndex={0}\n onKeyDown={(e) => e.key === 'Enter' && onArticleClick?.(a.slug)}\n >\n {a.featured_image_url && (\n <img\n src={a.featured_image_url}\n alt={a.featured_image_alt || a.title}\n style={{ width: '100%', height: '140px', objectFit: 'cover' as const, display: 'block' }}\n loading=\"lazy\"\n />\n )}\n <div style={{ padding: '1rem' }}>\n <h4 style={{ fontSize: '0.9375rem', fontWeight: 600, color: 'var(--dsa-text)', margin: 0, lineHeight: 1.3 }}>{a.title}</h4>\n {a.excerpt && <p style={{ fontSize: '0.8125rem', color: 'var(--dsa-text-muted)', marginTop: '0.5rem', lineHeight: 1.4 }}>{a.excerpt}</p>}\n </div>\n </div>\n ))}\n </div>\n </section>\n );\n}\n","import type { Article } from '../types';\n\n/**\n * Generate Next.js App Router Metadata object from an Article.\n * Use in page.tsx generateMetadata():\n *\n * ```ts\n * import { generateArticleMetadata } from \"@dsaplatform/content-sdk/server\";\n *\n * export async function generateMetadata({ params }) {\n * const article = await fetchArticleBySlug(config, params.slug);\n * return generateArticleMetadata(article, \"https://example.com\");\n * }\n * ```\n */\nexport function generateArticleMetadata(\n article: Article,\n siteUrl?: string,\n): Record<string, any> {\n const url = siteUrl\n ? `${siteUrl.replace(/\\/+$/, '')}/blog/${article.slug}`\n : undefined;\n\n const meta: Record<string, any> = {\n title: article.meta_title || article.title,\n description: article.meta_description || article.excerpt || '',\n openGraph: {\n title: article.meta_title || article.title,\n description: article.meta_description || article.excerpt || '',\n type: 'article',\n publishedTime: article.published_at || undefined,\n modifiedTime: article.updated_at || undefined,\n ...(url ? { url } : {}),\n ...(article.featured_image_url\n ? {\n images: [\n {\n url: article.featured_image_url,\n alt: article.featured_image_alt || article.title,\n },\n ],\n }\n : {}),\n },\n twitter: {\n card: 'summary_large_image',\n title: article.meta_title || article.title,\n description: article.meta_description || article.excerpt || '',\n ...(article.featured_image_url ? { images: [article.featured_image_url] } : {}),\n },\n ...(article.canonical_url\n ? { alternates: { canonical: article.canonical_url } }\n : url\n ? { alternates: { canonical: url } }\n : {}),\n };\n\n // Author metadata\n if (article.author?.name) {\n meta.authors = [{ name: article.author.name, url: article.author.url || undefined }];\n }\n\n return meta;\n}\n\n// ---------------------------------------------------------------------------\n// Schema.org builders\n// ---------------------------------------------------------------------------\n\nfunction buildArticleSchema(article: Article, siteUrl?: string): Record<string, any> {\n // If the Content Engine already generated schema_json with author/publisher/speakable,\n // use it directly — it's the most complete version.\n if (article.schema_json && article.schema_json['@context']) {\n return article.schema_json;\n }\n\n const url = siteUrl\n ? `${siteUrl.replace(/\\/+$/, '')}/blog/${article.slug}`\n : undefined;\n\n const schema: Record<string, any> = {\n '@context': 'https://schema.org',\n '@type': 'Article',\n headline: article.meta_title || article.title,\n description: article.meta_description || article.excerpt || '',\n datePublished: article.published_at || undefined,\n dateModified: article.updated_at || article.published_at || undefined,\n ...(article.featured_image_url ? { image: article.featured_image_url } : {}),\n ...(url ? { url } : {}),\n ...(article.target_keyword\n ? { keywords: [article.target_keyword, ...(article.secondary_keywords || [])].join(', ') }\n : {}),\n };\n\n // Author (Person) — E-E-A-T\n if (article.author?.name) {\n const author: Record<string, any> = {\n '@type': 'Person',\n name: article.author.name,\n };\n if (article.author.url) author.url = article.author.url;\n if (article.author.image_url) author.image = article.author.image_url;\n if (article.author.job_title) author.jobTitle = article.author.job_title;\n const sameAs: string[] = [];\n if (article.author.url) sameAs.push(article.author.url);\n if (article.author.socials) {\n for (const v of Object.values(article.author.socials)) {\n if (v && v.startsWith('http')) sameAs.push(v);\n }\n }\n if (sameAs.length) author.sameAs = sameAs;\n schema.author = author;\n }\n\n // Publisher (Organization) — E-E-A-T\n if (article.publisher?.name) {\n const pub: Record<string, any> = {\n '@type': 'Organization',\n name: article.publisher.name,\n };\n if (article.publisher.url) pub.url = article.publisher.url;\n if (article.publisher.logo_url) {\n pub.logo = { '@type': 'ImageObject', url: article.publisher.logo_url };\n }\n schema.publisher = pub;\n }\n\n // Speakable\n schema.speakable = {\n '@type': 'SpeakableSpecification',\n cssSelector: ['[data-speakable]', '.dsa-article-body > p:first-of-type'],\n };\n\n // FAQ\n if (article.faq?.length) {\n schema.mainEntity = article.faq.map((item) => ({\n '@type': 'Question',\n name: item.question,\n acceptedAnswer: {\n '@type': 'Answer',\n text: item.answer,\n },\n }));\n }\n\n return schema;\n}\n\nfunction buildBreadcrumbSchema(article: Article, siteUrl?: string): Record<string, any> | null {\n if (!siteUrl) return null;\n const base = siteUrl.replace(/\\/+$/, '');\n\n const items: { name: string; url: string }[] = [\n { name: 'Home', url: base },\n { name: 'Blog', url: `${base}/blog` },\n ];\n\n if (article.pillar_name) {\n items.push({ name: article.pillar_name, url: `${base}/blog?pillar=${encodeURIComponent(article.pillar_name)}` });\n }\n\n items.push({\n name: article.h1 || article.title,\n url: `${base}/blog/${article.slug}`,\n });\n\n return {\n '@context': 'https://schema.org',\n '@type': 'BreadcrumbList',\n itemListElement: items.map((item, i) => ({\n '@type': 'ListItem',\n position: i + 1,\n name: item.name,\n item: item.url,\n })),\n };\n}\n\n// ---------------------------------------------------------------------------\n// Component\n// ---------------------------------------------------------------------------\n\n/**\n * Renders JSON-LD structured data for an article.\n * Outputs Article schema (with Author, Publisher, Speakable, FAQ)\n * and BreadcrumbList schema when siteUrl is provided.\n *\n * ```tsx\n * <SeoMetaBridge article={article} siteUrl=\"https://example.com\" />\n * ```\n */\nexport function SeoMetaBridge({\n article,\n siteUrl,\n}: {\n article: Article;\n siteUrl?: string;\n}) {\n const articleSchema = buildArticleSchema(article, siteUrl);\n const breadcrumbSchema = buildBreadcrumbSchema(article, siteUrl);\n\n return (\n <>\n <script\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{ __html: JSON.stringify(articleSchema) }}\n />\n {breadcrumbSchema && (\n <script\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumbSchema) }}\n />\n )}\n </>\n );\n}\n","'use client';\n\nimport React, { useState, type FormEvent } from 'react';\nimport { useDsaLeadForm } from '../lead-form-hook';\nimport type {\n DsaLeadFormConfig,\n LeadFormField,\n LeadFormFieldName,\n LeadFormPayload,\n LeadMagnetConfig,\n} from '../types';\n\nexport type { LeadFormField, LeadFormFieldName, LeadMagnetConfig };\n\n/** Theme for the lead form */\nexport type LeadFormTheme = 'light' | 'dark' | 'inherit';\n\nexport interface DsaLeadFormProps extends DsaLeadFormConfig {\n /** Form fields to display. Shorthand: pass an array of field names. */\n fields?: (LeadFormFieldName | LeadFormField)[];\n /** Lead magnet to promote above the form / show after submission */\n leadMagnet?: LeadMagnetConfig;\n /** CTA button text */\n ctaText?: string;\n /** Thank-you message shown after successful submission */\n thankYouMessage?: string;\n /** Theme: \"light\" | \"dark\" | \"inherit\" (no styles) */\n theme?: LeadFormTheme;\n /** Additional CSS class on the wrapper */\n className?: string;\n /** Called after successful submission */\n onSuccess?: (data: LeadFormPayload) => void;\n /** Called on submission error */\n onError?: (error: Error) => void;\n /** Override source_url (defaults to window.location.href) */\n sourceUrl?: string;\n /** Render prop for full custom rendering */\n children?: (state: {\n submitting: boolean;\n submitted: boolean;\n error: Error | null;\n submit: (data: LeadFormPayload) => void;\n reset: () => void;\n }) => React.ReactNode;\n}\n\ntype FieldType = NonNullable<LeadFormField['type']>;\n\nconst FIELD_DEFAULTS: Record<LeadFormFieldName, { label: string; placeholder: string; type: FieldType; required: boolean }> = {\n name: { label: 'Name', placeholder: 'Your name', type: 'text', required: false },\n email: { label: 'Email', placeholder: 'you@company.com', type: 'email', required: true },\n phone: { label: 'Phone', placeholder: '+1 (555) 000-0000', type: 'tel', required: false },\n company: { label: 'Company', placeholder: 'Company name', type: 'text', required: false },\n website: { label: 'Website', placeholder: 'https://...', type: 'url', required: false },\n message: { label: 'Message', placeholder: 'How can we help?', type: 'textarea', required: false },\n city: { label: 'City', placeholder: 'City', type: 'text', required: false },\n country: { label: 'Country', placeholder: 'Country', type: 'text', required: false },\n};\n\nfunction normalizeField(f: LeadFormFieldName | LeadFormField): LeadFormField & { name: LeadFormFieldName } {\n if (typeof f === 'string') {\n const def = FIELD_DEFAULTS[f];\n return { name: f, ...def };\n }\n const def = FIELD_DEFAULTS[f.name];\n return { ...def, ...f };\n}\n\n/**\n * Ready-to-use lead capture form with built-in DSA webhook integration.\n *\n * ```tsx\n * <DsaLeadForm\n * webhookUrl=\"https://api.example.com\"\n * projectSlug=\"my-project\"\n * webhookToken=\"abc123\"\n * fields={['name', 'email', 'company']}\n * ctaText=\"Get Free Audit\"\n * leadMagnet={{ title: \"SEO Audit Checklist\", description: \"47-point checklist\" }}\n * theme=\"dark\"\n * />\n * ```\n */\nexport function DsaLeadForm({\n webhookUrl,\n projectSlug,\n webhookToken,\n fields = ['name', 'email'],\n leadMagnet,\n ctaText = 'Submit',\n thankYouMessage,\n theme = 'light',\n className,\n onSuccess,\n onError,\n sourceUrl,\n children,\n}: DsaLeadFormProps) {\n const form = useDsaLeadForm({ webhookUrl, projectSlug, webhookToken });\n const [values, setValues] = useState<Record<string, string>>({});\n\n const normalizedFields = fields.map(normalizeField);\n\n // Render prop mode\n if (children) {\n return <>{children({ ...form })}</>;\n }\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n const payload: LeadFormPayload = {\n email: values.email || '',\n name: values.name,\n phone: values.phone,\n company: values.company,\n website: values.website,\n message: values.message,\n city: values.city,\n country: values.country,\n source_url: sourceUrl,\n };\n const result = await form.submit(payload);\n if (result.ok) {\n onSuccess?.(payload);\n } else if (result.error) {\n onError?.(new Error(result.error));\n }\n };\n\n const isInherit = theme === 'inherit';\n const isDark = theme === 'dark';\n\n const styles = isInherit ? {} : {\n wrapper: {\n fontFamily: '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif',\n backgroundColor: isDark ? '#1e293b' : '#ffffff',\n border: `1px solid ${isDark ? '#334155' : '#e2e8f0'}`,\n borderRadius: '12px',\n padding: '24px',\n maxWidth: '480px',\n color: isDark ? '#f1f5f9' : '#0f172a',\n } as React.CSSProperties,\n heading: {\n margin: '0 0 4px 0',\n fontSize: '18px',\n fontWeight: 700,\n color: isDark ? '#f1f5f9' : '#0f172a',\n } as React.CSSProperties,\n description: {\n margin: '0 0 16px 0',\n fontSize: '14px',\n color: isDark ? '#94a3b8' : '#64748b',\n } as React.CSSProperties,\n label: {\n display: 'block',\n fontSize: '13px',\n fontWeight: 500,\n marginBottom: '4px',\n color: isDark ? '#cbd5e1' : '#374151',\n } as React.CSSProperties,\n input: {\n display: 'block',\n width: '100%',\n padding: '8px 12px',\n fontSize: '14px',\n border: `1px solid ${isDark ? '#475569' : '#d1d5db'}`,\n borderRadius: '8px',\n backgroundColor: isDark ? '#0f172a' : '#ffffff',\n color: isDark ? '#f1f5f9' : '#0f172a',\n outline: 'none',\n boxSizing: 'border-box' as const,\n } as React.CSSProperties,\n textarea: {\n display: 'block',\n width: '100%',\n padding: '8px 12px',\n fontSize: '14px',\n border: `1px solid ${isDark ? '#475569' : '#d1d5db'}`,\n borderRadius: '8px',\n backgroundColor: isDark ? '#0f172a' : '#ffffff',\n color: isDark ? '#f1f5f9' : '#0f172a',\n outline: 'none',\n minHeight: '80px',\n resize: 'vertical' as const,\n fontFamily: 'inherit',\n boxSizing: 'border-box' as const,\n } as React.CSSProperties,\n button: {\n width: '100%',\n padding: '10px 20px',\n fontSize: '14px',\n fontWeight: 600,\n color: '#ffffff',\n backgroundColor: '#2563eb',\n border: 'none',\n borderRadius: '8px',\n cursor: 'pointer',\n marginTop: '4px',\n opacity: form.submitting ? 0.7 : 1,\n } as React.CSSProperties,\n fieldGroup: {\n marginBottom: '12px',\n } as React.CSSProperties,\n error: {\n fontSize: '13px',\n color: '#ef4444',\n marginTop: '8px',\n } as React.CSSProperties,\n success: {\n textAlign: 'center' as const,\n padding: '16px 0',\n } as React.CSSProperties,\n successTitle: {\n fontSize: '18px',\n fontWeight: 700,\n color: isDark ? '#34d399' : '#059669',\n marginBottom: '8px',\n } as React.CSSProperties,\n successText: {\n fontSize: '14px',\n color: isDark ? '#94a3b8' : '#64748b',\n marginBottom: '16px',\n } as React.CSSProperties,\n downloadLink: {\n display: 'inline-block',\n padding: '10px 24px',\n fontSize: '14px',\n fontWeight: 600,\n color: '#ffffff',\n backgroundColor: '#2563eb',\n borderRadius: '8px',\n textDecoration: 'none',\n } as React.CSSProperties,\n };\n\n // ── Success state ──\n if (form.submitted) {\n return (\n <div\n className={`dsa-lead-form dsa-lead-form--success ${className || ''}`}\n data-dsa-lead-form\n data-theme={theme}\n style={isInherit ? undefined : styles.wrapper}\n >\n <div style={isInherit ? undefined : styles.success}>\n <div style={isInherit ? undefined : styles.successTitle}>\n {thankYouMessage || 'Thank you!'}\n </div>\n {leadMagnet?.downloadUrl && (\n <>\n <p style={isInherit ? undefined : styles.successText}>\n Your download is ready:\n </p>\n <a\n href={leadMagnet.downloadUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"dsa-lead-form__download\"\n style={isInherit ? undefined : styles.downloadLink}\n >\n Download {leadMagnet.title}\n </a>\n </>\n )}\n </div>\n </div>\n );\n }\n\n // ── Form state ──\n return (\n <div\n className={`dsa-lead-form ${className || ''}`}\n data-dsa-lead-form\n data-theme={theme}\n style={isInherit ? undefined : styles.wrapper}\n >\n {/* Lead magnet promo header */}\n {leadMagnet && (\n <div className=\"dsa-lead-form__magnet\" style={{ marginBottom: '16px' }}>\n {leadMagnet.imageUrl && (\n <img\n src={leadMagnet.imageUrl}\n alt={leadMagnet.title}\n style={isInherit ? undefined : {\n width: '100%',\n borderRadius: '8px',\n marginBottom: '12px',\n display: 'block',\n }}\n className=\"dsa-lead-form__magnet-image\"\n />\n )}\n <h3 className=\"dsa-lead-form__magnet-title\" style={isInherit ? undefined : styles.heading}>\n {leadMagnet.title}\n </h3>\n {leadMagnet.description && (\n <p className=\"dsa-lead-form__magnet-description\" style={isInherit ? undefined : styles.description}>\n {leadMagnet.description}\n </p>\n )}\n </div>\n )}\n\n <form onSubmit={handleSubmit} className=\"dsa-lead-form__form\" noValidate>\n {normalizedFields.map((field) => (\n <div key={field.name} className=\"dsa-lead-form__field\" style={isInherit ? undefined : styles.fieldGroup}>\n <label className=\"dsa-lead-form__label\" style={isInherit ? undefined : styles.label}>\n {field.label}{field.required && ' *'}\n </label>\n {field.type === 'textarea' ? (\n <textarea\n name={field.name}\n placeholder={field.placeholder}\n required={field.required}\n value={values[field.name] || ''}\n onChange={(e) => setValues((v) => ({ ...v, [field.name]: e.target.value }))}\n className=\"dsa-lead-form__textarea\"\n style={isInherit ? undefined : styles.textarea}\n />\n ) : (\n <input\n type={field.type || 'text'}\n name={field.name}\n placeholder={field.placeholder}\n required={field.required}\n value={values[field.name] || ''}\n onChange={(e) => setValues((v) => ({ ...v, [field.name]: e.target.value }))}\n className=\"dsa-lead-form__input\"\n style={isInherit ? undefined : styles.input}\n />\n )}\n </div>\n ))}\n\n <button\n type=\"submit\"\n disabled={form.submitting}\n className=\"dsa-lead-form__submit\"\n style={isInherit ? undefined : styles.button}\n >\n {form.submitting ? 'Sending...' : ctaText}\n </button>\n\n {form.error && (\n <p className=\"dsa-lead-form__error\" style={isInherit ? undefined : styles.error}>\n {form.error.message}\n </p>\n )}\n </form>\n </div>\n );\n}\n"],"mappings":";AAcO,IAAMA,EAAN,KAAoB,CAMzB,YAAYC,EAA0B,CACpC,KAAK,OAASA,EAAO,OAAO,QAAQ,OAAQ,EAAE,EAC9C,KAAK,OAASA,EAAO,OACrB,KAAK,cACHA,EAAO,gBAAkB,aACrB,UACAA,EAAO,gBAAkB,cACvB,cACA,WACR,KAAK,kBAAoBA,EAAO,iBAClC,CAEA,MAAc,QAAWC,EAAcC,EAAkE,CACvG,IAAMC,EAAM,IAAI,IAAI,GAAG,KAAK,MAAM,GAAGF,CAAI,EAAE,EACvCC,GACF,OAAO,QAAQA,CAAM,EAAE,QAAQ,CAAC,CAACE,EAAGC,CAAC,IAAM,CAClBA,GAAM,MAAQA,IAAM,IACzCF,EAAI,aAAa,IAAIC,EAAG,OAAOC,CAAC,CAAC,CAErC,CAAC,EAEHF,EAAI,aAAa,IAAI,WAAY,KAAK,MAAM,EAE5C,IAAMG,EAAiE,CACrE,OAAQ,MACR,QAAS,CAAE,YAAa,KAAK,MAAO,EACpC,MAAO,KAAK,aACd,EAGI,KAAK,mBAAqB,KAAK,gBAAkB,aACnDA,EAAa,KAAO,CAAE,WAAY,KAAK,iBAAkB,GAG3D,IAAMC,EAAM,MAAM,MAAMJ,EAAI,SAAS,EAAGG,CAAY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AC,EAAM,MAAOA,EAAM,UAAY,MAClC,EACCA,EAAM,OAAS,WACdjC,EAAC,YACC,KAAMiC,EAAM,KACZ,YAAaA,EAAM,YACnB,SAAUA,EAAM,SAChB,MAAOX,EAAOW,EAAM,IAAI,GAAK,GAC7B,SAAWN,GAAMJ,EAAWW,IAAO,CAAE,GAAGA,EAAG,CAACD,EAAM,IAAI,EAAGN,EAAE,OAAO,KAAM,EAAE,EAC1E,UAAU,0BACV,MAAOG,EAAY,OAAYE,EAAO,SACxC,EAEAhC,EAAC,SACC,KAAMiC,EAAM,MAAQ,OACpB,KAAMA,EAAM,KACZ,YAAaA,EAAM,YACnB,SAAUA,EAAM,SAChB,MAAOX,EAAOW,EAAM,IAAI,GAAK,GAC7B,SAAWN,GAAMJ,EAAWW,IAAO,CAAE,GAAGA,EAAG,CAACD,EAAM,IAAI,EAAGN,EAAE,OAAO,KAAM,EAAE,EAC1E,UAAU,uBACV,MAAOG,EAAY,OAAYE,EAAO,MACxC,IAxBMC,EAAM,IA0BhB,CACD,EAEDjC,EAAC,UACC,KAAK,SACL,SAAUoB,EAAK,WACf,UAAU,wBACV,MAAOU,EAAY,OAAYE,EAAO,OAErC,SAAAZ,EAAK,WAAa,aAAeR,EACpC,EAECQ,EAAK,OACJpB,EAAC,KAAE,UAAU,uBAAuB,MAAO8B,EAAY,OAAYE,EAAO,MACvE,SAAAZ,EAAK,MAAM,QACd,GAEJ,GACF,CAEJ","names":["ContentClient","config","path","params","url","k","v","fetchOptions","res","text","article","filters","raw","slug","limit","createContext","useContext","useMemo","jsx","ContentContext","createContext","DsaContentProvider","config","children","client","useMemo","ContentClient","useDsaContent","useContext","useState","useEffect","useCallback","useArticles","filters","client","useDsaContent","state","setState","useState","fetch","useCallback","res","err","s","useEffect","useArticle","slug","article","useRelatedArticles","limit","articles","useCategories","categories","useState","useCallback","useDsaLeadForm","config","submitting","setSubmitting","submitted","setSubmitted","error","setError","submit","data","url","body","res","json","msg","err","e","reset","React","jsx","jsxs","themeVars","DefaultCard","article","layout","showExcerpt","showImage","showMeta","onClick","isGrid","hovered","setHovered","cardStyle","e","ArticleFeed","articles","columns","onArticleClick","className","theme","renderArticle","gridTemplateColumns","vars","React","useState","jsx","jsxs","themeVars","FaqItemComponent","item","collapsible","defaultOpen","open","setOpen","FaqBlock","items","className","title","theme","vars","schemaData","i","jsx","jsxs","themeVars","RelatedArticles","articles","title","limit","onArticleClick","className","theme","displayed","vars","a","e","Fragment","jsx","jsxs","themeVars","PROSE_STYLE_ID","proseCSS","useProseStyles","enabled","React","el","DefaultToc","headings","h","i","InheritToc","ArticlePage","article","showFaq","showTableOfContents","showMeta","showRelated","relatedArticles","onRelatedClick","className","contentClassName","theme","disableProseStyles","components","inherit","H1","children","Toc","FaqComponent","FaqBlock","vars","bodyClasses","RelatedArticles","Fragment","jsx","jsxs","generateArticleMetadata","article","siteUrl","url","meta","buildArticleSchema","schema","author","sameAs","v","pub","item","buildBreadcrumbSchema","base","items","i","SeoMetaBridge","articleSchema","breadcrumbSchema","useState","Fragment","jsx","jsxs","FIELD_DEFAULTS","normalizeField","f","def","DsaLeadForm","webhookUrl","projectSlug","webhookToken","fields","leadMagnet","ctaText","thankYouMessage","theme","className","onSuccess","onError","sourceUrl","children","form","useDsaLeadForm","values","setValues","useState","normalizedFields","handleSubmit","e","payload","result","isInherit","isDark","styles","field","v"]}
|