@flamingo-stack/openframe-frontend-core 0.0.296-snapshot.20260621021605 → 0.0.296

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 (276) hide show
  1. package/README.md +0 -9
  2. package/dist/chunk-26PKDALD.js +2379 -0
  3. package/dist/chunk-26PKDALD.js.map +1 -0
  4. package/dist/chunk-3MCHAFHB.js +89 -0
  5. package/dist/chunk-3MCHAFHB.js.map +1 -0
  6. package/dist/{chunk-PI4WSYQV.js → chunk-3ZXUQQL4.js} +2 -2
  7. package/dist/{chunk-WMSTJAZT.cjs → chunk-5E2HOSSH.cjs} +51 -913
  8. package/dist/chunk-5E2HOSSH.cjs.map +1 -0
  9. package/dist/{chunk-IL47XWV5.js → chunk-5P3B2LZW.js} +14 -8
  10. package/dist/{chunk-IL47XWV5.js.map → chunk-5P3B2LZW.js.map} +1 -1
  11. package/dist/chunk-66AANIOC.cjs +619 -0
  12. package/dist/chunk-66AANIOC.cjs.map +1 -0
  13. package/dist/{chunk-AD6C23QY.js → chunk-6GCI7JOE.js} +7 -8
  14. package/dist/{chunk-AD6C23QY.js.map → chunk-6GCI7JOE.js.map} +1 -1
  15. package/dist/chunk-6JINAOI7.cjs +311 -0
  16. package/dist/chunk-6JINAOI7.cjs.map +1 -0
  17. package/dist/{chunk-2QG57XOJ.js → chunk-7RIYT7ZH.js} +205 -1067
  18. package/dist/chunk-7RIYT7ZH.js.map +1 -0
  19. package/dist/{chunk-L6PSSIUQ.cjs → chunk-AQOWFSMB.cjs} +1 -1
  20. package/dist/chunk-AQOWFSMB.cjs.map +1 -0
  21. package/dist/chunk-BOCFIKYS.cjs +3009 -0
  22. package/dist/chunk-BOCFIKYS.cjs.map +1 -0
  23. package/dist/{chunk-54KNMC2R.cjs → chunk-D3LEFMOA.cjs} +3 -3
  24. package/dist/{chunk-54KNMC2R.cjs.map → chunk-D3LEFMOA.cjs.map} +1 -1
  25. package/dist/chunk-D652TJBQ.js +3009 -0
  26. package/dist/chunk-D652TJBQ.js.map +1 -0
  27. package/dist/{chunk-PWQUAVA3.js → chunk-E4XABBSU.js} +98 -338
  28. package/dist/chunk-E4XABBSU.js.map +1 -0
  29. package/dist/{chunk-JALO4TAZ.js → chunk-EL6QLAWX.js} +55 -357
  30. package/dist/chunk-EL6QLAWX.js.map +1 -0
  31. package/dist/{chunk-6C526VNN.cjs → chunk-EYEW6PTA.cjs} +118 -358
  32. package/dist/chunk-EYEW6PTA.cjs.map +1 -0
  33. package/dist/chunk-FQJK446R.js +1606 -0
  34. package/dist/chunk-FQJK446R.js.map +1 -0
  35. package/dist/{chunk-4PSQS3SW.cjs → chunk-GLLDTKZK.cjs} +9 -7
  36. package/dist/chunk-GLLDTKZK.cjs.map +1 -0
  37. package/dist/{chunk-FQOTC3UU.cjs → chunk-IE6OU3WQ.cjs} +16 -318
  38. package/dist/chunk-IE6OU3WQ.cjs.map +1 -0
  39. package/dist/chunk-J54Z3OCR.cjs +1606 -0
  40. package/dist/chunk-J54Z3OCR.cjs.map +1 -0
  41. package/dist/{chunk-PC746XCO.js → chunk-K2PFPBMF.js} +5563 -15048
  42. package/dist/chunk-K2PFPBMF.js.map +1 -0
  43. package/dist/chunk-KXCRGTRN.cjs +2379 -0
  44. package/dist/chunk-KXCRGTRN.cjs.map +1 -0
  45. package/dist/{chunk-IZ7JSBFP.js → chunk-LCNMR277.js} +1 -1
  46. package/dist/chunk-LCNMR277.js.map +1 -0
  47. package/dist/chunk-LFGGF7OT.cjs +449 -0
  48. package/dist/chunk-LFGGF7OT.cjs.map +1 -0
  49. package/dist/chunk-M2OCXTNT.js +311 -0
  50. package/dist/chunk-M2OCXTNT.js.map +1 -0
  51. package/dist/{chunk-L7ULJKG7.js → chunk-MBFWU2EM.js} +10 -6
  52. package/dist/{chunk-L7ULJKG7.js.map → chunk-MBFWU2EM.js.map} +1 -1
  53. package/dist/chunk-ME4EVDFP.js +619 -0
  54. package/dist/chunk-ME4EVDFP.js.map +1 -0
  55. package/dist/chunk-OQ6X7ZOC.js +449 -0
  56. package/dist/chunk-OQ6X7ZOC.js.map +1 -0
  57. package/dist/{chunk-4TLE6VLU.js → chunk-OY7OF7E7.js} +24 -30
  58. package/dist/chunk-OY7OF7E7.js.map +1 -0
  59. package/dist/chunk-POKKCWKF.js +354 -0
  60. package/dist/chunk-POKKCWKF.js.map +1 -0
  61. package/dist/{chunk-GUTS7HGA.cjs → chunk-QHIXS3W2.cjs} +2514 -11999
  62. package/dist/chunk-QHIXS3W2.cjs.map +1 -0
  63. package/dist/chunk-TFSYSWPS.cjs +89 -0
  64. package/dist/chunk-TFSYSWPS.cjs.map +1 -0
  65. package/dist/{chunk-53FUMSZ5.cjs → chunk-W6M2FLLT.cjs} +46 -40
  66. package/dist/chunk-W6M2FLLT.cjs.map +1 -0
  67. package/dist/{chunk-3JIQVE7T.js → chunk-WHMATDVP.js} +15 -9
  68. package/dist/{chunk-3JIQVE7T.js.map → chunk-WHMATDVP.js.map} +1 -1
  69. package/dist/{chunk-YBYI62OE.cjs → chunk-X647HY3F.cjs} +37 -33
  70. package/dist/chunk-X647HY3F.cjs.map +1 -0
  71. package/dist/{chunk-UNVE2SDJ.cjs → chunk-X6BV7MB7.cjs} +31 -37
  72. package/dist/chunk-X6BV7MB7.cjs.map +1 -0
  73. package/dist/{chunk-7OVGB2DQ.cjs → chunk-XREEV72C.cjs} +25 -19
  74. package/dist/chunk-XREEV72C.cjs.map +1 -0
  75. package/dist/chunk-YETA25JW.cjs +354 -0
  76. package/dist/chunk-YETA25JW.cjs.map +1 -0
  77. package/dist/{chunk-FCDQNTDG.cjs → chunk-YIGPRLQY.cjs} +20 -21
  78. package/dist/chunk-YIGPRLQY.cjs.map +1 -0
  79. package/dist/{chunk-X4DOXQRT.js → chunk-ZP4AVIZP.js} +6 -4
  80. package/dist/{chunk-X4DOXQRT.js.map → chunk-ZP4AVIZP.js.map} +1 -1
  81. package/dist/components/chat/index.cjs +18 -8
  82. package/dist/components/chat/index.cjs.map +1 -1
  83. package/dist/components/chat/index.js +85 -75
  84. package/dist/components/contact/index.cjs +15 -8
  85. package/dist/components/contact/index.cjs.map +1 -1
  86. package/dist/components/contact/index.js +14 -7
  87. package/dist/components/docs/doc-viewer.d.ts +2 -39
  88. package/dist/components/docs/doc-viewer.d.ts.map +1 -1
  89. package/dist/components/docs/index.cjs +9 -17
  90. package/dist/components/docs/index.cjs.map +1 -1
  91. package/dist/components/docs/index.d.ts +0 -4
  92. package/dist/components/docs/index.d.ts.map +1 -1
  93. package/dist/components/docs/index.js +8 -16
  94. package/dist/components/docs/use-document-tree.d.ts.map +1 -1
  95. package/dist/components/embeds/embed-iframe.d.ts.map +1 -1
  96. package/dist/components/embeds/index.cjs +15 -38
  97. package/dist/components/embeds/index.cjs.map +1 -1
  98. package/dist/components/embeds/index.d.ts +0 -8
  99. package/dist/components/embeds/index.d.ts.map +1 -1
  100. package/dist/components/embeds/index.js +17 -40
  101. package/dist/components/faq/index.cjs +16 -9
  102. package/dist/components/faq/index.cjs.map +1 -1
  103. package/dist/components/faq/index.js +15 -8
  104. package/dist/components/features/index.cjs +16 -8
  105. package/dist/components/features/index.cjs.map +1 -1
  106. package/dist/components/features/index.js +32 -24
  107. package/dist/components/index.cjs +452 -257
  108. package/dist/components/index.cjs.map +1 -1
  109. package/dist/components/index.js +976 -781
  110. package/dist/components/index.js.map +1 -1
  111. package/dist/components/layout/page-layout.d.ts +1 -10
  112. package/dist/components/layout/page-layout.d.ts.map +1 -1
  113. package/dist/components/layout/title-block.d.ts +1 -17
  114. package/dist/components/layout/title-block.d.ts.map +1 -1
  115. package/dist/components/navigation/index.cjs +15 -7
  116. package/dist/components/navigation/index.cjs.map +1 -1
  117. package/dist/components/navigation/index.js +17 -9
  118. package/dist/components/onboarding-guides/index.cjs +36 -35
  119. package/dist/components/onboarding-guides/index.cjs.map +1 -1
  120. package/dist/components/onboarding-guides/index.js +14 -13
  121. package/dist/components/onboarding-guides/index.js.map +1 -1
  122. package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts +1 -1
  123. package/dist/components/onboarding-guides/onboarding-guide-detail-view.d.ts.map +1 -1
  124. package/dist/components/related-content/index.cjs +16 -9
  125. package/dist/components/related-content/index.cjs.map +1 -1
  126. package/dist/components/related-content/index.js +15 -8
  127. package/dist/components/shared/dev-section/dev-section-page.d.ts +0 -9
  128. package/dist/components/shared/dev-section/dev-section-page.d.ts.map +1 -1
  129. package/dist/components/shared/dev-section/dev-section-view.d.ts.map +1 -1
  130. package/dist/components/shared/dev-section/index.d.ts +1 -1
  131. package/dist/components/shared/dev-section/index.d.ts.map +1 -1
  132. package/dist/components/shared/doc-search/use-doc-search.d.ts.map +1 -1
  133. package/dist/components/shared/legal-document/legal-document-page.d.ts.map +1 -1
  134. package/dist/components/shared/product-release/release-detail-page.d.ts.map +1 -1
  135. package/dist/components/tickets/index.cjs +112 -100
  136. package/dist/components/tickets/index.cjs.map +1 -1
  137. package/dist/components/tickets/index.js +32 -20
  138. package/dist/components/tickets/index.js.map +1 -1
  139. package/dist/components/ui/file-manager/index.cjs +52 -50
  140. package/dist/components/ui/file-manager/index.cjs.map +1 -1
  141. package/dist/components/ui/file-manager/index.js +6 -4
  142. package/dist/components/ui/file-manager/index.js.map +1 -1
  143. package/dist/components/ui/index.cjs +19 -13
  144. package/dist/components/ui/index.cjs.map +1 -1
  145. package/dist/components/ui/index.d.ts +0 -2
  146. package/dist/components/ui/index.d.ts.map +1 -1
  147. package/dist/components/ui/index.js +139 -133
  148. package/dist/components/ui/release-changelog-section.d.ts +2 -6
  149. package/dist/components/ui/release-changelog-section.d.ts.map +1 -1
  150. package/dist/components/ui/simple-markdown-renderer.d.ts +8 -2
  151. package/dist/components/ui/simple-markdown-renderer.d.ts.map +1 -1
  152. package/dist/contexts/chat-runtime-context.d.ts +0 -14
  153. package/dist/contexts/chat-runtime-context.d.ts.map +1 -1
  154. package/dist/contexts/index.cjs +3 -3
  155. package/dist/contexts/index.js +5 -5
  156. package/dist/embed-shims/index.cjs +3 -3
  157. package/dist/embed-shims/index.cjs.map +1 -1
  158. package/dist/embed-shims/index.js +4 -4
  159. package/dist/hooks/index.cjs +9 -4
  160. package/dist/hooks/index.cjs.map +1 -1
  161. package/dist/hooks/index.js +11 -6
  162. package/dist/index.cjs +20 -14
  163. package/dist/index.cjs.map +1 -1
  164. package/dist/index.js +364 -358
  165. package/dist/types/doc-source.d.ts +1 -31
  166. package/dist/types/doc-source.d.ts.map +1 -1
  167. package/dist/utils/index.cjs +0 -4
  168. package/dist/utils/index.cjs.map +1 -1
  169. package/dist/utils/index.d.ts +0 -1
  170. package/dist/utils/index.d.ts.map +1 -1
  171. package/dist/utils/index.js +1 -4
  172. package/dist/utils/index.js.map +1 -1
  173. package/package.json +1 -7
  174. package/src/components/chat/embeddable-chat.tsx +1 -1
  175. package/src/components/docs/doc-viewer.tsx +19 -111
  176. package/src/components/docs/index.ts +0 -17
  177. package/src/components/docs/use-document-tree.ts +0 -21
  178. package/src/components/embeds/embed-iframe.tsx +9 -7
  179. package/src/components/embeds/index.ts +0 -30
  180. package/src/components/embeds/og-link-preview.tsx +13 -13
  181. package/src/components/layout/page-layout.tsx +1 -14
  182. package/src/components/layout/title-block.tsx +62 -40
  183. package/src/components/onboarding-guides/onboarding-guide-detail-view.tsx +3 -3
  184. package/src/components/shared/dev-section/dev-section-page.tsx +1 -9
  185. package/src/components/shared/dev-section/dev-section-view.tsx +9 -14
  186. package/src/components/shared/dev-section/index.ts +1 -1
  187. package/src/components/shared/doc-search/use-doc-search.ts +3 -7
  188. package/src/components/shared/legal-document/legal-document-page.tsx +2 -2
  189. package/src/components/shared/product-release/release-detail-page.tsx +4 -6
  190. package/src/components/ui/index.ts +0 -2
  191. package/src/components/ui/release-changelog-section.tsx +2 -7
  192. package/src/components/ui/simple-markdown-renderer.tsx +11 -7
  193. package/src/contexts/chat-runtime-context.tsx +0 -14
  194. package/src/types/doc-source.ts +1 -33
  195. package/src/utils/index.ts +0 -1
  196. package/dist/chunk-2QG57XOJ.js.map +0 -1
  197. package/dist/chunk-4PSQS3SW.cjs.map +0 -1
  198. package/dist/chunk-4TLE6VLU.js.map +0 -1
  199. package/dist/chunk-53FUMSZ5.cjs.map +0 -1
  200. package/dist/chunk-6C526VNN.cjs.map +0 -1
  201. package/dist/chunk-7OVGB2DQ.cjs.map +0 -1
  202. package/dist/chunk-F5OB2YAL.cjs +0 -144
  203. package/dist/chunk-F5OB2YAL.cjs.map +0 -1
  204. package/dist/chunk-FBWXMMRB.cjs +0 -2
  205. package/dist/chunk-FBWXMMRB.cjs.map +0 -1
  206. package/dist/chunk-FCDQNTDG.cjs.map +0 -1
  207. package/dist/chunk-FQOTC3UU.cjs.map +0 -1
  208. package/dist/chunk-GUTS7HGA.cjs.map +0 -1
  209. package/dist/chunk-GZ4C3XW6.js +0 -2
  210. package/dist/chunk-GZ4C3XW6.js.map +0 -1
  211. package/dist/chunk-IZ7JSBFP.js.map +0 -1
  212. package/dist/chunk-JALO4TAZ.js.map +0 -1
  213. package/dist/chunk-L6PSSIUQ.cjs.map +0 -1
  214. package/dist/chunk-PC746XCO.js.map +0 -1
  215. package/dist/chunk-PWQUAVA3.js.map +0 -1
  216. package/dist/chunk-SA2WPJVO.js +0 -144
  217. package/dist/chunk-SA2WPJVO.js.map +0 -1
  218. package/dist/chunk-UNVE2SDJ.cjs.map +0 -1
  219. package/dist/chunk-WMSTJAZT.cjs.map +0 -1
  220. package/dist/chunk-YBYI62OE.cjs.map +0 -1
  221. package/dist/components/case-studies/index.cjs +0 -126
  222. package/dist/components/case-studies/index.cjs.map +0 -1
  223. package/dist/components/case-studies/index.d.ts +0 -2
  224. package/dist/components/case-studies/index.d.ts.map +0 -1
  225. package/dist/components/case-studies/index.js +0 -126
  226. package/dist/components/case-studies/index.js.map +0 -1
  227. package/dist/components/case-studies/share-experience-section.d.ts +0 -48
  228. package/dist/components/case-studies/share-experience-section.d.ts.map +0 -1
  229. package/dist/components/docs/docs-hub-page.d.ts +0 -46
  230. package/dist/components/docs/docs-hub-page.d.ts.map +0 -1
  231. package/dist/components/docs/skeletons.d.ts +0 -32
  232. package/dist/components/docs/skeletons.d.ts.map +0 -1
  233. package/dist/components/docs/use-docs-resolve-link.d.ts +0 -20
  234. package/dist/components/docs/use-docs-resolve-link.d.ts.map +0 -1
  235. package/dist/components/embeds/embed-container.d.ts +0 -37
  236. package/dist/components/embeds/embed-container.d.ts.map +0 -1
  237. package/dist/components/embeds/file-download-card.d.ts +0 -18
  238. package/dist/components/embeds/file-download-card.d.ts.map +0 -1
  239. package/dist/components/embeds/linkedin-embed-client.d.ts +0 -8
  240. package/dist/components/embeds/linkedin-embed-client.d.ts.map +0 -1
  241. package/dist/components/embeds/markdown-image.d.ts +0 -5
  242. package/dist/components/embeds/markdown-image.d.ts.map +0 -1
  243. package/dist/components/embeds/reddit-embed-client.d.ts +0 -7
  244. package/dist/components/embeds/reddit-embed-client.d.ts.map +0 -1
  245. package/dist/components/embeds/rich-markdown-runtime.d.ts +0 -46
  246. package/dist/components/embeds/rich-markdown-runtime.d.ts.map +0 -1
  247. package/dist/components/embeds/twitter-embed-client.d.ts +0 -8
  248. package/dist/components/embeds/twitter-embed-client.d.ts.map +0 -1
  249. package/dist/components/layout/page-header.d.ts +0 -78
  250. package/dist/components/layout/page-header.d.ts.map +0 -1
  251. package/dist/components/layout/page-with-header.d.ts +0 -67
  252. package/dist/components/layout/page-with-header.d.ts.map +0 -1
  253. package/dist/components/ui/rich-markdown-renderer.d.ts +0 -34
  254. package/dist/components/ui/rich-markdown-renderer.d.ts.map +0 -1
  255. package/dist/utils/page-header-constants.d.ts +0 -15
  256. package/dist/utils/page-header-constants.d.ts.map +0 -1
  257. package/dist/utils/social-embed-cache.d.ts +0 -29
  258. package/dist/utils/social-embed-cache.d.ts.map +0 -1
  259. package/src/components/case-studies/index.ts +0 -4
  260. package/src/components/case-studies/share-experience-section.tsx +0 -185
  261. package/src/components/docs/docs-hub-page.tsx +0 -149
  262. package/src/components/docs/skeletons.tsx +0 -138
  263. package/src/components/docs/use-docs-resolve-link.ts +0 -52
  264. package/src/components/embeds/embed-container.tsx +0 -80
  265. package/src/components/embeds/file-download-card.tsx +0 -54
  266. package/src/components/embeds/linkedin-embed-client.tsx +0 -100
  267. package/src/components/embeds/markdown-image.tsx +0 -88
  268. package/src/components/embeds/reddit-embed-client.tsx +0 -550
  269. package/src/components/embeds/rich-markdown-runtime.tsx +0 -79
  270. package/src/components/embeds/twitter-embed-client.tsx +0 -308
  271. package/src/components/layout/page-header.tsx +0 -182
  272. package/src/components/layout/page-with-header.tsx +0 -110
  273. package/src/components/ui/rich-markdown-renderer.tsx +0 -1203
  274. package/src/utils/page-header-constants.ts +0 -15
  275. package/src/utils/social-embed-cache.ts +0 -391
  276. /package/dist/{chunk-PI4WSYQV.js.map → chunk-3ZXUQQL4.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-66AANIOC.cjs","../src/components/embeds/embed-iframe.tsx","../src/components/embeds/pdf-viewer.tsx","../src/components/embeds/google-sheets-viewer.tsx","../src/components/embeds/figma-embed.tsx","../src/components/embeds/og-link-preview.tsx"],"names":["jsx","jsxs"],"mappings":"AAAA,6rBAAY;AACZ;AACE;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACzBA,8BAAgE;AAS1D,+CAAA;AANN,SAAS,oBAAA,CAAqB,EAAE,OAAO,CAAA,EAAwB;AAC7D,EAAA,uBACE,6BAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAU,0FAAA;AAAA,MACV,KAAA,EAAO,EAAE,MAAA,EAAQ,OAAA,GAAU,sBAAsB,CAAA;AAAA,MAEj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e,wBAAA;AAKX,wBAAA;AAAAD,0BAAAA;AAAC,YAAA;AAAA,YAAA;AAAS,cAAA;AAAiC,cAAA;AAAc,cAAA;AACvC,cAAA;AAAiD,gBAAA;AAAO,cAAA;AAAA,YAAA;AAAG,UAAA;AAE3E,0BAAA;AAAAA,4BAAAA;AAAC,cAAA;AAAA,cAAA;AAAa,gBAAA;AACqE,gBAAA;AAAI,gBAAA;AAAA,cAAA;AAAM,YAAA;AAE3FA,YAAAA;AAAC,cAAA;AAAA,cAAA;AAAY,gBAAA;AACsE,gBAAA;AAAI,gBAAA;AAAA,cAAA;AAAY,YAAA;AAGnG,4BAAA;AAAsD,8BAAA;AAC/C,8BAAA;AAC8B,8BAAA;AACvC,YAAA;AACF,UAAA;AAEJ,QAAA;AAAA,MAAA;AAAA,IAAA;AAEJ,EAAA;AAEJ;ALoK2I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-66AANIOC.cjs","sourcesContent":[null,"\"use client\"\n\nimport React, { useState, useCallback, useRef, useEffect } from 'react'\n\n/** Loading skeleton for iframe embeds — matches project skeleton pattern */\nfunction EmbedLoadingSkeleton({ height }: { height?: string }) {\n return (\n <div\n className=\"w-full rounded-lg border border-ods-border overflow-hidden bg-ods-skeleton animate-pulse\"\n style={{ height: height || 'calc(100vh - 250px)' }}\n >\n <div className=\"flex flex-col items-center justify-center h-full gap-4\">\n <div className=\"w-12 h-12 rounded-lg bg-ods-card\" />\n <div className=\"h-4 w-48 rounded bg-ods-card\" />\n <div className=\"h-3 w-32 rounded bg-ods-card\" />\n </div>\n </div>\n )\n}\n\nexport interface EmbedIframeProps {\n /** The URL to embed */\n src: string\n /** Accessible title for the iframe */\n title: string\n /** Additional class names for the outer container */\n className?: string\n /** Container height (CSS value). Defaults to `calc(100vh - 250px)` */\n height?: string\n /** iframe `allow` attribute */\n allow?: string\n /** iframe `referrerPolicy` attribute */\n referrerPolicy?: React.IframeHTMLAttributes<HTMLIFrameElement>['referrerPolicy']\n /** iframe `loading` attribute */\n loading?: 'eager' | 'lazy'\n /** iframe `allowFullScreen` attribute */\n allowFullScreen?: boolean\n}\n\n/**\n * Base iframe wrapper with loading skeleton and proper memory cleanup.\n *\n * Prevents memory leaks by:\n * - Using `key={src}` to force full unmount/remount when src changes\n * - Setting iframe src to about:blank on unmount to release the embedded document\n * - Resetting loaded state when src changes\n */\nexport function EmbedIframe({\n src,\n title,\n className,\n height,\n allow,\n referrerPolicy,\n loading,\n allowFullScreen,\n}: EmbedIframeProps) {\n const [isLoaded, setIsLoaded] = useState(false)\n const iframeRef = useRef<HTMLIFrameElement>(null)\n const handleLoad = useCallback(() => setIsLoaded(true), [])\n\n useEffect(() => {\n setIsLoaded(false)\n }, [src])\n\n useEffect(() => {\n const iframe = iframeRef.current\n return () => {\n if (iframe) {\n try {\n iframe.src = 'about:blank'\n } catch {\n // Cross-origin iframes may throw — safe to ignore\n }\n }\n }\n }, [src])\n\n const resolvedHeight = height || 'calc(100vh - 250px)'\n\n return (\n <>\n {!isLoaded && <EmbedLoadingSkeleton height={resolvedHeight} />}\n <div\n className={`w-full rounded-lg border border-ods-border overflow-hidden ${!isLoaded ? 'h-0 overflow-hidden' : ''} ${className || ''}`}\n style={isLoaded ? { height: resolvedHeight } : undefined}\n >\n <iframe\n key={src}\n ref={iframeRef}\n src={src}\n className=\"w-full h-full border-0\"\n title={title}\n onLoad={handleLoad}\n allow={allow}\n referrerPolicy={referrerPolicy}\n loading={loading}\n allowFullScreen={allow?.includes('fullscreen') ? undefined : allowFullScreen}\n />\n </div>\n </>\n )\n}\n","\"use client\"\n\nimport React from 'react'\nimport { Button } from '../ui'\nimport { Download, Eye } from 'lucide-react'\nimport { AdobePdfIcon } from '../icons-v2-generated'\nimport { EmbedIframe } from './embed-iframe'\n\nexport interface PdfViewerProps {\n src: string\n fileName?: string\n onPreview?: () => void\n onDownload?: () => void\n height?: string\n}\n\nexport function PdfViewer({ src, fileName, onPreview, onDownload, height }: PdfViewerProps) {\n const displayName = fileName || 'PDF Document'\n\n if (!src) {\n return (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <AdobePdfIcon className=\"w-16 h-16 text-ods-text-secondary mb-4\" />\n <p className=\"text-ods-text-secondary\">PDF file not available</p>\n </div>\n )\n }\n\n return (\n <div className=\"space-y-4\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <AdobePdfIcon className=\"w-5 h-5 shrink-0\" />\n <h2 className=\"text-xl font-semibold text-ods-text-primary truncate\">{displayName}</h2>\n </div>\n <div className=\"flex items-center gap-2 w-full sm:w-auto\">\n <Button\n variant=\"outline\"\n size=\"small-legacy\"\n href={onPreview ? undefined : src}\n openInNewTab={!onPreview}\n onClick={onPreview}\n leftIcon={<Eye className=\"w-4 h-4\" />}\n className=\"flex-1 sm:flex-initial\"\n >\n Preview\n </Button>\n <Button\n variant=\"outline\"\n size=\"small-legacy\"\n href={onDownload ? undefined : src}\n openInNewTab={!onDownload}\n onClick={onDownload}\n leftIcon={<Download className=\"w-4 h-4\" />}\n className=\"flex-1 sm:flex-initial\"\n >\n Download\n </Button>\n </div>\n </div>\n <EmbedIframe src={src} title={displayName} height={height} />\n </div>\n )\n}\n","\"use client\"\n\nimport React from 'react'\nimport { Button } from '../ui'\nimport { ExternalLink } from 'lucide-react'\nimport { GoogleSheetsIcon } from '../icons-v2-generated'\nimport { EmbedIframe } from './embed-iframe'\nimport { toGoogleSheetsEmbedUrl, toGoogleSheetsOriginalUrl } from '../../utils/embed-url-converters'\n\nexport interface GoogleSheetsViewerProps {\n externalUrl: string\n fileName?: string\n height?: string\n}\n\nexport function GoogleSheetsViewer({ externalUrl, fileName, height }: GoogleSheetsViewerProps) {\n const displayName = fileName || 'Google Sheet'\n\n if (!externalUrl) {\n return (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <GoogleSheetsIcon className=\"w-16 h-16 text-ods-text-secondary mb-4\" />\n <p className=\"text-ods-text-secondary\">Google Sheet URL not configured</p>\n </div>\n )\n }\n\n return (\n <div className=\"space-y-4\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <GoogleSheetsIcon className=\"w-5 h-5 shrink-0\" />\n <h2 className=\"text-xl font-semibold text-ods-text-primary truncate\">{displayName}</h2>\n </div>\n <Button\n variant=\"outline\"\n size=\"small-legacy\"\n href={toGoogleSheetsOriginalUrl(externalUrl)}\n openInNewTab\n leftIcon={<GoogleSheetsIcon className=\"w-4 h-4\" />}\n rightIcon={<ExternalLink className=\"w-4 h-4\" />}\n className=\"w-full sm:w-auto\"\n >\n Open in Google Sheets\n </Button>\n </div>\n <EmbedIframe\n src={toGoogleSheetsEmbedUrl(externalUrl)}\n title={displayName}\n height={height}\n />\n </div>\n )\n}\n","'use client'\n\nimport { useState } from 'react'\nimport { Button, ToggleGroup, ToggleGroupItem } from '../ui'\nimport { FigmaIcon } from '../icons-v2-generated'\nimport { ExternalLink, Play, LayoutGrid } from 'lucide-react'\nimport { toFigmaEmbedUrl, toFigmaOriginalUrl, isFigmaSlidesUrl } from '../../utils/embed-url-converters'\nimport { EmbedIframe } from './embed-iframe'\n\nexport interface FigmaEmbedProps {\n /** Any Figma URL (design/file/proto/board/slides/deck) or an already-resolved embed URL. */\n url: string\n /** Heading shown above the embed. Defaults to \"Figma Design\". */\n title?: string\n /**\n * iframe height (CSS value). The data-room document viewer omits it (full\n * height, `calc(100vh - 250px)`); inline markdown passes e.g. `\"70vh\"` so the\n * embed sits naturally inside article content.\n */\n height?: string\n /** iframe loading strategy. Defaults to `\"lazy\"`; the data-room viewer passes `\"eager\"`. */\n loading?: 'eager' | 'lazy'\n}\n\ntype SlidesView = 'present' | 'browse'\n\n/**\n * Two-state present/browse toggle for Figma Slides. `present` (default) uses\n * Figma's deck viewer (full-bleed slide + `‹ n/N ›` nav bar + keyboard nav);\n * `browse` uses the thumbnail-rail + zoom viewer.\n */\nfunction SlidesViewToggle({\n view,\n onChange,\n}: {\n view: SlidesView\n onChange: (v: SlidesView) => void\n}) {\n const options: { key: SlidesView; label: string; Icon: typeof Play }[] = [\n { key: 'present', label: 'Present', Icon: Play },\n { key: 'browse', label: 'Browse', Icon: LayoutGrid },\n ]\n return (\n <ToggleGroup\n type=\"single\"\n value={view}\n onValueChange={(v: string) => {\n if (v && v !== view) onChange(v as SlidesView)\n }}\n aria-label=\"Figma slides view mode\"\n className=\"flex shrink-0 items-center gap-0.5 rounded-lg border border-ods-border bg-ods-card p-0.5\"\n >\n {options.map(({ key, label, Icon }) => {\n const active = view === key\n return (\n <ToggleGroupItem\n key={key}\n value={key}\n aria-label={label}\n className={`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-sm font-medium transition-colors ${\n active\n ? 'bg-ods-accent text-ods-text-on-accent'\n : 'text-ods-text-secondary hover:text-ods-text-primary hover:bg-ods-bg-hover'\n }`}\n >\n <Icon className=\"h-4 w-4 shrink-0\" />\n {label}\n </ToggleGroupItem>\n )\n })}\n </ToggleGroup>\n )\n}\n\n/**\n * Single source of truth for every Figma surface — the data-room document viewer\n * and in-article markdown both render this. A header (icon + title + \"Open in\n * Figma\") over an interactive Figma iframe, built from the canonical\n * `toFigmaEmbedUrl` / `toFigmaOriginalUrl` converters + the shared `<EmbedIframe>`.\n * Only height/loading differ per surface.\n *\n * For Slides decks, a present/browse toggle (default = present) lets viewers flip\n * slides with Figma's native nav bar + keyboard, or switch to the thumbnail-rail\n * browse view.\n */\nexport function FigmaEmbed({ url, title, height, loading = 'lazy' }: FigmaEmbedProps) {\n const [view, setView] = useState<SlidesView>('present')\n const isSlides = url ? isFigmaSlidesUrl(url) : false\n const embedSrc = url ? toFigmaEmbedUrl(url, { slidesView: view }) : null\n const originalUrl = (() => {\n if (!url) return null\n try {\n const parsed = new URL(toFigmaOriginalUrl(url))\n const host = parsed.hostname.toLowerCase()\n const okHost = host === 'figma.com' || host.endsWith('.figma.com')\n const okProtocol = parsed.protocol === 'https:' || parsed.protocol === 'http:'\n return okHost && okProtocol ? parsed.toString() : null\n } catch {\n return null\n }\n })()\n const heading = title || 'Figma Design'\n\n return (\n <div className=\"my-6 space-y-3\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex items-center gap-2 min-w-0\">\n <FigmaIcon className=\"w-5 h-5 shrink-0\" />\n <span className=\"font-sans text-base font-semibold text-ods-text-primary truncate\">\n {heading}\n </span>\n </div>\n <div className=\"flex flex-col gap-2 sm:flex-row sm:items-center\">\n {isSlides && embedSrc && <SlidesViewToggle view={view} onChange={setView} />}\n {originalUrl && (\n <Button\n variant=\"outline\"\n size=\"small-legacy\"\n href={originalUrl}\n openInNewTab\n leftIcon={<FigmaIcon className=\"w-4 h-4\" />}\n rightIcon={<ExternalLink className=\"w-4 h-4\" />}\n className=\"w-full sm:w-auto\"\n >\n Open in Figma\n </Button>\n )}\n </div>\n </div>\n {embedSrc ? (\n <EmbedIframe\n src={embedSrc}\n title={heading}\n allow=\"clipboard-write; clipboard-read; fullscreen\"\n loading={loading}\n height={height}\n allowFullScreen\n />\n ) : (\n <div className=\"flex flex-col items-center justify-center py-16 text-center\">\n <FigmaIcon className=\"w-16 h-16 text-ods-text-secondary mb-4\" />\n <p className=\"text-ods-text-secondary\">Figma URL not configured</p>\n </div>\n )}\n </div>\n )\n}\n","\"use client\"\n\nimport React, { useState, useEffect, Component, ReactNode } from 'react'\nimport Image from '../../embed-shims/next-image'\nimport { useImageEdgeColor } from '../../hooks'\n\n/**\n * Open-Graph metadata returned by the consumer's scrape endpoint.\n *\n * The shape MUST match the JSON the OG endpoint serves at `ogEndpointPath`.\n * The hub's `/api/blog/og-scraper` returns exactly these fields — embedders\n * with a different endpoint must return the same shape (or adapt at the\n * route boundary). Keeps the consumer surface trivial: one URL → one card.\n */\nexport interface OGData {\n title: string\n description: string\n image: string\n originalImage?: string\n url: string\n siteName: string\n type: string\n favicon: string\n}\n\ninterface ErrorBoundaryProps {\n children: ReactNode\n fallback: ReactNode\n}\n\ninterface ErrorBoundaryState {\n hasError: boolean\n}\n\n/**\n * Tiny error boundary tailored for OG link previews — caught errors quietly\n * fall back to the `fallback` prop (typically a plain hyperlink) so a single\n * broken third-party preview can't crash a whole article view.\n *\n * Named `OGLinkErrorBoundary` (not the generic `ErrorBoundary`) because the\n * lib already exports a separate `ErrorBoundary` from\n * `components/features/error-boundary.tsx`. The top-level `components/index.ts`\n * barrel re-exports both `./embeds` and `./features` via `export *`, so a\n * second `ErrorBoundary` here collides as TS2308.\n */\nexport class OGLinkErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {\n constructor(props: ErrorBoundaryProps) {\n super(props)\n this.state = { hasError: false }\n }\n\n static getDerivedStateFromError(): ErrorBoundaryState {\n return { hasError: true }\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n console.warn('Link preview error caught by boundary:', error, errorInfo)\n }\n\n render() {\n if (this.state.hasError) return this.props.fallback\n return this.props.children\n }\n}\n\n/**\n * Builds a placeholder image URL when the scrape returns no image. Hub passes\n * its own `buildOgPlaceholderUrl` (which resolves CSS-var ODS colors against\n * the platform's brand palette + hits `/api/og-placeholder`); other embedders\n * can omit the prop to disable the placeholder entirely.\n *\n * Receives the post-scrape `title` and `siteName` so the placeholder can echo\n * the actual card content, not a generic graphic.\n */\nexport type BuildPlaceholderUrl = (\n title: string,\n siteName: string,\n) => string | null\n\nexport interface OGLinkPreviewProps {\n /** The external URL to preview. */\n url: string\n /** Origin / base URL the OG endpoint is served from. Empty / undefined\n * means same-origin (hub-direct use). Embed contexts pass the hub's\n * origin here (e.g. `'https://hub.example.com'`) so the fetch hits\n * the hub instead of the embedder origin.\n *\n * Pattern matches lib's `useNatsDialogSubscription({apiBaseUrl})` +\n * `buildSuggestionUrl({apiBaseUrl})` so all embed-ready surfaces share\n * one configuration knob. */\n apiBaseUrl?: string\n /** Path of the OG endpoint on the configured base. Default\n * `'/api/blog/og-scraper'` matches the hub's route. Override if the\n * embedder serves the same `OGData` shape from a different path. */\n ogEndpointPath?: string\n /** Optional placeholder-builder. Omit to disable the placeholder image\n * (the card then degrades to a favicon+title chip when no scraped image\n * is available). The hub injects its `buildOgPlaceholderUrl` here. */\n buildPlaceholderUrl?: BuildPlaceholderUrl\n /** Override the scraped title (used by publication cards that already know\n * the title locally — e.g. a CMS-managed press link). */\n fallbackTitle?: string\n /** Override the scraped description. */\n fallbackDescription?: string\n /** Override the scraped image — useful when the scrape returns no image but\n * the embedder has a CMS-stored hero image to fall back to. */\n fallbackImage?: string\n /** Publication / source name shown alongside the favicon (e.g. \"TechCrunch\"). */\n publicationName?: string\n /** Publication logo URL shown alongside the title (defaults to favicon). */\n publicationLogo?: string\n /** Card variant. `compact` = horizontal layout (~120px tall) suited for\n * in-doc placements; `default` = larger vertical layout for press / hero\n * positions. */\n variant?: 'default' | 'compact'\n /** Disable the synthesized placeholder image even when `buildPlaceholderUrl`\n * is provided — used by the markdown renderer to keep doc cards lighter. */\n enablePlaceholder?: boolean\n}\n\nfunction getDomain(urlStr: string): string {\n try { return new URL(urlStr).hostname.replace('www.', '') }\n catch { return 'External Link' }\n}\n\nfunction domainToTitle(domain: string): string {\n return domain.split('.')[0].replace(/-/g, ' ').replace(/\\b\\w/g, c => c.toUpperCase())\n}\n\nconst ExternalLinkIcon = ({ size = 16 }: { size?: number }) => (\n <svg width={size} height={size} fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" className=\"text-ods-text-secondary group-hover:text-ods-accent transition-colors flex-shrink-0\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14\" />\n </svg>\n)\n\nconst Favicon = ({ src, size = 'w-6 h-6' }: { src: string; size?: string }) => (\n <img src={src} alt=\"\" className={size} onError={(e) => { (e.target as HTMLImageElement).style.display = 'none' }} />\n)\n\n/**\n * Rich Open-Graph link preview card with skeleton, fallback, and image-edge\n * background detection.\n *\n * Flow:\n * 1. Validate URL early (no network for malformed input, localhost, or\n * RFC1918 ranges — those render as plain `<a>` tags).\n * 2. `GET ogEndpointPath?url=<encoded>` — embedder serves the shape declared\n * in `OGData`.\n * 3. Resolve image: scraped og:image → `originalImage` fallback → `fallbackImage`\n * prop → `buildPlaceholderUrl(title, siteName)`. Each step has its own\n * error toggle so a 404 / CORS-tainted image gracefully degrades.\n * 4. Extract a letterbox background color from the resolved image via\n * `useImageEdgeColor`. Same-origin proxy is REQUIRED for cross-origin\n * images so the `<canvas>` extraction doesn't taint.\n * 5. Render compact (h-[120px] horizontal) or default (vertical w/ aspect-video\n * hero) variant, with image-less degraded variants for each.\n */\nexport const OGLinkPreview: React.FC<OGLinkPreviewProps> = ({\n url,\n apiBaseUrl,\n ogEndpointPath = '/api/blog/og-scraper',\n buildPlaceholderUrl,\n fallbackTitle,\n fallbackDescription,\n fallbackImage,\n publicationName,\n publicationLogo,\n variant = 'default',\n enablePlaceholder = true,\n}) => {\n const [ogData, setOgData] = useState<OGData | null>(null)\n const [loading, setLoading] = useState(true)\n const [error, setError] = useState(false)\n const [imageError, setImageError] = useState(false)\n const [originalImageError, setOriginalImageError] = useState(false)\n const [fallbackImageError, setFallbackImageError] = useState(false)\n\n let isValidUrl = true\n let isLocalhost = false\n try {\n if (url && typeof url === 'string') {\n const urlObj = new URL(url)\n if (['localhost', '127.0.0.1', '0.0.0.0'].includes(urlObj.hostname) ||\n urlObj.hostname.startsWith('192.168.') || urlObj.hostname.startsWith('10.') || urlObj.hostname.startsWith('172.')) {\n isLocalhost = true\n }\n } else {\n isValidUrl = false\n }\n } catch {\n isValidUrl = false\n }\n\n useEffect(() => {\n if (!isValidUrl || isLocalhost) return\n\n const fetchOGData = async () => {\n try {\n new URL(url)\n setLoading(true)\n // Compose `${base}${path}?url=…`. Empty base → relative path\n // (same-origin); absolute base → cross-origin embed against the hub.\n // Plain string concat is safer than `new URL(path, base)` because\n // the latter resolves `path` against the BASE's pathname when\n // `path` is relative, producing surprising URLs when the embedder\n // serves the lib from a subpath.\n const endpoint = `${apiBaseUrl ?? ''}${ogEndpointPath}?url=${encodeURIComponent(url)}`\n const response = await fetch(endpoint)\n if (response.ok) {\n const data = await response.json()\n if (data?.title && data.title !== 'Link Preview Unavailable') {\n setOgData(data)\n } else {\n setError(true)\n }\n } else {\n setError(true)\n }\n } catch {\n setError(true)\n } finally {\n setLoading(false)\n }\n }\n\n fetchOGData()\n }, [url, isValidUrl, isLocalhost, apiBaseUrl, ogEndpointPath])\n\n const isCompact = variant === 'compact'\n const domain = getDomain(url)\n\n const effectiveData: OGData | null = ogData ?? (error ? {\n title: fallbackTitle || domainToTitle(domain),\n description: fallbackDescription || domain,\n image: '',\n url,\n siteName: publicationName || domain,\n type: 'website',\n favicon: `https://www.google.com/s2/favicons?domain=${domain}&sz=32`,\n } : null)\n\n // Hub-injected placeholder builder — fires only when the post-scrape image\n // chain is empty AND `enablePlaceholder` is true. `null` when unprovided.\n const placeholderImageUrl =\n enablePlaceholder && buildPlaceholderUrl && effectiveData?.title\n ? buildPlaceholderUrl(effectiveData.title, effectiveData.siteName || domain)\n : null\n\n const resolvedImageUrl = (effectiveData?.image && !imageError)\n ? effectiveData.image\n : (effectiveData?.originalImage && !originalImageError)\n ? effectiveData.originalImage\n : (fallbackImage && !fallbackImageError)\n ? fallbackImage\n : placeholderImageUrl\n\n const hasImage = !!resolvedImageUrl\n const isFallbackImage = resolvedImageUrl === fallbackImage\n const isPlaceholder = resolvedImageUrl === placeholderImageUrl && !isFallbackImage\n const bgColor = useImageEdgeColor(resolvedImageUrl ?? null, 'var(--ods-bg-secondary)')\n\n const renderSkeleton = () => isCompact ? (\n <div className=\"my-4\">\n <div className=\"flex flex-row border border-ods-border rounded-lg overflow-hidden bg-ods-card h-[120px]\">\n <div className=\"w-[200px] h-full flex-shrink-0 bg-ods-skeleton animate-pulse\" />\n <div className=\"flex-1 p-3 flex flex-col justify-center\">\n <div className=\"bg-ods-skeleton rounded animate-pulse h-4 w-3/4 mb-2\" />\n <div className=\"bg-ods-skeleton rounded animate-pulse h-3 w-full mb-1\" />\n <div className=\"bg-ods-skeleton rounded animate-pulse h-3 w-2/3 mb-2\" />\n <div className=\"bg-ods-skeleton rounded animate-pulse h-3 w-1/3\" />\n </div>\n </div>\n </div>\n ) : (\n <div className=\"my-6\">\n <div className=\"block border border-ods-border rounded-lg overflow-hidden bg-ods-card\">\n <div className=\"aspect-video w-full bg-ods-skeleton overflow-hidden relative animate-pulse\" />\n <div className=\"p-4\">\n <div className=\"flex items-start gap-3\">\n <div className=\"w-6 h-6 bg-ods-skeleton rounded flex-shrink-0 mt-0.5 animate-pulse\" />\n <div className=\"flex-1 min-w-0\">\n <div className=\"h-[2.5rem] leading-[1.25rem] mb-2 overflow-hidden\">\n <div className=\"bg-ods-skeleton rounded animate-pulse\" style={{ height: '1.25rem', marginBottom: '0.25rem' }} />\n <div className=\"bg-ods-skeleton rounded animate-pulse w-3/4\" style={{ height: '1.25rem' }} />\n </div>\n <div className=\"h-[2.5rem] leading-[1.25rem] mb-2 overflow-hidden\">\n <div className=\"bg-ods-skeleton rounded animate-pulse\" style={{ height: '1.25rem', marginBottom: '0.25rem' }} />\n <div className=\"bg-ods-skeleton rounded animate-pulse w-5/6\" style={{ height: '1.25rem' }} />\n </div>\n <div className=\"flex items-center gap-2\">\n <div className=\"bg-ods-skeleton rounded animate-pulse\" style={{ height: '0.75rem', width: '6rem' }} />\n <div className=\"bg-ods-skeleton rounded animate-pulse\" style={{ height: '0.75rem', width: '5rem' }} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n\n if (!url || typeof url !== 'string' || !isValidUrl) return renderSkeleton()\n\n if (isLocalhost) {\n return (\n <div className=\"my-6\">\n <a href={url} target=\"_blank\" rel=\"noopener noreferrer\"\n className=\"inline-flex items-center gap-2 text-ods-accent hover:text-ods-accent-hover transition-colors\">\n <span className=\"underline\">{url}</span>\n <ExternalLinkIcon size={14} />\n </a>\n </div>\n )\n }\n\n if (loading) return renderSkeleton()\n if (!effectiveData) return renderSkeleton()\n\n const title = fallbackTitle || effectiveData.title\n // Empty string when the scrape returned nothing — descriptions render\n // conditionally below. Avoids the legacy `'No description available'` filler\n // that signaled \"broken card\" to users.\n const description = fallbackDescription || effectiveData.description || ''\n const ogDomain = getDomain(effectiveData.url)\n const faviconSrc = effectiveData.favicon || `https://www.google.com/s2/favicons?domain=${ogDomain}&sz=32`\n const logoSrc = publicationLogo || faviconSrc\n\n const handleImageError = () => {\n if (effectiveData.image && !imageError) setImageError(true)\n else if (effectiveData.originalImage && !originalImageError) setOriginalImageError(true)\n else setFallbackImageError(true)\n }\n\n const renderImage = () => {\n if (!resolvedImageUrl) return null\n if (isPlaceholder) {\n return (\n <img src={resolvedImageUrl} alt={title}\n className=\"absolute inset-0 w-full h-full object-cover rounded-md\" />\n )\n }\n if (isFallbackImage) {\n return (\n <Image src={resolvedImageUrl} alt={title} fill\n className=\"object-contain rounded-md group-hover:scale-105 transition-transform duration-300\"\n onError={handleImageError}\n unoptimized={resolvedImageUrl.includes('/render/image/')} />\n )\n }\n return (\n <img src={resolvedImageUrl} alt={title}\n className=\"absolute inset-0 w-full h-full object-contain rounded-md group-hover:scale-105 transition-transform duration-300\"\n onError={handleImageError} />\n )\n }\n\n if (isCompact) {\n if (!hasImage) {\n return (\n <div className=\"my-4\">\n <a href={effectiveData.url} target=\"_blank\" rel=\"noopener noreferrer\"\n className=\"flex flex-row items-center gap-3 border border-ods-border rounded-lg overflow-hidden bg-ods-card hover:border-ods-accent transition-all duration-200 group px-4 py-3\">\n <div className=\"w-8 h-8 bg-ods-bg-secondary rounded-lg flex items-center justify-center flex-shrink-0\">\n <Favicon src={faviconSrc} size=\"w-5 h-5\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"font-sans text-sm font-semibold text-ods-text-primary group-hover:text-ods-accent transition-colors truncate\">{title}</h3>\n {description && (\n <p className=\"font-sans text-xs text-ods-text-secondary truncate\">{description}</p>\n )}\n </div>\n <ExternalLinkIcon size={14} />\n </a>\n </div>\n )\n }\n return (\n <div className=\"my-4\">\n <a href={effectiveData.url} target=\"_blank\" rel=\"noopener noreferrer\"\n className=\"flex flex-row border border-ods-border rounded-lg overflow-hidden bg-ods-card hover:border-ods-accent transition-colors group h-[120px]\">\n <div className=\"w-[200px] h-full flex-shrink-0 overflow-hidden relative flex items-center justify-center rounded-lg transition-colors duration-300\" style={{ backgroundColor: bgColor }}>\n {renderImage()}\n </div>\n <div className=\"flex-1 p-3 flex flex-col justify-center min-w-0\">\n <h3 className=\"font-sans text-sm font-semibold text-ods-text-primary overflow-hidden group-hover:text-ods-accent transition-colors\"\n style={{ display: '-webkit-box', WebkitLineClamp: 1, WebkitBoxOrient: 'vertical' }}>{title}</h3>\n {description && (\n <p className=\"font-sans text-xs text-ods-text-secondary overflow-hidden mt-1\"\n style={{ display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical' }}>{description}</p>\n )}\n <div className=\"text-xs text-ods-text-secondary mt-1 truncate\">{effectiveData.siteName || ogDomain}</div>\n </div>\n </a>\n </div>\n )\n }\n\n if (!hasImage) {\n return (\n <div className=\"my-6\">\n <a href={effectiveData.url} target=\"_blank\" rel=\"noopener noreferrer\"\n className=\"flex items-center gap-3 border border-ods-border rounded-lg overflow-hidden bg-ods-card hover:border-ods-accent transition-all duration-200 group px-4 py-3\">\n <div className=\"w-10 h-10 bg-ods-bg-secondary rounded-lg flex items-center justify-center flex-shrink-0\">\n <Favicon src={faviconSrc} />\n </div>\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"font-sans font-semibold text-ods-text-primary text-base group-hover:text-ods-accent transition-colors truncate\">{title}</h3>\n {description && (\n <p className=\"font-sans text-sm text-ods-text-secondary truncate\">{description}</p>\n )}\n </div>\n <ExternalLinkIcon />\n </a>\n </div>\n )\n }\n\n return (\n <div className=\"my-6\">\n <a href={effectiveData.url} target=\"_blank\" rel=\"noopener noreferrer\"\n className=\"block border border-ods-border rounded-lg overflow-hidden bg-ods-card hover:border-ods-accent transition-colors group\">\n <div className=\"aspect-video w-full overflow-hidden relative flex items-center justify-center rounded-lg transition-colors duration-300\" style={{ backgroundColor: bgColor }}>\n {renderImage()}\n </div>\n <div className=\"p-4\">\n <div className=\"flex items-start gap-3\">\n <img src={logoSrc} alt={publicationName || ''} className=\"w-6 h-6 rounded object-contain flex-shrink-0 mt-0.5\"\n onError={(e) => { (e.target as HTMLImageElement).style.display = 'none' }} />\n <div className=\"flex-1 min-w-0\">\n <h3 className=\"font-sans font-semibold text-ods-text-primary text-base overflow-hidden group-hover:text-ods-accent transition-colors h-[2.5rem] leading-[1.25rem] mb-2\"\n style={{ display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical' }}>{title}</h3>\n {description && (\n <p className=\"font-sans text-sm text-ods-text-secondary overflow-hidden h-[2.5rem] leading-[1.25rem] mb-2\"\n style={{ display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical' }}>{description}</p>\n )}\n <div className=\"flex items-center gap-2 text-xs text-ods-text-secondary\">\n <span className=\"font-medium\">{effectiveData.siteName}</span>\n <span>•</span>\n <span className=\"truncate\">{ogDomain}</span>\n </div>\n </div>\n </div>\n </div>\n </a>\n </div>\n )\n}\n"]}
