@repzo/widget-react-native 1.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/README.md +482 -0
- package/lib/commonjs/agent-ui-blocks.js +159 -0
- package/lib/commonjs/agent-ui-blocks.js.map +1 -0
- package/lib/commonjs/api/client.js +267 -0
- package/lib/commonjs/api/client.js.map +1 -0
- package/lib/commonjs/api/realtime.js +193 -0
- package/lib/commonjs/api/realtime.js.map +1 -0
- package/lib/commonjs/api/sse-parser.js +58 -0
- package/lib/commonjs/api/sse-parser.js.map +1 -0
- package/lib/commonjs/controller.js +23 -0
- package/lib/commonjs/controller.js.map +1 -0
- package/lib/commonjs/device-id.js +75 -0
- package/lib/commonjs/device-id.js.map +1 -0
- package/lib/commonjs/events.js +49 -0
- package/lib/commonjs/events.js.map +1 -0
- package/lib/commonjs/i18n.js +106 -0
- package/lib/commonjs/i18n.js.map +1 -0
- package/lib/commonjs/index.js +98 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/locales.js +85 -0
- package/lib/commonjs/locales.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/push/push-notifications.js +208 -0
- package/lib/commonjs/push/push-notifications.js.map +1 -0
- package/lib/commonjs/state/use-widget-state.js +23 -0
- package/lib/commonjs/state/use-widget-state.js.map +1 -0
- package/lib/commonjs/state/widget-store.js +1682 -0
- package/lib/commonjs/state/widget-store.js.map +1 -0
- package/lib/commonjs/storage.js +147 -0
- package/lib/commonjs/storage.js.map +1 -0
- package/lib/commonjs/types.js +44 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/ui/WidgetProvider.js +404 -0
- package/lib/commonjs/ui/WidgetProvider.js.map +1 -0
- package/lib/commonjs/ui/components/AgentUiBlocks.js +864 -0
- package/lib/commonjs/ui/components/AgentUiBlocks.js.map +1 -0
- package/lib/commonjs/ui/components/Avatar.js +76 -0
- package/lib/commonjs/ui/components/Avatar.js.map +1 -0
- package/lib/commonjs/ui/components/ConversationRow.js +155 -0
- package/lib/commonjs/ui/components/ConversationRow.js.map +1 -0
- package/lib/commonjs/ui/components/ErrorBoundary.js +44 -0
- package/lib/commonjs/ui/components/ErrorBoundary.js.map +1 -0
- package/lib/commonjs/ui/components/Gradient.js +168 -0
- package/lib/commonjs/ui/components/Gradient.js.map +1 -0
- package/lib/commonjs/ui/components/Launcher.js +125 -0
- package/lib/commonjs/ui/components/Launcher.js.map +1 -0
- package/lib/commonjs/ui/components/Markdown.js +257 -0
- package/lib/commonjs/ui/components/Markdown.js.map +1 -0
- package/lib/commonjs/ui/components/OutboundMessageCard.js +157 -0
- package/lib/commonjs/ui/components/OutboundMessageCard.js.map +1 -0
- package/lib/commonjs/ui/components/WidgetPanel.js +131 -0
- package/lib/commonjs/ui/components/WidgetPanel.js.map +1 -0
- package/lib/commonjs/ui/components/icons.js +383 -0
- package/lib/commonjs/ui/components/icons.js.map +1 -0
- package/lib/commonjs/ui/hooks/use-keyboard-overlap.js +113 -0
- package/lib/commonjs/ui/hooks/use-keyboard-overlap.js.map +1 -0
- package/lib/commonjs/ui/hooks/use-reduce-motion.js +38 -0
- package/lib/commonjs/ui/hooks/use-reduce-motion.js.map +1 -0
- package/lib/commonjs/ui/hooks/use-widget-insets.js +41 -0
- package/lib/commonjs/ui/hooks/use-widget-insets.js.map +1 -0
- package/lib/commonjs/ui/screens/chat/ChatView.js +590 -0
- package/lib/commonjs/ui/screens/chat/ChatView.js.map +1 -0
- package/lib/commonjs/ui/screens/chat/ChatView.styles.js +362 -0
- package/lib/commonjs/ui/screens/chat/ChatView.styles.js.map +1 -0
- package/lib/commonjs/ui/screens/chat/ChatView.types.js +6 -0
- package/lib/commonjs/ui/screens/chat/ChatView.types.js.map +1 -0
- package/lib/commonjs/ui/screens/conversations/ConversationsList.js +150 -0
- package/lib/commonjs/ui/screens/conversations/ConversationsList.js.map +1 -0
- package/lib/commonjs/ui/screens/conversations/ConversationsList.styles.js +118 -0
- package/lib/commonjs/ui/screens/conversations/ConversationsList.styles.js.map +1 -0
- package/lib/commonjs/ui/screens/conversations/ConversationsList.types.js +6 -0
- package/lib/commonjs/ui/screens/conversations/ConversationsList.types.js.map +1 -0
- package/lib/commonjs/ui/screens/home/HomeView.js +336 -0
- package/lib/commonjs/ui/screens/home/HomeView.js.map +1 -0
- package/lib/commonjs/ui/screens/home/HomeView.styles.js +245 -0
- package/lib/commonjs/ui/screens/home/HomeView.styles.js.map +1 -0
- package/lib/commonjs/ui/screens/home/HomeView.types.js +6 -0
- package/lib/commonjs/ui/screens/home/HomeView.types.js.map +1 -0
- package/lib/commonjs/ui/screens/home/greeting.js +49 -0
- package/lib/commonjs/ui/screens/home/greeting.js.map +1 -0
- package/lib/commonjs/ui/screens/pre-chat/PreChatForm.js +229 -0
- package/lib/commonjs/ui/screens/pre-chat/PreChatForm.js.map +1 -0
- package/lib/commonjs/ui/screens/pre-chat/PreChatForm.styles.js +125 -0
- package/lib/commonjs/ui/screens/pre-chat/PreChatForm.styles.js.map +1 -0
- package/lib/commonjs/ui/screens/pre-chat/PreChatForm.types.js +6 -0
- package/lib/commonjs/ui/screens/pre-chat/PreChatForm.types.js.map +1 -0
- package/lib/commonjs/ui/styles/global.js +55 -0
- package/lib/commonjs/ui/styles/global.js.map +1 -0
- package/lib/commonjs/ui/styles/theme.js +148 -0
- package/lib/commonjs/ui/styles/theme.js.map +1 -0
- package/lib/commonjs/ui/utils/conversations.js +125 -0
- package/lib/commonjs/ui/utils/conversations.js.map +1 -0
- package/lib/commonjs/ui/utils/html.js +44 -0
- package/lib/commonjs/ui/utils/html.js.map +1 -0
- package/lib/commonjs/ui/utils/native-gradient.js +65 -0
- package/lib/commonjs/ui/utils/native-gradient.js.map +1 -0
- package/lib/commonjs/ui/utils/rtl.js +56 -0
- package/lib/commonjs/ui/utils/rtl.js.map +1 -0
- package/lib/commonjs/ui/utils/safe-url.js +67 -0
- package/lib/commonjs/ui/utils/safe-url.js.map +1 -0
- package/lib/module/agent-ui-blocks.js +152 -0
- package/lib/module/agent-ui-blocks.js.map +1 -0
- package/lib/module/api/client.js +261 -0
- package/lib/module/api/client.js.map +1 -0
- package/lib/module/api/realtime.js +189 -0
- package/lib/module/api/realtime.js.map +1 -0
- package/lib/module/api/sse-parser.js +53 -0
- package/lib/module/api/sse-parser.js.map +1 -0
- package/lib/module/controller.js +19 -0
- package/lib/module/controller.js.map +1 -0
- package/lib/module/device-id.js +69 -0
- package/lib/module/device-id.js.map +1 -0
- package/lib/module/events.js +44 -0
- package/lib/module/events.js.map +1 -0
- package/lib/module/i18n.js +99 -0
- package/lib/module/i18n.js.map +1 -0
- package/lib/module/index.js +55 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/locales.js +80 -0
- package/lib/module/locales.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/push/push-notifications.js +204 -0
- package/lib/module/push/push-notifications.js.map +1 -0
- package/lib/module/state/use-widget-state.js +18 -0
- package/lib/module/state/use-widget-state.js.map +1 -0
- package/lib/module/state/widget-store.js +1677 -0
- package/lib/module/state/widget-store.js.map +1 -0
- package/lib/module/storage.js +141 -0
- package/lib/module/storage.js.map +1 -0
- package/lib/module/types.js +40 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/ui/WidgetProvider.js +400 -0
- package/lib/module/ui/WidgetProvider.js.map +1 -0
- package/lib/module/ui/components/AgentUiBlocks.js +857 -0
- package/lib/module/ui/components/AgentUiBlocks.js.map +1 -0
- package/lib/module/ui/components/Avatar.js +71 -0
- package/lib/module/ui/components/Avatar.js.map +1 -0
- package/lib/module/ui/components/ConversationRow.js +150 -0
- package/lib/module/ui/components/ConversationRow.js.map +1 -0
- package/lib/module/ui/components/ErrorBoundary.js +39 -0
- package/lib/module/ui/components/ErrorBoundary.js.map +1 -0
- package/lib/module/ui/components/Gradient.js +165 -0
- package/lib/module/ui/components/Gradient.js.map +1 -0
- package/lib/module/ui/components/Launcher.js +121 -0
- package/lib/module/ui/components/Launcher.js.map +1 -0
- package/lib/module/ui/components/Markdown.js +253 -0
- package/lib/module/ui/components/Markdown.js.map +1 -0
- package/lib/module/ui/components/OutboundMessageCard.js +153 -0
- package/lib/module/ui/components/OutboundMessageCard.js.map +1 -0
- package/lib/module/ui/components/WidgetPanel.js +127 -0
- package/lib/module/ui/components/WidgetPanel.js.map +1 -0
- package/lib/module/ui/components/icons.js +370 -0
- package/lib/module/ui/components/icons.js.map +1 -0
- package/lib/module/ui/hooks/use-keyboard-overlap.js +109 -0
- package/lib/module/ui/hooks/use-keyboard-overlap.js.map +1 -0
- package/lib/module/ui/hooks/use-reduce-motion.js +34 -0
- package/lib/module/ui/hooks/use-reduce-motion.js.map +1 -0
- package/lib/module/ui/hooks/use-widget-insets.js +37 -0
- package/lib/module/ui/hooks/use-widget-insets.js.map +1 -0
- package/lib/module/ui/screens/chat/ChatView.js +586 -0
- package/lib/module/ui/screens/chat/ChatView.js.map +1 -0
- package/lib/module/ui/screens/chat/ChatView.styles.js +358 -0
- package/lib/module/ui/screens/chat/ChatView.styles.js.map +1 -0
- package/lib/module/ui/screens/chat/ChatView.types.js +4 -0
- package/lib/module/ui/screens/chat/ChatView.types.js.map +1 -0
- package/lib/module/ui/screens/conversations/ConversationsList.js +146 -0
- package/lib/module/ui/screens/conversations/ConversationsList.js.map +1 -0
- package/lib/module/ui/screens/conversations/ConversationsList.styles.js +114 -0
- package/lib/module/ui/screens/conversations/ConversationsList.styles.js.map +1 -0
- package/lib/module/ui/screens/conversations/ConversationsList.types.js +4 -0
- package/lib/module/ui/screens/conversations/ConversationsList.types.js.map +1 -0
- package/lib/module/ui/screens/home/HomeView.js +332 -0
- package/lib/module/ui/screens/home/HomeView.js.map +1 -0
- package/lib/module/ui/screens/home/HomeView.styles.js +242 -0
- package/lib/module/ui/screens/home/HomeView.styles.js.map +1 -0
- package/lib/module/ui/screens/home/HomeView.types.js +4 -0
- package/lib/module/ui/screens/home/HomeView.types.js.map +1 -0
- package/lib/module/ui/screens/home/greeting.js +44 -0
- package/lib/module/ui/screens/home/greeting.js.map +1 -0
- package/lib/module/ui/screens/pre-chat/PreChatForm.js +225 -0
- package/lib/module/ui/screens/pre-chat/PreChatForm.js.map +1 -0
- package/lib/module/ui/screens/pre-chat/PreChatForm.styles.js +121 -0
- package/lib/module/ui/screens/pre-chat/PreChatForm.styles.js.map +1 -0
- package/lib/module/ui/screens/pre-chat/PreChatForm.types.js +4 -0
- package/lib/module/ui/screens/pre-chat/PreChatForm.types.js.map +1 -0
- package/lib/module/ui/styles/global.js +51 -0
- package/lib/module/ui/styles/global.js.map +1 -0
- package/lib/module/ui/styles/theme.js +137 -0
- package/lib/module/ui/styles/theme.js.map +1 -0
- package/lib/module/ui/utils/conversations.js +115 -0
- package/lib/module/ui/utils/conversations.js.map +1 -0
- package/lib/module/ui/utils/html.js +39 -0
- package/lib/module/ui/utils/html.js.map +1 -0
- package/lib/module/ui/utils/native-gradient.js +60 -0
- package/lib/module/ui/utils/native-gradient.js.map +1 -0
- package/lib/module/ui/utils/rtl.js +49 -0
- package/lib/module/ui/utils/rtl.js.map +1 -0
- package/lib/module/ui/utils/safe-url.js +59 -0
- package/lib/module/ui/utils/safe-url.js.map +1 -0
- package/lib/typescript/commonjs/agent-ui-blocks.d.ts +20 -0
- package/lib/typescript/commonjs/agent-ui-blocks.d.ts.map +1 -0
- package/lib/typescript/commonjs/api/client.d.ts +115 -0
- package/lib/typescript/commonjs/api/client.d.ts.map +1 -0
- package/lib/typescript/commonjs/api/realtime.d.ts +39 -0
- package/lib/typescript/commonjs/api/realtime.d.ts.map +1 -0
- package/lib/typescript/commonjs/api/sse-parser.d.ts +13 -0
- package/lib/typescript/commonjs/api/sse-parser.d.ts.map +1 -0
- package/lib/typescript/commonjs/controller.d.ts +15 -0
- package/lib/typescript/commonjs/controller.d.ts.map +1 -0
- package/lib/typescript/commonjs/device-id.d.ts +15 -0
- package/lib/typescript/commonjs/device-id.d.ts.map +1 -0
- package/lib/typescript/commonjs/events.d.ts +41 -0
- package/lib/typescript/commonjs/events.d.ts.map +1 -0
- package/lib/typescript/commonjs/i18n.d.ts +78 -0
- package/lib/typescript/commonjs/i18n.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +103 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/locales.d.ts +18 -0
- package/lib/typescript/commonjs/locales.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/push/push-notifications.d.ts +71 -0
- package/lib/typescript/commonjs/push/push-notifications.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/use-widget-state.d.ts +10 -0
- package/lib/typescript/commonjs/state/use-widget-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/state/widget-store.d.ts +227 -0
- package/lib/typescript/commonjs/state/widget-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/storage.d.ts +42 -0
- package/lib/typescript/commonjs/storage.d.ts.map +1 -0
- package/lib/typescript/commonjs/types.d.ts +391 -0
- package/lib/typescript/commonjs/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/WidgetProvider.d.ts +15 -0
- package/lib/typescript/commonjs/ui/WidgetProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/AgentUiBlocks.d.ts +27 -0
- package/lib/typescript/commonjs/ui/components/AgentUiBlocks.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/Avatar.d.ts +19 -0
- package/lib/typescript/commonjs/ui/components/Avatar.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ConversationRow.d.ts +26 -0
- package/lib/typescript/commonjs/ui/components/ConversationRow.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ErrorBoundary.d.ts +27 -0
- package/lib/typescript/commonjs/ui/components/ErrorBoundary.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/Gradient.d.ts +33 -0
- package/lib/typescript/commonjs/ui/components/Gradient.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/Launcher.d.ts +18 -0
- package/lib/typescript/commonjs/ui/components/Launcher.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/Markdown.d.ts +19 -0
- package/lib/typescript/commonjs/ui/components/Markdown.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/OutboundMessageCard.d.ts +20 -0
- package/lib/typescript/commonjs/ui/components/OutboundMessageCard.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/WidgetPanel.d.ts +26 -0
- package/lib/typescript/commonjs/ui/components/WidgetPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/icons.d.ts +38 -0
- package/lib/typescript/commonjs/ui/components/icons.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/use-keyboard-overlap.d.ts +33 -0
- package/lib/typescript/commonjs/ui/hooks/use-keyboard-overlap.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/use-reduce-motion.d.ts +11 -0
- package/lib/typescript/commonjs/ui/hooks/use-reduce-motion.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/use-widget-insets.d.ts +16 -0
- package/lib/typescript/commonjs/ui/hooks/use-widget-insets.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.d.ts +11 -0
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.styles.d.ts +349 -0
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.styles.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts +48 -0
- package/lib/typescript/commonjs/ui/screens/chat/ChatView.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/conversations/ConversationsList.d.ts +10 -0
- package/lib/typescript/commonjs/ui/screens/conversations/ConversationsList.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/conversations/ConversationsList.styles.d.ts +113 -0
- package/lib/typescript/commonjs/ui/screens/conversations/ConversationsList.styles.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/conversations/ConversationsList.types.d.ts +31 -0
- package/lib/typescript/commonjs/ui/screens/conversations/ConversationsList.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/home/HomeView.d.ts +17 -0
- package/lib/typescript/commonjs/ui/screens/home/HomeView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/home/HomeView.styles.d.ts +227 -0
- package/lib/typescript/commonjs/ui/screens/home/HomeView.styles.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/home/HomeView.types.d.ts +40 -0
- package/lib/typescript/commonjs/ui/screens/home/HomeView.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/home/greeting.d.ts +19 -0
- package/lib/typescript/commonjs/ui/screens/home/greeting.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/pre-chat/PreChatForm.d.ts +7 -0
- package/lib/typescript/commonjs/ui/screens/pre-chat/PreChatForm.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/pre-chat/PreChatForm.styles.d.ts +115 -0
- package/lib/typescript/commonjs/ui/screens/pre-chat/PreChatForm.styles.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/pre-chat/PreChatForm.types.d.ts +20 -0
- package/lib/typescript/commonjs/ui/screens/pre-chat/PreChatForm.types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/styles/global.d.ts +46 -0
- package/lib/typescript/commonjs/ui/styles/global.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/styles/theme.d.ts +103 -0
- package/lib/typescript/commonjs/ui/styles/theme.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/conversations.d.ts +41 -0
- package/lib/typescript/commonjs/ui/utils/conversations.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/html.d.ts +10 -0
- package/lib/typescript/commonjs/ui/utils/html.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/native-gradient.d.ts +61 -0
- package/lib/typescript/commonjs/ui/utils/native-gradient.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/rtl.d.ts +33 -0
- package/lib/typescript/commonjs/ui/utils/rtl.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/utils/safe-url.d.ts +21 -0
- package/lib/typescript/commonjs/ui/utils/safe-url.d.ts.map +1 -0
- package/lib/typescript/module/agent-ui-blocks.d.ts +20 -0
- package/lib/typescript/module/agent-ui-blocks.d.ts.map +1 -0
- package/lib/typescript/module/api/client.d.ts +115 -0
- package/lib/typescript/module/api/client.d.ts.map +1 -0
- package/lib/typescript/module/api/realtime.d.ts +39 -0
- package/lib/typescript/module/api/realtime.d.ts.map +1 -0
- package/lib/typescript/module/api/sse-parser.d.ts +13 -0
- package/lib/typescript/module/api/sse-parser.d.ts.map +1 -0
- package/lib/typescript/module/controller.d.ts +15 -0
- package/lib/typescript/module/controller.d.ts.map +1 -0
- package/lib/typescript/module/device-id.d.ts +15 -0
- package/lib/typescript/module/device-id.d.ts.map +1 -0
- package/lib/typescript/module/events.d.ts +41 -0
- package/lib/typescript/module/events.d.ts.map +1 -0
- package/lib/typescript/module/i18n.d.ts +78 -0
- package/lib/typescript/module/i18n.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +103 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/locales.d.ts +18 -0
- package/lib/typescript/module/locales.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/push/push-notifications.d.ts +71 -0
- package/lib/typescript/module/push/push-notifications.d.ts.map +1 -0
- package/lib/typescript/module/state/use-widget-state.d.ts +10 -0
- package/lib/typescript/module/state/use-widget-state.d.ts.map +1 -0
- package/lib/typescript/module/state/widget-store.d.ts +227 -0
- package/lib/typescript/module/state/widget-store.d.ts.map +1 -0
- package/lib/typescript/module/storage.d.ts +42 -0
- package/lib/typescript/module/storage.d.ts.map +1 -0
- package/lib/typescript/module/types.d.ts +391 -0
- package/lib/typescript/module/types.d.ts.map +1 -0
- package/lib/typescript/module/ui/WidgetProvider.d.ts +15 -0
- package/lib/typescript/module/ui/WidgetProvider.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/AgentUiBlocks.d.ts +27 -0
- package/lib/typescript/module/ui/components/AgentUiBlocks.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/Avatar.d.ts +19 -0
- package/lib/typescript/module/ui/components/Avatar.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ConversationRow.d.ts +26 -0
- package/lib/typescript/module/ui/components/ConversationRow.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ErrorBoundary.d.ts +27 -0
- package/lib/typescript/module/ui/components/ErrorBoundary.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/Gradient.d.ts +33 -0
- package/lib/typescript/module/ui/components/Gradient.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/Launcher.d.ts +18 -0
- package/lib/typescript/module/ui/components/Launcher.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/Markdown.d.ts +19 -0
- package/lib/typescript/module/ui/components/Markdown.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/OutboundMessageCard.d.ts +20 -0
- package/lib/typescript/module/ui/components/OutboundMessageCard.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/WidgetPanel.d.ts +26 -0
- package/lib/typescript/module/ui/components/WidgetPanel.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/icons.d.ts +38 -0
- package/lib/typescript/module/ui/components/icons.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/use-keyboard-overlap.d.ts +33 -0
- package/lib/typescript/module/ui/hooks/use-keyboard-overlap.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/use-reduce-motion.d.ts +11 -0
- package/lib/typescript/module/ui/hooks/use-reduce-motion.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/use-widget-insets.d.ts +16 -0
- package/lib/typescript/module/ui/hooks/use-widget-insets.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/chat/ChatView.d.ts +11 -0
- package/lib/typescript/module/ui/screens/chat/ChatView.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/chat/ChatView.styles.d.ts +349 -0
- package/lib/typescript/module/ui/screens/chat/ChatView.styles.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts +48 -0
- package/lib/typescript/module/ui/screens/chat/ChatView.types.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/conversations/ConversationsList.d.ts +10 -0
- package/lib/typescript/module/ui/screens/conversations/ConversationsList.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/conversations/ConversationsList.styles.d.ts +113 -0
- package/lib/typescript/module/ui/screens/conversations/ConversationsList.styles.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/conversations/ConversationsList.types.d.ts +31 -0
- package/lib/typescript/module/ui/screens/conversations/ConversationsList.types.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/home/HomeView.d.ts +17 -0
- package/lib/typescript/module/ui/screens/home/HomeView.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/home/HomeView.styles.d.ts +227 -0
- package/lib/typescript/module/ui/screens/home/HomeView.styles.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/home/HomeView.types.d.ts +40 -0
- package/lib/typescript/module/ui/screens/home/HomeView.types.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/home/greeting.d.ts +19 -0
- package/lib/typescript/module/ui/screens/home/greeting.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/pre-chat/PreChatForm.d.ts +7 -0
- package/lib/typescript/module/ui/screens/pre-chat/PreChatForm.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/pre-chat/PreChatForm.styles.d.ts +115 -0
- package/lib/typescript/module/ui/screens/pre-chat/PreChatForm.styles.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/pre-chat/PreChatForm.types.d.ts +20 -0
- package/lib/typescript/module/ui/screens/pre-chat/PreChatForm.types.d.ts.map +1 -0
- package/lib/typescript/module/ui/styles/global.d.ts +46 -0
- package/lib/typescript/module/ui/styles/global.d.ts.map +1 -0
- package/lib/typescript/module/ui/styles/theme.d.ts +103 -0
- package/lib/typescript/module/ui/styles/theme.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/conversations.d.ts +41 -0
- package/lib/typescript/module/ui/utils/conversations.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/html.d.ts +10 -0
- package/lib/typescript/module/ui/utils/html.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/native-gradient.d.ts +61 -0
- package/lib/typescript/module/ui/utils/native-gradient.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/rtl.d.ts +33 -0
- package/lib/typescript/module/ui/utils/rtl.d.ts.map +1 -0
- package/lib/typescript/module/ui/utils/safe-url.d.ts +21 -0
- package/lib/typescript/module/ui/utils/safe-url.d.ts.map +1 -0
- package/metro.js +40 -0
- package/package.json +116 -0
- package/src/agent-ui-blocks.ts +302 -0
- package/src/api/client.ts +332 -0
- package/src/api/realtime.ts +225 -0
- package/src/api/sse-parser.ts +51 -0
- package/src/controller.ts +20 -0
- package/src/device-id.ts +71 -0
- package/src/events.ts +74 -0
- package/src/i18n.ts +114 -0
- package/src/index.tsx +199 -0
- package/src/locales.ts +80 -0
- package/src/push/push-notifications.ts +254 -0
- package/src/state/use-widget-state.ts +20 -0
- package/src/state/widget-store.ts +1815 -0
- package/src/storage.ts +153 -0
- package/src/types.ts +445 -0
- package/src/ui/WidgetProvider.tsx +434 -0
- package/src/ui/components/AgentUiBlocks.tsx +912 -0
- package/src/ui/components/Avatar.tsx +86 -0
- package/src/ui/components/ConversationRow.tsx +163 -0
- package/src/ui/components/ErrorBoundary.tsx +49 -0
- package/src/ui/components/Gradient.tsx +165 -0
- package/src/ui/components/Launcher.tsx +128 -0
- package/src/ui/components/Markdown.tsx +291 -0
- package/src/ui/components/OutboundMessageCard.tsx +154 -0
- package/src/ui/components/WidgetPanel.tsx +133 -0
- package/src/ui/components/icons.tsx +315 -0
- package/src/ui/hooks/use-keyboard-overlap.ts +134 -0
- package/src/ui/hooks/use-reduce-motion.ts +39 -0
- package/src/ui/hooks/use-widget-insets.ts +44 -0
- package/src/ui/screens/chat/ChatView.styles.ts +357 -0
- package/src/ui/screens/chat/ChatView.tsx +690 -0
- package/src/ui/screens/chat/ChatView.types.ts +46 -0
- package/src/ui/screens/conversations/ConversationsList.styles.ts +111 -0
- package/src/ui/screens/conversations/ConversationsList.tsx +144 -0
- package/src/ui/screens/conversations/ConversationsList.types.ts +33 -0
- package/src/ui/screens/home/HomeView.styles.ts +246 -0
- package/src/ui/screens/home/HomeView.tsx +336 -0
- package/src/ui/screens/home/HomeView.types.ts +42 -0
- package/src/ui/screens/home/greeting.ts +50 -0
- package/src/ui/screens/pre-chat/PreChatForm.styles.ts +120 -0
- package/src/ui/screens/pre-chat/PreChatForm.tsx +221 -0
- package/src/ui/screens/pre-chat/PreChatForm.types.ts +22 -0
- package/src/ui/styles/global.ts +50 -0
- package/src/ui/styles/theme.ts +155 -0
- package/src/ui/utils/conversations.ts +122 -0
- package/src/ui/utils/html.ts +58 -0
- package/src/ui/utils/native-gradient.ts +60 -0
- package/src/ui/utils/rtl.ts +43 -0
- package/src/ui/utils/safe-url.ts +63 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** Props and label bundle for the chat thread. */
|
|
2
|
+
|
|
3
|
+
import type { AgentUiAction, Message, WidgetAttachment } from '../../../types';
|
|
4
|
+
import type { AgentUiBlockLabels } from '../../components/AgentUiBlocks';
|
|
5
|
+
|
|
6
|
+
export interface ChatLabels {
|
|
7
|
+
back: string;
|
|
8
|
+
loading: string;
|
|
9
|
+
loadEarlier: string;
|
|
10
|
+
emptyConversation: string;
|
|
11
|
+
messagePlaceholder: string;
|
|
12
|
+
failedToSend: string;
|
|
13
|
+
thinking: string;
|
|
14
|
+
team: string;
|
|
15
|
+
statusOnline: string;
|
|
16
|
+
statusAway: string;
|
|
17
|
+
close: string;
|
|
18
|
+
today: string;
|
|
19
|
+
yesterday: string;
|
|
20
|
+
conversationUpdated: string;
|
|
21
|
+
procedureSend: string;
|
|
22
|
+
procedureSent: string;
|
|
23
|
+
blocks: AgentUiBlockLabels;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ChatViewProps {
|
|
27
|
+
messages: Message[];
|
|
28
|
+
loading: boolean;
|
|
29
|
+
hasMoreMessages: boolean;
|
|
30
|
+
agentTyping: boolean;
|
|
31
|
+
color: string;
|
|
32
|
+
/** Whoever is handling this thread, once the backend assigns someone. */
|
|
33
|
+
agentName?: string | null;
|
|
34
|
+
agentAvatar?: string | null;
|
|
35
|
+
isOnline: boolean;
|
|
36
|
+
prefillText?: string;
|
|
37
|
+
offlineMessage?: string;
|
|
38
|
+
locale: string;
|
|
39
|
+
labels: ChatLabels;
|
|
40
|
+
onSendMessage: (body: string, attachments?: WidgetAttachment[], action?: AgentUiAction) => void;
|
|
41
|
+
onIdentifyVisitor?: (data: { email?: string; name?: string; phone?: string }) => Promise<void>;
|
|
42
|
+
onLoadMore: () => void;
|
|
43
|
+
onTyping: (isTyping: boolean) => void;
|
|
44
|
+
onBack: () => void;
|
|
45
|
+
onClose: () => void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/** Styles for the Messages space: centered header, row list and the floating pill. */
|
|
2
|
+
|
|
3
|
+
import { StyleSheet } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { rowDividerInset } from '../../components/ConversationRow';
|
|
6
|
+
import { fontSize, palette, radius, shadows, spacing } from '../../styles/theme';
|
|
7
|
+
|
|
8
|
+
export const styles = StyleSheet.create({
|
|
9
|
+
header: {
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
// Leaves room for the absolutely-placed close button on both sides so the
|
|
13
|
+
// title stays optically centered.
|
|
14
|
+
paddingHorizontal: spacing.xxl + spacing.lg,
|
|
15
|
+
paddingTop: spacing.lg,
|
|
16
|
+
paddingBottom: spacing.md,
|
|
17
|
+
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
18
|
+
borderBottomColor: palette.borderSoft,
|
|
19
|
+
},
|
|
20
|
+
headerCopy: {
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
gap: 2,
|
|
23
|
+
},
|
|
24
|
+
title: {
|
|
25
|
+
fontSize: fontSize.title,
|
|
26
|
+
fontWeight: '600',
|
|
27
|
+
color: palette.ink,
|
|
28
|
+
},
|
|
29
|
+
statusLine: {
|
|
30
|
+
flexDirection: 'row',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
gap: spacing.xs + 2,
|
|
33
|
+
},
|
|
34
|
+
statusDot: {
|
|
35
|
+
width: 7,
|
|
36
|
+
height: 7,
|
|
37
|
+
borderRadius: 3.5,
|
|
38
|
+
},
|
|
39
|
+
statusText: {
|
|
40
|
+
fontSize: fontSize.caption,
|
|
41
|
+
color: palette.textMuted,
|
|
42
|
+
},
|
|
43
|
+
close: {
|
|
44
|
+
position: 'absolute',
|
|
45
|
+
end: spacing.lg,
|
|
46
|
+
top: 0,
|
|
47
|
+
bottom: 0,
|
|
48
|
+
justifyContent: 'center',
|
|
49
|
+
paddingHorizontal: spacing.xs,
|
|
50
|
+
},
|
|
51
|
+
listContent: {
|
|
52
|
+
flexGrow: 1,
|
|
53
|
+
},
|
|
54
|
+
listContentEmpty: {
|
|
55
|
+
justifyContent: 'center',
|
|
56
|
+
},
|
|
57
|
+
divider: {
|
|
58
|
+
marginStart: rowDividerInset(),
|
|
59
|
+
},
|
|
60
|
+
empty: {
|
|
61
|
+
alignItems: 'center',
|
|
62
|
+
paddingHorizontal: spacing.xxl,
|
|
63
|
+
paddingVertical: 48,
|
|
64
|
+
},
|
|
65
|
+
emptyIcon: {
|
|
66
|
+
width: 64,
|
|
67
|
+
height: 64,
|
|
68
|
+
borderRadius: 32,
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
justifyContent: 'center',
|
|
71
|
+
marginBottom: spacing.lg,
|
|
72
|
+
},
|
|
73
|
+
emptyTitle: {
|
|
74
|
+
fontSize: fontSize.body,
|
|
75
|
+
fontWeight: '600',
|
|
76
|
+
color: palette.ink,
|
|
77
|
+
textAlign: 'center',
|
|
78
|
+
},
|
|
79
|
+
emptySubtitle: {
|
|
80
|
+
fontSize: fontSize.meta,
|
|
81
|
+
color: palette.textSubtle,
|
|
82
|
+
marginTop: spacing.xs,
|
|
83
|
+
textAlign: 'center',
|
|
84
|
+
},
|
|
85
|
+
fabWrapper: {
|
|
86
|
+
position: 'absolute',
|
|
87
|
+
left: 0,
|
|
88
|
+
right: 0,
|
|
89
|
+
bottom: spacing.lg,
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
},
|
|
92
|
+
fab: {
|
|
93
|
+
flexDirection: 'row',
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
gap: spacing.sm,
|
|
96
|
+
minHeight: 46,
|
|
97
|
+
paddingHorizontal: spacing.xl,
|
|
98
|
+
paddingVertical: spacing.md,
|
|
99
|
+
borderRadius: radius.pill,
|
|
100
|
+
...shadows.floating,
|
|
101
|
+
},
|
|
102
|
+
fabPressed: {
|
|
103
|
+
opacity: 0.9,
|
|
104
|
+
transform: [{ scale: 0.98 }],
|
|
105
|
+
},
|
|
106
|
+
fabLabel: {
|
|
107
|
+
color: palette.white,
|
|
108
|
+
fontSize: fontSize.meta,
|
|
109
|
+
fontWeight: '600',
|
|
110
|
+
},
|
|
111
|
+
});
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Messages space — conversation rows plus the floating "new conversation"
|
|
3
|
+
* pill. Port of `client/src/widget/components/ConversationsList.tsx`.
|
|
4
|
+
*
|
|
5
|
+
* Rows are shared with the Home space's recent preview, and both sort for
|
|
6
|
+
* themselves because the store keeps conversations in arrival order.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
10
|
+
import { FlatList, Pressable, RefreshControl, Text, View } from 'react-native';
|
|
11
|
+
|
|
12
|
+
import { ConversationRow } from '../../components/ConversationRow';
|
|
13
|
+
import { ArrowRightIcon, ChatOutlineIcon, CloseIcon } from '../../components/icons';
|
|
14
|
+
import { globalStyles } from '../../styles/global';
|
|
15
|
+
import { palette, spacing, withAlpha } from '../../styles/theme';
|
|
16
|
+
import { sortByRecency } from '../../utils/conversations';
|
|
17
|
+
import { flipForRTL } from '../../utils/rtl';
|
|
18
|
+
import { styles } from './ConversationsList.styles';
|
|
19
|
+
import type { ConversationsListProps } from './ConversationsList.types';
|
|
20
|
+
|
|
21
|
+
export function ConversationsList({
|
|
22
|
+
conversations,
|
|
23
|
+
unreadByConversation,
|
|
24
|
+
color,
|
|
25
|
+
allowNewConversations,
|
|
26
|
+
showPreviousConversations,
|
|
27
|
+
isOnline,
|
|
28
|
+
startConversationLabel,
|
|
29
|
+
labels,
|
|
30
|
+
onSelect,
|
|
31
|
+
onNewConversation,
|
|
32
|
+
onRefresh,
|
|
33
|
+
onClose,
|
|
34
|
+
}: ConversationsListProps) {
|
|
35
|
+
const [refreshing, setRefreshing] = useState(false);
|
|
36
|
+
|
|
37
|
+
const visibleConversations = useMemo(
|
|
38
|
+
() => (showPreviousConversations ? sortByRecency(conversations) : []),
|
|
39
|
+
[conversations, showPreviousConversations]
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
// The realtime stream can drop messages while backgrounded, so let the
|
|
43
|
+
// visitor force the same refresh the app does when it returns to the front.
|
|
44
|
+
const handleRefresh = useCallback(async () => {
|
|
45
|
+
setRefreshing(true);
|
|
46
|
+
try {
|
|
47
|
+
await onRefresh();
|
|
48
|
+
} finally {
|
|
49
|
+
setRefreshing(false);
|
|
50
|
+
}
|
|
51
|
+
}, [onRefresh]);
|
|
52
|
+
|
|
53
|
+
const isEmpty = visibleConversations.length === 0;
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<View style={globalStyles.screen}>
|
|
57
|
+
<View style={styles.header}>
|
|
58
|
+
<View style={styles.headerCopy}>
|
|
59
|
+
<Text style={styles.title}>{labels.messages}</Text>
|
|
60
|
+
<View style={styles.statusLine}>
|
|
61
|
+
<View
|
|
62
|
+
style={[
|
|
63
|
+
styles.statusDot,
|
|
64
|
+
{ backgroundColor: isOnline ? palette.online : palette.textSubtle },
|
|
65
|
+
]}
|
|
66
|
+
/>
|
|
67
|
+
<Text style={styles.statusText}>
|
|
68
|
+
{isOnline ? labels.statusOnline : labels.statusAway}
|
|
69
|
+
</Text>
|
|
70
|
+
</View>
|
|
71
|
+
</View>
|
|
72
|
+
<Pressable
|
|
73
|
+
onPress={onClose}
|
|
74
|
+
accessibilityRole="button"
|
|
75
|
+
accessibilityLabel={labels.close}
|
|
76
|
+
hitSlop={12}
|
|
77
|
+
style={styles.close}>
|
|
78
|
+
<CloseIcon size={18} />
|
|
79
|
+
</Pressable>
|
|
80
|
+
</View>
|
|
81
|
+
|
|
82
|
+
<FlatList
|
|
83
|
+
data={visibleConversations}
|
|
84
|
+
keyExtractor={(item) => item.id}
|
|
85
|
+
contentContainerStyle={[
|
|
86
|
+
styles.listContent,
|
|
87
|
+
isEmpty && styles.listContentEmpty,
|
|
88
|
+
{ paddingBottom: allowNewConversations ? 84 : spacing.xl },
|
|
89
|
+
]}
|
|
90
|
+
ItemSeparatorComponent={() => <View style={[globalStyles.divider, styles.divider]} />}
|
|
91
|
+
refreshControl={
|
|
92
|
+
showPreviousConversations ? (
|
|
93
|
+
<RefreshControl
|
|
94
|
+
refreshing={refreshing}
|
|
95
|
+
onRefresh={handleRefresh}
|
|
96
|
+
tintColor={color}
|
|
97
|
+
colors={[color]}
|
|
98
|
+
/>
|
|
99
|
+
) : undefined
|
|
100
|
+
}
|
|
101
|
+
ListEmptyComponent={
|
|
102
|
+
<View style={styles.empty}>
|
|
103
|
+
<View style={[styles.emptyIcon, { backgroundColor: withAlpha(color, 0.08) }]}>
|
|
104
|
+
<ChatOutlineIcon size={30} color={color} />
|
|
105
|
+
</View>
|
|
106
|
+
<Text style={styles.emptyTitle}>
|
|
107
|
+
{showPreviousConversations ? labels.noMessages : labels.historyHidden}
|
|
108
|
+
</Text>
|
|
109
|
+
{allowNewConversations ? (
|
|
110
|
+
<Text style={styles.emptySubtitle}>{labels.startBelow}</Text>
|
|
111
|
+
) : null}
|
|
112
|
+
</View>
|
|
113
|
+
}
|
|
114
|
+
renderItem={({ item }) => (
|
|
115
|
+
<ConversationRow
|
|
116
|
+
conversation={item}
|
|
117
|
+
color={color}
|
|
118
|
+
fallbackName={labels.team}
|
|
119
|
+
timeLabels={labels.time}
|
|
120
|
+
unreadCount={unreadByConversation[item.id] ?? 0}
|
|
121
|
+
unreadLabel={labels.unread}
|
|
122
|
+
onPress={() => onSelect(item.id)}
|
|
123
|
+
/>
|
|
124
|
+
)}
|
|
125
|
+
/>
|
|
126
|
+
|
|
127
|
+
{allowNewConversations ? (
|
|
128
|
+
<View style={styles.fabWrapper} pointerEvents="box-none">
|
|
129
|
+
<Pressable
|
|
130
|
+
onPress={onNewConversation}
|
|
131
|
+
accessibilityRole="button"
|
|
132
|
+
style={({ pressed }) => [
|
|
133
|
+
styles.fab,
|
|
134
|
+
{ backgroundColor: color },
|
|
135
|
+
pressed && styles.fabPressed,
|
|
136
|
+
]}>
|
|
137
|
+
<Text style={styles.fabLabel}>{startConversationLabel}</Text>
|
|
138
|
+
<ArrowRightIcon size={16} color={palette.white} style={flipForRTL()} />
|
|
139
|
+
</Pressable>
|
|
140
|
+
</View>
|
|
141
|
+
) : null}
|
|
142
|
+
</View>
|
|
143
|
+
);
|
|
144
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Props and label bundle for the Messages space. */
|
|
2
|
+
|
|
3
|
+
import type { Conversation } from '../../../types';
|
|
4
|
+
import type { RelativeTimeLabels } from '../../utils/conversations';
|
|
5
|
+
|
|
6
|
+
export interface ConversationsListLabels {
|
|
7
|
+
messages: string;
|
|
8
|
+
noMessages: string;
|
|
9
|
+
historyHidden: string;
|
|
10
|
+
startBelow: string;
|
|
11
|
+
close: string;
|
|
12
|
+
team: string;
|
|
13
|
+
statusOnline: string;
|
|
14
|
+
statusAway: string;
|
|
15
|
+
time: RelativeTimeLabels;
|
|
16
|
+
/** Template with a `{count}` token. */
|
|
17
|
+
unread: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ConversationsListProps {
|
|
21
|
+
conversations: Conversation[];
|
|
22
|
+
unreadByConversation: Record<string, number>;
|
|
23
|
+
color: string;
|
|
24
|
+
allowNewConversations: boolean;
|
|
25
|
+
showPreviousConversations: boolean;
|
|
26
|
+
isOnline: boolean;
|
|
27
|
+
startConversationLabel: string;
|
|
28
|
+
labels: ConversationsListLabels;
|
|
29
|
+
onSelect: (conversationId: string) => void;
|
|
30
|
+
onNewConversation: () => void;
|
|
31
|
+
onRefresh: () => Promise<void> | void;
|
|
32
|
+
onClose: () => void;
|
|
33
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Styles and layout constants for the Home space. The constants live next to
|
|
3
|
+
* the sheet so the component and the styles can never disagree about them.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { I18nManager, StyleSheet } from 'react-native';
|
|
7
|
+
|
|
8
|
+
import { rowDividerInset } from '../../components/ConversationRow';
|
|
9
|
+
import { fontSize, palette, radius, shadows, spacing } from '../../styles/theme';
|
|
10
|
+
import { START_ALIGN } from '../../utils/rtl';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Header geometry in dp, measured off the web widget so the two surfaces line
|
|
14
|
+
* up: a tall header with the greeting pinned low, a start card that overhangs
|
|
15
|
+
* the seam by a fixed amount rather than half its height, and a fade that is a
|
|
16
|
+
* straight white ramp over the bottom of the header, starting just under the
|
|
17
|
+
* heading.
|
|
18
|
+
*/
|
|
19
|
+
export const HEADER_MIN_HEIGHT = 228;
|
|
20
|
+
/** Between the greeting and whatever comes next: the seam, or the start card. */
|
|
21
|
+
export const HEADER_BOTTOM_PADDING = 36;
|
|
22
|
+
export const START_CARD_LIFT = 28;
|
|
23
|
+
export const START_CARD_MIN_HEIGHT = 76;
|
|
24
|
+
export const HEADER_FADE_HEIGHT = 90;
|
|
25
|
+
export const CLOSE_BUTTON_SIZE = 28;
|
|
26
|
+
export const CLOSE_ICON_SIZE = 14;
|
|
27
|
+
|
|
28
|
+
export const styles = StyleSheet.create({
|
|
29
|
+
contentContainer: {
|
|
30
|
+
flexGrow: 1,
|
|
31
|
+
},
|
|
32
|
+
// Tall on purpose, with the greeting pinned to the bottom by `headerSpacer`:
|
|
33
|
+
// the close row stays at the top and the heading sits just above the seam.
|
|
34
|
+
header: {
|
|
35
|
+
minHeight: HEADER_MIN_HEIGHT,
|
|
36
|
+
paddingHorizontal: spacing.xl,
|
|
37
|
+
paddingTop: spacing.xl,
|
|
38
|
+
// When the start card is shown the component grows this to clear the card.
|
|
39
|
+
paddingBottom: HEADER_BOTTOM_PADDING,
|
|
40
|
+
overflow: 'hidden',
|
|
41
|
+
},
|
|
42
|
+
imageScrim: {
|
|
43
|
+
...StyleSheet.absoluteFillObject,
|
|
44
|
+
backgroundColor: 'rgba(0,0,0,0.16)',
|
|
45
|
+
},
|
|
46
|
+
// Always as tall as the logo slot, so the greeting lands in the same place
|
|
47
|
+
// whether or not the workspace uploaded a logo.
|
|
48
|
+
headerTop: {
|
|
49
|
+
flexDirection: 'row',
|
|
50
|
+
alignItems: 'flex-start',
|
|
51
|
+
justifyContent: 'space-between',
|
|
52
|
+
minHeight: 40,
|
|
53
|
+
},
|
|
54
|
+
// Soaks up the header's spare height so the greeting hugs the seam, and
|
|
55
|
+
// never shrinks below the gap the web widget keeps under the close row.
|
|
56
|
+
headerSpacer: {
|
|
57
|
+
flex: 1,
|
|
58
|
+
minHeight: 40,
|
|
59
|
+
},
|
|
60
|
+
logo: {
|
|
61
|
+
width: 132,
|
|
62
|
+
height: 40,
|
|
63
|
+
},
|
|
64
|
+
closeButton: {
|
|
65
|
+
marginStart: 'auto',
|
|
66
|
+
padding: (CLOSE_BUTTON_SIZE - CLOSE_ICON_SIZE) / 2,
|
|
67
|
+
borderRadius: radius.pill,
|
|
68
|
+
backgroundColor: 'rgba(255,255,255,0.18)',
|
|
69
|
+
},
|
|
70
|
+
heading: {
|
|
71
|
+
textAlign: START_ALIGN,
|
|
72
|
+
fontSize: fontSize.display,
|
|
73
|
+
lineHeight: fontSize.display * 1.15,
|
|
74
|
+
fontWeight: '600',
|
|
75
|
+
marginBottom: spacing.md,
|
|
76
|
+
},
|
|
77
|
+
subheading: {
|
|
78
|
+
textAlign: START_ALIGN,
|
|
79
|
+
fontSize: fontSize.body,
|
|
80
|
+
lineHeight: fontSize.body * 1.4,
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
// Meets the header on a straight seam. No top padding here: the start card
|
|
84
|
+
// is pulled up past this edge, and the rest of the content takes its spacing
|
|
85
|
+
// from `bodyContent`.
|
|
86
|
+
body: {
|
|
87
|
+
flex: 1,
|
|
88
|
+
backgroundColor: palette.white,
|
|
89
|
+
paddingHorizontal: spacing.xl,
|
|
90
|
+
paddingBottom: spacing.xxl,
|
|
91
|
+
},
|
|
92
|
+
bodyContent: {
|
|
93
|
+
flex: 1,
|
|
94
|
+
paddingTop: spacing.xl,
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
offlineNotice: {
|
|
98
|
+
flexDirection: 'row',
|
|
99
|
+
alignItems: 'flex-start',
|
|
100
|
+
gap: spacing.sm + 2,
|
|
101
|
+
padding: spacing.md,
|
|
102
|
+
borderRadius: radius.md,
|
|
103
|
+
backgroundColor: palette.warningBg,
|
|
104
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
105
|
+
borderColor: palette.warningBorder,
|
|
106
|
+
marginBottom: spacing.lg,
|
|
107
|
+
},
|
|
108
|
+
offlineText: {
|
|
109
|
+
textAlign: START_ALIGN,
|
|
110
|
+
flex: 1,
|
|
111
|
+
fontSize: fontSize.meta,
|
|
112
|
+
lineHeight: fontSize.meta * 1.4,
|
|
113
|
+
color: palette.warningText,
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
startCardSlot: {
|
|
117
|
+
marginTop: -START_CARD_LIFT,
|
|
118
|
+
},
|
|
119
|
+
// Neutral and opaque, like the web card: it spans two backgrounds, and a
|
|
120
|
+
// translucent or brand-tinted fill would let the header bleed through its
|
|
121
|
+
// top or stain the seam. Shadowed because without it the half over the
|
|
122
|
+
// header reads as a flat cut-out.
|
|
123
|
+
startCard: {
|
|
124
|
+
flexDirection: 'row',
|
|
125
|
+
alignItems: 'center',
|
|
126
|
+
gap: spacing.md,
|
|
127
|
+
minHeight: START_CARD_MIN_HEIGHT,
|
|
128
|
+
paddingHorizontal: spacing.xl,
|
|
129
|
+
paddingVertical: spacing.lg + 2,
|
|
130
|
+
borderRadius: radius.lg,
|
|
131
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
132
|
+
borderColor: palette.border,
|
|
133
|
+
backgroundColor: palette.surface,
|
|
134
|
+
...shadows.card,
|
|
135
|
+
},
|
|
136
|
+
startCardPressed: {
|
|
137
|
+
opacity: 0.85,
|
|
138
|
+
},
|
|
139
|
+
startIcon: {
|
|
140
|
+
width: 40,
|
|
141
|
+
height: 40,
|
|
142
|
+
borderRadius: 20,
|
|
143
|
+
alignItems: 'center',
|
|
144
|
+
justifyContent: 'center',
|
|
145
|
+
},
|
|
146
|
+
startCopy: {
|
|
147
|
+
flex: 1,
|
|
148
|
+
minWidth: 0,
|
|
149
|
+
},
|
|
150
|
+
startTitle: {
|
|
151
|
+
textAlign: START_ALIGN,
|
|
152
|
+
fontSize: fontSize.title,
|
|
153
|
+
fontWeight: '600',
|
|
154
|
+
color: palette.ink,
|
|
155
|
+
},
|
|
156
|
+
startSubtitle: {
|
|
157
|
+
textAlign: START_ALIGN,
|
|
158
|
+
fontSize: fontSize.meta,
|
|
159
|
+
color: palette.textSubtle,
|
|
160
|
+
marginTop: 2,
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
recentHeader: {
|
|
164
|
+
flexDirection: 'row',
|
|
165
|
+
alignItems: 'center',
|
|
166
|
+
justifyContent: 'space-between',
|
|
167
|
+
minHeight: 28,
|
|
168
|
+
marginBottom: spacing.sm,
|
|
169
|
+
},
|
|
170
|
+
recentTitle: {
|
|
171
|
+
textAlign: START_ALIGN,
|
|
172
|
+
fontSize: fontSize.caption,
|
|
173
|
+
fontWeight: '700',
|
|
174
|
+
color: palette.textMuted,
|
|
175
|
+
letterSpacing: I18nManager.isRTL ? 0 : 0.6,
|
|
176
|
+
textTransform: 'uppercase',
|
|
177
|
+
},
|
|
178
|
+
viewAllButton: {
|
|
179
|
+
minHeight: 32,
|
|
180
|
+
paddingHorizontal: spacing.xs,
|
|
181
|
+
justifyContent: 'center',
|
|
182
|
+
},
|
|
183
|
+
viewAllLabel: {
|
|
184
|
+
textAlign: START_ALIGN,
|
|
185
|
+
fontSize: fontSize.meta,
|
|
186
|
+
fontWeight: '600',
|
|
187
|
+
},
|
|
188
|
+
// Border rather than a shadow: `overflow: hidden` keeps the rows' ripple
|
|
189
|
+
// inside the rounded corners, and would clip a shadow on iOS anyway.
|
|
190
|
+
recentCard: {
|
|
191
|
+
overflow: 'hidden',
|
|
192
|
+
},
|
|
193
|
+
recentDivider: {
|
|
194
|
+
marginStart: rowDividerInset(spacing.lg),
|
|
195
|
+
},
|
|
196
|
+
// Absorbs the slack so the status strip stays pinned to the bottom, and
|
|
197
|
+
// centers the empty hint when there is nothing else to show.
|
|
198
|
+
spacer: {
|
|
199
|
+
flex: 1,
|
|
200
|
+
minHeight: spacing.lg,
|
|
201
|
+
justifyContent: 'center',
|
|
202
|
+
},
|
|
203
|
+
emptyHint: {
|
|
204
|
+
alignItems: 'center',
|
|
205
|
+
gap: spacing.sm,
|
|
206
|
+
paddingVertical: spacing.xl,
|
|
207
|
+
},
|
|
208
|
+
emptyHintText: {
|
|
209
|
+
fontSize: fontSize.meta,
|
|
210
|
+
color: palette.textSubtle,
|
|
211
|
+
textAlign: 'center',
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
statusStrip: {
|
|
215
|
+
flexDirection: 'row',
|
|
216
|
+
alignItems: 'center',
|
|
217
|
+
gap: spacing.sm + 2,
|
|
218
|
+
minHeight: 56,
|
|
219
|
+
paddingTop: spacing.lg,
|
|
220
|
+
marginTop: spacing.lg,
|
|
221
|
+
borderTopWidth: StyleSheet.hairlineWidth,
|
|
222
|
+
borderTopColor: palette.borderSoft,
|
|
223
|
+
},
|
|
224
|
+
avatarStack: {
|
|
225
|
+
flexDirection: 'row',
|
|
226
|
+
alignItems: 'center',
|
|
227
|
+
},
|
|
228
|
+
avatarStackItem: {
|
|
229
|
+
borderWidth: 2,
|
|
230
|
+
borderColor: palette.white,
|
|
231
|
+
},
|
|
232
|
+
avatarStackOverlap: {
|
|
233
|
+
marginStart: -10,
|
|
234
|
+
},
|
|
235
|
+
statusDot: {
|
|
236
|
+
width: 8,
|
|
237
|
+
height: 8,
|
|
238
|
+
borderRadius: 4,
|
|
239
|
+
},
|
|
240
|
+
statusText: {
|
|
241
|
+
textAlign: START_ALIGN,
|
|
242
|
+
flex: 1,
|
|
243
|
+
fontSize: fontSize.meta,
|
|
244
|
+
color: palette.textMuted,
|
|
245
|
+
},
|
|
246
|
+
});
|