@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,341 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AttachmentPicker = AttachmentPicker;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _lucideReactNative = require("lucide-react-native");
|
|
10
|
+
var _rn = require("@docyrus/i18n/rn");
|
|
11
|
+
var _index = require("../../theme/index.js");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* AttachmentPicker - Attachment selection component using anchored dropdown
|
|
15
|
+
*
|
|
16
|
+
* Provides UI for picking documents, images, or taking photos.
|
|
17
|
+
* Uses native action sheet pattern for better UX.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <AttachmentPicker
|
|
22
|
+
* onPickDocuments={pickDocuments}
|
|
23
|
+
* onPickImages={pickImages}
|
|
24
|
+
* onTakePhoto={takePhoto}
|
|
25
|
+
* attachmentCount={3}
|
|
26
|
+
* />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
function AttachmentPicker({
|
|
30
|
+
onPickDocuments,
|
|
31
|
+
onPickImages,
|
|
32
|
+
onTakePhoto,
|
|
33
|
+
isLoading = false,
|
|
34
|
+
disabled = false,
|
|
35
|
+
attachmentCount = 0,
|
|
36
|
+
showAsModal = true,
|
|
37
|
+
accentColor
|
|
38
|
+
}) {
|
|
39
|
+
const theme = (0, _index.useDocyrusRNAssistantTheme)();
|
|
40
|
+
const {
|
|
41
|
+
t
|
|
42
|
+
} = (0, _rn.useI18n)();
|
|
43
|
+
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
44
|
+
const [anchorFrame, setAnchorFrame] = (0, _react.useState)(null);
|
|
45
|
+
const finalAccentColor = accentColor || theme.colors.primary;
|
|
46
|
+
const triggerRef = (0, _react.useRef)(null);
|
|
47
|
+
const screen = _reactNative.Dimensions.get('window');
|
|
48
|
+
const measureAnchor = (0, _react.useCallback)(() => {
|
|
49
|
+
triggerRef.current?.measureInWindow((x, y, width, height) => {
|
|
50
|
+
setAnchorFrame({
|
|
51
|
+
x,
|
|
52
|
+
y,
|
|
53
|
+
width,
|
|
54
|
+
height
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}, []);
|
|
58
|
+
const handleToggle = (0, _react.useCallback)(() => {
|
|
59
|
+
if (disabled || isLoading) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (isOpen) {
|
|
63
|
+
setIsOpen(false);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
measureAnchor();
|
|
67
|
+
setIsOpen(true);
|
|
68
|
+
}, [disabled, isLoading, isOpen, measureAnchor]);
|
|
69
|
+
const handleClose = (0, _react.useCallback)(() => {
|
|
70
|
+
setIsOpen(false);
|
|
71
|
+
}, []);
|
|
72
|
+
const dropdownAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
73
|
+
|
|
74
|
+
// Build inline options for non-modal mode
|
|
75
|
+
const options = (0, _react.useMemo)(() => {
|
|
76
|
+
const baseOptions = [{
|
|
77
|
+
type: 'document',
|
|
78
|
+
label: t('assistant.document', 'Document'),
|
|
79
|
+
onPress: () => {
|
|
80
|
+
setIsOpen(false);
|
|
81
|
+
setTimeout(() => {
|
|
82
|
+
onPickDocuments();
|
|
83
|
+
}, 120);
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
type: 'image',
|
|
87
|
+
label: t('assistant.photo-library', 'Photo Library'),
|
|
88
|
+
onPress: () => {
|
|
89
|
+
setIsOpen(false);
|
|
90
|
+
setTimeout(() => {
|
|
91
|
+
onPickImages();
|
|
92
|
+
}, 120);
|
|
93
|
+
}
|
|
94
|
+
}];
|
|
95
|
+
if (onTakePhoto) {
|
|
96
|
+
baseOptions.push({
|
|
97
|
+
type: 'camera',
|
|
98
|
+
label: t('assistant.take-photo', 'Take Photo'),
|
|
99
|
+
onPress: () => {
|
|
100
|
+
setIsOpen(false);
|
|
101
|
+
setTimeout(() => {
|
|
102
|
+
onTakePhoto();
|
|
103
|
+
}, 120);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return baseOptions;
|
|
108
|
+
}, [onPickDocuments, onPickImages, onTakePhoto, t]);
|
|
109
|
+
(0, _react.useEffect)(() => {
|
|
110
|
+
if (isOpen) {
|
|
111
|
+
requestAnimationFrame(() => {
|
|
112
|
+
measureAnchor();
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}, [isOpen, measureAnchor]);
|
|
116
|
+
(0, _react.useEffect)(() => {
|
|
117
|
+
_reactNative.Animated.spring(dropdownAnim, {
|
|
118
|
+
toValue: isOpen ? 1 : 0,
|
|
119
|
+
damping: 22,
|
|
120
|
+
stiffness: 260,
|
|
121
|
+
mass: 0.9,
|
|
122
|
+
useNativeDriver: true
|
|
123
|
+
}).start();
|
|
124
|
+
}, [dropdownAnim, isOpen]);
|
|
125
|
+
const renderOption = option => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
126
|
+
onPress: option.onPress,
|
|
127
|
+
disabled: isLoading,
|
|
128
|
+
activeOpacity: 0.7,
|
|
129
|
+
style: [styles.optionItem, {
|
|
130
|
+
paddingVertical: theme.spacing[3],
|
|
131
|
+
paddingHorizontal: theme.spacing[4],
|
|
132
|
+
opacity: isLoading ? 0.5 : 1
|
|
133
|
+
}],
|
|
134
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
135
|
+
style: [styles.optionIconContainer, {
|
|
136
|
+
backgroundColor: `${finalAccentColor}15`,
|
|
137
|
+
borderRadius: theme.borderRadius.md,
|
|
138
|
+
padding: theme.spacing[2],
|
|
139
|
+
marginRight: theme.spacing[3]
|
|
140
|
+
}],
|
|
141
|
+
children: [option.type === 'document' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.FileText, {
|
|
142
|
+
size: 20,
|
|
143
|
+
color: finalAccentColor,
|
|
144
|
+
strokeWidth: 2.2
|
|
145
|
+
}) : null, option.type === 'image' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.Image, {
|
|
146
|
+
size: 20,
|
|
147
|
+
color: finalAccentColor,
|
|
148
|
+
strokeWidth: 2.2
|
|
149
|
+
}) : null, option.type === 'camera' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.Camera, {
|
|
150
|
+
size: 20,
|
|
151
|
+
color: finalAccentColor,
|
|
152
|
+
strokeWidth: 2.2
|
|
153
|
+
}) : null]
|
|
154
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
155
|
+
style: [styles.optionLabel, {
|
|
156
|
+
color: theme.colors.foreground
|
|
157
|
+
}],
|
|
158
|
+
children: option.label
|
|
159
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.ArrowRight, {
|
|
160
|
+
size: 16,
|
|
161
|
+
color: theme.colors.mutedForeground,
|
|
162
|
+
strokeWidth: 2.2
|
|
163
|
+
})]
|
|
164
|
+
}, option.type);
|
|
165
|
+
|
|
166
|
+
// Inline mode - show options directly
|
|
167
|
+
if (!showAsModal) {
|
|
168
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
169
|
+
style: styles.inlineContainer,
|
|
170
|
+
children: options.map(renderOption)
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Anchored dropdown mode
|
|
175
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
176
|
+
style: styles.root,
|
|
177
|
+
collapsable: false,
|
|
178
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
179
|
+
ref: triggerRef,
|
|
180
|
+
collapsable: false,
|
|
181
|
+
style: {
|
|
182
|
+
position: 'relative'
|
|
183
|
+
},
|
|
184
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
185
|
+
onPress: handleToggle,
|
|
186
|
+
disabled: disabled || isLoading,
|
|
187
|
+
activeOpacity: 0.7,
|
|
188
|
+
style: [styles.triggerButton, {
|
|
189
|
+
width: 40,
|
|
190
|
+
height: 40,
|
|
191
|
+
borderRadius: 20,
|
|
192
|
+
opacity: disabled ? 0.5 : 1
|
|
193
|
+
}],
|
|
194
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.Paperclip, {
|
|
195
|
+
size: 18,
|
|
196
|
+
color: theme.colors.mutedForeground,
|
|
197
|
+
strokeWidth: 2.2
|
|
198
|
+
})
|
|
199
|
+
}), attachmentCount > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
200
|
+
style: [styles.badge, {
|
|
201
|
+
backgroundColor: finalAccentColor,
|
|
202
|
+
borderRadius: theme.borderRadius.full
|
|
203
|
+
}],
|
|
204
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
205
|
+
style: styles.badgeText,
|
|
206
|
+
children: attachmentCount > 9 ? '9+' : attachmentCount
|
|
207
|
+
})
|
|
208
|
+
})]
|
|
209
|
+
}), isOpen && anchorFrame ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
210
|
+
pointerEvents: "box-none",
|
|
211
|
+
style: [styles.portalLayer, {
|
|
212
|
+
left: -anchorFrame.x,
|
|
213
|
+
top: -anchorFrame.y,
|
|
214
|
+
width: screen.width,
|
|
215
|
+
height: screen.height
|
|
216
|
+
}],
|
|
217
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
218
|
+
activeOpacity: 1,
|
|
219
|
+
onPress: handleClose,
|
|
220
|
+
style: styles.portalBackdrop
|
|
221
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
|
|
222
|
+
pointerEvents: "auto",
|
|
223
|
+
style: [styles.dropdown, {
|
|
224
|
+
backgroundColor: theme.colors.card,
|
|
225
|
+
borderColor: theme.colors.border,
|
|
226
|
+
borderRadius: theme.borderRadius.xl,
|
|
227
|
+
left: Math.min(Math.max(anchorFrame.x - 8, 12), screen.width - 252),
|
|
228
|
+
bottom: screen.height - anchorFrame.y + 8,
|
|
229
|
+
opacity: dropdownAnim,
|
|
230
|
+
transform: [{
|
|
231
|
+
translateY: dropdownAnim.interpolate({
|
|
232
|
+
inputRange: [0, 1],
|
|
233
|
+
outputRange: [8, 0]
|
|
234
|
+
})
|
|
235
|
+
}, {
|
|
236
|
+
scale: dropdownAnim.interpolate({
|
|
237
|
+
inputRange: [0, 1],
|
|
238
|
+
outputRange: [0.96, 1]
|
|
239
|
+
})
|
|
240
|
+
}]
|
|
241
|
+
}],
|
|
242
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
243
|
+
style: styles.dropdownHeader,
|
|
244
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
245
|
+
style: [styles.dropdownTitle, {
|
|
246
|
+
color: theme.colors.foreground
|
|
247
|
+
}],
|
|
248
|
+
children: t('assistant.add-attachment', 'Add Attachment')
|
|
249
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
250
|
+
onPress: handleClose,
|
|
251
|
+
hitSlop: {
|
|
252
|
+
top: 8,
|
|
253
|
+
bottom: 8,
|
|
254
|
+
left: 8,
|
|
255
|
+
right: 8
|
|
256
|
+
},
|
|
257
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.X, {
|
|
258
|
+
size: 16,
|
|
259
|
+
color: theme.colors.mutedForeground,
|
|
260
|
+
strokeWidth: 2.2
|
|
261
|
+
})
|
|
262
|
+
})]
|
|
263
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
264
|
+
style: styles.dropdownContent,
|
|
265
|
+
children: options.map(renderOption)
|
|
266
|
+
})]
|
|
267
|
+
})]
|
|
268
|
+
}) : null]
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
const styles = _reactNative.StyleSheet.create({
|
|
272
|
+
inlineContainer: {},
|
|
273
|
+
root: {
|
|
274
|
+
position: 'relative',
|
|
275
|
+
zIndex: 40
|
|
276
|
+
},
|
|
277
|
+
portalLayer: {
|
|
278
|
+
position: 'absolute',
|
|
279
|
+
zIndex: 120
|
|
280
|
+
},
|
|
281
|
+
portalBackdrop: {
|
|
282
|
+
..._reactNative.StyleSheet.absoluteFillObject
|
|
283
|
+
},
|
|
284
|
+
triggerButton: {
|
|
285
|
+
alignItems: 'center',
|
|
286
|
+
justifyContent: 'center'
|
|
287
|
+
},
|
|
288
|
+
badge: {
|
|
289
|
+
position: 'absolute',
|
|
290
|
+
top: -2,
|
|
291
|
+
right: -2,
|
|
292
|
+
minWidth: 18,
|
|
293
|
+
height: 18,
|
|
294
|
+
alignItems: 'center',
|
|
295
|
+
justifyContent: 'center',
|
|
296
|
+
paddingHorizontal: 4
|
|
297
|
+
},
|
|
298
|
+
badgeText: {
|
|
299
|
+
color: '#ffffff',
|
|
300
|
+
fontSize: 10,
|
|
301
|
+
fontWeight: '700'
|
|
302
|
+
},
|
|
303
|
+
optionItem: {
|
|
304
|
+
flexDirection: 'row',
|
|
305
|
+
alignItems: 'center'
|
|
306
|
+
},
|
|
307
|
+
optionIconContainer: {},
|
|
308
|
+
optionLabel: {
|
|
309
|
+
flex: 1,
|
|
310
|
+
fontSize: 15,
|
|
311
|
+
fontWeight: '500'
|
|
312
|
+
},
|
|
313
|
+
dropdown: {
|
|
314
|
+
borderWidth: 1,
|
|
315
|
+
minWidth: 240,
|
|
316
|
+
padding: 8,
|
|
317
|
+
position: 'absolute',
|
|
318
|
+
shadowColor: '#0f172a',
|
|
319
|
+
shadowOffset: {
|
|
320
|
+
width: 0,
|
|
321
|
+
height: 12
|
|
322
|
+
},
|
|
323
|
+
shadowOpacity: 0.18,
|
|
324
|
+
shadowRadius: 24
|
|
325
|
+
},
|
|
326
|
+
dropdownHeader: {
|
|
327
|
+
alignItems: 'center',
|
|
328
|
+
flexDirection: 'row',
|
|
329
|
+
justifyContent: 'space-between',
|
|
330
|
+
paddingBottom: 6,
|
|
331
|
+
paddingHorizontal: 8
|
|
332
|
+
},
|
|
333
|
+
dropdownTitle: {
|
|
334
|
+
fontSize: 13,
|
|
335
|
+
fontWeight: '700'
|
|
336
|
+
},
|
|
337
|
+
dropdownContent: {
|
|
338
|
+
gap: 2
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
//# sourceMappingURL=attachment-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_lucideReactNative","_rn","_index","_jsxRuntime","AttachmentPicker","onPickDocuments","onPickImages","onTakePhoto","isLoading","disabled","attachmentCount","showAsModal","accentColor","theme","useDocyrusRNAssistantTheme","t","useI18n","isOpen","setIsOpen","useState","anchorFrame","setAnchorFrame","finalAccentColor","colors","primary","triggerRef","useRef","screen","Dimensions","get","measureAnchor","useCallback","current","measureInWindow","x","y","width","height","handleToggle","handleClose","dropdownAnim","Animated","Value","options","useMemo","baseOptions","type","label","onPress","setTimeout","push","useEffect","requestAnimationFrame","spring","toValue","damping","stiffness","mass","useNativeDriver","start","renderOption","option","jsxs","TouchableOpacity","activeOpacity","style","styles","optionItem","paddingVertical","spacing","paddingHorizontal","opacity","children","View","optionIconContainer","backgroundColor","borderRadius","md","padding","marginRight","jsx","FileText","size","color","strokeWidth","Image","Camera","Text","optionLabel","foreground","ArrowRight","mutedForeground","inlineContainer","map","root","collapsable","ref","position","triggerButton","Paperclip","badge","full","badgeText","pointerEvents","portalLayer","left","top","portalBackdrop","dropdown","card","borderColor","border","xl","Math","min","max","bottom","transform","translateY","interpolate","inputRange","outputRange","scale","dropdownHeader","dropdownTitle","hitSlop","right","X","dropdownContent","StyleSheet","create","zIndex","absoluteFillObject","alignItems","justifyContent","minWidth","fontSize","fontWeight","flexDirection","flex","borderWidth","shadowColor","shadowOffset","shadowOpacity","shadowRadius","paddingBottom","gap"],"sourceRoot":"../../../../src","sources":["components/prompt-input/attachment-picker.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,kBAAA,GAAAF,OAAA;AASA,IAAAG,GAAA,GAAAH,OAAA;AAGA,IAAAI,MAAA,GAAAJ,OAAA;AAAyD,IAAAK,WAAA,GAAAL,OAAA;AAmDzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,gBAAgBA,CAAC;EAC/BC,eAAe;EACfC,YAAY;EACZC,WAAW;EACXC,SAAS,GAAG,KAAK;EACjBC,QAAQ,GAAG,KAAK;EAChBC,eAAe,GAAG,CAAC;EACnBC,WAAW,GAAG,IAAI;EAClBC;AACqB,CAAC,EAAE;EACxB,MAAMC,KAAK,GAAG,IAAAC,iCAA0B,EAAC,CAAC;EAC1C,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,WAAO,EAAC,CAAC;EACvB,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAC3C,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAG,IAAAF,eAAQ,EAKpC,IAAI,CAAC;EACf,MAAMG,gBAAgB,GAAGV,WAAW,IAAIC,KAAK,CAACU,MAAM,CAACC,OAAO;EAC5D,MAAMC,UAAU,GAAG,IAAAC,aAAM,EAAO,IAAI,CAAC;EACrC,MAAMC,MAAM,GAAGC,uBAAU,CAACC,GAAG,CAAC,QAAQ,CAAC;EA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
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AttachmentPreview = AttachmentPreview;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _expoImage = require("expo-image");
|
|
9
|
+
var _index = require("../../theme/index.js");
|
|
10
|
+
var _index2 = require("../../ui/index.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
/**
|
|
13
|
+
* Get file icon based on MIME type
|
|
14
|
+
*/
|
|
15
|
+
const getFileIcon = mimeType => {
|
|
16
|
+
if (mimeType.startsWith('image/')) return 'image-02';
|
|
17
|
+
if (mimeType.startsWith('video/')) return 'video-01';
|
|
18
|
+
if (mimeType.startsWith('audio/')) return 'music-note-01';
|
|
19
|
+
if (mimeType.includes('pdf')) return 'pdf-02';
|
|
20
|
+
if (mimeType.includes('word') || mimeType.includes('document')) return 'doc-01';
|
|
21
|
+
if (mimeType.includes('sheet') || mimeType.includes('excel')) return 'xls-01';
|
|
22
|
+
if (mimeType.includes('presentation') || mimeType.includes('powerpoint')) return 'ppt-01';
|
|
23
|
+
if (mimeType.includes('text')) return 'txt-01';
|
|
24
|
+
return 'file-02';
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Format file size
|
|
29
|
+
*/
|
|
30
|
+
const formatFileSize = bytes => {
|
|
31
|
+
if (!bytes) return '';
|
|
32
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
33
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
34
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Check if file is an image
|
|
39
|
+
*/
|
|
40
|
+
const isImageFile = mimeType => mimeType.startsWith('image/');
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* AttachmentPreview - Preview attached files
|
|
44
|
+
*
|
|
45
|
+
* Displays attached files as removable chips/cards.
|
|
46
|
+
* Supports image thumbnails and file type icons.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <AttachmentPreview
|
|
51
|
+
* attachments={attachments}
|
|
52
|
+
* onRemove={(id) => removeAttachment(id)}
|
|
53
|
+
* onPress={(file) => previewFile(file)}
|
|
54
|
+
* />
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
function AttachmentPreview({
|
|
58
|
+
attachments,
|
|
59
|
+
onRemove,
|
|
60
|
+
onPress,
|
|
61
|
+
maxVisible = 4,
|
|
62
|
+
horizontal = true
|
|
63
|
+
}) {
|
|
64
|
+
const theme = (0, _index.useDocyrusRNAssistantTheme)();
|
|
65
|
+
if (attachments.length === 0) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
const visibleAttachments = attachments.slice(0, maxVisible);
|
|
69
|
+
const hiddenCount = attachments.length - maxVisible;
|
|
70
|
+
const renderAttachment = attachment => {
|
|
71
|
+
const isImage = isImageFile(attachment.type);
|
|
72
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
73
|
+
style: [styles.attachmentItem, {
|
|
74
|
+
backgroundColor: theme.colors.muted,
|
|
75
|
+
borderRadius: theme.borderRadius.md,
|
|
76
|
+
marginRight: horizontal ? theme.spacing[2] : 0,
|
|
77
|
+
marginBottom: horizontal ? 0 : theme.spacing[2]
|
|
78
|
+
}],
|
|
79
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
80
|
+
onPress: () => onPress?.(attachment),
|
|
81
|
+
disabled: !onPress,
|
|
82
|
+
style: styles.attachmentContent,
|
|
83
|
+
children: [isImage ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_expoImage.Image, {
|
|
84
|
+
source: {
|
|
85
|
+
uri: attachment.uri
|
|
86
|
+
},
|
|
87
|
+
style: [styles.thumbnail, {
|
|
88
|
+
borderRadius: theme.borderRadius.sm
|
|
89
|
+
}],
|
|
90
|
+
contentFit: "cover"
|
|
91
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
92
|
+
style: [styles.iconContainer, {
|
|
93
|
+
backgroundColor: `${theme.colors.primary}15`,
|
|
94
|
+
borderRadius: theme.borderRadius.sm
|
|
95
|
+
}],
|
|
96
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.DocyrusIcon, {
|
|
97
|
+
icon: getFileIcon(attachment.type),
|
|
98
|
+
size: 20,
|
|
99
|
+
color: theme.colors.primary
|
|
100
|
+
})
|
|
101
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
102
|
+
style: styles.fileInfo,
|
|
103
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
104
|
+
style: [styles.fileName, {
|
|
105
|
+
color: theme.colors.foreground
|
|
106
|
+
}],
|
|
107
|
+
numberOfLines: 1,
|
|
108
|
+
children: attachment.name
|
|
109
|
+
}), attachment.size && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
110
|
+
style: [styles.fileSize, {
|
|
111
|
+
color: theme.colors.mutedForeground
|
|
112
|
+
}],
|
|
113
|
+
children: formatFileSize(attachment.size)
|
|
114
|
+
})]
|
|
115
|
+
})]
|
|
116
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
117
|
+
onPress: () => onRemove(attachment.id),
|
|
118
|
+
hitSlop: {
|
|
119
|
+
top: 8,
|
|
120
|
+
right: 8,
|
|
121
|
+
bottom: 8,
|
|
122
|
+
left: 8
|
|
123
|
+
},
|
|
124
|
+
style: [styles.removeButton, {
|
|
125
|
+
backgroundColor: theme.colors.background,
|
|
126
|
+
borderRadius: theme.borderRadius.full
|
|
127
|
+
}],
|
|
128
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index2.DocyrusIcon, {
|
|
129
|
+
icon: "cancel-01",
|
|
130
|
+
size: 12,
|
|
131
|
+
color: theme.colors.mutedForeground
|
|
132
|
+
})
|
|
133
|
+
})]
|
|
134
|
+
}, attachment.id);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// Render "+X more" indicator
|
|
138
|
+
const renderHiddenIndicator = () => {
|
|
139
|
+
if (hiddenCount <= 0) return null;
|
|
140
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
141
|
+
style: [styles.hiddenIndicator, {
|
|
142
|
+
backgroundColor: theme.colors.muted,
|
|
143
|
+
borderRadius: theme.borderRadius.md
|
|
144
|
+
}],
|
|
145
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
146
|
+
style: [styles.hiddenText, {
|
|
147
|
+
color: theme.colors.foreground
|
|
148
|
+
}],
|
|
149
|
+
children: ["+", hiddenCount]
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
if (horizontal) {
|
|
154
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
|
|
155
|
+
horizontal: true,
|
|
156
|
+
showsHorizontalScrollIndicator: false,
|
|
157
|
+
contentContainerStyle: [styles.horizontalContainer, {
|
|
158
|
+
paddingVertical: theme.spacing[2]
|
|
159
|
+
}],
|
|
160
|
+
children: [visibleAttachments.map(renderAttachment), renderHiddenIndicator()]
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
164
|
+
style: styles.verticalContainer,
|
|
165
|
+
children: [visibleAttachments.map(renderAttachment), renderHiddenIndicator()]
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
const styles = _reactNative.StyleSheet.create({
|
|
169
|
+
horizontalContainer: {
|
|
170
|
+
flexDirection: 'row',
|
|
171
|
+
alignItems: 'center'
|
|
172
|
+
},
|
|
173
|
+
verticalContainer: {},
|
|
174
|
+
attachmentItem: {
|
|
175
|
+
flexDirection: 'row',
|
|
176
|
+
alignItems: 'center',
|
|
177
|
+
padding: 8,
|
|
178
|
+
maxWidth: 200,
|
|
179
|
+
position: 'relative'
|
|
180
|
+
},
|
|
181
|
+
attachmentContent: {
|
|
182
|
+
flexDirection: 'row',
|
|
183
|
+
alignItems: 'center',
|
|
184
|
+
flex: 1,
|
|
185
|
+
marginRight: 20
|
|
186
|
+
},
|
|
187
|
+
thumbnail: {
|
|
188
|
+
width: 40,
|
|
189
|
+
height: 40
|
|
190
|
+
},
|
|
191
|
+
iconContainer: {
|
|
192
|
+
width: 40,
|
|
193
|
+
height: 40,
|
|
194
|
+
alignItems: 'center',
|
|
195
|
+
justifyContent: 'center'
|
|
196
|
+
},
|
|
197
|
+
fileInfo: {
|
|
198
|
+
flex: 1,
|
|
199
|
+
marginLeft: 10
|
|
200
|
+
},
|
|
201
|
+
fileName: {
|
|
202
|
+
fontSize: 13,
|
|
203
|
+
fontWeight: '500'
|
|
204
|
+
},
|
|
205
|
+
fileSize: {
|
|
206
|
+
fontSize: 11,
|
|
207
|
+
marginTop: 2
|
|
208
|
+
},
|
|
209
|
+
removeButton: {
|
|
210
|
+
position: 'absolute',
|
|
211
|
+
top: -4,
|
|
212
|
+
right: -4,
|
|
213
|
+
width: 20,
|
|
214
|
+
height: 20,
|
|
215
|
+
alignItems: 'center',
|
|
216
|
+
justifyContent: 'center'
|
|
217
|
+
},
|
|
218
|
+
hiddenIndicator: {
|
|
219
|
+
paddingHorizontal: 12,
|
|
220
|
+
paddingVertical: 8,
|
|
221
|
+
alignItems: 'center',
|
|
222
|
+
justifyContent: 'center'
|
|
223
|
+
},
|
|
224
|
+
hiddenText: {
|
|
225
|
+
fontSize: 13,
|
|
226
|
+
fontWeight: '600'
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
//# sourceMappingURL=attachment-preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_expoImage","_index","_index2","_jsxRuntime","getFileIcon","mimeType","startsWith","includes","formatFileSize","bytes","toFixed","isImageFile","AttachmentPreview","attachments","onRemove","onPress","maxVisible","horizontal","theme","useDocyrusRNAssistantTheme","length","visibleAttachments","slice","hiddenCount","renderAttachment","attachment","isImage","type","jsxs","View","style","styles","attachmentItem","backgroundColor","colors","muted","borderRadius","md","marginRight","spacing","marginBottom","children","TouchableOpacity","disabled","attachmentContent","jsx","Image","source","uri","thumbnail","sm","contentFit","iconContainer","primary","DocyrusIcon","icon","size","color","fileInfo","Text","fileName","foreground","numberOfLines","name","fileSize","mutedForeground","id","hitSlop","top","right","bottom","left","removeButton","background","full","renderHiddenIndicator","hiddenIndicator","hiddenText","ScrollView","showsHorizontalScrollIndicator","contentContainerStyle","horizontalContainer","paddingVertical","map","verticalContainer","StyleSheet","create","flexDirection","alignItems","padding","maxWidth","position","flex","width","height","justifyContent","marginLeft","fontSize","fontWeight","marginTop","paddingHorizontal"],"sourceRoot":"../../../../src","sources":["components/prompt-input/attachment-preview.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAOA,IAAAC,UAAA,GAAAD,OAAA;AAGA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAAuC,IAAAI,WAAA,GAAAJ,OAAA;AA+BvC;AACA;AACA;AACA,MAAMK,WAAW,GAAIC,QAAgB,IAAa;EAChD,IAAIA,QAAQ,CAACC,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,UAAU;EACpD,IAAID,QAAQ,CAACC,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,UAAU;EACpD,IAAID,QAAQ,CAACC,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,eAAe;EACzD,IAAID,QAAQ,CAACE,QAAQ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E,EAAE;IACVN,UAAU,EAAE,QAAQ;IACpBO,cAAc,EAAE;EAClB,CAAC;EACDrC,QAAQ,EAAE;IACRkC,IAAI,EAAE,CAAC;IACPI,UAAU,EAAE;EACd,CAAC;EACDpC,QAAQ,EAAE;IACRqC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd,CAAC;EACDlC,QAAQ,EAAE;IACRiC,QAAQ,EAAE,EAAE;IACZE,SAAS,EAAE;EACb,CAAC;EACD3B,YAAY,EAAE;IACZmB,QAAQ,EAAE,UAAU;IACpBvB,GAAG,EAAE,CAAC,CAAC;IACPC,KAAK,EAAE,CAAC,CAAC;IACTwB,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVN,UAAU,EAAE,QAAQ;IACpBO,cAAc,EAAE;EAClB,CAAC;EACDnB,eAAe,EAAE;IACfwB,iBAAiB,EAAE,EAAE;IACrBlB,eAAe,EAAE,CAAC;IAClBM,UAAU,EAAE,QAAQ;IACpBO,cAAc,EAAE;EAClB,CAAC;EACDlB,UAAU,EAAE;IACVoB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "AttachmentPicker", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _attachmentPicker.AttachmentPicker;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "AttachmentPreview", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _attachmentPreview.AttachmentPreview;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "PromptInput", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _promptInput.PromptInput;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "ProviderSelector", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _providerSelector.ProviderSelector;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "VoiceRecorder", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _voiceRecorder.VoiceRecorder;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
var _promptInput = require("./prompt-input.js");
|
|
37
|
+
var _providerSelector = require("./provider-selector.js");
|
|
38
|
+
var _voiceRecorder = require("./voice-recorder.js");
|
|
39
|
+
var _attachmentPicker = require("./attachment-picker.js");
|
|
40
|
+
var _attachmentPreview = require("./attachment-preview.js");
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_promptInput","require","_providerSelector","_voiceRecorder","_attachmentPicker","_attachmentPreview"],"sourceRoot":"../../../../src","sources":["components/prompt-input/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAAA,YAAA,GAAAC,OAAA;AAGA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA","ignoreList":[]}
|