@@ -6,13 +6,13 @@ import {
6
6
  resolveExternalNavigation,
7
7
  resolveSourceIcon,
8
8
  stripSameOriginToPath
9
- } from "./chunk-PC746XCO.js";
9
+ } from "./chunk-FQJK446R.js";
10
10
  import {
11
11
  useDebounce
12
- } from "./chunk-2QG57XOJ.js";
12
+ } from "./chunk-POKKCWKF.js";
13
13
  import {
14
14
  useChatRuntime
15
- } from "./chunk-IZ7JSBFP.js";
15
+ } from "./chunk-LCNMR277.js";
16
16
  import {
17
17
  useRouter
18
18
  } from "./chunk-PLJLE4A4.js";
@@ -221,12 +221,11 @@ function useDocSearch(config) {
221
221
  onNavigate,
222
222
  tableIds,
223
223
  onInPageSwap,
224
- searchEndpoint
224
+ searchEndpoint = "/api/docs/search"
225
225
  } = config;
226
226
  const tableIdsKey = tableIds && tableIds.length > 0 ? tableIds.join(",") : "";
227
227
  const router = useRouter();
228
228
  const runtime = useChatRuntime();
229
- const resolvedSearchEndpoint = searchEndpoint ?? runtime?.endpoints.docsSearchUrl ?? "/api/docs/search";
230
229
  const [query, setQuery] = useState("");
