@teamvortexsoftware/vortex-react-native 0.0.13 → 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 (228) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +1227 -11
  3. package/dist/InviteFormCore-D4HkMMo0.d.mts +721 -0
  4. package/dist/InviteFormCore-D9oUCbu7.d.ts +721 -0
  5. package/dist/VortexClient.js +192 -0
  6. package/dist/VortexClient.js.map +1 -0
  7. package/dist/VortexDeferredLinks.js +127 -0
  8. package/dist/VortexDeferredLinks.js.map +1 -0
  9. package/dist/clientInfo.js +45 -0
  10. package/dist/clientInfo.js.map +1 -0
  11. package/dist/components/ContactsPickerModal.js +182 -0
  12. package/dist/components/ContactsPickerModal.js.map +1 -0
  13. package/dist/components/InviteFormCore.js +2141 -0
  14. package/dist/components/InviteFormCore.js.map +1 -0
  15. package/dist/components/InviteFormMobile.js +463 -0
  16. package/dist/components/InviteFormMobile.js.map +1 -0
  17. package/dist/components/InviteFormWeb.js +295 -0
  18. package/dist/components/InviteFormWeb.js.map +1 -0
  19. package/dist/components/PlacedItemToolbar.js +147 -0
  20. package/dist/components/PlacedItemToolbar.js.map +1 -0
  21. package/dist/components/ShareButtons.js +1 -0
  22. package/dist/components/ShareButtons.js.map +1 -0
  23. package/dist/components/VrtxContactsImport.js +234 -0
  24. package/dist/components/VrtxContactsImport.js.map +1 -0
  25. package/dist/components/VrtxEmailInvitations.js +341 -0
  26. package/dist/components/VrtxEmailInvitations.js.map +1 -0
  27. package/dist/components/VrtxFindFriends.js +400 -0
  28. package/dist/components/VrtxFindFriends.js.map +1 -0
  29. package/dist/components/VrtxHeading.js +58 -0
  30. package/dist/components/VrtxHeading.js.map +1 -0
  31. package/dist/components/VrtxIncomingInvitations.js +657 -0
  32. package/dist/components/VrtxIncomingInvitations.js.map +1 -0
  33. package/dist/components/VrtxInvitationSuggestions.js +506 -0
  34. package/dist/components/VrtxInvitationSuggestions.js.map +1 -0
  35. package/dist/components/VrtxInviteContacts.js +512 -0
  36. package/dist/components/VrtxInviteContacts.js.map +1 -0
  37. package/dist/components/VrtxOutgoingInvitations.js +572 -0
  38. package/dist/components/VrtxOutgoingInvitations.js.map +1 -0
  39. package/dist/components/VrtxSearchBox.js +487 -0
  40. package/dist/components/VrtxSearchBox.js.map +1 -0
  41. package/dist/components/VrtxSelect.js +27 -0
  42. package/dist/components/VrtxSelect.js.map +1 -0
  43. package/dist/components/VrtxShareOptions.js +435 -0
  44. package/dist/components/VrtxShareOptions.js.map +1 -0
  45. package/dist/components/VrtxSubmit.js +132 -0
  46. package/dist/components/VrtxSubmit.js.map +1 -0
  47. package/dist/components/VrtxText.js +146 -0
  48. package/dist/components/VrtxText.js.map +1 -0
  49. package/dist/constants/mockData.d.mts +7 -0
  50. package/dist/constants/mockData.d.ts +7 -0
  51. package/dist/constants/mockData.js +48 -0
  52. package/dist/constants/mockData.js.map +1 -0
  53. package/dist/constants/mockData.mjs +22 -0
  54. package/dist/constants/mockData.mjs.map +1 -0
  55. package/dist/context/VortexModulesContext.js +135 -0
  56. package/dist/context/VortexModulesContext.js.map +1 -0
  57. package/dist/hooks/useInvitationFormLogic.d.mts +2 -0
  58. package/dist/hooks/useInvitationFormLogic.d.ts +2 -0
  59. package/dist/hooks/useInvitationFormLogic.js +300 -0
  60. package/dist/hooks/useInvitationFormLogic.js.map +1 -0
  61. package/dist/hooks/useInvitationFormLogic.mjs +276 -0
  62. package/dist/hooks/useInvitationFormLogic.mjs.map +1 -0
  63. package/dist/hooks/usePrefetchWidgetConfiguration.js +117 -0
  64. package/dist/hooks/usePrefetchWidgetConfiguration.js.map +1 -0
  65. package/dist/hooks/useThemeStyles.js +2 -0
  66. package/dist/hooks/useThemeStyles.js.map +1 -0
  67. package/dist/hooks/useVortexInvite.js +467 -56
  68. package/dist/hooks/useVortexInvite.js.map +1 -0
  69. package/dist/index-web.d.mts +93 -0
  70. package/dist/index-web.d.ts +93 -0
  71. package/dist/index-web.js +7397 -0
  72. package/dist/index-web.js.map +1 -0
  73. package/dist/index-web.mjs +7445 -0
  74. package/dist/index-web.mjs.map +1 -0
  75. package/dist/index.d.mts +656 -0
  76. package/dist/index.d.ts +656 -0
  77. package/dist/index.js +10205 -4
  78. package/dist/index.js.map +1 -0
  79. package/dist/index.mjs +10244 -0
  80. package/dist/index.mjs.map +1 -0
  81. package/dist/types/VortexClient.d.ts +106 -0
  82. package/dist/types/VortexClient.d.ts.map +1 -0
  83. package/dist/types/VortexDeferredLinks.d.ts +73 -0
  84. package/dist/types/VortexDeferredLinks.d.ts.map +1 -0
  85. package/dist/types/clientInfo.d.ts +5 -0
  86. package/dist/types/clientInfo.d.ts.map +1 -0
  87. package/dist/types/components/ContactsPickerModal.d.ts +18 -0
  88. package/dist/types/components/ContactsPickerModal.d.ts.map +1 -0
  89. package/dist/types/components/InviteFormCore.d.ts +166 -0
  90. package/dist/types/components/InviteFormCore.d.ts.map +1 -0
  91. package/dist/types/components/InviteFormMobile.d.ts +42 -0
  92. package/dist/types/components/InviteFormMobile.d.ts.map +1 -0
  93. package/dist/types/components/InviteFormWeb.d.ts +87 -0
  94. package/dist/types/components/InviteFormWeb.d.ts.map +1 -0
  95. package/dist/types/components/PlacedItemToolbar.d.ts +16 -0
  96. package/dist/types/components/PlacedItemToolbar.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 +1 -0
  134. package/dist/types/hooks/useThemeStyles.d.ts.map +1 -1
  135. package/dist/types/hooks/useVortexInvite.d.ts +48 -6
  136. package/dist/types/hooks/useVortexInvite.d.ts.map +1 -1
  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 +21 -0
  140. package/dist/types/index.d.ts.map +1 -1
  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/{shared/InvitationResult.js → types/platformOperations.js} +1 -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 +11 -3
  172. package/dist/types/utils/formUtils.d.ts.map +1 -1
  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 +3 -1
  184. package/dist/types/utils/themeUtils.d.ts.map +1 -1
  185. package/dist/types/vortexInvite.d.ts +145 -5
  186. package/dist/types/vortexInvite.d.ts.map +1 -1
  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 +161 -51
  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 +117 -32
  214. package/dist/utils/themeUtils.js.map +1 -0
  215. package/dist/vortexInvite.js +78 -167
  216. package/dist/vortexInvite.js.map +1 -0
  217. package/package.json +69 -31
  218. package/dist/components/Clipboard.js +0 -64
  219. package/dist/shared/api.js +0 -90
  220. package/dist/tests/TestVortexInvite.js +0 -134
  221. package/dist/types/components/Clipboard.d.ts +0 -16
  222. package/dist/types/components/Clipboard.d.ts.map +0 -1
  223. package/dist/types/shared/InvitationResult.d.ts +0 -24
  224. package/dist/types/shared/InvitationResult.d.ts.map +0 -1
  225. package/dist/types/shared/api.d.ts +0 -14
  226. package/dist/types/shared/api.d.ts.map +0 -1
  227. package/dist/types/tests/TestVortexInvite.d.ts +0 -4
  228. package/dist/types/tests/TestVortexInvite.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeUtils.js","sourceRoot":"","sources":["../../src/utils/themeUtils.ts"],"names":[],"mappings":";;AAmDA,gDAoEC;AAKD,kDAuDC;AArKD;;;GAGG;AACH,SAAS,kBAAkB,CAAC,WAA+B;IACzD,IAAI,CAAC,WAAW;QAAE,OAAO,SAAS,CAAC;IAEnC,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC9C,0EAA0E;IAC1E,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAoBD;;GAEG;AACH,SAAgB,kBAAkB,CAAC,mBAAyC;;IAC1E,MAAM,KAAK,GAAG,MAAA,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,aAAa,0CAAE,KAAY,CAAC;IAC/D,MAAM,UAAU,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,cAAc,CAA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B,CAAC","sourcesContent":["import { WidgetConfiguration } from '@teamvortexsoftware/vortex-types';\n\nexport interface ThemeColors {\n containerBackground: string;\n containerForeground: string;\n containerBorder: string;\n primaryButtonBackground: string;\n primaryButtonForeground: string;\n primaryButtonBorder: string;\n secondaryButtonBackground: string;\n secondaryButtonForeground: string;\n secondaryButtonBorder: string;\n}\n\n/**\n * Extracts the color from a CSS border shorthand value (e.g., \"1px solid #c4c4c4\" → \"#c4c4c4\")\n * Returns undefined if the value doesn't match the expected format\n */\nfunction extractBorderColor(borderValue: string | undefined): string | undefined {\n if (!borderValue) return undefined;\n\n const parts = borderValue.trim().split(/\\s+/);\n // Expect exactly 3 parts: width, style, color (e.g., \"1px solid #c4c4c4\")\n if (parts.length === 3) {\n return parts[2];\n }\n\n return undefined;\n}\n\nexport interface FeatureFlags {\n shareableLinks: boolean;\n emailInvitations: boolean;\n shareOptionsCopyLink: boolean;\n shareOptionsSms: boolean;\n shareOptionsEmail: boolean;\n shareOptionsFacebookMessenger: boolean;\n shareOptionsInstagramDms: boolean;\n shareOptionsLinkedInMessaging: boolean;\n shareOptionsTwitterDms: boolean;\n shareOptionsWhatsApp: boolean;\n shareOptionsNativeShareSheet: boolean;\n shareOptionsQrCode: boolean;\n shareOptionsLine: boolean;\n shareEnabled: boolean;\n shareOptionsOrder: string[];\n}\n\n/**\n * Extracts theme colors from widget configuration\n */\nexport function extractThemeColors(widgetConfiguration?: WidgetConfiguration): ThemeColors {\n const props = widgetConfiguration?.configuration?.props as any;\n const themeValue = props?.['vortex.theme']?.value;\n\n // Normalize theme entries to an array of { key, value }\n let entries: Array<{ key?: string; value?: string }> = [];\n if (Array.isArray(themeValue)) {\n entries = themeValue as Array<{ key?: string; value?: string }>;\n } else if (themeValue && Array.isArray(themeValue.options)) {\n entries = themeValue.options as Array<{ key?: string; value?: string }>;\n } else if (themeValue && typeof themeValue === 'object') {\n // Fallback: treat object map as entries if present\n entries = Object.keys(themeValue)\n .filter((k) => k.startsWith('--'))\n .map((k) => ({ key: k, value: String((themeValue as any)[k]) }));\n }\n\n const colorMap: Record<string, string> = {};\n entries.forEach((item: any) => {\n const k = item?.key;\n const v = item?.value;\n if (typeof k === 'string' && typeof v === 'string') {\n colorMap[k] = v;\n }\n });\n\n return {\n containerBackground:\n colorMap['--vrtx-root-background'] || colorMap['--color-background'] || '#ffffff',\n containerForeground:\n colorMap['--vrtx-root-color'] || colorMap['--color-foreground'] || '#666666',\n containerBorder:\n extractBorderColor(colorMap['--vrtx-root-border']) ||\n extractBorderColor(colorMap['--vrtx-input-border']) ||\n colorMap['--color-border'] ||\n '#c4c4c4',\n primaryButtonBackground:\n colorMap['--vrtx-submit-primary-background'] ||\n colorMap['--vrtx-button-primary-background'] ||\n colorMap['--color-primary-background'] ||\n '#197af3',\n primaryButtonForeground:\n colorMap['--vrtx-submit-primary-color'] ||\n colorMap['--color-primary-foreground'] ||\n '#ffffff',\n primaryButtonBorder:\n extractBorderColor(colorMap['--vrtx-submit-primary-border']) ||\n colorMap['--vrtx-submit-primary-border-color'] ||\n colorMap['--vrtx-button-primary-border-color'] ||\n colorMap['--color-primary-border'] ||\n '#000000',\n secondaryButtonBackground:\n colorMap['--vrtx-submit-secondary-background'] ||\n colorMap['--vrtx-button-secondary-background'] ||\n colorMap['--color-secondary-background'] ||\n '#dfdfdf',\n secondaryButtonForeground:\n colorMap['--vrtx-submit-secondary-color'] ||\n colorMap['--vrtx-button-secondary-color'] ||\n colorMap['--color-secondary-foreground'] ||\n '#000000',\n secondaryButtonBorder:\n extractBorderColor(colorMap['--vrtx-submit-secondary-border']) ||\n colorMap['--vrtx-submit-secondary-border-color'] ||\n colorMap['--vrtx-button-secondary-border-color'] ||\n colorMap['--color-secondary-border'] ||\n '#c4c4c4',\n };\n}\n\n/**\n * Extracts feature flags from widget configuration\n */\nexport function extractFeatureFlags(widgetConfiguration?: WidgetConfiguration): FeatureFlags {\n const props = widgetConfiguration?.configuration?.props as any;\n const features: string[] = Array.isArray(props?.['vortex.components']?.value)\n ? props['vortex.components'].value\n : [];\n\n const shareOptions: string[] = Array.isArray(props?.['vortex.components.share.options']?.value)\n ? props['vortex.components.share.options'].value\n : [];\n\n // Detect presence of blocks in the form tree (row/column/block with subtype)\n const formValue = props?.['vortex.components.form']?.value;\n let hasEmailBlock = false;\n let hasShareBlock = false;\n\n const traverse = (node: any) => {\n if (!node) return;\n if (Array.isArray(node)) {\n node.forEach(traverse);\n return;\n }\n if (node.type === 'block') {\n if (node.subtype === 'vrtx-email-invitations') hasEmailBlock = true;\n if (node.subtype === 'vrtx-share-options') hasShareBlock = true;\n }\n if (node.children && node.children.length) {\n node.children.forEach(traverse);\n }\n };\n\n if (formValue?.root) {\n traverse(formValue.root);\n } else if (Array.isArray(formValue)) {\n traverse(formValue);\n }\n\n return {\n // Email invites if feature enabled or email block present\n emailInvitations: features.includes('vortex.components.emailinvitations') || hasEmailBlock,\n // Share section enabled if share block present or explicit feature (if ever provided)\n shareEnabled: hasShareBlock || features.includes('vortex.components.share'),\n shareableLinks: hasShareBlock || features.includes('vortex.components.share'),\n shareOptionsCopyLink: shareOptions.includes('copyLink'),\n shareOptionsFacebookMessenger: shareOptions.includes('facebookMessenger'),\n shareOptionsInstagramDms: shareOptions.includes('instagramDms'),\n shareOptionsLinkedInMessaging: shareOptions.includes('linkedInMessaging'),\n shareOptionsNativeShareSheet: shareOptions.includes('nativeShareSheet'),\n shareOptionsQrCode: shareOptions.includes('qrCode'),\n shareOptionsSms: shareOptions.includes('sms'),\n shareOptionsTwitterDms: shareOptions.includes('twitterDms'),\n shareOptionsEmail: shareOptions.includes('email'),\n shareOptionsWhatsApp: shareOptions.includes('whatsApp'),\n shareOptionsLine: shareOptions.includes('line'),\n shareOptionsOrder: shareOptions,\n } as FeatureFlags;\n}\n"]}
@@ -1,172 +1,83 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
5
35
  Object.defineProperty(exports, "__esModule", { value: true });
6
36
  exports.VortexInvite = VortexInvite;
7
- const react_1 = __importDefault(require("react"));
37
+ const react_1 = __importStar(require("react"));
8
38
  const react_native_1 = require("react-native");
9
- const useVortexInvite_1 = require("./hooks/useVortexInvite");
10
- const ShareButtons_1 = require("./components/ShareButtons");
11
- function VortexInvite({ widgetId, environmentId, vortexApiHost, isLoading = false, jwt, onSuccess, onError, contentTokens, }) {
12
- const { error, fetching, loading, email, setEmail, opacity, themeColors, themeStyles, has, inviteLoading, showSuccessMessage, handleInviteClick, handleShareLink, handleCopyLink, handleSmsShare, handleEmailShare, getShareableLink, formLayout, } = (0, useVortexInvite_1.useVortexInvite)({
13
- widgetId,
14
- environmentId,
15
- vortexApiUrl: vortexApiHost,
16
- isLoading,
17
- jwt,
18
- onSuccess,
19
- onError,
20
- });
21
- if (error === null || error === void 0 ? void 0 : error.message) {
22
- return <react_native_1.Text data-testid="error">{error.message}</react_native_1.Text>;
23
- }
24
- if (fetching || loading) {
25
- return <react_native_1.Animated.View style={[styles.skeleton, { opacity }]}/>;
26
- }
27
- // Theme styles are now provided by the hook
28
- // If we have a grid layout with separate columns for email and share, we'll use that layout
29
- if ((formLayout === null || formLayout === void 0 ? void 0 : formLayout.isGridLayout) && (formLayout === null || formLayout === void 0 ? void 0 : formLayout.hasSeparateColumns)) {
30
- return (<react_native_1.View style={[styles.container, themeStyles.containerStyles]}>
31
- <react_native_1.View style={styles.gridContainer}>
32
- {/* Email invitation column */}
33
- {(has === null || has === void 0 ? void 0 : has.emailInvitations) && (<react_native_1.View style={styles.gridItem}>
34
- <react_native_1.Text style={[styles.introText, themeStyles.textStyles]}>Invite People</react_native_1.Text>
35
- <react_native_1.TextInput style={[styles.input, themeStyles.inputStyles]} placeholder={formLayout.emailPlaceholder} placeholderTextColor={themeColors.containerForeground} value={email} onChangeText={setEmail} autoCapitalize="none"/>
36
- <react_native_1.View style={styles.buttonContainer}>
37
- <react_native_1.Pressable style={[styles.submitButton, themeStyles.primaryButton, inviteLoading && styles.disabledButton]} onPress={() => handleInviteClick(contentTokens)} disabled={inviteLoading}>
38
- {inviteLoading ? (<react_native_1.ActivityIndicator size="small" color={themeColors.containerBackground}/>) : (<react_native_1.Text style={[styles.submitButtonText, themeStyles.primaryButtonText]}>
39
- {formLayout.submitButtonLabel}
40
- </react_native_1.Text>)}
41
- </react_native_1.Pressable>
42
- {showSuccessMessage && (<react_native_1.View style={styles.successMessageContainer}>
43
- <react_native_1.Text style={styles.successMessage}>Success!</react_native_1.Text>
44
- </react_native_1.View>)}
45
- </react_native_1.View>
46
- </react_native_1.View>)}
47
-
48
- {/* Share buttons column */}
49
- {(has === null || has === void 0 ? void 0 : has.shareableLinks) && (<react_native_1.View style={styles.gridItem}>
50
- <react_native_1.View style={styles.shareButtonsContainer}>
51
- <ShareButtons_1.ShareButtons has={has} themeColors={themeColors} themeStyles={themeStyles} handleShareLink={handleShareLink} handleCopyLink={handleCopyLink} handleSmsShare={handleSmsShare} handleEmailShare={handleEmailShare} shareableLink={getShareableLink()}/>
52
- </react_native_1.View>
53
- </react_native_1.View>)}
54
- </react_native_1.View>
55
- </react_native_1.View>);
56
- }
57
- // Default stacked layout
58
- return (<react_native_1.View style={[styles.container, themeStyles.containerStyles]}>
59
- {(has === null || has === void 0 ? void 0 : has.emailInvitations) && (<react_native_1.View style={styles.inviteContainer}>
60
- <react_native_1.Text style={[styles.introText, themeStyles.textStyles]}>Invite People</react_native_1.Text>
61
- <react_native_1.TextInput style={[styles.input, themeStyles.inputStyles]} placeholder={(formLayout === null || formLayout === void 0 ? void 0 : formLayout.emailPlaceholder) || 'Enter email'} placeholderTextColor={themeColors.containerForeground} value={email} onChangeText={setEmail} autoCapitalize="none"/>
62
- <react_native_1.View style={styles.buttonContainer}>
63
- <react_native_1.Pressable style={[styles.submitButton, themeStyles.primaryButton, inviteLoading && styles.disabledButton]} onPress={() => handleInviteClick(contentTokens)} disabled={inviteLoading}>
64
- {inviteLoading ? (<react_native_1.ActivityIndicator size="small" color={themeColors.containerBackground}/>) : (<react_native_1.Text style={[styles.submitButtonText, themeStyles.primaryButtonText]}>
65
- {(formLayout === null || formLayout === void 0 ? void 0 : formLayout.submitButtonLabel) || 'Invite'}
66
- </react_native_1.Text>)}
67
- </react_native_1.Pressable>
68
- {showSuccessMessage && (<react_native_1.View style={styles.successMessageContainer}>
69
- <react_native_1.Text style={styles.successMessage}>Success!</react_native_1.Text>
70
- </react_native_1.View>)}
71
- </react_native_1.View>
72
- </react_native_1.View>)}
73
-
74
- {(has === null || has === void 0 ? void 0 : has.shareableLinks) && (<react_native_1.View style={styles.shareContainer}>
75
- {(has === null || has === void 0 ? void 0 : has.emailInvitations) && <react_native_1.Text style={[styles.divider, themeStyles.textStyles]}>OR</react_native_1.Text>}
76
-
77
- <react_native_1.View style={styles.shareButtonsContainer}>
78
- <ShareButtons_1.ShareButtons has={has} themeColors={themeColors} themeStyles={themeStyles} handleShareLink={handleShareLink} handleCopyLink={handleCopyLink} handleSmsShare={handleSmsShare} handleEmailShare={handleEmailShare} shareableLink={getShareableLink()}/>
79
- </react_native_1.View>
80
- </react_native_1.View>)}
81
- </react_native_1.View>);
39
+ const InviteFormMobile_1 = require("./components/InviteFormMobile");
40
+ const VortexModulesContext_1 = require("./context/VortexModulesContext");
41
+ const featureWarnings_1 = require("./utils/featureWarnings");
42
+ // Import native module loaders - these contain the actual require() statements
43
+ const nativeLoaders = __importStar(require("./utils/moduleLoaders"));
44
+ 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, }) {
45
+ // Create the modules configuration object with native loaders
46
+ const modulesConfig = (0, react_1.useMemo)(() => ({
47
+ modules,
48
+ // Inject native loaders - these contain the actual require() statements
49
+ loaders: {
50
+ loadGradientComponent: nativeLoaders.loadGradientComponent,
51
+ parseCSSLinearGradient: nativeLoaders.parseCSSLinearGradient,
52
+ angleToGradientPoints: nativeLoaders.angleToGradientPoints,
53
+ parseGradientFirstColor: nativeLoaders.parseGradientFirstColor,
54
+ },
55
+ }), [modules]);
56
+ // Warn about unsupported props in development
57
+ (0, react_1.useEffect)(() => {
58
+ if (__DEV__) {
59
+ if (contentTokens) {
60
+ console.warn('[VortexInvite] contentTokens prop is not yet supported in the new implementation');
61
+ }
62
+ if (onSuccess) {
63
+ console.warn('[VortexInvite] onSuccess callback is not yet supported in the new implementation');
64
+ }
65
+ if (onError) {
66
+ console.warn('[VortexInvite] onError callback is not yet supported in the new implementation');
67
+ }
68
+ }
69
+ }, [contentTokens, onSuccess, onError]);
70
+ // Print feature warnings when widget configuration is available
71
+ (0, react_1.useEffect)(() => {
72
+ if (widgetConfiguration) {
73
+ const requirements = (0, featureWarnings_1.detectRequiredFeatures)(widgetConfiguration);
74
+ (0, featureWarnings_1.printFeatureWarnings)(requirements, modulesConfig);
75
+ }
76
+ }, [widgetConfiguration, modulesConfig]);
77
+ // Map old prop names to new ones
78
+ const platform = react_native_1.Platform.OS === 'ios' ? 'ios' : 'android';
79
+ return (<VortexModulesContext_1.VortexModulesProvider config={modulesConfig}>
80
+ <InviteFormMobile_1.InviteFormMobile componentId={componentId} vortexApiUrl={vortexApiUrl || "https://client-api.vortexsoftware.com"} jwt={jwt} user={user} googleIosClientId={googleIosClientId} googleWebClientId={googleWebClientId} widgetConfiguration={widgetConfiguration} group={group} groups={groups} scope={scope} scopeType={scopeType} platform={platform} onClose={onClose} analyticsBaseURL={analyticsBaseURL} onEvent={onEvent} analyticsSegmentation={analyticsSegmentation} findFriendsConfig={findFriendsConfig} incomingInvitationsConfig={incomingInvitationsConfig} outgoingInvitationsConfig={outgoingInvitationsConfig} inviteContactsConfig={inviteContactsConfig} searchBoxConfig={searchBoxConfig} locale={locale} invitationSuggestionsConfig={invitationSuggestionsConfig} unfurlConfig={unfurlConfig}/>
81
+ </VortexModulesContext_1.VortexModulesProvider>);
82
82
  }
