@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
|
@@ -33,3 +33,136 @@ export {
|
|
|
33
33
|
|
|
34
34
|
// Tool call helpers
|
|
35
35
|
export { getCommandText } from './tool-call-helpers'
|
|
36
|
+
|
|
37
|
+
// Chat-side click + navigation helpers
|
|
38
|
+
export { CHIP_ACTION_BUTTON_CLASS } from './chip-action-class'
|
|
39
|
+
export { chatChipClass, type ChipClassOptions } from './chip-styles'
|
|
40
|
+
export {
|
|
41
|
+
NEW_TAB_FEATURES,
|
|
42
|
+
isModifierClick,
|
|
43
|
+
stripSameOriginToPath,
|
|
44
|
+
resolveExternalNavigation,
|
|
45
|
+
type ExternalNavResolution,
|
|
46
|
+
} from './chat-nav-resolution'
|
|
47
|
+
export {
|
|
48
|
+
handleChatNavClick,
|
|
49
|
+
type ChatNavClickInput,
|
|
50
|
+
} from './nav-click-handler'
|
|
51
|
+
export {
|
|
52
|
+
computeIsNewTab,
|
|
53
|
+
newTabAnchorAttrs,
|
|
54
|
+
buildAnchorProps,
|
|
55
|
+
} from './nav-anchor-props'
|
|
56
|
+
export { isCrossOriginUrl } from './is-cross-origin-url'
|
|
57
|
+
export {
|
|
58
|
+
decideNewTab,
|
|
59
|
+
type DecideNewTabInput,
|
|
60
|
+
type NavSurface,
|
|
61
|
+
type RuntimeMode,
|
|
62
|
+
} from './decide-new-tab'
|
|
63
|
+
|
|
64
|
+
// Chat-proxy auth (localStorage adapter + fetch wrapper)
|
|
65
|
+
export {
|
|
66
|
+
getChatProxyAuth,
|
|
67
|
+
getPersistedProxyEmail,
|
|
68
|
+
setChatProxyAuth,
|
|
69
|
+
clearChatProxyAuth,
|
|
70
|
+
applyProxyAuth,
|
|
71
|
+
type ChatProxyAuth,
|
|
72
|
+
} from './chat-proxy-auth-storage'
|
|
73
|
+
export { chatAuthedFetch } from './chat-authed-fetch'
|
|
74
|
+
|
|
75
|
+
// Pure content helpers
|
|
76
|
+
export { flattenAssistantContent } from './flatten-assistant-content'
|
|
77
|
+
export {
|
|
78
|
+
SCROLL_ANCHOR,
|
|
79
|
+
type ScrollAnchor,
|
|
80
|
+
SCROLL_ANCHOR_WIRE_KEY,
|
|
81
|
+
parseScrollAnchor,
|
|
82
|
+
} from './scroll-anchor'
|
|
83
|
+
export {
|
|
84
|
+
AUTO_CONTINUATION_DIRECTIVE_PREFIX,
|
|
85
|
+
buildAutoContinuationDirective,
|
|
86
|
+
type BuildAutoContinuationOptions,
|
|
87
|
+
} from './auto-continuation-directive'
|
|
88
|
+
|
|
89
|
+
// Slash-command + dispatch (lib-portable subset)
|
|
90
|
+
export {
|
|
91
|
+
type WireCommandOverride,
|
|
92
|
+
parseWireCommandOverride,
|
|
93
|
+
sanitizeTitleForChat,
|
|
94
|
+
formatSingularLookupInvocation,
|
|
95
|
+
type CommandOverride,
|
|
96
|
+
extractEntityIdFilter,
|
|
97
|
+
buildDiscussAddendum,
|
|
98
|
+
} from './slash-dispatch-utils'
|
|
99
|
+
|
|
100
|
+
// Chat-attachment markdown formatter + strip parser
|
|
101
|
+
export {
|
|
102
|
+
CHAT_ATTACHMENT_VIEW_URL_PREFIX,
|
|
103
|
+
CHAT_ATTACHMENT_VIEW_TOKEN_QUERY_PARAM,
|
|
104
|
+
ANTHROPIC_SUPPORTED_IMAGE_MIME,
|
|
105
|
+
type ChatAttachment,
|
|
106
|
+
buildChatAttachmentViewUrl,
|
|
107
|
+
escapeMarkdownInline,
|
|
108
|
+
formatChatAttachmentMarkdownForBubble,
|
|
109
|
+
CHAT_ATTACHMENT_VIEW_URL_PREFIX_REGEX_ESCAPED,
|
|
110
|
+
CHAT_ATTACHMENT_MARKDOWN_PATTERN,
|
|
111
|
+
stripChatAttachmentMarkdown,
|
|
112
|
+
} from './chat-attachment-markdown'
|
|
113
|
+
|
|
114
|
+
// External app deep-links (chat surfaces)
|
|
115
|
+
export { clickupTaskUrl } from './external-app-urls'
|
|
116
|
+
|
|
117
|
+
// Agent status → color scheme
|
|
118
|
+
export { type ColorScheme, getStatusColorScheme } from './agent-status-message'
|
|
119
|
+
|
|
120
|
+
// ClickUp task-type label + canonical custom_item_id map
|
|
121
|
+
export { getTaskTypeLabel, CUSTOM_ITEM_ID } from './clickup-task-type-utils'
|
|
122
|
+
|
|
123
|
+
// Compact-card class constants + safe-href guard
|
|
124
|
+
export {
|
|
125
|
+
COMPACT_CARD_OUTER,
|
|
126
|
+
COMPACT_CARD_OUTER_STATIC,
|
|
127
|
+
COMPACT_CARD_SKELETON_OUTER,
|
|
128
|
+
COMPACT_CARD_IMAGE_SLOT,
|
|
129
|
+
COMPACT_CARD_SKELETON_IMAGE_SLOT,
|
|
130
|
+
COMPACT_CARD_ICON_SLOT,
|
|
131
|
+
COMPACT_CARD_TEXT_COL,
|
|
132
|
+
COMPACT_CARD_TITLE_ROW,
|
|
133
|
+
COMPACT_CARD_META_ROW_BOX,
|
|
134
|
+
COMPACT_CARD_TITLE,
|
|
135
|
+
COMPACT_CARD_SUBTITLE,
|
|
136
|
+
COMPACT_CARD_SUMMARY,
|
|
137
|
+
COMPACT_CARD_META_ROW,
|
|
138
|
+
COMPACT_CARD_ROW_FILLER,
|
|
139
|
+
safeHref,
|
|
140
|
+
} from './compact-card-classes'
|
|
141
|
+
|
|
142
|
+
// Icon + source registries (chat surfaces). The icon-registry file is
|
|
143
|
+
// the SINGLE source of truth for all icon-name → React-component lookup
|
|
144
|
+
// across the lib + the hub — kebab-case keys, with PascalCase aliases
|
|
145
|
+
// routed through `normalizeIconKey()` for DB columns that store
|
|
146
|
+
// component-style names (e.g. social_platforms.icon_name).
|
|
147
|
+
export {
|
|
148
|
+
ICON_REGISTRY,
|
|
149
|
+
getIconComponent,
|
|
150
|
+
normalizeIconKey,
|
|
151
|
+
getDynamicIcon,
|
|
152
|
+
type DynamicIconSize,
|
|
153
|
+
} from './icon-registry'
|
|
154
|
+
export {
|
|
155
|
+
SOURCE_ICON_NAMES,
|
|
156
|
+
getSourceIconName,
|
|
157
|
+
SOURCE_LABELS_BY_TABLE,
|
|
158
|
+
getSourceLabel,
|
|
159
|
+
DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID,
|
|
160
|
+
defaultTableIdForDocumentType,
|
|
161
|
+
} from './source-icons'
|
|
162
|
+
export {
|
|
163
|
+
type SourceRowInput,
|
|
164
|
+
type SourceRowContext,
|
|
165
|
+
type SourceRowCTA,
|
|
166
|
+
resolveSourceRowCTA,
|
|
167
|
+
resolveSourceIcon,
|
|
168
|
+
} from './source-row-cta'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure utility — true iff `url` has an explicit host (i.e. would resolve
|
|
3
|
+
* to a different origin than where the consumer is running). Used by
|
|
4
|
+
* chat nav decisions and the extracted `decideNewTab` helper.
|
|
5
|
+
*
|
|
6
|
+
* SSR-deterministic: any URL with an explicit host (http://, https://,
|
|
7
|
+
* or protocol-relative //) is treated as cross-origin. By convention
|
|
8
|
+
* same-origin same-app navigation uses RELATIVE paths; an absolute URL
|
|
9
|
+
* with a host is external.
|
|
10
|
+
*
|
|
11
|
+
* Why deterministic: an earlier `window`-dependent implementation
|
|
12
|
+
* returned different values during SSR (false — no window) vs client
|
|
13
|
+
* hydration (true — origin differs), causing React hydration mismatches
|
|
14
|
+
* on every anchor that fell into the no-targetPlatform fallback (e.g.
|
|
15
|
+
* footer "Support" links to flamingo.run/support). Same-platform
|
|
16
|
+
* absolute URLs (rare — they only happen when a composer like
|
|
17
|
+
* `buildContentURL` returns an absolute URL for a non-current platform)
|
|
18
|
+
* flow through `decideNewTab`'s PLATFORM branch first (which uses
|
|
19
|
+
* `targetPlatform !== currentSource`) and never reach this fallback.
|
|
20
|
+
*/
|
|
21
|
+
export function isCrossOriginUrl(url: string | null | undefined): boolean {
|
|
22
|
+
if (!url) return false
|
|
23
|
+
// Relative URL — by definition same origin.
|
|
24
|
+
if (url.startsWith('/') && !url.startsWith('//')) return false
|
|
25
|
+
// Anything else — absolute URL (http(s)://) or protocol-relative (//)
|
|
26
|
+
// — is treated as cross-origin.
|
|
27
|
+
return true
|
|
28
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for the new-tab decision + anchor attribute pair used
|
|
3
|
+
* by chat-rendered links.
|
|
4
|
+
*
|
|
5
|
+
* After the navigation unification (ChatCardLoader pre-resolves
|
|
6
|
+
* `chatRef.url` via `resolveSourceRowCTA` + `resolveHrefForRuntime`,
|
|
7
|
+
* and `ChatCardNavWrap` handles every primary click via `onClickCapture`
|
|
8
|
+
* → `handleChatNavClick`), the per-card wrapper only needs
|
|
9
|
+
* `{href, target, rel}` on its inner `<a>` so modifier-click /
|
|
10
|
+
* hover-preview / copy-link work natively.
|
|
11
|
+
*
|
|
12
|
+
* `computeIsNewTab` is the SINGLE source of the new-tab rule across
|
|
13
|
+
* inline cards, source chips, and `NavLinkAnchorViaRuntime`. Do NOT
|
|
14
|
+
* inline the `runtime.navigation.mode === 'embed'` short-circuit + the
|
|
15
|
+
* `decideNewTab` fallback chain anywhere else.
|
|
16
|
+
*
|
|
17
|
+
* Rules:
|
|
18
|
+
* - `embed` mode → ALWAYS new-tab. The chat lives on the embedder
|
|
19
|
+
* origin; content lives on the hub. Same-tab nav would leave the
|
|
20
|
+
* embedder entirely.
|
|
21
|
+
* - `host` mode → defer to the runtime's `decideNewTab` callback
|
|
22
|
+
* (cross-platform → new-tab) or the lib's default.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import type { ChatRuntime } from '../../../contexts/chat-runtime-context'
|
|
26
|
+
import { decideNewTab as libDecideNewTab } from './decide-new-tab'
|
|
27
|
+
|
|
28
|
+
export function computeIsNewTab(
|
|
29
|
+
runtime: ChatRuntime,
|
|
30
|
+
href: string | null | undefined,
|
|
31
|
+
targetPlatform: string | null,
|
|
32
|
+
): boolean {
|
|
33
|
+
if (!href) return false
|
|
34
|
+
if (runtime.navigation.mode === 'embed') return true
|
|
35
|
+
return (
|
|
36
|
+
runtime.navigation.decideNewTab?.({ href, targetPlatform }) ??
|
|
37
|
+
libDecideNewTab({
|
|
38
|
+
href,
|
|
39
|
+
targetPlatform,
|
|
40
|
+
currentSource: runtime.source ?? '',
|
|
41
|
+
})
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Returns the `target` + `rel` attribute pair for an inner `<a>` based
|
|
47
|
+
* on the new-tab decision. Spread directly into JSX:
|
|
48
|
+
* <a href={href} {...newTabAnchorAttrs(isNewTab)} />
|
|
49
|
+
*
|
|
50
|
+
* Single helper so chat anchors stay consistent — new-tab links always
|
|
51
|
+
* pair `_blank` with `noopener noreferrer` (defense against window.opener
|
|
52
|
+
* tab-nabbing) and same-tab links don't render either attribute.
|
|
53
|
+
*/
|
|
54
|
+
export function newTabAnchorAttrs(isNewTab: boolean): {
|
|
55
|
+
target?: '_blank'
|
|
56
|
+
rel?: 'noopener noreferrer'
|
|
57
|
+
} {
|
|
58
|
+
return isNewTab
|
|
59
|
+
? { target: '_blank' as const, rel: 'noopener noreferrer' as const }
|
|
60
|
+
: {}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Combine `href` + new-tab attrs into a card's `anchorProps` slot.
|
|
65
|
+
* Returns `undefined` (not a falsy object) when there's no URL, so card
|
|
66
|
+
* components can branch on `anchorProps != null` to render either a
|
|
67
|
+
* clickable `<a>` or a static `<span>`.
|
|
68
|
+
*
|
|
69
|
+
* Replaces the repeated inline
|
|
70
|
+
* `chatRef.url ? { href: chatRef.url, ...newTabAnchorAttrs(isNewTab) } : undefined`
|
|
71
|
+
* pattern across the 7 dispatcher wrappers.
|
|
72
|
+
*/
|
|
73
|
+
export function buildAnchorProps(
|
|
74
|
+
href: string | null | undefined,
|
|
75
|
+
isNewTab: boolean,
|
|
76
|
+
): { href: string; target?: '_blank'; rel?: 'noopener noreferrer' } | undefined {
|
|
77
|
+
return href ? { href, ...newTabAnchorAttrs(isNewTab) } : undefined
|
|
78
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure click-handler helper for chat-rendered nav links.
|
|
3
|
+
*
|
|
4
|
+
* Single click router shared by:
|
|
5
|
+
* - The chip block inside EmbeddableChat
|
|
6
|
+
* - `<ChatCardNavWrap>` inside the entity-card dispatcher
|
|
7
|
+
* - `<NavLinkAnchorViaRuntime>` (markdown-body anchor wrapper)
|
|
8
|
+
*
|
|
9
|
+
* Returns `true` when the handler took action (called preventDefault); the
|
|
10
|
+
* caller can treat that as "I handled it" and skip any further routing.
|
|
11
|
+
* Returns `false` for modifier-clicks / non-primary buttons — those pass
|
|
12
|
+
* through to the browser's default behavior (open in new tab, etc.).
|
|
13
|
+
*
|
|
14
|
+
* The new-tab decision (`computeIsNewTab` — embed-mode short-circuit +
|
|
15
|
+
* `runtime.navigation.decideNewTab` + lib fallback) is the single source
|
|
16
|
+
* of truth and is consumed here directly. No caller needs to duplicate
|
|
17
|
+
* the embed-vs-host logic.
|
|
18
|
+
*
|
|
19
|
+
* Routing rules:
|
|
20
|
+
* - Empty href → preventDefault + return true (no-op nav)
|
|
21
|
+
* - Non-primary mouse button OR any modifier key → return false (let
|
|
22
|
+
* the browser handle it; `<a>` semantics take over)
|
|
23
|
+
* - new-tab (`computeIsNewTab` true) → `runtime.navigation.openExternal`
|
|
24
|
+
* or `window.open(href, '_blank')`. Covers embed mode and
|
|
25
|
+
* cross-platform host mode uniformly.
|
|
26
|
+
* - same-tab → `runtime.navigation.navigate?.(…)` → fallback
|
|
27
|
+
* `window.location.assign(stripSameOriginToPath(href))`
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
import { computeIsNewTab } from './nav-anchor-props'
|
|
31
|
+
import { NEW_TAB_FEATURES, stripSameOriginToPath } from './chat-nav-resolution'
|
|
32
|
+
import type { ChatRuntime } from '../../../contexts/chat-runtime-context'
|
|
33
|
+
|
|
34
|
+
export interface ChatNavClickInput {
|
|
35
|
+
href: string
|
|
36
|
+
path?: string | null
|
|
37
|
+
targetPlatform?: string | null
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Minimal mouse-event surface the click handler needs. Accepting a
|
|
42
|
+
* structural type rather than `React.MouseEvent<HTMLAnchorElement>` keeps
|
|
43
|
+
* the helper callable from non-anchor surfaces (chip buttons, tile
|
|
44
|
+
* containers) without forcing a cast.
|
|
45
|
+
*/
|
|
46
|
+
interface NavClickEvent {
|
|
47
|
+
preventDefault(): void
|
|
48
|
+
button?: number
|
|
49
|
+
metaKey?: boolean
|
|
50
|
+
ctrlKey?: boolean
|
|
51
|
+
shiftKey?: boolean
|
|
52
|
+
altKey?: boolean
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function handleChatNavClick(
|
|
56
|
+
e: NavClickEvent,
|
|
57
|
+
runtime: ChatRuntime,
|
|
58
|
+
{ href, path, targetPlatform }: ChatNavClickInput,
|
|
59
|
+
): boolean {
|
|
60
|
+
if (!href) {
|
|
61
|
+
e.preventDefault()
|
|
62
|
+
return true
|
|
63
|
+
}
|
|
64
|
+
if (e.button !== undefined && e.button !== 0) return false
|
|
65
|
+
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return false
|
|
66
|
+
|
|
67
|
+
e.preventDefault()
|
|
68
|
+
const isNewTab = computeIsNewTab(runtime, href, targetPlatform ?? null)
|
|
69
|
+
if (isNewTab) {
|
|
70
|
+
if (runtime.navigation.openExternal) {
|
|
71
|
+
runtime.navigation.openExternal(href)
|
|
72
|
+
} else {
|
|
73
|
+
window.open(href, '_blank', NEW_TAB_FEATURES)
|
|
74
|
+
}
|
|
75
|
+
return true
|
|
76
|
+
}
|
|
77
|
+
const handled =
|
|
78
|
+
runtime.navigation.navigate?.({ href, path, targetPlatform }) ?? false
|
|
79
|
+
if (!handled) window.location.assign(stripSameOriginToPath(href))
|
|
80
|
+
return true
|
|
81
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire glue + canonical const for the per-message `scrollAnchor`
|
|
3
|
+
* render hint.
|
|
4
|
+
*
|
|
5
|
+
* The actual `SCROLL_ANCHOR` const + `ScrollAnchor` type lives in
|
|
6
|
+
* `../types/message.types.ts` (it's part of the `Message` shape). This
|
|
7
|
+
* module re-exports them alongside the wire-key + a `parseScrollAnchor`
|
|
8
|
+
* narrower so server-side code that emits the metadata leading frame and
|
|
9
|
+
* client-side code that consumes it agree on the literal value AND the
|
|
10
|
+
* key on the wire frame.
|
|
11
|
+
*
|
|
12
|
+
* Consumed by:
|
|
13
|
+
* - SERVER: emits the field into the metadata leading frame
|
|
14
|
+
* (`...(scrollAnchor ? { [SCROLL_ANCHOR_WIRE_KEY]: x } : {})`).
|
|
15
|
+
* - CLIENT: parses each leading frame and feeds the value through
|
|
16
|
+
* `parseScrollAnchor` before storing it for the chat-message-list
|
|
17
|
+
* to consume. Malformed wire values return `null` and are filtered
|
|
18
|
+
* by metadata-merge logic — they never clobber a prior value.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { SCROLL_ANCHOR, type ScrollAnchor } from '../types/message.types'
|
|
22
|
+
|
|
23
|
+
export { SCROLL_ANCHOR, type ScrollAnchor }
|
|
24
|
+
|
|
25
|
+
/** Wire-frame key for the `scrollAnchor` field on the metadata leading
|
|
26
|
+
* frame. Used as a computed property name on both the emit side
|
|
27
|
+
* (server) and the parse side (client) so a rename is one-file. */
|
|
28
|
+
export const SCROLL_ANCHOR_WIRE_KEY = "scrollAnchor" as const
|
|
29
|
+
|
|
30
|
+
/** Narrow + validate a wire-supplied value. Returns the literal when
|
|
31
|
+
* it matches one of the registry's known values; returns `null`
|
|
32
|
+
* otherwise (which the metadata-merge null-skip filter then drops). */
|
|
33
|
+
export function parseScrollAnchor(raw: unknown): ScrollAnchor | null {
|
|
34
|
+
return raw === SCROLL_ANCHOR.TOP || raw === SCROLL_ANCHOR.BOTTOM ? raw : null
|
|
35
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lib-side portable subset of the hub's `lib/utils/slash-dispatch-utils.ts`.
|
|
3
|
+
*
|
|
4
|
+
* The full hub file owns the SERVER-SIDE parser/dispatcher (depends on
|
|
5
|
+
* `slash-commands-config`, `slash-commands-static`, `doc-source-config-utils`,
|
|
6
|
+
* `chat-admin-types`, `rag-table-config`) which stays hub-side.
|
|
7
|
+
*
|
|
8
|
+
* What MIGRATES here is the wire contract + the small text helpers consumed
|
|
9
|
+
* by chat surfaces in the lib + the hub UI:
|
|
10
|
+
* - `WireCommandOverride` — wire-shape (chat request body)
|
|
11
|
+
* - `parseWireCommandOverride` — wire validator
|
|
12
|
+
* - `CommandOverride` — server-built dispatch result type
|
|
13
|
+
* (presentation typed as `string` here; the hub narrows via its own
|
|
14
|
+
* `SlashCommandPresentation` union)
|
|
15
|
+
* - `extractEntityIdFilter` — `CommandOverride` → narrowed filter
|
|
16
|
+
* - `sanitizeTitleForChat` — collapse control chars in titles
|
|
17
|
+
* - `formatSingularLookupInvocation` — `/cmd "value"` builder
|
|
18
|
+
* - `buildDiscussAddendum` — server-side Discuss addendum prose
|
|
19
|
+
*
|
|
20
|
+
* Validation constants (regex + length caps) are duplicated here verbatim
|
|
21
|
+
* to keep the lib's wire validator self-contained.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
const WIRE_TABLE_ID_REGEX = /^[a-z][a-z0-9-]*$/
|
|
25
|
+
const WIRE_ID_REGEX = /^[A-Za-z0-9._:/-]+$/
|
|
26
|
+
const WIRE_TABLE_ID_MAX = 60
|
|
27
|
+
const WIRE_ID_MAX = 200
|
|
28
|
+
const WIRE_QUERY_MAX = 2000
|
|
29
|
+
|
|
30
|
+
/** Wire-supplied `CommandOverride` — the subset of fields a client (chat
|
|
31
|
+
* shell) is allowed to send on the request body. Excludes
|
|
32
|
+
* `systemPromptAddendum` by construction: addendum injection is a
|
|
33
|
+
* Rule-5b bypass vector, so we never accept it from the wire. */
|
|
34
|
+
export interface WireCommandOverride {
|
|
35
|
+
entityIdFilter?: { tableId: string; id: string }
|
|
36
|
+
retrievalQueryOverride?: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Parse + validate a wire-supplied `commandOverride` from the chat
|
|
41
|
+
* request body. Returns the validated subset OR `null` if the input is
|
|
42
|
+
* missing / malformed in every field.
|
|
43
|
+
*/
|
|
44
|
+
export function parseWireCommandOverride(raw: unknown): WireCommandOverride | null {
|
|
45
|
+
if (!raw || typeof raw !== 'object') return null
|
|
46
|
+
const out: WireCommandOverride = {}
|
|
47
|
+
const r = raw as Record<string, unknown>
|
|
48
|
+
|
|
49
|
+
if (r.entityIdFilter && typeof r.entityIdFilter === 'object') {
|
|
50
|
+
const f = r.entityIdFilter as Record<string, unknown>
|
|
51
|
+
if (
|
|
52
|
+
typeof f.tableId === 'string'
|
|
53
|
+
&& f.tableId.length > 0
|
|
54
|
+
&& f.tableId.length <= WIRE_TABLE_ID_MAX
|
|
55
|
+
&& WIRE_TABLE_ID_REGEX.test(f.tableId)
|
|
56
|
+
&& typeof f.id === 'string'
|
|
57
|
+
&& f.id.length > 0
|
|
58
|
+
&& f.id.length <= WIRE_ID_MAX
|
|
59
|
+
&& WIRE_ID_REGEX.test(f.id)
|
|
60
|
+
) {
|
|
61
|
+
out.entityIdFilter = { tableId: f.tableId, id: f.id }
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (
|
|
65
|
+
typeof r.retrievalQueryOverride === 'string'
|
|
66
|
+
&& r.retrievalQueryOverride.length > 0
|
|
67
|
+
&& r.retrievalQueryOverride.length <= WIRE_QUERY_MAX
|
|
68
|
+
) {
|
|
69
|
+
out.retrievalQueryOverride = r.retrievalQueryOverride
|
|
70
|
+
}
|
|
71
|
+
if (out.entityIdFilter === undefined && out.retrievalQueryOverride === undefined) {
|
|
72
|
+
return null
|
|
73
|
+
}
|
|
74
|
+
return out
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Sanitize a free-text title for use inside a chat-visible string:
|
|
79
|
+
* collapse control chars (\r \n \t) to single spaces and trim. Defends
|
|
80
|
+
* against a row title containing embedded newlines (which would split
|
|
81
|
+
* the rendered prompt across visible lines + survive into ILIKE in a
|
|
82
|
+
* confusing way) and tab/CR artifacts from sloppy imports.
|
|
83
|
+
*/
|
|
84
|
+
export function sanitizeTitleForChat(value: string | null | undefined): string {
|
|
85
|
+
return (value ?? '').replace(/[\r\n\t]+/g, ' ').trim()
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Compose a singular-lookup slash invocation as the user-visible chat
|
|
90
|
+
* message: `/<cmd> "<value>"` (or `/<cmd>` when value is empty).
|
|
91
|
+
*
|
|
92
|
+
* SINGLE SOURCE OF TRUTH for the quoting convention `parseSlashCommand`
|
|
93
|
+
* consumes: outer `"`-pair triggers `singularLookup`; unquoted args run
|
|
94
|
+
* FTS; empty args browse. Internal `"` chars are backslash-escaped so
|
|
95
|
+
* the visible string is paste-able / re-runnable.
|
|
96
|
+
*/
|
|
97
|
+
export function formatSingularLookupInvocation(cmdId: string, value?: string | null): string {
|
|
98
|
+
// Escape `\` BEFORE `"` — otherwise a value ending in `\` survives the
|
|
99
|
+
// `"`-escape pass and, when wrapped in `"..."`, the trailing `\"`
|
|
100
|
+
// becomes a literal `"` to a parser that processes backslash escapes,
|
|
101
|
+
// breaking the close quote. CodeQL's `js/incomplete-sanitization` fires
|
|
102
|
+
// on the previous one-pass `\"` escape for exactly this reason.
|
|
103
|
+
const safe = sanitizeTitleForChat(value)
|
|
104
|
+
.replace(/\\/g, '\\\\')
|
|
105
|
+
.replace(/"/g, '\\"')
|
|
106
|
+
return safe ? `/${cmdId} "${safe}"` : `/${cmdId}`
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Command-override structure passed to `buildChatContext.opts.commandOverride`. */
|
|
110
|
+
export interface CommandOverride {
|
|
111
|
+
retrievalScope?: string[]
|
|
112
|
+
systemPromptAddendum?: string
|
|
113
|
+
retrievalQueryOverride?: string | null
|
|
114
|
+
/** Singular-item lookup. When set, retrieval bypasses FTS and queries the
|
|
115
|
+
* named table directly via ILIKE on the matchFields. */
|
|
116
|
+
entityLookup?: {
|
|
117
|
+
tableId: string
|
|
118
|
+
value: string
|
|
119
|
+
matchFields: string[]
|
|
120
|
+
}
|
|
121
|
+
/** Singular row by primary key. Used by the inline object-card
|
|
122
|
+
* "Discuss" action — the client knows the exact row id from a prior
|
|
123
|
+
* chip. Higher precedence than `entityLookup` (route enforces) and
|
|
124
|
+
* `retrievalQueryOverride`. The retrieval layer still runs the table's
|
|
125
|
+
* `searchFilter` so privacy invariants hold. */
|
|
126
|
+
entityIdFilter?: {
|
|
127
|
+
tableId: string
|
|
128
|
+
id: string
|
|
129
|
+
}
|
|
130
|
+
/** "Browse" bypass for bare slash list commands. The search layer
|
|
131
|
+
* treats this as "skip FTS — return rows from these tableIds ordered
|
|
132
|
+
* by the configured `primaryDateColumn` DESC". */
|
|
133
|
+
browseScope?: string[]
|
|
134
|
+
/** Presentation hint propagated from the slash command. Hub narrows to
|
|
135
|
+
* its `SlashCommandPresentation` union; lib leaves as `string` for
|
|
136
|
+
* decoupling. */
|
|
137
|
+
presentation?: string
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Resolve the wire `entityIdFilter` from a `CommandOverride`, optionally
|
|
142
|
+
* narrowed to a specific `tableId`. Returns the validated `{ tableId, id }`
|
|
143
|
+
* pair only when both fields are present, non-empty, and (when an expected
|
|
144
|
+
* tableId is passed) match. Returns `null` otherwise.
|
|
145
|
+
*/
|
|
146
|
+
export function extractEntityIdFilter(
|
|
147
|
+
override: CommandOverride | null | undefined,
|
|
148
|
+
expectedTableId?: string,
|
|
149
|
+
): { tableId: string; id: string } | null {
|
|
150
|
+
const f = override?.entityIdFilter
|
|
151
|
+
if (!f) return null
|
|
152
|
+
const tableId = typeof f.tableId === 'string' ? f.tableId : ''
|
|
153
|
+
const id = typeof f.id === 'string' ? f.id : ''
|
|
154
|
+
if (!tableId || !id) return null
|
|
155
|
+
if (expectedTableId && tableId !== expectedTableId) return null
|
|
156
|
+
return { tableId, id }
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Server-only synthesizer for the Discuss-action system-prompt addendum.
|
|
161
|
+
* Called by the chat route AFTER `parseWireCommandOverride` accepts an
|
|
162
|
+
* `entityIdFilter` — the addendum text is composed from server-trusted
|
|
163
|
+
* values (the row's tableId + id) so a malicious client can't inject
|
|
164
|
+
* arbitrary prompt content.
|
|
165
|
+
*/
|
|
166
|
+
export function buildDiscussAddendum(args: { tableId: string; id: string }): string {
|
|
167
|
+
const idTag = args.id.length > 24 ? args.id.slice(0, 24) + '…' : args.id
|
|
168
|
+
return (
|
|
169
|
+
`Ask drill-in for row id="${args.id}" in table "${args.tableId}". Focus the ` +
|
|
170
|
+
`answer on this single record. If retrieval returns 0 rows (privacy ` +
|
|
171
|
+
`filter), say so plainly per Rule 5b.\n\n` +
|
|
172
|
+
`OPEN with the inline card on the FIRST line, immediately followed by ` +
|
|
173
|
+
`the chip and a mono-font id tag — no prose before the card:\n` +
|
|
174
|
+
` [card://<type>:${args.id}] [N] \`${args.tableId} · ${idTag}\`\n` +
|
|
175
|
+
`Use the EXACT <type> from the row's <document type="..." id="${args.id}"> tag.\n\n` +
|
|
176
|
+
`SURFACE EVERY FIELD PRESENT in the retrieved record — the user already ` +
|
|
177
|
+
`knows the title from the card; the value of Ask is the BODY (description, ` +
|
|
178
|
+
`status, vote counts, dates, linked URLs, …). Walk each non-empty field. ` +
|
|
179
|
+
`Don't invent fields, don't hallucinate values, silently omit absent fields.\n\n` +
|
|
180
|
+
`FORMAT: card+chip+id-tag opener, then ONE framing sentence, then a compact ` +
|
|
181
|
+
`bulleted "**Field** — value" list. Don't restate fields already in the list.`
|
|
182
|
+
)
|
|
183
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side re-export shim. Source-icons data + helpers live in
|
|
3
|
+
* `src/utils/source-icons.ts` (server-safe, no `'use client'` banner)
|
|
4
|
+
* so server-side hub code can call them. Chat-side consumers continue
|
|
5
|
+
* importing from this path via the chat-utils barrel.
|
|
6
|
+
*/
|
|
7
|
+
export {
|
|
8
|
+
SOURCE_ICON_NAMES,
|
|
9
|
+
getSourceIconName,
|
|
10
|
+
SOURCE_LABELS_BY_TABLE,
|
|
11
|
+
getSourceLabel,
|
|
12
|
+
DEFAULT_DOCUMENT_TYPE_TO_TABLE_ID,
|
|
13
|
+
defaultTableIdForDocumentType,
|
|
14
|
+
} from '../../../utils/source-icons'
|