@inkeep/cxkit-primitives 0.0.0-dev-20250221234142
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 +21 -0
- package/README.md +1 -0
- package/dist/atoms/api/analytics/conversation.cjs +1 -0
- package/dist/atoms/api/analytics/conversation.d.cts +3 -0
- package/dist/atoms/api/analytics/conversation.d.ts +3 -0
- package/dist/atoms/api/analytics/conversation.js +37 -0
- package/dist/atoms/api/analytics/events.cjs +1 -0
- package/dist/atoms/api/analytics/events.d.cts +2 -0
- package/dist/atoms/api/analytics/events.d.ts +2 -0
- package/dist/atoms/api/analytics/events.js +30 -0
- package/dist/atoms/api/analytics/feedback.cjs +1 -0
- package/dist/atoms/api/analytics/feedback.d.cts +11 -0
- package/dist/atoms/api/analytics/feedback.d.ts +11 -0
- package/dist/atoms/api/analytics/feedback.js +26 -0
- package/dist/atoms/avatars/ai.cjs +1 -0
- package/dist/atoms/avatars/ai.d.cts +3 -0
- package/dist/atoms/avatars/ai.d.ts +3 -0
- package/dist/atoms/avatars/ai.js +88 -0
- package/dist/atoms/avatars/user.cjs +1 -0
- package/dist/atoms/avatars/user.d.cts +3 -0
- package/dist/atoms/avatars/user.d.ts +3 -0
- package/dist/atoms/avatars/user.js +27 -0
- package/dist/atoms/codeblock/index.cjs +1 -0
- package/dist/atoms/codeblock/index.d.cts +10 -0
- package/dist/atoms/codeblock/index.d.ts +10 -0
- package/dist/atoms/codeblock/index.js +40 -0
- package/dist/atoms/custom-styles.cjs +1 -0
- package/dist/atoms/custom-styles.d.cts +5 -0
- package/dist/atoms/custom-styles.d.ts +5 -0
- package/dist/atoms/custom-styles.js +57 -0
- package/dist/atoms/dialog.cjs +1 -0
- package/dist/atoms/dialog.d.cts +68 -0
- package/dist/atoms/dialog.d.ts +68 -0
- package/dist/atoms/dialog.js +185 -0
- package/dist/atoms/icons/built-in-icon-renderer.cjs +1 -0
- package/dist/atoms/icons/built-in-icon-renderer.d.cts +6 -0
- package/dist/atoms/icons/built-in-icon-renderer.d.ts +6 -0
- package/dist/atoms/icons/built-in-icon-renderer.js +49 -0
- package/dist/atoms/icons/built-in-icons.cjs +1 -0
- package/dist/atoms/icons/built-in-icons.d.cts +72 -0
- package/dist/atoms/icons/built-in-icons.d.ts +72 -0
- package/dist/atoms/icons/built-in-icons.js +79 -0
- package/dist/atoms/icons/checkbox-icon.cjs +1 -0
- package/dist/atoms/icons/checkbox-icon.d.cts +1 -0
- package/dist/atoms/icons/checkbox-icon.d.ts +1 -0
- package/dist/atoms/icons/checkbox-icon.js +24 -0
- package/dist/atoms/icons/custom-icon.cjs +1 -0
- package/dist/atoms/icons/custom-icon.d.cts +6 -0
- package/dist/atoms/icons/custom-icon.d.ts +6 -0
- package/dist/atoms/icons/custom-icon.js +19 -0
- package/dist/atoms/icons/index.cjs +1 -0
- package/dist/atoms/icons/index.d.cts +2 -0
- package/dist/atoms/icons/index.d.ts +2 -0
- package/dist/atoms/icons/index.js +6 -0
- package/dist/atoms/icons/inkeep-default-icons.cjs +1 -0
- package/dist/atoms/icons/inkeep-default-icons.d.cts +2 -0
- package/dist/atoms/icons/inkeep-default-icons.d.ts +2 -0
- package/dist/atoms/icons/inkeep-default-icons.js +23 -0
- package/dist/atoms/link.cjs +1 -0
- package/dist/atoms/link.d.cts +14 -0
- package/dist/atoms/link.d.ts +14 -0
- package/dist/atoms/link.js +35 -0
- package/dist/atoms/markdown/components.cjs +1 -0
- package/dist/atoms/markdown/components.d.cts +27 -0
- package/dist/atoms/markdown/components.d.ts +27 -0
- package/dist/atoms/markdown/components.js +64 -0
- package/dist/atoms/markdown/index.cjs +1 -0
- package/dist/atoms/markdown/index.d.cts +15 -0
- package/dist/atoms/markdown/index.d.ts +15 -0
- package/dist/atoms/markdown/index.js +79 -0
- package/dist/atoms/markdown/rehype-inline-code-property.cjs +1 -0
- package/dist/atoms/markdown/rehype-inline-code-property.d.cts +1 -0
- package/dist/atoms/markdown/rehype-inline-code-property.d.ts +1 -0
- package/dist/atoms/markdown/rehype-inline-code-property.js +12 -0
- package/dist/atoms/portal-with-theme.cjs +1 -0
- package/dist/atoms/portal-with-theme.d.cts +2 -0
- package/dist/atoms/portal-with-theme.d.ts +2 -0
- package/dist/atoms/portal-with-theme.js +12 -0
- package/dist/atoms/portal.cjs +1 -0
- package/dist/atoms/portal.d.cts +8 -0
- package/dist/atoms/portal.d.ts +8 -0
- package/dist/atoms/portal.js +19 -0
- package/dist/atoms/shadow/context.cjs +2 -0
- package/dist/atoms/shadow/context.d.cts +14 -0
- package/dist/atoms/shadow/context.d.ts +14 -0
- package/dist/atoms/shadow/context.js +55 -0
- package/dist/atoms/shadow/create.cjs +1 -0
- package/dist/atoms/shadow/create.d.cts +8 -0
- package/dist/atoms/shadow/create.d.ts +8 -0
- package/dist/atoms/shadow/create.js +56 -0
- package/dist/atoms/shadow/index.d.cts +1 -0
- package/dist/atoms/shadow/index.d.ts +1 -0
- package/dist/atoms/shadow/root.cjs +1 -0
- package/dist/atoms/shadow/root.d.cts +5 -0
- package/dist/atoms/shadow/root.d.ts +5 -0
- package/dist/atoms/shadow/root.js +22 -0
- package/dist/atoms/shadow/use-ensured-forwarded-ref.cjs +1 -0
- package/dist/atoms/shadow/use-ensured-forwarded-ref.d.cts +2 -0
- package/dist/atoms/shadow/use-ensured-forwarded-ref.d.ts +2 -0
- package/dist/atoms/shadow/use-ensured-forwarded-ref.js +11 -0
- package/dist/atoms/shadow/utils.cjs +1 -0
- package/dist/atoms/shadow/utils.d.cts +9 -0
- package/dist/atoms/shadow/utils.d.ts +9 -0
- package/dist/atoms/shadow/utils.js +16 -0
- package/dist/components/chat-button.cjs +1 -0
- package/dist/components/chat-button.d.cts +11 -0
- package/dist/components/chat-button.d.ts +11 -0
- package/dist/components/chat-button.js +42 -0
- package/dist/components/embedded-chat/chat-provider.cjs +1 -0
- package/dist/components/embedded-chat/chat-provider.d.cts +19 -0
- package/dist/components/embedded-chat/chat-provider.d.ts +19 -0
- package/dist/components/embedded-chat/chat-provider.js +22 -0
- package/dist/components/embedded-chat/use-captcha.cjs +1 -0
- package/dist/components/embedded-chat/use-captcha.d.cts +13 -0
- package/dist/components/embedded-chat/use-captcha.d.ts +13 -0
- package/dist/components/embedded-chat/use-captcha.js +56 -0
- package/dist/components/embedded-chat/use-chat-action.cjs +1 -0
- package/dist/components/embedded-chat/use-chat-action.d.cts +9 -0
- package/dist/components/embedded-chat/use-chat-action.d.ts +9 -0
- package/dist/components/embedded-chat/use-chat-action.js +26 -0
- package/dist/components/embedded-chat/use-inkeep-chat.cjs +4 -0
- package/dist/components/embedded-chat/use-inkeep-chat.d.cts +25 -0
- package/dist/components/embedded-chat/use-inkeep-chat.d.ts +25 -0
- package/dist/components/embedded-chat/use-inkeep-chat.js +227 -0
- package/dist/components/embedded-chat.cjs +17 -0
- package/dist/components/embedded-chat.d.cts +415 -0
- package/dist/components/embedded-chat.d.ts +415 -0
- package/dist/components/embedded-chat.js +1840 -0
- package/dist/components/embedded-search/search-provider.cjs +1 -0
- package/dist/components/embedded-search/search-provider.d.cts +21 -0
- package/dist/components/embedded-search/search-provider.d.ts +21 -0
- package/dist/components/embedded-search/search-provider.js +19 -0
- package/dist/components/embedded-search/search-query.graphql.cjs +82 -0
- package/dist/components/embedded-search/search-query.graphql.js +86 -0
- package/dist/components/embedded-search/transform-results.cjs +1 -0
- package/dist/components/embedded-search/transform-results.d.cts +3 -0
- package/dist/components/embedded-search/transform-results.d.ts +3 -0
- package/dist/components/embedded-search/transform-results.js +113 -0
- package/dist/components/embedded-search/use-inkeep-search.cjs +1 -0
- package/dist/components/embedded-search/use-inkeep-search.d.cts +21 -0
- package/dist/components/embedded-search/use-inkeep-search.d.ts +21 -0
- package/dist/components/embedded-search/use-inkeep-search.js +137 -0
- package/dist/components/embedded-search.cjs +1 -0
- package/dist/components/embedded-search.d.cts +229 -0
- package/dist/components/embedded-search.d.ts +229 -0
- package/dist/components/embedded-search.js +390 -0
- package/dist/components/factory.cjs +1 -0
- package/dist/components/factory.d.cts +19 -0
- package/dist/components/factory.d.ts +19 -0
- package/dist/components/factory.js +39 -0
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.d.cts +11 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.js +31 -0
- package/dist/components/intelligent-form/actions/context-model-response.cjs +9 -0
- package/dist/components/intelligent-form/actions/context-model-response.d.cts +10 -0
- package/dist/components/intelligent-form/actions/context-model-response.d.ts +10 -0
- package/dist/components/intelligent-form/actions/context-model-response.js +36 -0
- package/dist/components/intelligent-form/actions/escalation-schema.cjs +1 -0
- package/dist/components/intelligent-form/actions/escalation-schema.d.cts +2 -0
- package/dist/components/intelligent-form/actions/escalation-schema.d.ts +2 -0
- package/dist/components/intelligent-form/actions/escalation-schema.js +48 -0
- package/dist/components/intelligent-form/actions/qa-model-messages.cjs +27 -0
- package/dist/components/intelligent-form/actions/qa-model-messages.d.cts +2 -0
- package/dist/components/intelligent-form/actions/qa-model-messages.d.ts +2 -0
- package/dist/components/intelligent-form/actions/qa-model-messages.js +45 -0
- package/dist/components/intelligent-form/actions/qa-model-response.cjs +1 -0
- package/dist/components/intelligent-form/actions/qa-model-response.d.cts +14 -0
- package/dist/components/intelligent-form/actions/qa-model-response.d.ts +14 -0
- package/dist/components/intelligent-form/actions/qa-model-response.js +46 -0
- package/dist/components/intelligent-form/intelligent-form-provider.cjs +1 -0
- package/dist/components/intelligent-form/intelligent-form-provider.d.cts +29 -0
- package/dist/components/intelligent-form/intelligent-form-provider.d.ts +29 -0
- package/dist/components/intelligent-form/intelligent-form-provider.js +23 -0
- package/dist/components/intelligent-form/use-inkeep-intelligent-form.cjs +1 -0
- package/dist/components/intelligent-form/use-inkeep-intelligent-form.d.cts +30 -0
- package/dist/components/intelligent-form/use-inkeep-intelligent-form.d.ts +30 -0
- package/dist/components/intelligent-form/use-inkeep-intelligent-form.js +157 -0
- package/dist/components/intelligent-form.cjs +1 -0
- package/dist/components/intelligent-form.d.cts +135 -0
- package/dist/components/intelligent-form.d.ts +135 -0
- package/dist/components/intelligent-form.js +568 -0
- package/dist/components/modal/modal-provider.cjs +1 -0
- package/dist/components/modal/modal-provider.d.cts +13 -0
- package/dist/components/modal/modal-provider.d.ts +13 -0
- package/dist/components/modal/modal-provider.js +8 -0
- package/dist/components/modal/use-inkeep-modal.cjs +1 -0
- package/dist/components/modal/use-inkeep-modal.d.cts +8 -0
- package/dist/components/modal/use-inkeep-modal.d.ts +8 -0
- package/dist/components/modal/use-inkeep-modal.js +30 -0
- package/dist/components/modal.cjs +1 -0
- package/dist/components/modal.d.cts +18 -0
- package/dist/components/modal.d.ts +18 -0
- package/dist/components/modal.js +40 -0
- package/dist/components/searchbar.cjs +1 -0
- package/dist/components/searchbar.d.cts +23 -0
- package/dist/components/searchbar.d.ts +23 -0
- package/dist/components/searchbar.js +54 -0
- package/dist/components/tagline-logo-icon.cjs +1 -0
- package/dist/components/tagline-logo-icon.d.cts +1 -0
- package/dist/components/tagline-logo-icon.d.ts +1 -0
- package/dist/components/tagline-logo-icon.js +34 -0
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.d.cts +12 -0
- package/dist/hooks/index.d.ts +12 -0
- package/dist/hooks/index.js +27 -0
- package/dist/hooks/use-boolean.cjs +1 -0
- package/dist/hooks/use-boolean.d.cts +10 -0
- package/dist/hooks/use-boolean.d.ts +10 -0
- package/dist/hooks/use-boolean.js +17 -0
- package/dist/hooks/use-browser-storage.cjs +1 -0
- package/dist/hooks/use-browser-storage.d.cts +17 -0
- package/dist/hooks/use-browser-storage.d.ts +17 -0
- package/dist/hooks/use-browser-storage.js +88 -0
- package/dist/hooks/use-component-classnames.cjs +1 -0
- package/dist/hooks/use-component-classnames.d.cts +6 -0
- package/dist/hooks/use-component-classnames.d.ts +6 -0
- package/dist/hooks/use-component-classnames.js +14 -0
- package/dist/hooks/use-container-size.cjs +1 -0
- package/dist/hooks/use-container-size.d.cts +5 -0
- package/dist/hooks/use-container-size.d.ts +5 -0
- package/dist/hooks/use-container-size.js +18 -0
- package/dist/hooks/use-copy-to-clipboard.cjs +1 -0
- package/dist/hooks/use-copy-to-clipboard.d.cts +3 -0
- package/dist/hooks/use-copy-to-clipboard.d.ts +3 -0
- package/dist/hooks/use-copy-to-clipboard.js +19 -0
- package/dist/hooks/use-instant-update.cjs +1 -0
- package/dist/hooks/use-instant-update.d.cts +17 -0
- package/dist/hooks/use-instant-update.d.ts +17 -0
- package/dist/hooks/use-instant-update.js +16 -0
- package/dist/hooks/use-is-mounted.cjs +1 -0
- package/dist/hooks/use-is-mounted.d.cts +1 -0
- package/dist/hooks/use-is-mounted.d.ts +1 -0
- package/dist/hooks/use-is-mounted.js +11 -0
- package/dist/hooks/use-media-query.cjs +1 -0
- package/dist/hooks/use-media-query.d.cts +1 -0
- package/dist/hooks/use-media-query.d.ts +1 -0
- package/dist/hooks/use-media-query.js +14 -0
- package/dist/hooks/use-resize-observer.cjs +1 -0
- package/dist/hooks/use-resize-observer.d.cts +12 -0
- package/dist/hooks/use-resize-observer.d.ts +12 -0
- package/dist/hooks/use-resize-observer.js +32 -0
- package/dist/hooks/use-scroll-to-bottom.cjs +1 -0
- package/dist/hooks/use-scroll-to-bottom.d.cts +13 -0
- package/dist/hooks/use-scroll-to-bottom.d.ts +13 -0
- package/dist/hooks/use-scroll-to-bottom.js +52 -0
- package/dist/hooks/use-scrolling-fades.cjs +1 -0
- package/dist/hooks/use-scrolling-fades.d.cts +2 -0
- package/dist/hooks/use-scrolling-fades.d.ts +2 -0
- package/dist/hooks/use-scrolling-fades.js +18 -0
- package/dist/hooks/use-settle-action.cjs +1 -0
- package/dist/hooks/use-settle-action.d.cts +3 -0
- package/dist/hooks/use-settle-action.d.ts +3 -0
- package/dist/hooks/use-settle-action.js +11 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +152 -0
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/fa6/index.cjs +1 -0
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/fa6/index.js +92 -0
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/fi/index.cjs +1 -0
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/fi/index.js +8 -0
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/hi2/index.cjs +1 -0
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/hi2/index.js +8 -0
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/io5/index.cjs +1 -0
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/io5/index.js +128 -0
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/lib/iconBase.cjs +1 -0
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/lib/iconBase.js +109 -0
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/lib/iconContext.cjs +1 -0
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/lib/iconContext.js +13 -0
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/lu/index.cjs +1 -0
- package/dist/node_modules/.pnpm/react-icons@5.4.0_react@19.0.0/node_modules/react-icons/lu/index.js +68 -0
- package/dist/providers/attachment-item-provider.cjs +1 -0
- package/dist/providers/attachment-item-provider.d.cts +9 -0
- package/dist/providers/attachment-item-provider.d.ts +9 -0
- package/dist/providers/attachment-item-provider.js +13 -0
- package/dist/providers/attachments-bar-provider.cjs +1 -0
- package/dist/providers/attachments-bar-provider.d.cts +30 -0
- package/dist/providers/attachments-bar-provider.d.ts +30 -0
- package/dist/providers/attachments-bar-provider.js +64 -0
- package/dist/providers/base-events-provider.cjs +1 -0
- package/dist/providers/base-events-provider.d.cts +8 -0
- package/dist/providers/base-events-provider.d.ts +8 -0
- package/dist/providers/base-events-provider.js +39 -0
- package/dist/providers/chat-events-provider.cjs +1 -0
- package/dist/providers/chat-events-provider.d.cts +12 -0
- package/dist/providers/chat-events-provider.d.ts +12 -0
- package/dist/providers/chat-events-provider.js +66 -0
- package/dist/providers/chat-form-provider.cjs +1 -0
- package/dist/providers/chat-form-provider.d.cts +23 -0
- package/dist/providers/chat-form-provider.d.ts +23 -0
- package/dist/providers/chat-form-provider.js +66 -0
- package/dist/providers/config-provider.cjs +1 -0
- package/dist/providers/config-provider.d.cts +24 -0
- package/dist/providers/config-provider.d.ts +24 -0
- package/dist/providers/config-provider.js +37 -0
- package/dist/providers/conversation-provider.cjs +1 -0
- package/dist/providers/conversation-provider.d.cts +12 -0
- package/dist/providers/conversation-provider.d.ts +12 -0
- package/dist/providers/conversation-provider.js +49 -0
- package/dist/providers/feedback-item-provider.cjs +1 -0
- package/dist/providers/feedback-item-provider.d.cts +10 -0
- package/dist/providers/feedback-item-provider.d.ts +10 -0
- package/dist/providers/feedback-item-provider.js +16 -0
- package/dist/providers/feedback-provider.cjs +1 -0
- package/dist/providers/feedback-provider.d.cts +19 -0
- package/dist/providers/feedback-provider.d.ts +19 -0
- package/dist/providers/feedback-provider.js +82 -0
- package/dist/providers/form-field-provider.cjs +1 -0
- package/dist/providers/form-field-provider.d.cts +15 -0
- package/dist/providers/form-field-provider.d.ts +15 -0
- package/dist/providers/form-field-provider.js +17 -0
- package/dist/providers/help-menu-provider.cjs +1 -0
- package/dist/providers/help-menu-provider.d.cts +11 -0
- package/dist/providers/help-menu-provider.d.ts +11 -0
- package/dist/providers/help-menu-provider.js +19 -0
- package/dist/providers/index.cjs +1 -0
- package/dist/providers/index.d.cts +19 -0
- package/dist/providers/index.d.ts +19 -0
- package/dist/providers/index.js +63 -0
- package/dist/providers/intelligent-form-field-provider.cjs +1 -0
- package/dist/providers/intelligent-form-field-provider.d.cts +15 -0
- package/dist/providers/intelligent-form-field-provider.d.ts +15 -0
- package/dist/providers/intelligent-form-field-provider.js +19 -0
- package/dist/providers/markdown-provider.cjs +1 -0
- package/dist/providers/markdown-provider.d.cts +9 -0
- package/dist/providers/markdown-provider.d.ts +9 -0
- package/dist/providers/markdown-provider.js +8 -0
- package/dist/providers/message-attachments-provider.cjs +1 -0
- package/dist/providers/message-attachments-provider.d.cts +13 -0
- package/dist/providers/message-attachments-provider.d.ts +13 -0
- package/dist/providers/message-attachments-provider.js +27 -0
- package/dist/providers/message-provider.cjs +1 -0
- package/dist/providers/message-provider.d.cts +10 -0
- package/dist/providers/message-provider.d.ts +10 -0
- package/dist/providers/message-provider.js +14 -0
- package/dist/providers/root-provider.cjs +1 -0
- package/dist/providers/root-provider.d.cts +8 -0
- package/dist/providers/root-provider.d.ts +8 -0
- package/dist/providers/root-provider.js +21 -0
- package/dist/providers/search-events-provider.cjs +1 -0
- package/dist/providers/search-events-provider.d.cts +11 -0
- package/dist/providers/search-events-provider.d.ts +11 -0
- package/dist/providers/search-events-provider.js +18 -0
- package/dist/providers/source-item-provider.cjs +1 -0
- package/dist/providers/source-item-provider.d.cts +12 -0
- package/dist/providers/source-item-provider.d.ts +12 -0
- package/dist/providers/source-item-provider.js +13 -0
- package/dist/providers/theme-provider.cjs +1 -0
- package/dist/providers/theme-provider.d.cts +3 -0
- package/dist/providers/theme-provider.d.ts +3 -0
- package/dist/providers/theme-provider.js +65 -0
- package/dist/providers/user-provider.cjs +1 -0
- package/dist/providers/user-provider.d.cts +13 -0
- package/dist/providers/user-provider.d.ts +13 -0
- package/dist/providers/user-provider.js +34 -0
- package/dist/providers/widget-provider.cjs +1 -0
- package/dist/providers/widget-provider.d.cts +9 -0
- package/dist/providers/widget-provider.d.ts +9 -0
- package/dist/providers/widget-provider.js +8 -0
- package/dist/utils/component-ids.cjs +1 -0
- package/dist/utils/component-ids.d.cts +632 -0
- package/dist/utils/component-ids.d.ts +632 -0
- package/dist/utils/component-ids.js +340 -0
- package/dist/utils/compose-event-handlers.cjs +1 -0
- package/dist/utils/compose-event-handlers.d.cts +3 -0
- package/dist/utils/compose-event-handlers.d.ts +3 -0
- package/dist/utils/compose-event-handlers.js +10 -0
- package/dist/utils/compose-refs.cjs +1 -0
- package/dist/utils/compose-refs.d.cts +5 -0
- package/dist/utils/compose-refs.d.ts +5 -0
- package/dist/utils/compose-refs.js +30 -0
- package/dist/utils/default-settings.cjs +1 -0
- package/dist/utils/default-settings.d.cts +244 -0
- package/dist/utils/default-settings.d.ts +244 -0
- package/dist/utils/default-settings.js +75 -0
- package/dist/utils/form.cjs +1 -0
- package/dist/utils/form.d.cts +3 -0
- package/dist/utils/form.d.ts +3 -0
- package/dist/utils/form.js +17 -0
- package/dist/utils/generate-uid.cjs +1 -0
- package/dist/utils/generate-uid.d.cts +2 -0
- package/dist/utils/generate-uid.d.ts +2 -0
- package/dist/utils/generate-uid.js +14 -0
- package/dist/utils/get-message-metadata.cjs +10 -0
- package/dist/utils/get-message-metadata.d.cts +8 -0
- package/dist/utils/get-message-metadata.d.ts +8 -0
- package/dist/utils/get-message-metadata.js +142 -0
- package/dist/utils/graphql-client.cjs +1 -0
- package/dist/utils/graphql-client.d.cts +8 -0
- package/dist/utils/graphql-client.d.ts +8 -0
- package/dist/utils/graphql-client.js +23 -0
- package/dist/utils/highlight-emphasis.cjs +1 -0
- package/dist/utils/highlight-emphasis.d.cts +4 -0
- package/dist/utils/highlight-emphasis.d.ts +4 -0
- package/dist/utils/highlight-emphasis.js +15 -0
- package/dist/utils/merge-props.cjs +1 -0
- package/dist/utils/merge-props.d.cts +7 -0
- package/dist/utils/merge-props.d.ts +7 -0
- package/dist/utils/merge-props.js +41 -0
- package/dist/utils/misc.cjs +1 -0
- package/dist/utils/misc.d.cts +13 -0
- package/dist/utils/misc.d.ts +13 -0
- package/dist/utils/misc.js +36 -0
- package/dist/utils/reset-query-params.cjs +1 -0
- package/dist/utils/reset-query-params.d.cts +1 -0
- package/dist/utils/reset-query-params.d.ts +1 -0
- package/dist/utils/reset-query-params.js +13 -0
- package/dist/utils/tools/links-schema.cjs +1 -0
- package/dist/utils/tools/links-schema.d.cts +64 -0
- package/dist/utils/tools/links-schema.d.ts +64 -0
- package/dist/utils/tools/links-schema.js +85 -0
- package/dist/utils/transform-source/breadcrumbs.cjs +1 -0
- package/dist/utils/transform-source/breadcrumbs.d.cts +2 -0
- package/dist/utils/transform-source/breadcrumbs.d.ts +2 -0
- package/dist/utils/transform-source/breadcrumbs.js +16 -0
- package/dist/utils/transform-source/common-words/long.cjs +1 -0
- package/dist/utils/transform-source/common-words/long.d.cts +1 -0
- package/dist/utils/transform-source/common-words/long.d.ts +1 -0
- package/dist/utils/transform-source/common-words/long.js +69 -0
- package/dist/utils/transform-source/common-words/lowercase.cjs +1 -0
- package/dist/utils/transform-source/common-words/lowercase.d.cts +1 -0
- package/dist/utils/transform-source/common-words/lowercase.d.ts +1 -0
- package/dist/utils/transform-source/common-words/lowercase.js +48 -0
- package/dist/utils/transform-source/common-words/short.cjs +1 -0
- package/dist/utils/transform-source/common-words/short.d.cts +1 -0
- package/dist/utils/transform-source/common-words/short.d.ts +1 -0
- package/dist/utils/transform-source/common-words/short.js +141 -0
- package/dist/utils/transform-source/description.cjs +1 -0
- package/dist/utils/transform-source/description.d.cts +2 -0
- package/dist/utils/transform-source/description.d.ts +2 -0
- package/dist/utils/transform-source/description.js +10 -0
- package/dist/utils/transform-source/icon.cjs +1 -0
- package/dist/utils/transform-source/icon.d.cts +2 -0
- package/dist/utils/transform-source/icon.d.ts +2 -0
- package/dist/utils/transform-source/icon.js +9 -0
- package/dist/utils/transform-source/index.cjs +1 -0
- package/dist/utils/transform-source/index.d.cts +2 -0
- package/dist/utils/transform-source/index.d.ts +2 -0
- package/dist/utils/transform-source/index.js +21 -0
- package/dist/utils/transform-source/tabs.cjs +1 -0
- package/dist/utils/transform-source/tabs.d.cts +2 -0
- package/dist/utils/transform-source/tabs.d.ts +2 -0
- package/dist/utils/transform-source/tabs.js +13 -0
- package/dist/utils/transform-source/title.cjs +1 -0
- package/dist/utils/transform-source/title.d.cts +2 -0
- package/dist/utils/transform-source/title.d.ts +2 -0
- package/dist/utils/transform-source/title.js +12 -0
- package/dist/utils/transform-source/utils/description-without-title.cjs +1 -0
- package/dist/utils/transform-source/utils/description-without-title.d.cts +11 -0
- package/dist/utils/transform-source/utils/description-without-title.d.ts +11 -0
- package/dist/utils/transform-source/utils/description-without-title.js +12 -0
- package/dist/utils/transform-source/utils/index.cjs +1 -0
- package/dist/utils/transform-source/utils/index.d.cts +6 -0
- package/dist/utils/transform-source/utils/index.d.ts +6 -0
- package/dist/utils/transform-source/utils/index.js +16 -0
- package/dist/utils/transform-source/utils/misc.cjs +1 -0
- package/dist/utils/transform-source/utils/misc.d.cts +2 -0
- package/dist/utils/transform-source/utils/misc.d.ts +2 -0
- package/dist/utils/transform-source/utils/misc.js +15 -0
- package/dist/utils/transform-source/utils/standardize-common-words.cjs +1 -0
- package/dist/utils/transform-source/utils/standardize-common-words.d.cts +1 -0
- package/dist/utils/transform-source/utils/standardize-common-words.d.ts +1 -0
- package/dist/utils/transform-source/utils/standardize-common-words.js +26 -0
- package/dist/utils/transform-source/utils/standardize-organization-display-name.cjs +1 -0
- package/dist/utils/transform-source/utils/standardize-organization-display-name.d.cts +8 -0
- package/dist/utils/transform-source/utils/standardize-organization-display-name.d.ts +8 -0
- package/dist/utils/transform-source/utils/standardize-organization-display-name.js +10 -0
- package/dist/utils/transform-source/utils/standardize-suffixes.cjs +1 -0
- package/dist/utils/transform-source/utils/standardize-suffixes.d.cts +5 -0
- package/dist/utils/transform-source/utils/standardize-suffixes.d.ts +5 -0
- package/dist/utils/transform-source/utils/standardize-suffixes.js +16 -0
- package/dist/utils/transform-source/utils/strip-branding-keywords.cjs +1 -0
- package/dist/utils/transform-source/utils/strip-branding-keywords.d.cts +17 -0
- package/dist/utils/transform-source/utils/strip-branding-keywords.d.ts +17 -0
- package/dist/utils/transform-source/utils/strip-branding-keywords.js +14 -0
- package/package.json +111 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),i=require("./use-inkeep-search.cjs"),a=require("../../providers/search-events-provider.cjs"),c=t.createContext(void 0),u=e=>r.jsx(a.SearchEventsProviderWithBase,{children:r.jsx(s,{...e})}),s=({children:e,...o})=>{const n=i.useInkeepSearch();return r.jsx(c.Provider,{value:{...n,...o},children:e})},h=()=>{const e=t.useContext(c);if(!e)throw new Error("useSearch must be used within a SearchProvider");return e};exports.SearchProvider=u;exports.SearchProviderImpl=s;exports.useSearch=h;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useInkeepSearch } from './use-inkeep-search';
|
|
2
|
+
export interface EmbeddedSearchProviderProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether to show the search.
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
isHidden?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether to autofocus the search input on load.
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
shouldAutoFocusInput?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export type SearchContextValue = ReturnType<typeof useInkeepSearch> & Omit<EmbeddedSearchProviderProps, 'children'>;
|
|
15
|
+
interface SearchProviderProps extends Pick<EmbeddedSearchProviderProps, 'shouldAutoFocusInput' | 'isHidden'> {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare const SearchProvider: React.FC<SearchProviderProps>;
|
|
19
|
+
export declare const SearchProviderImpl: React.FC<SearchProviderProps>;
|
|
20
|
+
export declare const useSearch: () => SearchContextValue;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useInkeepSearch } from './use-inkeep-search';
|
|
2
|
+
export interface EmbeddedSearchProviderProps {
|
|
3
|
+
/**
|
|
4
|
+
* Whether to show the search.
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
isHidden?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether to autofocus the search input on load.
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
|
+
shouldAutoFocusInput?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export type SearchContextValue = ReturnType<typeof useInkeepSearch> & Omit<EmbeddedSearchProviderProps, 'children'>;
|
|
15
|
+
interface SearchProviderProps extends Pick<EmbeddedSearchProviderProps, 'shouldAutoFocusInput' | 'isHidden'> {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare const SearchProvider: React.FC<SearchProviderProps>;
|
|
19
|
+
export declare const SearchProviderImpl: React.FC<SearchProviderProps>;
|
|
20
|
+
export declare const useSearch: () => SearchContextValue;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as n, useContext as s } from "react";
|
|
4
|
+
import { useInkeepSearch as i } from "./use-inkeep-search.js";
|
|
5
|
+
import { SearchEventsProviderWithBase as a } from "../../providers/search-events-provider.js";
|
|
6
|
+
const t = n(void 0), S = (r) => /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e(h, { ...r }) }), h = ({ children: r, ...o }) => {
|
|
7
|
+
const c = i();
|
|
8
|
+
return /* @__PURE__ */ e(t.Provider, { value: { ...c, ...o }, children: r });
|
|
9
|
+
}, p = () => {
|
|
10
|
+
const r = s(t);
|
|
11
|
+
if (!r)
|
|
12
|
+
throw new Error("useSearch must be used within a SearchProvider");
|
|
13
|
+
return r;
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
S as SearchProvider,
|
|
17
|
+
h as SearchProviderImpl,
|
|
18
|
+
p as useSearch
|
|
19
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=`query GetSearchResults($searchInput: SearchInput!) {
|
|
2
|
+
search(searchInput: $searchInput) {
|
|
3
|
+
searchHits {
|
|
4
|
+
id
|
|
5
|
+
hitOnRoot
|
|
6
|
+
url
|
|
7
|
+
title
|
|
8
|
+
preview
|
|
9
|
+
|
|
10
|
+
... on DocumentationHit {
|
|
11
|
+
rootRecord {
|
|
12
|
+
__typename
|
|
13
|
+
id
|
|
14
|
+
title
|
|
15
|
+
url
|
|
16
|
+
preview
|
|
17
|
+
... on DocumentationRecord {
|
|
18
|
+
pathBreadcrumbs
|
|
19
|
+
contentType
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
pathHeadings {
|
|
23
|
+
content
|
|
24
|
+
}
|
|
25
|
+
content {
|
|
26
|
+
content
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
... on StackOverflowHit {
|
|
31
|
+
rootRecord {
|
|
32
|
+
__typename
|
|
33
|
+
id
|
|
34
|
+
title
|
|
35
|
+
url
|
|
36
|
+
preview
|
|
37
|
+
... on StackOverflowRecord {
|
|
38
|
+
body
|
|
39
|
+
createdAt
|
|
40
|
+
|
|
41
|
+
markedAsCorrectAnswer {
|
|
42
|
+
url
|
|
43
|
+
score
|
|
44
|
+
content
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
... on GitHubIssueHit {
|
|
51
|
+
rootRecord {
|
|
52
|
+
__typename
|
|
53
|
+
id
|
|
54
|
+
title
|
|
55
|
+
url
|
|
56
|
+
preview
|
|
57
|
+
... on GitHubIssueRecord {
|
|
58
|
+
createdAt
|
|
59
|
+
body
|
|
60
|
+
state
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
... on DiscourseHit {
|
|
66
|
+
rootRecord {
|
|
67
|
+
__typename
|
|
68
|
+
id
|
|
69
|
+
title
|
|
70
|
+
url
|
|
71
|
+
preview
|
|
72
|
+
... on DiscourseRecord {
|
|
73
|
+
createdAt
|
|
74
|
+
body
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
searchQuery
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
`;exports.default=n;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const n = `query GetSearchResults($searchInput: SearchInput!) {
|
|
3
|
+
search(searchInput: $searchInput) {
|
|
4
|
+
searchHits {
|
|
5
|
+
id
|
|
6
|
+
hitOnRoot
|
|
7
|
+
url
|
|
8
|
+
title
|
|
9
|
+
preview
|
|
10
|
+
|
|
11
|
+
... on DocumentationHit {
|
|
12
|
+
rootRecord {
|
|
13
|
+
__typename
|
|
14
|
+
id
|
|
15
|
+
title
|
|
16
|
+
url
|
|
17
|
+
preview
|
|
18
|
+
... on DocumentationRecord {
|
|
19
|
+
pathBreadcrumbs
|
|
20
|
+
contentType
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
pathHeadings {
|
|
24
|
+
content
|
|
25
|
+
}
|
|
26
|
+
content {
|
|
27
|
+
content
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
... on StackOverflowHit {
|
|
32
|
+
rootRecord {
|
|
33
|
+
__typename
|
|
34
|
+
id
|
|
35
|
+
title
|
|
36
|
+
url
|
|
37
|
+
preview
|
|
38
|
+
... on StackOverflowRecord {
|
|
39
|
+
body
|
|
40
|
+
createdAt
|
|
41
|
+
|
|
42
|
+
markedAsCorrectAnswer {
|
|
43
|
+
url
|
|
44
|
+
score
|
|
45
|
+
content
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
... on GitHubIssueHit {
|
|
52
|
+
rootRecord {
|
|
53
|
+
__typename
|
|
54
|
+
id
|
|
55
|
+
title
|
|
56
|
+
url
|
|
57
|
+
preview
|
|
58
|
+
... on GitHubIssueRecord {
|
|
59
|
+
createdAt
|
|
60
|
+
body
|
|
61
|
+
state
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
... on DiscourseHit {
|
|
67
|
+
rootRecord {
|
|
68
|
+
__typename
|
|
69
|
+
id
|
|
70
|
+
title
|
|
71
|
+
url
|
|
72
|
+
preview
|
|
73
|
+
... on DiscourseRecord {
|
|
74
|
+
createdAt
|
|
75
|
+
body
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
searchQuery
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`;
|
|
84
|
+
export {
|
|
85
|
+
n as default
|
|
86
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),S=require("../../providers/config-provider.cjs"),T=(e,o)=>{const{baseSettings:{transformSource:r,organizationDisplayName:s},searchSettings:{tabs:u,searchQueryParamKey:p,shouldOpenLinksInNewTab:g}}=S.useInkeepConfig();return w.useMemo(()=>{const R=u.length>0?u:["All"],n={},y=new Set,i=R.map(t=>typeof t=="string"?t:t[0]);for(const t of i)n[t]=[];for(const t of e){const c=t.url||"";if(y.has(c))continue;y.add(c);const d=v(c,o,p),a=r({title:t.title,url:d,description:k(t),type:D(t.rootRecord.__typename),tag:I(t),breadcrumbs:t.rootRecord.pathBreadcrumbs,contentType:t.rootRecord.contentType},"searchResultItem",{organizationDisplayName:s,tabs:u}),l={...a,id:t.id,isExternal:g||!!a.shouldOpenInNewTab},m=l.tabs||[];for(const f of m){const b=typeof f=="string"?f:f[0];if(!i.includes(b)){console.warn(`Tab "${b}" found in item but not configured in tabs`);continue}n[b].push(l)}i.includes("All")&&n.All.push(l)}for(const t of Object.keys(n)){const c=R.find(a=>typeof a=="string"?a===t:a[0]===t),d=typeof c=="object"?c[1]?.alwaysVisible===!0:!1;n[t].length===0&&!d&&delete n[t]}return n},[e,r,s,u,o,p,g])};function v(e,o,r){try{const s=new URL(e);return s.searchParams.set(r,o),s.toString()}catch{return e}}const k=e=>{switch(e.rootRecord.__typename){case"DocumentationRecord":{const o=h(e.pathHeadings?.at(-1)?.content||""),r=h(e.content?.content||"");return e.preview||r||o}case"GitHubIssueRecord":case"StackOverflowRecord":case"DiscourseRecord":return e.rootRecord.body;default:return e.preview}},I=e=>{switch(e.rootRecord.__typename){case"StackOverflowRecord":return e.rootRecord.markedAsCorrectAnswer?"Resolved":void 0;case"GitHubIssueRecord":return e.rootRecord.state==="CLOSED"?"Closed":void 0}},h=e=>{const o=/(https?:\/\/\S+)/g;return e.replace(o,r=>{const s=r.split("/");return s.length>3?`...${s.slice(-2).join("/")}`:r})},D=e=>{switch(e){case"DocumentationRecord":return"documentation";case"GitHubIssueRecord":return"github_issue";case"DiscourseRecord":return"discourse";case"DiscordRecord":return"discord";case"StackOverflowRecord":return"stackoverflow";case"SlackEntry":return"slack_message";default:return"site"}};exports.useTransformResults=T;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMemo as w } from "react";
|
|
3
|
+
import { useInkeepConfig as S } from "../../providers/config-provider.js";
|
|
4
|
+
const O = (e, r) => {
|
|
5
|
+
const {
|
|
6
|
+
baseSettings: { transformSource: o, organizationDisplayName: s },
|
|
7
|
+
searchSettings: { tabs: u, searchQueryParamKey: b, shouldOpenLinksInNewTab: g }
|
|
8
|
+
} = S();
|
|
9
|
+
return w(() => {
|
|
10
|
+
const R = u.length > 0 ? u : ["All"], n = {}, m = /* @__PURE__ */ new Set(), i = R.map((t) => typeof t == "string" ? t : t[0]);
|
|
11
|
+
for (const t of i)
|
|
12
|
+
n[t] = [];
|
|
13
|
+
for (const t of e) {
|
|
14
|
+
const c = t.url || "";
|
|
15
|
+
if (m.has(c)) continue;
|
|
16
|
+
m.add(c);
|
|
17
|
+
const d = T(c, r, b), a = o(
|
|
18
|
+
{
|
|
19
|
+
title: t.title,
|
|
20
|
+
url: d,
|
|
21
|
+
description: k(t),
|
|
22
|
+
type: v(t.rootRecord.__typename),
|
|
23
|
+
tag: I(t),
|
|
24
|
+
breadcrumbs: t.rootRecord.pathBreadcrumbs,
|
|
25
|
+
contentType: t.rootRecord.contentType
|
|
26
|
+
},
|
|
27
|
+
"searchResultItem",
|
|
28
|
+
{ organizationDisplayName: s, tabs: u }
|
|
29
|
+
), l = {
|
|
30
|
+
...a,
|
|
31
|
+
id: t.id,
|
|
32
|
+
isExternal: g || !!a.shouldOpenInNewTab
|
|
33
|
+
}, y = l.tabs || [];
|
|
34
|
+
for (const f of y) {
|
|
35
|
+
const p = typeof f == "string" ? f : f[0];
|
|
36
|
+
if (!i.includes(p)) {
|
|
37
|
+
console.warn(`Tab "${p}" found in item but not configured in tabs`);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
n[p].push(l);
|
|
41
|
+
}
|
|
42
|
+
i.includes("All") && n.All.push(l);
|
|
43
|
+
}
|
|
44
|
+
for (const t of Object.keys(n)) {
|
|
45
|
+
const c = R.find((a) => typeof a == "string" ? a === t : a[0] === t), d = typeof c == "object" ? c[1]?.alwaysVisible === !0 : !1;
|
|
46
|
+
n[t].length === 0 && !d && delete n[t];
|
|
47
|
+
}
|
|
48
|
+
return n;
|
|
49
|
+
}, [
|
|
50
|
+
e,
|
|
51
|
+
o,
|
|
52
|
+
s,
|
|
53
|
+
u,
|
|
54
|
+
r,
|
|
55
|
+
b,
|
|
56
|
+
g
|
|
57
|
+
]);
|
|
58
|
+
};
|
|
59
|
+
function T(e, r, o) {
|
|
60
|
+
try {
|
|
61
|
+
const s = new URL(e);
|
|
62
|
+
return s.searchParams.set(o, r), s.toString();
|
|
63
|
+
} catch {
|
|
64
|
+
return e;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const k = (e) => {
|
|
68
|
+
switch (e.rootRecord.__typename) {
|
|
69
|
+
case "DocumentationRecord": {
|
|
70
|
+
const r = h(e.pathHeadings?.at(-1)?.content || ""), o = h(e.content?.content || "");
|
|
71
|
+
return e.preview || o || r;
|
|
72
|
+
}
|
|
73
|
+
case "GitHubIssueRecord":
|
|
74
|
+
case "StackOverflowRecord":
|
|
75
|
+
case "DiscourseRecord":
|
|
76
|
+
return e.rootRecord.body;
|
|
77
|
+
default:
|
|
78
|
+
return e.preview;
|
|
79
|
+
}
|
|
80
|
+
}, I = (e) => {
|
|
81
|
+
switch (e.rootRecord.__typename) {
|
|
82
|
+
case "StackOverflowRecord":
|
|
83
|
+
return e.rootRecord.markedAsCorrectAnswer ? "Resolved" : void 0;
|
|
84
|
+
case "GitHubIssueRecord":
|
|
85
|
+
return e.rootRecord.state === "CLOSED" ? "Closed" : void 0;
|
|
86
|
+
}
|
|
87
|
+
}, h = (e) => {
|
|
88
|
+
const r = /(https?:\/\/\S+)/g;
|
|
89
|
+
return e.replace(r, (o) => {
|
|
90
|
+
const s = o.split("/");
|
|
91
|
+
return s.length > 3 ? `...${s.slice(-2).join("/")}` : o;
|
|
92
|
+
});
|
|
93
|
+
}, v = (e) => {
|
|
94
|
+
switch (e) {
|
|
95
|
+
case "DocumentationRecord":
|
|
96
|
+
return "documentation";
|
|
97
|
+
case "GitHubIssueRecord":
|
|
98
|
+
return "github_issue";
|
|
99
|
+
case "DiscourseRecord":
|
|
100
|
+
return "discourse";
|
|
101
|
+
case "DiscordRecord":
|
|
102
|
+
return "discord";
|
|
103
|
+
case "StackOverflowRecord":
|
|
104
|
+
return "stackoverflow";
|
|
105
|
+
case "SlackEntry":
|
|
106
|
+
return "slack_message";
|
|
107
|
+
default:
|
|
108
|
+
return "site";
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
export {
|
|
112
|
+
O as useTransformResults
|
|
113
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),W=require("../../providers/config-provider.cjs"),G=require("../../hooks/use-media-query.cjs"),J=require("./search-query.graphql.cjs"),V=require("./transform-results.cjs"),X=require("../../providers/search-events-provider.cjs"),Y=require("../../hooks/use-instant-update.cjs"),Z=require("../../utils/graphql-client.cjs"),ee=()=>{const{baseSettings:U,searchSettings:_}=W.useInkeepConfig(),{apiKey:p,baseUrl:j,userAuthToken:i}=U,{maximumHitsLimit:S,placeholder:Q,defaultQuery:H,debounceTime:R,onQueryChange:N,searchFunctionsRef:O}=_,{logEvent:q}=X.useSearchEvents(),[c,C]=t.useState(H),T=t.useRef(null),[k,v]=t.useState(!1),[x,l]=t.useState(null),[F,a]=t.useState("NONE"),$=t.useCallback(e=>{a(e)},[]),[h,d]=t.useState([]),s=V.useTransformResults(h,c),[f,E]=t.useState("All"),{disableTransition:w,disabled:z}=Y.useInstantUpdate(),B=t.useCallback(e=>{w(),E(e),a(s[e][0].id)},[s,w]);t.useEffect(()=>{let e=f in s?f:Object.keys(s)[0];if(!s[e]?.length){const n=Object.keys(s).find(u=>s[u]?.length);n?e=n:e="All"}if(!e)return;E(e);const r=s[e]?.[0];r&&a(r.id)},[s]);const y=G.useMediaQuery("(max-width: 768px)"),o=t.useRef({}),b=t.useRef(null),m=t.useRef(null);t.useImperativeHandle(O,()=>({updateQuery(e){C(e)},focusInput:()=>{T.current?.focus()}}));const M=`${j}/graphql`,A=t.useMemo(()=>({Authorization:`Bearer ${p}`,"Content-Type":"application/json",...i?{"User-Token":i}:{}}),[p,i]),I=t.useCallback(async e=>{b.current&&b.current.abort();const r=new AbortController;b.current=r;try{v(!0),l(null);const u=(await Z.graphqlRequest(M,J.default,{searchInput:e},A))?.search.searchHits;o.current[e.searchQuery]=u,d(u)}catch(n){if(n.name==="AbortError")return;l("Failed to fetch search results. Please try again.")}v(!1)},[M,A]),L=t.useCallback(e=>{const r=o.current[e.searchQuery];q({eventName:"search_query_response_received",properties:{searchQuery:e.searchQuery,totalHits:r?.length}})},[]),P=t.useCallback(e=>{if(m.current&&window.clearTimeout(m.current),!e.searchQuery){d([]),l(null);return}m.current=window.setTimeout(()=>{q({eventName:"search_query_submitted",properties:{searchQuery:e.searchQuery}}),o.current[e.searchQuery]?(d(o.current[e.searchQuery]),L(e)):I(e).then(()=>{L(e)})},R)},[R,I]),g=t.useMemo(()=>({searchQuery:c,filters:{limit:S}}),[c,S]);t.useEffect(()=>{N?.(g.searchQuery),P(g)},[P,g]);const D=t.useCallback(e=>C(e.target.value),[]),K=t.useMemo(()=>Q||(y?"Search...":"Search for anything..."),[Q,y]);return{results:s,resultsList:h,hasContent:h.length>0||k,loading:k,error:x,query:c,onInput:D,placeholder:K,tab:f,onTabChange:B,selectedItem:F,setSelectedItem:a,onSelectedItemChange:$,transitionsDisabled:z,inputRef:T,isMobile:y}};exports.useInkeepSearch=ee;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SearchHit } from '@inkeep/cxkit-types';
|
|
2
|
+
import { TransformedSourceItem } from '../..';
|
|
3
|
+
import { Dispatch, SetStateAction, RefObject } from 'react';
|
|
4
|
+
export declare const useInkeepSearch: () => {
|
|
5
|
+
results: Record<string, TransformedSourceItem[]>;
|
|
6
|
+
resultsList: SearchHit[];
|
|
7
|
+
hasContent: boolean;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
error: string | null;
|
|
10
|
+
query: string;
|
|
11
|
+
onInput: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
12
|
+
placeholder: string;
|
|
13
|
+
tab: string;
|
|
14
|
+
onTabChange: (value: string) => void;
|
|
15
|
+
selectedItem: string | undefined;
|
|
16
|
+
setSelectedItem: Dispatch<SetStateAction<string | undefined>>;
|
|
17
|
+
onSelectedItemChange: (value: string) => void;
|
|
18
|
+
transitionsDisabled: boolean;
|
|
19
|
+
inputRef: RefObject<HTMLInputElement | null>;
|
|
20
|
+
isMobile: boolean;
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SearchHit } from '@inkeep/cxkit-types';
|
|
2
|
+
import { TransformedSourceItem } from '../..';
|
|
3
|
+
import { Dispatch, SetStateAction, RefObject } from 'react';
|
|
4
|
+
export declare const useInkeepSearch: () => {
|
|
5
|
+
results: Record<string, TransformedSourceItem[]>;
|
|
6
|
+
resultsList: SearchHit[];
|
|
7
|
+
hasContent: boolean;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
error: string | null;
|
|
10
|
+
query: string;
|
|
11
|
+
onInput: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
12
|
+
placeholder: string;
|
|
13
|
+
tab: string;
|
|
14
|
+
onTabChange: (value: string) => void;
|
|
15
|
+
selectedItem: string | undefined;
|
|
16
|
+
setSelectedItem: Dispatch<SetStateAction<string | undefined>>;
|
|
17
|
+
onSelectedItemChange: (value: string) => void;
|
|
18
|
+
transitionsDisabled: boolean;
|
|
19
|
+
inputRef: RefObject<HTMLInputElement | null>;
|
|
20
|
+
isMobile: boolean;
|
|
21
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState as s, useRef as l, useCallback as n, useEffect as j, useImperativeHandle as X, useMemo as T } from "react";
|
|
3
|
+
import { useInkeepConfig as Y } from "../../providers/config-provider.js";
|
|
4
|
+
import { useMediaQuery as Z } from "../../hooks/use-media-query.js";
|
|
5
|
+
import ee from "./search-query.graphql.js";
|
|
6
|
+
import { useTransformResults as te } from "./transform-results.js";
|
|
7
|
+
import { useSearchEvents as re } from "../../providers/search-events-provider.js";
|
|
8
|
+
import { useInstantUpdate as se } from "../../hooks/use-instant-update.js";
|
|
9
|
+
import { graphqlRequest as ne } from "../../utils/graphql-client.js";
|
|
10
|
+
const fe = () => {
|
|
11
|
+
const { baseSettings: M, searchSettings: O } = Y(), { apiKey: R, baseUrl: F, userAuthToken: h } = M, {
|
|
12
|
+
maximumHitsLimit: S,
|
|
13
|
+
placeholder: C,
|
|
14
|
+
defaultQuery: P,
|
|
15
|
+
debounceTime: k,
|
|
16
|
+
onQueryChange: $,
|
|
17
|
+
searchFunctionsRef: z
|
|
18
|
+
} = O, { logEvent: v } = re(), [c, w] = s(P), q = l(null), [A, E] = s(!1), [B, m] = s(null), [D, a] = s("NONE"), K = n((e) => {
|
|
19
|
+
a(e);
|
|
20
|
+
}, []), [f, d] = s([]), t = te(f, c), [y, L] = s("All"), { disableTransition: _, disabled: W } = se(), G = n(
|
|
21
|
+
(e) => {
|
|
22
|
+
_(), L(e), a(t[e][0].id);
|
|
23
|
+
},
|
|
24
|
+
[t, _]
|
|
25
|
+
);
|
|
26
|
+
j(() => {
|
|
27
|
+
let e = y in t ? y : Object.keys(t)[0];
|
|
28
|
+
if (!t[e]?.length) {
|
|
29
|
+
const o = Object.keys(t).find((u) => t[u]?.length);
|
|
30
|
+
o ? e = o : e = "All";
|
|
31
|
+
}
|
|
32
|
+
if (!e) return;
|
|
33
|
+
L(e);
|
|
34
|
+
const r = t[e]?.[0];
|
|
35
|
+
r && a(r.id);
|
|
36
|
+
}, [t]);
|
|
37
|
+
const p = Z("(max-width: 768px)"), i = l({}), b = l(null), g = l(null);
|
|
38
|
+
X(z, () => ({
|
|
39
|
+
updateQuery(e) {
|
|
40
|
+
w(e);
|
|
41
|
+
},
|
|
42
|
+
focusInput: () => {
|
|
43
|
+
q.current?.focus();
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
const x = `${F}/graphql`, H = T(
|
|
47
|
+
() => ({
|
|
48
|
+
Authorization: `Bearer ${R}`,
|
|
49
|
+
"Content-Type": "application/json",
|
|
50
|
+
...h ? { "User-Token": h } : {}
|
|
51
|
+
}),
|
|
52
|
+
[R, h]
|
|
53
|
+
), I = n(
|
|
54
|
+
async (e) => {
|
|
55
|
+
b.current && b.current.abort();
|
|
56
|
+
const r = new AbortController();
|
|
57
|
+
b.current = r;
|
|
58
|
+
try {
|
|
59
|
+
E(!0), m(null);
|
|
60
|
+
const u = (await ne(x, ee, { searchInput: e }, H))?.search.searchHits;
|
|
61
|
+
i.current[e.searchQuery] = u, d(u);
|
|
62
|
+
} catch (o) {
|
|
63
|
+
if (o.name === "AbortError")
|
|
64
|
+
return;
|
|
65
|
+
m("Failed to fetch search results. Please try again.");
|
|
66
|
+
}
|
|
67
|
+
E(!1);
|
|
68
|
+
},
|
|
69
|
+
[x, H]
|
|
70
|
+
), N = n((e) => {
|
|
71
|
+
const r = i.current[e.searchQuery];
|
|
72
|
+
v({
|
|
73
|
+
eventName: "search_query_response_received",
|
|
74
|
+
properties: {
|
|
75
|
+
searchQuery: e.searchQuery,
|
|
76
|
+
totalHits: r?.length
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}, []), U = n(
|
|
80
|
+
(e) => {
|
|
81
|
+
if (g.current && window.clearTimeout(g.current), !e.searchQuery) {
|
|
82
|
+
d([]), m(null);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
g.current = window.setTimeout(() => {
|
|
86
|
+
v({
|
|
87
|
+
eventName: "search_query_submitted",
|
|
88
|
+
properties: {
|
|
89
|
+
searchQuery: e.searchQuery
|
|
90
|
+
}
|
|
91
|
+
}), i.current[e.searchQuery] ? (d(i.current[e.searchQuery]), N(e)) : I(e).then(() => {
|
|
92
|
+
N(e);
|
|
93
|
+
});
|
|
94
|
+
}, k);
|
|
95
|
+
},
|
|
96
|
+
[k, I]
|
|
97
|
+
), Q = T(
|
|
98
|
+
() => ({
|
|
99
|
+
searchQuery: c,
|
|
100
|
+
filters: {
|
|
101
|
+
limit: S
|
|
102
|
+
}
|
|
103
|
+
}),
|
|
104
|
+
[c, S]
|
|
105
|
+
);
|
|
106
|
+
j(() => {
|
|
107
|
+
$?.(Q.searchQuery), U(Q);
|
|
108
|
+
}, [U, Q]);
|
|
109
|
+
const J = n(
|
|
110
|
+
(e) => w(e.target.value),
|
|
111
|
+
[]
|
|
112
|
+
), V = T(
|
|
113
|
+
() => C || (p ? "Search..." : "Search for anything..."),
|
|
114
|
+
[C, p]
|
|
115
|
+
);
|
|
116
|
+
return {
|
|
117
|
+
results: t,
|
|
118
|
+
resultsList: f,
|
|
119
|
+
hasContent: f.length > 0 || A,
|
|
120
|
+
loading: A,
|
|
121
|
+
error: B,
|
|
122
|
+
query: c,
|
|
123
|
+
onInput: J,
|
|
124
|
+
placeholder: V,
|
|
125
|
+
tab: y,
|
|
126
|
+
onTabChange: G,
|
|
127
|
+
selectedItem: D,
|
|
128
|
+
setSelectedItem: a,
|
|
129
|
+
onSelectedItemChange: K,
|
|
130
|
+
transitionsDisabled: W,
|
|
131
|
+
inputRef: q,
|
|
132
|
+
isMobile: p
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
export {
|
|
136
|
+
fe as useInkeepSearch
|
|
137
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),S=require("cmdk"),i=require("./factory.cjs"),l=require("../utils/misc.cjs"),m=require("react"),o=require("./embedded-search/search-provider.cjs"),ae=require("./tagline-logo-icon.cjs"),v=require("../atoms/icons/custom-icon.cjs"),ne=require("react-textarea-autosize"),ce=require("@radix-ui/react-scroll-area"),oe=require("@radix-ui/react-tabs"),P=require("../providers/config-provider.cjs"),de=require("../providers/search-events-provider.cjs"),le=require("../atoms/link.cjs"),h=require("../providers/source-item-provider.cjs"),A=require("../atoms/icons/built-in-icon-renderer.cjs"),ue=require("../utils/highlight-emphasis.cjs"),me=require("../hooks/use-scrolling-fades.cjs"),he=require("@inkeep/cxkit-color-mode"),Se=require("../atoms/avatars/ai.cjs"),T=require("./modal/modal-provider.cjs"),_=require("../utils/compose-refs.cjs"),I=require("../utils/compose-event-handlers.cjs");function f(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const b=f(ce),g=f(oe),pe=i.ikp("div",{_id:"aiSearchWrapper"}),L=t=>{const{isHidden:e,hasContent:r,isMobile:s}=o.useSearch(),n=T.useModal();return a.jsx(pe,{"data-hidden":l.dataAttr(e),"data-has-content":l.dataAttr(r),"data-in-modal":l.dataAttr(!!n),"data-mobile":l.dataAttr(s),...t})},be=i.ikp(S.Command,{_id:"aiSearchRoot"}),y=t=>{const{isHidden:e,selectedItem:r,onSelectedItemChange:s}=o.useSearch();return a.jsx(be,{"data-hidden":l.dataAttr(e),shouldFilter:!1,loop:!1,value:r,onValueChange:s,...t})},C=i.ikp(S.Command.List,{_id:"aiSearchContent"}),x=i.ikp("div",{_id:"aiSearchInputGroup"}),j=i.ikp(v.CustomIcon,{_id:"aiSearchInputIcon",iconKey:"search"}),Ie=i.ikp(S.Command.Input,{_id:"aiSearchInput"}),q=m.forwardRef(({onInput:t,...e},r)=>{const{query:s,onInput:n,placeholder:c,inputRef:d,shouldAutoFocusInput:u}=o.useSearch(),p=_.useComposedRefs(r,d),R=T.useModal();return m.useEffect(()=>{requestAnimationFrame(()=>{u&&d?.current&&(d.current.focus(),d.current.selectionStart=d.current.value.length)})},[u,d,R?.open]),a.jsx(Ie,{asChild:!0,ref:p,placeholder:c,value:s,onInput:I.composeEventHandlers(t,n),...e,children:a.jsx(ne,{minRows:1,maxLength:1e3})})}),ve=i.ikp(A.BuiltInIconRenderer,{_id:"aiSearchLoading",iconSettings:{builtIn:"LuLoaderCircle"}}),w=t=>{const{loading:e,resultsList:r}=o.useSearch();return!e||r.length===0?null:a.jsx(ve,{...t})},ge=i.ikp(S.Command.Item,{_id:"aiAskAITrigger",value:"__ask_ai__"}),B=t=>{const{setSelectedItem:e,results:r,tab:s}=o.useSearch(),n=r[s]?.[0]?.id??"NONE";return a.jsx(ge,{...t,onPointerLeave:()=>e(n)})},Re=i.ikp("img",{_id:"aiAskAITrigger__Icon"}),D=t=>{const{aiChatSettings:e}=P.useInkeepConfig(),{botAvatarSrcUrl:r,botAvatarDarkSrcUrl:s}=e??{},n=s??r,c=he.useColorModeValue(r,n),[d,u]=m.useState(c);m.useEffect(()=>{u(c)},[c]);const p=()=>{u(null)};return a.jsx(Re,{asChild:!0,...t,children:d?a.jsx("img",{src:d,alt:"AI Avatar","data-type":"image",onError:I.composeEventHandlers(p),...t}):a.jsx(Se.default,{"data-type":"icon",...t})})},N=i.ikp("span",{_id:"aiAskAITrigger__Label"}),F=i.ikp(v.CustomIcon,{_id:"aiAskAITrigger__Indicator",iconKey:"openLinkInSameTab"}),Pe=i.ikp(g.Root,{_id:"aiSearchResults"}),O=t=>{const{tab:e,onTabChange:r,hasContent:s}=o.useSearch();return a.jsx(Pe,{value:e,onValueChange:r,"data-has-content":l.dataAttr(s),...t})},_e=i.ikp("div",{_id:"aiSearchResults__Loading"}),M=t=>{const{loading:e,resultsList:r}=o.useSearch();return!e||r.length>0?null:a.jsx(_e,{...t})},Ee=i.ikp(S.Command.Empty,{_id:"aiSearchResults__Empty"}),V=t=>{const{query:e,loading:r,results:s,tab:n}=o.useSearch(),c=s[n]?.length;return r||!e||c?null:a.jsx(Ee,{children:"No results found.",...t})},ke=i.ikp(g.List,{_id:"aiSearchResults__TabList"}),H=t=>{const{children:e,...r}=t,{searchSettings:{tabs:s}}=P.useInkeepConfig(),{results:n,loading:c,resultsList:d}=o.useSearch();if(c&&d.length===0)return null;const u=Object.keys(n);return!s.length||!u.length?null:a.jsx(ke,{children:l.maybeRender(e,u),...r})},Ae=i.ikp(g.Trigger,{_id:"aiSearchResults__Tab"}),U=t=>{const{tab:e,...r}=t,{results:s}=o.useSearch(),n=s[e].length;return a.jsx(Ae,{value:e,children:`${e} (${n})`,...r})},Te=i.ikp(b.Root,{_id:"aiSearchResults__ScrollArea"}),W=t=>{const{loading:e,resultsList:r}=o.useSearch();return e&&r.length===0?null:a.jsx(Te,{...t})},fe=i.ikp(b.Viewport,{_id:"aiSearchResults__ScrollAreaViewport"}),G=m.forwardRef(({children:t,...e},r)=>{const s=me.useScrollingFades(),n=_.useComposedRefs(r,s),{tab:c}=o.useSearch();return m.useEffect(()=>{c&&s.current?.scrollTo({top:0,behavior:"auto"})},[c]),a.jsx(fe,{ref:n,children:a.jsx("div",{style:{display:"grid"},children:t}),...e})}),Le=i.ikp(b.ScrollAreaScrollbar,{_id:"aiSearchResults__ScrollAreaScrollbar"}),ye=i.ikp(b.ScrollAreaThumb,{_id:"aiSearchResults__ScrollAreaThumb"}),Ce=i.ikp(b.Corner,{_id:"aiSearchResults__ScrollAreaCorner"}),xe=i.ikp(g.Content,{_id:"aiSearchResults__List"}),K=t=>{const{children:e,...r}=t,{results:s,tab:n}=o.useSearch(),c=s[n]??[];return a.jsx(xe,{value:n,"data-has-results":l.dataAttr(c.length>0),"aria-label":"Search results",children:l.maybeRender(e,c),...r})},je=i.ikp(S.Command.Item,{_id:"aiSearchResults__Item",asChild:!0}),z=m.forwardRef(({item:t,onClick:e,onSelect:r,children:s,...n},c)=>{const{searchSettings:{shouldOpenLinksInNewTab:d}}=P.useInkeepConfig(),{logEvent:u}=de.useSearchEvents(),{query:p,transitionsDisabled:R}=o.useSearch(),E=m.useRef(null),re=_.useComposedRefs(c,E),ie=()=>{E.current?.click()},se=()=>{u({eventName:"search_result_clicked",properties:{searchQuery:p,title:t.title,url:t.url}})},k=d||!!t.shouldOpenInNewTab;return a.jsx(h.SourceItemProvider,{source:{...t,isExternal:k},children:a.jsx(je,{ref:re,value:t.id,"data-type":t.type,"data-breadcrumbs":!!t.breadcrumbs?.length,"data-disable-transitions":l.dataAttr(R),onSelect:I.composeEventHandlers(r,ie),onClick:I.composeEventHandlers(e,se),...n,children:a.jsx(le.LinkWithQueryParams,{href:t.url,isExternal:k,appendToUrl:t.appendToUrl,children:s})})})}),qe=i.ikp("div",{_id:"aiSearchResults__ItemBreadcrumbs"}),Q=t=>{const{source:e}=h.useSourceItem(),{tab:r}=o.useSearch();if(!e.breadcrumbs?.length)return null;const{children:s,...n}=t,d=e.tabs?.find(u=>typeof u!="string"&&u[0]===r)?.[1]?.breadcrumbs??e.breadcrumbs??[];return a.jsx(qe,{children:l.maybeRender(s,d),...n})},we=i.ikp(v.CustomIcon,{_id:"aiSearchResults__ItemBreadcrumbIcon",iconKey:"breadcrumbSeparator"}),Be=i.ikp(A.BuiltInIconRenderer,{_id:"aiSearchResults__ItemIcon"}),$=t=>{const{source:e}=h.useSourceItem();return a.jsx(Be,{iconSettings:e.icon,"data-type":e.type,...t})},De=i.ikp("span",{_id:"aiSearchResults__ItemTitle"}),J=t=>{const{source:e}=h.useSourceItem();return a.jsx(De,{"data-type":e.type,children:e.title,...t})},Ne=i.ikp("span",{_id:"aiSearchResults__ItemTag"}),X=t=>{const{source:e}=h.useSourceItem();return a.jsx(Ne,{"data-type":e.type,children:e.tag,...t})},Fe=i.ikp("span",{_id:"aiSearchResults__ItemDescription"}),Y=t=>{const{source:e}=h.useSourceItem(),{children:r,...s}=t,n=m.useMemo(()=>e.description?ue.highlightEmphasis(e.description):[],[e.description]);return n.length?a.jsx(Fe,{"data-type":e.type,children:l.maybeRender(r,n),...s}):null},Oe=i.ikp("span",{_id:"aiSearchResults__ItemDescriptionPart"}),Z=t=>{const{part:e,...r}=t,{source:s}=h.useSourceItem();return typeof e=="string"?e:a.jsx(Oe,{"data-type":s.type,children:e.content,"data-highlighted":l.dataAttr(e.highlighted),...r})},Me=i.ikp(v.CustomIcon,{_id:"aiSearchResults__ItemIndicator"}),ee=t=>{const{source:e}=h.useSourceItem();return a.jsx(Me,{iconKey:e.isExternal?"openLinkInNewTab":"openLinkInSameTab",...t})},Ve=i.ikp("div",{_id:"aiSearchFooter"}),te=t=>{const{resultsList:e}=o.useSearch();return a.jsx(Ve,{"data-has-results":l.dataAttr(e.length>0),...t})},He=i.ikp("div",{_id:"aiSearchTagline__Container"}),Ue=i.ikp("span",{_id:"aiSearchTagline__Text",children:"Powered by"}),We=i.ikp(ae.default,{_id:"aiSearchTagline__Logo"}),Ge=i.ikp("a",{_id:"aiSearchTagline__BrandName",children:"inkeep",href:"https://www.inkeep.com/",target:"_blank",rel:"noopener noreferrer"});exports.Provider=o.SearchProvider;exports.AskAITrigger=B;exports.AskAITriggerIcon=D;exports.AskAITriggerIndicator=F;exports.AskAITriggerLabel=N;exports.Content=C;exports.EmbeddedSearchInputIcon=j;exports.EmbeddedSearchPrimitiveAskAITrigger=B;exports.EmbeddedSearchPrimitiveAskAITriggerIcon=D;exports.EmbeddedSearchPrimitiveAskAITriggerIndicator=F;exports.EmbeddedSearchPrimitiveAskAITriggerLabel=N;exports.EmbeddedSearchPrimitiveContent=C;exports.EmbeddedSearchPrimitiveFooter=te;exports.EmbeddedSearchPrimitiveInput=q;exports.EmbeddedSearchPrimitiveInputGroup=x;exports.EmbeddedSearchPrimitiveLoading=w;exports.EmbeddedSearchPrimitiveResults=O;exports.EmbeddedSearchPrimitiveResultsEmpty=V;exports.EmbeddedSearchPrimitiveResultsItem=z;exports.EmbeddedSearchPrimitiveResultsItemBreadcrumbs=Q;exports.EmbeddedSearchPrimitiveResultsItemDescription=Y;exports.EmbeddedSearchPrimitiveResultsItemDescriptionPart=Z;exports.EmbeddedSearchPrimitiveResultsItemIcon=$;exports.EmbeddedSearchPrimitiveResultsItemIndicator=ee;exports.EmbeddedSearchPrimitiveResultsItemTag=X;exports.EmbeddedSearchPrimitiveResultsItemTitle=J;exports.EmbeddedSearchPrimitiveResultsList=K;exports.EmbeddedSearchPrimitiveResultsLoading=M;exports.EmbeddedSearchPrimitiveResultsScrollArea=W;exports.EmbeddedSearchPrimitiveResultsScrollAreaViewport=G;exports.EmbeddedSearchPrimitiveResultsTab=U;exports.EmbeddedSearchPrimitiveResultsTabList=H;exports.EmbeddedSearchPrimitiveRoot=y;exports.EmbeddedSearchPrimitiveWrapper=L;exports.Footer=te;exports.Input=q;exports.InputGroup=x;exports.InputIcon=j;exports.Loading=w;exports.Results=O;exports.ResultsEmpty=V;exports.ResultsItem=z;exports.ResultsItemBreadcrumbIcon=we;exports.ResultsItemBreadcrumbs=Q;exports.ResultsItemDescription=Y;exports.ResultsItemDescriptionPart=Z;exports.ResultsItemIcon=$;exports.ResultsItemIndicator=ee;exports.ResultsItemTag=X;exports.ResultsItemTitle=J;exports.ResultsList=K;exports.ResultsLoading=M;exports.ResultsScrollArea=W;exports.ResultsScrollAreaCorner=Ce;exports.ResultsScrollAreaScrollbar=Le;exports.ResultsScrollAreaThumb=ye;exports.ResultsScrollAreaViewport=G;exports.ResultsTab=U;exports.ResultsTabList=H;exports.Root=y;exports.TaglineBrandName=Ge;exports.TaglineContainer=He;exports.TaglineLogo=We;exports.TaglineText=Ue;exports.Wrapper=L;
|