@teamvortexsoftware/vortex-react-native 0.0.13 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +1227 -11
- 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 +1 -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 +2 -0
- package/dist/hooks/useThemeStyles.js.map +1 -0
- package/dist/hooks/useVortexInvite.js +467 -56
- 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 +10205 -4
- 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/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 +1 -0
- package/dist/types/hooks/useThemeStyles.d.ts.map +1 -1
- package/dist/types/hooks/useVortexInvite.d.ts +48 -6
- package/dist/types/hooks/useVortexInvite.d.ts.map +1 -1
- 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 +21 -0
- package/dist/types/index.d.ts.map +1 -1
- 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/{shared/InvitationResult.js → types/platformOperations.js} +1 -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 +11 -3
- package/dist/types/utils/formUtils.d.ts.map +1 -1
- 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 +3 -1
- package/dist/types/utils/themeUtils.d.ts.map +1 -1
- package/dist/types/vortexInvite.d.ts +145 -5
- package/dist/types/vortexInvite.d.ts.map +1 -1
- 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 +161 -51
- 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 +117 -32
- package/dist/utils/themeUtils.js.map +1 -0
- package/dist/vortexInvite.js +78 -167
- package/dist/vortexInvite.js.map +1 -0
- package/package.json +69 -31
- package/dist/components/Clipboard.js +0 -64
- package/dist/shared/api.js +0 -90
- package/dist/tests/TestVortexInvite.js +0 -134
- package/dist/types/components/Clipboard.d.ts +0 -16
- package/dist/types/components/Clipboard.d.ts.map +0 -1
- package/dist/types/shared/InvitationResult.d.ts +0 -24
- package/dist/types/shared/InvitationResult.d.ts.map +0 -1
- package/dist/types/shared/api.d.ts +0 -14
- package/dist/types/shared/api.d.ts.map +0 -1
- package/dist/types/tests/TestVortexInvite.d.ts +0 -4
- package/dist/types/tests/TestVortexInvite.d.ts.map +0 -1
|
@@ -0,0 +1,234 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.VrtxContactsImport = VrtxContactsImport;
|
|
16
|
+
const react_1 = __importDefault(require("react"));
|
|
17
|
+
const react_native_1 = require("react-native");
|
|
18
|
+
const VortexModulesContext_1 = require("../context/VortexModulesContext");
|
|
19
|
+
const isWeb = react_native_1.Platform.OS === 'web';
|
|
20
|
+
const ButtonWrapper = ({ children, style, gradientString, onPress, disabled, }) => {
|
|
21
|
+
// Get the gradient module and loaders from context
|
|
22
|
+
const { gradientModule, loaders } = (0, VortexModulesContext_1.useVortexModules)();
|
|
23
|
+
const styleArray = Array.isArray(style) ? style : [style];
|
|
24
|
+
// On web, use CSS gradients directly
|
|
25
|
+
if (gradientString && isWeb) {
|
|
26
|
+
return (<react_native_1.TouchableOpacity style={[...styleArray, { background: gradientString }]} onPress={onPress} disabled={disabled} activeOpacity={0.7}>
|
|
27
|
+
{children}
|
|
28
|
+
</react_native_1.TouchableOpacity>);
|
|
29
|
+
}
|
|
30
|
+
// On native, try to use gradient library if specified
|
|
31
|
+
if (gradientString && gradientModule && loaders) {
|
|
32
|
+
const GradientComponent = loaders.loadGradientComponent(gradientModule);
|
|
33
|
+
const parsed = loaders.parseCSSLinearGradient(gradientString);
|
|
34
|
+
if (GradientComponent && parsed) {
|
|
35
|
+
const points = loaders.angleToGradientPoints(parsed.angle);
|
|
36
|
+
return (<react_native_1.TouchableOpacity onPress={onPress} disabled={disabled} activeOpacity={0.7}>
|
|
37
|
+
<GradientComponent colors={parsed.colors} locations={parsed.locations} start={points.start} end={points.end} style={styleArray}>
|
|
38
|
+
{children}
|
|
39
|
+
</GradientComponent>
|
|
40
|
+
</react_native_1.TouchableOpacity>);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Fallback: solid color from first gradient stop
|
|
44
|
+
const fallbackColor = gradientString && loaders ? loaders.parseGradientFirstColor(gradientString) : null;
|
|
45
|
+
const finalStyle = fallbackColor ? [...styleArray, { backgroundColor: fallbackColor }] : styleArray;
|
|
46
|
+
return (<react_native_1.TouchableOpacity style={finalStyle} onPress={onPress} disabled={disabled} activeOpacity={0.7}>
|
|
47
|
+
{children}
|
|
48
|
+
</react_native_1.TouchableOpacity>);
|
|
49
|
+
};
|
|
50
|
+
function VrtxContactsImport({ block, renderIcon, isNativeContactsEnabled, isGoogleContactsEnabled, handleSelectFromContacts, handleSelectFromGoogle, triggerHaptic, isEditMode = false, }) {
|
|
51
|
+
var _a;
|
|
52
|
+
// Get loaders from context
|
|
53
|
+
const { loaders } = (0, VortexModulesContext_1.useVortexModules)();
|
|
54
|
+
// Helper to get customization label - null/undefined uses default, empty string shows nothing
|
|
55
|
+
const getCustomLabel = (key, defaultLabel) => {
|
|
56
|
+
var _a, _b, _c;
|
|
57
|
+
const textContent = (_c = (_b = (_a = block === null || block === void 0 ? void 0 : block.settings) === null || _a === void 0 ? void 0 : _a.customizations) === null || _b === void 0 ? void 0 : _b[key]) === null || _c === void 0 ? void 0 : _c.textContent;
|
|
58
|
+
// If textContent is null or undefined, use default. Empty string is valid (shows no label).
|
|
59
|
+
if (textContent === null || textContent === undefined) {
|
|
60
|
+
return defaultLabel;
|
|
61
|
+
}
|
|
62
|
+
return textContent;
|
|
63
|
+
};
|
|
64
|
+
const handleSelectFromContactsWithHaptics = () => __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
yield (triggerHaptic === null || triggerHaptic === void 0 ? void 0 : triggerHaptic('light'));
|
|
66
|
+
handleSelectFromContacts();
|
|
67
|
+
});
|
|
68
|
+
const handleSelectFromGoogleWithHaptics = () => __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
yield (triggerHaptic === null || triggerHaptic === void 0 ? void 0 : triggerHaptic('light'));
|
|
70
|
+
handleSelectFromGoogle();
|
|
71
|
+
});
|
|
72
|
+
// Convert theme options to inline styles
|
|
73
|
+
const themeToStyle = (theme) => {
|
|
74
|
+
if (!(theme === null || theme === void 0 ? void 0 : theme.options) || !Array.isArray(theme.options))
|
|
75
|
+
return {};
|
|
76
|
+
const style = {};
|
|
77
|
+
theme.options.forEach((option) => {
|
|
78
|
+
if (!option.value)
|
|
79
|
+
return;
|
|
80
|
+
const { key, value } = option;
|
|
81
|
+
// Handle padding and margin with shorthand expansion
|
|
82
|
+
if (key === '--vrtx-icon-button-padding' && value) {
|
|
83
|
+
const parts = value.trim().split(/\s+/);
|
|
84
|
+
if (parts.length === 1) {
|
|
85
|
+
style.paddingTop = style.paddingRight = style.paddingBottom = style.paddingLeft = value;
|
|
86
|
+
}
|
|
87
|
+
else if (parts.length === 2) {
|
|
88
|
+
style.paddingTop = style.paddingBottom = parts[0];
|
|
89
|
+
style.paddingRight = style.paddingLeft = parts[1];
|
|
90
|
+
}
|
|
91
|
+
else if (parts.length === 3) {
|
|
92
|
+
style.paddingTop = parts[0];
|
|
93
|
+
style.paddingRight = style.paddingLeft = parts[1];
|
|
94
|
+
style.paddingBottom = parts[2];
|
|
95
|
+
}
|
|
96
|
+
else if (parts.length === 4) {
|
|
97
|
+
style.paddingTop = parts[0];
|
|
98
|
+
style.paddingRight = parts[1];
|
|
99
|
+
style.paddingBottom = parts[2];
|
|
100
|
+
style.paddingLeft = parts[3];
|
|
101
|
+
}
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (key === '--vrtx-icon-button-margin' && value) {
|
|
105
|
+
const parts = value.trim().split(/\s+/);
|
|
106
|
+
if (parts.length === 1) {
|
|
107
|
+
style.marginTop = style.marginRight = style.marginBottom = style.marginLeft = value;
|
|
108
|
+
}
|
|
109
|
+
else if (parts.length === 2) {
|
|
110
|
+
style.marginTop = style.marginBottom = parts[0];
|
|
111
|
+
style.marginRight = style.marginLeft = parts[1];
|
|
112
|
+
}
|
|
113
|
+
else if (parts.length === 3) {
|
|
114
|
+
style.marginTop = parts[0];
|
|
115
|
+
style.marginRight = style.marginLeft = parts[1];
|
|
116
|
+
style.marginBottom = parts[2];
|
|
117
|
+
}
|
|
118
|
+
else if (parts.length === 4) {
|
|
119
|
+
style.marginTop = parts[0];
|
|
120
|
+
style.marginRight = parts[1];
|
|
121
|
+
style.marginBottom = parts[2];
|
|
122
|
+
style.marginLeft = parts[3];
|
|
123
|
+
}
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
// Map CSS custom properties to React Native style properties
|
|
127
|
+
const propertyMap = {
|
|
128
|
+
'--vrtx-icon-button-color': 'color',
|
|
129
|
+
'--vrtx-icon-button-background': 'background',
|
|
130
|
+
'--vrtx-icon-button-background-color': 'backgroundColor',
|
|
131
|
+
'--vrtx-icon-button-border-radius': 'borderRadius',
|
|
132
|
+
'--vrtx-icon-button-font-size': 'fontSize',
|
|
133
|
+
'--vrtx-icon-button-font-weight': 'fontWeight',
|
|
134
|
+
};
|
|
135
|
+
const styleProperty = propertyMap[key];
|
|
136
|
+
if (styleProperty) {
|
|
137
|
+
style[styleProperty] = value;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
return style;
|
|
141
|
+
};
|
|
142
|
+
// Extract styles from the vrtx-contacts-import block itself (this block has the theme)
|
|
143
|
+
const blockStyle = (block === null || block === void 0 ? void 0 : block.style) || {};
|
|
144
|
+
const blockThemeStyle = themeToStyle(block === null || block === void 0 ? void 0 : block.theme);
|
|
145
|
+
// Merge styles (theme styles take precedence over block.style)
|
|
146
|
+
const mergedBlockStyle = Object.assign(Object.assign({}, blockStyle), blockThemeStyle);
|
|
147
|
+
// Extract gradient string and fallback color
|
|
148
|
+
// On native, 'background' is a CSS property that doesn't work — convert solid colors to 'backgroundColor'
|
|
149
|
+
const rawBlockBackground = mergedBlockStyle.background || null;
|
|
150
|
+
const isBlockGradient = rawBlockBackground === null || rawBlockBackground === void 0 ? void 0 : rawBlockBackground.includes('gradient');
|
|
151
|
+
const blockGradientString = isBlockGradient ? rawBlockBackground : null;
|
|
152
|
+
const blockFallbackColor = isBlockGradient
|
|
153
|
+
? loaders === null || loaders === void 0 ? void 0 : loaders.parseGradientFirstColor(rawBlockBackground)
|
|
154
|
+
: rawBlockBackground || mergedBlockStyle.backgroundColor;
|
|
155
|
+
const blockTextColor = mergedBlockStyle.color || '#333';
|
|
156
|
+
// Create a clean style object without background/backgroundColor (we'll handle those separately)
|
|
157
|
+
const cleanBlockStyle = Object.assign({}, mergedBlockStyle);
|
|
158
|
+
delete cleanBlockStyle.background;
|
|
159
|
+
delete cleanBlockStyle.backgroundColor;
|
|
160
|
+
// Extract label from block attributes
|
|
161
|
+
const label = (_a = block === null || block === void 0 ? void 0 : block.attributes) === null || _a === void 0 ? void 0 : _a.label;
|
|
162
|
+
return (<react_native_1.View key={block.id} style={styles.contactButtonsContainer}>
|
|
163
|
+
{/* Section label from block attributes */}
|
|
164
|
+
{label && (<react_native_1.Text style={styles.sectionLabel}>{label}</react_native_1.Text>)}
|
|
165
|
+
{isNativeContactsEnabled() && (<ButtonWrapper style={[
|
|
166
|
+
styles.button,
|
|
167
|
+
styles.fullButton,
|
|
168
|
+
styles.tertiaryButton,
|
|
169
|
+
cleanBlockStyle,
|
|
170
|
+
blockFallbackColor ? { backgroundColor: blockFallbackColor } : undefined,
|
|
171
|
+
]} gradientString={blockGradientString} onPress={handleSelectFromContactsWithHaptics}>
|
|
172
|
+
<react_native_1.View style={styles.buttonIconContainer}>
|
|
173
|
+
{renderIcon({ name: 'import-contacts', size: 18, color: blockTextColor })}
|
|
174
|
+
</react_native_1.View>
|
|
175
|
+
<react_native_1.Text style={[styles.tertiaryButtonText, { color: blockTextColor }]}>
|
|
176
|
+
{getCustomLabel('importContacts', 'Add from Contacts')}
|
|
177
|
+
</react_native_1.Text>
|
|
178
|
+
</ButtonWrapper>)}
|
|
179
|
+
|
|
180
|
+
{isGoogleContactsEnabled() && (<ButtonWrapper style={[
|
|
181
|
+
styles.button,
|
|
182
|
+
styles.fullButton,
|
|
183
|
+
styles.tertiaryButton,
|
|
184
|
+
cleanBlockStyle,
|
|
185
|
+
blockFallbackColor ? { backgroundColor: blockFallbackColor } : undefined,
|
|
186
|
+
]} gradientString={blockGradientString} onPress={handleSelectFromGoogleWithHaptics}>
|
|
187
|
+
<react_native_1.View style={styles.buttonIconContainer}>
|
|
188
|
+
{renderIcon({ name: 'google', size: 18, color: blockTextColor })}
|
|
189
|
+
</react_native_1.View>
|
|
190
|
+
<react_native_1.Text style={[styles.tertiaryButtonText, { color: blockTextColor }]}>
|
|
191
|
+
{getCustomLabel('google', 'Add from Google Contacts')}
|
|
192
|
+
</react_native_1.Text>
|
|
193
|
+
</ButtonWrapper>)}
|
|
194
|
+
</react_native_1.View>);
|
|
195
|
+
}
|
|
196
|
+
const styles = react_native_1.StyleSheet.create({
|
|
197
|
+
contactButtonsContainer: {
|
|
198
|
+
gap: 12,
|
|
199
|
+
},
|
|
200
|
+
sectionLabel: {
|
|
201
|
+
fontSize: 14,
|
|
202
|
+
fontWeight: '500',
|
|
203
|
+
color: '#666',
|
|
204
|
+
marginBottom: 4,
|
|
205
|
+
},
|
|
206
|
+
button: {
|
|
207
|
+
paddingVertical: 12,
|
|
208
|
+
paddingHorizontal: 16,
|
|
209
|
+
borderRadius: 8,
|
|
210
|
+
flexDirection: 'row',
|
|
211
|
+
alignItems: 'center',
|
|
212
|
+
justifyContent: 'center',
|
|
213
|
+
gap: 8,
|
|
214
|
+
},
|
|
215
|
+
tertiaryButton: {
|
|
216
|
+
backgroundColor: '#f5f5f5',
|
|
217
|
+
},
|
|
218
|
+
fullButton: {
|
|
219
|
+
width: '100%',
|
|
220
|
+
},
|
|
221
|
+
buttonIconContainer: {
|
|
222
|
+
width: 18,
|
|
223
|
+
height: 18,
|
|
224
|
+
alignItems: 'center',
|
|
225
|
+
justifyContent: 'center',
|
|
226
|
+
overflow: 'visible',
|
|
227
|
+
},
|
|
228
|
+
tertiaryButtonText: {
|
|
229
|
+
color: '#333',
|
|
230
|
+
fontSize: 16,
|
|
231
|
+
fontWeight: '500',
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
//# sourceMappingURL=VrtxContactsImport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VrtxContactsImport.js","sourceRoot":"","sources":["../../src/components/VrtxContactsImport.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAgGA,gDAmLC;AAnRD,kDAA0B;AAC1B,+CAA6F;AAE7F,0EAAmE;AAEnE,MAAM,KAAK,GAAG,uBAAQ,CAAC,EAAE,KAAK,KAAK,CAAC;AAWpC,MAAM,aAAa,GAAiC,CAAC,EACnD,QAAQ,EACR,KAAK,EACL,cAAc,EACd,OAAO,EACP,QAAQ,GACT,EAAE,EAAE;IACH,mDAAmD;IACnD,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,GAAG,IAAA,uCAAgB,GAAE,CAAC;IACvD,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAE1D,qCAAqC;IACrC,IAAI,cAAc,IAAI,KAAK,EAAE,CAAC;QAC5B,OAAO,CACL,CAAC,+BAAgB,CACf,KAAK,CAAC,CAAC,CAAC,GAAG,UAAU,EAAE,E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,kBAAkB,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC,CAClE;YAAA,CAAC,cAAc,CAAC,QAAQ,EAAE,0BAA0B,CAAC,CACvD;UAAA,EAAE,mBAAI,CACR;QAAA,EAAE,aAAa,CAAC,CACjB,CACH;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,uBAAuB,EAAE;QACvB,GAAG,EAAE,EAAE;KACR;IACD,YAAY,EAAE;QACZ,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,MAAM;QACb,YAAY,EAAE,CAAC;KAChB;IACD,MAAM,EAAE;QACN,eAAe,EAAE,EAAE;QACnB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;QACf,aAAa,EAAE,KAAK;QACpB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,GAAG,EAAE,CAAC;KACP;IACD,cAAc,EAAE;QACd,eAAe,EAAE,SAAS;KAC3B;IACD,UAAU,EAAE;QACV,KAAK,EAAE,MAAM;KACd;IACD,mBAAmB,EAAE;QACnB,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;QACxB,QAAQ,EAAE,SAAS;KACpB;IACD,kBAAkB,EAAE;QAClB,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;KAClB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { View, Text, TouchableOpacity, StyleSheet, ViewStyle, Platform } from 'react-native';\nimport { IconRendererProps } from './InviteFormCore';\nimport { useVortexModules } from '../context/VortexModulesContext';\n\nconst isWeb = Platform.OS === 'web';\n\n// Button wrapper component that handles gradients on web, native gradient libraries, or solid color fallback\ninterface ButtonWrapperProps {\n children: React.ReactNode;\n style: ViewStyle | ViewStyle[];\n gradientString: string | null;\n onPress?: () => void;\n disabled?: boolean;\n}\n\nconst ButtonWrapper: React.FC<ButtonWrapperProps> = ({\n children,\n style,\n gradientString,\n onPress,\n disabled,\n}) => {\n // Get the gradient module and loaders from context\n const { gradientModule, loaders } = useVortexModules();\n const styleArray = Array.isArray(style) ? style : [style];\n\n // On web, use CSS gradients directly\n if (gradientString && isWeb) {\n return (\n <TouchableOpacity\n style={[...styleArray, { background: gradientString } as any]}\n onPress={onPress}\n disabled={disabled}\n activeOpacity={0.7}\n >\n {children}\n </TouchableOpacity>\n );\n }\n\n // On native, try to use gradient library if specified\n if (gradientString && gradientModule && loaders) {\n const GradientComponent = loaders.loadGradientComponent(gradientModule);\n const parsed = loaders.parseCSSLinearGradient(gradientString);\n\n if (GradientComponent && parsed) {\n const points = loaders.angleToGradientPoints(parsed.angle);\n\n return (\n <TouchableOpacity\n onPress={onPress}\n disabled={disabled}\n activeOpacity={0.7}\n >\n <GradientComponent\n colors={parsed.colors}\n locations={parsed.locations}\n start={points.start}\n end={points.end}\n style={styleArray}\n >\n {children}\n </GradientComponent>\n </TouchableOpacity>\n );\n }\n }\n\n // Fallback: solid color from first gradient stop\n const fallbackColor = gradientString && loaders ? loaders.parseGradientFirstColor(gradientString) : null;\n const finalStyle = fallbackColor ? [...styleArray, { backgroundColor: fallbackColor }] : styleArray;\n\n return (\n <TouchableOpacity\n style={finalStyle}\n onPress={onPress}\n disabled={disabled}\n activeOpacity={0.7}\n >\n {children}\n </TouchableOpacity>\n );\n};\n\nexport interface VrtxContactsImportProps {\n block: any;\n renderIcon: (props: IconRendererProps) => React.ReactNode;\n isNativeContactsEnabled: () => boolean;\n isGoogleContactsEnabled: () => boolean;\n handleSelectFromContacts: () => void;\n handleSelectFromGoogle: () => void;\n triggerHaptic?: (style: 'light' | 'medium' | 'heavy') => Promise<void>;\n isEditMode?: boolean;\n}\n\nexport function VrtxContactsImport({\n block,\n renderIcon,\n isNativeContactsEnabled,\n isGoogleContactsEnabled,\n handleSelectFromContacts,\n handleSelectFromGoogle,\n triggerHaptic,\n isEditMode = false,\n}: VrtxContactsImportProps) {\n // Get loaders from context\n const { loaders } = useVortexModules();\n\n // Helper to get customization label - null/undefined uses default, empty string shows nothing\n const getCustomLabel = (key: string, defaultLabel: string): string => {\n const textContent = block?.settings?.customizations?.[key]?.textContent;\n // If textContent is null or undefined, use default. Empty string is valid (shows no label).\n if (textContent === null || textContent === undefined) {\n return defaultLabel;\n }\n return textContent;\n };\n\n const handleSelectFromContactsWithHaptics = async () => {\n await triggerHaptic?.('light');\n handleSelectFromContacts();\n };\n\n const handleSelectFromGoogleWithHaptics = async () => {\n await triggerHaptic?.('light');\n handleSelectFromGoogle();\n };\n\n // Convert theme options to inline styles\n const themeToStyle = (theme: any): Record<string, any> => {\n if (!theme?.options || !Array.isArray(theme.options)) return {};\n\n const style: Record<string, any> = {};\n\n theme.options.forEach((option: any) => {\n if (!option.value) return;\n\n const { key, value } = option;\n\n // Handle padding and margin with shorthand expansion\n if (key === '--vrtx-icon-button-padding' && value) {\n const parts = value.trim().split(/\\s+/);\n if (parts.length === 1) {\n style.paddingTop = style.paddingRight = style.paddingBottom = style.paddingLeft = value;\n } else if (parts.length === 2) {\n style.paddingTop = style.paddingBottom = parts[0];\n style.paddingRight = style.paddingLeft = parts[1];\n } else if (parts.length === 3) {\n style.paddingTop = parts[0];\n style.paddingRight = style.paddingLeft = parts[1];\n style.paddingBottom = parts[2];\n } else if (parts.length === 4) {\n style.paddingTop = parts[0];\n style.paddingRight = parts[1];\n style.paddingBottom = parts[2];\n style.paddingLeft = parts[3];\n }\n return;\n }\n\n if (key === '--vrtx-icon-button-margin' && value) {\n const parts = value.trim().split(/\\s+/);\n if (parts.length === 1) {\n style.marginTop = style.marginRight = style.marginBottom = style.marginLeft = value;\n } else if (parts.length === 2) {\n style.marginTop = style.marginBottom = parts[0];\n style.marginRight = style.marginLeft = parts[1];\n } else if (parts.length === 3) {\n style.marginTop = parts[0];\n style.marginRight = style.marginLeft = parts[1];\n style.marginBottom = parts[2];\n } else if (parts.length === 4) {\n style.marginTop = parts[0];\n style.marginRight = parts[1];\n style.marginBottom = parts[2];\n style.marginLeft = parts[3];\n }\n return;\n }\n\n // Map CSS custom properties to React Native style properties\n const propertyMap: Record<string, string> = {\n '--vrtx-icon-button-color': 'color',\n '--vrtx-icon-button-background': 'background',\n '--vrtx-icon-button-background-color': 'backgroundColor',\n '--vrtx-icon-button-border-radius': 'borderRadius',\n '--vrtx-icon-button-font-size': 'fontSize',\n '--vrtx-icon-button-font-weight': 'fontWeight',\n };\n\n const styleProperty = propertyMap[key];\n if (styleProperty) {\n style[styleProperty] = value;\n }\n });\n\n return style;\n };\n\n // Extract styles from the vrtx-contacts-import block itself (this block has the theme)\n const blockStyle = block?.style || {};\n const blockThemeStyle = themeToStyle(block?.theme);\n\n // Merge styles (theme styles take precedence over block.style)\n const mergedBlockStyle = { ...blockStyle, ...blockThemeStyle };\n\n // Extract gradient string and fallback color\n // On native, 'background' is a CSS property that doesn't work — convert solid colors to 'backgroundColor'\n const rawBlockBackground = mergedBlockStyle.background || null;\n const isBlockGradient = rawBlockBackground?.includes('gradient');\n const blockGradientString = isBlockGradient ? rawBlockBackground : null;\n const blockFallbackColor = isBlockGradient\n ? loaders?.parseGradientFirstColor(rawBlockBackground)\n : rawBlockBackground || mergedBlockStyle.backgroundColor;\n\n const blockTextColor = mergedBlockStyle.color || '#333';\n\n // Create a clean style object without background/backgroundColor (we'll handle those separately)\n const cleanBlockStyle = { ...mergedBlockStyle };\n delete cleanBlockStyle.background;\n delete cleanBlockStyle.backgroundColor;\n\n // Extract label from block attributes\n const label = block?.attributes?.label;\n\n return (\n <View key={block.id} style={styles.contactButtonsContainer}>\n {/* Section label from block attributes */}\n {label && (\n <Text style={styles.sectionLabel}>{label}</Text>\n )}\n {isNativeContactsEnabled() && (\n <ButtonWrapper\n style={[\n styles.button,\n styles.fullButton,\n styles.tertiaryButton,\n cleanBlockStyle,\n blockFallbackColor ? { backgroundColor: blockFallbackColor } : undefined,\n ]}\n gradientString={blockGradientString}\n onPress={handleSelectFromContactsWithHaptics}\n >\n <View style={styles.buttonIconContainer}>\n {renderIcon({ name: 'import-contacts', size: 18, color: blockTextColor })}\n </View>\n <Text style={[styles.tertiaryButtonText, { color: blockTextColor }]}>\n {getCustomLabel('importContacts', 'Add from Contacts')}\n </Text>\n </ButtonWrapper>\n )}\n\n {isGoogleContactsEnabled() && (\n <ButtonWrapper\n style={[\n styles.button,\n styles.fullButton,\n styles.tertiaryButton,\n cleanBlockStyle,\n blockFallbackColor ? { backgroundColor: blockFallbackColor } : undefined,\n ]}\n gradientString={blockGradientString}\n onPress={handleSelectFromGoogleWithHaptics}\n >\n <View style={styles.buttonIconContainer}>\n {renderIcon({ name: 'google', size: 18, color: blockTextColor })}\n </View>\n <Text style={[styles.tertiaryButtonText, { color: blockTextColor }]}>\n {getCustomLabel('google', 'Add from Google Contacts')}\n </Text>\n </ButtonWrapper>\n )}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n contactButtonsContainer: {\n gap: 12,\n },\n sectionLabel: {\n fontSize: 14,\n fontWeight: '500',\n color: '#666',\n marginBottom: 4,\n },\n button: {\n paddingVertical: 12,\n paddingHorizontal: 16,\n borderRadius: 8,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 8,\n },\n tertiaryButton: {\n backgroundColor: '#f5f5f5',\n },\n fullButton: {\n width: '100%',\n },\n buttonIconContainer: {\n width: 18,\n height: 18,\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'visible',\n },\n tertiaryButtonText: {\n color: '#333',\n fontSize: 16,\n fontWeight: '500',\n },\n});\n"]}
|
|
@@ -0,0 +1,341 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.VrtxEmailInvitations = VrtxEmailInvitations;
|
|
16
|
+
const react_1 = __importDefault(require("react"));
|
|
17
|
+
const react_native_1 = require("react-native");
|
|
18
|
+
const isWeb = react_native_1.Platform.OS === 'web';
|
|
19
|
+
// Parse CSS linear-gradient to extract first color for fallback
|
|
20
|
+
function parseGradientFirstColor(gradientString) {
|
|
21
|
+
if (!gradientString || !gradientString.includes('linear-gradient')) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const stopsRegex = /(rgba?\([^)]+\)|#[0-9a-fA-F]{3,8}|[a-z]+)\s+(\d+)%/i;
|
|
25
|
+
const match = stopsRegex.exec(gradientString);
|
|
26
|
+
if (match) {
|
|
27
|
+
return match[1].trim();
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const ButtonWrapper = ({ children, style, gradientString, onPress, disabled, }) => {
|
|
32
|
+
const styleArray = Array.isArray(style) ? style : [style];
|
|
33
|
+
// On web, use CSS gradients directly
|
|
34
|
+
if (gradientString && isWeb) {
|
|
35
|
+
return (<react_native_1.TouchableOpacity style={[...styleArray, { background: gradientString }]} onPress={onPress} disabled={disabled} activeOpacity={0.7}>
|
|
36
|
+
{children}
|
|
37
|
+
</react_native_1.TouchableOpacity>);
|
|
38
|
+
}
|
|
39
|
+
// On native, use first color from gradient as solid background
|
|
40
|
+
const fallbackColor = gradientString ? parseGradientFirstColor(gradientString) : null;
|
|
41
|
+
const finalStyle = fallbackColor ? [...styleArray, { backgroundColor: fallbackColor }] : styleArray;
|
|
42
|
+
return (<react_native_1.TouchableOpacity style={finalStyle} onPress={onPress} disabled={disabled} activeOpacity={0.7}>
|
|
43
|
+
{children}
|
|
44
|
+
</react_native_1.TouchableOpacity>);
|
|
45
|
+
};
|
|
46
|
+
const ChipWrapper = ({ children, style, gradientString }) => {
|
|
47
|
+
const styleArray = Array.isArray(style) ? style : [style];
|
|
48
|
+
// On web, use CSS gradients directly
|
|
49
|
+
if (gradientString && isWeb) {
|
|
50
|
+
return <react_native_1.View style={[...styleArray, { background: gradientString }]}>{children}</react_native_1.View>;
|
|
51
|
+
}
|
|
52
|
+
// On native, use first color from gradient as solid background
|
|
53
|
+
const fallbackColor = gradientString ? parseGradientFirstColor(gradientString) : null;
|
|
54
|
+
const finalStyle = fallbackColor ? [...styleArray, { backgroundColor: fallbackColor }] : styleArray;
|
|
55
|
+
return <react_native_1.View style={finalStyle}>{children}</react_native_1.View>;
|
|
56
|
+
};
|
|
57
|
+
function VrtxEmailInvitations({ block, view, emails, emailInput, setEmailInput, handleEmailSubmit, handleRemoveEmail, submitButtonBlock, handleSendInvitation, triggerHaptic, loadingEmailInvite = false, sendSuccess = false, lastInvalidEmail = null, EditableWrapper, onEmailFieldFocus, onEmailFieldBlur, handleAddByEmail, renderIcon, isEditMode = false, }) {
|
|
58
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
59
|
+
const inputRef = react_1.default.useRef(null);
|
|
60
|
+
// Smart email input handler: detect delimiter characters (space, comma, semicolon)
|
|
61
|
+
// and automatically convert valid emails into pills — best-practice multi-email UX.
|
|
62
|
+
// Also handles paste of multiple emails separated by delimiters.
|
|
63
|
+
const handleChangeText = react_1.default.useCallback((text) => {
|
|
64
|
+
// Check if pasted text contains multiple emails (e.g. "a@b.com, c@d.com")
|
|
65
|
+
const delimiterRegex = /[,;\s]+/;
|
|
66
|
+
if (delimiterRegex.test(text) && text.trim().includes('@')) {
|
|
67
|
+
const parts = text.split(delimiterRegex).filter(Boolean);
|
|
68
|
+
// If multiple parts, try to pill-ify all complete ones
|
|
69
|
+
if (parts.length > 1) {
|
|
70
|
+
for (const part of parts) {
|
|
71
|
+
handleEmailSubmit(part.trim());
|
|
72
|
+
}
|
|
73
|
+
setEmailInput('');
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Check if the last character typed is a delimiter
|
|
78
|
+
const lastChar = text.slice(-1);
|
|
79
|
+
const delimiters = [' ', ',', ';'];
|
|
80
|
+
if (delimiters.includes(lastChar)) {
|
|
81
|
+
const candidate = text.slice(0, -1).trim();
|
|
82
|
+
if (candidate) {
|
|
83
|
+
handleEmailSubmit(candidate);
|
|
84
|
+
triggerHaptic === null || triggerHaptic === void 0 ? void 0 : triggerHaptic('light');
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
// If nothing before the delimiter, ignore it
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
setEmailInput(text);
|
|
91
|
+
}, [setEmailInput, handleEmailSubmit, triggerHaptic]);
|
|
92
|
+
// Convert any pending text to a pill on blur
|
|
93
|
+
const handleBlur = react_1.default.useCallback(() => {
|
|
94
|
+
if (emailInput.trim()) {
|
|
95
|
+
handleEmailSubmit(emailInput.trim());
|
|
96
|
+
}
|
|
97
|
+
onEmailFieldBlur === null || onEmailFieldBlur === void 0 ? void 0 : onEmailFieldBlur();
|
|
98
|
+
}, [emailInput, handleEmailSubmit, onEmailFieldBlur]);
|
|
99
|
+
// Extract styles from block.style
|
|
100
|
+
const blockStyle = (block === null || block === void 0 ? void 0 : block.style) || {};
|
|
101
|
+
// Merge styles
|
|
102
|
+
const mergedStyle = Object.assign({}, blockStyle);
|
|
103
|
+
// Extract gradient string and fallback color
|
|
104
|
+
// On native, 'background' is a CSS property that doesn't work — convert solid colors to 'backgroundColor'
|
|
105
|
+
const rawBackground = mergedStyle.background || null;
|
|
106
|
+
const isGradient = rawBackground === null || rawBackground === void 0 ? void 0 : rawBackground.includes('gradient');
|
|
107
|
+
const gradientString = isGradient ? rawBackground : null;
|
|
108
|
+
const fallbackColor = isGradient
|
|
109
|
+
? parseGradientFirstColor(rawBackground)
|
|
110
|
+
: rawBackground || mergedStyle.backgroundColor;
|
|
111
|
+
// Extract text color
|
|
112
|
+
const textColor = mergedStyle.color || '#333';
|
|
113
|
+
// Create text style
|
|
114
|
+
const textStyle = Object.assign(Object.assign({}, mergedStyle), { color: textColor });
|
|
115
|
+
// Extract submit button styles and content if provided
|
|
116
|
+
const submitButtonStyle = (submitButtonBlock === null || submitButtonBlock === void 0 ? void 0 : submitButtonBlock.style) || {};
|
|
117
|
+
const submitButtonGradientString = submitButtonStyle.background || null;
|
|
118
|
+
const submitButtonFallbackColor = submitButtonGradientString
|
|
119
|
+
? parseGradientFirstColor(submitButtonGradientString)
|
|
120
|
+
: submitButtonStyle.backgroundColor;
|
|
121
|
+
const submitButtonTextColor = submitButtonStyle.color || '#fff';
|
|
122
|
+
const submitButtonText = (submitButtonBlock === null || submitButtonBlock === void 0 ? void 0 : submitButtonBlock.textContent) || ((_a = submitButtonBlock === null || submitButtonBlock === void 0 ? void 0 : submitButtonBlock.attributes) === null || _a === void 0 ? void 0 : _a.label) || 'Invite';
|
|
123
|
+
const handleSendInvitationWithHaptics = () => __awaiter(this, void 0, void 0, function* () {
|
|
124
|
+
if (handleSendInvitation) {
|
|
125
|
+
yield (triggerHaptic === null || triggerHaptic === void 0 ? void 0 : triggerHaptic('light'));
|
|
126
|
+
yield handleSendInvitation();
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
const handleAddByEmailWithHaptics = () => __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
if (handleAddByEmail) {
|
|
131
|
+
yield (triggerHaptic === null || triggerHaptic === void 0 ? void 0 : triggerHaptic('light'));
|
|
132
|
+
handleAddByEmail();
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
// On main view, render as a button
|
|
136
|
+
if (view === 'main') {
|
|
137
|
+
return (<react_native_1.View key={block.id} style={{
|
|
138
|
+
position: 'relative',
|
|
139
|
+
}}>
|
|
140
|
+
<ButtonWrapper style={[
|
|
141
|
+
styles.button,
|
|
142
|
+
styles.fullButton,
|
|
143
|
+
{
|
|
144
|
+
borderWidth: 1,
|
|
145
|
+
borderColor: '#e0e0e0',
|
|
146
|
+
},
|
|
147
|
+
mergedStyle,
|
|
148
|
+
fallbackColor ? { backgroundColor: fallbackColor } : undefined,
|
|
149
|
+
]} gradientString={gradientString} onPress={isEditMode ? undefined : handleAddByEmailWithHaptics} disabled={isEditMode}>
|
|
150
|
+
{renderIcon && (<react_native_1.View style={styles.buttonIconContainer}>
|
|
151
|
+
{renderIcon({ name: 'email', size: 18, color: textColor })}
|
|
152
|
+
</react_native_1.View>)}
|
|
153
|
+
<react_native_1.Text style={[styles.buttonText, { color: textColor }]}>
|
|
154
|
+
{((_d = (_c = (_b = block.settings) === null || _b === void 0 ? void 0 : _b.customizations) === null || _c === void 0 ? void 0 : _c['mobile.addByEmailButton']) === null || _d === void 0 ? void 0 : _d.textContent) || ((_e = block.attributes) === null || _e === void 0 ? void 0 : _e.label) || 'Add by Email'}
|
|
155
|
+
</react_native_1.Text>
|
|
156
|
+
</ButtonWrapper>
|
|
157
|
+
{/* Circle button for edit mode to preview the email form */}
|
|
158
|
+
{isEditMode && (<react_native_1.TouchableOpacity {...{
|
|
159
|
+
'data-circle-button': 'true',
|
|
160
|
+
onMouseDown: (e) => __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
console.log('[VrtxEmailInvitations] Circle button onMouseDown - switching to email view');
|
|
162
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
163
|
+
e._circleButtonClick = true;
|
|
164
|
+
if (e.nativeEvent) {
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
166
|
+
e.nativeEvent._circleButtonClick = true;
|
|
167
|
+
}
|
|
168
|
+
e.stopPropagation();
|
|
169
|
+
e.preventDefault();
|
|
170
|
+
yield (triggerHaptic === null || triggerHaptic === void 0 ? void 0 : triggerHaptic('light'));
|
|
171
|
+
if (handleAddByEmail) {
|
|
172
|
+
console.log('[VrtxEmailInvitations] Calling handleAddByEmail');
|
|
173
|
+
handleAddByEmail();
|
|
174
|
+
}
|
|
175
|
+
}),
|
|
176
|
+
onClick: (e) => {
|
|
177
|
+
console.log('[VrtxEmailInvitations] Circle button onClick - preventing default');
|
|
178
|
+
e.stopPropagation();
|
|
179
|
+
e.preventDefault();
|
|
180
|
+
},
|
|
181
|
+
onClickCapture: (e) => {
|
|
182
|
+
console.log('[VrtxEmailInvitations] Circle button onClickCapture - preventing default');
|
|
183
|
+
e.stopPropagation();
|
|
184
|
+
e.preventDefault();
|
|
185
|
+
},
|
|
186
|
+
}} style={Object.assign({ position: 'absolute', right: 8, bottom: '8%', transform: [{ translateY: -12 }], width: 24, height: 24, borderRadius: 12, backgroundColor: '#606971ff', justifyContent: 'center', alignItems: 'center', shadowColor: '#2196F3', shadowOffset: { width: 0, height: 0 }, shadowOpacity: 0.8, shadowRadius: 8, elevation: 99999, zIndex: 99999 }, (isWeb && {
|
|
187
|
+
boxShadow: '0 0 12px 3px rgba(118, 122, 125, 0.6)',
|
|
188
|
+
}))} activeOpacity={0.7} onPress={(e) => __awaiter(this, void 0, void 0, function* () {
|
|
189
|
+
console.log('[VrtxEmailInvitations] Circle button pressed - switching to email view');
|
|
190
|
+
// Mark the event so EditableWrapper ignores it
|
|
191
|
+
if (e) {
|
|
192
|
+
e._circleButtonClick = true;
|
|
193
|
+
if (e.nativeEvent) {
|
|
194
|
+
e.nativeEvent._circleButtonClick = true;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
yield (triggerHaptic === null || triggerHaptic === void 0 ? void 0 : triggerHaptic('light'));
|
|
198
|
+
if (handleAddByEmail) {
|
|
199
|
+
handleAddByEmail();
|
|
200
|
+
}
|
|
201
|
+
})}>
|
|
202
|
+
<react_native_1.Text style={{ color: '#fff', fontSize: 14, fontWeight: 'bold' }}></react_native_1.Text>
|
|
203
|
+
</react_native_1.TouchableOpacity>)}
|
|
204
|
+
{/* Invisible spacer to ensure outline includes the circle button */}
|
|
205
|
+
{isEditMode && (<react_native_1.View style={{
|
|
206
|
+
position: 'absolute',
|
|
207
|
+
right: 0,
|
|
208
|
+
top: 0,
|
|
209
|
+
bottom: 0,
|
|
210
|
+
width: 40,
|
|
211
|
+
pointerEvents: 'none',
|
|
212
|
+
}}/>)}
|
|
213
|
+
</react_native_1.View>);
|
|
214
|
+
}
|
|
215
|
+
// On email view, render the full form
|
|
216
|
+
if (view !== 'email') {
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
return (<react_native_1.View key={block.id}>
|
|
220
|
+
{emails.length > 0 && (<react_native_1.View style={styles.emailChipsContainer}>
|
|
221
|
+
{emails.map((email, index) => (<ChipWrapper key={index} style={[styles.emailChip, mergedStyle, fallbackColor ? { backgroundColor: fallbackColor } : undefined]} gradientString={gradientString}>
|
|
222
|
+
<react_native_1.Text style={[styles.emailChipText, textStyle]}>{email}</react_native_1.Text>
|
|
223
|
+
<react_native_1.TouchableOpacity onPress={() => handleRemoveEmail(email)} hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }} style={{ padding: 4 }}>
|
|
224
|
+
<react_native_1.Text style={[styles.emailChipRemove, { color: textColor }]}>×</react_native_1.Text>
|
|
225
|
+
</react_native_1.TouchableOpacity>
|
|
226
|
+
</ChipWrapper>))}
|
|
227
|
+
</react_native_1.View>)}
|
|
228
|
+
|
|
229
|
+
<react_native_1.TextInput ref={inputRef} style={[styles.input, lastInvalidEmail ? styles.inputInvalid : undefined]} placeholder={emails.length > 0 ? (((_h = (_g = (_f = block.settings) === null || _f === void 0 ? void 0 : _f.customizations) === null || _g === void 0 ? void 0 : _g['mobile.addAnotherPlaceholder']) === null || _h === void 0 ? void 0 : _h.textContent) || 'Add another email') : (((_l = (_k = (_j = block.settings) === null || _j === void 0 ? void 0 : _j.customizations) === null || _k === void 0 ? void 0 : _k['mobile.placeholder']) === null || _l === void 0 ? void 0 : _l.textContent) || 'Enter email addresses')} placeholderTextColor="#999" value={emailInput} onChangeText={handleChangeText} onSubmitEditing={() => {
|
|
230
|
+
var _a;
|
|
231
|
+
handleEmailSubmit();
|
|
232
|
+
// Keep keyboard open for entering more emails
|
|
233
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
234
|
+
}} onFocus={onEmailFieldFocus} onBlur={handleBlur} keyboardType="email-address" autoCapitalize="none" autoCorrect={false} returnKeyType="done" blurOnSubmit={false} autoFocus={true}/>
|
|
235
|
+
|
|
236
|
+
{/* Hint text below input */}
|
|
237
|
+
{(() => {
|
|
238
|
+
var _a, _b, _c;
|
|
239
|
+
const hintText = ((_c = (_b = (_a = block.settings) === null || _a === void 0 ? void 0 : _a.customizations) === null || _b === void 0 ? void 0 : _b['mobile.hint']) === null || _c === void 0 ? void 0 : _c.textContent) || 'Separate emails with spaces or commas';
|
|
240
|
+
return hintText ? (<react_native_1.Text style={styles.hintText}>{hintText}</react_native_1.Text>) : null;
|
|
241
|
+
})()}
|
|
242
|
+
|
|
243
|
+
{/* Submit button is now rendered separately in InviteFormCore */}
|
|
244
|
+
</react_native_1.View>);
|
|
245
|
+
}
|
|
246
|
+
const styles = react_native_1.StyleSheet.create({
|
|
247
|
+
emailChipsContainer: {
|
|
248
|
+
flexDirection: 'row',
|
|
249
|
+
flexWrap: 'wrap',
|
|
250
|
+
gap: 8,
|
|
251
|
+
marginBottom: 12,
|
|
252
|
+
},
|
|
253
|
+
emailChip: {
|
|
254
|
+
flexDirection: 'row',
|
|
255
|
+
alignItems: 'center',
|
|
256
|
+
backgroundColor: '#f0f0f0',
|
|
257
|
+
borderRadius: 16,
|
|
258
|
+
paddingHorizontal: 12,
|
|
259
|
+
paddingVertical: 6,
|
|
260
|
+
gap: 6,
|
|
261
|
+
},
|
|
262
|
+
emailChipText: {
|
|
263
|
+
fontSize: 14,
|
|
264
|
+
color: '#333',
|
|
265
|
+
},
|
|
266
|
+
emailChipRemove: {
|
|
267
|
+
fontSize: 20,
|
|
268
|
+
color: '#666',
|
|
269
|
+
fontWeight: '300',
|
|
270
|
+
},
|
|
271
|
+
input: {
|
|
272
|
+
borderWidth: 1,
|
|
273
|
+
borderColor: '#ddd',
|
|
274
|
+
borderRadius: 8,
|
|
275
|
+
padding: 12,
|
|
276
|
+
fontSize: 16,
|
|
277
|
+
backgroundColor: '#fff',
|
|
278
|
+
marginBottom: 4,
|
|
279
|
+
},
|
|
280
|
+
inputInvalid: {
|
|
281
|
+
borderColor: '#d9534f',
|
|
282
|
+
borderWidth: 1.5,
|
|
283
|
+
},
|
|
284
|
+
hintText: {
|
|
285
|
+
fontSize: 12,
|
|
286
|
+
color: '#999',
|
|
287
|
+
marginBottom: 12,
|
|
288
|
+
marginLeft: 4,
|
|
289
|
+
},
|
|
290
|
+
submitButtonContainer: {
|
|
291
|
+
marginTop: 16,
|
|
292
|
+
},
|
|
293
|
+
successMessageContainer: {
|
|
294
|
+
padding: 16,
|
|
295
|
+
backgroundColor: '#e8f5e9',
|
|
296
|
+
borderRadius: 8,
|
|
297
|
+
alignItems: 'center',
|
|
298
|
+
},
|
|
299
|
+
invitedText: {
|
|
300
|
+
color: '#2e7d32',
|
|
301
|
+
fontSize: 16,
|
|
302
|
+
fontWeight: '600',
|
|
303
|
+
},
|
|
304
|
+
button: {
|
|
305
|
+
paddingVertical: 12,
|
|
306
|
+
paddingHorizontal: 16,
|
|
307
|
+
borderRadius: 8,
|
|
308
|
+
flexDirection: 'row',
|
|
309
|
+
alignItems: 'center',
|
|
310
|
+
justifyContent: 'center',
|
|
311
|
+
gap: 8,
|
|
312
|
+
backgroundColor: '#f5f5f5',
|
|
313
|
+
},
|
|
314
|
+
submitButton: {
|
|
315
|
+
backgroundColor: '#007AFF',
|
|
316
|
+
},
|
|
317
|
+
fullButton: {
|
|
318
|
+
width: '100%',
|
|
319
|
+
},
|
|
320
|
+
submitButtonText: {
|
|
321
|
+
color: '#fff',
|
|
322
|
+
fontSize: 16,
|
|
323
|
+
fontWeight: '600',
|
|
324
|
+
},
|
|
325
|
+
buttonContainer: {
|
|
326
|
+
marginBottom: 16,
|
|
327
|
+
},
|
|
328
|
+
buttonIconContainer: {
|
|
329
|
+
width: 18,
|
|
330
|
+
height: 18,
|
|
331
|
+
alignItems: 'center',
|
|
332
|
+
justifyContent: 'center',
|
|
333
|
+
overflow: 'visible',
|
|
334
|
+
},
|
|
335
|
+
buttonText: {
|
|
336
|
+
color: '#333',
|
|
337
|
+
fontSize: 16,
|
|
338
|
+
fontWeight: '500',
|
|
339
|
+
},
|
|
340
|
+
});
|
|
341
|
+
//# sourceMappingURL=VrtxEmailInvitations.js.map
|