@proveanything/smartlinks-auth-ui 0.1.24 → 0.1.27

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/index.esm.js CHANGED
@@ -50,9 +50,10 @@ const AuthContainer = ({ children, theme = 'light', className = '', config, mini
50
50
  const logoUrl = config?.branding?.logoUrl === undefined
51
51
  ? 'https://smartlinks.app/smartlinks/landscape-medium.png' // Default Smartlinks logo
52
52
  : config?.branding?.logoUrl || null; // Custom or explicitly hidden
53
+ const inheritHostStyles = config?.branding?.inheritHostStyles ? 'auth-inherit-host' : '';
53
54
  const containerClass = minimal
54
- ? `auth-minimal auth-theme-${theme} ${className}`
55
- : `auth-container auth-theme-${theme} ${className}`;
55
+ ? `auth-minimal auth-theme-${theme} ${inheritHostStyles} ${className}`
56
+ : `auth-container auth-theme-${theme} ${inheritHostStyles} ${className}`;
56
57
  const cardClass = minimal ? 'auth-minimal-card' : 'auth-card';
57
58
  return (jsx("div", { className: containerClass, children: jsxs("div", { className: cardClass, style: !minimal && config?.branding?.buttonStyle === 'square' ? { borderRadius: '4px' } : undefined, children: [(logoUrl || title || subtitle) && (jsxs("div", { className: "auth-header", children: [logoUrl && (jsx("div", { className: "auth-logo", children: jsx("img", { src: logoUrl, alt: "Logo", style: { maxWidth: '200px', height: 'auto', objectFit: 'contain' } }) })), title && jsx("h1", { className: "auth-title", children: title }), subtitle && jsx("p", { className: "auth-subtitle", children: subtitle })] })), jsx("div", { className: "auth-content", children: children }), (config?.branding?.termsUrl || config?.branding?.privacyUrl) && (jsxs("div", { className: "auth-footer", children: [config.branding.termsUrl && jsx("a", { href: config.branding.termsUrl, target: "_blank", rel: "noopener noreferrer", children: "Terms" }), config.branding.termsUrl && config.branding.privacyUrl && jsx("span", { children: "\u2022" }), config.branding.privacyUrl && jsx("a", { href: config.branding.privacyUrl, target: "_blank", rel: "noopener noreferrer", children: "Privacy" })] }))] }) }));
58
59
  };
@@ -11481,10 +11482,13 @@ collectionId, enableContactSync, enableInteractionTracking, interactionAppId, in
11481
11482
  if (storedContactId) {
11482
11483
  setContactId(storedContactId);
11483
11484
  }
11485
+ // Set loading to false IMMEDIATELY after optimistic restore
11486
+ // Don't wait for background verification
11487
+ setIsLoading(false);
11484
11488
  console.log('[AuthContext] Session restored optimistically (pending verification)');
11485
11489
  notifyAuthStateChange('SESSION_RESTORED_OFFLINE', storedUser, storedToken.token, storedAccountData || null, null, false, null, storedContactId);
11486
11490
  }
11487
- // BACKGROUND: Verify token
11491
+ // BACKGROUND: Verify token (non-blocking)
11488
11492
  try {
11489
11493
  console.log('[AuthContext] Verifying stored token in background...');
11490
11494
  await smartlinks.auth.verifyToken(storedToken.token);
@@ -13074,16 +13078,14 @@ const AccountManagement = ({ apiEndpoint, clientId, onError, className = '', cus
13074
13078
  }, className: "auth-button button-secondary", children: "Cancel" })] })] }))] }))] }));
13075
13079
  };
13076
13080
 
13077
- const SmartlinksClaimUI = ({ apiEndpoint, clientId, clientName, collectionId, productId, proofId, onClaimSuccess, onClaimError, additionalFields = [], theme = 'light', className = '', minimal = false, proxyMode = false, customization = {}, }) => {
13078
- // Debug logging for proxyMode
13079
- console.log('[SmartlinksClaimUI] 🎯 Component received props:', {
13080
- proxyMode,
13081
- apiEndpoint,
13082
- clientId,
13083
- collectionId,
13084
- productId,
13085
- proofId,
13086
- });
13081
+ const SmartlinksClaimUI = (props) => {
13082
+ // Destructure AFTER logging raw props to debug proxyMode issue
13083
+ const { apiEndpoint, clientId, clientName, collectionId, productId, proofId, onClaimSuccess, onClaimError, additionalFields = [], theme = 'light', className = '', minimal = false, proxyMode = false, customization = {}, } = props;
13084
+ // Debug logging for proxyMode - log RAW props first
13085
+ console.log('[SmartlinksClaimUI] 🔍 RAW props received:', props);
13086
+ console.log('[SmartlinksClaimUI] 🔍 props.proxyMode value:', props.proxyMode);
13087
+ console.log('[SmartlinksClaimUI] 🔍 typeof props.proxyMode:', typeof props.proxyMode);
13088
+ console.log('[SmartlinksClaimUI] 🎯 Destructured proxyMode:', proxyMode);
13087
13089
  const auth = useAuth();
13088
13090
  const [claimStep, setClaimStep] = useState(auth.isAuthenticated ? 'questions' : 'auth');
13089
13091
  const [claimData, setClaimData] = useState({});