@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.
Files changed (217) hide show
  1. package/dist/InviteFormCore-D4HkMMo0.d.mts +721 -0
  2. package/dist/InviteFormCore-D9oUCbu7.d.ts +721 -0
  3. package/dist/VortexClient.js +192 -0
  4. package/dist/VortexClient.js.map +1 -0
  5. package/dist/VortexDeferredLinks.js +127 -0
  6. package/dist/VortexDeferredLinks.js.map +1 -0
  7. package/dist/clientInfo.js +45 -0
  8. package/dist/clientInfo.js.map +1 -0
  9. package/dist/components/ContactsPickerModal.js +182 -0
  10. package/dist/components/ContactsPickerModal.js.map +1 -0
  11. package/dist/components/InviteFormCore.js +2141 -0
  12. package/dist/components/InviteFormCore.js.map +1 -0
  13. package/dist/components/InviteFormMobile.js +463 -0
  14. package/dist/components/InviteFormMobile.js.map +1 -0
  15. package/dist/components/InviteFormWeb.js +295 -0
  16. package/dist/components/InviteFormWeb.js.map +1 -0
  17. package/dist/components/PlacedItemToolbar.js +147 -0
  18. package/dist/components/PlacedItemToolbar.js.map +1 -0
  19. package/dist/components/ShareButtons.js +181 -0
  20. package/dist/components/ShareButtons.js.map +1 -0
  21. package/dist/components/VrtxContactsImport.js +234 -0
  22. package/dist/components/VrtxContactsImport.js.map +1 -0
  23. package/dist/components/VrtxEmailInvitations.js +341 -0
  24. package/dist/components/VrtxEmailInvitations.js.map +1 -0
  25. package/dist/components/VrtxFindFriends.js +400 -0
  26. package/dist/components/VrtxFindFriends.js.map +1 -0
  27. package/dist/components/VrtxHeading.js +58 -0
  28. package/dist/components/VrtxHeading.js.map +1 -0
  29. package/dist/components/VrtxIncomingInvitations.js +657 -0
  30. package/dist/components/VrtxIncomingInvitations.js.map +1 -0
  31. package/dist/components/VrtxInvitationSuggestions.js +506 -0
  32. package/dist/components/VrtxInvitationSuggestions.js.map +1 -0
  33. package/dist/components/VrtxInviteContacts.js +512 -0
  34. package/dist/components/VrtxInviteContacts.js.map +1 -0
  35. package/dist/components/VrtxOutgoingInvitations.js +572 -0
  36. package/dist/components/VrtxOutgoingInvitations.js.map +1 -0
  37. package/dist/components/VrtxSearchBox.js +487 -0
  38. package/dist/components/VrtxSearchBox.js.map +1 -0
  39. package/dist/components/VrtxSelect.js +27 -0
  40. package/dist/components/VrtxSelect.js.map +1 -0
  41. package/dist/components/VrtxShareOptions.js +435 -0
  42. package/dist/components/VrtxShareOptions.js.map +1 -0
  43. package/dist/components/VrtxSubmit.js +132 -0
  44. package/dist/components/VrtxSubmit.js.map +1 -0
  45. package/dist/components/VrtxText.js +146 -0
  46. package/dist/components/VrtxText.js.map +1 -0
  47. package/dist/constants/mockData.d.mts +7 -0
  48. package/dist/constants/mockData.d.ts +7 -0
  49. package/dist/constants/mockData.js +48 -0
  50. package/dist/constants/mockData.js.map +1 -0
  51. package/dist/constants/mockData.mjs +22 -0
  52. package/dist/constants/mockData.mjs.map +1 -0
  53. package/dist/context/VortexModulesContext.js +135 -0
  54. package/dist/context/VortexModulesContext.js.map +1 -0
  55. package/dist/hooks/useInvitationFormLogic.d.mts +2 -0
  56. package/dist/hooks/useInvitationFormLogic.d.ts +2 -0
  57. package/dist/hooks/useInvitationFormLogic.js +300 -0
  58. package/dist/hooks/useInvitationFormLogic.js.map +1 -0
  59. package/dist/hooks/useInvitationFormLogic.mjs +276 -0
  60. package/dist/hooks/useInvitationFormLogic.mjs.map +1 -0
  61. package/dist/hooks/usePrefetchWidgetConfiguration.js +117 -0
  62. package/dist/hooks/usePrefetchWidgetConfiguration.js.map +1 -0
  63. package/dist/hooks/useThemeStyles.js +41 -0
  64. package/dist/hooks/useThemeStyles.js.map +1 -0
  65. package/dist/hooks/useVortexInvite.js +732 -0
  66. package/dist/hooks/useVortexInvite.js.map +1 -0
  67. package/dist/index-web.d.mts +93 -0
  68. package/dist/index-web.d.ts +93 -0
  69. package/dist/index-web.js +7397 -0
  70. package/dist/index-web.js.map +1 -0
  71. package/dist/index-web.mjs +7445 -0
  72. package/dist/index-web.mjs.map +1 -0
  73. package/dist/index.d.mts +656 -0
  74. package/dist/index.d.ts +656 -0
  75. package/dist/index.js +10206 -0
  76. package/dist/index.js.map +1 -0
  77. package/dist/index.mjs +10244 -0
  78. package/dist/index.mjs.map +1 -0
  79. package/dist/types/VortexClient.d.ts +106 -0
  80. package/dist/types/VortexClient.d.ts.map +1 -0
  81. package/dist/types/VortexDeferredLinks.d.ts +73 -0
  82. package/dist/types/VortexDeferredLinks.d.ts.map +1 -0
  83. package/dist/types/clientInfo.d.ts +5 -0
  84. package/dist/types/clientInfo.d.ts.map +1 -0
  85. package/dist/types/components/ContactsPickerModal.d.ts +18 -0
  86. package/dist/types/components/ContactsPickerModal.d.ts.map +1 -0
  87. package/dist/types/components/InviteFormCore.d.ts +166 -0
  88. package/dist/types/components/InviteFormCore.d.ts.map +1 -0
  89. package/dist/types/components/InviteFormMobile.d.ts +42 -0
  90. package/dist/types/components/InviteFormMobile.d.ts.map +1 -0
  91. package/dist/types/components/InviteFormWeb.d.ts +87 -0
  92. package/dist/types/components/InviteFormWeb.d.ts.map +1 -0
  93. package/dist/types/components/PlacedItemToolbar.d.ts +16 -0
  94. package/dist/types/components/PlacedItemToolbar.d.ts.map +1 -0
  95. package/dist/types/components/ShareButtons.d.ts +29 -0
  96. package/dist/types/components/ShareButtons.d.ts.map +1 -0
  97. package/dist/types/components/VrtxContactsImport.d.ts +14 -0
  98. package/dist/types/components/VrtxContactsImport.d.ts.map +1 -0
  99. package/dist/types/components/VrtxEmailInvitations.d.ts +31 -0
  100. package/dist/types/components/VrtxEmailInvitations.d.ts.map +1 -0
  101. package/dist/types/components/VrtxFindFriends.d.ts +25 -0
  102. package/dist/types/components/VrtxFindFriends.d.ts.map +1 -0
  103. package/dist/types/components/VrtxHeading.d.ts +6 -0
  104. package/dist/types/components/VrtxHeading.d.ts.map +1 -0
  105. package/dist/types/components/VrtxIncomingInvitations.d.ts +27 -0
  106. package/dist/types/components/VrtxIncomingInvitations.d.ts.map +1 -0
  107. package/dist/types/components/VrtxInvitationSuggestions.d.ts +25 -0
  108. package/dist/types/components/VrtxInvitationSuggestions.d.ts.map +1 -0
  109. package/dist/types/components/VrtxInviteContacts.d.ts +24 -0
  110. package/dist/types/components/VrtxInviteContacts.d.ts.map +1 -0
  111. package/dist/types/components/VrtxOutgoingInvitations.d.ts +27 -0
  112. package/dist/types/components/VrtxOutgoingInvitations.d.ts.map +1 -0
  113. package/dist/types/components/VrtxSearchBox.d.ts +28 -0
  114. package/dist/types/components/VrtxSearchBox.d.ts.map +1 -0
  115. package/dist/types/components/VrtxSelect.d.ts +6 -0
  116. package/dist/types/components/VrtxSelect.d.ts.map +1 -0
  117. package/dist/types/components/VrtxShareOptions.d.ts +41 -0
  118. package/dist/types/components/VrtxShareOptions.d.ts.map +1 -0
  119. package/dist/types/components/VrtxSubmit.d.ts +18 -0
  120. package/dist/types/components/VrtxSubmit.d.ts.map +1 -0
  121. package/dist/types/components/VrtxText.d.ts +8 -0
  122. package/dist/types/components/VrtxText.d.ts.map +1 -0
  123. package/dist/types/constants/mockData.d.ts +4 -0
  124. package/dist/types/constants/mockData.d.ts.map +1 -0
  125. package/dist/types/context/VortexModulesContext.d.ts +238 -0
  126. package/dist/types/context/VortexModulesContext.d.ts.map +1 -0
  127. package/dist/types/findFriends.js +10 -0
  128. package/dist/types/findFriends.js.map +1 -0
  129. package/dist/types/hooks/useInvitationFormLogic.d.ts +55 -0
  130. package/dist/types/hooks/useInvitationFormLogic.d.ts.map +1 -0
  131. package/dist/types/hooks/usePrefetchWidgetConfiguration.d.ts +39 -0
  132. package/dist/types/hooks/usePrefetchWidgetConfiguration.d.ts.map +1 -0
  133. package/dist/types/hooks/useThemeStyles.d.ts +35 -0
  134. package/dist/types/hooks/useThemeStyles.d.ts.map +1 -0
  135. package/dist/types/hooks/useVortexInvite.d.ts +86 -0
  136. package/dist/types/hooks/useVortexInvite.d.ts.map +1 -0
  137. package/dist/types/index-web.d.ts +23 -0
  138. package/dist/types/index-web.d.ts.map +1 -0
  139. package/dist/types/index.d.ts +23 -0
  140. package/dist/types/index.d.ts.map +1 -0
  141. package/dist/types/invitations.js +13 -0
  142. package/dist/types/invitations.js.map +1 -0
  143. package/dist/types/inviteContacts.js +14 -0
  144. package/dist/types/inviteContacts.js.map +1 -0
  145. package/dist/types/platformOperations.js +3 -0
  146. package/dist/types/platformOperations.js.map +1 -0
  147. package/dist/types/searchBox.js +11 -0
  148. package/dist/types/searchBox.js.map +1 -0
  149. package/dist/types/types/findFriends.d.ts +101 -0
  150. package/dist/types/types/findFriends.d.ts.map +1 -0
  151. package/dist/types/types/invitations.d.ts +301 -0
  152. package/dist/types/types/invitations.d.ts.map +1 -0
  153. package/dist/types/types/inviteContacts.d.ts +86 -0
  154. package/dist/types/types/inviteContacts.d.ts.map +1 -0
  155. package/dist/types/types/platformOperations.d.ts +185 -0
  156. package/dist/types/types/platformOperations.d.ts.map +1 -0
  157. package/dist/types/types/searchBox.d.ts +69 -0
  158. package/dist/types/types/searchBox.d.ts.map +1 -0
  159. package/dist/types/types/unfurlConfig.d.ts +34 -0
  160. package/dist/types/types/unfurlConfig.d.ts.map +1 -0
  161. package/dist/types/unfurlConfig.js +21 -0
  162. package/dist/types/unfurlConfig.js.map +1 -0
  163. package/dist/types/utils/analytics.d.ts +54 -0
  164. package/dist/types/utils/analytics.d.ts.map +1 -0
  165. package/dist/types/utils/configCache.d.ts +34 -0
  166. package/dist/types/utils/configCache.d.ts.map +1 -0
  167. package/dist/types/utils/contactUtils.d.ts +9 -0
  168. package/dist/types/utils/contactUtils.d.ts.map +1 -0
  169. package/dist/types/utils/featureWarnings.d.ts +56 -0
  170. package/dist/types/utils/featureWarnings.d.ts.map +1 -0
  171. package/dist/types/utils/formUtils.d.ts +93 -0
  172. package/dist/types/utils/formUtils.d.ts.map +1 -0
  173. package/dist/types/utils/gradientUtils.d.ts +67 -0
  174. package/dist/types/utils/gradientUtils.d.ts.map +1 -0
  175. package/dist/types/utils/invitationEvents.d.ts +21 -0
  176. package/dist/types/utils/invitationEvents.d.ts.map +1 -0
  177. package/dist/types/utils/moduleLoaders.d.ts +115 -0
  178. package/dist/types/utils/moduleLoaders.d.ts.map +1 -0
  179. package/dist/types/utils/moduleLoaders.web.d.ts +73 -0
  180. package/dist/types/utils/moduleLoaders.web.d.ts.map +1 -0
  181. package/dist/types/utils/nameUtils.d.ts +15 -0
  182. package/dist/types/utils/nameUtils.d.ts.map +1 -0
  183. package/dist/types/utils/themeUtils.d.ts +38 -0
  184. package/dist/types/utils/themeUtils.d.ts.map +1 -0
  185. package/dist/types/vortexInvite.d.ts +165 -0
  186. package/dist/types/vortexInvite.d.ts.map +1 -0
  187. package/dist/useInvitationFormLogic-Ct73M19B.d.mts +242 -0
  188. package/dist/useInvitationFormLogic-Ct73M19B.d.ts +242 -0
  189. package/dist/utils/analytics.js +92 -0
  190. package/dist/utils/analytics.js.map +1 -0
  191. package/dist/utils/configCache.js +68 -0
  192. package/dist/utils/configCache.js.map +1 -0
  193. package/dist/utils/contactUtils.d.mts +12 -0
  194. package/dist/utils/contactUtils.d.ts +12 -0
  195. package/dist/utils/contactUtils.js +37 -0
  196. package/dist/utils/contactUtils.js.map +1 -0
  197. package/dist/utils/contactUtils.mjs +12 -0
  198. package/dist/utils/contactUtils.mjs.map +1 -0
  199. package/dist/utils/featureWarnings.js +214 -0
  200. package/dist/utils/featureWarnings.js.map +1 -0
  201. package/dist/utils/formUtils.js +284 -0
  202. package/dist/utils/formUtils.js.map +1 -0
  203. package/dist/utils/gradientUtils.js +120 -0
  204. package/dist/utils/gradientUtils.js.map +1 -0
  205. package/dist/utils/invitationEvents.js +45 -0
  206. package/dist/utils/invitationEvents.js.map +1 -0
  207. package/dist/utils/moduleLoaders.js +275 -0
  208. package/dist/utils/moduleLoaders.js.map +1 -0
  209. package/dist/utils/moduleLoaders.web.js +72 -0
  210. package/dist/utils/moduleLoaders.web.js.map +1 -0
  211. package/dist/utils/nameUtils.js +51 -0
  212. package/dist/utils/nameUtils.js.map +1 -0
  213. package/dist/utils/themeUtils.js +141 -0
  214. package/dist/utils/themeUtils.js.map +1 -0
  215. package/dist/vortexInvite.js +83 -0
  216. package/dist/vortexInvite.js.map +1 -0
  217. package/package.json +21 -56
