@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,391 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wire + UI types for the Repzo widget.
|
|
3
|
+
*
|
|
4
|
+
* Shapes mirror the CRM widget API (`/api/widget/*`) and the web widget's
|
|
5
|
+
* `client/src/widget/lib/api.ts` — keep them in sync so agent-authored
|
|
6
|
+
* metadata (agentUiBlocks / agentProcedureForm) renders identically.
|
|
7
|
+
*/
|
|
8
|
+
export type WidgetSpaceType = 'home' | 'messages';
|
|
9
|
+
export interface WidgetSpace {
|
|
10
|
+
type: WidgetSpaceType;
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface PreChatField {
|
|
14
|
+
name: string;
|
|
15
|
+
label: string;
|
|
16
|
+
type: 'text' | 'email' | 'phone' | 'select';
|
|
17
|
+
required: boolean;
|
|
18
|
+
options?: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface WidgetConfig {
|
|
21
|
+
primaryColor: string;
|
|
22
|
+
homeLogoUrl: string | null;
|
|
23
|
+
homeBackgroundType: 'solid' | 'gradient' | 'image';
|
|
24
|
+
homeBackgroundColor: string;
|
|
25
|
+
homeBackgroundGradientStart: string;
|
|
26
|
+
homeBackgroundGradientMiddle: string | null;
|
|
27
|
+
homeBackgroundGradientEnd: string;
|
|
28
|
+
homeBackgroundImageUrl: string | null;
|
|
29
|
+
homeHeaderTextColor: 'black' | 'white';
|
|
30
|
+
homeBackgroundFade: boolean;
|
|
31
|
+
position: 'left' | 'right';
|
|
32
|
+
bubbleText: string;
|
|
33
|
+
welcomeHeading: string;
|
|
34
|
+
welcomeSubheading: string;
|
|
35
|
+
preChatEnabled: boolean;
|
|
36
|
+
preChatFields: PreChatField[];
|
|
37
|
+
businessHoursEnabled: boolean;
|
|
38
|
+
offlineMessage: string;
|
|
39
|
+
spaces: WidgetSpace[];
|
|
40
|
+
launchDirectly: boolean;
|
|
41
|
+
showLauncher: boolean;
|
|
42
|
+
launcherVerticalPadding: number;
|
|
43
|
+
launcherHorizontalPadding: number;
|
|
44
|
+
startConversationLabel: string;
|
|
45
|
+
replyTimeLabel: string;
|
|
46
|
+
allowNewConversations: boolean;
|
|
47
|
+
showPreviousConversations: boolean;
|
|
48
|
+
proactiveEnabled: boolean;
|
|
49
|
+
proactiveTitle: string;
|
|
50
|
+
proactiveBody: string;
|
|
51
|
+
proactiveCtaLabel: string;
|
|
52
|
+
proactiveDelaySeconds: number;
|
|
53
|
+
proactivePathContains: string;
|
|
54
|
+
proactiveFrequency: 'session' | 'visitor';
|
|
55
|
+
proactiveOpenMode: 'home' | 'new_message';
|
|
56
|
+
attachmentsEnabled: boolean;
|
|
57
|
+
analyticsEnabled: boolean;
|
|
58
|
+
toursEnabled: boolean;
|
|
59
|
+
defaultLocale: string;
|
|
60
|
+
enabledLocales: string[];
|
|
61
|
+
translations: Record<string, Record<string, string>>;
|
|
62
|
+
identityVerificationEnabled: boolean;
|
|
63
|
+
hmacMandatory: boolean;
|
|
64
|
+
isOnline: boolean;
|
|
65
|
+
}
|
|
66
|
+
/** Received attachments are normalized: a missing `id`/`size` is filled in. */
|
|
67
|
+
export interface WidgetAttachment {
|
|
68
|
+
id: string;
|
|
69
|
+
name: string;
|
|
70
|
+
url: string;
|
|
71
|
+
contentType: string;
|
|
72
|
+
size: number;
|
|
73
|
+
}
|
|
74
|
+
export interface Conversation {
|
|
75
|
+
id: string;
|
|
76
|
+
subject: string | null;
|
|
77
|
+
status: string;
|
|
78
|
+
snippet: string | null;
|
|
79
|
+
messageCount: number;
|
|
80
|
+
lastMessageAt: string | null;
|
|
81
|
+
createdAt: string;
|
|
82
|
+
agentName: string | null;
|
|
83
|
+
agentAvatar: string | null;
|
|
84
|
+
/**
|
|
85
|
+
* Agent replies the visitor hasn't seen, computed server-side from their
|
|
86
|
+
* read cursor. Absent on older Workstation deployments — the SDK then falls
|
|
87
|
+
* back to its locally persisted counts.
|
|
88
|
+
*/
|
|
89
|
+
unreadCount?: number;
|
|
90
|
+
}
|
|
91
|
+
export interface Message {
|
|
92
|
+
id: string;
|
|
93
|
+
messageType?: 'message' | 'note' | 'system';
|
|
94
|
+
direction: 'inbound' | 'outbound';
|
|
95
|
+
senderType: string;
|
|
96
|
+
senderName: string | null;
|
|
97
|
+
body: string | null;
|
|
98
|
+
bodyPlain: string | null;
|
|
99
|
+
attachments: WidgetAttachment[] | null;
|
|
100
|
+
metadata?: Record<string, unknown> | null;
|
|
101
|
+
status: string | null;
|
|
102
|
+
createdAt: string;
|
|
103
|
+
}
|
|
104
|
+
export interface OutboundMessage {
|
|
105
|
+
id?: string;
|
|
106
|
+
type?: 'chat' | 'post' | 'announcement' | 'banner';
|
|
107
|
+
title?: string;
|
|
108
|
+
body?: string;
|
|
109
|
+
bodyHtml?: string;
|
|
110
|
+
ctaLabel?: string;
|
|
111
|
+
ctaUrl?: string;
|
|
112
|
+
imageUrl?: string;
|
|
113
|
+
prefill?: string;
|
|
114
|
+
}
|
|
115
|
+
/** Identity fields accepted by `POST /api/widget/init`. */
|
|
116
|
+
export interface WidgetUser {
|
|
117
|
+
userId?: string;
|
|
118
|
+
email?: string;
|
|
119
|
+
name?: string;
|
|
120
|
+
phone?: string;
|
|
121
|
+
/** HMAC-SHA256 hex of (email ?? userId) — only needed when the widget enforces identity verification. */
|
|
122
|
+
userHash?: string;
|
|
123
|
+
}
|
|
124
|
+
export type WidgetCustomAttributes = Record<string, string | number | boolean>;
|
|
125
|
+
export interface InitResponse {
|
|
126
|
+
token: string;
|
|
127
|
+
identityId: string;
|
|
128
|
+
config: WidgetConfig;
|
|
129
|
+
conversations: Conversation[];
|
|
130
|
+
user?: {
|
|
131
|
+
name?: string;
|
|
132
|
+
email?: string;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/** Production Workstation deployment — where `/api/widget/*` is served. */
|
|
136
|
+
export declare const DEFAULT_BASE_URL = "https://workstation.repzo.com";
|
|
137
|
+
export interface BootOptions {
|
|
138
|
+
/**
|
|
139
|
+
* Override the CRM deployment root. Defaults to production Workstation
|
|
140
|
+
* (`https://workstation.repzo.com`); set it only for a dev/staging CRM.
|
|
141
|
+
* Android emulators need `http://10.0.2.2:3000` to reach a local CRM.
|
|
142
|
+
*/
|
|
143
|
+
baseUrl?: string;
|
|
144
|
+
/** `inbox_channel_accounts.id` of the Website Chat widget. */
|
|
145
|
+
channelAccountId: string;
|
|
146
|
+
user?: WidgetUser;
|
|
147
|
+
/**
|
|
148
|
+
* Called first for every link the visitor taps inside the widget (agent/AI
|
|
149
|
+
* replies, campaign CTAs, attachments). Return `true` when the host handled
|
|
150
|
+
* it (e.g. routed an `myapp://` deep link itself). Otherwise the SDK only
|
|
151
|
+
* opens `https:`, `http:`, `mailto:` and `tel:` URLs and blocks the rest —
|
|
152
|
+
* agent-authored text must never be able to fire host deep links,
|
|
153
|
+
* `intent:` or `javascript:` URLs.
|
|
154
|
+
*/
|
|
155
|
+
onOpenUrl?: (url: string) => boolean | Promise<boolean>;
|
|
156
|
+
/**
|
|
157
|
+
* FCM push registration (requires `@react-native-firebase/messaging` in the
|
|
158
|
+
* host app and the channel's push provider set to FCM in Workstation).
|
|
159
|
+
*/
|
|
160
|
+
push?: {
|
|
161
|
+
enabled?: boolean;
|
|
162
|
+
/** Default true — set false when the host runs its own permission prompt. */
|
|
163
|
+
requestPermission?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* The app's bundle id / package name — lets a channel serving several apps
|
|
166
|
+
* match this device to the right Firebase key. Optional for single-app
|
|
167
|
+
* channels.
|
|
168
|
+
*/
|
|
169
|
+
bundleId?: string;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
export type AgentUiModule = 'products' | 'product_variants' | 'carts' | 'orders' | 'contacts' | 'leads' | 'appointments' | 'price_offers' | 'send';
|
|
173
|
+
export interface AgentUiAction {
|
|
174
|
+
id: string;
|
|
175
|
+
type: 'add_to_cart' | 'buy_now' | 'submit_contact' | 'record_consent' | 'select_appointment_provider' | 'select_appointment_slot' | 'open_record' | 'accept_quote' | 'next_action';
|
|
176
|
+
label: string;
|
|
177
|
+
module: AgentUiModule;
|
|
178
|
+
payload: Record<string, unknown>;
|
|
179
|
+
navigateTo?: string;
|
|
180
|
+
}
|
|
181
|
+
export interface AgentUiProduct {
|
|
182
|
+
id: string;
|
|
183
|
+
name: string;
|
|
184
|
+
type: 'physical' | 'service' | 'digital';
|
|
185
|
+
shortDescription?: string;
|
|
186
|
+
description?: string;
|
|
187
|
+
imageUrl?: string;
|
|
188
|
+
sku?: string;
|
|
189
|
+
unit?: string;
|
|
190
|
+
price: number;
|
|
191
|
+
currency: string;
|
|
192
|
+
durationMinutes?: number;
|
|
193
|
+
}
|
|
194
|
+
export interface AgentUiCommerceItem {
|
|
195
|
+
productId?: string;
|
|
196
|
+
variantId?: string;
|
|
197
|
+
name: string;
|
|
198
|
+
description?: string;
|
|
199
|
+
imageUrl?: string;
|
|
200
|
+
sku?: string;
|
|
201
|
+
quantity: number;
|
|
202
|
+
unitPrice: number;
|
|
203
|
+
lineTotal: number;
|
|
204
|
+
}
|
|
205
|
+
export type AgentUiBlock = {
|
|
206
|
+
id: string;
|
|
207
|
+
module: AgentUiModule;
|
|
208
|
+
type: 'product_service_card';
|
|
209
|
+
product: AgentUiProduct;
|
|
210
|
+
} | {
|
|
211
|
+
id: string;
|
|
212
|
+
module: AgentUiModule;
|
|
213
|
+
type: 'product_choices';
|
|
214
|
+
productId: string;
|
|
215
|
+
title: string;
|
|
216
|
+
variants: Array<{
|
|
217
|
+
id: string;
|
|
218
|
+
title: string;
|
|
219
|
+
sku?: string;
|
|
220
|
+
price: number;
|
|
221
|
+
currency: string;
|
|
222
|
+
imageUrl?: string;
|
|
223
|
+
available: boolean;
|
|
224
|
+
}>;
|
|
225
|
+
} | {
|
|
226
|
+
id: string;
|
|
227
|
+
module: AgentUiModule;
|
|
228
|
+
type: 'commerce_actions';
|
|
229
|
+
productId: string;
|
|
230
|
+
variantId?: string;
|
|
231
|
+
quantity: number;
|
|
232
|
+
actions: AgentUiAction[];
|
|
233
|
+
} | {
|
|
234
|
+
id: string;
|
|
235
|
+
module: AgentUiModule;
|
|
236
|
+
type: 'cart_order_summary';
|
|
237
|
+
title: string;
|
|
238
|
+
reference?: string;
|
|
239
|
+
status?: string;
|
|
240
|
+
currency: string;
|
|
241
|
+
items: AgentUiCommerceItem[];
|
|
242
|
+
subtotal: number;
|
|
243
|
+
discount: number;
|
|
244
|
+
tax: number;
|
|
245
|
+
shipping: number;
|
|
246
|
+
total: number;
|
|
247
|
+
action?: AgentUiAction;
|
|
248
|
+
} | {
|
|
249
|
+
id: string;
|
|
250
|
+
module: AgentUiModule;
|
|
251
|
+
type: 'contact_lead_form';
|
|
252
|
+
title: string;
|
|
253
|
+
description?: string;
|
|
254
|
+
fields: Array<{
|
|
255
|
+
name: string;
|
|
256
|
+
label: string;
|
|
257
|
+
type: 'text' | 'email' | 'phone' | 'textarea';
|
|
258
|
+
required: boolean;
|
|
259
|
+
placeholder?: string;
|
|
260
|
+
value?: string;
|
|
261
|
+
}>;
|
|
262
|
+
submitLabel: string;
|
|
263
|
+
} | {
|
|
264
|
+
id: string;
|
|
265
|
+
module: AgentUiModule;
|
|
266
|
+
type: 'consent';
|
|
267
|
+
statement: string;
|
|
268
|
+
channels: Array<'email' | 'phone' | 'whatsapp'>;
|
|
269
|
+
required: boolean;
|
|
270
|
+
privacyUrl?: string;
|
|
271
|
+
} | {
|
|
272
|
+
id: string;
|
|
273
|
+
module: AgentUiModule;
|
|
274
|
+
type: 'appointment_slot_picker';
|
|
275
|
+
serviceId: string;
|
|
276
|
+
serviceName: string;
|
|
277
|
+
durationMinutes: number;
|
|
278
|
+
timezone?: string;
|
|
279
|
+
locationId?: string;
|
|
280
|
+
selectedProviderId?: string;
|
|
281
|
+
providers: Array<{
|
|
282
|
+
id: string;
|
|
283
|
+
name: string;
|
|
284
|
+
avatarUrl?: string | null;
|
|
285
|
+
}>;
|
|
286
|
+
days: Array<{
|
|
287
|
+
date: string;
|
|
288
|
+
slots: Array<{
|
|
289
|
+
startTime: string;
|
|
290
|
+
endTime: string;
|
|
291
|
+
staffUserId?: string | null;
|
|
292
|
+
slotToken: string;
|
|
293
|
+
}>;
|
|
294
|
+
}>;
|
|
295
|
+
} | {
|
|
296
|
+
id: string;
|
|
297
|
+
module: AgentUiModule;
|
|
298
|
+
type: 'quote_preview';
|
|
299
|
+
quoteId: string;
|
|
300
|
+
name: string;
|
|
301
|
+
serialNumber?: string;
|
|
302
|
+
status: string;
|
|
303
|
+
amount: number;
|
|
304
|
+
currency: string;
|
|
305
|
+
validUntil?: string;
|
|
306
|
+
contactName?: string;
|
|
307
|
+
items: AgentUiCommerceItem[];
|
|
308
|
+
actions: AgentUiAction[];
|
|
309
|
+
} | {
|
|
310
|
+
id: string;
|
|
311
|
+
module: AgentUiModule;
|
|
312
|
+
type: 'success_receipt';
|
|
313
|
+
title: string;
|
|
314
|
+
description?: string;
|
|
315
|
+
entityId?: string;
|
|
316
|
+
reference?: string;
|
|
317
|
+
amount?: number;
|
|
318
|
+
currency?: string;
|
|
319
|
+
navigateTo?: string;
|
|
320
|
+
nextActions: AgentUiAction[];
|
|
321
|
+
};
|
|
322
|
+
export interface AgentProcedureForm {
|
|
323
|
+
procedureId: string;
|
|
324
|
+
procedureName: string;
|
|
325
|
+
fields: Array<{
|
|
326
|
+
name: string;
|
|
327
|
+
label: string;
|
|
328
|
+
type: 'text' | 'email' | 'phone' | 'date' | 'time';
|
|
329
|
+
required: boolean;
|
|
330
|
+
}>;
|
|
331
|
+
}
|
|
332
|
+
export type WidgetRealtimeEvent = 'connected' | 'message.new' | 'typing.start' | 'typing.stop' | 'conversation.updated' | 'conversation.event' | 'error';
|
|
333
|
+
/**
|
|
334
|
+
* Async key/value store. The regular adapter holds the device id, unread
|
|
335
|
+
* counts and cached theme; the optional secure adapter (Keychain/Keystore via
|
|
336
|
+
* `setSecureStorageAdapter`) holds the visitor token and user key.
|
|
337
|
+
*/
|
|
338
|
+
export interface RepzoWidgetStorageAdapter {
|
|
339
|
+
getItem(key: string): Promise<string | null> | string | null;
|
|
340
|
+
setItem(key: string, value: string): Promise<void> | void;
|
|
341
|
+
removeItem(key: string): Promise<void> | void;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* `RepzoWidgetError.code`. The last two come from the server's 403 body and
|
|
345
|
+
* are terminal — the SDK stops realtime and does not retry on its own:
|
|
346
|
+
* - `messenger_api_disabled` — the channel's Messenger API is switched off.
|
|
347
|
+
* - `identity_verification_failed` — `userHash` missing/wrong while the
|
|
348
|
+
* channel enforces identity verification.
|
|
349
|
+
*/
|
|
350
|
+
export type RepzoWidgetErrorCode = 'network' | 'http' | 'messenger_api_disabled' | 'identity_verification_failed';
|
|
351
|
+
export type WidgetView = 'bubble' | 'home' | 'prechat' | 'chat' | 'conversations';
|
|
352
|
+
export interface WidgetState {
|
|
353
|
+
booted: boolean;
|
|
354
|
+
loading: boolean;
|
|
355
|
+
error: string | null;
|
|
356
|
+
/** Machine-readable companion to `error` — see `RepzoWidgetErrorCode`. */
|
|
357
|
+
errorCode: RepzoWidgetErrorCode | null;
|
|
358
|
+
config: WidgetConfig | null;
|
|
359
|
+
identityId: string | null;
|
|
360
|
+
isOpen: boolean;
|
|
361
|
+
view: WidgetView;
|
|
362
|
+
activeTab: WidgetSpaceType;
|
|
363
|
+
conversations: Conversation[];
|
|
364
|
+
activeConversationId: string | null;
|
|
365
|
+
messages: Message[];
|
|
366
|
+
messagesLoading: boolean;
|
|
367
|
+
hasMoreMessages: boolean;
|
|
368
|
+
messageCursor: string | null;
|
|
369
|
+
agentTyping: boolean;
|
|
370
|
+
/**
|
|
371
|
+
* Unread team replies across all threads — always the sum of
|
|
372
|
+
* `unreadByConversation`, so it only drops when a thread is opened.
|
|
373
|
+
*/
|
|
374
|
+
unreadCount: number;
|
|
375
|
+
/**
|
|
376
|
+
* Unread replies per conversation. Only `messageType: 'message'` replies
|
|
377
|
+
* count (never system rows); a thread stays unread until the visitor
|
|
378
|
+
* actually opens it.
|
|
379
|
+
*/
|
|
380
|
+
unreadByConversation: Record<string, number>;
|
|
381
|
+
locale: string;
|
|
382
|
+
prefillText: string;
|
|
383
|
+
outboundMessage: OutboundMessage | null;
|
|
384
|
+
/** Name/email captured from pre-chat or `loginUserWithUserAttributes`. */
|
|
385
|
+
visitorProfile: {
|
|
386
|
+
name?: string;
|
|
387
|
+
email?: string;
|
|
388
|
+
phone?: string;
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,eAAe,GAAG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AAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,eAAe,GAAG,IAAI,CAAC;IACxC,0EAA0E;IAC1E,cAAc,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACnE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<RepzoWidgetProvider>` — mount once at the app root.
|
|
3
|
+
*
|
|
4
|
+
* Hosts the chat modal and subscribes to the controller's store. It owns no
|
|
5
|
+
* session state: the SSE stream and unread count live in the store, so closing
|
|
6
|
+
* the modal (or never mounting it) never drops a conversation.
|
|
7
|
+
*/
|
|
8
|
+
export interface RepzoWidgetProviderProps {
|
|
9
|
+
/** Rendered underneath the widget — usually the rest of the app. */
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
/** iOS sheet style. `pageSheet` keeps the native swipe-to-dismiss grabber. */
|
|
12
|
+
presentationStyle?: 'pageSheet' | 'fullScreen';
|
|
13
|
+
}
|
|
14
|
+
export declare function RepzoWidgetProvider({ children, presentationStyle, }: RepzoWidgetProviderProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=WidgetProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WidgetProvider.d.ts","sourceRoot":"","sources":["../../../../src/ui/WidgetProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgCH,MAAM,WAAW,wBAAwB;IACvC,oEAAoE;IACpE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,8EAA8E;IAC9E,iBAAiB,CAAC,EAAE,WAAW,GAAG,YAAY,CAAC;CAChD;AAED,wBAAgB,mBAAmB,CAAC,EAClC,QAAQ,EACR,iBAA+B,GAChC,EAAE,wBAAwB,+BAoV1B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders agent-authored rich blocks (product cards, slot pickers, lead forms,
|
|
3
|
+
* quotes, receipts) and posts the visitor's choice back through
|
|
4
|
+
* `POST /api/widget/messages` as an `agentUiAction`.
|
|
5
|
+
* Port of `client/src/widget/components/AgentUiBlocks.tsx`.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentUiAction, AgentUiBlock } from '../../types';
|
|
8
|
+
export interface AgentUiBlockLabels {
|
|
9
|
+
service: string;
|
|
10
|
+
product: string;
|
|
11
|
+
chooseTime: string;
|
|
12
|
+
professional: string;
|
|
13
|
+
priceOffer: string;
|
|
14
|
+
working: string;
|
|
15
|
+
}
|
|
16
|
+
interface AgentUiBlocksProps {
|
|
17
|
+
blocks: AgentUiBlock[];
|
|
18
|
+
color: string;
|
|
19
|
+
labels?: AgentUiBlockLabels;
|
|
20
|
+
onAction: (action: AgentUiAction) => void | Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export declare function AgentUiBlocks({ blocks, color, labels, onAction, }: AgentUiBlocksProps): import("react").JSX.Element;
|
|
23
|
+
export declare function formatMoney(amount: number, currency: string): string;
|
|
24
|
+
export declare function formatDate(date: string): string;
|
|
25
|
+
export declare function formatTime(time: string): string;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=AgentUiBlocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentUiBlocks.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/AgentUiBlocks.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG/D,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAaD,UAAU,kBAAkB;IAC1B,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3D;AAED,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,KAAK,EACL,MAA6B,EAC7B,QAAQ,GACT,EAAE,kBAAkB,+BAuepB;AA+GD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAQ3D;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,UAYtC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,UAStC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent avatar with graceful fallbacks: photo → initials → person glyph.
|
|
3
|
+
* A broken URL must never leave a blank hole in the header or the list.
|
|
4
|
+
*/
|
|
5
|
+
import { type ImageStyle, type StyleProp, type ViewStyle } from 'react-native';
|
|
6
|
+
interface AvatarProps {
|
|
7
|
+
avatar?: string | null;
|
|
8
|
+
name?: string | null;
|
|
9
|
+
size?: number;
|
|
10
|
+
/** Background when there is no photo. */
|
|
11
|
+
color?: string;
|
|
12
|
+
/** Used in the colored header, where the placeholder is a translucent white. */
|
|
13
|
+
translucent?: boolean;
|
|
14
|
+
style?: StyleProp<ViewStyle & ImageStyle>;
|
|
15
|
+
}
|
|
16
|
+
export declare function Avatar({ avatar, name, size, color, translucent, style, }: AvatarProps): import("react").JSX.Element;
|
|
17
|
+
export declare function getInitials(name: string): string;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=Avatar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/Avatar.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAML,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAKtB,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,GAAG,UAAU,CAAC,CAAC;CAC3C;AAED,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,IAAI,EACJ,IAAS,EACT,KAAwB,EACxB,WAAmB,EACnB,KAAK,GACN,EAAE,WAAW,+BA6Bb;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIhD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One conversation in a list: who replied, when, and the last thing said.
|
|
3
|
+
* Shared by the Home space's recent preview and the Messages list so the two
|
|
4
|
+
* cannot drift apart.
|
|
5
|
+
*/
|
|
6
|
+
import type { Conversation } from '../../types';
|
|
7
|
+
import { type RelativeTimeLabels } from '../utils/conversations';
|
|
8
|
+
interface ConversationRowProps {
|
|
9
|
+
conversation: Conversation;
|
|
10
|
+
color: string;
|
|
11
|
+
/** Stands in until an agent is assigned to the thread. */
|
|
12
|
+
fallbackName: string;
|
|
13
|
+
timeLabels: RelativeTimeLabels;
|
|
14
|
+
/** Replies that arrived since the visitor last opened this thread. */
|
|
15
|
+
unreadCount?: number;
|
|
16
|
+
/** Template with a `{count}` token, for screen readers. */
|
|
17
|
+
unreadLabel?: string;
|
|
18
|
+
/** Messages runs full-bleed; Home insets it inside a card. */
|
|
19
|
+
horizontalPadding?: number;
|
|
20
|
+
onPress: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function ConversationRow({ conversation, color, fallbackName, timeLabels, unreadCount, unreadLabel, horizontalPadding, onPress, }: ConversationRowProps): import("react").JSX.Element;
|
|
23
|
+
/** Where a divider should start so it sits under the text, not the avatar. */
|
|
24
|
+
export declare function rowDividerInset(horizontalPadding?: number): number;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=ConversationRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConversationRow.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ConversationRow.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAOrF,UAAU,oBAAoB;IAC5B,YAAY,EAAE,YAAY,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,EAC9B,YAAY,EACZ,KAAK,EACL,YAAY,EACZ,UAAU,EACV,WAAe,EACf,WAAW,EACX,iBAA8B,EAC9B,OAAO,GACR,EAAE,oBAAoB,+BAmDtB;AAED,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,iBAAiB,GAAE,MAAmB,GAAG,MAAM,CAE9E"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps a render error inside the widget's own UI from unmounting the host
|
|
3
|
+
* app. `<RepzoWidgetProvider>` renders the host's `children` next to the
|
|
4
|
+
* modal, so an uncaught throw in, say, a malformed agent block would
|
|
5
|
+
* otherwise take the whole app down with it. Never wraps host children.
|
|
6
|
+
*/
|
|
7
|
+
import { Component, type ReactNode } from 'react';
|
|
8
|
+
interface WidgetErrorBoundaryProps {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/** Rendered instead of `children` after a crash; `reset` re-renders them. */
|
|
11
|
+
fallback: ReactNode | ((reset: () => void) => ReactNode);
|
|
12
|
+
/** Any change clears a caught error — e.g. the visitor moved to another screen. */
|
|
13
|
+
resetKey?: string | number | null;
|
|
14
|
+
}
|
|
15
|
+
interface WidgetErrorBoundaryState {
|
|
16
|
+
hasError: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare class WidgetErrorBoundary extends Component<WidgetErrorBoundaryProps, WidgetErrorBoundaryState> {
|
|
19
|
+
state: WidgetErrorBoundaryState;
|
|
20
|
+
static getDerivedStateFromError(): WidgetErrorBoundaryState;
|
|
21
|
+
componentDidCatch(error: unknown): void;
|
|
22
|
+
componentDidUpdate(previous: WidgetErrorBoundaryProps): void;
|
|
23
|
+
reset: () => void;
|
|
24
|
+
render(): ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=ErrorBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,UAAU,wBAAwB;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,6EAA6E;IAC7E,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,IAAI,KAAK,SAAS,CAAC,CAAC;IACzD,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,UAAU,wBAAwB;IAChC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,qBAAa,mBAAoB,SAAQ,SAAS,CAChD,wBAAwB,EACxB,wBAAwB,CACzB;IACC,KAAK,EAAE,wBAAwB,CAAuB;IAEtD,MAAM,CAAC,wBAAwB,IAAI,wBAAwB;IAI3D,iBAAiB,CAAC,KAAK,EAAE,OAAO;IAIhC,kBAAkB,CAAC,QAAQ,EAAE,wBAAwB;IAIrD,KAAK,aAEH;IAEF,MAAM;CAKP"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brand backgrounds drawn without a native dependency: the gradient a header
|
|
3
|
+
* is painted with, and the fade that washes it out into the page. Both borrow
|
|
4
|
+
* the host app's `react-native-linear-gradient` when it is installed and stack
|
|
5
|
+
* solid bands when it is not (see `utils/native-gradient.ts`).
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
8
|
+
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
9
|
+
/**
|
|
10
|
+
* Multi-band approximation of a CSS linear-gradient. RN has no gradient
|
|
11
|
+
* primitive and the SDK ships no native deps, so we stack interpolated bands.
|
|
12
|
+
*/
|
|
13
|
+
export declare function GradientBackground({ colors, children, style, bands, }: {
|
|
14
|
+
colors: string[];
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
style?: StyleProp<ViewStyle>;
|
|
17
|
+
/** Defaults to whatever the colour ramp needs to look continuous. */
|
|
18
|
+
bands?: number;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Washes the bottom of a header out into the page colour: a straight ramp from
|
|
22
|
+
* fully transparent at the top to opaque at the bottom edge, the same
|
|
23
|
+
* `linear-gradient(transparent, white)` the web widget draws. Callers size it
|
|
24
|
+
* so the ramp begins below the heading, which it would otherwise wash out.
|
|
25
|
+
*/
|
|
26
|
+
export declare function FadeOverlay({ color, height, bands, style, }: {
|
|
27
|
+
color?: string;
|
|
28
|
+
height?: number;
|
|
29
|
+
/** Defaults to a count fine enough that the alpha ramp reads as continuous. */
|
|
30
|
+
bands?: number;
|
|
31
|
+
style?: ViewStyle;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
33
|
+
//# sourceMappingURL=Gradient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Gradient.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/Gradient.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AA4BhF;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,EACR,KAAK,EACL,KAAK,GACN,EAAE;IACD,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,+BAmBA;AAoCD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAqB,EACrB,MAAW,EACX,KAAK,EACL,KAAK,GACN,EAAE;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,+BA6BA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional floating launcher with an unread badge — the RN counterpart of the
|
|
3
|
+
* web widget's `Bubble.tsx`. Apps that already have their own chat entry point
|
|
4
|
+
* (like Repzo's map screen) can ignore it and call `RepzoWidget.present()`
|
|
5
|
+
* directly; it is exported so smaller hosts get a launcher for free.
|
|
6
|
+
*
|
|
7
|
+
* It positions itself absolutely, so mount it inside a full-screen container.
|
|
8
|
+
*/
|
|
9
|
+
export interface LauncherProps {
|
|
10
|
+
/** Overrides the widget config's position/padding when the host needs to. */
|
|
11
|
+
position?: 'left' | 'right';
|
|
12
|
+
verticalPadding?: number;
|
|
13
|
+
horizontalPadding?: number;
|
|
14
|
+
/** Hides the launcher without unmounting the provider. */
|
|
15
|
+
hidden?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function Launcher({ position, verticalPadding, horizontalPadding, hidden, }: LauncherProps): import("react").JSX.Element | null;
|
|
18
|
+
//# sourceMappingURL=Launcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Launcher.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/Launcher.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgBH,MAAM,WAAW,aAAa;IAC5B,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,QAAQ,CAAC,EACvB,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,MAAc,GACf,EAAE,aAAa,sCA0Cf"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal Markdown renderer for agent replies.
|
|
3
|
+
*
|
|
4
|
+
* The web widget uses react-markdown + remark-gfm; this SDK ships no runtime
|
|
5
|
+
* dependencies, so it supports the subset agents actually emit: paragraphs,
|
|
6
|
+
* bullet/numbered lists, bold, italic, inline code, fenced code and links
|
|
7
|
+
* (including bare URLs, linkified the same way the web widget does).
|
|
8
|
+
*/
|
|
9
|
+
/** Turn bare URLs into markdown links while leaving code and existing links alone. */
|
|
10
|
+
export declare function linkifyMarkdown(text: string): string;
|
|
11
|
+
interface MarkdownProps {
|
|
12
|
+
content: string;
|
|
13
|
+
color: string;
|
|
14
|
+
/** Link color — defaults to the text color with an underline. */
|
|
15
|
+
linkColor?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function Markdown({ content, color, linkColor }: MarkdownProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=Markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/Markdown.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAqDH,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOpD;AA4DD,UAAU,aAAa;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,aAAa,+BA0CpE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Proactive / campaign card shown above the home + messages spaces.
|
|
3
|
+
* Port of `client/src/widget/components/OutboundMessageCard.tsx`.
|
|
4
|
+
*/
|
|
5
|
+
import type { OutboundMessage } from '../../types';
|
|
6
|
+
interface OutboundMessageCardProps {
|
|
7
|
+
message: OutboundMessage;
|
|
8
|
+
color: string;
|
|
9
|
+
labels: {
|
|
10
|
+
title: string;
|
|
11
|
+
cta: string;
|
|
12
|
+
dismiss: string;
|
|
13
|
+
};
|
|
14
|
+
onDismiss: () => void;
|
|
15
|
+
onStartChat: (prefill?: string) => void;
|
|
16
|
+
onTrack?: (event: string, metadata?: Record<string, unknown>) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function OutboundMessageCard({ message, color, labels, onDismiss, onStartChat, onTrack, }: OutboundMessageCardProps): import("react").JSX.Element;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=OutboundMessageCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OutboundMessageCard.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/OutboundMessageCard.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAOnD,UAAU,wBAAwB;IAChC,OAAO,EAAE,eAAe,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACvE;AAED,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,KAAK,EACL,MAAM,EACN,SAAS,EACT,WAAW,EACX,OAAO,GACR,EAAE,wBAAwB,+BA0D1B"}
|