@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,39 @@
|
|
|
1
|
+
import { WidgetConfiguration, UnsignedData } from '@teamvortexsoftware/vortex-types';
|
|
2
|
+
export interface UsePrefetchWidgetConfigurationOptions {
|
|
3
|
+
componentId: string;
|
|
4
|
+
vortexApiUrl: string;
|
|
5
|
+
jwt?: string;
|
|
6
|
+
user?: string | UnsignedData;
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hook to prefetch widget configuration for instant rendering.
|
|
11
|
+
* This hook fetches the configuration early (e.g., when JWT becomes available)
|
|
12
|
+
* so the VortexInvite component can render immediately without showing a loading spinner.
|
|
13
|
+
*
|
|
14
|
+
* The hook will still refetch in the background when VortexInvite mounts to ensure
|
|
15
|
+
* the configuration is up-to-date (stale-while-revalidate pattern).
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const { widgetConfiguration } = usePrefetchWidgetConfiguration({
|
|
20
|
+
* componentId: 'your-component-id',
|
|
21
|
+
* vortexApiUrl: 'https://client-api.vortexsoftware.com',
|
|
22
|
+
* jwt,
|
|
23
|
+
* enabled: !!jwt, // Only prefetch when JWT is ready
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* <VortexInvite
|
|
27
|
+
* componentId={componentId}
|
|
28
|
+
* jwt={jwt}
|
|
29
|
+
* widgetConfiguration={widgetConfiguration} // Pass prefetched config
|
|
30
|
+
* // ... other props
|
|
31
|
+
* />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function usePrefetchWidgetConfiguration({ componentId, vortexApiUrl, jwt, user, enabled, }: UsePrefetchWidgetConfigurationOptions): {
|
|
35
|
+
widgetConfiguration: WidgetConfiguration | undefined;
|
|
36
|
+
error: Error | null;
|
|
37
|
+
isLoading: boolean;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=usePrefetchWidgetConfiguration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePrefetchWidgetConfiguration.d.ts","sourceRoot":"","sources":["../../../src/hooks/usePrefetchWidgetConfiguration.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAIrF,MAAM,WAAW,qCAAqC;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,8BAA8B,CAAC,EAC7C,WAAW,EACX,YAAY,EACZ,GAAG,EACH,IAAI,EACJ,OAAc,GACf,EAAE,qCAAqC;;;;EA8EvC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ThemeColors } from "../utils/themeUtils";
|
|
2
|
+
/**
|
|
3
|
+
* Hook to generate dynamic styles based on theme colors
|
|
4
|
+
* @param themeColors The theme colors object
|
|
5
|
+
* @returns Object containing styled components based on the theme
|
|
6
|
+
*/
|
|
7
|
+
export declare function useThemeStyles(themeColors: ThemeColors): {
|
|
8
|
+
primaryButton: {
|
|
9
|
+
backgroundColor: string;
|
|
10
|
+
borderColor: string;
|
|
11
|
+
};
|
|
12
|
+
primaryButtonText: {
|
|
13
|
+
color: string;
|
|
14
|
+
};
|
|
15
|
+
secondaryButton: {
|
|
16
|
+
backgroundColor: string;
|
|
17
|
+
borderColor: string;
|
|
18
|
+
};
|
|
19
|
+
secondaryButtonText: {
|
|
20
|
+
color: string;
|
|
21
|
+
};
|
|
22
|
+
containerStyles: {
|
|
23
|
+
backgroundColor: string;
|
|
24
|
+
borderColor: string;
|
|
25
|
+
};
|
|
26
|
+
textStyles: {
|
|
27
|
+
color: string;
|
|
28
|
+
};
|
|
29
|
+
inputStyles: {
|
|
30
|
+
borderColor: string;
|
|
31
|
+
color: string;
|
|
32
|
+
backgroundColor: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=useThemeStyles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useThemeStyles.d.ts","sourceRoot":"","sources":["../../../src/hooks/useThemeStyles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCtD"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { WidgetConfiguration, UnsignedData } from '@teamvortexsoftware/vortex-types';
|
|
2
|
+
import { Animated } from 'react-native';
|
|
3
|
+
import { Attributes, VortexActionResult, VortexActionType } from '../vortexInvite';
|
|
4
|
+
import { VortexAnalyticsEvent, GroupDTO } from '../utils/analytics';
|
|
5
|
+
export interface UseVortexInviteOptions {
|
|
6
|
+
componentId?: string;
|
|
7
|
+
vortexApiUrl: string;
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
jwt?: string;
|
|
10
|
+
user?: string | UnsignedData | undefined;
|
|
11
|
+
onSuccess?: (result: VortexActionResult) => void;
|
|
12
|
+
onError?: (error: Error, type: VortexActionType) => void;
|
|
13
|
+
group?: {
|
|
14
|
+
name: string;
|
|
15
|
+
type: string;
|
|
16
|
+
id?: string;
|
|
17
|
+
groupId?: string;
|
|
18
|
+
};
|
|
19
|
+
groups?: GroupDTO[];
|
|
20
|
+
scope?: string;
|
|
21
|
+
scopeType?: string;
|
|
22
|
+
widgetConfiguration?: WidgetConfiguration;
|
|
23
|
+
analyticsBaseURL?: string;
|
|
24
|
+
onEvent?: (event: VortexAnalyticsEvent) => void;
|
|
25
|
+
analyticsSegmentation?: Record<string, any>;
|
|
26
|
+
locale?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function useVortexInvite({ componentId, vortexApiUrl, isLoading, jwt, user, onSuccess, onError, group, groups, scope, scopeType, widgetConfiguration: initialWidgetConfiguration, analyticsBaseURL, onEvent, analyticsSegmentation, locale, }: UseVortexInviteOptions): {
|
|
29
|
+
widgetConfiguration: WidgetConfiguration | undefined;
|
|
30
|
+
error: {
|
|
31
|
+
message: string;
|
|
32
|
+
code?: string;
|
|
33
|
+
userMessage?: string;
|
|
34
|
+
developerMessage?: string;
|
|
35
|
+
} | null;
|
|
36
|
+
fetching: boolean;
|
|
37
|
+
loading: boolean;
|
|
38
|
+
email: string;
|
|
39
|
+
setEmail: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
40
|
+
role: string | undefined;
|
|
41
|
+
setRole: import("react").Dispatch<import("react").SetStateAction<string | undefined>>;
|
|
42
|
+
roleOptions: {
|
|
43
|
+
id?: string;
|
|
44
|
+
label: string;
|
|
45
|
+
value: string;
|
|
46
|
+
}[];
|
|
47
|
+
opacity: Animated.Value;
|
|
48
|
+
themeColors: import("../utils/themeUtils").ThemeColors;
|
|
49
|
+
themeStyles: Record<string, Record<string, string | number>>;
|
|
50
|
+
has: import("../utils/themeUtils").FeatureFlags;
|
|
51
|
+
options: import("@teamvortexsoftware/vortex-types").WidgetConfigurationConfigurationProps;
|
|
52
|
+
inviteLoading: boolean;
|
|
53
|
+
showSuccessMessage: boolean;
|
|
54
|
+
handleInviteClick: (contentTokens?: Attributes) => Promise<void>;
|
|
55
|
+
handleShareLink: () => Promise<void>;
|
|
56
|
+
handleCopyLink: () => Promise<void>;
|
|
57
|
+
handleSmsShare: () => Promise<void>;
|
|
58
|
+
handleEmailShare: () => Promise<void>;
|
|
59
|
+
handleWhatsAppShare: () => Promise<void>;
|
|
60
|
+
getShareableLink: () => string;
|
|
61
|
+
getShareableInviteLink: (contentTokens?: Attributes) => Promise<string | undefined>;
|
|
62
|
+
createUserIdInvitation: (userId: string, name?: string, avatarUrl?: string, metadata?: Record<string, unknown>) => Promise<void>;
|
|
63
|
+
formLayout: {
|
|
64
|
+
emailPlaceholder: string;
|
|
65
|
+
submitButtonLabel: string;
|
|
66
|
+
isGridLayout: boolean;
|
|
67
|
+
hasSeparateColumns: boolean;
|
|
68
|
+
formConfig: import("../utils/formUtils").FormComponent[] | null;
|
|
69
|
+
};
|
|
70
|
+
fetchContactsWithEmailsIOS: () => Promise<Array<{
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
emails: string[];
|
|
74
|
+
imageUri?: string;
|
|
75
|
+
}>>;
|
|
76
|
+
trackWidgetRender: () => void;
|
|
77
|
+
trackWidgetError: (errorMessage: string) => void;
|
|
78
|
+
trackShareLinkClick: (clickName: string) => void;
|
|
79
|
+
trackEmailFieldFocus: () => void;
|
|
80
|
+
trackEmailFieldBlur: () => void;
|
|
81
|
+
trackEmailValidation: (emailValue: string, isValid: boolean) => void;
|
|
82
|
+
trackEmailInvitationsSubmitted: (formData: Record<string, any>) => void;
|
|
83
|
+
trackEmailValidationError: (formData: Record<string, any>) => void;
|
|
84
|
+
trackEmailSubmitError: (errorMessage: string) => void;
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=useVortexInvite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVortexInvite.d.ts","sourceRoot":"","sources":["../../../src/hooks/useVortexInvite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAE,QAAQ,EAA4B,MAAM,cAAc,CAAC;AAGlE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAcnF,OAAO,EACL,oBAAoB,EACpB,QAAQ,EAIT,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,sBAAsB;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;IACzC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACjD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACzD,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAE1C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAChD,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE5C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,YAAY,EACZ,SAAiB,EACjB,GAAG,EACH,IAAI,EACJ,SAAS,EACT,OAAO,EACP,KAAK,EACL,MAAM,EACN,KAAK,EACL,SAAS,EACT,mBAAmB,EAAE,0BAA0B,EAC/C,gBAAgB,EAChB,OAAO,EACP,qBAAqB,EACrB,MAAM,GACP,EAAE,sBAAsB;;;iBAuCuB,MAAM;eAAS,MAAM;sBAAgB,MAAM;2BAAqB,MAAM;;;;;;;;;;;;;;;;;;;;wCAmVnE,UAAU,KAAG,OAAO,CAAC,IAAI,CAAC;;;;;;;6CAoKzD,UAAU,KACzB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;qCAhGpB,MAAM,SACP,MAAM,cACD,MAAM,aACP,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACjC,OAAO,CAAC,IAAI,CAAC;;;;;;;;sCA+O6B,OAAO,CAAC,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;;qCA9iB7G,MAAM;qCAQT,MAAM;;;uCAoBL,MAAM,WAAW,OAAO;+CAQ1B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;0CAQnB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;0CAQf,MAAM;EAonBxB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web-compatible preview entry point
|
|
3
|
+
*
|
|
4
|
+
* This entry point only exports components and utilities that are safe to use
|
|
5
|
+
* in web environments (Next.js, etc.) without importing any React Native native
|
|
6
|
+
* dependencies like expo-clipboard, expo-sharing, react-native-vector-icons, etc.
|
|
7
|
+
*
|
|
8
|
+
* Use this import in web applications:
|
|
9
|
+
* import { InviteFormWeb } from '@teamvortexsoftware/vortex-react-native/preview';
|
|
10
|
+
*
|
|
11
|
+
* NOTE: InviteFormCore is NOT exported here because it imports native components
|
|
12
|
+
* (VrtxSubmit, VrtxShareOptions, VrtxContactsImport) which pull in moduleLoaders.ts
|
|
13
|
+
* containing native require() statements. Web consumers should use InviteFormWeb
|
|
14
|
+
* which internally uses web-safe component versions.
|
|
15
|
+
*/
|
|
16
|
+
export { InviteFormWeb, InviteFormWeb as InvitationFormPreview, type InvitationFormPreviewProps, type ComponentInfo } from './components/InviteFormWeb';
|
|
17
|
+
export type { InvitationFormCoreProps, IconRendererProps, IconName } from './components/InviteFormCore';
|
|
18
|
+
export { InviteFormCore } from './components/InviteFormCore';
|
|
19
|
+
export { useInvitationFormLogic, type ViewType, type Contact } from './hooks/useInvitationFormLogic';
|
|
20
|
+
export { type PlatformOperations } from './types/platformOperations';
|
|
21
|
+
export { MOCK_CONTACTS, MOCK_GOOGLE_CONTACTS } from './constants/mockData';
|
|
22
|
+
export { filterContacts } from './utils/contactUtils';
|
|
23
|
+
//# sourceMappingURL=index-web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-web.d.ts","sourceRoot":"","sources":["../../src/index-web.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,aAAa,IAAI,qBAAqB,EAAE,KAAK,0BAA0B,EAAE,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAExJ,YAAY,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACrG,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { VortexInvite, type VortexInviteProps, type Attributes, type VortexActionResult, type VortexActionType } from './vortexInvite';
|
|
2
|
+
export type { VortexModules, } from './context/VortexModulesContext';
|
|
3
|
+
export { InviteFormMobile, InviteFormMobile as InvitationForm } from './components/InviteFormMobile';
|
|
4
|
+
export { InviteFormCore, InviteFormCore as InvitationFormCore, type InvitationFormCoreProps, type IconRendererProps, type IconName } from './components/InviteFormCore';
|
|
5
|
+
export { useInvitationFormLogic, type ViewType, type Contact } from './hooks/useInvitationFormLogic';
|
|
6
|
+
export { usePrefetchWidgetConfiguration, type UsePrefetchWidgetConfigurationOptions } from './hooks/usePrefetchWidgetConfiguration';
|
|
7
|
+
export { configCache } from './utils/configCache';
|
|
8
|
+
export { type PlatformOperations } from './types/platformOperations';
|
|
9
|
+
export { type FindFriendsConfig, type FindFriendsContact, } from './types/findFriends';
|
|
10
|
+
export { type InvitationItem, type IncomingInvitationItem, type OutgoingInvitationItem, type IncomingInvitationsConfig, type OutgoingInvitationsConfig, type InvitationSuggestionsConfig, } from './types/invitations';
|
|
11
|
+
export { type InviteContactsConfig, type InviteContactsContact, } from './types/inviteContacts';
|
|
12
|
+
export { type UnfurlConfig, unfurlConfigToMetadata, } from './types/unfurlConfig';
|
|
13
|
+
export { VortexDeferredLinks, type DeviceFingerprint, type MatchFingerprintResponse, type RetrieveDeferredDeepLinkOptions, } from './VortexDeferredLinks';
|
|
14
|
+
export { VortexClient, type VortexClientOptions, type InvitationResponse, } from './VortexClient';
|
|
15
|
+
export { type SearchBoxConfig, } from './types/searchBox';
|
|
16
|
+
export { VrtxInviteContacts, type VrtxInviteContactsProps } from './components/VrtxInviteContacts';
|
|
17
|
+
export { VrtxSearchBox, type VrtxSearchBoxProps } from './components/VrtxSearchBox';
|
|
18
|
+
export { MOCK_CONTACTS, MOCK_GOOGLE_CONTACTS } from './constants/mockData';
|
|
19
|
+
export { filterContacts } from './utils/contactUtils';
|
|
20
|
+
export type { EmailGroupMembershipCheckFunction, EmailGroupMembershipCheckResult, UnsignedData } from '@teamvortexsoftware/vortex-types';
|
|
21
|
+
export { type VortexAnalyticsEvent, type SimpleAnalyticsEvent, type GroupDTO, DEFAULT_ANALYTICS_URL, } from './utils/analytics';
|
|
22
|
+
export { EventNames, type EventName } from '@teamvortexsoftware/analytics-client';
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,KAAK,UAAU,EAAE,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvI,YAAY,EACV,aAAa,GACd,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,IAAI,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACrG,OAAO,EAAE,cAAc,EAAE,cAAc,IAAI,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACxK,OAAO,EAAE,sBAAsB,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACrG,OAAO,EAAE,8BAA8B,EAAE,KAAK,qCAAqC,EAAE,MAAM,wCAAwC,CAAC;AACpI,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,GACjC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,KAAK,YAAY,EACjB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,GACrC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,eAAe,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,iCAAiC,EAAE,+BAA+B,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGzI,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,QAAQ,EACb,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Types for the Incoming, Outgoing, and Invitation Suggestions features.
|
|
4
|
+
*
|
|
5
|
+
* These components display lists of invitations:
|
|
6
|
+
* - VrtxIncomingInvitations: Invitations the user has received (with Accept/Delete actions)
|
|
7
|
+
* - VrtxOutgoingInvitations: Invitations the user has sent (with Cancel action)
|
|
8
|
+
* - VrtxInvitationSuggestions: "People you may know" suggestions (with Invite/Dismiss actions)
|
|
9
|
+
*
|
|
10
|
+
* The invitation data is provided directly via props by the host application.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
//# sourceMappingURL=invitations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitations.js","sourceRoot":"","sources":["../../src/types/invitations.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG","sourcesContent":["/**\n * Types for the Incoming, Outgoing, and Invitation Suggestions features.\n *\n * These components display lists of invitations:\n * - VrtxIncomingInvitations: Invitations the user has received (with Accept/Delete actions)\n * - VrtxOutgoingInvitations: Invitations the user has sent (with Cancel action)\n * - VrtxInvitationSuggestions: \"People you may know\" suggestions (with Invite/Dismiss actions)\n *\n * The invitation data is provided directly via props by the host application.\n */\n\n/**\n * Represents a generic invitation/suggestion item.\n * Used by VrtxInvitationSuggestions component.\n */\nexport interface InvitationItem {\n /** Unique identifier for the invitation */\n id: string;\n /** Display name of the person */\n name: string;\n /** The user ID in the customer's platform */\n userId?: string;\n /** Optional subtitle (e.g., username, mutual friends count) */\n subtitle?: string;\n /** Avatar/profile image URL (optional) */\n avatarUrl?: string;\n /** Whether this invitation came from the Vortex backend */\n isVortexInvitation?: boolean;\n /** Optional metadata for app-specific data */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Represents an incoming invitation item.\n * Used by VrtxIncomingInvitations component.\n */\nexport interface IncomingInvitationItem {\n /** Unique identifier for the invitation */\n id: string;\n /** Display name of the sender */\n name: string;\n /**\n * The user ID, used for deduplication (maps to creatorId from the Vortex API).\n * When both API and internal invitations share the same `userId`, the API one is kept.\n */\n userId?: string;\n /** Avatar/profile image URL (optional) */\n avatarUrl?: string;\n /**\n * Whether this invitation came from the Vortex backend.\n * When true, the SDK will call the Vortex API for accept/delete operations.\n * When false, the SDK relies entirely on the app's callbacks.\n * @default false for invitations provided via config\n */\n isVortexInvitation?: boolean;\n /** Optional metadata for app-specific data */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Represents an outgoing invitation item.\n * Used by VrtxOutgoingInvitations component.\n */\nexport interface OutgoingInvitationItem {\n /** Unique identifier for the invitation */\n id: string;\n /** Display name of the invitee */\n name: string;\n /**\n * The user ID, used for deduplication (maps to targetValue from the Vortex API).\n * When both API and internal invitations share the same `userId`, the API one is kept.\n */\n userId?: string;\n /** Avatar/profile image URL (optional) */\n avatarUrl?: string;\n /**\n * Whether this invitation came from the Vortex backend.\n * When true, the SDK will call the Vortex API for cancel operations.\n * When false, the SDK relies entirely on the app's callbacks.\n * @default false for invitations provided via config\n */\n isVortexInvitation?: boolean;\n /** Optional metadata for app-specific data */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Configuration for VrtxIncomingInvitations component.\n * Displays invitations the user has received with Accept and Delete actions.\n */\nexport interface IncomingInvitationsConfig {\n /**\n * List of incoming invitations to display.\n * Provided by the host application.\n */\n invitations: IncomingInvitationItem[];\n\n /**\n * Called when user confirms \"Accept\" on an invitation.\n * A confirmation dialog is shown before this callback is invoked.\n *\n * For non-Vortex invitations (isVortexInvitation=false), return true to remove\n * the invitation from the list, or false to keep it displayed.\n *\n * For Vortex invitations, the return value is also respected - return false\n * to prevent the API call and keep the invitation in the list.\n *\n * @param invitation - The invitation that was accepted\n * @returns Boolean indicating whether to proceed (remove from list), or void/Promise<void>\n *\n * @example\n * ```typescript\n * onAccept: async (invitation) => {\n * const success = await api.acceptInvitation(invitation.id);\n * return success; // Return true to remove from list\n * }\n * ```\n */\n onAccept: (invitation: IncomingInvitationItem) => boolean | void | Promise<boolean | void>;\n\n /**\n * Called when user confirms \"Delete\" on an invitation.\n * A confirmation dialog is shown before this callback is invoked.\n *\n * For non-Vortex invitations (isVortexInvitation=false), return true to remove\n * the invitation from the list, or false to keep it displayed.\n *\n * For Vortex invitations, the return value is also respected - return false\n * to prevent the API call and keep the invitation in the list.\n *\n * @param invitation - The invitation that was deleted/declined\n * @returns Boolean indicating whether to proceed (remove from list), or void/Promise<void>\n *\n * @example\n * ```typescript\n * onDelete: async (invitation) => {\n * const success = await api.declineInvitation(invitation.id);\n * return success; // Return true to remove from list\n * }\n * ```\n */\n onDelete: (invitation: IncomingInvitationItem) => boolean | void | Promise<boolean | void>;\n\n /**\n * Optional callback to compute a custom subtitle for each invitation.\n *\n * When provided, the SDK calls this function for each invitation to determine the\n * displayed subtitle. Useful when the subtitle should be derived from the invitation's\n * metadata (e.g., `invitation.metadata?.inviter_handle`).\n *\n * If not provided, no subtitle is rendered.\n */\n getSubtitle?: (invitation: IncomingInvitationItem) => string | undefined;\n\n /**\n * Optional: Custom text for the Accept button.\n * @default \"Accept\"\n */\n acceptButtonText?: string;\n\n /**\n * Optional: Custom text for the Delete button.\n * @default \"Delete\"\n */\n deleteButtonText?: string;\n\n /**\n * Optional: Custom empty state message when no invitations are present.\n * @default \"No incoming invitations\"\n */\n emptyStateMessage?: string;\n\n /**\n * Optional: Custom title for the Accept confirmation dialog.\n * @default \"Accept Invitation\"\n */\n acceptConfirmTitle?: string;\n\n /**\n * Optional: Custom message for the Accept confirmation dialog.\n * Use {name} as a placeholder for the person's name.\n * @default \"Accept invitation from {name}?\"\n */\n acceptConfirmMessage?: string;\n\n /**\n * Optional: Custom title for the Delete confirmation dialog.\n * @default \"Delete Invitation\"\n */\n deleteConfirmTitle?: string;\n\n /**\n * Optional: Custom message for the Delete confirmation dialog.\n * Use {name} as a placeholder for the person's name.\n * @default \"Delete invitation from {name}?\"\n */\n deleteConfirmMessage?: string;\n\n /**\n * Optional: Custom text for the confirmation dialog's confirm button.\n * @default \"Confirm\"\n */\n confirmButtonText?: string;\n\n /**\n * Optional: Custom text for the confirmation dialog's cancel button.\n * @default \"Cancel\"\n */\n cancelButtonText?: string;\n}\n\n/**\n * Configuration for VrtxOutgoingInvitations component.\n * Displays invitations the user has sent with a Cancel action.\n * \n * Note: The component fetches invitations from the API and handles revocation automatically.\n * Text customizations (button text, empty state, etc.) come from the widget configuration.\n */\nexport interface OutgoingInvitationsConfig {\n /**\n * Optional: Internal invitations provided by the app (merged with API-fetched ones).\n * These invitations will NOT have `isVortexInvitation` set, so your app must handle\n * the cancel logic in the `onCancel` callback.\n *\n * If an internal invitation has the same `userId` as an API invitation,\n * the API invitation is kept (deduplicated).\n */\n invitations?: OutgoingInvitationItem[];\n\n /**\n * Optional callback when user taps \"Cancel\" on an invitation.\n * Called before the API revocation as a gate.\n *\n * Return `true` (or void/undefined) to proceed with the API revocation,\n * or `false` to cancel the action.\n *\n * @param invitation - The invitation being cancelled\n * @returns Whether to proceed with the cancellation\n *\n * @example\n * ```typescript\n * onCancel: async (invitation) => {\n * // Return true to proceed, false to cancel\n * return true;\n * }\n * ```\n */\n onCancel?: (invitation: OutgoingInvitationItem) => boolean | void | Promise<boolean | void>;\n\n /**\n * Optional callback to compute a custom subtitle for each invitation.\n *\n * When provided, the SDK calls this function for each invitation to determine the\n * displayed subtitle. Useful when the subtitle should be derived from the invitation's\n * metadata (e.g., `invitation.metadata?.invitee_handle`).\n *\n * If not provided, no subtitle is rendered.\n */\n getSubtitle?: (invitation: OutgoingInvitationItem) => string | undefined;\n\n /**\n * @internal Mock invitations for preview mode only.\n * When provided, skips API calls and uses these invitations instead.\n * This is NOT for customer use - only for internal preview/web mode.\n */\n _mockInvitations?: OutgoingInvitationItem[];\n}\n\n/**\n * Configuration for VrtxInvitationSuggestions component.\n * Displays \"People you may know\" suggestions with Invite and Dismiss (X) actions.\n */\nexport interface InvitationSuggestionsConfig {\n /**\n * List of suggested people to display.\n * Provided by the host application.\n */\n suggestions: InvitationItem[];\n\n /**\n * Called when user taps \"Invite\" on a suggestion.\n * No confirmation dialog - invites immediately.\n *\n * @param suggestion - The suggestion that was invited\n * @returns Optional promise for async operations\n *\n * @example\n * ```typescript\n * onInvite: async (suggestion) => {\n * await api.sendInvitation(suggestion.id);\n * // Update your local state to remove the suggestion\n * }\n * ```\n */\n onInvite: (suggestion: InvitationItem) => void | Promise<void>;\n\n /**\n * Called when user taps the dismiss (X) button on a suggestion.\n * No confirmation dialog - dismisses immediately.\n *\n * @param suggestion - The suggestion that was dismissed\n * @returns Optional promise for async operations\n *\n * @example\n * ```typescript\n * onDismiss: async (suggestion) => {\n * await api.dismissSuggestion(suggestion.id);\n * // Update your local state to remove the suggestion\n * }\n * ```\n */\n onDismiss: (suggestion: InvitationItem) => void | Promise<void>;\n\n /**\n * Optional: Custom text for the Invite button.\n * @default \"Invite\"\n */\n inviteButtonText?: string;\n\n /**\n * Optional: Custom empty state message when no suggestions are present.\n * @default \"No suggestions\"\n */\n emptyStateMessage?: string;\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Types for the Invite Contacts feature.
|
|
4
|
+
*
|
|
5
|
+
* The Invite Contacts component displays a list of contacts that can be invited via SMS.
|
|
6
|
+
* Unlike Find Friends, this component:
|
|
7
|
+
* - Receives pre-classified contacts directly (no fetching/classification)
|
|
8
|
+
* - Only shows contacts that can be invited (no member/non-member distinction)
|
|
9
|
+
* - Creates SMS invitations and opens the SMS app for the user to send
|
|
10
|
+
*
|
|
11
|
+
* The component renders nothing (no height) if the contacts list is empty.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
//# sourceMappingURL=inviteContacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inviteContacts.js","sourceRoot":"","sources":["../../src/types/inviteContacts.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG","sourcesContent":["/**\n * Types for the Invite Contacts feature.\n *\n * The Invite Contacts component displays a list of contacts that can be invited via SMS.\n * Unlike Find Friends, this component:\n * - Receives pre-classified contacts directly (no fetching/classification)\n * - Only shows contacts that can be invited (no member/non-member distinction)\n * - Creates SMS invitations and opens the SMS app for the user to send\n *\n * The component renders nothing (no height) if the contacts list is empty.\n */\n\n/**\n * Contact to be displayed in the Invite Contacts component.\n * Each contact has a name and phone number for SMS invitation.\n */\nexport interface InviteContactsContact {\n /** Unique identifier for the contact */\n id: string;\n /** Display name of the contact */\n name: string;\n /** Phone number for SMS invitation */\n phoneNumber: string;\n /** Avatar/profile image URL (optional) */\n avatarUrl?: string;\n /** Optional metadata for the contact */\n metadata?: Record<string, unknown>;\n}\n\n/**\n * Configuration for the Invite Contacts feature.\n * Passed to VortexInvite via the inviteContactsConfig prop.\n */\nexport interface InviteContactsConfig {\n /**\n * List of contacts to display for SMS invitation.\n * If empty or undefined, the component renders nothing (no height).\n */\n contacts: InviteContactsContact[];\n\n /**\n * Called when user taps \"Invite\" on a contact.\n * The SDK will:\n * 1. Create an SMS invitation via the API\n * 2. Get the short link for the invitation\n * 3. Open the SMS app with the configured message and link\n *\n * This callback is optional and can be used for analytics or custom handling.\n *\n * @param contact - The contact that was invited\n * @param shortLink - The invitation short link that was created\n */\n onInvite?: (contact: InviteContactsContact, shortLink: string) => void | Promise<void>;\n\n /**\n * Optional: Custom text for the \"Invite your contacts\" link.\n * @default \"Invite your contacts\"\n */\n inviteYourContactsText?: string;\n\n /**\n * Optional: Custom text for the \"Invite\" button.\n * @default \"Invite\"\n */\n inviteButtonText?: string;\n\n /**\n * Optional: Custom empty state message (shown when contacts list becomes empty after inviting).\n * @default \"No contacts to invite\"\n */\n emptyStateMessage?: string;\n\n /**\n * Optional: Called when user navigates to the contacts list.\n * Can be used for analytics.\n */\n onNavigateToContacts?: () => void;\n\n /**\n * Optional: Called when user navigates back from the contacts list.\n * Can be used for analytics.\n */\n onNavigateBack?: () => void;\n\n /**\n * Optional: Called when an invitation is successfully created.\n * This can be used to notify other components (like Outgoing Invitations)\n * that they should refresh their data.\n *\n * @param contact - The contact that was invited\n * @param shortLink - The invitation short link that was created\n */\n onInvitationCreated?: (contact: InviteContactsContact, shortLink: string) => void;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformOperations.js","sourceRoot":"","sources":["../../src/types/platformOperations.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Platform-specific operations that need different implementations\n * for native (React Native) and web environments.\n *\n * This interface enables dependency injection, allowing components\n * to work in both environments without importing platform-specific code.\n */\nexport interface PlatformOperations {\n /**\n * Copy invitation link to clipboard\n * - Native: Fetches shareable invitation link via Vortex API and uses expo-clipboard or @react-native-clipboard/clipboard\n * - Web: Fetches shareable invitation link and uses navigator.clipboard.writeText\n *\n * The method handles fetching the invitation link internally via the Vortex API.\n */\n copyToClipboard: () => Promise<void>;\n\n /**\n * Share invitation link using native share sheet or web share API\n * - Native: Fetches shareable invitation link via Vortex API and uses React Native Share API\n * - Web: Fetches shareable invitation link and uses navigator.share (if available) or logs a message\n *\n * The method handles fetching the invitation link and composing the share message internally.\n */\n share: () => Promise<void>;\n\n /**\n * Close/dismiss the invitation form\n * - Native: Dismisses bottom sheet or calls onClose callback\n * - Web: No-op or logs a message (preview mode)\n */\n close: () => void;\n\n /**\n * Fetch contacts with email addresses\n * - Native: Uses expo-contacts to fetch from device contacts (called on-demand)\n * - Web/Preview: Returns mock data for consistent preview behavior\n *\n * Called on-demand when user navigates to \"Add from Contacts\" view.\n * Contacts with multiple emails are flattened into separate entries.\n */\n fetchContacts: () => Promise<Array<{ id: string; name: string; email: string }>>;\n\n /**\n * Send an invitation to a user\n * - Native: Calls the Vortex API via handleInviteClick with proper authentication\n * - Web/Preview: Simulates invite for consistent preview behavior\n *\n * Called when user clicks \"Invite\" button for email or contact invitations.\n *\n * @param email - Email address of the person to invite\n * @param contactName - Optional name of the contact being invited\n * @returns Promise that resolves when invitation is sent successfully\n */\n invite: (email: string, contactName?: string) => Promise<void>;\n\n /**\n * Fetch Google contacts via Google People API\n * - Native: Authenticates via Google OAuth and fetches from People API\n * - Web/Preview: Returns mock data for consistent preview behavior\n *\n * Called on-demand when user navigates to \"Add from Google Contacts\" view.\n * Requires authentication and proper OAuth scopes.\n *\n * @returns Promise that resolves with array of Google contacts\n */\n fetchGoogleContacts: () => Promise<Array<{ id: string; name: string; email: string }>>;\n\n /**\n * Provide haptic feedback\n * - Native: Uses expo-haptics for tactile feedback (dynamically imported)\n * - Web/Preview: No-op (silent fail)\n *\n * Optional method that provides haptic feedback when user interacts with buttons.\n * If expo-haptics is not installed, the implementation should fail silently.\n *\n * @param style - Intensity of haptic feedback ('light', 'medium', or 'heavy')\n * @returns Promise that resolves when haptic feedback is complete (or immediately for no-op)\n */\n triggerHaptic?: (style: 'light' | 'medium' | 'heavy') => Promise<void>;\n\n /**\n * Share invitation via email (mailto)\n * - Native: Opens email composer with pre-filled subject and body containing invitation link\n * - Web/Preview: Opens mailto link or logs message\n *\n * Optional method for sharing via email client.\n */\n shareViaEmail?: () => Promise<void>;\n\n /**\n * Share invitation via SMS\n * - Native: Opens SMS composer with pre-filled message containing invitation link\n * - Web/Preview: Opens sms link or logs message\n *\n * Optional method for sharing via SMS.\n */\n shareViaSms?: () => Promise<void>;\n\n /**\n * Share invitation via X/Twitter DMs\n * - Native: Opens Twitter app for direct messaging with invitation link\n * - Web/Preview: Opens Twitter web URL or logs message\n *\n * Optional method for sharing via X/Twitter direct messages.\n */\n shareViaTwitter?: () => Promise<void>;\n\n /**\n * Share invitation via Instagram DMs\n * - Native: Opens Instagram direct inbox\n * - Web/Preview: Logs message (Instagram web doesn't support direct linking to DMs)\n *\n * Optional method for sharing via Instagram direct messages.\n */\n shareViaInstagram?: () => Promise<void>;\n\n /**\n * Share invitation via WhatsApp\n * - Native: Opens WhatsApp with pre-filled message containing invitation link\n * - Web/Preview: Opens WhatsApp web URL or logs message\n *\n * Optional method for sharing via WhatsApp.\n */\n shareViaWhatsApp?: () => Promise<void>;\n\n /**\n * Share invitation via Line\n * - Native: Opens Line app with pre-filled message containing invitation link\n * - Web/Preview: Opens Line web URL or logs message\n *\n * Optional method for sharing via Line messenger.\n */\n shareViaLine?: () => Promise<void>;\n\n /**\n * Share invitation via Line LIFF (LINE Frontend Framework)\n * - Native: Opens Line LIFF app URL\n * - Web/Preview: Opens Line LIFF URL or logs message\n *\n * Optional method for sharing via Line LIFF app.\n */\n shareViaLineLiff?: () => Promise<void>;\n\n /**\n * Show QR code for invitation\n * - Native: Displays QR code modal with invitation link encoded\n * - Web/Preview: Logs message or shows QR code modal\n *\n * Optional method for displaying QR code for invitation link.\n */\n showQrCode?: () => Promise<void>;\n\n /**\n * Share invitation via Facebook Messenger\n * - Native: Opens Messenger app with pre-filled message containing invitation link\n * - Web/Preview: Opens Messenger web URL or logs message\n *\n * Optional method for sharing via Facebook Messenger.\n */\n shareViaFacebookMessenger?: () => Promise<void>;\n\n /**\n * Share invitation via Telegram\n * - Native: Opens Telegram app with pre-filled message containing invitation link\n * - Web/Preview: Opens Telegram web URL or logs message\n *\n * Optional method for sharing via Telegram.\n */\n shareViaTelegram?: () => Promise<void>;\n\n /**\n * Share invitation via Discord\n * - Native: Opens Discord app\n * - Web/Preview: Opens Discord web URL or logs message\n *\n * Optional method for sharing via Discord.\n */\n shareViaDiscord?: () => Promise<void>;\n\n /**\n * Create an SMS invitation and return the short link\n * - Native: Calls the Vortex API to create an SMS invitation\n * - Web/Preview: Returns mock link for consistent preview behavior\n *\n * Used by the Invite Contacts component to create SMS invitations.\n * The returned short link is included in the SMS message sent by the user.\n *\n * @param phoneNumber - Phone number of the person to invite\n * @param contactName - Optional name of the contact being invited\n * @returns Promise that resolves with the invitation short link, or null if failed\n */\n createSmsInvitation?: (phoneNumber: string, contactName?: string) => Promise<string | null>;\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Types for the Search Box feature.
|
|
4
|
+
*
|
|
5
|
+
* The Search Box component displays a search input with a search button.
|
|
6
|
+
* When the user taps the search button, a customer-provided callback is invoked
|
|
7
|
+
* with the search query. The callback returns a list of matching contacts
|
|
8
|
+
* (identical to FindFriendsContact) which are rendered below the search box.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
//# sourceMappingURL=searchBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchBox.js","sourceRoot":"","sources":["../../src/types/searchBox.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG","sourcesContent":["/**\n * Types for the Search Box feature.\n *\n * The Search Box component displays a search input with a search button.\n * When the user taps the search button, a customer-provided callback is invoked\n * with the search query. The callback returns a list of matching contacts\n * (identical to FindFriendsContact) which are rendered below the search box.\n */\n\nimport { FindFriendsContact } from './findFriends';\n\n/**\n * Configuration for the Search Box feature.\n * Passed to VortexInvite to enable and configure the Search Box component.\n */\nexport interface SearchBoxConfig {\n /**\n * Called when the user taps the search button.\n * The customer implements this callback to perform the search and return matching contacts.\n *\n * @param query - The search query entered by the user\n * @returns Promise resolving to an array of matching contacts\n *\n * @example\n * ```typescript\n * onSearch: async (query) => {\n * const results = await myApi.searchUsers(query);\n * return results.map(user => ({\n * userId: user.id,\n * name: user.displayName,\n * subtitle: user.email,\n * avatarUrl: user.avatar,\n * }));\n * }\n * ```\n */\n onSearch: (query: string) => Promise<FindFriendsContact[]> | FindFriendsContact[];\n\n /**\n * Called when user taps \"Connect\" on a search result contact.\n * If the callback returns true, the SDK will create an invitation via the\n * Vortex backend.\n *\n * @param contact - The contact that was tapped\n * @returns Promise resolving to true if the invitation should be created\n */\n onConnect: (contact: FindFriendsContact) => Promise<boolean> | boolean;\n\n /**\n * Optional: Called after an invitation is successfully created.\n *\n * @param contact - The contact for whom the invitation was created\n */\n onInvitationCreated?: (contact: FindFriendsContact) => void;\n\n /**\n * Optional: Called if creating the invitation fails.\n *\n * @param contact - The contact for whom the invitation failed\n * @param error - The error that occurred\n */\n onInvitationError?: (contact: FindFriendsContact, error: Error) => void;\n\n /**\n * Optional: Custom text for the \"Connect\" button.\n * @default \"Connect\"\n */\n connectButtonText?: string;\n\n /**\n * Optional: Custom message shown when search returns no results.\n * @default \"No results found\"\n */\n noResultsMessage?: string;\n}\n"]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the Find Friends feature.
|
|
3
|
+
*
|
|
4
|
+
* The Find Friends component displays a list of contacts provided by the customer.
|
|
5
|
+
* Each contact has a user ID that identifies them in the customer's platform.
|
|
6
|
+
* When the user taps "Connect", an invitation is created via the Vortex backend.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A contact in the Find Friends list.
|
|
10
|
+
* Provided by the customer via findFriendsConfig.contacts.
|
|
11
|
+
*/
|
|
12
|
+
export interface FindFriendsContact {
|
|
13
|
+
/** The user ID that identifies this contact in the customer's platform */
|
|
14
|
+
userId: string;
|
|
15
|
+
/** Display name of the contact */
|
|
16
|
+
name: string;
|
|
17
|
+
/** Optional subtitle (e.g., username, email, or app-specific info) */
|
|
18
|
+
subtitle?: string;
|
|
19
|
+
/** Avatar/profile image URL (optional) */
|
|
20
|
+
avatarUrl?: string;
|
|
21
|
+
/** Optional metadata for app-specific data */
|
|
22
|
+
metadata?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Configuration for the Find Friends feature.
|
|
26
|
+
* Passed to VortexInvite to enable and configure the Find Friends component.
|
|
27
|
+
*/
|
|
28
|
+
export interface FindFriendsConfig {
|
|
29
|
+
/**
|
|
30
|
+
* List of contacts to display.
|
|
31
|
+
* Each contact must have a userId that identifies them in the customer's platform.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* <VortexInvite
|
|
36
|
+
* findFriendsConfig={{
|
|
37
|
+
* contacts: [
|
|
38
|
+
* { userId: 'user-123', name: 'John Doe', subtitle: '@johndoe' },
|
|
39
|
+
* { userId: 'user-456', name: 'Jane Smith', avatarUrl: 'https://...' },
|
|
40
|
+
* ],
|
|
41
|
+
* onConnect: async (contact) => {
|
|
42
|
+
* // Return true to create the invitation via Vortex backend
|
|
43
|
+
* return true;
|
|
44
|
+
* },
|
|
45
|
+
* }}
|
|
46
|
+
* />
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
contacts: FindFriendsContact[];
|
|
50
|
+
/**
|
|
51
|
+
* Called when user taps "Connect" on a contact.
|
|
52
|
+
* The customer implements this callback to perform any pre-connection logic.
|
|
53
|
+
*
|
|
54
|
+
* If the callback returns true, the SDK will create an invitation via the
|
|
55
|
+
* Vortex backend.
|
|
56
|
+
*
|
|
57
|
+
* If the callback returns false, no invitation is created.
|
|
58
|
+
*
|
|
59
|
+
* @param contact - The contact that was tapped
|
|
60
|
+
* @returns Promise resolving to true if the invitation should be created, false otherwise
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* onConnect: async (contact) => {
|
|
65
|
+
* // Perform any pre-connection validation
|
|
66
|
+
* const canConnect = await myApi.checkCanConnect(contact.userId);
|
|
67
|
+
* if (!canConnect) {
|
|
68
|
+
* showError('Cannot connect to this user');
|
|
69
|
+
* return false;
|
|
70
|
+
* }
|
|
71
|
+
* return true; // SDK will create the invitation
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
onConnect: (contact: FindFriendsContact) => Promise<boolean> | boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Optional: Called after an invitation is successfully created.
|
|
78
|
+
* Use this to update your UI or local state.
|
|
79
|
+
*
|
|
80
|
+
* @param contact - The contact for whom the invitation was created
|
|
81
|
+
*/
|
|
82
|
+
onInvitationCreated?: (contact: FindFriendsContact) => void;
|
|
83
|
+
/**
|
|
84
|
+
* Optional: Called if creating the invitation fails.
|
|
85
|
+
*
|
|
86
|
+
* @param contact - The contact for whom the invitation failed
|
|
87
|
+
* @param error - The error that occurred
|
|
88
|
+
*/
|
|
89
|
+
onInvitationError?: (contact: FindFriendsContact, error: Error) => void;
|
|
90
|
+
/**
|
|
91
|
+
* Optional: Custom text for the "Connect" button.
|
|
92
|
+
* @default "Connect"
|
|
93
|
+
*/
|
|
94
|
+
connectButtonText?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Optional: Custom empty state message when no contacts are provided.
|
|
97
|
+
* @default "No contacts found"
|
|
98
|
+
*/
|
|
99
|
+
emptyStateMessage?: string;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=findFriends.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findFriends.d.ts","sourceRoot":"","sources":["../../../src/types/findFriends.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,EAAE,kBAAkB,EAAE,CAAC;IAE/B;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,SAAS,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAEvE;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAE5D;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAExE;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
|