@flamingo-stack/openframe-frontend-core 0.0.204 → 0.0.205

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 (509) hide show
  1. package/dist/{chunk-4CWSZPXH.cjs → chunk-24KCAECR.cjs} +9 -9
  2. package/dist/{chunk-4CWSZPXH.cjs.map → chunk-24KCAECR.cjs.map} +1 -1
  3. package/dist/chunk-27APPAJN.cjs +24 -0
  4. package/dist/chunk-27APPAJN.cjs.map +1 -0
  5. package/dist/{chunk-UC43NICZ.cjs → chunk-664KA5FI.cjs} +2 -35
  6. package/dist/chunk-664KA5FI.cjs.map +1 -0
  7. package/dist/chunk-6RZYJICV.cjs +24 -0
  8. package/dist/chunk-6RZYJICV.cjs.map +1 -0
  9. package/dist/chunk-7L4DWM7P.js +24 -0
  10. package/dist/chunk-7L4DWM7P.js.map +1 -0
  11. package/dist/chunk-BZFW3FOF.cjs +21 -0
  12. package/dist/chunk-BZFW3FOF.cjs.map +1 -0
  13. package/dist/{chunk-N57KWHDB.js → chunk-CIPO6DXK.js} +5 -5
  14. package/dist/chunk-EL5YVPD5.js +21 -0
  15. package/dist/chunk-EL5YVPD5.js.map +1 -0
  16. package/dist/{chunk-ARQ4XP64.cjs → chunk-FDCFI7YT.cjs} +40080 -31492
  17. package/dist/chunk-FDCFI7YT.cjs.map +1 -0
  18. package/dist/chunk-G7UE6RKV.cjs +121 -0
  19. package/dist/chunk-G7UE6RKV.cjs.map +1 -0
  20. package/dist/{chunk-25LVV26X.cjs → chunk-JUZGUQMX.cjs} +178 -50
  21. package/dist/chunk-JUZGUQMX.cjs.map +1 -0
  22. package/dist/{chunk-SZPJ5R5B.js → chunk-KSOOKNBG.js} +1 -34
  23. package/dist/chunk-KSOOKNBG.js.map +1 -0
  24. package/dist/{chunk-RMB5DVED.cjs → chunk-KUZGEA7U.cjs} +83 -66
  25. package/dist/chunk-KUZGEA7U.cjs.map +1 -0
  26. package/dist/chunk-LXC6P2EO.js +63 -0
  27. package/dist/chunk-LXC6P2EO.js.map +1 -0
  28. package/dist/chunk-MJNXIEV2.js +24 -0
  29. package/dist/chunk-MJNXIEV2.js.map +1 -0
  30. package/dist/{chunk-CPXLQ57U.js → chunk-MVGGXOFA.js} +37 -20
  31. package/dist/chunk-MVGGXOFA.js.map +1 -0
  32. package/dist/{chunk-LY34ORX6.js → chunk-O55ZUAX7.js} +39920 -31332
  33. package/dist/chunk-O55ZUAX7.js.map +1 -0
  34. package/dist/chunk-OHPI2HRK.js +47 -0
  35. package/dist/chunk-OHPI2HRK.js.map +1 -0
  36. package/dist/chunk-PLJLE4A4.js +121 -0
  37. package/dist/chunk-PLJLE4A4.js.map +1 -0
  38. package/dist/{chunk-XGL5FKIK.js → chunk-SCN5WFIZ.js} +148 -20
  39. package/dist/chunk-SCN5WFIZ.js.map +1 -0
  40. package/dist/chunk-WBR7H6E3.cjs +47 -0
  41. package/dist/chunk-WBR7H6E3.cjs.map +1 -0
  42. package/dist/chunk-XL4V2PYG.cjs +63 -0
  43. package/dist/chunk-XL4V2PYG.cjs.map +1 -0
  44. package/dist/components/announcement-bar.d.ts.map +1 -1
  45. package/dist/components/chat/chat-attachment-bar.d.ts +66 -0
  46. package/dist/components/chat/chat-attachment-bar.d.ts.map +1 -0
  47. package/dist/components/chat/chat-container.d.ts +21 -1
  48. package/dist/components/chat/chat-container.d.ts.map +1 -1
  49. package/dist/components/chat/chat-input.d.ts.map +1 -1
  50. package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
  51. package/dist/components/chat/chat-message-list.d.ts.map +1 -1
  52. package/dist/components/chat/chat-panel-context.d.ts +9 -0
  53. package/dist/components/chat/chat-panel-context.d.ts.map +1 -0
  54. package/dist/components/chat/chat-ticket-list.d.ts +1 -1
  55. package/dist/components/chat/chat-ticket-list.d.ts.map +1 -1
  56. package/dist/components/chat/embeddable-chat.d.ts +42 -0
  57. package/dist/components/chat/embeddable-chat.d.ts.map +1 -0
  58. package/dist/components/chat/entity-cards/admin-content-card.d.ts +34 -0
  59. package/dist/components/chat/entity-cards/admin-content-card.d.ts.map +1 -0
  60. package/dist/components/chat/entity-cards/block-card.d.ts.map +1 -0
  61. package/dist/components/chat/entity-cards/blog-card.d.ts +30 -0
  62. package/dist/components/chat/entity-cards/blog-card.d.ts.map +1 -0
  63. package/dist/components/chat/entity-cards/blog-image-placeholder.d.ts +26 -0
  64. package/dist/components/chat/entity-cards/blog-image-placeholder.d.ts.map +1 -0
  65. package/dist/components/chat/entity-cards/campaign-card-admin.d.ts +33 -0
  66. package/dist/components/chat/entity-cards/campaign-card-admin.d.ts.map +1 -0
  67. package/dist/components/chat/entity-cards/case-study-card.d.ts +20 -0
  68. package/dist/components/chat/entity-cards/case-study-card.d.ts.map +1 -0
  69. package/dist/components/chat/entity-cards/chat-ticket-item.d.ts.map +1 -0
  70. package/dist/components/chat/{chat-video-entity-card.d.ts → entity-cards/chat-video-entity-card.d.ts} +1 -1
  71. package/dist/components/chat/entity-cards/chat-video-entity-card.d.ts.map +1 -0
  72. package/dist/components/chat/entity-cards/customer-interview-card.d.ts +19 -0
  73. package/dist/components/chat/entity-cards/customer-interview-card.d.ts.map +1 -0
  74. package/dist/components/chat/entity-cards/data-room-doc-card.d.ts +47 -0
  75. package/dist/components/chat/entity-cards/data-room-doc-card.d.ts.map +1 -0
  76. package/dist/components/chat/entity-cards/dispatch.d.ts +119 -0
  77. package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -0
  78. package/dist/components/chat/entity-cards/entity-author-card.d.ts +87 -0
  79. package/dist/components/chat/entity-cards/entity-author-card.d.ts.map +1 -0
  80. package/dist/components/chat/entity-cards/generic-entity-card.d.ts +42 -0
  81. package/dist/components/chat/entity-cards/generic-entity-card.d.ts.map +1 -0
  82. package/dist/components/chat/entity-cards/github-activity-card.d.ts +37 -0
  83. package/dist/components/chat/entity-cards/github-activity-card.d.ts.map +1 -0
  84. package/dist/components/chat/entity-cards/hubspot-ticket-card.d.ts +28 -0
  85. package/dist/components/chat/entity-cards/hubspot-ticket-card.d.ts.map +1 -0
  86. package/dist/components/chat/entity-cards/index.d.ts +32 -0
  87. package/dist/components/chat/entity-cards/index.d.ts.map +1 -0
  88. package/dist/components/chat/entity-cards/investor-update-card.d.ts +19 -0
  89. package/dist/components/chat/entity-cards/investor-update-card.d.ts.map +1 -0
  90. package/dist/components/chat/entity-cards/onboarding-guide-card.d.ts +20 -0
  91. package/dist/components/chat/entity-cards/onboarding-guide-card.d.ts.map +1 -0
  92. package/dist/components/chat/entity-cards/product-release-card-defaults.d.ts +21 -0
  93. package/dist/components/chat/entity-cards/product-release-card-defaults.d.ts.map +1 -0
  94. package/dist/components/chat/entity-cards/product-release-card.d.ts +12 -0
  95. package/dist/components/chat/entity-cards/product-release-card.d.ts.map +1 -0
  96. package/dist/components/chat/entity-cards/program-card-defaults.d.ts +32 -0
  97. package/dist/components/chat/entity-cards/program-card-defaults.d.ts.map +1 -0
  98. package/dist/components/chat/entity-cards/program-card.d.ts +37 -0
  99. package/dist/components/chat/entity-cards/program-card.d.ts.map +1 -0
  100. package/dist/components/chat/entity-cards/roadmap-card.d.ts +28 -0
  101. package/dist/components/chat/entity-cards/roadmap-card.d.ts.map +1 -0
  102. package/dist/components/chat/entity-cards/roadmap-vote-button.d.ts +12 -0
  103. package/dist/components/chat/entity-cards/roadmap-vote-button.d.ts.map +1 -0
  104. package/dist/components/chat/entity-cards/slack-message-card.d.ts +28 -0
  105. package/dist/components/chat/entity-cards/slack-message-card.d.ts.map +1 -0
  106. package/dist/components/chat/entity-cards/task-type-icon.d.ts +6 -0
  107. package/dist/components/chat/entity-cards/task-type-icon.d.ts.map +1 -0
  108. package/dist/components/chat/hooks/index.d.ts +10 -0
  109. package/dist/components/chat/hooks/index.d.ts.map +1 -1
  110. package/dist/components/chat/hooks/use-chat-attachment-image-gallery.d.ts +5 -0
  111. package/dist/components/chat/hooks/use-chat-attachment-image-gallery.d.ts.map +1 -0
  112. package/dist/components/chat/hooks/use-chat-attachments.d.ts +33 -0
  113. package/dist/components/chat/hooks/use-chat-attachments.d.ts.map +1 -0
  114. package/dist/components/chat/hooks/use-chat-card-item.d.ts +7 -0
  115. package/dist/components/chat/hooks/use-chat-card-item.d.ts.map +1 -0
  116. package/dist/components/chat/hooks/use-chat-identity.d.ts +44 -0
  117. package/dist/components/chat/hooks/use-chat-identity.d.ts.map +1 -0
  118. package/dist/components/chat/hooks/use-chat.d.ts +30 -0
  119. package/dist/components/chat/hooks/use-chat.d.ts.map +1 -0
  120. package/dist/components/chat/hooks/use-close-on-navigation.d.ts +2 -0
  121. package/dist/components/chat/hooks/use-close-on-navigation.d.ts.map +1 -0
  122. package/dist/components/chat/hooks/use-embedded-chat.d.ts +174 -0
  123. package/dist/components/chat/hooks/use-embedded-chat.d.ts.map +1 -0
  124. package/dist/components/chat/hooks/use-proxied-image-url.d.ts +18 -0
  125. package/dist/components/chat/hooks/use-proxied-image-url.d.ts.map +1 -0
  126. package/dist/components/chat/hooks/use-slash-commands.d.ts +32 -0
  127. package/dist/components/chat/hooks/use-slash-commands.d.ts.map +1 -0
  128. package/dist/components/chat/hooks/use-sse.d.ts +57 -0
  129. package/dist/components/chat/hooks/use-sse.d.ts.map +1 -0
  130. package/dist/components/chat/index.cjs +393 -0
  131. package/dist/components/chat/index.cjs.map +1 -0
  132. package/dist/components/chat/index.d.ts +5 -3
  133. package/dist/components/chat/index.d.ts.map +1 -1
  134. package/dist/components/chat/index.js +393 -0
  135. package/dist/components/chat/index.js.map +1 -0
  136. package/dist/components/chat/nav-link-anchor-via-runtime.d.ts +33 -0
  137. package/dist/components/chat/nav-link-anchor-via-runtime.d.ts.map +1 -0
  138. package/dist/components/chat/source-action-button.d.ts +39 -0
  139. package/dist/components/chat/source-action-button.d.ts.map +1 -0
  140. package/dist/components/chat/types/chat.types.d.ts +36 -0
  141. package/dist/components/chat/types/chat.types.d.ts.map +1 -1
  142. package/dist/components/chat/types/component.types.d.ts +56 -11
  143. package/dist/components/chat/types/component.types.d.ts.map +1 -1
  144. package/dist/components/chat/types/entities/blog.d.ts +14 -0
  145. package/dist/components/chat/types/entities/blog.d.ts.map +1 -0
  146. package/dist/components/chat/types/entities/case-study.d.ts +10 -0
  147. package/dist/components/chat/types/entities/case-study.d.ts.map +1 -0
  148. package/dist/components/chat/types/entities/content-ref.d.ts +23 -0
  149. package/dist/components/chat/types/entities/content-ref.d.ts.map +1 -0
  150. package/dist/components/chat/types/entities/customer-interview.d.ts +10 -0
  151. package/dist/components/chat/types/entities/customer-interview.d.ts.map +1 -0
  152. package/dist/components/chat/types/entities/data-room-doc.d.ts +37 -0
  153. package/dist/components/chat/types/entities/data-room-doc.d.ts.map +1 -0
  154. package/dist/components/chat/types/entities/github-activity.d.ts +29 -0
  155. package/dist/components/chat/types/entities/github-activity.d.ts.map +1 -0
  156. package/dist/components/chat/types/entities/hubspot-ticket.d.ts +39 -0
  157. package/dist/components/chat/types/entities/hubspot-ticket.d.ts.map +1 -0
  158. package/dist/components/chat/types/entities/index.d.ts +28 -0
  159. package/dist/components/chat/types/entities/index.d.ts.map +1 -0
  160. package/dist/components/chat/types/entities/investor-update.d.ts +83 -0
  161. package/dist/components/chat/types/entities/investor-update.d.ts.map +1 -0
  162. package/dist/components/chat/types/entities/onboarding-guide.d.ts +79 -0
  163. package/dist/components/chat/types/entities/onboarding-guide.d.ts.map +1 -0
  164. package/dist/components/chat/types/entities/program-types.d.ts +303 -0
  165. package/dist/components/chat/types/entities/program-types.d.ts.map +1 -0
  166. package/dist/components/chat/types/entities/roadmap-item.d.ts +41 -0
  167. package/dist/components/chat/types/entities/roadmap-item.d.ts.map +1 -0
  168. package/dist/components/chat/types/entities/slack-message.d.ts +28 -0
  169. package/dist/components/chat/types/entities/slack-message.d.ts.map +1 -0
  170. package/dist/components/chat/types/index.d.ts +1 -0
  171. package/dist/components/chat/types/index.d.ts.map +1 -1
  172. package/dist/components/chat/utils/agent-status-message.d.ts +18 -0
  173. package/dist/components/chat/utils/agent-status-message.d.ts.map +1 -0
  174. package/dist/components/chat/utils/auto-continuation-directive.d.ts +38 -0
  175. package/dist/components/chat/utils/auto-continuation-directive.d.ts.map +1 -0
  176. package/dist/components/chat/utils/chat-attachment-markdown.d.ts +114 -0
  177. package/dist/components/chat/utils/chat-attachment-markdown.d.ts.map +1 -0
  178. package/dist/components/chat/utils/chat-authed-fetch.d.ts +13 -0
  179. package/dist/components/chat/utils/chat-authed-fetch.d.ts.map +1 -0
  180. package/dist/components/chat/utils/chat-nav-resolution.d.ts +72 -0
  181. package/dist/components/chat/utils/chat-nav-resolution.d.ts.map +1 -0
  182. package/dist/components/chat/utils/chat-proxy-auth-storage.d.ts +43 -0
  183. package/dist/components/chat/utils/chat-proxy-auth-storage.d.ts.map +1 -0
  184. package/dist/components/chat/utils/chip-action-class.d.ts +16 -0
  185. package/dist/components/chat/utils/chip-action-class.d.ts.map +1 -0
  186. package/dist/components/chat/utils/chip-styles.d.ts +32 -0
  187. package/dist/components/chat/utils/chip-styles.d.ts.map +1 -0
  188. package/dist/components/chat/utils/clickup-task-type-utils.d.ts +38 -0
  189. package/dist/components/chat/utils/clickup-task-type-utils.d.ts.map +1 -0
  190. package/dist/components/chat/utils/compact-card-classes.d.ts +50 -0
  191. package/dist/components/chat/utils/compact-card-classes.d.ts.map +1 -0
  192. package/dist/components/chat/utils/decide-new-tab.d.ts +39 -0
  193. package/dist/components/chat/utils/decide-new-tab.d.ts.map +1 -0
  194. package/dist/components/chat/utils/external-app-urls.d.ts +14 -0
  195. package/dist/components/chat/utils/external-app-urls.d.ts.map +1 -0
  196. package/dist/components/chat/utils/flatten-assistant-content.d.ts +25 -0
  197. package/dist/components/chat/utils/flatten-assistant-content.d.ts.map +1 -0
  198. package/dist/components/chat/utils/icon-registry.d.ts +67 -0
  199. package/dist/components/chat/utils/icon-registry.d.ts.map +1 -0
  200. package/dist/components/chat/utils/index.d.ts +21 -0
  201. package/dist/components/chat/utils/index.d.ts.map +1 -1
  202. package/dist/components/chat/utils/is-cross-origin-url.d.ts +22 -0
  203. package/dist/components/chat/utils/is-cross-origin-url.d.ts.map +1 -0
  204. package/dist/components/chat/utils/nav-anchor-props.d.ts +54 -0
  205. package/dist/components/chat/utils/nav-anchor-props.d.ts.map +1 -0
  206. package/dist/components/chat/utils/nav-click-handler.d.ts +51 -0
  207. package/dist/components/chat/utils/nav-click-handler.d.ts.map +1 -0
  208. package/dist/components/chat/utils/scroll-anchor.d.ts +30 -0
  209. package/dist/components/chat/utils/scroll-anchor.d.ts.map +1 -0
  210. package/dist/components/chat/utils/slash-dispatch-utils.d.ts +109 -0
  211. package/dist/components/chat/utils/slash-dispatch-utils.d.ts.map +1 -0
  212. package/dist/components/chat/utils/source-icons.d.ts +8 -0
  213. package/dist/components/chat/utils/source-icons.d.ts.map +1 -0
  214. package/dist/components/chat/utils/source-row-cta.d.ts +111 -0
  215. package/dist/components/chat/utils/source-row-cta.d.ts.map +1 -0
  216. package/dist/components/features/figma-prototype-viewer.d.ts.map +1 -1
  217. package/dist/components/features/index.cjs +12 -6
  218. package/dist/components/features/index.cjs.map +1 -1
  219. package/dist/components/features/index.js +11 -5
  220. package/dist/components/features/video.d.ts.map +1 -1
  221. package/dist/components/icons/index.cjs +3 -3
  222. package/dist/components/icons/index.js +2 -2
  223. package/dist/components/index.cjs +274 -8
  224. package/dist/components/index.cjs.map +1 -1
  225. package/dist/components/index.js +273 -7
  226. package/dist/components/interactive-wrapper.d.ts +3 -3
  227. package/dist/components/navigation/index.cjs +12 -6
  228. package/dist/components/navigation/index.cjs.map +1 -1
  229. package/dist/components/navigation/index.js +11 -5
  230. package/dist/components/resizable.d.ts +1 -1
  231. package/dist/components/shared/product-release/product-release-card-skeleton.d.ts +1 -1
  232. package/dist/components/shared/product-release/product-release-card-skeleton.d.ts.map +1 -1
  233. package/dist/components/shared/product-release/product-release-card.d.ts +19 -12
  234. package/dist/components/shared/product-release/product-release-card.d.ts.map +1 -1
  235. package/dist/components/shared/product-release/release-detail-page.d.ts +2 -4
  236. package/dist/components/shared/product-release/release-detail-page.d.ts.map +1 -1
  237. package/dist/components/ui/button/button.d.ts +13 -0
  238. package/dist/components/ui/button/button.d.ts.map +1 -1
  239. package/dist/components/ui/dashboard-info-card.d.ts.map +1 -1
  240. package/dist/components/ui/entity-image.d.ts.map +1 -1
  241. package/dist/components/ui/file-manager/index.cjs +71 -70
  242. package/dist/components/ui/file-manager/index.cjs.map +1 -1
  243. package/dist/components/ui/file-manager/index.js +6 -5
  244. package/dist/components/ui/file-manager/index.js.map +1 -1
  245. package/dist/components/ui/hover-dropdown.d.ts +66 -0
  246. package/dist/components/ui/hover-dropdown.d.ts.map +1 -0
  247. package/dist/components/ui/index.cjs +276 -6
  248. package/dist/components/ui/index.cjs.map +1 -1
  249. package/dist/components/ui/index.d.ts +1 -0
  250. package/dist/components/ui/index.d.ts.map +1 -1
  251. package/dist/components/ui/index.js +278 -8
  252. package/dist/components/ui/simple-markdown-renderer.d.ts.map +1 -1
  253. package/dist/components/ui/square-avatar.d.ts.map +1 -1
  254. package/dist/contexts/chat-runtime-context.d.ts +109 -0
  255. package/dist/contexts/chat-runtime-context.d.ts.map +1 -0
  256. package/dist/contexts/endpoints-runtime-context.d.ts +28 -0
  257. package/dist/contexts/endpoints-runtime-context.d.ts.map +1 -0
  258. package/dist/contexts/index.cjs +30 -0
  259. package/dist/contexts/index.cjs.map +1 -0
  260. package/dist/contexts/index.d.ts +26 -0
  261. package/dist/contexts/index.d.ts.map +1 -0
  262. package/dist/contexts/index.js +30 -0
  263. package/dist/contexts/index.js.map +1 -0
  264. package/dist/contexts/use-outer-or-default.d.ts +29 -0
  265. package/dist/contexts/use-outer-or-default.d.ts.map +1 -0
  266. package/dist/embed-shims/index.cjs +51 -0
  267. package/dist/embed-shims/index.cjs.map +1 -0
  268. package/dist/embed-shims/index.d.ts +31 -0
  269. package/dist/embed-shims/index.d.ts.map +1 -0
  270. package/dist/embed-shims/index.js +51 -0
  271. package/dist/embed-shims/index.js.map +1 -0
  272. package/dist/embed-shims/next-dynamic.cjs +12 -0
  273. package/dist/embed-shims/next-dynamic.cjs.map +1 -0
  274. package/dist/embed-shims/next-dynamic.d.ts +47 -0
  275. package/dist/embed-shims/next-dynamic.d.ts.map +1 -0
  276. package/dist/embed-shims/next-dynamic.js +12 -0
  277. package/dist/embed-shims/next-dynamic.js.map +1 -0
  278. package/dist/embed-shims/next-image.cjs +12 -0
  279. package/dist/embed-shims/next-image.cjs.map +1 -0
  280. package/dist/embed-shims/next-image.d.ts +28 -0
  281. package/dist/embed-shims/next-image.d.ts.map +1 -0
  282. package/dist/embed-shims/next-image.js +12 -0
  283. package/dist/embed-shims/next-image.js.map +1 -0
  284. package/dist/embed-shims/next-link.cjs +14 -0
  285. package/dist/embed-shims/next-link.cjs.map +1 -0
  286. package/dist/embed-shims/next-link.d.ts +22 -0
  287. package/dist/embed-shims/next-link.d.ts.map +1 -0
  288. package/dist/embed-shims/next-link.js +14 -0
  289. package/dist/embed-shims/next-link.js.map +1 -0
  290. package/dist/embed-shims/next-navigation.cjs +30 -0
  291. package/dist/embed-shims/next-navigation.cjs.map +1 -0
  292. package/dist/embed-shims/next-navigation.d.ts +46 -0
  293. package/dist/embed-shims/next-navigation.d.ts.map +1 -0
  294. package/dist/embed-shims/next-navigation.js +30 -0
  295. package/dist/embed-shims/next-navigation.js.map +1 -0
  296. package/dist/hooks/index.cjs +10 -4
  297. package/dist/hooks/index.cjs.map +1 -1
  298. package/dist/hooks/index.d.ts +2 -0
  299. package/dist/hooks/index.d.ts.map +1 -1
  300. package/dist/hooks/index.js +9 -3
  301. package/dist/hooks/use-access-code-integration.d.ts +48 -0
  302. package/dist/hooks/use-access-code-integration.d.ts.map +1 -0
  303. package/dist/hooks/use-contact-submission.d.ts.map +1 -1
  304. package/dist/hooks/use-og-placeholder.d.ts +31 -0
  305. package/dist/hooks/use-og-placeholder.d.ts.map +1 -0
  306. package/dist/hooks/use-toast.d.ts +1 -1
  307. package/dist/index.cjs +367 -7
  308. package/dist/index.cjs.map +1 -1
  309. package/dist/index.js +378 -18
  310. package/dist/types/index.cjs.map +1 -1
  311. package/dist/types/index.js.map +1 -1
  312. package/dist/utils/access-code-client.d.ts +21 -37
  313. package/dist/utils/access-code-client.d.ts.map +1 -1
  314. package/dist/utils/cn.d.ts +0 -27
  315. package/dist/utils/cn.d.ts.map +1 -1
  316. package/dist/utils/color-analysis.d.ts +33 -0
  317. package/dist/utils/color-analysis.d.ts.map +1 -0
  318. package/dist/utils/date-formatters.d.ts +16 -5
  319. package/dist/utils/date-formatters.d.ts.map +1 -1
  320. package/dist/utils/fetch-priority.d.ts +3 -0
  321. package/dist/utils/fetch-priority.d.ts.map +1 -0
  322. package/dist/utils/format.d.ts +192 -1
  323. package/dist/utils/format.d.ts.map +1 -1
  324. package/dist/utils/image-proxy.d.ts +67 -2
  325. package/dist/utils/image-proxy.d.ts.map +1 -1
  326. package/dist/utils/index.cjs +1274 -155
  327. package/dist/utils/index.cjs.map +1 -1
  328. package/dist/utils/index.d.ts +19 -3
  329. package/dist/utils/index.d.ts.map +1 -1
  330. package/dist/utils/index.js +1200 -157
  331. package/dist/utils/index.js.map +1 -1
  332. package/dist/utils/local-storage-adapter.d.ts +46 -0
  333. package/dist/utils/local-storage-adapter.d.ts.map +1 -0
  334. package/dist/utils/source-icons.d.ts +78 -0
  335. package/dist/utils/source-icons.d.ts.map +1 -0
  336. package/package.json +29 -2
  337. package/src/components/announcement-bar.tsx +26 -4
  338. package/src/components/categories-cart.tsx +1 -1
  339. package/src/components/chat/chat-attachment-bar.tsx +323 -0
  340. package/src/components/chat/chat-container.tsx +39 -5
  341. package/src/components/chat/chat-input.tsx +7 -1
  342. package/src/components/chat/chat-message-enhanced.tsx +32 -22
  343. package/src/components/chat/chat-message-list.tsx +53 -4
  344. package/src/components/chat/chat-panel-context.tsx +37 -0
  345. package/src/components/chat/chat-ticket-list.tsx +1 -1
  346. package/src/components/chat/embeddable-chat.tsx +1106 -0
  347. package/src/components/chat/entity-cards/admin-content-card.tsx +155 -0
  348. package/src/components/chat/entity-cards/blog-card.tsx +259 -0
  349. package/src/components/chat/entity-cards/blog-image-placeholder.tsx +52 -0
  350. package/src/components/chat/entity-cards/campaign-card-admin.tsx +113 -0
  351. package/src/components/chat/entity-cards/case-study-card.tsx +192 -0
  352. package/src/components/chat/{chat-ticket-item.tsx → entity-cards/chat-ticket-item.tsx} +2 -2
  353. package/src/components/chat/{chat-video-entity-card.tsx → entity-cards/chat-video-entity-card.tsx} +2 -2
  354. package/src/components/chat/entity-cards/customer-interview-card.tsx +211 -0
  355. package/src/components/chat/entity-cards/data-room-doc-card.tsx +120 -0
  356. package/src/components/chat/entity-cards/dispatch.tsx +1093 -0
  357. package/src/components/chat/entity-cards/entity-author-card.tsx +193 -0
  358. package/src/components/chat/entity-cards/generic-entity-card.tsx +144 -0
  359. package/src/components/chat/entity-cards/github-activity-card.tsx +305 -0
  360. package/src/components/chat/entity-cards/hubspot-ticket-card.tsx +205 -0
  361. package/src/components/chat/entity-cards/index.ts +125 -0
  362. package/src/components/chat/entity-cards/investor-update-card.tsx +150 -0
  363. package/src/components/chat/entity-cards/onboarding-guide-card.tsx +326 -0
  364. package/src/components/chat/entity-cards/product-release-card-defaults.ts +57 -0
  365. package/src/components/chat/entity-cards/product-release-card.tsx +19 -0
  366. package/src/components/chat/entity-cards/program-card-defaults.ts +62 -0
  367. package/src/components/chat/entity-cards/program-card.tsx +451 -0
  368. package/src/components/chat/entity-cards/roadmap-card.tsx +356 -0
  369. package/src/components/chat/entity-cards/roadmap-vote-button.tsx +54 -0
  370. package/src/components/chat/entity-cards/slack-message-card.tsx +182 -0
  371. package/src/components/chat/entity-cards/task-type-icon.tsx +60 -0
  372. package/src/components/chat/hooks/index.ts +22 -0
  373. package/src/components/chat/hooks/use-chat-attachment-image-gallery.tsx +114 -0
  374. package/src/components/chat/hooks/use-chat-attachments.ts +429 -0
  375. package/src/components/chat/hooks/use-chat-card-item.ts +102 -0
  376. package/src/components/chat/hooks/use-chat-identity.ts +139 -0
  377. package/src/components/chat/hooks/use-chat.ts +501 -0
  378. package/src/components/chat/hooks/use-close-on-navigation.ts +87 -0
  379. package/src/components/chat/hooks/use-embedded-chat.ts +1023 -0
  380. package/src/components/chat/hooks/use-proxied-image-url.ts +31 -0
  381. package/src/components/chat/hooks/use-slash-commands.ts +106 -0
  382. package/src/components/chat/hooks/use-sse.ts +143 -0
  383. package/src/components/chat/index.ts +30 -4
  384. package/src/components/chat/nav-link-anchor-via-runtime.tsx +72 -0
  385. package/src/components/chat/source-action-button.tsx +120 -0
  386. package/src/components/chat/types/chat.types.ts +61 -0
  387. package/src/components/chat/types/component.types.ts +57 -11
  388. package/src/components/chat/types/entities/blog.ts +27 -0
  389. package/src/components/chat/types/entities/case-study.ts +14 -0
  390. package/src/components/chat/types/entities/content-ref.ts +23 -0
  391. package/src/components/chat/types/entities/customer-interview.ts +15 -0
  392. package/src/components/chat/types/entities/data-room-doc.ts +37 -0
  393. package/src/components/chat/types/entities/github-activity.ts +36 -0
  394. package/src/components/chat/types/entities/hubspot-ticket.ts +39 -0
  395. package/src/components/chat/types/entities/index.ts +28 -0
  396. package/src/components/chat/types/entities/investor-update.ts +100 -0
  397. package/src/components/chat/types/entities/onboarding-guide.ts +101 -0
  398. package/src/components/chat/types/entities/program-types.ts +433 -0
  399. package/src/components/chat/types/entities/roadmap-item.ts +42 -0
  400. package/src/components/chat/types/entities/slack-message.ts +28 -0
  401. package/src/components/chat/types/index.ts +1 -0
  402. package/src/components/chat/utils/agent-status-message.ts +52 -0
  403. package/src/components/chat/utils/auto-continuation-directive.ts +70 -0
  404. package/src/components/chat/utils/chat-attachment-markdown.ts +190 -0
  405. package/src/components/chat/utils/chat-authed-fetch.ts +73 -0
  406. package/src/components/chat/utils/chat-nav-resolution.ts +151 -0
  407. package/src/components/chat/utils/chat-proxy-auth-storage.ts +148 -0
  408. package/src/components/chat/utils/chip-action-class.ts +19 -0
  409. package/src/components/chat/utils/chip-styles.ts +51 -0
  410. package/src/components/chat/utils/clickup-task-type-utils.ts +59 -0
  411. package/src/components/chat/utils/compact-card-classes.ts +97 -0
  412. package/src/components/chat/utils/decide-new-tab.ts +57 -0
  413. package/src/components/chat/utils/external-app-urls.ts +19 -0
  414. package/src/components/chat/utils/flatten-assistant-content.ts +35 -0
  415. package/src/components/chat/utils/icon-registry.ts +297 -0
  416. package/src/components/chat/utils/index.ts +133 -0
  417. package/src/components/chat/utils/is-cross-origin-url.ts +28 -0
  418. package/src/components/chat/utils/nav-anchor-props.ts +78 -0
  419. package/src/components/chat/utils/nav-click-handler.ts +81 -0
  420. package/src/components/chat/utils/scroll-anchor.ts +35 -0
  421. package/src/components/chat/utils/slash-dispatch-utils.ts +183 -0
  422. package/src/components/chat/utils/source-icons.ts +14 -0
  423. package/src/components/chat/utils/source-row-cta.ts +215 -0
  424. package/src/components/empty-state.tsx +1 -1
  425. package/src/components/features/board/ticket-card.tsx +1 -1
  426. package/src/components/features/figma-prototype-viewer.tsx +2 -1
  427. package/src/components/features/media-gallery-manager.tsx +1 -1
  428. package/src/components/features/parallax-image-showcase.tsx +1 -1
  429. package/src/components/features/release-media-manager.tsx +1 -1
  430. package/src/components/features/seo-editor-preview.tsx +1 -1
  431. package/src/components/features/video.tsx +54 -3
  432. package/src/components/footer-waitlist-button.tsx +1 -1
  433. package/src/components/navigation/header.tsx +1 -1
  434. package/src/components/shared/onboarding/onboarding-step-card.tsx +1 -1
  435. package/src/components/shared/product-release/product-release-card-skeleton.tsx +8 -44
  436. package/src/components/shared/product-release/product-release-card.tsx +31 -116
  437. package/src/components/shared/product-release/release-detail-page.tsx +12 -16
  438. package/src/components/ui/actions-menu.tsx +1 -1
  439. package/src/components/ui/button/button.tsx +41 -11
  440. package/src/components/ui/button/split-button.tsx +1 -1
  441. package/src/components/ui/dashboard-info-card.tsx +2 -3
  442. package/src/components/ui/data-table/data-table-row.tsx +1 -1
  443. package/src/components/ui/entity-image.tsx +2 -8
  444. package/src/components/ui/hover-dropdown.tsx +258 -0
  445. package/src/components/ui/image-gallery-modal.tsx +1 -1
  446. package/src/components/ui/index.ts +1 -0
  447. package/src/components/ui/markdown-editor.tsx +1 -1
  448. package/src/components/ui/more-actions-menu.tsx +1 -1
  449. package/src/components/ui/organization-card.tsx +1 -1
  450. package/src/components/ui/simple-markdown-renderer.tsx +53 -5
  451. package/src/components/ui/square-avatar.tsx +3 -12
  452. package/src/components/ui/tab-navigation.tsx +1 -1
  453. package/src/components/ui/table/table-row.tsx +1 -1
  454. package/src/components/unified-filter-logic.tsx +1 -1
  455. package/src/components/unified-pagination.tsx +1 -1
  456. package/src/components/user-summary-stub.tsx +1 -1
  457. package/src/components/vendor-display-button.tsx +1 -1
  458. package/src/components/vendor-icon.tsx +1 -1
  459. package/src/contexts/chat-runtime-context.tsx +163 -0
  460. package/src/contexts/endpoints-runtime-context.tsx +68 -0
  461. package/src/contexts/index.ts +38 -0
  462. package/src/contexts/use-outer-or-default.ts +42 -0
  463. package/src/embed-shims/index.ts +42 -0
  464. package/src/embed-shims/next-dynamic.tsx +70 -0
  465. package/src/embed-shims/next-image.tsx +114 -0
  466. package/src/embed-shims/next-link.tsx +91 -0
  467. package/src/embed-shims/next-navigation.tsx +201 -0
  468. package/src/hooks/index.ts +9 -0
  469. package/src/hooks/state/use-api-params.ts +1 -1
  470. package/src/hooks/state/use-query-params.ts +1 -1
  471. package/src/hooks/use-access-code-integration.ts +107 -0
  472. package/src/hooks/use-contact-submission.ts +7 -3
  473. package/src/hooks/use-og-placeholder.ts +45 -0
  474. package/src/stories/OnboardingStepCard.stories.tsx +140 -0
  475. package/src/styles/chat-animations.css +65 -0
  476. package/src/styles/index.css +1 -0
  477. package/src/utils/access-code-client.ts +32 -75
  478. package/src/utils/cn.ts +0 -65
  479. package/src/utils/color-analysis.ts +205 -0
  480. package/src/utils/date-formatters.ts +54 -11
  481. package/src/utils/fetch-priority.ts +41 -0
  482. package/src/utils/format.ts +525 -1
  483. package/src/utils/image-proxy.ts +127 -7
  484. package/src/utils/index.ts +145 -5
  485. package/src/utils/local-storage-adapter.ts +105 -0
  486. package/src/utils/source-icons.ts +219 -0
  487. package/dist/chunk-25LVV26X.cjs.map +0 -1
  488. package/dist/chunk-ARQ4XP64.cjs.map +0 -1
  489. package/dist/chunk-CPXLQ57U.js.map +0 -1
  490. package/dist/chunk-LY34ORX6.js.map +0 -1
  491. package/dist/chunk-RMB5DVED.cjs.map +0 -1
  492. package/dist/chunk-SZPJ5R5B.js.map +0 -1
  493. package/dist/chunk-UC43NICZ.cjs.map +0 -1
  494. package/dist/chunk-XGL5FKIK.js.map +0 -1
  495. package/dist/components/chat/block-card.d.ts.map +0 -1
  496. package/dist/components/chat/chat-ticket-item.d.ts.map +0 -1
  497. package/dist/components/chat/chat-video-entity-card.d.ts.map +0 -1
  498. package/dist/utils/dynamic-icons.d.ts +0 -26
  499. package/dist/utils/dynamic-icons.d.ts.map +0 -1
  500. package/dist/utils/format-relative-time.d.ts +0 -21
  501. package/dist/utils/format-relative-time.d.ts.map +0 -1
  502. package/src/utils/.dynamic-icons.md +0 -30
  503. package/src/utils/.format-relative-time.md +0 -36
  504. package/src/utils/dynamic-icons.tsx +0 -120
  505. package/src/utils/format-relative-time.ts +0 -52
  506. /package/dist/{chunk-N57KWHDB.js.map → chunk-CIPO6DXK.js.map} +0 -0
  507. /package/dist/components/chat/{block-card.d.ts → entity-cards/block-card.d.ts} +0 -0
  508. /package/dist/components/chat/{chat-ticket-item.d.ts → entity-cards/chat-ticket-item.d.ts} +0 -0
  509. /package/src/components/chat/{block-card.tsx → entity-cards/block-card.tsx} +0 -0
