@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,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractThemeColors = extractThemeColors;
|
|
4
|
+
exports.extractFeatureFlags = extractFeatureFlags;
|
|
5
|
+
/**
|
|
6
|
+
* Extracts the color from a CSS border shorthand value (e.g., "1px solid #c4c4c4" → "#c4c4c4")
|
|
7
|
+
* Returns undefined if the value doesn't match the expected format
|
|
8
|
+
*/
|
|
9
|
+
function extractBorderColor(borderValue) {
|
|
10
|
+
if (!borderValue)
|
|
11
|
+
return undefined;
|
|
12
|
+
const parts = borderValue.trim().split(/\s+/);
|
|
13
|
+
// Expect exactly 3 parts: width, style, color (e.g., "1px solid #c4c4c4")
|
|
14
|
+
if (parts.length === 3) {
|
|
15
|
+
return parts[2];
|
|
16
|
+
}
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Extracts theme colors from widget configuration
|
|
21
|
+
*/
|
|
22
|
+
function extractThemeColors(widgetConfiguration) {
|
|
23
|
+
var _a, _b;
|
|
24
|
+
const props = (_a = widgetConfiguration === null || widgetConfiguration === void 0 ? void 0 : widgetConfiguration.configuration) === null || _a === void 0 ? void 0 : _a.props;
|
|
25
|
+
const themeValue = (_b = props === null || props === void 0 ? void 0 : props['vortex.theme']) === null || _b === void 0 ? void 0 : _b.value;
|
|
26
|
+
// Normalize theme entries to an array of { key, value }
|
|
27
|
+
let entries = [];
|
|
28
|
+
if (Array.isArray(themeValue)) {
|
|
29
|
+
entries = themeValue;
|
|
30
|
+
}
|
|
31
|
+
else if (themeValue && Array.isArray(themeValue.options)) {
|
|
32
|
+
entries = themeValue.options;
|
|
33
|
+
}
|
|
34
|
+
else if (themeValue && typeof themeValue === 'object') {
|
|
35
|
+
// Fallback: treat object map as entries if present
|
|
36
|
+
entries = Object.keys(themeValue)
|
|
37
|
+
.filter((k) => k.startsWith('--'))
|
|
38
|
+
.map((k) => ({ key: k, value: String(themeValue[k]) }));
|
|
39
|
+
}
|
|
40
|
+
const colorMap = {};
|
|
41
|
+
entries.forEach((item) => {
|
|
42
|
+
const k = item === null || item === void 0 ? void 0 : item.key;
|
|
43
|
+
const v = item === null || item === void 0 ? void 0 : item.value;
|
|
44
|
+
if (typeof k === 'string' && typeof v === 'string') {
|
|
45
|
+
colorMap[k] = v;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return {
|
|
49
|
+
containerBackground: colorMap['--vrtx-root-background'] || colorMap['--color-background'] || '#ffffff',
|
|
50
|
+
containerForeground: colorMap['--vrtx-root-color'] || colorMap['--color-foreground'] || '#666666',
|
|
51
|
+
containerBorder: extractBorderColor(colorMap['--vrtx-root-border']) ||
|
|
52
|
+
extractBorderColor(colorMap['--vrtx-input-border']) ||
|
|
53
|
+
colorMap['--color-border'] ||
|
|
54
|
+
'#c4c4c4',
|
|
55
|
+
primaryButtonBackground: colorMap['--vrtx-submit-primary-background'] ||
|
|
56
|
+
colorMap['--vrtx-button-primary-background'] ||
|
|
57
|
+
colorMap['--color-primary-background'] ||
|
|
58
|
+
'#197af3',
|
|
59
|
+
primaryButtonForeground: colorMap['--vrtx-submit-primary-color'] ||
|
|
60
|
+
colorMap['--color-primary-foreground'] ||
|
|
61
|
+
'#ffffff',
|
|
62
|
+
primaryButtonBorder: extractBorderColor(colorMap['--vrtx-submit-primary-border']) ||
|
|
63
|
+
colorMap['--vrtx-submit-primary-border-color'] ||
|
|
64
|
+
colorMap['--vrtx-button-primary-border-color'] ||
|
|
65
|
+
colorMap['--color-primary-border'] ||
|
|
66
|
+
'#000000',
|
|
67
|
+
secondaryButtonBackground: colorMap['--vrtx-submit-secondary-background'] ||
|
|
68
|
+
colorMap['--vrtx-button-secondary-background'] ||
|
|
69
|
+
colorMap['--color-secondary-background'] ||
|
|
70
|
+
'#dfdfdf',
|
|
71
|
+
secondaryButtonForeground: colorMap['--vrtx-submit-secondary-color'] ||
|
|
72
|
+
colorMap['--vrtx-button-secondary-color'] ||
|
|
73
|
+
colorMap['--color-secondary-foreground'] ||
|
|
74
|
+
'#000000',
|
|
75
|
+
secondaryButtonBorder: extractBorderColor(colorMap['--vrtx-submit-secondary-border']) ||
|
|
76
|
+
colorMap['--vrtx-submit-secondary-border-color'] ||
|
|
77
|
+
colorMap['--vrtx-button-secondary-border-color'] ||
|
|
78
|
+
colorMap['--color-secondary-border'] ||
|
|
79
|
+
'#c4c4c4',
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Extracts feature flags from widget configuration
|
|
84
|
+
*/
|
|
85
|
+
function extractFeatureFlags(widgetConfiguration) {
|
|
86
|
+
var _a, _b, _c, _d;
|
|
87
|
+
const props = (_a = widgetConfiguration === null || widgetConfiguration === void 0 ? void 0 : widgetConfiguration.configuration) === null || _a === void 0 ? void 0 : _a.props;
|
|
88
|
+
const features = Array.isArray((_b = props === null || props === void 0 ? void 0 : props['vortex.components']) === null || _b === void 0 ? void 0 : _b.value)
|
|
89
|
+
? props['vortex.components'].value
|
|
90
|
+
: [];
|
|
91
|
+
const shareOptions = Array.isArray((_c = props === null || props === void 0 ? void 0 : props['vortex.components.share.options']) === null || _c === void 0 ? void 0 : _c.value)
|
|
92
|
+
? props['vortex.components.share.options'].value
|
|
93
|
+
: [];
|
|
94
|
+
// Detect presence of blocks in the form tree (row/column/block with subtype)
|
|
95
|
+
const formValue = (_d = props === null || props === void 0 ? void 0 : props['vortex.components.form']) === null || _d === void 0 ? void 0 : _d.value;
|
|
96
|
+
let hasEmailBlock = false;
|
|
97
|
+
let hasShareBlock = false;
|
|
98
|
+
const traverse = (node) => {
|
|
99
|
+
if (!node)
|
|
100
|
+
return;
|
|
101
|
+
if (Array.isArray(node)) {
|
|
102
|
+
node.forEach(traverse);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (node.type === 'block') {
|
|
106
|
+
if (node.subtype === 'vrtx-email-invitations')
|
|
107
|
+
hasEmailBlock = true;
|
|
108
|
+
if (node.subtype === 'vrtx-share-options')
|
|
109
|
+
hasShareBlock = true;
|
|
110
|
+
}
|
|
111
|
+
if (node.children && node.children.length) {
|
|
112
|
+
node.children.forEach(traverse);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
if (formValue === null || formValue === void 0 ? void 0 : formValue.root) {
|
|
116
|
+
traverse(formValue.root);
|
|
117
|
+
}
|
|
118
|
+
else if (Array.isArray(formValue)) {
|
|
119
|
+
traverse(formValue);
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
// Email invites if feature enabled or email block present
|
|
123
|
+
emailInvitations: features.includes('vortex.components.emailinvitations') || hasEmailBlock,
|
|
124
|
+
// Share section enabled if share block present or explicit feature (if ever provided)
|
|
125
|
+
shareEnabled: hasShareBlock || features.includes('vortex.components.share'),
|
|
126
|
+
shareableLinks: hasShareBlock || features.includes('vortex.components.share'),
|
|
127
|
+
shareOptionsCopyLink: shareOptions.includes('copyLink'),
|
|
128
|
+
shareOptionsFacebookMessenger: shareOptions.includes('facebookMessenger'),
|
|
129
|
+
shareOptionsInstagramDms: shareOptions.includes('instagramDms'),
|
|
130
|
+
shareOptionsLinkedInMessaging: shareOptions.includes('linkedInMessaging'),
|
|
131
|
+
shareOptionsNativeShareSheet: shareOptions.includes('nativeShareSheet'),
|
|
132
|
+
shareOptionsQrCode: shareOptions.includes('qrCode'),
|
|
133
|
+
shareOptionsSms: shareOptions.includes('sms'),
|
|
134
|
+
shareOptionsTwitterDms: shareOptions.includes('twitterDms'),
|
|
135
|
+
shareOptionsEmail: shareOptions.includes('email'),
|
|
136
|
+
shareOptionsWhatsApp: shareOptions.includes('whatsApp'),
|
|
137
|
+
shareOptionsLine: shareOptions.includes('line'),
|
|
138
|
+
shareOptionsOrder: shareOptions,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=themeUtils.js.map
|
|
@@ -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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Q,CAAC,KAAK,CAAC;QAC7C,sBAAsB,EAAE,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC3D,iBAAiB,EAAE,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC;QACjD,oBAAoB,EAAE,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC;QACvD,gBAAgB,EAAE,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC/C,iBAAiB,EAAE,YAAY;KAChB,CAAC;AACpB,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"]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.VortexInvite = VortexInvite;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const react_native_1 = require("react-native");
|
|
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
|
+
}
|
|
83
|
+
//# sourceMappingURL=vortexInvite.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vortexInvite.js","sourceRoot":"","sources":["../src/vortexInvite.tsx"],"names":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,iBAAiB,CAAC,CACrC,yBAAyB,CAAC,CAAC,yBAAyB,CAAC,CACrD,yBAAyB,CAAC,CAAC,yBAAyB,CAAC,CACrD,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,eAAe,CAAC,CAAC,eAAe,CAAC,CACjC,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,2BAA2B,CAAC,CAAC,2BAA2B,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
|
@@ -3,69 +3,47 @@
|
|
|
3
3
|
"description": "Vortex React Native SDK",
|
|
4
4
|
"author": "@teamvortexsoftware",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.1",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
10
|
"main": "./dist/index.js",
|
|
11
|
+
"module": "./dist/index.mjs",
|
|
11
12
|
"exports": {
|
|
12
13
|
".": {
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"development": "./src/index.tsx",
|
|
16
|
-
"default": "./dist/index.js"
|
|
17
|
-
},
|
|
18
|
-
"import": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
19
16
|
"require": "./dist/index.js",
|
|
20
|
-
"
|
|
17
|
+
"react-native": "./dist/index.js",
|
|
18
|
+
"source": "./src/index.tsx"
|
|
21
19
|
},
|
|
22
20
|
"./web": {
|
|
23
|
-
"
|
|
24
|
-
"import": "./dist/index-web.
|
|
21
|
+
"types": "./dist/index-web.d.ts",
|
|
22
|
+
"import": "./dist/index-web.mjs",
|
|
25
23
|
"require": "./dist/index-web.js",
|
|
26
|
-
"
|
|
24
|
+
"source": "./src/index-web.tsx"
|
|
27
25
|
},
|
|
28
|
-
"./runtime": "./dist/index.js",
|
|
29
26
|
"./hooks/useInvitationFormLogic": {
|
|
30
|
-
"
|
|
31
|
-
"import": "./dist/hooks/useInvitationFormLogic.
|
|
27
|
+
"types": "./dist/hooks/useInvitationFormLogic.d.ts",
|
|
28
|
+
"import": "./dist/hooks/useInvitationFormLogic.mjs",
|
|
32
29
|
"require": "./dist/hooks/useInvitationFormLogic.js",
|
|
33
|
-
"
|
|
30
|
+
"source": "./src/hooks/useInvitationFormLogic.ts"
|
|
34
31
|
},
|
|
35
32
|
"./constants/mockData": {
|
|
36
|
-
"
|
|
37
|
-
"import": "./dist/constants/mockData.
|
|
33
|
+
"types": "./dist/constants/mockData.d.ts",
|
|
34
|
+
"import": "./dist/constants/mockData.mjs",
|
|
38
35
|
"require": "./dist/constants/mockData.js",
|
|
39
|
-
"
|
|
36
|
+
"source": "./src/constants/mockData.ts"
|
|
40
37
|
},
|
|
41
38
|
"./utils/contactUtils": {
|
|
42
|
-
"
|
|
43
|
-
"import": "./dist/utils/contactUtils.
|
|
39
|
+
"types": "./dist/utils/contactUtils.d.ts",
|
|
40
|
+
"import": "./dist/utils/contactUtils.mjs",
|
|
44
41
|
"require": "./dist/utils/contactUtils.js",
|
|
45
|
-
"
|
|
42
|
+
"source": "./src/utils/contactUtils.ts"
|
|
46
43
|
}
|
|
47
44
|
},
|
|
48
|
-
"types": "dist/
|
|
45
|
+
"types": "dist/index.d.ts",
|
|
49
46
|
"react-native": "dist/index.js",
|
|
50
|
-
"devDependencies": {
|
|
51
|
-
"@eslint/js": "9.39.2",
|
|
52
|
-
"@testing-library/jest-dom": "6.9.1",
|
|
53
|
-
"@testing-library/react": "16.3.1",
|
|
54
|
-
"@types/react": "19.2.7",
|
|
55
|
-
"@types/react-native-vector-icons": "^6.4.18",
|
|
56
|
-
"@vitest/coverage-v8": "4.0.18",
|
|
57
|
-
"eslint": "9.39.2",
|
|
58
|
-
"eslint-plugin-react-native": "^4.1.0",
|
|
59
|
-
"expo-haptics": "^15.0.7",
|
|
60
|
-
"jsdom": "^26.0.2",
|
|
61
|
-
"react": "19.2.3",
|
|
62
|
-
"react-dom": "19.2.3",
|
|
63
|
-
"react-native-web": "^0.19.13",
|
|
64
|
-
"rimraf": "6.1.2",
|
|
65
|
-
"typescript-eslint": "8.50.1",
|
|
66
|
-
"vite": "7.3.1",
|
|
67
|
-
"vitest": "4.0.18"
|
|
68
|
-
},
|
|
69
47
|
"dependencies": {
|
|
70
48
|
"react-native-uuid": "^2.0.3",
|
|
71
49
|
"react-native-vector-icons": "^10.2.0"
|
|
@@ -77,8 +55,8 @@
|
|
|
77
55
|
"expo-haptics": ">=13.0.0",
|
|
78
56
|
"expo-linear-gradient": ">=12.0.0",
|
|
79
57
|
"expo-sharing": ">=13.0.0",
|
|
80
|
-
"react": "
|
|
81
|
-
"react-native": ">=0.
|
|
58
|
+
"react": ">=18.0.0",
|
|
59
|
+
"react-native": ">=0.75.0",
|
|
82
60
|
"react-native-linear-gradient": ">=2.6.0",
|
|
83
61
|
"react-native-qrcode-svg": ">=6.3.0",
|
|
84
62
|
"react-native-svg": ">=15.0.0",
|
|
@@ -115,18 +93,5 @@
|
|
|
115
93
|
"react-qr-code": {
|
|
116
94
|
"optional": true
|
|
117
95
|
}
|
|
118
|
-
},
|
|
119
|
-
"scripts": {
|
|
120
|
-
"clean": "rimraf dist",
|
|
121
|
-
"build": "pnpm run clean && tsc",
|
|
122
|
-
"dev": "pnpm run clean && tsc -w --preserveWatchOutput",
|
|
123
|
-
"prepublish": "pnpm run build",
|
|
124
|
-
"build:prod": "pnpm run clean && tsc",
|
|
125
|
-
"prepublish:prod": "mkdir -p dist.d/prod && cp -r dist dist.d/prod/ && cp ./LICENSE ./README.md dist.d/prod/ && jq 'del(.dependencies.\"@teamvortexsoftware/analytics-client\") | del(.dependencies.\"@teamvortexsoftware/vortex-shared-ui\") | del(.devDependencies.\"@teamvortexsoftware/vortex-types\") | del(.devDependencies.\"@teamvortexsoftware/eslint-config\") | del(.devDependencies.\"@teamvortexsoftware/typescript-config\") | del(.scripts.prepack)' ./package.json > ./dist.d/prod/package.json",
|
|
126
|
-
"publish:prod": "pnpm run prepublish:prod && pnpm publish --access public ./dist.d/prod",
|
|
127
|
-
"lint": "eslint src/",
|
|
128
|
-
"type-check": "tsc --noEmit",
|
|
129
|
-
"test": "vitest",
|
|
130
|
-
"test:ci": "vitest run --coverage"
|
|
131
96
|
}
|
|
132
97
|
}
|