@flamingo-stack/openframe-frontend-core 0.0.244 → 0.0.245

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 (131) hide show
  1. package/dist/{chunk-DV3YZWGN.cjs → chunk-3TDLFCCS.cjs} +33 -20
  2. package/dist/chunk-3TDLFCCS.cjs.map +1 -0
  3. package/dist/{chunk-ORJREQ2W.js → chunk-4XLJWX2N.js} +4 -4
  4. package/dist/{chunk-P5C732SC.js → chunk-7ZHFCEJH.js} +6 -6
  5. package/dist/{chunk-EJ7J4QAD.cjs → chunk-BKPS6M2F.cjs} +12 -12
  6. package/dist/{chunk-EJ7J4QAD.cjs.map → chunk-BKPS6M2F.cjs.map} +1 -1
  7. package/dist/{chunk-EPXROXYC.cjs → chunk-CZITXP77.cjs} +645 -713
  8. package/dist/chunk-CZITXP77.cjs.map +1 -0
  9. package/dist/{chunk-Z6GGYZDR.cjs → chunk-DUZBTUXF.cjs} +27 -27
  10. package/dist/{chunk-Z6GGYZDR.cjs.map → chunk-DUZBTUXF.cjs.map} +1 -1
  11. package/dist/{chunk-M7DPUWAL.js → chunk-FRRMXLU5.js} +120 -188
  12. package/dist/chunk-FRRMXLU5.js.map +1 -0
  13. package/dist/chunk-GIDH6UL4.js +287 -0
  14. package/dist/chunk-GIDH6UL4.js.map +1 -0
  15. package/dist/{chunk-PTSAF7T2.js → chunk-JJV3XGCY.js} +2 -2
  16. package/dist/{chunk-APGMNHPY.js → chunk-MKVKVJQQ.js} +32 -19
  17. package/dist/chunk-MKVKVJQQ.js.map +1 -0
  18. package/dist/chunk-ML2ROCYA.cjs +287 -0
  19. package/dist/chunk-ML2ROCYA.cjs.map +1 -0
  20. package/dist/{chunk-STKMIMLP.cjs → chunk-MP5HOP7N.cjs} +12 -12
  21. package/dist/{chunk-STKMIMLP.cjs.map → chunk-MP5HOP7N.cjs.map} +1 -1
  22. package/dist/{chunk-NKGNRFSS.js → chunk-SEVJT2HP.js} +8 -8
  23. package/dist/{chunk-FSS2MIEA.cjs → chunk-SGJBUL2Y.cjs} +20 -3
  24. package/dist/chunk-SGJBUL2Y.cjs.map +1 -0
  25. package/dist/{chunk-WD2MZVJI.js → chunk-V35PZSUA.js} +5 -5
  26. package/dist/{chunk-LJGBFD52.js → chunk-VAUI3CND.js} +18 -1
  27. package/dist/chunk-VAUI3CND.js.map +1 -0
  28. package/dist/{chunk-OB45JHDY.cjs → chunk-VFKQMAUF.cjs} +3 -3
  29. package/dist/{chunk-OB45JHDY.cjs.map → chunk-VFKQMAUF.cjs.map} +1 -1
  30. package/dist/{chunk-RJC3L5DT.cjs → chunk-VXP553WT.cjs} +7 -7
  31. package/dist/{chunk-RJC3L5DT.cjs.map → chunk-VXP553WT.cjs.map} +1 -1
  32. package/dist/components/chat/chat-message-list.d.ts.map +1 -1
  33. package/dist/components/chat/hooks/use-chat-card-item.d.ts.map +1 -1
  34. package/dist/components/chat/index.cjs +6 -16
  35. package/dist/components/chat/index.cjs.map +1 -1
  36. package/dist/components/chat/index.js +5 -15
  37. package/dist/components/chat/types/entities/content-ref.d.ts +5 -20
  38. package/dist/components/chat/types/entities/content-ref.d.ts.map +1 -1
  39. package/dist/components/chat/utils/index.d.ts +0 -1
  40. package/dist/components/chat/utils/index.d.ts.map +1 -1
  41. package/dist/components/contact/index.cjs +7 -7
  42. package/dist/components/contact/index.js +6 -6
  43. package/dist/components/faq/faq-section.d.ts +7 -1
  44. package/dist/components/faq/faq-section.d.ts.map +1 -1
  45. package/dist/components/faq/index.cjs +3 -3
  46. package/dist/components/faq/index.js +2 -2
  47. package/dist/components/features/index.cjs +6 -6
  48. package/dist/components/features/index.js +5 -5
  49. package/dist/components/features/policy-configuration-panel.d.ts.map +1 -1
  50. package/dist/components/index.cjs +87 -93
  51. package/dist/components/index.cjs.map +1 -1
  52. package/dist/components/index.d.ts +1 -0
  53. package/dist/components/index.d.ts.map +1 -1
  54. package/dist/components/index.js +31 -37
  55. package/dist/components/index.js.map +1 -1
  56. package/dist/components/navigation/index.cjs +6 -6
  57. package/dist/components/navigation/index.js +5 -5
  58. package/dist/components/onboarding-guides/index.cjs +30 -30
  59. package/dist/components/onboarding-guides/index.cjs.map +1 -1
  60. package/dist/components/onboarding-guides/index.js +11 -11
  61. package/dist/components/related-content/index.cjs +26 -0
  62. package/dist/components/related-content/index.cjs.map +1 -0
  63. package/dist/components/related-content/index.d.ts +2 -0
  64. package/dist/components/related-content/index.d.ts.map +1 -0
  65. package/dist/components/related-content/index.js +26 -0
  66. package/dist/components/related-content/index.js.map +1 -0
  67. package/dist/components/related-content/related-content-section.d.ts +149 -0
  68. package/dist/components/related-content/related-content-section.d.ts.map +1 -0
  69. package/dist/components/tickets/index.cjs +73 -73
  70. package/dist/components/tickets/index.cjs.map +1 -1
  71. package/dist/components/tickets/index.js +15 -15
  72. package/dist/components/ui/index.cjs +9 -19
  73. package/dist/components/ui/index.cjs.map +1 -1
  74. package/dist/components/ui/index.js +13 -23
  75. package/dist/embed-shims/index.cjs +3 -3
  76. package/dist/embed-shims/index.cjs.map +1 -1
  77. package/dist/embed-shims/index.js +5 -5
  78. package/dist/index.cjs +17 -11
  79. package/dist/index.cjs.map +1 -1
  80. package/dist/index.js +55 -49
  81. package/dist/types/content-ref.d.ts +35 -0
  82. package/dist/types/content-ref.d.ts.map +1 -0
  83. package/dist/types/index.d.ts +1 -0
  84. package/dist/types/index.d.ts.map +1 -1
  85. package/dist/utils/content-ref-groups.d.ts +58 -0
  86. package/dist/utils/content-ref-groups.d.ts.map +1 -0
  87. package/dist/utils/extract-items.d.ts +18 -0
  88. package/dist/utils/extract-items.d.ts.map +1 -0
  89. package/dist/utils/index.cjs +81 -0
  90. package/dist/utils/index.cjs.map +1 -1
  91. package/dist/utils/index.d.ts +4 -1
  92. package/dist/utils/index.d.ts.map +1 -1
  93. package/dist/utils/index.js +74 -1
  94. package/dist/utils/index.js.map +1 -1
  95. package/dist/utils/list-url.d.ts +6 -0
  96. package/dist/utils/list-url.d.ts.map +1 -1
  97. package/dist/utils/suggestion-url.d.ts +26 -0
  98. package/dist/utils/suggestion-url.d.ts.map +1 -0
  99. package/package.json +7 -1
  100. package/src/components/chat/chat-message-list.tsx +49 -74
  101. package/src/components/chat/hooks/use-chat-card-item.ts +3 -38
  102. package/src/components/chat/types/entities/content-ref.ts +5 -21
  103. package/src/components/chat/utils/index.ts +0 -12
  104. package/src/components/faq/faq-section.tsx +69 -24
  105. package/src/components/features/policy-configuration-panel.tsx +0 -1
  106. package/src/components/index.ts +1 -0
  107. package/src/components/related-content/index.ts +9 -0
  108. package/src/components/related-content/related-content-section.tsx +630 -0
  109. package/src/types/content-ref.ts +34 -0
  110. package/src/types/index.ts +1 -0
  111. package/src/utils/content-ref-groups.ts +89 -0
  112. package/src/utils/extract-items.ts +48 -0
  113. package/src/utils/index.ts +16 -1
  114. package/src/utils/list-url.ts +9 -0
  115. package/src/utils/suggestion-url.ts +39 -0
  116. package/dist/chunk-APGMNHPY.js.map +0 -1
  117. package/dist/chunk-DV3YZWGN.cjs.map +0 -1
  118. package/dist/chunk-EPXROXYC.cjs.map +0 -1
  119. package/dist/chunk-FSS2MIEA.cjs.map +0 -1
  120. package/dist/chunk-LJGBFD52.js.map +0 -1
  121. package/dist/chunk-M7DPUWAL.js.map +0 -1
  122. package/dist/components/chat/utils/history-merge.d.ts +0 -92
  123. package/dist/components/chat/utils/history-merge.d.ts.map +0 -1
  124. package/src/components/chat/__tests__/chat-message-list.test.tsx +0 -92
  125. package/src/components/chat/utils/__tests__/history-merge.test.ts +0 -339
  126. package/src/components/chat/utils/history-merge.ts +0 -255
  127. /package/dist/{chunk-ORJREQ2W.js.map → chunk-4XLJWX2N.js.map} +0 -0
  128. /package/dist/{chunk-P5C732SC.js.map → chunk-7ZHFCEJH.js.map} +0 -0
  129. /package/dist/{chunk-PTSAF7T2.js.map → chunk-JJV3XGCY.js.map} +0 -0
  130. /package/dist/{chunk-NKGNRFSS.js.map → chunk-SEVJT2HP.js.map} +0 -0
  131. /package/dist/{chunk-WD2MZVJI.js.map → chunk-V35PZSUA.js.map} +0 -0
