@onairosofficial/onairos-capacitor 0.1.3 → 0.1.5
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/OnairosofficialOnairosCapacitor.podspec +1 -1
- package/README.md +1 -1
- package/dist/onairos.capacitor.esm.js +509 -1
- package/dist/onairos.capacitor.esm.turbopack.js +509 -1
- package/ios/Sources/OnairosNativeConnectorsPlugin/OnairosChatGPTNativePlugin.swift +187 -945
- package/ios/Sources/OnairosNativeConnectorsPlugin/OnairosRNScrapers.swift +1800 -0
- package/ios/Sources/OnairosNativeConnectorsPlugin/OnairosSpotifyNativePlugin.swift +180 -629
- package/onairos.d.ts +24 -0
- package/package.json +5 -2
- package/src/assets/connectors/Linkedinicon.png +0 -0
- package/src/assets/connectors/Redditicon.png +0 -0
- package/src/assets/connectors/YouTubeicon2.png +0 -0
- package/src/assets/connectors/chatgpt.png +0 -0
- package/src/assets/connectors/claude.png +0 -0
- package/src/assets/connectors/instagram.png +0 -0
- package/src/assets/connectors/netflix.png +0 -0
- package/src/assets/connectors/pinterest.png +0 -0
- package/src/assets/connectors/sephora.png +0 -0
- package/src/assets/connectors/spotify.png +0 -0
- package/src/assets/connectors/tiktok.png +0 -0
- package/src/assets/permissions/onairos.png +0 -0
- package/src/assets/permissions/personalization.png +0 -0
- package/src/assets/permissions/public-profile-person.png +0 -0
- package/src/assets/permissions/raw-memories.png +0 -0
- package/src/capacitorConnectorCatalog.js +2 -6
- package/src/components/DataRequest.jsx +96 -532
- package/src/components/EmailAuth.jsx +4 -116
- package/src/components/PinSetup.jsx +39 -226
- package/src/components/SDKDesignPreview.jsx +33 -0
- package/src/components/SessionUserBar.jsx +2 -1
- package/src/components/TrainingScreen.jsx +18 -12
- package/src/components/UniversalOnboarding.jsx +191 -424
- package/src/components/WelcomeScreen.jsx +19 -12
- package/src/components/parity/NativeConnections.jsx +136 -0
- package/src/components/parity/NativeScreens.jsx +48 -0
- package/src/components/ui/PageLayout.jsx +7 -3
- package/src/nativeImport/ConnectorLoading.jsx +13 -0
- package/src/nativeImport/CustomImportSession.js +115 -0
- package/src/nativeImport/ImportIcon.jsx +29 -0
- package/src/nativeImport/ImportProgress.jsx +24 -0
- package/src/nativeImport/ImportStatus.jsx +9 -0
- package/src/nativeImport/NativeChatImport.jsx +28 -0
- package/src/nativeImport/NativeImportSession.js +123 -0
- package/src/nativeImport/NativeScraperImport.jsx +57 -0
- package/src/nativeImport/SmartFilter.jsx +28 -0
- package/src/nativeImport/customPayload.js +37 -0
- package/src/nativeImport/netflixExport.js +30 -0
- package/src/nativeImport/netflixHistory.js +28 -0
- package/src/nativeImport/netflixSession.js +59 -0
- package/src/nativeImport/rawHandoff.js +7 -0
- package/src/nativeImport/rn/config/api.js +5 -0
- package/src/nativeImport/rn/services/apiKeyService.js +2 -0
- package/src/nativeImport/rn/services/hingePayload.js +37 -0
- package/src/nativeImport/rn/services/nativeConversationImport.js +138 -0
- package/src/nativeImport/rn/services/nativeFileTransfer.js +127 -0
- package/src/nativeImport/rn/services/nativeRawRedaction.js +136 -0
- package/src/nativeImport/rn/services/netflixPayload.js +70 -0
- package/src/nativeImport/rn/services/rawMemoryPolicy.js +38 -0
- package/src/nativeImport/rn/services/sephoraPayload.js +166 -0
- package/src/nativeImport/rn/services/spotifyPayload.js +99 -0
- package/src/nativeImport/rn/source-manifest.json +45 -0
- package/src/nativeImport/rn/utils/importedFiles.js +74 -0
- package/src/nativeImport/rn/utils/nativeImportDates.js +45 -0
- package/src/nativeImport/rn/utils/nativeImportFileReceiver.js +51 -0
- package/src/nativeImport/rn/utils/nativeImportMetadata.js +74 -0
- package/src/nativeImport/rn/utils/nativeImportTopics.js +56 -0
- package/src/nativeImport/rn/utils/rawExportDelivery.js +12 -0
- package/src/nativeImport/rn/utils/webviewScripts/chatgptDiscovery.js +99 -0
- package/src/nativeImport/rn/utils/webviewScripts/claude.js +349 -0
- package/src/nativeImport/rn/utils/webviewScripts/gemini.js +356 -0
- package/src/nativeImport/rn/utils/webviewScripts/hinge.js +375 -0
- package/src/nativeImport/rn/utils/webviewScripts/instagram.js +152 -0
- package/src/nativeImport/rn/utils/webviewScripts/linkedin.js +825 -0
- package/src/nativeImport/rn/utils/webviewScripts/nativeChatGPTImport.js +202 -0
- package/src/nativeImport/rn/utils/webviewScripts/nativeChatGPTSession.js +63 -0
- package/src/nativeImport/rn/utils/webviewScripts/nativeImportFiles.js +132 -0
- package/src/nativeImport/rn/utils/webviewScripts/nativeImportProviders.js +80 -0
- package/src/nativeImport/rn/utils/webviewScripts/nativeLoginViewport.js +28 -0
- package/src/nativeImport/rn/utils/webviewScripts/netflix.js +257 -0
- package/src/nativeImport/rn/utils/webviewScripts/sephora.js +862 -0
- package/src/nativeImport/rn/utils/webviewScripts/sephoraSession.js +160 -0
- package/src/nativeImport/rn/utils/webviewScripts/spotify.js +1868 -0
- package/src/nativeImport/rn/utils/webviewScripts/telegram.js +630 -0
- package/src/nativeImport/rn/utils/webviewScripts/tiktok.js +2920 -0
- package/src/onairos.capacitor.jsx +14 -2
- package/src/onairos.core.jsx +3 -0
- package/src/onairosButton.jsx +23 -17
- package/src/styles/onairos-fonts.css +20 -0
- package/src/styles/onairos-native.css +709 -0
- package/src/styles/onairos-rn-parity.css +175 -0
- package/src/styles/sdkCssRegistry.js +83 -1
- package/src/styles/tailwind.capacitor.css +6 -0
- package/src/utils/capacitorPlugins.js +20 -12
- package/src/utils/nativeConnectorSession.js +18 -0
- package/src/utils/parityPolicy.js +41 -0
|
@@ -681,119 +681,7 @@ function EmailAuthComponent({
|
|
|
681
681
|
|
|
682
682
|
// If we're in a native Capacitor app, prefer native Google sign-in (no embedded WKWebView).
|
|
683
683
|
if (isCapacitorNativePlatform()) {
|
|
684
|
-
|
|
685
|
-
if (!googleAuth) {
|
|
686
|
-
setGoogleHint('Google sign-in requires a native Google auth plugin in this app. Use email login.');
|
|
687
|
-
return;
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
let handedOffToBackend = false;
|
|
691
|
-
try {
|
|
692
|
-
setIsLoading(true);
|
|
693
|
-
|
|
694
|
-
// Support multiple native plugin APIs.
|
|
695
|
-
// - @capgo/capacitor-social-login: initialize() + login({ provider:'google', options:{...} })
|
|
696
|
-
// - other plugins: signIn()
|
|
697
|
-
let result = null;
|
|
698
|
-
if (typeof googleAuth.initialize === 'function' && typeof googleAuth.login === 'function') {
|
|
699
|
-
const webClientId =
|
|
700
|
-
(typeof window !== 'undefined' && window.onairosGoogleClientId) || '';
|
|
701
|
-
const iosClientId =
|
|
702
|
-
(typeof window !== 'undefined' && window.onairosGoogleIosClientId) || '';
|
|
703
|
-
const serverClientId =
|
|
704
|
-
(typeof window !== 'undefined' && window.onairosGoogleServerClientId) || webClientId;
|
|
705
|
-
|
|
706
|
-
if (!webClientId || !iosClientId) {
|
|
707
|
-
setGoogleHint('To enable Google sign-in in this iOS app, set updateGoogleClientIds({ webClientId, iosClientId }) in the host app. Otherwise use email login.');
|
|
708
|
-
setIsLoading(false);
|
|
709
|
-
return;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
try {
|
|
713
|
-
await googleAuth.initialize({
|
|
714
|
-
google: {
|
|
715
|
-
webClientId,
|
|
716
|
-
iOSClientId: iosClientId,
|
|
717
|
-
// If your backend verifies tokens / you need server-side validation, set this to the web client id.
|
|
718
|
-
// (Safe default here.)
|
|
719
|
-
iOSServerClientId: serverClientId,
|
|
720
|
-
mode: 'online',
|
|
721
|
-
},
|
|
722
|
-
});
|
|
723
|
-
} catch (e) {
|
|
724
|
-
console.warn('Google plugin initialize failed:', e);
|
|
725
|
-
setGoogleHint('Google sign-in is not configured correctly in this app. Please use email login.');
|
|
726
|
-
setIsLoading(false);
|
|
727
|
-
return;
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
const r = await googleAuth.login({
|
|
731
|
-
provider: 'google',
|
|
732
|
-
options: { scopes: ['profile', 'email'] },
|
|
733
|
-
});
|
|
734
|
-
result = r?.result || r;
|
|
735
|
-
} else if (typeof googleAuth.signIn === 'function') {
|
|
736
|
-
result = await googleAuth.signIn();
|
|
737
|
-
} else {
|
|
738
|
-
setGoogleHint('Google sign-in requires a compatible native Google auth plugin in this app. Use email login.');
|
|
739
|
-
setIsLoading(false);
|
|
740
|
-
return;
|
|
741
|
-
}
|
|
742
|
-
|
|
743
|
-
// Best-effort extraction across common Capacitor Google Auth plugins.
|
|
744
|
-
const idToken =
|
|
745
|
-
result?.authentication?.idToken ||
|
|
746
|
-
result?.idToken ||
|
|
747
|
-
result?.result?.idToken ||
|
|
748
|
-
result?.credential ||
|
|
749
|
-
result?.tokens?.idToken ||
|
|
750
|
-
result?.response?.idToken ||
|
|
751
|
-
'';
|
|
752
|
-
|
|
753
|
-
// Prefer explicit email if provided; otherwise decode from the JWT (same as web flow).
|
|
754
|
-
let userEmail =
|
|
755
|
-
result?.email ||
|
|
756
|
-
result?.user?.email ||
|
|
757
|
-
result?.profile?.email ||
|
|
758
|
-
result?.result?.profile?.email ||
|
|
759
|
-
'';
|
|
760
|
-
|
|
761
|
-
if (!idToken) {
|
|
762
|
-
setGoogleHint('Google sign-in did not return an ID token. Use email login.');
|
|
763
|
-
setIsLoading(false);
|
|
764
|
-
return;
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
if (!userEmail) {
|
|
768
|
-
try {
|
|
769
|
-
const base64Url = String(idToken).split('.')[1];
|
|
770
|
-
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
|
|
771
|
-
const jsonPayload = decodeURIComponent(
|
|
772
|
-
atob(base64)
|
|
773
|
-
.split('')
|
|
774
|
-
.map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))
|
|
775
|
-
.join('')
|
|
776
|
-
);
|
|
777
|
-
const payload = JSON.parse(jsonPayload);
|
|
778
|
-
userEmail = String(payload?.email || '').trim().toLowerCase();
|
|
779
|
-
} catch (_) {}
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
if (!userEmail) {
|
|
783
|
-
setGoogleHint('Could not determine your email from Google sign-in. Use email login.');
|
|
784
|
-
setIsLoading(false);
|
|
785
|
-
return;
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
// Reuse the existing backend login flow which expects an ID token (JWT).
|
|
789
|
-
handedOffToBackend = true;
|
|
790
|
-
await handleOAuthSuccess(userEmail, idToken);
|
|
791
|
-
} catch (e) {
|
|
792
|
-
console.error('Native Google sign-in failed:', e);
|
|
793
|
-
setGoogleHint('Google sign-in failed in this app. Please use email login.');
|
|
794
|
-
if (!handedOffToBackend) setIsLoading(false);
|
|
795
|
-
}
|
|
796
|
-
|
|
684
|
+
await handleNativeGoogleSignIn();
|
|
797
685
|
return;
|
|
798
686
|
}
|
|
799
687
|
|
|
@@ -1503,7 +1391,7 @@ function EmailAuthComponent({
|
|
|
1503
1391
|
</div>
|
|
1504
1392
|
)}
|
|
1505
1393
|
<div className="mb-8 w-full text-left">
|
|
1506
|
-
<h1 className="text-2xl font-bold mb-2 leading-tight" style={{ fontFamily: '
|
|
1394
|
+
<h1 className="text-2xl font-bold mb-2 leading-tight" style={{ fontFamily: '"Instrument Serif", "Times New Roman", serif', fontSize: 'clamp(27px, 6.4vw, 34px)', fontWeight: 400, letterSpacing: '-0.02em', lineHeight: 1.08, color: isGlass ? '#FFFFFF' : '#000000' }}>
|
|
1507
1395
|
{usePartnerCopy ? partnerWelcomeCopy : 'Build your Onairos persona to own your digital identity'}
|
|
1508
1396
|
</h1>
|
|
1509
1397
|
{!usePartnerCopy && (
|
|
@@ -1704,7 +1592,7 @@ function EmailAuthComponent({
|
|
|
1704
1592
|
</div>
|
|
1705
1593
|
</div>
|
|
1706
1594
|
)}
|
|
1707
|
-
<h1 className={`text-2xl font-bold mb-2 ${isGlass ? 'text-white' : 'text-gray-900'}`} style={{ fontFamily: '
|
|
1595
|
+
<h1 className={`text-2xl font-bold mb-2 ${isGlass ? 'text-white' : 'text-gray-900'}`} style={{ fontFamily: '"Instrument Serif", "Times New Roman", serif', fontSize: 'clamp(27px, 6.4vw, 34px)', fontWeight: 400, letterSpacing: '-0.02em', lineHeight: 1.08 }}>
|
|
1708
1596
|
{usePartnerCopy ? partnerWelcomeCopy : 'Sign in with Onairos'}
|
|
1709
1597
|
</h1>
|
|
1710
1598
|
{!usePartnerCopy && (
|
|
@@ -1826,7 +1714,7 @@ function EmailAuthComponent({
|
|
|
1826
1714
|
|
|
1827
1715
|
const renderCodeStep = () => (
|
|
1828
1716
|
<div className="w-full flex flex-col h-full px-6 pt-16 text-center">
|
|
1829
|
-
<h1 className="text-2xl font-bold mb-2" style={{ fontFamily: '
|
|
1717
|
+
<h1 className="text-2xl font-bold mb-2" style={{ fontFamily: '"Instrument Serif", "Times New Roman", serif', fontSize: 'clamp(27px, 6.4vw, 34px)', fontWeight: 400, letterSpacing: '-0.02em', lineHeight: 1.08, color: isGlass ? '#FFFFFF' : COLORS.textPrimary }}>
|
|
1830
1718
|
{isWelcomeBack ? 'Welcome back' : 'Enter verification code'}
|
|
1831
1719
|
</h1>
|
|
1832
1720
|
<p className="mb-6" style={{ fontFamily: 'Inter, system-ui, sans-serif', color: isGlass ? 'rgba(255,255,255,0.7)' : COLORS.textSecondary }}>
|
|
@@ -1,228 +1,41 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const [
|
|
6
|
-
const [
|
|
7
|
-
const [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
setPinRequirements({
|
|
30
|
-
length: pin.length >= 8,
|
|
31
|
-
uppercase: /[A-Z]/.test(pin),
|
|
32
|
-
number: /\d/.test(pin),
|
|
33
|
-
// Must match the backend's accepted symbol set exactly so a PIN that
|
|
34
|
-
// passes here also passes /store-pin (otherwise store-pin 400s).
|
|
35
|
-
specialChar: /[!@#$%^&*(),.?":{}|<>]/.test(pin),
|
|
36
|
-
});
|
|
37
|
-
}, [pin]);
|
|
38
|
-
|
|
39
|
-
const allRequirementsMet = pinRequirements.length && pinRequirements.uppercase && pinRequirements.number && pinRequirements.specialChar;
|
|
40
|
-
|
|
41
|
-
const handleSubmit = async () => {
|
|
42
|
-
if (allRequirementsMet && !isSubmitting) {
|
|
43
|
-
setIsSubmitting(true);
|
|
44
|
-
setSubmitError('');
|
|
45
|
-
try { inputRef.current?.blur?.(); } catch (_) {}
|
|
46
|
-
try {
|
|
47
|
-
if (document?.activeElement && typeof document.activeElement.blur === 'function') {
|
|
48
|
-
document.activeElement.blur();
|
|
49
|
-
}
|
|
50
|
-
} catch (_) {}
|
|
51
|
-
try {
|
|
52
|
-
await Promise.resolve(onComplete({
|
|
53
|
-
pin: pin, // This should be hashed in production
|
|
54
|
-
pinCreated: true,
|
|
55
|
-
timestamp: new Date().toISOString()
|
|
56
|
-
}));
|
|
57
|
-
} catch (error) {
|
|
58
|
-
console.warn('PIN setup failed to advance:', error);
|
|
59
|
-
if (isMountedRef.current) {
|
|
60
|
-
setSubmitError(
|
|
61
|
-
(error && error.message) ||
|
|
62
|
-
"We couldn't save your secret code. Please try again."
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
} finally {
|
|
66
|
-
if (isMountedRef.current) {
|
|
67
|
-
setIsSubmitting(false);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
1
|
+
import React, {useRef, useState, useEffect} from 'react';
|
|
2
|
+
import {NativeAction, NativeInfoIcon} from './parity/NativeScreens.jsx';
|
|
3
|
+
|
|
4
|
+
export default function PinSetup({onComplete, onBack}) {
|
|
5
|
+
const [pin,setPin]=useState('');
|
|
6
|
+
const [visible,setVisible]=useState(false);
|
|
7
|
+
const [submitting,setSubmitting]=useState(false);
|
|
8
|
+
const [error,setError]=useState('');
|
|
9
|
+
const pending=useRef(false),mounted=useRef(true);
|
|
10
|
+
useEffect(()=>{mounted.current=true;return()=>{mounted.current=false;};},[]);
|
|
11
|
+
const requirements=[
|
|
12
|
+
['At least 8 characters',pin.length>=8],
|
|
13
|
+
['An uppercase letter',/[A-Z]/.test(pin)],
|
|
14
|
+
['A number',/\d/.test(pin)],
|
|
15
|
+
['A special character',/[!@#$%^&*(),.?":{}|<>]/.test(pin)],
|
|
16
|
+
];
|
|
17
|
+
const valid=requirements.every(([,met])=>met);
|
|
18
|
+
async function submit(event) {
|
|
19
|
+
event?.preventDefault();
|
|
20
|
+
if(!valid||pending.current)return;
|
|
21
|
+
pending.current=true;setSubmitting(true);setError('');
|
|
22
|
+
try {
|
|
23
|
+
await onComplete?.({pin,pinCreated:true,timestamp:new Date().toISOString()});
|
|
24
|
+
} catch(cause) {
|
|
25
|
+
if(mounted.current)setError(cause?.message || 'We couldn’t save your password. Please try again.');
|
|
26
|
+
} finally {
|
|
27
|
+
pending.current=false;
|
|
28
|
+
if(mounted.current)setSubmitting(false);
|
|
70
29
|
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
borderWidth: 2,
|
|
80
|
-
boxShadow: 'inset 0 0 0 1px rgba(55,65,81,0.22)',
|
|
81
|
-
opacity: 1,
|
|
82
|
-
WebkitAppearance: 'none',
|
|
83
|
-
appearance: 'none',
|
|
84
|
-
backgroundClip: 'padding-box',
|
|
85
|
-
fontFamily: 'Inter, system-ui, sans-serif',
|
|
86
|
-
// iOS/Instagram in-app browsers zoom focused inputs below 16px.
|
|
87
|
-
fontSize: 16,
|
|
88
|
-
lineHeight: '24px',
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
return (
|
|
92
|
-
<div className="w-full h-full flex flex-col" style={{ height: '100%', minHeight: 0 }}>
|
|
93
|
-
{/* Content - Flexible center area */}
|
|
94
|
-
<div
|
|
95
|
-
className="px-6 pt-16 flex-1 flex flex-col overflow-y-auto"
|
|
96
|
-
style={{
|
|
97
|
-
minHeight: 0,
|
|
98
|
-
paddingTop: isMobileViewport ? 64 : 40,
|
|
99
|
-
paddingBottom: isMobileViewport ? 16 : 12,
|
|
100
|
-
}}
|
|
101
|
-
>
|
|
102
|
-
<div className="mb-6 flex-shrink-0">
|
|
103
|
-
<h1 className="text-2xl font-bold text-gray-900 mb-2" style={{ fontFamily: 'IBM Plex Sans, system-ui, sans-serif' }}>Create a Secret Code</h1>
|
|
104
|
-
<p className="text-gray-600 text-base" style={{ fontFamily: 'Inter, system-ui, sans-serif' }}>A secret code so only you have access to your data</p>
|
|
105
|
-
</div>
|
|
106
|
-
|
|
107
|
-
<div className="mb-6 flex-shrink-0">
|
|
108
|
-
<input
|
|
109
|
-
ref={inputRef}
|
|
110
|
-
type="password"
|
|
111
|
-
value={pin}
|
|
112
|
-
onChange={(e) => setPin(e.target.value)}
|
|
113
|
-
className="w-full px-4 py-4 border-2 rounded-xl text-center text-lg font-medium focus:border-gray-900 focus:outline-none placeholder-gray-500"
|
|
114
|
-
placeholder="Enter your secret code"
|
|
115
|
-
maxLength={20}
|
|
116
|
-
disabled={isSubmitting}
|
|
117
|
-
style={visiblePinInputStyle}
|
|
118
|
-
/>
|
|
119
|
-
</div>
|
|
120
|
-
|
|
121
|
-
{/* Requirements list - NO SCROLL ISOLATION to prevent nesting issues */}
|
|
122
|
-
<div className="pb-4">
|
|
123
|
-
<p className="text-gray-900 font-medium mb-4">Your secret code must:</p>
|
|
124
|
-
<div className="space-y-3">
|
|
125
|
-
<div className="flex items-center gap-3">
|
|
126
|
-
<div
|
|
127
|
-
className={`w-5 h-5 rounded-full border-2 ${pinRequirements.length ? "border-green-500 bg-green-500" : "border-gray-300 bg-white"}`}
|
|
128
|
-
>
|
|
129
|
-
{pinRequirements.length && (
|
|
130
|
-
<svg className="w-3 h-3 text-white m-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
131
|
-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
|
|
132
|
-
</svg>
|
|
133
|
-
)}
|
|
134
|
-
</div>
|
|
135
|
-
<span className="text-gray-700">Be at least 8 characters in length.</span>
|
|
136
|
-
</div>
|
|
137
|
-
<div className="flex items-center gap-3">
|
|
138
|
-
<div
|
|
139
|
-
className={`w-5 h-5 rounded-full border-2 ${pinRequirements.uppercase ? "border-green-500 bg-green-500" : "border-gray-300 bg-white"}`}
|
|
140
|
-
>
|
|
141
|
-
{pinRequirements.uppercase && (
|
|
142
|
-
<svg className="w-3 h-3 text-white m-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
143
|
-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
|
|
144
|
-
</svg>
|
|
145
|
-
)}
|
|
146
|
-
</div>
|
|
147
|
-
<span className="text-gray-700">Contain an uppercase letter.</span>
|
|
148
|
-
</div>
|
|
149
|
-
<div className="flex items-center gap-3">
|
|
150
|
-
<div
|
|
151
|
-
className={`w-5 h-5 rounded-full border-2 ${pinRequirements.number ? "border-green-500 bg-green-500" : "border-gray-300 bg-white"}`}
|
|
152
|
-
>
|
|
153
|
-
{pinRequirements.number && (
|
|
154
|
-
<svg className="w-3 h-3 text-white m-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
155
|
-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
|
|
156
|
-
</svg>
|
|
157
|
-
)}
|
|
158
|
-
</div>
|
|
159
|
-
<span className="text-gray-700">Contain a number.</span>
|
|
160
|
-
</div>
|
|
161
|
-
<div className="flex items-center gap-3">
|
|
162
|
-
<div
|
|
163
|
-
className={`w-5 h-5 rounded-full border-2 ${pinRequirements.specialChar ? "border-green-500 bg-green-500" : "border-gray-300 bg-white"}`}
|
|
164
|
-
>
|
|
165
|
-
{pinRequirements.specialChar && (
|
|
166
|
-
<svg className="w-3 h-3 text-white m-0.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
167
|
-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
|
|
168
|
-
</svg>
|
|
169
|
-
)}
|
|
170
|
-
</div>
|
|
171
|
-
<span className="text-gray-700">Contain a special character/symbol.</span>
|
|
172
|
-
</div>
|
|
173
|
-
</div>
|
|
174
|
-
</div>
|
|
175
|
-
</div>
|
|
176
|
-
|
|
177
|
-
{/* Buttons - Fixed at bottom */}
|
|
178
|
-
<div
|
|
179
|
-
className="px-6 pb-6 pt-4 flex-shrink-0 space-y-3 bg-white"
|
|
180
|
-
style={{
|
|
181
|
-
minHeight: 'auto',
|
|
182
|
-
paddingBottom: isMobileViewport ? 'calc(24px + env(safe-area-inset-bottom))' : 20,
|
|
183
|
-
}}
|
|
184
|
-
>
|
|
185
|
-
{submitError && (
|
|
186
|
-
<div
|
|
187
|
-
role="alert"
|
|
188
|
-
className="rounded-xl px-4 py-3 text-sm"
|
|
189
|
-
style={{
|
|
190
|
-
backgroundColor: '#FEF2F2',
|
|
191
|
-
border: '1px solid #FECACA',
|
|
192
|
-
color: '#B91C1C',
|
|
193
|
-
fontFamily: 'Inter, system-ui, sans-serif',
|
|
194
|
-
}}
|
|
195
|
-
>
|
|
196
|
-
{submitError}
|
|
197
|
-
</div>
|
|
198
|
-
)}
|
|
199
|
-
<div
|
|
200
|
-
className={`w-full rounded-full py-4 text-base font-medium flex items-center justify-center gap-2 transition-colors ${
|
|
201
|
-
allRequirementsMet && !isSubmitting
|
|
202
|
-
? "bg-gray-900 hover:bg-gray-800 cursor-pointer"
|
|
203
|
-
: "bg-gray-300 text-gray-500 cursor-not-allowed"
|
|
204
|
-
}`}
|
|
205
|
-
style={allRequirementsMet ? { color: '#ffffff' } : {}}
|
|
206
|
-
onClick={allRequirementsMet && !isSubmitting ? handleSubmit : undefined}
|
|
207
|
-
>
|
|
208
|
-
{isSubmitting ? (
|
|
209
|
-
<>
|
|
210
|
-
<svg className="w-4 h-4 animate-spin" viewBox="0 0 24 24" fill="none" aria-hidden="true">
|
|
211
|
-
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4" />
|
|
212
|
-
<path className="opacity-90" d="M21 12a9 9 0 0 0-9-9" stroke="currentColor" strokeWidth="4" strokeLinecap="round" />
|
|
213
|
-
</svg>
|
|
214
|
-
Loading...
|
|
215
|
-
</>
|
|
216
|
-
) : (
|
|
217
|
-
<>
|
|
218
|
-
Continue
|
|
219
|
-
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
220
|
-
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
|
|
221
|
-
</svg>
|
|
222
|
-
</>
|
|
223
|
-
)}
|
|
224
|
-
</div>
|
|
225
|
-
</div>
|
|
30
|
+
}
|
|
31
|
+
return <form className="rn-screen rn-password" onSubmit={submit}>
|
|
32
|
+
<div className="rn-scroll">
|
|
33
|
+
<svg className="rn-lock" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.4" aria-hidden="true"><rect x="5" y="10" width="14" height="11" rx="3"/><path d="M8 10V7a4 4 0 0 1 8 0v3M12 14v3"/></svg>
|
|
34
|
+
<h1>Create a password</h1>
|
|
35
|
+
<p className="rn-subtitle">A password so only you have access to your persona. <a href="https://privacy.onairos.io" target="_blank" rel="noreferrer" aria-label="About password privacy"><NativeInfoIcon/></a></p>
|
|
36
|
+
<div className="rn-password-field"><input aria-label="Password" type={visible?'text':'password'} autoComplete="new-password" autoCapitalize="none" autoCorrect="off" placeholder="Enter your password" disabled={submitting} value={pin} onChange={e=>setPin(e.target.value)}/><button type="button" aria-label={visible?'Hide password':'Show password'} disabled={submitting} onClick={()=>setVisible(v=>!v)}>{visible?'Hide':'Show'}</button></div>
|
|
37
|
+
<ul className="rn-password-rules">{requirements.map(([label,met])=><li key={label}><span className={met?'is-met':''} aria-hidden="true">{met?'✓':'○'}</span>{label}</li>)}</ul>
|
|
226
38
|
</div>
|
|
227
|
-
|
|
228
|
-
|
|
39
|
+
<footer className="rn-footer">{error && <p role="alert" className="rn-error">{error}</p>}<NativeAction disabled={!valid||submitting} busy={submitting} onClick={submit}>{submitting?'Securing…':'Secure my data'}</NativeAction>{onBack && <button className="rn-link" type="button" disabled={submitting} onClick={onBack}>Back</button>}</footer>
|
|
40
|
+
</form>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
|
+
import {NativeAction, NativeConnections, NativeWelcome} from './parity/NativeScreens.jsx';
|
|
3
|
+
import DataRequest from './DataRequest.jsx';
|
|
4
|
+
import PinSetup from './PinSetup.jsx';
|
|
5
|
+
import {SUPPORTED_PLATFORMS} from '../capacitorConnectorCatalog.js';
|
|
6
|
+
import chatgpt from '../assets/connectors/chatgpt.png';
|
|
7
|
+
import youtube from '../assets/connectors/YouTubeicon2.png';
|
|
8
|
+
import linkedin from '../assets/connectors/Linkedinicon.png';
|
|
9
|
+
import pinterest from '../assets/connectors/pinterest.png';
|
|
10
|
+
import reddit from '../assets/connectors/Redditicon.png';
|
|
11
|
+
import spotify from '../assets/connectors/spotify.png';
|
|
12
|
+
import tiktok from '../assets/connectors/tiktok.png';
|
|
13
|
+
const icons = {chatgpt,youtube,linkedin,pinterest,reddit,spotify,tiktok};
|
|
14
|
+
const platforms = SUPPORTED_PLATFORMS.map(p=>({...p,icon:<img src={icons[p.connector]} alt=""/>}));
|
|
15
|
+
/** An explicit synthetic walkthrough. Never authenticates, calls connectors, or saves a PIN/session. */
|
|
16
|
+
export default function SDKDesignPreview({appName='Example app',initialStep='welcome',onClose}) {
|
|
17
|
+
const [step,setStep]=useState(initialStep);
|
|
18
|
+
const [connected,setConnected]=useState({});
|
|
19
|
+
const [selected,setSelected]=useState(platforms[0]?.name);
|
|
20
|
+
const [decision,setDecision]=useState(null);
|
|
21
|
+
return <div className="rn-preview" data-onairos-modal="true">
|
|
22
|
+
<header className="rn-preview-header"><span>onairos</span><button type="button" aria-label="Close SDK preview" onClick={onClose}>×</button></header>
|
|
23
|
+
<nav className="rn-preview-tabs" aria-label="Mock SDK screens">{['welcome','connections','password','consent'].map(name=><button key={name} onClick={()=>setStep(name)} aria-current={step===name?'step':undefined}>{name}</button>)}</nav>
|
|
24
|
+
<p className="rn-preview-notice">Mock preview · no accounts or data are connected</p>
|
|
25
|
+
<div className="rn-preview-content">
|
|
26
|
+
{step==='welcome' && <NativeWelcome appName={appName} sharesRawContent onContinue={()=>setStep('connections')}/>}
|
|
27
|
+
{step==='connections' && <NativeConnections platforms={platforms} selected={selected} onSelect={setSelected} connected={connected} onToggle={name=>setConnected(old=>({...old,[name]:!old[name]}))} onContinue={()=>setStep('password')}/>}
|
|
28
|
+
{step==='password' && <PinSetup onBack={()=>setStep('connections')} onComplete={()=>setStep('consent')}/>}
|
|
29
|
+
{step==='consent' && <DataRequest demoMode appName={appName} requestData={['preferences','personality','rawMemories']} connectedPlatforms={Object.keys(connected).filter(name=>connected[name])} onConnectMoreApps={()=>setStep('connections')} onDecline={()=>{setDecision('Declined');setStep('complete');}} onComplete={result=>{setDecision(`Approved: ${result.approved.join(', ')}`);setStep('complete');}}/>}
|
|
30
|
+
{step==='complete' && <section className="rn-screen"><div className="rn-scroll"><h1>Preview complete</h1><p className="rn-subtitle">{decision}</p><p className="rn-subtitle">This was a synthetic walkthrough. Nothing was sent or saved.</p></div><footer className="rn-footer"><NativeAction onClick={()=>{setConnected({});setStep('welcome');}}>Start again</NativeAction></footer></section>}
|
|
31
|
+
</div>
|
|
32
|
+
</div>;
|
|
33
|
+
}
|
|
@@ -3,8 +3,9 @@ import React from 'react';
|
|
|
3
3
|
/**
|
|
4
4
|
* Logged-in session strip (email + logout) — same layout as DataRequest’s header.
|
|
5
5
|
*/
|
|
6
|
-
export default function SessionUserBar({ userEmail, onLogout, theme = 'default' }) {
|
|
6
|
+
export default function SessionUserBar({ userEmail, onLogout, theme = 'default', nativeConnectionHeader = false }) {
|
|
7
7
|
if (!userEmail) return null;
|
|
8
|
+
if (nativeConnectionHeader) return <div className="rn-connection-session"><span title={userEmail}>{userEmail}</span>{onLogout&&<button type="button" onClick={onLogout} aria-label="Log out of Onairos"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" aria-hidden="true"><path d="M10 4H5v16h5M8 12h13m-5-5 5 5-5 5"/></svg></button>}</div>;
|
|
8
9
|
const isGlass = theme === 'glass';
|
|
9
10
|
const shellStyle = {
|
|
10
11
|
padding: '4px 18px 5px',
|
|
@@ -778,10 +778,13 @@ export default function TrainingScreen({
|
|
|
778
778
|
|
|
779
779
|
<div>
|
|
780
780
|
<h2
|
|
781
|
-
className="
|
|
781
|
+
className="font-normal text-gray-950"
|
|
782
782
|
style={{
|
|
783
|
-
fontFamily: '
|
|
784
|
-
|
|
783
|
+
fontFamily: '"Instrument Serif", "Times New Roman", serif',
|
|
784
|
+
fontSize: 'clamp(26px, 5vw, 32px)',
|
|
785
|
+
fontWeight: 400,
|
|
786
|
+
letterSpacing: '-0.03em',
|
|
787
|
+
lineHeight: 1.06,
|
|
785
788
|
maxWidth: 380
|
|
786
789
|
}}
|
|
787
790
|
>
|
|
@@ -789,7 +792,7 @@ export default function TrainingScreen({
|
|
|
789
792
|
</h2>
|
|
790
793
|
<p
|
|
791
794
|
className="mt-3 text-sm sm:text-base text-gray-600"
|
|
792
|
-
style={{ fontFamily: '
|
|
795
|
+
style={{ fontFamily: '"DM Sans", Inter, system-ui, sans-serif', lineHeight: 1.55, maxWidth: 380 }}
|
|
793
796
|
>
|
|
794
797
|
We could not find enough activity{activityTarget} to continue.
|
|
795
798
|
</p>
|
|
@@ -799,13 +802,13 @@ export default function TrainingScreen({
|
|
|
799
802
|
>
|
|
800
803
|
<p
|
|
801
804
|
className="text-[11px] font-semibold uppercase tracking-[0.16em] text-gray-400"
|
|
802
|
-
style={{ fontFamily: '
|
|
805
|
+
style={{ fontFamily: '"DM Sans", Inter, system-ui, sans-serif' }}
|
|
803
806
|
>
|
|
804
807
|
Reasoning
|
|
805
808
|
</p>
|
|
806
809
|
<p
|
|
807
810
|
className="mt-1 text-sm text-gray-700"
|
|
808
|
-
style={{ fontFamily: '
|
|
811
|
+
style={{ fontFamily: '"DM Sans", Inter, system-ui, sans-serif', lineHeight: 1.5 }}
|
|
809
812
|
>
|
|
810
813
|
{reasoning}
|
|
811
814
|
</p>
|
|
@@ -817,7 +820,7 @@ export default function TrainingScreen({
|
|
|
817
820
|
type="button"
|
|
818
821
|
onClick={onBack}
|
|
819
822
|
className="w-full sm:w-auto rounded-full bg-gray-950 hover:bg-gray-800 text-white px-7 py-3.5 text-sm font-semibold transition-colors shadow-[0_12px_28px_rgba(17,24,39,0.18)]"
|
|
820
|
-
style={{ fontFamily: '
|
|
823
|
+
style={{ fontFamily: '"DM Sans", Inter, system-ui, sans-serif', maxWidth: 320 }}
|
|
821
824
|
>
|
|
822
825
|
Connect more apps
|
|
823
826
|
</button>
|
|
@@ -842,10 +845,13 @@ export default function TrainingScreen({
|
|
|
842
845
|
{/* Vague message only (never show backend training/inference details) */}
|
|
843
846
|
<div className="text-center" style={{ minHeight: 56, display: 'flex', alignItems: 'center' }}>
|
|
844
847
|
<h2
|
|
845
|
-
className="
|
|
848
|
+
className="font-normal text-gray-900"
|
|
846
849
|
style={{
|
|
847
|
-
fontFamily: '
|
|
848
|
-
|
|
850
|
+
fontFamily: '"Instrument Serif", "Times New Roman", serif',
|
|
851
|
+
fontSize: 'clamp(26px, 5vw, 34px)',
|
|
852
|
+
fontWeight: 400,
|
|
853
|
+
letterSpacing: '-0.03em',
|
|
854
|
+
lineHeight: 1.05,
|
|
849
855
|
maxWidth: 360
|
|
850
856
|
}}
|
|
851
857
|
>
|
|
@@ -879,7 +885,7 @@ export default function TrainingScreen({
|
|
|
879
885
|
</div>
|
|
880
886
|
<p
|
|
881
887
|
className="mt-3 text-center text-xs md:text-sm text-gray-400"
|
|
882
|
-
style={{ fontFamily: '
|
|
888
|
+
style={{ fontFamily: '"DM Sans", Inter, system-ui, sans-serif', lineHeight: 1.4 }}
|
|
883
889
|
>
|
|
884
890
|
This usually takes about a minute - sit tight!
|
|
885
891
|
</p>
|
|
@@ -888,7 +894,7 @@ export default function TrainingScreen({
|
|
|
888
894
|
</div>
|
|
889
895
|
<div
|
|
890
896
|
className="mt-auto pt-6 text-center text-sm text-gray-300"
|
|
891
|
-
style={{ fontFamily: '
|
|
897
|
+
style={{ fontFamily: '"DM Sans", Inter, system-ui, sans-serif', letterSpacing: '0.01em' }}
|
|
892
898
|
>
|
|
893
899
|
Onairos
|
|
894
900
|
</div>
|