@onairosofficial/onairos-capacitor 0.1.2 → 0.1.4
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 +17 -6
- package/dist/onairos.capacitor.esm.js +1 -1
- package/dist/onairos.capacitor.esm.turbopack.js +1 -1
- package/onairos.d.ts +16 -26
- package/package.json +1 -1
- package/src/capacitorOAuthConfig.js +24 -13
- package/src/components/DataRequest.jsx +1 -1
- package/src/components/EmailAuth.js +3 -1
- package/src/components/EmailAuth.jsx +4 -114
- package/src/components/PinSetup.jsx +1 -1
- package/src/components/TrainingScreen.jsx +18 -12
- package/src/components/UniversalOnboarding.jsx +1 -1
- package/src/components/WelcomeScreen.jsx +12 -12
- package/src/onairos.capacitor.jsx +14 -2
- package/src/styles/onairos-fonts.css +20 -0
- package/src/styles/onairos-native.css +709 -0
- package/src/styles/sdkCssRegistry.js +83 -1
- package/src/styles/tailwind.capacitor.css +2 -0
- package/src/utils/capacitorPlugins.js +20 -12
package/onairos.d.ts
CHANGED
|
@@ -402,38 +402,28 @@ declare module '@onairosofficial/onairos-capacitor' {
|
|
|
402
402
|
// ===============================================
|
|
403
403
|
|
|
404
404
|
/**
|
|
405
|
-
* Configure Google OAuth client IDs
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
410
|
-
*
|
|
411
|
-
*
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
*
|
|
415
|
-
*
|
|
416
|
-
*
|
|
417
|
-
* - iOS (with your bundle identifier)
|
|
418
|
-
* - Android (with your package name and SHA-1 fingerprint)
|
|
419
|
-
*
|
|
420
|
-
* @param clientIds - Object containing platform-specific client IDs
|
|
421
|
-
* @returns Updated client IDs object
|
|
422
|
-
*
|
|
405
|
+
* Configure developer-owned native Google OAuth client IDs.
|
|
406
|
+
*
|
|
407
|
+
* A Capacitor build is a native app even before store publication. Create
|
|
408
|
+
* an iOS client for the exact bundle ID and/or an Android client for the
|
|
409
|
+
* exact package name and signing SHA-1.
|
|
410
|
+
*
|
|
411
|
+
* The SDK supplies the Onairos web/server OAuth client used as the ID-token
|
|
412
|
+
* audience. Do not pass an iOS or Android client ID as `webClientId` or
|
|
413
|
+
* `serverClientId`, or backend verification will fail with an audience
|
|
414
|
+
* mismatch. Those two fields remain optional for advanced deployments whose
|
|
415
|
+
* backend explicitly verifies a different web OAuth client.
|
|
416
|
+
*
|
|
423
417
|
* @example
|
|
424
418
|
* ```typescript
|
|
425
419
|
* import { updateGoogleClientIds } from '@onairosofficial/onairos-capacitor';
|
|
426
|
-
*
|
|
427
|
-
* // For Capacitor apps - provide YOUR OWN client IDs
|
|
420
|
+
*
|
|
428
421
|
* updateGoogleClientIds({
|
|
429
|
-
* webClientId: 'your-web-client-id.apps.googleusercontent.com',
|
|
430
422
|
* iosClientId: 'your-ios-client-id.apps.googleusercontent.com',
|
|
431
|
-
* androidClientId: 'your-android-client-id.apps.googleusercontent.com'
|
|
432
|
-
* serverClientId: 'your-server-client-id.apps.googleusercontent.com' // For backend token verification
|
|
423
|
+
* androidClientId: 'your-android-client-id.apps.googleusercontent.com'
|
|
433
424
|
* });
|
|
434
425
|
* ```
|
|
435
|
-
*/
|
|
436
|
-
export function updateGoogleClientIds(clientIds: {
|
|
426
|
+
*/ export function updateGoogleClientIds(clientIds: {
|
|
437
427
|
webClientId?: string;
|
|
438
428
|
iosClientId?: string;
|
|
439
429
|
androidClientId?: string;
|
|
@@ -470,7 +460,7 @@ declare module '@onairosofficial/onairos-capacitor' {
|
|
|
470
460
|
*
|
|
471
461
|
* REQUIREMENTS:
|
|
472
462
|
* 1. Install @codetrix-studio/capacitor-google-auth: `npm install @codetrix-studio/capacitor-google-auth`
|
|
473
|
-
* 2. Configure with
|
|
463
|
+
* 2. Configure with your own native iOS and/or Android OAuth client ID
|
|
474
464
|
* 3. Set up native platform config (Info.plist for iOS, google-services.json for Android)
|
|
475
465
|
*
|
|
476
466
|
* @returns Promise with sign-in result
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { DEFAULT_ONAIROS_GOOGLE_WEB_CLIENT_ID } from './utils/googleWebClientId.js';
|
|
2
|
+
|
|
1
3
|
const pick = (value) => {
|
|
2
4
|
const s = typeof value === 'string' ? value.trim() : '';
|
|
3
5
|
return s && s !== 'undefined' && s !== 'null' ? s : null;
|
|
4
6
|
};
|
|
5
7
|
|
|
6
8
|
let googleClientIds = {
|
|
7
|
-
webClientId:
|
|
9
|
+
webClientId: DEFAULT_ONAIROS_GOOGLE_WEB_CLIENT_ID,
|
|
8
10
|
iosClientId: null,
|
|
9
11
|
androidClientId: null,
|
|
10
|
-
serverClientId:
|
|
12
|
+
serverClientId: DEFAULT_ONAIROS_GOOGLE_WEB_CLIENT_ID,
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
let youtubeClientId = null;
|
|
@@ -18,22 +20,31 @@ export const updateGoogleClientIds = (clientIds = {}) => {
|
|
|
18
20
|
const androidClientId = pick(clientIds.androidClientId);
|
|
19
21
|
const serverClientId = pick(clientIds.serverClientId);
|
|
20
22
|
|
|
23
|
+
// Google native clients identify the installed app, but Onairos verifies the
|
|
24
|
+
// ID token against the web OAuth client. Keep those concerns separate so the
|
|
25
|
+
// native client ID can never accidentally become the backend token audience.
|
|
26
|
+
const nextWebClientId =
|
|
27
|
+
webClientId || googleClientIds.webClientId || DEFAULT_ONAIROS_GOOGLE_WEB_CLIENT_ID;
|
|
28
|
+
const nextServerClientId =
|
|
29
|
+
serverClientId || webClientId || googleClientIds.serverClientId || nextWebClientId;
|
|
30
|
+
|
|
21
31
|
googleClientIds = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
...(serverClientId ? { serverClientId } : {}),
|
|
32
|
+
webClientId: nextWebClientId,
|
|
33
|
+
iosClientId: iosClientId || googleClientIds.iosClientId,
|
|
34
|
+
androidClientId: androidClientId || googleClientIds.androidClientId,
|
|
35
|
+
serverClientId: nextServerClientId,
|
|
27
36
|
};
|
|
28
37
|
|
|
29
38
|
if (typeof window !== 'undefined') {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
39
|
+
window.onairosGoogleClientId = googleClientIds.webClientId;
|
|
40
|
+
window.onairosGoogleWebClientId = googleClientIds.webClientId;
|
|
41
|
+
window.onairosGoogleServerClientId = googleClientIds.serverClientId;
|
|
42
|
+
if (googleClientIds.iosClientId) {
|
|
43
|
+
window.onairosGoogleIosClientId = googleClientIds.iosClientId;
|
|
44
|
+
}
|
|
45
|
+
if (googleClientIds.androidClientId) {
|
|
46
|
+
window.onairosGoogleAndroidClientId = googleClientIds.androidClientId;
|
|
33
47
|
}
|
|
34
|
-
if (iosClientId) window.onairosGoogleIosClientId = iosClientId;
|
|
35
|
-
if (androidClientId) window.onairosGoogleAndroidClientId = androidClientId;
|
|
36
|
-
if (serverClientId) window.onairosGoogleServerClientId = serverClientId;
|
|
37
48
|
}
|
|
38
49
|
|
|
39
50
|
return googleClientIds;
|
|
@@ -861,7 +861,7 @@ const DataRequest = ({ appName = "My App", onComplete, onConnectMoreApps, connec
|
|
|
861
861
|
|
|
862
862
|
{/* TITLE */}
|
|
863
863
|
<div className={`text-center ${demoMode ? 'mb-3 md:mb-3' : 'mb-4 md:mb-5'}`}>
|
|
864
|
-
<h1 className={`text-[
|
|
864
|
+
<h1 className={`text-[25px] md:text-[27px] leading-tight ${isGlass ? 'text-white' : 'text-gray-900'}`} style={{ fontFamily: '"Instrument Serif", "Times New Roman", serif', fontWeight: 400, letterSpacing: '-0.03em' }}>
|
|
865
865
|
{customTitle || `${appName} wants to personalize your experience`}
|
|
866
866
|
</h1>
|
|
867
867
|
<div className="mt-1 flex items-center justify-center gap-2">
|
|
@@ -501,6 +501,8 @@ function EmailAuthComponent({ onSuccess, testMode = false, preVerifiedEmail = nu
|
|
|
501
501
|
(typeof window !== 'undefined' && window.onairosGoogleClientId) || '';
|
|
502
502
|
const iosClientId =
|
|
503
503
|
(typeof window !== 'undefined' && window.onairosGoogleIosClientId) || '';
|
|
504
|
+
const serverClientId =
|
|
505
|
+
(typeof window !== 'undefined' && window.onairosGoogleServerClientId) || webClientId;
|
|
504
506
|
|
|
505
507
|
if (!webClientId || !iosClientId) {
|
|
506
508
|
setGoogleHint('To enable Google sign-in in this iOS app, set updateGoogleClientIds({ webClientId, iosClientId }) in the host app. Otherwise use email login.');
|
|
@@ -515,7 +517,7 @@ function EmailAuthComponent({ onSuccess, testMode = false, preVerifiedEmail = nu
|
|
|
515
517
|
iOSClientId: iosClientId,
|
|
516
518
|
// If your backend verifies tokens / you need server-side validation, set this to the web client id.
|
|
517
519
|
// (Safe default here.)
|
|
518
|
-
iOSServerClientId:
|
|
520
|
+
iOSServerClientId: serverClientId,
|
|
519
521
|
mode: 'online',
|
|
520
522
|
},
|
|
521
523
|
});
|
|
@@ -681,117 +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
|
-
|
|
704
|
-
if (!webClientId || !iosClientId) {
|
|
705
|
-
setGoogleHint('To enable Google sign-in in this iOS app, set updateGoogleClientIds({ webClientId, iosClientId }) in the host app. Otherwise use email login.');
|
|
706
|
-
setIsLoading(false);
|
|
707
|
-
return;
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
try {
|
|
711
|
-
await googleAuth.initialize({
|
|
712
|
-
google: {
|
|
713
|
-
webClientId,
|
|
714
|
-
iOSClientId: iosClientId,
|
|
715
|
-
// If your backend verifies tokens / you need server-side validation, set this to the web client id.
|
|
716
|
-
// (Safe default here.)
|
|
717
|
-
iOSServerClientId: webClientId,
|
|
718
|
-
mode: 'online',
|
|
719
|
-
},
|
|
720
|
-
});
|
|
721
|
-
} catch (e) {
|
|
722
|
-
console.warn('Google plugin initialize failed:', e);
|
|
723
|
-
setGoogleHint('Google sign-in is not configured correctly in this app. Please use email login.');
|
|
724
|
-
setIsLoading(false);
|
|
725
|
-
return;
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
const r = await googleAuth.login({
|
|
729
|
-
provider: 'google',
|
|
730
|
-
options: { scopes: ['profile', 'email'] },
|
|
731
|
-
});
|
|
732
|
-
result = r?.result || r;
|
|
733
|
-
} else if (typeof googleAuth.signIn === 'function') {
|
|
734
|
-
result = await googleAuth.signIn();
|
|
735
|
-
} else {
|
|
736
|
-
setGoogleHint('Google sign-in requires a compatible native Google auth plugin in this app. Use email login.');
|
|
737
|
-
setIsLoading(false);
|
|
738
|
-
return;
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
// Best-effort extraction across common Capacitor Google Auth plugins.
|
|
742
|
-
const idToken =
|
|
743
|
-
result?.authentication?.idToken ||
|
|
744
|
-
result?.idToken ||
|
|
745
|
-
result?.result?.idToken ||
|
|
746
|
-
result?.credential ||
|
|
747
|
-
result?.tokens?.idToken ||
|
|
748
|
-
result?.response?.idToken ||
|
|
749
|
-
'';
|
|
750
|
-
|
|
751
|
-
// Prefer explicit email if provided; otherwise decode from the JWT (same as web flow).
|
|
752
|
-
let userEmail =
|
|
753
|
-
result?.email ||
|
|
754
|
-
result?.user?.email ||
|
|
755
|
-
result?.profile?.email ||
|
|
756
|
-
result?.result?.profile?.email ||
|
|
757
|
-
'';
|
|
758
|
-
|
|
759
|
-
if (!idToken) {
|
|
760
|
-
setGoogleHint('Google sign-in did not return an ID token. Use email login.');
|
|
761
|
-
setIsLoading(false);
|
|
762
|
-
return;
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
if (!userEmail) {
|
|
766
|
-
try {
|
|
767
|
-
const base64Url = String(idToken).split('.')[1];
|
|
768
|
-
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
|
|
769
|
-
const jsonPayload = decodeURIComponent(
|
|
770
|
-
atob(base64)
|
|
771
|
-
.split('')
|
|
772
|
-
.map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))
|
|
773
|
-
.join('')
|
|
774
|
-
);
|
|
775
|
-
const payload = JSON.parse(jsonPayload);
|
|
776
|
-
userEmail = String(payload?.email || '').trim().toLowerCase();
|
|
777
|
-
} catch (_) {}
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
if (!userEmail) {
|
|
781
|
-
setGoogleHint('Could not determine your email from Google sign-in. Use email login.');
|
|
782
|
-
setIsLoading(false);
|
|
783
|
-
return;
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
// Reuse the existing backend login flow which expects an ID token (JWT).
|
|
787
|
-
handedOffToBackend = true;
|
|
788
|
-
await handleOAuthSuccess(userEmail, idToken);
|
|
789
|
-
} catch (e) {
|
|
790
|
-
console.error('Native Google sign-in failed:', e);
|
|
791
|
-
setGoogleHint('Google sign-in failed in this app. Please use email login.');
|
|
792
|
-
if (!handedOffToBackend) setIsLoading(false);
|
|
793
|
-
}
|
|
794
|
-
|
|
684
|
+
await handleNativeGoogleSignIn();
|
|
795
685
|
return;
|
|
796
686
|
}
|
|
797
687
|
|
|
@@ -1501,7 +1391,7 @@ function EmailAuthComponent({
|
|
|
1501
1391
|
</div>
|
|
1502
1392
|
)}
|
|
1503
1393
|
<div className="mb-8 w-full text-left">
|
|
1504
|
-
<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' }}>
|
|
1505
1395
|
{usePartnerCopy ? partnerWelcomeCopy : 'Build your Onairos persona to own your digital identity'}
|
|
1506
1396
|
</h1>
|
|
1507
1397
|
{!usePartnerCopy && (
|
|
@@ -1702,7 +1592,7 @@ function EmailAuthComponent({
|
|
|
1702
1592
|
</div>
|
|
1703
1593
|
</div>
|
|
1704
1594
|
)}
|
|
1705
|
-
<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 }}>
|
|
1706
1596
|
{usePartnerCopy ? partnerWelcomeCopy : 'Sign in with Onairos'}
|
|
1707
1597
|
</h1>
|
|
1708
1598
|
{!usePartnerCopy && (
|
|
@@ -1824,7 +1714,7 @@ function EmailAuthComponent({
|
|
|
1824
1714
|
|
|
1825
1715
|
const renderCodeStep = () => (
|
|
1826
1716
|
<div className="w-full flex flex-col h-full px-6 pt-16 text-center">
|
|
1827
|
-
<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 }}>
|
|
1828
1718
|
{isWelcomeBack ? 'Welcome back' : 'Enter verification code'}
|
|
1829
1719
|
</h1>
|
|
1830
1720
|
<p className="mb-6" style={{ fontFamily: 'Inter, system-ui, sans-serif', color: isGlass ? 'rgba(255,255,255,0.7)' : COLORS.textSecondary }}>
|
|
@@ -100,7 +100,7 @@ export default function PinSetup({ onComplete, onBack, userEmail }) {
|
|
|
100
100
|
}}
|
|
101
101
|
>
|
|
102
102
|
<div className="mb-6 flex-shrink-0">
|
|
103
|
-
<h1 className="
|
|
103
|
+
<h1 className="mb-2" style={{ fontFamily: '"Instrument Serif", "Times New Roman", serif', fontSize: 'clamp(36px, 8vw, 47px)', fontWeight: 400, letterSpacing: '-0.03em', lineHeight: 0.98, color: '#111111' }}>Create a Secret Code</h1>
|
|
104
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
105
|
</div>
|
|
106
106
|
|
|
@@ -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>
|
|
@@ -4179,7 +4179,7 @@ export default function UniversalOnboarding({
|
|
|
4179
4179
|
>
|
|
4180
4180
|
{/* Nudge header/subheader up slightly on mobile without affecting layout below (transform doesn't affect flow). */}
|
|
4181
4181
|
<div style={{ transform: combineConsentWithOnboarding ? 'translateY(-6px)' : (isMobile ? 'translateY(-16px)' : 'translateY(-10px)') }}>
|
|
4182
|
-
<h1 className="text-2xl font-bold text-gray-900 mb-1 leading-tight" style={{ fontFamily: '
|
|
4182
|
+
<h1 className="text-2xl font-bold text-gray-900 mb-1 leading-tight" style={{ fontFamily: '"Instrument Serif", "Times New Roman", serif', fontSize: 'clamp(37px, 7.7vw, 48px)', fontWeight: 400, letterSpacing: '-0.03em', lineHeight: 1.02 }}>
|
|
4183
4183
|
Connect your apps
|
|
4184
4184
|
</h1>
|
|
4185
4185
|
{combineConsentWithOnboarding ? (
|
|
@@ -196,7 +196,7 @@ export default function WelcomeScreen({
|
|
|
196
196
|
<h1
|
|
197
197
|
className={`font-bold text-balance ${isGlass ? 'text-white' : 'text-gray-900'}`}
|
|
198
198
|
style={{
|
|
199
|
-
fontFamily: '
|
|
199
|
+
fontFamily: '"Instrument Serif", "Times New Roman", serif', fontWeight: 400, letterSpacing: '-0.03em',
|
|
200
200
|
fontSize: isVeryTight ? 22 : (isTight ? 24 : 28),
|
|
201
201
|
marginBottom: isVeryTight ? 10 : (isTight ? 12 : 14),
|
|
202
202
|
}}
|
|
@@ -209,7 +209,7 @@ export default function WelcomeScreen({
|
|
|
209
209
|
<p
|
|
210
210
|
className={`text-sm ${isGlass ? 'text-white/60' : 'text-gray-500'}`}
|
|
211
211
|
style={{
|
|
212
|
-
fontFamily: 'Inter, system-ui, sans-serif',
|
|
212
|
+
fontFamily: '"DM Sans", Inter, system-ui, sans-serif',
|
|
213
213
|
marginBottom: isVeryTight ? 2 : 6,
|
|
214
214
|
}}
|
|
215
215
|
>
|
|
@@ -220,7 +220,7 @@ export default function WelcomeScreen({
|
|
|
220
220
|
<h1
|
|
221
221
|
className={`font-bold text-balance ${isGlass ? 'text-white' : 'text-gray-900'}`}
|
|
222
222
|
style={{
|
|
223
|
-
fontFamily: '
|
|
223
|
+
fontFamily: '"Instrument Serif", "Times New Roman", serif', fontWeight: 400, letterSpacing: '-0.03em',
|
|
224
224
|
fontSize: isVeryTight ? 30 : (isTight ? 32 : 40),
|
|
225
225
|
marginBottom: isVeryTight ? 3 : (isTight ? 5 : 8),
|
|
226
226
|
}}
|
|
@@ -232,7 +232,7 @@ export default function WelcomeScreen({
|
|
|
232
232
|
<p
|
|
233
233
|
className={`leading-relaxed text-pretty mx-auto w-full max-w-md ${isGlass ? 'text-white/70' : 'text-gray-600'}`}
|
|
234
234
|
style={{
|
|
235
|
-
fontFamily: 'Inter, system-ui, sans-serif',
|
|
235
|
+
fontFamily: '"DM Sans", Inter, system-ui, sans-serif',
|
|
236
236
|
// Slightly larger than before for readability
|
|
237
237
|
fontSize: isVeryTight ? 16 : (isTight ? 16 : 18),
|
|
238
238
|
marginBottom: isVeryTight ? 6 : (isTight ? 8 : 8),
|
|
@@ -286,7 +286,7 @@ export default function WelcomeScreen({
|
|
|
286
286
|
<div
|
|
287
287
|
className={`font-semibold leading-5 ${isGlass ? 'text-white' : 'text-gray-900'}`}
|
|
288
288
|
style={{
|
|
289
|
-
fontFamily: 'Inter, system-ui, sans-serif',
|
|
289
|
+
fontFamily: '"DM Sans", Inter, system-ui, sans-serif',
|
|
290
290
|
fontSize: isVeryTight ? 15 : 16,
|
|
291
291
|
}}
|
|
292
292
|
>
|
|
@@ -295,7 +295,7 @@ export default function WelcomeScreen({
|
|
|
295
295
|
<div
|
|
296
296
|
className={`leading-5 ${isGlass ? 'text-white/60' : 'text-gray-600'}`}
|
|
297
297
|
style={{
|
|
298
|
-
fontFamily: 'Inter, system-ui, sans-serif',
|
|
298
|
+
fontFamily: '"DM Sans", Inter, system-ui, sans-serif',
|
|
299
299
|
fontSize: isVeryTight ? 13 : 14,
|
|
300
300
|
}}
|
|
301
301
|
>
|
|
@@ -332,7 +332,7 @@ export default function WelcomeScreen({
|
|
|
332
332
|
<div
|
|
333
333
|
className={`font-semibold leading-5 ${isGlass ? 'text-white' : 'text-gray-900'}`}
|
|
334
334
|
style={{
|
|
335
|
-
fontFamily: 'Inter, system-ui, sans-serif',
|
|
335
|
+
fontFamily: '"DM Sans", Inter, system-ui, sans-serif',
|
|
336
336
|
fontSize: isVeryTight ? 15 : 16,
|
|
337
337
|
}}
|
|
338
338
|
>
|
|
@@ -341,7 +341,7 @@ export default function WelcomeScreen({
|
|
|
341
341
|
<div
|
|
342
342
|
className={`leading-5 ${isGlass ? 'text-white/60' : 'text-gray-600'}`}
|
|
343
343
|
style={{
|
|
344
|
-
fontFamily: 'Inter, system-ui, sans-serif',
|
|
344
|
+
fontFamily: '"DM Sans", Inter, system-ui, sans-serif',
|
|
345
345
|
fontSize: isVeryTight ? 13 : 14,
|
|
346
346
|
}}
|
|
347
347
|
>
|
|
@@ -367,7 +367,7 @@ export default function WelcomeScreen({
|
|
|
367
367
|
<p
|
|
368
368
|
className="text-center text-sm"
|
|
369
369
|
style={{
|
|
370
|
-
fontFamily: 'Inter, system-ui, sans-serif',
|
|
370
|
+
fontFamily: '"DM Sans", Inter, system-ui, sans-serif',
|
|
371
371
|
color: COLORS.error,
|
|
372
372
|
marginBottom: isTight ? 8 : 10,
|
|
373
373
|
}}
|
|
@@ -378,7 +378,7 @@ export default function WelcomeScreen({
|
|
|
378
378
|
<button
|
|
379
379
|
className={`w-full rounded-full py-4 md:py-3 text-base font-medium flex items-center justify-center gap-2 transition-colors ${isGlass ? 'bg-white/15 hover:bg-white/25 text-white border border-white/20' : 'bg-gray-900 hover:bg-gray-800 text-white'}`}
|
|
380
380
|
style={{
|
|
381
|
-
fontFamily: 'Inter, system-ui, sans-serif',
|
|
381
|
+
fontFamily: '"DM Sans", Inter, system-ui, sans-serif',
|
|
382
382
|
// Defensive inline styles so host-app CSS/Tailwind differences cannot hide CTA in production.
|
|
383
383
|
display: 'flex',
|
|
384
384
|
width: '100%',
|
|
@@ -408,7 +408,7 @@ export default function WelcomeScreen({
|
|
|
408
408
|
<p
|
|
409
409
|
className="mt-2 w-full text-center"
|
|
410
410
|
style={{
|
|
411
|
-
fontFamily: 'Inter, system-ui, sans-serif',
|
|
411
|
+
fontFamily: '"DM Sans", Inter, system-ui, sans-serif',
|
|
412
412
|
fontSize: 12,
|
|
413
413
|
fontWeight: 400,
|
|
414
414
|
color: COLORS.textMuted,
|
|
@@ -422,7 +422,7 @@ export default function WelcomeScreen({
|
|
|
422
422
|
onClick={onUseDifferentEmail}
|
|
423
423
|
disabled={continueLoading}
|
|
424
424
|
className={`w-full text-center text-sm font-medium transition-colors ${isGlass ? 'text-white/50 hover:text-white/80' : 'text-gray-500 hover:text-gray-700'}`}
|
|
425
|
-
style={{ fontFamily: 'Inter, system-ui, sans-serif' }}
|
|
425
|
+
style={{ fontFamily: '"DM Sans", Inter, system-ui, sans-serif' }}
|
|
426
426
|
// tighten spacing on very small screens
|
|
427
427
|
{...(isVeryTight ? { } : {})}
|
|
428
428
|
>
|
|
@@ -6,10 +6,22 @@
|
|
|
6
6
|
// still renders correctly.
|
|
7
7
|
import './nativeConnectors.js';
|
|
8
8
|
import cssText from './styles/tailwind.capacitor.css?inline';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
registerOnairosCssText,
|
|
11
|
+
ensureOnairosCssInDocument,
|
|
12
|
+
ensureOnairosFontsInDocument,
|
|
13
|
+
} from './styles/sdkCssRegistry.js';
|
|
10
14
|
|
|
11
|
-
// Register compiled CSS so the modal can inject into ShadowRoot
|
|
15
|
+
// Register compiled CSS so the modal can inject it into its ShadowRoot.
|
|
12
16
|
registerOnairosCssText(cssText);
|
|
13
17
|
|
|
18
|
+
// The ShadowRoot only exists once the modal opens and never covers SDK UI in the
|
|
19
|
+
// host's light DOM (the trigger button), so the sheet also goes in the document.
|
|
20
|
+
// Preflight is scoped to `.onairos-modal` at build time, so this cannot restyle
|
|
21
|
+
// the host. Fonts go in too — the stylesheet's @import for them is dropped when
|
|
22
|
+
// Tailwind compiles, so without this the SDK renders in the host's fonts.
|
|
23
|
+
ensureOnairosCssInDocument();
|
|
24
|
+
ensureOnairosFontsInDocument();
|
|
25
|
+
|
|
14
26
|
export * from './onairos.core.jsx';
|
|
15
27
|
export { default } from './onairos.core.jsx';
|