@flamingo-stack/openframe-frontend-core 0.0.618 → 0.0.619-2160.6147.1

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 (163) hide show
  1. package/dist/{chunk-ANMD7SM4.js → chunk-3BNNYHP2.js} +3 -3
  2. package/dist/{chunk-YCZBCEQO.js → chunk-3Z5ZIKDX.js} +4 -4
  3. package/dist/{chunk-3FTNQDLP.cjs → chunk-4ZGUSO7M.cjs} +5 -5
  4. package/dist/{chunk-3FTNQDLP.cjs.map → chunk-4ZGUSO7M.cjs.map} +1 -1
  5. package/dist/{chunk-VRN5YYD3.js → chunk-5DUTXG6P.js} +3 -3
  6. package/dist/{chunk-VIBREYUK.cjs → chunk-5G3L6327.cjs} +3 -3
  7. package/dist/{chunk-VIBREYUK.cjs.map → chunk-5G3L6327.cjs.map} +1 -1
  8. package/dist/{chunk-GBON2OCG.js → chunk-5WGOAJ4B.js} +3 -2
  9. package/dist/chunk-5WGOAJ4B.js.map +1 -0
  10. package/dist/{chunk-FCN2HN6Q.js → chunk-65SWJSQX.js} +8 -3
  11. package/dist/{chunk-FCN2HN6Q.js.map → chunk-65SWJSQX.js.map} +1 -1
  12. package/dist/{chunk-6XJS3WU7.js → chunk-7HWVD42H.js} +24 -4
  13. package/dist/chunk-7HWVD42H.js.map +1 -0
  14. package/dist/{chunk-RDEFB354.cjs → chunk-AU2Q75HU.cjs} +6 -6
  15. package/dist/{chunk-RDEFB354.cjs.map → chunk-AU2Q75HU.cjs.map} +1 -1
  16. package/dist/{chunk-J25M43YI.js → chunk-D4ARG53E.js} +6 -6
  17. package/dist/{chunk-UXOOVP77.cjs → chunk-DV7IBKJI.cjs} +4 -4
  18. package/dist/{chunk-UXOOVP77.cjs.map → chunk-DV7IBKJI.cjs.map} +1 -1
  19. package/dist/{chunk-CM6DNLK7.cjs → chunk-DXR23SLZ.cjs} +200 -200
  20. package/dist/{chunk-CM6DNLK7.cjs.map → chunk-DXR23SLZ.cjs.map} +1 -1
  21. package/dist/{chunk-N6CULJYR.cjs → chunk-EG4IKWY4.cjs} +3 -2
  22. package/dist/{chunk-N6CULJYR.cjs.map → chunk-EG4IKWY4.cjs.map} +1 -1
  23. package/dist/{chunk-UKFBPJBK.cjs → chunk-EIFU6N5L.cjs} +29 -29
  24. package/dist/{chunk-UKFBPJBK.cjs.map → chunk-EIFU6N5L.cjs.map} +1 -1
  25. package/dist/{chunk-E2EGTHYA.cjs → chunk-EYKTKDRK.cjs} +75 -48
  26. package/dist/chunk-EYKTKDRK.cjs.map +1 -0
  27. package/dist/{chunk-IW746HJ7.js → chunk-FHR2JU2J.js} +2 -2
  28. package/dist/{chunk-ROQTWRV7.cjs → chunk-GAPXVAS6.cjs} +151 -146
  29. package/dist/chunk-GAPXVAS6.cjs.map +1 -0
  30. package/dist/{chunk-7ZEQMFP3.cjs → chunk-GNWKLE7O.cjs} +58 -38
  31. package/dist/chunk-GNWKLE7O.cjs.map +1 -0
  32. package/dist/{chunk-PIJK3FV6.cjs → chunk-HF4EZICZ.cjs} +3 -3
  33. package/dist/{chunk-PIJK3FV6.cjs.map → chunk-HF4EZICZ.cjs.map} +1 -1
  34. package/dist/{chunk-WVRXDGGP.js → chunk-HPIRQWNK.js} +3 -3
  35. package/dist/{chunk-2DTZXXY3.js → chunk-I7RWVDN4.js} +5 -5
  36. package/dist/{chunk-XUNFDRMP.js → chunk-J27HVNT2.js} +4 -4
  37. package/dist/{chunk-GFWKEWEH.js → chunk-JA2SIJ7T.js} +4 -4
  38. package/dist/{chunk-IPHA3AQ6.js → chunk-JBXNDB5U.js} +8 -8
  39. package/dist/{chunk-E7VXPU3R.cjs → chunk-KQDGZS3U.cjs} +33 -33
  40. package/dist/{chunk-E7VXPU3R.cjs.map → chunk-KQDGZS3U.cjs.map} +1 -1
  41. package/dist/{chunk-CWMKY2UJ.js → chunk-LPGBA4UZ.js} +3 -3
  42. package/dist/{chunk-G7NEMLNW.cjs → chunk-M4V2O2MT.cjs} +12 -12
  43. package/dist/{chunk-G7NEMLNW.cjs.map → chunk-M4V2O2MT.cjs.map} +1 -1
  44. package/dist/{chunk-5P74E24M.js → chunk-MJRXGAXS.js} +5 -5
  45. package/dist/{chunk-K26VN65M.cjs → chunk-NOW7NGUH.cjs} +15 -15
  46. package/dist/{chunk-K26VN65M.cjs.map → chunk-NOW7NGUH.cjs.map} +1 -1
  47. package/dist/{chunk-GD7CV2JI.js → chunk-OD4JKGQG.js} +8 -8
  48. package/dist/{chunk-U6B3MM4U.cjs → chunk-P3I5KY4A.cjs} +20 -20
  49. package/dist/{chunk-U6B3MM4U.cjs.map → chunk-P3I5KY4A.cjs.map} +1 -1
  50. package/dist/{chunk-BXNSKTEG.cjs → chunk-QVOS4BPC.cjs} +65 -65
  51. package/dist/{chunk-BXNSKTEG.cjs.map → chunk-QVOS4BPC.cjs.map} +1 -1
  52. package/dist/{chunk-NUU5ZEEG.js → chunk-RTC3H5RW.js} +4 -4
  53. package/dist/{chunk-GXUGYZ6H.js → chunk-S44BHDOI.js} +481 -454
  54. package/dist/chunk-S44BHDOI.js.map +1 -0
  55. package/dist/{chunk-RROIA6WY.js → chunk-SKRI6QJ5.js} +2 -2
  56. package/dist/{chunk-MOC7JLEP.cjs → chunk-U7MQS4CR.cjs} +88 -88
  57. package/dist/{chunk-MOC7JLEP.cjs.map → chunk-U7MQS4CR.cjs.map} +1 -1
  58. package/dist/{chunk-BGDYSUA2.cjs → chunk-UP2OB7RI.cjs} +11 -11
  59. package/dist/{chunk-BGDYSUA2.cjs.map → chunk-UP2OB7RI.cjs.map} +1 -1
  60. package/dist/{chunk-EJGZIYC7.cjs → chunk-UWPZT3FY.cjs} +6 -6
  61. package/dist/{chunk-EJGZIYC7.cjs.map → chunk-UWPZT3FY.cjs.map} +1 -1
  62. package/dist/{chunk-TSCIVH7T.js → chunk-VBIFSOPQ.js} +2 -2
  63. package/dist/{chunk-IDMEC4ZK.cjs → chunk-XRWY5ETC.cjs} +22 -22
  64. package/dist/{chunk-IDMEC4ZK.cjs.map → chunk-XRWY5ETC.cjs.map} +1 -1
  65. package/dist/{chunk-EXEXX34Q.cjs → chunk-YNA7ZCDS.cjs} +28 -28
  66. package/dist/{chunk-EXEXX34Q.cjs.map → chunk-YNA7ZCDS.cjs.map} +1 -1
  67. package/dist/{chunk-UUXLDIK3.js → chunk-ZPJ6KYAW.js} +3 -3
  68. package/dist/components/case-studies/index.cjs +11 -11
  69. package/dist/components/case-studies/index.js +5 -5
  70. package/dist/components/chat/entity-cards/ai-prompt-card.d.ts +35 -0
  71. package/dist/components/chat/entity-cards/ai-prompt-card.d.ts.map +1 -0
  72. package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -1
  73. package/dist/components/chat/entity-cards/index.d.ts +2 -0
  74. package/dist/components/chat/entity-cards/index.d.ts.map +1 -1
  75. package/dist/components/chat/index.cjs +7 -3
  76. package/dist/components/chat/index.cjs.map +1 -1
  77. package/dist/components/chat/index.js +6 -2
  78. package/dist/components/comment-card.d.ts +26 -24
  79. package/dist/components/comment-card.d.ts.map +1 -1
  80. package/dist/components/comment-thread.d.ts +58 -0
  81. package/dist/components/comment-thread.d.ts.map +1 -0
  82. package/dist/components/contact/index.cjs +6 -6
  83. package/dist/components/contact/index.js +5 -5
  84. package/dist/components/docs/index.cjs +9 -9
  85. package/dist/components/docs/index.js +8 -8
  86. package/dist/components/embeds/index.cjs +6 -6
  87. package/dist/components/embeds/index.js +5 -5
  88. package/dist/components/faq/index.cjs +6 -6
  89. package/dist/components/faq/index.js +5 -5
  90. package/dist/components/features/index.cjs +5 -5
  91. package/dist/components/features/index.js +4 -4
  92. package/dist/components/help-center-pages/index.cjs +27 -27
  93. package/dist/components/help-center-pages/index.js +18 -18
  94. package/dist/components/index.cjs +221 -77
  95. package/dist/components/index.cjs.map +1 -1
  96. package/dist/components/index.d.ts +1 -0
  97. package/dist/components/index.d.ts.map +1 -1
  98. package/dist/components/index.js +338 -194
  99. package/dist/components/index.js.map +1 -1
  100. package/dist/components/meeting-scheduler/index.cjs +40 -40
  101. package/dist/components/meeting-scheduler/index.js +6 -6
  102. package/dist/components/navigation/index.cjs +8 -8
  103. package/dist/components/navigation/index.js +7 -7
  104. package/dist/components/onboarding-guides/index.cjs +8 -8
  105. package/dist/components/onboarding-guides/index.js +7 -7
  106. package/dist/components/related-content/card-registry.d.ts.map +1 -1
  107. package/dist/components/related-content/index.cjs +4 -4
  108. package/dist/components/related-content/index.js +3 -3
  109. package/dist/components/tickets/index.cjs +10 -10
  110. package/dist/components/tickets/index.js +9 -9
  111. package/dist/components/ui/index.cjs +9 -5
  112. package/dist/components/ui/index.cjs.map +1 -1
  113. package/dist/components/ui/index.js +8 -4
  114. package/dist/index.cjs +13 -9
  115. package/dist/index.cjs.map +1 -1
  116. package/dist/index.js +12 -8
  117. package/dist/index.js.map +1 -1
  118. package/dist/types/marketing.d.ts +1 -1
  119. package/dist/types/marketing.d.ts.map +1 -1
  120. package/dist/utils/content-ref-groups.d.ts.map +1 -1
  121. package/dist/utils/index.cjs +5 -1
  122. package/dist/utils/index.cjs.map +1 -1
  123. package/dist/utils/index.js +5 -1
  124. package/dist/utils/index.js.map +1 -1
  125. package/dist/utils/list-url.d.ts.map +1 -1
  126. package/dist/utils/source-icons.d.ts.map +1 -1
  127. package/package.json +1 -1
  128. package/src/components/chat/entity-cards/ai-prompt-card.tsx +62 -0
  129. package/src/components/chat/entity-cards/dispatch.tsx +3 -1
  130. package/src/components/chat/entity-cards/index.ts +2 -0
  131. package/src/components/comment-card.tsx +27 -24
  132. package/src/components/comment-thread.tsx +212 -0
  133. package/src/components/index.ts +1 -0
  134. package/src/components/related-content/__tests__/card-registry.test.tsx +7 -0
  135. package/src/components/related-content/card-registry.tsx +20 -1
  136. package/src/types/marketing.ts +1 -0
  137. package/src/utils/__tests__/list-url.test.ts +1 -0
  138. package/src/utils/content-ref-groups.ts +1 -0
  139. package/src/utils/list-url.ts +1 -0
  140. package/src/utils/source-icons.ts +3 -0
  141. package/dist/chunk-6XJS3WU7.js.map +0 -1
  142. package/dist/chunk-7ZEQMFP3.cjs.map +0 -1
  143. package/dist/chunk-E2EGTHYA.cjs.map +0 -1
  144. package/dist/chunk-GBON2OCG.js.map +0 -1
  145. package/dist/chunk-GXUGYZ6H.js.map +0 -1
  146. package/dist/chunk-ROQTWRV7.cjs.map +0 -1
  147. /package/dist/{chunk-ANMD7SM4.js.map → chunk-3BNNYHP2.js.map} +0 -0
  148. /package/dist/{chunk-YCZBCEQO.js.map → chunk-3Z5ZIKDX.js.map} +0 -0
  149. /package/dist/{chunk-VRN5YYD3.js.map → chunk-5DUTXG6P.js.map} +0 -0
  150. /package/dist/{chunk-J25M43YI.js.map → chunk-D4ARG53E.js.map} +0 -0
  151. /package/dist/{chunk-IW746HJ7.js.map → chunk-FHR2JU2J.js.map} +0 -0
  152. /package/dist/{chunk-WVRXDGGP.js.map → chunk-HPIRQWNK.js.map} +0 -0
  153. /package/dist/{chunk-2DTZXXY3.js.map → chunk-I7RWVDN4.js.map} +0 -0
  154. /package/dist/{chunk-XUNFDRMP.js.map → chunk-J27HVNT2.js.map} +0 -0
  155. /package/dist/{chunk-GFWKEWEH.js.map → chunk-JA2SIJ7T.js.map} +0 -0
  156. /package/dist/{chunk-IPHA3AQ6.js.map → chunk-JBXNDB5U.js.map} +0 -0
  157. /package/dist/{chunk-CWMKY2UJ.js.map → chunk-LPGBA4UZ.js.map} +0 -0
  158. /package/dist/{chunk-5P74E24M.js.map → chunk-MJRXGAXS.js.map} +0 -0
  159. /package/dist/{chunk-GD7CV2JI.js.map → chunk-OD4JKGQG.js.map} +0 -0
  160. /package/dist/{chunk-NUU5ZEEG.js.map → chunk-RTC3H5RW.js.map} +0 -0
  161. /package/dist/{chunk-RROIA6WY.js.map → chunk-SKRI6QJ5.js.map} +0 -0
  162. /package/dist/{chunk-TSCIVH7T.js.map → chunk-VBIFSOPQ.js.map} +0 -0
  163. /package/dist/{chunk-UUXLDIK3.js.map → chunk-ZPJ6KYAW.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"list-url.d.ts","sourceRoot":"","sources":["../../src/utils/list-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAWH;;;;iEAIiE;AACjE,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAKtE;AAmED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,IAAI,SAAK,GAAG,MAAM,GAAG,IAAI,CAa5F"}
1
+ {"version":3,"file":"list-url.d.ts","sourceRoot":"","sources":["../../src/utils/list-url.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAWH;;;;iEAIiE;AACjE,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAKtE;AAoED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,IAAI,SAAK,GAAG,MAAM,GAAG,IAAI,CAa5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"source-icons.d.ts","sourceRoot":"","sources":["../../src/utils/source-icons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAoDpD,CAAC;AAEF;;6DAE6D;AAC7D,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGxF;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA0DzD,CAAC;AAEF;;kEAEkE;AAClE,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAoDpE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEjF"}
1
+ {"version":3,"file":"source-icons.d.ts","sourceRoot":"","sources":["../../src/utils/source-icons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqDpD,CAAC;AAEF;;6DAE6D;AAC7D,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGxF;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA2DzD,CAAC;AAEF;;kEAEkE;AAClE,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqDpE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEjF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flamingo-stack/openframe-frontend-core",
3
- "version": "0.0.618",
3
+ "version": "0.0.619-2160.6147.1",
4
4
  "description": "Shared design system and components for all Flamingo platforms",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,62 @@
1
+ import type React from 'react';
2
+ import { formatDateUTC } from '../../../utils/format';
3
+ import {
4
+ EmployeeEntryBadge,
5
+ EmployeeEntryCard,
6
+ type EmployeeEntryCardData,
7
+ EmployeeEntryCardSkeleton,
8
+ } from './employee-entry-card';
9
+
10
+ /** Minimal row shape the card renders. Both the hub dashboard entry and the
11
+ * related-content hydrated row satisfy it structurally. */
12
+ export interface AiPromptCardData extends EmployeeEntryCardData {
13
+ published_at?: string | null;
14
+ /** The department the prompt is for, surfaced as a badge (the library's filter axis). */
15
+ department?: { name?: string | null } | null;
16
+ /** How many steps the prompt has. A chain (more than one) is badged. */
17
+ step_count?: number | null;
18
+ }
19
+
20
+ export interface AiPromptCardProps {
21
+ entry: AiPromptCardData;
22
+ /** OG fallback cover. Caller computes it (hub: `useOgPlaceholderUrl`; related
23
+ * rail: `extras.buildOgPlaceholderUrl`). */
24
+ placeholderUrl?: string | null;
25
+ /** Owner action row (dashboard). Omit for a read-only card. */
26
+ actions?: React.ReactNode;
27
+ /** When provided, the WHOLE card becomes a link (related-rail click-through).
28
+ * Don't combine with `actions` (nested interactive). */
29
+ anchorProps?: React.AnchorHTMLAttributes<HTMLAnchorElement>;
30
+ className?: string;
31
+ }
32
+
33
+ /**
34
+ * THE single Squawkbox prompt card: a thin binding over `EmployeeEntryCard`
35
+ * that maps the publish date to the meta date and adds the department and step
36
+ * count badges. Used by the people-hub dashboard (with owner `actions`) and the
37
+ * related-content rail (with `anchorProps`), so the card cannot drift between them.
38
+ */
39
+ export function AiPromptCard({ entry, placeholderUrl, actions, anchorProps, className }: AiPromptCardProps) {
40
+ const department = entry.department?.name?.trim();
41
+ const steps = typeof entry.step_count === 'number' ? entry.step_count : 0;
42
+ return (
43
+ <EmployeeEntryCard
44
+ entry={entry}
45
+ dateLabel={entry.published_at ? formatDateUTC(entry.published_at, { fallback: '' }) || null : null}
46
+ extraBadges={
47
+ <>
48
+ {department ? <EmployeeEntryBadge>{department}</EmployeeEntryBadge> : null}
49
+ {steps > 1 ? <EmployeeEntryBadge>{`${steps} steps`}</EmployeeEntryBadge> : null}
50
+ </>
51
+ }
52
+ untitledLabel="Untitled prompt"
53
+ placeholderUrl={placeholderUrl}
54
+ actions={actions}
55
+ anchorProps={anchorProps}
56
+ className={className}
57
+ />
58
+ );
59
+ }
60
+
61
+ /** Loading skeleton matching AiPromptCard's shape (the shared employee-entry skeleton). */
62
+ export const AiPromptCardSkeleton = EmployeeEntryCardSkeleton;
@@ -53,6 +53,7 @@ import { PresentationLineIcon } from '../../icons-v2-generated/charts/presentati
53
53
  import { CodeIcon } from '../../icons-v2-generated/coding/code-icon';
54
54
  import { CodingCommitIcon } from '../../icons-v2-generated/coding/coding-commit-icon';
55
55
  import { CodingPullRequestIcon } from '../../icons-v2-generated/coding/coding-pull-request-icon';
56
+ import { ChatQuoteIcon } from '../../icons-v2-generated/communication/chat-quote-icon';
56
57
  import { CalendarIcon } from '../../icons-v2-generated/date-and-time/calendar-icon';
57
58
  import { ClipboardListIcon } from '../../icons-v2-generated/documents/clipboard-list-icon';
58
59
  import { FileContentIcon } from '../../icons-v2-generated/documents/file-content-icon';
@@ -1363,7 +1364,7 @@ function refGlyphRegistryEntries(): Record<string, ChatCardRegistryEntry> {
1363
1364
  }
1364
1365
 
1365
1366
  /** People-hub employee feeds hydrate from their EXISTING list APIs
1366
- * (`/api/what-i-shipped?ids=`, `/api/how-i-work?ids=`) — entry-shaped rows
1367
+ * (`/api/what-i-shipped?ids=`, `/api/how-i-work?ids=`, `/api/prompts?ids=`) — entry-shaped rows
1367
1368
  * (title / summary / author), not ChatRefs, hence the bespoke row→display
1368
1369
  * mapping (the FAQ precedent). The destination comes from the ref (the
1369
1370
  * server-resolved entry url) or, on a bare marker, the host's
@@ -1379,6 +1380,7 @@ function fetchedEmployeeEntryDisplayRef(item: unknown, chatRef: ChatRef): ChatRe
1379
1380
  const EMPLOYEE_ENTRY_CARD_CONFIGS: Record<string, GlyphCardConfig> = {
1380
1381
  what_i_shipped: { label: 'What I Shipped', icon: () => <Rocket02Icon size={24} /> },
1381
1382
  how_i_work: { label: 'How I Work', icon: () => <ClipboardListIcon size={24} /> },
1383
+ ai_prompt: { label: 'Squawkbox', icon: () => <ChatQuoteIcon size={24} /> },
1382
1384
  };
1383
1385
  function employeeEntryRegistryEntries(): Record<string, ChatCardRegistryEntry> {
1384
1386
  return registryEntries(EMPLOYEE_ENTRY_CARD_CONFIGS, (cfg, docType) => ({
@@ -25,6 +25,8 @@ export { WhatIShippedCard, WhatIShippedCardSkeleton } from './what-i-shipped-car
25
25
  export type { WhatIShippedCardData, WhatIShippedCardProps } from './what-i-shipped-card';
26
26
  export { HowIWorkCard, HowIWorkCardSkeleton } from './how-i-work-card';
27
27
  export type { HowIWorkCardData, HowIWorkCardProps } from './how-i-work-card';
28
+ export { AiPromptCard, AiPromptCardSkeleton } from './ai-prompt-card';
29
+ export type { AiPromptCardData, AiPromptCardProps } from './ai-prompt-card';
28
30
 
29
31
  // Moved-into-subdir flat cards
30
32
  export { BlockCard, type BlockCardProps } from './block-card';
@@ -6,33 +6,36 @@ import { Button } from './ui/button';
6
6
  import { UserSummary } from './user-summary-stub';
7
7
  import { VendorDisplayButton } from './vendor-display-button';
8
8
 
9
- interface CommentCardProps {
10
- comment: {
9
+ /** The comment shape every comment surface renders (vendor reviews, design-doc and prompt threads). */
10
+ export interface CommentCardComment {
11
+ id: string;
12
+ content: string;
13
+ title?: string;
14
+ type?: 'pro' | 'con';
15
+ importance?: 'Critical' | 'Important' | 'Nice-to-have';
16
+ createdAt: string;
17
+ vendor?: {
18
+ id: number;
19
+ title: string;
20
+ slug: string;
21
+ logo: string | null;
22
+ category?: string | null;
23
+ };
24
+ user?: {
11
25
  id: string;
12
- content: string;
13
- title?: string;
14
- type?: 'pro' | 'con';
15
- importance?: 'Critical' | 'Important' | 'Nice-to-have';
16
- createdAt: string;
17
- vendor?: {
18
- id: number;
19
- title: string;
20
- slug: string;
21
- logo: string | null;
22
- category?: string | null;
23
- };
24
- user?: {
25
- id: string;
26
- name: string;
27
- profilePicture: string | null;
28
- msp?: {
29
- id: string | number;
30
- name?: string | null;
31
- icon_url?: string | null;
32
- };
26
+ name: string;
27
+ profilePicture: string | null;
28
+ msp?: {
29
+ id: string | number;
30
+ name?: string | null;
31
+ icon_url?: string | null;
33
32
  };
34
- canDelete?: boolean;
35
33
  };
34
+ canDelete?: boolean;
35
+ }
36
+
37
+ interface CommentCardProps {
38
+ comment: CommentCardComment;
36
39
  onViewProduct?: (vendorSlug: string) => void;
37
40
  onDeleteComment?: (commentId: string) => void;
38
41
  /** @deprecated Superseded by `leadWith`; the component ignores it. */
@@ -0,0 +1,212 @@
1
+ 'use client';
2
+
3
+ import { ChevronDown } from 'lucide-react';
4
+ import { type ReactNode, useState } from 'react';
5
+ import { CommentCard, type CommentCardComment } from './comment-card';
6
+ import { CommentComposer } from './comment-composer';
7
+ import { Button } from './ui/button';
8
+
9
+ /** A root comment with its replies. Replies never nest further (single-level threads). */
10
+ export interface ThreadComment extends CommentCardComment {
11
+ replies?: CommentCardComment[];
12
+ }
13
+
14
+ export interface CommentThreadProps {
15
+ comments: ThreadComment[];
16
+ /** Shown when there is nothing to list. Omit to render nothing. */
17
+ emptyLabel?: ReactNode;
18
+ /**
19
+ * Post a reply to a ROOT comment. Resolve `false` to keep the typed reply (a
20
+ * failed post must never wipe the box). Omit and the thread is read-only.
21
+ */
22
+ onReply?: (parentId: string, body: string) => Promise<boolean | void> | boolean | void;
23
+ /** Delete a root or a reply. Each card's `canDelete` still decides whether the button shows. */
24
+ onDelete?: (commentId: string) => Promise<unknown> | void;
25
+ /** Surface badges on a root (a design doc's type + status). */
26
+ renderBadges?: (comment: ThreadComment) => ReactNode;
27
+ /** Surface actions on a root, after Reply (a design doc's Resolve / Decline / Reopen). */
28
+ renderActions?: (comment: ThreadComment) => ReactNode;
29
+ replyPlaceholder?: string;
30
+ pending?: boolean;
31
+ /** Which header each ROOT card leads with; replies always lead with the commenter. */
32
+ leadWith?: 'vendor' | 'commenter';
33
+ onViewProduct?: (vendorSlug: string) => void;
34
+ }
35
+
36
+ /**
37
+ * THE threaded comment list: root cards read in full, their replies indented
38
+ * beneath, and an inline reply composer per root.
39
+ *
40
+ * One component for every comment surface (design-doc sections and decision
41
+ * log, prompt library threads, vendor reviews), so reply behaviour, spacing and
42
+ * the keep-the-draft-on-failure rule cannot drift between them. Everything a
43
+ * surface owns (who may delete, which badges and settle actions a root carries)
44
+ * arrives through props; nothing in here knows about vocabularies or vendors.
45
+ */
46
+ export function CommentThread({
47
+ comments,
48
+ emptyLabel,
49
+ onReply,
50
+ onDelete,
51
+ renderBadges,
52
+ renderActions,
53
+ replyPlaceholder = 'Write a reply',
54
+ pending = false,
55
+ leadWith,
56
+ onViewProduct,
57
+ }: CommentThreadProps) {
58
+ if (comments.length === 0) {
59
+ return emptyLabel ? <p className="text-ods-text-secondary text-h6">{emptyLabel}</p> : null;
60
+ }
61
+ return (
62
+ <div className="flex flex-col gap-[var(--spacing-system-sf)]">
63
+ {comments.map(comment => (
64
+ <CommentThreadRow
65
+ key={comment.id}
66
+ comment={comment}
67
+ onReply={onReply}
68
+ onDelete={onDelete}
69
+ renderBadges={renderBadges}
70
+ renderActions={renderActions}
71
+ replyPlaceholder={replyPlaceholder}
72
+ pending={pending}
73
+ leadWith={leadWith}
74
+ onViewProduct={onViewProduct}
75
+ />
76
+ ))}
77
+ </div>
78
+ );
79
+ }
80
+
81
+ function CommentThreadRow({
82
+ comment,
83
+ onReply,
84
+ onDelete,
85
+ renderBadges,
86
+ renderActions,
87
+ replyPlaceholder,
88
+ pending,
89
+ leadWith,
90
+ onViewProduct,
91
+ }: Omit<CommentThreadProps, 'comments' | 'emptyLabel'> & { comment: ThreadComment }) {
92
+ const [replyOpen, setReplyOpen] = useState(false);
93
+ const replies = comment.replies ?? [];
94
+ const actions = renderActions?.(comment);
95
+ const footer: ReactNode = (
96
+ <>
97
+ {renderBadges?.(comment)}
98
+ {replies.length > 0 ? (
99
+ <span className="text-ods-text-secondary text-h6">
100
+ {replies.length} {replies.length === 1 ? 'reply' : 'replies'}
101
+ </span>
102
+ ) : null}
103
+ {onReply || actions ? (
104
+ <span className="ml-auto flex flex-wrap gap-[var(--spacing-system-xsf)]">
105
+ {onReply ? (
106
+ <Button
107
+ type="button"
108
+ variant="outline"
109
+ size="small-legacy"
110
+ onClick={() => setReplyOpen(open => !open)}
111
+ disabled={pending}
112
+ >
113
+ Reply
114
+ </Button>
115
+ ) : null}
116
+ {actions}
117
+ </span>
118
+ ) : null}
119
+ </>
120
+ );
121
+
122
+ return (
123
+ <CommentCard
124
+ fullBody
125
+ comment={comment}
126
+ leadWith={leadWith}
127
+ onViewProduct={onViewProduct}
128
+ onDeleteComment={onDelete ? id => void onDelete(id) : undefined}
129
+ footer={footer}
130
+ >
131
+ {replies.length > 0 || replyOpen ? (
132
+ <div className="ml-[var(--spacing-system-lf)] mt-[var(--spacing-system-xsf)] flex flex-col gap-[var(--spacing-system-xsf)] border-l border-ods-border pl-[var(--spacing-system-sf)]">
133
+ {replies.map(reply => (
134
+ <CommentCard
135
+ key={reply.id}
136
+ fullBody
137
+ compact
138
+ comment={reply}
139
+ onDeleteComment={onDelete ? id => void onDelete(id) : undefined}
140
+ />
141
+ ))}
142
+ {replyOpen && onReply ? (
143
+ <CommentComposer
144
+ pending={pending}
145
+ onCancel={() => setReplyOpen(false)}
146
+ submitLabel="Reply"
147
+ ariaLabel="Reply"
148
+ placeholder={replyPlaceholder}
149
+ onSubmit={async ({ body }) => {
150
+ const ok = await onReply(comment.id, body);
151
+ if (ok === false) return false;
152
+ setReplyOpen(false);
153
+ return true;
154
+ }}
155
+ />
156
+ ) : null}
157
+ </div>
158
+ ) : null}
159
+ </CommentCard>
160
+ );
161
+ }
162
+
163
+ export interface CommentsBlockProps {
164
+ /** Header label, e.g. "Comments". */
165
+ title: string;
166
+ /** Readable while collapsed: "2 open · 1 closed", "3 comments". */
167
+ summary: string;
168
+ /** Start expanded. A later flip to `true` (new activity) expands it again. */
169
+ defaultOpen?: boolean;
170
+ /** The list (usually a `CommentThread`) plus anything under it. */
171
+ children: ReactNode;
172
+ /** The root composer, rendered last while expanded. */
173
+ composer?: ReactNode;
174
+ }
175
+
176
+ /**
177
+ * THE collapsible comments section: a chevron header carrying the thread's
178
+ * summary, then the thread and the root composer. Collapsing is for threads
179
+ * with nothing left to act on; a host passes `defaultOpen` whenever there is
180
+ * (content behind an accordion is content readers miss).
181
+ */
182
+ export function CommentsBlock({ title, summary, defaultOpen = false, children, composer }: CommentsBlockProps) {
183
+ const [open, setOpen] = useState(defaultOpen);
184
+ // New activity AFTER mount (a colleague's comment arrives) flips `defaultOpen`
185
+ // to true and must expand the block; collapsing again stays the reader's call.
186
+ // Adjusted during render, React's pattern for state that follows a prop.
187
+ const [seenDefaultOpen, setSeenDefaultOpen] = useState(defaultOpen);
188
+ if (defaultOpen !== seenDefaultOpen) {
189
+ setSeenDefaultOpen(defaultOpen);
190
+ if (defaultOpen) setOpen(true);
191
+ }
192
+ return (
193
+ <div className="space-y-[var(--spacing-system-sf)]">
194
+ <Button
195
+ type="button"
196
+ variant="transparent"
197
+ size="small-legacy"
198
+ className="px-0 text-ods-text-secondary hover:text-ods-text-primary"
199
+ onClick={() => setOpen(value => !value)}
200
+ rightIcon={<ChevronDown className={`h-4 w-4 transition-transform ${open ? 'rotate-180' : ''}`} />}
201
+ >
202
+ {`${title} · ${summary}`}
203
+ </Button>
204
+ {open ? (
205
+ <>
206
+ {children}
207
+ {composer}
208
+ </>
209
+ ) : null}
210
+ </div>
211
+ );
212
+ }
@@ -17,6 +17,7 @@ export * from './categories-cart';
17
17
  export * from './category-card';
18
18
  export * from './comment-card';
19
19
  export * from './comment-composer';
20
+ export * from './comment-thread';
20
21
  export * from './content-loading-container';
21
22
  export * from './dynamic-skeleton';
22
23
  export * from './empty-state';
@@ -63,6 +63,13 @@ const ROWS: Record<string, unknown> = {
63
63
  onboarding_guide: { id: 'g1', title: 'Guide Title', section: 'Start', step_order: 1, content: 'c' },
64
64
  what_i_shipped: { title: 'Shipped Title', summary: 's', entry_month: '2026-01-01' },
65
65
  how_i_work: { title: 'How Title', summary: 's', session_date: '2026-01-01' },
66
+ ai_prompt: {
67
+ title: 'Prompt Title',
68
+ summary: 's',
69
+ published_at: '2026-01-01',
70
+ department: { name: 'Sales' },
71
+ step_count: 2,
72
+ },
66
73
  roadmap_item: { id: 'r1', title: 'Roadmap Title', description: 'd', status: 'open', quarter: 'Q1' },
67
74
  };
68
75
 
@@ -48,6 +48,7 @@ import type { CustomerInterview } from '../../types/customer-interview';
48
48
  import type { EntityAuthor } from '../../types/entity-author';
49
49
  import type { MSP } from '../../types/stack';
50
50
  import type { UserProfile } from '../../types/user';
51
+ import { AiPromptCard, AiPromptCardSkeleton, type AiPromptCardData } from '../chat/entity-cards/ai-prompt-card';
51
52
  // DEEP card imports — NOT the `../chat` barrel. See the import note in
52
53
  // `related-content-section.tsx`: the barrel statically reaches
53
54
  // @tanstack/react-query, deep paths keep this module's source graph free of it.
@@ -511,8 +512,10 @@ function decodeProgramRow(row: unknown): BaseProgramItem & Record<string, unknow
511
512
  /** The two employee-entry cards already declare MINIMAL row shapes
512
513
  * (`EmployeeEntryCardData` + one date column each), so their decoders read
513
514
  * exactly the card's fields with nothing left over. */
514
- function decodeEmployeeEntryRow(row: unknown): WhatIShippedCardData & HowIWorkCardData {
515
+ function decodeEmployeeEntryRow(row: unknown): WhatIShippedCardData & HowIWorkCardData & AiPromptCardData {
515
516
  const record = asRecord(row);
517
+ const department = asRecord(record.department);
518
+ const stepCount = record.step_count;
516
519
  return {
517
520
  title: strOrNull(record, 'title'),
518
521
  summary: strOrNull(record, 'summary'),
@@ -523,6 +526,9 @@ function decodeEmployeeEntryRow(row: unknown): WhatIShippedCardData & HowIWorkCa
523
526
  entry_month: strOrNull(record, 'entry_month'),
524
527
  session_date: strOrNull(record, 'session_date'),
525
528
  discipline: strOrNull(record, 'discipline'),
529
+ published_at: strOrNull(record, 'published_at'),
530
+ department: record.department ? { name: strOrNull(department, 'name') } : null,
531
+ step_count: typeof stepCount === 'number' ? stepCount : null,
526
532
  };
527
533
  }
528
534
 
@@ -770,6 +776,19 @@ export const RELATED_CARD_REGISTRY: Record<string, RelatedCardRegistryEntry> = {
770
776
  ),
771
777
  }),
772
778
 
779
+ /** Same shared employee-entry shape + anchor contract as What I Shipped. */
780
+ ai_prompt: cardEntry({
781
+ skeleton: () => <AiPromptCardSkeleton />,
782
+ decode: decodeEmployeeEntryRow,
783
+ render: (entry, ctx) => (
784
+ <AiPromptCard
785
+ entry={entry}
786
+ placeholderUrl={ctx.placeholderUrl}
787
+ anchorProps={ctx.linkProps ?? (ctx.href ? { href: ctx.href, ...ctx.anchorAttrs } : undefined)}
788
+ />
789
+ ),
790
+ }),
791
+
773
792
  roadmap_item: roadmapEntry('roadmap_item'),
774
793
  delivery_item: roadmapEntry('delivery_item'),
775
794
  internal_task: roadmapEntry('internal_task'),
@@ -368,6 +368,7 @@ export type ContentSourceType =
368
368
  | 'walkthrough_video' // Per-platform floating demo video (no slug, no detail page; URL is the platform home)
369
369
  | 'what_i_shipped' // What I Shipped employee check-ins (lives on people-hub)
370
370
  | 'how_i_work' // How I Work employee AI-workflow sessions (lives on people-hub)
371
+ | 'ai_prompt' // Squawkbox prompt library entries (lives on people-hub)
371
372
  | 'faq' // FAQ Q&A pair (single-page /faqs index; deep-link by category anchor)
372
373
  | 'design_doc' // Internal design docs (product-hub admin; preview route only, no public page)
373
374
  | 'from_scratch';
@@ -52,6 +52,7 @@ const BASELINE: Record<string, string> = {
52
52
  // product-hub design docs + tenants via per-object card routes).
53
53
  what_i_shipped: '/api/what-i-shipped?ids=a,b&limit=2',
54
54
  how_i_work: '/api/how-i-work?ids=a,b&limit=2',
55
+ ai_prompt: '/api/prompts?ids=a,b&limit=2',
55
56
  design_doc: '/api/design-docs?ids=a,b',
56
57
  openframe_tenant: '/api/openframe-tenants?ids=a,b',
57
58
  };
@@ -55,6 +55,7 @@ export const CONTENT_REF_GROUPS: Record<string, ContentRefGroupConfig> = {
55
55
  onboarding_guide: { label: 'Onboarding Guides', order: 9, layout: 'list', gridSize: 'default' },
56
56
  what_i_shipped: { label: 'What I Shipped', order: 10, layout: 'grid', gridSize: 'default' },
57
57
  how_i_work: { label: 'How I Work', order: 11, layout: 'grid', gridSize: 'default' },
58
+ ai_prompt: { label: 'Squawkbox', order: 12, layout: 'grid', gridSize: 'default' },
58
59
  };
59
60
 
60
61
  /** Human-readable label for a content_ref `type`. Returns null when the type
@@ -108,6 +108,7 @@ const BUILDERS: Record<string, (ids: string[], base: string) => string> = {
108
108
  // the related-content rail + author page), entry-shaped rows.
109
109
  what_i_shipped: (ids, b) => `${b}/api/what-i-shipped?ids=${ids.join(',')}&limit=${ids.length}`,
110
110
  how_i_work: (ids, b) => `${b}/api/how-i-work?ids=${ids.join(',')}&limit=${ids.length}`,
111
+ ai_prompt: (ids, b) => `${b}/api/prompts?ids=${ids.join(',')}&limit=${ids.length}`,
111
112
  // Product-hub internal objects — per-object card-hydration routes
112
113
  // (ChatRef-shaped items, `handleEntityCardList`), like github / slack.
113
114
  design_doc: (ids, b) => `${b}/api/design-docs?ids=${ids.join(',')}`,
@@ -73,6 +73,7 @@ export const SOURCE_ICON_NAMES: Record<string, string> = {
73
73
  // People-hub employee content
74
74
  'what-i-shipped': 'package',
75
75
  'how-i-work': 'book-open',
76
+ 'ai-prompts': 'message-square',
76
77
 
77
78
  // Product-hub internal
78
79
  'design-docs': 'file-text',
@@ -153,6 +154,7 @@ export const SOURCE_LABELS_BY_TABLE: Record<string, string> = {
153
154
  // People-hub employee content
154
155
  'what-i-shipped': 'What I Shipped',
155
156
  'how-i-work': 'How I Work',
157
+ 'ai-prompts': 'Squawkbox',
156
158
 
157
159
  // Product-hub internal
158
160
  'design-docs': 'Design Docs',
@@ -235,6 +237,7 @@ export const DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID: Record<string, string> = {
235
237
  // People-hub employee content
236
238
  what_i_shipped: 'what-i-shipped',
237
239
  how_i_work: 'how-i-work',
240
+ ai_prompt: 'ai-prompts',
238
241
 
239
242
  // Product-hub internal
240
243
  design_doc: 'design-docs',