package/dist/index.js CHANGED
@@ -100,6 +100,7 @@ import {
100
100
  COMPACT_CARD_TITLE_ROW,
101
101
  COMPACT_HEADER_BUTTON,
102
102
  CONNECTION_STATUS,
103
+ CONTENT_REF_GROUPS,
103
104
  CUSTOM_ITEM_ID,
104
105
  CUSTOM_PRESET_KEY,
105
106
  CampaignCardAdmin,
@@ -416,7 +417,6 @@ import {
416
417
  SHELL_TYPES,
417
418
  SOURCE_ICON_NAMES,
418
419
  SOURCE_LABELS_BY_TABLE,
419
- SYNTHETIC_REALTIME_ID_PREFIXES,
420
420
  ScriptArguments,
421
421
  ScriptInfoSection,
422
422
  SearchInput,
@@ -546,13 +546,13 @@ import {
546
546
  buildListUrl,
547
547
  buildNatsWsUrl,
548
548
  buildProductReleaseCardProps,
549
+ canonicalContentRefType,
549
550
  changelogLabels,
550
551
  chatChipClass,
551
552
  cleanEmailDomain,
552
553
  clearEmbedProxyAuth,
553
554
  clickupTaskUrl,
554
555
  columnFromTicketStatus,
555
- computeHistoryPrepend,
556
556
  computeIsNewTab,
557
557
  createColumnHelper,
558
558
  createMessageSegmentAccumulator,
@@ -575,12 +575,13 @@ import {
575
575
  extractErrorMessages,
576
576
  extractImageEdgeColorAsync,
577
577
  extractIncompleteMessageState,
578
+ extractItemId,
579
+ extractItems,
578
580
  extractTextFromChunk,
579
581
  extractYouTubeId,
580
582
  fetchPriorityProp,
581
583
  fetchSlashCommands,
582
584
  flattenAssistantContent,
583
- flattenMessagePagesChronological,
584
585
  flexRender,
585
586
  formatAbbreviatedNumber,
586
587
  formatAbsoluteDate,
@@ -629,6 +630,8 @@ import {
629
630
  getConfidenceLabel,
630
631
  getConfidenceLevel,
631
632
  getConfidenceTextClass,
633
+ getContentRefLabel,
634
+ getContentRefLabelOrTitleCase,
632
635
  getContrastRatio,
633
636
  getCoreRowModel,
634
637
  getCountryByCode,
@@ -690,8 +693,6 @@ import {
690
693
  isWithinMinutes,
691
694
  kindToCanonicalStatus,
692
695
  makeComposeContentUrl,
693
- maxPersistedStreamSeq,
694
- mergeHistoryWithRealtime,
695
696
  multiSelectFilterFn,
696
697
  nameInitials,
697
698
  navigationMenuTriggerStyle,
@@ -702,6 +703,7 @@ import {
702
703
  normalizeOSType,
703
704
  normalizeToolType,
704
705
  normalizeToolTypeWithFallback,
706
+ orderContentRefTypes,
705
707
  osLabels,
706
708
  parseChunkToAction,
707
709
  parseScrollAnchor,
@@ -778,45 +780,7 @@ import {
778
780
  validateEmailDomain,
779
781
  validateEmailDomainList,
780
782
  validatePhoneNumber
781
- } from "./chunk-M7DPUWAL.js";
782
- import "./chunk-4YKGXZ7W.js";
783
- import "./chunk-LXC6P2EO.js";
784
- import "./chunk-EL5YVPD5.js";
785
- import {
786
- ChevronButton
787
- } from "./chunk-LJGBFD52.js";
788
- import {
789
- Button,
790
- Checkbox,
791
- DropdownMenu,
792
- DropdownMenuCheckboxItem,
793
- DropdownMenuContent,
794
- DropdownMenuGroup,
795
- DropdownMenuItem,
796
- DropdownMenuLabel,
797
- DropdownMenuPortal,
798
- DropdownMenuRadioGroup,
799
- DropdownMenuRadioItem,
800
- DropdownMenuSeparator,
801
- DropdownMenuShortcut,
802
- DropdownMenuSub,
803
- DropdownMenuSubContent,
804
- DropdownMenuSubTrigger,
805
- DropdownMenuTrigger,
806
- FieldWrapper,
807
- Input,
808
- Skeleton,
809
- SkeletonButton,
810
- SkeletonCard,
811
- SkeletonGrid,
812
- SkeletonHeading,
813
- SkeletonList,
814
- SkeletonNavigation,
815
- SkeletonText,
816
- SplitButton,
817
- buttonVariants
818
- } from "./chunk-AGU44B7B.js";
819
- import "./chunk-OHPI2HRK.js";
783
+ } from "./chunk-FRRMXLU5.js";
820
784
  import {
821
785
  CommandApprovalToast,
822
786
  DEFAULT_MIN_FILL_MS,
@@ -912,8 +876,47 @@ import {
912
876
  validateVariables,
913
877
  variablesToUrlParams
914
878
  } from "./chunk-UECRKCKH.js";
879
+ import "./chunk-4YKGXZ7W.js";
915
880
  import "./chunk-MJNXIEV2.js";
881
+ import "./chunk-LXC6P2EO.js";
882
+ import "./chunk-EL5YVPD5.js";
916
883
  import "./chunk-PLJLE4A4.js";
884
+ import {
885
+ ChevronButton,
886
+ buildSuggestionUrl
887
+ } from "./chunk-VAUI3CND.js";
888
+ import {
889
+ Button,
890
+ Checkbox,
891
+ DropdownMenu,
892
+ DropdownMenuCheckboxItem,
893
+ DropdownMenuContent,
894
+ DropdownMenuGroup,
895
+ DropdownMenuItem,
896
+ DropdownMenuLabel,
897
+ DropdownMenuPortal,
898
+ DropdownMenuRadioGroup,
899
+ DropdownMenuRadioItem,
900
+ DropdownMenuSeparator,
901
+ DropdownMenuShortcut,
902
+ DropdownMenuSub,
903
+ DropdownMenuSubContent,
904
+ DropdownMenuSubTrigger,
905
+ DropdownMenuTrigger,
906
+ FieldWrapper,
907
+ Input,
908
+ Skeleton,
909
+ SkeletonButton,
910
+ SkeletonCard,
911
+ SkeletonGrid,
912
+ SkeletonHeading,
913
+ SkeletonList,
914
+ SkeletonNavigation,
915
+ SkeletonText,
916
+ SplitButton,
917
+ buttonVariants
918
+ } from "./chunk-AGU44B7B.js";
919
+ import "./chunk-OHPI2HRK.js";
917
920
  import {
918
921
  AboutIcon,
919
922
  AiRobotIcon,
@@ -1192,6 +1195,7 @@ export {
1192
1195
  COMPACT_CARD_TITLE_ROW,
1193
1196
  COMPACT_HEADER_BUTTON,
1194
1197
  CONNECTION_STATUS,
1198
+ CONTENT_REF_GROUPS,
1195
1199
  CUSTOM_ITEM_ID,
1196
1200
  CUSTOM_PRESET_KEY,
1197
1201
  CampaignCardAdmin,
@@ -1637,7 +1641,6 @@ export {
1637
1641
  SOURCE_ICON_NAMES,
1638
1642
  SOURCE_LABELS_BY_TABLE,
1639
1643
  SSOConfigurationIcon,
1640
- SYNTHETIC_REALTIME_ID_PREFIXES,
1641
1644
  ScriptArguments,
1642
1645
  ScriptGenerationIcon,
1643
1646
  ScriptIcon,
@@ -1815,7 +1818,9 @@ export {
1815
1818
  buildListUrl,
1816
1819
  buildNatsWsUrl,
1817
1820
  buildProductReleaseCardProps,
1821
+ buildSuggestionUrl,
1818
1822
  buttonVariants,
1823
+ canonicalContentRefType,
1819
1824
  changelogLabels,
1820
1825
  embedAuthedFetch as chatAuthedFetch,
1821
1826
  chatChipClass,
@@ -1827,7 +1832,6 @@ export {
1827
1832
  cn,
1828
1833
  coerceValue,
1829
1834
  columnFromTicketStatus,
1830
- computeHistoryPrepend,
1831
1835
  computeIsNewTab,
1832
1836
  configureAuthenticatedImage,
1833
1837
  configureBatchImageFetch,
@@ -1857,13 +1861,14 @@ export {
1857
1861
  extractHumanitySignals,
1858
1862
  extractImageEdgeColorAsync,
1859
1863
  extractIncompleteMessageState,
1864
+ extractItemId,
1865
+ extractItems,
1860
1866
  extractTextFromChunk,
1861
1867
  extractVariablesFromQuery,
1862
1868
  extractYouTubeId,
1863
1869
  fetchPriorityProp,
1864
1870
  fetchSlashCommands,
1865
1871
  flattenAssistantContent,
1866
- flattenMessagePagesChronological,
1867
1872
  flattenQueryVariables,
1868
1873
  flexRender,
1869
1874
  formatAbbreviatedNumber,
@@ -1917,6 +1922,8 @@ export {
1917
1922
  getConfidenceLabel,
1918
1923
  getConfidenceLevel,
1919
1924
  getConfidenceTextClass,
1925
+ getContentRefLabel,
1926
+ getContentRefLabelOrTitleCase,
1920
1927
  getContrastRatio,
1921
1928
  getCoreRowModel,
1922
1929
  getCountryByCode,
@@ -1995,9 +2002,7 @@ export {
1995
2002
  isWithinMinutes,
1996
2003
  kindToCanonicalStatus,
1997
2004
  makeComposeContentUrl,
1998
- maxPersistedStreamSeq,
1999
2005
  mergeDefaults,
2000
- mergeHistoryWithRealtime,
2001
2006
  mergeVariables,
2002
2007
  multiSelectFilterFn,
2003
2008
  nameInitials,
@@ -2009,6 +2014,7 @@ export {
2009
2014
  normalizeOSType,
2010
2015
  normalizeToolType,
2011
2016
  normalizeToolTypeWithFallback,
2017
+ orderContentRefTypes,
2012
2018
  osLabels,
2013
2019
  parseChunkToAction,
2014
2020
  parseScrollAnchor,
@@ -0,0 +1,35 @@
1
+ /**
2
+ * ContentRef — the unified link/embed shape stored in JSONB columns
3
+ * across investor updates, performance baselines, and any other entity
4
+ * that surfaces "related content" rails.
5
+ *
6
+ * Lifted from `lib/data/investor-update-utils-shared.ts` in the hub
7
+ * (the server-side data utils in the same file stay hub-side; only the
8
+ * TYPE moves here). RELOCATED from `components/chat/types/entities/`
9
+ * to this server-safe home when `RelatedContentSection` moved into the
10
+ * lib — the chat path re-exports from here, so there is exactly ONE
11
+ * `ContentRef` definition package-wide.
12
+ */
13
+ export interface ContentRef {
14
+ type: string;
15
+ id: string;
16
+ slug: string;
17
+ url: string;
18
+ targetPlatform?: string | null;
19
+ title: string;
20
+ summary?: string;
21
+ image_url?: string;
22
+ image_bg_color?: string;
23
+ visibility: 'public' | 'internal';
24
+ display_order: number;
25
+ }
26
+ /**
27
+ * A ContentRef as returned by the suggestion service (`/api/related-content`)
28
+ * — carries the 5-tier engine's placement reason. Widened to `string` here
29
+ * (the narrow reason union is hub-server vocabulary); data-only, never
30
+ * rendered by the rail.
31
+ */
32
+ export type ContentRefWithReason = ContentRef & {
33
+ reason: string;
34
+ };
35
+ //# sourceMappingURL=content-ref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-ref.d.ts","sourceRoot":"","sources":["../../src/types/content-ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,QAAQ,GAAG,UAAU,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -22,6 +22,7 @@ export * from './user';
22
22
  export * from './slack';
23
23
  export * from './waitlist';
24
24
  export * from './faq';
25
+ export * from './content-ref';
25
26
  export * from './report';
26
27
  export * from './stack';
27
28
  export * from './navigation';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAA;AAC9B,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACtF,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,IAAI,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAGjK,cAAc,YAAY,CAAA;AAG1B,cAAc,QAAQ,CAAA;AAGtB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,sBAAsB,CAAA;AACpC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,QAAQ,CAAA;AACtB,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAGlC,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AAGtB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAG1B,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAGvB,cAAc,cAAc,CAAA;AAG5B,cAAc,cAAc,CAAA;AAG5B,cAAc,eAAe,CAAA;AAG7B,cAAc,YAAY,CAAA;AAG1B,cAAc,aAAa,CAAA;AAE3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAA;AAC9B,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACtF,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,IAAI,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAGjK,cAAc,YAAY,CAAA;AAG1B,cAAc,QAAQ,CAAA;AAGtB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,sBAAsB,CAAA;AACpC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,QAAQ,CAAA;AACtB,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,oBAAoB,CAAA;AAGlC,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AAGtB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAG1B,cAAc,OAAO,CAAA;AACrB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAGvB,cAAc,cAAc,CAAA;AAG5B,cAAc,cAAc,CAAA;AAG5B,cAAc,eAAe,CAAA;AAG7B,cAAc,YAAY,CAAA;AAG1B,cAAc,aAAa,CAAA;AAE3B,cAAc,uBAAuB,CAAA;AACrC,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,QAAQ,CAAA"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Content Ref Group Configuration
3
+ *
4
+ * Single source of truth for grouping content_refs by type. Used by both:
5
+ * - components/related-content (detail page rail — lives in this lib)
6
+ * - the hub's lib/utils/investor-email-utils.ts (email builder, via the
7
+ * hub's re-export shim at lib/config/content-ref-groups.ts)
8
+ *
9
+ * Lives in utils/ (server-safe tsup block) so hub server-side code can
10
+ * import it.
11
+ *
12
+ * Each entry carries the metadata RelatedContentSection needs to render the
13
+ * group WITHOUT re-implementing per-type logic locally:
14
+ * - `label`: section heading.
15
+ * - `order`: source-stable ordering (lowest first).
16
+ * - `layout`: 'list' (one-per-row, full-width cards) or 'grid' (responsive
17
+ * column grid).
18
+ * - `gridSize`: card-size variant passed to the per-type card dispatch.
19
+ * `'lg'` matches the canonical large-card variant openframe + flamingo
20
+ * apps already use; `'default'` is the legacy denser variant. New types
21
+ * should pick `'lg'` whenever the card has a large variant.
22
+ *
23
+ * Adding a new content type = one entry here. RelatedContentSection picks up
24
+ * the new group automatically (no hardcoded set to update). NOTE: the hub's
25
+ * related-content SUGGESTION candidate list is DERIVED from these keys (minus
26
+ * an explicit exclusion knob) — a new entry here becomes a suggestion
27
+ * candidate iff it also resolves through the hub's TYPE_TO_ENTITY → RAG
28
+ * config chain (unresolvable entries are dropped loudly at module load).
29
+ */
30
+ export type ContentRefLayout = 'list' | 'grid';
31
+ /** Subset of `EntityCardSize` (entity-card dispatch) appropriate for
32
+ * grid/list rendering in RelatedContentSection. Duplicated as a literal
33
+ * union here to avoid a config→component import cycle. Kept in lockstep
34
+ * with `EntityCardSize`; widen here when a new size is added there. */
35
+ export type ContentRefGridSize = 'lg' | 'default' | 'sm';
36
+ export interface ContentRefGroupConfig {
37
+ label: string;
38
+ order: number;
39
+ layout: ContentRefLayout;
40
+ gridSize: ContentRefGridSize;
41
+ }
42
+ export declare const CONTENT_REF_GROUPS: Record<string, ContentRefGroupConfig>;
43
+ /** Human-readable label for a content_ref `type`. Returns null when the type
44
+ * isn't registered — caller decides the fallback. Use `getContentRefLabelOrTitleCase`
45
+ * to get a consistent title-cased fallback across all surfaces. */
46
+ export declare function getContentRefLabel(type: string): string | null;
47
+ /** Resolved label with a single shared fallback shape — title-cased version
48
+ * of the raw type string for any unregistered type. Both RelatedContentSection
49
+ * AND the investor-email builder consume this so cross-surface label rendering
50
+ * for unregistered types is identical (no drift between "podcast guest" and
51
+ * "Podcast Guest"). */
52
+ export declare function getContentRefLabelOrTitleCase(type: string): string;
53
+ /** Sort a set of present content_ref types into the canonical group order
54
+ * (registered types first in CONTENT_REF_GROUPS `order`, then unregistered
55
+ * types appended in insertion order). Used by RelatedContentSection AND the
56
+ * investor-email builder so cross-surface ordering stays identical. */
57
+ export declare function orderContentRefTypes(present: Iterable<string>): string[];
58
+ //# sourceMappingURL=content-ref-groups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-ref-groups.d.ts","sourceRoot":"","sources":["../../src/utils/content-ref-groups.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,CAAA;AAE9C;;;wEAGwE;AACxE,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAA;AAExD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,gBAAgB,CAAA;IACxB,QAAQ,EAAE,kBAAkB,CAAA;CAC7B;AAED,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAUpE,CAAA;AAED;;oEAEoE;AACpE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAE9D;AAED;;;;wBAIwB;AACxB,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKlE;AAED;;;wEAGwE;AACxE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAQxE"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * List-API response normalizers — HOISTED from
3
+ * `components/chat/hooks/use-chat-card-item.ts` (private copies) so the
4
+ * related-content rail can import them WITHOUT touching the chat hooks
5
+ * chunk (which reaches `@tanstack/react-query`). Pure + server-safe.
6
+ *
7
+ * The hub's `lib/utils/entity-list-api.ts` re-exports these — one
8
+ * implementation of response-shape normalization across both repos.
9
+ */
10
+ /** Extract the items array from each endpoint's response shape (some
11
+ * return `{ items }`, others `{ posts }`, etc.). Single normalization
12
+ * point — callers always read `Item[]`. */
13
+ export declare function extractItems(data: unknown): unknown[];
14
+ /** Extract a stable id from a fetched item — different shapes use
15
+ * `id` vs `external_id`. Used by the chat loader to match the fetched
16
+ * array element back to the marker's id. */
17
+ export declare function extractItemId(type: string, item: unknown): string | null;
18
+ //# sourceMappingURL=extract-items.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-items.d.ts","sourceRoot":"","sources":["../../src/utils/extract-items.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;4CAE4C;AAC5C,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,EAAE,CAerD;AAED;;6CAE6C;AAC7C,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAcxE"}
@@ -3290,6 +3290,9 @@ function scrollElementIntoView(target, options = {}) {
3290
3290
 
3291
3291
  // src/utils/list-url.ts
3292
3292
  var ALIASES = { blog_post_existing: "blog_post" };
3293
+ function canonicalContentRefType(contentRefType) {
3294
+ return ALIASES[contentRefType] ?? contentRefType;
3295
+ }
3293
3296
  var BUILDERS = {
3294
3297
  roadmap_item: (ids, b) => `${b}/api/roadmap?task_ids=${ids.join(",")}`,
3295
3298
  delivery_item: (ids, b) => `${b}/api/delivery?task_ids=${ids.join(",")}`,
@@ -3314,6 +3317,76 @@ function buildListUrl(contentRefType, ids, base = "") {
3314
3317
  return fn ? fn(ids, base) : null;
3315
3318
  }
3316
3319
 
3320
+ // src/utils/content-ref-groups.ts
3321
+ var CONTENT_REF_GROUPS = {
3322
+ investor_update: { label: "Investor Updates", order: 1, layout: "grid", gridSize: "default" },
3323
+ product_release: { label: "Product Releases", order: 2, layout: "list", gridSize: "lg" },
3324
+ podcast: { label: "Podcasts", order: 3, layout: "list", gridSize: "default" },
3325
+ webinar: { label: "Webinars", order: 4, layout: "list", gridSize: "default" },
3326
+ case_study: { label: "Case Studies", order: 5, layout: "grid", gridSize: "default" },
3327
+ event: { label: "Events", order: 6, layout: "list", gridSize: "default" },
3328
+ blog_post_existing: { label: "Blog Posts", order: 7, layout: "grid", gridSize: "default" },
3329
+ customer_interview: { label: "Customer Interviews", order: 8, layout: "grid", gridSize: "default" },
3330
+ onboarding_guide: { label: "Onboarding Guides", order: 9, layout: "list", gridSize: "default" }
3331
+ };
3332
+ function getContentRefLabel(type) {
3333
+ return CONTENT_REF_GROUPS[type]?.label ?? null;
3334
+ }
3335
+ function getContentRefLabelOrTitleCase(type) {
3336
+ return CONTENT_REF_GROUPS[type]?.label ?? type.replace(/_/g, " ").replace(/\b\w/g, (ch) => ch.toUpperCase());
3337
+ }
3338
+ function orderContentRefTypes(present) {
3339
+ const presentSet = new Set(present);
3340
+ const registeredInOrder = Object.entries(CONTENT_REF_GROUPS).sort(([, a], [, b]) => a.order - b.order).map(([type]) => type).filter((type) => presentSet.has(type));
3341
+ const unregistered = [...presentSet].filter((type) => !CONTENT_REF_GROUPS[type]);
3342
+ return [...registeredInOrder, ...unregistered];
3343
+ }
3344
+
3345
+ // src/utils/extract-items.ts
3346
+ function extractItems(data) {
3347
+ if (!data || typeof data !== "object") return [];
3348
+ const obj = data;
3349
+ if (Array.isArray(obj.items)) return obj.items;
3350
+ if (Array.isArray(obj.posts)) return obj.posts;
3351
+ if (Array.isArray(obj.campaigns)) return obj.campaigns;
3352
+ if (Array.isArray(obj.completed) || Array.isArray(obj.inProgress)) {
3353
+ const completed = Array.isArray(obj.completed) ? obj.completed : [];
3354
+ const inProgress = Array.isArray(obj.inProgress) ? obj.inProgress : [];
3355
+ return [...completed, ...inProgress];
3356
+ }
3357
+ if (Array.isArray(obj.data)) return obj.data;
3358
+ if (Array.isArray(data)) return data;
3359
+ return [];
3360
+ }
3361
+ function extractItemId(type, item) {
3362
+ if (!item || typeof item !== "object") return null;
3363
+ const obj = item;
3364
+ if (type === "roadmap_item" || type === "delivery_item" || type === "internal_task") {
3365
+ const ext = obj.external_id;
3366
+ if (typeof ext === "string") return ext;
3367
+ }
3368
+ const id = obj.id;
3369
+ if (typeof id === "string") return id;
3370
+ if (typeof id === "number") return String(id);
3371
+ return null;
3372
+ }
3373
+
3374
+ // src/utils/suggestion-url.ts
3375
+ function buildSuggestionUrl(path, opts = {}) {
3376
+ const qs = new URLSearchParams();
3377
+ const { entityType, entityId } = opts;
3378
+ if (entityType && entityId !== void 0 && entityId !== null && entityId !== "") {
3379
+ qs.set("entityType", entityType);
3380
+ qs.set("entityId", String(entityId));
3381
+ }
3382
+ if (opts.count !== void 0) qs.set("count", String(opts.count));
3383
+ for (const [key, value] of Object.entries(opts.extraParams ?? {})) {
3384
+ if (value !== void 0 && value !== "") qs.set(key, value);
3385
+ }
3386
+ const query = qs.toString();
3387
+ return `${opts.apiBaseUrl ?? ""}${path}${query ? `?${query}` : ""}`;
3388
+ }
3389
+
3317
3390
  // src/utils/content-href.ts
3318
3391
  var DEFAULT_CONTENT_SUFFIXES = {
3319
3392
  onboarding_guide: "onboarding-guides",
@@ -3379,6 +3452,7 @@ exports.CHAT_ATTACHMENT_MARKDOWN_PATTERN = CHAT_ATTACHMENT_MARKDOWN_PATTERN;
3379
3452
  exports.CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM = CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM;
3380
3453
  exports.CHAT_ATTACHMENT_VIEW_URL_PREFIX = CHAT_ATTACHMENT_VIEW_URL_PREFIX;
3381
3454
  exports.CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED = CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED;
3455
+ exports.CONTENT_REF_GROUPS = CONTENT_REF_GROUPS;
3382
3456
  exports.CUSTOM_ITEM_ID = CUSTOM_ITEM_ID;
3383
3457
  exports.DEFAULT_CONTENT_SUFFIXES = DEFAULT_CONTENT_SUFFIXES;
3384
3458
  exports.DEFAULT_MIN_FILL_MS = DEFAULT_MIN_FILL_MS;
@@ -3407,6 +3481,8 @@ exports.buildChatAttachmentViewUrl = buildChatAttachmentViewUrl;
3407
3481
  exports.buildDefaultHref = buildDefaultHref;
3408
3482
  exports.buildDiscussAddendum = buildDiscussAddendum;
3409
3483
  exports.buildListUrl = buildListUrl;
3484
+ exports.buildSuggestionUrl = buildSuggestionUrl;
3485
+ exports.canonicalContentRefType = canonicalContentRefType;
3410
3486
  exports.cleanEmailDomain = cleanEmailDomain;
3411
3487
  exports.clearEmbedProxyAuth = clearEmbedProxyAuth;
3412
3488
  exports.clickupTaskUrl = clickupTaskUrl;
@@ -3423,6 +3499,8 @@ exports.extractDominantColor = extractDominantColor;
3423
3499
  exports.extractEntityIdFilter = extractEntityIdFilter;
3424
3500
  exports.extractHumanitySignals = extractHumanitySignals;
3425
3501
  exports.extractImageEdgeColorAsync = extractImageEdgeColorAsync;
3502
+ exports.extractItemId = extractItemId;
3503
+ exports.extractItems = extractItems;
3426
3504
  exports.fetchPriorityProp = fetchPriorityProp;
3427
3505
  exports.flattenAssistantContent = flattenAssistantContent;
3428
3506
  exports.formatAbbreviatedNumber = formatAbbreviatedNumber;
@@ -3470,6 +3548,8 @@ exports.getConfidenceColorClass = getConfidenceColorClass;
3470
3548
  exports.getConfidenceLabel = getConfidenceLabel;
3471
3549
  exports.getConfidenceLevel = getConfidenceLevel;
3472
3550
  exports.getConfidenceTextClass = getConfidenceTextClass;
3551
+ exports.getContentRefLabel = getContentRefLabel;
3552
+ exports.getContentRefLabelOrTitleCase = getContentRefLabelOrTitleCase;
3473
3553
  exports.getContrastRatio = getContrastRatio;
3474
3554
  exports.getCountryByCode = getCountryByCode;
3475
3555
  exports.getCountryPhoneData = getCountryPhoneData;
@@ -3524,6 +3604,7 @@ exports.normalizeIconKey = normalizeIconKey;
3524
3604
  exports.normalizeOSType = normalizeOSType;
3525
3605
  exports.normalizeToolType = normalizeToolType;
3526
3606
  exports.normalizeToolTypeWithFallback = normalizeToolTypeWithFallback;
3607
+ exports.orderContentRefTypes = orderContentRefTypes;
3527
3608
  exports.parseScrollAnchor = parseScrollAnchor;
3528
3609
  exports.parseWireCommandOverride = parseWireCommandOverride;
3529
3610
  exports.platformColors = platformColors;