@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.
- package/dist/{chunk-4CWSZPXH.cjs → chunk-24KCAECR.cjs} +9 -9
- package/dist/{chunk-4CWSZPXH.cjs.map → chunk-24KCAECR.cjs.map} +1 -1
- package/dist/chunk-27APPAJN.cjs +24 -0
- package/dist/chunk-27APPAJN.cjs.map +1 -0
- package/dist/{chunk-UC43NICZ.cjs → chunk-664KA5FI.cjs} +2 -35
- package/dist/chunk-664KA5FI.cjs.map +1 -0
- package/dist/chunk-6RZYJICV.cjs +24 -0
- package/dist/chunk-6RZYJICV.cjs.map +1 -0
- package/dist/chunk-7L4DWM7P.js +24 -0
- package/dist/chunk-7L4DWM7P.js.map +1 -0
- package/dist/chunk-BZFW3FOF.cjs +21 -0
- package/dist/chunk-BZFW3FOF.cjs.map +1 -0
- package/dist/{chunk-N57KWHDB.js → chunk-CIPO6DXK.js} +5 -5
- package/dist/chunk-EL5YVPD5.js +21 -0
- package/dist/chunk-EL5YVPD5.js.map +1 -0
- package/dist/{chunk-ARQ4XP64.cjs → chunk-FDCFI7YT.cjs} +40080 -31492
- package/dist/chunk-FDCFI7YT.cjs.map +1 -0
- package/dist/chunk-G7UE6RKV.cjs +121 -0
- package/dist/chunk-G7UE6RKV.cjs.map +1 -0
- package/dist/{chunk-25LVV26X.cjs → chunk-JUZGUQMX.cjs} +178 -50
- package/dist/chunk-JUZGUQMX.cjs.map +1 -0
- package/dist/{chunk-SZPJ5R5B.js → chunk-KSOOKNBG.js} +1 -34
- package/dist/chunk-KSOOKNBG.js.map +1 -0
- package/dist/{chunk-RMB5DVED.cjs → chunk-KUZGEA7U.cjs} +83 -66
- package/dist/chunk-KUZGEA7U.cjs.map +1 -0
- package/dist/chunk-LXC6P2EO.js +63 -0
- package/dist/chunk-LXC6P2EO.js.map +1 -0
- package/dist/chunk-MJNXIEV2.js +24 -0
- package/dist/chunk-MJNXIEV2.js.map +1 -0
- package/dist/{chunk-CPXLQ57U.js → chunk-MVGGXOFA.js} +37 -20
- package/dist/chunk-MVGGXOFA.js.map +1 -0
- package/dist/{chunk-LY34ORX6.js → chunk-O55ZUAX7.js} +39920 -31332
- package/dist/chunk-O55ZUAX7.js.map +1 -0
- package/dist/chunk-OHPI2HRK.js +47 -0
- package/dist/chunk-OHPI2HRK.js.map +1 -0
- package/dist/chunk-PLJLE4A4.js +121 -0
- package/dist/chunk-PLJLE4A4.js.map +1 -0
- package/dist/{chunk-XGL5FKIK.js → chunk-SCN5WFIZ.js} +148 -20
- package/dist/chunk-SCN5WFIZ.js.map +1 -0
- package/dist/chunk-WBR7H6E3.cjs +47 -0
- package/dist/chunk-WBR7H6E3.cjs.map +1 -0
- package/dist/chunk-XL4V2PYG.cjs +63 -0
- package/dist/chunk-XL4V2PYG.cjs.map +1 -0
- package/dist/components/announcement-bar.d.ts.map +1 -1
- package/dist/components/chat/chat-attachment-bar.d.ts +66 -0
- package/dist/components/chat/chat-attachment-bar.d.ts.map +1 -0
- package/dist/components/chat/chat-container.d.ts +21 -1
- package/dist/components/chat/chat-container.d.ts.map +1 -1
- package/dist/components/chat/chat-input.d.ts.map +1 -1
- package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
- package/dist/components/chat/chat-message-list.d.ts.map +1 -1
- package/dist/components/chat/chat-panel-context.d.ts +9 -0
- package/dist/components/chat/chat-panel-context.d.ts.map +1 -0
- package/dist/components/chat/chat-ticket-list.d.ts +1 -1
- package/dist/components/chat/chat-ticket-list.d.ts.map +1 -1
- package/dist/components/chat/embeddable-chat.d.ts +42 -0
- package/dist/components/chat/embeddable-chat.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/admin-content-card.d.ts +34 -0
- package/dist/components/chat/entity-cards/admin-content-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/block-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/blog-card.d.ts +30 -0
- package/dist/components/chat/entity-cards/blog-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/blog-image-placeholder.d.ts +26 -0
- package/dist/components/chat/entity-cards/blog-image-placeholder.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/campaign-card-admin.d.ts +33 -0
- package/dist/components/chat/entity-cards/campaign-card-admin.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/case-study-card.d.ts +20 -0
- package/dist/components/chat/entity-cards/case-study-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/chat-ticket-item.d.ts.map +1 -0
- package/dist/components/chat/{chat-video-entity-card.d.ts → entity-cards/chat-video-entity-card.d.ts} +1 -1
- package/dist/components/chat/entity-cards/chat-video-entity-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/customer-interview-card.d.ts +19 -0
- package/dist/components/chat/entity-cards/customer-interview-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/data-room-doc-card.d.ts +47 -0
- package/dist/components/chat/entity-cards/data-room-doc-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/dispatch.d.ts +119 -0
- package/dist/components/chat/entity-cards/dispatch.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/entity-author-card.d.ts +87 -0
- package/dist/components/chat/entity-cards/entity-author-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/generic-entity-card.d.ts +42 -0
- package/dist/components/chat/entity-cards/generic-entity-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/github-activity-card.d.ts +37 -0
- package/dist/components/chat/entity-cards/github-activity-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/hubspot-ticket-card.d.ts +28 -0
- package/dist/components/chat/entity-cards/hubspot-ticket-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/index.d.ts +32 -0
- package/dist/components/chat/entity-cards/index.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/investor-update-card.d.ts +19 -0
- package/dist/components/chat/entity-cards/investor-update-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/onboarding-guide-card.d.ts +20 -0
- package/dist/components/chat/entity-cards/onboarding-guide-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/product-release-card-defaults.d.ts +21 -0
- package/dist/components/chat/entity-cards/product-release-card-defaults.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/product-release-card.d.ts +12 -0
- package/dist/components/chat/entity-cards/product-release-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/program-card-defaults.d.ts +32 -0
- package/dist/components/chat/entity-cards/program-card-defaults.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/program-card.d.ts +37 -0
- package/dist/components/chat/entity-cards/program-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/roadmap-card.d.ts +28 -0
- package/dist/components/chat/entity-cards/roadmap-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/roadmap-vote-button.d.ts +12 -0
- package/dist/components/chat/entity-cards/roadmap-vote-button.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/slack-message-card.d.ts +28 -0
- package/dist/components/chat/entity-cards/slack-message-card.d.ts.map +1 -0
- package/dist/components/chat/entity-cards/task-type-icon.d.ts +6 -0
- package/dist/components/chat/entity-cards/task-type-icon.d.ts.map +1 -0
- package/dist/components/chat/hooks/index.d.ts +10 -0
- package/dist/components/chat/hooks/index.d.ts.map +1 -1
- package/dist/components/chat/hooks/use-chat-attachment-image-gallery.d.ts +5 -0
- package/dist/components/chat/hooks/use-chat-attachment-image-gallery.d.ts.map +1 -0
- package/dist/components/chat/hooks/use-chat-attachments.d.ts +33 -0
- package/dist/components/chat/hooks/use-chat-attachments.d.ts.map +1 -0
- package/dist/components/chat/hooks/use-chat-card-item.d.ts +7 -0
- package/dist/components/chat/hooks/use-chat-card-item.d.ts.map +1 -0
- package/dist/components/chat/hooks/use-chat-identity.d.ts +44 -0
- package/dist/components/chat/hooks/use-chat-identity.d.ts.map +1 -0
- package/dist/components/chat/hooks/use-chat.d.ts +30 -0
- package/dist/components/chat/hooks/use-chat.d.ts.map +1 -0
- package/dist/components/chat/hooks/use-close-on-navigation.d.ts +2 -0
- package/dist/components/chat/hooks/use-close-on-navigation.d.ts.map +1 -0
- package/dist/components/chat/hooks/use-embedded-chat.d.ts +174 -0
- package/dist/components/chat/hooks/use-embedded-chat.d.ts.map +1 -0
- package/dist/components/chat/hooks/use-proxied-image-url.d.ts +18 -0
- package/dist/components/chat/hooks/use-proxied-image-url.d.ts.map +1 -0
- package/dist/components/chat/hooks/use-slash-commands.d.ts +32 -0
- package/dist/components/chat/hooks/use-slash-commands.d.ts.map +1 -0
- package/dist/components/chat/hooks/use-sse.d.ts +57 -0
- package/dist/components/chat/hooks/use-sse.d.ts.map +1 -0
- package/dist/components/chat/index.cjs +393 -0
- package/dist/components/chat/index.cjs.map +1 -0
- package/dist/components/chat/index.d.ts +5 -3
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/chat/index.js +393 -0
- package/dist/components/chat/index.js.map +1 -0
- package/dist/components/chat/nav-link-anchor-via-runtime.d.ts +33 -0
- package/dist/components/chat/nav-link-anchor-via-runtime.d.ts.map +1 -0
- package/dist/components/chat/source-action-button.d.ts +39 -0
- package/dist/components/chat/source-action-button.d.ts.map +1 -0
- package/dist/components/chat/types/chat.types.d.ts +36 -0
- package/dist/components/chat/types/chat.types.d.ts.map +1 -1
- package/dist/components/chat/types/component.types.d.ts +56 -11
- package/dist/components/chat/types/component.types.d.ts.map +1 -1
- package/dist/components/chat/types/entities/blog.d.ts +14 -0
- package/dist/components/chat/types/entities/blog.d.ts.map +1 -0
- package/dist/components/chat/types/entities/case-study.d.ts +10 -0
- package/dist/components/chat/types/entities/case-study.d.ts.map +1 -0
- package/dist/components/chat/types/entities/content-ref.d.ts +23 -0
- package/dist/components/chat/types/entities/content-ref.d.ts.map +1 -0
- package/dist/components/chat/types/entities/customer-interview.d.ts +10 -0
- package/dist/components/chat/types/entities/customer-interview.d.ts.map +1 -0
- package/dist/components/chat/types/entities/data-room-doc.d.ts +37 -0
- package/dist/components/chat/types/entities/data-room-doc.d.ts.map +1 -0
- package/dist/components/chat/types/entities/github-activity.d.ts +29 -0
- package/dist/components/chat/types/entities/github-activity.d.ts.map +1 -0
- package/dist/components/chat/types/entities/hubspot-ticket.d.ts +39 -0
- package/dist/components/chat/types/entities/hubspot-ticket.d.ts.map +1 -0
- package/dist/components/chat/types/entities/index.d.ts +28 -0
- package/dist/components/chat/types/entities/index.d.ts.map +1 -0
- package/dist/components/chat/types/entities/investor-update.d.ts +83 -0
- package/dist/components/chat/types/entities/investor-update.d.ts.map +1 -0
- package/dist/components/chat/types/entities/onboarding-guide.d.ts +79 -0
- package/dist/components/chat/types/entities/onboarding-guide.d.ts.map +1 -0
- package/dist/components/chat/types/entities/program-types.d.ts +303 -0
- package/dist/components/chat/types/entities/program-types.d.ts.map +1 -0
- package/dist/components/chat/types/entities/roadmap-item.d.ts +41 -0
- package/dist/components/chat/types/entities/roadmap-item.d.ts.map +1 -0
- package/dist/components/chat/types/entities/slack-message.d.ts +28 -0
- package/dist/components/chat/types/entities/slack-message.d.ts.map +1 -0
- package/dist/components/chat/types/index.d.ts +1 -0
- package/dist/components/chat/types/index.d.ts.map +1 -1
- package/dist/components/chat/utils/agent-status-message.d.ts +18 -0
- package/dist/components/chat/utils/agent-status-message.d.ts.map +1 -0
- package/dist/components/chat/utils/auto-continuation-directive.d.ts +38 -0
- package/dist/components/chat/utils/auto-continuation-directive.d.ts.map +1 -0
- package/dist/components/chat/utils/chat-attachment-markdown.d.ts +114 -0
- package/dist/components/chat/utils/chat-attachment-markdown.d.ts.map +1 -0
- package/dist/components/chat/utils/chat-authed-fetch.d.ts +13 -0
- package/dist/components/chat/utils/chat-authed-fetch.d.ts.map +1 -0
- package/dist/components/chat/utils/chat-nav-resolution.d.ts +72 -0
- package/dist/components/chat/utils/chat-nav-resolution.d.ts.map +1 -0
- package/dist/components/chat/utils/chat-proxy-auth-storage.d.ts +43 -0
- package/dist/components/chat/utils/chat-proxy-auth-storage.d.ts.map +1 -0
- package/dist/components/chat/utils/chip-action-class.d.ts +16 -0
- package/dist/components/chat/utils/chip-action-class.d.ts.map +1 -0
- package/dist/components/chat/utils/chip-styles.d.ts +32 -0
- package/dist/components/chat/utils/chip-styles.d.ts.map +1 -0
- package/dist/components/chat/utils/clickup-task-type-utils.d.ts +38 -0
- package/dist/components/chat/utils/clickup-task-type-utils.d.ts.map +1 -0
- package/dist/components/chat/utils/compact-card-classes.d.ts +50 -0
- package/dist/components/chat/utils/compact-card-classes.d.ts.map +1 -0
- package/dist/components/chat/utils/decide-new-tab.d.ts +39 -0
- package/dist/components/chat/utils/decide-new-tab.d.ts.map +1 -0
- package/dist/components/chat/utils/external-app-urls.d.ts +14 -0
- package/dist/components/chat/utils/external-app-urls.d.ts.map +1 -0
- package/dist/components/chat/utils/flatten-assistant-content.d.ts +25 -0
- package/dist/components/chat/utils/flatten-assistant-content.d.ts.map +1 -0
- package/dist/components/chat/utils/icon-registry.d.ts +67 -0
- package/dist/components/chat/utils/icon-registry.d.ts.map +1 -0
- package/dist/components/chat/utils/index.d.ts +21 -0
- package/dist/components/chat/utils/index.d.ts.map +1 -1
- package/dist/components/chat/utils/is-cross-origin-url.d.ts +22 -0
- package/dist/components/chat/utils/is-cross-origin-url.d.ts.map +1 -0
- package/dist/components/chat/utils/nav-anchor-props.d.ts +54 -0
- package/dist/components/chat/utils/nav-anchor-props.d.ts.map +1 -0
- package/dist/components/chat/utils/nav-click-handler.d.ts +51 -0
- package/dist/components/chat/utils/nav-click-handler.d.ts.map +1 -0
- package/dist/components/chat/utils/scroll-anchor.d.ts +30 -0
- package/dist/components/chat/utils/scroll-anchor.d.ts.map +1 -0
- package/dist/components/chat/utils/slash-dispatch-utils.d.ts +109 -0
- package/dist/components/chat/utils/slash-dispatch-utils.d.ts.map +1 -0
- package/dist/components/chat/utils/source-icons.d.ts +8 -0
- package/dist/components/chat/utils/source-icons.d.ts.map +1 -0
- package/dist/components/chat/utils/source-row-cta.d.ts +111 -0
- package/dist/components/chat/utils/source-row-cta.d.ts.map +1 -0
- package/dist/components/features/figma-prototype-viewer.d.ts.map +1 -1
- package/dist/components/features/index.cjs +12 -6
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.js +11 -5
- package/dist/components/features/video.d.ts.map +1 -1
- package/dist/components/icons/index.cjs +3 -3
- package/dist/components/icons/index.js +2 -2
- package/dist/components/index.cjs +274 -8
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +273 -7
- package/dist/components/interactive-wrapper.d.ts +3 -3
- package/dist/components/navigation/index.cjs +12 -6
- package/dist/components/navigation/index.cjs.map +1 -1
- package/dist/components/navigation/index.js +11 -5
- package/dist/components/resizable.d.ts +1 -1
- package/dist/components/shared/product-release/product-release-card-skeleton.d.ts +1 -1
- package/dist/components/shared/product-release/product-release-card-skeleton.d.ts.map +1 -1
- package/dist/components/shared/product-release/product-release-card.d.ts +19 -12
- package/dist/components/shared/product-release/product-release-card.d.ts.map +1 -1
- package/dist/components/shared/product-release/release-detail-page.d.ts +2 -4
- package/dist/components/shared/product-release/release-detail-page.d.ts.map +1 -1
- package/dist/components/ui/button/button.d.ts +13 -0
- package/dist/components/ui/button/button.d.ts.map +1 -1
- package/dist/components/ui/dashboard-info-card.d.ts.map +1 -1
- package/dist/components/ui/entity-image.d.ts.map +1 -1
- package/dist/components/ui/file-manager/index.cjs +71 -70
- package/dist/components/ui/file-manager/index.cjs.map +1 -1
- package/dist/components/ui/file-manager/index.js +6 -5
- package/dist/components/ui/file-manager/index.js.map +1 -1
- package/dist/components/ui/hover-dropdown.d.ts +66 -0
- package/dist/components/ui/hover-dropdown.d.ts.map +1 -0
- package/dist/components/ui/index.cjs +276 -6
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +278 -8
- package/dist/components/ui/simple-markdown-renderer.d.ts.map +1 -1
- package/dist/components/ui/square-avatar.d.ts.map +1 -1
- package/dist/contexts/chat-runtime-context.d.ts +109 -0
- package/dist/contexts/chat-runtime-context.d.ts.map +1 -0
- package/dist/contexts/endpoints-runtime-context.d.ts +28 -0
- package/dist/contexts/endpoints-runtime-context.d.ts.map +1 -0
- package/dist/contexts/index.cjs +30 -0
- package/dist/contexts/index.cjs.map +1 -0
- package/dist/contexts/index.d.ts +26 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/contexts/index.js +30 -0
- package/dist/contexts/index.js.map +1 -0
- package/dist/contexts/use-outer-or-default.d.ts +29 -0
- package/dist/contexts/use-outer-or-default.d.ts.map +1 -0
- package/dist/embed-shims/index.cjs +51 -0
- package/dist/embed-shims/index.cjs.map +1 -0
- package/dist/embed-shims/index.d.ts +31 -0
- package/dist/embed-shims/index.d.ts.map +1 -0
- package/dist/embed-shims/index.js +51 -0
- package/dist/embed-shims/index.js.map +1 -0
- package/dist/embed-shims/next-dynamic.cjs +12 -0
- package/dist/embed-shims/next-dynamic.cjs.map +1 -0
- package/dist/embed-shims/next-dynamic.d.ts +47 -0
- package/dist/embed-shims/next-dynamic.d.ts.map +1 -0
- package/dist/embed-shims/next-dynamic.js +12 -0
- package/dist/embed-shims/next-dynamic.js.map +1 -0
- package/dist/embed-shims/next-image.cjs +12 -0
- package/dist/embed-shims/next-image.cjs.map +1 -0
- package/dist/embed-shims/next-image.d.ts +28 -0
- package/dist/embed-shims/next-image.d.ts.map +1 -0
- package/dist/embed-shims/next-image.js +12 -0
- package/dist/embed-shims/next-image.js.map +1 -0
- package/dist/embed-shims/next-link.cjs +14 -0
- package/dist/embed-shims/next-link.cjs.map +1 -0
- package/dist/embed-shims/next-link.d.ts +22 -0
- package/dist/embed-shims/next-link.d.ts.map +1 -0
- package/dist/embed-shims/next-link.js +14 -0
- package/dist/embed-shims/next-link.js.map +1 -0
- package/dist/embed-shims/next-navigation.cjs +30 -0
- package/dist/embed-shims/next-navigation.cjs.map +1 -0
- package/dist/embed-shims/next-navigation.d.ts +46 -0
- package/dist/embed-shims/next-navigation.d.ts.map +1 -0
- package/dist/embed-shims/next-navigation.js +30 -0
- package/dist/embed-shims/next-navigation.js.map +1 -0
- package/dist/hooks/index.cjs +10 -4
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +9 -3
- package/dist/hooks/use-access-code-integration.d.ts +48 -0
- package/dist/hooks/use-access-code-integration.d.ts.map +1 -0
- package/dist/hooks/use-contact-submission.d.ts.map +1 -1
- package/dist/hooks/use-og-placeholder.d.ts +31 -0
- package/dist/hooks/use-og-placeholder.d.ts.map +1 -0
- package/dist/hooks/use-toast.d.ts +1 -1
- package/dist/index.cjs +367 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +378 -18
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/access-code-client.d.ts +21 -37
- package/dist/utils/access-code-client.d.ts.map +1 -1
- package/dist/utils/cn.d.ts +0 -27
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/color-analysis.d.ts +33 -0
- package/dist/utils/color-analysis.d.ts.map +1 -0
- package/dist/utils/date-formatters.d.ts +16 -5
- package/dist/utils/date-formatters.d.ts.map +1 -1
- package/dist/utils/fetch-priority.d.ts +3 -0
- package/dist/utils/fetch-priority.d.ts.map +1 -0
- package/dist/utils/format.d.ts +192 -1
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/image-proxy.d.ts +67 -2
- package/dist/utils/image-proxy.d.ts.map +1 -1
- package/dist/utils/index.cjs +1274 -155
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.d.ts +19 -3
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1200 -157
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/local-storage-adapter.d.ts +46 -0
- package/dist/utils/local-storage-adapter.d.ts.map +1 -0
- package/dist/utils/source-icons.d.ts +78 -0
- package/dist/utils/source-icons.d.ts.map +1 -0
- package/package.json +29 -2
- package/src/components/announcement-bar.tsx +26 -4
- package/src/components/categories-cart.tsx +1 -1
- package/src/components/chat/chat-attachment-bar.tsx +323 -0
- package/src/components/chat/chat-container.tsx +39 -5
- package/src/components/chat/chat-input.tsx +7 -1
- package/src/components/chat/chat-message-enhanced.tsx +32 -22
- package/src/components/chat/chat-message-list.tsx +53 -4
- package/src/components/chat/chat-panel-context.tsx +37 -0
- package/src/components/chat/chat-ticket-list.tsx +1 -1
- package/src/components/chat/embeddable-chat.tsx +1106 -0
- package/src/components/chat/entity-cards/admin-content-card.tsx +155 -0
- package/src/components/chat/entity-cards/blog-card.tsx +259 -0
- package/src/components/chat/entity-cards/blog-image-placeholder.tsx +52 -0
- package/src/components/chat/entity-cards/campaign-card-admin.tsx +113 -0
- package/src/components/chat/entity-cards/case-study-card.tsx +192 -0
- package/src/components/chat/{chat-ticket-item.tsx → entity-cards/chat-ticket-item.tsx} +2 -2
- package/src/components/chat/{chat-video-entity-card.tsx → entity-cards/chat-video-entity-card.tsx} +2 -2
- package/src/components/chat/entity-cards/customer-interview-card.tsx +211 -0
- package/src/components/chat/entity-cards/data-room-doc-card.tsx +120 -0
- package/src/components/chat/entity-cards/dispatch.tsx +1093 -0
- package/src/components/chat/entity-cards/entity-author-card.tsx +193 -0
- package/src/components/chat/entity-cards/generic-entity-card.tsx +144 -0
- package/src/components/chat/entity-cards/github-activity-card.tsx +305 -0
- package/src/components/chat/entity-cards/hubspot-ticket-card.tsx +205 -0
- package/src/components/chat/entity-cards/index.ts +125 -0
- package/src/components/chat/entity-cards/investor-update-card.tsx +150 -0
- package/src/components/chat/entity-cards/onboarding-guide-card.tsx +326 -0
- package/src/components/chat/entity-cards/product-release-card-defaults.ts +57 -0
- package/src/components/chat/entity-cards/product-release-card.tsx +19 -0
- package/src/components/chat/entity-cards/program-card-defaults.ts +62 -0
- package/src/components/chat/entity-cards/program-card.tsx +451 -0
- package/src/components/chat/entity-cards/roadmap-card.tsx +356 -0
- package/src/components/chat/entity-cards/roadmap-vote-button.tsx +54 -0
- package/src/components/chat/entity-cards/slack-message-card.tsx +182 -0
- package/src/components/chat/entity-cards/task-type-icon.tsx +60 -0
- package/src/components/chat/hooks/index.ts +22 -0
- package/src/components/chat/hooks/use-chat-attachment-image-gallery.tsx +114 -0
- package/src/components/chat/hooks/use-chat-attachments.ts +429 -0
- package/src/components/chat/hooks/use-chat-card-item.ts +102 -0
- package/src/components/chat/hooks/use-chat-identity.ts +139 -0
- package/src/components/chat/hooks/use-chat.ts +501 -0
- package/src/components/chat/hooks/use-close-on-navigation.ts +87 -0
- package/src/components/chat/hooks/use-embedded-chat.ts +1023 -0
- package/src/components/chat/hooks/use-proxied-image-url.ts +31 -0
- package/src/components/chat/hooks/use-slash-commands.ts +106 -0
- package/src/components/chat/hooks/use-sse.ts +143 -0
- package/src/components/chat/index.ts +30 -4
- package/src/components/chat/nav-link-anchor-via-runtime.tsx +72 -0
- package/src/components/chat/source-action-button.tsx +120 -0
- package/src/components/chat/types/chat.types.ts +61 -0
- package/src/components/chat/types/component.types.ts +57 -11
- package/src/components/chat/types/entities/blog.ts +27 -0
- package/src/components/chat/types/entities/case-study.ts +14 -0
- package/src/components/chat/types/entities/content-ref.ts +23 -0
- package/src/components/chat/types/entities/customer-interview.ts +15 -0
- package/src/components/chat/types/entities/data-room-doc.ts +37 -0
- package/src/components/chat/types/entities/github-activity.ts +36 -0
- package/src/components/chat/types/entities/hubspot-ticket.ts +39 -0
- package/src/components/chat/types/entities/index.ts +28 -0
- package/src/components/chat/types/entities/investor-update.ts +100 -0
- package/src/components/chat/types/entities/onboarding-guide.ts +101 -0
- package/src/components/chat/types/entities/program-types.ts +433 -0
- package/src/components/chat/types/entities/roadmap-item.ts +42 -0
- package/src/components/chat/types/entities/slack-message.ts +28 -0
- package/src/components/chat/types/index.ts +1 -0
- package/src/components/chat/utils/agent-status-message.ts +52 -0
- package/src/components/chat/utils/auto-continuation-directive.ts +70 -0
- package/src/components/chat/utils/chat-attachment-markdown.ts +190 -0
- package/src/components/chat/utils/chat-authed-fetch.ts +73 -0
- package/src/components/chat/utils/chat-nav-resolution.ts +151 -0
- package/src/components/chat/utils/chat-proxy-auth-storage.ts +148 -0
- package/src/components/chat/utils/chip-action-class.ts +19 -0
- package/src/components/chat/utils/chip-styles.ts +51 -0
- package/src/components/chat/utils/clickup-task-type-utils.ts +59 -0
- package/src/components/chat/utils/compact-card-classes.ts +97 -0
- package/src/components/chat/utils/decide-new-tab.ts +57 -0
- package/src/components/chat/utils/external-app-urls.ts +19 -0
- package/src/components/chat/utils/flatten-assistant-content.ts +35 -0
- package/src/components/chat/utils/icon-registry.ts +297 -0
- package/src/components/chat/utils/index.ts +133 -0
- package/src/components/chat/utils/is-cross-origin-url.ts +28 -0
- package/src/components/chat/utils/nav-anchor-props.ts +78 -0
- package/src/components/chat/utils/nav-click-handler.ts +81 -0
- package/src/components/chat/utils/scroll-anchor.ts +35 -0
- package/src/components/chat/utils/slash-dispatch-utils.ts +183 -0
- package/src/components/chat/utils/source-icons.ts +14 -0
- package/src/components/chat/utils/source-row-cta.ts +215 -0
- package/src/components/empty-state.tsx +1 -1
- package/src/components/features/board/ticket-card.tsx +1 -1
- package/src/components/features/figma-prototype-viewer.tsx +2 -1
- package/src/components/features/media-gallery-manager.tsx +1 -1
- package/src/components/features/parallax-image-showcase.tsx +1 -1
- package/src/components/features/release-media-manager.tsx +1 -1
- package/src/components/features/seo-editor-preview.tsx +1 -1
- package/src/components/features/video.tsx +54 -3
- package/src/components/footer-waitlist-button.tsx +1 -1
- package/src/components/navigation/header.tsx +1 -1
- package/src/components/shared/onboarding/onboarding-step-card.tsx +1 -1
- package/src/components/shared/product-release/product-release-card-skeleton.tsx +8 -44
- package/src/components/shared/product-release/product-release-card.tsx +31 -116
- package/src/components/shared/product-release/release-detail-page.tsx +12 -16
- package/src/components/ui/actions-menu.tsx +1 -1
- package/src/components/ui/button/button.tsx +41 -11
- package/src/components/ui/button/split-button.tsx +1 -1
- package/src/components/ui/dashboard-info-card.tsx +2 -3
- package/src/components/ui/data-table/data-table-row.tsx +1 -1
- package/src/components/ui/entity-image.tsx +2 -8
- package/src/components/ui/hover-dropdown.tsx +258 -0
- package/src/components/ui/image-gallery-modal.tsx +1 -1
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/markdown-editor.tsx +1 -1
- package/src/components/ui/more-actions-menu.tsx +1 -1
- package/src/components/ui/organization-card.tsx +1 -1
- package/src/components/ui/simple-markdown-renderer.tsx +53 -5
- package/src/components/ui/square-avatar.tsx +3 -12
- package/src/components/ui/tab-navigation.tsx +1 -1
- package/src/components/ui/table/table-row.tsx +1 -1
- package/src/components/unified-filter-logic.tsx +1 -1
- package/src/components/unified-pagination.tsx +1 -1
- package/src/components/user-summary-stub.tsx +1 -1
- package/src/components/vendor-display-button.tsx +1 -1
- package/src/components/vendor-icon.tsx +1 -1
- package/src/contexts/chat-runtime-context.tsx +163 -0
- package/src/contexts/endpoints-runtime-context.tsx +68 -0
- package/src/contexts/index.ts +38 -0
- package/src/contexts/use-outer-or-default.ts +42 -0
- package/src/embed-shims/index.ts +42 -0
- package/src/embed-shims/next-dynamic.tsx +70 -0
- package/src/embed-shims/next-image.tsx +114 -0
- package/src/embed-shims/next-link.tsx +91 -0
- package/src/embed-shims/next-navigation.tsx +201 -0
- package/src/hooks/index.ts +9 -0
- package/src/hooks/state/use-api-params.ts +1 -1
- package/src/hooks/state/use-query-params.ts +1 -1
- package/src/hooks/use-access-code-integration.ts +107 -0
- package/src/hooks/use-contact-submission.ts +7 -3
- package/src/hooks/use-og-placeholder.ts +45 -0
- package/src/stories/OnboardingStepCard.stories.tsx +140 -0
- package/src/styles/chat-animations.css +65 -0
- package/src/styles/index.css +1 -0
- package/src/utils/access-code-client.ts +32 -75
- package/src/utils/cn.ts +0 -65
- package/src/utils/color-analysis.ts +205 -0
- package/src/utils/date-formatters.ts +54 -11
- package/src/utils/fetch-priority.ts +41 -0
- package/src/utils/format.ts +525 -1
- package/src/utils/image-proxy.ts +127 -7
- package/src/utils/index.ts +145 -5
- package/src/utils/local-storage-adapter.ts +105 -0
- package/src/utils/source-icons.ts +219 -0
- package/dist/chunk-25LVV26X.cjs.map +0 -1
- package/dist/chunk-ARQ4XP64.cjs.map +0 -1
- package/dist/chunk-CPXLQ57U.js.map +0 -1
- package/dist/chunk-LY34ORX6.js.map +0 -1
- package/dist/chunk-RMB5DVED.cjs.map +0 -1
- package/dist/chunk-SZPJ5R5B.js.map +0 -1
- package/dist/chunk-UC43NICZ.cjs.map +0 -1
- package/dist/chunk-XGL5FKIK.js.map +0 -1
- package/dist/components/chat/block-card.d.ts.map +0 -1
- package/dist/components/chat/chat-ticket-item.d.ts.map +0 -1
- package/dist/components/chat/chat-video-entity-card.d.ts.map +0 -1
- package/dist/utils/dynamic-icons.d.ts +0 -26
- package/dist/utils/dynamic-icons.d.ts.map +0 -1
- package/dist/utils/format-relative-time.d.ts +0 -21
- package/dist/utils/format-relative-time.d.ts.map +0 -1
- package/src/utils/.dynamic-icons.md +0 -30
- package/src/utils/.format-relative-time.md +0 -36
- package/src/utils/dynamic-icons.tsx +0 -120
- package/src/utils/format-relative-time.ts +0 -52
- /package/dist/{chunk-N57KWHDB.js.map → chunk-CIPO6DXK.js.map} +0 -0
- /package/dist/components/chat/{block-card.d.ts → entity-cards/block-card.d.ts} +0 -0
- /package/dist/components/chat/{chat-ticket-item.d.ts → entity-cards/chat-ticket-item.d.ts} +0 -0
- /package/src/components/chat/{block-card.tsx → entity-cards/block-card.tsx} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useRequiredChatRuntime } from '../../../contexts/chat-runtime-context'
|
|
4
|
+
import { getProxiedImageUrl } from '../../../utils/image-proxy'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Hook-version of `getProxiedImageUrl` that reads `proxyPrefix` and
|
|
8
|
+
* `skipDomains` from the ambient `ChatRuntime`. Use anywhere inside
|
|
9
|
+
* a `<ChatRuntimeContext.Provider>`.
|
|
10
|
+
*
|
|
11
|
+
* Returns the input URL (or `''` for null/undefined) when no
|
|
12
|
+
* `imageProxyUrlPrefix` is configured. Always passes `directHttps: true`
|
|
13
|
+
* — callers that need proxied https (e.g. raster-only) must use the pure
|
|
14
|
+
* `getProxiedImageUrl` from `@flamingo-stack/openframe-frontend-core/utils`
|
|
15
|
+
* directly.
|
|
16
|
+
*
|
|
17
|
+
* Rules of hooks: call at the TOP of a component, NOT inside loops/maps.
|
|
18
|
+
* For `.map(item => proxy(item.url))` patterns, use the pure
|
|
19
|
+
* `getProxiedImageUrl` and hardcode the proxy config — the rare
|
|
20
|
+
* non-React-tree caller pattern.
|
|
21
|
+
*/
|
|
22
|
+
export function useProxiedImageUrl(url: string | null | undefined): string {
|
|
23
|
+
const r = useRequiredChatRuntime()
|
|
24
|
+
return (
|
|
25
|
+
getProxiedImageUrl(url ?? '', {
|
|
26
|
+
proxyPrefix: r.endpoints.imageProxyUrlPrefix,
|
|
27
|
+
skipDomains: r.endpoints.imageProxySkipDomains,
|
|
28
|
+
directHttps: true,
|
|
29
|
+
}) ?? ''
|
|
30
|
+
)
|
|
31
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Client-side hook + helper for the slash-command autocomplete.
|
|
5
|
+
*
|
|
6
|
+
* `fetchSlashCommands` is a stateless wrapper around the host's
|
|
7
|
+
* commands endpoint. The caller threads the URL — the lib never
|
|
8
|
+
* depends on hub-internal route paths.
|
|
9
|
+
*
|
|
10
|
+
* `useSlashCommands` is the React-state version (debounced, cancellable).
|
|
11
|
+
*
|
|
12
|
+
* Types live in `../types/component.types` so the autocomplete
|
|
13
|
+
* dropdown and the chat-side runtime share one source of truth.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { useEffect, useState } from "react";
|
|
17
|
+
import type {
|
|
18
|
+
SlashCommandActionId,
|
|
19
|
+
SlashCommandSummaryAction,
|
|
20
|
+
SlashCommandSummary,
|
|
21
|
+
} from "../types/component.types";
|
|
22
|
+
|
|
23
|
+
// Re-export so callers can `import { SlashCommandSummary } from
|
|
24
|
+
// '@flamingo-stack/openframe-frontend-core/components/chat/hooks'`
|
|
25
|
+
// without reaching into types. The component.types module is the
|
|
26
|
+
// canonical declaration.
|
|
27
|
+
export type {
|
|
28
|
+
SlashCommandActionId,
|
|
29
|
+
SlashCommandSummaryAction,
|
|
30
|
+
SlashCommandSummary,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Fetch slash-command suggestions for the CURRENT deployment platform,
|
|
35
|
+
* matching id-prefix `prefix`. The chat source is server-resolved — the
|
|
36
|
+
* client sends NO `source` param on the URL.
|
|
37
|
+
*
|
|
38
|
+
* `commandsUrl` is required — supplied by `useChatRuntime().endpoints.commandsUrl`
|
|
39
|
+
* at the call site. NO default value.
|
|
40
|
+
*
|
|
41
|
+
* URL handling: `new URL(commandsUrl, window.location.origin)` works
|
|
42
|
+
* for both relative (e.g. `/api/mingo-guide/commands` → resolved against
|
|
43
|
+
* the embedder origin, proxy handles it) and absolute
|
|
44
|
+
* (e.g. `https://hub.openframe.ai/api/commands` → the base arg is
|
|
45
|
+
* ignored).
|
|
46
|
+
*
|
|
47
|
+
* Returns the parsed `commands` array; on any non-2xx (auth,
|
|
48
|
+
* rate-limit, chat-disabled) returns an empty array — the autocomplete
|
|
49
|
+
* UI silently shows no suggestions rather than surfacing 401/403/429
|
|
50
|
+
* toasts.
|
|
51
|
+
*/
|
|
52
|
+
export async function fetchSlashCommands(
|
|
53
|
+
prefix: string,
|
|
54
|
+
signal: AbortSignal | undefined,
|
|
55
|
+
commandsUrl: string,
|
|
56
|
+
): Promise<SlashCommandSummary[]> {
|
|
57
|
+
const url = new URL(commandsUrl, window.location.origin);
|
|
58
|
+
if (prefix) url.searchParams.set("q", prefix);
|
|
59
|
+
const res = await fetch(url.toString(), { signal });
|
|
60
|
+
if (!res.ok) return [];
|
|
61
|
+
const data = (await res.json()) as { commands?: SlashCommandSummary[] };
|
|
62
|
+
return data.commands ?? [];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Debounced, cancellable React hook. Returns `{ commands, loading }`.
|
|
67
|
+
*
|
|
68
|
+
* `commandsUrl` is required — pass `useChatRuntime().endpoints.commandsUrl`.
|
|
69
|
+
*/
|
|
70
|
+
export function useSlashCommands(
|
|
71
|
+
prefix: string | null,
|
|
72
|
+
commandsUrl: string,
|
|
73
|
+
): { commands: SlashCommandSummary[]; loading: boolean } {
|
|
74
|
+
const [commands, setCommands] = useState<SlashCommandSummary[]>([]);
|
|
75
|
+
const [loading, setLoading] = useState(false);
|
|
76
|
+
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
if (prefix == null) {
|
|
79
|
+
setCommands([]);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
let cancelled = false;
|
|
83
|
+
const ctrl = new AbortController();
|
|
84
|
+
setLoading(true);
|
|
85
|
+
const handle = setTimeout(async () => {
|
|
86
|
+
try {
|
|
87
|
+
const next = await fetchSlashCommands(prefix, ctrl.signal, commandsUrl);
|
|
88
|
+
if (!cancelled) setCommands(next);
|
|
89
|
+
} catch (err) {
|
|
90
|
+
// AbortError on dep-change / unmount is expected; log others.
|
|
91
|
+
if (!cancelled && (err as Error)?.name !== "AbortError") {
|
|
92
|
+
console.warn("[use-slash-commands] fetch failed:", err);
|
|
93
|
+
}
|
|
94
|
+
} finally {
|
|
95
|
+
if (!cancelled) setLoading(false);
|
|
96
|
+
}
|
|
97
|
+
}, 150);
|
|
98
|
+
return () => {
|
|
99
|
+
cancelled = true;
|
|
100
|
+
ctrl.abort();
|
|
101
|
+
clearTimeout(handle);
|
|
102
|
+
};
|
|
103
|
+
}, [prefix, commandsUrl]);
|
|
104
|
+
|
|
105
|
+
return { commands, loading };
|
|
106
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useState, useCallback, useRef } from 'react'
|
|
4
|
+
import type { MessageSegment } from '../types/message.types'
|
|
5
|
+
import type { WireCommandOverride } from '../utils/slash-dispatch-utils'
|
|
6
|
+
import type { ChatAttachment } from '../utils/chat-attachment-markdown'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Stream function signature. The optional `signal` is created fresh per
|
|
10
|
+
* `streamMessage` call so the underlying fetch can be aborted cleanly when
|
|
11
|
+
* the user clicks Stop. Without the signal, abort would only stop yielding
|
|
12
|
+
* chunks at the iterator boundary while the upstream Anthropic request
|
|
13
|
+
* continued running (and billing).
|
|
14
|
+
*
|
|
15
|
+
* `extraOptions` carries per-call extras (currently `commandOverride` for
|
|
16
|
+
* the inline-card "Discuss" affordance per v6.1 §B.2.8). Kept generic so
|
|
17
|
+
* future per-call wire fields don't bloat the signature.
|
|
18
|
+
*/
|
|
19
|
+
export interface StreamFnExtraOptions {
|
|
20
|
+
commandOverride?: WireCommandOverride
|
|
21
|
+
/** Out-of-band signal for the post-approval / post-reject
|
|
22
|
+
* server-driven turn. When set, the streamFn routes to
|
|
23
|
+
* `/api/chat/agent/confirm-tool` instead of `/api/docs/chat` and
|
|
24
|
+
* encodes the action on the request body. The server emits a
|
|
25
|
+
* `decision_resolved` leading frame that the chat-shell uses to
|
|
26
|
+
* flip the SOURCE approval card (different assistant message than
|
|
27
|
+
* the one being streamed into), then — on approve + write tool —
|
|
28
|
+
* pipes the auto-continuation Sonnet response as standard chat SSE
|
|
29
|
+
* frames into a NEW assistant turn. The CLIENT does not orchestrate
|
|
30
|
+
* the auto-continuation; it just renders frames. */
|
|
31
|
+
approvalAction?: {
|
|
32
|
+
proposalId: string
|
|
33
|
+
action: 'approve' | 'reject'
|
|
34
|
+
}
|
|
35
|
+
/** Chat-attachment payload riding alongside the user's text — the
|
|
36
|
+
* staged attachments produced by `useChatAttachments`. Server-side,
|
|
37
|
+
* `runDocsChat` strips the embedded `/api/storage/view/chat-attachments/...`
|
|
38
|
+
* markdown lines from the user's text and replaces them with
|
|
39
|
+
* Anthropic image content blocks (raw signed URLs).
|
|
40
|
+
*
|
|
41
|
+
* Wire format: `storagePath` + `viewToken` only — NEVER a `url`
|
|
42
|
+
* field. Server validates against `ChatAttachmentSchema` and rejects
|
|
43
|
+
* malformed shapes. */
|
|
44
|
+
pendingAttachments?: ChatAttachment[]
|
|
45
|
+
}
|
|
46
|
+
export type StreamFn = (
|
|
47
|
+
message: string,
|
|
48
|
+
signal?: AbortSignal,
|
|
49
|
+
extra?: StreamFnExtraOptions,
|
|
50
|
+
) => AsyncGenerator<MessageSegment>
|
|
51
|
+
|
|
52
|
+
interface UseSSEOptions {
|
|
53
|
+
useMock?: boolean
|
|
54
|
+
debugMode?: boolean
|
|
55
|
+
/** Custom stream function — when provided, bypasses the mock fallback */
|
|
56
|
+
streamFn?: StreamFn
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function useSSE({ useMock = true, debugMode = false, streamFn }: UseSSEOptions = {}) {
|
|
60
|
+
const [isStreaming, setIsStreaming] = useState(false)
|
|
61
|
+
const [error, setError] = useState<string | null>(null)
|
|
62
|
+
const abortControllerRef = useRef<AbortController | null>(null)
|
|
63
|
+
|
|
64
|
+
// Lib-side mock fallback — useDocChat ALWAYS sets `useMock: false`,
|
|
65
|
+
// so this path is unreachable in production usage. Kept as a clear
|
|
66
|
+
// error so any future caller that flips `useMock: true` without
|
|
67
|
+
// providing a `streamFn` gets a loud signal instead of a silent
|
|
68
|
+
// misroute. Hub-side wrappers that need the mock can supply their
|
|
69
|
+
// own streamFn from a MockChatService.
|
|
70
|
+
const fallbackStream = useCallback(async function* (): AsyncGenerator<MessageSegment> {
|
|
71
|
+
throw new Error(
|
|
72
|
+
'[useSSE] No streamFn provided and `useMock: true` is no longer wired into the lib. ' +
|
|
73
|
+
'Supply a `streamFn` (see `createDocStreamFn` in use-embedded-chat) or migrate the ' +
|
|
74
|
+
'mock to your host code.',
|
|
75
|
+
)
|
|
76
|
+
}, [])
|
|
77
|
+
|
|
78
|
+
const streamMessage = useCallback(
|
|
79
|
+
async function* (
|
|
80
|
+
message: string,
|
|
81
|
+
extra?: StreamFnExtraOptions,
|
|
82
|
+
): AsyncGenerator<MessageSegment> {
|
|
83
|
+
setIsStreaming(true)
|
|
84
|
+
setError(null)
|
|
85
|
+
|
|
86
|
+
// Create a fresh AbortController for this stream. abort() targets it via
|
|
87
|
+
// the ref; the signal is passed THROUGH to streamFn so the underlying
|
|
88
|
+
// fetch (and Anthropic upstream) terminates on Stop.
|
|
89
|
+
const ctrl = new AbortController()
|
|
90
|
+
abortControllerRef.current = ctrl
|
|
91
|
+
|
|
92
|
+
try {
|
|
93
|
+
const generator = streamFn
|
|
94
|
+
? streamFn(message, ctrl.signal, extra)
|
|
95
|
+
: fallbackStream()
|
|
96
|
+
|
|
97
|
+
for await (const chunk of generator) {
|
|
98
|
+
// Check if aborted
|
|
99
|
+
if (ctrl.signal.aborted) {
|
|
100
|
+
break
|
|
101
|
+
}
|
|
102
|
+
yield chunk
|
|
103
|
+
}
|
|
104
|
+
} catch (err) {
|
|
105
|
+
// AbortError on user-initiated stop is expected — surface as a no-error
|
|
106
|
+
// path so the consumer's catch doesn't render a red error message.
|
|
107
|
+
if ((err as any)?.name === 'AbortError' || ctrl.signal.aborted) {
|
|
108
|
+
return
|
|
109
|
+
}
|
|
110
|
+
const errorMessage = err instanceof Error ? err.message : 'An error occurred'
|
|
111
|
+
setError(errorMessage)
|
|
112
|
+
throw err
|
|
113
|
+
} finally {
|
|
114
|
+
setIsStreaming(false)
|
|
115
|
+
// Only clear the ref if it still points at this controller (defensive
|
|
116
|
+
// — a rapid send-stop-send sequence might have already replaced it).
|
|
117
|
+
if (abortControllerRef.current === ctrl) {
|
|
118
|
+
abortControllerRef.current = null
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
[streamFn, fallbackStream],
|
|
123
|
+
)
|
|
124
|
+
|
|
125
|
+
const abort = useCallback(() => {
|
|
126
|
+
if (abortControllerRef.current) {
|
|
127
|
+
abortControllerRef.current.abort()
|
|
128
|
+
}
|
|
129
|
+
setIsStreaming(false)
|
|
130
|
+
}, [])
|
|
131
|
+
|
|
132
|
+
const reset = useCallback(() => {
|
|
133
|
+
// Reset state if needed
|
|
134
|
+
}, [])
|
|
135
|
+
|
|
136
|
+
return {
|
|
137
|
+
streamMessage,
|
|
138
|
+
isStreaming,
|
|
139
|
+
error,
|
|
140
|
+
abort,
|
|
141
|
+
reset,
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -12,10 +12,8 @@ export * from './chat-input'
|
|
|
12
12
|
export * from './slash-command-suggestions'
|
|
13
13
|
export * from './chat-message-enhanced'
|
|
14
14
|
export * from './chat-message-list'
|
|
15
|
-
|
|
16
|
-
export * from './block-card'
|
|
15
|
+
|
|
17
16
|
export * from './chat-quick-action'
|
|
18
|
-
export * from './chat-ticket-item'
|
|
19
17
|
export * from './chat-ticket-list'
|
|
20
18
|
export * from './chat-typing-indicator'
|
|
21
19
|
export * from './tool-execution-display'
|
|
@@ -25,6 +23,29 @@ export * from './chat-sidebar'
|
|
|
25
23
|
export type { ChatRef } from './chat-ref.types'
|
|
26
24
|
export { remarkCardLinks } from './remark-card-links'
|
|
27
25
|
|
|
26
|
+
// Card-supporting UI migrated from hub `components/shared/*` + `components/blog/*`
|
|
27
|
+
export {
|
|
28
|
+
NavLinkAnchorViaRuntime,
|
|
29
|
+
type NavLinkAnchorViaRuntimeProps,
|
|
30
|
+
} from './nav-link-anchor-via-runtime'
|
|
31
|
+
export {
|
|
32
|
+
SourceActionButton,
|
|
33
|
+
type SourceActionButtonProps,
|
|
34
|
+
type SourceActionDensity,
|
|
35
|
+
} from './source-action-button'
|
|
36
|
+
export {
|
|
37
|
+
ChatAttachmentAddButton,
|
|
38
|
+
ChatAttachmentChipStrip,
|
|
39
|
+
type ChatAttachmentAddButtonProps,
|
|
40
|
+
type ChatAttachmentChipStripProps,
|
|
41
|
+
type StagedAttachment,
|
|
42
|
+
CHAT_ATTACHMENT_MIME_TYPES,
|
|
43
|
+
CHAT_ATTACHMENT_CONCURRENT_UPLOADS_PER_USER,
|
|
44
|
+
} from './chat-attachment-bar'
|
|
45
|
+
|
|
46
|
+
// Entity-cards (12 refactored + 4 moved + supporting primitives)
|
|
47
|
+
export * from './entity-cards'
|
|
48
|
+
|
|
28
49
|
// Chat types and constants
|
|
29
50
|
export * from './types'
|
|
30
51
|
|
|
@@ -32,4 +53,9 @@ export * from './types'
|
|
|
32
53
|
export * from './hooks'
|
|
33
54
|
|
|
34
55
|
// Chat utilities
|
|
35
|
-
export * from './utils'
|
|
56
|
+
export * from './utils'
|
|
57
|
+
|
|
58
|
+
// EmbeddableChat — full chat orchestrator (lib-portable port of hub's
|
|
59
|
+
// `<GlobalAskAI>`). Hosts mount it once at the root after providing a
|
|
60
|
+
// <ChatRuntimeContext.Provider>.
|
|
61
|
+
export { EmbeddableChat, type EmbeddableChatProps } from './embeddable-chat'
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Lib-side `<a>` wrapper for chat-rendered links (markdown bodies,
|
|
5
|
+
* source-chip drill-ins, inline references).
|
|
6
|
+
*
|
|
7
|
+
* Reads the active `ChatRuntime` and routes clicks through
|
|
8
|
+
* `handleChatNavClick`. Same single-source rules as source chips and
|
|
9
|
+
* inline cards:
|
|
10
|
+
* - new-tab decision via `computeIsNewTab` (embed-mode short-circuit
|
|
11
|
+
* + `runtime.navigation.decideNewTab` + lib fallback)
|
|
12
|
+
* - `target` / `rel` via `newTabAnchorAttrs`
|
|
13
|
+
* - same-tab click → close the chat panel (via `ChatPanelContext`);
|
|
14
|
+
* new-tab click → leave panel open while the new tab loads
|
|
15
|
+
*
|
|
16
|
+
* Chat-only contract: uses `useRequiredChatRuntime`, which THROWS when
|
|
17
|
+
* mounted outside a `<ChatRuntimeContext.Provider>`. That's by design —
|
|
18
|
+
* the lib should never silently fall back when the runtime is missing
|
|
19
|
+
* (the chat tree always provides one in both host + embed modes).
|
|
20
|
+
*
|
|
21
|
+
* For surfaces OUTSIDE the chat tree (header chrome, marketing pages, …)
|
|
22
|
+
* the hub keeps its own `useNavLink`-based anchor.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import type { ReactNode, MouseEvent } from 'react'
|
|
26
|
+
import { useRequiredChatRuntime } from '../../contexts/chat-runtime-context'
|
|
27
|
+
import { handleChatNavClick } from './utils/nav-click-handler'
|
|
28
|
+
import { resolveHrefForRuntime } from './utils/chat-nav-resolution'
|
|
29
|
+
import { computeIsNewTab, newTabAnchorAttrs } from './utils/nav-anchor-props'
|
|
30
|
+
import { useChatPanel } from './chat-panel-context'
|
|
31
|
+
|
|
32
|
+
export interface NavLinkAnchorViaRuntimeProps {
|
|
33
|
+
href: string
|
|
34
|
+
path?: string | null
|
|
35
|
+
targetPlatform?: string | null
|
|
36
|
+
className?: string
|
|
37
|
+
/** Optional — matches `NavLinkAnchorComponent`'s contract so the
|
|
38
|
+
* markdown-anchor slot can render an empty anchor (rare but legal). */
|
|
39
|
+
children?: ReactNode
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function NavLinkAnchorViaRuntime({
|
|
43
|
+
href,
|
|
44
|
+
path,
|
|
45
|
+
targetPlatform,
|
|
46
|
+
className,
|
|
47
|
+
children,
|
|
48
|
+
}: NavLinkAnchorViaRuntimeProps) {
|
|
49
|
+
const runtime = useRequiredChatRuntime()
|
|
50
|
+
const panel = useChatPanel()
|
|
51
|
+
const resolvedHref = resolveHrefForRuntime(href, runtime)
|
|
52
|
+
const isNewTab = computeIsNewTab(runtime, resolvedHref, targetPlatform ?? null)
|
|
53
|
+
|
|
54
|
+
const onClick = (e: MouseEvent<HTMLAnchorElement>) => {
|
|
55
|
+
const handled = handleChatNavClick(e, runtime, {
|
|
56
|
+
href: resolvedHref,
|
|
57
|
+
path,
|
|
58
|
+
targetPlatform,
|
|
59
|
+
})
|
|
60
|
+
if (handled && !isNewTab && panel?.closeChat) panel.closeChat()
|
|
61
|
+
}
|
|
62
|
+
return (
|
|
63
|
+
<a
|
|
64
|
+
href={resolvedHref}
|
|
65
|
+
{...newTabAnchorAttrs(isNewTab)}
|
|
66
|
+
onClick={onClick}
|
|
67
|
+
className={className}
|
|
68
|
+
>
|
|
69
|
+
{children}
|
|
70
|
+
</a>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* One-component-fits-all "Ask" affordance shared across the three
|
|
5
|
+
* chat-adjacent surfaces (source chips, inline cards, search results).
|
|
6
|
+
*
|
|
7
|
+
* Before this primitive, the same semantic action was implemented three
|
|
8
|
+
* different ways:
|
|
9
|
+
* - Source chip: inline `<button>` next to the chip
|
|
10
|
+
* - Source chip dropdown row: secondaryAction icon-button
|
|
11
|
+
* - Inline card: UI-Kit `<Button variant="transparent">Ask</Button>`
|
|
12
|
+
* - Search results: nothing (asymmetric — no Ask)
|
|
13
|
+
*
|
|
14
|
+
* Three icon sizes, three different opacity rules, three different DOM
|
|
15
|
+
* shapes for the same action. Centralized here as a single `Button`-
|
|
16
|
+
* backed wrapper so the DOM + a11y + hover behavior live in one place.
|
|
17
|
+
* The `density` prop picks the visual variant; the icon/label/click
|
|
18
|
+
* semantics are identical across all three.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import React from 'react'
|
|
22
|
+
import { MessageSquare, FileText } from 'lucide-react'
|
|
23
|
+
import { Button } from '../ui/button'
|
|
24
|
+
import type { ChatRef } from './chat-ref.types'
|
|
25
|
+
|
|
26
|
+
export type SourceActionDensity = 'inline' | 'card' | 'list-row'
|
|
27
|
+
|
|
28
|
+
export interface SourceActionButtonProps {
|
|
29
|
+
/** The row to drill into when clicked. The button is HIDDEN when this
|
|
30
|
+
* is null (e.g. row has no primary key — Ask can't fire). */
|
|
31
|
+
chatRef: ChatRef | null
|
|
32
|
+
/** Click handler. Receives the chatRef. When undefined the button is
|
|
33
|
+
* hidden — same as null chatRef. */
|
|
34
|
+
onDiscuss?: (ref: ChatRef) => void
|
|
35
|
+
/** Visual density / layout. Defaults to `'inline'`. */
|
|
36
|
+
density?: SourceActionDensity
|
|
37
|
+
/** Optional className appended to the outer element. */
|
|
38
|
+
className?: string
|
|
39
|
+
/** Button text label override. Defaults to `'Ask'`. The Display variant
|
|
40
|
+
* on inline cards passes `'Display'` here. Density `'inline'` shows
|
|
41
|
+
* the icon only — the label is used for aria-label / title even when
|
|
42
|
+
* it doesn't render visibly. */
|
|
43
|
+
label?: string
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Per-density styling lives in one map so the three call sites share the
|
|
47
|
+
// SAME hover/opacity/transition rules. Adding a fourth density means
|
|
48
|
+
// adding one entry here, not touching the render path.
|
|
49
|
+
const DENSITY_STYLES: Record<
|
|
50
|
+
SourceActionDensity,
|
|
51
|
+
{
|
|
52
|
+
size: 'small' | 'icon'
|
|
53
|
+
showLabel: boolean
|
|
54
|
+
iconSize: string
|
|
55
|
+
className: string
|
|
56
|
+
}
|
|
57
|
+
> = {
|
|
58
|
+
inline: {
|
|
59
|
+
size: 'icon',
|
|
60
|
+
showLabel: false,
|
|
61
|
+
iconSize: '!h-3 !w-3',
|
|
62
|
+
className:
|
|
63
|
+
'!h-5 !w-5 !p-0 text-ods-text-secondary opacity-60 hover:opacity-100 hover:text-ods-text-primary hover:bg-ods-accent/15',
|
|
64
|
+
},
|
|
65
|
+
card: {
|
|
66
|
+
size: 'small',
|
|
67
|
+
showLabel: true,
|
|
68
|
+
iconSize: '!h-3 !w-3',
|
|
69
|
+
className:
|
|
70
|
+
'!h-auto !p-0 text-xs font-normal text-ods-text-secondary opacity-60 hover:bg-transparent hover:opacity-100 hover:text-ods-text-primary',
|
|
71
|
+
},
|
|
72
|
+
'list-row': {
|
|
73
|
+
size: 'small',
|
|
74
|
+
showLabel: true,
|
|
75
|
+
iconSize: '!h-3 !w-3',
|
|
76
|
+
className:
|
|
77
|
+
'!h-auto !px-1.5 !py-0.5 text-[11px] font-normal text-ods-text-secondary opacity-60 hover:opacity-100 hover:text-ods-text-primary hover:bg-ods-accent/10',
|
|
78
|
+
},
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function SourceActionButton({
|
|
82
|
+
chatRef,
|
|
83
|
+
onDiscuss,
|
|
84
|
+
density = 'inline',
|
|
85
|
+
className,
|
|
86
|
+
label = 'Ask',
|
|
87
|
+
}: SourceActionButtonProps): React.ReactElement | null {
|
|
88
|
+
if (!chatRef || !onDiscuss) return null
|
|
89
|
+
|
|
90
|
+
// Label-driven icon. "Display" reads as a verbatim-content action so a
|
|
91
|
+
// FileText icon reinforces "show me the body" semantics; the default
|
|
92
|
+
// "Ask" stays MessageSquare for the conversational connotation. Any
|
|
93
|
+
// future label adds an entry to this map.
|
|
94
|
+
const isDisplay = label === 'Display'
|
|
95
|
+
const verbLabel = isDisplay
|
|
96
|
+
? `Display ${chatRef.title || 'this item'}`
|
|
97
|
+
: `Ask about ${chatRef.title || 'this item'}`
|
|
98
|
+
const handle = (e: React.MouseEvent) => {
|
|
99
|
+
e.preventDefault()
|
|
100
|
+
e.stopPropagation()
|
|
101
|
+
onDiscuss(chatRef)
|
|
102
|
+
}
|
|
103
|
+
const styles = DENSITY_STYLES[density]
|
|
104
|
+
const IconComponent = isDisplay ? FileText : MessageSquare
|
|
105
|
+
const icon = <IconComponent className={styles.iconSize} />
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<Button
|
|
109
|
+
variant="transparent"
|
|
110
|
+
size={styles.size}
|
|
111
|
+
leftIcon={styles.showLabel ? icon : undefined}
|
|
112
|
+
onClick={handle}
|
|
113
|
+
aria-label={verbLabel}
|
|
114
|
+
title={verbLabel}
|
|
115
|
+
className={`${styles.className}${className ? ` ${className}` : ''}`}
|
|
116
|
+
>
|
|
117
|
+
{styles.showLabel ? label : icon}
|
|
118
|
+
</Button>
|
|
119
|
+
)
|
|
120
|
+
}
|
|
@@ -89,3 +89,64 @@ export interface MessageOwner {
|
|
|
89
89
|
lastName?: string
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
+
|
|
93
|
+
// ========== ChatRef-key construction ==========
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Canonical key shape for the `chatRefs` map carried on every Message —
|
|
97
|
+
* `${docType}:${externalId}`. The chat-message renderer looks up inline
|
|
98
|
+
* `[card://<type>:<id>]` markers via this same key shape, so keeping the
|
|
99
|
+
* construction in one place avoids divergence between the writer
|
|
100
|
+
* (server-driven attach in decision_resolved handler) and the readers
|
|
101
|
+
* (renderingPlan in chat-message-enhanced).
|
|
102
|
+
*
|
|
103
|
+
* Pure function — no runtime cost vs. inline template literal — but the
|
|
104
|
+
* call-site reads as "the chat-ref key for this ref" rather than as a
|
|
105
|
+
* generic string-concat, which is what the eye is hunting for when
|
|
106
|
+
* scanning the file for ref-keyed logic.
|
|
107
|
+
*/
|
|
108
|
+
export function buildChatRefKey(docType: string, externalId: string): string {
|
|
109
|
+
return `${docType}:${externalId}`
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// ========== Content-shape helpers ==========
|
|
113
|
+
|
|
114
|
+
import type { MessageContent, MessageSegment } from './message.types'
|
|
115
|
+
|
|
116
|
+
/** Helper function to check if content is structured (segment array). */
|
|
117
|
+
export function isStructuredContent(content: MessageContent): content is MessageSegment[] {
|
|
118
|
+
return Array.isArray(content)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Normalize either a string or segment array into a uniform segment array. */
|
|
122
|
+
export function normalizeContent(content: MessageContent): MessageSegment[] {
|
|
123
|
+
if (typeof content === 'string') {
|
|
124
|
+
return content ? [{ type: 'text', text: content }] : []
|
|
125
|
+
}
|
|
126
|
+
return content
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// ========== SSE event data shapes (wire shapes) ==========
|
|
130
|
+
|
|
131
|
+
export interface TextEventData {
|
|
132
|
+
type: 'TEXT'
|
|
133
|
+
text: string
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface ToolExecutionEventData {
|
|
137
|
+
type: 'EXECUTING_TOOL' | 'EXECUTED_TOOL'
|
|
138
|
+
integratedToolType: string
|
|
139
|
+
toolFunction: string
|
|
140
|
+
parameters?: Record<string, any>
|
|
141
|
+
result?: string
|
|
142
|
+
success?: boolean
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export type SSEEventData = TextEventData | ToolExecutionEventData
|
|
146
|
+
|
|
147
|
+
// ========== Quick-action chip shape ==========
|
|
148
|
+
|
|
149
|
+
export interface QuickAction {
|
|
150
|
+
id: string
|
|
151
|
+
text: string
|
|
152
|
+
}
|