@teamvortexsoftware/vortex-react-native 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/Clipboard.js +64 -0
- package/dist/components/ShareButtons.js +27 -17
- package/dist/hooks/useVortexInvite.js +51 -9
- package/dist/types/components/Clipboard.d.ts +16 -0
- package/dist/types/components/Clipboard.d.ts.map +1 -0
- package/dist/types/components/ShareButtons.d.ts +4 -2
- package/dist/types/components/ShareButtons.d.ts.map +1 -1
- package/dist/types/hooks/useVortexInvite.d.ts +5 -2
- package/dist/types/hooks/useVortexInvite.d.ts.map +1 -1
- package/dist/types/utils/themeUtils.d.ts +1 -0
- package/dist/types/utils/themeUtils.d.ts.map +1 -1
- package/dist/types/vortexInvite.d.ts.map +1 -1
- package/dist/utils/themeUtils.js +1 -0
- package/dist/vortexInvite.js +4 -4
- package/package.json +16 -5
package/README.md
CHANGED
|
@@ -0,0 +1,64 @@
|
|
|
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;
|
|
@@ -42,7 +42,7 @@ const react_1 = __importStar(require("react"));
|
|
|
42
42
|
const react_native_1 = require("react-native");
|
|
43
43
|
const FontAwesome6_1 = __importDefault(require("react-native-vector-icons/FontAwesome6"));
|
|
44
44
|
const react_native_qrcode_svg_1 = __importDefault(require("react-native-qrcode-svg"));
|
|
45
|
-
function ShareButton({ iconName, label, onPress, themeColors, themeStyles }) {
|
|
45
|
+
function ShareButton({ iconName, label, onPress, themeColors, themeStyles, }) {
|
|
46
46
|
return (<react_native_1.View style={styles.shareButtonWrapper}>
|
|
47
47
|
<react_native_1.Pressable style={[styles.shareButton, themeStyles.secondaryButton]} onPress={onPress}>
|
|
48
48
|
<react_native_1.View style={styles.buttonContentContainer}>
|
|
@@ -52,17 +52,10 @@ function ShareButton({ iconName, label, onPress, themeColors, themeStyles }) {
|
|
|
52
52
|
</react_native_1.Pressable>
|
|
53
53
|
</react_native_1.View>);
|
|
54
54
|
}
|
|
55
|
-
function ShareButtons({ has, themeColors, themeStyles, handleShareLink, handleCopyLink, shareableLink, }) {
|
|
55
|
+
function ShareButtons({ has, themeColors, themeStyles, handleShareLink, handleCopyLink, handleSmsShare, handleEmailShare, shareableLink, }) {
|
|
56
56
|
const [showQRCode, setShowQRCode] = (0, react_1.useState)(false);
|
|
57
57
|
// Define button configurations
|
|
58
58
|
const buttonConfigs = [
|
|
59
|
-
{
|
|
60
|
-
key: 'shareOptionsNativeShareSheet',
|
|
61
|
-
iconName: 'share-nodes',
|
|
62
|
-
label: 'Native Share',
|
|
63
|
-
onPress: handleShareLink,
|
|
64
|
-
isAvailable: has.shareOptionsNativeShareSheet,
|
|
65
|
-
},
|
|
66
59
|
{
|
|
67
60
|
key: 'shareOptionsCopyLink',
|
|
68
61
|
iconName: 'copy',
|
|
@@ -71,6 +64,27 @@ function ShareButtons({ has, themeColors, themeStyles, handleShareLink, handleCo
|
|
|
71
64
|
isAvailable: true, // Always available when share is enabled
|
|
72
65
|
isWithShowUrl: has.shareOptionsCopyLink, // Special handling only if specifically enabled
|
|
73
66
|
},
|
|
67
|
+
{
|
|
68
|
+
key: 'shareOptionsSms',
|
|
69
|
+
iconName: 'message',
|
|
70
|
+
label: 'SMS',
|
|
71
|
+
onPress: handleSmsShare,
|
|
72
|
+
isAvailable: has.shareOptionsSms,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
key: 'shareOptionsEmail',
|
|
76
|
+
iconName: 'envelope',
|
|
77
|
+
label: 'Email',
|
|
78
|
+
onPress: handleEmailShare,
|
|
79
|
+
isAvailable: has.shareOptionsEmail,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
key: 'shareOptionsNativeShareSheet',
|
|
83
|
+
iconName: 'share-nodes',
|
|
84
|
+
label: 'Share Link',
|
|
85
|
+
onPress: handleShareLink,
|
|
86
|
+
isAvailable: has.shareOptionsNativeShareSheet,
|
|
87
|
+
},
|
|
74
88
|
{
|
|
75
89
|
key: 'shareOptionsQRCode',
|
|
76
90
|
iconName: 'qrcode',
|
|
@@ -85,13 +99,6 @@ function ShareButtons({ has, themeColors, themeStyles, handleShareLink, handleCo
|
|
|
85
99
|
onPress: () => { },
|
|
86
100
|
isAvailable: has.shareOptionsWhatsApp,
|
|
87
101
|
},
|
|
88
|
-
{
|
|
89
|
-
key: 'shareOptionsSms',
|
|
90
|
-
iconName: 'message',
|
|
91
|
-
label: 'SMS',
|
|
92
|
-
onPress: () => { },
|
|
93
|
-
isAvailable: has.shareOptionsSms,
|
|
94
|
-
},
|
|
95
102
|
// Add more share options as needed
|
|
96
103
|
// Example:
|
|
97
104
|
// {
|
|
@@ -111,7 +118,10 @@ function ShareButtons({ has, themeColors, themeStyles, handleShareLink, handleCo
|
|
|
111
118
|
.map((config) => config.isWithShowUrl && config.key === 'shareOptionsCopyLink' && shareableLink ? (<react_native_1.View key={config.key} style={styles.copyLinkContainer}>
|
|
112
119
|
<react_native_1.TextInput style={[
|
|
113
120
|
styles.linkInput,
|
|
114
|
-
{
|
|
121
|
+
{
|
|
122
|
+
color: themeColors.containerForeground,
|
|
123
|
+
borderColor: themeColors.containerBorder,
|
|
124
|
+
},
|
|
115
125
|
]} value={shareableLink} editable={false}/>
|
|
116
126
|
<react_native_1.Pressable style={[styles.copyButton, themeStyles.secondaryButton]} onPress={handleCopyLink}>
|
|
117
127
|
<FontAwesome6_1.default name="copy" size={20} color={themeColors.secondaryButtonForeground}/>
|
|
@@ -15,13 +15,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.useVortexInvite = useVortexInvite;
|
|
16
16
|
const react_1 = require("react");
|
|
17
17
|
const react_native_1 = require("react-native");
|
|
18
|
-
const api_1 = __importDefault(require("../shared/api"));
|
|
19
18
|
const themeUtils_1 = require("../utils/themeUtils");
|
|
19
|
+
const Clipboard_1 = require("../components/Clipboard");
|
|
20
20
|
const useThemeStyles_1 = require("./useThemeStyles");
|
|
21
21
|
const react_native_uuid_1 = __importDefault(require("react-native-uuid"));
|
|
22
22
|
const formUtils_1 = require("../utils/formUtils");
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const vortex_shared_ui_1 = require("@teamvortexsoftware/vortex-shared-ui");
|
|
24
|
+
function useVortexInvite({ widgetId, environmentId, vortexApiUrl, contentTokens, isLoading = false, jwt, onSuccess, onError, }) {
|
|
25
|
+
const vortexClient = (0, react_1.useMemo)(() => new vortex_shared_ui_1.VortexClient(vortexApiUrl, react_native_uuid_1.default.v4()), [vortexApiUrl]);
|
|
25
26
|
const [widgetConfiguration, setWidgetConfiguration] = (0, react_1.useState)();
|
|
26
27
|
const [error, setError] = (0, react_1.useState)(null);
|
|
27
28
|
const [fetching, setFetching] = (0, react_1.useState)(isLoading);
|
|
@@ -58,10 +59,10 @@ function useVortexInvite({ widgetId, environmentId, vortexApiHost, isLoading = f
|
|
|
58
59
|
}, [widgetConfiguration]);
|
|
59
60
|
// Log the host only once when the hook mounts
|
|
60
61
|
(0, react_1.useEffect)(() => {
|
|
61
|
-
if (
|
|
62
|
+
if (vortexApiUrl.indexOf('localhost') > -1) {
|
|
62
63
|
console.warn('[Vortex] Invite Using localhost as host');
|
|
63
64
|
}
|
|
64
|
-
}, [
|
|
65
|
+
}, [vortexApiUrl]);
|
|
65
66
|
// Loading animation effect
|
|
66
67
|
(0, react_1.useEffect)(() => {
|
|
67
68
|
const animation = react_native_1.Animated.loop(react_native_1.Animated.sequence([
|
|
@@ -184,7 +185,46 @@ function useVortexInvite({ widgetId, environmentId, vortexApiHost, isLoading = f
|
|
|
184
185
|
const getShareableLink = () => {
|
|
185
186
|
return vortexClient.getShareableLinkFormatted();
|
|
186
187
|
};
|
|
187
|
-
const
|
|
188
|
+
const handleSmsShare = () => __awaiter(this, void 0, void 0, function* () {
|
|
189
|
+
var _a, _b, _c;
|
|
190
|
+
try {
|
|
191
|
+
const template = (_c = (_b = (_a = widgetConfiguration === null || widgetConfiguration === void 0 ? void 0 : widgetConfiguration.configuration) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b['vortex.components.share.template.body']) === null || _c === void 0 ? void 0 : _c.value;
|
|
192
|
+
if (!template)
|
|
193
|
+
throw new Error('No template available');
|
|
194
|
+
const shareableLink = yield getShareableInviteLink();
|
|
195
|
+
if (!shareableLink)
|
|
196
|
+
throw new Error('No shareable link available');
|
|
197
|
+
const body = encodeURIComponent(template.replace(/{{vortex-share-link}}/g, shareableLink));
|
|
198
|
+
const smsUrl = `sms:?body=${body}`;
|
|
199
|
+
yield react_native_1.Linking.openURL(smsUrl);
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
console.error('[Vortex] Failed to open SMS app:', error);
|
|
203
|
+
if (onError)
|
|
204
|
+
onError(error instanceof Error ? error : new Error(String(error)), 'share');
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
const handleEmailShare = () => __awaiter(this, void 0, void 0, function* () {
|
|
208
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
209
|
+
try {
|
|
210
|
+
const template = (_c = (_b = (_a = widgetConfiguration === null || widgetConfiguration === void 0 ? void 0 : widgetConfiguration.configuration) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b['vortex.components.share.template.body']) === null || _c === void 0 ? void 0 : _c.value;
|
|
211
|
+
if (!template)
|
|
212
|
+
throw new Error('No template available');
|
|
213
|
+
const subject = ((_g = (_f = (_e = (_d = widgetConfiguration === null || widgetConfiguration === void 0 ? void 0 : widgetConfiguration.configuration) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e['vortex.components.share.template.subject']) === null || _f === void 0 ? void 0 : _f.value) === null || _g === void 0 ? void 0 : _g.trim()) || "You're Invited";
|
|
214
|
+
const shareableLink = yield getShareableInviteLink();
|
|
215
|
+
if (!shareableLink)
|
|
216
|
+
throw new Error('No shareable link available');
|
|
217
|
+
const body = encodeURIComponent(template.replace(/{{vortex-share-link}}/g, shareableLink));
|
|
218
|
+
const mailtoUrl = `mailto:?subject=${encodeURIComponent(subject)}&body=${body}`;
|
|
219
|
+
yield react_native_1.Linking.openURL(mailtoUrl);
|
|
220
|
+
}
|
|
221
|
+
catch (error) {
|
|
222
|
+
console.error('[Vortex] Failed to open Email app:', error);
|
|
223
|
+
if (onError)
|
|
224
|
+
onError(error instanceof Error ? error : new Error(String(error)), 'share');
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
const getShareableInviteLink = (contentTokens) => __awaiter(this, void 0, void 0, function* () {
|
|
188
228
|
// if (this.isLoading || !this.vortex) {
|
|
189
229
|
// return;
|
|
190
230
|
// }
|
|
@@ -204,14 +244,14 @@ function useVortexInvite({ widgetId, environmentId, vortexApiHost, isLoading = f
|
|
|
204
244
|
// this.host.requestUpdate();
|
|
205
245
|
return;
|
|
206
246
|
}
|
|
207
|
-
const link = `${
|
|
247
|
+
const link = `${vortexApiUrl}/noauth/invite/${invite.data.invitation.id}`;
|
|
208
248
|
console.log(`getShareableInviteLink: ${link}`);
|
|
209
249
|
setShareableLink(link); // TODO - need to differentiate invite host vs api host even though they are the same for now)
|
|
210
250
|
return link;
|
|
211
251
|
});
|
|
212
252
|
const handleShareLink = () => __awaiter(this, void 0, void 0, function* () {
|
|
213
253
|
try {
|
|
214
|
-
const shareableLink = yield getShareableInviteLink();
|
|
254
|
+
const shareableLink = yield getShareableInviteLink(contentTokens);
|
|
215
255
|
if (!shareableLink) {
|
|
216
256
|
throw new Error('No shareable link available');
|
|
217
257
|
}
|
|
@@ -240,7 +280,7 @@ function useVortexInvite({ widgetId, environmentId, vortexApiHost, isLoading = f
|
|
|
240
280
|
if (!shareableLink) {
|
|
241
281
|
throw new Error('No shareable link available');
|
|
242
282
|
}
|
|
243
|
-
yield
|
|
283
|
+
yield Clipboard_1.Clipboard.setString(shareableLink);
|
|
244
284
|
console.log('[Vortex] handleCopyLink', 'The invite link has been copied.');
|
|
245
285
|
if (onSuccess) {
|
|
246
286
|
onSuccess({
|
|
@@ -273,6 +313,8 @@ function useVortexInvite({ widgetId, environmentId, vortexApiHost, isLoading = f
|
|
|
273
313
|
handleInviteClick,
|
|
274
314
|
handleShareLink,
|
|
275
315
|
handleCopyLink,
|
|
316
|
+
handleSmsShare,
|
|
317
|
+
handleEmailShare,
|
|
276
318
|
getShareableLink,
|
|
277
319
|
formLayout,
|
|
278
320
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface IClipboard {
|
|
2
|
+
/**
|
|
3
|
+
* Sets the content of the clipboard as a string
|
|
4
|
+
* @param content The string to save to the clipboard
|
|
5
|
+
*/
|
|
6
|
+
setString(content: string): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* Gets the content of the clipboard as a string
|
|
9
|
+
* @returns The current clipboard content
|
|
10
|
+
*/
|
|
11
|
+
getString(): Promise<string>;
|
|
12
|
+
}
|
|
13
|
+
declare let Clipboard: IClipboard;
|
|
14
|
+
export { Clipboard };
|
|
15
|
+
export default Clipboard;
|
|
16
|
+
//# sourceMappingURL=Clipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Clipboard.d.ts","sourceRoot":"","sources":["../../../src/components/Clipboard.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1C;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;CAC9B;AAKD,QAAA,IAAI,SAAS,EAAE,UAAU,CAAC;AAwD1B,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,eAAe,SAAS,CAAC"}
|
|
@@ -10,7 +10,7 @@ interface ShareButtonProps {
|
|
|
10
10
|
themeColors: ThemeColors;
|
|
11
11
|
themeStyles: any;
|
|
12
12
|
}
|
|
13
|
-
export declare function ShareButton({ iconName, label, onPress, themeColors, themeStyles }: ShareButtonProps): React.JSX.Element;
|
|
13
|
+
export declare function ShareButton({ iconName, label, onPress, themeColors, themeStyles, }: ShareButtonProps): React.JSX.Element;
|
|
14
14
|
/**
|
|
15
15
|
* ShareButtons component for rendering all available share options
|
|
16
16
|
*/
|
|
@@ -20,8 +20,10 @@ export interface ShareButtonsProps {
|
|
|
20
20
|
themeStyles: any;
|
|
21
21
|
handleShareLink: () => void;
|
|
22
22
|
handleCopyLink: () => void;
|
|
23
|
+
handleSmsShare: () => void;
|
|
24
|
+
handleEmailShare: () => void;
|
|
23
25
|
shareableLink?: string;
|
|
24
26
|
}
|
|
25
|
-
export declare function ShareButtons({ has, themeColors, themeStyles, handleShareLink, handleCopyLink, shareableLink, }: ShareButtonsProps): React.JSX.Element;
|
|
27
|
+
export declare function ShareButtons({ has, themeColors, themeStyles, handleShareLink, handleCopyLink, handleSmsShare, handleEmailShare, shareableLink, }: ShareButtonsProps): React.JSX.Element;
|
|
26
28
|
export {};
|
|
27
29
|
//# sourceMappingURL=ShareButtons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShareButtons.d.ts","sourceRoot":"","sources":["../../../src/components/ShareButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD;;GAEG;AACH,UAAU,gBAAgB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,GAAG,CAAC;CAClB;AAED,wBAAgB,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"ShareButtons.d.ts","sourceRoot":"","sources":["../../../src/components/ShareButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD;;GAEG;AACH,UAAU,gBAAgB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,GAAG,CAAC;CAClB;AAED,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,KAAK,EACL,OAAO,EACP,WAAW,EACX,WAAW,GACZ,EAAE,gBAAgB,qBAWlB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,GAAG,CAAC;IACT,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,GAAG,CAAC;IACjB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,YAAY,CAAC,EAC3B,GAAG,EACH,WAAW,EACX,WAAW,EACX,eAAe,EACf,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,aAAa,GACd,EAAE,iBAAiB,qBA2GnB"}
|
|
@@ -4,13 +4,14 @@ import { Attributes, VortexActionResult, VortexActionType } from '../vortexInvit
|
|
|
4
4
|
export interface UseVortexInviteOptions {
|
|
5
5
|
widgetId: string;
|
|
6
6
|
environmentId: string;
|
|
7
|
-
|
|
7
|
+
vortexApiUrl: string;
|
|
8
|
+
contentTokens?: Attributes;
|
|
8
9
|
isLoading?: boolean;
|
|
9
10
|
jwt?: string;
|
|
10
11
|
onSuccess?: (result: VortexActionResult) => void;
|
|
11
12
|
onError?: (error: Error, type: VortexActionType) => void;
|
|
12
13
|
}
|
|
13
|
-
export declare function useVortexInvite({ widgetId, environmentId,
|
|
14
|
+
export declare function useVortexInvite({ widgetId, environmentId, vortexApiUrl, contentTokens, isLoading, jwt, onSuccess, onError, }: UseVortexInviteOptions): {
|
|
14
15
|
widgetConfiguration: WidgetConfiguration | undefined;
|
|
15
16
|
error: {
|
|
16
17
|
message: string;
|
|
@@ -29,6 +30,8 @@ export declare function useVortexInvite({ widgetId, environmentId, vortexApiHost
|
|
|
29
30
|
handleInviteClick: (contentTokens?: Attributes) => Promise<void>;
|
|
30
31
|
handleShareLink: () => Promise<void>;
|
|
31
32
|
handleCopyLink: () => Promise<void>;
|
|
33
|
+
handleSmsShare: () => Promise<void>;
|
|
34
|
+
handleEmailShare: () => Promise<void>;
|
|
32
35
|
getShareableLink: () => string;
|
|
33
36
|
formLayout: {
|
|
34
37
|
emailPlaceholder: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVortexInvite.d.ts","sourceRoot":"","sources":["../../../src/hooks/useVortexInvite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"useVortexInvite.d.ts","sourceRoot":"","sources":["../../../src/hooks/useVortexInvite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAkB,MAAM,cAAc,CAAC;AAIxD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAYnF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,UAAU,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,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;CAC1D;AAED,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,aAAa,EACb,SAAiB,EACjB,GAAG,EACH,SAAS,EACT,OAAO,GACR,EAAE,sBAAsB;;;iBAIuB,MAAM;;;;;;;;;;;;;wCAwIH,UAAU,KAAG,OAAO,CAAC,IAAI,CAAC;;;;;;;;;;;;;EA+L5E"}
|
|
@@ -15,6 +15,7 @@ export interface FeatureFlags {
|
|
|
15
15
|
emailInvitations: boolean;
|
|
16
16
|
shareOptionsCopyLink: boolean;
|
|
17
17
|
shareOptionsSms: boolean;
|
|
18
|
+
shareOptionsEmail: boolean;
|
|
18
19
|
shareOptionsFacebookMessenger: boolean;
|
|
19
20
|
shareOptionsInstagramDms: boolean;
|
|
20
21
|
shareOptionsLinkedInMessaging: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themeUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/themeUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,MAAM,WAAW,WAAW;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;IAChC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,yBAAyB,EAAE,MAAM,CAAC;IAClC,yBAAyB,EAAE,MAAM,CAAC;IAClC,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,6BAA6B,EAAE,OAAO,CAAC;IACvC,wBAAwB,EAAE,OAAO,CAAC;IAClC,6BAA6B,EAAE,OAAO,CAAC;IACvC,sBAAsB,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vortexInvite.d.ts","sourceRoot":"","sources":["../../src/vortexInvite.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAGD,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1E;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,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,aAAa,CAAC,EAAE,UAAU,CAAC;CAC5B;AAED,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,aAAa,EACb,aAAa,EACb,SAAiB,EACjB,GAAG,EACH,SAAS,EACT,OAAO,EACP,aAAa,GACd,EAAE,iBAAiB,qBA+JnB"}
|
package/dist/utils/themeUtils.js
CHANGED
|
@@ -48,6 +48,7 @@ function extractFeatureFlags(widgetConfiguration) {
|
|
|
48
48
|
shareOptionsLinkedInMessaging: shareOptions.includes("linkedInMessaging"),
|
|
49
49
|
shareOptionsNativeShareSheet: shareOptions.includes("nativeShareSheet"),
|
|
50
50
|
shareOptionsQrCode: shareOptions.includes("qrCode"), // Only true if specifically included
|
|
51
|
+
shareOptionsEmail: shareOptions.includes("email"),
|
|
51
52
|
shareOptionsSms: shareOptions.includes("sms"),
|
|
52
53
|
shareOptionsTwitterDms: shareOptions.includes("twitterDms"),
|
|
53
54
|
shareOptionsWhatsApp: shareOptions.includes("whatsApp"),
|
package/dist/vortexInvite.js
CHANGED
|
@@ -9,10 +9,10 @@ const react_native_1 = require("react-native");
|
|
|
9
9
|
const useVortexInvite_1 = require("./hooks/useVortexInvite");
|
|
10
10
|
const ShareButtons_1 = require("./components/ShareButtons");
|
|
11
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, getShareableLink, formLayout, } = (0, useVortexInvite_1.useVortexInvite)({
|
|
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
13
|
widgetId,
|
|
14
14
|
environmentId,
|
|
15
|
-
vortexApiHost,
|
|
15
|
+
vortexApiUrl: vortexApiHost,
|
|
16
16
|
isLoading,
|
|
17
17
|
jwt,
|
|
18
18
|
onSuccess,
|
|
@@ -48,7 +48,7 @@ function VortexInvite({ widgetId, environmentId, vortexApiHost, isLoading = fals
|
|
|
48
48
|
{/* Share buttons column */}
|
|
49
49
|
{(has === null || has === void 0 ? void 0 : has.shareableLinks) && (<react_native_1.View style={styles.gridItem}>
|
|
50
50
|
<react_native_1.View style={styles.shareButtonsContainer}>
|
|
51
|
-
<ShareButtons_1.ShareButtons has={has} themeColors={themeColors} themeStyles={themeStyles} handleShareLink={handleShareLink} handleCopyLink={handleCopyLink} shareableLink={getShareableLink()}/>
|
|
51
|
+
<ShareButtons_1.ShareButtons has={has} themeColors={themeColors} themeStyles={themeStyles} handleShareLink={handleShareLink} handleCopyLink={handleCopyLink} handleSmsShare={handleSmsShare} handleEmailShare={handleEmailShare} shareableLink={getShareableLink()}/>
|
|
52
52
|
</react_native_1.View>
|
|
53
53
|
</react_native_1.View>)}
|
|
54
54
|
</react_native_1.View>
|
|
@@ -75,7 +75,7 @@ function VortexInvite({ widgetId, environmentId, vortexApiHost, isLoading = fals
|
|
|
75
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
76
|
|
|
77
77
|
<react_native_1.View style={styles.shareButtonsContainer}>
|
|
78
|
-
<ShareButtons_1.ShareButtons has={has} themeColors={themeColors} themeStyles={themeStyles} handleShareLink={handleShareLink} handleCopyLink={handleCopyLink} shareableLink={getShareableLink()}/>
|
|
78
|
+
<ShareButtons_1.ShareButtons has={has} themeColors={themeColors} themeStyles={themeStyles} handleShareLink={handleShareLink} handleCopyLink={handleCopyLink} handleSmsShare={handleSmsShare} handleEmailShare={handleEmailShare} shareableLink={getShareableLink()}/>
|
|
79
79
|
</react_native_1.View>
|
|
80
80
|
</react_native_1.View>)}
|
|
81
81
|
</react_native_1.View>);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@teamvortexsoftware/vortex-react-native",
|
|
3
3
|
"description": "",
|
|
4
4
|
"author": "@teamvortexsoftware",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.13",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
8
8
|
],
|
|
@@ -25,19 +25,30 @@
|
|
|
25
25
|
"eslint-plugin-react-native": "^4.1.0",
|
|
26
26
|
"typescript": "5.8.3",
|
|
27
27
|
"typescript-eslint": "^8.30.1",
|
|
28
|
-
"@teamvortexsoftware/
|
|
29
|
-
"@teamvortexsoftware/
|
|
28
|
+
"@teamvortexsoftware/eslint-config": "0.0.0",
|
|
29
|
+
"@teamvortexsoftware/typescript-config": "0.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"react-native-qrcode-svg": "^6.3.15",
|
|
33
33
|
"react-native-svg": "^15.12.0",
|
|
34
34
|
"react-native-uuid": "^2.0.3",
|
|
35
35
|
"react-native-vector-icons": "^10.2.0",
|
|
36
|
-
"@teamvortexsoftware/vortex-core": "0.0.1"
|
|
36
|
+
"@teamvortexsoftware/vortex-core": "0.0.1",
|
|
37
|
+
"@teamvortexsoftware/vortex-shared-ui": "0.0.1"
|
|
37
38
|
},
|
|
38
39
|
"peerDependencies": {
|
|
39
40
|
"react": ">=19.0.0",
|
|
40
|
-
"react-native": ">=0.79.0"
|
|
41
|
+
"react-native": ">=0.79.0",
|
|
42
|
+
"@react-native-clipboard/clipboard": ">=1.16.2",
|
|
43
|
+
"expo-clipboard": ">=7.1.4"
|
|
44
|
+
},
|
|
45
|
+
"peerDependenciesMeta": {
|
|
46
|
+
"@react-native-clipboard/clipboard": {
|
|
47
|
+
"optional": true
|
|
48
|
+
},
|
|
49
|
+
"expo-clipboard": {
|
|
50
|
+
"optional": true
|
|
51
|
+
}
|
|
41
52
|
},
|
|
42
53
|
"scripts": {
|
|
43
54
|
"build": "tsc",
|