@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,35 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef as a } from "react";
|
|
4
|
+
import { useInkeepConfig as d } from "../providers/config-provider.js";
|
|
5
|
+
const s = a(({ isExternal: e, ...r }, n) => /* @__PURE__ */ o(
|
|
6
|
+
"a",
|
|
7
|
+
{
|
|
8
|
+
target: e ? "_blank" : void 0,
|
|
9
|
+
rel: e ? "noopener" : void 0,
|
|
10
|
+
...r,
|
|
11
|
+
ref: n
|
|
12
|
+
}
|
|
13
|
+
));
|
|
14
|
+
s.displayName = "Link";
|
|
15
|
+
const f = a(({ href: e, appendToUrl: r, ...n }, t) => {
|
|
16
|
+
const { baseSettings: i } = d(), c = Object.assign({}, i.appendQueryParamsToUrls, r), p = e && m(e, c);
|
|
17
|
+
return /* @__PURE__ */ o(s, { ref: t, href: p, ...n });
|
|
18
|
+
});
|
|
19
|
+
f.displayName = "LinkWithQueryParams";
|
|
20
|
+
function m(e, r) {
|
|
21
|
+
if (!r)
|
|
22
|
+
return e;
|
|
23
|
+
try {
|
|
24
|
+
const n = new URL(e);
|
|
25
|
+
for (const t of Object.keys(r))
|
|
26
|
+
r[t] && n.searchParams.append(t, r[t]);
|
|
27
|
+
return n.href;
|
|
28
|
+
} catch {
|
|
29
|
+
return e;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
s as Link,
|
|
34
|
+
f as LinkWithQueryParams
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../components/factory.cjs"),d=require("../link.cjs"),k=o.ikp("h1",{_id:"markdownH1"}),n=o.ikp("h2",{_id:"markdownH2"}),e=o.ikp("p",{_id:"markdownP"}),i=o.ikp("li",{_id:"markdownLi"}),r=o.ikp("ul",{_id:"markdownUl"}),a=o.ikp("ol",{_id:"markdownOl"}),c=o.ikp(d.LinkWithQueryParams,{_id:"markdownLink"}),t=o.ikp("sup",{_id:"markdownSourceLink"}),l=o.ikp("table",{_id:"markdownTable"}),w=o.ikp("th",{_id:"markdownTh"}),p=o.ikp("td",{_id:"markdownTd"}),b=o.ikp("code",{_id:"markdownCode"}),s=o.ikp("div",{_id:"codeblockContainer"}),C=o.ikp("div",{_id:"codeblockHeader"}),M=o.ikp("span",{_id:"codeblockHeaderLanguage"}),g=o.ikp("button",{_id:"codeblockCopyButton",type:"button"}),u=o.ikp("div",{_id:"codeblockHighlighterWrapper"}),h=o.ikp("div",{_id:"codeblockHighlighter"}),_=o.ikp("code",{_id:"codeblockCode"});exports.CodeblockCode=_;exports.CodeblockContainer=s;exports.CodeblockCopyButton=g;exports.CodeblockHeader=C;exports.CodeblockHeaderLanguage=M;exports.CodeblockHighlighter=h;exports.CodeblockHighlighterWrapper=u;exports.MarkdownCode=b;exports.MarkdownH1=k;exports.MarkdownH2=n;exports.MarkdownLi=i;exports.MarkdownLink=c;exports.MarkdownOl=a;exports.MarkdownP=e;exports.MarkdownSourceLink=t;exports.MarkdownTable=l;exports.MarkdownTd=p;exports.MarkdownTh=w;exports.MarkdownUl=r;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, DetailedHTMLProps, HTMLAttributes, LiHTMLAttributes, OlHTMLAttributes, RefAttributes, TableHTMLAttributes, ThHTMLAttributes, TdHTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { PolymorphicProps } from '../..';
|
|
3
|
+
import { LinkProps } from '../link';
|
|
4
|
+
import { UrlQueryParam } from '@inkeep/cxkit-types';
|
|
5
|
+
export declare const MarkdownH1: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "_id">>>;
|
|
6
|
+
export declare const MarkdownH2: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "_id">>>;
|
|
7
|
+
export declare const MarkdownP: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "_id">>>;
|
|
8
|
+
export declare const MarkdownLi: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "_id"> & Partial<Pick< DetailedHTMLProps<LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "_id">>>;
|
|
9
|
+
export declare const MarkdownUl: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "_id">>>;
|
|
10
|
+
export declare const MarkdownOl: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "_id"> & Partial<Pick< DetailedHTMLProps<OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "_id">>>;
|
|
11
|
+
export declare const MarkdownLink: ForwardRefExoticComponent< PolymorphicProps & Omit<Omit< LinkProps & {
|
|
12
|
+
appendToUrl?: UrlQueryParam;
|
|
13
|
+
}, "ref"> & RefAttributes<HTMLAnchorElement>, "_id"> & Partial<Pick<Omit< LinkProps & {
|
|
14
|
+
appendToUrl?: UrlQueryParam;
|
|
15
|
+
}, "ref"> & RefAttributes<HTMLAnchorElement>, "_id">>>;
|
|
16
|
+
export declare const MarkdownSourceLink: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "_id">>>;
|
|
17
|
+
export declare const MarkdownTable: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "_id"> & Partial<Pick< DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "_id">>>;
|
|
18
|
+
export declare const MarkdownTh: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, "_id"> & Partial<Pick< DetailedHTMLProps<ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, "_id">>>;
|
|
19
|
+
export declare const MarkdownTd: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "_id"> & Partial<Pick< DetailedHTMLProps<TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "_id">>>;
|
|
20
|
+
export declare const MarkdownCode: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "_id">>>;
|
|
21
|
+
export declare const CodeblockContainer: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id">>>;
|
|
22
|
+
export declare const CodeblockHeader: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id">>>;
|
|
23
|
+
export declare const CodeblockHeaderLanguage: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "_id">>>;
|
|
24
|
+
export declare const CodeblockCopyButton: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "_id"> & Partial<Pick< DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "_id">>>;
|
|
25
|
+
export declare const CodeblockHighlighterWrapper: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id">>>;
|
|
26
|
+
export declare const CodeblockHighlighter: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id">>>;
|
|
27
|
+
export declare const CodeblockCode: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "_id">>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, DetailedHTMLProps, HTMLAttributes, LiHTMLAttributes, OlHTMLAttributes, RefAttributes, TableHTMLAttributes, ThHTMLAttributes, TdHTMLAttributes, ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { PolymorphicProps } from '../..';
|
|
3
|
+
import { LinkProps } from '../link';
|
|
4
|
+
import { UrlQueryParam } from '@inkeep/cxkit-types';
|
|
5
|
+
export declare const MarkdownH1: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "_id">>>;
|
|
6
|
+
export declare const MarkdownH2: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "_id">>>;
|
|
7
|
+
export declare const MarkdownP: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "_id">>>;
|
|
8
|
+
export declare const MarkdownLi: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "_id"> & Partial<Pick< DetailedHTMLProps<LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "_id">>>;
|
|
9
|
+
export declare const MarkdownUl: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "_id">>>;
|
|
10
|
+
export declare const MarkdownOl: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "_id"> & Partial<Pick< DetailedHTMLProps<OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, "_id">>>;
|
|
11
|
+
export declare const MarkdownLink: ForwardRefExoticComponent< PolymorphicProps & Omit<Omit< LinkProps & {
|
|
12
|
+
appendToUrl?: UrlQueryParam;
|
|
13
|
+
}, "ref"> & RefAttributes<HTMLAnchorElement>, "_id"> & Partial<Pick<Omit< LinkProps & {
|
|
14
|
+
appendToUrl?: UrlQueryParam;
|
|
15
|
+
}, "ref"> & RefAttributes<HTMLAnchorElement>, "_id">>>;
|
|
16
|
+
export declare const MarkdownSourceLink: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "_id">>>;
|
|
17
|
+
export declare const MarkdownTable: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "_id"> & Partial<Pick< DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, "_id">>>;
|
|
18
|
+
export declare const MarkdownTh: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, "_id"> & Partial<Pick< DetailedHTMLProps<ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, "_id">>>;
|
|
19
|
+
export declare const MarkdownTd: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "_id"> & Partial<Pick< DetailedHTMLProps<TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "_id">>>;
|
|
20
|
+
export declare const MarkdownCode: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "_id">>>;
|
|
21
|
+
export declare const CodeblockContainer: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id">>>;
|
|
22
|
+
export declare const CodeblockHeader: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id">>>;
|
|
23
|
+
export declare const CodeblockHeaderLanguage: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "_id">>>;
|
|
24
|
+
export declare const CodeblockCopyButton: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "_id"> & Partial<Pick< DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "type" | "_id">>>;
|
|
25
|
+
export declare const CodeblockHighlighterWrapper: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id">>>;
|
|
26
|
+
export declare const CodeblockHighlighter: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "_id">>>;
|
|
27
|
+
export declare const CodeblockCode: ForwardRefExoticComponent< PolymorphicProps & Omit< DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "_id"> & Partial<Pick< DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "_id">>>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { ikp as o } from "../../components/factory.js";
|
|
3
|
+
import { LinkWithQueryParams as d } from "../link.js";
|
|
4
|
+
const r = o("h1", {
|
|
5
|
+
_id: "markdownH1"
|
|
6
|
+
}), i = o("h2", {
|
|
7
|
+
_id: "markdownH2"
|
|
8
|
+
}), c = o("p", {
|
|
9
|
+
_id: "markdownP"
|
|
10
|
+
}), k = o("li", {
|
|
11
|
+
_id: "markdownLi"
|
|
12
|
+
}), a = o("ul", {
|
|
13
|
+
_id: "markdownUl"
|
|
14
|
+
}), t = o("ol", {
|
|
15
|
+
_id: "markdownOl"
|
|
16
|
+
}), l = o(d, {
|
|
17
|
+
_id: "markdownLink"
|
|
18
|
+
}), w = o("sup", {
|
|
19
|
+
_id: "markdownSourceLink"
|
|
20
|
+
}), s = o("table", {
|
|
21
|
+
_id: "markdownTable"
|
|
22
|
+
}), b = o("th", {
|
|
23
|
+
_id: "markdownTh"
|
|
24
|
+
}), _ = o("td", {
|
|
25
|
+
_id: "markdownTd"
|
|
26
|
+
}), m = o("code", {
|
|
27
|
+
_id: "markdownCode"
|
|
28
|
+
}), C = o("div", {
|
|
29
|
+
_id: "codeblockContainer"
|
|
30
|
+
}), h = o("div", {
|
|
31
|
+
_id: "codeblockHeader"
|
|
32
|
+
}), p = o("span", {
|
|
33
|
+
_id: "codeblockHeaderLanguage"
|
|
34
|
+
}), g = o("button", {
|
|
35
|
+
_id: "codeblockCopyButton",
|
|
36
|
+
type: "button"
|
|
37
|
+
}), u = o("div", {
|
|
38
|
+
_id: "codeblockHighlighterWrapper"
|
|
39
|
+
}), H = o("div", {
|
|
40
|
+
_id: "codeblockHighlighter"
|
|
41
|
+
}), M = o("code", {
|
|
42
|
+
_id: "codeblockCode"
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
M as CodeblockCode,
|
|
46
|
+
C as CodeblockContainer,
|
|
47
|
+
g as CodeblockCopyButton,
|
|
48
|
+
h as CodeblockHeader,
|
|
49
|
+
p as CodeblockHeaderLanguage,
|
|
50
|
+
H as CodeblockHighlighter,
|
|
51
|
+
u as CodeblockHighlighterWrapper,
|
|
52
|
+
m as MarkdownCode,
|
|
53
|
+
r as MarkdownH1,
|
|
54
|
+
i as MarkdownH2,
|
|
55
|
+
k as MarkdownLi,
|
|
56
|
+
l as MarkdownLink,
|
|
57
|
+
t as MarkdownOl,
|
|
58
|
+
c as MarkdownP,
|
|
59
|
+
w as MarkdownSourceLink,
|
|
60
|
+
s as MarkdownTable,
|
|
61
|
+
_ as MarkdownTd,
|
|
62
|
+
b as MarkdownTh,
|
|
63
|
+
a as MarkdownUl
|
|
64
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("react"),M=require("react-markdown"),m=require("rehype-raw"),y=require("../../providers/markdown-provider.cjs"),g=require("../codeblock/index.cjs"),n=require("./components.cjs"),C=require("./rehype-inline-code-property.cjs");const b=({children:c,componentStyles:a,shouldOpenLinksInNewTab:h,onLinkClick:u,onCodeCopy:k,...p})=>{if(!c)return null;const w={h1:({children:r})=>e.jsx(n.MarkdownH1,{children:r}),h2:({children:r})=>e.jsx(n.MarkdownH2,{children:r}),p:({children:r})=>e.jsx(n.MarkdownP,{children:r}),li:({children:r})=>e.jsx(n.MarkdownLi,{children:r}),ul:({children:r})=>e.jsx(n.MarkdownUl,{children:r}),ol:({children:r,node:o})=>{const t=o?.properties?.start;return e.jsx(n.MarkdownOl,{style:{"--start":t?.toString()??"0"},children:r})},a:({children:r,href:o})=>{const t=x.Children.toArray(r),i=t[0],d=typeof i=="string"&&/^\(\d+\)$/.test(i)&&t.length===1,s=d?i.match(/\d+/):r,l=e.jsx(n.MarkdownLink,{isExternal:h,href:o,onClick:()=>{u?.(o,s?.toString())},children:s});return d?e.jsx(n.MarkdownSourceLink,{children:l}):l},img:({src:r,alt:o})=>``,table:({children:r})=>e.jsx(n.MarkdownTable,{children:r}),th:({children:r,isHeader:o})=>o?e.jsx(n.MarkdownTh,{children:r}):e.jsx(n.MarkdownTd,{children:r}),pre:({children:r})=>e.jsx("pre",{children:r}),code:({children:r,inline:o,className:t})=>o?e.jsx(n.MarkdownCode,{children:r}):e.jsx(g.CodeBlock,{className:t,onCopy:k,children:r})},j=e.jsx(M,{rehypePlugins:[m,C.rehypeInlineCodeProperty],components:w,disallowedElements:f,children:c.toString(),...p});return e.jsx(y.ChatMarkdownProvider,{componentStyles:a,children:j})},f=["script","iframe","frame","embed","meta","base","form","style","object"];exports.Markdown=b;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { CodeProps } from '../codeblock';
|
|
3
|
+
import { MarkdownComponentID } from '../../utils/component-ids';
|
|
4
|
+
export interface MarkdownProps {
|
|
5
|
+
shouldOpenLinksInNewTab?: boolean;
|
|
6
|
+
componentStyles?: Partial<Record<MarkdownComponentID, string>>;
|
|
7
|
+
onCodeCopy?: CodeProps['onCopy'];
|
|
8
|
+
/**
|
|
9
|
+
* Callback when a link is clicked.
|
|
10
|
+
* @param href - the destination of the link
|
|
11
|
+
* @param label - the link text
|
|
12
|
+
*/
|
|
13
|
+
onLinkClick?: (href: string | undefined, label: string | undefined) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const Markdown: ({ children, componentStyles, shouldOpenLinksInNewTab, onLinkClick, onCodeCopy, ...props }: ComponentPropsWithRef<"div"> & MarkdownProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { CodeProps } from '../codeblock';
|
|
3
|
+
import { MarkdownComponentID } from '../../utils/component-ids';
|
|
4
|
+
export interface MarkdownProps {
|
|
5
|
+
shouldOpenLinksInNewTab?: boolean;
|
|
6
|
+
componentStyles?: Partial<Record<MarkdownComponentID, string>>;
|
|
7
|
+
onCodeCopy?: CodeProps['onCopy'];
|
|
8
|
+
/**
|
|
9
|
+
* Callback when a link is clicked.
|
|
10
|
+
* @param href - the destination of the link
|
|
11
|
+
* @param label - the link text
|
|
12
|
+
*/
|
|
13
|
+
onLinkClick?: (href: string | undefined, label: string | undefined) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const Markdown: ({ children, componentStyles, shouldOpenLinksInNewTab, onLinkClick, onCodeCopy, ...props }: ComponentPropsWithRef<"div"> & MarkdownProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
|
+
import u from "react-markdown";
|
|
4
|
+
import M from "rehype-raw";
|
|
5
|
+
import { ChatMarkdownProvider as y } from "../../providers/markdown-provider.js";
|
|
6
|
+
import { CodeBlock as g } from "../codeblock/index.js";
|
|
7
|
+
import { MarkdownCode as C, MarkdownTh as b, MarkdownTd as S, MarkdownTable as P, MarkdownSourceLink as x, MarkdownOl as L, MarkdownUl as R, MarkdownLi as T, MarkdownP as $, MarkdownH2 as j, MarkdownH1 as A, MarkdownLink as E } from "./components.js";
|
|
8
|
+
import { rehypeInlineCodeProperty as H } from "./rehype-inline-code-property.js";
|
|
9
|
+
const F = ({
|
|
10
|
+
children: i,
|
|
11
|
+
componentStyles: a,
|
|
12
|
+
shouldOpenLinksInNewTab: h,
|
|
13
|
+
onLinkClick: s,
|
|
14
|
+
onCodeCopy: m,
|
|
15
|
+
...p
|
|
16
|
+
}) => {
|
|
17
|
+
if (!i) return null;
|
|
18
|
+
const k = {
|
|
19
|
+
h1: ({ children: r }) => /* @__PURE__ */ n(A, { children: r }),
|
|
20
|
+
h2: ({ children: r }) => /* @__PURE__ */ n(j, { children: r }),
|
|
21
|
+
p: ({ children: r }) => /* @__PURE__ */ n($, { children: r }),
|
|
22
|
+
li: ({ children: r }) => /* @__PURE__ */ n(T, { children: r }),
|
|
23
|
+
ul: ({ children: r }) => /* @__PURE__ */ n(R, { children: r }),
|
|
24
|
+
ol: ({ children: r, node: e }) => {
|
|
25
|
+
const o = e?.properties?.start;
|
|
26
|
+
return /* @__PURE__ */ n(
|
|
27
|
+
L,
|
|
28
|
+
{
|
|
29
|
+
style: {
|
|
30
|
+
"--start": o?.toString() ?? "0"
|
|
31
|
+
},
|
|
32
|
+
children: r
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
},
|
|
36
|
+
a: ({ children: r, href: e }) => {
|
|
37
|
+
const o = f.Children.toArray(r), t = o[0], d = typeof t == "string" && /^\(\d+\)$/.test(t) && o.length === 1, c = d ? t.match(/\d+/) : r, l = /* @__PURE__ */ n(
|
|
38
|
+
E,
|
|
39
|
+
{
|
|
40
|
+
isExternal: h,
|
|
41
|
+
href: e,
|
|
42
|
+
onClick: () => {
|
|
43
|
+
s?.(e, c?.toString());
|
|
44
|
+
},
|
|
45
|
+
children: c
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
return d ? /* @__PURE__ */ n(x, { children: l }) : l;
|
|
49
|
+
},
|
|
50
|
+
img: ({ src: r, alt: e }) => ``,
|
|
51
|
+
table: ({ children: r }) => /* @__PURE__ */ n(P, { children: r }),
|
|
52
|
+
th: ({ children: r, isHeader: e }) => e ? /* @__PURE__ */ n(b, { children: r }) : /* @__PURE__ */ n(S, { children: r }),
|
|
53
|
+
pre: ({ children: r }) => /* @__PURE__ */ n("pre", { children: r }),
|
|
54
|
+
code: ({ children: r, inline: e, className: o }) => e ? /* @__PURE__ */ n(C, { children: r }) : /* @__PURE__ */ n(g, { className: o, onCopy: m, children: r })
|
|
55
|
+
}, w = /* @__PURE__ */ n(
|
|
56
|
+
u,
|
|
57
|
+
{
|
|
58
|
+
rehypePlugins: [M, H],
|
|
59
|
+
components: k,
|
|
60
|
+
disallowedElements: _,
|
|
61
|
+
children: i.toString(),
|
|
62
|
+
...p
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
return /* @__PURE__ */ n(y, { componentStyles: a, children: w });
|
|
66
|
+
}, _ = [
|
|
67
|
+
"script",
|
|
68
|
+
"iframe",
|
|
69
|
+
"frame",
|
|
70
|
+
"embed",
|
|
71
|
+
"meta",
|
|
72
|
+
"base",
|
|
73
|
+
"form",
|
|
74
|
+
"style",
|
|
75
|
+
"object"
|
|
76
|
+
];
|
|
77
|
+
export {
|
|
78
|
+
F as Markdown
|
|
79
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("unist-util-visit");function n(){return t=>{r.visit(t,"element",(e,l,i)=>{e.tagName==="code"&&(i&&i.tagName==="pre"?e.properties.inline=!1:e.properties.inline=!0)})}}exports.rehypeInlineCodeProperty=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function rehypeInlineCodeProperty(): (tree: any) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function rehypeInlineCodeProperty(): (tree: any) => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { visit as t } from "unist-util-visit";
|
|
3
|
+
function l() {
|
|
4
|
+
return (r) => {
|
|
5
|
+
t(r, "element", (e, n, i) => {
|
|
6
|
+
e.tagName === "code" && (i && i.tagName === "pre" ? e.properties.inline = !1 : e.properties.inline = !0);
|
|
7
|
+
});
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
l as rehypeInlineCodeProperty
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("./portal.cjs"),s=require("../providers/theme-provider.cjs"),c=require("../providers/config-provider.cjs"),u=({children:t,...r})=>{const{baseSettings:o}=c.useInkeepConfig(),{rootElement:i}=o;return e.jsx(n.Portal,{host:i,...r,children:e.jsx(s.ThemeProvider,{children:t})})};exports.PortalWithTheme=u;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { Portal as i } from "./portal.js";
|
|
4
|
+
import { ThemeProvider as n } from "../providers/theme-provider.js";
|
|
5
|
+
import { useInkeepConfig as s } from "../providers/config-provider.js";
|
|
6
|
+
const l = ({ children: t, ...e }) => {
|
|
7
|
+
const { baseSettings: r } = s(), { rootElement: m } = r;
|
|
8
|
+
return /* @__PURE__ */ o(i, { host: m, ...e, children: /* @__PURE__ */ o(n, { children: t }) });
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
l as PortalWithTheme
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),i=require("react-dom"),p=typeof document<"u"?e.useLayoutEffect:e.useEffect;function m(u){const{children:s,target:a,tag:f,host:l}=u,n=e.useRef(null),t=e.useRef(null),[,d]=e.useReducer(r=>r+1,0);p(()=>{if(!n.current)return;const r=n.current.ownerDocument,c=l??r.body;return t.current=r.createElement(f??"inkeep-portal"),c.appendChild(t.current),d(),()=>{t.current&&c.removeChild(t.current)}},[]);const o=a?.current??t.current;return o?i.createPortal(s,o):e.createElement("span",{ref:n})}exports.Portal=m;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef as c, useReducer as i, useLayoutEffect as p, useEffect as m, createElement as h } from "react";
|
|
3
|
+
import { createPortal as E } from "react-dom";
|
|
4
|
+
const y = typeof document < "u" ? p : m;
|
|
5
|
+
function C(u) {
|
|
6
|
+
const { children: f, target: s, tag: a, host: d } = u, r = c(null), e = c(null), [, l] = i((t) => t + 1, 0);
|
|
7
|
+
y(() => {
|
|
8
|
+
if (!r.current) return;
|
|
9
|
+
const t = r.current.ownerDocument, o = d ?? t.body;
|
|
10
|
+
return e.current = t.createElement(a ?? "inkeep-portal"), o.appendChild(e.current), l(), () => {
|
|
11
|
+
e.current && o.removeChild(e.current);
|
|
12
|
+
};
|
|
13
|
+
}, []);
|
|
14
|
+
const n = s?.current ?? e.current;
|
|
15
|
+
return n ? E(f, n) : h("span", { ref: r });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
C as Portal
|
|
19
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),n=require("react"),m=require("./root.cjs"),p=require("@radix-ui/react-id"),c=n.createContext(void 0),d=()=>n.useContext(c);function u({wrapperStyles:e={},children:i,customStyles:a,styles:l}){const[s,h]=n.useState(null),[r,x]=n.useState(null),w=n.useMemo(()=>({shadowHost:s,rootElement:r}),[s,r]),S=p.useId(),f=m.default.div;return o.jsxs(f,{id:`inkeep-shadow${S}`,ref:t=>{t&&h(t)},style:e,children:[o.jsx("style",{type:"text/css",dangerouslySetInnerHTML:{__html:`@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');
|
|
2
|
+
${l}`}}),a,o.jsx("div",{id:"inkeep-widget-root",ref:t=>{t&&x(t)},style:e,children:o.jsx(c.Provider,{value:w,children:s&&r&&i})})]})}const v=e=>d()?e.children:o.jsx(u,{...e});exports.InkeepShadow=v;exports.InkeepShadowProvider=u;exports.ShadowContext=c;exports.useShadow=d;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CSSProperties, PropsWithChildren, Context, ReactNode, ReactPortal, ReactElement, JSXElementConstructor } from 'react';
|
|
2
|
+
export declare const ShadowContext: Context<ShadowContextValue | undefined>;
|
|
3
|
+
export type ShadowContextValue = {
|
|
4
|
+
shadowHost: HTMLDivElement | null;
|
|
5
|
+
rootElement: HTMLDivElement | null;
|
|
6
|
+
};
|
|
7
|
+
export declare const useShadow: () => ShadowContextValue | undefined;
|
|
8
|
+
export interface InkeepShadowProps extends PropsWithChildren {
|
|
9
|
+
wrapperStyles?: CSSProperties;
|
|
10
|
+
customStyles?: React.ReactNode;
|
|
11
|
+
styles?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function InkeepShadowProvider({ wrapperStyles, children, customStyles, styles, }: InkeepShadowProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const InkeepShadow: (props: InkeepShadowProps) => string | number | bigint | boolean | Iterable< ReactNode> | Promise<string | number | bigint | boolean | ReactPortal | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable< ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CSSProperties, PropsWithChildren, Context, ReactNode, ReactPortal, ReactElement, JSXElementConstructor } from 'react';
|
|
2
|
+
export declare const ShadowContext: Context<ShadowContextValue | undefined>;
|
|
3
|
+
export type ShadowContextValue = {
|
|
4
|
+
shadowHost: HTMLDivElement | null;
|
|
5
|
+
rootElement: HTMLDivElement | null;
|
|
6
|
+
};
|
|
7
|
+
export declare const useShadow: () => ShadowContextValue | undefined;
|
|
8
|
+
export interface InkeepShadowProps extends PropsWithChildren {
|
|
9
|
+
wrapperStyles?: CSSProperties;
|
|
10
|
+
customStyles?: React.ReactNode;
|
|
11
|
+
styles?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function InkeepShadowProvider({ wrapperStyles, children, customStyles, styles, }: InkeepShadowProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const InkeepShadow: (props: InkeepShadowProps) => string | number | bigint | boolean | Iterable< ReactNode> | Promise<string | number | bigint | boolean | ReactPortal | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable< ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as x, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { createContext as p, useContext as w, useState as i, useMemo as v } from "react";
|
|
4
|
+
import y from "./root.js";
|
|
5
|
+
import { useId as S } from "@radix-ui/react-id";
|
|
6
|
+
const c = p(void 0), g = () => w(c);
|
|
7
|
+
function I({
|
|
8
|
+
wrapperStyles: t = {},
|
|
9
|
+
children: s,
|
|
10
|
+
customStyles: d,
|
|
11
|
+
styles: l
|
|
12
|
+
}) {
|
|
13
|
+
const [n, u] = i(null), [r, m] = i(null), a = v(() => ({ shadowHost: n, rootElement: r }), [n, r]), h = S(), f = y.div;
|
|
14
|
+
return /* @__PURE__ */ x(
|
|
15
|
+
f,
|
|
16
|
+
{
|
|
17
|
+
id: `inkeep-shadow${h}`,
|
|
18
|
+
ref: (e) => {
|
|
19
|
+
e && u(e);
|
|
20
|
+
},
|
|
21
|
+
style: t,
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ o(
|
|
24
|
+
"style",
|
|
25
|
+
{
|
|
26
|
+
type: "text/css",
|
|
27
|
+
dangerouslySetInnerHTML: {
|
|
28
|
+
__html: `@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');
|
|
29
|
+
${l}`
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
d,
|
|
34
|
+
/* @__PURE__ */ o(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
id: "inkeep-widget-root",
|
|
38
|
+
ref: (e) => {
|
|
39
|
+
e && m(e);
|
|
40
|
+
},
|
|
41
|
+
style: t,
|
|
42
|
+
children: /* @__PURE__ */ o(c.Provider, { value: a, children: n && r && s })
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
const E = (t) => g() ? t.children : /* @__PURE__ */ o(I, { ...t });
|
|
50
|
+
export {
|
|
51
|
+
E as InkeepShadow,
|
|
52
|
+
I as InkeepShadowProvider,
|
|
53
|
+
c as ShadowContext,
|
|
54
|
+
g as useShadow
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),s=require("react"),m=require("react-dom"),w=require("./utils.cjs"),p=require("react-dom/server"),x=require("./use-ensured-forwarded-ref.cjs");function g({children:e="",...a}){let t="";return s.isValidElement(e)?t=p.renderToString(e):typeof e=="string"&&(t=e),u.jsx("template",{...a,dangerouslySetInnerHTML:{__html:t}})}function q({root:e,children:a=null}){return m.createPortal(a,e)}function y(e){return s.forwardRef(({mode:t="open",delegatesFocus:l=!1,styleSheets:c=[],ssr:n=!1,children:f=null,...R},d)=>{const r=x.useEnsuredForwardedRef(d),[o,h]=s.useState(null),S=`node_${t}${l}`;return s.useLayoutEffect(()=>{if(r.current)try{if(typeof d=="function"&&d(r.current),n){const{shadowRoot:j}=r.current;h(j);return}const i=r.current.attachShadow({mode:t,delegatesFocus:l});c.length>0&&(i.adoptedStyleSheets=c),h(i)}catch(i){w.handleError({error:i,styleSheets:c,root:o})}},[d,r,c]),u.jsx(e.tag,{ref:r,...R,children:(o||n)&&u.jsx(w.Context.Provider,{value:o,children:n?u.jsx(g,{shadowroot:t,shadowrootmode:t,children:e.render({root:o,ssr:n,children:f})}):u.jsx(q,{root:o,children:e.render({root:o,ssr:n,children:f})})})},S)})}exports.create=y;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RenderFn, ShadowRootProps } from '@inkeep/cxkit-types';
|
|
3
|
+
interface CreateOptions {
|
|
4
|
+
tag: React.ElementType;
|
|
5
|
+
render: RenderFn;
|
|
6
|
+
}
|
|
7
|
+
export declare function create(options: CreateOptions): React.ForwardRefExoticComponent<ShadowRootProps & React.RefAttributes<Element>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RenderFn, ShadowRootProps } from '@inkeep/cxkit-types';
|
|
3
|
+
interface CreateOptions {
|
|
4
|
+
tag: React.ElementType;
|
|
5
|
+
render: RenderFn;
|
|
6
|
+
}
|
|
7
|
+
export declare function create(options: CreateOptions): React.ForwardRefExoticComponent<ShadowRootProps & React.RefAttributes<Element>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import R, { forwardRef as s, useState as S, useLayoutEffect as C } from "react";
|
|
4
|
+
import { createPortal as _ } from "react-dom";
|
|
5
|
+
import { handleError as g, Context as y } from "./utils.js";
|
|
6
|
+
import { renderToString as E } from "react-dom/server";
|
|
7
|
+
import { useEnsuredForwardedRef as x } from "./use-ensured-forwarded-ref.js";
|
|
8
|
+
function T({ children: o = "", ...d }) {
|
|
9
|
+
let t = "";
|
|
10
|
+
return R.isValidElement(o) ? t = E(o) : typeof o == "string" && (t = o), /* @__PURE__ */ a("template", { ...d, dangerouslySetInnerHTML: { __html: t } });
|
|
11
|
+
}
|
|
12
|
+
function v({ root: o, children: d = null }) {
|
|
13
|
+
return _(d, o);
|
|
14
|
+
}
|
|
15
|
+
function I(o) {
|
|
16
|
+
return s(
|
|
17
|
+
({
|
|
18
|
+
mode: t = "open",
|
|
19
|
+
delegatesFocus: i = !1,
|
|
20
|
+
styleSheets: f = [],
|
|
21
|
+
ssr: n = !1,
|
|
22
|
+
children: l = null,
|
|
23
|
+
...h
|
|
24
|
+
}, u) => {
|
|
25
|
+
const r = x(u), [e, m] = S(null), p = `node_${t}${i}`;
|
|
26
|
+
return C(() => {
|
|
27
|
+
if (r.current)
|
|
28
|
+
try {
|
|
29
|
+
if (typeof u == "function" && u(r.current), n) {
|
|
30
|
+
const { shadowRoot: w } = r.current;
|
|
31
|
+
m(w);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const c = r.current.attachShadow({
|
|
35
|
+
mode: t,
|
|
36
|
+
delegatesFocus: i
|
|
37
|
+
});
|
|
38
|
+
f.length > 0 && (c.adoptedStyleSheets = f), m(c);
|
|
39
|
+
} catch (c) {
|
|
40
|
+
g({ error: c, styleSheets: f, root: e });
|
|
41
|
+
}
|
|
42
|
+
}, [u, r, f]), /* @__PURE__ */ a(o.tag, { ref: r, ...h, children: (e || n) && /* @__PURE__ */ a(y.Provider, { value: e, children: n ? /* @__PURE__ */ a(T, { shadowroot: t, shadowrootmode: t, children: o.render({
|
|
43
|
+
root: e,
|
|
44
|
+
ssr: n,
|
|
45
|
+
children: l
|
|
46
|
+
}) }) : /* @__PURE__ */ a(v, { root: e, children: o.render({
|
|
47
|
+
root: e,
|
|
48
|
+
ssr: n,
|
|
49
|
+
children: l
|
|
50
|
+
}) }) }) }, p);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
I as create
|
|
56
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './context';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './context';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("humps");require("react");const g=require("./create.cjs"),t=new Map;function n(c={},s="core",u=({children:r})=>r){return new Proxy(c,{get:function(f,a){const o=l.decamelize(a,{separator:"-"}),e=`${s}-${o}`;if(!t.has(e)){const i=g.create({tag:o,render:u});t.set(e,i)}return t.get(e)}})}const d=n();exports.createProxy=n;exports.default=d;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { decamelize as m } from "humps";
|
|
3
|
+
import "react";
|
|
4
|
+
import { create as f } from "./create.js";
|
|
5
|
+
const e = /* @__PURE__ */ new Map();
|
|
6
|
+
function p(n = {}, c = "core", a = ({ children: o }) => o) {
|
|
7
|
+
return new Proxy(n, {
|
|
8
|
+
get: function(u, s) {
|
|
9
|
+
const r = m(s, { separator: "-" }), t = `${c}-${r}`;
|
|
10
|
+
if (!e.has(t)) {
|
|
11
|
+
const i = f({ tag: r, render: a });
|
|
12
|
+
e.set(t, i);
|
|
13
|
+
}
|
|
14
|
+
return e.get(t);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const y = p();
|
|
19
|
+
export {
|
|
20
|
+
p as createProxy,
|
|
21
|
+
y as default
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react");function t(e){const u=r.useRef(e?.current);return r.useEffect(()=>{e&&(e.current=u.current)},[e]),u}exports.useEnsuredForwardedRef=t;
|