83
- const styles = react_native_1.StyleSheet.create({
84
- container: {
85
- padding: 15,
86
- display: 'flex',
87
- flexDirection: 'column',
88
- borderRadius: 8,
89
- borderWidth: 1,
90
- },
91
- gridContainer: {
92
- flexDirection: 'row',
93
- flexWrap: 'wrap',
94
- justifyContent: 'space-between',
95
- },
96
- gridItem: {
97
- flex: 1,
98
- padding: 8,
99
- minWidth: 250, // Ensure items have minimum width for smaller screens
100
- },
101
- disabledButton: {
102
- opacity: 0.7,
103
- },
104
- successMessageContainer: {
105
- marginTop: 8,
106
- padding: 8,
107
- alignItems: 'center',
108
- width: '100%',
109
- },
110
- successMessage: {
111
- color: 'green',
112
- fontWeight: 'bold',
113
- fontSize: 16,
114
- },
115
- inviteContainer: {
116
- display: 'flex',
117
- flexDirection: 'column',
118
- justifyContent: 'center',
119
- alignItems: 'center',
120
- marginTop: 8,
121
- },
122
- introText: {
123
- marginBottom: 8,
124
- fontSize: 24,
125
- fontWeight: 'bold',
126
- textAlign: 'center',
127
- },
128
- input: {
129
- width: '100%',
130
- borderWidth: 1,
131
- padding: 10,
132
- borderRadius: 5,
133
- marginBottom: 8,
134
- },
135
- buttonContainer: {
136
- marginTop: 16,
137
- marginBottom: 8,
138
- width: '100%',
139
- },
140
- submitButton: {
141
- padding: 12,
142
- borderRadius: 5,
143
- alignItems: 'center',
144
- borderWidth: 1,
145
- },
146
- submitButtonText: {
147
- fontWeight: '500',
148
- textTransform: 'none',
149
- },
150
- skeleton: {
151
- width: '100%',
152
- height: 50,
153
- backgroundColor: 'lightgray',
154
- borderRadius: 5,
155
- },
156
- shareContainer: {
157
- marginTop: 16,
158
- alignItems: 'center',
159
- },
160
- divider: {
161
- marginVertical: 10,
162
- fontSize: 16,
163
- fontWeight: 'bold',
164
- textAlign: 'center',
165
- },
166
- shareButtonsContainer: {
167
- flexDirection: 'row',
168
- flexWrap: 'wrap',
169
- justifyContent: 'center',
170
- },
171
- // Share button styles moved to ShareButtons.tsx
172
- });
83
+ //# sourceMappingURL=vortexInvite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vortexInvite.js","sourceRoot":"","sources":["../src/vortexInvite.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoLA,oCAoGC;AAxRD,+CAAkD;AAElD,+CAAwC;AACxC,oEAAiE;AAOjE,yEAIwC;AACxC,6DAAuF;AACvF,+EAA+E;AAC/E,qEAAuD;AAmKvD,SAAgB,YAAY,CAAC,EAC3B,WAAW,EACX,YAAY,EACZ,GAAG,EACH,I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A2B,CAAC,CACzD,YAAY,CAAC,CAAC,YAAY,CAAC,EAE/B;IAAA,EAAE,4CAAqB,CAAC,CACzB,CAAC;AACJ,CAAC","sourcesContent":["import React, { useEffect, useMemo } from 'react';\nimport { UnsignedData } from '@teamvortexsoftware/vortex-types';\nimport { Platform } from 'react-native';\nimport { InviteFormMobile } from './components/InviteFormMobile';\nimport { VortexAnalyticsEvent, GroupDTO } from './utils/analytics';\nimport { FindFriendsConfig } from './types/findFriends';\nimport { IncomingInvitationsConfig, OutgoingInvitationsConfig, InvitationSuggestionsConfig } from './types/invitations';\nimport { InviteContactsConfig } from './types/inviteContacts';\nimport { UnfurlConfig } from './types/unfurlConfig';\nimport { SearchBoxConfig } from './types/searchBox';\nimport {\n VortexModulesProvider,\n type VortexModules,\n type ModuleLoaders,\n} from './context/VortexModulesContext';\nimport { detectRequiredFeatures, printFeatureWarnings } from './utils/featureWarnings';\n// Import native module loaders - these contain the actual require() statements\nimport * as nativeLoaders from './utils/moduleLoaders';\n\n// Keep the existing type exports for backward compatibility\nexport type VortexActionType = 'invite' | 'share';\n\nexport interface VortexActionResult {\n type: VortexActionType;\n data: string;\n}\n\nexport interface Attributes {\n [key: string]: { value: string | string[]; type: string; role?: string };\n}\n\nexport interface VortexInviteProps {\n vortexApiUrl?: string;\n componentId: string;\n jwt?: string;\n user?: string | UnsignedData | undefined;\n googleIosClientId?: string;\n googleWebClientId?: string; // Required for Google Contacts on Android\n onSuccess?: (result: VortexActionResult) => void;\n onError?: (error: Error, type: VortexActionType) => void;\n onClose?: () => void;\n contentTokens?: Attributes;\n widgetConfiguration?: any; // Prefetched widget configuration for instant rendering\n group?: {\n name: string;\n type: string;\n id?: string;\n groupId?: string;\n };\n groups?: GroupDTO[];\n scope?: string;\n scopeType?: string;\n // Analytics props\n analyticsBaseURL?: string; // Defaults to production collector (https://collector.vortexsoftware.com)\n onEvent?: (event: VortexAnalyticsEvent) => void; // Callback for analytics events\n analyticsSegmentation?: Record<string, any>; // Segmentation data for analytics\n /**\n * Configuration for the Find Friends feature.\n * When provided, enables the Find Friends component to display\n * contacts with Connect buttons. When Connect is tapped and onConnect\n * returns true, an invitation is created via the Vortex backend.\n *\n * @example\n * ```tsx\n * <VortexInvite\n * componentId=\"abc123\"\n * findFriendsConfig={{\n * contacts: [\n * { userId: 'user-123', name: 'John Doe', subtitle: '@johndoe' },\n * { userId: 'user-456', name: 'Jane Smith', avatarUrl: 'https://...' },\n * ],\n * onConnect: async (contact) => {\n * // Perform any pre-connection validation\n * // Return true to create the invitation via Vortex backend\n * return true;\n * },\n * onInvitationCreated: (contact) => {\n * // Called after invitation is successfully created\n * },\n * }}\n * />\n * ```\n */\n findFriendsConfig?: FindFriendsConfig;\n /**\n * Configuration for the Incoming Invitations feature.\n * When provided, enables the Incoming Invitations component to display\n * invitations the user has received with Accept/Delete buttons.\n */\n incomingInvitationsConfig?: IncomingInvitationsConfig;\n /**\n * Configuration for the Outgoing Invitations feature.\n * When provided, enables the Outgoing Invitations component to display\n * invitations the user has sent with a Cancel button.\n */\n outgoingInvitationsConfig?: OutgoingInvitationsConfig;\n /**\n * Configuration for the Invite Contacts feature.\n * When provided, enables the Invite Contacts component to display\n * a list of contacts that can be invited via SMS.\n *\n * The component shows an \"Invite your contacts\" link that expands to\n * a searchable contact list. When the user taps \"Invite\", an SMS\n * invitation is created and the SMS app opens with a pre-filled message.\n *\n * @example\n * ```tsx\n * <VortexInvite\n * componentId=\"abc123\"\n * inviteContactsConfig={{\n * contacts: [\n * { id: '1', name: 'John Doe', phoneNumber: '+1234567890' },\n * { id: '2', name: 'Jane Smith', phoneNumber: '+0987654321' },\n * ],\n * onInvite: (contact, shortLink) => {\n * console.log(`Invited ${contact.name} with link ${shortLink}`);\n * },\n * }}\n * />\n * ```\n */\n inviteContactsConfig?: InviteContactsConfig;\n /**\n * Configuration for the Search Box feature.\n * When provided, enables the Search Box component with a search input,\n * search button, and results list with Connect buttons.\n */\n searchBoxConfig?: SearchBoxConfig;\n /**\n * Locale code for internationalization (e.g., \"es\", \"fr\", \"zh-TW\").\n * If provided and i18n is enabled on the widget, returns localized content.\n */\n locale?: string;\n /**\n * Configuration for invitation suggestions (People You May Know).\n * When provided, enables the Invitation Suggestions component to display\n * suggested contacts with Invite/Dismiss buttons.\n */\n invitationSuggestionsConfig?: InvitationSuggestionsConfig;\n /**\n * Configuration for Open Graph unfurl metadata.\n * Used to customize link previews when sharing invitation links.\n *\n * @example\n * ```tsx\n * <VortexInvite\n * componentId=\"abc123\"\n * unfurlConfig={{\n * title: \"Join our team!\",\n * description: \"You've been invited to collaborate\",\n * image: \"https://example.com/preview.png\",\n * }}\n * />\n * ```\n */\n unfurlConfig?: UnfurlConfig;\n\n // ============================================================================\n // Optional Feature Modules\n // ============================================================================\n\n /**\n * Configuration for optional native libraries.\n * Specify which libraries you have installed in a single object.\n *\n * @example\n * ```tsx\n * <VortexInvite\n * componentId=\"abc123\"\n * modules={{\n * gradient: 'expo-linear-gradient',\n * haptics: 'expo-haptics',\n * qrCode: 'react-native-qrcode-svg',\n * }}\n * />\n * ```\n */\n modules?: VortexModules;\n}\n\nexport function VortexInvite({\n componentId,\n vortexApiUrl,\n jwt,\n user,\n googleIosClientId,\n googleWebClientId,\n onSuccess,\n onError,\n onClose,\n contentTokens,\n widgetConfiguration,\n group,\n groups,\n scope,\n scopeType,\n analyticsBaseURL,\n onEvent,\n analyticsSegmentation,\n findFriendsConfig,\n incomingInvitationsConfig,\n outgoingInvitationsConfig,\n inviteContactsConfig,\n searchBoxConfig,\n locale,\n invitationSuggestionsConfig,\n unfurlConfig,\n modules,\n}: VortexInviteProps) {\n // Create the modules configuration object with native loaders\n const modulesConfig = useMemo(\n () => ({\n modules,\n // Inject native loaders - these contain the actual require() statements\n loaders: {\n loadGradientComponent: nativeLoaders.loadGradientComponent,\n parseCSSLinearGradient: nativeLoaders.parseCSSLinearGradient,\n angleToGradientPoints: nativeLoaders.angleToGradientPoints,\n parseGradientFirstColor: nativeLoaders.parseGradientFirstColor,\n } as ModuleLoaders,\n }),\n [modules]\n );\n\n // Warn about unsupported props in development\n useEffect(() => {\n if (__DEV__) {\n if (contentTokens) {\n console.warn('[VortexInvite] contentTokens prop is not yet supported in the new implementation');\n }\n if (onSuccess) {\n console.warn('[VortexInvite] onSuccess callback is not yet supported in the new implementation');\n }\n if (onError) {\n console.warn('[VortexInvite] onError callback is not yet supported in the new implementation');\n }\n }\n }, [contentTokens, onSuccess, onError]);\n\n // Print feature warnings when widget configuration is available\n useEffect(() => {\n if (widgetConfiguration) {\n const requirements = detectRequiredFeatures(widgetConfiguration);\n printFeatureWarnings(requirements, modulesConfig);\n }\n }, [widgetConfiguration, modulesConfig]);\n\n // Map old prop names to new ones\n const platform = Platform.OS === 'ios' ? 'ios' : 'android';\n\n return (\n <VortexModulesProvider config={modulesConfig}>\n <InviteFormMobile\n componentId={componentId}\n vortexApiUrl={vortexApiUrl || \"https://client-api.vortexsoftware.com\"}\n jwt={jwt}\n user={user}\n googleIosClientId={googleIosClientId}\n googleWebClientId={googleWebClientId}\n widgetConfiguration={widgetConfiguration}\n group={group}\n groups={groups}\n scope={scope}\n scopeType={scopeType}\n platform={platform}\n onClose={onClose}\n analyticsBaseURL={analyticsBaseURL}\n onEvent={onEvent}\n analyticsSegmentation={analyticsSegmentation}\n findFriendsConfig={findFriendsConfig}\n incomingInvitationsConfig={incomingInvitationsConfig}\n outgoingInvitationsConfig={outgoingInvitationsConfig}\n inviteContactsConfig={inviteContactsConfig}\n searchBoxConfig={searchBoxConfig}\n locale={locale}\n invitationSuggestionsConfig={invitationSuggestionsConfig}\n unfurlConfig={unfurlConfig}\n />\n </VortexModulesProvider>\n );\n}\n"]}
package/package.json CHANGED
@@ -1,59 +1,97 @@
1
1
  {
2
2
  "name": "@teamvortexsoftware/vortex-react-native",
3
- "description": "",
3
+ "description": "Vortex React Native SDK",
4
4
  "author": "@teamvortexsoftware",
5
- "version": "0.0.13",
5
+ "license": "Apache-2.0",
6
+ "version": "1.0.1",
6
7
  "files": [
7
8
  "dist"
8
9
  ],
9
10
  "main": "./dist/index.js",
11
+ "module": "./dist/index.mjs",
10
12
  "exports": {
11
13
  ".": {
12
- "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.mjs",
13
16
  "require": "./dist/index.js",
14
- "types": "./dist/types/index.d.ts"
17
+ "react-native": "./dist/index.js",
18
+ "source": "./src/index.tsx"
15
19
  },
16
- "./runtime": "./dist/index.js"
20
+ "./web": {
21
+ "types": "./dist/index-web.d.ts",
22
+ "import": "./dist/index-web.mjs",
23
+ "require": "./dist/index-web.js",
24
+ "source": "./src/index-web.tsx"
25
+ },
26
+ "./hooks/useInvitationFormLogic": {
27
+ "types": "./dist/hooks/useInvitationFormLogic.d.ts",
28
+ "import": "./dist/hooks/useInvitationFormLogic.mjs",
29
+ "require": "./dist/hooks/useInvitationFormLogic.js",
30
+ "source": "./src/hooks/useInvitationFormLogic.ts"
31
+ },
32
+ "./constants/mockData": {
33
+ "types": "./dist/constants/mockData.d.ts",
34
+ "import": "./dist/constants/mockData.mjs",
35
+ "require": "./dist/constants/mockData.js",
36
+ "source": "./src/constants/mockData.ts"
37
+ },
38
+ "./utils/contactUtils": {
39
+ "types": "./dist/utils/contactUtils.d.ts",
40
+ "import": "./dist/utils/contactUtils.mjs",
41
+ "require": "./dist/utils/contactUtils.js",
42
+ "source": "./src/utils/contactUtils.ts"
43
+ }
17
44
  },
18
- "types": "dist/types/index.d.ts",
45
+ "types": "dist/index.d.ts",
19
46
  "react-native": "dist/index.js",
20
- "devDependencies": {
21
- "@eslint/js": "^9.24.0",
22
- "@types/react": "^19.0.10",
23
- "@types/react-native-vector-icons": "^6.4.18",
24
- "eslint": "^9.24.0",
25
- "eslint-plugin-react-native": "^4.1.0",
26
- "typescript": "5.8.3",
27
- "typescript-eslint": "^8.30.1",
28
- "@teamvortexsoftware/eslint-config": "0.0.0",
29
- "@teamvortexsoftware/typescript-config": "0.0.0"
30
- },
31
47
  "dependencies": {
32
- "react-native-qrcode-svg": "^6.3.15",
33
- "react-native-svg": "^15.12.0",
34
48
  "react-native-uuid": "^2.0.3",
35
- "react-native-vector-icons": "^10.2.0",
36
- "@teamvortexsoftware/vortex-core": "0.0.1",
37
- "@teamvortexsoftware/vortex-shared-ui": "0.0.1"
49
+ "react-native-vector-icons": "^10.2.0"
38
50
  },
39
51
  "peerDependencies": {
40
- "react": ">=19.0.0",
41
- "react-native": ">=0.79.0",
42
52
  "@react-native-clipboard/clipboard": ">=1.16.2",
43
- "expo-clipboard": ">=7.1.4"
53
+ "@react-native-google-signin/google-signin": ">=16.0.0",
54
+ "expo-clipboard": ">=7.1.4",
55
+ "expo-haptics": ">=13.0.0",
56
+ "expo-linear-gradient": ">=12.0.0",
57
+ "expo-sharing": ">=13.0.0",
58
+ "react": ">=18.0.0",
59
+ "react-native": ">=0.75.0",
60
+ "react-native-linear-gradient": ">=2.6.0",
61
+ "react-native-qrcode-svg": ">=6.3.0",
62
+ "react-native-svg": ">=15.0.0",
63
+ "react-qr-code": ">=2.0.0"
44
64
  },
45
65
  "peerDependenciesMeta": {
46
66
  "@react-native-clipboard/clipboard": {
47
67
  "optional": true
48
68
  },
69
+ "@react-native-google-signin/google-signin": {
70
+ "optional": true
71
+ },
49
72
  "expo-clipboard": {
50
73
  "optional": true
74
+ },
75
+ "expo-haptics": {
76
+ "optional": true
77
+ },
78
+ "expo-linear-gradient": {
79
+ "optional": true
80
+ },
81
+ "expo-sharing": {
82
+ "optional": true
83
+ },
84
+ "react-native-linear-gradient": {
85
+ "optional": true
86
+ },
87
+ "react-native-qrcode-svg": {
88
+ "optional": true
89
+ },
90
+ "react-native-svg": {
91
+ "optional": true
92
+ },
93
+ "react-qr-code": {
94
+ "optional": true
51
95
  }
52
- },
53
- "scripts": {
54
- "build": "tsc",
55
- "prepublish": "pnpm run build",
56
- "lint": "eslint src/",
57
- "type-check": "tsc --noEmit"
58
96
  }
59
97
  }
