@flamingo-stack/openframe-frontend-core 0.0.257 → 0.0.259

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.
Files changed (37) hide show
  1. package/dist/{chunk-ZJP2BB3E.cjs → chunk-3UAV25YB.cjs} +39 -15
  2. package/dist/chunk-3UAV25YB.cjs.map +1 -0
  3. package/dist/{chunk-IJHORDN5.js → chunk-ACJPRIZC.js} +1 -1
  4. package/dist/{chunk-IJHORDN5.js.map → chunk-ACJPRIZC.js.map} +1 -1
  5. package/dist/{chunk-4MXBBBHB.cjs → chunk-KQQDN2WK.cjs} +1 -1
  6. package/dist/{chunk-4MXBBBHB.cjs.map → chunk-KQQDN2WK.cjs.map} +1 -1
  7. package/dist/{chunk-J3QMPOS6.js → chunk-OVXKTNEP.js} +39 -15
  8. package/dist/chunk-OVXKTNEP.js.map +1 -0
  9. package/dist/components/authors/author-detail-view.d.ts +34 -0
  10. package/dist/components/authors/author-detail-view.d.ts.map +1 -0
  11. package/dist/components/faq/faq-section.d.ts +20 -4
  12. package/dist/components/faq/faq-section.d.ts.map +1 -1
  13. package/dist/components/faq/index.cjs +2 -2
  14. package/dist/components/faq/index.js +1 -1
  15. package/dist/components/faq-accordion.d.ts +4 -0
  16. package/dist/components/faq-accordion.d.ts.map +1 -1
  17. package/dist/components/index.cjs +59 -5
  18. package/dist/components/index.cjs.map +1 -1
  19. package/dist/components/index.d.ts +1 -0
  20. package/dist/components/index.d.ts.map +1 -1
  21. package/dist/components/index.js +56 -2
  22. package/dist/components/index.js.map +1 -1
  23. package/dist/components/onboarding-guides/index.cjs +5 -5
  24. package/dist/components/onboarding-guides/index.js +1 -1
  25. package/dist/components/shared/article-author-byline.d.ts +3 -4
  26. package/dist/components/shared/article-author-byline.d.ts.map +1 -1
  27. package/dist/types/entity-author.d.ts +25 -0
  28. package/dist/types/entity-author.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/src/components/authors/author-detail-view.tsx +130 -0
  31. package/src/components/faq/faq-section.tsx +67 -31
  32. package/src/components/faq-accordion.tsx +14 -3
  33. package/src/components/index.ts +7 -2
  34. package/src/components/shared/article-author-byline.tsx +3 -4
  35. package/src/types/entity-author.ts +27 -0
  36. package/dist/chunk-J3QMPOS6.js.map +0 -1
  37. package/dist/chunk-ZJP2BB3E.cjs.map +0 -1
