@flamingo-stack/openframe-frontend-core 0.0.286 → 0.0.287-snapshot.20260618163006

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 (94) hide show
  1. package/dist/{chunk-HLQW7MWJ.cjs → chunk-3SDBXXDP.cjs} +21 -21
  2. package/dist/{chunk-HLQW7MWJ.cjs.map → chunk-3SDBXXDP.cjs.map} +1 -1
  3. package/dist/{chunk-4WACBTZU.cjs → chunk-6AW25OS6.cjs} +25 -25
  4. package/dist/{chunk-4WACBTZU.cjs.map → chunk-6AW25OS6.cjs.map} +1 -1
  5. package/dist/{chunk-QCKN37OP.cjs → chunk-6CSW5TMS.cjs} +35 -35
  6. package/dist/{chunk-QCKN37OP.cjs.map → chunk-6CSW5TMS.cjs.map} +1 -1
  7. package/dist/{chunk-YVB3VDIQ.js → chunk-7EYWERFT.js} +2 -2
  8. package/dist/chunk-AISIZLZP.js +619 -0
  9. package/dist/chunk-AISIZLZP.js.map +1 -0
  10. package/dist/{chunk-6N26CURS.cjs → chunk-D6RK5YXX.cjs} +25 -3
  11. package/dist/chunk-D6RK5YXX.cjs.map +1 -0
  12. package/dist/chunk-DVUFNTI2.cjs +619 -0
  13. package/dist/chunk-DVUFNTI2.cjs.map +1 -0
  14. package/dist/{chunk-FSBDVT6R.js → chunk-EFYXPR43.js} +2 -2
  15. package/dist/{chunk-XQL4WDML.js → chunk-GJDXIVEQ.js} +3 -3
  16. package/dist/{chunk-D5YY5U6J.cjs → chunk-JQ4I743L.cjs} +11 -11
  17. package/dist/{chunk-D5YY5U6J.cjs.map → chunk-JQ4I743L.cjs.map} +1 -1
  18. package/dist/{chunk-DDAT4RKX.js → chunk-ODR6A6FC.js} +24 -2
  19. package/dist/chunk-ODR6A6FC.js.map +1 -0
  20. package/dist/{chunk-GDF2R2ER.cjs → chunk-OXC72UIP.cjs} +120 -120
  21. package/dist/{chunk-GDF2R2ER.cjs.map → chunk-OXC72UIP.cjs.map} +1 -1
  22. package/dist/{chunk-RQ6RTBKF.cjs → chunk-RG6FNZUA.cjs} +65 -27
  23. package/dist/chunk-RG6FNZUA.cjs.map +1 -0
  24. package/dist/{chunk-5BTZOVDQ.js → chunk-RWCA2ZQK.js} +2 -2
  25. package/dist/{chunk-QF2X6PTD.js → chunk-TY2EB7VK.js} +58 -20
  26. package/dist/chunk-TY2EB7VK.js.map +1 -0
  27. package/dist/{chunk-VCQ3CTYK.js → chunk-ZYLQMCHW.js} +3 -3
  28. package/dist/components/chat/index.cjs +3 -3
  29. package/dist/components/chat/index.js +2 -2
  30. package/dist/components/contact/index.cjs +4 -4
  31. package/dist/components/contact/index.js +3 -3
  32. package/dist/components/docs/index.cjs +3 -3
  33. package/dist/components/docs/index.js +2 -2
  34. package/dist/components/embeds/index.cjs +8 -4
  35. package/dist/components/embeds/index.cjs.map +1 -1
  36. package/dist/components/embeds/index.d.ts +2 -0
  37. package/dist/components/embeds/index.d.ts.map +1 -1
  38. package/dist/components/embeds/index.js +7 -3
  39. package/dist/components/embeds/og-link-preview.d.ts +114 -0
  40. package/dist/components/embeds/og-link-preview.d.ts.map +1 -0
  41. package/dist/components/faq/faq-section.d.ts.map +1 -1
  42. package/dist/components/faq/index.cjs +4 -4
  43. package/dist/components/faq/index.js +3 -3
  44. package/dist/components/faq-accordion.d.ts.map +1 -1
  45. package/dist/components/features/index.cjs +3 -3
  46. package/dist/components/features/index.js +2 -2
  47. package/dist/components/index.cjs +146 -142
  48. package/dist/components/index.cjs.map +1 -1
  49. package/dist/components/index.js +11 -7
  50. package/dist/components/index.js.map +1 -1
  51. package/dist/components/navigation/index.cjs +3 -3
  52. package/dist/components/navigation/index.js +2 -2
  53. package/dist/components/related-content/index.cjs +4 -4
  54. package/dist/components/related-content/index.js +3 -3
  55. package/dist/components/tickets/index.cjs +53 -53
  56. package/dist/components/tickets/index.js +4 -4
  57. package/dist/components/ui/index.cjs +3 -3
  58. package/dist/components/ui/index.js +2 -2
  59. package/dist/index.cjs +9 -3
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.js +8 -2
  62. package/dist/types/marketing.d.ts +1 -1
  63. package/dist/types/marketing.d.ts.map +1 -1
  64. package/dist/utils/faq-anchor.d.ts +51 -0
  65. package/dist/utils/faq-anchor.d.ts.map +1 -0
  66. package/dist/utils/index.cjs +23 -1
  67. package/dist/utils/index.cjs.map +1 -1
  68. package/dist/utils/index.d.ts +2 -0
  69. package/dist/utils/index.d.ts.map +1 -1
  70. package/dist/utils/index.js +21 -2
  71. package/dist/utils/index.js.map +1 -1
  72. package/dist/utils/list-url.d.ts.map +1 -1
  73. package/package.json +1 -1
  74. package/src/components/embeds/index.ts +7 -0
  75. package/src/components/embeds/og-link-preview.tsx +446 -0
  76. package/src/components/faq/faq-section.tsx +78 -26
  77. package/src/components/faq-accordion.tsx +8 -1
  78. package/src/types/marketing.ts +1 -0
  79. package/src/utils/faq-anchor.ts +70 -0
  80. package/src/utils/index.ts +7 -0
  81. package/src/utils/list-url.ts +1 -0
  82. package/dist/chunk-6N26CURS.cjs.map +0 -1
  83. package/dist/chunk-BBZ7AX5H.cjs +0 -290
  84. package/dist/chunk-BBZ7AX5H.cjs.map +0 -1
  85. package/dist/chunk-C6SCWXDP.js +0 -290
  86. package/dist/chunk-C6SCWXDP.js.map +0 -1
  87. package/dist/chunk-DDAT4RKX.js.map +0 -1
  88. package/dist/chunk-QF2X6PTD.js.map +0 -1
  89. package/dist/chunk-RQ6RTBKF.cjs.map +0 -1
  90. /package/dist/{chunk-YVB3VDIQ.js.map → chunk-7EYWERFT.js.map} +0 -0
  91. /package/dist/{chunk-FSBDVT6R.js.map → chunk-EFYXPR43.js.map} +0 -0
  92. /package/dist/{chunk-XQL4WDML.js.map → chunk-GJDXIVEQ.js.map} +0 -0
  93. /package/dist/{chunk-5BTZOVDQ.js.map → chunk-RWCA2ZQK.js.map} +0 -0
  94. /package/dist/{chunk-VCQ3CTYK.js.map → chunk-ZYLQMCHW.js.map} +0 -0