@@ -0,0 +1,68 @@
1
+ 'use client'
2
+
3
+ /**
4
+ * Endpoints runtime — sibling of ChatRuntime. Carries the API path
5
+ * literals consumed by oss-lib components/hooks/utils so a host
6
+ * application can override them (e.g. when running behind a reverse
7
+ * proxy as `user1.openframe.ai` → `/api/mingo-guide/*`).
8
+ *
9
+ * The hub mounts `<HubRuntimeProvider>` at root with the
10
+ * canonical hub paths; an embedded app mounts its own provider with
11
+ * remapped paths. The pattern mirrors ChatRuntimeContext exactly:
12
+ *
13
+ * - `useEndpointsRuntime()` returns null when no provider is mounted.
14
+ * For optional consumers that should gracefully no-op without one.
15
+ * - `useRequiredEndpointsRuntime()` throws on missing provider — for
16
+ * hooks/components that cannot function without endpoints.
17
+ *
18
+ * IMPORTANT for embedders: memoize the value passed to
19
+ * `<EndpointsRuntimeContext.Provider value={...}>` (e.g. React.useMemo).
20
+ * Reference changes invalidate downstream effect dependency arrays and
21
+ * trigger unnecessary re-fetches.
22
+ */
23
+
24
+ import { createContext, useContext } from 'react'
25
+
26
+ export interface EndpointsRuntime {
27
+ /** GET active announcement (used by `<AnnouncementBar>` polling). */
28
+ announcementsUrl: string
29
+ accessCode: {
30
+ /** POST validate access code. */
31
+ validateUrl: string
32
+ /** POST consume / redeem access code after registration. */
33
+ consumeUrl: string
34
+ }
35
+ /** POST contact-form submission. */
36
+ contactUrl: string
37
+ }
38
+
39
+ export const EndpointsRuntimeContext = createContext<EndpointsRuntime | null>(null)
40
+
41
+ /**
42
+ * Optional read — returns null when no provider is mounted. Use for
43
+ * surfaces that should silently skip the fetch (e.g. announcement
44
+ * polling on a page rendered outside the provider tree).
45
+ */
46
+ export function useEndpointsRuntime(): EndpointsRuntime | null {
47
+ return useContext(EndpointsRuntimeContext)
48
+ }
49
+
50
+ /**
51
+ * Strict variant — throws on missing provider. Use for consumers that
52
+ * cannot function without an endpoint (form submission, code
53
+ * validation). In tests/Storybook, wrap with the hub's
54
+ * `<HubRuntimeProvider>` or a stub
55
+ * `<EndpointsRuntimeContext.Provider value={mockedEndpoints}>`.
56
+ */
57
+ export function useRequiredEndpointsRuntime(): EndpointsRuntime {
58
+ const v = useContext(EndpointsRuntimeContext)
59
+ if (!v) {
60
+ throw new Error(
61
+ '[endpoints-runtime] hook called outside an <EndpointsRuntimeContext.Provider>. ' +
62
+ 'Hub: mount <HubRuntimeProvider> in your providers tree. ' +
63
+ 'Embedded app: mount your own provider with proxied URLs at the tree root. ' +
64
+ 'Tests/Storybook: wrap render() in <EndpointsRuntimeContext.Provider value={mocked}>.',
65
+ )
66
+ }
67
+ return v
68
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Runtime contexts for embeddable oss-lib components.
3
+ *
4
+ * BUNDLE-SPLIT CONVENTION — read before adding new files here:
5
+ * Every module in `src/contexts/` calls `createContext()` at module
6
+ * top level. The tsup config builds this directory under the CLIENT
7
+ * bundle (with `"use client"` banner). Importing anything from here
8
+ * into a SERVER-bundled module (`utils/index.ts` and its `export *`
9
+ * transitive closure) crashes SSR with
10
+ * `createContext is not a function`.
11
+ *
12
+ * Rule of thumb when adding a runtime-aware helper:
13
+ * - Pure functions that take endpoints/runtime as args → `utils/`.
14
+ * - React hooks that READ the runtime via useContext → `hooks/`
15
+ * (with `'use client'` at the top of the file).
16
+ * - Never re-export from `utils/*` anything that pulls
17
+ * `src/contexts/*` transitively.
18
+ *
19
+ * The split between `utils/access-code-client.ts` (pure) and
20
+ * `hooks/use-access-code-integration.ts` (runtime-aware) is the
21
+ * reference example.
22
+ */
23
+
24
+ export {
25
+ EndpointsRuntimeContext,
26
+ useEndpointsRuntime,
27
+ useRequiredEndpointsRuntime,
28
+ type EndpointsRuntime,
29
+ } from './endpoints-runtime-context'
30
+
31
+ export {
32
+ ChatRuntimeContext,
33
+ useChatRuntime,
34
+ useRequiredChatRuntime,
35
+ type ChatRuntime,
36
+ } from './chat-runtime-context'
37
+
38
+ export { useOuterOrDefault } from './use-outer-or-default'
@@ -0,0 +1,42 @@
1
+ 'use client'
2
+
3
+ /**
4
+ * Outer-forward provider helper — used by hub + embedder providers
5
+ * that supply default runtime values while allowing OUTER providers
6
+ * to override.
7
+ *
8
+ * When an embedder mounts an outer `<ChatRuntimeContext.Provider>`
9
+ * (or `<EndpointsRuntimeContext.Provider>`) ABOVE the hub provider,
10
+ * the outer value wins. When no outer is mounted, the hub provider
11
+ * supplies its `factory()` default. Tree shape stays constant —
12
+ * same provider element at the same position regardless of outer
13
+ * presence — so consumers below never remount when an embedder
14
+ * toggles their providers at runtime.
15
+ *
16
+ * `deps` controls factory memoization:
17
+ * - Empty `[]` (default) → factory runs ONCE per mount; safe ONLY
18
+ * when factory closes over module-scope/constant values.
19
+ * - Non-empty → factory re-runs when deps change. Use when the
20
+ * factory closes over callbacks or other reactive values
21
+ * (e.g. hub's ChatRuntime which includes `navigate` +
22
+ * `decideNewTab` callbacks that depend on router + docNav).
23
+ *
24
+ * Returning the SAME reference across renders is critical for
25
+ * downstream `useMemo` consumers. With empty deps, identity is
26
+ * trivially stable. With reactive deps, the caller must memoize
27
+ * the deps themselves (typically via `useCallback`).
28
+ */
29
+
30
+ import { useContext, useMemo, type Context } from 'react'
31
+
32
+ export function useOuterOrDefault<T>(
33
+ context: Context<T | null>,
34
+ factory: () => T,
35
+ deps: ReadonlyArray<unknown> = [],
36
+ ): T {
37
+ const outer = useContext(context)
38
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- deps are the contract;
39
+ // factory identity is intentionally ignored (caller controls re-creation via deps).
40
+ const fallback = useMemo(factory, deps)
41
+ return outer ?? fallback
42
+ }
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Barrel for the `embed-shims/` shims.
3
+ *
4
+ * Each shim is environment-aware: by default it renders a plain HTML
5
+ * equivalent so non-Next hosts (Vite, CRA, esbuild) work out of the
6
+ * box. Next.js hosts opt into the REAL Next primitives by calling the
7
+ * `register*` functions ONCE at app init — see each shim's docblock
8
+ * for the host wiring snippet. After registration, every lib component
9
+ * that renders through these shims delegates to the real Next impl
10
+ * (Image Optimization, client-router prefetching, full app-router
11
+ * navigation, etc.) without further config.
12
+ *
13
+ * Lib internals import each shim directly via its relative path
14
+ * (`../embed-shims/next-link`). Hub and external consumers import
15
+ * through this barrel:
16
+ *
17
+ * import { Link, Image, dynamic, useRouter, usePathname } from
18
+ * '@flamingo-stack/openframe-frontend-core/embed-shims'
19
+ *
20
+ * Or per-shim:
21
+ *
22
+ * import Link from '@flamingo-stack/openframe-frontend-core/embed-shims/next-link'
23
+ * import Image from '@flamingo-stack/openframe-frontend-core/embed-shims/next-image'
24
+ *
25
+ * Companion to the docblocks on each individual shim file.
26
+ */
27
+ export { default as Image, registerImage } from './next-image'
28
+ export { default as Link, registerLink } from './next-link'
29
+ export { default as dynamic, registerDynamic } from './next-dynamic'
30
+ export {
31
+ useRouter,
32
+ usePathname,
33
+ useSearchParams,
34
+ useParams,
35
+ redirect,
36
+ permanentRedirect,
37
+ notFound,
38
+ RedirectType,
39
+ ServerInsertedHTMLContext,
40
+ registerNavigation,
41
+ type NavigationImpl,
42
+ } from './next-navigation'
@@ -0,0 +1,70 @@
1
+ 'use client'
2
+
3
+ /**
4
+ * `next/dynamic` shim — environment-aware lazy loader.
5
+ *
6
+ * Defaults to `React.lazy` so non-Next hosts (Vite, CRA, esbuild) work
7
+ * out of the box. Callers MUST be wrapped in a `<Suspense>` boundary
8
+ * somewhere up the tree (Next.js's runtime provides one automatically;
9
+ * non-Next embedders provide their own).
10
+ *
11
+ * Next.js hosts can opt into the REAL `next/dynamic` (with SSR support,
12
+ * loading components, prefetch hints) by calling {@link registerDynamic}
13
+ * ONCE at app init:
14
+ *
15
+ * // hub: lib/embed-shim-registration.ts
16
+ * import nextDynamic from 'next/dynamic'
17
+ * import { registerDynamic } from '@flamingo-stack/openframe-frontend-core/embed-shims'
18
+ * registerDynamic(nextDynamic)
19
+ *
20
+ * After registration, every lib call to this shim's default export
21
+ * delegates to `next/dynamic`. Without registration, `ssr` / `loading`
22
+ * options are ignored (React.lazy doesn't support them).
23
+ */
24
+ import { lazy, type ComponentType, type ReactNode } from 'react'
25
+
26
+ interface DynamicOptions {
27
+ loading?: (props: {
28
+ error?: Error | null
29
+ isLoading?: boolean
30
+ pastDelay?: boolean
31
+ retry?: () => void
32
+ timedOut?: boolean
33
+ }) => ReactNode | null
34
+ ssr?: boolean
35
+ suspense?: boolean
36
+ }
37
+
38
+ type DynamicLoader<P> = () => Promise<{ default: ComponentType<P> } | ComponentType<P>>
39
+
40
+ /** Matches `next/dynamic`'s exported signature. */
41
+ type DynamicFn = <P extends Record<string, any> = Record<string, never>>(
42
+ loader: DynamicLoader<P>,
43
+ options?: DynamicOptions,
44
+ ) => ComponentType<P>
45
+
46
+ const fallback: DynamicFn = (loader, _options) => {
47
+ // React.lazy expects a loader returning { default }. Wrap loaders
48
+ // that return a bare component (legacy next/dynamic shape).
49
+ const wrapped = () =>
50
+ loader().then((mod: any) => ('default' in mod ? mod : { default: mod }))
51
+ return lazy(wrapped) as unknown as ComponentType<any>
52
+ }
53
+
54
+ let impl: DynamicFn = fallback
55
+
56
+ /**
57
+ * Register the real `next/dynamic` so this shim delegates to it instead
58
+ * of `React.lazy`. Call ONCE at app init in a Next.js host. The function
59
+ * signature must match `next/dynamic`'s default export.
60
+ */
61
+ export function registerDynamic(fn: DynamicFn): void {
62
+ impl = fn
63
+ }
64
+
65
+ export default function dynamic<P extends Record<string, any> = Record<string, never>>(
66
+ loader: DynamicLoader<P>,
67
+ options?: DynamicOptions,
68
+ ): ComponentType<P> {
69
+ return impl(loader, options)
70
+ }
@@ -0,0 +1,114 @@
1
+ /**
2
+ * `next/image` shim — environment-aware Image component.
3
+ *
4
+ * Defaults to a plain `<img>` so non-Next hosts (Vite, CRA, esbuild)
5
+ * work out of the box without aliasing tricks. Next.js hosts can opt
6
+ * into the REAL `next/image` (with Image Optimization) by calling
7
+ * {@link registerImage} ONCE at app init:
8
+ *
9
+ * // hub: lib/embed-shim-registration.ts
10
+ * import NextImage from 'next/image'
11
+ * import { registerImage } from '@flamingo-stack/openframe-frontend-core/embed-shims'
12
+ * registerImage(NextImage)
13
+ *
14
+ * After registration, every lib component that renders this shim
15
+ * delegates to `NextImage` — full Image Optimization, blur placeholders,
16
+ * priority, etc. Without registration, the shim falls through to the
17
+ * plain `<img>` path that drops Next-specific props.
18
+ *
19
+ * Lib internals import this shim directly (relative path); hub-side
20
+ * code goes through the barrel (`@flamingo-stack/.../embed-shims`).
21
+ */
22
+ 'use client'
23
+ import {
24
+ forwardRef,
25
+ type ComponentType,
26
+ type ImgHTMLAttributes,
27
+ } from 'react'
28
+
29
+ type ImageProps = Omit<ImgHTMLAttributes<HTMLImageElement>, 'src' | 'placeholder'> & {
30
+ src?: string | { src: string }
31
+ alt?: string
32
+ width?: number | string
33
+ height?: number | string
34
+ fill?: boolean
35
+ sizes?: string
36
+ quality?: number
37
+ priority?: boolean
38
+ loading?: 'eager' | 'lazy'
39
+ placeholder?: 'blur' | 'empty' | `data:image/${string}`
40
+ blurDataURL?: string
41
+ unoptimized?: boolean
42
+ onLoadingComplete?: (img: HTMLImageElement) => void
43
+ loader?: unknown
44
+ }
45
+
46
+ let impl: ComponentType<any> | null = null
47
+
48
+ /**
49
+ * Register the real `next/image` so this shim delegates to it instead
50
+ * of rendering a plain `<img>`. Call ONCE at app init in a Next.js host
51
+ * — subsequent calls overwrite the registration silently. Safe to skip
52
+ * entirely in non-Next environments.
53
+ */
54
+ export function registerImage(component: ComponentType<any>): void {
55
+ impl = component
56
+ }
57
+
58
+ const Image = forwardRef<HTMLImageElement, ImageProps>(function NextImageShim(
59
+ props,
60
+ ref,
61
+ ) {
62
+ // Real impl path — registered by the host. Hand off untouched so
63
+ // every Next-specific prop (priority, placeholder, sizes, loader…)
64
+ // reaches the real component intact.
65
+ if (impl) {
66
+ const Real = impl
67
+ return <Real ref={ref} {...props} />
68
+ }
69
+
70
+ // Fallback path — plain <img>. Drops Next-only props and reduces
71
+ // `StaticImageData` src to a string.
72
+ const {
73
+ src,
74
+ alt,
75
+ width,
76
+ height,
77
+ fill,
78
+ sizes: _sizes,
79
+ quality: _quality,
80
+ priority: _priority,
81
+ placeholder: _placeholder,
82
+ blurDataURL: _blurDataURL,
83
+ unoptimized: _unoptimized,
84
+ onLoadingComplete,
85
+ loader: _loader,
86
+ style,
87
+ ...rest
88
+ } = props
89
+ const srcStr = typeof src === 'string' ? src : src?.src
90
+ const finalStyle = fill
91
+ ? {
92
+ position: 'absolute' as const,
93
+ inset: 0,
94
+ width: '100%',
95
+ height: '100%',
96
+ objectFit: 'cover' as const,
97
+ ...style,
98
+ }
99
+ : style
100
+ return (
101
+ <img
102
+ ref={ref}
103
+ src={srcStr}
104
+ alt={alt ?? ''}
105
+ width={fill ? undefined : width}
106
+ height={fill ? undefined : height}
107
+ style={finalStyle}
108
+ onLoad={onLoadingComplete ? (e) => onLoadingComplete(e.currentTarget) : undefined}
109
+ {...rest}
110
+ />
111
+ )
112
+ })
113
+
114
+ export default Image
@@ -0,0 +1,91 @@
1
+ /**
2
+ * `next/link` shim — environment-aware Link component.
3
+ *
4
+ * Defaults to a plain `<a>` so non-Next hosts (Vite, CRA, esbuild)
5
+ * work out of the box. Next.js hosts can opt into the REAL `next/link`
6
+ * (with client-router prefetching) by calling {@link registerLink}
7
+ * ONCE at app init:
8
+ *
9
+ * // hub: lib/embed-shim-registration.ts
10
+ * import NextLink from 'next/link'
11
+ * import { registerLink } from '@flamingo-stack/openframe-frontend-core/embed-shims'
12
+ * registerLink(NextLink)
13
+ *
14
+ * After registration, every lib component that renders this shim
15
+ * delegates to `NextLink` — prefetch, replace, scroll, locale, etc.
16
+ * all work as expected. Without registration, the shim falls through
17
+ * to the plain `<a>` path that drops Next-specific props.
18
+ *
19
+ * Lib internals import this shim directly (relative path); hub-side
20
+ * code goes through the barrel (`@flamingo-stack/.../embed-shims`).
21
+ */
22
+ 'use client'
23
+ import {
24
+ forwardRef,
25
+ type AnchorHTMLAttributes,
26
+ type ComponentType,
27
+ type ReactNode,
28
+ } from 'react'
29
+
30
+ type LinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> & {
31
+ href?: string | { pathname?: string; query?: Record<string, string> }
32
+ prefetch?: boolean | null
33
+ replace?: boolean
34
+ scroll?: boolean
35
+ shallow?: boolean
36
+ passHref?: boolean
37
+ legacyBehavior?: boolean
38
+ locale?: string | false
39
+ children?: ReactNode
40
+ }
41
+
42
+ let impl: ComponentType<any> | null = null
43
+
44
+ /**
45
+ * Register the real `next/link` so this shim delegates to it instead
46
+ * of rendering a plain `<a>`. Call ONCE at app init in a Next.js host.
47
+ */
48
+ export function registerLink(component: ComponentType<any>): void {
49
+ impl = component
50
+ }
51
+
52
+ const Link = forwardRef<HTMLAnchorElement, LinkProps>(function NextLinkShim(
53
+ props,
54
+ ref,
55
+ ) {
56
+ // Real impl path — registered by the host. Hand off untouched so
57
+ // every Next-specific prop (prefetch, replace, scroll, locale…)
58
+ // reaches the real component intact.
59
+ if (impl) {
60
+ const Real = impl
61
+ return <Real ref={ref} {...props} />
62
+ }
63
+
64
+ // Fallback path — plain <a>. Drops Next-only props and reduces
65
+ // `UrlObject` href to its pathname.
66
+ const {
67
+ href,
68
+ children,
69
+ prefetch: _prefetch,
70
+ replace: _replace,
71
+ scroll: _scroll,
72
+ shallow: _shallow,
73
+ passHref: _passHref,
74
+ legacyBehavior: _legacyBehavior,
75
+ locale: _locale,
76
+ ...rest
77
+ } = props
78
+ const hrefStr =
79
+ typeof href === 'string'
80
+ ? href
81
+ : href?.pathname
82
+ ? href.pathname
83
+ : undefined
84
+ return (
85
+ <a ref={ref} href={hrefStr} {...rest}>
86
+ {children}
87
+ </a>
88
+ )
89
+ })
90
+
91
+ export default Link
@@ -0,0 +1,201 @@
1
+ /**
2
+ * `next/navigation` shim — environment-aware app-router hooks.
3
+ *
4
+ * Defaults to lightweight stubs backed by `window.location` and
5
+ * `URLSearchParams` so lib components that read the URL work outside
6
+ * a Next.js router shell. Next.js hosts can opt into the REAL
7
+ * `next/navigation` exports (full client-router integration —
8
+ * `router.replace(href, { scroll: false })`, etc.) by calling
9
+ * {@link registerNavigation} ONCE at app init:
10
+ *
11
+ * // hub: lib/embed-shim-registration.ts
12
+ * import {
13
+ * useRouter, usePathname, useSearchParams, useParams,
14
+ * redirect, permanentRedirect, notFound,
15
+ * } from 'next/navigation'
16
+ * import { registerNavigation } from '@flamingo-stack/openframe-frontend-core/embed-shims'
17
+ * registerNavigation({
18
+ * useRouter, usePathname, useSearchParams, useParams,
19
+ * redirect, permanentRedirect, notFound,
20
+ * })
21
+ *
22
+ * After registration, every exported hook in this file delegates to
23
+ * the real implementation. Without registration, the stubs run:
24
+ *
25
+ * - `useRouter()` → push/replace use `window.location.assign/replace`;
26
+ * back/forward use `history.back/forward`; refresh reloads; prefetch
27
+ * is a no-op.
28
+ * - `usePathname()` → returns `window.location.pathname` (popstate-
29
+ * subscribed so back/forward re-renders).
30
+ * - `useSearchParams()` → returns `URLSearchParams` view of
31
+ * `window.location.search` (popstate-subscribed).
32
+ * - `useParams()` → returns `{}` — embedders that need dynamic
33
+ * params should parse them from `usePathname()` themselves.
34
+ * - `notFound()` / `redirect()` / `permanentRedirect()` —
35
+ * best-effort equivalents using `window.location`.
36
+ *
37
+ * The fallback path subscribes to `popstate` only. Programmatic
38
+ * `pushState`/`replaceState` does NOT fire popstate, so the fallback
39
+ * does not auto-re-render on programmatic navigation. Embedders that
40
+ * need that should register a real router or supply their own.
41
+ */
42
+ 'use client'
43
+ import { useEffect, useState } from 'react'
44
+
45
+ // --- Router shape — matches Next's AppRouterInstance surface enough to
46
+ // --- satisfy hub callsites that pass options like `{ scroll: false }`.
47
+ interface NavigateOptions {
48
+ scroll?: boolean
49
+ }
50
+
51
+ interface PrefetchOptions {
52
+ kind?: unknown
53
+ }
54
+
55
+ interface RouterStub {
56
+ push: (href: string, options?: NavigateOptions) => void
57
+ replace: (href: string, options?: NavigateOptions) => void
58
+ back: () => void
59
+ forward: () => void
60
+ refresh: () => void
61
+ prefetch: (href: string, options?: PrefetchOptions) => void
62
+ }
63
+
64
+ // --- Registration surface — partial so a host can register only the
65
+ // --- hooks it needs (e.g. routes that don't use redirect()).
66
+ export interface NavigationImpl {
67
+ useRouter: () => RouterStub
68
+ usePathname: () => string
69
+ useSearchParams: () => URLSearchParams
70
+ useParams: <T extends Record<string, string | string[]>>() => T
71
+ redirect: (url: string, type?: unknown) => never
72
+ permanentRedirect: (url: string, type?: unknown) => never
73
+ notFound: () => never
74
+ }
75
+
76
+ let impl: Partial<NavigationImpl> = {}
77
+
78
+ /**
79
+ * Register real `next/navigation` exports. Merges with any prior
80
+ * registration so partial-overrides are safe. Call ONCE at app init
81
+ * in a Next.js host.
82
+ */
83
+ export function registerNavigation(nav: Partial<NavigationImpl>): void {
84
+ impl = { ...impl, ...nav }
85
+ }
86
+
87
+ // --- Fallback impls ----------------------------------------------------
88
+
89
+ const noopRouter: RouterStub = {
90
+ push: () => {},
91
+ replace: () => {},
92
+ back: () => {},
93
+ forward: () => {},
94
+ refresh: () => {},
95
+ prefetch: () => {},
96
+ }
97
+
98
+ function fallbackUseRouter(): RouterStub {
99
+ if (typeof window === 'undefined') return noopRouter
100
+ return {
101
+ push: (href: string) => window.location.assign(href),
102
+ replace: (href: string) => window.location.replace(href),
103
+ back: () => window.history.back(),
104
+ forward: () => window.history.forward(),
105
+ refresh: () => window.location.reload(),
106
+ prefetch: () => {},
107
+ }
108
+ }
109
+
110
+ function readLocation<T>(read: () => T, fallback: T): T {
111
+ return typeof window === 'undefined' ? fallback : read()
112
+ }
113
+
114
+ /** Subscribes to `popstate` only. pushState/replaceState do NOT fire
115
+ * popstate by design — callers that mutate the URL programmatically
116
+ * (and want their component to re-render in response) need a real
117
+ * router. */
118
+ function useLocationSubscription(): number {
119
+ const [tick, setTick] = useState(0)
120
+ useEffect(() => {
121
+ if (typeof window === 'undefined') return
122
+ const onChange = () => setTick((t) => t + 1)
123
+ window.addEventListener('popstate', onChange)
124
+ return () => window.removeEventListener('popstate', onChange)
125
+ }, [])
126
+ return tick
127
+ }
128
+
129
+ function fallbackUsePathname(): string {
130
+ useLocationSubscription()
131
+ return readLocation(() => window.location.pathname, '/')
132
+ }
133
+
134
+ function fallbackUseSearchParams(): URLSearchParams {
135
+ useLocationSubscription()
136
+ return readLocation(
137
+ () => new URLSearchParams(window.location.search),
138
+ new URLSearchParams(),
139
+ )
140
+ }
141
+
142
+ function fallbackUseParams<T extends Record<string, string | string[]>>(): T {
143
+ return {} as T
144
+ }
145
+
146
+ function fallbackRedirect(url: string): never {
147
+ if (typeof window !== 'undefined') window.location.assign(url)
148
+ throw new Error(`[next-navigation shim] redirect(${url})`)
149
+ }
150
+
151
+ function fallbackPermanentRedirect(url: string): never {
152
+ if (typeof window !== 'undefined') window.location.replace(url)
153
+ throw new Error(`[next-navigation shim] permanentRedirect(${url})`)
154
+ }
155
+
156
+ function fallbackNotFound(): never {
157
+ throw new Error('[next-navigation shim] notFound()')
158
+ }
159
+
160
+ // --- Public surface — each export checks the registry and falls
161
+ // --- through to the fallback. Hooks must remain hooks (no early-
162
+ // --- return-before-hook) — the registry lookup is itself synchronous
163
+ // --- and the registered impl is a hook in its own right.
164
+
165
+ export function useRouter(): RouterStub {
166
+ return (impl.useRouter ?? fallbackUseRouter)()
167
+ }
168
+
169
+ export function usePathname(): string {
170
+ return (impl.usePathname ?? fallbackUsePathname)()
171
+ }
172
+
173
+ export function useSearchParams(): URLSearchParams {
174
+ return (impl.useSearchParams ?? fallbackUseSearchParams)()
175
+ }
176
+
177
+ export function useParams<T extends Record<string, string | string[]>>(): T {
178
+ return ((impl.useParams as (() => T) | undefined) ?? fallbackUseParams)()
179
+ }
180
+
181
+ export function redirect(url: string, type?: unknown): never {
182
+ return (impl.redirect ?? fallbackRedirect)(url, type)
183
+ }
184
+
185
+ export function permanentRedirect(url: string, type?: unknown): never {
186
+ return (impl.permanentRedirect ?? fallbackPermanentRedirect)(url, type)
187
+ }
188
+
189
+ export function notFound(): never {
190
+ return (impl.notFound ?? fallbackNotFound)()
191
+ }
192
+
193
+ /** Match Next's RedirectType enum surface for code that imports it. */
194
+ export const RedirectType = {
195
+ push: 'push' as const,
196
+ replace: 'replace' as const,
197
+ }
198
+
199
+ /** Match Next's ServerInsertedHTMLContext surface — non-functional in
200
+ * the embed environment but importable so consumers don't crash. */
201
+ export const ServerInsertedHTMLContext = null as any
@@ -18,3 +18,12 @@ export * from './nats/use-nats-client'
18
18
 
19
19
  // Viewport / lazy-mount primitive (shared IO singleton)
20
20
  export * from './use-near-viewport'
21
+
22
+ // Access code integration — pairs with the standalone helpers in
23
+ // `utils/access-code-client`. Lives in `hooks/` so the createContext
24
+ // pulled in via EndpointsRuntimeContext doesn't end up in the
25
+ // server-safe utils bundle.
26
+ export * from './use-access-code-integration'
27
+
28
+ // OG placeholder URL builder hook (requires host-supplied URL builder)
29
+ export * from './use-og-placeholder'
@@ -19,7 +19,7 @@
19
19
 
20
20
  'use client'
21
21
 
22
- import { useRouter, useSearchParams } from 'next/navigation'
22
+ import { useRouter, useSearchParams } from '../../embed-shims/next-navigation'
23
23
  import { useCallback, useMemo, useRef } from 'react'
24
24
  import { FlattenedParam, shouldIncludeInUrl } from './flatten-schema'
25
25
  import { JSType } from './graphql-parser'