@@ -70,7 +70,10 @@ function FaqAccordion({ items, defaultOpenIds = [] }) {
70
70
  "aria-expanded": isOpen,
71
71
  className: "flex w-full items-center justify-between px-6 md:px-8 py-6 text-left focus:outline-none transition-colors cursor-pointer",
72
72
  children: [
73
- /* @__PURE__ */ jsx("h3", { children: item.question }),
73
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col gap-2 pr-4", children: [
74
+ /* @__PURE__ */ jsx("h3", { children: item.question }),
75
+ item.badge && /* @__PURE__ */ jsx("span", { className: "w-fit shrink-0 px-2 py-1 rounded text-xs font-medium font-['DM_Sans'] bg-ods-border text-ods-text-secondary", children: item.badge })
76
+ ] }),
74
77
  /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx(
75
78
  ChevronButton,
76
79
  {
@@ -161,6 +164,7 @@ function FaqSection({
161
164
  entityType,
162
165
  entityId,
163
166
  heading,
167
+ variant,
164
168
  emitJsonLd = false,
165
169
  jsonLd,
166
170
  className,
@@ -174,17 +178,21 @@ function FaqSection({
174
178
  );
175
179
  const { data, isLoading, error } = useSelfFetch(url, { initialData });
176
180
  const faqs = data?.faqs ?? [];
177
- const showHeading = heading !== null;
178
- const headingNode = heading === void 0 ? /* @__PURE__ */ jsx2("h1", { className: "text-h1 tracking-[-0.04em] text-ods-text-primary", children: DEFAULT_HEADING_TEXT }) : heading;
179
- const groups = groupBySection(faqs);
180
- if (error && !showHeading) {
181
+ const isEmbedded = variant ? variant === "embedded" : heading === null;
182
+ const headingNode = heading === void 0 ? isEmbedded ? (
183
+ // Embedded default is an <h2> — a host page already owns the <h1>,
184
+ // and the schema/heading pair must read "Frequently Asked Questions"
185
+ // (one FAQ heading per page, never tag/section names).
186
+ /* @__PURE__ */ jsx2("h2", { className: "text-h2 tracking-[-0.04em] text-ods-text-primary", children: DEFAULT_HEADING_TEXT })
187
+ ) : /* @__PURE__ */ jsx2("h1", { className: "text-h1 tracking-[-0.04em] text-ods-text-primary", children: DEFAULT_HEADING_TEXT }) : heading;
188
+ if (error && isEmbedded) {
181
189
  return null;
182
190
  }
183
- if (!isLoading && !error && faqs.length === 0 && !showHeading) {
191
+ if (!isLoading && !error && faqs.length === 0 && isEmbedded) {
184
192
  return null;
185
193
  }
186
194
  if (isLoading && faqs.length === 0) {
187
- if (!showHeading) {
195
+ if (isEmbedded) {
188
196
  return /* @__PURE__ */ jsx2("div", { className, children: /* @__PURE__ */ jsx2(FaqSkeleton, {}) });
189
197
  }
190
198
  return /* @__PURE__ */ jsx2("main", { className: className ?? "bg-ods-bg", children: /* @__PURE__ */ jsx2("div", { className: "max-w-[1920px] px-6 md:px-20 py-6 md:py-10 mx-auto", children: /* @__PURE__ */ jsx2(FaqSkeleton, {}) }) });
@@ -193,14 +201,30 @@ function FaqSection({
193
201
  return /* @__PURE__ */ jsx2("main", { className: className ?? "bg-ods-bg flex items-center justify-center py-20", children: /* @__PURE__ */ jsx2("p", { className: "text-ods-text-primary font-medium", children: "Failed to load FAQs. Please try again later." }) });
194
202
  }
195
203
  const schema = emitJsonLd ? buildFaqJsonLdFromFaqs(faqs, jsonLd) : null;
196
- const groupNodes = groups.map(({ section, items }) => /* @__PURE__ */ jsxs2("div", { className: "space-y-4", children: [
197
- section && /* @__PURE__ */ jsx2("h2", { className: "text-h2 tracking-[-0.04em] text-ods-text-primary mb-3 md:mb-4", children: section }),
198
- /* @__PURE__ */ jsx2(FaqAccordion, { items })
199
- ] }, section || "default"));
200
- const body = showHeading ? /* @__PURE__ */ jsx2("main", { className: className ?? "bg-ods-bg", children: /* @__PURE__ */ jsxs2("div", { className: "max-w-[1920px] px-6 md:px-20 py-6 md:py-10 mx-auto space-y-10", children: [
204
+ const body = isEmbedded ? /* @__PURE__ */ jsxs2("section", { className: className ?? "space-y-6", children: [
201
205
  headingNode,
202
- groupNodes
203
- ] }) }) : /* @__PURE__ */ jsx2("section", { className: className ?? "space-y-10", children: groupNodes });
206
+ /* @__PURE__ */ jsx2(
207
+ FaqAccordion,
208
+ {
209
+ items: faqs.map((faq) => ({
210
+ id: faq.id,
211
+ question: faq.question,
212
+ answer: faq.answer,
213
+ badge: faq.section || void 0
214
+ }))
215
+ }
216
+ )
217
+ ] }) : (
218
+ // Page variant (standalone /faqs): historical markup — <main> shell,
219
+ // page gutters, FAQs grouped by section with one <h2> per section.
220
+ /* @__PURE__ */ jsx2("main", { className: className ?? "bg-ods-bg", children: /* @__PURE__ */ jsxs2("div", { className: "max-w-[1920px] px-6 md:px-20 py-6 md:py-10 mx-auto space-y-10", children: [
221
+ headingNode,
222
+ groupBySection(faqs).map(({ section, items }) => /* @__PURE__ */ jsxs2("div", { className: "space-y-4", children: [
223
+ section && /* @__PURE__ */ jsx2("h2", { className: "text-h2 tracking-[-0.04em] text-ods-text-primary mb-3 md:mb-4", children: section }),
224
+ /* @__PURE__ */ jsx2(FaqAccordion, { items })
225
+ ] }, section || "default"))
226
+ ] }) })
227
+ );
204
228
  return /* @__PURE__ */ jsxs2(Fragment, { children: [
205
229
  body,
206
230
  schema && /* @__PURE__ */ jsx2(
@@ -217,4 +241,4 @@ export {
217
241
  FaqAccordion,
218
242
  FaqSection
219
243
  };
220
- //# sourceMappingURL=chunk-J3QMPOS6.js.map
244
+ //# sourceMappingURL=chunk-OVXKTNEP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/faq/faq-section.tsx","../src/components/faq-accordion.tsx","../src/components/faq/json-ld.ts"],"sourcesContent":["\"use client\"\n\nimport React, { useMemo } from 'react'\nimport type { Faq } from '../../types/faq'\nimport { FaqAccordion, type FaqItem } from '../faq-accordion'\nimport { useSelfFetch } from '../../hooks/use-self-fetch'\nimport { buildSuggestionUrl } from '../../utils/suggestion-url'\nimport { serializeJsonLd } from '../../utils/common'\nimport { buildFaqJsonLdFromFaqs, type FaqSchemaOptions } from './json-ld'\n\nexport interface FaqSectionProps {\n /**\n * SSR hydrate. When provided, the hook skips the first client fetch (per\n * useSelfFetch contract). The consuming server page resolves FAQs then drills\n * them into this prop — the lib never re-fetches what the host already gated on.\n */\n initialFaqs?: Faq[]\n /** Both required together for entity-attached FAQs; partial → bare /api/faqs. */\n entityType?: string\n entityId?: number | string\n /**\n * Heading node. `undefined` → variant default (page: <h1>, embedded: <h2>\n * \"Frequently Asked Questions\"); `null` → no heading. React node so\n * platforms can drill their local <PageHeading> component without the lib\n * referencing platform state.\n */\n heading?: React.ReactNode | null\n /**\n * Layout variant.\n * - 'page' — the standalone /faqs surface: <main> shell + page gutters,\n * FAQs GROUPED by `faq.section` with one <h2> per section.\n * - 'embedded' — a section inside a host page (entity detail rails, the\n * global nested-page block): no shell, ONE flat accordion with each\n * row's `faq.section` rendered as a neutral chip (never a heading) and\n * a single default <h2> above. Exactly one FAQ block per page — the\n * per-tag heading loop is page-variant-only.\n * Back-compat default: `heading === null` → 'embedded', else 'page' (the\n * pre-variant discriminator, kept so older embedders don't shift layout\n * until they opt in — they DO pick up the flat chip list, which is the\n * point of the consolidation).\n */\n variant?: 'page' | 'embedded'\n /** Inject FAQPage schema.org JSON-LD as a <script>. Off by default so embeds\n * don't emit duplicate schema. */\n emitJsonLd?: boolean\n /** Overrides for the JSON-LD's name/description/url. */\n jsonLd?: FaqSchemaOptions\n className?: string\n /** Maps to /api/faqs `?count=` (the 5-tier fill target). Absent → param\n * not sent (server default applies). */\n minResults?: number\n /** Fetch-URL prefix for third-party embeds / reverse proxies\n * ('' = same-origin relative). */\n apiBaseUrl?: string\n}\n\nconst DEFAULT_HEADING_TEXT = 'Frequently Asked Questions'\n\n/** URL composition shared with RelatedContentSection (`buildSuggestionUrl`)\n * — byte-identical to the historical `buildFaqsUrl` output when\n * `minResults`/`apiBaseUrl` are absent. */\nfunction buildFaqsUrl(\n entityType?: string,\n entityId?: number | string,\n minResults?: number,\n apiBaseUrl = '',\n): string {\n return buildSuggestionUrl('/api/faqs', { apiBaseUrl, entityType, entityId, count: minResults })\n}\n\nfunction groupBySection(faqs: Faq[]): Array<{ section: string | null; items: FaqItem[] }> {\n const map = new Map<string, FaqItem[]>()\n for (const faq of faqs) {\n const key = faq.section || ''\n let arr = map.get(key)\n if (!arr) {\n arr = []\n map.set(key, arr)\n }\n arr.push({ id: faq.id, question: faq.question, answer: faq.answer })\n }\n return Array.from(map.entries()).map(([section, items]) => ({\n section: section || null,\n items,\n }))\n}\n\nfunction FaqSkeleton() {\n return (\n <div className=\"space-y-8 animate-pulse\">\n <div className=\"h-12 md:h-14 w-2/3 rounded bg-ods-border\" />\n <div className=\"rounded-3xl border border-ods-border overflow-hidden bg-ods-card divide-y divide-ods-border w-full\">\n {Array.from({ length: 8 }).map((_, idx) => (\n <div key={idx} className=\"flex items-center justify-between px-6 md:px-8 py-6\">\n <div className=\"h-6 w-5/6 rounded bg-ods-border\" />\n <div className=\"h-10 w-10 rounded-md bg-ods-border\" />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\ninterface FaqsResponse {\n faqs: Faq[]\n}\n\n/**\n * Generic, embeddable FAQ display surface.\n *\n * - Standalone /faqs page: pass `initialFaqs` from the server + `heading` +\n * `emitJsonLd` with `jsonLd` overrides for SEO.\n * - Per-entity embed: pass `entityType` + `entityId` (no `initialFaqs`); the\n * hook self-fetches and the public /api/faqs endpoint picks override-vs-fallback.\n *\n * CONTRACT: the consuming app MUST implement `GET /api/faqs`. Without it,\n * useSelfFetch reports `error:true` (logged once); in embedded mode (heading\n * === null) this component renders nothing so the host page isn't disfigured.\n */\nexport function FaqSection({\n initialFaqs,\n entityType,\n entityId,\n heading,\n variant,\n emitJsonLd = false,\n jsonLd,\n className,\n minResults,\n apiBaseUrl = '',\n}: FaqSectionProps) {\n const url = buildFaqsUrl(entityType, entityId, minResults, apiBaseUrl)\n // Memoized — useSelfFetch re-syncs on [initialData]; a fresh per-render\n // wrapper object would setState-loop under re-rendering parents.\n const initialData = useMemo<FaqsResponse | undefined>(\n () => (initialFaqs ? { faqs: initialFaqs } : undefined),\n [initialFaqs],\n )\n const { data, isLoading, error } = useSelfFetch<FaqsResponse>(url, { initialData })\n\n const faqs = data?.faqs ?? []\n const isEmbedded = variant ? variant === 'embedded' : heading === null\n const headingNode =\n heading === undefined ? (\n isEmbedded ? (\n // Embedded default is an <h2> — a host page already owns the <h1>,\n // and the schema/heading pair must read \"Frequently Asked Questions\"\n // (one FAQ heading per page, never tag/section names).\n <h2 className=\"text-h2 tracking-[-0.04em] text-ods-text-primary\">{DEFAULT_HEADING_TEXT}</h2>\n ) : (\n <h1 className=\"text-h1 tracking-[-0.04em] text-ods-text-primary\">{DEFAULT_HEADING_TEXT}</h1>\n )\n ) : (\n heading\n )\n\n // Embedded mode: degrade silently on error.\n if (error && isEmbedded) {\n return null\n }\n\n // Embedded mode, zero FAQs after load: render nothing — an embedded host\n // page (blog/case-study detail) must not show an empty section shell.\n // The standalone /faqs page keeps its existing behavior.\n if (!isLoading && !error && faqs.length === 0 && isEmbedded) {\n return null\n }\n\n if (isLoading && faqs.length === 0) {\n // Embedded mode renders skeletons WITHOUT the standalone page shell —\n // a host detail page already provides <main> + gutters; nesting them\n // here would emit invalid markup and double padding.\n if (isEmbedded) {\n return (\n <div className={className}>\n <FaqSkeleton />\n </div>\n )\n }\n return (\n <main className={className ?? 'bg-ods-bg'}>\n <div className=\"max-w-[1920px] px-6 md:px-20 py-6 md:py-10 mx-auto\">\n <FaqSkeleton />\n </div>\n </main>\n )\n }\n\n if (error && faqs.length === 0) {\n return (\n <main className={className ?? 'bg-ods-bg flex items-center justify-center py-20'}>\n <p className=\"text-ods-text-primary font-medium\">Failed to load FAQs. Please try again later.</p>\n </main>\n )\n }\n\n const schema = emitJsonLd ? buildFaqJsonLdFromFaqs(faqs, jsonLd) : null\n\n // Embedded: ONE flat accordion — `faq.section` becomes a per-row chip, NOT\n // a heading, so the host page's outline stays h2(\"Frequently Asked\n // Questions\") + h3(questions). Order is the server's (post-specific first,\n // then reused) — grouping by section here would destroy it.\n const body = isEmbedded ? (\n <section className={className ?? 'space-y-6'}>\n {headingNode}\n <FaqAccordion\n items={faqs.map((faq) => ({\n id: faq.id,\n question: faq.question,\n answer: faq.answer,\n badge: faq.section || undefined,\n }))}\n />\n </section>\n ) : (\n // Page variant (standalone /faqs): historical markup — <main> shell,\n // page gutters, FAQs grouped by section with one <h2> per section.\n <main className={className ?? 'bg-ods-bg'}>\n <div className=\"max-w-[1920px] px-6 md:px-20 py-6 md:py-10 mx-auto space-y-10\">\n {headingNode}\n {groupBySection(faqs).map(({ section, items }) => (\n <div key={section || 'default'} className=\"space-y-4\">\n {section && (\n <h2 className=\"text-h2 tracking-[-0.04em] text-ods-text-primary mb-3 md:mb-4\">\n {section}\n </h2>\n )}\n <FaqAccordion items={items} />\n </div>\n ))}\n </div>\n </main>\n )\n\n return (\n <>\n {body}\n {schema && (\n <script\n type=\"application/ld+json\"\n // eslint-disable-next-line react/no-danger\n // serializeJsonLd, NOT raw JSON.stringify — FAQ answers are\n // admin-entered; an embedded \"</script>\" must not break the tag.\n dangerouslySetInnerHTML={{ __html: serializeJsonLd(schema) }}\n />\n )}\n </>\n )\n}\n","\"use client\"\n\nimport React, { useRef, useState, useEffect, useCallback } from 'react'\nimport { ChevronButton } from './ui/chevron-button'\nimport { cn } from \"../utils/cn\"\n\nexport interface FaqItem {\n id: number | string\n question: string\n answer: string\n /** Optional category label rendered as a neutral chip under the question\n * (NOT a heading — keeps the document outline to h2/h3 only). Mirrors the\n * hub's FaqSectionBadge recipe so admin + public chips stay identical. */\n badge?: string\n}\n\ninterface FaqAccordionProps {\n items: FaqItem[]\n defaultOpenIds?: (number | string)[]\n}\n\n// Utility to measure scrollHeight outside render cycle\nconst useMeasuredHeight = (isOpen: boolean) => {\n const ref = useRef<HTMLDivElement | null>(null)\n const [maxHeight, setMaxHeight] = useState<string>('0px')\n\n const measure = useCallback(() => {\n if (ref.current) {\n const height = ref.current.scrollHeight\n setMaxHeight(`${height}px`)\n }\n }, [])\n\n // Update height only when section is open\n useEffect(() => {\n if (isOpen) {\n measure()\n } else {\n setMaxHeight('0px')\n }\n }, [isOpen, measure])\n\n return { ref, maxHeight }\n}\n\nexport function FaqAccordion({ items, defaultOpenIds = [] }: FaqAccordionProps) {\n const [openSet, setOpenSet] = useState<Set<string | number>>(new Set(defaultOpenIds))\n\n const toggle = (id: string | number) => {\n setOpenSet(prev => {\n const next = new Set(prev)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n return next\n })\n }\n\n return (\n <div className=\"rounded-3xl border border-ods-border divide-y divide-ods-border bg-ods-card overflow-hidden\">\n {items.map(item => {\n const isOpen = openSet.has(item.id)\n const { ref, maxHeight } = useMeasuredHeight(isOpen)\n\n return (\n <div\n key={item.id}\n className={cn('group transition-colors hover:bg-[#1E1E1E]', isOpen ? 'bg-ods-bg' : 'bg-transparent')}\n >\n {/* Header */}\n <div\n role=\"button\"\n tabIndex={0}\n onClick={() => toggle(item.id)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n toggle(item.id);\n }\n }}\n aria-expanded={isOpen}\n className=\"flex w-full items-center justify-between px-6 md:px-8 py-6 text-left focus:outline-none transition-colors cursor-pointer\"\n >\n <div className=\"flex min-w-0 flex-col gap-2 pr-4\">\n <h3>\n {item.question}\n </h3>\n {item.badge && (\n <span className=\"w-fit shrink-0 px-2 py-1 rounded text-xs font-medium font-['DM_Sans'] bg-ods-border text-ods-text-secondary\">\n {item.badge}\n </span>\n )}\n </div>\n <div className=\"flex-shrink-0\">\n <ChevronButton\n aria-label={isOpen ? 'Collapse question' : 'Expand question'}\n size=\"md\"\n isExpanded={isOpen}\n backgroundColor=\"transparent\"\n borderColor=\"#3A3A3A\"\n />\n </div>\n </div>\n {/* Content wrapper with max-height animation */}\n <div\n style={{ maxHeight, transition: 'max-height 0.35s ease-in-out, opacity 0.35s ease-in-out', opacity: isOpen ? 1 : 0 }}\n className=\"overflow-hidden group-hover:bg-[#1E1E1E]/30\"\n >\n <div ref={ref} className=\"px-6 md:px-8 pb-6 text-ods-text-primary text-h4\">\n {item.answer}\n </div>\n </div>\n </div>\n )\n })}\n </div>\n )\n} ","/**\n * Pure FAQ JSON-LD builder. No React, no client-only deps — safe to import from\n * Server Components via the `./components/faq` subpath export. (Do NOT import\n * through the root `./components` barrel — that barrel is `\"use client\"` and\n * dragging it into a Server Component would force the client graph into the\n * server.)\n *\n * The hub used to harcode `name`/`description` here for OpenMSP; in the lib we\n * accept overrides so every embedder can supply its own platform branding.\n */\nimport type { Faq } from '../../types/faq'\n\nexport interface FaqSchemaOptions {\n name?: string\n description?: string\n url?: string\n}\n\nconst DEFAULT_NAME = 'Frequently Asked Questions'\nconst DEFAULT_DESCRIPTION =\n 'Answers to common questions.'\n\nexport function baseFaqSchema(opts: FaqSchemaOptions = {}) {\n return {\n '@context': 'https://schema.org',\n '@type': 'FAQPage',\n name: opts.name ?? DEFAULT_NAME,\n description: opts.description ?? DEFAULT_DESCRIPTION,\n ...(opts.url ? { url: opts.url } : {}),\n } as const\n}\n\nexport function buildFaqJsonLdFromFaqs(faqs: Faq[], opts: FaqSchemaOptions = {}) {\n return {\n ...baseFaqSchema(opts),\n mainEntity: faqs.map((faq) => ({\n '@type': 'Question',\n name: faq.question,\n acceptedAnswer: {\n '@type': 'Answer',\n text: faq.answer,\n },\n })),\n } as const\n}\n"],"mappings":";;;;;;;;;;;;;;;AAEA,SAAgB,eAAe;;;ACA/B,SAAgB,QAAQ,UAAU,WAAW,mBAAmB;AAEhE;AA8Ec,SACE,KADF;AA5Dd,IAAM,oBAAoB,CAAC,WAAoB;AAC7C,QAAM,MAAM,OAA8B,IAAI;AAC9C,QAAM,CAAC,WAAW,YAAY,IAAI,SAAiB,KAAK;AAExD,QAAM,UAA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A;AAAA,IAIA,gBAAAA,KAAC,UAAK,WAAW,aAAa,aAC5B,0BAAAC,MAAC,SAAI,WAAU,iEACZ;AAAA;AAAA,MACA,eAAe,IAAI,EAAE,IAAI,CAAC,EAAE,SAAS,MAAM,MAC1C,gBAAAA,MAAC,SAA+B,WAAU,aACvC;AAAA,mBACC,gBAAAD,KAAC,QAAG,WAAU,iEACX,mBACH;AAAA,QAEF,gBAAAA,KAAC,gBAAa,OAAc;AAAA,WANpB,WAAW,SAOrB,CACD;AAAA,OACH,GACF;AAAA;AAGF,SACE,gBAAAC,MAAA,YACG;AAAA;AAAA,IACA,UACC,gBAAAD;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QAIL,yBAAyB,EAAE,QAAQ,gBAAgB,MAAM,EAAE;AAAA;AAAA,IAC7D;AAAA,KAEJ;AAEJ;","names":["jsx","jsxs"]}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Author detail-page body — identity header (avatar → name → job title →
3
+ * socials), bio, expertise badges, and a `children` slot for the authored-
4
+ * content rail. THE one implementation behind the hub's `/authors/[slug]`
5
+ * page AND embedded author pages (react-embedding-example) — hosts fetch
6
+ * the `AuthorProfile` however they like and drill it in.
7
+ *
8
+ * Embed-readiness contract (same rules as ArticleAuthorByline):
9
+ * - `Image` renders through the embed shim (plain `<img>` in non-Next
10
+ * hosts; the real `next/image` once registered at app init).
11
+ * - Avatar proxying rides the OPTIONAL ambient `ChatRuntime`
12
+ * (`endpoints.imageProxyUrlPrefix`) — no provider ⇒ raw URL, never
13
+ * throws. `proxyImageUrl` prop wins over the runtime.
14
+ * - The authored-content rail is a SLOT (`children`), not a baked-in
15
+ * fetch: the hub passes its pre-bound `RelatedContentSection` with SSR
16
+ * `initialItems`; embedders pass the lib section with `apiBaseUrl`.
17
+ * The view stays data-in, markup-out.
18
+ *
19
+ * Heading semantics are the HOST's: the view renders the name as a styled
20
+ * `<p>` (like the hub profile header) so a hosting page can own its `<h1>`
21
+ * (the hub uses an sr-only h1 for crawlers).
22
+ */
23
+ import React from 'react';
24
+ import type { AuthorProfile } from '../../types/entity-author';
25
+ export interface AuthorDetailViewProps {
26
+ author: AuthorProfile;
27
+ /** Host-injected avatar-URL mapper — wins over the ambient runtime. */
28
+ proxyImageUrl?: (url: string) => string;
29
+ /** Authored-content rail (or anything else) rendered below the profile. */
30
+ children?: React.ReactNode;
31
+ className?: string;
32
+ }
33
+ export declare function AuthorDetailView({ author, proxyImageUrl, children, className, }: AuthorDetailViewProps): React.JSX.Element;
34
+ //# sourceMappingURL=author-detail-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"author-detail-view.d.ts","sourceRoot":"","sources":["../../../src/components/authors/author-detail-view.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAE9D,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,aAAa,CAAA;IACrB,uEAAuE;IACvE,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;IACvC,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,aAAa,EACb,QAAQ,EACR,SAAS,GACV,EAAE,qBAAqB,qBAgFvB"}
@@ -12,11 +12,27 @@ export interface FaqSectionProps {
12
12
  entityType?: string;
13
13
  entityId?: number | string;
14
14
  /**
15
- * Page heading. Pass null to render in embedded mode (no <h1>, error branch
16
- * suppresses any banner). React node so platforms can drill their local
17
- * <PageHeading> component without the lib referencing platform state.
15
+ * Heading node. `undefined` variant default (page: <h1>, embedded: <h2>
16
+ * "Frequently Asked Questions"); `null` → no heading. React node so
17
+ * platforms can drill their local <PageHeading> component without the lib
18
+ * referencing platform state.
18
19
  */
19
20
  heading?: React.ReactNode | null;
21
+ /**
22
+ * Layout variant.
23
+ * - 'page' — the standalone /faqs surface: <main> shell + page gutters,
24
+ * FAQs GROUPED by `faq.section` with one <h2> per section.
25
+ * - 'embedded' — a section inside a host page (entity detail rails, the
26
+ * global nested-page block): no shell, ONE flat accordion with each
27
+ * row's `faq.section` rendered as a neutral chip (never a heading) and
28
+ * a single default <h2> above. Exactly one FAQ block per page — the
29
+ * per-tag heading loop is page-variant-only.
30
+ * Back-compat default: `heading === null` → 'embedded', else 'page' (the
31
+ * pre-variant discriminator, kept so older embedders don't shift layout
32
+ * until they opt in — they DO pick up the flat chip list, which is the
33
+ * point of the consolidation).
34
+ */
35
+ variant?: 'page' | 'embedded';
20
36
  /** Inject FAQPage schema.org JSON-LD as a <script>. Off by default so embeds
21
37
  * don't emit duplicate schema. */
22
38
  emitJsonLd?: boolean;
@@ -42,5 +58,5 @@ export interface FaqSectionProps {
42
58
  * useSelfFetch reports `error:true` (logged once); in embedded mode (heading
43
59
  * === null) this component renders nothing so the host page isn't disfigured.
44
60
  */
45
- export declare function FaqSection({ initialFaqs, entityType, entityId, heading, emitJsonLd, jsonLd, className, minResults, apiBaseUrl, }: FaqSectionProps): React.JSX.Element | null;
61
+ export declare function FaqSection({ initialFaqs, entityType, entityId, heading, variant, emitJsonLd, jsonLd, className, minResults, apiBaseUrl, }: FaqSectionProps): React.JSX.Element | null;
46
62
  //# sourceMappingURL=faq-section.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"faq-section.d.ts","sourceRoot":"","sources":["../../../src/components/faq/faq-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAK1C,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAEzE,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,WAAW,CAAC,EAAE,GAAG,EAAE,CAAA;IACnB,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;IAChC;uCACmC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,wDAAwD;IACxD,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;6CACyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;uCACmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAqDD;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,EACzB,WAAW,EACX,UAAU,EACV,QAAQ,EACR,OAAO,EACP,UAAkB,EAClB,MAAM,EACN,SAAS,EACT,UAAU,EACV,UAAe,GAChB,EAAE,eAAe,4BAmGjB"}
1
+ {"version":3,"file":"faq-section.d.ts","sourceRoot":"","sources":["../../../src/components/faq/faq-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAK1C,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAEzE,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,WAAW,CAAC,EAAE,GAAG,EAAE,CAAA;IACnB,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;IAChC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;IAC7B;uCACmC;IACnC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,wDAAwD;IACxD,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;6CACyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;uCACmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAqDD;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,EACzB,WAAW,EACX,UAAU,EACV,QAAQ,EACR,OAAO,EACP,OAAO,EACP,UAAkB,EAClB,MAAM,EACN,SAAS,EACT,UAAU,EACV,UAAe,GAChB,EAAE,eAAe,4BAsHjB"}
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
2
 
3
3
 
4
- var _chunkZJP2BB3Ecjs = require('../../chunk-ZJP2BB3E.cjs');
4
+ var _chunk3UAV25YBcjs = require('../../chunk-3UAV25YB.cjs');
5
5
  require('../../chunk-T7AJBKZP.cjs');
6
6
  require('../../chunk-7VMEOFEA.cjs');
7
7
  require('../../chunk-FIG2RKZF.cjs');
8
8
  require('../../chunk-VRHGVLSL.cjs');
9
9
 
10
10
 
11
- exports.FaqSection = _chunkZJP2BB3Ecjs.FaqSection;
11
+ exports.FaqSection = _chunk3UAV25YBcjs.FaqSection;
12
12
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  FaqSection
4
- } from "../../chunk-J3QMPOS6.js";
4
+ } from "../../chunk-OVXKTNEP.js";
5
5
  import "../../chunk-L4LAAA5Q.js";
6
6
  import "../../chunk-NR535XIY.js";
7
7
  import "../../chunk-XTCBRQN2.js";
@@ -3,6 +3,10 @@ export interface FaqItem {
3
3
  id: number | string;
4
4
  question: string;
5
5
  answer: string;
6
+ /** Optional category label rendered as a neutral chip under the question
7
+ * (NOT a heading — keeps the document outline to h2/h3 only). Mirrors the
8
+ * hub's FaqSectionBadge recipe so admin + public chips stay identical. */
9
+ badge?: string;
6
10
  }
7
11
  interface FaqAccordionProps {
8
12
  items: FaqItem[];
@@ -1 +1 @@
1
- {"version":3,"file":"faq-accordion.d.ts","sourceRoot":"","sources":["../../src/components/faq-accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAA;AAIvE,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,UAAU,iBAAiB;IACzB,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;CACrC;AA0BD,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,cAAmB,EAAE,EAAE,iBAAiB,qBAgE7E"}
1
+ {"version":3,"file":"faq-accordion.d.ts","sourceRoot":"","sources":["../../src/components/faq-accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAA;AAIvE,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd;;+EAE2E;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,UAAU,iBAAiB;IACzB,KAAK,EAAE,OAAO,EAAE,CAAA;IAChB,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;CACrC;AA0BD,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,cAAmB,EAAE,EAAE,iBAAiB,qBAuE7E"}