@@ -0,0 +1,70 @@
1
+ /**
2
+ * FAQ anchor SSOTs — TWO complementary deep-link kinds on the `/faqs` page,
3
+ * both rendered straight onto the DOM and recognised by ONE parser. Keeping
4
+ * the format helpers + parser in one file means the page, the chat RAG
5
+ * mapper, and any future consumer can't drift on what a hash means.
6
+ *
7
+ * `/faqs#faq-pricing` → category section header (jump-nav pills,
8
+ * scroll-spy)
9
+ * `/faqs#faq-item-42` → individual question (chat citation chips —
10
+ * auto-expands the row + scrolls to it)
11
+ *
12
+ * Reserved namespaces — `faq-item-<digits>` is the item shape; everything
13
+ * else starting with `faq-` is a section slug. `faqSectionSlug` lowercases
14
+ * + dash-collapses + dash-trims, so a section name would only collide with
15
+ * the item shape if it slugified to `faq-item-<digits-only>` (e.g. a
16
+ * category called "Item 42") — none of the 21 production sections do, and
17
+ * `parseFaqHash`'s regex is digits-only so future word-suffixed names like
18
+ * "Item Whatever" (slugifies to `faq-item-whatever`) are also safe.
19
+ */
20
+
21
+ /** Stable, URL-safe anchor id for a category. Prefixed with `faq-` so it
22
+ * can't collide with other in-page ids, and so a bare numeric/blank
23
+ * section still yields a valid id. The helper assumes the caller has
24
+ * already verified the section is a non-blank string (matches
25
+ * `faq-section.tsx`'s `groupFaqsBySection` precondition). */
26
+ export function faqSectionSlug(section: string): string {
27
+ return (
28
+ 'faq-' +
29
+ section
30
+ .toLowerCase()
31
+ .replace(/[^a-z0-9]+/g, '-')
32
+ .replace(/^-+|-+$/g, '')
33
+ )
34
+ }
35
+
36
+ /** Stable anchor for an individual FAQ row. Rendered as the row container's
37
+ * `id` attribute by `FaqAccordion`; consumed by `FaqSection` (auto-open +
38
+ * auto-scroll on mount) AND by the hub's RAG mapper so chat citations
39
+ * deep-link to the specific question, not just its category. The id is
40
+ * stringified verbatim — the FAQ schema uses integer PKs so `parseFaqHash`'s
41
+ * digits-only regex always matches a real row. */
42
+ export function faqItemAnchor(id: number | string): string {
43
+ return `faq-item-${id}`
44
+ }
45
+
46
+ /** Discriminated parse of a `/faqs#…` hash. Returns null for an empty,
47
+ * missing, or unrecognised hash so callers can early-out without
48
+ * scattering string parsing across the file.
49
+ *
50
+ * parseFaqHash('#faq-item-42') → { kind: 'item', rawId: '42' }
51
+ * parseFaqHash('#faq-pricing') → { kind: 'section', slug: 'faq-pricing' }
52
+ * parseFaqHash('#anything-else') → null
53
+ *
54
+ * `rawId` is the matched digit run as a string — the caller compares it
55
+ * to `String(item.id)` so coercion stays at the comparison site. */
56
+ export type FaqHashTarget =
57
+ | { kind: 'item'; rawId: string }
58
+ | { kind: 'section'; slug: string }
59
+
60
+ const FAQ_ITEM_HASH_RE = /^faq-item-(\d+)$/
61
+
62
+ export function parseFaqHash(hash: string | null | undefined): FaqHashTarget | null {
63
+ if (!hash) return null
64
+ const trimmed = hash.replace(/^#/, '')
65
+ if (!trimmed) return null
66
+ const itemMatch = FAQ_ITEM_HASH_RE.exec(trimmed)
67
+ if (itemMatch) return { kind: 'item', rawId: itemMatch[1] }
68
+ if (trimmed.startsWith('faq-')) return { kind: 'section', slug: trimmed }
69
+ return null
70
+ }
@@ -253,6 +253,13 @@ export {
253
253
  // Pure + server-safe (the hub imports it server-side from this barrel).
254
254
  export { buildListUrl, canonicalContentRefType } from './list-url'
255
255
 
256
+ // FAQ anchor SSOTs — section (`faq-<slug>`) AND item (`faq-item-<id>`)
257
+ // formats plus the parser, all rendered by `FaqSection`/`FaqAccordion`
258
+ // and recognised by the hub's RAG mapper. One algo per kind, one parser,
259
+ // zero drift across page + chat + future consumers.
260
+ export { faqSectionSlug, faqItemAnchor, parseFaqHash } from './faq-anchor'
261
+ export type { FaqHashTarget } from './faq-anchor'
262
+
256
263
  // Content-ref group registry (labels/order/layout per rail type) + list-API
257
264
  // response normalizers + the shared suggestion-fetch URL composer — all
258
265
  // pure + server-safe; the hub re-exports these from its config/util shims.
@@ -70,6 +70,7 @@ const BUILDERS: Record<string, (ids: string[], base: string) => string> = {
70
70
  product_release: (ids, b) => `${b}/api/releases?ids=${ids.join(',')}&limit=${ids.length}`,
71
71
  customer_interview: (ids, b) => `${b}/api/customer-interviews?ids=${ids.join(',')}&limit=${ids.length}`,
72
72
  investor_update: (ids, b) => `${b}/api/investor-updates?ids=${ids.join(',')}&limit=${ids.length}`,
73
+ faq: (ids, b) => `${b}/api/faqs?ids=${ids.join(',')}&limit=${ids.length}`,
73
74
  }
74
75
 
75
76
  /**