@inkeep/agents-ui 0.0.0-dev-20260313222128
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/LICENSE +64 -0
- package/README.md +1 -0
- package/dist/_virtual/index.cjs +1 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/_virtual/use-sync-external-store-shim.development.cjs +1 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.production.cjs +1 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js +5 -0
- package/dist/color-mode/index.cjs +1 -0
- package/dist/color-mode/index.d.ts +20 -0
- package/dist/color-mode/index.js +170 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +238 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +9 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +68 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs +9 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +56 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/shim/index.cjs +1 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/shim/index.js +8 -0
- package/dist/primitives/atoms/avatars/ai.cjs +1 -0
- package/dist/primitives/atoms/avatars/ai.d.ts +3 -0
- package/dist/primitives/atoms/avatars/ai.js +99 -0
- package/dist/primitives/atoms/avatars/user.cjs +1 -0
- package/dist/primitives/atoms/avatars/user.d.ts +3 -0
- package/dist/primitives/atoms/avatars/user.js +27 -0
- package/dist/primitives/atoms/cmdk/command-score.cjs +1 -0
- package/dist/primitives/atoms/cmdk/command-score.d.ts +1 -0
- package/dist/primitives/atoms/cmdk/command-score.js +46 -0
- package/dist/primitives/atoms/cmdk/index.cjs +1 -0
- package/dist/primitives/atoms/cmdk/index.d.ts +460 -0
- package/dist/primitives/atoms/cmdk/index.js +521 -0
- package/dist/primitives/atoms/codeblock/index.cjs +1 -0
- package/dist/primitives/atoms/codeblock/index.d.ts +10 -0
- package/dist/primitives/atoms/codeblock/index.js +40 -0
- package/dist/primitives/atoms/combobox.cjs +1 -0
- package/dist/primitives/atoms/combobox.js +275 -0
- package/dist/primitives/atoms/custom-styles.cjs +1 -0
- package/dist/primitives/atoms/custom-styles.d.ts +5 -0
- package/dist/primitives/atoms/custom-styles.js +57 -0
- package/dist/primitives/atoms/dialog.cjs +1 -0
- package/dist/primitives/atoms/dialog.d.ts +94 -0
- package/dist/primitives/atoms/dialog.js +227 -0
- package/dist/primitives/atoms/error-boundary.cjs +1 -0
- package/dist/primitives/atoms/error-boundary.d.ts +6 -0
- package/dist/primitives/atoms/error-boundary.js +9 -0
- package/dist/primitives/atoms/icons/built-in-icon-renderer.cjs +1 -0
- package/dist/primitives/atoms/icons/built-in-icon-renderer.d.ts +6 -0
- package/dist/primitives/atoms/icons/built-in-icon-renderer.js +51 -0
- package/dist/primitives/atoms/icons/built-in-icons.cjs +1 -0
- package/dist/primitives/atoms/icons/built-in-icons.d.ts +86 -0
- package/dist/primitives/atoms/icons/built-in-icons.js +89 -0
- package/dist/primitives/atoms/icons/checkbox-icon.cjs +1 -0
- package/dist/primitives/atoms/icons/checkbox-icon.d.ts +1 -0
- package/dist/primitives/atoms/icons/checkbox-icon.js +24 -0
- package/dist/primitives/atoms/icons/collections/bi.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/bi.d.ts +4 -0
- package/dist/primitives/atoms/icons/collections/bi.js +49 -0
- package/dist/primitives/atoms/icons/collections/fi.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/fi.d.ts +2 -0
- package/dist/primitives/atoms/icons/collections/fi.js +29 -0
- package/dist/primitives/atoms/icons/collections/gr.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/gr.d.ts +2 -0
- package/dist/primitives/atoms/icons/collections/gr.js +21 -0
- package/dist/primitives/atoms/icons/collections/io5.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/io5.d.ts +34 -0
- package/dist/primitives/atoms/icons/collections/io5.js +806 -0
- package/dist/primitives/atoms/icons/collections/pi.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/pi.d.ts +4 -0
- package/dist/primitives/atoms/icons/collections/pi.js +49 -0
- package/dist/primitives/atoms/icons/custom-icon.cjs +1 -0
- package/dist/primitives/atoms/icons/custom-icon.d.ts +6 -0
- package/dist/primitives/atoms/icons/custom-icon.js +19 -0
- package/dist/primitives/atoms/icons/generate-icon.cjs +1 -0
- package/dist/primitives/atoms/icons/generate-icon.d.ts +28 -0
- package/dist/primitives/atoms/icons/generate-icon.js +56 -0
- package/dist/primitives/atoms/icons/index.cjs +1 -0
- package/dist/primitives/atoms/icons/index.d.ts +2 -0
- package/dist/primitives/atoms/icons/index.js +6 -0
- package/dist/primitives/atoms/icons/inkeep-default-icons.cjs +1 -0
- package/dist/primitives/atoms/icons/inkeep-default-icons.d.ts +2 -0
- package/dist/primitives/atoms/icons/inkeep-default-icons.js +28 -0
- package/dist/primitives/atoms/link.cjs +1 -0
- package/dist/primitives/atoms/link.d.ts +14 -0
- package/dist/primitives/atoms/link.js +35 -0
- package/dist/primitives/atoms/markdown/components.cjs +1 -0
- package/dist/primitives/atoms/markdown/components.d.ts +31 -0
- package/dist/primitives/atoms/markdown/components.js +76 -0
- package/dist/primitives/atoms/markdown/index.cjs +1 -0
- package/dist/primitives/atoms/markdown/index.d.ts +17 -0
- package/dist/primitives/atoms/markdown/index.js +121 -0
- package/dist/primitives/atoms/markdown/rehype-inline-code-property.cjs +1 -0
- package/dist/primitives/atoms/markdown/rehype-inline-code-property.d.ts +1 -0
- package/dist/primitives/atoms/markdown/rehype-inline-code-property.js +12 -0
- package/dist/primitives/atoms/portal-with-theme.cjs +1 -0
- package/dist/primitives/atoms/portal-with-theme.d.ts +2 -0
- package/dist/primitives/atoms/portal-with-theme.js +12 -0
- package/dist/primitives/atoms/portal.cjs +1 -0
- package/dist/primitives/atoms/portal.d.ts +8 -0
- package/dist/primitives/atoms/portal.js +19 -0
- package/dist/primitives/atoms/select.cjs +1 -0
- package/dist/primitives/atoms/select.d.ts +136 -0
- package/dist/primitives/atoms/select.js +785 -0
- package/dist/primitives/atoms/shadow/context.cjs +1 -0
- package/dist/primitives/atoms/shadow/context.d.ts +14 -0
- package/dist/primitives/atoms/shadow/context.js +54 -0
- package/dist/primitives/atoms/shadow/create.cjs +1 -0
- package/dist/primitives/atoms/shadow/create.d.ts +8 -0
- package/dist/primitives/atoms/shadow/create.js +56 -0
- package/dist/primitives/atoms/shadow/index.d.ts +1 -0
- package/dist/primitives/atoms/shadow/root.cjs +1 -0
- package/dist/primitives/atoms/shadow/root.d.ts +5 -0
- package/dist/primitives/atoms/shadow/root.js +22 -0
- package/dist/primitives/atoms/shadow/use-ensured-forwarded-ref.cjs +1 -0
- package/dist/primitives/atoms/shadow/use-ensured-forwarded-ref.d.ts +2 -0
- package/dist/primitives/atoms/shadow/use-ensured-forwarded-ref.js +11 -0
- package/dist/primitives/atoms/shadow/utils.cjs +1 -0
- package/dist/primitives/atoms/shadow/utils.d.ts +9 -0
- package/dist/primitives/atoms/shadow/utils.js +16 -0
- package/dist/primitives/components/chat-bubble/index.cjs +1 -0
- package/dist/primitives/components/chat-bubble/index.d.ts +10 -0
- package/dist/primitives/components/chat-bubble/index.js +38 -0
- package/dist/primitives/components/chat-button.cjs +1 -0
- package/dist/primitives/components/chat-button.d.ts +20 -0
- package/dist/primitives/components/chat-button.js +51 -0
- package/dist/primitives/components/chat-history/index.cjs +1 -0
- package/dist/primitives/components/chat-history/index.d.ts +27 -0
- package/dist/primitives/components/chat-history/index.js +105 -0
- package/dist/primitives/components/data-summaries.cjs +1 -0
- package/dist/primitives/components/data-summaries.d.ts +14 -0
- package/dist/primitives/components/data-summaries.js +38 -0
- package/dist/primitives/components/embedded-chat/chat-provider.cjs +1 -0
- package/dist/primitives/components/embedded-chat/chat-provider.d.ts +19 -0
- package/dist/primitives/components/embedded-chat/chat-provider.js +20 -0
- package/dist/primitives/components/embedded-chat/use-captcha.cjs +1 -0
- package/dist/primitives/components/embedded-chat/use-captcha.d.ts +30 -0
- package/dist/primitives/components/embedded-chat/use-captcha.js +67 -0
- package/dist/primitives/components/embedded-chat/use-chat-action.cjs +1 -0
- package/dist/primitives/components/embedded-chat/use-chat-action.d.ts +9 -0
- package/dist/primitives/components/embedded-chat/use-chat-action.js +41 -0
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +3 -0
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +57 -0
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +312 -0
- package/dist/primitives/components/embedded-chat/use-stream-processor.cjs +1 -0
- package/dist/primitives/components/embedded-chat/use-stream-processor.d.ts +30 -0
- package/dist/primitives/components/embedded-chat/use-stream-processor.js +159 -0
- package/dist/primitives/components/embedded-chat.cjs +11 -0
- package/dist/primitives/components/embedded-chat.d.ts +461 -0
- package/dist/primitives/components/embedded-chat.js +2051 -0
- package/dist/primitives/components/embedded-search/search-provider.cjs +1 -0
- package/dist/primitives/components/embedded-search/search-provider.d.ts +21 -0
- package/dist/primitives/components/embedded-search/search-provider.js +26 -0
- package/dist/primitives/components/embedded-search/transform-results.cjs +1 -0
- package/dist/primitives/components/embedded-search/transform-results.d.ts +3 -0
- package/dist/primitives/components/embedded-search/transform-results.js +47 -0
- package/dist/primitives/components/embedded-search/url-query.cjs +1 -0
- package/dist/primitives/components/embedded-search/url-query.d.ts +4 -0
- package/dist/primitives/components/embedded-search/url-query.js +12 -0
- package/dist/primitives/components/embedded-search/use-inkeep-search.cjs +1 -0
- package/dist/primitives/components/embedded-search/use-inkeep-search.d.ts +19 -0
- package/dist/primitives/components/embedded-search/use-inkeep-search.js +35 -0
- package/dist/primitives/components/embedded-search/use-search-filter.cjs +1 -0
- package/dist/primitives/components/embedded-search/use-search-filter.d.ts +1 -0
- package/dist/primitives/components/embedded-search/use-search-filter.js +77 -0
- package/dist/primitives/components/embedded-search.cjs +1 -0
- package/dist/primitives/components/embedded-search.d.ts +249 -0
- package/dist/primitives/components/embedded-search.js +628 -0
- package/dist/primitives/components/factory.cjs +1 -0
- package/dist/primitives/components/factory.d.ts +19 -0
- package/dist/primitives/components/factory.js +39 -0
- package/dist/primitives/components/index.cjs +1 -0
- package/dist/primitives/components/index.d.ts +13 -0
- package/dist/primitives/components/index.js +33 -0
- package/dist/primitives/components/modal/modal-provider.cjs +1 -0
- package/dist/primitives/components/modal/modal-provider.d.ts +12 -0
- package/dist/primitives/components/modal/modal-provider.js +8 -0
- package/dist/primitives/components/modal/use-inkeep-modal.cjs +1 -0
- package/dist/primitives/components/modal/use-inkeep-modal.d.ts +7 -0
- package/dist/primitives/components/modal/use-inkeep-modal.js +9 -0
- package/dist/primitives/components/modal/widget-auto-focus.cjs +1 -0
- package/dist/primitives/components/modal/widget-auto-focus.d.ts +2 -0
- package/dist/primitives/components/modal/widget-auto-focus.js +25 -0
- package/dist/primitives/components/modal.cjs +1 -0
- package/dist/primitives/components/modal.d.ts +18 -0
- package/dist/primitives/components/modal.js +40 -0
- package/dist/primitives/components/presence.cjs +1 -0
- package/dist/primitives/components/presence.d.ts +8 -0
- package/dist/primitives/components/presence.js +26 -0
- package/dist/primitives/components/searchbar.cjs +1 -0
- package/dist/primitives/components/searchbar.d.ts +23 -0
- package/dist/primitives/components/searchbar.js +54 -0
- package/dist/primitives/components/sidebar-chat/index.cjs +1 -0
- package/dist/primitives/components/sidebar-chat/index.d.ts +9 -0
- package/dist/primitives/components/sidebar-chat/index.js +67 -0
- package/dist/primitives/components/sidebar-chat/use-sidebar-chat-resizer.cjs +1 -0
- package/dist/primitives/components/sidebar-chat/use-sidebar-chat-resizer.d.ts +5 -0
- package/dist/primitives/components/sidebar-chat/use-sidebar-chat-resizer.js +34 -0
- package/dist/primitives/components/tagline-logo-icon.cjs +1 -0
- package/dist/primitives/components/tagline-logo-icon.d.ts +1 -0
- package/dist/primitives/components/tagline-logo-icon.js +26 -0
- package/dist/primitives/components/use-component-trigger.cjs +1 -0
- package/dist/primitives/components/use-component-trigger.d.ts +5 -0
- package/dist/primitives/components/use-component-trigger.js +17 -0
- package/dist/primitives/constants/search.cjs +1 -0
- package/dist/primitives/constants/search.d.ts +1 -0
- package/dist/primitives/constants/search.js +5 -0
- package/dist/primitives/hooks/index.cjs +1 -0
- package/dist/primitives/hooks/index.d.ts +12 -0
- package/dist/primitives/hooks/index.js +26 -0
- package/dist/primitives/hooks/use-anonymous-session.cjs +1 -0
- package/dist/primitives/hooks/use-anonymous-session.d.ts +12 -0
- package/dist/primitives/hooks/use-anonymous-session.js +82 -0
- package/dist/primitives/hooks/use-boolean.cjs +1 -0
- package/dist/primitives/hooks/use-boolean.d.ts +10 -0
- package/dist/primitives/hooks/use-boolean.js +17 -0
- package/dist/primitives/hooks/use-component-classnames.cjs +1 -0
- package/dist/primitives/hooks/use-component-classnames.d.ts +6 -0
- package/dist/primitives/hooks/use-component-classnames.js +14 -0
- package/dist/primitives/hooks/use-container-size.cjs +1 -0
- package/dist/primitives/hooks/use-container-size.d.ts +5 -0
- package/dist/primitives/hooks/use-container-size.js +18 -0
- package/dist/primitives/hooks/use-conversation-loader.cjs +1 -0
- package/dist/primitives/hooks/use-conversation-loader.d.ts +13 -0
- package/dist/primitives/hooks/use-conversation-loader.js +36 -0
- package/dist/primitives/hooks/use-copy-to-clipboard.cjs +1 -0
- package/dist/primitives/hooks/use-copy-to-clipboard.d.ts +3 -0
- package/dist/primitives/hooks/use-copy-to-clipboard.js +24 -0
- package/dist/primitives/hooks/use-debounce.cjs +1 -0
- package/dist/primitives/hooks/use-debounce.d.ts +1 -0
- package/dist/primitives/hooks/use-debounce.js +16 -0
- package/dist/primitives/hooks/use-inkeep-api-client.cjs +1 -0
- package/dist/primitives/hooks/use-inkeep-api-client.d.ts +33 -0
- package/dist/primitives/hooks/use-inkeep-api-client.js +87 -0
- package/dist/primitives/hooks/use-inkeep-open-state.cjs +1 -0
- package/dist/primitives/hooks/use-inkeep-open-state.d.ts +18 -0
- package/dist/primitives/hooks/use-inkeep-open-state.js +47 -0
- package/dist/primitives/hooks/use-instant-update.cjs +1 -0
- package/dist/primitives/hooks/use-instant-update.d.ts +16 -0
- package/dist/primitives/hooks/use-instant-update.js +16 -0
- package/dist/primitives/hooks/use-is-mounted.cjs +1 -0
- package/dist/primitives/hooks/use-is-mounted.d.ts +1 -0
- package/dist/primitives/hooks/use-is-mounted.js +11 -0
- package/dist/primitives/hooks/use-local-storage.cjs +1 -0
- package/dist/primitives/hooks/use-local-storage.d.ts +8 -0
- package/dist/primitives/hooks/use-local-storage.js +26 -0
- package/dist/primitives/hooks/use-media-query.cjs +1 -0
- package/dist/primitives/hooks/use-media-query.d.ts +1 -0
- package/dist/primitives/hooks/use-media-query.js +14 -0
- package/dist/primitives/hooks/use-resize-observer.cjs +1 -0
- package/dist/primitives/hooks/use-resize-observer.d.ts +12 -0
- package/dist/primitives/hooks/use-resize-observer.js +32 -0
- package/dist/primitives/hooks/use-scrolling-fades.cjs +1 -0
- package/dist/primitives/hooks/use-scrolling-fades.d.ts +2 -0
- package/dist/primitives/hooks/use-scrolling-fades.js +18 -0
- package/dist/primitives/hooks/use-settle-action.cjs +1 -0
- package/dist/primitives/hooks/use-settle-action.d.ts +3 -0
- package/dist/primitives/hooks/use-settle-action.js +11 -0
- package/dist/primitives/hooks/use-simple-scroll.cjs +1 -0
- package/dist/primitives/hooks/use-simple-scroll.d.ts +16 -0
- package/dist/primitives/hooks/use-simple-scroll.js +51 -0
- package/dist/primitives/hooks/use-streaming-events.cjs +1 -0
- package/dist/primitives/hooks/use-streaming-events.d.ts +8 -0
- package/dist/primitives/hooks/use-streaming-events.js +33 -0
- package/dist/primitives/index.cjs +1 -0
- package/dist/primitives/index.d.ts +13 -0
- package/dist/primitives/index.js +174 -0
- package/dist/primitives/providers/attachment-item-provider.cjs +1 -0
- package/dist/primitives/providers/attachment-item-provider.d.ts +9 -0
- package/dist/primitives/providers/attachment-item-provider.js +13 -0
- package/dist/primitives/providers/attachments-bar-provider.cjs +1 -0
- package/dist/primitives/providers/attachments-bar-provider.d.ts +30 -0
- package/dist/primitives/providers/attachments-bar-provider.js +57 -0
- package/dist/primitives/providers/base-events-provider.cjs +1 -0
- package/dist/primitives/providers/base-events-provider.d.ts +8 -0
- package/dist/primitives/providers/base-events-provider.js +37 -0
- package/dist/primitives/providers/chat-bubble-provider.cjs +1 -0
- package/dist/primitives/providers/chat-bubble-provider.d.ts +22 -0
- package/dist/primitives/providers/chat-bubble-provider.js +19 -0
- package/dist/primitives/providers/chat-form-provider.cjs +1 -0
- package/dist/primitives/providers/chat-form-provider.d.ts +26 -0
- package/dist/primitives/providers/chat-form-provider.js +109 -0
- package/dist/primitives/providers/chat-history-provider.cjs +1 -0
- package/dist/primitives/providers/chat-history-provider.d.ts +32 -0
- package/dist/primitives/providers/chat-history-provider.js +105 -0
- package/dist/primitives/providers/config-provider.cjs +1 -0
- package/dist/primitives/providers/config-provider.d.ts +24 -0
- package/dist/primitives/providers/config-provider.js +40 -0
- package/dist/primitives/providers/feedback-item-provider.cjs +1 -0
- package/dist/primitives/providers/feedback-item-provider.d.ts +10 -0
- package/dist/primitives/providers/feedback-item-provider.js +16 -0
- package/dist/primitives/providers/feedback-provider.cjs +1 -0
- package/dist/primitives/providers/feedback-provider.d.ts +16 -0
- package/dist/primitives/providers/feedback-provider.js +83 -0
- package/dist/primitives/providers/form-field-provider.cjs +1 -0
- package/dist/primitives/providers/form-field-provider.d.ts +15 -0
- package/dist/primitives/providers/form-field-provider.js +17 -0
- package/dist/primitives/providers/help-menu-provider.cjs +1 -0
- package/dist/primitives/providers/help-menu-provider.d.ts +11 -0
- package/dist/primitives/providers/help-menu-provider.js +19 -0
- package/dist/primitives/providers/hover-popover-provider.cjs +1 -0
- package/dist/primitives/providers/hover-popover-provider.d.ts +10 -0
- package/dist/primitives/providers/hover-popover-provider.js +13 -0
- package/dist/primitives/providers/index.cjs +1 -0
- package/dist/primitives/providers/index.d.ts +19 -0
- package/dist/primitives/providers/index.js +65 -0
- package/dist/primitives/providers/markdown-provider.cjs +1 -0
- package/dist/primitives/providers/markdown-provider.d.ts +9 -0
- package/dist/primitives/providers/markdown-provider.js +8 -0
- package/dist/primitives/providers/message-attachments-provider.cjs +1 -0
- package/dist/primitives/providers/message-attachments-provider.d.ts +13 -0
- package/dist/primitives/providers/message-attachments-provider.js +27 -0
- package/dist/primitives/providers/message-provider.cjs +1 -0
- package/dist/primitives/providers/message-provider.d.ts +10 -0
- package/dist/primitives/providers/message-provider.js +14 -0
- package/dist/primitives/providers/root-provider.cjs +1 -0
- package/dist/primitives/providers/root-provider.d.ts +8 -0
- package/dist/primitives/providers/root-provider.js +21 -0
- package/dist/primitives/providers/search-events-provider.cjs +1 -0
- package/dist/primitives/providers/search-events-provider.d.ts +8 -0
- package/dist/primitives/providers/search-events-provider.js +17 -0
- package/dist/primitives/providers/sidebar-chat-provider.cjs +1 -0
- package/dist/primitives/providers/sidebar-chat-provider.d.ts +61 -0
- package/dist/primitives/providers/sidebar-chat-provider.js +37 -0
- package/dist/primitives/providers/source-item-provider.cjs +1 -0
- package/dist/primitives/providers/source-item-provider.d.ts +12 -0
- package/dist/primitives/providers/source-item-provider.js +13 -0
- package/dist/primitives/providers/theme-provider.cjs +3 -0
- package/dist/primitives/providers/theme-provider.d.ts +3 -0
- package/dist/primitives/providers/theme-provider.js +79 -0
- package/dist/primitives/providers/widget-provider.cjs +1 -0
- package/dist/primitives/providers/widget-provider.d.ts +10 -0
- package/dist/primitives/providers/widget-provider.js +8 -0
- package/dist/primitives/utils/component-ids.cjs +1 -0
- package/dist/primitives/utils/component-ids.d.ts +662 -0
- package/dist/primitives/utils/component-ids.js +361 -0
- package/dist/primitives/utils/compose-event-handlers.cjs +1 -0
- package/dist/primitives/utils/compose-event-handlers.d.ts +3 -0
- package/dist/primitives/utils/compose-event-handlers.js +10 -0
- package/dist/primitives/utils/compose-refs.cjs +1 -0
- package/dist/primitives/utils/compose-refs.d.ts +5 -0
- package/dist/primitives/utils/compose-refs.js +30 -0
- package/dist/primitives/utils/default-settings.cjs +1 -0
- package/dist/primitives/utils/default-settings.d.ts +169 -0
- package/dist/primitives/utils/default-settings.js +52 -0
- package/dist/primitives/utils/form.cjs +1 -0
- package/dist/primitives/utils/form.d.ts +3 -0
- package/dist/primitives/utils/form.js +19 -0
- package/dist/primitives/utils/generate-uid.cjs +1 -0
- package/dist/primitives/utils/generate-uid.d.ts +2 -0
- package/dist/primitives/utils/generate-uid.js +14 -0
- package/dist/primitives/utils/get-message-metadata.d.ts +8 -0
- package/dist/primitives/utils/get-source-icon.cjs +1 -0
- package/dist/primitives/utils/get-source-icon.d.ts +2 -0
- package/dist/primitives/utils/get-source-icon.js +11 -0
- package/dist/primitives/utils/highlight-emphasis.cjs +1 -0
- package/dist/primitives/utils/highlight-emphasis.d.ts +4 -0
- package/dist/primitives/utils/highlight-emphasis.js +15 -0
- package/dist/primitives/utils/merge-props.cjs +1 -0
- package/dist/primitives/utils/merge-props.d.ts +7 -0
- package/dist/primitives/utils/merge-props.js +41 -0
- package/dist/primitives/utils/misc.cjs +1 -0
- package/dist/primitives/utils/misc.d.ts +12 -0
- package/dist/primitives/utils/misc.js +31 -0
- package/dist/primitives/utils/split-props.cjs +1 -0
- package/dist/primitives/utils/split-props.d.ts +14 -0
- package/dist/primitives/utils/split-props.js +10 -0
- package/dist/react/chat-button-modal.cjs +1 -0
- package/dist/react/chat-button-modal.d.ts +22 -0
- package/dist/react/chat-button-modal.js +41 -0
- package/dist/react/chat-button.cjs +1 -0
- package/dist/react/chat-button.d.ts +28 -0
- package/dist/react/chat-button.js +73 -0
- package/dist/react/embedded-chat.cjs +1 -0
- package/dist/react/embedded-chat.d.ts +15 -0
- package/dist/react/embedded-chat.js +431 -0
- package/dist/react/embedded-search-and-chat.cjs +1 -0
- package/dist/react/embedded-search-and-chat.d.ts +40 -0
- package/dist/react/embedded-search-and-chat.impl.cjs +1 -0
- package/dist/react/embedded-search-and-chat.impl.d.ts +9 -0
- package/dist/react/embedded-search-and-chat.impl.js +43 -0
- package/dist/react/embedded-search-and-chat.js +66 -0
- package/dist/react/embedded-search.cjs +1 -0
- package/dist/react/embedded-search.d.ts +17 -0
- package/dist/react/embedded-search.js +181 -0
- package/dist/react/index.cjs +1 -0
- package/dist/react/index.d.ts +13 -0
- package/dist/react/index.js +238 -0
- package/dist/react/modal.chat.cjs +1 -0
- package/dist/react/modal.chat.d.ts +9 -0
- package/dist/react/modal.chat.js +21 -0
- package/dist/react/modal.cjs +1 -0
- package/dist/react/modal.d.ts +23 -0
- package/dist/react/modal.js +27 -0
- package/dist/react/modal.search-and-chat.cjs +1 -0
- package/dist/react/modal.search-and-chat.d.ts +6 -0
- package/dist/react/modal.search-and-chat.js +27 -0
- package/dist/react/modal.search.cjs +1 -0
- package/dist/react/modal.search.d.ts +6 -0
- package/dist/react/modal.search.js +21 -0
- package/dist/react/searchbar.cjs +1 -0
- package/dist/react/searchbar.d.ts +13 -0
- package/dist/react/searchbar.js +68 -0
- package/dist/react/sidebar-chat.cjs +1 -0
- package/dist/react/sidebar-chat.d.ts +4 -0
- package/dist/react/sidebar-chat.js +53 -0
- package/dist/react/utils.cjs +1 -0
- package/dist/react/utils.d.ts +6 -0
- package/dist/react/utils.js +20 -0
- package/dist/react/widget-toggle.cjs +1 -0
- package/dist/react/widget-toggle.d.ts +14 -0
- package/dist/react/widget-toggle.js +65 -0
- package/dist/styled/components/chat-bubble.cjs +1 -0
- package/dist/styled/components/chat-bubble.d.ts +5 -0
- package/dist/styled/components/chat-bubble.js +70 -0
- package/dist/styled/components/chat-button.cjs +1 -0
- package/dist/styled/components/chat-button.d.ts +9 -0
- package/dist/styled/components/chat-button.js +60 -0
- package/dist/styled/components/chat-history.cjs +1 -0
- package/dist/styled/components/chat-history.d.ts +15 -0
- package/dist/styled/components/chat-history.js +197 -0
- package/dist/styled/components/data-summary-group.cjs +1 -0
- package/dist/styled/components/data-summary-group.d.ts +11 -0
- package/dist/styled/components/data-summary-group.js +96 -0
- package/dist/styled/components/embedded-chat/session-loading.cjs +1 -0
- package/dist/styled/components/embedded-chat/session-loading.d.ts +1 -0
- package/dist/styled/components/embedded-chat/session-loading.js +23 -0
- package/dist/styled/components/embedded-chat.cjs +1 -0
- package/dist/styled/components/embedded-chat.d.ts +211 -0
- package/dist/styled/components/embedded-chat.js +1997 -0
- package/dist/styled/components/embedded-search/results-loading.cjs +1 -0
- package/dist/styled/components/embedded-search/results-loading.d.ts +1 -0
- package/dist/styled/components/embedded-search/results-loading.js +39 -0
- package/dist/styled/components/embedded-search.cjs +1 -0
- package/dist/styled/components/embedded-search.d.ts +73 -0
- package/dist/styled/components/embedded-search.js +680 -0
- package/dist/styled/components/index.cjs +1 -0
- package/dist/styled/components/index.d.ts +13 -0
- package/dist/styled/components/index.js +28 -0
- package/dist/styled/components/loading-indicator.cjs +1 -0
- package/dist/styled/components/loading-indicator.d.ts +1 -0
- package/dist/styled/components/loading-indicator.js +36 -0
- package/dist/styled/components/message.cjs +1 -0
- package/dist/styled/components/message.d.ts +4 -0
- package/dist/styled/components/message.js +333 -0
- package/dist/styled/components/modal.cjs +1 -0
- package/dist/styled/components/modal.d.ts +6 -0
- package/dist/styled/components/modal.js +46 -0
- package/dist/styled/components/searchbar.cjs +1 -0
- package/dist/styled/components/searchbar.d.ts +11 -0
- package/dist/styled/components/searchbar.js +81 -0
- package/dist/styled/components/shadow.cjs +1 -0
- package/dist/styled/components/shadow.d.ts +3 -0
- package/dist/styled/components/shadow.js +8 -0
- package/dist/styled/components/sidebar-chat.cjs +1 -0
- package/dist/styled/components/sidebar-chat.d.ts +6 -0
- package/dist/styled/components/sidebar-chat.js +90 -0
- package/dist/styled/components/ui/markdown-styles.cjs +1 -0
- package/dist/styled/components/ui/markdown-styles.d.ts +23 -0
- package/dist/styled/components/ui/markdown-styles.js +39 -0
- package/dist/styled/components/ui/recipes/ai-chat-page-wrapper.cjs +1 -0
- package/dist/styled/components/ui/recipes/ai-chat-page-wrapper.d.ts +7 -0
- package/dist/styled/components/ui/recipes/ai-chat-page-wrapper.js +33 -0
- package/dist/styled/components/ui/recipes/attachment.cjs +1 -0
- package/dist/styled/components/ui/recipes/attachment.d.ts +4 -0
- package/dist/styled/components/ui/recipes/attachment.js +28 -0
- package/dist/styled/components/ui/recipes/button.cjs +1 -0
- package/dist/styled/components/ui/recipes/button.d.ts +6 -0
- package/dist/styled/components/ui/recipes/button.js +87 -0
- package/dist/styled/components/ui/recipes/checkbox.cjs +1 -0
- package/dist/styled/components/ui/recipes/checkbox.d.ts +4 -0
- package/dist/styled/components/ui/recipes/checkbox.js +23 -0
- package/dist/styled/components/ui/recipes/citation.cjs +1 -0
- package/dist/styled/components/ui/recipes/citation.d.ts +4 -0
- package/dist/styled/components/ui/recipes/citation.js +75 -0
- package/dist/styled/components/ui/recipes/combobox.cjs +1 -0
- package/dist/styled/components/ui/recipes/combobox.d.ts +4 -0
- package/dist/styled/components/ui/recipes/combobox.js +57 -0
- package/dist/styled/components/ui/recipes/icon.cjs +1 -0
- package/dist/styled/components/ui/recipes/icon.d.ts +2 -0
- package/dist/styled/components/ui/recipes/icon.js +6 -0
- package/dist/styled/components/ui/recipes/index.cjs +1 -0
- package/dist/styled/components/ui/recipes/index.d.ts +16 -0
- package/dist/styled/components/ui/recipes/index.js +39 -0
- package/dist/styled/components/ui/recipes/input.cjs +1 -0
- package/dist/styled/components/ui/recipes/input.d.ts +5 -0
- package/dist/styled/components/ui/recipes/input.js +34 -0
- package/dist/styled/components/ui/recipes/link.cjs +1 -0
- package/dist/styled/components/ui/recipes/link.d.ts +2 -0
- package/dist/styled/components/ui/recipes/link.js +13 -0
- package/dist/styled/components/ui/recipes/markdown.cjs +1 -0
- package/dist/styled/components/ui/recipes/markdown.d.ts +16 -0
- package/dist/styled/components/ui/recipes/markdown.js +103 -0
- package/dist/styled/components/ui/recipes/modal.cjs +1 -0
- package/dist/styled/components/ui/recipes/modal.d.ts +4 -0
- package/dist/styled/components/ui/recipes/modal.js +59 -0
- package/dist/styled/components/ui/recipes/popover.cjs +1 -0
- package/dist/styled/components/ui/recipes/popover.d.ts +4 -0
- package/dist/styled/components/ui/recipes/popover.js +20 -0
- package/dist/styled/components/ui/recipes/scrollable.cjs +1 -0
- package/dist/styled/components/ui/recipes/scrollable.d.ts +4 -0
- package/dist/styled/components/ui/recipes/scrollable.js +15 -0
- package/dist/styled/components/ui/recipes/select.cjs +1 -0
- package/dist/styled/components/ui/recipes/select.d.ts +4 -0
- package/dist/styled/components/ui/recipes/select.js +38 -0
- package/dist/styled/components/ui/recipes/skeleton.cjs +1 -0
- package/dist/styled/components/ui/recipes/skeleton.d.ts +2 -0
- package/dist/styled/components/ui/recipes/skeleton.js +16 -0
- package/dist/styled/components/ui/recipes/widget-toggle.cjs +1 -0
- package/dist/styled/components/ui/recipes/widget-toggle.d.ts +4 -0
- package/dist/styled/components/ui/recipes/widget-toggle.js +35 -0
- package/dist/styled/index.cjs +1 -0
- package/dist/styled/index.d.ts +2 -0
- package/dist/styled/index.js +200 -0
- package/dist/styled/inkeep.css.cjs +4567 -0
- package/dist/styled/inkeep.css.js +4571 -0
- package/dist/styled/utils.cjs +1 -0
- package/dist/styled/utils.d.ts +4 -0
- package/dist/styled/utils.js +11 -0
- package/dist/theme/color-utils.cjs +1 -0
- package/dist/theme/color-utils.d.ts +1 -0
- package/dist/theme/color-utils.js +21 -0
- package/dist/theme/colors.cjs +1 -0
- package/dist/theme/colors.d.ts +104 -0
- package/dist/theme/colors.js +143 -0
- package/dist/theme/index.cjs +1 -0
- package/dist/theme/index.d.ts +125 -0
- package/dist/theme/index.js +58 -0
- package/dist/theme/utils/create-css-variables.cjs +1 -0
- package/dist/theme/utils/create-css-variables.d.ts +2 -0
- package/dist/theme/utils/create-css-variables.js +24 -0
- package/dist/theme/utils/generate-theme-variables.cjs +1 -0
- package/dist/theme/utils/generate-theme-variables.d.ts +3 -0
- package/dist/theme/utils/generate-theme-variables.js +34 -0
- package/dist/types/color-mode.d.ts +44 -0
- package/dist/types/config/ai.d.ts +269 -0
- package/dist/types/config/base.d.ts +358 -0
- package/dist/types/config/components.d.ts +16 -0
- package/dist/types/config/filters.d.ts +17 -0
- package/dist/types/config/index.d.ts +36 -0
- package/dist/types/config/open-settings.d.ts +70 -0
- package/dist/types/config/search.d.ts +95 -0
- package/dist/types/config/settings/actions.d.ts +112 -0
- package/dist/types/config/settings/form.d.ts +83 -0
- package/dist/types/config/settings/jsonschema.d.ts +105 -0
- package/dist/types/config/settings/workflow.d.ts +86 -0
- package/dist/types/events.d.ts +188 -0
- package/dist/types/icons/built-in.d.ts +1 -0
- package/dist/types/icons/custom.d.ts +33 -0
- package/dist/types/icons/index.d.ts +2 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/types/js/index.d.ts +55 -0
- package/dist/types/message.d.ts +43 -0
- package/dist/types/shadow.d.ts +15 -0
- package/dist/types/sources.d.ts +100 -0
- package/dist/types/theme.d.ts +25 -0
- package/dist/types/widget.d.ts +27 -0
- package/package.json +140 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AIChatFormSettings, GetHelpOption, Message, FormField } from '../../types/index.ts';
|
|
2
|
+
import { Message, FieldErrors, Control } from 'react-hook-form';
|
|
3
|
+
export type ChatFormContextValue = ReturnType<typeof useChatFormState>;
|
|
4
|
+
export declare function useChatFormState(): {
|
|
5
|
+
form: AIChatFormSettings | null;
|
|
6
|
+
openForm: (formSettings: AIChatFormSettings, getHelpOption?: GetHelpOption) => void;
|
|
7
|
+
closeForm: () => void;
|
|
8
|
+
handleSubmit: (e: React.FormEvent, conversation?: {
|
|
9
|
+
id: string;
|
|
10
|
+
messages: Message[];
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
isSuccess: boolean;
|
|
13
|
+
isSubmitting: boolean;
|
|
14
|
+
formError: Partial<{
|
|
15
|
+
type: string | number;
|
|
16
|
+
message: Message;
|
|
17
|
+
}> | undefined;
|
|
18
|
+
getFields: (conversationId?: string) => FormField[];
|
|
19
|
+
errors: FieldErrors<Record<string, any>>;
|
|
20
|
+
control: Control<Record<string, any>, any>;
|
|
21
|
+
defaultValues: Record<string, any>;
|
|
22
|
+
};
|
|
23
|
+
export declare const ChatFormProvider: React.FC<{
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const useChatForm: () => ChatFormContextValue;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as N } from "react/jsx-runtime";
|
|
3
|
+
import { useState as d, useCallback as a, useMemo as v, useEffect as P, createContext as T, useContext as k } from "react";
|
|
4
|
+
import { useForm as G } from "react-hook-form";
|
|
5
|
+
import { useModal as W } from "../components/modal/modal-provider.js";
|
|
6
|
+
import { getFormDefaultValues as j } from "../utils/form.js";
|
|
7
|
+
import { useBaseEvents as A } from "./base-events-provider.js";
|
|
8
|
+
const B = "root.serverError", y = T(void 0);
|
|
9
|
+
function D() {
|
|
10
|
+
const [e, c] = d(null), [u, f] = d(null), [w, p] = d(!1), h = W(), { logEvent: b } = A(), x = a(
|
|
11
|
+
(o, t) => {
|
|
12
|
+
c(o), f(t || null);
|
|
13
|
+
},
|
|
14
|
+
[]
|
|
15
|
+
), l = a(() => {
|
|
16
|
+
c(null), f(null), p(!1), e?.buttons.close?.action === "close_modal" && h?.setOpen(!1);
|
|
17
|
+
}, [e?.buttons.close?.action, h]), s = a(
|
|
18
|
+
(o) => e?.fields.map((t) => {
|
|
19
|
+
if ("_type" in t && t._type === "include_chat_session") {
|
|
20
|
+
const { _type: I, ...r } = t;
|
|
21
|
+
return {
|
|
22
|
+
...r,
|
|
23
|
+
inputType: "checkbox",
|
|
24
|
+
isHidden: !o,
|
|
25
|
+
defaultValue: r.defaultValue ?? !1
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return t;
|
|
29
|
+
}).filter((t) => !("_type" in t)) || [],
|
|
30
|
+
[e?.fields]
|
|
31
|
+
), g = v(() => s(), [s]), n = v(() => j(g), [g]), {
|
|
32
|
+
control: V,
|
|
33
|
+
handleSubmit: S,
|
|
34
|
+
formState: { errors: _, isSubmitting: O },
|
|
35
|
+
setError: C,
|
|
36
|
+
reset: E
|
|
37
|
+
} = G({
|
|
38
|
+
defaultValues: n
|
|
39
|
+
});
|
|
40
|
+
P(() => {
|
|
41
|
+
n && E(n);
|
|
42
|
+
}, [E, n]);
|
|
43
|
+
const F = a(
|
|
44
|
+
(o) => async (t) => {
|
|
45
|
+
const r = s(o?.id).find(
|
|
46
|
+
(i) => i.name && e?.fields.some(
|
|
47
|
+
(m) => "_type" in m && m._type === "include_chat_session" && m.name === i.name
|
|
48
|
+
)
|
|
49
|
+
), M = o?.id && r && t[r.name];
|
|
50
|
+
try {
|
|
51
|
+
await e?.buttons.submit.onSubmit({
|
|
52
|
+
values: t,
|
|
53
|
+
conversation: M ? o : void 0
|
|
54
|
+
}), u && b({
|
|
55
|
+
eventName: "user_escalation_indicated",
|
|
56
|
+
properties: {
|
|
57
|
+
escalationType: "support_form",
|
|
58
|
+
getHelpOptionName: u.name,
|
|
59
|
+
conversationId: o?.id
|
|
60
|
+
}
|
|
61
|
+
}), p(!0), e?.successView || l();
|
|
62
|
+
} catch (i) {
|
|
63
|
+
C(B, {
|
|
64
|
+
message: i instanceof Error ? i.message : "Something went wrong."
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
[
|
|
69
|
+
s,
|
|
70
|
+
e?.fields,
|
|
71
|
+
e?.buttons.submit,
|
|
72
|
+
e?.successView,
|
|
73
|
+
u,
|
|
74
|
+
b,
|
|
75
|
+
C,
|
|
76
|
+
l
|
|
77
|
+
]
|
|
78
|
+
), R = a(
|
|
79
|
+
(o, t) => S(F(t))(o),
|
|
80
|
+
[S, F]
|
|
81
|
+
), H = _?.root?.serverError;
|
|
82
|
+
return {
|
|
83
|
+
form: e,
|
|
84
|
+
openForm: x,
|
|
85
|
+
closeForm: l,
|
|
86
|
+
handleSubmit: R,
|
|
87
|
+
isSuccess: w,
|
|
88
|
+
isSubmitting: O,
|
|
89
|
+
formError: H,
|
|
90
|
+
getFields: s,
|
|
91
|
+
errors: _,
|
|
92
|
+
control: V,
|
|
93
|
+
defaultValues: n
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const U = ({ children: e }) => {
|
|
97
|
+
const c = D();
|
|
98
|
+
return /* @__PURE__ */ N(y.Provider, { value: c, children: e });
|
|
99
|
+
}, X = () => {
|
|
100
|
+
const e = k(y);
|
|
101
|
+
if (!e)
|
|
102
|
+
throw new Error("useChatForm must be used within a ChatFormProvider");
|
|
103
|
+
return e;
|
|
104
|
+
};
|
|
105
|
+
export {
|
|
106
|
+
U as ChatFormProvider,
|
|
107
|
+
X as useChatForm,
|
|
108
|
+
D as useChatFormState
|
|
109
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const X=require("react/jsx-runtime"),e=require("react"),Y=require("../components/embedded-chat/chat-provider.cjs"),N=require("./config-provider.cjs"),ee=require("../hooks/use-inkeep-api-client.cjs"),F=e.createContext(void 0),D=25;function te(t){const{stop:a,clear:c,conversationId:u,isStreaming:H,loadAndRestoreSession:P,sessionToken:f,refreshSession:W,getCaptchaHeader:G,invalidateCaptcha:K}=Y.useChat(),{aiChatSettings:U}=N.useInkeepConfig(),{baseUrl:h,appId:k,apiKey:Z}=U,o=!Z&&!!k,C=f,{fetchWithAuth:I}=ee.useInkeepApiClient({appId:k,authToken:C,getCaptchaHeader:G,invalidateCaptcha:K,refreshSession:W}),[p,S]=e.useState(!1),[R,E]=e.useState([]),[g,x]=e.useState(!1),[m,_]=e.useState(0),[v,z]=e.useState(!1),b=e.useRef(!1),q=e.useRef(null),j=e.useRef([]);j.current=R;const M=e.useRef(I);M.current=I;const i=e.useCallback(async(s,n=!1)=>{if(!(!h||!C||!o)){n||x(!0);try{const w=`${h}/run/v1/conversations?page=${s+1}&limit=${D}`,y=await M.current(w);if(!y.ok)throw new Error(`Failed to fetch conversations: ${y.status}`);const L=await y.json(),d=(L.data??[]).map(r=>({id:r.id,title:r.title??"",createdAt:new Date(r.createdAt),updatedAt:new Date(r.updatedAt)}));E(r=>{if(s===0&&!n)return d;if(s===0&&n){const l=new Set(d.map(A=>A.id));return[...d,...r.slice(D).filter(A=>!l.has(A.id))]}const V=new Set(r.map(l=>l.id));return[...r,...d.filter(l=>!V.has(l.id))]});const{page:O,pages:T}=L.pagination??{};z(O!=null&&T!=null?O<T:!1),n||_(s)}catch(w){console.error("[useChatHistory] Failed to load conversations:",w)}finally{x(!1)}}},[h,C,o]);e.useEffect(()=>{!p||!f||!o||(t==="stack"?(E([]),i(0)):b.current||(b.current=!0,i(0)))},[p,f,o,t,i]);const $=e.useRef("");e.useEffect(()=>{o&&t==="sidepane"&&(!u||!H||b.current&&$.current!==u&&(j.current.some(s=>s.id===u)||($.current=u,i(0,!0))))},[u,o,t,i,H]);const B=e.useCallback(()=>{!g&&v&&i(m+1)},[g,v,m,i]),J=e.useCallback(()=>{a(),c(),t!=="sidepane"&&S(!1)},[t,a,c]),Q=e.useCallback(async s=>{q.current?.abort();const n=new AbortController;q.current=n,await P(s,n.signal),!n.signal.aborted&&t!=="sidepane"&&S(!1)},[t,P]);return{isEnabled:o,isOpen:p,setIsOpen:S,sessions:R,isLoading:g,hasMore:v,loadMore:B,startNewConversation:J,loadSession:Q}}const se=({layout:t,children:a})=>{const c=te(t);return X.jsx(F.Provider,{value:c,children:typeof a=="function"?a(c):a})},ne=()=>{const t=e.useContext(F);if(!t)throw new Error("useChatHistory must be used within a ChatHistoryProvider");return t};exports.ChatHistoryProvider=se;exports.useChatHistory=ne;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface ConversationApiItem {
|
|
2
|
+
id: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
updatedAt: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ChatSession {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
updatedAt: Date;
|
|
12
|
+
}
|
|
13
|
+
export type ChatHistoryLayout = 'sidepane' | 'stack';
|
|
14
|
+
interface ChatHistoryContextValue {
|
|
15
|
+
/** False when chat history is unavailable (e.g. API key auth or no appId configured). */
|
|
16
|
+
isEnabled: boolean;
|
|
17
|
+
isOpen: boolean;
|
|
18
|
+
setIsOpen: (open: boolean) => void;
|
|
19
|
+
sessions: ChatSession[];
|
|
20
|
+
isLoading: boolean;
|
|
21
|
+
hasMore: boolean;
|
|
22
|
+
loadMore: () => void;
|
|
23
|
+
startNewConversation: () => void;
|
|
24
|
+
loadSession: (sessionId: string) => void;
|
|
25
|
+
}
|
|
26
|
+
export interface ChatHistoryProviderProps {
|
|
27
|
+
layout: ChatHistoryLayout;
|
|
28
|
+
children: React.ReactNode | ((value: ChatHistoryContextValue) => React.ReactNode);
|
|
29
|
+
}
|
|
30
|
+
export declare const ChatHistoryProvider: React.FC<ChatHistoryProviderProps>;
|
|
31
|
+
export declare const useChatHistory: () => ChatHistoryContextValue;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as tt } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as et, useContext as st, useState as f, useRef as d, useCallback as h, useEffect as G } from "react";
|
|
4
|
+
import { useChat as nt } from "../components/embedded-chat/chat-provider.js";
|
|
5
|
+
import { useInkeepConfig as rt } from "./config-provider.js";
|
|
6
|
+
import { useInkeepApiClient as ot } from "../hooks/use-inkeep-api-client.js";
|
|
7
|
+
const U = et(void 0), K = 25;
|
|
8
|
+
function it(t) {
|
|
9
|
+
const {
|
|
10
|
+
stop: i,
|
|
11
|
+
clear: a,
|
|
12
|
+
conversationId: c,
|
|
13
|
+
isStreaming: y,
|
|
14
|
+
loadAndRestoreSession: P,
|
|
15
|
+
sessionToken: p,
|
|
16
|
+
refreshSession: Z,
|
|
17
|
+
getCaptchaHeader: _,
|
|
18
|
+
invalidateCaptcha: q
|
|
19
|
+
} = nt(), { aiChatSettings: z } = rt(), { baseUrl: C, appId: k, apiKey: B } = z, r = !B && !!k, g = p, { fetchWithAuth: x } = ot({
|
|
20
|
+
appId: k,
|
|
21
|
+
authToken: g,
|
|
22
|
+
getCaptchaHeader: _,
|
|
23
|
+
invalidateCaptcha: q,
|
|
24
|
+
refreshSession: Z
|
|
25
|
+
}), [w, m] = f(!1), [E, $] = f([]), [S, L] = f(!1), [M, J] = f(0), [v, Q] = f(!1), A = d(!1), R = d(null), j = d([]);
|
|
26
|
+
j.current = E;
|
|
27
|
+
const D = d(x);
|
|
28
|
+
D.current = x;
|
|
29
|
+
const o = h(
|
|
30
|
+
async (e, s = !1) => {
|
|
31
|
+
if (!(!C || !g || !r)) {
|
|
32
|
+
s || L(!0);
|
|
33
|
+
try {
|
|
34
|
+
const b = `${C}/run/v1/conversations?page=${e + 1}&limit=${K}`, H = await D.current(b);
|
|
35
|
+
if (!H.ok) throw new Error(`Failed to fetch conversations: ${H.status}`);
|
|
36
|
+
const O = await H.json(), l = (O.data ?? []).map((n) => ({
|
|
37
|
+
id: n.id,
|
|
38
|
+
title: n.title ?? "",
|
|
39
|
+
createdAt: new Date(n.createdAt),
|
|
40
|
+
updatedAt: new Date(n.updatedAt)
|
|
41
|
+
}));
|
|
42
|
+
$((n) => {
|
|
43
|
+
if (e === 0 && !s) return l;
|
|
44
|
+
if (e === 0 && s) {
|
|
45
|
+
const u = new Set(l.map((I) => I.id));
|
|
46
|
+
return [...l, ...n.slice(K).filter((I) => !u.has(I.id))];
|
|
47
|
+
}
|
|
48
|
+
const N = new Set(n.map((u) => u.id));
|
|
49
|
+
return [...n, ...l.filter((u) => !N.has(u.id))];
|
|
50
|
+
});
|
|
51
|
+
const { page: T, pages: W } = O.pagination ?? {};
|
|
52
|
+
Q(T != null && W != null ? T < W : !1), s || J(e);
|
|
53
|
+
} catch (b) {
|
|
54
|
+
console.error("[useChatHistory] Failed to load conversations:", b);
|
|
55
|
+
} finally {
|
|
56
|
+
L(!1);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
[C, g, r]
|
|
61
|
+
);
|
|
62
|
+
G(() => {
|
|
63
|
+
!w || !p || !r || (t === "stack" ? ($([]), o(0)) : A.current || (A.current = !0, o(0)));
|
|
64
|
+
}, [w, p, r, t, o]);
|
|
65
|
+
const F = d("");
|
|
66
|
+
G(() => {
|
|
67
|
+
r && t === "sidepane" && (!c || !y || A.current && F.current !== c && (j.current.some((e) => e.id === c) || (F.current = c, o(0, !0))));
|
|
68
|
+
}, [c, r, t, o, y]);
|
|
69
|
+
const V = h(() => {
|
|
70
|
+
!S && v && o(M + 1);
|
|
71
|
+
}, [S, v, M, o]), X = h(() => {
|
|
72
|
+
i(), a(), t !== "sidepane" && m(!1);
|
|
73
|
+
}, [t, i, a]), Y = h(
|
|
74
|
+
async (e) => {
|
|
75
|
+
R.current?.abort();
|
|
76
|
+
const s = new AbortController();
|
|
77
|
+
R.current = s, await P(e, s.signal), !s.signal.aborted && t !== "sidepane" && m(!1);
|
|
78
|
+
},
|
|
79
|
+
[t, P]
|
|
80
|
+
);
|
|
81
|
+
return {
|
|
82
|
+
isEnabled: r,
|
|
83
|
+
isOpen: w,
|
|
84
|
+
setIsOpen: m,
|
|
85
|
+
sessions: E,
|
|
86
|
+
isLoading: S,
|
|
87
|
+
hasMore: v,
|
|
88
|
+
loadMore: V,
|
|
89
|
+
startNewConversation: X,
|
|
90
|
+
loadSession: Y
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const ht = ({ layout: t, children: i }) => {
|
|
94
|
+
const a = it(t);
|
|
95
|
+
return /* @__PURE__ */ tt(U.Provider, { value: a, children: typeof i == "function" ? i(a) : i });
|
|
96
|
+
}, pt = () => {
|
|
97
|
+
const t = st(U);
|
|
98
|
+
if (!t)
|
|
99
|
+
throw new Error("useChatHistory must be used within a ChatHistoryProvider");
|
|
100
|
+
return t;
|
|
101
|
+
};
|
|
102
|
+
export {
|
|
103
|
+
ht as ChatHistoryProvider,
|
|
104
|
+
pt as useChatHistory
|
|
105
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),b=require("merge-anything"),r=require("react"),n=require("../utils/default-settings.cjs"),f=require("../atoms/shadow/context.cjs"),s={ChatButton:"ChatButton",CustomTrigger:"CustomTrigger",SearchBar:"SearchBar",EmbeddedChat:"EmbeddedChat",EmbeddedSearch:"EmbeddedSearch",EmbeddedSearchAndChat:"EmbeddedSearchAndChat",SidebarChat:"SidebarChat"},o={prefix:"ikp",aiChatSettings:n.defaultInkeepAIChatSettings,baseSettings:n.defaultInkeepBaseSettings,searchSettings:n.defaultInkeepSearchSettings,componentType:s.EmbeddedChat},d=r.createContext(o),p=({children:t,value:i})=>{const c=f.useShadow(),g=(e,a,C)=>["baseSettings","searchSettings","aiChatSettings"].includes(C)&&!a?e:a,u={baseSettings:c??{}},h=r.useMemo(()=>{const e=b.mergeAndCompare(g,o,u,i??{});return e.aiChatSettings?.baseUrl&&(e.aiChatSettings.baseUrl=e.aiChatSettings.baseUrl.replace(/\/+$/,"")),e},[i]);return S.jsx(d.Provider,{value:h,children:t})},m=()=>{const t=r.useContext(d);if(!t)throw new Error("useInkeepConfig must be used within a ConfigProvider");return t};exports.InkeepConfigProvider=p;exports.WebWidgetInteractionType=s;exports.useInkeepConfig=m;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DefaultInkeepAIChatSettings, DefaultInkeepBaseSettings, DefaultInkeepSearchSettings } from '../utils/default-settings';
|
|
3
|
+
import { InkeepConfig } from '../../types/index.ts';
|
|
4
|
+
export declare const WebWidgetInteractionType: {
|
|
5
|
+
readonly ChatButton: "ChatButton";
|
|
6
|
+
readonly CustomTrigger: "CustomTrigger";
|
|
7
|
+
readonly SearchBar: "SearchBar";
|
|
8
|
+
readonly EmbeddedChat: "EmbeddedChat";
|
|
9
|
+
readonly EmbeddedSearch: "EmbeddedSearch";
|
|
10
|
+
readonly EmbeddedSearchAndChat: "EmbeddedSearchAndChat";
|
|
11
|
+
readonly SidebarChat: "SidebarChat";
|
|
12
|
+
};
|
|
13
|
+
export interface WidgetConfig extends InkeepConfig {
|
|
14
|
+
aiChatSettings: InkeepConfig['aiChatSettings'] & DefaultInkeepAIChatSettings;
|
|
15
|
+
baseSettings: InkeepConfig['baseSettings'] & DefaultInkeepBaseSettings;
|
|
16
|
+
searchSettings: InkeepConfig['searchSettings'] & DefaultInkeepSearchSettings;
|
|
17
|
+
}
|
|
18
|
+
interface InkeepConfigProviderProps {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
value?: Partial<InkeepConfig>;
|
|
21
|
+
}
|
|
22
|
+
export declare const InkeepConfigProvider: ({ children, value }: InkeepConfigProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const useInkeepConfig: () => WidgetConfig;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
3
|
+
import { mergeAndCompare as g } from "merge-anything";
|
|
4
|
+
import { useMemo as m, createContext as S, useContext as u } from "react";
|
|
5
|
+
import { defaultInkeepSearchSettings as f, defaultInkeepBaseSettings as p, defaultInkeepAIChatSettings as b } from "../utils/default-settings.js";
|
|
6
|
+
import { useShadow as l } from "../atoms/shadow/context.js";
|
|
7
|
+
const I = {
|
|
8
|
+
ChatButton: "ChatButton",
|
|
9
|
+
CustomTrigger: "CustomTrigger",
|
|
10
|
+
SearchBar: "SearchBar",
|
|
11
|
+
EmbeddedChat: "EmbeddedChat",
|
|
12
|
+
EmbeddedSearch: "EmbeddedSearch",
|
|
13
|
+
EmbeddedSearchAndChat: "EmbeddedSearchAndChat",
|
|
14
|
+
SidebarChat: "SidebarChat"
|
|
15
|
+
}, a = {
|
|
16
|
+
prefix: "ikp",
|
|
17
|
+
// Default prefix
|
|
18
|
+
aiChatSettings: b,
|
|
19
|
+
baseSettings: p,
|
|
20
|
+
searchSettings: f,
|
|
21
|
+
componentType: I.EmbeddedChat
|
|
22
|
+
}, o = S(a), A = ({ children: t, value: n }) => {
|
|
23
|
+
const i = l(), s = (e, r, h) => ["baseSettings", "searchSettings", "aiChatSettings"].includes(h) && !r ? e : r, d = {
|
|
24
|
+
baseSettings: i ?? {}
|
|
25
|
+
}, c = m(() => {
|
|
26
|
+
const e = g(s, a, d, n ?? {});
|
|
27
|
+
return e.aiChatSettings?.baseUrl && (e.aiChatSettings.baseUrl = e.aiChatSettings.baseUrl.replace(/\/+$/, "")), e;
|
|
28
|
+
}, [n]);
|
|
29
|
+
return /* @__PURE__ */ C(o.Provider, { value: c, children: t });
|
|
30
|
+
}, T = () => {
|
|
31
|
+
const t = u(o);
|
|
32
|
+
if (!t)
|
|
33
|
+
throw new Error("useInkeepConfig must be used within a ConfigProvider");
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
A as InkeepConfigProvider,
|
|
38
|
+
I as WebWidgetInteractionType,
|
|
39
|
+
T as useInkeepConfig
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),t=require("react"),r=t.createContext(void 0),s=({children:e,name:o})=>{const c=t.useRef(null);return n.jsx(r.Provider,{value:{name:o,focusItem:c},children:e})},u=()=>{const e=t.useContext(r);if(!e)throw new Error("useFeedbackItem must be used within a FeedbackItemProvider");return e};exports.FeedbackItemProvider=s;exports.useFeedbackItem=u;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FeedbackItemType } from '../../types/index.ts';
|
|
2
|
+
export type FeedbackItemContextValue = {
|
|
3
|
+
name: FeedbackItemType;
|
|
4
|
+
focusItem: React.RefObject<HTMLElement | null>;
|
|
5
|
+
};
|
|
6
|
+
export declare const FeedbackItemProvider: React.FC<{
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
name: FeedbackItemType;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const useFeedbackItem: () => FeedbackItemContextValue;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as c, createContext as s, useContext as u } from "react";
|
|
4
|
+
const t = s(void 0), i = ({ children: e, name: o }) => {
|
|
5
|
+
const r = c(null);
|
|
6
|
+
return /* @__PURE__ */ n(t.Provider, { value: { name: o, focusItem: r }, children: e });
|
|
7
|
+
}, a = () => {
|
|
8
|
+
const e = u(t);
|
|
9
|
+
if (!e)
|
|
10
|
+
throw new Error("useFeedbackItem must be used within a FeedbackItemProvider");
|
|
11
|
+
return e;
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
i as FeedbackItemProvider,
|
|
15
|
+
a as useFeedbackItem
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),n=require("react"),g=require("../components/embedded-chat/chat-provider.cjs"),f=require("../utils/misc.cjs"),q=require("./config-provider.cjs"),x=require("./base-events-provider.cjs"),F=n.createContext(void 0);function M(){const{baseSettings:e}=q.useInkeepConfig(),[s,o]=n.useState(null),[k,p]=n.useState({}),{conversationId:u}=g.useChat(),{messages:a,selectedWorkflow:C}=g.useChat(),{analyticsProperties:P}=e,{logEvent:v}=x.useBaseEvents(),i=n.useCallback(async(t,c,r=[])=>{const d=await e.onFeedback?.({type:c,messageId:t,reasons:r,properties:P});d&&p(b=>({...b,[t]:{type:d.type,messageId:t,reasons:d.reasons}}));const l=a.findIndex(b=>b.id===t),w=a[l],y={conversationId:u,question:f.getMessageContent(a[l-1]),answer:f.getMessageContent(w),messageId:t,reasons:r,workflowId:C?.id};v({eventName:c==="positive"?"assistant_positive_feedback_submitted":"assistant_negative_feedback_submitted",properties:y}),c==="negative"&&v({eventName:"user_escalation_indicated",properties:{escalationType:"downvote",conversationId:u}})},[a,u]),m=n.useCallback(async t=>{i(t,"positive")},[i]),h=n.useCallback(async(t,c)=>{const r=j(c);i(t,"negative",r)},[i]);return{feedback:k,currentFeedback:s,setCurrentFeedback:o,submitPositiveFeedback:m,submitNegativeFeedback:h}}const S=({children:e})=>{const s=M();return _.jsx(F.Provider,{value:s,children:e})},E=()=>{const e=n.useContext(F);if(!e)throw new Error("useFeedback must be used within a FeedbackProvider");return e};function j(e){const s=[];for(const o in e)e[o]==="on"&&s.push({label:o,details:e[`${o}:description`]||""});return s.length>0?s:[]}exports.FeedbackProvider=S;exports.useMessageFeedback=E;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InkeepFeedback } from '../../types/index.ts';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
export type FeedbackContextValue = ReturnType<typeof useFeedback>;
|
|
4
|
+
export type MessageFeedbackItem = Record<string, InkeepFeedback>;
|
|
5
|
+
declare function useFeedback(): {
|
|
6
|
+
feedback: MessageFeedbackItem;
|
|
7
|
+
currentFeedback: string | null;
|
|
8
|
+
setCurrentFeedback: Dispatch<SetStateAction<string | null>>;
|
|
9
|
+
submitPositiveFeedback: (messageId: string) => Promise<void>;
|
|
10
|
+
submitNegativeFeedback: (messageId: string, reasonsData: Record<string, FormDataEntryValue>) => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export declare const FeedbackProvider: React.FC<{
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const useMessageFeedback: () => FeedbackContextValue;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as P } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as E, useContext as N, useState as v, useCallback as b } from "react";
|
|
4
|
+
import { useChat as m } from "../components/embedded-chat/chat-provider.js";
|
|
5
|
+
import { getMessageContent as l } from "../utils/misc.js";
|
|
6
|
+
import { useInkeepConfig as M } from "./config-provider.js";
|
|
7
|
+
import { useBaseEvents as S } from "./base-events-provider.js";
|
|
8
|
+
const F = E(void 0);
|
|
9
|
+
function j() {
|
|
10
|
+
const { baseSettings: e } = M(), [s, o] = v(null), [k, g] = v({}), { conversationId: a } = m(), { messages: c, selectedWorkflow: w } = m(), { analyticsProperties: C } = e, { logEvent: f } = S(), i = b(
|
|
11
|
+
async (t, n, r = []) => {
|
|
12
|
+
const d = await e.onFeedback?.({
|
|
13
|
+
type: n,
|
|
14
|
+
messageId: t,
|
|
15
|
+
reasons: r,
|
|
16
|
+
properties: C
|
|
17
|
+
});
|
|
18
|
+
d && g((u) => ({
|
|
19
|
+
...u,
|
|
20
|
+
[t]: { type: d.type, messageId: t, reasons: d.reasons }
|
|
21
|
+
}));
|
|
22
|
+
const p = c.findIndex((u) => u.id === t), x = c[p], y = {
|
|
23
|
+
conversationId: a,
|
|
24
|
+
question: l(c[p - 1]),
|
|
25
|
+
answer: l(x),
|
|
26
|
+
messageId: t,
|
|
27
|
+
reasons: r,
|
|
28
|
+
workflowId: w?.id
|
|
29
|
+
};
|
|
30
|
+
f({
|
|
31
|
+
eventName: n === "positive" ? "assistant_positive_feedback_submitted" : "assistant_negative_feedback_submitted",
|
|
32
|
+
properties: y
|
|
33
|
+
}), n === "negative" && f({
|
|
34
|
+
eventName: "user_escalation_indicated",
|
|
35
|
+
properties: {
|
|
36
|
+
escalationType: "downvote",
|
|
37
|
+
conversationId: a
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
[c, a]
|
|
42
|
+
), _ = b(
|
|
43
|
+
async (t) => {
|
|
44
|
+
i(t, "positive");
|
|
45
|
+
},
|
|
46
|
+
[i]
|
|
47
|
+
), h = b(
|
|
48
|
+
async (t, n) => {
|
|
49
|
+
const r = q(n);
|
|
50
|
+
i(t, "negative", r);
|
|
51
|
+
},
|
|
52
|
+
[i]
|
|
53
|
+
);
|
|
54
|
+
return {
|
|
55
|
+
feedback: k,
|
|
56
|
+
currentFeedback: s,
|
|
57
|
+
setCurrentFeedback: o,
|
|
58
|
+
submitPositiveFeedback: _,
|
|
59
|
+
submitNegativeFeedback: h
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const z = ({ children: e }) => {
|
|
63
|
+
const s = j();
|
|
64
|
+
return /* @__PURE__ */ P(F.Provider, { value: s, children: e });
|
|
65
|
+
}, A = () => {
|
|
66
|
+
const e = N(F);
|
|
67
|
+
if (!e)
|
|
68
|
+
throw new Error("useFeedback must be used within a FeedbackProvider");
|
|
69
|
+
return e;
|
|
70
|
+
};
|
|
71
|
+
function q(e) {
|
|
72
|
+
const s = [];
|
|
73
|
+
for (const o in e)
|
|
74
|
+
e[o] === "on" && s.push({
|
|
75
|
+
label: o,
|
|
76
|
+
details: e[`${o}:description`] || ""
|
|
77
|
+
});
|
|
78
|
+
return s.length > 0 ? s : [];
|
|
79
|
+
}
|
|
80
|
+
export {
|
|
81
|
+
z as FeedbackProvider,
|
|
82
|
+
A as useMessageFeedback
|
|
83
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),o=require("react"),F=require("./chat-form-provider.cjs"),t=o.createContext(void 0),d=({children:e,field:r,fieldProps:i,autoFocus:n})=>{const{errors:s}=F.useChatForm(),u=s[r.name];return c.jsx(t.Provider,{value:{field:r,fieldProps:i,error:u,autoFocus:n},children:e})},m=()=>{const e=o.useContext(t);if(!e)throw new Error("useFormField must be used within a FormFieldProvider");return e};exports.FormFieldProvider=d;exports.useFormField=m;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FormField } from '../../types/index.ts';
|
|
2
|
+
import { ControllerRenderProps, FieldErrors } from 'react-hook-form';
|
|
3
|
+
interface FormFieldCtx {
|
|
4
|
+
field: FormField;
|
|
5
|
+
fieldProps: ControllerRenderProps<Record<string, any>, string>;
|
|
6
|
+
autoFocus?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface FormFieldContextValue extends FormFieldCtx {
|
|
9
|
+
error: FieldErrors<Record<string, any>>[number];
|
|
10
|
+
}
|
|
11
|
+
export declare const FormFieldProvider: React.FC<{
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
} & FormFieldCtx>;
|
|
14
|
+
export declare const useFormField: () => FormFieldContextValue;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as F, useContext as u } from "react";
|
|
4
|
+
import { useChatForm as c } from "./chat-form-provider.js";
|
|
5
|
+
const e = F(void 0), a = ({ children: r, field: o, fieldProps: t, autoFocus: n }) => {
|
|
6
|
+
const { errors: i } = c(), s = i[o.name];
|
|
7
|
+
return /* @__PURE__ */ m(e.Provider, { value: { field: o, fieldProps: t, error: s, autoFocus: n }, children: r });
|
|
8
|
+
}, v = () => {
|
|
9
|
+
const r = u(e);
|
|
10
|
+
if (!r)
|
|
11
|
+
throw new Error("useFormField must be used within a FormFieldProvider");
|
|
12
|
+
return r;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
a as FormFieldProvider,
|
|
16
|
+
v as useFormField
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),u=n.createContext(void 0);function o(){const[e,t]=n.useState(!1);return{open:e,setOpen:t}}const s=({children:e,value:t})=>r.jsx(u.Provider,{value:t,children:e}),i=()=>{const e=n.useContext(u);if(!e)throw new Error("useHelpMenu must be used within a HelpMenuProvider");return e};exports.HelpMenuProvider=s;exports.useHelpMenu=i;exports.useHelpMenuState=o;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
export type HelpMenuContextValue = ReturnType<typeof useHelpMenuState>;
|
|
3
|
+
export declare function useHelpMenuState(): {
|
|
4
|
+
open: boolean;
|
|
5
|
+
setOpen: Dispatch<SetStateAction<boolean>>;
|
|
6
|
+
};
|
|
7
|
+
export declare const HelpMenuProvider: React.FC<{
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
value: HelpMenuContextValue;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const useHelpMenu: () => HelpMenuContextValue;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { useState as r, createContext as u, useContext as s } from "react";
|
|
4
|
+
const n = u(void 0);
|
|
5
|
+
function c() {
|
|
6
|
+
const [e, t] = r(!1);
|
|
7
|
+
return { open: e, setOpen: t };
|
|
8
|
+
}
|
|
9
|
+
const l = ({ children: e, value: t }) => /* @__PURE__ */ o(n.Provider, { value: t, children: e }), x = () => {
|
|
10
|
+
const e = s(n);
|
|
11
|
+
if (!e)
|
|
12
|
+
throw new Error("useHelpMenu must be used within a HelpMenuProvider");
|
|
13
|
+
return e;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
l as HelpMenuProvider,
|
|
17
|
+
x as useHelpMenu,
|
|
18
|
+
c as useHelpMenuState
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),o=require("react"),r=o.createContext(void 0),s=({children:e,open:t,setOpen:v})=>n.jsx(r.Provider,{value:{open:t,setOpen:v},children:e}),u=()=>{const e=o.useContext(r);if(!e)throw new Error("useHoverPopover must be used within a HoverPopoverProvider");return e};exports.HoverPopoverProvider=s;exports.useHoverPopover=u;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type HoverPopoverContextValue = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
setOpen: (open: boolean) => void;
|
|
4
|
+
};
|
|
5
|
+
export declare const HoverPopoverProvider: React.FC<{
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
open: boolean;
|
|
8
|
+
setOpen: (open: boolean) => void;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const useHoverPopover: () => HoverPopoverContextValue;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as n, useContext as s } from "react";
|
|
4
|
+
const e = n(void 0), p = ({ children: o, open: r, setOpen: t }) => /* @__PURE__ */ v(e.Provider, { value: { open: r, setOpen: t }, children: o }), P = () => {
|
|
5
|
+
const o = s(e);
|
|
6
|
+
if (!o)
|
|
7
|
+
throw new Error("useHoverPopover must be used within a HoverPopoverProvider");
|
|
8
|
+
return o;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
p as HoverPopoverProvider,
|
|
12
|
+
P as useHoverPopover
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./attachment-item-provider.cjs"),d=require("./attachments-bar-provider.cjs"),u=require("./base-events-provider.cjs"),t=require("./chat-form-provider.cjs"),n=require("./chat-history-provider.cjs"),o=require("./config-provider.cjs"),v=require("./feedback-item-provider.cjs"),P=require("./feedback-provider.cjs"),c=require("./form-field-provider.cjs"),s=require("./help-menu-provider.cjs"),h=require("./markdown-provider.cjs"),m=require("./message-attachments-provider.cjs"),i=require("./message-provider.cjs"),l=require("./root-provider.cjs"),b=require("./source-item-provider.cjs"),g=require("./theme-provider.cjs"),C=require("./widget-provider.cjs"),e=require("./sidebar-chat-provider.cjs"),r=require("./chat-bubble-provider.cjs");exports.AttachmentItemProvider=a.AttachmentItemProvider;exports.useAttachmentItem=a.useAttachmentItem;exports.AttachmentsBarProvider=d.AttachmentsBarProvider;exports.useAttachmentsBar=d.useAttachmentsBar;exports.BaseEventsProvider=u.BaseEventsProvider;exports.useBaseEvents=u.useBaseEvents;exports.ChatFormProvider=t.ChatFormProvider;exports.useChatForm=t.useChatForm;exports.useChatFormState=t.useChatFormState;exports.ChatHistoryProvider=n.ChatHistoryProvider;exports.useChatHistory=n.useChatHistory;exports.InkeepConfigProvider=o.InkeepConfigProvider;exports.WebWidgetInteractionType=o.WebWidgetInteractionType;exports.useInkeepConfig=o.useInkeepConfig;exports.FeedbackItemProvider=v.FeedbackItemProvider;exports.useFeedbackItem=v.useFeedbackItem;exports.FeedbackProvider=P.FeedbackProvider;exports.useMessageFeedback=P.useMessageFeedback;exports.FormFieldProvider=c.FormFieldProvider;exports.useFormField=c.useFormField;exports.HelpMenuProvider=s.HelpMenuProvider;exports.useHelpMenu=s.useHelpMenu;exports.useHelpMenuState=s.useHelpMenuState;exports.ChatMarkdownProvider=h.ChatMarkdownProvider;exports.useChatMarkdown=h.useChatMarkdown;exports.MessageAttachmentsProvider=m.MessageAttachmentsProvider;exports.useMessageAttachments=m.useMessageAttachments;exports.MessageProvider=i.MessageProvider;exports.useMessage=i.useMessage;exports.useOptionalMessage=i.useOptionalMessage;exports.RootProvider=l.RootProvider;exports.SourceItemProvider=b.SourceItemProvider;exports.useSourceItem=b.useSourceItem;exports.ThemeProvider=g.ThemeProvider;exports.WidgetProvider=C.WidgetProvider;exports.useWidget=C.useWidget;exports.SidebarChatProvider=e.SidebarChatProvider;exports.useInkeepSidebarChat=e.useInkeepSidebarChat;exports.useOptionalSidebarChat=e.useOptionalSidebarChat;exports.useSidebarChat=e.useSidebarChat;exports.ChatBubbleProvider=r.ChatBubbleProvider;exports.useChatBubble=r.useChatBubble;exports.useInkeepChatBubble=r.useInkeepChatBubble;exports.useOptionalChatBubble=r.useOptionalChatBubble;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from './attachment-item-provider';
|
|
2
|
+
export * from './attachments-bar-provider';
|
|
3
|
+
export * from './base-events-provider';
|
|
4
|
+
export * from './chat-form-provider';
|
|
5
|
+
export * from './chat-history-provider';
|
|
6
|
+
export * from './config-provider';
|
|
7
|
+
export * from './feedback-item-provider';
|
|
8
|
+
export * from './feedback-provider';
|
|
9
|
+
export * from './form-field-provider';
|
|
10
|
+
export * from './help-menu-provider';
|
|
11
|
+
export * from './markdown-provider';
|
|
12
|
+
export * from './message-attachments-provider';
|
|
13
|
+
export * from './message-provider';
|
|
14
|
+
export * from './root-provider';
|
|
15
|
+
export * from './source-item-provider';
|
|
16
|
+
export * from './theme-provider';
|
|
17
|
+
export * from './widget-provider';
|
|
18
|
+
export * from './sidebar-chat-provider';
|
|
19
|
+
export * from './chat-bubble-provider';
|