231
230
  const [results, setResults] = useState([]);
232
231
  const [isFetching, setIsFetching] = useState(false);
@@ -247,7 +246,7 @@ function useDocSearch(config) {
247
246
  limit: "10"
248
247
  });
249
248
  if (tableIdsKey) params.set("tableIds", tableIdsKey);
250
- const response = await fetch(`${resolvedSearchEndpoint}?${params.toString()}`);
249
+ const response = await fetch(`${searchEndpoint}?${params.toString()}`);
251
250
  if (!response.ok) {
252
251
  throw new Error(`Search request failed: ${response.status}`);
253
252
  }
@@ -271,7 +270,7 @@ function useDocSearch(config) {
271
270
  return () => {
272
271
  cancelled = true;
273
272
  };
274
- }, [debouncedQuery, source, tableIdsKey, resolvedSearchEndpoint]);
273
+ }, [debouncedQuery, source, tableIdsKey, searchEndpoint]);
275
274
  const isLoading = query.trim().length >= 2 && (query !== debouncedQuery || isFetching);
276
275
  const [keepOpen, setKeepOpen] = useState(false);
277
276
  const handleResultSelect = useCallback(
@@ -346,4 +345,4 @@ export {
346
345
  resolveSearchResultAction,
347
346
  useDocSearch
348
347
  };
349
- //# sourceMappingURL=chunk-AD6C23QY.js.map
348
+ //# sourceMappingURL=chunk-6GCI7JOE.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/shared/doc-search/format-relative-path.ts","../src/components/shared/doc-search/doc-search-result-row.tsx","../src/components/shared/doc-search/doc-search-bar.tsx","../src/components/shared/doc-search/map-doc-search-results.ts","../src/components/shared/doc-search/resolve-search-result-action.ts","../src/components/shared/doc-search/use-doc-search.ts"],"sourcesContent":["/**\n * Format a full document path as a breadcrumb trail.\n * Shows parent folders only (excludes the last segment / filename).\n *\n * @example\n * formatRelativePath('openframe-oss-tenant/architecture/api-controllers.md')\n * // → 'Openframe oss tenant / Architecture'\n */\nexport function formatRelativePath(fullPath: string): string {\n if (!fullPath) return ''\n const segments = fullPath.replace(/\\.md$/, '').split('/')\n // Show only parent path (exclude the filename itself since the title already shows it)\n const parentSegments = segments.length > 1 ? segments.slice(0, -1) : segments\n return parentSegments\n .map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1).replace(/-/g, ' '))\n .join(' / ')\n}\n","'use client'\n\n/**\n * Single row in the `<SearchInput>` dropdown — the standard layout\n * used by every doc-search-backed surface (company-hub data-room\n * search bar, onboarding-guide catalog search, …). Single source of\n * truth for the row appearance so search dropdowns are visually\n * identical everywhere.\n *\n * Resolves the source icon via the same `resolveSourceIcon()`\n * registry the inline chat-card refs use, so a row pointing at e.g.\n * an onboarding-guide surfaces the SAME `<GraduationCap>` glyph the\n * chat card surfaces — no cross-surface drift.\n */\n\nimport { resolveSourceIcon } from '../../chat/utils/source-row-cta'\nimport { formatRelativePath } from './format-relative-path'\n\n/**\n * Minimal result shape this row renders. Compatible with any\n * doc-search hook whose result type exposes `{ title?, path?,\n * metadata? }`. The two hub consumers (onboarding-guide catalog,\n * data-room sidebar) both satisfy this shape via their\n * `useDocSearch` hook result.\n */\nexport interface DocSearchResultRowEntry {\n title?: string\n path?: string\n metadata?: Record<string, unknown>\n}\n\nexport interface DocSearchResultRowProps {\n result: DocSearchResultRowEntry\n isHighlighted: boolean\n}\n\nexport function DocSearchResultRow({\n result,\n isHighlighted,\n}: DocSearchResultRowProps) {\n const docType = (result.metadata?.documentType as string) || undefined\n const sourceRepo = (result.metadata?.sourceRepo as string) || undefined\n const { Icon: SourceIcon, label: iconLabel } = resolveSourceIcon({\n sourceRepo,\n documentType: docType,\n })\n const isGroup = result.metadata?.isGroup as boolean | undefined\n\n return (\n <div className=\"flex items-center gap-3 w-full min-w-0\">\n <span\n className=\"flex-shrink-0 text-ods-text-secondary\"\n title={iconLabel}\n >\n <SourceIcon className=\"size-4\" />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div\n className={`text-sm font-medium leading-5 truncate ${\n isHighlighted ? 'text-ods-accent' : 'text-ods-text-primary'\n }`}\n >\n {result.title || result.path}\n </div>\n {!isGroup && result.path?.includes('/') && (\n <div className=\"text-xs leading-4 text-ods-text-secondary truncate mt-0.5\">\n {formatRelativePath(result.path)}\n </div>\n )}\n </div>\n </div>\n )\n}\n","'use client'\n\n/**\n * `<DocSearchBar>` — the canonical RAG-search dropdown surface.\n *\n * Mounted by every doc-search consumer (data-room sidebar, onboarding-\n * guide catalog, and any future surface that needs typeahead against\n * `/api/docs/search`). Wraps `<SearchInput>` with the lib's standard\n * `<DocSearchResultRow>` so the dropdown looks identical everywhere.\n *\n * ## Why a presentation component, not a \"search bar that owns its\n * own hook\"\n *\n * The data-fetching hook (`useDocSearch`) lives hub-side because it\n * depends on hub-only context (`useDocNavigation`, the rag-table-\n * config registry, the hub's `decideNewTab` helper). Moving the hook\n * would cascade ~5 more file migrations into the lib.\n *\n * Instead, the hook stays hub-side and callers pass its result into\n * this component as plain props. Both consumers shrink to ~5 lines.\n */\n\nimport type { ReactNode } from 'react'\nimport { SearchInput, type SearchResult } from '../../ui/search-input'\nimport { DocSearchResultRow } from './doc-search-result-row'\n\nexport interface DocSearchBarProps {\n placeholder: string\n query: string\n onQueryChange: (value: string) => void\n /** Hook-fetched results. Reuses the lib's `<SearchInput>` `SearchResult`\n * shape directly so callers don't translate. */\n results: SearchResult[]\n isLoading: boolean\n /** Result selection handler. Mirrors `<SearchInput>` — the second\n * `modifiers` argument is preserved so cmd-click / shift-click on\n * a result row still forces new-tab behavior. Hub `useDocSearch`\n * reads these to short-circuit to `window.open()`. */\n onResultSelect: (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean\n ctrlKey?: boolean\n shiftKey?: boolean\n altKey?: boolean\n button?: number\n },\n ) => void\n /** Lets the caller's hook force the dropdown open after a recent\n * internal action (e.g. result navigation). `undefined` falls back\n * to `<SearchInput>`'s built-in focus/hover heuristics. */\n showDropdown?: boolean\n /** Defaults to 2 — matches the existing data-room and onboarding-\n * guide consumers. Override only if a surface needs different\n * typeahead semantics. */\n minQueryLength?: number\n /** Defaults to 0 — both existing consumers debounce inside the\n * hook, not the input. */\n debounceMs?: number\n className?: string\n /** Optional row-renderer override. Defaults to the lib's standard\n * `<DocSearchResultRow>` (source icon + title + path breadcrumb).\n * Override only when a surface needs custom row chrome. */\n renderResult?: (result: SearchResult, isHighlighted: boolean) => ReactNode\n}\n\nexport function DocSearchBar({\n placeholder,\n query,\n onQueryChange,\n results,\n isLoading,\n onResultSelect,\n showDropdown,\n minQueryLength = 2,\n debounceMs = 0,\n className = 'w-full',\n renderResult,\n}: DocSearchBarProps) {\n return (\n <SearchInput\n placeholder={placeholder}\n value={query}\n onChange={onQueryChange}\n results={results}\n isLoading={isLoading}\n onResultSelect={onResultSelect}\n showDropdown={showDropdown || undefined}\n debounceMs={debounceMs}\n minQueryLength={minQueryLength}\n className={className}\n renderResult={\n renderResult ??\n ((result, isHighlighted) => (\n <DocSearchResultRow result={result} isHighlighted={isHighlighted} />\n ))\n }\n />\n )\n}\n","/**\n * Map RAG `/api/docs/search` wire results into the `<DocSearchBar>`\n * dropdown's row shape, collapsing entity-table rows into grouped\n * results so the dropdown lists ONE \"Cap Table (12 records)\" row\n * instead of 12 individual rows.\n *\n * Pure transform — no telemetry, no navigation, no React deps. Lifted\n * from the hub's `hooks/use-docs.ts:mapDocSearchResults` (the hub's\n * `traceCompose` call was hub-only telemetry and is intentionally\n * dropped — callers that want logging can wrap this helper).\n */\n\nimport type { SearchResult } from '../../ui/search-input'\nimport type { DocSearchResult } from './types'\n\n/** Source repos that should be collapsed into grouped results in the search bar.\n * Only financial tables (all rows link to the same admin page).\n * Content tables (blog, webinar, podcast, etc.) stay individual since each has a unique URL. */\nconst SEARCH_GROUP_REPOS = new Set([\n 'financial-cap-table',\n 'financial-kpis',\n 'financial-pnl',\n 'financial-balance-sheet',\n 'financial-cash-flow',\n])\n\nconst ENTITY_LABELS: Record<string, string> = {\n 'financial-cap-table': 'Cap Table',\n 'financial-kpis': 'Financial KPIs',\n 'financial-pnl': 'Profit & Loss',\n 'financial-balance-sheet': 'Balance Sheets',\n 'financial-cash-flow': 'Cash Flow',\n 'blog-posts': 'Blog Posts',\n 'product-releases': 'Product Releases',\n 'case-studies': 'Case Studies',\n webinars: 'Webinars',\n events: 'Events',\n podcasts: 'Podcasts',\n}\n\nexport function mapDocSearchResults(docs: DocSearchResult[]): SearchResult[] {\n const entityGroups = new Map<string, DocSearchResult[]>()\n // Track insertion order — groups appear where the FIRST row of that\n // repo appeared in the response.\n const order: Array<\n { type: 'entity'; repo: string } | { type: 'doc'; doc: DocSearchResult }\n > = []\n const seenRepos = new Set<string>()\n\n for (const doc of docs) {\n if (doc.sourceRepo && SEARCH_GROUP_REPOS.has(doc.sourceRepo)) {\n const group = entityGroups.get(doc.sourceRepo) || []\n group.push(doc)\n entityGroups.set(doc.sourceRepo, group)\n if (!seenRepos.has(doc.sourceRepo)) {\n seenRepos.add(doc.sourceRepo)\n order.push({ type: 'entity', repo: doc.sourceRepo })\n }\n } else {\n order.push({ type: 'doc', doc })\n }\n }\n\n const results: SearchResult[] = []\n for (const entry of order) {\n if (entry.type === 'entity') {\n const rows = entityGroups.get(entry.repo)!\n const label = ENTITY_LABELS[entry.repo] || entry.repo\n results.push({\n id: `group-${entry.repo}`,\n title: `${label} (${rows.length} ${rows.length === 1 ? 'record' : 'records'})`,\n path: rows[0].path,\n type: 'file',\n metadata: {\n documentType: rows[0].documentType,\n externalUrl: rows[0].externalUrl,\n sourceRepo: entry.repo,\n id: rows[0].entityId,\n isGroup: true,\n items: rows.map((r) => ({\n name: r.name,\n externalUrl: r.externalUrl,\n id: r.entityId,\n sourceRepo: r.sourceRepo,\n documentType: r.documentType,\n })),\n },\n })\n } else {\n const doc = entry.doc\n const isNonMarkdown = doc.documentType && doc.documentType !== 'markdown'\n results.push({\n id: doc.path,\n title: doc.name,\n description: isNonMarkdown ? doc.name : doc.snippet,\n path: doc.path,\n type: doc.type,\n metadata: {\n matchType: doc.matchType,\n ...(doc.documentType ? { documentType: doc.documentType } : {}),\n ...(doc.externalUrl ? { externalUrl: doc.externalUrl } : {}),\n ...(doc.targetPlatform != null\n ? { targetPlatform: doc.targetPlatform }\n : {}),\n ...(doc.sourceRepo ? { sourceRepo: doc.sourceRepo } : {}),\n ...(doc.entityId ? { id: doc.entityId } : {}),\n },\n })\n }\n }\n\n return results\n}\n","/**\n * Resolve what should happen when the user picks a search result.\n * Returns one of five typed actions so the caller is a single switch.\n *\n * Resolution order:\n * 1. `externalUrl` present → use `decideNewTab` to choose same-tab vs\n * new-tab against the row's `targetPlatform`.\n * 2. Row has `id` + `sourceRepo` + `documentType` → synth an Ask-AI\n * action (entity drill-in via primary key, no URL).\n * 3. Row has only `path` → legacy navigation fallback.\n * 4. Nothing actionable → noop.\n *\n * Lifted from the hub's `hooks/use-docs.ts:resolveSearchResultAction`.\n * Pure — no React, no telemetry.\n */\n\nimport type { SearchResult } from '../../ui/search-input'\nimport type { ChatRef } from '../../chat/chat-ref.types'\nimport { decideNewTab } from '../../chat/utils/decide-new-tab'\n\nexport type SearchResultAction =\n | { kind: 'navigate-same-tab'; href: string }\n | { kind: 'navigate-new-tab'; href: string }\n | { kind: 'ask-ai'; detail: { source: string; ref: ChatRef } }\n | { kind: 'route'; path: string }\n | { kind: 'noop' }\n\nexport function resolveSearchResultAction(\n result: SearchResult,\n source: string,\n runtimeMode?: 'host' | 'embed',\n): SearchResultAction {\n const meta = result.metadata ?? {}\n const externalUrl = meta.externalUrl as string | undefined\n if (externalUrl) {\n // Same pure helper `useNavLink` and `useUnifiedNav` call — single\n // decision rule across cards, chips, and autocomplete rows. Thread\n // the caller's `source` as `currentSource` so the platform-vs-\n // platform comparison matches the hub's pre-migration behavior.\n const targetPlatform = meta.targetPlatform as string | null | undefined\n const isNewTab = decideNewTab({\n href: externalUrl,\n targetPlatform,\n surface: 'useUnifiedNav',\n runtimeMode,\n currentSource: source,\n })\n return isNewTab\n ? { kind: 'navigate-new-tab', href: externalUrl }\n : { kind: 'navigate-same-tab', href: externalUrl }\n }\n const rowId = meta.id as string | undefined\n const sourceRepo = meta.sourceRepo as string | undefined\n const documentType = meta.documentType as string | undefined\n if (rowId && sourceRepo && documentType) {\n return {\n kind: 'ask-ai',\n detail: {\n source,\n ref: { type: documentType, id: rowId, title: result.title, url: null },\n },\n }\n }\n if (result.path) {\n return { kind: 'route', path: result.path }\n }\n return { kind: 'noop' }\n}\n","'use client'\n\n/**\n * `useDocSearch` — debounced RAG-search hook against `/api/docs/search`.\n *\n * Pure fetch + navigation glue. Embedders can mount this directly\n * (any host with a reverse-proxy that exposes `/api/docs/search` will\n * work). Hub callers wire it into the lib `<DocSearchBar>` for the\n * canonical typeahead dropdown.\n *\n * ## What moved from hub to lib\n *\n * Lifted from `multi-platform-hub/hooks/use-docs.ts:useDocSearch`. Two\n * hub-only concerns are now optional injection points instead of\n * direct imports:\n *\n * - `useDocNavigation()` (hub's in-page doc-tree swap) → optional\n * `onInPageSwap?: (path: string) => boolean` config callback. When\n * present and returns true, the hook treats a same-origin result\n * click as \"handled in-page\"; when absent or returns false, the\n * hook falls back to `onNavigate(path)` (`router.push` on hub,\n * `window.location.assign` on bare embedders).\n * - `traceCompose` (hub-only telemetry) → dropped. The lib has no\n * equivalent runtime-context yet; bring it back when there is one.\n *\n * Everything else (debounce, `useChatRuntime` for embed-mode short-\n * circuit, embed-shim router, the action-resolver + result-mapper) is\n * now lib-resident.\n */\n\nimport { useState, useEffect, useCallback } from 'react'\nimport { useRouter } from '../../../embed-shims'\nimport { useDebounce } from '../../../hooks/ui/use-debounce'\nimport { useChatRuntime } from '../../../contexts/chat-runtime-context'\nimport type { SearchResult } from '../../ui/search-input'\nimport {\n resolveExternalNavigation,\n stripSameOriginToPath,\n NEW_TAB_FEATURES,\n} from '../../chat/utils/chat-nav-resolution'\nimport type { DocSearchResult } from './types'\nimport { mapDocSearchResults } from './map-doc-search-results'\nimport { resolveSearchResultAction } from './resolve-search-result-action'\n\nexport interface UseDocSearchConfig {\n /** Discriminator passed to `/api/docs/search?source=` (e.g.\n * `'openframe'`). Embedders set it to whatever discriminator their\n * reverse-proxy expects. */\n source: string\n /** Base route prefix this search lives under (e.g. `'/onboarding-guides'`).\n * When a result's href starts with `${baseRoute}/`, the hook\n * attempts the optional in-page swap path before falling through\n * to a full nav. */\n baseRoute: string\n /** Imperative navigation fallback. Called when no override\n * (in-page swap, new-tab) applies. Hub callers pass\n * `(path) => router.push(path)`; embedders pass an equivalent. */\n onNavigate: (path: string) => void\n /** Optional `RagTableConfig.id` list to narrow the search to specific\n * tables (e.g. `['onboarding-guides']`). Forwarded to\n * `/api/docs/search?tableIds=…` which intersects with the source's\n * standing set. */\n tableIds?: string[]\n /** Optional in-page swap callback. When the result's href is under\n * `baseRoute` AND this callback returns true, the hook treats the\n * click as handled in-page (no router push). Hub's\n * `<DocumentationSection>` wires this to\n * `useDocNavigation().navigate(path)`. */\n onInPageSwap?: (path: string) => boolean\n /** Optional endpoint override. Defaults to `'/api/docs/search'`\n * (the hub's reverse-proxy route). Embedders with a different\n * path can override. */\n searchEndpoint?: string\n}\n\nexport function useDocSearch(config: UseDocSearchConfig) {\n const {\n source,\n baseRoute,\n onNavigate,\n tableIds,\n onInPageSwap,\n searchEndpoint,\n } = config\n const tableIdsKey = tableIds && tableIds.length > 0 ? tableIds.join(',') : ''\n\n const router = useRouter()\n // Optional chat-runtime read — when present and mode='embed' the\n // search-result row click short-circuits to a new-tab open against\n // the absolutized URL. Null/host preserves today's behavior.\n // Also used as the proxy-prefix fallback for `searchEndpoint`, matching\n // how tickets resolves `findTicketUrl`.\n const runtime = useChatRuntime()\n const resolvedSearchEndpoint =\n searchEndpoint ?? runtime?.endpoints.docsSearchUrl ?? '/api/docs/search'\n\n const [query, setQuery] = useState('')\n const [results, setResults] = useState<SearchResult[]>([])\n const [isFetching, setIsFetching] = useState(false)\n const debouncedQuery = useDebounce(query, 300)\n\n useEffect(() => {\n if (!debouncedQuery || debouncedQuery.trim().length < 2) {\n setResults([])\n setIsFetching(false)\n return\n }\n\n let cancelled = false\n\n async function fetchResults() {\n setIsFetching(true)\n try {\n const params = new URLSearchParams({\n q: debouncedQuery,\n source,\n limit: '10',\n })\n if (tableIdsKey) params.set('tableIds', tableIdsKey)\n\n const response = await fetch(`${resolvedSearchEndpoint}?${params.toString()}`)\n if (!response.ok) {\n throw new Error(`Search request failed: ${response.status}`)\n }\n\n const json = await response.json()\n\n if (!cancelled && json.success && Array.isArray(json.data)) {\n const mapped = mapDocSearchResults(json.data as DocSearchResult[])\n setResults(mapped)\n }\n } catch (error) {\n console.error('Doc search error:', error)\n if (!cancelled) {\n setResults([])\n }\n } finally {\n if (!cancelled) {\n setIsFetching(false)\n }\n }\n }\n\n fetchResults()\n\n return () => {\n cancelled = true\n }\n }, [debouncedQuery, source, tableIdsKey, resolvedSearchEndpoint])\n\n // Derived loading state — single source of truth for \"should the\n // dropdown show 'Loading...' instead of 'No results found'\":\n const isLoading =\n query.trim().length >= 2 && (query !== debouncedQuery || isFetching)\n\n // Track whether dropdown should stay open (external link opened in new tab).\n const [keepOpen, setKeepOpen] = useState(false)\n\n const handleResultSelect = useCallback(\n (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean\n ctrlKey?: boolean\n shiftKey?: boolean\n altKey?: boolean\n button?: number\n },\n ) => {\n const action = resolveSearchResultAction(\n result,\n source,\n runtime?.navigation.mode,\n )\n // Modifier / non-primary mouse click → force new tab regardless of\n // same-tab/new-tab decision. The dropdown row is a `<div>`, not an\n // `<a target=\"_blank\">`, so the browser doesn't background-tab\n // natively on cmd-click. Honor it explicitly here for parity with\n // the anchor-based surfaces (cards, chips, related-content). Plain\n // Enter from the keyboard passes `modifiers === undefined`.\n const wantsNewTab =\n modifiers &&\n (modifiers.metaKey ||\n modifiers.ctrlKey ||\n modifiers.shiftKey ||\n modifiers.altKey ||\n (typeof modifiers.button === 'number' && modifiers.button !== 0))\n switch (action.kind) {\n case 'navigate-same-tab': {\n // Embed-mode short-circuit — autocomplete row clicked while\n // the chat panel is hosted inside an embedding app.\n if (runtime?.navigation.mode === 'embed') {\n setKeepOpen(true)\n const targetPlatform =\n (result.metadata?.targetPlatform as string | null | undefined) ?? null\n resolveExternalNavigation({\n href: action.href,\n targetPlatform,\n runtime,\n }).open()\n return\n }\n if (wantsNewTab) {\n setKeepOpen(true)\n window.open(action.href, '_blank', NEW_TAB_FEATURES)\n return\n }\n // Same-origin click:\n // 1. If the href is under the current doc-tree's baseRoute AND\n // an `onInPageSwap` callback is wired AND returns true →\n // consider in-page swap handled.\n // 2. Otherwise → embed-shim `router.push()` (soft RSC nav on\n // Next.js hosts, window.location.assign on bare hosts).\n setKeepOpen(false)\n const path =\n baseRoute && action.href.startsWith(`${baseRoute}/`)\n ? action.href.slice(baseRoute.length + 1)\n : null\n if (path && onInPageSwap?.(path)) return\n router.push(stripSameOriginToPath(action.href))\n return\n }\n case 'navigate-new-tab':\n // Cross-origin (e.g. clicking a flamingo.run release from\n // product-hub) — open in a new tab. Keep dropdown open so the\n // user can pick another result without re-searching.\n setKeepOpen(true)\n window.open(action.href, '_blank', NEW_TAB_FEATURES)\n return\n case 'ask-ai':\n // Row is searchable-but-not-openable (cap_table positions,\n // financial-kpi snapshots, anything backed by\n // `resolveUrl: () => null`). Dispatch a CustomEvent that\n // GlobalAskAI listens for — opens chat + drills via\n // `entityIdFilter` (primary-key only, same as inline-card Ask).\n setKeepOpen(false)\n window.dispatchEvent(\n new CustomEvent('ask-ai:open-with-ref', { detail: action.detail }),\n )\n return\n case 'route':\n // Final fallback: legacy navigation by path. Hits when a row\n // has neither URL nor pk metadata — a mapper/API regression.\n setKeepOpen(false)\n onNavigate(action.path)\n return\n case 'noop':\n return\n }\n },\n [onNavigate, source, baseRoute, router, onInPageSwap, runtime],\n )\n\n // Reset keepOpen when query changes.\n useEffect(() => {\n setKeepOpen(false)\n }, [query])\n\n return {\n query,\n setQuery,\n results,\n isLoading,\n handleResultSelect,\n keepDropdownOpen: keepOpen,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAQO,SAAS,mBAAmB,UAA0B;AAC3D,MAAI,CAAC,SAAU,QAAO;AACtB,QAAM,WAAW,SAAS,QAAQ,SAAS,EAAE,EAAE,MAAM,GAAG;AAExD,QAAM,iBAAiB,SAAS,SAAS,IAAI,SAAS,MAAM,GAAG,EAAE,IAAI;AACrE,SAAO,eACJ,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,EAAE,YAAY,IAAI,IAAI,MAAM,CAAC,EAAE,QAAQ,MAAM,GAAG,CAAC,EAC1E,KAAK,KAAK;AACf;;;ACsCQ,cAEF,YAFE;AAlBD,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AACF,GAA4B;AAC1B,QAAM,UAAW,OAAO,UAAU,gBAA2B;AAC7D,QAAM,aAAc,OAAO,UAAU,cAAyB;AAC9D,QAAM,EAAE,MAAM,YAAY,OAAO,UAAU,IAAI,kBAAkB;AAAA,IAC/D;AAAA,IACA,cAAc;AAAA,EAChB,CAAC;AACD,QAAM,UAAU,OAAO,UAAU;AAEjC,SACE,qBAAC,SAAI,WAAU,0CACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,OAAO;AAAA,QAEP,8BAAC,cAAW,WAAU,UAAS;AAAA;AAAA,IACjC;AAAA,IACA,qBAAC,SAAI,WAAU,kBACb;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW,0CACT,gBAAgB,oBAAoB,uBACtC;AAAA,UAEC,iBAAO,SAAS,OAAO;AAAA;AAAA,MAC1B;AAAA,MACC,CAAC,WAAW,OAAO,MAAM,SAAS,GAAG,KACpC,oBAAC,SAAI,WAAU,6DACZ,6BAAmB,OAAO,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Y,KAAK;AACjB,iBAAO;AAAA,YACL,IAAI,YAAY,wBAAwB,EAAE,QAAQ,OAAO,OAAO,CAAC;AAAA,UACnE;AACA;AAAA,QACF,KAAK;AAGH,sBAAY,KAAK;AACjB,qBAAW,OAAO,IAAI;AACtB;AAAA,QACF,KAAK;AACH;AAAA,MACJ;AAAA,IACF;AAAA,IACA,CAAC,YAAY,QAAQ,WAAW,QAAQ,cAAc,OAAO;AAAA,EAC/D;AAGA,YAAU,MAAM;AACd,gBAAY,KAAK;AAAA,EACnB,GAAG,CAAC,KAAK,CAAC;AAEV,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,EACpB;AACF;","names":["jsx"]}
1
+ {"version":3,"sources":["../src/components/shared/doc-search/format-relative-path.ts","../src/components/shared/doc-search/doc-search-result-row.tsx","../src/components/shared/doc-search/doc-search-bar.tsx","../src/components/shared/doc-search/map-doc-search-results.ts","../src/components/shared/doc-search/resolve-search-result-action.ts","../src/components/shared/doc-search/use-doc-search.ts"],"sourcesContent":["/**\n * Format a full document path as a breadcrumb trail.\n * Shows parent folders only (excludes the last segment / filename).\n *\n * @example\n * formatRelativePath('openframe-oss-tenant/architecture/api-controllers.md')\n * // → 'Openframe oss tenant / Architecture'\n */\nexport function formatRelativePath(fullPath: string): string {\n if (!fullPath) return ''\n const segments = fullPath.replace(/\\.md$/, '').split('/')\n // Show only parent path (exclude the filename itself since the title already shows it)\n const parentSegments = segments.length > 1 ? segments.slice(0, -1) : segments\n return parentSegments\n .map((seg) => seg.charAt(0).toUpperCase() + seg.slice(1).replace(/-/g, ' '))\n .join(' / ')\n}\n","'use client'\n\n/**\n * Single row in the `<SearchInput>` dropdown — the standard layout\n * used by every doc-search-backed surface (company-hub data-room\n * search bar, onboarding-guide catalog search, …). Single source of\n * truth for the row appearance so search dropdowns are visually\n * identical everywhere.\n *\n * Resolves the source icon via the same `resolveSourceIcon()`\n * registry the inline chat-card refs use, so a row pointing at e.g.\n * an onboarding-guide surfaces the SAME `<GraduationCap>` glyph the\n * chat card surfaces — no cross-surface drift.\n */\n\nimport { resolveSourceIcon } from '../../chat/utils/source-row-cta'\nimport { formatRelativePath } from './format-relative-path'\n\n/**\n * Minimal result shape this row renders. Compatible with any\n * doc-search hook whose result type exposes `{ title?, path?,\n * metadata? }`. The two hub consumers (onboarding-guide catalog,\n * data-room sidebar) both satisfy this shape via their\n * `useDocSearch` hook result.\n */\nexport interface DocSearchResultRowEntry {\n title?: string\n path?: string\n metadata?: Record<string, unknown>\n}\n\nexport interface DocSearchResultRowProps {\n result: DocSearchResultRowEntry\n isHighlighted: boolean\n}\n\nexport function DocSearchResultRow({\n result,\n isHighlighted,\n}: DocSearchResultRowProps) {\n const docType = (result.metadata?.documentType as string) || undefined\n const sourceRepo = (result.metadata?.sourceRepo as string) || undefined\n const { Icon: SourceIcon, label: iconLabel } = resolveSourceIcon({\n sourceRepo,\n documentType: docType,\n })\n const isGroup = result.metadata?.isGroup as boolean | undefined\n\n return (\n <div className=\"flex items-center gap-3 w-full min-w-0\">\n <span\n className=\"flex-shrink-0 text-ods-text-secondary\"\n title={iconLabel}\n >\n <SourceIcon className=\"size-4\" />\n </span>\n <div className=\"min-w-0 flex-1\">\n <div\n className={`text-sm font-medium leading-5 truncate ${\n isHighlighted ? 'text-ods-accent' : 'text-ods-text-primary'\n }`}\n >\n {result.title || result.path}\n </div>\n {!isGroup && result.path?.includes('/') && (\n <div className=\"text-xs leading-4 text-ods-text-secondary truncate mt-0.5\">\n {formatRelativePath(result.path)}\n </div>\n )}\n </div>\n </div>\n )\n}\n","'use client'\n\n/**\n * `<DocSearchBar>` — the canonical RAG-search dropdown surface.\n *\n * Mounted by every doc-search consumer (data-room sidebar, onboarding-\n * guide catalog, and any future surface that needs typeahead against\n * `/api/docs/search`). Wraps `<SearchInput>` with the lib's standard\n * `<DocSearchResultRow>` so the dropdown looks identical everywhere.\n *\n * ## Why a presentation component, not a \"search bar that owns its\n * own hook\"\n *\n * The data-fetching hook (`useDocSearch`) lives hub-side because it\n * depends on hub-only context (`useDocNavigation`, the rag-table-\n * config registry, the hub's `decideNewTab` helper). Moving the hook\n * would cascade ~5 more file migrations into the lib.\n *\n * Instead, the hook stays hub-side and callers pass its result into\n * this component as plain props. Both consumers shrink to ~5 lines.\n */\n\nimport type { ReactNode } from 'react'\nimport { SearchInput, type SearchResult } from '../../ui/search-input'\nimport { DocSearchResultRow } from './doc-search-result-row'\n\nexport interface DocSearchBarProps {\n placeholder: string\n query: string\n onQueryChange: (value: string) => void\n /** Hook-fetched results. Reuses the lib's `<SearchInput>` `SearchResult`\n * shape directly so callers don't translate. */\n results: SearchResult[]\n isLoading: boolean\n /** Result selection handler. Mirrors `<SearchInput>` — the second\n * `modifiers` argument is preserved so cmd-click / shift-click on\n * a result row still forces new-tab behavior. Hub `useDocSearch`\n * reads these to short-circuit to `window.open()`. */\n onResultSelect: (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean\n ctrlKey?: boolean\n shiftKey?: boolean\n altKey?: boolean\n button?: number\n },\n ) => void\n /** Lets the caller's hook force the dropdown open after a recent\n * internal action (e.g. result navigation). `undefined` falls back\n * to `<SearchInput>`'s built-in focus/hover heuristics. */\n showDropdown?: boolean\n /** Defaults to 2 — matches the existing data-room and onboarding-\n * guide consumers. Override only if a surface needs different\n * typeahead semantics. */\n minQueryLength?: number\n /** Defaults to 0 — both existing consumers debounce inside the\n * hook, not the input. */\n debounceMs?: number\n className?: string\n /** Optional row-renderer override. Defaults to the lib's standard\n * `<DocSearchResultRow>` (source icon + title + path breadcrumb).\n * Override only when a surface needs custom row chrome. */\n renderResult?: (result: SearchResult, isHighlighted: boolean) => ReactNode\n}\n\nexport function DocSearchBar({\n placeholder,\n query,\n onQueryChange,\n results,\n isLoading,\n onResultSelect,\n showDropdown,\n minQueryLength = 2,\n debounceMs = 0,\n className = 'w-full',\n renderResult,\n}: DocSearchBarProps) {\n return (\n <SearchInput\n placeholder={placeholder}\n value={query}\n onChange={onQueryChange}\n results={results}\n isLoading={isLoading}\n onResultSelect={onResultSelect}\n showDropdown={showDropdown || undefined}\n debounceMs={debounceMs}\n minQueryLength={minQueryLength}\n className={className}\n renderResult={\n renderResult ??\n ((result, isHighlighted) => (\n <DocSearchResultRow result={result} isHighlighted={isHighlighted} />\n ))\n }\n />\n )\n}\n","/**\n * Map RAG `/api/docs/search` wire results into the `<DocSearchBar>`\n * dropdown's row shape, collapsing entity-table rows into grouped\n * results so the dropdown lists ONE \"Cap Table (12 records)\" row\n * instead of 12 individual rows.\n *\n * Pure transform — no telemetry, no navigation, no React deps. Lifted\n * from the hub's `hooks/use-docs.ts:mapDocSearchResults` (the hub's\n * `traceCompose` call was hub-only telemetry and is intentionally\n * dropped — callers that want logging can wrap this helper).\n */\n\nimport type { SearchResult } from '../../ui/search-input'\nimport type { DocSearchResult } from './types'\n\n/** Source repos that should be collapsed into grouped results in the search bar.\n * Only financial tables (all rows link to the same admin page).\n * Content tables (blog, webinar, podcast, etc.) stay individual since each has a unique URL. */\nconst SEARCH_GROUP_REPOS = new Set([\n 'financial-cap-table',\n 'financial-kpis',\n 'financial-pnl',\n 'financial-balance-sheet',\n 'financial-cash-flow',\n])\n\nconst ENTITY_LABELS: Record<string, string> = {\n 'financial-cap-table': 'Cap Table',\n 'financial-kpis': 'Financial KPIs',\n 'financial-pnl': 'Profit & Loss',\n 'financial-balance-sheet': 'Balance Sheets',\n 'financial-cash-flow': 'Cash Flow',\n 'blog-posts': 'Blog Posts',\n 'product-releases': 'Product Releases',\n 'case-studies': 'Case Studies',\n webinars: 'Webinars',\n events: 'Events',\n podcasts: 'Podcasts',\n}\n\nexport function mapDocSearchResults(docs: DocSearchResult[]): SearchResult[] {\n const entityGroups = new Map<string, DocSearchResult[]>()\n // Track insertion order — groups appear where the FIRST row of that\n // repo appeared in the response.\n const order: Array<\n { type: 'entity'; repo: string } | { type: 'doc'; doc: DocSearchResult }\n > = []\n const seenRepos = new Set<string>()\n\n for (const doc of docs) {\n if (doc.sourceRepo && SEARCH_GROUP_REPOS.has(doc.sourceRepo)) {\n const group = entityGroups.get(doc.sourceRepo) || []\n group.push(doc)\n entityGroups.set(doc.sourceRepo, group)\n if (!seenRepos.has(doc.sourceRepo)) {\n seenRepos.add(doc.sourceRepo)\n order.push({ type: 'entity', repo: doc.sourceRepo })\n }\n } else {\n order.push({ type: 'doc', doc })\n }\n }\n\n const results: SearchResult[] = []\n for (const entry of order) {\n if (entry.type === 'entity') {\n const rows = entityGroups.get(entry.repo)!\n const label = ENTITY_LABELS[entry.repo] || entry.repo\n results.push({\n id: `group-${entry.repo}`,\n title: `${label} (${rows.length} ${rows.length === 1 ? 'record' : 'records'})`,\n path: rows[0].path,\n type: 'file',\n metadata: {\n documentType: rows[0].documentType,\n externalUrl: rows[0].externalUrl,\n sourceRepo: entry.repo,\n id: rows[0].entityId,\n isGroup: true,\n items: rows.map((r) => ({\n name: r.name,\n externalUrl: r.externalUrl,\n id: r.entityId,\n sourceRepo: r.sourceRepo,\n documentType: r.documentType,\n })),\n },\n })\n } else {\n const doc = entry.doc\n const isNonMarkdown = doc.documentType && doc.documentType !== 'markdown'\n results.push({\n id: doc.path,\n title: doc.name,\n description: isNonMarkdown ? doc.name : doc.snippet,\n path: doc.path,\n type: doc.type,\n metadata: {\n matchType: doc.matchType,\n ...(doc.documentType ? { documentType: doc.documentType } : {}),\n ...(doc.externalUrl ? { externalUrl: doc.externalUrl } : {}),\n ...(doc.targetPlatform != null\n ? { targetPlatform: doc.targetPlatform }\n : {}),\n ...(doc.sourceRepo ? { sourceRepo: doc.sourceRepo } : {}),\n ...(doc.entityId ? { id: doc.entityId } : {}),\n },\n })\n }\n }\n\n return results\n}\n","/**\n * Resolve what should happen when the user picks a search result.\n * Returns one of five typed actions so the caller is a single switch.\n *\n * Resolution order:\n * 1. `externalUrl` present → use `decideNewTab` to choose same-tab vs\n * new-tab against the row's `targetPlatform`.\n * 2. Row has `id` + `sourceRepo` + `documentType` → synth an Ask-AI\n * action (entity drill-in via primary key, no URL).\n * 3. Row has only `path` → legacy navigation fallback.\n * 4. Nothing actionable → noop.\n *\n * Lifted from the hub's `hooks/use-docs.ts:resolveSearchResultAction`.\n * Pure — no React, no telemetry.\n */\n\nimport type { SearchResult } from '../../ui/search-input'\nimport type { ChatRef } from '../../chat/chat-ref.types'\nimport { decideNewTab } from '../../chat/utils/decide-new-tab'\n\nexport type SearchResultAction =\n | { kind: 'navigate-same-tab'; href: string }\n | { kind: 'navigate-new-tab'; href: string }\n | { kind: 'ask-ai'; detail: { source: string; ref: ChatRef } }\n | { kind: 'route'; path: string }\n | { kind: 'noop' }\n\nexport function resolveSearchResultAction(\n result: SearchResult,\n source: string,\n runtimeMode?: 'host' | 'embed',\n): SearchResultAction {\n const meta = result.metadata ?? {}\n const externalUrl = meta.externalUrl as string | undefined\n if (externalUrl) {\n // Same pure helper `useNavLink` and `useUnifiedNav` call — single\n // decision rule across cards, chips, and autocomplete rows. Thread\n // the caller's `source` as `currentSource` so the platform-vs-\n // platform comparison matches the hub's pre-migration behavior.\n const targetPlatform = meta.targetPlatform as string | null | undefined\n const isNewTab = decideNewTab({\n href: externalUrl,\n targetPlatform,\n surface: 'useUnifiedNav',\n runtimeMode,\n currentSource: source,\n })\n return isNewTab\n ? { kind: 'navigate-new-tab', href: externalUrl }\n : { kind: 'navigate-same-tab', href: externalUrl }\n }\n const rowId = meta.id as string | undefined\n const sourceRepo = meta.sourceRepo as string | undefined\n const documentType = meta.documentType as string | undefined\n if (rowId && sourceRepo && documentType) {\n return {\n kind: 'ask-ai',\n detail: {\n source,\n ref: { type: documentType, id: rowId, title: result.title, url: null },\n },\n }\n }\n if (result.path) {\n return { kind: 'route', path: result.path }\n }\n return { kind: 'noop' }\n}\n","'use client'\n\n/**\n * `useDocSearch` — debounced RAG-search hook against `/api/docs/search`.\n *\n * Pure fetch + navigation glue. Embedders can mount this directly\n * (any host with a reverse-proxy that exposes `/api/docs/search` will\n * work). Hub callers wire it into the lib `<DocSearchBar>` for the\n * canonical typeahead dropdown.\n *\n * ## What moved from hub to lib\n *\n * Lifted from `multi-platform-hub/hooks/use-docs.ts:useDocSearch`. Two\n * hub-only concerns are now optional injection points instead of\n * direct imports:\n *\n * - `useDocNavigation()` (hub's in-page doc-tree swap) → optional\n * `onInPageSwap?: (path: string) => boolean` config callback. When\n * present and returns true, the hook treats a same-origin result\n * click as \"handled in-page\"; when absent or returns false, the\n * hook falls back to `onNavigate(path)` (`router.push` on hub,\n * `window.location.assign` on bare embedders).\n * - `traceCompose` (hub-only telemetry) → dropped. The lib has no\n * equivalent runtime-context yet; bring it back when there is one.\n *\n * Everything else (debounce, `useChatRuntime` for embed-mode short-\n * circuit, embed-shim router, the action-resolver + result-mapper) is\n * now lib-resident.\n */\n\nimport { useState, useEffect, useCallback } from 'react'\nimport { useRouter } from '../../../embed-shims'\nimport { useDebounce } from '../../../hooks/ui/use-debounce'\nimport { useChatRuntime } from '../../../contexts/chat-runtime-context'\nimport type { SearchResult } from '../../ui/search-input'\nimport {\n resolveExternalNavigation,\n stripSameOriginToPath,\n NEW_TAB_FEATURES,\n} from '../../chat/utils/chat-nav-resolution'\nimport type { DocSearchResult } from './types'\nimport { mapDocSearchResults } from './map-doc-search-results'\nimport { resolveSearchResultAction } from './resolve-search-result-action'\n\nexport interface UseDocSearchConfig {\n /** Discriminator passed to `/api/docs/search?source=` (e.g.\n * `'openframe'`). Embedders set it to whatever discriminator their\n * reverse-proxy expects. */\n source: string\n /** Base route prefix this search lives under (e.g. `'/onboarding-guides'`).\n * When a result's href starts with `${baseRoute}/`, the hook\n * attempts the optional in-page swap path before falling through\n * to a full nav. */\n baseRoute: string\n /** Imperative navigation fallback. Called when no override\n * (in-page swap, new-tab) applies. Hub callers pass\n * `(path) => router.push(path)`; embedders pass an equivalent. */\n onNavigate: (path: string) => void\n /** Optional `RagTableConfig.id` list to narrow the search to specific\n * tables (e.g. `['onboarding-guides']`). Forwarded to\n * `/api/docs/search?tableIds=…` which intersects with the source's\n * standing set. */\n tableIds?: string[]\n /** Optional in-page swap callback. When the result's href is under\n * `baseRoute` AND this callback returns true, the hook treats the\n * click as handled in-page (no router push). Hub's\n * `<DocumentationSection>` wires this to\n * `useDocNavigation().navigate(path)`. */\n onInPageSwap?: (path: string) => boolean\n /** Optional endpoint override. Defaults to `'/api/docs/search'`\n * (the hub's reverse-proxy route). Embedders with a different\n * path can override. */\n searchEndpoint?: string\n}\n\nexport function useDocSearch(config: UseDocSearchConfig) {\n const {\n source,\n baseRoute,\n onNavigate,\n tableIds,\n onInPageSwap,\n searchEndpoint = '/api/docs/search',\n } = config\n const tableIdsKey = tableIds && tableIds.length > 0 ? tableIds.join(',') : ''\n\n const router = useRouter()\n // Optional chat-runtime read — when present and mode='embed' the\n // search-result row click short-circuits to a new-tab open against\n // the absolutized URL. Null/host preserves today's behavior.\n const runtime = useChatRuntime()\n\n const [query, setQuery] = useState('')\n const [results, setResults] = useState<SearchResult[]>([])\n const [isFetching, setIsFetching] = useState(false)\n const debouncedQuery = useDebounce(query, 300)\n\n useEffect(() => {\n if (!debouncedQuery || debouncedQuery.trim().length < 2) {\n setResults([])\n setIsFetching(false)\n return\n }\n\n let cancelled = false\n\n async function fetchResults() {\n setIsFetching(true)\n try {\n const params = new URLSearchParams({\n q: debouncedQuery,\n source,\n limit: '10',\n })\n if (tableIdsKey) params.set('tableIds', tableIdsKey)\n\n const response = await fetch(`${searchEndpoint}?${params.toString()}`)\n if (!response.ok) {\n throw new Error(`Search request failed: ${response.status}`)\n }\n\n const json = await response.json()\n\n if (!cancelled && json.success && Array.isArray(json.data)) {\n const mapped = mapDocSearchResults(json.data as DocSearchResult[])\n setResults(mapped)\n }\n } catch (error) {\n console.error('Doc search error:', error)\n if (!cancelled) {\n setResults([])\n }\n } finally {\n if (!cancelled) {\n setIsFetching(false)\n }\n }\n }\n\n fetchResults()\n\n return () => {\n cancelled = true\n }\n }, [debouncedQuery, source, tableIdsKey, searchEndpoint])\n\n // Derived loading state — single source of truth for \"should the\n // dropdown show 'Loading...' instead of 'No results found'\":\n const isLoading =\n query.trim().length >= 2 && (query !== debouncedQuery || isFetching)\n\n // Track whether dropdown should stay open (external link opened in new tab).\n const [keepOpen, setKeepOpen] = useState(false)\n\n const handleResultSelect = useCallback(\n (\n result: SearchResult,\n modifiers?: {\n metaKey?: boolean\n ctrlKey?: boolean\n shiftKey?: boolean\n altKey?: boolean\n button?: number\n },\n ) => {\n const action = resolveSearchResultAction(\n result,\n source,\n runtime?.navigation.mode,\n )\n // Modifier / non-primary mouse click → force new tab regardless of\n // same-tab/new-tab decision. The dropdown row is a `<div>`, not an\n // `<a target=\"_blank\">`, so the browser doesn't background-tab\n // natively on cmd-click. Honor it explicitly here for parity with\n // the anchor-based surfaces (cards, chips, related-content). Plain\n // Enter from the keyboard passes `modifiers === undefined`.\n const wantsNewTab =\n modifiers &&\n (modifiers.metaKey ||\n modifiers.ctrlKey ||\n modifiers.shiftKey ||\n modifiers.altKey ||\n (typeof modifiers.button === 'number' && modifiers.button !== 0))\n switch (action.kind) {\n case 'navigate-same-tab': {\n // Embed-mode short-circuit — autocomplete row clicked while\n // the chat panel is hosted inside an embedding app.\n if (runtime?.navigation.mode === 'embed') {\n setKeepOpen(true)\n const targetPlatform =\n (result.metadata?.targetPlatform as string | null | undefined) ?? null\n resolveExternalNavigation({\n href: action.href,\n targetPlatform,\n runtime,\n }).open()\n return\n }\n if (wantsNewTab) {\n setKeepOpen(true)\n window.open(action.href, '_blank', NEW_TAB_FEATURES)\n return\n }\n // Same-origin click:\n // 1. If the href is under the current doc-tree's baseRoute AND\n // an `onInPageSwap` callback is wired AND returns true →\n // consider in-page swap handled.\n // 2. Otherwise → embed-shim `router.push()` (soft RSC nav on\n // Next.js hosts, window.location.assign on bare hosts).\n setKeepOpen(false)\n const path =\n baseRoute && action.href.startsWith(`${baseRoute}/`)\n ? action.href.slice(baseRoute.length + 1)\n : null\n if (path && onInPageSwap?.(path)) return\n router.push(stripSameOriginToPath(action.href))\n return\n }\n case 'navigate-new-tab':\n // Cross-origin (e.g. clicking a flamingo.run release from\n // product-hub) — open in a new tab. Keep dropdown open so the\n // user can pick another result without re-searching.\n setKeepOpen(true)\n window.open(action.href, '_blank', NEW_TAB_FEATURES)\n return\n case 'ask-ai':\n // Row is searchable-but-not-openable (cap_table positions,\n // financial-kpi snapshots, anything backed by\n // `resolveUrl: () => null`). Dispatch a CustomEvent that\n // GlobalAskAI listens for — opens chat + drills via\n // `entityIdFilter` (primary-key only, same as inline-card Ask).\n setKeepOpen(false)\n window.dispatchEvent(\n new CustomEvent('ask-ai:open-with-ref', { detail: action.detail }),\n )\n return\n case 'route':\n // Final fallback: legacy navigation by path. Hits when a row\n // has neither URL nor pk metadata — a mapper/API regression.\n setKeepOpen(false)\n onNavigate(action.path)\n return\n case 'noop':\n return\n }\n },\n [onNavigate, source, baseRoute, router, onInPageSwap, runtime],\n )\n\n // Reset keepOpen when query changes.\n useEffect(() => {\n setKeepOpen(false)\n }, [query])\n\n return {\n query,\n setQuery,\n results,\n isLoading,\n handleResultSelect,\n keepDropdownOpen: keepOpen,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAQO,SAAS,mBAAmB,UAA0B;AAC3D,MAAI,CAAC,SAAU,QAAO;AACtB,QAAM,WAAW,SAAS,QAAQ,SAAS,EAAE,EAAE,MAAM,GAAG;AAExD,QAAM,iBAAiB,SAAS,SAAS,IAAI,SAAS,MAAM,GAAG,EAAE,IAAI;AACrE,SAAO,eACJ,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,EAAE,YAAY,IAAI,IAAI,MAAM,CAAC,EAAE,QAAQ,MAAM,GAAG,CAAC,EAC1E,KAAK,KAAK;AACf;;;ACsCQ,cAEF,YAFE;AAlBD,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AACF,GAA4B;AAC1B,QAAM,UAAW,OAAO,UAAU,gBAA2B;AAC7D,QAAM,aAAc,OAAO,UAAU,cAAyB;AAC9D,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AA,YACF,CAAC,EAAE,KAAK;AACR;AAAA,UACF;AACA,cAAI,aAAa;AACf,wBAAY,IAAI;AAChB,mBAAO,KAAK,OAAO,MAAM,UAAU,gBAAgB;AACnD;AAAA,UACF;AAOA,sBAAY,KAAK;AACjB,gBAAM,OACJ,aAAa,OAAO,KAAK,WAAW,GAAG,SAAS,GAAG,IAC/C,OAAO,KAAK,MAAM,UAAU,SAAS,CAAC,IACtC;AACN,cAAI,QAAQ,eAAe,IAAI,EAAG;AAClC,iBAAO,KAAK,sBAAsB,OAAO,IAAI,CAAC;AAC9C;AAAA,QACF;AAAA,QACA,KAAK;AAIH,sBAAY,IAAI;AAChB,iBAAO,KAAK,OAAO,MAAM,UAAU,gBAAgB;AACnD;AAAA,QACF,KAAK;AAMH,sBAAY,KAAK;AACjB,iBAAO;AAAA,YACL,IAAI,YAAY,wBAAwB,EAAE,QAAQ,OAAO,OAAO,CAAC;AAAA,UACnE;AACA;AAAA,QACF,KAAK;AAGH,sBAAY,KAAK;AACjB,qBAAW,OAAO,IAAI;AACtB;AAAA,QACF,KAAK;AACH;AAAA,MACJ;AAAA,IACF;AAAA,IACA,CAAC,YAAY,QAAQ,WAAW,QAAQ,cAAc,OAAO;AAAA,EAC/D;AAGA,YAAU,MAAM;AACd,gBAAY,KAAK;AAAA,EACnB,GAAG,CAAC,KAAK,CAAC;AAEV,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,kBAAkB;AAAA,EACpB;AACF;","names":["jsx"]}
@@ -0,0 +1,311 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";
2
+
3
+
4
+
5
+ var _chunkFIG2RKZFcjs = require('./chunk-FIG2RKZF.cjs');
6
+
7
+
8
+ var _chunkWZW7C7TFcjs = require('./chunk-WZW7C7TF.cjs');
9
+
10
+ // src/components/ui/field-wrapper.tsx
11
+ _chunkFIG2RKZFcjs.init_cn.call(void 0, );
12
+ var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react); var React4 = _interopRequireWildcard(_react);
13
+ var _jsxruntime = require('react/jsx-runtime');
14
+ var errorVariantClasses = {
15
+ error: "text-ods-error",
16
+ warning: "text-[var(--ods-attention-yellow-warning)]"
17
+ };
18
+ var FieldWrapper = React.forwardRef(
19
+ ({ label, error, errorVariant = "error", className, children }, ref) => {
20
+ const hasChrome = label != null || error != null;
21
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { ref, className: _chunkFIG2RKZFcjs.cn.call(void 0, hasChrome ? "relative flex w-full flex-col" : "contents", className), children: [
22
+ label && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "label", { className: "text-h4 text-ods-text-primary mb-1", children: label }),
23
+ children,
24
+ error && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: _chunkFIG2RKZFcjs.cn.call(void 0, "absolute bottom-0 left-0 right-0 translate-y-full text-h6 truncate", errorVariantClasses[errorVariant]), title: error, children: error })
25
+ ] });
26
+ }
27
+ );
28
+ FieldWrapper.displayName = "FieldWrapper";
29
+
30
+ // src/components/ui/input.tsx
31
+ _chunkFIG2RKZFcjs.init_cn.call(void 0, );
32
+
33
+ var _lucidereact = require('lucide-react');
34
+
35
+ var invalidBorderClasses = {
36
+ error: "border-ods-error hover:border-ods-error has-[:focus]:border-ods-error",
37
+ warning: "!border-[var(--ods-attention-yellow-warning)] hover:!border-[var(--ods-attention-yellow-warning)] has-[:focus]:!border-[var(--ods-attention-yellow-warning)]"
38
+ };
39
+ var Input = React2.forwardRef(
40
+ ({ className, type, invalid = false, startAdornment, endAdornment, label, error, errorVariant = "error", loading = false, ...props }, ref) => {
41
+ const isInvalid = invalid || !!error;
42
+ if (type === "range") {
43
+ const rangeInput = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
44
+ "input",
45
+ {
46
+ type: "range",
47
+ className: _chunkFIG2RKZFcjs.cn.call(void 0,
48
+ "w-full cursor-pointer appearance-none rounded-full bg-white/30 h-1",
49
+ // Webkit (Chrome/Safari) thumb
50
+ "[&::-webkit-slider-thumb]:appearance-none",
51
+ "[&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3",
52
+ "[&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:bg-white",
53
+ "[&::-webkit-slider-thumb]:cursor-pointer [&::-webkit-slider-thumb]:shadow-sm",
54
+ // Firefox thumb
55
+ "[&::-moz-range-thumb]:w-3 [&::-moz-range-thumb]:h-3",
56
+ "[&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:bg-white",
57
+ "[&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:cursor-pointer",
58
+ // Firefox track
59
+ "[&::-moz-range-track]:bg-transparent",
60
+ // Disabled
61
+ "disabled:cursor-not-allowed disabled:opacity-50",
62
+ className
63
+ ),
64
+ ref,
65
+ ...props
66
+ }
67
+ );
68
+ return label ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FieldWrapper, { label, error, errorVariant, children: rangeInput }) : rangeInput;
69
+ }
70
+ const content = /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
71
+ "label",
72
+ {
73
+ "data-invalid": isInvalid || void 0,
74
+ className: _chunkFIG2RKZFcjs.cn.call(void 0,
75
+ // Layout & spacing
76
+ "flex w-full items-center gap-2 rounded-[6px] border px-3 h-11 md:h-12 cursor-text",
77
+ // Focus-within states
78
+ "has-[:focus-visible]:outline-none",
79
+ "group",
80
+ // Animations & touch UX
81
+ "transition-colors duration-200",
82
+ // Theme palette
83
+ "bg-ods-card border-ods-border has-[:focus]:border-ods-accent",
84
+ // Hover & active (not disabled)
85
+ !props.disabled && "hover:bg-ods-bg-hover hover:border-ods-border-hover active:bg-ods-bg-active active:border-ods-border-active",
86
+ // Disabled
87
+ props.disabled && "!cursor-not-allowed bg-ods-bg",
88
+ // Invalid
89
+ isInvalid && invalidBorderClasses[errorVariant],
90
+ className
91
+ ),
92
+ children: [
93
+ startAdornment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-h6 flex-shrink-0 text-ods-text-secondary transition-colors duration-200 group-has-[:focus]:text-ods-accent group-data-[invalid]:text-ods-error [&_svg]:size-4 md:[&_svg]:size-6", children: startAdornment }),
94
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
95
+ "input",
96
+ {
97
+ type,
98
+ className: _chunkFIG2RKZFcjs.cn.call(void 0,
99
+ // Layout
100
+ "flex-1 min-w-0 bg-transparent border-none outline-none",
101
+ // Typography
102
+ "text-h4",
103
+ // Colors
104
+ "text-ods-text-primary placeholder:text-ods-text-secondary",
105
+ // File input adjustments
106
+ "file:border-0 file:bg-transparent",
107
+ // Disabled
108
+ "disabled:cursor-not-allowed disabled:text-ods-text-disabled disabled:placeholder:text-ods-border",
109
+ // Touch
110
+ "touch-manipulation",
111
+ // Autofill override
112
+ "[&:-webkit-autofill]:[-webkit-box-shadow:0_0_0_9999px_transparent_inset] [&:-webkit-autofill]:[-webkit-text-fill-color:var(--color-text-primary)] [&:-webkit-autofill]:[caret-color:var(--color-text-primary)] [&:-webkit-autofill]:[transition:background-color_9999s_ease-in-out_0s]"
113
+ ),
114
+ ref,
115
+ ...props
116
+ }
117
+ ),
118
+ loading && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Loader2, { className: "animate-spin flex-shrink-0 text-ods-text-secondary size-4 md:size-6" }),
119
+ !loading && endAdornment && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-h6 flex-shrink-0 text-ods-text-secondary transition-colors duration-200 group-has-[:focus]:text-ods-accent group-data-[invalid]:text-ods-error [&_svg]:size-4 md:[&_svg]:size-6", children: endAdornment })
120
+ ]
121
+ }
122
+ );
123
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FieldWrapper, { label, error, errorVariant, children: content });
124
+ }
125
+ );
126
+ Input.displayName = "Input";
127
+
128
+ // src/components/ui/checkbox.tsx
129
+ _chunkFIG2RKZFcjs.init_cn.call(void 0, );
130
+
131
+ var _reactcheckbox = require('@radix-ui/react-checkbox'); var CheckboxPrimitive = _interopRequireWildcard(_reactcheckbox);
132
+
133
+ var Checkbox = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
134
+ CheckboxPrimitive.Root,
135
+ {
136
+ ref,
137
+ className: _chunkFIG2RKZFcjs.cn.call(void 0,
138
+ "peer h-4 w-4 shrink-0 rounded-sm border border-ods-border bg-ods-card focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ods-accent focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-ods-accent data-[state=checked]:border-ods-accent",
139
+ className
140
+ ),
141
+ ...props,
142
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
143
+ CheckboxPrimitive.Indicator,
144
+ {
145
+ className: _chunkFIG2RKZFcjs.cn.call(void 0, "flex items-center justify-center text-ods-text-on-accent"),
146
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkWZW7C7TFcjs.CheckboxCheckmarkIcon, { size: 10 })
147
+ }
148
+ )
149
+ }
150
+ ));
151
+ Checkbox.displayName = CheckboxPrimitive.Root.displayName;
152
+
153
+ // src/components/ui/skeleton.tsx
154
+ _chunkFIG2RKZFcjs.init_cn.call(void 0, );
155
+
156
+
157
+ var Skeleton = React4.forwardRef(
158
+ ({ className, ...props }, ref) => {
159
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
160
+ "div",
161
+ {
162
+ ref,
163
+ className: _chunkFIG2RKZFcjs.cn.call(void 0,
164
+ "animate-pulse rounded-md bg-ods-border",
165
+ className
166
+ ),
167
+ ...props
168
+ }
169
+ );
170
+ }
171
+ );
172
+ Skeleton.displayName = "Skeleton";
173
+ var SkeletonText = React4.forwardRef(
174
+ ({ lines = 1, className, ...props }, ref) => {
175
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref, className: _chunkFIG2RKZFcjs.cn.call(void 0, "space-y-2", className), ...props, children: Array.from({ length: lines }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
176
+ Skeleton,
177
+ {
178
+ className: _chunkFIG2RKZFcjs.cn.call(void 0,
179
+ "h-4",
180
+ i === lines - 1 && lines > 1 && "w-3/4"
181
+ // Last line shorter for multi-line
182
+ )
183
+ },
184
+ i
185
+ )) });
186
+ }
187
+ );
188
+ SkeletonText.displayName = "SkeletonText";
189
+ var SkeletonCard = React4.forwardRef(
190
+ ({ showImage = false, className, ...props }, ref) => {
191
+ return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
192
+ "div",
193
+ {
194
+ ref,
195
+ className: _chunkFIG2RKZFcjs.cn.call(void 0,
196
+ "rounded-lg border border-ods-border overflow-hidden",
197
+ className
198
+ ),
199
+ ...props,
200
+ children: [
201
+ showImage && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Skeleton, { className: "h-48 w-full" }),
202
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "p-6", children: [
203
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Skeleton, { className: "h-6 w-3/4 mb-4" }),
204
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SkeletonText, { lines: 3 })
205
+ ] })
206
+ ]
207
+ }
208
+ );
209
+ }
210
+ );
211
+ SkeletonCard.displayName = "SkeletonCard";
212
+ var SkeletonGrid = React4.forwardRef(
213
+ ({ columns = 3, items = 6, showImages = false, className, ...props }, ref) => {
214
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
215
+ "div",
216
+ {
217
+ ref,
218
+ className: _chunkFIG2RKZFcjs.cn.call(void 0,
219
+ `grid grid-cols-1 gap-6`,
220
+ columns === 2 && "md:grid-cols-2",
221
+ columns === 3 && "md:grid-cols-3",
222
+ columns === 4 && "md:grid-cols-4",
223
+ className
224
+ ),
225
+ ...props,
226
+ children: Array.from({ length: items }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, SkeletonCard, { showImage: showImages }, i))
227
+ }
228
+ );
229
+ }
230
+ );
231
+ SkeletonGrid.displayName = "SkeletonGrid";
232
+ var SkeletonButton = React4.forwardRef(
233
+ ({ size = "default", className, ...props }, ref) => {
234
+ const sizeClasses = {
235
+ sm: "h-8 w-20",
236
+ default: "h-10 w-32",
237
+ lg: "h-12 w-40"
238
+ };
239
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
240
+ Skeleton,
241
+ {
242
+ ref,
243
+ className: _chunkFIG2RKZFcjs.cn.call(void 0,
244
+ "rounded-lg",
245
+ sizeClasses[size],
246
+ className
247
+ ),
248
+ ...props
249
+ }
250
+ );
251
+ }
252
+ );
253
+ SkeletonButton.displayName = "SkeletonButton";
254
+ var SkeletonHeading = React4.forwardRef(
255
+ ({ level = 1, className, ...props }, ref) => {
256
+ const heightClasses = {
257
+ 1: "h-12",
258
+ 2: "h-10",
259
+ 3: "h-8",
260
+ 4: "h-7",
261
+ 5: "h-6",
262
+ 6: "h-5"
263
+ };
264
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
265
+ Skeleton,
266
+ {
267
+ ref,
268
+ className: _chunkFIG2RKZFcjs.cn.call(void 0,
269
+ heightClasses[level],
270
+ "w-3/4",
271
+ className
272
+ ),
273
+ ...props
274
+ }
275
+ );
276
+ }
277
+ );
278
+ SkeletonHeading.displayName = "SkeletonHeading";
279
+ var SkeletonList = React4.forwardRef(
280
+ ({ items = 5, className, ...props }, ref) => {
281
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref, className: _chunkFIG2RKZFcjs.cn.call(void 0, "space-y-3", className), ...props, children: Array.from({ length: items }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-3", children: [
282
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Skeleton, { className: "h-10 w-10 rounded-full flex-shrink-0" }),
283
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1", children: [
284
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Skeleton, { className: "h-4 w-1/3 mb-1" }),
285
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Skeleton, { className: "h-3 w-1/2" })
286
+ ] })
287
+ ] }, i)) });
288
+ }
289
+ );
290
+ SkeletonList.displayName = "SkeletonList";
291
+ var SkeletonNavigation = React4.forwardRef(
292
+ ({ items = 6, className, ...props }, ref) => {
293
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref, className: _chunkFIG2RKZFcjs.cn.call(void 0, "flex items-center gap-6", className), ...props, children: Array.from({ length: items }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Skeleton, { className: "h-5 w-20" }, i)) });
294
+ }
295
+ );
296
+ SkeletonNavigation.displayName = "SkeletonNavigation";
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+ exports.FieldWrapper = FieldWrapper; exports.Input = Input; exports.Checkbox = Checkbox; exports.Skeleton = Skeleton; exports.SkeletonText = SkeletonText; exports.SkeletonCard = SkeletonCard; exports.SkeletonGrid = SkeletonGrid; exports.SkeletonButton = SkeletonButton; exports.SkeletonHeading = SkeletonHeading; exports.SkeletonList = SkeletonList; exports.SkeletonNavigation = SkeletonNavigation;
311
+ //# sourceMappingURL=chunk-6JINAOI7.cjs.map