@inkeep/agents-ui 0.0.0-dev-20260313222128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +64 -0
- package/README.md +1 -0
- package/dist/_virtual/index.cjs +1 -0
- package/dist/_virtual/index.js +4 -0
- package/dist/_virtual/use-sync-external-store-shim.development.cjs +1 -0
- package/dist/_virtual/use-sync-external-store-shim.development.js +5 -0
- package/dist/_virtual/use-sync-external-store-shim.production.cjs +1 -0
- package/dist/_virtual/use-sync-external-store-shim.production.js +5 -0
- package/dist/color-mode/index.cjs +1 -0
- package/dist/color-mode/index.d.ts +20 -0
- package/dist/color-mode/index.js +170 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +238 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.cjs +9 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +68 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.cjs +9 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +56 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/shim/index.cjs +1 -0
- package/dist/node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/shim/index.js +8 -0
- package/dist/primitives/atoms/avatars/ai.cjs +1 -0
- package/dist/primitives/atoms/avatars/ai.d.ts +3 -0
- package/dist/primitives/atoms/avatars/ai.js +99 -0
- package/dist/primitives/atoms/avatars/user.cjs +1 -0
- package/dist/primitives/atoms/avatars/user.d.ts +3 -0
- package/dist/primitives/atoms/avatars/user.js +27 -0
- package/dist/primitives/atoms/cmdk/command-score.cjs +1 -0
- package/dist/primitives/atoms/cmdk/command-score.d.ts +1 -0
- package/dist/primitives/atoms/cmdk/command-score.js +46 -0
- package/dist/primitives/atoms/cmdk/index.cjs +1 -0
- package/dist/primitives/atoms/cmdk/index.d.ts +460 -0
- package/dist/primitives/atoms/cmdk/index.js +521 -0
- package/dist/primitives/atoms/codeblock/index.cjs +1 -0
- package/dist/primitives/atoms/codeblock/index.d.ts +10 -0
- package/dist/primitives/atoms/codeblock/index.js +40 -0
- package/dist/primitives/atoms/combobox.cjs +1 -0
- package/dist/primitives/atoms/combobox.js +275 -0
- package/dist/primitives/atoms/custom-styles.cjs +1 -0
- package/dist/primitives/atoms/custom-styles.d.ts +5 -0
- package/dist/primitives/atoms/custom-styles.js +57 -0
- package/dist/primitives/atoms/dialog.cjs +1 -0
- package/dist/primitives/atoms/dialog.d.ts +94 -0
- package/dist/primitives/atoms/dialog.js +227 -0
- package/dist/primitives/atoms/error-boundary.cjs +1 -0
- package/dist/primitives/atoms/error-boundary.d.ts +6 -0
- package/dist/primitives/atoms/error-boundary.js +9 -0
- package/dist/primitives/atoms/icons/built-in-icon-renderer.cjs +1 -0
- package/dist/primitives/atoms/icons/built-in-icon-renderer.d.ts +6 -0
- package/dist/primitives/atoms/icons/built-in-icon-renderer.js +51 -0
- package/dist/primitives/atoms/icons/built-in-icons.cjs +1 -0
- package/dist/primitives/atoms/icons/built-in-icons.d.ts +86 -0
- package/dist/primitives/atoms/icons/built-in-icons.js +89 -0
- package/dist/primitives/atoms/icons/checkbox-icon.cjs +1 -0
- package/dist/primitives/atoms/icons/checkbox-icon.d.ts +1 -0
- package/dist/primitives/atoms/icons/checkbox-icon.js +24 -0
- package/dist/primitives/atoms/icons/collections/bi.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/bi.d.ts +4 -0
- package/dist/primitives/atoms/icons/collections/bi.js +49 -0
- package/dist/primitives/atoms/icons/collections/fi.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/fi.d.ts +2 -0
- package/dist/primitives/atoms/icons/collections/fi.js +29 -0
- package/dist/primitives/atoms/icons/collections/gr.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/gr.d.ts +2 -0
- package/dist/primitives/atoms/icons/collections/gr.js +21 -0
- package/dist/primitives/atoms/icons/collections/io5.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/io5.d.ts +34 -0
- package/dist/primitives/atoms/icons/collections/io5.js +806 -0
- package/dist/primitives/atoms/icons/collections/pi.cjs +1 -0
- package/dist/primitives/atoms/icons/collections/pi.d.ts +4 -0
- package/dist/primitives/atoms/icons/collections/pi.js +49 -0
- package/dist/primitives/atoms/icons/custom-icon.cjs +1 -0
- package/dist/primitives/atoms/icons/custom-icon.d.ts +6 -0
- package/dist/primitives/atoms/icons/custom-icon.js +19 -0
- package/dist/primitives/atoms/icons/generate-icon.cjs +1 -0
- package/dist/primitives/atoms/icons/generate-icon.d.ts +28 -0
- package/dist/primitives/atoms/icons/generate-icon.js +56 -0
- package/dist/primitives/atoms/icons/index.cjs +1 -0
- package/dist/primitives/atoms/icons/index.d.ts +2 -0
- package/dist/primitives/atoms/icons/index.js +6 -0
- package/dist/primitives/atoms/icons/inkeep-default-icons.cjs +1 -0
- package/dist/primitives/atoms/icons/inkeep-default-icons.d.ts +2 -0
- package/dist/primitives/atoms/icons/inkeep-default-icons.js +28 -0
- package/dist/primitives/atoms/link.cjs +1 -0
- package/dist/primitives/atoms/link.d.ts +14 -0
- package/dist/primitives/atoms/link.js +35 -0
- package/dist/primitives/atoms/markdown/components.cjs +1 -0
- package/dist/primitives/atoms/markdown/components.d.ts +31 -0
- package/dist/primitives/atoms/markdown/components.js +76 -0
- package/dist/primitives/atoms/markdown/index.cjs +1 -0
- package/dist/primitives/atoms/markdown/index.d.ts +17 -0
- package/dist/primitives/atoms/markdown/index.js +121 -0
- package/dist/primitives/atoms/markdown/rehype-inline-code-property.cjs +1 -0
- package/dist/primitives/atoms/markdown/rehype-inline-code-property.d.ts +1 -0
- package/dist/primitives/atoms/markdown/rehype-inline-code-property.js +12 -0
- package/dist/primitives/atoms/portal-with-theme.cjs +1 -0
- package/dist/primitives/atoms/portal-with-theme.d.ts +2 -0
- package/dist/primitives/atoms/portal-with-theme.js +12 -0
- package/dist/primitives/atoms/portal.cjs +1 -0
- package/dist/primitives/atoms/portal.d.ts +8 -0
- package/dist/primitives/atoms/portal.js +19 -0
- package/dist/primitives/atoms/select.cjs +1 -0
- package/dist/primitives/atoms/select.d.ts +136 -0
- package/dist/primitives/atoms/select.js +785 -0
- package/dist/primitives/atoms/shadow/context.cjs +1 -0
- package/dist/primitives/atoms/shadow/context.d.ts +14 -0
- package/dist/primitives/atoms/shadow/context.js +54 -0
- package/dist/primitives/atoms/shadow/create.cjs +1 -0
- package/dist/primitives/atoms/shadow/create.d.ts +8 -0
- package/dist/primitives/atoms/shadow/create.js +56 -0
- package/dist/primitives/atoms/shadow/index.d.ts +1 -0
- package/dist/primitives/atoms/shadow/root.cjs +1 -0
- package/dist/primitives/atoms/shadow/root.d.ts +5 -0
- package/dist/primitives/atoms/shadow/root.js +22 -0
- package/dist/primitives/atoms/shadow/use-ensured-forwarded-ref.cjs +1 -0
- package/dist/primitives/atoms/shadow/use-ensured-forwarded-ref.d.ts +2 -0
- package/dist/primitives/atoms/shadow/use-ensured-forwarded-ref.js +11 -0
- package/dist/primitives/atoms/shadow/utils.cjs +1 -0
- package/dist/primitives/atoms/shadow/utils.d.ts +9 -0
- package/dist/primitives/atoms/shadow/utils.js +16 -0
- package/dist/primitives/components/chat-bubble/index.cjs +1 -0
- package/dist/primitives/components/chat-bubble/index.d.ts +10 -0
- package/dist/primitives/components/chat-bubble/index.js +38 -0
- package/dist/primitives/components/chat-button.cjs +1 -0
- package/dist/primitives/components/chat-button.d.ts +20 -0
- package/dist/primitives/components/chat-button.js +51 -0
- package/dist/primitives/components/chat-history/index.cjs +1 -0
- package/dist/primitives/components/chat-history/index.d.ts +27 -0
- package/dist/primitives/components/chat-history/index.js +105 -0
- package/dist/primitives/components/data-summaries.cjs +1 -0
- package/dist/primitives/components/data-summaries.d.ts +14 -0
- package/dist/primitives/components/data-summaries.js +38 -0
- package/dist/primitives/components/embedded-chat/chat-provider.cjs +1 -0
- package/dist/primitives/components/embedded-chat/chat-provider.d.ts +19 -0
- package/dist/primitives/components/embedded-chat/chat-provider.js +20 -0
- package/dist/primitives/components/embedded-chat/use-captcha.cjs +1 -0
- package/dist/primitives/components/embedded-chat/use-captcha.d.ts +30 -0
- package/dist/primitives/components/embedded-chat/use-captcha.js +67 -0
- package/dist/primitives/components/embedded-chat/use-chat-action.cjs +1 -0
- package/dist/primitives/components/embedded-chat/use-chat-action.d.ts +9 -0
- package/dist/primitives/components/embedded-chat/use-chat-action.js +41 -0
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.cjs +3 -0
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.d.ts +57 -0
- package/dist/primitives/components/embedded-chat/use-inkeep-chat.js +312 -0
- package/dist/primitives/components/embedded-chat/use-stream-processor.cjs +1 -0
- package/dist/primitives/components/embedded-chat/use-stream-processor.d.ts +30 -0
- package/dist/primitives/components/embedded-chat/use-stream-processor.js +159 -0
- package/dist/primitives/components/embedded-chat.cjs +11 -0
- package/dist/primitives/components/embedded-chat.d.ts +461 -0
- package/dist/primitives/components/embedded-chat.js +2051 -0
- package/dist/primitives/components/embedded-search/search-provider.cjs +1 -0
- package/dist/primitives/components/embedded-search/search-provider.d.ts +21 -0
- package/dist/primitives/components/embedded-search/search-provider.js +26 -0
- package/dist/primitives/components/embedded-search/transform-results.cjs +1 -0
- package/dist/primitives/components/embedded-search/transform-results.d.ts +3 -0
- package/dist/primitives/components/embedded-search/transform-results.js +47 -0
- package/dist/primitives/components/embedded-search/url-query.cjs +1 -0
- package/dist/primitives/components/embedded-search/url-query.d.ts +4 -0
- package/dist/primitives/components/embedded-search/url-query.js +12 -0
- package/dist/primitives/components/embedded-search/use-inkeep-search.cjs +1 -0
- package/dist/primitives/components/embedded-search/use-inkeep-search.d.ts +19 -0
- package/dist/primitives/components/embedded-search/use-inkeep-search.js +35 -0
- package/dist/primitives/components/embedded-search/use-search-filter.cjs +1 -0
- package/dist/primitives/components/embedded-search/use-search-filter.d.ts +1 -0
- package/dist/primitives/components/embedded-search/use-search-filter.js +77 -0
- package/dist/primitives/components/embedded-search.cjs +1 -0
- package/dist/primitives/components/embedded-search.d.ts +249 -0
- package/dist/primitives/components/embedded-search.js +628 -0
- package/dist/primitives/components/factory.cjs +1 -0
- package/dist/primitives/components/factory.d.ts +19 -0
- package/dist/primitives/components/factory.js +39 -0
- package/dist/primitives/components/index.cjs +1 -0
- package/dist/primitives/components/index.d.ts +13 -0
- package/dist/primitives/components/index.js +33 -0
- package/dist/primitives/components/modal/modal-provider.cjs +1 -0
- package/dist/primitives/components/modal/modal-provider.d.ts +12 -0
- package/dist/primitives/components/modal/modal-provider.js +8 -0
- package/dist/primitives/components/modal/use-inkeep-modal.cjs +1 -0
- package/dist/primitives/components/modal/use-inkeep-modal.d.ts +7 -0
- package/dist/primitives/components/modal/use-inkeep-modal.js +9 -0
- package/dist/primitives/components/modal/widget-auto-focus.cjs +1 -0
- package/dist/primitives/components/modal/widget-auto-focus.d.ts +2 -0
- package/dist/primitives/components/modal/widget-auto-focus.js +25 -0
- package/dist/primitives/components/modal.cjs +1 -0
- package/dist/primitives/components/modal.d.ts +18 -0
- package/dist/primitives/components/modal.js +40 -0
- package/dist/primitives/components/presence.cjs +1 -0
- package/dist/primitives/components/presence.d.ts +8 -0
- package/dist/primitives/components/presence.js +26 -0
- package/dist/primitives/components/searchbar.cjs +1 -0
- package/dist/primitives/components/searchbar.d.ts +23 -0
- package/dist/primitives/components/searchbar.js +54 -0
- package/dist/primitives/components/sidebar-chat/index.cjs +1 -0
- package/dist/primitives/components/sidebar-chat/index.d.ts +9 -0
- package/dist/primitives/components/sidebar-chat/index.js +67 -0
- package/dist/primitives/components/sidebar-chat/use-sidebar-chat-resizer.cjs +1 -0
- package/dist/primitives/components/sidebar-chat/use-sidebar-chat-resizer.d.ts +5 -0
- package/dist/primitives/components/sidebar-chat/use-sidebar-chat-resizer.js +34 -0
- package/dist/primitives/components/tagline-logo-icon.cjs +1 -0
- package/dist/primitives/components/tagline-logo-icon.d.ts +1 -0
- package/dist/primitives/components/tagline-logo-icon.js +26 -0
- package/dist/primitives/components/use-component-trigger.cjs +1 -0
- package/dist/primitives/components/use-component-trigger.d.ts +5 -0
- package/dist/primitives/components/use-component-trigger.js +17 -0
- package/dist/primitives/constants/search.cjs +1 -0
- package/dist/primitives/constants/search.d.ts +1 -0
- package/dist/primitives/constants/search.js +5 -0
- package/dist/primitives/hooks/index.cjs +1 -0
- package/dist/primitives/hooks/index.d.ts +12 -0
- package/dist/primitives/hooks/index.js +26 -0
- package/dist/primitives/hooks/use-anonymous-session.cjs +1 -0
- package/dist/primitives/hooks/use-anonymous-session.d.ts +12 -0
- package/dist/primitives/hooks/use-anonymous-session.js +82 -0
- package/dist/primitives/hooks/use-boolean.cjs +1 -0
- package/dist/primitives/hooks/use-boolean.d.ts +10 -0
- package/dist/primitives/hooks/use-boolean.js +17 -0
- package/dist/primitives/hooks/use-component-classnames.cjs +1 -0
- package/dist/primitives/hooks/use-component-classnames.d.ts +6 -0
- package/dist/primitives/hooks/use-component-classnames.js +14 -0
- package/dist/primitives/hooks/use-container-size.cjs +1 -0
- package/dist/primitives/hooks/use-container-size.d.ts +5 -0
- package/dist/primitives/hooks/use-container-size.js +18 -0
- package/dist/primitives/hooks/use-conversation-loader.cjs +1 -0
- package/dist/primitives/hooks/use-conversation-loader.d.ts +13 -0
- package/dist/primitives/hooks/use-conversation-loader.js +36 -0
- package/dist/primitives/hooks/use-copy-to-clipboard.cjs +1 -0
- package/dist/primitives/hooks/use-copy-to-clipboard.d.ts +3 -0
- package/dist/primitives/hooks/use-copy-to-clipboard.js +24 -0
- package/dist/primitives/hooks/use-debounce.cjs +1 -0
- package/dist/primitives/hooks/use-debounce.d.ts +1 -0
- package/dist/primitives/hooks/use-debounce.js +16 -0
- package/dist/primitives/hooks/use-inkeep-api-client.cjs +1 -0
- package/dist/primitives/hooks/use-inkeep-api-client.d.ts +33 -0
- package/dist/primitives/hooks/use-inkeep-api-client.js +87 -0
- package/dist/primitives/hooks/use-inkeep-open-state.cjs +1 -0
- package/dist/primitives/hooks/use-inkeep-open-state.d.ts +18 -0
- package/dist/primitives/hooks/use-inkeep-open-state.js +47 -0
- package/dist/primitives/hooks/use-instant-update.cjs +1 -0
- package/dist/primitives/hooks/use-instant-update.d.ts +16 -0
- package/dist/primitives/hooks/use-instant-update.js +16 -0
- package/dist/primitives/hooks/use-is-mounted.cjs +1 -0
- package/dist/primitives/hooks/use-is-mounted.d.ts +1 -0
- package/dist/primitives/hooks/use-is-mounted.js +11 -0
- package/dist/primitives/hooks/use-local-storage.cjs +1 -0
- package/dist/primitives/hooks/use-local-storage.d.ts +8 -0
- package/dist/primitives/hooks/use-local-storage.js +26 -0
- package/dist/primitives/hooks/use-media-query.cjs +1 -0
- package/dist/primitives/hooks/use-media-query.d.ts +1 -0
- package/dist/primitives/hooks/use-media-query.js +14 -0
- package/dist/primitives/hooks/use-resize-observer.cjs +1 -0
- package/dist/primitives/hooks/use-resize-observer.d.ts +12 -0
- package/dist/primitives/hooks/use-resize-observer.js +32 -0
- package/dist/primitives/hooks/use-scrolling-fades.cjs +1 -0
- package/dist/primitives/hooks/use-scrolling-fades.d.ts +2 -0
- package/dist/primitives/hooks/use-scrolling-fades.js +18 -0
- package/dist/primitives/hooks/use-settle-action.cjs +1 -0
- package/dist/primitives/hooks/use-settle-action.d.ts +3 -0
- package/dist/primitives/hooks/use-settle-action.js +11 -0
- package/dist/primitives/hooks/use-simple-scroll.cjs +1 -0
- package/dist/primitives/hooks/use-simple-scroll.d.ts +16 -0
- package/dist/primitives/hooks/use-simple-scroll.js +51 -0
- package/dist/primitives/hooks/use-streaming-events.cjs +1 -0
- package/dist/primitives/hooks/use-streaming-events.d.ts +8 -0
- package/dist/primitives/hooks/use-streaming-events.js +33 -0
- package/dist/primitives/index.cjs +1 -0
- package/dist/primitives/index.d.ts +13 -0
- package/dist/primitives/index.js +174 -0
- package/dist/primitives/providers/attachment-item-provider.cjs +1 -0
- package/dist/primitives/providers/attachment-item-provider.d.ts +9 -0
- package/dist/primitives/providers/attachment-item-provider.js +13 -0
- package/dist/primitives/providers/attachments-bar-provider.cjs +1 -0
- package/dist/primitives/providers/attachments-bar-provider.d.ts +30 -0
- package/dist/primitives/providers/attachments-bar-provider.js +57 -0
- package/dist/primitives/providers/base-events-provider.cjs +1 -0
- package/dist/primitives/providers/base-events-provider.d.ts +8 -0
- package/dist/primitives/providers/base-events-provider.js +37 -0
- package/dist/primitives/providers/chat-bubble-provider.cjs +1 -0
- package/dist/primitives/providers/chat-bubble-provider.d.ts +22 -0
- package/dist/primitives/providers/chat-bubble-provider.js +19 -0
- package/dist/primitives/providers/chat-form-provider.cjs +1 -0
- package/dist/primitives/providers/chat-form-provider.d.ts +26 -0
- package/dist/primitives/providers/chat-form-provider.js +109 -0
- package/dist/primitives/providers/chat-history-provider.cjs +1 -0
- package/dist/primitives/providers/chat-history-provider.d.ts +32 -0
- package/dist/primitives/providers/chat-history-provider.js +105 -0
- package/dist/primitives/providers/config-provider.cjs +1 -0
- package/dist/primitives/providers/config-provider.d.ts +24 -0
- package/dist/primitives/providers/config-provider.js +40 -0
- package/dist/primitives/providers/feedback-item-provider.cjs +1 -0
- package/dist/primitives/providers/feedback-item-provider.d.ts +10 -0
- package/dist/primitives/providers/feedback-item-provider.js +16 -0
- package/dist/primitives/providers/feedback-provider.cjs +1 -0
- package/dist/primitives/providers/feedback-provider.d.ts +16 -0
- package/dist/primitives/providers/feedback-provider.js +83 -0
- package/dist/primitives/providers/form-field-provider.cjs +1 -0
- package/dist/primitives/providers/form-field-provider.d.ts +15 -0
- package/dist/primitives/providers/form-field-provider.js +17 -0
- package/dist/primitives/providers/help-menu-provider.cjs +1 -0
- package/dist/primitives/providers/help-menu-provider.d.ts +11 -0
- package/dist/primitives/providers/help-menu-provider.js +19 -0
- package/dist/primitives/providers/hover-popover-provider.cjs +1 -0
- package/dist/primitives/providers/hover-popover-provider.d.ts +10 -0
- package/dist/primitives/providers/hover-popover-provider.js +13 -0
- package/dist/primitives/providers/index.cjs +1 -0
- package/dist/primitives/providers/index.d.ts +19 -0
- package/dist/primitives/providers/index.js +65 -0
- package/dist/primitives/providers/markdown-provider.cjs +1 -0
- package/dist/primitives/providers/markdown-provider.d.ts +9 -0
- package/dist/primitives/providers/markdown-provider.js +8 -0
- package/dist/primitives/providers/message-attachments-provider.cjs +1 -0
- package/dist/primitives/providers/message-attachments-provider.d.ts +13 -0
- package/dist/primitives/providers/message-attachments-provider.js +27 -0
- package/dist/primitives/providers/message-provider.cjs +1 -0
- package/dist/primitives/providers/message-provider.d.ts +10 -0
- package/dist/primitives/providers/message-provider.js +14 -0
- package/dist/primitives/providers/root-provider.cjs +1 -0
- package/dist/primitives/providers/root-provider.d.ts +8 -0
- package/dist/primitives/providers/root-provider.js +21 -0
- package/dist/primitives/providers/search-events-provider.cjs +1 -0
- package/dist/primitives/providers/search-events-provider.d.ts +8 -0
- package/dist/primitives/providers/search-events-provider.js +17 -0
- package/dist/primitives/providers/sidebar-chat-provider.cjs +1 -0
- package/dist/primitives/providers/sidebar-chat-provider.d.ts +61 -0
- package/dist/primitives/providers/sidebar-chat-provider.js +37 -0
- package/dist/primitives/providers/source-item-provider.cjs +1 -0
- package/dist/primitives/providers/source-item-provider.d.ts +12 -0
- package/dist/primitives/providers/source-item-provider.js +13 -0
- package/dist/primitives/providers/theme-provider.cjs +3 -0
- package/dist/primitives/providers/theme-provider.d.ts +3 -0
- package/dist/primitives/providers/theme-provider.js +79 -0
- package/dist/primitives/providers/widget-provider.cjs +1 -0
- package/dist/primitives/providers/widget-provider.d.ts +10 -0
- package/dist/primitives/providers/widget-provider.js +8 -0
- package/dist/primitives/utils/component-ids.cjs +1 -0
- package/dist/primitives/utils/component-ids.d.ts +662 -0
- package/dist/primitives/utils/component-ids.js +361 -0
- package/dist/primitives/utils/compose-event-handlers.cjs +1 -0
- package/dist/primitives/utils/compose-event-handlers.d.ts +3 -0
- package/dist/primitives/utils/compose-event-handlers.js +10 -0
- package/dist/primitives/utils/compose-refs.cjs +1 -0
- package/dist/primitives/utils/compose-refs.d.ts +5 -0
- package/dist/primitives/utils/compose-refs.js +30 -0
- package/dist/primitives/utils/default-settings.cjs +1 -0
- package/dist/primitives/utils/default-settings.d.ts +169 -0
- package/dist/primitives/utils/default-settings.js +52 -0
- package/dist/primitives/utils/form.cjs +1 -0
- package/dist/primitives/utils/form.d.ts +3 -0
- package/dist/primitives/utils/form.js +19 -0
- package/dist/primitives/utils/generate-uid.cjs +1 -0
- package/dist/primitives/utils/generate-uid.d.ts +2 -0
- package/dist/primitives/utils/generate-uid.js +14 -0
- package/dist/primitives/utils/get-message-metadata.d.ts +8 -0
- package/dist/primitives/utils/get-source-icon.cjs +1 -0
- package/dist/primitives/utils/get-source-icon.d.ts +2 -0
- package/dist/primitives/utils/get-source-icon.js +11 -0
- package/dist/primitives/utils/highlight-emphasis.cjs +1 -0
- package/dist/primitives/utils/highlight-emphasis.d.ts +4 -0
- package/dist/primitives/utils/highlight-emphasis.js +15 -0
- package/dist/primitives/utils/merge-props.cjs +1 -0
- package/dist/primitives/utils/merge-props.d.ts +7 -0
- package/dist/primitives/utils/merge-props.js +41 -0
- package/dist/primitives/utils/misc.cjs +1 -0
- package/dist/primitives/utils/misc.d.ts +12 -0
- package/dist/primitives/utils/misc.js +31 -0
- package/dist/primitives/utils/split-props.cjs +1 -0
- package/dist/primitives/utils/split-props.d.ts +14 -0
- package/dist/primitives/utils/split-props.js +10 -0
- package/dist/react/chat-button-modal.cjs +1 -0
- package/dist/react/chat-button-modal.d.ts +22 -0
- package/dist/react/chat-button-modal.js +41 -0
- package/dist/react/chat-button.cjs +1 -0
- package/dist/react/chat-button.d.ts +28 -0
- package/dist/react/chat-button.js +73 -0
- package/dist/react/embedded-chat.cjs +1 -0
- package/dist/react/embedded-chat.d.ts +15 -0
- package/dist/react/embedded-chat.js +431 -0
- package/dist/react/embedded-search-and-chat.cjs +1 -0
- package/dist/react/embedded-search-and-chat.d.ts +40 -0
- package/dist/react/embedded-search-and-chat.impl.cjs +1 -0
- package/dist/react/embedded-search-and-chat.impl.d.ts +9 -0
- package/dist/react/embedded-search-and-chat.impl.js +43 -0
- package/dist/react/embedded-search-and-chat.js +66 -0
- package/dist/react/embedded-search.cjs +1 -0
- package/dist/react/embedded-search.d.ts +17 -0
- package/dist/react/embedded-search.js +181 -0
- package/dist/react/index.cjs +1 -0
- package/dist/react/index.d.ts +13 -0
- package/dist/react/index.js +238 -0
- package/dist/react/modal.chat.cjs +1 -0
- package/dist/react/modal.chat.d.ts +9 -0
- package/dist/react/modal.chat.js +21 -0
- package/dist/react/modal.cjs +1 -0
- package/dist/react/modal.d.ts +23 -0
- package/dist/react/modal.js +27 -0
- package/dist/react/modal.search-and-chat.cjs +1 -0
- package/dist/react/modal.search-and-chat.d.ts +6 -0
- package/dist/react/modal.search-and-chat.js +27 -0
- package/dist/react/modal.search.cjs +1 -0
- package/dist/react/modal.search.d.ts +6 -0
- package/dist/react/modal.search.js +21 -0
- package/dist/react/searchbar.cjs +1 -0
- package/dist/react/searchbar.d.ts +13 -0
- package/dist/react/searchbar.js +68 -0
- package/dist/react/sidebar-chat.cjs +1 -0
- package/dist/react/sidebar-chat.d.ts +4 -0
- package/dist/react/sidebar-chat.js +53 -0
- package/dist/react/utils.cjs +1 -0
- package/dist/react/utils.d.ts +6 -0
- package/dist/react/utils.js +20 -0
- package/dist/react/widget-toggle.cjs +1 -0
- package/dist/react/widget-toggle.d.ts +14 -0
- package/dist/react/widget-toggle.js +65 -0
- package/dist/styled/components/chat-bubble.cjs +1 -0
- package/dist/styled/components/chat-bubble.d.ts +5 -0
- package/dist/styled/components/chat-bubble.js +70 -0
- package/dist/styled/components/chat-button.cjs +1 -0
- package/dist/styled/components/chat-button.d.ts +9 -0
- package/dist/styled/components/chat-button.js +60 -0
- package/dist/styled/components/chat-history.cjs +1 -0
- package/dist/styled/components/chat-history.d.ts +15 -0
- package/dist/styled/components/chat-history.js +197 -0
- package/dist/styled/components/data-summary-group.cjs +1 -0
- package/dist/styled/components/data-summary-group.d.ts +11 -0
- package/dist/styled/components/data-summary-group.js +96 -0
- package/dist/styled/components/embedded-chat/session-loading.cjs +1 -0
- package/dist/styled/components/embedded-chat/session-loading.d.ts +1 -0
- package/dist/styled/components/embedded-chat/session-loading.js +23 -0
- package/dist/styled/components/embedded-chat.cjs +1 -0
- package/dist/styled/components/embedded-chat.d.ts +211 -0
- package/dist/styled/components/embedded-chat.js +1997 -0
- package/dist/styled/components/embedded-search/results-loading.cjs +1 -0
- package/dist/styled/components/embedded-search/results-loading.d.ts +1 -0
- package/dist/styled/components/embedded-search/results-loading.js +39 -0
- package/dist/styled/components/embedded-search.cjs +1 -0
- package/dist/styled/components/embedded-search.d.ts +73 -0
- package/dist/styled/components/embedded-search.js +680 -0
- package/dist/styled/components/index.cjs +1 -0
- package/dist/styled/components/index.d.ts +13 -0
- package/dist/styled/components/index.js +28 -0
- package/dist/styled/components/loading-indicator.cjs +1 -0
- package/dist/styled/components/loading-indicator.d.ts +1 -0
- package/dist/styled/components/loading-indicator.js +36 -0
- package/dist/styled/components/message.cjs +1 -0
- package/dist/styled/components/message.d.ts +4 -0
- package/dist/styled/components/message.js +333 -0
- package/dist/styled/components/modal.cjs +1 -0
- package/dist/styled/components/modal.d.ts +6 -0
- package/dist/styled/components/modal.js +46 -0
- package/dist/styled/components/searchbar.cjs +1 -0
- package/dist/styled/components/searchbar.d.ts +11 -0
- package/dist/styled/components/searchbar.js +81 -0
- package/dist/styled/components/shadow.cjs +1 -0
- package/dist/styled/components/shadow.d.ts +3 -0
- package/dist/styled/components/shadow.js +8 -0
- package/dist/styled/components/sidebar-chat.cjs +1 -0
- package/dist/styled/components/sidebar-chat.d.ts +6 -0
- package/dist/styled/components/sidebar-chat.js +90 -0
- package/dist/styled/components/ui/markdown-styles.cjs +1 -0
- package/dist/styled/components/ui/markdown-styles.d.ts +23 -0
- package/dist/styled/components/ui/markdown-styles.js +39 -0
- package/dist/styled/components/ui/recipes/ai-chat-page-wrapper.cjs +1 -0
- package/dist/styled/components/ui/recipes/ai-chat-page-wrapper.d.ts +7 -0
- package/dist/styled/components/ui/recipes/ai-chat-page-wrapper.js +33 -0
- package/dist/styled/components/ui/recipes/attachment.cjs +1 -0
- package/dist/styled/components/ui/recipes/attachment.d.ts +4 -0
- package/dist/styled/components/ui/recipes/attachment.js +28 -0
- package/dist/styled/components/ui/recipes/button.cjs +1 -0
- package/dist/styled/components/ui/recipes/button.d.ts +6 -0
- package/dist/styled/components/ui/recipes/button.js +87 -0
- package/dist/styled/components/ui/recipes/checkbox.cjs +1 -0
- package/dist/styled/components/ui/recipes/checkbox.d.ts +4 -0
- package/dist/styled/components/ui/recipes/checkbox.js +23 -0
- package/dist/styled/components/ui/recipes/citation.cjs +1 -0
- package/dist/styled/components/ui/recipes/citation.d.ts +4 -0
- package/dist/styled/components/ui/recipes/citation.js +75 -0
- package/dist/styled/components/ui/recipes/combobox.cjs +1 -0
- package/dist/styled/components/ui/recipes/combobox.d.ts +4 -0
- package/dist/styled/components/ui/recipes/combobox.js +57 -0
- package/dist/styled/components/ui/recipes/icon.cjs +1 -0
- package/dist/styled/components/ui/recipes/icon.d.ts +2 -0
- package/dist/styled/components/ui/recipes/icon.js +6 -0
- package/dist/styled/components/ui/recipes/index.cjs +1 -0
- package/dist/styled/components/ui/recipes/index.d.ts +16 -0
- package/dist/styled/components/ui/recipes/index.js +39 -0
- package/dist/styled/components/ui/recipes/input.cjs +1 -0
- package/dist/styled/components/ui/recipes/input.d.ts +5 -0
- package/dist/styled/components/ui/recipes/input.js +34 -0
- package/dist/styled/components/ui/recipes/link.cjs +1 -0
- package/dist/styled/components/ui/recipes/link.d.ts +2 -0
- package/dist/styled/components/ui/recipes/link.js +13 -0
- package/dist/styled/components/ui/recipes/markdown.cjs +1 -0
- package/dist/styled/components/ui/recipes/markdown.d.ts +16 -0
- package/dist/styled/components/ui/recipes/markdown.js +103 -0
- package/dist/styled/components/ui/recipes/modal.cjs +1 -0
- package/dist/styled/components/ui/recipes/modal.d.ts +4 -0
- package/dist/styled/components/ui/recipes/modal.js +59 -0
- package/dist/styled/components/ui/recipes/popover.cjs +1 -0
- package/dist/styled/components/ui/recipes/popover.d.ts +4 -0
- package/dist/styled/components/ui/recipes/popover.js +20 -0
- package/dist/styled/components/ui/recipes/scrollable.cjs +1 -0
- package/dist/styled/components/ui/recipes/scrollable.d.ts +4 -0
- package/dist/styled/components/ui/recipes/scrollable.js +15 -0
- package/dist/styled/components/ui/recipes/select.cjs +1 -0
- package/dist/styled/components/ui/recipes/select.d.ts +4 -0
- package/dist/styled/components/ui/recipes/select.js +38 -0
- package/dist/styled/components/ui/recipes/skeleton.cjs +1 -0
- package/dist/styled/components/ui/recipes/skeleton.d.ts +2 -0
- package/dist/styled/components/ui/recipes/skeleton.js +16 -0
- package/dist/styled/components/ui/recipes/widget-toggle.cjs +1 -0
- package/dist/styled/components/ui/recipes/widget-toggle.d.ts +4 -0
- package/dist/styled/components/ui/recipes/widget-toggle.js +35 -0
- package/dist/styled/index.cjs +1 -0
- package/dist/styled/index.d.ts +2 -0
- package/dist/styled/index.js +200 -0
- package/dist/styled/inkeep.css.cjs +4567 -0
- package/dist/styled/inkeep.css.js +4571 -0
- package/dist/styled/utils.cjs +1 -0
- package/dist/styled/utils.d.ts +4 -0
- package/dist/styled/utils.js +11 -0
- package/dist/theme/color-utils.cjs +1 -0
- package/dist/theme/color-utils.d.ts +1 -0
- package/dist/theme/color-utils.js +21 -0
- package/dist/theme/colors.cjs +1 -0
- package/dist/theme/colors.d.ts +104 -0
- package/dist/theme/colors.js +143 -0
- package/dist/theme/index.cjs +1 -0
- package/dist/theme/index.d.ts +125 -0
- package/dist/theme/index.js +58 -0
- package/dist/theme/utils/create-css-variables.cjs +1 -0
- package/dist/theme/utils/create-css-variables.d.ts +2 -0
- package/dist/theme/utils/create-css-variables.js +24 -0
- package/dist/theme/utils/generate-theme-variables.cjs +1 -0
- package/dist/theme/utils/generate-theme-variables.d.ts +3 -0
- package/dist/theme/utils/generate-theme-variables.js +34 -0
- package/dist/types/color-mode.d.ts +44 -0
- package/dist/types/config/ai.d.ts +269 -0
- package/dist/types/config/base.d.ts +358 -0
- package/dist/types/config/components.d.ts +16 -0
- package/dist/types/config/filters.d.ts +17 -0
- package/dist/types/config/index.d.ts +36 -0
- package/dist/types/config/open-settings.d.ts +70 -0
- package/dist/types/config/search.d.ts +95 -0
- package/dist/types/config/settings/actions.d.ts +112 -0
- package/dist/types/config/settings/form.d.ts +83 -0
- package/dist/types/config/settings/jsonschema.d.ts +105 -0
- package/dist/types/config/settings/workflow.d.ts +86 -0
- package/dist/types/events.d.ts +188 -0
- package/dist/types/icons/built-in.d.ts +1 -0
- package/dist/types/icons/custom.d.ts +33 -0
- package/dist/types/icons/index.d.ts +2 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/types/js/index.d.ts +55 -0
- package/dist/types/message.d.ts +43 -0
- package/dist/types/shadow.d.ts +15 -0
- package/dist/types/sources.d.ts +100 -0
- package/dist/types/theme.d.ts +25 -0
- package/dist/types/widget.d.ts +27 -0
- package/package.json +140 -0
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
import { jsxs as Z, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { Root as Ee, Portal as Ce, Overlay as we, Content as ye } from "../dialog.js";
|
|
3
|
+
import * as c from "react";
|
|
4
|
+
import { useCallback as le, useMemo as Ie } from "react";
|
|
5
|
+
import { commandScore as Re } from "./command-score.js";
|
|
6
|
+
import { Primitive as R } from "@radix-ui/react-primitive";
|
|
7
|
+
import { useId as F } from "@radix-ui/react-id";
|
|
8
|
+
import { s as ke } from "../../../node_modules/.pnpm/use-sync-external-store@1.5.0_react@19.0.0/node_modules/use-sync-external-store/shim/index.js";
|
|
9
|
+
import { ASK_AI_TRIGGER_VALUE as xe } from "../../constants/search.js";
|
|
10
|
+
import { composeEventHandlers as Ae } from "../../utils/compose-event-handlers.js";
|
|
11
|
+
import { useWidget as _e } from "../../providers/widget-provider.js";
|
|
12
|
+
import { useShadow as Le } from "../shadow/context.js";
|
|
13
|
+
const T = '[cmdk-group=""]', X = '[cmdk-group-items=""]', Me = '[cmdk-group-heading=""]', ae = '[cmdk-item=""]', ue = `${ae}:not([aria-disabled="true"])`, Y = "cmdk-item-select", L = "data-value", Pe = (t, n, r) => Re(t, n, r ?? []), de = c.createContext(void 0), D = () => c.useContext(de), fe = c.createContext(void 0), ee = () => c.useContext(fe), me = c.createContext(void 0), he = c.forwardRef((t, n) => {
|
|
14
|
+
const r = M(() => /* @__PURE__ */ new Set()), i = M(() => /* @__PURE__ */ new Map()), a = M(() => /* @__PURE__ */ new Map()), f = M(() => /* @__PURE__ */ new Set()), s = ve(t), {
|
|
15
|
+
label: h,
|
|
16
|
+
children: d,
|
|
17
|
+
value: S,
|
|
18
|
+
onValueChange: C,
|
|
19
|
+
filter: y,
|
|
20
|
+
shouldFilter: w,
|
|
21
|
+
loop: I,
|
|
22
|
+
disablePointerSelection: _ = !1,
|
|
23
|
+
vimBindings: B = !0,
|
|
24
|
+
defaultSearch: te,
|
|
25
|
+
...N
|
|
26
|
+
} = t, v = M(() => ({
|
|
27
|
+
/** Value of the search query. */
|
|
28
|
+
search: te ?? "",
|
|
29
|
+
/** Currently selected item value. */
|
|
30
|
+
value: t.value ?? t.defaultValue ?? "",
|
|
31
|
+
/** Currently selected item id. */
|
|
32
|
+
selectedItemId: void 0,
|
|
33
|
+
filtered: {
|
|
34
|
+
/** The count of all visible items. */
|
|
35
|
+
count: 0,
|
|
36
|
+
/** Map from visible item id to its search score. */
|
|
37
|
+
items: /* @__PURE__ */ new Map(),
|
|
38
|
+
/** Set of groups with at least one visible item. */
|
|
39
|
+
groups: /* @__PURE__ */ new Set()
|
|
40
|
+
}
|
|
41
|
+
})), U = F(), $ = F(), j = F(), k = c.useRef(null), g = $e();
|
|
42
|
+
A(() => {
|
|
43
|
+
if (S !== void 0) {
|
|
44
|
+
const e = S.trim();
|
|
45
|
+
v.current.value = e, E.emit();
|
|
46
|
+
}
|
|
47
|
+
}, [S]), A(() => {
|
|
48
|
+
g(6, ne);
|
|
49
|
+
}, []);
|
|
50
|
+
const G = Le(), E = c.useMemo(() => ({
|
|
51
|
+
subscribe: (e) => (f.current.add(e), () => f.current.delete(e)),
|
|
52
|
+
snapshot: () => v.current,
|
|
53
|
+
setState: (e, l, o) => {
|
|
54
|
+
if (!Object.is(v.current[e], l)) {
|
|
55
|
+
if (v.current[e] = l, e === "search")
|
|
56
|
+
W(), z(), g(1, H);
|
|
57
|
+
else if (e === "value" && (G?.shadowHost?.shadowRoot?.activeElement?.hasAttribute("cmdk-input") || g(1, () => {
|
|
58
|
+
x()?.focus();
|
|
59
|
+
}), g(7, () => {
|
|
60
|
+
v.current.selectedItemId = x()?.id, E.emit();
|
|
61
|
+
}), o || g(5, ne), s.current?.value !== void 0)) {
|
|
62
|
+
const b = l ?? "";
|
|
63
|
+
s.current.onValueChange?.(b);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
E.emit();
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
emit: () => {
|
|
70
|
+
f.current.forEach((e) => e());
|
|
71
|
+
}
|
|
72
|
+
}), []), q = c.useMemo(
|
|
73
|
+
() => ({
|
|
74
|
+
// Keep id → {value, keywords} mapping up-to-date
|
|
75
|
+
value: (e, l, o) => {
|
|
76
|
+
l !== a.current.get(e)?.value && (a.current.set(e, { value: l, keywords: o }), v.current.filtered.items.set(e, re(l, o)), g(2, () => {
|
|
77
|
+
z(), E.emit();
|
|
78
|
+
}));
|
|
79
|
+
},
|
|
80
|
+
// Track item lifecycle (mount, unmount)
|
|
81
|
+
item: (e, l) => (r.current.add(e), l && (i.current.has(l) ? i.current?.get(l)?.add(e) : i.current.set(l, /* @__PURE__ */ new Set([e]))), g(3, () => {
|
|
82
|
+
W(), z(), v.current.value || H(), E.emit();
|
|
83
|
+
}), () => {
|
|
84
|
+
a.current.delete(e), r.current.delete(e), v.current.filtered.items.delete(e);
|
|
85
|
+
const o = x();
|
|
86
|
+
g(4, () => {
|
|
87
|
+
W(), o?.getAttribute("id") === e && H(), E.emit();
|
|
88
|
+
});
|
|
89
|
+
}),
|
|
90
|
+
// Track group lifecycle (mount, unmount)
|
|
91
|
+
group: (e) => (i.current.has(e) || i.current.set(e, /* @__PURE__ */ new Set()), () => {
|
|
92
|
+
a.current.delete(e), i.current.delete(e);
|
|
93
|
+
}),
|
|
94
|
+
filter: () => !!s.current.shouldFilter,
|
|
95
|
+
label: h || t["aria-label"] || "",
|
|
96
|
+
getDisablePointerSelection: () => !!s.current.disablePointerSelection,
|
|
97
|
+
listId: U,
|
|
98
|
+
inputId: j,
|
|
99
|
+
labelId: $,
|
|
100
|
+
listInnerRef: k
|
|
101
|
+
}),
|
|
102
|
+
[]
|
|
103
|
+
);
|
|
104
|
+
function re(e, l) {
|
|
105
|
+
const o = s.current?.filter ?? Pe;
|
|
106
|
+
return e ? o?.(e, v.current.search, l) : 0;
|
|
107
|
+
}
|
|
108
|
+
function z() {
|
|
109
|
+
if (!v.current.search || // Explicitly false, because true | undefined is the default
|
|
110
|
+
s.current.shouldFilter === !1)
|
|
111
|
+
return;
|
|
112
|
+
const e = v.current.filtered.items, l = [];
|
|
113
|
+
v.current.filtered.groups.forEach((u) => {
|
|
114
|
+
const m = i.current.get(u);
|
|
115
|
+
let b = 0;
|
|
116
|
+
m.forEach((Q) => {
|
|
117
|
+
const Se = e.get(Q);
|
|
118
|
+
b = Math.max(Se, b);
|
|
119
|
+
}), l.push([u, b]);
|
|
120
|
+
});
|
|
121
|
+
const o = k.current;
|
|
122
|
+
V().sort((u, m) => {
|
|
123
|
+
const b = u.getAttribute("id"), Q = m.getAttribute("id");
|
|
124
|
+
return (e.get(Q) ?? 0) - (e.get(b) ?? 0);
|
|
125
|
+
}).forEach((u) => {
|
|
126
|
+
const m = u.closest(X);
|
|
127
|
+
if (m) {
|
|
128
|
+
const b = u.parentElement === m ? u : u.closest(`${X} > *`);
|
|
129
|
+
b && m.appendChild(b);
|
|
130
|
+
} else {
|
|
131
|
+
const b = u.parentElement === o ? u : u.closest(`${X} > *`);
|
|
132
|
+
b && o?.appendChild(b);
|
|
133
|
+
}
|
|
134
|
+
}), l.sort((u, m) => m[1] - u[1]).forEach((u) => {
|
|
135
|
+
const m = k.current?.querySelector(
|
|
136
|
+
`${T}[${L}="${encodeURIComponent(u[0])}"]`
|
|
137
|
+
);
|
|
138
|
+
m?.parentElement?.appendChild(m);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
function H() {
|
|
142
|
+
const l = V().find(
|
|
143
|
+
(o) => o.getAttribute("aria-disabled") !== "true" && o.getAttribute("data-value") !== xe
|
|
144
|
+
)?.getAttribute(L);
|
|
145
|
+
E.setState("value", l || void 0);
|
|
146
|
+
}
|
|
147
|
+
function W() {
|
|
148
|
+
if (!v.current.search || // Explicitly false, because true | undefined is the default
|
|
149
|
+
s.current.shouldFilter === !1) {
|
|
150
|
+
v.current.filtered.count = r.current.size;
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
v.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
154
|
+
let e = 0;
|
|
155
|
+
for (const l of r.current) {
|
|
156
|
+
const o = a.current.get(l)?.value ?? "", u = a.current.get(l)?.keywords ?? [], m = re(o, u);
|
|
157
|
+
v.current.filtered.items.set(l, m), m > 0 && e++;
|
|
158
|
+
}
|
|
159
|
+
for (const [l, o] of i.current)
|
|
160
|
+
for (const u of o) {
|
|
161
|
+
const m = v.current.filtered.items.get(u);
|
|
162
|
+
if (m && m > 0) {
|
|
163
|
+
v.current.filtered.groups.add(l);
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
v.current.filtered.count = e;
|
|
168
|
+
}
|
|
169
|
+
function ne() {
|
|
170
|
+
const e = x();
|
|
171
|
+
e && (e.parentElement?.firstChild === e && e.closest(T)?.querySelector(Me)?.scrollIntoView({ block: "nearest" }), e.scrollIntoView({ block: "nearest" }));
|
|
172
|
+
}
|
|
173
|
+
function x() {
|
|
174
|
+
return k.current?.querySelector(`${ae}[aria-selected="true"]`);
|
|
175
|
+
}
|
|
176
|
+
function V() {
|
|
177
|
+
return Array.from(k.current?.querySelectorAll(ue) || []);
|
|
178
|
+
}
|
|
179
|
+
function oe(e) {
|
|
180
|
+
const o = V()[e];
|
|
181
|
+
o && E.setState("value", o.getAttribute(L));
|
|
182
|
+
}
|
|
183
|
+
function J(e) {
|
|
184
|
+
const l = x(), o = V(), u = o.findIndex((b) => b === l);
|
|
185
|
+
let m = o[u + e];
|
|
186
|
+
s.current?.loop && (m = u + e < 0 ? o[o.length - 1] : u + e === o.length ? o[0] : o[u + e]), m && E.setState("value", m.getAttribute(L));
|
|
187
|
+
}
|
|
188
|
+
function ce(e) {
|
|
189
|
+
let o = x()?.closest(T), u;
|
|
190
|
+
for (; o && !u; )
|
|
191
|
+
o = e > 0 ? Ne(o, T) : Ue(o, T), u = o?.querySelector(ue);
|
|
192
|
+
u ? E.setState("value", u.getAttribute(L)) : J(e);
|
|
193
|
+
}
|
|
194
|
+
const pe = () => oe(V().length - 1), se = (e) => {
|
|
195
|
+
e.preventDefault(), e.metaKey ? pe() : e.altKey ? ce(1) : J(1);
|
|
196
|
+
}, ie = (e) => {
|
|
197
|
+
e.preventDefault(), e.metaKey ? oe(0) : e.altKey ? ce(-1) : J(-1);
|
|
198
|
+
}, be = _e();
|
|
199
|
+
return /* @__PURE__ */ Z(
|
|
200
|
+
R.div,
|
|
201
|
+
{
|
|
202
|
+
ref: n,
|
|
203
|
+
tabIndex: -1,
|
|
204
|
+
...N,
|
|
205
|
+
"cmdk-root": "",
|
|
206
|
+
onKeyDown: (e) => {
|
|
207
|
+
if (be?.view === "search" && (N.onKeyDown?.(e), !e.defaultPrevented))
|
|
208
|
+
switch (e.key) {
|
|
209
|
+
case "n":
|
|
210
|
+
case "j": {
|
|
211
|
+
B && e.ctrlKey && se(e);
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
case "ArrowDown": {
|
|
215
|
+
se(e);
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
case "p":
|
|
219
|
+
case "k": {
|
|
220
|
+
B && e.ctrlKey && ie(e);
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
case "ArrowUp": {
|
|
224
|
+
ie(e);
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
case "Enter":
|
|
228
|
+
if (!e.nativeEvent.isComposing && e.keyCode !== 229) {
|
|
229
|
+
e.preventDefault();
|
|
230
|
+
const l = x();
|
|
231
|
+
if (l) {
|
|
232
|
+
const o = new Event(Y);
|
|
233
|
+
l.dispatchEvent(o);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
style: {
|
|
239
|
+
display: "contents"
|
|
240
|
+
},
|
|
241
|
+
children: [
|
|
242
|
+
/* @__PURE__ */ p(
|
|
243
|
+
"label",
|
|
244
|
+
{
|
|
245
|
+
"cmdk-label": "",
|
|
246
|
+
htmlFor: q.inputId,
|
|
247
|
+
id: q.labelId,
|
|
248
|
+
style: qe,
|
|
249
|
+
children: h
|
|
250
|
+
}
|
|
251
|
+
),
|
|
252
|
+
K(t, (e) => /* @__PURE__ */ p(fe.Provider, { value: E, children: /* @__PURE__ */ p(de.Provider, { value: q, children: e }) }))
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
}), Ve = c.forwardRef((t, n) => {
|
|
257
|
+
const { id: r } = t, i = c.useRef(null), a = c.useContext(me), f = D(), s = ve(t), h = s.current?.forceMount ?? a?.forceMount;
|
|
258
|
+
A(() => {
|
|
259
|
+
if (!h)
|
|
260
|
+
return f.item(r, a?.id);
|
|
261
|
+
}, [h]);
|
|
262
|
+
const d = ge(r, i, [t.value, t.children, i], t.keywords), S = ee(), C = P((g) => g.value && g.value === d.current), y = P(
|
|
263
|
+
(g) => h || f.filter() === !1 ? !0 : g.search ? g.filtered.items.get(r) > 0 : !0
|
|
264
|
+
);
|
|
265
|
+
c.useEffect(() => {
|
|
266
|
+
const g = i.current;
|
|
267
|
+
if (!g || t.disabled) return;
|
|
268
|
+
const G = () => I("keyboard");
|
|
269
|
+
return g.addEventListener(Y, G), () => g.removeEventListener(Y, G);
|
|
270
|
+
}, [y, t.onSelect, t.disabled]);
|
|
271
|
+
const w = le(() => {
|
|
272
|
+
S.setState("value", d.current, !0);
|
|
273
|
+
}, [S, d]), I = le(
|
|
274
|
+
(g = "click") => {
|
|
275
|
+
w(), s.current.onSelect?.({ value: d.current, trigger: g });
|
|
276
|
+
},
|
|
277
|
+
[w, s, d]
|
|
278
|
+
);
|
|
279
|
+
if (!y) return null;
|
|
280
|
+
const {
|
|
281
|
+
disabled: _,
|
|
282
|
+
value: B,
|
|
283
|
+
onSelect: te,
|
|
284
|
+
forceMount: N,
|
|
285
|
+
keywords: v,
|
|
286
|
+
onClick: U,
|
|
287
|
+
...$
|
|
288
|
+
} = t, j = Ie(() => O([i, n]), [i, n]), k = Ae(U, I);
|
|
289
|
+
return /* @__PURE__ */ p(
|
|
290
|
+
R.div,
|
|
291
|
+
{
|
|
292
|
+
ref: j,
|
|
293
|
+
...$,
|
|
294
|
+
id: r,
|
|
295
|
+
"cmdk-item": "",
|
|
296
|
+
role: "option",
|
|
297
|
+
"aria-disabled": !!_,
|
|
298
|
+
"aria-selected": !!C,
|
|
299
|
+
"data-disabled": !!_,
|
|
300
|
+
"data-selected": !!C,
|
|
301
|
+
onPointerMove: _ || f.getDisablePointerSelection() ? void 0 : w,
|
|
302
|
+
onClick: _ ? void 0 : k,
|
|
303
|
+
onFocus: _ ? void 0 : w,
|
|
304
|
+
children: t.children
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
}), Te = c.forwardRef((t, n) => {
|
|
308
|
+
const { heading: r, children: i, forceMount: a, ...f } = t, s = F(), h = c.useRef(null), d = c.useRef(null), S = F(), C = D(), y = P(
|
|
309
|
+
(I) => a || C.filter() === !1 ? !0 : I.search ? I.filtered.groups.has(s) : !0
|
|
310
|
+
);
|
|
311
|
+
A(() => C.group(s), []), ge(s, h, [t.value, t.heading, d]);
|
|
312
|
+
const w = c.useMemo(() => ({ id: s, forceMount: a }), [a]);
|
|
313
|
+
return /* @__PURE__ */ Z(
|
|
314
|
+
R.div,
|
|
315
|
+
{
|
|
316
|
+
ref: O([h, n]),
|
|
317
|
+
...f,
|
|
318
|
+
"cmdk-group": "",
|
|
319
|
+
role: "presentation",
|
|
320
|
+
hidden: y ? void 0 : !0,
|
|
321
|
+
children: [
|
|
322
|
+
r && /* @__PURE__ */ p("div", { ref: d, "cmdk-group-heading": "", "aria-hidden": !0, id: S, children: r }),
|
|
323
|
+
K(t, (I) => (
|
|
324
|
+
// biome-ignore lint/a11y/useSemanticElements: <explanation>
|
|
325
|
+
/* @__PURE__ */ p("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? S : void 0, children: /* @__PURE__ */ p(me.Provider, { value: w, children: I }) })
|
|
326
|
+
))
|
|
327
|
+
]
|
|
328
|
+
}
|
|
329
|
+
);
|
|
330
|
+
}), Fe = c.forwardRef((t, n) => {
|
|
331
|
+
const { alwaysRender: r, ...i } = t, a = c.useRef(null), f = P((s) => !s.search);
|
|
332
|
+
return !r && !f ? null : /* @__PURE__ */ p(
|
|
333
|
+
R.div,
|
|
334
|
+
{
|
|
335
|
+
ref: O([a, n]),
|
|
336
|
+
...i,
|
|
337
|
+
"cmdk-separator": "",
|
|
338
|
+
role: "separator"
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
}), Oe = c.forwardRef((t, n) => {
|
|
342
|
+
const { onValueChange: r, ...i } = t, a = t.value != null, f = ee(), s = P((d) => d.search), h = D();
|
|
343
|
+
return c.useEffect(() => {
|
|
344
|
+
t.value != null && f.setState("search", t.value);
|
|
345
|
+
}, [t.value]), /* @__PURE__ */ p(
|
|
346
|
+
R.input,
|
|
347
|
+
{
|
|
348
|
+
ref: n,
|
|
349
|
+
...i,
|
|
350
|
+
"cmdk-input": "",
|
|
351
|
+
autoComplete: "off",
|
|
352
|
+
autoCorrect: "off",
|
|
353
|
+
spellCheck: !1,
|
|
354
|
+
"aria-autocomplete": "list",
|
|
355
|
+
role: "combobox",
|
|
356
|
+
"aria-expanded": !0,
|
|
357
|
+
"aria-controls": h.listId,
|
|
358
|
+
"aria-labelledby": h.labelId,
|
|
359
|
+
id: h.inputId,
|
|
360
|
+
type: "text",
|
|
361
|
+
value: a ? t.value : s,
|
|
362
|
+
onChange: (d) => {
|
|
363
|
+
a || f.setState("search", d.target.value), r?.(d.target.value);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
);
|
|
367
|
+
}), De = c.forwardRef((t, n) => {
|
|
368
|
+
const { children: r, label: i = "Suggestions", ...a } = t, f = c.useRef(null), s = c.useRef(null), h = D();
|
|
369
|
+
return c.useEffect(() => {
|
|
370
|
+
if (s.current && f.current) {
|
|
371
|
+
const d = s.current, S = f.current;
|
|
372
|
+
let C;
|
|
373
|
+
const y = new ResizeObserver(() => {
|
|
374
|
+
C = requestAnimationFrame(() => {
|
|
375
|
+
const w = d.offsetHeight;
|
|
376
|
+
S.style.setProperty("--cmdk-list-height", w.toFixed(1) + "px");
|
|
377
|
+
});
|
|
378
|
+
});
|
|
379
|
+
return y.observe(d), () => {
|
|
380
|
+
cancelAnimationFrame(C), y.unobserve(d);
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
}, []), /* @__PURE__ */ p(
|
|
384
|
+
R.div,
|
|
385
|
+
{
|
|
386
|
+
ref: O([f, n]),
|
|
387
|
+
...a,
|
|
388
|
+
"cmdk-list": "",
|
|
389
|
+
tabIndex: -1,
|
|
390
|
+
"aria-label": i,
|
|
391
|
+
id: h.listId,
|
|
392
|
+
children: K(t, (d) => /* @__PURE__ */ p("div", { ref: O([s, h.listInnerRef]), "cmdk-list-sizer": "", children: d }))
|
|
393
|
+
}
|
|
394
|
+
);
|
|
395
|
+
}), Ge = c.forwardRef((t, n) => {
|
|
396
|
+
const { open: r, onOpenChange: i, overlayClassName: a, contentClassName: f, container: s, ...h } = t;
|
|
397
|
+
return /* @__PURE__ */ p(Ee, { open: r, onOpenChange: i, children: /* @__PURE__ */ Z(Ce, { container: s, children: [
|
|
398
|
+
/* @__PURE__ */ p(we, { "cmdk-overlay": "", className: a }),
|
|
399
|
+
/* @__PURE__ */ p(ye, { "aria-label": t.label, "cmdk-dialog": "", className: f, children: /* @__PURE__ */ p(he, { ref: n, ...h }) })
|
|
400
|
+
] }) });
|
|
401
|
+
}), Ke = c.forwardRef((t, n) => P((i) => i.filtered.count === 0) ? /* @__PURE__ */ p(R.div, { ref: n, ...t, "cmdk-empty": "", role: "presentation" }) : null), Be = c.forwardRef((t, n) => {
|
|
402
|
+
const { progress: r, children: i, label: a = "Loading...", ...f } = t;
|
|
403
|
+
return /* @__PURE__ */ p(
|
|
404
|
+
R.div,
|
|
405
|
+
{
|
|
406
|
+
ref: n,
|
|
407
|
+
...f,
|
|
408
|
+
"cmdk-loading": "",
|
|
409
|
+
role: "progressbar",
|
|
410
|
+
"aria-valuenow": r,
|
|
411
|
+
"aria-valuemin": 0,
|
|
412
|
+
"aria-valuemax": 100,
|
|
413
|
+
"aria-label": a,
|
|
414
|
+
children: K(t, (s) => /* @__PURE__ */ p("div", { "aria-hidden": !0, children: s }))
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
}), nt = Object.assign(he, {
|
|
418
|
+
List: De,
|
|
419
|
+
Item: Ve,
|
|
420
|
+
Input: Oe,
|
|
421
|
+
Group: Te,
|
|
422
|
+
Separator: Fe,
|
|
423
|
+
Dialog: Ge,
|
|
424
|
+
Empty: Ke,
|
|
425
|
+
Loading: Be
|
|
426
|
+
});
|
|
427
|
+
function Ne(t, n) {
|
|
428
|
+
let r = t.nextElementSibling;
|
|
429
|
+
for (; r; ) {
|
|
430
|
+
if (r.matches(n)) return r;
|
|
431
|
+
r = r.nextElementSibling;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
function Ue(t, n) {
|
|
435
|
+
let r = t.previousElementSibling;
|
|
436
|
+
for (; r; ) {
|
|
437
|
+
if (r.matches(n)) return r;
|
|
438
|
+
r = r.previousElementSibling;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
function ve(t) {
|
|
442
|
+
const n = c.useRef(t);
|
|
443
|
+
return A(() => {
|
|
444
|
+
n.current = t;
|
|
445
|
+
}), n;
|
|
446
|
+
}
|
|
447
|
+
const A = typeof window > "u" ? c.useEffect : c.useLayoutEffect;
|
|
448
|
+
function M(t) {
|
|
449
|
+
const n = c.useRef(void 0);
|
|
450
|
+
return n.current === void 0 && (n.current = t()), n;
|
|
451
|
+
}
|
|
452
|
+
function O(t) {
|
|
453
|
+
return (n) => {
|
|
454
|
+
t.forEach((r) => {
|
|
455
|
+
typeof r == "function" ? r(n) : r != null && (r.current = n);
|
|
456
|
+
});
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
function P(t) {
|
|
460
|
+
const n = ee(), r = () => t(n.snapshot());
|
|
461
|
+
return ke.useSyncExternalStore(n.subscribe, r, r);
|
|
462
|
+
}
|
|
463
|
+
function ge(t, n, r, i = []) {
|
|
464
|
+
const a = c.useRef(void 0), f = D();
|
|
465
|
+
return A(() => {
|
|
466
|
+
const s = (() => {
|
|
467
|
+
for (const d of r) {
|
|
468
|
+
if (typeof d == "string")
|
|
469
|
+
return d.trim();
|
|
470
|
+
if (typeof d == "object" && "current" in d)
|
|
471
|
+
return d.current ? d.current.textContent?.trim() : a.current;
|
|
472
|
+
}
|
|
473
|
+
})(), h = i.map((d) => d.trim());
|
|
474
|
+
f.value(t, s, h), n.current?.setAttribute(L, s), a.current = s;
|
|
475
|
+
}), a;
|
|
476
|
+
}
|
|
477
|
+
const $e = () => {
|
|
478
|
+
const [t, n] = c.useState(), r = M(() => /* @__PURE__ */ new Map());
|
|
479
|
+
return A(() => {
|
|
480
|
+
r.current.forEach((i) => i()), r.current = /* @__PURE__ */ new Map();
|
|
481
|
+
}, [t]), (i, a) => {
|
|
482
|
+
r.current.set(i, a), n({});
|
|
483
|
+
};
|
|
484
|
+
};
|
|
485
|
+
function je(t) {
|
|
486
|
+
const n = t.type;
|
|
487
|
+
return typeof n == "function" ? n(t.props) : "render" in n ? n.render(t.props) : t;
|
|
488
|
+
}
|
|
489
|
+
function K({ asChild: t, children: n }, r) {
|
|
490
|
+
return t && c.isValidElement(n) ? c.cloneElement(
|
|
491
|
+
je(n),
|
|
492
|
+
{ ref: n.ref },
|
|
493
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
494
|
+
r(n.props.children)
|
|
495
|
+
) : r(n);
|
|
496
|
+
}
|
|
497
|
+
const qe = {
|
|
498
|
+
position: "absolute",
|
|
499
|
+
width: "1px",
|
|
500
|
+
height: "1px",
|
|
501
|
+
padding: "0",
|
|
502
|
+
margin: "-1px",
|
|
503
|
+
overflow: "hidden",
|
|
504
|
+
clip: "rect(0, 0, 0, 0)",
|
|
505
|
+
whiteSpace: "nowrap",
|
|
506
|
+
borderWidth: "0"
|
|
507
|
+
};
|
|
508
|
+
export {
|
|
509
|
+
nt as Command,
|
|
510
|
+
Ge as CommandDialog,
|
|
511
|
+
Ke as CommandEmpty,
|
|
512
|
+
Oe as CommandInput,
|
|
513
|
+
Ve as CommandItem,
|
|
514
|
+
De as CommandList,
|
|
515
|
+
Be as CommandLoading,
|
|
516
|
+
he as CommandRoot,
|
|
517
|
+
Fe as CommandSeparator,
|
|
518
|
+
Pe as defaultFilter,
|
|
519
|
+
P as useCommandState,
|
|
520
|
+
ee as useCommandStore
|
|
521
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("prism-react-renderer"),f=require("../../../color-mode/index.cjs"),S=require("../../hooks/use-copy-to-clipboard.cjs"),v=require("../../providers/config-provider.cjs"),B=require("../../utils/misc.cjs"),I=require("../icons/custom-icon.cjs"),o=require("../markdown/components.cjs"),L=t.themes.oneLight,R=t.themes.vsDark,D=({className:d="",children:l,onCopy:a})=>{const c=d.replace(/^language-/,""),r=String(l).replace(/\n$/,""),[i,h]=S.useCopyToClipboard(),{baseSettings:n}=v.useInkeepConfig(),g=n.theme?.syntaxHighlighter,{lightTheme:p=L,darkTheme:u=R}=g??{},C=f.useColorModeValue(p,u),m=()=>{h(r),a?.(c,r)};return e.jsxs(o.CodeblockContainer,{children:[e.jsxs(o.CodeblockHeader,{children:[e.jsx(o.CodeblockHeaderLanguage,{children:c}),e.jsx(o.CodeblockCopyButton,{"aria-label":"Copy to clipboard",onClick:m,"data-copied":B.dataAttr(i),children:e.jsx(I.CustomIcon,{iconKey:i?"codeCopied":"codeCopy"})})]}),e.jsx(o.CodeblockHighlighterWrapper,{children:e.jsx(t.Highlight,{theme:C,code:r,language:c,prism:n.prism,children:({className:k,tokens:b,getLineProps:x,getTokenProps:j,style:y})=>e.jsx(o.CodeblockHighlighter,{className:k,children:e.jsx(o.CodeblockCode,{style:y,children:b.map((s,q)=>e.jsx("div",{...x({line:s}),children:s.map((T,H)=>e.jsx("span",{...j({token:T})},H))},q))})})})})]})};exports.CodeBlock=D;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface CodeProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
children: string;
|
|
4
|
+
/**
|
|
5
|
+
* Callback when the code is copied.
|
|
6
|
+
* Receives the current language and code that's copied.
|
|
7
|
+
*/
|
|
8
|
+
onCopy?: (language: string, code: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const CodeBlock: ({ className, children, onCopy }: CodeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { themes as l, Highlight as L } from "prism-react-renderer";
|
|
3
|
+
import { useColorModeValue as S } from "../../../color-mode/index.js";
|
|
4
|
+
import { useCopyToClipboard as j } from "../../hooks/use-copy-to-clipboard.js";
|
|
5
|
+
import { useInkeepConfig as v } from "../../providers/config-provider.js";
|
|
6
|
+
import { dataAttr as B } from "../../utils/misc.js";
|
|
7
|
+
import { CustomIcon as D } from "../icons/custom-icon.js";
|
|
8
|
+
import { CodeblockContainer as I, CodeblockHeader as N, CodeblockHeaderLanguage as A, CodeblockCopyButton as K, CodeblockHighlighterWrapper as M, CodeblockHighlighter as V, CodeblockCode as W } from "../markdown/components.js";
|
|
9
|
+
const $ = l.oneLight, q = l.vsDark, R = ({ className: a = "", children: d, onCopy: h }) => {
|
|
10
|
+
const o = a.replace(/^language-/, ""), r = String(d).replace(/\n$/, ""), [t, p] = j(), { baseSettings: i } = v(), m = i.theme?.syntaxHighlighter, { lightTheme: s = $, darkTheme: g = q } = m ?? {}, C = S(s, g);
|
|
11
|
+
return /* @__PURE__ */ n(I, { children: [
|
|
12
|
+
/* @__PURE__ */ n(N, { children: [
|
|
13
|
+
/* @__PURE__ */ e(A, { children: o }),
|
|
14
|
+
/* @__PURE__ */ e(
|
|
15
|
+
K,
|
|
16
|
+
{
|
|
17
|
+
"aria-label": "Copy to clipboard",
|
|
18
|
+
onClick: () => {
|
|
19
|
+
p(r), h?.(o, r);
|
|
20
|
+
},
|
|
21
|
+
"data-copied": B(t),
|
|
22
|
+
children: /* @__PURE__ */ e(D, { iconKey: t ? "codeCopied" : "codeCopy" })
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ e(M, { children: /* @__PURE__ */ e(
|
|
27
|
+
L,
|
|
28
|
+
{
|
|
29
|
+
theme: C,
|
|
30
|
+
code: r,
|
|
31
|
+
language: o,
|
|
32
|
+
prism: i.prism,
|
|
33
|
+
children: ({ className: k, tokens: u, getLineProps: b, getTokenProps: f, style: y }) => /* @__PURE__ */ e(V, { className: k, children: /* @__PURE__ */ e(W, { style: y, children: u.map((c, H) => /* @__PURE__ */ e("div", { ...b({ line: c }), children: c.map((T, x) => /* @__PURE__ */ e("span", { ...f({ token: T }) }, x)) }, H)) }) })
|
|
34
|
+
}
|
|
35
|
+
) })
|
|
36
|
+
] });
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
R as CodeBlock
|
|
40
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),U=require("@zag-js/combobox"),I=require("@zag-js/react"),P=require("react"),v=require("./icons/built-in-icon-renderer.cjs"),W=require("./shadow/context.cjs");function R(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const x=R(U),s=R(P),y=s.forwardRef((o,t)=>{const{children:e,defaultValue:n=[],items:a,multiple:c=!1,placeholder:b,name:m,disabled:M,required:B,id:D,onValueChange:z}=o,A=P.useId(),F=D??A,H=W.useShadow(),[u,g]=s.useState(a),$=s.useMemo(()=>x.collection({items:u,itemToValue:d=>d.value,itemToString:d=>d.label}),[u]),G=I.useMachine(x.machine,{id:F,collection:$,defaultValue:n,multiple:c,placeholder:b,name:m,disabled:M,required:B,openOnClick:!0,getRootNode:()=>H?.shadowHost?.shadowRoot??document,selectionBehavior:c?"clear":"replace",onOpenChange(d){d.open||g(a)},onInputValueChange(d){const h=d.inputValue.trim()===""?a:a.filter(Q=>Q.label.toLowerCase().includes(d.inputValue.toLowerCase()));g(h.length>0?h:[])},onValueChange(d){z?.(d)}}),p=x.connect(G,I.normalizeProps),J=s.useMemo(()=>({api:p,options:u}),[p,u]),K=p.getRootProps();return r.jsx("div",{"data-scope":"combobox","data-part":"root",...K,children:r.jsx(f.Provider,{value:J,children:e})})});y.displayName="ComboboxRoot";const j=s.forwardRef((o,t)=>{const{children:e,...n}=o,a=i(),c=a.getControlProps();return r.jsx("div",{"data-scope":"combobox","data-part":"control","data-state":a.open?"open":"closed","data-disabled":a.disabled?"":void 0,"data-focus":a.focused?"":void 0,...c,ref:l(t,c.ref),...n,children:e})});j.displayName="ComboboxControl";function l(...o){return t=>{o.forEach(e=>{typeof e=="function"?e(t):e&&(e.current=t)})}}const w=s.forwardRef((o,t)=>{const e=i(),n=e.getInputProps();return r.jsx("input",{"data-scope":"combobox","data-part":"input","data-state":e.open?"open":"closed",...n,...o,ref:l(t,n.ref)})});w.displayName="ComboboxInput";const T=s.forwardRef((o,t)=>{const e=i(),n=e.getTriggerProps();return r.jsx("button",{type:"button","data-scope":"combobox","data-part":"trigger","data-state":e.open?"open":"closed","data-disabled":e.disabled?"":void 0,...n,ref:l(t,n.ref),...o,children:o.children??"▼"})});T.displayName="ComboboxTrigger";const X=s.forwardRef(function(t,e){const n=i();return r.jsx("div",{ref:e,...n.getPositionerProps(),...t})}),N=s.forwardRef((o,t)=>{const e=i(),n=e.getContentProps();return r.jsx("div",{"data-scope":"combobox","data-part":"content","data-state":e.open?"open":"closed",...n,ref:l(t,n.ref),...o,children:o.children})});N.displayName="ComboboxContent";const S=s.forwardRef((o,t)=>{const n=i().getListProps();return r.jsx("div",{ref:l(t,n.ref),"data-scope":"combobox","data-part":"list",...n,...o,children:o.children})});S.displayName="ComboboxList";const L=({children:o})=>{const t=E();return r.jsx(r.Fragment,{children:o(t)})};L.displayName="ComboboxListItems";const O=s.forwardRef((o,t)=>{const{children:e="No results found",...n}=o;return r.jsx("div",{ref:t,"data-scope":"combobox","data-part":"list-empty",...n,children:e})});O.displayName="ComboboxListEmpty";const C=s.createContext(null),V=s.forwardRef((o,t)=>{const{item:e,...n}=o,a=i(),c=a.getItemState({item:e}),b=a.getItemProps({item:e});return r.jsx(C.Provider,{value:e,children:r.jsx("div",{ref:l(t,b.ref),"data-scope":"combobox","data-part":"item","data-value":e.value,"data-highlighted":c.highlighted?"":void 0,"data-state":c.selected?"checked":"unchecked","data-disabled":c.disabled?"":void 0,...b,...n,children:o.children})})});V.displayName="ComboboxItem";const k=s.forwardRef((o,t)=>{const e=s.useContext(C),n=i(),a=e?n.getItemTextProps({item:e}):{};return r.jsx("span",{ref:l(t,a.ref),"data-scope":"combobox","data-part":"item-text",...a,...o})});k.displayName="ComboboxItemText";const q=s.forwardRef((o,t)=>{const{children:e,...n}=o,a=s.useContext(C),c=i(),b=a?c.getItemState({item:a}):{selected:!1},m=a?c.getItemIndicatorProps({item:a}):{};return b.selected?r.jsx("span",{ref:l(t,m.ref),"data-scope":"combobox","data-part":"item-indicator","data-state":"checked","aria-hidden":!0,...m,...n,children:e??r.jsx(v.BuiltInIconRenderer,{iconSettings:{builtIn:"LuCheck"}})}):null});q.displayName="ComboboxItemIndicator";const f=s.createContext(null);function i(){const o=s.useContext(f);if(!o)throw new Error("Combobox components must be used within ComboboxRoot");return o.api}function E(){const o=s.useContext(f);if(!o)throw new Error("Combobox components must be used within ComboboxRoot");return o.options}const _=s.forwardRef((o,t)=>{const e=i(),n=e.selectedItems??[],a=e.clearValue;return n.length===0?null:r.jsx("div",{ref:t,"data-scope":"combobox","data-part":"selected-tags",className:o.className,style:o.style,children:n.map(c=>r.jsxs("span",{"data-scope":"combobox","data-part":"tag",children:[o.renderTag?o.renderTag(c):c.label,r.jsx("button",{type:"button","data-part":"tag-clear","aria-label":`Remove ${c.label}`,onClick:b=>{b.preventDefault(),b.stopPropagation(),a?.(c.value)},children:r.jsx(v.BuiltInIconRenderer,{iconSettings:{builtIn:"IoCloseOutline"}})})]},c.value))})});_.displayName="ComboboxSelectedTags";exports.ComboboxContent=N;exports.ComboboxControl=j;exports.ComboboxInput=w;exports.ComboboxItem=V;exports.ComboboxItemIndicator=q;exports.ComboboxItemText=k;exports.ComboboxList=S;exports.ComboboxListEmpty=O;exports.ComboboxListItems=L;exports.ComboboxPositioner=X;exports.ComboboxRoot=y;exports.ComboboxSelectedTags=_;exports.ComboboxTrigger=T;exports.useComboboxApi=i;exports.useComboboxOptions=E;
|