@docyrus/rn-assistant 0.0.1
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/README.md +477 -0
- package/dist/commonjs/components/agent-selector/agent-selector.js +300 -0
- package/dist/commonjs/components/agent-selector/agent-selector.js.map +1 -0
- package/dist/commonjs/components/agent-selector/index.js +17 -0
- package/dist/commonjs/components/agent-selector/index.js.map +1 -0
- package/dist/commonjs/components/assistant-animations/assistant-animations.js +169 -0
- package/dist/commonjs/components/assistant-animations/assistant-animations.js.map +1 -0
- package/dist/commonjs/components/assistant-animations/index.js +17 -0
- package/dist/commonjs/components/assistant-animations/index.js.map +1 -0
- package/dist/commonjs/components/assistant-screen/assistant-screen.js +809 -0
- package/dist/commonjs/components/assistant-screen/assistant-screen.js.map +1 -0
- package/dist/commonjs/components/assistant-screen/index.js +17 -0
- package/dist/commonjs/components/assistant-screen/index.js.map +1 -0
- package/dist/commonjs/components/index.js +116 -0
- package/dist/commonjs/components/index.js.map +1 -0
- package/dist/commonjs/components/message-parts/index.js +13 -0
- package/dist/commonjs/components/message-parts/index.js.map +1 -0
- package/dist/commonjs/components/message-parts/message-parts.js +209 -0
- package/dist/commonjs/components/message-parts/message-parts.js.map +1 -0
- package/dist/commonjs/components/new-chat/index.js +17 -0
- package/dist/commonjs/components/new-chat/index.js.map +1 -0
- package/dist/commonjs/components/new-chat/new-chat.js +100 -0
- package/dist/commonjs/components/new-chat/new-chat.js.map +1 -0
- package/dist/commonjs/components/prompt-input/attachment-picker.js +341 -0
- package/dist/commonjs/components/prompt-input/attachment-picker.js.map +1 -0
- package/dist/commonjs/components/prompt-input/attachment-preview.js +229 -0
- package/dist/commonjs/components/prompt-input/attachment-preview.js.map +1 -0
- package/dist/commonjs/components/prompt-input/index.js +41 -0
- package/dist/commonjs/components/prompt-input/index.js.map +1 -0
- package/dist/commonjs/components/prompt-input/prompt-input.js +288 -0
- package/dist/commonjs/components/prompt-input/prompt-input.js.map +1 -0
- package/dist/commonjs/components/prompt-input/provider-selector.js +542 -0
- package/dist/commonjs/components/prompt-input/provider-selector.js.map +1 -0
- package/dist/commonjs/components/prompt-input/reasoning-level-selector.js +350 -0
- package/dist/commonjs/components/prompt-input/reasoning-level-selector.js.map +1 -0
- package/dist/commonjs/components/prompt-input/voice-recorder.js +260 -0
- package/dist/commonjs/components/prompt-input/voice-recorder.js.map +1 -0
- package/dist/commonjs/components/sessions-list/index.js +17 -0
- package/dist/commonjs/components/sessions-list/index.js.map +1 -0
- package/dist/commonjs/components/sessions-list/sessions-list.js +820 -0
- package/dist/commonjs/components/sessions-list/sessions-list.js.map +1 -0
- package/dist/commonjs/hooks/index.js +34 -0
- package/dist/commonjs/hooks/index.js.map +1 -0
- package/dist/commonjs/hooks/use-agent-models.js +104 -0
- package/dist/commonjs/hooks/use-agent-models.js.map +1 -0
- package/dist/commonjs/hooks/use-assistant.js +402 -0
- package/dist/commonjs/hooks/use-assistant.js.map +1 -0
- package/dist/commonjs/hooks/use-attachment-picker.js +308 -0
- package/dist/commonjs/hooks/use-attachment-picker.js.map +1 -0
- package/dist/commonjs/hooks/use-voice-recorder.js +217 -0
- package/dist/commonjs/hooks/use-voice-recorder.js.map +1 -0
- package/dist/commonjs/index.js +112 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/package.json +1 -0
- package/dist/commonjs/theme/assistant-theme.js +105 -0
- package/dist/commonjs/theme/assistant-theme.js.map +1 -0
- package/dist/commonjs/theme/index.js +19 -0
- package/dist/commonjs/theme/index.js.map +1 -0
- package/dist/commonjs/types/index.js +2 -0
- package/dist/commonjs/types/index.js.map +1 -0
- package/dist/commonjs/ui/action-sheet.js +348 -0
- package/dist/commonjs/ui/action-sheet.js.map +1 -0
- package/dist/commonjs/ui/alert-dialog.js +134 -0
- package/dist/commonjs/ui/alert-dialog.js.map +1 -0
- package/dist/commonjs/ui/docyrus-brand-mark.js +52 -0
- package/dist/commonjs/ui/docyrus-brand-mark.js.map +1 -0
- package/dist/commonjs/ui/docyrus-icon.js +298 -0
- package/dist/commonjs/ui/docyrus-icon.js.map +1 -0
- package/dist/commonjs/ui/index.js +34 -0
- package/dist/commonjs/ui/index.js.map +1 -0
- package/dist/commonjs/utils/api-client.js +99 -0
- package/dist/commonjs/utils/api-client.js.map +1 -0
- package/dist/commonjs/utils/default-api-config.js +195 -0
- package/dist/commonjs/utils/default-api-config.js.map +1 -0
- package/dist/commonjs/utils/index.js +39 -0
- package/dist/commonjs/utils/index.js.map +1 -0
- package/dist/commonjs/utils/resolve-api-headers.js +16 -0
- package/dist/commonjs/utils/resolve-api-headers.js.map +1 -0
- package/dist/module/components/agent-selector/agent-selector.js +296 -0
- package/dist/module/components/agent-selector/agent-selector.js.map +1 -0
- package/dist/module/components/agent-selector/index.js +4 -0
- package/dist/module/components/agent-selector/index.js.map +1 -0
- package/dist/module/components/assistant-animations/assistant-animations.js +164 -0
- package/dist/module/components/assistant-animations/assistant-animations.js.map +1 -0
- package/dist/module/components/assistant-animations/index.js +4 -0
- package/dist/module/components/assistant-animations/index.js.map +1 -0
- package/dist/module/components/assistant-screen/assistant-screen.js +801 -0
- package/dist/module/components/assistant-screen/assistant-screen.js.map +1 -0
- package/dist/module/components/assistant-screen/index.js +4 -0
- package/dist/module/components/assistant-screen/index.js.map +1 -0
- package/dist/module/components/index.js +23 -0
- package/dist/module/components/index.js.map +1 -0
- package/dist/module/components/message-parts/index.js +4 -0
- package/dist/module/components/message-parts/index.js.map +1 -0
- package/dist/module/components/message-parts/message-parts.js +205 -0
- package/dist/module/components/message-parts/message-parts.js.map +1 -0
- package/dist/module/components/new-chat/index.js +4 -0
- package/dist/module/components/new-chat/index.js.map +1 -0
- package/dist/module/components/new-chat/new-chat.js +96 -0
- package/dist/module/components/new-chat/new-chat.js.map +1 -0
- package/dist/module/components/prompt-input/attachment-picker.js +337 -0
- package/dist/module/components/prompt-input/attachment-picker.js.map +1 -0
- package/dist/module/components/prompt-input/attachment-preview.js +225 -0
- package/dist/module/components/prompt-input/attachment-preview.js.map +1 -0
- package/dist/module/components/prompt-input/index.js +15 -0
- package/dist/module/components/prompt-input/index.js.map +1 -0
- package/dist/module/components/prompt-input/prompt-input.js +284 -0
- package/dist/module/components/prompt-input/prompt-input.js.map +1 -0
- package/dist/module/components/prompt-input/provider-selector.js +538 -0
- package/dist/module/components/prompt-input/provider-selector.js.map +1 -0
- package/dist/module/components/prompt-input/reasoning-level-selector.js +346 -0
- package/dist/module/components/prompt-input/reasoning-level-selector.js.map +1 -0
- package/dist/module/components/prompt-input/voice-recorder.js +256 -0
- package/dist/module/components/prompt-input/voice-recorder.js.map +1 -0
- package/dist/module/components/sessions-list/index.js +4 -0
- package/dist/module/components/sessions-list/index.js.map +1 -0
- package/dist/module/components/sessions-list/sessions-list.js +816 -0
- package/dist/module/components/sessions-list/sessions-list.js.map +1 -0
- package/dist/module/hooks/index.js +18 -0
- package/dist/module/hooks/index.js.map +1 -0
- package/dist/module/hooks/use-agent-models.js +100 -0
- package/dist/module/hooks/use-agent-models.js.map +1 -0
- package/dist/module/hooks/use-assistant.js +398 -0
- package/dist/module/hooks/use-assistant.js.map +1 -0
- package/dist/module/hooks/use-attachment-picker.js +303 -0
- package/dist/module/hooks/use-attachment-picker.js.map +1 -0
- package/dist/module/hooks/use-voice-recorder.js +214 -0
- package/dist/module/hooks/use-voice-recorder.js.map +1 -0
- package/dist/module/index.js +59 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/theme/assistant-theme.js +100 -0
- package/dist/module/theme/assistant-theme.js.map +1 -0
- package/dist/module/theme/index.js +4 -0
- package/dist/module/theme/index.js.map +1 -0
- package/dist/module/types/index.js +2 -0
- package/dist/module/types/index.js.map +1 -0
- package/dist/module/ui/action-sheet.js +344 -0
- package/dist/module/ui/action-sheet.js.map +1 -0
- package/dist/module/ui/alert-dialog.js +130 -0
- package/dist/module/ui/alert-dialog.js.map +1 -0
- package/dist/module/ui/docyrus-brand-mark.js +48 -0
- package/dist/module/ui/docyrus-brand-mark.js.map +1 -0
- package/dist/module/ui/docyrus-icon.js +294 -0
- package/dist/module/ui/docyrus-icon.js.map +1 -0
- package/dist/module/ui/index.js +7 -0
- package/dist/module/ui/index.js.map +1 -0
- package/dist/module/utils/api-client.js +95 -0
- package/dist/module/utils/api-client.js.map +1 -0
- package/dist/module/utils/default-api-config.js +190 -0
- package/dist/module/utils/default-api-config.js.map +1 -0
- package/dist/module/utils/index.js +12 -0
- package/dist/module/utils/index.js.map +1 -0
- package/dist/module/utils/resolve-api-headers.js +12 -0
- package/dist/module/utils/resolve-api-headers.js.map +1 -0
- package/dist/typescript/commonjs/eslint.config.d.mts +4 -0
- package/dist/typescript/commonjs/eslint.config.d.mts.map +1 -0
- package/dist/typescript/commonjs/package.json +1 -0
- package/dist/typescript/commonjs/src/components/agent-selector/agent-selector.d.ts +49 -0
- package/dist/typescript/commonjs/src/components/agent-selector/agent-selector.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/agent-selector/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/agent-selector/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/assistant-animations/assistant-animations.d.ts +8 -0
- package/dist/typescript/commonjs/src/components/assistant-animations/assistant-animations.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/assistant-animations/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/assistant-animations/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/assistant-screen/assistant-screen.d.ts +122 -0
- package/dist/typescript/commonjs/src/components/assistant-screen/assistant-screen.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/assistant-screen/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/assistant-screen/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/index.d.ts +11 -0
- package/dist/typescript/commonjs/src/components/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/message-parts/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/message-parts/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/message-parts/message-parts.d.ts +22 -0
- package/dist/typescript/commonjs/src/components/message-parts/message-parts.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/new-chat/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/new-chat/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/new-chat/new-chat.d.ts +34 -0
- package/dist/typescript/commonjs/src/components/new-chat/new-chat.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/attachment-picker.d.ts +53 -0
- package/dist/typescript/commonjs/src/components/prompt-input/attachment-picker.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/attachment-preview.d.ts +42 -0
- package/dist/typescript/commonjs/src/components/prompt-input/attachment-preview.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/index.d.ts +9 -0
- package/dist/typescript/commonjs/src/components/prompt-input/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/prompt-input.d.ts +139 -0
- package/dist/typescript/commonjs/src/components/prompt-input/prompt-input.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/provider-selector.d.ts +11 -0
- package/dist/typescript/commonjs/src/components/prompt-input/provider-selector.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/reasoning-level-selector.d.ts +35 -0
- package/dist/typescript/commonjs/src/components/prompt-input/reasoning-level-selector.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/prompt-input/voice-recorder.d.ts +48 -0
- package/dist/typescript/commonjs/src/components/prompt-input/voice-recorder.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/sessions-list/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/components/sessions-list/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/components/sessions-list/sessions-list.d.ts +59 -0
- package/dist/typescript/commonjs/src/components/sessions-list/sessions-list.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/index.d.ts +8 -0
- package/dist/typescript/commonjs/src/hooks/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/use-agent-models.d.ts +68 -0
- package/dist/typescript/commonjs/src/hooks/use-agent-models.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/use-assistant.d.ts +55 -0
- package/dist/typescript/commonjs/src/hooks/use-assistant.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/use-attachment-picker.d.ts +99 -0
- package/dist/typescript/commonjs/src/hooks/use-attachment-picker.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/hooks/use-voice-recorder.d.ts +101 -0
- package/dist/typescript/commonjs/src/hooks/use-voice-recorder.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/index.d.ts +47 -0
- package/dist/typescript/commonjs/src/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/theme/assistant-theme.d.ts +51 -0
- package/dist/typescript/commonjs/src/theme/assistant-theme.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/theme/index.d.ts +2 -0
- package/dist/typescript/commonjs/src/theme/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/types/index.d.ts +167 -0
- package/dist/typescript/commonjs/src/types/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/action-sheet.d.ts +29 -0
- package/dist/typescript/commonjs/src/ui/action-sheet.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/alert-dialog.d.ts +12 -0
- package/dist/typescript/commonjs/src/ui/alert-dialog.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/docyrus-brand-mark.d.ts +5 -0
- package/dist/typescript/commonjs/src/ui/docyrus-brand-mark.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/docyrus-icon.d.ts +11 -0
- package/dist/typescript/commonjs/src/ui/docyrus-icon.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/ui/index.d.ts +5 -0
- package/dist/typescript/commonjs/src/ui/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utils/api-client.d.ts +35 -0
- package/dist/typescript/commonjs/src/utils/api-client.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utils/default-api-config.d.ts +38 -0
- package/dist/typescript/commonjs/src/utils/default-api-config.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utils/index.d.ts +9 -0
- package/dist/typescript/commonjs/src/utils/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/src/utils/resolve-api-headers.d.ts +3 -0
- package/dist/typescript/commonjs/src/utils/resolve-api-headers.d.ts.map +1 -0
- package/dist/typescript/module/eslint.config.d.mts +4 -0
- package/dist/typescript/module/eslint.config.d.mts.map +1 -0
- package/dist/typescript/module/package.json +1 -0
- package/dist/typescript/module/src/components/agent-selector/agent-selector.d.ts +49 -0
- package/dist/typescript/module/src/components/agent-selector/agent-selector.d.ts.map +1 -0
- package/dist/typescript/module/src/components/agent-selector/index.d.ts +2 -0
- package/dist/typescript/module/src/components/agent-selector/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/assistant-animations/assistant-animations.d.ts +8 -0
- package/dist/typescript/module/src/components/assistant-animations/assistant-animations.d.ts.map +1 -0
- package/dist/typescript/module/src/components/assistant-animations/index.d.ts +2 -0
- package/dist/typescript/module/src/components/assistant-animations/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/assistant-screen/assistant-screen.d.ts +122 -0
- package/dist/typescript/module/src/components/assistant-screen/assistant-screen.d.ts.map +1 -0
- package/dist/typescript/module/src/components/assistant-screen/index.d.ts +2 -0
- package/dist/typescript/module/src/components/assistant-screen/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/index.d.ts +11 -0
- package/dist/typescript/module/src/components/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/message-parts/index.d.ts +2 -0
- package/dist/typescript/module/src/components/message-parts/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/message-parts/message-parts.d.ts +22 -0
- package/dist/typescript/module/src/components/message-parts/message-parts.d.ts.map +1 -0
- package/dist/typescript/module/src/components/new-chat/index.d.ts +2 -0
- package/dist/typescript/module/src/components/new-chat/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/new-chat/new-chat.d.ts +34 -0
- package/dist/typescript/module/src/components/new-chat/new-chat.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/attachment-picker.d.ts +53 -0
- package/dist/typescript/module/src/components/prompt-input/attachment-picker.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/attachment-preview.d.ts +42 -0
- package/dist/typescript/module/src/components/prompt-input/attachment-preview.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/index.d.ts +9 -0
- package/dist/typescript/module/src/components/prompt-input/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/prompt-input.d.ts +139 -0
- package/dist/typescript/module/src/components/prompt-input/prompt-input.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/provider-selector.d.ts +11 -0
- package/dist/typescript/module/src/components/prompt-input/provider-selector.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/reasoning-level-selector.d.ts +35 -0
- package/dist/typescript/module/src/components/prompt-input/reasoning-level-selector.d.ts.map +1 -0
- package/dist/typescript/module/src/components/prompt-input/voice-recorder.d.ts +48 -0
- package/dist/typescript/module/src/components/prompt-input/voice-recorder.d.ts.map +1 -0
- package/dist/typescript/module/src/components/sessions-list/index.d.ts +2 -0
- package/dist/typescript/module/src/components/sessions-list/index.d.ts.map +1 -0
- package/dist/typescript/module/src/components/sessions-list/sessions-list.d.ts +59 -0
- package/dist/typescript/module/src/components/sessions-list/sessions-list.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/index.d.ts +8 -0
- package/dist/typescript/module/src/hooks/index.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/use-agent-models.d.ts +68 -0
- package/dist/typescript/module/src/hooks/use-agent-models.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/use-assistant.d.ts +55 -0
- package/dist/typescript/module/src/hooks/use-assistant.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/use-attachment-picker.d.ts +99 -0
- package/dist/typescript/module/src/hooks/use-attachment-picker.d.ts.map +1 -0
- package/dist/typescript/module/src/hooks/use-voice-recorder.d.ts +101 -0
- package/dist/typescript/module/src/hooks/use-voice-recorder.d.ts.map +1 -0
- package/dist/typescript/module/src/index.d.ts +47 -0
- package/dist/typescript/module/src/index.d.ts.map +1 -0
- package/dist/typescript/module/src/theme/assistant-theme.d.ts +51 -0
- package/dist/typescript/module/src/theme/assistant-theme.d.ts.map +1 -0
- package/dist/typescript/module/src/theme/index.d.ts +2 -0
- package/dist/typescript/module/src/theme/index.d.ts.map +1 -0
- package/dist/typescript/module/src/types/index.d.ts +167 -0
- package/dist/typescript/module/src/types/index.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/action-sheet.d.ts +29 -0
- package/dist/typescript/module/src/ui/action-sheet.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/alert-dialog.d.ts +12 -0
- package/dist/typescript/module/src/ui/alert-dialog.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/docyrus-brand-mark.d.ts +5 -0
- package/dist/typescript/module/src/ui/docyrus-brand-mark.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/docyrus-icon.d.ts +11 -0
- package/dist/typescript/module/src/ui/docyrus-icon.d.ts.map +1 -0
- package/dist/typescript/module/src/ui/index.d.ts +5 -0
- package/dist/typescript/module/src/ui/index.d.ts.map +1 -0
- package/dist/typescript/module/src/utils/api-client.d.ts +35 -0
- package/dist/typescript/module/src/utils/api-client.d.ts.map +1 -0
- package/dist/typescript/module/src/utils/default-api-config.d.ts +38 -0
- package/dist/typescript/module/src/utils/default-api-config.d.ts.map +1 -0
- package/dist/typescript/module/src/utils/index.d.ts +9 -0
- package/dist/typescript/module/src/utils/index.d.ts.map +1 -0
- package/dist/typescript/module/src/utils/resolve-api-headers.d.ts +3 -0
- package/dist/typescript/module/src/utils/resolve-api-headers.d.ts.map +1 -0
- package/package.json +176 -0
|
@@ -0,0 +1,816 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
4
|
+
import { View, Text, FlatList, TouchableOpacity, StyleSheet } from 'react-native';
|
|
5
|
+
import { ArrowRight, Clock3, MessageSquareText, MessagesSquare, Plus, RefreshCw, Sparkles, Trash2 } from 'lucide-react-native';
|
|
6
|
+
import { useI18n } from '@docyrus/i18n/rn';
|
|
7
|
+
import { apiClient } from "../../utils/api-client.js";
|
|
8
|
+
import { resolveAPIHeaders } from "../../utils/resolve-api-headers.js";
|
|
9
|
+
import { useDocyrusRNAssistantTheme } from "../../theme/index.js";
|
|
10
|
+
import { AlertDialog as DocyAlertDialog } from "../../ui/index.js";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
/**
|
|
13
|
+
* Sessions List Component
|
|
14
|
+
*
|
|
15
|
+
* Displays list of user's chat sessions with the agent.
|
|
16
|
+
* Sessions are ordered by last modified date.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <SessionsList
|
|
21
|
+
* api="https://api.docyrus.com"
|
|
22
|
+
* agentId="agent-123"
|
|
23
|
+
* token={userToken}
|
|
24
|
+
* onSelectSession={(session) => navigate('Chat', { sessionId: session.id })}
|
|
25
|
+
* onNewChat={() => navigate('Chat')}
|
|
26
|
+
* />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export function SessionsList({
|
|
30
|
+
apiConfig,
|
|
31
|
+
agentId,
|
|
32
|
+
userId,
|
|
33
|
+
dataSourceId = 'f42b3daa-ca43-11ed-be9d-6fe3a1a7b37c',
|
|
34
|
+
headers = {},
|
|
35
|
+
onSelectSession,
|
|
36
|
+
onNewChat,
|
|
37
|
+
showHeader = true
|
|
38
|
+
}) {
|
|
39
|
+
const theme = useDocyrusRNAssistantTheme();
|
|
40
|
+
const {
|
|
41
|
+
t
|
|
42
|
+
} = useI18n();
|
|
43
|
+
const [sessions, setSessions] = useState([]);
|
|
44
|
+
const [loading, setLoading] = useState(true);
|
|
45
|
+
const [refreshing, setRefreshing] = useState(false);
|
|
46
|
+
const [deletingSessionId, setDeletingSessionId] = useState(null);
|
|
47
|
+
const [sessionToDelete, setSessionToDelete] = useState(null);
|
|
48
|
+
const fetchSessions = useCallback(async (isRefresh = false) => {
|
|
49
|
+
if (isRefresh) {
|
|
50
|
+
setRefreshing(true);
|
|
51
|
+
} else {
|
|
52
|
+
setLoading(true);
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
// Build filters for query API
|
|
56
|
+
const filters = {
|
|
57
|
+
combinator: 'and',
|
|
58
|
+
rules: [{
|
|
59
|
+
field: 'tenant_ai_agent_id',
|
|
60
|
+
operator: '=',
|
|
61
|
+
value: agentId
|
|
62
|
+
}]
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// Add user filter if userId is provided
|
|
66
|
+
if (userId) {
|
|
67
|
+
filters.rules.push({
|
|
68
|
+
field: 'created_by',
|
|
69
|
+
operator: '=',
|
|
70
|
+
value: userId
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Build query params (matching web version format)
|
|
75
|
+
const params = new URLSearchParams({
|
|
76
|
+
columns: JSON.stringify(['subject', 'created_on', 'last_modified_on', 'created_by']),
|
|
77
|
+
limit: '100',
|
|
78
|
+
orderBy: JSON.stringify([{
|
|
79
|
+
field: 'created_on',
|
|
80
|
+
direction: 'desc'
|
|
81
|
+
}]),
|
|
82
|
+
dataSourceId,
|
|
83
|
+
filters: JSON.stringify(filters),
|
|
84
|
+
fullCount: 'true',
|
|
85
|
+
expand: 'record_owner,created_by,last_modified_by,request_type,incoming_channel,parent_record_id,followers,contact,tenant_data_source_id,tenant_ai_agent_id,organization,priority,case_status,category,product,hold_reason,thread_type,tenant_ai_agent_deployment_id,thread_mode,tenant_view_id'
|
|
86
|
+
});
|
|
87
|
+
const url = `${apiConfig.baseUrl}${apiConfig.endpoints.sessions}?${params.toString()}`;
|
|
88
|
+
const resolvedApiHeaders = await resolveAPIHeaders(apiConfig.headers);
|
|
89
|
+
|
|
90
|
+
// Use centralized API client
|
|
91
|
+
const data = await apiClient(url, {
|
|
92
|
+
headers: {
|
|
93
|
+
...resolvedApiHeaders,
|
|
94
|
+
...headers
|
|
95
|
+
},
|
|
96
|
+
transformResponse: apiConfig.transformResponse
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// API returns array directly after transform, or records array
|
|
100
|
+
const records = Array.isArray(data) ? data : data.records || data || [];
|
|
101
|
+
|
|
102
|
+
// Map records to AISession format
|
|
103
|
+
const mappedSessions = records.map(record => ({
|
|
104
|
+
id: record.id,
|
|
105
|
+
subject: record.subject || t('assistant.untitled-session', 'Untitled Session'),
|
|
106
|
+
preview: record.preview,
|
|
107
|
+
agentId: record.tenant_ai_agent_id || agentId,
|
|
108
|
+
agentDeploymentId: record.tenant_ai_agent_deployment_id,
|
|
109
|
+
createdOn: new Date(record.created_on || record.createdOn),
|
|
110
|
+
lastModifiedOn: new Date(record.last_modified_on || record.updatedOn),
|
|
111
|
+
messageCount: record.message_count || 0
|
|
112
|
+
}));
|
|
113
|
+
setSessions(mappedSessions);
|
|
114
|
+
} catch (error) {
|
|
115
|
+
console.error('Error fetching sessions:', error);
|
|
116
|
+
setSessions([]);
|
|
117
|
+
} finally {
|
|
118
|
+
setLoading(false);
|
|
119
|
+
setRefreshing(false);
|
|
120
|
+
}
|
|
121
|
+
}, [agentId, apiConfig.baseUrl, apiConfig.endpoints.sessions, apiConfig.headers, apiConfig.transformResponse, dataSourceId, headers, userId, t]);
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
fetchSessions();
|
|
124
|
+
}, [fetchSessions]);
|
|
125
|
+
const deleteSession = async sessionId => {
|
|
126
|
+
try {
|
|
127
|
+
setDeletingSessionId(sessionId);
|
|
128
|
+
const url = `${apiConfig.baseUrl}${apiConfig.endpoints.deleteSession.replace(':sessionId', sessionId)}`;
|
|
129
|
+
const resolvedApiHeaders = await resolveAPIHeaders(apiConfig.headers);
|
|
130
|
+
|
|
131
|
+
// Use centralized API client
|
|
132
|
+
await apiClient(url, {
|
|
133
|
+
method: 'DELETE',
|
|
134
|
+
headers: {
|
|
135
|
+
...resolvedApiHeaders,
|
|
136
|
+
...headers
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
// Refresh sessions list
|
|
141
|
+
await fetchSessions();
|
|
142
|
+
} catch (error) {
|
|
143
|
+
console.error('Error deleting session:', error);
|
|
144
|
+
} finally {
|
|
145
|
+
setDeletingSessionId(null);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
const formatDate = useCallback(date => {
|
|
149
|
+
try {
|
|
150
|
+
const now = new Date();
|
|
151
|
+
const messageDate = new Date(date);
|
|
152
|
+
|
|
153
|
+
// Check if date is valid
|
|
154
|
+
if (isNaN(messageDate.getTime())) {
|
|
155
|
+
return t('common.time-recently', 'Recently');
|
|
156
|
+
}
|
|
157
|
+
const diff = now.getTime() - messageDate.getTime();
|
|
158
|
+
|
|
159
|
+
// Handle future dates or negative diffs
|
|
160
|
+
if (diff < 0) {
|
|
161
|
+
return t('common.time-just-now', 'Just now');
|
|
162
|
+
}
|
|
163
|
+
const minutes = Math.floor(diff / (1000 * 60));
|
|
164
|
+
const hours = Math.floor(diff / (1000 * 60 * 60));
|
|
165
|
+
const days = Math.floor(diff / (1000 * 60 * 60 * 24));
|
|
166
|
+
if (minutes < 1) return t('common.time-now', 'now');
|
|
167
|
+
if (minutes < 60) return `${minutes}${t('common.time-minutes-ago', 'm ago')}`;
|
|
168
|
+
if (hours < 24) return `${hours}${t('common.time-hours-ago', 'h ago')}`;
|
|
169
|
+
if (days < 7) return `${days}${t('common.time-days-ago', 'd ago')}`;
|
|
170
|
+
if (days < 30) return `${Math.floor(days / 7)}${t('common.time-weeks-ago', 'w ago')}`;
|
|
171
|
+
return messageDate.toLocaleDateString('en-US', {
|
|
172
|
+
month: 'short',
|
|
173
|
+
day: 'numeric',
|
|
174
|
+
year: 'numeric'
|
|
175
|
+
});
|
|
176
|
+
} catch {
|
|
177
|
+
return t('common.time-recently', 'Recently');
|
|
178
|
+
}
|
|
179
|
+
}, [t]);
|
|
180
|
+
const formatAbsoluteDate = useCallback(date => {
|
|
181
|
+
try {
|
|
182
|
+
const value = new Date(date);
|
|
183
|
+
if (isNaN(value.getTime())) {
|
|
184
|
+
return t('common.time-recently', 'Recently');
|
|
185
|
+
}
|
|
186
|
+
return value.toLocaleDateString('en-US', {
|
|
187
|
+
month: 'short',
|
|
188
|
+
day: 'numeric'
|
|
189
|
+
});
|
|
190
|
+
} catch {
|
|
191
|
+
return t('common.time-recently', 'Recently');
|
|
192
|
+
}
|
|
193
|
+
}, [t]);
|
|
194
|
+
const getSessionPreview = useCallback(session => {
|
|
195
|
+
if (session.preview?.trim()) {
|
|
196
|
+
return session.preview;
|
|
197
|
+
}
|
|
198
|
+
if (session.messageCount && session.messageCount > 0) {
|
|
199
|
+
return t('assistant.session-has-messages', 'Continue this conversation where you left off.');
|
|
200
|
+
}
|
|
201
|
+
return t('assistant.session-awaiting-first-message', 'A fresh thread ready for the next prompt.');
|
|
202
|
+
}, [t]);
|
|
203
|
+
const renderSession = ({
|
|
204
|
+
item
|
|
205
|
+
}) => {
|
|
206
|
+
const isDeleting = deletingSessionId === item.id;
|
|
207
|
+
const preview = getSessionPreview(item);
|
|
208
|
+
const messageCountLabel = item.messageCount === 1 ? t('assistant.msg', 'msg') : t('assistant.msgs', 'msgs');
|
|
209
|
+
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
210
|
+
onPress: () => !isDeleting && onSelectSession(item),
|
|
211
|
+
disabled: isDeleting,
|
|
212
|
+
activeOpacity: 0.88,
|
|
213
|
+
style: [styles.sessionPressable, {
|
|
214
|
+
opacity: isDeleting ? 0.5 : 1
|
|
215
|
+
}],
|
|
216
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
217
|
+
style: [styles.sessionItem, {
|
|
218
|
+
paddingVertical: theme.spacing[4],
|
|
219
|
+
paddingHorizontal: theme.spacing[4],
|
|
220
|
+
borderRadius: theme.borderRadius.xl,
|
|
221
|
+
backgroundColor: theme.colors.card,
|
|
222
|
+
borderWidth: 1,
|
|
223
|
+
borderColor: theme.colors.border,
|
|
224
|
+
shadowColor: '#0f172a',
|
|
225
|
+
shadowOffset: {
|
|
226
|
+
width: 0,
|
|
227
|
+
height: 10
|
|
228
|
+
},
|
|
229
|
+
shadowOpacity: theme.isDark ? 0.18 : 0.08,
|
|
230
|
+
shadowRadius: 24,
|
|
231
|
+
elevation: 3
|
|
232
|
+
}],
|
|
233
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
234
|
+
style: styles.sessionTopRow,
|
|
235
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
236
|
+
style: [styles.sessionAvatar, {
|
|
237
|
+
backgroundColor: `${theme.colors.primary}14`,
|
|
238
|
+
borderRadius: theme.borderRadius.lg
|
|
239
|
+
}],
|
|
240
|
+
children: /*#__PURE__*/_jsx(MessageSquareText, {
|
|
241
|
+
size: 18,
|
|
242
|
+
color: theme.colors.primary,
|
|
243
|
+
strokeWidth: 2.2
|
|
244
|
+
})
|
|
245
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
246
|
+
style: styles.sessionContent,
|
|
247
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
248
|
+
style: styles.sessionHeaderRow,
|
|
249
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
250
|
+
style: [styles.sessionTitle, {
|
|
251
|
+
color: theme.colors.foreground
|
|
252
|
+
}],
|
|
253
|
+
numberOfLines: 1,
|
|
254
|
+
children: item.subject || t('assistant.untitled-session', 'Untitled Session')
|
|
255
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
256
|
+
style: [styles.dateChip, {
|
|
257
|
+
backgroundColor: theme.colors.muted,
|
|
258
|
+
borderRadius: theme.borderRadius.full
|
|
259
|
+
}],
|
|
260
|
+
children: [/*#__PURE__*/_jsx(Clock3, {
|
|
261
|
+
size: 12,
|
|
262
|
+
color: theme.colors.mutedForeground,
|
|
263
|
+
strokeWidth: 2.1
|
|
264
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
265
|
+
style: [styles.dateChipText, {
|
|
266
|
+
color: theme.colors.mutedForeground
|
|
267
|
+
}],
|
|
268
|
+
children: formatAbsoluteDate(item.lastModifiedOn)
|
|
269
|
+
})]
|
|
270
|
+
})]
|
|
271
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
272
|
+
style: [styles.previewText, {
|
|
273
|
+
color: theme.colors.mutedForeground
|
|
274
|
+
}],
|
|
275
|
+
numberOfLines: 2,
|
|
276
|
+
children: preview
|
|
277
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
278
|
+
style: [styles.metaRow, {
|
|
279
|
+
marginTop: theme.spacing[2]
|
|
280
|
+
}],
|
|
281
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
282
|
+
style: [styles.metaChip, {
|
|
283
|
+
backgroundColor: theme.colors.muted,
|
|
284
|
+
borderRadius: theme.borderRadius.full
|
|
285
|
+
}],
|
|
286
|
+
children: [/*#__PURE__*/_jsx(RefreshCw, {
|
|
287
|
+
size: 12,
|
|
288
|
+
color: theme.colors.mutedForeground,
|
|
289
|
+
strokeWidth: 2.1
|
|
290
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
291
|
+
style: [styles.metaChipText, {
|
|
292
|
+
color: theme.colors.mutedForeground
|
|
293
|
+
}],
|
|
294
|
+
children: `${t('assistant.updated', 'Updated')} ${formatDate(item.lastModifiedOn)}`
|
|
295
|
+
})]
|
|
296
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
297
|
+
style: [styles.metaChip, {
|
|
298
|
+
backgroundColor: `${theme.colors.primary}12`,
|
|
299
|
+
borderRadius: theme.borderRadius.full
|
|
300
|
+
}],
|
|
301
|
+
children: [/*#__PURE__*/_jsx(MessagesSquare, {
|
|
302
|
+
size: 12,
|
|
303
|
+
color: theme.colors.primary,
|
|
304
|
+
strokeWidth: 2.1
|
|
305
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
306
|
+
style: [styles.metaChipText, {
|
|
307
|
+
color: theme.colors.primary
|
|
308
|
+
}],
|
|
309
|
+
children: `${item.messageCount || 0} ${messageCountLabel}`
|
|
310
|
+
})]
|
|
311
|
+
})]
|
|
312
|
+
})]
|
|
313
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
314
|
+
style: styles.trailingActions,
|
|
315
|
+
children: [isDeleting ? /*#__PURE__*/_jsx(View, {
|
|
316
|
+
style: {
|
|
317
|
+
width: 36,
|
|
318
|
+
height: 36,
|
|
319
|
+
borderRadius: theme.borderRadius.full,
|
|
320
|
+
backgroundColor: theme.colors.muted,
|
|
321
|
+
opacity: 0.5
|
|
322
|
+
}
|
|
323
|
+
}) : /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
324
|
+
onPress: e => {
|
|
325
|
+
e.stopPropagation();
|
|
326
|
+
setSessionToDelete(item);
|
|
327
|
+
},
|
|
328
|
+
style: [styles.iconButton, {
|
|
329
|
+
borderRadius: theme.borderRadius.full,
|
|
330
|
+
backgroundColor: theme.colors.muted
|
|
331
|
+
}],
|
|
332
|
+
hitSlop: {
|
|
333
|
+
top: 10,
|
|
334
|
+
bottom: 10,
|
|
335
|
+
left: 10,
|
|
336
|
+
right: 10
|
|
337
|
+
},
|
|
338
|
+
children: /*#__PURE__*/_jsx(Trash2, {
|
|
339
|
+
size: 16,
|
|
340
|
+
color: theme.colors.mutedForeground,
|
|
341
|
+
strokeWidth: 2.2
|
|
342
|
+
})
|
|
343
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
344
|
+
style: [styles.arrowBadge, {
|
|
345
|
+
backgroundColor: `${theme.colors.primary}10`,
|
|
346
|
+
borderRadius: theme.borderRadius.full
|
|
347
|
+
}],
|
|
348
|
+
children: /*#__PURE__*/_jsx(ArrowRight, {
|
|
349
|
+
size: 16,
|
|
350
|
+
color: theme.colors.primary,
|
|
351
|
+
strokeWidth: 2.2
|
|
352
|
+
})
|
|
353
|
+
})]
|
|
354
|
+
})]
|
|
355
|
+
})
|
|
356
|
+
})
|
|
357
|
+
});
|
|
358
|
+
};
|
|
359
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
360
|
+
style: [styles.container, {
|
|
361
|
+
backgroundColor: theme.colors.background
|
|
362
|
+
}],
|
|
363
|
+
children: [showHeader && /*#__PURE__*/_jsx(View, {
|
|
364
|
+
style: [styles.heroWrap, {
|
|
365
|
+
padding: theme.spacing[4],
|
|
366
|
+
backgroundColor: theme.colors.background,
|
|
367
|
+
borderBottomWidth: 1,
|
|
368
|
+
borderBottomColor: theme.colors.border
|
|
369
|
+
}],
|
|
370
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
371
|
+
style: [styles.heroCard, {
|
|
372
|
+
backgroundColor: theme.colors.card,
|
|
373
|
+
borderColor: theme.colors.border,
|
|
374
|
+
borderRadius: theme.borderRadius.xl,
|
|
375
|
+
shadowColor: '#0f172a',
|
|
376
|
+
shadowOffset: {
|
|
377
|
+
width: 0,
|
|
378
|
+
height: 10
|
|
379
|
+
},
|
|
380
|
+
shadowOpacity: theme.isDark ? 0.16 : 0.08,
|
|
381
|
+
shadowRadius: 24,
|
|
382
|
+
elevation: 3
|
|
383
|
+
}],
|
|
384
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
385
|
+
style: styles.heroTopRow,
|
|
386
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
387
|
+
style: styles.heroTitleWrap,
|
|
388
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
389
|
+
style: [styles.heroIconWrap, {
|
|
390
|
+
backgroundColor: `${theme.colors.primary}12`,
|
|
391
|
+
borderRadius: theme.borderRadius.lg
|
|
392
|
+
}],
|
|
393
|
+
children: /*#__PURE__*/_jsx(MessagesSquare, {
|
|
394
|
+
size: 22,
|
|
395
|
+
color: theme.colors.primary,
|
|
396
|
+
strokeWidth: 2.2
|
|
397
|
+
})
|
|
398
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
399
|
+
style: [styles.heroTitle, {
|
|
400
|
+
color: theme.colors.foreground,
|
|
401
|
+
marginLeft: theme.spacing[2]
|
|
402
|
+
}],
|
|
403
|
+
children: t('assistant.sessions', 'Sessions')
|
|
404
|
+
})]
|
|
405
|
+
}), /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
406
|
+
onPress: onNewChat,
|
|
407
|
+
style: [styles.newChatButton, {
|
|
408
|
+
borderRadius: theme.borderRadius.full,
|
|
409
|
+
backgroundColor: theme.colors.primary
|
|
410
|
+
}],
|
|
411
|
+
children: [/*#__PURE__*/_jsx(Plus, {
|
|
412
|
+
size: 16,
|
|
413
|
+
color: theme.colors.primaryForeground,
|
|
414
|
+
strokeWidth: 2.4
|
|
415
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
416
|
+
style: [styles.newChatButtonText, {
|
|
417
|
+
color: theme.colors.primaryForeground
|
|
418
|
+
}],
|
|
419
|
+
children: t('assistant.new-chat', 'New Chat')
|
|
420
|
+
})]
|
|
421
|
+
})]
|
|
422
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
423
|
+
style: [styles.heroDescription, {
|
|
424
|
+
color: theme.colors.mutedForeground,
|
|
425
|
+
marginTop: theme.spacing[2]
|
|
426
|
+
}],
|
|
427
|
+
children: t('assistant.sessions-desc', 'Resume earlier threads, revisit ideas, and jump back into recent work instantly.')
|
|
428
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
429
|
+
style: [styles.heroMetaRow, {
|
|
430
|
+
marginTop: theme.spacing[3]
|
|
431
|
+
}],
|
|
432
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
433
|
+
style: [styles.heroStatChip, {
|
|
434
|
+
backgroundColor: theme.colors.muted,
|
|
435
|
+
borderRadius: theme.borderRadius.full
|
|
436
|
+
}],
|
|
437
|
+
children: [/*#__PURE__*/_jsx(MessagesSquare, {
|
|
438
|
+
size: 13,
|
|
439
|
+
color: theme.colors.foreground,
|
|
440
|
+
strokeWidth: 2.2
|
|
441
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
442
|
+
style: [styles.heroStatText, {
|
|
443
|
+
color: theme.colors.foreground
|
|
444
|
+
}],
|
|
445
|
+
children: `${sessions.length} ${t('assistant.sessions', 'Sessions')}`
|
|
446
|
+
})]
|
|
447
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
448
|
+
style: [styles.heroStatChip, {
|
|
449
|
+
backgroundColor: `${theme.colors.primary}12`,
|
|
450
|
+
borderRadius: theme.borderRadius.full
|
|
451
|
+
}],
|
|
452
|
+
children: [/*#__PURE__*/_jsx(Sparkles, {
|
|
453
|
+
size: 13,
|
|
454
|
+
color: theme.colors.primary,
|
|
455
|
+
strokeWidth: 2.2
|
|
456
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
457
|
+
style: [styles.heroStatText, {
|
|
458
|
+
color: theme.colors.primary
|
|
459
|
+
}],
|
|
460
|
+
children: t('assistant.pick-up-where-left-off', 'Pick up where you left off')
|
|
461
|
+
})]
|
|
462
|
+
})]
|
|
463
|
+
})]
|
|
464
|
+
})
|
|
465
|
+
}), loading ? /*#__PURE__*/_jsx(View, {
|
|
466
|
+
style: {
|
|
467
|
+
flex: 1,
|
|
468
|
+
padding: theme.spacing[4]
|
|
469
|
+
},
|
|
470
|
+
children: [1, 2, 3, 4, 5].map(i => /*#__PURE__*/_jsx(View, {
|
|
471
|
+
style: [styles.loadingCard, {
|
|
472
|
+
marginBottom: theme.spacing[3],
|
|
473
|
+
paddingVertical: theme.spacing[4],
|
|
474
|
+
paddingHorizontal: theme.spacing[4],
|
|
475
|
+
borderRadius: theme.borderRadius.xl,
|
|
476
|
+
backgroundColor: theme.colors.card,
|
|
477
|
+
borderWidth: 1,
|
|
478
|
+
borderColor: theme.colors.border
|
|
479
|
+
}],
|
|
480
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
481
|
+
style: styles.sessionTopRow,
|
|
482
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
483
|
+
style: {
|
|
484
|
+
width: 48,
|
|
485
|
+
height: 48,
|
|
486
|
+
backgroundColor: theme.colors.muted,
|
|
487
|
+
borderRadius: theme.borderRadius.lg,
|
|
488
|
+
marginRight: theme.spacing[3],
|
|
489
|
+
opacity: 0.6
|
|
490
|
+
}
|
|
491
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
492
|
+
style: {
|
|
493
|
+
flex: 1
|
|
494
|
+
},
|
|
495
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
496
|
+
style: {
|
|
497
|
+
height: 16,
|
|
498
|
+
backgroundColor: theme.colors.muted,
|
|
499
|
+
borderRadius: theme.borderRadius.sm,
|
|
500
|
+
marginBottom: theme.spacing[1.5],
|
|
501
|
+
width: `${56 + Math.random() * 22}%`,
|
|
502
|
+
opacity: 0.7
|
|
503
|
+
}
|
|
504
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
505
|
+
style: {
|
|
506
|
+
height: 12,
|
|
507
|
+
backgroundColor: theme.colors.muted,
|
|
508
|
+
borderRadius: theme.borderRadius.sm,
|
|
509
|
+
width: `${70 + Math.random() * 18}%`,
|
|
510
|
+
opacity: 0.45
|
|
511
|
+
}
|
|
512
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
513
|
+
style: {
|
|
514
|
+
flexDirection: 'row',
|
|
515
|
+
marginTop: theme.spacing[2],
|
|
516
|
+
gap: theme.spacing[2]
|
|
517
|
+
},
|
|
518
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
519
|
+
style: {
|
|
520
|
+
height: 26,
|
|
521
|
+
width: 110,
|
|
522
|
+
backgroundColor: theme.colors.muted,
|
|
523
|
+
borderRadius: theme.borderRadius.full,
|
|
524
|
+
opacity: 0.35
|
|
525
|
+
}
|
|
526
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
527
|
+
style: {
|
|
528
|
+
height: 26,
|
|
529
|
+
width: 72,
|
|
530
|
+
backgroundColor: theme.colors.muted,
|
|
531
|
+
borderRadius: theme.borderRadius.full,
|
|
532
|
+
opacity: 0.35
|
|
533
|
+
}
|
|
534
|
+
})]
|
|
535
|
+
})]
|
|
536
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
537
|
+
style: {
|
|
538
|
+
marginLeft: theme.spacing[3],
|
|
539
|
+
gap: theme.spacing[2]
|
|
540
|
+
},
|
|
541
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
542
|
+
style: {
|
|
543
|
+
width: 36,
|
|
544
|
+
height: 36,
|
|
545
|
+
borderRadius: theme.borderRadius.full,
|
|
546
|
+
backgroundColor: theme.colors.muted,
|
|
547
|
+
opacity: 0.35
|
|
548
|
+
}
|
|
549
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
550
|
+
style: {
|
|
551
|
+
width: 36,
|
|
552
|
+
height: 36,
|
|
553
|
+
borderRadius: theme.borderRadius.full,
|
|
554
|
+
backgroundColor: theme.colors.muted,
|
|
555
|
+
opacity: 0.25
|
|
556
|
+
}
|
|
557
|
+
})]
|
|
558
|
+
})]
|
|
559
|
+
})
|
|
560
|
+
}, i))
|
|
561
|
+
}) : /*#__PURE__*/_jsx(FlatList, {
|
|
562
|
+
data: sessions,
|
|
563
|
+
renderItem: renderSession,
|
|
564
|
+
keyExtractor: item => item.id,
|
|
565
|
+
style: {
|
|
566
|
+
flex: 1
|
|
567
|
+
},
|
|
568
|
+
contentContainerStyle: {
|
|
569
|
+
padding: theme.spacing[4]
|
|
570
|
+
},
|
|
571
|
+
refreshing: refreshing,
|
|
572
|
+
onRefresh: () => fetchSessions(true),
|
|
573
|
+
ListEmptyComponent: /*#__PURE__*/_jsx(View, {
|
|
574
|
+
style: [styles.emptyWrap, {
|
|
575
|
+
paddingVertical: theme.spacing[6]
|
|
576
|
+
}],
|
|
577
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
578
|
+
style: [styles.emptyCard, {
|
|
579
|
+
backgroundColor: theme.colors.card,
|
|
580
|
+
borderColor: theme.colors.border,
|
|
581
|
+
borderRadius: theme.borderRadius.xl
|
|
582
|
+
}],
|
|
583
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
584
|
+
style: [styles.emptyIconWrap, {
|
|
585
|
+
backgroundColor: `${theme.colors.primary}12`,
|
|
586
|
+
borderRadius: theme.borderRadius.xl
|
|
587
|
+
}],
|
|
588
|
+
children: /*#__PURE__*/_jsx(MessagesSquare, {
|
|
589
|
+
size: 34,
|
|
590
|
+
color: theme.colors.primary,
|
|
591
|
+
strokeWidth: 2.1
|
|
592
|
+
})
|
|
593
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
594
|
+
style: {
|
|
595
|
+
marginTop: theme.spacing[3],
|
|
596
|
+
fontSize: 18,
|
|
597
|
+
fontWeight: '700',
|
|
598
|
+
color: theme.colors.foreground
|
|
599
|
+
},
|
|
600
|
+
children: t('assistant.no-sessions', 'No sessions yet')
|
|
601
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
602
|
+
style: {
|
|
603
|
+
marginTop: theme.spacing[1.5],
|
|
604
|
+
fontSize: 14,
|
|
605
|
+
lineHeight: 21,
|
|
606
|
+
color: theme.colors.mutedForeground,
|
|
607
|
+
textAlign: 'center'
|
|
608
|
+
},
|
|
609
|
+
children: t('assistant.no-sessions-desc', 'Start a new conversation to create your first session')
|
|
610
|
+
}), /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
611
|
+
onPress: onNewChat,
|
|
612
|
+
style: {
|
|
613
|
+
marginTop: theme.spacing[4],
|
|
614
|
+
paddingVertical: theme.spacing[3],
|
|
615
|
+
paddingHorizontal: theme.spacing[4],
|
|
616
|
+
borderRadius: theme.borderRadius.full,
|
|
617
|
+
backgroundColor: theme.colors.primary,
|
|
618
|
+
flexDirection: 'row',
|
|
619
|
+
alignItems: 'center'
|
|
620
|
+
},
|
|
621
|
+
children: [/*#__PURE__*/_jsx(Plus, {
|
|
622
|
+
size: 16,
|
|
623
|
+
color: theme.colors.primaryForeground,
|
|
624
|
+
strokeWidth: 2.4
|
|
625
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
626
|
+
style: {
|
|
627
|
+
fontSize: 14,
|
|
628
|
+
fontWeight: '700',
|
|
629
|
+
color: theme.colors.primaryForeground,
|
|
630
|
+
marginLeft: theme.spacing[1.5]
|
|
631
|
+
},
|
|
632
|
+
children: t('assistant.start-new-chat', 'Start New Chat')
|
|
633
|
+
})]
|
|
634
|
+
})]
|
|
635
|
+
})
|
|
636
|
+
})
|
|
637
|
+
}), /*#__PURE__*/_jsx(DocyAlertDialog, {
|
|
638
|
+
visible: !!sessionToDelete,
|
|
639
|
+
onCancel: () => setSessionToDelete(null),
|
|
640
|
+
onConfirm: () => {
|
|
641
|
+
if (sessionToDelete) {
|
|
642
|
+
deleteSession(sessionToDelete.id);
|
|
643
|
+
setSessionToDelete(null);
|
|
644
|
+
}
|
|
645
|
+
},
|
|
646
|
+
title: t('assistant.delete-session-title', 'Delete Session?'),
|
|
647
|
+
description: t('assistant.delete-session-desc', 'Are you sure you want to delete this session? This action cannot be undone. Please confirm your choice.\n\nThe associated child records from the following data source will be deleted automatically:\n• Messages'),
|
|
648
|
+
variant: "destructive",
|
|
649
|
+
confirmText: t('common.delete', 'Delete'),
|
|
650
|
+
cancelText: t('common.cancel', 'Cancel')
|
|
651
|
+
})]
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
const styles = StyleSheet.create({
|
|
655
|
+
container: {
|
|
656
|
+
flex: 1
|
|
657
|
+
},
|
|
658
|
+
heroWrap: {},
|
|
659
|
+
heroCard: {
|
|
660
|
+
borderWidth: 1,
|
|
661
|
+
padding: 16
|
|
662
|
+
},
|
|
663
|
+
heroTopRow: {
|
|
664
|
+
flexDirection: 'row',
|
|
665
|
+
alignItems: 'center',
|
|
666
|
+
justifyContent: 'space-between'
|
|
667
|
+
},
|
|
668
|
+
heroTitleWrap: {
|
|
669
|
+
flexDirection: 'row',
|
|
670
|
+
alignItems: 'center',
|
|
671
|
+
flex: 1,
|
|
672
|
+
marginRight: 12
|
|
673
|
+
},
|
|
674
|
+
heroIconWrap: {
|
|
675
|
+
width: 44,
|
|
676
|
+
height: 44,
|
|
677
|
+
alignItems: 'center',
|
|
678
|
+
justifyContent: 'center'
|
|
679
|
+
},
|
|
680
|
+
heroTitle: {
|
|
681
|
+
fontSize: 22,
|
|
682
|
+
fontWeight: '700',
|
|
683
|
+
letterSpacing: -0.4
|
|
684
|
+
},
|
|
685
|
+
heroDescription: {
|
|
686
|
+
fontSize: 14,
|
|
687
|
+
lineHeight: 21
|
|
688
|
+
},
|
|
689
|
+
heroMetaRow: {
|
|
690
|
+
flexDirection: 'row',
|
|
691
|
+
flexWrap: 'wrap',
|
|
692
|
+
gap: 10
|
|
693
|
+
},
|
|
694
|
+
heroStatChip: {
|
|
695
|
+
flexDirection: 'row',
|
|
696
|
+
alignItems: 'center',
|
|
697
|
+
paddingHorizontal: 12,
|
|
698
|
+
paddingVertical: 8
|
|
699
|
+
},
|
|
700
|
+
heroStatText: {
|
|
701
|
+
fontSize: 12,
|
|
702
|
+
fontWeight: '700',
|
|
703
|
+
marginLeft: 6
|
|
704
|
+
},
|
|
705
|
+
newChatButton: {
|
|
706
|
+
flexDirection: 'row',
|
|
707
|
+
alignItems: 'center',
|
|
708
|
+
paddingHorizontal: 14,
|
|
709
|
+
paddingVertical: 10
|
|
710
|
+
},
|
|
711
|
+
newChatButtonText: {
|
|
712
|
+
fontSize: 14,
|
|
713
|
+
fontWeight: '700',
|
|
714
|
+
marginLeft: 8
|
|
715
|
+
},
|
|
716
|
+
sessionPressable: {
|
|
717
|
+
marginBottom: 12
|
|
718
|
+
},
|
|
719
|
+
sessionItem: {
|
|
720
|
+
overflow: 'hidden'
|
|
721
|
+
},
|
|
722
|
+
sessionTopRow: {
|
|
723
|
+
flexDirection: 'row',
|
|
724
|
+
alignItems: 'flex-start'
|
|
725
|
+
},
|
|
726
|
+
sessionAvatar: {
|
|
727
|
+
width: 48,
|
|
728
|
+
height: 48,
|
|
729
|
+
alignItems: 'center',
|
|
730
|
+
justifyContent: 'center',
|
|
731
|
+
marginRight: 12
|
|
732
|
+
},
|
|
733
|
+
sessionContent: {
|
|
734
|
+
flex: 1
|
|
735
|
+
},
|
|
736
|
+
sessionHeaderRow: {
|
|
737
|
+
flexDirection: 'row',
|
|
738
|
+
alignItems: 'center'
|
|
739
|
+
},
|
|
740
|
+
sessionTitle: {
|
|
741
|
+
flex: 1,
|
|
742
|
+
fontSize: 16,
|
|
743
|
+
fontWeight: '700',
|
|
744
|
+
letterSpacing: -0.3,
|
|
745
|
+
marginRight: 8
|
|
746
|
+
},
|
|
747
|
+
dateChip: {
|
|
748
|
+
flexDirection: 'row',
|
|
749
|
+
alignItems: 'center',
|
|
750
|
+
paddingHorizontal: 10,
|
|
751
|
+
paddingVertical: 6
|
|
752
|
+
},
|
|
753
|
+
dateChipText: {
|
|
754
|
+
fontSize: 11,
|
|
755
|
+
fontWeight: '700',
|
|
756
|
+
marginLeft: 6
|
|
757
|
+
},
|
|
758
|
+
previewText: {
|
|
759
|
+
fontSize: 14,
|
|
760
|
+
lineHeight: 20,
|
|
761
|
+
marginTop: 6
|
|
762
|
+
},
|
|
763
|
+
metaRow: {
|
|
764
|
+
flexDirection: 'row',
|
|
765
|
+
flexWrap: 'wrap',
|
|
766
|
+
gap: 8
|
|
767
|
+
},
|
|
768
|
+
metaChip: {
|
|
769
|
+
flexDirection: 'row',
|
|
770
|
+
alignItems: 'center',
|
|
771
|
+
paddingHorizontal: 10,
|
|
772
|
+
paddingVertical: 7
|
|
773
|
+
},
|
|
774
|
+
metaChipText: {
|
|
775
|
+
fontSize: 11,
|
|
776
|
+
fontWeight: '700',
|
|
777
|
+
marginLeft: 6
|
|
778
|
+
},
|
|
779
|
+
trailingActions: {
|
|
780
|
+
marginLeft: 12,
|
|
781
|
+
gap: 10,
|
|
782
|
+
alignItems: 'center'
|
|
783
|
+
},
|
|
784
|
+
iconButton: {
|
|
785
|
+
width: 36,
|
|
786
|
+
height: 36,
|
|
787
|
+
alignItems: 'center',
|
|
788
|
+
justifyContent: 'center'
|
|
789
|
+
},
|
|
790
|
+
arrowBadge: {
|
|
791
|
+
width: 36,
|
|
792
|
+
height: 36,
|
|
793
|
+
alignItems: 'center',
|
|
794
|
+
justifyContent: 'center'
|
|
795
|
+
},
|
|
796
|
+
loadingCard: {},
|
|
797
|
+
emptyWrap: {
|
|
798
|
+
alignItems: 'center',
|
|
799
|
+
justifyContent: 'center'
|
|
800
|
+
},
|
|
801
|
+
emptyCard: {
|
|
802
|
+
width: '100%',
|
|
803
|
+
borderWidth: 1,
|
|
804
|
+
alignItems: 'center',
|
|
805
|
+
paddingVertical: 32,
|
|
806
|
+
paddingHorizontal: 24
|
|
807
|
+
},
|
|
808
|
+
emptyIconWrap: {
|
|
809
|
+
width: 72,
|
|
810
|
+
height: 72,
|
|
811
|
+
alignItems: 'center',
|
|
812
|
+
justifyContent: 'center'
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
SessionsList.displayName = 'SessionsList';
|
|
816
|
+
//# sourceMappingURL=sessions-list.js.map
|