@@ -1,64 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var _a, _b;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.Clipboard = void 0;
14
- console.log('[Vortex] Clipboard.ts: Starting initialization');
15
- // Initialize with a placeholder that will be replaced
16
- let Clipboard;
17
- // Try to load expo-clipboard first
18
- try {
19
- console.log('[Vortex] Clipboard.ts: Trying to load expo-clipboard');
20
- const expoClipboard = require('expo-clipboard');
21
- if ((expoClipboard === null || expoClipboard === void 0 ? void 0 : expoClipboard.setStringAsync) && (expoClipboard === null || expoClipboard === void 0 ? void 0 : expoClipboard.getStringAsync)) {
22
- exports.Clipboard = Clipboard = {
23
- setString: expoClipboard.setStringAsync,
24
- getString: expoClipboard.getStringAsync,
25
- };
26
- console.log('[Vortex] Clipboard.ts: Using expo-clipboard implementation');
27
- }
28
- else {
29
- console.error('[Vortex] Clipboard.ts: expo-clipboard is missing required methods');
30
- throw new Error('expo-clipboard is missing required methods');
31
- }
32
- }
33
- catch (error) {
34
- console.error('[Vortex] Clipboard.ts: Failed to use expo-clipboard:', error);
35
- // Fall back to @react-native-clipboard/clipboard
36
- try {
37
- console.log('[Vortex] Clipboard.ts: Trying to load @react-native-clipboard/clipboard');
38
- const rnClipboard = require('@react-native-clipboard/clipboard');
39
- if (((_a = rnClipboard === null || rnClipboard === void 0 ? void 0 : rnClipboard.default) === null || _a === void 0 ? void 0 : _a.setString) && ((_b = rnClipboard.default) === null || _b === void 0 ? void 0 : _b.getString)) {
40
- console.log('[Vortex] Clipboard.ts: Successfully found @react-native-clipboard/clipboard methods');
41
- exports.Clipboard = Clipboard = {
42
- setString: (content) => __awaiter(void 0, void 0, void 0, function* () {
43
- rnClipboard.default.setString(content);
44
- }),
45
- getString: () => __awaiter(void 0, void 0, void 0, function* () {
46
- // @react-native-clipboard/clipboard returns string or undefined
47
- return Promise.resolve(rnClipboard.default.getString() || '');
48
- }),
49
- };
50
- console.log('[Vortex] Clipboard.ts: Using @react-native-clipboard/clipboard implementation');
51
- }
52
- else {
53
- console.error('[Vortex] Clipboard.ts: @react-native-clipboard/clipboard is missing required methods');
54
- throw new Error('@react-native-clipboard/clipboard is missing required methods');
55
- }
56
- }
57
- catch (e) {
58
- console.error('[Vortex] Clipboard.ts: Failed to use @react-native-clipboard/clipboard:', e);
59
- // If we get here, neither clipboard implementation is available
60
- console.error('[Vortex] Clipboard.ts: No clipboard implementation found');
61
- throw new Error('No clipboard implementation found. Please install expo-clipboard or @react-native-clipboard/clipboard');
62
- }
63
- }
64
- exports.default = Clipboard;
@@ -1,90 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- class VortexClient {
13
- constructor(baseUrl, sessionId) {
14
- this.sessionId = sessionId;
15
- // trim ending /
16
- this.baseUrl = baseUrl.replace(/\/+$/, '');
17
- }
18
- getWidgetConfiguration(widgetId, jwt, environmentId) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- const url = `${this.baseUrl}/api/v1/environment/${environmentId}/widgets/${widgetId}`;
21
- console.log('[VortexClient] getWidgetConfiguration', { url });
22
- const response = yield fetch(url, {
23
- headers: {
24
- Authorization: `Bearer ${jwt}`,
25
- 'x-session-id': this.sessionId,
26
- },
27
- });
28
- if (!response.ok) {
29
- const body = yield response.text();
30
- console.error('[VortexClient] getWidgetConfiguration', { status: response.status, body });
31
- throw new Error(`Error fetching widget configuration from ${url}: ${response.status}`);
32
- }
33
- const data = yield response.json();
34
- console.log('[VortexClient] getWidgetConfiguration', { data });
35
- return data;
36
- });
37
- }
38
- createInvite(jwt, widgetConfigurationId, environmentId, payload) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- const response = yield fetch(`${this.baseUrl}/api/v1/environment/${environmentId}/widget-configuration/${widgetConfigurationId}/invite`, {
41
- method: 'POST',
42
- headers: {
43
- 'Content-Type': 'application/json',
44
- Authorization: `Bearer ${jwt}`,
45
- 'x-session-id': this.sessionId,
46
- },
47
- body: JSON.stringify({
48
- data: {
49
- payload,
50
- },
51
- }),
52
- });
53
- if (!response.ok) {
54
- const body = yield response.text();
55
- console.error('[VortexClient] createInvite', { status: response.status, body });
56
- throw new Error(`Error POSTing widget invite: ${response.status}`);
57
- }
58
- const data = yield response.json();
59
- console.log('[VortexClient] createInvite', data);
60
- return data;
61
- });
62
- }
63
- getShareableLinkFormatted() {
64
- return `${this.baseUrl}/noauth/invite/...`;
65
- }
66
- createShareableInvite(jwt, widgetConfigurationId, environmentId) {
67
- return __awaiter(this, void 0, void 0, function* () {
68
- console.debug('[VortexClient] createShareableInvite request', {
69
- widgetConfigurationId,
70
- environmentId,
71
- jwt,
72
- });
73
- const response = yield fetch(`${this.baseUrl}/api/v1/environment/${environmentId}/widget-configuration/${widgetConfigurationId}/generate-shareable-link-invite`, {
74
- method: 'POST',
75
- headers: {
76
- 'Content-Type': 'application/json',
77
- Authorization: `Bearer ${jwt}`,
78
- 'x-session-id': this.sessionId,
79
- },
80
- });
81
- if (!response.ok) {
82
- throw new Error(`Error POSTing widget invite: ${response.statusText}`);
83
- }
84
- const data = yield response.json();
85
- console.debug(`[VortexClient] createShareableInvite response ${JSON.stringify(data)}`);
86
- return data;
87
- });
88
- }
89
- }
90
- exports.default = VortexClient;