@unif/react-native-chat 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +48 -0
- package/lib/module/actions/index.js +2 -0
- package/lib/module/actions/index.js.map +1 -0
- package/lib/module/actions/types.js +4 -0
- package/lib/module/actions/types.js.map +1 -0
- package/lib/module/components/Attachments/AttachmentItem.js +108 -0
- package/lib/module/components/Attachments/AttachmentItem.js.map +1 -0
- package/lib/module/components/Attachments/Attachments.js +60 -0
- package/lib/module/components/Attachments/Attachments.js.map +1 -0
- package/lib/module/components/Attachments/constants.js +18 -0
- package/lib/module/components/Attachments/constants.js.map +1 -0
- package/lib/module/components/Attachments/index.js +4 -0
- package/lib/module/components/Attachments/index.js.map +1 -0
- package/lib/module/components/Attachments/styles.js +83 -0
- package/lib/module/components/Attachments/styles.js.map +1 -0
- package/lib/module/components/Attachments/types.js +4 -0
- package/lib/module/components/Attachments/types.js.map +1 -0
- package/lib/module/components/Chat/Chat.js +29 -0
- package/lib/module/components/Chat/Chat.js.map +1 -0
- package/lib/module/components/Chat/index.js +4 -0
- package/lib/module/components/Chat/index.js.map +1 -0
- package/lib/module/components/Chat/styles.js +17 -0
- package/lib/module/components/Chat/styles.js.map +1 -0
- package/lib/module/components/Chat/types.js +4 -0
- package/lib/module/components/Chat/types.js.map +1 -0
- package/lib/module/components/Citation/Citation.js +32 -0
- package/lib/module/components/Citation/Citation.js.map +1 -0
- package/lib/module/components/Citation/index.js +4 -0
- package/lib/module/components/Citation/index.js.map +1 -0
- package/lib/module/components/Citation/styles.js +15 -0
- package/lib/module/components/Citation/styles.js.map +1 -0
- package/lib/module/components/Citation/types.js +2 -0
- package/lib/module/components/Citation/types.js.map +1 -0
- package/lib/module/components/Composer/Composer.js +149 -0
- package/lib/module/components/Composer/Composer.js.map +1 -0
- package/lib/module/components/Composer/constants.js +14 -0
- package/lib/module/components/Composer/constants.js.map +1 -0
- package/lib/module/components/Composer/index.js +4 -0
- package/lib/module/components/Composer/index.js.map +1 -0
- package/lib/module/components/Composer/styles.js +43 -0
- package/lib/module/components/Composer/styles.js.map +1 -0
- package/lib/module/components/Composer/types.js +4 -0
- package/lib/module/components/Composer/types.js.map +1 -0
- package/lib/module/components/Confirmation/Confirmation.js +56 -0
- package/lib/module/components/Confirmation/Confirmation.js.map +1 -0
- package/lib/module/components/Confirmation/constants.js +10 -0
- package/lib/module/components/Confirmation/constants.js.map +1 -0
- package/lib/module/components/Confirmation/index.js +4 -0
- package/lib/module/components/Confirmation/index.js.map +1 -0
- package/lib/module/components/Confirmation/styles.js +34 -0
- package/lib/module/components/Confirmation/styles.js.map +1 -0
- package/lib/module/components/Confirmation/types.js +4 -0
- package/lib/module/components/Confirmation/types.js.map +1 -0
- package/lib/module/components/Feedback/Feedback.js +82 -0
- package/lib/module/components/Feedback/Feedback.js.map +1 -0
- package/lib/module/components/Feedback/constants.js +15 -0
- package/lib/module/components/Feedback/constants.js.map +1 -0
- package/lib/module/components/Feedback/index.js +4 -0
- package/lib/module/components/Feedback/index.js.map +1 -0
- package/lib/module/components/Feedback/styles.js +30 -0
- package/lib/module/components/Feedback/styles.js.map +1 -0
- package/lib/module/components/Feedback/types.js +4 -0
- package/lib/module/components/Feedback/types.js.map +1 -0
- package/lib/module/components/Message/MarkdownContent/MarkdownContent.js +68 -0
- package/lib/module/components/Message/MarkdownContent/MarkdownContent.js.map +1 -0
- package/lib/module/components/Message/MarkdownContent/MarkdownImage/MarkdownImage.js +53 -0
- package/lib/module/components/Message/MarkdownContent/MarkdownImage/MarkdownImage.js.map +1 -0
- package/lib/module/components/Message/MarkdownContent/MarkdownImage/styles.js +10 -0
- package/lib/module/components/Message/MarkdownContent/MarkdownImage/styles.js.map +1 -0
- package/lib/module/components/Message/MarkdownContent/MarkdownImage/types.js +2 -0
- package/lib/module/components/Message/MarkdownContent/MarkdownImage/types.js.map +1 -0
- package/lib/module/components/Message/MarkdownContent/styles.js +85 -0
- package/lib/module/components/Message/MarkdownContent/styles.js.map +1 -0
- package/lib/module/components/Message/MarkdownContent/types.js +2 -0
- package/lib/module/components/Message/MarkdownContent/types.js.map +1 -0
- package/lib/module/components/Message/Message.js +87 -0
- package/lib/module/components/Message/Message.js.map +1 -0
- package/lib/module/components/Message/constants.js +4 -0
- package/lib/module/components/Message/constants.js.map +1 -0
- package/lib/module/components/Message/index.js +4 -0
- package/lib/module/components/Message/index.js.map +1 -0
- package/lib/module/components/Message/isNestedAction.js +14 -0
- package/lib/module/components/Message/isNestedAction.js.map +1 -0
- package/lib/module/components/Message/styles.js +73 -0
- package/lib/module/components/Message/styles.js.map +1 -0
- package/lib/module/components/Message/types.js +4 -0
- package/lib/module/components/Message/types.js.map +1 -0
- package/lib/module/components/MessageList/MessageList.js +223 -0
- package/lib/module/components/MessageList/MessageList.js.map +1 -0
- package/lib/module/components/MessageList/constants.js +4 -0
- package/lib/module/components/MessageList/constants.js.map +1 -0
- package/lib/module/components/MessageList/index.js +4 -0
- package/lib/module/components/MessageList/index.js.map +1 -0
- package/lib/module/components/MessageList/styles.js +20 -0
- package/lib/module/components/MessageList/styles.js.map +1 -0
- package/lib/module/components/MessageList/types.js +4 -0
- package/lib/module/components/MessageList/types.js.map +1 -0
- package/lib/module/components/MessageList/webPrependAnchor/constants.js +4 -0
- package/lib/module/components/MessageList/webPrependAnchor/constants.js.map +1 -0
- package/lib/module/components/MessageList/webPrependAnchor/index.js +4 -0
- package/lib/module/components/MessageList/webPrependAnchor/index.js.map +1 -0
- package/lib/module/components/MessageList/webPrependAnchor/types.js +4 -0
- package/lib/module/components/MessageList/webPrependAnchor/types.js.map +1 -0
- package/lib/module/components/MessageList/webPrependAnchor/useWebPrependAnchor.js +19 -0
- package/lib/module/components/MessageList/webPrependAnchor/useWebPrependAnchor.js.map +1 -0
- package/lib/module/components/MessageList/webPrependAnchor/useWebPrependAnchor.web.js +208 -0
- package/lib/module/components/MessageList/webPrependAnchor/useWebPrependAnchor.web.js.map +1 -0
- package/lib/module/components/Process/Process.js +121 -0
- package/lib/module/components/Process/Process.js.map +1 -0
- package/lib/module/components/Process/constants.js +17 -0
- package/lib/module/components/Process/constants.js.map +1 -0
- package/lib/module/components/Process/index.js +4 -0
- package/lib/module/components/Process/index.js.map +1 -0
- package/lib/module/components/Process/styles.js +77 -0
- package/lib/module/components/Process/styles.js.map +1 -0
- package/lib/module/components/Process/types.js +4 -0
- package/lib/module/components/Process/types.js.map +1 -0
- package/lib/module/components/Sources/Sources.js +64 -0
- package/lib/module/components/Sources/Sources.js.map +1 -0
- package/lib/module/components/Sources/constants.js +4 -0
- package/lib/module/components/Sources/constants.js.map +1 -0
- package/lib/module/components/Sources/index.js +4 -0
- package/lib/module/components/Sources/index.js.map +1 -0
- package/lib/module/components/Sources/styles.js +52 -0
- package/lib/module/components/Sources/styles.js.map +1 -0
- package/lib/module/components/Sources/types.js +4 -0
- package/lib/module/components/Sources/types.js.map +1 -0
- package/lib/module/components/Suggestions/Suggestions.js +31 -0
- package/lib/module/components/Suggestions/Suggestions.js.map +1 -0
- package/lib/module/components/Suggestions/index.js +4 -0
- package/lib/module/components/Suggestions/index.js.map +1 -0
- package/lib/module/components/Suggestions/styles.js +18 -0
- package/lib/module/components/Suggestions/styles.js.map +1 -0
- package/lib/module/components/Suggestions/types.js +4 -0
- package/lib/module/components/Suggestions/types.js.map +1 -0
- package/lib/module/index.js +14 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/actions/index.d.ts +2 -0
- package/lib/typescript/src/actions/index.d.ts.map +1 -0
- package/lib/typescript/src/actions/types.d.ts +11 -0
- package/lib/typescript/src/actions/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Attachments/AttachmentItem.d.ts +3 -0
- package/lib/typescript/src/components/Attachments/AttachmentItem.d.ts.map +1 -0
- package/lib/typescript/src/components/Attachments/Attachments.d.ts +3 -0
- package/lib/typescript/src/components/Attachments/Attachments.d.ts.map +1 -0
- package/lib/typescript/src/components/Attachments/constants.d.ts +13 -0
- package/lib/typescript/src/components/Attachments/constants.d.ts.map +1 -0
- package/lib/typescript/src/components/Attachments/index.d.ts +3 -0
- package/lib/typescript/src/components/Attachments/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Attachments/styles.d.ts +80 -0
- package/lib/typescript/src/components/Attachments/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Attachments/types.d.ts +34 -0
- package/lib/typescript/src/components/Attachments/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Chat/Chat.d.ts +3 -0
- package/lib/typescript/src/components/Chat/Chat.d.ts.map +1 -0
- package/lib/typescript/src/components/Chat/index.d.ts +3 -0
- package/lib/typescript/src/components/Chat/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Chat/styles.d.ts +15 -0
- package/lib/typescript/src/components/Chat/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Chat/types.d.ts +12 -0
- package/lib/typescript/src/components/Chat/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Citation/Citation.d.ts +3 -0
- package/lib/typescript/src/components/Citation/Citation.d.ts.map +1 -0
- package/lib/typescript/src/components/Citation/index.d.ts +3 -0
- package/lib/typescript/src/components/Citation/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Citation/styles.d.ts +12 -0
- package/lib/typescript/src/components/Citation/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Citation/types.d.ts +8 -0
- package/lib/typescript/src/components/Citation/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Composer/Composer.d.ts +4 -0
- package/lib/typescript/src/components/Composer/Composer.d.ts.map +1 -0
- package/lib/typescript/src/components/Composer/constants.d.ts +12 -0
- package/lib/typescript/src/components/Composer/constants.d.ts.map +1 -0
- package/lib/typescript/src/components/Composer/index.d.ts +3 -0
- package/lib/typescript/src/components/Composer/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Composer/styles.d.ts +40 -0
- package/lib/typescript/src/components/Composer/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Composer/types.d.ts +53 -0
- package/lib/typescript/src/components/Composer/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Confirmation/Confirmation.d.ts +3 -0
- package/lib/typescript/src/components/Confirmation/Confirmation.d.ts.map +1 -0
- package/lib/typescript/src/components/Confirmation/constants.d.ts +5 -0
- package/lib/typescript/src/components/Confirmation/constants.d.ts.map +1 -0
- package/lib/typescript/src/components/Confirmation/index.d.ts +3 -0
- package/lib/typescript/src/components/Confirmation/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Confirmation/styles.d.ts +31 -0
- package/lib/typescript/src/components/Confirmation/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Confirmation/types.d.ts +19 -0
- package/lib/typescript/src/components/Confirmation/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Feedback/Feedback.d.ts +3 -0
- package/lib/typescript/src/components/Feedback/Feedback.d.ts.map +1 -0
- package/lib/typescript/src/components/Feedback/constants.d.ts +5 -0
- package/lib/typescript/src/components/Feedback/constants.d.ts.map +1 -0
- package/lib/typescript/src/components/Feedback/index.d.ts +3 -0
- package/lib/typescript/src/components/Feedback/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Feedback/styles.d.ts +27 -0
- package/lib/typescript/src/components/Feedback/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Feedback/types.d.ts +12 -0
- package/lib/typescript/src/components/Feedback/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Message/MarkdownContent/MarkdownContent.d.ts +3 -0
- package/lib/typescript/src/components/Message/MarkdownContent/MarkdownContent.d.ts.map +1 -0
- package/lib/typescript/src/components/Message/MarkdownContent/MarkdownImage/MarkdownImage.d.ts +3 -0
- package/lib/typescript/src/components/Message/MarkdownContent/MarkdownImage/MarkdownImage.d.ts.map +1 -0
- package/lib/typescript/src/components/Message/MarkdownContent/MarkdownImage/styles.d.ts +7 -0
- package/lib/typescript/src/components/Message/MarkdownContent/MarkdownImage/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Message/MarkdownContent/MarkdownImage/types.d.ts +9 -0
- package/lib/typescript/src/components/Message/MarkdownContent/MarkdownImage/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Message/MarkdownContent/styles.d.ts +92 -0
- package/lib/typescript/src/components/Message/MarkdownContent/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Message/MarkdownContent/types.d.ts +5 -0
- package/lib/typescript/src/components/Message/MarkdownContent/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Message/Message.d.ts +3 -0
- package/lib/typescript/src/components/Message/Message.d.ts.map +1 -0
- package/lib/typescript/src/components/Message/constants.d.ts +2 -0
- package/lib/typescript/src/components/Message/constants.d.ts.map +1 -0
- package/lib/typescript/src/components/Message/index.d.ts +3 -0
- package/lib/typescript/src/components/Message/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Message/isNestedAction.d.ts +3 -0
- package/lib/typescript/src/components/Message/isNestedAction.d.ts.map +1 -0
- package/lib/typescript/src/components/Message/styles.d.ts +70 -0
- package/lib/typescript/src/components/Message/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Message/types.d.ts +44 -0
- package/lib/typescript/src/components/Message/types.d.ts.map +1 -0
- package/lib/typescript/src/components/MessageList/MessageList.d.ts +4 -0
- package/lib/typescript/src/components/MessageList/MessageList.d.ts.map +1 -0
- package/lib/typescript/src/components/MessageList/constants.d.ts +2 -0
- package/lib/typescript/src/components/MessageList/constants.d.ts.map +1 -0
- package/lib/typescript/src/components/MessageList/index.d.ts +3 -0
- package/lib/typescript/src/components/MessageList/index.d.ts.map +1 -0
- package/lib/typescript/src/components/MessageList/styles.d.ts +16 -0
- package/lib/typescript/src/components/MessageList/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/MessageList/types.d.ts +36 -0
- package/lib/typescript/src/components/MessageList/types.d.ts.map +1 -0
- package/lib/typescript/src/components/MessageList/webPrependAnchor/constants.d.ts +2 -0
- package/lib/typescript/src/components/MessageList/webPrependAnchor/constants.d.ts.map +1 -0
- package/lib/typescript/src/components/MessageList/webPrependAnchor/index.d.ts +3 -0
- package/lib/typescript/src/components/MessageList/webPrependAnchor/index.d.ts.map +1 -0
- package/lib/typescript/src/components/MessageList/webPrependAnchor/types.d.ts +72 -0
- package/lib/typescript/src/components/MessageList/webPrependAnchor/types.d.ts.map +1 -0
- package/lib/typescript/src/components/MessageList/webPrependAnchor/useWebPrependAnchor.d.ts +3 -0
- package/lib/typescript/src/components/MessageList/webPrependAnchor/useWebPrependAnchor.d.ts.map +1 -0
- package/lib/typescript/src/components/MessageList/webPrependAnchor/useWebPrependAnchor.web.d.ts +3 -0
- package/lib/typescript/src/components/MessageList/webPrependAnchor/useWebPrependAnchor.web.d.ts.map +1 -0
- package/lib/typescript/src/components/Process/Process.d.ts +3 -0
- package/lib/typescript/src/components/Process/Process.d.ts.map +1 -0
- package/lib/typescript/src/components/Process/constants.d.ts +5 -0
- package/lib/typescript/src/components/Process/constants.d.ts.map +1 -0
- package/lib/typescript/src/components/Process/index.d.ts +3 -0
- package/lib/typescript/src/components/Process/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Process/styles.d.ts +74 -0
- package/lib/typescript/src/components/Process/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Process/types.d.ts +32 -0
- package/lib/typescript/src/components/Process/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Sources/Sources.d.ts +3 -0
- package/lib/typescript/src/components/Sources/Sources.d.ts.map +1 -0
- package/lib/typescript/src/components/Sources/constants.d.ts +2 -0
- package/lib/typescript/src/components/Sources/constants.d.ts.map +1 -0
- package/lib/typescript/src/components/Sources/index.d.ts +3 -0
- package/lib/typescript/src/components/Sources/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Sources/styles.d.ts +49 -0
- package/lib/typescript/src/components/Sources/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Sources/types.d.ts +16 -0
- package/lib/typescript/src/components/Sources/types.d.ts.map +1 -0
- package/lib/typescript/src/components/Suggestions/Suggestions.d.ts +3 -0
- package/lib/typescript/src/components/Suggestions/Suggestions.d.ts.map +1 -0
- package/lib/typescript/src/components/Suggestions/index.d.ts +3 -0
- package/lib/typescript/src/components/Suggestions/index.d.ts.map +1 -0
- package/lib/typescript/src/components/Suggestions/styles.d.ts +14 -0
- package/lib/typescript/src/components/Suggestions/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/Suggestions/types.d.ts +18 -0
- package/lib/typescript/src/components/Suggestions/types.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +24 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +178 -0
- package/src/actions/index.ts +1 -0
- package/src/actions/types.ts +11 -0
- package/src/components/Attachments/AttachmentItem.tsx +139 -0
- package/src/components/Attachments/Attachments.tsx +72 -0
- package/src/components/Attachments/constants.ts +21 -0
- package/src/components/Attachments/index.ts +6 -0
- package/src/components/Attachments/styles.ts +54 -0
- package/src/components/Attachments/types.ts +38 -0
- package/src/components/Chat/Chat.tsx +26 -0
- package/src/components/Chat/index.ts +2 -0
- package/src/components/Chat/styles.ts +12 -0
- package/src/components/Chat/types.ts +11 -0
- package/src/components/Citation/Citation.tsx +33 -0
- package/src/components/Citation/index.ts +2 -0
- package/src/components/Citation/styles.ts +15 -0
- package/src/components/Citation/types.ts +7 -0
- package/src/components/Composer/Composer.tsx +208 -0
- package/src/components/Composer/constants.ts +11 -0
- package/src/components/Composer/index.ts +11 -0
- package/src/components/Composer/styles.ts +25 -0
- package/src/components/Composer/types.ts +61 -0
- package/src/components/Confirmation/Confirmation.tsx +63 -0
- package/src/components/Confirmation/constants.ts +12 -0
- package/src/components/Confirmation/index.ts +2 -0
- package/src/components/Confirmation/styles.ts +39 -0
- package/src/components/Confirmation/types.ts +21 -0
- package/src/components/Feedback/Feedback.tsx +87 -0
- package/src/components/Feedback/constants.ts +16 -0
- package/src/components/Feedback/index.ts +2 -0
- package/src/components/Feedback/styles.ts +30 -0
- package/src/components/Feedback/types.ts +13 -0
- package/src/components/Message/MarkdownContent/MarkdownContent.tsx +70 -0
- package/src/components/Message/MarkdownContent/MarkdownImage/MarkdownImage.tsx +52 -0
- package/src/components/Message/MarkdownContent/MarkdownImage/styles.ts +4 -0
- package/src/components/Message/MarkdownContent/MarkdownImage/types.ts +8 -0
- package/src/components/Message/MarkdownContent/styles.ts +61 -0
- package/src/components/Message/MarkdownContent/types.ts +4 -0
- package/src/components/Message/Message.tsx +137 -0
- package/src/components/Message/constants.ts +2 -0
- package/src/components/Message/index.ts +10 -0
- package/src/components/Message/isNestedAction.ts +22 -0
- package/src/components/Message/styles.ts +42 -0
- package/src/components/Message/types.ts +45 -0
- package/src/components/MessageList/MessageList.tsx +238 -0
- package/src/components/MessageList/constants.ts +1 -0
- package/src/components/MessageList/index.ts +6 -0
- package/src/components/MessageList/styles.ts +7 -0
- package/src/components/MessageList/types.ts +36 -0
- package/src/components/MessageList/webPrependAnchor/constants.ts +6 -0
- package/src/components/MessageList/webPrependAnchor/index.ts +7 -0
- package/src/components/MessageList/webPrependAnchor/types.ts +92 -0
- package/src/components/MessageList/webPrependAnchor/useWebPrependAnchor.ts +27 -0
- package/src/components/MessageList/webPrependAnchor/useWebPrependAnchor.web.ts +293 -0
- package/src/components/Process/Process.tsx +160 -0
- package/src/components/Process/constants.ts +22 -0
- package/src/components/Process/index.ts +9 -0
- package/src/components/Process/styles.ts +77 -0
- package/src/components/Process/types.ts +39 -0
- package/src/components/Sources/Sources.tsx +70 -0
- package/src/components/Sources/constants.ts +1 -0
- package/src/components/Sources/index.ts +2 -0
- package/src/components/Sources/styles.ts +59 -0
- package/src/components/Sources/types.ts +17 -0
- package/src/components/Suggestions/Suggestions.tsx +34 -0
- package/src/components/Suggestions/index.ts +2 -0
- package/src/components/Suggestions/styles.ts +16 -0
- package/src/components/Suggestions/types.ts +19 -0
- package/src/index.tsx +61 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import type { ChatAction } from '../../actions';
|
|
4
|
+
|
|
5
|
+
export type ProcessStepStatus =
|
|
6
|
+
'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
7
|
+
|
|
8
|
+
export interface ProcessStep {
|
|
9
|
+
id: string;
|
|
10
|
+
title: string;
|
|
11
|
+
status: ProcessStepStatus;
|
|
12
|
+
description?: string;
|
|
13
|
+
elapsedMs?: number;
|
|
14
|
+
details?: ReactNode;
|
|
15
|
+
actions?: readonly ChatAction[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ProcessBaseProps {
|
|
19
|
+
steps: readonly ProcessStep[];
|
|
20
|
+
title?: string;
|
|
21
|
+
identity?: ReactNode;
|
|
22
|
+
style?: StyleProp<ViewStyle>;
|
|
23
|
+
testID?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ProcessControlledExpansion {
|
|
27
|
+
expandedIds: readonly string[];
|
|
28
|
+
onExpandedChange(ids: readonly string[]): void;
|
|
29
|
+
defaultExpandedIds?: never;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ProcessLocalExpansion {
|
|
33
|
+
expandedIds?: never;
|
|
34
|
+
defaultExpandedIds?: readonly string[];
|
|
35
|
+
onExpandedChange?(ids: readonly string[]): void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type ProcessProps = ProcessBaseProps &
|
|
39
|
+
(ProcessControlledExpansion | ProcessLocalExpansion);
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Pressable, Text, View } from 'react-native';
|
|
2
|
+
import { Icon, useThemedStyles } from '@unif/react-native-design';
|
|
3
|
+
import { DEFAULT_SOURCES_TITLE } from './constants';
|
|
4
|
+
import { createStyles } from './styles';
|
|
5
|
+
import type { SourceItem, SourcesProps } from './types';
|
|
6
|
+
|
|
7
|
+
export function Sources({
|
|
8
|
+
items,
|
|
9
|
+
title = DEFAULT_SOURCES_TITLE,
|
|
10
|
+
onPress,
|
|
11
|
+
style,
|
|
12
|
+
testID,
|
|
13
|
+
}: SourcesProps): React.JSX.Element | null {
|
|
14
|
+
const styles = useThemedStyles(createStyles);
|
|
15
|
+
|
|
16
|
+
if (items.length === 0) return null;
|
|
17
|
+
|
|
18
|
+
const renderItem = (item: SourceItem, showChevron: boolean) => (
|
|
19
|
+
<>
|
|
20
|
+
<Text style={styles.label} testID={`source-label-${item.id}`}>
|
|
21
|
+
{item.label}
|
|
22
|
+
</Text>
|
|
23
|
+
<View style={styles.content}>
|
|
24
|
+
{item.title ? <Text style={styles.title}>{item.title}</Text> : null}
|
|
25
|
+
{item.description ? (
|
|
26
|
+
<Text style={styles.description}>{item.description}</Text>
|
|
27
|
+
) : null}
|
|
28
|
+
</View>
|
|
29
|
+
{showChevron ? <Icon name="chevron-right" /> : null}
|
|
30
|
+
</>
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<View style={[styles.root, style]} testID={testID}>
|
|
35
|
+
<Text style={styles.heading}>{title}</Text>
|
|
36
|
+
<View style={styles.list}>
|
|
37
|
+
{items.map((item) =>
|
|
38
|
+
onPress ? (
|
|
39
|
+
<Pressable
|
|
40
|
+
key={item.id}
|
|
41
|
+
style={({ pressed }) => [
|
|
42
|
+
styles.item,
|
|
43
|
+
pressed && styles.pressed,
|
|
44
|
+
item.disabled && styles.disabled,
|
|
45
|
+
]}
|
|
46
|
+
onPress={item.disabled ? undefined : () => onPress(item)}
|
|
47
|
+
disabled={item.disabled}
|
|
48
|
+
accessibilityRole="button"
|
|
49
|
+
accessibilityLabel={
|
|
50
|
+
item.title ? `${item.label} ${item.title}` : item.label
|
|
51
|
+
}
|
|
52
|
+
accessibilityState={{ disabled: item.disabled === true }}
|
|
53
|
+
testID={`source-${item.id}`}
|
|
54
|
+
>
|
|
55
|
+
{renderItem(item, true)}
|
|
56
|
+
</Pressable>
|
|
57
|
+
) : (
|
|
58
|
+
<View
|
|
59
|
+
key={item.id}
|
|
60
|
+
style={[styles.item, item.disabled && styles.disabled]}
|
|
61
|
+
testID={`source-${item.id}`}
|
|
62
|
+
>
|
|
63
|
+
{renderItem(item, false)}
|
|
64
|
+
</View>
|
|
65
|
+
)
|
|
66
|
+
)}
|
|
67
|
+
</View>
|
|
68
|
+
</View>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const DEFAULT_SOURCES_TITLE = '参考来源';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import {
|
|
3
|
+
fixed,
|
|
4
|
+
fw,
|
|
5
|
+
pressedOpacity,
|
|
6
|
+
radius,
|
|
7
|
+
space,
|
|
8
|
+
type,
|
|
9
|
+
} from '@unif/react-native-design';
|
|
10
|
+
import type { ColorTokens } from '@unif/react-native-design';
|
|
11
|
+
|
|
12
|
+
export const createStyles = (colors: ColorTokens) =>
|
|
13
|
+
StyleSheet.create({
|
|
14
|
+
root: {
|
|
15
|
+
gap: space[3],
|
|
16
|
+
},
|
|
17
|
+
heading: {
|
|
18
|
+
color: colors.foreground,
|
|
19
|
+
fontSize: type.sm,
|
|
20
|
+
fontWeight: fw.semi,
|
|
21
|
+
},
|
|
22
|
+
list: {
|
|
23
|
+
gap: space[2],
|
|
24
|
+
},
|
|
25
|
+
item: {
|
|
26
|
+
minHeight: fixed.hitTarget,
|
|
27
|
+
flexDirection: 'row',
|
|
28
|
+
alignItems: 'flex-start',
|
|
29
|
+
gap: space[3],
|
|
30
|
+
padding: space[3],
|
|
31
|
+
borderRadius: radius.md,
|
|
32
|
+
backgroundColor: colors.surfaceContainer,
|
|
33
|
+
},
|
|
34
|
+
pressed: {
|
|
35
|
+
opacity: pressedOpacity,
|
|
36
|
+
},
|
|
37
|
+
disabled: {
|
|
38
|
+
opacity: 0.5,
|
|
39
|
+
},
|
|
40
|
+
label: {
|
|
41
|
+
minWidth: space[7],
|
|
42
|
+
color: colors.primary,
|
|
43
|
+
fontSize: type.sm,
|
|
44
|
+
fontWeight: fw.semi,
|
|
45
|
+
},
|
|
46
|
+
content: {
|
|
47
|
+
flex: 1,
|
|
48
|
+
gap: space[1],
|
|
49
|
+
},
|
|
50
|
+
title: {
|
|
51
|
+
color: colors.foreground,
|
|
52
|
+
fontSize: type.sm,
|
|
53
|
+
fontWeight: fw.medium,
|
|
54
|
+
},
|
|
55
|
+
description: {
|
|
56
|
+
color: colors.foregroundMuted,
|
|
57
|
+
fontSize: type.xxs,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export interface SourceItem {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface SourcesProps {
|
|
12
|
+
items: readonly SourceItem[];
|
|
13
|
+
title?: string;
|
|
14
|
+
onPress?(item: SourceItem): void;
|
|
15
|
+
style?: StyleProp<ViewStyle>;
|
|
16
|
+
testID?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import { Chip, Icon } from '@unif/react-native-design';
|
|
3
|
+
import { styles } from './styles';
|
|
4
|
+
import type { SuggestionsProps } from './types';
|
|
5
|
+
|
|
6
|
+
export function Suggestions({
|
|
7
|
+
items,
|
|
8
|
+
onSelect,
|
|
9
|
+
align = 'start',
|
|
10
|
+
style,
|
|
11
|
+
testID,
|
|
12
|
+
}: SuggestionsProps): React.JSX.Element | null {
|
|
13
|
+
if (items.length === 0) return null;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<View
|
|
17
|
+
style={[styles.root, styles[align], style]}
|
|
18
|
+
testID={testID}
|
|
19
|
+
accessibilityRole="list"
|
|
20
|
+
>
|
|
21
|
+
{items.map((item) => (
|
|
22
|
+
<Chip
|
|
23
|
+
key={item.id}
|
|
24
|
+
label={item.label}
|
|
25
|
+
selected={item.selected}
|
|
26
|
+
busy={item.loading}
|
|
27
|
+
disabled={item.disabled}
|
|
28
|
+
leading={item.icon ? <Icon name={item.icon} /> : undefined}
|
|
29
|
+
onPress={onSelect ? () => onSelect(item) : undefined}
|
|
30
|
+
/>
|
|
31
|
+
))}
|
|
32
|
+
</View>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { space } from '@unif/react-native-design';
|
|
3
|
+
|
|
4
|
+
export const styles = StyleSheet.create({
|
|
5
|
+
root: {
|
|
6
|
+
flexDirection: 'row',
|
|
7
|
+
flexWrap: 'wrap',
|
|
8
|
+
gap: space[3],
|
|
9
|
+
},
|
|
10
|
+
start: {
|
|
11
|
+
justifyContent: 'flex-start',
|
|
12
|
+
},
|
|
13
|
+
center: {
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IconName } from '@unif/react-native-design';
|
|
2
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export interface SuggestionItem {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
icon?: IconName;
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface SuggestionsProps {
|
|
14
|
+
items: readonly SuggestionItem[];
|
|
15
|
+
onSelect?(item: SuggestionItem): void;
|
|
16
|
+
align?: 'start' | 'center';
|
|
17
|
+
style?: StyleProp<ViewStyle>;
|
|
18
|
+
testID?: string;
|
|
19
|
+
}
|
package/src/index.tsx
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type { ChatAction } from './actions';
|
|
2
|
+
export { Composer } from './components/Composer';
|
|
3
|
+
export type {
|
|
4
|
+
ComposerBusyAction,
|
|
5
|
+
ComposerHandle,
|
|
6
|
+
ComposerPrimaryAction,
|
|
7
|
+
ComposerProps,
|
|
8
|
+
ComposerSendAction,
|
|
9
|
+
ComposerStopAction,
|
|
10
|
+
ComposerVoiceControl,
|
|
11
|
+
ComposerVoiceStatus,
|
|
12
|
+
} from './components/Composer';
|
|
13
|
+
export { Attachments } from './components/Attachments';
|
|
14
|
+
export type {
|
|
15
|
+
AttachmentsProps,
|
|
16
|
+
ChatAttachmentItem,
|
|
17
|
+
ChatAttachmentStatus,
|
|
18
|
+
} from './components/Attachments';
|
|
19
|
+
export { Message } from './components/Message';
|
|
20
|
+
export type {
|
|
21
|
+
MessageBaseProps,
|
|
22
|
+
MessageCustomContent,
|
|
23
|
+
MessageMarkdownContent,
|
|
24
|
+
MessagePlainContent,
|
|
25
|
+
MessagePlacement,
|
|
26
|
+
MessageProps,
|
|
27
|
+
MessageStatus,
|
|
28
|
+
} from './components/Message';
|
|
29
|
+
export { MessageList } from './components/MessageList';
|
|
30
|
+
export type {
|
|
31
|
+
MessageListHandle,
|
|
32
|
+
MessageListProps,
|
|
33
|
+
MessageListScrollOptions,
|
|
34
|
+
} from './components/MessageList';
|
|
35
|
+
export { Chat } from './components/Chat';
|
|
36
|
+
export type { ChatProps } from './components/Chat';
|
|
37
|
+
export { Suggestions } from './components/Suggestions';
|
|
38
|
+
export type {
|
|
39
|
+
SuggestionItem,
|
|
40
|
+
SuggestionsProps,
|
|
41
|
+
} from './components/Suggestions';
|
|
42
|
+
export { Confirmation } from './components/Confirmation';
|
|
43
|
+
export type {
|
|
44
|
+
ConfirmationProps,
|
|
45
|
+
ConfirmationStatus,
|
|
46
|
+
} from './components/Confirmation';
|
|
47
|
+
export { Process } from './components/Process';
|
|
48
|
+
export type {
|
|
49
|
+
ProcessBaseProps,
|
|
50
|
+
ProcessControlledExpansion,
|
|
51
|
+
ProcessLocalExpansion,
|
|
52
|
+
ProcessProps,
|
|
53
|
+
ProcessStep,
|
|
54
|
+
ProcessStepStatus,
|
|
55
|
+
} from './components/Process';
|
|
56
|
+
export { Feedback } from './components/Feedback';
|
|
57
|
+
export type { FeedbackProps, FeedbackTone } from './components/Feedback';
|
|
58
|
+
export { Sources } from './components/Sources';
|
|
59
|
+
export type { SourceItem, SourcesProps } from './components/Sources';
|
|
60
|
+
export { Citation } from './components/Citation';
|
|
61
|
+
export type { CitationProps } from './components/Citation';
|