@teamvortexsoftware/vortex-react-native 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/InviteFormCore-D4HkMMo0.d.mts +721 -0
- package/dist/InviteFormCore-D9oUCbu7.d.ts +721 -0
- package/dist/VortexClient.js +192 -0
- package/dist/VortexClient.js.map +1 -0
- package/dist/VortexDeferredLinks.js +127 -0
- package/dist/VortexDeferredLinks.js.map +1 -0
- package/dist/clientInfo.js +45 -0
- package/dist/clientInfo.js.map +1 -0
- package/dist/components/ContactsPickerModal.js +182 -0
- package/dist/components/ContactsPickerModal.js.map +1 -0
- package/dist/components/InviteFormCore.js +2141 -0
- package/dist/components/InviteFormCore.js.map +1 -0
- package/dist/components/InviteFormMobile.js +463 -0
- package/dist/components/InviteFormMobile.js.map +1 -0
- package/dist/components/InviteFormWeb.js +295 -0
- package/dist/components/InviteFormWeb.js.map +1 -0
- package/dist/components/PlacedItemToolbar.js +147 -0
- package/dist/components/PlacedItemToolbar.js.map +1 -0
- package/dist/components/ShareButtons.js +181 -0
- package/dist/components/ShareButtons.js.map +1 -0
- package/dist/components/VrtxContactsImport.js +234 -0
- package/dist/components/VrtxContactsImport.js.map +1 -0
- package/dist/components/VrtxEmailInvitations.js +341 -0
- package/dist/components/VrtxEmailInvitations.js.map +1 -0
- package/dist/components/VrtxFindFriends.js +400 -0
- package/dist/components/VrtxFindFriends.js.map +1 -0
- package/dist/components/VrtxHeading.js +58 -0
- package/dist/components/VrtxHeading.js.map +1 -0
- package/dist/components/VrtxIncomingInvitations.js +657 -0
- package/dist/components/VrtxIncomingInvitations.js.map +1 -0
- package/dist/components/VrtxInvitationSuggestions.js +506 -0
- package/dist/components/VrtxInvitationSuggestions.js.map +1 -0
- package/dist/components/VrtxInviteContacts.js +512 -0
- package/dist/components/VrtxInviteContacts.js.map +1 -0
- package/dist/components/VrtxOutgoingInvitations.js +572 -0
- package/dist/components/VrtxOutgoingInvitations.js.map +1 -0
- package/dist/components/VrtxSearchBox.js +487 -0
- package/dist/components/VrtxSearchBox.js.map +1 -0
- package/dist/components/VrtxSelect.js +27 -0
- package/dist/components/VrtxSelect.js.map +1 -0
- package/dist/components/VrtxShareOptions.js +435 -0
- package/dist/components/VrtxShareOptions.js.map +1 -0
- package/dist/components/VrtxSubmit.js +132 -0
- package/dist/components/VrtxSubmit.js.map +1 -0
- package/dist/components/VrtxText.js +146 -0
- package/dist/components/VrtxText.js.map +1 -0
- package/dist/constants/mockData.d.mts +7 -0
- package/dist/constants/mockData.d.ts +7 -0
- package/dist/constants/mockData.js +48 -0
- package/dist/constants/mockData.js.map +1 -0
- package/dist/constants/mockData.mjs +22 -0
- package/dist/constants/mockData.mjs.map +1 -0
- package/dist/context/VortexModulesContext.js +135 -0
- package/dist/context/VortexModulesContext.js.map +1 -0
- package/dist/hooks/useInvitationFormLogic.d.mts +2 -0
- package/dist/hooks/useInvitationFormLogic.d.ts +2 -0
- package/dist/hooks/useInvitationFormLogic.js +300 -0
- package/dist/hooks/useInvitationFormLogic.js.map +1 -0
- package/dist/hooks/useInvitationFormLogic.mjs +276 -0
- package/dist/hooks/useInvitationFormLogic.mjs.map +1 -0
- package/dist/hooks/usePrefetchWidgetConfiguration.js +117 -0
- package/dist/hooks/usePrefetchWidgetConfiguration.js.map +1 -0
- package/dist/hooks/useThemeStyles.js +41 -0
- package/dist/hooks/useThemeStyles.js.map +1 -0
- package/dist/hooks/useVortexInvite.js +732 -0
- package/dist/hooks/useVortexInvite.js.map +1 -0
- package/dist/index-web.d.mts +93 -0
- package/dist/index-web.d.ts +93 -0
- package/dist/index-web.js +7397 -0
- package/dist/index-web.js.map +1 -0
- package/dist/index-web.mjs +7445 -0
- package/dist/index-web.mjs.map +1 -0
- package/dist/index.d.mts +656 -0
- package/dist/index.d.ts +656 -0
- package/dist/index.js +10206 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +10244 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/VortexClient.d.ts +106 -0
- package/dist/types/VortexClient.d.ts.map +1 -0
- package/dist/types/VortexDeferredLinks.d.ts +73 -0
- package/dist/types/VortexDeferredLinks.d.ts.map +1 -0
- package/dist/types/clientInfo.d.ts +5 -0
- package/dist/types/clientInfo.d.ts.map +1 -0
- package/dist/types/components/ContactsPickerModal.d.ts +18 -0
- package/dist/types/components/ContactsPickerModal.d.ts.map +1 -0
- package/dist/types/components/InviteFormCore.d.ts +166 -0
- package/dist/types/components/InviteFormCore.d.ts.map +1 -0
- package/dist/types/components/InviteFormMobile.d.ts +42 -0
- package/dist/types/components/InviteFormMobile.d.ts.map +1 -0
- package/dist/types/components/InviteFormWeb.d.ts +87 -0
- package/dist/types/components/InviteFormWeb.d.ts.map +1 -0
- package/dist/types/components/PlacedItemToolbar.d.ts +16 -0
- package/dist/types/components/PlacedItemToolbar.d.ts.map +1 -0
- package/dist/types/components/ShareButtons.d.ts +29 -0
- package/dist/types/components/ShareButtons.d.ts.map +1 -0
- package/dist/types/components/VrtxContactsImport.d.ts +14 -0
- package/dist/types/components/VrtxContactsImport.d.ts.map +1 -0
- package/dist/types/components/VrtxEmailInvitations.d.ts +31 -0
- package/dist/types/components/VrtxEmailInvitations.d.ts.map +1 -0
- package/dist/types/components/VrtxFindFriends.d.ts +25 -0
- package/dist/types/components/VrtxFindFriends.d.ts.map +1 -0
- package/dist/types/components/VrtxHeading.d.ts +6 -0
- package/dist/types/components/VrtxHeading.d.ts.map +1 -0
- package/dist/types/components/VrtxIncomingInvitations.d.ts +27 -0
- package/dist/types/components/VrtxIncomingInvitations.d.ts.map +1 -0
- package/dist/types/components/VrtxInvitationSuggestions.d.ts +25 -0
- package/dist/types/components/VrtxInvitationSuggestions.d.ts.map +1 -0
- package/dist/types/components/VrtxInviteContacts.d.ts +24 -0
- package/dist/types/components/VrtxInviteContacts.d.ts.map +1 -0
- package/dist/types/components/VrtxOutgoingInvitations.d.ts +27 -0
- package/dist/types/components/VrtxOutgoingInvitations.d.ts.map +1 -0
- package/dist/types/components/VrtxSearchBox.d.ts +28 -0
- package/dist/types/components/VrtxSearchBox.d.ts.map +1 -0
- package/dist/types/components/VrtxSelect.d.ts +6 -0
- package/dist/types/components/VrtxSelect.d.ts.map +1 -0
- package/dist/types/components/VrtxShareOptions.d.ts +41 -0
- package/dist/types/components/VrtxShareOptions.d.ts.map +1 -0
- package/dist/types/components/VrtxSubmit.d.ts +18 -0
- package/dist/types/components/VrtxSubmit.d.ts.map +1 -0
- package/dist/types/components/VrtxText.d.ts +8 -0
- package/dist/types/components/VrtxText.d.ts.map +1 -0
- package/dist/types/constants/mockData.d.ts +4 -0
- package/dist/types/constants/mockData.d.ts.map +1 -0
- package/dist/types/context/VortexModulesContext.d.ts +238 -0
- package/dist/types/context/VortexModulesContext.d.ts.map +1 -0
- package/dist/types/findFriends.js +10 -0
- package/dist/types/findFriends.js.map +1 -0
- package/dist/types/hooks/useInvitationFormLogic.d.ts +55 -0
- package/dist/types/hooks/useInvitationFormLogic.d.ts.map +1 -0
- package/dist/types/hooks/usePrefetchWidgetConfiguration.d.ts +39 -0
- package/dist/types/hooks/usePrefetchWidgetConfiguration.d.ts.map +1 -0
- package/dist/types/hooks/useThemeStyles.d.ts +35 -0
- package/dist/types/hooks/useThemeStyles.d.ts.map +1 -0
- package/dist/types/hooks/useVortexInvite.d.ts +86 -0
- package/dist/types/hooks/useVortexInvite.d.ts.map +1 -0
- package/dist/types/index-web.d.ts +23 -0
- package/dist/types/index-web.d.ts.map +1 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/invitations.js +13 -0
- package/dist/types/invitations.js.map +1 -0
- package/dist/types/inviteContacts.js +14 -0
- package/dist/types/inviteContacts.js.map +1 -0
- package/dist/types/platformOperations.js +3 -0
- package/dist/types/platformOperations.js.map +1 -0
- package/dist/types/searchBox.js +11 -0
- package/dist/types/searchBox.js.map +1 -0
- package/dist/types/types/findFriends.d.ts +101 -0
- package/dist/types/types/findFriends.d.ts.map +1 -0
- package/dist/types/types/invitations.d.ts +301 -0
- package/dist/types/types/invitations.d.ts.map +1 -0
- package/dist/types/types/inviteContacts.d.ts +86 -0
- package/dist/types/types/inviteContacts.d.ts.map +1 -0
- package/dist/types/types/platformOperations.d.ts +185 -0
- package/dist/types/types/platformOperations.d.ts.map +1 -0
- package/dist/types/types/searchBox.d.ts +69 -0
- package/dist/types/types/searchBox.d.ts.map +1 -0
- package/dist/types/types/unfurlConfig.d.ts +34 -0
- package/dist/types/types/unfurlConfig.d.ts.map +1 -0
- package/dist/types/unfurlConfig.js +21 -0
- package/dist/types/unfurlConfig.js.map +1 -0
- package/dist/types/utils/analytics.d.ts +54 -0
- package/dist/types/utils/analytics.d.ts.map +1 -0
- package/dist/types/utils/configCache.d.ts +34 -0
- package/dist/types/utils/configCache.d.ts.map +1 -0
- package/dist/types/utils/contactUtils.d.ts +9 -0
- package/dist/types/utils/contactUtils.d.ts.map +1 -0
- package/dist/types/utils/featureWarnings.d.ts +56 -0
- package/dist/types/utils/featureWarnings.d.ts.map +1 -0
- package/dist/types/utils/formUtils.d.ts +93 -0
- package/dist/types/utils/formUtils.d.ts.map +1 -0
- package/dist/types/utils/gradientUtils.d.ts +67 -0
- package/dist/types/utils/gradientUtils.d.ts.map +1 -0
- package/dist/types/utils/invitationEvents.d.ts +21 -0
- package/dist/types/utils/invitationEvents.d.ts.map +1 -0
- package/dist/types/utils/moduleLoaders.d.ts +115 -0
- package/dist/types/utils/moduleLoaders.d.ts.map +1 -0
- package/dist/types/utils/moduleLoaders.web.d.ts +73 -0
- package/dist/types/utils/moduleLoaders.web.d.ts.map +1 -0
- package/dist/types/utils/nameUtils.d.ts +15 -0
- package/dist/types/utils/nameUtils.d.ts.map +1 -0
- package/dist/types/utils/themeUtils.d.ts +38 -0
- package/dist/types/utils/themeUtils.d.ts.map +1 -0
- package/dist/types/vortexInvite.d.ts +165 -0
- package/dist/types/vortexInvite.d.ts.map +1 -0
- package/dist/useInvitationFormLogic-Ct73M19B.d.mts +242 -0
- package/dist/useInvitationFormLogic-Ct73M19B.d.ts +242 -0
- package/dist/utils/analytics.js +92 -0
- package/dist/utils/analytics.js.map +1 -0
- package/dist/utils/configCache.js +68 -0
- package/dist/utils/configCache.js.map +1 -0
- package/dist/utils/contactUtils.d.mts +12 -0
- package/dist/utils/contactUtils.d.ts +12 -0
- package/dist/utils/contactUtils.js +37 -0
- package/dist/utils/contactUtils.js.map +1 -0
- package/dist/utils/contactUtils.mjs +12 -0
- package/dist/utils/contactUtils.mjs.map +1 -0
- package/dist/utils/featureWarnings.js +214 -0
- package/dist/utils/featureWarnings.js.map +1 -0
- package/dist/utils/formUtils.js +284 -0
- package/dist/utils/formUtils.js.map +1 -0
- package/dist/utils/gradientUtils.js +120 -0
- package/dist/utils/gradientUtils.js.map +1 -0
- package/dist/utils/invitationEvents.js +45 -0
- package/dist/utils/invitationEvents.js.map +1 -0
- package/dist/utils/moduleLoaders.js +275 -0
- package/dist/utils/moduleLoaders.js.map +1 -0
- package/dist/utils/moduleLoaders.web.js +72 -0
- package/dist/utils/moduleLoaders.web.js.map +1 -0
- package/dist/utils/nameUtils.js +51 -0
- package/dist/utils/nameUtils.js.map +1 -0
- package/dist/utils/themeUtils.js +141 -0
- package/dist/utils/themeUtils.js.map +1 -0
- package/dist/vortexInvite.js +83 -0
- package/dist/vortexInvite.js.map +1 -0
- package/package.json +21 -56
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Platform-specific operations that need different implementations
|
|
5
|
+
* for native (React Native) and web environments.
|
|
6
|
+
*
|
|
7
|
+
* This interface enables dependency injection, allowing components
|
|
8
|
+
* to work in both environments without importing platform-specific code.
|
|
9
|
+
*/
|
|
10
|
+
interface PlatformOperations {
|
|
11
|
+
/**
|
|
12
|
+
* Copy invitation link to clipboard
|
|
13
|
+
* - Native: Fetches shareable invitation link via Vortex API and uses expo-clipboard or @react-native-clipboard/clipboard
|
|
14
|
+
* - Web: Fetches shareable invitation link and uses navigator.clipboard.writeText
|
|
15
|
+
*
|
|
16
|
+
* The method handles fetching the invitation link internally via the Vortex API.
|
|
17
|
+
*/
|
|
18
|
+
copyToClipboard: () => Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Share invitation link using native share sheet or web share API
|
|
21
|
+
* - Native: Fetches shareable invitation link via Vortex API and uses React Native Share API
|
|
22
|
+
* - Web: Fetches shareable invitation link and uses navigator.share (if available) or logs a message
|
|
23
|
+
*
|
|
24
|
+
* The method handles fetching the invitation link and composing the share message internally.
|
|
25
|
+
*/
|
|
26
|
+
share: () => Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Close/dismiss the invitation form
|
|
29
|
+
* - Native: Dismisses bottom sheet or calls onClose callback
|
|
30
|
+
* - Web: No-op or logs a message (preview mode)
|
|
31
|
+
*/
|
|
32
|
+
close: () => void;
|
|
33
|
+
/**
|
|
34
|
+
* Fetch contacts with email addresses
|
|
35
|
+
* - Native: Uses expo-contacts to fetch from device contacts (called on-demand)
|
|
36
|
+
* - Web/Preview: Returns mock data for consistent preview behavior
|
|
37
|
+
*
|
|
38
|
+
* Called on-demand when user navigates to "Add from Contacts" view.
|
|
39
|
+
* Contacts with multiple emails are flattened into separate entries.
|
|
40
|
+
*/
|
|
41
|
+
fetchContacts: () => Promise<Array<{
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
email: string;
|
|
45
|
+
}>>;
|
|
46
|
+
/**
|
|
47
|
+
* Send an invitation to a user
|
|
48
|
+
* - Native: Calls the Vortex API via handleInviteClick with proper authentication
|
|
49
|
+
* - Web/Preview: Simulates invite for consistent preview behavior
|
|
50
|
+
*
|
|
51
|
+
* Called when user clicks "Invite" button for email or contact invitations.
|
|
52
|
+
*
|
|
53
|
+
* @param email - Email address of the person to invite
|
|
54
|
+
* @param contactName - Optional name of the contact being invited
|
|
55
|
+
* @returns Promise that resolves when invitation is sent successfully
|
|
56
|
+
*/
|
|
57
|
+
invite: (email: string, contactName?: string) => Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Fetch Google contacts via Google People API
|
|
60
|
+
* - Native: Authenticates via Google OAuth and fetches from People API
|
|
61
|
+
* - Web/Preview: Returns mock data for consistent preview behavior
|
|
62
|
+
*
|
|
63
|
+
* Called on-demand when user navigates to "Add from Google Contacts" view.
|
|
64
|
+
* Requires authentication and proper OAuth scopes.
|
|
65
|
+
*
|
|
66
|
+
* @returns Promise that resolves with array of Google contacts
|
|
67
|
+
*/
|
|
68
|
+
fetchGoogleContacts: () => Promise<Array<{
|
|
69
|
+
id: string;
|
|
70
|
+
name: string;
|
|
71
|
+
email: string;
|
|
72
|
+
}>>;
|
|
73
|
+
/**
|
|
74
|
+
* Provide haptic feedback
|
|
75
|
+
* - Native: Uses expo-haptics for tactile feedback (dynamically imported)
|
|
76
|
+
* - Web/Preview: No-op (silent fail)
|
|
77
|
+
*
|
|
78
|
+
* Optional method that provides haptic feedback when user interacts with buttons.
|
|
79
|
+
* If expo-haptics is not installed, the implementation should fail silently.
|
|
80
|
+
*
|
|
81
|
+
* @param style - Intensity of haptic feedback ('light', 'medium', or 'heavy')
|
|
82
|
+
* @returns Promise that resolves when haptic feedback is complete (or immediately for no-op)
|
|
83
|
+
*/
|
|
84
|
+
triggerHaptic?: (style: 'light' | 'medium' | 'heavy') => Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Share invitation via email (mailto)
|
|
87
|
+
* - Native: Opens email composer with pre-filled subject and body containing invitation link
|
|
88
|
+
* - Web/Preview: Opens mailto link or logs message
|
|
89
|
+
*
|
|
90
|
+
* Optional method for sharing via email client.
|
|
91
|
+
*/
|
|
92
|
+
shareViaEmail?: () => Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Share invitation via SMS
|
|
95
|
+
* - Native: Opens SMS composer with pre-filled message containing invitation link
|
|
96
|
+
* - Web/Preview: Opens sms link or logs message
|
|
97
|
+
*
|
|
98
|
+
* Optional method for sharing via SMS.
|
|
99
|
+
*/
|
|
100
|
+
shareViaSms?: () => Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* Share invitation via X/Twitter DMs
|
|
103
|
+
* - Native: Opens Twitter app for direct messaging with invitation link
|
|
104
|
+
* - Web/Preview: Opens Twitter web URL or logs message
|
|
105
|
+
*
|
|
106
|
+
* Optional method for sharing via X/Twitter direct messages.
|
|
107
|
+
*/
|
|
108
|
+
shareViaTwitter?: () => Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Share invitation via Instagram DMs
|
|
111
|
+
* - Native: Opens Instagram direct inbox
|
|
112
|
+
* - Web/Preview: Logs message (Instagram web doesn't support direct linking to DMs)
|
|
113
|
+
*
|
|
114
|
+
* Optional method for sharing via Instagram direct messages.
|
|
115
|
+
*/
|
|
116
|
+
shareViaInstagram?: () => Promise<void>;
|
|
117
|
+
/**
|
|
118
|
+
* Share invitation via WhatsApp
|
|
119
|
+
* - Native: Opens WhatsApp with pre-filled message containing invitation link
|
|
120
|
+
* - Web/Preview: Opens WhatsApp web URL or logs message
|
|
121
|
+
*
|
|
122
|
+
* Optional method for sharing via WhatsApp.
|
|
123
|
+
*/
|
|
124
|
+
shareViaWhatsApp?: () => Promise<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Share invitation via Line
|
|
127
|
+
* - Native: Opens Line app with pre-filled message containing invitation link
|
|
128
|
+
* - Web/Preview: Opens Line web URL or logs message
|
|
129
|
+
*
|
|
130
|
+
* Optional method for sharing via Line messenger.
|
|
131
|
+
*/
|
|
132
|
+
shareViaLine?: () => Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Share invitation via Line LIFF (LINE Frontend Framework)
|
|
135
|
+
* - Native: Opens Line LIFF app URL
|
|
136
|
+
* - Web/Preview: Opens Line LIFF URL or logs message
|
|
137
|
+
*
|
|
138
|
+
* Optional method for sharing via Line LIFF app.
|
|
139
|
+
*/
|
|
140
|
+
shareViaLineLiff?: () => Promise<void>;
|
|
141
|
+
/**
|
|
142
|
+
* Show QR code for invitation
|
|
143
|
+
* - Native: Displays QR code modal with invitation link encoded
|
|
144
|
+
* - Web/Preview: Logs message or shows QR code modal
|
|
145
|
+
*
|
|
146
|
+
* Optional method for displaying QR code for invitation link.
|
|
147
|
+
*/
|
|
148
|
+
showQrCode?: () => Promise<void>;
|
|
149
|
+
/**
|
|
150
|
+
* Share invitation via Facebook Messenger
|
|
151
|
+
* - Native: Opens Messenger app with pre-filled message containing invitation link
|
|
152
|
+
* - Web/Preview: Opens Messenger web URL or logs message
|
|
153
|
+
*
|
|
154
|
+
* Optional method for sharing via Facebook Messenger.
|
|
155
|
+
*/
|
|
156
|
+
shareViaFacebookMessenger?: () => Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Share invitation via Telegram
|
|
159
|
+
* - Native: Opens Telegram app with pre-filled message containing invitation link
|
|
160
|
+
* - Web/Preview: Opens Telegram web URL or logs message
|
|
161
|
+
*
|
|
162
|
+
* Optional method for sharing via Telegram.
|
|
163
|
+
*/
|
|
164
|
+
shareViaTelegram?: () => Promise<void>;
|
|
165
|
+
/**
|
|
166
|
+
* Share invitation via Discord
|
|
167
|
+
* - Native: Opens Discord app
|
|
168
|
+
* - Web/Preview: Opens Discord web URL or logs message
|
|
169
|
+
*
|
|
170
|
+
* Optional method for sharing via Discord.
|
|
171
|
+
*/
|
|
172
|
+
shareViaDiscord?: () => Promise<void>;
|
|
173
|
+
/**
|
|
174
|
+
* Create an SMS invitation and return the short link
|
|
175
|
+
* - Native: Calls the Vortex API to create an SMS invitation
|
|
176
|
+
* - Web/Preview: Returns mock link for consistent preview behavior
|
|
177
|
+
*
|
|
178
|
+
* Used by the Invite Contacts component to create SMS invitations.
|
|
179
|
+
* The returned short link is included in the SMS message sent by the user.
|
|
180
|
+
*
|
|
181
|
+
* @param phoneNumber - Phone number of the person to invite
|
|
182
|
+
* @param contactName - Optional name of the contact being invited
|
|
183
|
+
* @returns Promise that resolves with the invitation short link, or null if failed
|
|
184
|
+
*/
|
|
185
|
+
createSmsInvitation?: (phoneNumber: string, contactName?: string) => Promise<string | null>;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
type ViewType = 'main' | 'email' | 'contacts' | 'googleContacts' | 'qrcode';
|
|
189
|
+
interface Contact {
|
|
190
|
+
id: string;
|
|
191
|
+
name: string;
|
|
192
|
+
email: string;
|
|
193
|
+
imageUri?: string;
|
|
194
|
+
}
|
|
195
|
+
declare function useInvitationFormLogic(platformOps: PlatformOperations, contacts?: Contact[], googleContacts?: Contact[], getShareableInviteLink?: () => Promise<string | undefined>): {
|
|
196
|
+
view: ViewType;
|
|
197
|
+
emailInput: string;
|
|
198
|
+
emails: string[];
|
|
199
|
+
role: "member" | "admin";
|
|
200
|
+
copySuccess: boolean;
|
|
201
|
+
shareSuccess: boolean;
|
|
202
|
+
sendSuccess: boolean;
|
|
203
|
+
searchQuery: string;
|
|
204
|
+
invitedContactIds: Set<string>;
|
|
205
|
+
invitedGoogleContactIds: Set<string>;
|
|
206
|
+
googleSearchQuery: string;
|
|
207
|
+
invitationLink: string;
|
|
208
|
+
loadingContactIds: Set<string>;
|
|
209
|
+
loadingGoogleContactIds: Set<string>;
|
|
210
|
+
loadingEmailInvite: boolean;
|
|
211
|
+
loadingCopy: boolean;
|
|
212
|
+
loadingShare: boolean;
|
|
213
|
+
loadingInvitationLink: boolean;
|
|
214
|
+
lastInvalidEmail: string | null;
|
|
215
|
+
setView: react.Dispatch<react.SetStateAction<ViewType>>;
|
|
216
|
+
setEmailInput: react.Dispatch<react.SetStateAction<string>>;
|
|
217
|
+
setEmails: react.Dispatch<react.SetStateAction<string[]>>;
|
|
218
|
+
setRole: react.Dispatch<react.SetStateAction<"member" | "admin">>;
|
|
219
|
+
setCopySuccess: react.Dispatch<react.SetStateAction<boolean>>;
|
|
220
|
+
setShareSuccess: react.Dispatch<react.SetStateAction<boolean>>;
|
|
221
|
+
setSendSuccess: react.Dispatch<react.SetStateAction<boolean>>;
|
|
222
|
+
setSearchQuery: react.Dispatch<react.SetStateAction<string>>;
|
|
223
|
+
setInvitedContactIds: react.Dispatch<react.SetStateAction<Set<string>>>;
|
|
224
|
+
setInvitedGoogleContactIds: react.Dispatch<react.SetStateAction<Set<string>>>;
|
|
225
|
+
setGoogleSearchQuery: react.Dispatch<react.SetStateAction<string>>;
|
|
226
|
+
handleClose: () => void;
|
|
227
|
+
handleSendInvitation: () => Promise<void>;
|
|
228
|
+
handleCopyLink: () => Promise<void>;
|
|
229
|
+
handleShare: () => Promise<void>;
|
|
230
|
+
isValidEmail: (email: string) => boolean;
|
|
231
|
+
handleEmailSubmit: (overrideEmail?: string) => void;
|
|
232
|
+
handleRemoveEmail: (emailToRemove: string) => void;
|
|
233
|
+
handleSelectFromGoogle: () => void;
|
|
234
|
+
handleSelectFromContacts: () => void;
|
|
235
|
+
handleAddByEmail: () => void;
|
|
236
|
+
handleShowQrCode: () => void;
|
|
237
|
+
handleBackToMain: () => void;
|
|
238
|
+
handleInviteContact: (contactId: string) => Promise<void>;
|
|
239
|
+
handleInviteGoogleContact: (contactId: string) => Promise<void>;
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
export { type Contact as C, type PlatformOperations as P, type ViewType as V, useInvitationFormLogic as u };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_ANALYTICS_URL = void 0;
|
|
4
|
+
exports.getDeviceInfo = getDeviceInfo;
|
|
5
|
+
exports.extractForeignUserId = extractForeignUserId;
|
|
6
|
+
const react_native_1 = require("react-native");
|
|
7
|
+
// SDK version - should match package.json version
|
|
8
|
+
const SDK_VERSION = '0.0.15';
|
|
9
|
+
// Default production analytics URL
|
|
10
|
+
exports.DEFAULT_ANALYTICS_URL = 'https://collector.vortexsoftware.com';
|
|
11
|
+
/**
|
|
12
|
+
* Generates a device info / user agent string for analytics
|
|
13
|
+
* Format: VortexSDK-RN/{version} ({OS} {osVersion})
|
|
14
|
+
*/
|
|
15
|
+
function getDeviceInfo() {
|
|
16
|
+
const osName = react_native_1.Platform.OS === 'ios' ? 'iOS' : 'Android';
|
|
17
|
+
const osVersion = react_native_1.Platform.Version;
|
|
18
|
+
return `VortexSDK-RN/${SDK_VERSION} (${osName} ${osVersion})`;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Extracts the foreign user ID from a JWT token
|
|
22
|
+
* Checks claims in order: userId, sub, user_id
|
|
23
|
+
* Handles both standard JWTs and raw-data format (insecure development JWTs)
|
|
24
|
+
*/
|
|
25
|
+
function extractForeignUserId(jwt) {
|
|
26
|
+
if (!jwt)
|
|
27
|
+
return undefined;
|
|
28
|
+
// Handle raw-data format (insecure JWT for development)
|
|
29
|
+
if (jwt.startsWith('raw-data:')) {
|
|
30
|
+
try {
|
|
31
|
+
const base64Part = jwt.replace('raw-data:', '');
|
|
32
|
+
// Use a cross-platform base64 decode
|
|
33
|
+
const decoded = decodeBase64(base64Part);
|
|
34
|
+
const json = JSON.parse(decoded);
|
|
35
|
+
return json.userId || json.user_id;
|
|
36
|
+
}
|
|
37
|
+
catch (_a) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Standard JWT: header.payload.signature
|
|
42
|
+
const parts = jwt.split('.');
|
|
43
|
+
if (parts.length < 2)
|
|
44
|
+
return undefined;
|
|
45
|
+
try {
|
|
46
|
+
// Base64 URL decode
|
|
47
|
+
const base64 = parts[1].replace(/-/g, '+').replace(/_/g, '/');
|
|
48
|
+
const decoded = decodeBase64(base64);
|
|
49
|
+
const payload = JSON.parse(decoded);
|
|
50
|
+
// Try common user ID claims in order:
|
|
51
|
+
return payload.userId || payload.sub || payload.user_id;
|
|
52
|
+
}
|
|
53
|
+
catch (_b) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Cross-platform base64 decode function
|
|
59
|
+
* Works in both React Native and web environments
|
|
60
|
+
*/
|
|
61
|
+
function decodeBase64(base64) {
|
|
62
|
+
// Add padding if needed
|
|
63
|
+
const padded = base64 + '==='.slice(0, (4 - (base64.length % 4)) % 4);
|
|
64
|
+
// Try using Buffer (Node.js / React Native with polyfill)
|
|
65
|
+
if (typeof Buffer !== 'undefined') {
|
|
66
|
+
return Buffer.from(padded, 'base64').toString('utf-8');
|
|
67
|
+
}
|
|
68
|
+
// Fallback to atob (web)
|
|
69
|
+
if (typeof atob !== 'undefined') {
|
|
70
|
+
return atob(padded);
|
|
71
|
+
}
|
|
72
|
+
// Manual decode as last resort
|
|
73
|
+
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
74
|
+
let output = '';
|
|
75
|
+
let i = 0;
|
|
76
|
+
while (i < padded.length) {
|
|
77
|
+
const enc1 = chars.indexOf(padded.charAt(i++));
|
|
78
|
+
const enc2 = chars.indexOf(padded.charAt(i++));
|
|
79
|
+
const enc3 = chars.indexOf(padded.charAt(i++));
|
|
80
|
+
const enc4 = chars.indexOf(padded.charAt(i++));
|
|
81
|
+
const chr1 = (enc1 << 2) | (enc2 >> 4);
|
|
82
|
+
const chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
|
|
83
|
+
const chr3 = ((enc3 & 3) << 6) | enc4;
|
|
84
|
+
output += String.fromCharCode(chr1);
|
|
85
|
+
if (enc3 !== 64)
|
|
86
|
+
output += String.fromCharCode(chr2);
|
|
87
|
+
if (enc4 !== 64)
|
|
88
|
+
output += String.fromCharCode(chr3);
|
|
89
|
+
}
|
|
90
|
+
return output;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=analytics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.js","sourceRoot":"","sources":["../../src/utils/analytics.ts"],"names":[],"mappings":"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","sourcesContent":["import { Platform } from 'react-native';\nimport type { EventName } from '@teamvortexsoftware/analytics-client';\n\n// SDK version - should match package.json version\nconst SDK_VERSION = '0.0.15';\n\n// Default production analytics URL\nexport const DEFAULT_ANALYTICS_URL = 'https://collector.vortexsoftware.com';\n\n/**\n * Analytics event interface for React Native SDK\n * Based on AnalyticsEvent from analytics-client with additional mobile-specific fields\n */\nexport interface VortexAnalyticsEvent {\n // Core fields from AnalyticsEvent\n name: EventName;\n widgetConfigurationId: string;\n deploymentId: string;\n environmentId: string;\n platform: string;\n segmentation?: Record<string, any>;\n payload?: Record<string, any>;\n groups?: Array<{\n type: string;\n id: string;\n name: string;\n }>;\n // Additional mobile-specific fields\n timestamp: number; // Unix timestamp in seconds\n sessionId?: string; // Generated UUID per session\n useragent?: string; // Device info string\n foreignUserId?: string; // Extracted from JWT\n}\n\n/**\n * Simplified analytics event for components that emit minimal events.\n * These components emit (name + segmentation) and the parent\n * is responsible for enriching with widgetConfigurationId, deploymentId, etc.\n */\nexport interface SimpleAnalyticsEvent {\n name: EventName;\n segmentation?: Record<string, any>;\n payload?: Record<string, any>;\n}\n\n/**\n * Group DTO for analytics events\n */\nexport interface GroupDTO {\n type: string;\n id: string;\n name: string;\n}\n\n/**\n * Generates a device info / user agent string for analytics\n * Format: VortexSDK-RN/{version} ({OS} {osVersion})\n */\nexport function getDeviceInfo(): string {\n const osName = Platform.OS === 'ios' ? 'iOS' : 'Android';\n const osVersion = Platform.Version;\n\n return `VortexSDK-RN/${SDK_VERSION} (${osName} ${osVersion})`;\n}\n\n/**\n * Extracts the foreign user ID from a JWT token\n * Checks claims in order: userId, sub, user_id\n * Handles both standard JWTs and raw-data format (insecure development JWTs)\n */\nexport function extractForeignUserId(jwt?: string): string | undefined {\n if (!jwt) return undefined;\n\n // Handle raw-data format (insecure JWT for development)\n if (jwt.startsWith('raw-data:')) {\n try {\n const base64Part = jwt.replace('raw-data:', '');\n // Use a cross-platform base64 decode\n const decoded = decodeBase64(base64Part);\n const json = JSON.parse(decoded);\n return json.userId || json.user_id;\n } catch {\n return undefined;\n }\n }\n\n // Standard JWT: header.payload.signature\n const parts = jwt.split('.');\n if (parts.length < 2) return undefined;\n\n try {\n // Base64 URL decode\n const base64 = parts[1].replace(/-/g, '+').replace(/_/g, '/');\n const decoded = decodeBase64(base64);\n const payload = JSON.parse(decoded);\n\n // Try common user ID claims in order:\n return payload.userId || payload.sub || payload.user_id;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Cross-platform base64 decode function\n * Works in both React Native and web environments\n */\nfunction decodeBase64(base64: string): string {\n // Add padding if needed\n const padded = base64 + '==='.slice(0, (4 - (base64.length % 4)) % 4);\n\n // Try using Buffer (Node.js / React Native with polyfill)\n if (typeof Buffer !== 'undefined') {\n return Buffer.from(padded, 'base64').toString('utf-8');\n }\n\n // Fallback to atob (web)\n if (typeof atob !== 'undefined') {\n return atob(padded);\n }\n\n // Manual decode as last resort\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n let output = '';\n let i = 0;\n\n while (i < padded.length) {\n const enc1 = chars.indexOf(padded.charAt(i++));\n const enc2 = chars.indexOf(padded.charAt(i++));\n const enc3 = chars.indexOf(padded.charAt(i++));\n const enc4 = chars.indexOf(padded.charAt(i++));\n\n const chr1 = (enc1 << 2) | (enc2 >> 4);\n const chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n const chr3 = ((enc3 & 3) << 6) | enc4;\n\n output += String.fromCharCode(chr1);\n if (enc3 !== 64) output += String.fromCharCode(chr2);\n if (enc4 !== 64) output += String.fromCharCode(chr3);\n }\n\n return output;\n}\n\n\n"]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configCache = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Module-level cache for widget configurations.
|
|
6
|
+
* This cache is shared across all hooks and components to ensure
|
|
7
|
+
* configuration updates persist between component mount/unmount cycles.
|
|
8
|
+
*
|
|
9
|
+
* Benefits:
|
|
10
|
+
* - Single source of truth for widget configurations
|
|
11
|
+
* - Persists between modal open/close cycles
|
|
12
|
+
* - Automatic synchronization between prefetch and main hooks
|
|
13
|
+
* - No React Context overhead
|
|
14
|
+
*/
|
|
15
|
+
const cache = new Map();
|
|
16
|
+
exports.configCache = {
|
|
17
|
+
/**
|
|
18
|
+
* Get a cached widget configuration by component ID.
|
|
19
|
+
* @param componentId - The widget component ID
|
|
20
|
+
* @returns The cached configuration, or undefined if not found
|
|
21
|
+
*/
|
|
22
|
+
get: (componentId) => {
|
|
23
|
+
return cache.get(componentId);
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* Store a widget configuration in the cache.
|
|
27
|
+
* @param componentId - The widget component ID
|
|
28
|
+
* @param config - The widget configuration to cache
|
|
29
|
+
*/
|
|
30
|
+
set: (componentId, config) => {
|
|
31
|
+
cache.set(componentId, config);
|
|
32
|
+
console.log('[Vortex] Configuration cached', {
|
|
33
|
+
componentId,
|
|
34
|
+
configId: config.id,
|
|
35
|
+
cacheSize: cache.size,
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
/**
|
|
39
|
+
* Clear cached configuration(s).
|
|
40
|
+
* @param componentId - Optional component ID to clear specific config. If omitted, clears all.
|
|
41
|
+
*/
|
|
42
|
+
clear: (componentId) => {
|
|
43
|
+
if (componentId) {
|
|
44
|
+
cache.delete(componentId);
|
|
45
|
+
console.log('[Vortex] Configuration cache cleared', { componentId });
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
cache.clear();
|
|
49
|
+
console.log('[Vortex] All configuration cache cleared');
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* Check if a configuration exists in the cache.
|
|
54
|
+
* @param componentId - The widget component ID
|
|
55
|
+
* @returns True if configuration is cached, false otherwise
|
|
56
|
+
*/
|
|
57
|
+
has: (componentId) => {
|
|
58
|
+
return cache.has(componentId);
|
|
59
|
+
},
|
|
60
|
+
/**
|
|
61
|
+
* Get cache statistics for debugging.
|
|
62
|
+
*/
|
|
63
|
+
stats: () => ({
|
|
64
|
+
size: cache.size,
|
|
65
|
+
keys: Array.from(cache.keys()),
|
|
66
|
+
}),
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=configCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configCache.js","sourceRoot":"","sources":["../../src/utils/configCache.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;GAUG;AACH,MAAM,KAAK,GAAG,IAAI,GAAG,EAA+B,CAAC;AAExC,QAAA,WAAW,GAAG;IACzB;;;;OAIG;IACH,GAAG,EAAE,CAAC,WAAmB,EAAmC,EAAE;QAC5D,OAAO,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,GAAG,EAAE,CAAC,WAAmB,EAAE,MAA2B,EAAQ,EAAE;QAC9D,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE;YAC3C,WAAW;YACX,QAAQ,EAAE,MAAM,CAAC,EAAE;YACnB,SAAS,EAAE,KAAK,CAAC,IAAI;SACtB,CAAC,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,KAAK,EAAE,CAAC,WAAoB,EAAQ,EAAE;QACpC,IAAI,WAAW,EAAE,CAAC;YAChB,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YAC1B,OAAO,CAAC,GAAG,CAAC,sCAAsC,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;QACvE,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAC;QAC1D,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,GAAG,EAAE,CAAC,WAAmB,EAAW,EAAE;QACpC,OAAO,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;QACZ,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;KAC/B,CAAC;CACH,CAAC","sourcesContent":["import { WidgetConfiguration } from '@teamvortexsoftware/vortex-types';\n\n/**\n * Module-level cache for widget configurations.\n * This cache is shared across all hooks and components to ensure\n * configuration updates persist between component mount/unmount cycles.\n * \n * Benefits:\n * - Single source of truth for widget configurations\n * - Persists between modal open/close cycles\n * - Automatic synchronization between prefetch and main hooks\n * - No React Context overhead\n */\nconst cache = new Map<string, WidgetConfiguration>();\n\nexport const configCache = {\n /**\n * Get a cached widget configuration by component ID.\n * @param componentId - The widget component ID\n * @returns The cached configuration, or undefined if not found\n */\n get: (componentId: string): WidgetConfiguration | undefined => {\n return cache.get(componentId);\n },\n\n /**\n * Store a widget configuration in the cache.\n * @param componentId - The widget component ID\n * @param config - The widget configuration to cache\n */\n set: (componentId: string, config: WidgetConfiguration): void => {\n cache.set(componentId, config);\n console.log('[Vortex] Configuration cached', {\n componentId,\n configId: config.id,\n cacheSize: cache.size,\n });\n },\n\n /**\n * Clear cached configuration(s).\n * @param componentId - Optional component ID to clear specific config. If omitted, clears all.\n */\n clear: (componentId?: string): void => {\n if (componentId) {\n cache.delete(componentId);\n console.log('[Vortex] Configuration cache cleared', { componentId });\n } else {\n cache.clear();\n console.log('[Vortex] All configuration cache cleared');\n }\n },\n\n /**\n * Check if a configuration exists in the cache.\n * @param componentId - The widget component ID\n * @returns True if configuration is cached, false otherwise\n */\n has: (componentId: string): boolean => {\n return cache.has(componentId);\n },\n\n /**\n * Get cache statistics for debugging.\n */\n stats: () => ({\n size: cache.size,\n keys: Array.from(cache.keys()),\n }),\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { C as Contact } from '../useInvitationFormLogic-Ct73M19B.mjs';
|
|
2
|
+
import 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Filters contacts based on a search query
|
|
6
|
+
* @param contacts Array of contacts to filter
|
|
7
|
+
* @param searchQuery Query string to filter by
|
|
8
|
+
* @returns Filtered array of contacts
|
|
9
|
+
*/
|
|
10
|
+
declare function filterContacts(contacts: Contact[], searchQuery: string): Contact[];
|
|
11
|
+
|
|
12
|
+
export { filterContacts };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { C as Contact } from '../useInvitationFormLogic-Ct73M19B.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Filters contacts based on a search query
|
|
6
|
+
* @param contacts Array of contacts to filter
|
|
7
|
+
* @param searchQuery Query string to filter by
|
|
8
|
+
* @returns Filtered array of contacts
|
|
9
|
+
*/
|
|
10
|
+
declare function filterContacts(contacts: Contact[], searchQuery: string): Contact[];
|
|
11
|
+
|
|
12
|
+
export { filterContacts };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/utils/contactUtils.ts
|
|
21
|
+
var contactUtils_exports = {};
|
|
22
|
+
__export(contactUtils_exports, {
|
|
23
|
+
filterContacts: () => filterContacts
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(contactUtils_exports);
|
|
26
|
+
function filterContacts(contacts, searchQuery) {
|
|
27
|
+
const query = searchQuery.toLowerCase().trim();
|
|
28
|
+
if (!query) return contacts;
|
|
29
|
+
return contacts.filter(
|
|
30
|
+
(contact) => contact.name.toLowerCase().includes(query) || contact.email.toLowerCase().includes(query)
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
filterContacts
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=contactUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/contactUtils.ts"],"sourcesContent":["import type { Contact } from '../hooks/useInvitationFormLogic';\n\n/**\n * Filters contacts based on a search query\n * @param contacts Array of contacts to filter\n * @param searchQuery Query string to filter by\n * @returns Filtered array of contacts\n */\nexport function filterContacts(contacts: Contact[], searchQuery: string): Contact[] {\n const query = searchQuery.toLowerCase().trim();\n if (!query) return contacts;\n \n return contacts.filter(contact =>\n contact.name.toLowerCase().includes(query) ||\n contact.email.toLowerCase().includes(query)\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQO,SAAS,eAAe,UAAqB,aAAgC;AAClF,QAAM,QAAQ,YAAY,YAAY,EAAE,KAAK;AAC7C,MAAI,CAAC,MAAO,QAAO;AAEnB,SAAO,SAAS;AAAA,IAAO,aACrB,QAAQ,KAAK,YAAY,EAAE,SAAS,KAAK,KACzC,QAAQ,MAAM,YAAY,EAAE,SAAS,KAAK;AAAA,EAC5C;AACF;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/utils/contactUtils.ts
|
|
2
|
+
function filterContacts(contacts, searchQuery) {
|
|
3
|
+
const query = searchQuery.toLowerCase().trim();
|
|
4
|
+
if (!query) return contacts;
|
|
5
|
+
return contacts.filter(
|
|
6
|
+
(contact) => contact.name.toLowerCase().includes(query) || contact.email.toLowerCase().includes(query)
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
filterContacts
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=contactUtils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/contactUtils.ts"],"sourcesContent":["import type { Contact } from '../hooks/useInvitationFormLogic';\n\n/**\n * Filters contacts based on a search query\n * @param contacts Array of contacts to filter\n * @param searchQuery Query string to filter by\n * @returns Filtered array of contacts\n */\nexport function filterContacts(contacts: Contact[], searchQuery: string): Contact[] {\n const query = searchQuery.toLowerCase().trim();\n if (!query) return contacts;\n \n return contacts.filter(contact =>\n contact.name.toLowerCase().includes(query) ||\n contact.email.toLowerCase().includes(query)\n );\n}\n"],"mappings":";AAQO,SAAS,eAAe,UAAqB,aAAgC;AAClF,QAAM,QAAQ,YAAY,YAAY,EAAE,KAAK;AAC7C,MAAI,CAAC,MAAO,QAAO;AAEnB,SAAO,SAAS;AAAA,IAAO,aACrB,QAAQ,KAAK,YAAY,EAAE,SAAS,KAAK,KACzC,QAAQ,MAAM,YAAY,EAAE,SAAS,KAAK;AAAA,EAC5C;AACF;","names":[]}
|