@@ -0,0 +1,38 @@
1
+ import { WidgetConfiguration } from '@teamvortexsoftware/vortex-types';
2
+ export interface ThemeColors {
3
+ containerBackground: string;
4
+ containerForeground: string;
5
+ containerBorder: string;
6
+ primaryButtonBackground: string;
7
+ primaryButtonForeground: string;
8
+ primaryButtonBorder: string;
9
+ secondaryButtonBackground: string;
10
+ secondaryButtonForeground: string;
11
+ secondaryButtonBorder: string;
12
+ }
13
+ export interface FeatureFlags {
14
+ shareableLinks: boolean;
15
+ emailInvitations: boolean;
16
+ shareOptionsCopyLink: boolean;
17
+ shareOptionsSms: boolean;
18
+ shareOptionsEmail: boolean;
19
+ shareOptionsFacebookMessenger: boolean;
20
+ shareOptionsInstagramDms: boolean;
21
+ shareOptionsLinkedInMessaging: boolean;
22
+ shareOptionsTwitterDms: boolean;
23
+ shareOptionsWhatsApp: boolean;
24
+ shareOptionsNativeShareSheet: boolean;
25
+ shareOptionsQrCode: boolean;
26
+ shareOptionsLine: boolean;
27
+ shareEnabled: boolean;
28
+ shareOptionsOrder: string[];
29
+ }
30
+ /**
31
+ * Extracts theme colors from widget configuration
32
+ */
33
+ export declare function extractThemeColors(widgetConfiguration?: WidgetConfiguration): ThemeColors;
34
+ /**
35
+ * Extracts feature flags from widget configuration
36
+ */
37
+ export declare function extractFeatureFlags(widgetConfiguration?: WidgetConfiguration): FeatureFlags;
38
+ //# sourceMappingURL=themeUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/themeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,MAAM,WAAW,WAAW;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;IAChC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,yBAAyB,EAAE,MAAM,CAAC;IAClC,yBAAyB,EAAE,MAAM,CAAC;IAClC,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAkBD,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,6BAA6B,EAAE,OAAO,CAAC;IACvC,wBAAwB,EAAE,OAAO,CAAC;IAClC,6BAA6B,EAAE,OAAO,CAAC;IACvC,sBAAsB,EAAE,OAAO,CAAC;IAChC,oBAAoB,EAAE,OAAO,CAAC;IAC9B,4BAA4B,EAAE,OAAO,CAAC;IACtC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,GAAG,WAAW,CAoEzF;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,GAAG,YAAY,CAuD3F"}
@@ -0,0 +1,165 @@
1
+ import React from 'react';
2
+ import { UnsignedData } from '@teamvortexsoftware/vortex-types';
3
+ import { VortexAnalyticsEvent, GroupDTO } from './utils/analytics';
4
+ import { FindFriendsConfig } from './types/findFriends';
5
+ import { IncomingInvitationsConfig, OutgoingInvitationsConfig, InvitationSuggestionsConfig } from './types/invitations';
6
+ import { InviteContactsConfig } from './types/inviteContacts';
7
+ import { UnfurlConfig } from './types/unfurlConfig';
8
+ import { SearchBoxConfig } from './types/searchBox';
9
+ import { type VortexModules } from './context/VortexModulesContext';
10
+ export type VortexActionType = 'invite' | 'share';
11
+ export interface VortexActionResult {
12
+ type: VortexActionType;
13
+ data: string;
14
+ }
15
+ export interface Attributes {
16
+ [key: string]: {
17
+ value: string | string[];
18
+ type: string;
19
+ role?: string;
20
+ };
21
+ }
22
+ export interface VortexInviteProps {
23
+ vortexApiUrl?: string;
24
+ componentId: string;
25
+ jwt?: string;
26
+ user?: string | UnsignedData | undefined;
27
+ googleIosClientId?: string;
28
+ googleWebClientId?: string;
29
+ onSuccess?: (result: VortexActionResult) => void;
30
+ onError?: (error: Error, type: VortexActionType) => void;
31
+ onClose?: () => void;
32
+ contentTokens?: Attributes;
33
+ widgetConfiguration?: any;
34
+ group?: {
35
+ name: string;
36
+ type: string;
37
+ id?: string;
38
+ groupId?: string;
39
+ };
40
+ groups?: GroupDTO[];
41
+ scope?: string;
42
+ scopeType?: string;
43
+ analyticsBaseURL?: string;
44
+ onEvent?: (event: VortexAnalyticsEvent) => void;
45
+ analyticsSegmentation?: Record<string, any>;
46
+ /**
47
+ * Configuration for the Find Friends feature.
48
+ * When provided, enables the Find Friends component to display
49
+ * contacts with Connect buttons. When Connect is tapped and onConnect
50
+ * returns true, an invitation is created via the Vortex backend.
51
+ *
52
+ * @example
53
+ * ```tsx
54
+ * <VortexInvite
55
+ * componentId="abc123"
56
+ * findFriendsConfig={{
57
+ * contacts: [
58
+ * { userId: 'user-123', name: 'John Doe', subtitle: '@johndoe' },
59
+ * { userId: 'user-456', name: 'Jane Smith', avatarUrl: 'https://...' },
60
+ * ],
61
+ * onConnect: async (contact) => {
62
+ * // Perform any pre-connection validation
63
+ * // Return true to create the invitation via Vortex backend
64
+ * return true;
65
+ * },
66
+ * onInvitationCreated: (contact) => {
67
+ * // Called after invitation is successfully created
68
+ * },
69
+ * }}
70
+ * />
71
+ * ```
72
+ */
73
+ findFriendsConfig?: FindFriendsConfig;
74
+ /**
75
+ * Configuration for the Incoming Invitations feature.
76
+ * When provided, enables the Incoming Invitations component to display
77
+ * invitations the user has received with Accept/Delete buttons.
78
+ */
79
+ incomingInvitationsConfig?: IncomingInvitationsConfig;
80
+ /**
81
+ * Configuration for the Outgoing Invitations feature.
82
+ * When provided, enables the Outgoing Invitations component to display
83
+ * invitations the user has sent with a Cancel button.
84
+ */
85
+ outgoingInvitationsConfig?: OutgoingInvitationsConfig;
86
+ /**
87
+ * Configuration for the Invite Contacts feature.
88
+ * When provided, enables the Invite Contacts component to display
89
+ * a list of contacts that can be invited via SMS.
90
+ *
91
+ * The component shows an "Invite your contacts" link that expands to
92
+ * a searchable contact list. When the user taps "Invite", an SMS
93
+ * invitation is created and the SMS app opens with a pre-filled message.
94
+ *
95
+ * @example
96
+ * ```tsx
97
+ * <VortexInvite
98
+ * componentId="abc123"
99
+ * inviteContactsConfig={{
100
+ * contacts: [
101
+ * { id: '1', name: 'John Doe', phoneNumber: '+1234567890' },
102
+ * { id: '2', name: 'Jane Smith', phoneNumber: '+0987654321' },
103
+ * ],
104
+ * onInvite: (contact, shortLink) => {
105
+ * console.log(`Invited ${contact.name} with link ${shortLink}`);
106
+ * },
107
+ * }}
108
+ * />
109
+ * ```
110
+ */
111
+ inviteContactsConfig?: InviteContactsConfig;
112
+ /**
113
+ * Configuration for the Search Box feature.
114
+ * When provided, enables the Search Box component with a search input,
115
+ * search button, and results list with Connect buttons.
116
+ */
117
+ searchBoxConfig?: SearchBoxConfig;
118
+ /**
119
+ * Locale code for internationalization (e.g., "es", "fr", "zh-TW").
120
+ * If provided and i18n is enabled on the widget, returns localized content.
121
+ */
122
+ locale?: string;
123
+ /**
124
+ * Configuration for invitation suggestions (People You May Know).
125
+ * When provided, enables the Invitation Suggestions component to display
126
+ * suggested contacts with Invite/Dismiss buttons.
127
+ */
128
+ invitationSuggestionsConfig?: InvitationSuggestionsConfig;
129
+ /**
130
+ * Configuration for Open Graph unfurl metadata.
131
+ * Used to customize link previews when sharing invitation links.
132
+ *
133
+ * @example
134
+ * ```tsx
135
+ * <VortexInvite
136
+ * componentId="abc123"
137
+ * unfurlConfig={{
138
+ * title: "Join our team!",
139
+ * description: "You've been invited to collaborate",
140
+ * image: "https://example.com/preview.png",
141
+ * }}
142
+ * />
143
+ * ```
144
+ */
145
+ unfurlConfig?: UnfurlConfig;
146
+ /**
147
+ * Configuration for optional native libraries.
148
+ * Specify which libraries you have installed in a single object.
149
+ *
150
+ * @example
151
+ * ```tsx
152
+ * <VortexInvite
153
+ * componentId="abc123"
154
+ * modules={{
155
+ * gradient: 'expo-linear-gradient',
156
+ * haptics: 'expo-haptics',
157
+ * qrCode: 'react-native-qrcode-svg',
158
+ * }}
159
+ * />
160
+ * ```
161
+ */
162
+ modules?: VortexModules;
163
+ }
164
+ export declare function VortexInvite({ componentId, vortexApiUrl, jwt, user, googleIosClientId, googleWebClientId, onSuccess, onError, onClose, contentTokens, widgetConfiguration, group, groups, scope, scopeType, analyticsBaseURL, onEvent, analyticsSegmentation, findFriendsConfig, incomingInvitationsConfig, outgoingInvitationsConfig, inviteContactsConfig, searchBoxConfig, locale, invitationSuggestionsConfig, unfurlConfig, modules, }: VortexInviteProps): React.JSX.Element;
165
+ //# sourceMappingURL=vortexInvite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vortexInvite.d.ts","sourceRoot":"","sources":["../../src/vortexInvite.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGhE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AACxH,OAAO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Y,EACZ,OAAO,GACR,EAAE,iBAAiB,qBAwEnB"}
@@ -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 };