@proveanything/smartlinks-auth-ui 0.6.2 → 0.6.3
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/CUSTOMIZATION_GUIDE.md +2 -0
- package/README.md +2 -0
- package/dist/components/EmailAuthForm.d.ts +2 -0
- package/dist/components/EmailAuthForm.d.ts.map +1 -1
- package/dist/components/SmartlinksAuthUI.d.ts.map +1 -1
- package/dist/index.esm.js +5 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -277,11 +277,11 @@ const AuthModeToggle = ({ mode, onModeChange, disabled = false, }) => {
|
|
|
277
277
|
return (jsxRuntime.jsxs("div", { className: "auth-mode-toggle", role: "tablist", "aria-label": "Authentication mode", children: [jsxRuntime.jsx("button", { type: "button", role: "tab", "aria-selected": mode === 'login', className: `auth-mode-toggle-button ${mode === 'login' ? 'auth-mode-toggle-button--active' : ''}`, onClick: () => onModeChange('login'), disabled: disabled, children: "Sign In" }), jsxRuntime.jsx("button", { type: "button", role: "tab", "aria-selected": mode === 'register', className: `auth-mode-toggle-button ${mode === 'register' ? 'auth-mode-toggle-button--active' : ''}`, onClick: () => onModeChange('register'), disabled: disabled, children: "Create Account" })] }));
|
|
278
278
|
};
|
|
279
279
|
|
|
280
|
-
const EmailAuthForm = ({ mode, onSubmit, onModeSwitch, onForgotPassword, loading, error, signupProminence = 'minimal', signupRedirectUrl, schema, registrationFieldsConfig = [], additionalFields = [], }) => {
|
|
280
|
+
const EmailAuthForm = ({ mode, onSubmit, onModeSwitch, onForgotPassword, loading, error, signupProminence = 'minimal', signupRedirectUrl, prefillEmail, prefillDisplayName, schema, registrationFieldsConfig = [], additionalFields = [], }) => {
|
|
281
281
|
const [formData, setFormData] = React.useState({
|
|
282
|
-
email: '',
|
|
282
|
+
email: prefillEmail || '',
|
|
283
283
|
password: '',
|
|
284
|
-
displayName: '',
|
|
284
|
+
displayName: prefillDisplayName || '',
|
|
285
285
|
});
|
|
286
286
|
const [customFieldValues, setCustomFieldValues] = React.useState({});
|
|
287
287
|
// Get schema-driven registration fields
|
|
@@ -13733,7 +13733,7 @@ const checkSilentGoogleSignIn = async (clientId, googleClientId) => {
|
|
|
13733
13733
|
});
|
|
13734
13734
|
};
|
|
13735
13735
|
// getFriendlyErrorMessage is now imported from ../utils/errorHandling
|
|
13736
|
-
const SmartlinksAuthUI = ({ apiEndpoint, clientId, clientName, accountData, onAuthSuccess, onAuthError, onRedirect, enabledProviders = ['email', 'google', 'phone'], initialMode, signupProminence, redirectUrl, theme = 'light', className, customization, skipConfigFetch = false, minimal = false, logger, proxyMode = false, collectionId, disableConfigCache = false, enableSilentGoogleSignIn = false, nativeAuth, enableSilentNativeSignIn = false, whatsappReply, whatsappPrefillMessage, }) => {
|
|
13736
|
+
const SmartlinksAuthUI = ({ apiEndpoint, clientId, clientName, accountData, prefillEmail, prefillDisplayName, onAuthSuccess, onAuthError, onRedirect, enabledProviders = ['email', 'google', 'phone'], initialMode, signupProminence, redirectUrl, theme = 'light', className, customization, skipConfigFetch = false, minimal = false, logger, proxyMode = false, collectionId, disableConfigCache = false, enableSilentGoogleSignIn = false, nativeAuth, enableSilentNativeSignIn = false, whatsappReply, whatsappPrefillMessage, }) => {
|
|
13737
13737
|
// Resolve signup prominence from props, customization, config, or default
|
|
13738
13738
|
const resolvedSignupProminence = signupProminence || customization?.signupProminence || 'minimal';
|
|
13739
13739
|
// Determine initial mode based on signupProminence setting
|
|
@@ -15671,7 +15671,7 @@ const SmartlinksAuthUI = ({ apiEndpoint, clientId, clientName, accountData, onAu
|
|
|
15671
15671
|
setShowResendVerification(false);
|
|
15672
15672
|
setShowRequestNewReset(false);
|
|
15673
15673
|
setError(undefined);
|
|
15674
|
-
}, onForgotPassword: () => setMode('reset-password'), loading: loading, error: error, signupProminence: resolvedSignupProminence, signupRedirectUrl: config?.signupRedirectUrl || customization?.signupRedirectUrl, schema: contactSchema, registrationFieldsConfig: config?.registrationFields, additionalFields: config?.signupAdditionalFields }), emailDisplayMode === 'form' && actualProviders.length > 1 && (jsxRuntime.jsx(ProviderButtons, { enabledProviders: actualProviders.filter((p) => p !== 'email'), providerOrder: providerOrder, onGoogleLogin: handleGoogleLogin, onAppleLogin: handleAppleLogin, onPhoneLogin: () => setMode('phone'), onMagicLinkLogin: () => setMode('magic-link'), onWhatsAppLogin: () => setMode('whatsapp'), loading: loading }))] }));
|
|
15674
|
+
}, onForgotPassword: () => setMode('reset-password'), loading: loading, error: error, signupProminence: resolvedSignupProminence, signupRedirectUrl: config?.signupRedirectUrl || customization?.signupRedirectUrl, prefillEmail: prefillEmail, prefillDisplayName: prefillDisplayName, schema: contactSchema, registrationFieldsConfig: config?.registrationFields, additionalFields: config?.signupAdditionalFields }), emailDisplayMode === 'form' && actualProviders.length > 1 && (jsxRuntime.jsx(ProviderButtons, { enabledProviders: actualProviders.filter((p) => p !== 'email'), providerOrder: providerOrder, onGoogleLogin: handleGoogleLogin, onAppleLogin: handleAppleLogin, onPhoneLogin: () => setMode('phone'), onMagicLinkLogin: () => setMode('magic-link'), onWhatsAppLogin: () => setMode('whatsapp'), loading: loading }))] }));
|
|
15675
15675
|
})()] })) })) : null }));
|
|
15676
15676
|
};
|
|
15677
15677
|
|