@inkeep/agents-ui 0.0.0-rc-20260310051343
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 +64 -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 +51 -0
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +275 -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 +9 -0
- package/dist/primitives/hooks/use-anonymous-session.js +45 -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 +12 -0
- package/dist/primitives/hooks/use-conversation-loader.js +41 -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-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 +30 -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 +37 -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 +428 -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 +26 -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 +4565 -0
- package/dist/styled/inkeep.css.js +4569 -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,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef as c, useCallback as o } from "react";
|
|
3
|
+
import { useShadow as u } from "../atoms/shadow/context.js";
|
|
4
|
+
function v() {
|
|
5
|
+
const e = u()?.shadowHost, n = c(""), s = o((t) => {
|
|
6
|
+
n.current = t;
|
|
7
|
+
}, []), r = o(
|
|
8
|
+
(t, a) => {
|
|
9
|
+
if (!e) {
|
|
10
|
+
console.warn("useStreamingEvents: No host element available for parent event emission");
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const i = new CustomEvent(`ikp-${t}`, {
|
|
14
|
+
detail: {
|
|
15
|
+
...a,
|
|
16
|
+
conversationId: n.current,
|
|
17
|
+
timestamp: Date.now()
|
|
18
|
+
},
|
|
19
|
+
bubbles: !0,
|
|
20
|
+
composed: !0
|
|
21
|
+
});
|
|
22
|
+
e.dispatchEvent(i);
|
|
23
|
+
},
|
|
24
|
+
[e]
|
|
25
|
+
);
|
|
26
|
+
return {
|
|
27
|
+
setConversationId: s,
|
|
28
|
+
emitToParent: r
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
v as useStreamingEvents
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./providers/attachment-item-provider.cjs"),C=require("./providers/attachments-bar-provider.cjs"),h=require("./providers/base-events-provider.cjs"),n=require("./providers/chat-form-provider.cjs"),l=require("./providers/chat-history-provider.cjs"),i=require("./providers/config-provider.cjs"),p=require("./providers/feedback-item-provider.cjs"),v=require("./providers/feedback-provider.cjs"),P=require("./providers/form-field-provider.cjs"),d=require("./providers/help-menu-provider.cjs"),I=require("./providers/markdown-provider.cjs"),S=require("./providers/message-attachments-provider.cjs"),u=require("./providers/message-provider.cjs"),y=require("./providers/root-provider.cjs"),b=require("./providers/source-item-provider.cjs"),F=require("./providers/theme-provider.cjs"),q=require("./providers/widget-provider.cjs"),t=require("./providers/sidebar-chat-provider.cjs"),s=require("./providers/chat-bubble-provider.cjs"),g=require("./components/factory.cjs"),A=require("./components/embedded-chat.cjs"),f=require("./components/sidebar-chat/index.cjs"),M=require("./components/embedded-chat/chat-provider.cjs"),R=require("./components/embedded-search.cjs"),m=require("./components/embedded-search/search-provider.cjs"),w=require("./components/modal.cjs"),B=require("./components/modal/modal-provider.cjs"),H=require("./components/chat-button.cjs"),O=require("./components/searchbar.cjs"),E=require("./components/chat-bubble/index.cjs"),T=require("./components/data-summaries.cjs"),W=require("./components/chat-history/index.cjs"),x=require("./hooks/use-boolean.cjs"),D=require("./hooks/use-component-classnames.cjs"),z=require("./hooks/use-container-size.cjs"),L=require("./hooks/use-inkeep-open-state.cjs"),j=require("./hooks/use-copy-to-clipboard.cjs"),Q=require("./hooks/use-instant-update.cjs"),U=require("./hooks/use-is-mounted.cjs"),$=require("./hooks/use-media-query.cjs"),K=require("./hooks/use-resize-observer.cjs"),N=require("./hooks/use-scrolling-fades.cjs"),G=require("./hooks/use-settle-action.cjs"),J=require("./hooks/use-simple-scroll.cjs"),o=require("./utils/misc.cjs"),e=require("./utils/component-ids.cjs"),k=require("./utils/compose-refs.cjs"),V=require("./utils/merge-props.cjs"),X=require("./atoms/portal.cjs"),Y=require("./atoms/icons/custom-icon.cjs"),Z=require("./atoms/icons/built-in-icon-renderer.cjs"),_=require("./atoms/portal-with-theme.cjs"),r=require("./atoms/cmdk/index.cjs"),ee=require("./atoms/error-boundary.cjs"),a=require("./atoms/shadow/context.cjs");exports.AttachmentItemProvider=c.AttachmentItemProvider;exports.useAttachmentItem=c.useAttachmentItem;exports.AttachmentsBarProvider=C.AttachmentsBarProvider;exports.useAttachmentsBar=C.useAttachmentsBar;exports.BaseEventsProvider=h.BaseEventsProvider;exports.useBaseEvents=h.useBaseEvents;exports.ChatFormProvider=n.ChatFormProvider;exports.useChatForm=n.useChatForm;exports.useChatFormState=n.useChatFormState;exports.ChatHistoryProvider=l.ChatHistoryProvider;exports.useChatHistory=l.useChatHistory;exports.InkeepConfigProvider=i.InkeepConfigProvider;exports.WebWidgetInteractionType=i.WebWidgetInteractionType;exports.useInkeepConfig=i.useInkeepConfig;exports.FeedbackItemProvider=p.FeedbackItemProvider;exports.useFeedbackItem=p.useFeedbackItem;exports.FeedbackProvider=v.FeedbackProvider;exports.useMessageFeedback=v.useMessageFeedback;exports.FormFieldProvider=P.FormFieldProvider;exports.useFormField=P.useFormField;exports.HelpMenuProvider=d.HelpMenuProvider;exports.useHelpMenu=d.useHelpMenu;exports.useHelpMenuState=d.useHelpMenuState;exports.ChatMarkdownProvider=I.ChatMarkdownProvider;exports.useChatMarkdown=I.useChatMarkdown;exports.MessageAttachmentsProvider=S.MessageAttachmentsProvider;exports.useMessageAttachments=S.useMessageAttachments;exports.MessageProvider=u.MessageProvider;exports.useMessage=u.useMessage;exports.useOptionalMessage=u.useOptionalMessage;exports.RootProvider=y.RootProvider;exports.SourceItemProvider=b.SourceItemProvider;exports.useSourceItem=b.useSourceItem;exports.ThemeProvider=F.ThemeProvider;exports.WidgetProvider=q.WidgetProvider;exports.useWidget=q.useWidget;exports.SidebarChatProvider=t.SidebarChatProvider;exports.useInkeepSidebarChat=t.useInkeepSidebarChat;exports.useOptionalSidebarChat=t.useOptionalSidebarChat;exports.useSidebarChat=t.useSidebarChat;exports.ChatBubbleProvider=s.ChatBubbleProvider;exports.useChatBubble=s.useChatBubble;exports.useInkeepChatBubble=s.useInkeepChatBubble;exports.useOptionalChatBubble=s.useOptionalChatBubble;exports.ikp=g.ikp;exports.jsxFactory=g.jsxFactory;exports.EmbeddedChatPrimitive=A;exports.SidebarChatPrimitive=f;exports.ChatProvider=M.ChatProvider;exports.useChat=M.useChat;exports.EmbeddedSearchPrimitive=R;exports.SearchProvider=m.SearchProvider;exports.SearchProviderImpl=m.SearchProviderImpl;exports.useSearch=m.useSearch;exports.ModalPrimitive=w;exports.ModalProvider=B.ModalProvider;exports.useModal=B.useModal;exports.ChatButtonPrimitive=H;exports.SearchBarPrimitive=O;exports.ChatBubblePrimitive=E;exports.DataSummaryPrimitive=T;exports.ChatHistoryPrimitive=W;exports.useBoolean=x.useBoolean;exports.useComponentClassNames=D.useComponentClassNames;exports.useContainerSize=z.useContainerSize;exports.useInkeepOpenState=L.useInkeepOpenState;exports.useCopyToClipboard=j.useCopyToClipboard;exports.useInstantUpdate=Q.useInstantUpdate;exports.useIsMounted=U.useIsMounted;exports.useMediaQuery=$.useMediaQuery;exports.useResizeObserver=K.useResizeObserver;exports.useScrollingFades=N.useScrollingFades;exports.useSettleAction=G.useSettleAction;exports.useSimpleScroll=J.useSimpleScroll;exports.callAll=o.callAll;exports.dataAttr=o.dataAttr;exports.getInitials=o.getInitials;exports.getMessageContent=o.getMessageContent;exports.isString=o.isString;exports.maybeRender=o.maybeRender;exports.toKebabCase=o.toKebabCase;exports.ChatBubbleComponentIds=e.ChatBubbleComponentIds;exports.DataSummaryComponentIds=e.DataSummaryComponentIds;exports.SearchBarComponentIds=e.SearchBarComponentIds;exports.SidebarChatComponentIds=e.SidebarChatComponentIds;exports.aiChatComponentIds=e.aiChatComponentIds;exports.aiChatHistoryComponentIds=e.aiChatHistoryComponentIds;exports.aiSearchComponentIds=e.aiSearchComponentIds;exports.chatButtonComponentIds=e.chatButtonComponentIds;exports.componentIDs=e.componentIDs;exports.markDownComponentIds=e.markDownComponentIds;exports.miscellanousComponentIds=e.miscellanousComponentIds;exports.modalComponentIds=e.modalComponentIds;exports.composeRefs=k.composeRefs;exports.useComposedRefs=k.useComposedRefs;exports.mergeProps=V.mergeProps;exports.Portal=X.Portal;exports.CustomIcon=Y.CustomIcon;exports.BuiltInIconRenderer=Z.BuiltInIconRenderer;exports.PortalWithTheme=_.PortalWithTheme;exports.Command=r.Command;exports.CommandDialog=r.CommandDialog;exports.CommandEmpty=r.CommandEmpty;exports.CommandInput=r.CommandInput;exports.CommandItem=r.CommandItem;exports.CommandList=r.CommandList;exports.CommandLoading=r.CommandLoading;exports.CommandRoot=r.CommandRoot;exports.CommandSeparator=r.CommandSeparator;exports.defaultFilter=r.defaultFilter;exports.useCommandState=r.useCommandState;exports.useCommandStore=r.useCommandStore;exports.ErrorBoundary=ee.ErrorBoundary;exports.InkeepShadow=a.InkeepShadow;exports.InkeepShadowProvider=a.InkeepShadowProvider;exports.ShadowContext=a.ShadowContext;exports.useShadow=a.useShadow;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './providers';
|
|
2
|
+
export * from './components';
|
|
3
|
+
export * from './hooks';
|
|
4
|
+
export * from './utils/misc';
|
|
5
|
+
export * from './utils/component-ids';
|
|
6
|
+
export * from './utils/compose-refs';
|
|
7
|
+
export * from './utils/merge-props';
|
|
8
|
+
export * from './atoms/shadow';
|
|
9
|
+
export * from './atoms/portal';
|
|
10
|
+
export * from './atoms/icons';
|
|
11
|
+
export * from './atoms/portal-with-theme';
|
|
12
|
+
export * from './atoms/cmdk';
|
|
13
|
+
export * from './atoms/error-boundary';
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { AttachmentItemProvider as u, useAttachmentItem as C } from "./providers/attachment-item-provider.js";
|
|
2
|
+
import { AttachmentsBarProvider as x, useAttachmentsBar as h } from "./providers/attachments-bar-provider.js";
|
|
3
|
+
import { BaseEventsProvider as v, useBaseEvents as P } from "./providers/base-events-provider.js";
|
|
4
|
+
import { ChatFormProvider as S, useChatForm as c, useChatFormState as b } from "./providers/chat-form-provider.js";
|
|
5
|
+
import { ChatHistoryProvider as B, useChatHistory as M } from "./providers/chat-history-provider.js";
|
|
6
|
+
import { InkeepConfigProvider as F, WebWidgetInteractionType as y, useInkeepConfig as A } from "./providers/config-provider.js";
|
|
7
|
+
import { FeedbackItemProvider as H, useFeedbackItem as R } from "./providers/feedback-item-provider.js";
|
|
8
|
+
import { FeedbackProvider as D, useMessageFeedback as O } from "./providers/feedback-provider.js";
|
|
9
|
+
import { FormFieldProvider as T, useFormField as z } from "./providers/form-field-provider.js";
|
|
10
|
+
import { HelpMenuProvider as $, useHelpMenu as j, useHelpMenuState as K } from "./providers/help-menu-provider.js";
|
|
11
|
+
import { ChatMarkdownProvider as Q, useChatMarkdown as U } from "./providers/markdown-provider.js";
|
|
12
|
+
import { MessageAttachmentsProvider as G, useMessageAttachments as J } from "./providers/message-attachments-provider.js";
|
|
13
|
+
import { MessageProvider as X, useMessage as Y, useOptionalMessage as Z } from "./providers/message-provider.js";
|
|
14
|
+
import { RootProvider as ee } from "./providers/root-provider.js";
|
|
15
|
+
import { SourceItemProvider as re, useSourceItem as te } from "./providers/source-item-provider.js";
|
|
16
|
+
import { ThemeProvider as me } from "./providers/theme-provider.js";
|
|
17
|
+
import { WidgetProvider as ie, useWidget as pe } from "./providers/widget-provider.js";
|
|
18
|
+
import { SidebarChatProvider as ne, useInkeepSidebarChat as ue, useOptionalSidebarChat as Ce, useSidebarChat as fe } from "./providers/sidebar-chat-provider.js";
|
|
19
|
+
import { ChatBubbleProvider as he, useChatBubble as le, useInkeepChatBubble as ve, useOptionalChatBubble as Pe } from "./providers/chat-bubble-provider.js";
|
|
20
|
+
import { ikp as Se, jsxFactory as ce } from "./components/factory.js";
|
|
21
|
+
import * as e from "./components/embedded-chat.js";
|
|
22
|
+
import * as o from "./components/sidebar-chat/index.js";
|
|
23
|
+
import { ChatProvider as ge, useChat as Be } from "./components/embedded-chat/chat-provider.js";
|
|
24
|
+
import * as r from "./components/embedded-search.js";
|
|
25
|
+
import { SearchProvider as ke, SearchProviderImpl as Fe, useSearch as ye } from "./components/embedded-search/search-provider.js";
|
|
26
|
+
import * as t from "./components/modal.js";
|
|
27
|
+
import { ModalProvider as we, useModal as He } from "./components/modal/modal-provider.js";
|
|
28
|
+
import * as a from "./components/chat-button.js";
|
|
29
|
+
import * as m from "./components/searchbar.js";
|
|
30
|
+
import * as s from "./components/chat-bubble/index.js";
|
|
31
|
+
import * as i from "./components/data-summaries.js";
|
|
32
|
+
import * as p from "./components/chat-history/index.js";
|
|
33
|
+
import { useBoolean as Ee } from "./hooks/use-boolean.js";
|
|
34
|
+
import { useComponentClassNames as Oe } from "./hooks/use-component-classnames.js";
|
|
35
|
+
import { useContainerSize as Te } from "./hooks/use-container-size.js";
|
|
36
|
+
import { useInkeepOpenState as Le } from "./hooks/use-inkeep-open-state.js";
|
|
37
|
+
import { useCopyToClipboard as je } from "./hooks/use-copy-to-clipboard.js";
|
|
38
|
+
import { useInstantUpdate as Ne } from "./hooks/use-instant-update.js";
|
|
39
|
+
import { useIsMounted as Ue } from "./hooks/use-is-mounted.js";
|
|
40
|
+
import { useMediaQuery as Ge } from "./hooks/use-media-query.js";
|
|
41
|
+
import { useResizeObserver as Ve } from "./hooks/use-resize-observer.js";
|
|
42
|
+
import { useScrollingFades as Ye } from "./hooks/use-scrolling-fades.js";
|
|
43
|
+
import { useSettleAction as _e } from "./hooks/use-settle-action.js";
|
|
44
|
+
import { useSimpleScroll as oo } from "./hooks/use-simple-scroll.js";
|
|
45
|
+
import { callAll as to, dataAttr as ao, getInitials as mo, getMessageContent as so, isString as io, maybeRender as po, toKebabCase as no } from "./utils/misc.js";
|
|
46
|
+
import { ChatBubbleComponentIds as Co, DataSummaryComponentIds as fo, SearchBarComponentIds as xo, SidebarChatComponentIds as ho, aiChatComponentIds as lo, aiChatHistoryComponentIds as vo, aiSearchComponentIds as Po, chatButtonComponentIds as Io, componentIDs as So, markDownComponentIds as co, miscellanousComponentIds as bo, modalComponentIds as go } from "./utils/component-ids.js";
|
|
47
|
+
import { composeRefs as Mo, useComposedRefs as ko } from "./utils/compose-refs.js";
|
|
48
|
+
import { mergeProps as yo } from "./utils/merge-props.js";
|
|
49
|
+
import { Portal as wo } from "./atoms/portal.js";
|
|
50
|
+
import { CustomIcon as Ro } from "./atoms/icons/custom-icon.js";
|
|
51
|
+
import { BuiltInIconRenderer as Do } from "./atoms/icons/built-in-icon-renderer.js";
|
|
52
|
+
import { PortalWithTheme as Wo } from "./atoms/portal-with-theme.js";
|
|
53
|
+
import { Command as zo, CommandDialog as Lo, CommandEmpty as $o, CommandInput as jo, CommandItem as Ko, CommandList as No, CommandLoading as Qo, CommandRoot as Uo, CommandSeparator as qo, defaultFilter as Go, useCommandState as Jo, useCommandStore as Vo } from "./atoms/cmdk/index.js";
|
|
54
|
+
import { ErrorBoundary as Yo } from "./atoms/error-boundary.js";
|
|
55
|
+
import { InkeepShadow as _o, InkeepShadowProvider as er, ShadowContext as or, useShadow as rr } from "./atoms/shadow/context.js";
|
|
56
|
+
export {
|
|
57
|
+
u as AttachmentItemProvider,
|
|
58
|
+
x as AttachmentsBarProvider,
|
|
59
|
+
v as BaseEventsProvider,
|
|
60
|
+
Do as BuiltInIconRenderer,
|
|
61
|
+
Co as ChatBubbleComponentIds,
|
|
62
|
+
s as ChatBubblePrimitive,
|
|
63
|
+
he as ChatBubbleProvider,
|
|
64
|
+
a as ChatButtonPrimitive,
|
|
65
|
+
S as ChatFormProvider,
|
|
66
|
+
p as ChatHistoryPrimitive,
|
|
67
|
+
B as ChatHistoryProvider,
|
|
68
|
+
Q as ChatMarkdownProvider,
|
|
69
|
+
ge as ChatProvider,
|
|
70
|
+
zo as Command,
|
|
71
|
+
Lo as CommandDialog,
|
|
72
|
+
$o as CommandEmpty,
|
|
73
|
+
jo as CommandInput,
|
|
74
|
+
Ko as CommandItem,
|
|
75
|
+
No as CommandList,
|
|
76
|
+
Qo as CommandLoading,
|
|
77
|
+
Uo as CommandRoot,
|
|
78
|
+
qo as CommandSeparator,
|
|
79
|
+
Ro as CustomIcon,
|
|
80
|
+
fo as DataSummaryComponentIds,
|
|
81
|
+
i as DataSummaryPrimitive,
|
|
82
|
+
e as EmbeddedChatPrimitive,
|
|
83
|
+
r as EmbeddedSearchPrimitive,
|
|
84
|
+
Yo as ErrorBoundary,
|
|
85
|
+
H as FeedbackItemProvider,
|
|
86
|
+
D as FeedbackProvider,
|
|
87
|
+
T as FormFieldProvider,
|
|
88
|
+
$ as HelpMenuProvider,
|
|
89
|
+
F as InkeepConfigProvider,
|
|
90
|
+
_o as InkeepShadow,
|
|
91
|
+
er as InkeepShadowProvider,
|
|
92
|
+
G as MessageAttachmentsProvider,
|
|
93
|
+
X as MessageProvider,
|
|
94
|
+
t as ModalPrimitive,
|
|
95
|
+
we as ModalProvider,
|
|
96
|
+
wo as Portal,
|
|
97
|
+
Wo as PortalWithTheme,
|
|
98
|
+
ee as RootProvider,
|
|
99
|
+
xo as SearchBarComponentIds,
|
|
100
|
+
m as SearchBarPrimitive,
|
|
101
|
+
ke as SearchProvider,
|
|
102
|
+
Fe as SearchProviderImpl,
|
|
103
|
+
or as ShadowContext,
|
|
104
|
+
ho as SidebarChatComponentIds,
|
|
105
|
+
o as SidebarChatPrimitive,
|
|
106
|
+
ne as SidebarChatProvider,
|
|
107
|
+
re as SourceItemProvider,
|
|
108
|
+
me as ThemeProvider,
|
|
109
|
+
y as WebWidgetInteractionType,
|
|
110
|
+
ie as WidgetProvider,
|
|
111
|
+
lo as aiChatComponentIds,
|
|
112
|
+
vo as aiChatHistoryComponentIds,
|
|
113
|
+
Po as aiSearchComponentIds,
|
|
114
|
+
to as callAll,
|
|
115
|
+
Io as chatButtonComponentIds,
|
|
116
|
+
So as componentIDs,
|
|
117
|
+
Mo as composeRefs,
|
|
118
|
+
ao as dataAttr,
|
|
119
|
+
Go as defaultFilter,
|
|
120
|
+
mo as getInitials,
|
|
121
|
+
so as getMessageContent,
|
|
122
|
+
Se as ikp,
|
|
123
|
+
io as isString,
|
|
124
|
+
ce as jsxFactory,
|
|
125
|
+
co as markDownComponentIds,
|
|
126
|
+
po as maybeRender,
|
|
127
|
+
yo as mergeProps,
|
|
128
|
+
bo as miscellanousComponentIds,
|
|
129
|
+
go as modalComponentIds,
|
|
130
|
+
no as toKebabCase,
|
|
131
|
+
C as useAttachmentItem,
|
|
132
|
+
h as useAttachmentsBar,
|
|
133
|
+
P as useBaseEvents,
|
|
134
|
+
Ee as useBoolean,
|
|
135
|
+
Be as useChat,
|
|
136
|
+
le as useChatBubble,
|
|
137
|
+
c as useChatForm,
|
|
138
|
+
b as useChatFormState,
|
|
139
|
+
M as useChatHistory,
|
|
140
|
+
U as useChatMarkdown,
|
|
141
|
+
Jo as useCommandState,
|
|
142
|
+
Vo as useCommandStore,
|
|
143
|
+
Oe as useComponentClassNames,
|
|
144
|
+
ko as useComposedRefs,
|
|
145
|
+
Te as useContainerSize,
|
|
146
|
+
je as useCopyToClipboard,
|
|
147
|
+
R as useFeedbackItem,
|
|
148
|
+
z as useFormField,
|
|
149
|
+
j as useHelpMenu,
|
|
150
|
+
K as useHelpMenuState,
|
|
151
|
+
ve as useInkeepChatBubble,
|
|
152
|
+
A as useInkeepConfig,
|
|
153
|
+
Le as useInkeepOpenState,
|
|
154
|
+
ue as useInkeepSidebarChat,
|
|
155
|
+
Ne as useInstantUpdate,
|
|
156
|
+
Ue as useIsMounted,
|
|
157
|
+
Ge as useMediaQuery,
|
|
158
|
+
Y as useMessage,
|
|
159
|
+
J as useMessageAttachments,
|
|
160
|
+
O as useMessageFeedback,
|
|
161
|
+
He as useModal,
|
|
162
|
+
Pe as useOptionalChatBubble,
|
|
163
|
+
Z as useOptionalMessage,
|
|
164
|
+
Ce as useOptionalSidebarChat,
|
|
165
|
+
Ve as useResizeObserver,
|
|
166
|
+
Ye as useScrollingFades,
|
|
167
|
+
ye as useSearch,
|
|
168
|
+
_e as useSettleAction,
|
|
169
|
+
rr as useShadow,
|
|
170
|
+
fe as useSidebarChat,
|
|
171
|
+
oo as useSimpleScroll,
|
|
172
|
+
te as useSourceItem,
|
|
173
|
+
pe as useWidget
|
|
174
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),e=require("react"),n=e.createContext(void 0),c=({children:t,attachment:r})=>o.jsx(n.Provider,{value:{attachment:r},children:t}),m=()=>{const t=e.useContext(n);if(!t)throw new Error("useAttachmentItem must be used within a AttachmentItemProvider");return t};exports.AttachmentItemProvider=c;exports.useAttachmentItem=m;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MessageAttachment } from '../../types/index.ts';
|
|
2
|
+
export type AttachmentItemContextValue = {
|
|
3
|
+
attachment: MessageAttachment;
|
|
4
|
+
};
|
|
5
|
+
export declare const AttachmentItemProvider: React.FC<{
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
attachment: MessageAttachment;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const useAttachmentItem: () => AttachmentItemContextValue;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as n, useContext as m } from "react";
|
|
4
|
+
const e = n(void 0), i = ({ children: t, attachment: r }) => /* @__PURE__ */ o(e.Provider, { value: { attachment: r }, children: t }), u = () => {
|
|
5
|
+
const t = m(e);
|
|
6
|
+
if (!t)
|
|
7
|
+
throw new Error("useAttachmentItem must be used within a AttachmentItemProvider");
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
i as AttachmentItemProvider,
|
|
12
|
+
u as useAttachmentItem
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("react/jsx-runtime"),n=require("react"),b=require("../hooks/use-boolean.cjs"),d=n.createContext(void 0);function B(){const[t,s]=n.useState(null),{value:m,setTrue:v,setFalse:c}=b.useBoolean(!1),[a,u]=n.useState({title:"",content:""}),[f,l]=n.useState({title:void 0,content:void 0}),o={data:a,errors:f,labels:{title:t?.workflowModalProps?.titleInputLabel||"Title",content:t?.contentType.contentInputLabel||"Content"},validate(){const e={};return a.title.trim()||(e.title=`${o.labels.title} is required`),a.content.trim()||(e.content=`${o.labels.content} is required`),e},onChange(e){const{name:r,value:i}=e.target;u(h=>({...h,[r]:i}))},onSubmit(e){if(e.preventDefault(),!t?.contentType)return;const r=o.validate();if(Object.values(r).some(i=>!!i)){l(r);return}c(),u({title:"",content:""}),l({title:void 0,content:void 0})}};return{selectedInput:t,selectInput:s,isOpen:m,onOpen:v,onClose:c,form:o}}function A({children:t}){const s=B();return p.jsx(d.Provider,{value:s,children:t})}const w=()=>{const t=n.useContext(d);if(!t)throw new Error("useAttachmentsBar must be used within a AttachmentsBarProvider");return t};exports.AttachmentsBarProvider=A;exports.useAttachmentsBar=w;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { WorkflowModalSingleInput } from '../../types/index.ts';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
export type AttachmentsBarContextValue = ReturnType<typeof useChatAttachmentsBar>;
|
|
4
|
+
type FormErrors = Record<'title' | 'content', string | undefined>;
|
|
5
|
+
declare function useChatAttachmentsBar(): {
|
|
6
|
+
selectedInput: WorkflowModalSingleInput | null;
|
|
7
|
+
selectInput: Dispatch<SetStateAction<WorkflowModalSingleInput | null>>;
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
onOpen: () => void;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
form: {
|
|
12
|
+
data: {
|
|
13
|
+
title: string;
|
|
14
|
+
content: string;
|
|
15
|
+
};
|
|
16
|
+
errors: FormErrors;
|
|
17
|
+
labels: {
|
|
18
|
+
title: string;
|
|
19
|
+
content: string;
|
|
20
|
+
};
|
|
21
|
+
validate(): FormErrors;
|
|
22
|
+
onChange(event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>): void;
|
|
23
|
+
onSubmit(e: React.FormEvent<HTMLFormElement>): void;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare function AttachmentsBarProvider({ children }: {
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const useAttachmentsBar: () => AttachmentsBarContextValue;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as b, useContext as w, useState as i } from "react";
|
|
4
|
+
import { useBoolean as B } from "../hooks/use-boolean.js";
|
|
5
|
+
const m = b(void 0);
|
|
6
|
+
function C() {
|
|
7
|
+
const [t, r] = i(null), { value: d, setTrue: f, setFalse: c } = B(!1), [s, l] = i({ title: "", content: "" }), [v, u] = i({
|
|
8
|
+
title: void 0,
|
|
9
|
+
content: void 0
|
|
10
|
+
}), n = {
|
|
11
|
+
data: s,
|
|
12
|
+
errors: v,
|
|
13
|
+
labels: {
|
|
14
|
+
title: t?.workflowModalProps?.titleInputLabel || "Title",
|
|
15
|
+
content: t?.contentType.contentInputLabel || "Content"
|
|
16
|
+
},
|
|
17
|
+
validate() {
|
|
18
|
+
const e = {};
|
|
19
|
+
return s.title.trim() || (e.title = `${n.labels.title} is required`), s.content.trim() || (e.content = `${n.labels.content} is required`), e;
|
|
20
|
+
},
|
|
21
|
+
onChange(e) {
|
|
22
|
+
const { name: o, value: a } = e.target;
|
|
23
|
+
l((p) => ({ ...p, [o]: a }));
|
|
24
|
+
},
|
|
25
|
+
onSubmit(e) {
|
|
26
|
+
if (e.preventDefault(), !t?.contentType) return;
|
|
27
|
+
const o = n.validate();
|
|
28
|
+
if (Object.values(o).some((a) => !!a)) {
|
|
29
|
+
u(o);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
c(), l({ title: "", content: "" }), u({ title: void 0, content: void 0 });
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
selectedInput: t,
|
|
37
|
+
selectInput: r,
|
|
38
|
+
isOpen: d,
|
|
39
|
+
onOpen: f,
|
|
40
|
+
onClose: c,
|
|
41
|
+
form: n
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function I({ children: t }) {
|
|
45
|
+
const r = C();
|
|
46
|
+
return /* @__PURE__ */ h(m.Provider, { value: r, children: t });
|
|
47
|
+
}
|
|
48
|
+
const P = () => {
|
|
49
|
+
const t = w(m);
|
|
50
|
+
if (!t)
|
|
51
|
+
throw new Error("useAttachmentsBar must be used within a AttachmentsBarProvider");
|
|
52
|
+
return t;
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
I as AttachmentsBarProvider,
|
|
56
|
+
P as useAttachmentsBar
|
|
57
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react/jsx-runtime"),t=require("react"),l=require("./config-provider.cjs"),a=t.createContext(void 0),p=({children:e})=>{const{baseSettings:s,componentType:n}=l.useInkeepConfig(),{tags:o,analyticsProperties:r}=s,i=t.useMemo(()=>({widgetLibraryVersion:"0.0.0-rc-20260310051343",componentType:n,tags:o}),[n,o]),u={logEvent:t.useCallback(async c=>{const v={...i,...c.properties,...r},d={eventName:c.eventName,properties:v};return s.onEvent?.(d)},[s,i,r])};return E.jsx(a.Provider,{value:u,children:e})},g=()=>{const e=t.useContext(a);if(!e)throw new Error("useBaseEvents must be used within a BaseEventsProvider");return e};exports.BaseEventsProvider=p;exports.useBaseEvents=g;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InkeepEvent } from '../../types/index.ts';
|
|
2
|
+
export type BaseEventsContextValue = {
|
|
3
|
+
logEvent: (event: InkeepEvent) => Promise<void>;
|
|
4
|
+
};
|
|
5
|
+
export declare const BaseEventsProvider: React.FC<{
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const useBaseEvents: () => BaseEventsContextValue;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo as u, useCallback as E, createContext as d, useContext as l } from "react";
|
|
4
|
+
import { useInkeepConfig as g } from "./config-provider.js";
|
|
5
|
+
const a = d(void 0), P = ({ children: e }) => {
|
|
6
|
+
const { baseSettings: t, componentType: o } = g(), { tags: s, analyticsProperties: n } = t, r = u(
|
|
7
|
+
() => ({
|
|
8
|
+
widgetLibraryVersion: "0.0.0-rc-20260310051343",
|
|
9
|
+
componentType: o,
|
|
10
|
+
tags: s
|
|
11
|
+
}),
|
|
12
|
+
[o, s]
|
|
13
|
+
), c = { logEvent: E(
|
|
14
|
+
async (i) => {
|
|
15
|
+
const v = {
|
|
16
|
+
...r,
|
|
17
|
+
...i.properties,
|
|
18
|
+
...n
|
|
19
|
+
}, m = {
|
|
20
|
+
eventName: i.eventName,
|
|
21
|
+
properties: v
|
|
22
|
+
};
|
|
23
|
+
return t.onEvent?.(m);
|
|
24
|
+
},
|
|
25
|
+
[t, r, n]
|
|
26
|
+
) };
|
|
27
|
+
return /* @__PURE__ */ p(a.Provider, { value: c, children: e });
|
|
28
|
+
}, b = () => {
|
|
29
|
+
const e = l(a);
|
|
30
|
+
if (!e)
|
|
31
|
+
throw new Error("useBaseEvents must be used within a BaseEventsProvider");
|
|
32
|
+
return e;
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
P as BaseEventsProvider,
|
|
36
|
+
b as useBaseEvents
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),o=require("../hooks/use-inkeep-open-state.cjs"),u=t.createContext(void 0),b=({children:e,value:n})=>r.jsx(u.Provider,{value:n,children:e}),s=()=>{const e=t.useContext(u);if(!e)throw new Error("useChatBubble must be used within a ChatBubbleProvider");return e},a=()=>t.useContext(u),c=e=>o.useInkeepOpenState(e,{eventNamePrefix:"chat_bubble"});exports.ChatBubbleProvider=b;exports.useChatBubble=s;exports.useInkeepChatBubble=c;exports.useOptionalChatBubble=a;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OpenSettingsChatButton } from '../../types/index.ts';
|
|
2
|
+
import { SetStateAction } from 'react';
|
|
3
|
+
export type ChatBubbleContextValue = ReturnType<typeof useInkeepChatBubble>;
|
|
4
|
+
export declare const ChatBubbleProvider: React.FC<{
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
value: ChatBubbleContextValue;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const useChatBubble: () => {
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
setOpen: (value: SetStateAction<boolean>) => void;
|
|
11
|
+
shortcutKey: string | null | undefined;
|
|
12
|
+
};
|
|
13
|
+
export declare const useOptionalChatBubble: () => {
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
setOpen: (value: SetStateAction<boolean>) => void;
|
|
16
|
+
shortcutKey: string | null | undefined;
|
|
17
|
+
} | undefined;
|
|
18
|
+
export declare const useInkeepChatBubble: (props: OpenSettingsChatButton) => {
|
|
19
|
+
isOpen: boolean;
|
|
20
|
+
setOpen: (value: SetStateAction<boolean>) => void;
|
|
21
|
+
shortcutKey: string | null | undefined;
|
|
22
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as u, useContext as o } from "react";
|
|
4
|
+
import { useInkeepOpenState as b } from "../hooks/use-inkeep-open-state.js";
|
|
5
|
+
const t = u(void 0), i = ({ children: e, value: r }) => /* @__PURE__ */ n(t.Provider, { value: r, children: e }), h = () => {
|
|
6
|
+
const e = o(t);
|
|
7
|
+
if (!e)
|
|
8
|
+
throw new Error("useChatBubble must be used within a ChatBubbleProvider");
|
|
9
|
+
return e;
|
|
10
|
+
}, l = () => o(t), C = (e) => b(e, {
|
|
11
|
+
eventNamePrefix: "chat_bubble"
|
|
12
|
+
// No default trigger selector - chat buttons typically don't use click triggers
|
|
13
|
+
});
|
|
14
|
+
export {
|
|
15
|
+
i as ChatBubbleProvider,
|
|
16
|
+
h as useChatBubble,
|
|
17
|
+
C as useInkeepChatBubble,
|
|
18
|
+
l as useOptionalChatBubble
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react/jsx-runtime"),s=require("react"),H=require("react-hook-form"),M=require("../components/modal/modal-provider.cjs"),I=require("../utils/form.cjs"),T=require("./base-events-provider.cjs"),j="root.serverError",E=s.createContext(void 0);function _(){const[e,u]=s.useState(null),[c,d]=s.useState(null),[y,f]=s.useState(!1),p=M.useModal(),{logEvent:b}=T.useBaseEvents(),w=s.useCallback((o,t)=>{u(o),d(t||null)},[]),l=s.useCallback(()=>{u(null),d(null),f(!1),e?.buttons.close?.action==="close_modal"&&p?.setOpen(!1)},[e?.buttons.close?.action,p]),r=s.useCallback(o=>e?.fields.map(t=>{if("_type"in t&&t._type==="include_chat_session"){const{_type:R,...i}=t;return{...i,inputType:"checkbox",isHidden:!o,defaultValue:i.defaultValue??!1}}return t}).filter(t=>!("_type"in t))||[],[e?.fields]),h=s.useMemo(()=>r(),[r]),n=s.useMemo(()=>I.getFormDefaultValues(h),[h]),{control:k,handleSubmit:C,formState:{errors:S,isSubmitting:x},setError:g,reset:v}=H.useForm({defaultValues:n});s.useEffect(()=>{n&&v(n)},[v,n]);const F=s.useCallback(o=>async t=>{const i=r(o?.id).find(a=>a.name&&e?.fields.some(m=>"_type"in m&&m._type==="include_chat_session"&&m.name===a.name)),V=o?.id&&i&&t[i.name];try{await e?.buttons.submit.onSubmit({values:t,conversation:V?o:void 0}),c&&b({eventName:"user_escalation_indicated",properties:{escalationType:"support_form",getHelpOptionName:c.name,conversationId:o?.id}}),f(!0),e?.successView||l()}catch(a){g(j,{message:a instanceof Error?a.message:"Something went wrong."})}},[r,e?.fields,e?.buttons.submit,e?.successView,c,b,g,l]),O=s.useCallback((o,t)=>C(F(t))(o),[C,F]),P=S?.root?.serverError;return{form:e,openForm:w,closeForm:l,handleSubmit:O,isSuccess:y,isSubmitting:x,formError:P,getFields:r,errors:S,control:k,defaultValues:n}}const N=({children:e})=>{const u=_();return q.jsx(E.Provider,{value:u,children:e})},G=()=>{const e=s.useContext(E);if(!e)throw new Error("useChatForm must be used within a ChatFormProvider");return e};exports.ChatFormProvider=N;exports.useChatForm=G;exports.useChatFormState=_;
|
|
@@ -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 Y=require("react/jsx-runtime"),e=require("react"),N=require("../components/embedded-chat/chat-provider.cjs"),ee=require("./config-provider.cjs"),te=require("../hooks/use-anonymous-session.cjs"),se=require("../components/embedded-chat/use-captcha.cjs"),U=e.createContext(void 0),F=25;function ne(t){const{stop:o,clear:c,conversationId:u,isStreaming:P,loadAndRestoreSession:k}=N.useChat(),{baseSettings:z,aiChatSettings:G}=ee.useInkeepConfig(),{baseUrl:l,appId:h,apiKey:d}=G,{shouldBypassCaptcha:K,privacyPreferences:Z}=z,{getCaptchaHeader:p,invalidate:I}=se.useCaptcha({fetchUrl:`${l}/run/auth/pow/challenge`,shouldBypassCaptcha:K||!!d}),C=te.useAnonymousSession({baseUrl:l,appId:h,getCaptchaHeader:p,optOutAllAnalytics:Z?.optOutAllAnalytics}),[g,v]=e.useState(!1),[m,x]=e.useState([]),[w,R]=e.useState(!1),[q,_]=e.useState(0),[y,J]=e.useState(!0),b=e.useRef(!1),E=e.useRef(null),$=e.useRef([]);$.current=m;const a=e.useCallback(async(n,r=!1)=>{const j=d||C;if(!(!l||!j)){R(!0);try{const A=await p(),M=`${l}/run/v1/conversations?page=${n+1}&limit=${F}`,B={...h?{"x-inkeep-app-id":h}:{},Authorization:`Bearer ${j}`};let i=await fetch(M,{headers:{...B,...A}});if(!i.ok&&i.status===401){I();const s=await p();i=await fetch(M,{headers:{...B,...s}})}if(!i.ok)throw new Error(`Failed to fetch conversations: ${i.status}`);const L=await i.json(),S=(L.data??[]).map(s=>({id:s.id,title:s.title??"",createdAt:new Date(s.createdAt),updatedAt:new Date(s.updatedAt)}));x(s=>{if(n===0&&!r)return S;if(n===0&&r){const f=new Set(S.map(H=>H.id));return[...S,...s.slice(F).filter(H=>!f.has(H.id))]}const X=new Set(s.map(f=>f.id));return[...s,...S.filter(f=>!X.has(f.id))]});const{page:T,pages:D}=L.pagination??{};J(T!=null&&D!=null?T<D:!1),r||_(n)}catch(A){console.error("[useChatHistory] Failed to load conversations:",A)}finally{R(!1)}}},[l,h,d,C,p,I]);e.useEffect(()=>{!g||!(d||C)||(t==="stack"?(x([]),a(0)):b.current||(b.current=!0,a(0)))},[g,C,d,t,a]);const O=e.useRef("");e.useEffect(()=>{t==="sidepane"&&(!u||!P||b.current&&O.current!==u&&($.current.some(n=>n.id===u)||(O.current=u,a(0,!0))))},[u,t,a,P]);const Q=e.useCallback(()=>{!w&&y&&a(q+1)},[w,y,q,a]),V=e.useCallback(()=>{o(),c(),t!=="sidepane"&&v(!1)},[t,o,c]),W=e.useCallback(async n=>{E.current?.abort();const r=new AbortController;E.current=r,await k(n,r.signal),!r.signal.aborted&&t!=="sidepane"&&v(!1)},[t,k]);return{isOpen:g,setIsOpen:v,sessions:m,isLoading:w,hasMore:y,loadMore:Q,startNewConversation:V,loadSession:W}}const ae=({layout:t,children:o})=>{const c=ne(t);return Y.jsx(U.Provider,{value:c,children:typeof o=="function"?o(c):o})},re=()=>{const t=e.useContext(U);if(!t)throw new Error("useChatHistory must be used within a ChatHistoryProvider");return t};exports.ChatHistoryProvider=ae;exports.useChatHistory=re;
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
isOpen: boolean;
|
|
16
|
+
setIsOpen: (open: boolean) => void;
|
|
17
|
+
sessions: ChatSession[];
|
|
18
|
+
isLoading: boolean;
|
|
19
|
+
hasMore: boolean;
|
|
20
|
+
loadMore: () => void;
|
|
21
|
+
startNewConversation: () => void;
|
|
22
|
+
loadSession: (sessionId: string) => void;
|
|
23
|
+
}
|
|
24
|
+
export interface ChatHistoryProviderProps {
|
|
25
|
+
layout: ChatHistoryLayout;
|
|
26
|
+
children: React.ReactNode | ((value: ChatHistoryContextValue) => React.ReactNode);
|
|
27
|
+
}
|
|
28
|
+
export declare const ChatHistoryProvider: React.FC<ChatHistoryProviderProps>;
|
|
29
|
+
export declare const useChatHistory: () => ChatHistoryContextValue;
|
|
30
|
+
export {};
|