@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,864 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.AgentUiBlocks = AgentUiBlocks;
|
|
7
|
+
exports.formatDate = formatDate;
|
|
8
|
+
exports.formatMoney = formatMoney;
|
|
9
|
+
exports.formatTime = formatTime;
|
|
10
|
+
var _react = require("react");
|
|
11
|
+
var _reactNative = require("react-native");
|
|
12
|
+
var _theme = require("../styles/theme.js");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
/**
|
|
15
|
+
* Renders agent-authored rich blocks (product cards, slot pickers, lead forms,
|
|
16
|
+
* quotes, receipts) and posts the visitor's choice back through
|
|
17
|
+
* `POST /api/widget/messages` as an `agentUiAction`.
|
|
18
|
+
* Port of `client/src/widget/components/AgentUiBlocks.tsx`.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const DEFAULT_BLOCK_LABELS = {
|
|
22
|
+
service: 'Service',
|
|
23
|
+
product: 'Product',
|
|
24
|
+
chooseTime: 'Choose a time',
|
|
25
|
+
professional: 'Professional',
|
|
26
|
+
priceOffer: 'Price offer',
|
|
27
|
+
working: 'Working...'
|
|
28
|
+
};
|
|
29
|
+
const BlockLabelContext = /*#__PURE__*/(0, _react.createContext)(DEFAULT_BLOCK_LABELS);
|
|
30
|
+
function AgentUiBlocks({
|
|
31
|
+
blocks,
|
|
32
|
+
color,
|
|
33
|
+
labels = DEFAULT_BLOCK_LABELS,
|
|
34
|
+
onAction
|
|
35
|
+
}) {
|
|
36
|
+
const [selectedVariants, setSelectedVariants] = (0, _react.useState)({});
|
|
37
|
+
const [consents, setConsents] = (0, _react.useState)({});
|
|
38
|
+
const [values, setValues] = (0, _react.useState)({});
|
|
39
|
+
const [selectedSlots, setSelectedSlots] = (0, _react.useState)({});
|
|
40
|
+
const [pending, setPending] = (0, _react.useState)(null);
|
|
41
|
+
const requiredConsent = blocks.filter(block => block.type === 'consent' && block.required);
|
|
42
|
+
const consentGranted = requiredConsent.every(block => consents[block.id]);
|
|
43
|
+
const act = async action => {
|
|
44
|
+
if (pending) return;
|
|
45
|
+
const productId = typeof action.payload.productId === 'string' ? action.payload.productId : undefined;
|
|
46
|
+
const nextAction = productId && selectedVariants[productId] ? {
|
|
47
|
+
...action,
|
|
48
|
+
payload: {
|
|
49
|
+
...action.payload,
|
|
50
|
+
variantId: selectedVariants[productId]
|
|
51
|
+
}
|
|
52
|
+
} : action;
|
|
53
|
+
setPending(action.id);
|
|
54
|
+
try {
|
|
55
|
+
await onAction(nextAction);
|
|
56
|
+
} finally {
|
|
57
|
+
setPending(null);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(BlockLabelContext.Provider, {
|
|
61
|
+
value: labels,
|
|
62
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
63
|
+
style: styles.stack,
|
|
64
|
+
children: blocks.map(block => {
|
|
65
|
+
if (block.type === 'product_service_card') {
|
|
66
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
67
|
+
style: styles.card,
|
|
68
|
+
children: [block.product.imageUrl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
69
|
+
source: {
|
|
70
|
+
uri: block.product.imageUrl
|
|
71
|
+
},
|
|
72
|
+
style: styles.cardImage,
|
|
73
|
+
resizeMode: "cover",
|
|
74
|
+
accessibilityIgnoresInvertColors: true
|
|
75
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
76
|
+
style: styles.cardBody,
|
|
77
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
78
|
+
style: styles.rowStart,
|
|
79
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
80
|
+
style: styles.flexMin,
|
|
81
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
82
|
+
style: styles.title,
|
|
83
|
+
children: block.product.name
|
|
84
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
85
|
+
style: styles.description,
|
|
86
|
+
children: block.product.shortDescription || block.product.description || ''
|
|
87
|
+
})]
|
|
88
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Badge, {
|
|
89
|
+
label: block.product.type === 'service' ? labels.service : labels.product
|
|
90
|
+
})]
|
|
91
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
92
|
+
style: styles.row,
|
|
93
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
94
|
+
style: styles.muted,
|
|
95
|
+
children: block.product.durationMinutes ? `${block.product.durationMinutes} min` : block.product.unit || ''
|
|
96
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
97
|
+
style: styles.price,
|
|
98
|
+
children: formatMoney(block.product.price, block.product.currency)
|
|
99
|
+
})]
|
|
100
|
+
})]
|
|
101
|
+
})]
|
|
102
|
+
}, block.id);
|
|
103
|
+
}
|
|
104
|
+
if (block.type === 'product_choices') {
|
|
105
|
+
const selected = selectedVariants[block.productId] || block.variants.find(variant => variant.available)?.id || '';
|
|
106
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
107
|
+
style: [styles.card, styles.cardPadded],
|
|
108
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
109
|
+
style: styles.title,
|
|
110
|
+
children: block.title
|
|
111
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
112
|
+
style: styles.chipRow,
|
|
113
|
+
children: block.variants.map(variant => /*#__PURE__*/(0, _jsxRuntime.jsx)(Chip, {
|
|
114
|
+
selected: selected === variant.id,
|
|
115
|
+
disabled: !variant.available,
|
|
116
|
+
color: color,
|
|
117
|
+
onPress: () => setSelectedVariants(current => ({
|
|
118
|
+
...current,
|
|
119
|
+
[block.productId]: variant.id
|
|
120
|
+
})),
|
|
121
|
+
label: variant.title,
|
|
122
|
+
sublabel: formatMoney(variant.price, variant.currency)
|
|
123
|
+
}, variant.id))
|
|
124
|
+
})]
|
|
125
|
+
}, block.id);
|
|
126
|
+
}
|
|
127
|
+
if (block.type === 'commerce_actions') {
|
|
128
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
129
|
+
style: styles.actionRow,
|
|
130
|
+
children: block.actions.map((action, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
131
|
+
style: styles.actionCell,
|
|
132
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionButton, {
|
|
133
|
+
color: color,
|
|
134
|
+
secondary: index === 0 && block.actions.length > 1,
|
|
135
|
+
pending: pending === action.id,
|
|
136
|
+
onPress: () => act(action),
|
|
137
|
+
children: action.label
|
|
138
|
+
})
|
|
139
|
+
}, action.id))
|
|
140
|
+
}, block.id);
|
|
141
|
+
}
|
|
142
|
+
if (block.type === 'cart_order_summary') {
|
|
143
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
144
|
+
style: [styles.card, styles.cardPadded],
|
|
145
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
146
|
+
style: styles.rowStart,
|
|
147
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
148
|
+
style: styles.title,
|
|
149
|
+
children: block.title
|
|
150
|
+
}), block.status ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Badge, {
|
|
151
|
+
label: block.status
|
|
152
|
+
}) : null]
|
|
153
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
154
|
+
style: styles.itemList,
|
|
155
|
+
children: block.items.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
156
|
+
style: styles.row,
|
|
157
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
158
|
+
style: styles.flexMin,
|
|
159
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
160
|
+
style: styles.itemName,
|
|
161
|
+
children: item.name
|
|
162
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
163
|
+
style: styles.muted,
|
|
164
|
+
children: [item.quantity, " \xD7 ", formatMoney(item.unitPrice, block.currency)]
|
|
165
|
+
})]
|
|
166
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
167
|
+
style: styles.itemTotal,
|
|
168
|
+
children: formatMoney(item.lineTotal, block.currency)
|
|
169
|
+
})]
|
|
170
|
+
}, `${item.name}:${index}`))
|
|
171
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
172
|
+
style: styles.totals,
|
|
173
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(MoneyRow, {
|
|
174
|
+
label: "Subtotal",
|
|
175
|
+
value: formatMoney(block.subtotal, block.currency)
|
|
176
|
+
}), block.discount ? /*#__PURE__*/(0, _jsxRuntime.jsx)(MoneyRow, {
|
|
177
|
+
label: "Discount",
|
|
178
|
+
value: `−${formatMoney(block.discount, block.currency)}`
|
|
179
|
+
}) : null, block.tax ? /*#__PURE__*/(0, _jsxRuntime.jsx)(MoneyRow, {
|
|
180
|
+
label: "Tax",
|
|
181
|
+
value: formatMoney(block.tax, block.currency)
|
|
182
|
+
}) : null, block.shipping ? /*#__PURE__*/(0, _jsxRuntime.jsx)(MoneyRow, {
|
|
183
|
+
label: "Shipping",
|
|
184
|
+
value: formatMoney(block.shipping, block.currency)
|
|
185
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(MoneyRow, {
|
|
186
|
+
label: "Total",
|
|
187
|
+
value: formatMoney(block.total, block.currency),
|
|
188
|
+
strong: true
|
|
189
|
+
})]
|
|
190
|
+
}), block.action ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
191
|
+
style: styles.blockAction,
|
|
192
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionButton, {
|
|
193
|
+
color: color,
|
|
194
|
+
pending: pending === block.action.id,
|
|
195
|
+
onPress: () => block.action && act(block.action),
|
|
196
|
+
children: block.action.label
|
|
197
|
+
})
|
|
198
|
+
}) : null]
|
|
199
|
+
}, block.id);
|
|
200
|
+
}
|
|
201
|
+
if (block.type === 'contact_lead_form') {
|
|
202
|
+
const complete = block.fields.every(field => !field.required || (values[`${block.id}:${field.name}`] ?? field.value ?? '').trim());
|
|
203
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
204
|
+
style: [styles.card, styles.cardPadded],
|
|
205
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
206
|
+
style: styles.title,
|
|
207
|
+
children: block.title
|
|
208
|
+
}), block.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
209
|
+
style: styles.description,
|
|
210
|
+
children: block.description
|
|
211
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
212
|
+
style: styles.fieldStack,
|
|
213
|
+
children: block.fields.map(field => {
|
|
214
|
+
const id = `${block.id}:${field.name}`;
|
|
215
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
|
|
216
|
+
value: values[id] ?? field.value ?? '',
|
|
217
|
+
onChangeText: text => setValues(current => ({
|
|
218
|
+
...current,
|
|
219
|
+
[id]: text
|
|
220
|
+
})),
|
|
221
|
+
placeholder: field.placeholder || field.label,
|
|
222
|
+
placeholderTextColor: _theme.palette.textSubtle,
|
|
223
|
+
accessibilityLabel: field.label,
|
|
224
|
+
keyboardType: keyboardTypeFor(field.type),
|
|
225
|
+
autoCapitalize: field.type === 'email' ? 'none' : 'sentences',
|
|
226
|
+
multiline: field.type === 'textarea',
|
|
227
|
+
style: [styles.input, field.type === 'textarea' && styles.textarea]
|
|
228
|
+
}, id);
|
|
229
|
+
})
|
|
230
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
231
|
+
style: styles.blockAction,
|
|
232
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionButton, {
|
|
233
|
+
color: color,
|
|
234
|
+
disabled: !complete || !consentGranted,
|
|
235
|
+
pending: pending === `submit:${block.id}`,
|
|
236
|
+
onPress: () => act({
|
|
237
|
+
id: `submit:${block.id}`,
|
|
238
|
+
type: 'submit_contact',
|
|
239
|
+
label: block.submitLabel,
|
|
240
|
+
module: block.module,
|
|
241
|
+
payload: Object.fromEntries(block.fields.map(field => [field.name, values[`${block.id}:${field.name}`] || field.value || '']))
|
|
242
|
+
}),
|
|
243
|
+
children: block.submitLabel
|
|
244
|
+
})
|
|
245
|
+
})]
|
|
246
|
+
}, block.id);
|
|
247
|
+
}
|
|
248
|
+
if (block.type === 'consent') {
|
|
249
|
+
const checked = consents[block.id] || false;
|
|
250
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
251
|
+
style: [styles.card, styles.cardPadded],
|
|
252
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
253
|
+
onPress: () => setConsents(current => ({
|
|
254
|
+
...current,
|
|
255
|
+
[block.id]: !checked
|
|
256
|
+
})),
|
|
257
|
+
accessibilityRole: "checkbox",
|
|
258
|
+
accessibilityState: {
|
|
259
|
+
checked
|
|
260
|
+
},
|
|
261
|
+
style: styles.consentRow,
|
|
262
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
263
|
+
style: [styles.checkbox, checked && {
|
|
264
|
+
backgroundColor: color,
|
|
265
|
+
borderColor: color
|
|
266
|
+
}],
|
|
267
|
+
children: checked ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
268
|
+
style: styles.checkmark,
|
|
269
|
+
children: "\u2713"
|
|
270
|
+
}) : null
|
|
271
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
272
|
+
style: styles.consentText,
|
|
273
|
+
children: block.statement
|
|
274
|
+
})]
|
|
275
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
276
|
+
style: [styles.row, styles.blockAction],
|
|
277
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
278
|
+
style: styles.chipRow,
|
|
279
|
+
children: block.channels.map(channel => /*#__PURE__*/(0, _jsxRuntime.jsx)(Badge, {
|
|
280
|
+
label: channel
|
|
281
|
+
}, channel))
|
|
282
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
283
|
+
disabled: !checked || pending !== null,
|
|
284
|
+
onPress: () => act({
|
|
285
|
+
id: `consent:${block.id}`,
|
|
286
|
+
type: 'record_consent',
|
|
287
|
+
label: 'Save consent',
|
|
288
|
+
module: 'contacts',
|
|
289
|
+
payload: {
|
|
290
|
+
channels: block.channels,
|
|
291
|
+
consent: true,
|
|
292
|
+
statement: block.statement
|
|
293
|
+
}
|
|
294
|
+
}),
|
|
295
|
+
hitSlop: 8,
|
|
296
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
297
|
+
style: [styles.linkButton, {
|
|
298
|
+
color: checked ? color : _theme.palette.textSubtle
|
|
299
|
+
}],
|
|
300
|
+
children: "Save"
|
|
301
|
+
})
|
|
302
|
+
})]
|
|
303
|
+
})]
|
|
304
|
+
}, block.id);
|
|
305
|
+
}
|
|
306
|
+
if (block.type === 'appointment_slot_picker') {
|
|
307
|
+
const selected = selectedSlots[block.id] || '';
|
|
308
|
+
const selectedSlot = block.days.flatMap(day => day.slots.map(slot => ({
|
|
309
|
+
...slot,
|
|
310
|
+
date: day.date
|
|
311
|
+
}))).find(slot => `${slot.date}:${slot.startTime}` === selected);
|
|
312
|
+
const providerById = new Map(block.providers.map(provider => [provider.id, provider]));
|
|
313
|
+
const selectedProvider = selectedSlot?.staffUserId ? providerById.get(selectedSlot.staffUserId) : undefined;
|
|
314
|
+
const activeProviderId = block.selectedProviderId || 'any';
|
|
315
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
316
|
+
style: [styles.card, styles.cardPadded],
|
|
317
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
318
|
+
style: styles.title,
|
|
319
|
+
children: labels.chooseTime
|
|
320
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
321
|
+
style: styles.description,
|
|
322
|
+
children: [block.serviceName, " \xB7 ", block.durationMinutes, " min", block.timezone ? ` · ${block.timezone}` : '']
|
|
323
|
+
}), block.providers.length > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
324
|
+
style: styles.section,
|
|
325
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
326
|
+
style: styles.sectionLabel,
|
|
327
|
+
children: labels.professional
|
|
328
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
329
|
+
style: styles.chipRow,
|
|
330
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Chip, {
|
|
331
|
+
selected: activeProviderId === 'any',
|
|
332
|
+
color: color,
|
|
333
|
+
disabled: pending !== null,
|
|
334
|
+
label: "Any available",
|
|
335
|
+
onPress: () => activeProviderId !== 'any' && act({
|
|
336
|
+
id: `provider:${block.serviceId}:any`,
|
|
337
|
+
type: 'select_appointment_provider',
|
|
338
|
+
label: 'Choose any professional',
|
|
339
|
+
module: 'appointments',
|
|
340
|
+
payload: {
|
|
341
|
+
serviceId: block.serviceId,
|
|
342
|
+
serviceName: block.serviceName,
|
|
343
|
+
durationMinutes: block.durationMinutes,
|
|
344
|
+
locationId: block.locationId,
|
|
345
|
+
providerName: 'any available professional'
|
|
346
|
+
}
|
|
347
|
+
})
|
|
348
|
+
}), block.providers.map(provider => /*#__PURE__*/(0, _jsxRuntime.jsx)(Chip, {
|
|
349
|
+
selected: activeProviderId === provider.id,
|
|
350
|
+
color: color,
|
|
351
|
+
disabled: pending !== null,
|
|
352
|
+
label: provider.name,
|
|
353
|
+
onPress: () => activeProviderId !== provider.id && act({
|
|
354
|
+
id: `provider:${block.serviceId}:${provider.id}`,
|
|
355
|
+
type: 'select_appointment_provider',
|
|
356
|
+
label: `Choose ${provider.name}`,
|
|
357
|
+
module: 'appointments',
|
|
358
|
+
payload: {
|
|
359
|
+
serviceId: block.serviceId,
|
|
360
|
+
serviceName: block.serviceName,
|
|
361
|
+
durationMinutes: block.durationMinutes,
|
|
362
|
+
locationId: block.locationId,
|
|
363
|
+
providerId: provider.id,
|
|
364
|
+
providerName: provider.name
|
|
365
|
+
}
|
|
366
|
+
})
|
|
367
|
+
}, provider.id))]
|
|
368
|
+
})]
|
|
369
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
370
|
+
style: styles.section,
|
|
371
|
+
children: block.days.map(day => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
372
|
+
style: styles.day,
|
|
373
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
374
|
+
style: styles.sectionLabel,
|
|
375
|
+
children: formatDate(day.date)
|
|
376
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
377
|
+
style: styles.chipRow,
|
|
378
|
+
children: day.slots.map(slot => {
|
|
379
|
+
const value = `${day.date}:${slot.startTime}`;
|
|
380
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Chip, {
|
|
381
|
+
selected: selected === value,
|
|
382
|
+
color: color,
|
|
383
|
+
label: formatTime(slot.startTime),
|
|
384
|
+
onPress: () => setSelectedSlots(current => ({
|
|
385
|
+
...current,
|
|
386
|
+
[block.id]: value
|
|
387
|
+
}))
|
|
388
|
+
}, value);
|
|
389
|
+
})
|
|
390
|
+
})]
|
|
391
|
+
}, day.date))
|
|
392
|
+
}), selectedProvider ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
393
|
+
style: [styles.muted, styles.blockAction],
|
|
394
|
+
children: ["With ", selectedProvider.name]
|
|
395
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
396
|
+
style: styles.blockAction,
|
|
397
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionButton, {
|
|
398
|
+
color: color,
|
|
399
|
+
disabled: !selectedSlot,
|
|
400
|
+
pending: pending?.startsWith(`book:${block.serviceId}`) || false,
|
|
401
|
+
onPress: () => selectedSlot && act({
|
|
402
|
+
id: `book:${block.serviceId}:${selected}`,
|
|
403
|
+
type: 'select_appointment_slot',
|
|
404
|
+
label: 'Book this time',
|
|
405
|
+
module: 'appointments',
|
|
406
|
+
payload: {
|
|
407
|
+
serviceId: block.serviceId,
|
|
408
|
+
serviceName: block.serviceName,
|
|
409
|
+
durationMinutes: block.durationMinutes,
|
|
410
|
+
date: selectedSlot.date,
|
|
411
|
+
startTime: selectedSlot.startTime,
|
|
412
|
+
endTime: selectedSlot.endTime,
|
|
413
|
+
userId: selectedSlot.staffUserId,
|
|
414
|
+
slotToken: selectedSlot.slotToken,
|
|
415
|
+
providerName: selectedProvider?.name
|
|
416
|
+
}
|
|
417
|
+
}),
|
|
418
|
+
children: "Book this time"
|
|
419
|
+
})
|
|
420
|
+
})]
|
|
421
|
+
}, block.id);
|
|
422
|
+
}
|
|
423
|
+
if (block.type === 'quote_preview') {
|
|
424
|
+
const publicActions = block.actions.filter(action => action.type !== 'open_record');
|
|
425
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
426
|
+
style: [styles.card, styles.cardPadded],
|
|
427
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
428
|
+
style: styles.rowStart,
|
|
429
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
430
|
+
style: styles.flexMin,
|
|
431
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
432
|
+
style: styles.title,
|
|
433
|
+
children: block.name
|
|
434
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
435
|
+
style: styles.description,
|
|
436
|
+
children: [block.serialNumber || labels.priceOffer, block.contactName ? ` · ${block.contactName}` : '']
|
|
437
|
+
})]
|
|
438
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Badge, {
|
|
439
|
+
label: block.status
|
|
440
|
+
})]
|
|
441
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
442
|
+
style: styles.amount,
|
|
443
|
+
children: formatMoney(block.amount, block.currency)
|
|
444
|
+
}), block.validUntil ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
445
|
+
style: styles.muted,
|
|
446
|
+
children: ["Valid until ", formatDate(block.validUntil.slice(0, 10))]
|
|
447
|
+
}) : null, publicActions.map(action => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
448
|
+
style: styles.blockAction,
|
|
449
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionButton, {
|
|
450
|
+
color: color,
|
|
451
|
+
pending: pending === action.id,
|
|
452
|
+
onPress: () => act(action),
|
|
453
|
+
children: action.label
|
|
454
|
+
})
|
|
455
|
+
}, action.id))]
|
|
456
|
+
}, block.id);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// success_receipt
|
|
460
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
461
|
+
style: [styles.card, styles.cardPadded],
|
|
462
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
463
|
+
style: styles.rowStart,
|
|
464
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
465
|
+
style: [styles.checkGlyph, {
|
|
466
|
+
color
|
|
467
|
+
}],
|
|
468
|
+
children: "\u2713"
|
|
469
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
470
|
+
style: styles.flexMin,
|
|
471
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
472
|
+
style: styles.title,
|
|
473
|
+
children: block.title
|
|
474
|
+
}), block.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
475
|
+
style: styles.description,
|
|
476
|
+
children: block.description
|
|
477
|
+
}) : null]
|
|
478
|
+
})]
|
|
479
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
480
|
+
style: [styles.row, styles.blockAction],
|
|
481
|
+
children: [block.reference ? /*#__PURE__*/(0, _jsxRuntime.jsx)(Badge, {
|
|
482
|
+
label: block.reference
|
|
483
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {}), block.amount != null && block.currency ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
484
|
+
style: styles.itemTotal,
|
|
485
|
+
children: formatMoney(block.amount, block.currency)
|
|
486
|
+
}) : null]
|
|
487
|
+
}), block.nextActions.filter(action => action.type !== 'open_record').map(action => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
488
|
+
style: styles.blockAction,
|
|
489
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ActionButton, {
|
|
490
|
+
color: color,
|
|
491
|
+
pending: pending === action.id,
|
|
492
|
+
onPress: () => act(action),
|
|
493
|
+
children: action.label
|
|
494
|
+
})
|
|
495
|
+
}, action.id))]
|
|
496
|
+
}, block.id);
|
|
497
|
+
})
|
|
498
|
+
})
|
|
499
|
+
});
|
|
500
|
+
}
|
|
501
|
+
function ActionButton({
|
|
502
|
+
children,
|
|
503
|
+
color,
|
|
504
|
+
secondary = false,
|
|
505
|
+
pending = false,
|
|
506
|
+
disabled = false,
|
|
507
|
+
onPress
|
|
508
|
+
}) {
|
|
509
|
+
const labels = (0, _react.useContext)(BlockLabelContext);
|
|
510
|
+
const inactive = disabled || pending;
|
|
511
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
512
|
+
disabled: inactive,
|
|
513
|
+
onPress: onPress,
|
|
514
|
+
accessibilityRole: "button",
|
|
515
|
+
style: ({
|
|
516
|
+
pressed
|
|
517
|
+
}) => [styles.actionButton, secondary ? {
|
|
518
|
+
borderColor: color,
|
|
519
|
+
backgroundColor: _theme.palette.white
|
|
520
|
+
} : {
|
|
521
|
+
backgroundColor: color
|
|
522
|
+
}, inactive && styles.actionButtonDisabled, pressed && styles.pressed],
|
|
523
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
524
|
+
style: [styles.actionButtonLabel, {
|
|
525
|
+
color: inactive ? _theme.palette.white : secondary ? color : _theme.palette.white
|
|
526
|
+
}],
|
|
527
|
+
children: pending ? labels.working : children
|
|
528
|
+
})
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
function Chip({
|
|
532
|
+
label,
|
|
533
|
+
sublabel,
|
|
534
|
+
selected,
|
|
535
|
+
disabled = false,
|
|
536
|
+
color,
|
|
537
|
+
onPress
|
|
538
|
+
}) {
|
|
539
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
|
|
540
|
+
disabled: disabled,
|
|
541
|
+
onPress: onPress,
|
|
542
|
+
accessibilityRole: "button",
|
|
543
|
+
accessibilityState: {
|
|
544
|
+
selected,
|
|
545
|
+
disabled
|
|
546
|
+
},
|
|
547
|
+
style: [styles.chip, {
|
|
548
|
+
borderColor: selected ? color : _theme.palette.disabled,
|
|
549
|
+
backgroundColor: selected ? (0, _theme.withAlpha)(color, 0.07) : _theme.palette.white
|
|
550
|
+
}, disabled && styles.chipDisabled],
|
|
551
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
552
|
+
style: [styles.chipLabel, {
|
|
553
|
+
color: selected ? color : '#374151'
|
|
554
|
+
}],
|
|
555
|
+
children: label
|
|
556
|
+
}), sublabel ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
557
|
+
style: styles.chipSublabel,
|
|
558
|
+
children: sublabel
|
|
559
|
+
}) : null]
|
|
560
|
+
});
|
|
561
|
+
}
|
|
562
|
+
function Badge({
|
|
563
|
+
label
|
|
564
|
+
}) {
|
|
565
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
566
|
+
style: styles.badge,
|
|
567
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
568
|
+
style: styles.badgeLabel,
|
|
569
|
+
numberOfLines: 1,
|
|
570
|
+
children: label
|
|
571
|
+
})
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
function MoneyRow({
|
|
575
|
+
label,
|
|
576
|
+
value,
|
|
577
|
+
strong = false
|
|
578
|
+
}) {
|
|
579
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
580
|
+
style: styles.row,
|
|
581
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
582
|
+
style: [styles.moneyLabel, strong && styles.moneyStrong],
|
|
583
|
+
children: label
|
|
584
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
585
|
+
style: [styles.moneyLabel, strong && styles.moneyStrong],
|
|
586
|
+
children: value
|
|
587
|
+
})]
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
function keyboardTypeFor(type) {
|
|
591
|
+
if (type === 'email') return 'email-address';
|
|
592
|
+
if (type === 'phone') return 'phone-pad';
|
|
593
|
+
return 'default';
|
|
594
|
+
}
|
|
595
|
+
function formatMoney(amount, currency) {
|
|
596
|
+
// Blocks are validated upstream; this is the last line against a bad value.
|
|
597
|
+
const value = typeof amount === 'number' && Number.isFinite(amount) ? amount : 0;
|
|
598
|
+
try {
|
|
599
|
+
return new Intl.NumberFormat(undefined, {
|
|
600
|
+
style: 'currency',
|
|
601
|
+
currency
|
|
602
|
+
}).format(value);
|
|
603
|
+
} catch {
|
|
604
|
+
return `${value.toFixed(2)} ${currency ?? ''}`.trim();
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
function formatDate(date) {
|
|
608
|
+
const parsed = new Date(`${date}T12:00:00`);
|
|
609
|
+
if (Number.isNaN(parsed.getTime())) return date;
|
|
610
|
+
try {
|
|
611
|
+
return new Intl.DateTimeFormat(undefined, {
|
|
612
|
+
weekday: 'short',
|
|
613
|
+
month: 'short',
|
|
614
|
+
day: 'numeric'
|
|
615
|
+
}).format(parsed);
|
|
616
|
+
} catch {
|
|
617
|
+
return date;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
function formatTime(time) {
|
|
621
|
+
const [hour, minute] = time.split(':').map(Number);
|
|
622
|
+
try {
|
|
623
|
+
return new Intl.DateTimeFormat(undefined, {
|
|
624
|
+
hour: 'numeric',
|
|
625
|
+
minute: '2-digit'
|
|
626
|
+
}).format(new Date(2000, 0, 1, hour ?? 0, minute ?? 0));
|
|
627
|
+
} catch {
|
|
628
|
+
return time;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
const cardStyle = {
|
|
632
|
+
overflow: 'hidden',
|
|
633
|
+
borderWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
634
|
+
borderColor: _theme.palette.border,
|
|
635
|
+
borderRadius: _theme.radius.xl,
|
|
636
|
+
backgroundColor: _theme.palette.white,
|
|
637
|
+
..._theme.shadows.card
|
|
638
|
+
};
|
|
639
|
+
const styles = _reactNative.StyleSheet.create({
|
|
640
|
+
stack: {
|
|
641
|
+
width: '100%',
|
|
642
|
+
maxWidth: 350,
|
|
643
|
+
gap: _theme.spacing.sm,
|
|
644
|
+
marginTop: _theme.spacing.sm
|
|
645
|
+
},
|
|
646
|
+
card: cardStyle,
|
|
647
|
+
cardPadded: {
|
|
648
|
+
padding: _theme.spacing.md
|
|
649
|
+
},
|
|
650
|
+
cardBody: {
|
|
651
|
+
gap: _theme.spacing.sm + 2,
|
|
652
|
+
padding: _theme.spacing.md
|
|
653
|
+
},
|
|
654
|
+
cardImage: {
|
|
655
|
+
width: '100%',
|
|
656
|
+
aspectRatio: 16 / 7
|
|
657
|
+
},
|
|
658
|
+
row: {
|
|
659
|
+
flexDirection: 'row',
|
|
660
|
+
alignItems: 'center',
|
|
661
|
+
justifyContent: 'space-between',
|
|
662
|
+
gap: _theme.spacing.sm + 2
|
|
663
|
+
},
|
|
664
|
+
rowStart: {
|
|
665
|
+
flexDirection: 'row',
|
|
666
|
+
alignItems: 'flex-start',
|
|
667
|
+
justifyContent: 'space-between',
|
|
668
|
+
gap: _theme.spacing.sm + 2
|
|
669
|
+
},
|
|
670
|
+
flexMin: {
|
|
671
|
+
flex: 1,
|
|
672
|
+
minWidth: 0
|
|
673
|
+
},
|
|
674
|
+
title: {
|
|
675
|
+
fontSize: _theme.fontSize.body,
|
|
676
|
+
lineHeight: _theme.fontSize.body * 1.3,
|
|
677
|
+
fontWeight: '600',
|
|
678
|
+
color: _theme.palette.text
|
|
679
|
+
},
|
|
680
|
+
description: {
|
|
681
|
+
fontSize: _theme.fontSize.meta,
|
|
682
|
+
lineHeight: _theme.fontSize.meta * 1.45,
|
|
683
|
+
color: _theme.palette.textMuted,
|
|
684
|
+
marginTop: 3
|
|
685
|
+
},
|
|
686
|
+
muted: {
|
|
687
|
+
fontSize: _theme.fontSize.caption,
|
|
688
|
+
color: _theme.palette.textMuted
|
|
689
|
+
},
|
|
690
|
+
price: {
|
|
691
|
+
fontSize: _theme.fontSize.title,
|
|
692
|
+
fontWeight: '600',
|
|
693
|
+
color: _theme.palette.text
|
|
694
|
+
},
|
|
695
|
+
amount: {
|
|
696
|
+
fontSize: _theme.fontSize.heading,
|
|
697
|
+
fontWeight: '700',
|
|
698
|
+
color: _theme.palette.text,
|
|
699
|
+
marginTop: _theme.spacing.sm + 2
|
|
700
|
+
},
|
|
701
|
+
badge: {
|
|
702
|
+
borderWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
703
|
+
borderColor: _theme.palette.border,
|
|
704
|
+
borderRadius: _theme.radius.pill,
|
|
705
|
+
paddingHorizontal: 7,
|
|
706
|
+
paddingVertical: 3,
|
|
707
|
+
backgroundColor: _theme.palette.surface
|
|
708
|
+
},
|
|
709
|
+
badgeLabel: {
|
|
710
|
+
fontSize: _theme.fontSize.caption - 1,
|
|
711
|
+
color: '#4b5563'
|
|
712
|
+
},
|
|
713
|
+
chipRow: {
|
|
714
|
+
flexDirection: 'row',
|
|
715
|
+
flexWrap: 'wrap',
|
|
716
|
+
gap: _theme.spacing.xs + 2,
|
|
717
|
+
marginTop: _theme.spacing.sm
|
|
718
|
+
},
|
|
719
|
+
chip: {
|
|
720
|
+
borderWidth: 1,
|
|
721
|
+
borderRadius: _theme.radius.md,
|
|
722
|
+
paddingHorizontal: _theme.spacing.md,
|
|
723
|
+
paddingVertical: _theme.spacing.sm,
|
|
724
|
+
minHeight: 40,
|
|
725
|
+
justifyContent: 'center'
|
|
726
|
+
},
|
|
727
|
+
chipDisabled: {
|
|
728
|
+
opacity: 0.45
|
|
729
|
+
},
|
|
730
|
+
chipLabel: {
|
|
731
|
+
fontSize: _theme.fontSize.meta,
|
|
732
|
+
fontWeight: '600'
|
|
733
|
+
},
|
|
734
|
+
chipSublabel: {
|
|
735
|
+
fontSize: _theme.fontSize.caption - 1,
|
|
736
|
+
opacity: 0.75,
|
|
737
|
+
marginTop: 2
|
|
738
|
+
},
|
|
739
|
+
actionRow: {
|
|
740
|
+
flexDirection: 'row',
|
|
741
|
+
gap: _theme.spacing.sm
|
|
742
|
+
},
|
|
743
|
+
actionCell: {
|
|
744
|
+
flex: 1
|
|
745
|
+
},
|
|
746
|
+
actionButton: {
|
|
747
|
+
width: '100%',
|
|
748
|
+
borderWidth: 1,
|
|
749
|
+
borderColor: 'transparent',
|
|
750
|
+
borderRadius: _theme.radius.md,
|
|
751
|
+
paddingVertical: _theme.spacing.md,
|
|
752
|
+
paddingHorizontal: _theme.spacing.md,
|
|
753
|
+
alignItems: 'center',
|
|
754
|
+
justifyContent: 'center',
|
|
755
|
+
minHeight: 44
|
|
756
|
+
},
|
|
757
|
+
actionButtonDisabled: {
|
|
758
|
+
backgroundColor: _theme.palette.disabled,
|
|
759
|
+
borderColor: _theme.palette.disabled
|
|
760
|
+
},
|
|
761
|
+
actionButtonLabel: {
|
|
762
|
+
fontSize: _theme.fontSize.meta,
|
|
763
|
+
fontWeight: '600'
|
|
764
|
+
},
|
|
765
|
+
pressed: {
|
|
766
|
+
opacity: 0.85
|
|
767
|
+
},
|
|
768
|
+
blockAction: {
|
|
769
|
+
marginTop: _theme.spacing.sm + 2
|
|
770
|
+
},
|
|
771
|
+
itemList: {
|
|
772
|
+
gap: _theme.spacing.sm,
|
|
773
|
+
marginTop: _theme.spacing.sm + 2
|
|
774
|
+
},
|
|
775
|
+
itemName: {
|
|
776
|
+
fontSize: _theme.fontSize.meta,
|
|
777
|
+
fontWeight: '600',
|
|
778
|
+
color: _theme.palette.text
|
|
779
|
+
},
|
|
780
|
+
itemTotal: {
|
|
781
|
+
fontSize: _theme.fontSize.meta,
|
|
782
|
+
fontWeight: '600',
|
|
783
|
+
color: _theme.palette.text
|
|
784
|
+
},
|
|
785
|
+
totals: {
|
|
786
|
+
borderTopWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
787
|
+
borderTopColor: _theme.palette.border,
|
|
788
|
+
marginTop: _theme.spacing.sm + 2,
|
|
789
|
+
paddingTop: _theme.spacing.sm + 2,
|
|
790
|
+
gap: 5
|
|
791
|
+
},
|
|
792
|
+
moneyLabel: {
|
|
793
|
+
fontSize: _theme.fontSize.meta,
|
|
794
|
+
color: _theme.palette.text
|
|
795
|
+
},
|
|
796
|
+
moneyStrong: {
|
|
797
|
+
fontWeight: '700'
|
|
798
|
+
},
|
|
799
|
+
fieldStack: {
|
|
800
|
+
gap: _theme.spacing.sm,
|
|
801
|
+
marginTop: _theme.spacing.sm + 2
|
|
802
|
+
},
|
|
803
|
+
input: {
|
|
804
|
+
borderWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
805
|
+
borderColor: _theme.palette.disabled,
|
|
806
|
+
borderRadius: _theme.radius.md,
|
|
807
|
+
paddingHorizontal: _theme.spacing.md,
|
|
808
|
+
paddingVertical: _theme.spacing.sm + 2,
|
|
809
|
+
fontSize: _theme.fontSize.input,
|
|
810
|
+
color: _theme.palette.text,
|
|
811
|
+
backgroundColor: _theme.palette.white,
|
|
812
|
+
minHeight: 44
|
|
813
|
+
},
|
|
814
|
+
textarea: {
|
|
815
|
+
minHeight: 84,
|
|
816
|
+
textAlignVertical: 'top'
|
|
817
|
+
},
|
|
818
|
+
consentRow: {
|
|
819
|
+
flexDirection: 'row',
|
|
820
|
+
alignItems: 'flex-start',
|
|
821
|
+
gap: _theme.spacing.sm
|
|
822
|
+
},
|
|
823
|
+
checkbox: {
|
|
824
|
+
width: 22,
|
|
825
|
+
height: 22,
|
|
826
|
+
borderRadius: 6,
|
|
827
|
+
borderWidth: 1.5,
|
|
828
|
+
borderColor: _theme.palette.disabled,
|
|
829
|
+
alignItems: 'center',
|
|
830
|
+
justifyContent: 'center'
|
|
831
|
+
},
|
|
832
|
+
checkmark: {
|
|
833
|
+
color: _theme.palette.white,
|
|
834
|
+
fontSize: _theme.fontSize.meta,
|
|
835
|
+
fontWeight: '700'
|
|
836
|
+
},
|
|
837
|
+
consentText: {
|
|
838
|
+
flex: 1,
|
|
839
|
+
fontSize: _theme.fontSize.meta,
|
|
840
|
+
lineHeight: _theme.fontSize.meta * 1.45,
|
|
841
|
+
color: _theme.palette.text
|
|
842
|
+
},
|
|
843
|
+
linkButton: {
|
|
844
|
+
fontSize: _theme.fontSize.meta,
|
|
845
|
+
fontWeight: '600',
|
|
846
|
+
padding: _theme.spacing.xs
|
|
847
|
+
},
|
|
848
|
+
section: {
|
|
849
|
+
marginTop: _theme.spacing.sm + 2
|
|
850
|
+
},
|
|
851
|
+
sectionLabel: {
|
|
852
|
+
fontSize: _theme.fontSize.caption,
|
|
853
|
+
fontWeight: '600',
|
|
854
|
+
color: _theme.palette.text
|
|
855
|
+
},
|
|
856
|
+
day: {
|
|
857
|
+
marginTop: _theme.spacing.sm + 2
|
|
858
|
+
},
|
|
859
|
+
checkGlyph: {
|
|
860
|
+
fontSize: _theme.fontSize.title,
|
|
861
|
+
fontWeight: '700'
|
|
862
|
+
}
|
|
863
|
+
});
|
|
864
|
+
//# sourceMappingURL=AgentUiBlocks.js.map
|