@onairosofficial/onairos-capacitor 0.1.0 → 0.1.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 +194 -10
- package/README.md +182 -25
- package/dist/onairos.capacitor.esm.js +1 -0
- package/dist/onairos.capacitor.esm.turbopack.js +1 -0
- package/onairos.d.ts +656 -0
- package/package.json +186 -38
- package/src/OnairosReconnectButton.jsx +272 -0
- package/src/RSA.jsx +57 -0
- package/src/assets/NewLogo.png +0 -0
- package/src/assets/OnairosNewLogo.png +0 -0
- package/src/assets/chatgpt-icon.png +0 -0
- package/src/assets/fire-horse.png +0 -0
- package/src/assets/fire-horse.transparent.png +0 -0
- package/src/assets/latest-firehorse.png +0 -0
- package/src/assets/perplexity.png +0 -0
- package/src/assets/persona.png +0 -0
- package/src/assets/persona1.png +0 -0
- package/src/assets/persona2.png +0 -0
- package/src/assets/persona3.png +0 -0
- package/src/assets/persona4.png +0 -0
- package/src/assets/persona5.png +0 -0
- package/src/capacitorConnectorCatalog.js +38 -0
- package/src/capacitorOAuthConfig.js +52 -0
- package/src/chatgptHostedImport/index.js +303 -0
- package/src/components/AuthButtons.jsx +48 -0
- package/src/components/ConnectChatGPTModal.jsx +666 -0
- package/src/components/ConnectClaudeModal.jsx +610 -0
- package/src/components/ConnectGeminiModal.jsx +639 -0
- package/src/components/ConnectGrokModal.jsx +701 -0
- package/src/components/ConnectPerplexityModal.jsx +726 -0
- package/src/components/DataExplainerScreen.jsx +349 -0
- package/src/components/DataRequest.js +885 -0
- package/src/components/DataRequest.jsx +1055 -0
- package/src/components/EmailAuth.js +1871 -0
- package/src/components/EmailAuth.jsx +2062 -0
- package/src/components/ExtensionInstallPrompt.jsx +142 -0
- package/src/components/GoogleButton.js +133 -0
- package/src/components/LLMConnectorManager.jsx +201 -0
- package/src/components/LoadingPage.jsx +19 -0
- package/src/components/LoadingScreen.jsx +81 -0
- package/src/components/LunarBirthdate.jsx +96 -0
- package/src/components/LunarLoadingPage.jsx +251 -0
- package/src/components/Notification.jsx +21 -0
- package/src/components/OnairosAppButton.jsx +85 -0
- package/src/components/OnairosSSO.jsx +645 -0
- package/src/components/OnairosTrigger.jsx +61 -0
- package/src/components/PerplexityLogo.jsx +43 -0
- package/src/components/PinSetup.js +200 -0
- package/src/components/PinSetup.jsx +228 -0
- package/src/components/SDK_PIN_INTEGRATION_REQUIRED_CHANGES.md +526 -0
- package/src/components/SdkErrorBoundary.jsx +36 -0
- package/src/components/SecuritySetup.js +81 -0
- package/src/components/SessionUserBar.jsx +83 -0
- package/src/components/SignUp.js +123 -0
- package/src/components/TestTelegramButton.js +53 -0
- package/src/components/TrainingComponent.jsx +200 -0
- package/src/components/TrainingScreen.jsx +897 -0
- package/src/components/UniversalOnboarding.js +306 -0
- package/src/components/UniversalOnboarding.jsx +4837 -0
- package/src/components/ValentineLoadingPage.jsx +502 -0
- package/src/components/ValentineModeSelector.jsx +162 -0
- package/src/components/WelcomeScreen.jsx +435 -0
- package/src/components/WrappedLoadingPage.jsx +205 -0
- package/src/components/connectors/ChatGPTConnector.js +348 -0
- package/src/components/connectors/ChatGPTConnector.jsx +348 -0
- package/src/components/connectors/ClaudeConnector.js +44 -0
- package/src/components/connectors/ClaudeConnector.jsx +44 -0
- package/src/components/connectors/GeminiConnector.js +170 -0
- package/src/components/connectors/GeminiConnector.jsx +170 -0
- package/src/components/connectors/GmailConnector.js +148 -0
- package/src/components/connectors/GmailConnector.jsx +148 -0
- package/src/components/connectors/GrokConnector.js +16 -0
- package/src/components/connectors/GrokConnector.jsx +16 -0
- package/src/components/connectors/HingeConnector.js +419 -0
- package/src/components/connectors/HingeConnector.jsx +419 -0
- package/src/components/connectors/InstagramDataConnector.js +726 -0
- package/src/components/connectors/InstagramDataConnector.jsx +726 -0
- package/src/components/connectors/LinkedInConnector.js +4 -0
- package/src/components/connectors/LinkedInConnector.jsx +296 -0
- package/src/components/connectors/PerplexityConnector.jsx +16 -0
- package/src/components/connectors/PinterestConnector.js +208 -0
- package/src/components/connectors/PinterestConnector.jsx +208 -0
- package/src/components/connectors/README.md +292 -0
- package/src/components/connectors/RedditConnector.js +229 -0
- package/src/components/connectors/RedditConnector.jsx +229 -0
- package/src/components/connectors/SephoraConnector.js +482 -0
- package/src/components/connectors/SephoraConnector.jsx +482 -0
- package/src/components/connectors/TikTokConnector.jsx +430 -0
- package/src/components/connectors/YoutubeConnector.js +361 -0
- package/src/components/connectors/YoutubeConnector.jsx +361 -0
- package/src/components/connectors/index.js +50 -0
- package/src/components/icons.jsx +46 -0
- package/src/components/icons.tsx +21 -0
- package/src/components/ui/PageLayout.jsx +1255 -0
- package/src/components/ui/PrimaryButton.jsx +162 -0
- package/src/components/ui/button.jsx +49 -0
- package/src/components/ui/card.jsx +61 -0
- package/src/components/ui/checkbox.jsx +33 -0
- package/src/components/ui/label.jsx +29 -0
- package/src/components/utils/UpdateConnections.js +45 -0
- package/src/components/utils/oauthHelper.js +97 -0
- package/src/config/api-config.js +138 -0
- package/src/deepLink.jsx +38 -0
- package/src/getPin.js +26 -0
- package/src/icons/Avatar.png +0 -0
- package/src/icons/Sentiment.png +0 -0
- package/src/icons/Trait.png +0 -0
- package/src/iframe/DataRequestPage.jsx +285 -0
- package/src/iframe/OnairosButtonIntegration.md +148 -0
- package/src/iframe/components/Box.jsx +56 -0
- package/src/iframe/components/IndividualConnection.jsx +88 -0
- package/src/iframe/dataRequestHandler.js +714 -0
- package/src/iframe/data_request_iframe.html +27 -0
- package/src/iframe/data_request_page.js +47 -0
- package/src/iframe/icons/Avatar.png +1 -0
- package/src/iframe/icons/Avatar2.png +1 -0
- package/src/iframe/icons/Sentiment.png +1 -0
- package/src/iframe/icons/Trait.png +1 -0
- package/src/iframe/icons/onairos_logo.png +0 -0
- package/src/iframe/utils/api.js +57 -0
- package/src/index.js +274 -0
- package/src/laravel/OnairosVue.vue +410 -0
- package/src/laravel/blade-helpers.js +320 -0
- package/src/laravel/vite-plugin.js +179 -0
- package/src/mobile/MobileDataRequestPage.jsx +233 -0
- package/src/mobile/components/MobileBox.jsx +71 -0
- package/src/mobile/components/MobileIndividualConnection.jsx +51 -0
- package/src/mobile/shims/browser-apis.js +78 -0
- package/src/mobile/shims/lucide-shim.js +85 -0
- package/src/newUI/EMAIL_VERIFICATION_API_SCHEMA.md +268 -0
- package/src/newUI/PlatformConnectorsStep.tsx +435 -0
- package/src/newUI/PrimaryButton.tsx +213 -0
- package/src/newUI/SignInStep.tsx +194 -0
- package/src/newUI/VerificationStep.tsx +133 -0
- package/src/newUI/WelcomeScreen.tsx +311 -0
- package/src/newUI/services/connectedAccountsService.js +129 -0
- package/src/onairos.capacitor.jsx +16 -0
- package/src/onairos.core.jsx +133 -0
- package/src/onairos.jsx +14 -0
- package/src/onairos.native.jsx +15 -0
- package/src/onairosButton.jsx +9000 -0
- package/src/overlay/CheckBox.jsx +114 -0
- package/src/overlay/IndividualConnection copy.js +86 -0
- package/src/overlay/IndividualConnection.js +191 -0
- package/src/overlay/IndividualConnectionNew.jsx +157 -0
- package/src/overlay/box.js +84 -0
- package/src/overlay/overlay.js +437 -0
- package/src/styles/onairos-scoped-preflight.css +97 -0
- package/src/styles/sdkCssRegistry.js +20 -0
- package/src/styles/styleLoaderInsertShadow.js +69 -0
- package/src/styles/tailwind.capacitor.css +395 -0
- package/src/styles/tailwind.css +395 -0
- package/src/theme/colors.js +40 -0
- package/src/utils/apiKeyValidation.js +341 -0
- package/src/utils/apiResponseLogger.js +316 -0
- package/src/utils/authHeaders.js +275 -0
- package/src/utils/biometrics.js +26 -0
- package/src/utils/bookmarkletUtils.js +28 -0
- package/src/utils/capacitorDetection.js +278 -0
- package/src/utils/capacitorLLMHelper.js +352 -0
- package/src/utils/capacitorPlugins.js +366 -0
- package/src/utils/crossDomainSSO.js +587 -0
- package/src/utils/deepLinking.js +27 -0
- package/src/utils/devLogger.js +46 -0
- package/src/utils/extensionDetection.js +418 -0
- package/src/utils/extractMemory.js +277 -0
- package/src/utils/framerBrandingOverrides.js +40 -0
- package/src/utils/googleWebClientId.js +55 -0
- package/src/utils/overlayHandler.js +224 -0
- package/src/utils/platformDisconnect.js +309 -0
- package/src/utils/pollTrainingStatus.js +200 -0
- package/src/utils/rawMemoriesAccess.js +211 -0
- package/src/utils/resolveBackendAppId.js +47 -0
- package/src/utils/responseFormatter.js +140 -0
- package/src/utils/sdkDebugStorage.js +113 -0
- package/src/utils/sdkInitialization.js +645 -0
- package/src/utils/sessionManager.js +1258 -0
- package/src/utils/startBackgroundTraining.js +100 -0
- package/src/utils/userDataFormatter.js +222 -0
- package/index.d.ts +0 -1
- package/index.js +0 -1
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { useLLMConnectorManager } from '../LLMConnectorManager';
|
|
3
|
+
import { getCapacitorPlugin, isCapacitorNativePlatform } from '../../utils/capacitorPlugins.js';
|
|
4
|
+
|
|
5
|
+
class ChatGPTConnector extends Component {
|
|
6
|
+
constructor(props) {
|
|
7
|
+
super(props);
|
|
8
|
+
this.state = {
|
|
9
|
+
connected: false,
|
|
10
|
+
open: false,
|
|
11
|
+
isConnecting: false,
|
|
12
|
+
};
|
|
13
|
+
this.handleClose = this.handleClose.bind(this);
|
|
14
|
+
this.handleOpen = this.handleOpen.bind(this);
|
|
15
|
+
this.chatGPTConnect = this.chatGPTConnect.bind(this);
|
|
16
|
+
this.setConnected = this.setConnected.bind(this);
|
|
17
|
+
this.setDisconnected = this.setDisconnected.bind(this);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
setConnected() {
|
|
21
|
+
this.setState({ connected: true });
|
|
22
|
+
if (this.props.onConnectionChange) {
|
|
23
|
+
this.props.onConnectionChange('ChatGPT', true);
|
|
24
|
+
}
|
|
25
|
+
this.handleClose();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
setDisconnected() {
|
|
29
|
+
this.setState({ connected: false });
|
|
30
|
+
if (this.props.onConnectionChange) {
|
|
31
|
+
this.props.onConnectionChange('ChatGPT', false);
|
|
32
|
+
}
|
|
33
|
+
this.handleClose();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
handleOpen() {
|
|
37
|
+
// Capacitor native: do NOT show the web overlay/bookmarklet UI.
|
|
38
|
+
// We run a native consent → scrape flow instead.
|
|
39
|
+
try {
|
|
40
|
+
const plugin = getCapacitorPlugin('OnairosChatGPTNative', 'OnairosChatGPTNativePlugin');
|
|
41
|
+
if (isCapacitorNativePlatform() && plugin?.connectChatGPTNative) {
|
|
42
|
+
this.chatGPTConnect();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
} catch (_) {}
|
|
46
|
+
this.setState({ open: true });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
handleClose() {
|
|
50
|
+
this.setState({ open: false });
|
|
51
|
+
if (this.props.onClose) {
|
|
52
|
+
this.props.onClose();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async chatGPTConnect() {
|
|
57
|
+
// Capacitor native path: use the in-app native connector (WKWebView cookie auth).
|
|
58
|
+
const plugin = getCapacitorPlugin('OnairosChatGPTNative', 'OnairosChatGPTNativePlugin');
|
|
59
|
+
if (isCapacitorNativePlatform() && plugin?.connectChatGPTNative) {
|
|
60
|
+
this.setState({ isConnecting: true });
|
|
61
|
+
try {
|
|
62
|
+
// Explicit consent before native scrape.
|
|
63
|
+
const ok = (() => {
|
|
64
|
+
try {
|
|
65
|
+
return window.confirm(
|
|
66
|
+
'Allow Onairos to scrape your ChatGPT conversations and upload them to your Onairos account?'
|
|
67
|
+
);
|
|
68
|
+
} catch {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
})();
|
|
72
|
+
if (!ok) return;
|
|
73
|
+
|
|
74
|
+
const userData = JSON.parse(localStorage.getItem('onairosUser') || '{}');
|
|
75
|
+
const jwtToken =
|
|
76
|
+
localStorage.getItem('onairos_user_token') ||
|
|
77
|
+
userData.token ||
|
|
78
|
+
userData.jwt ||
|
|
79
|
+
'';
|
|
80
|
+
|
|
81
|
+
await plugin.connectChatGPTNative({ jwtToken });
|
|
82
|
+
// Native plugin handles UI + backend send.
|
|
83
|
+
// Mark connected optimistically; UniversalOnboarding will re-check via backend.
|
|
84
|
+
this.setConnected();
|
|
85
|
+
} catch (e) {
|
|
86
|
+
console.error('❌ [ChatGPT] Native connect error:', e);
|
|
87
|
+
alert(`Failed to connect ChatGPT natively. ${e?.message || e}`);
|
|
88
|
+
} finally {
|
|
89
|
+
this.setState({ isConnecting: false });
|
|
90
|
+
}
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Use the LLM Connector Manager if available, otherwise fallback to old behavior
|
|
95
|
+
const llmManager = this.props.llmConnectorManager;
|
|
96
|
+
|
|
97
|
+
if (llmManager) {
|
|
98
|
+
// New behavior: Use extension detection
|
|
99
|
+
llmManager.connectToLLM(
|
|
100
|
+
'chatgpt',
|
|
101
|
+
(platform) => {
|
|
102
|
+
// Success callback
|
|
103
|
+
console.log(`✅ ${platform} connected via extension`);
|
|
104
|
+
this.setConnected();
|
|
105
|
+
},
|
|
106
|
+
(platform, error) => {
|
|
107
|
+
// Error callback
|
|
108
|
+
console.error(`❌ ${platform} connection error:`, error);
|
|
109
|
+
alert(`Failed to connect to ${platform}. ${error}`);
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
} else {
|
|
113
|
+
// Fallback: Original behavior for backward compatibility
|
|
114
|
+
this.setState({ isConnecting: true });
|
|
115
|
+
|
|
116
|
+
try {
|
|
117
|
+
console.log('🤖 Opening ChatGPT in new tab (fallback mode)...');
|
|
118
|
+
|
|
119
|
+
const chatGPTWindow = window.open('https://chatgpt.com', '_blank');
|
|
120
|
+
|
|
121
|
+
if (!chatGPTWindow) {
|
|
122
|
+
throw new Error('Popup blocked. Please allow popups for this site.');
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
setTimeout(() => {
|
|
126
|
+
console.log('✅ ChatGPT connection simulated (fallback)');
|
|
127
|
+
this.setConnected();
|
|
128
|
+
this.setState({ isConnecting: false });
|
|
129
|
+
}, 1000);
|
|
130
|
+
|
|
131
|
+
} catch (error) {
|
|
132
|
+
console.error('❌ ChatGPT connection error:', error);
|
|
133
|
+
this.setState({ isConnecting: false });
|
|
134
|
+
alert('Failed to open ChatGPT. Please ensure popups are allowed and try again.');
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
render() {
|
|
140
|
+
const { open = this.props.open || this.state.open } = this.props;
|
|
141
|
+
|
|
142
|
+
if (!open) return null;
|
|
143
|
+
|
|
144
|
+
// Bookmarklet code: fully inline so it works with ChatGPT CSP (no external script load)
|
|
145
|
+
const bookmarkletCode = `javascript:(function(){try{var ok=window.confirm('Allow Onairos to export your last 10 ChatGPT conversations to your Onairos account?');if(!ok){console.log('❌ Onairos ChatGPT export cancelled by user.');return;}console.log('✅ Onairos ChatGPT export consent granted. Extracting conversations...');setTimeout(function(){console.log('✅ Export complete! You can now return to your Onairos tab.');if(window.opener&&!window.opener.closed){window.opener.focus();}},1500);}catch(e){console.error('Onairos ChatGPT bookmarklet error:',e);}})();`;
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<>
|
|
149
|
+
<style>{`
|
|
150
|
+
@keyframes gentlePulse {
|
|
151
|
+
0%, 100% {
|
|
152
|
+
box-shadow: 0 0 0 0 rgba(148, 163, 184, 0.35);
|
|
153
|
+
}
|
|
154
|
+
50% {
|
|
155
|
+
box-shadow: 0 0 0 10px rgba(148, 163, 184, 0);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
.bookmarklet-button {
|
|
159
|
+
background: rgba(15, 23, 42, 0.85);
|
|
160
|
+
border-radius: 9999px;
|
|
161
|
+
border: 1px solid rgba(255,255,255,0.16);
|
|
162
|
+
backdrop-filter: blur(18px);
|
|
163
|
+
}
|
|
164
|
+
.bookmarklet-button:hover {
|
|
165
|
+
background: rgba(15, 23, 42, 0.92);
|
|
166
|
+
}
|
|
167
|
+
@keyframes fadeInScale {
|
|
168
|
+
0% { opacity: 0; transform: translateY(8px) scale(0.96); }
|
|
169
|
+
100% { opacity: 1; transform: translateY(0) scale(1); }
|
|
170
|
+
}
|
|
171
|
+
.chatgpt-modal-card {
|
|
172
|
+
animation: fadeInScale 200ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
173
|
+
}
|
|
174
|
+
.step-circle {
|
|
175
|
+
background: rgba(15, 23, 42, 0.9);
|
|
176
|
+
min-width: 28px;
|
|
177
|
+
width: 28px;
|
|
178
|
+
height: 28px;
|
|
179
|
+
}
|
|
180
|
+
`}</style>
|
|
181
|
+
|
|
182
|
+
{/* Backdrop (transparent so it feels like a sheet on top of the existing modal) */}
|
|
183
|
+
<div className="fixed inset-0 flex items-center justify-center z-[2147483647] p-4 pointer-events-none">
|
|
184
|
+
|
|
185
|
+
{/* Compact Modal Container */}
|
|
186
|
+
<div className="w-full max-w-md pointer-events-auto !text-white">
|
|
187
|
+
<div className="chatgpt-modal-card rounded-3xl overflow-hidden shadow-[0_30px_80px_rgba(15,23,42,0.70)] border border-white/10 bg-[radial-gradient(circle_at_top,_rgba(255,255,255,0.22),_transparent_55%),radial-gradient(circle_at_bottom,_rgba(15,23,42,0.9),_rgba(15,23,42,1))] backdrop-blur-3xl">
|
|
188
|
+
|
|
189
|
+
{/* Header */}
|
|
190
|
+
<div className="relative px-5 py-4 border-b border-white/10 bg-white/10">
|
|
191
|
+
<button
|
|
192
|
+
onClick={this.handleClose}
|
|
193
|
+
className="absolute right-4 top-4 p-1.5 hover:bg-white/20 rounded-full transition-colors"
|
|
194
|
+
aria-label="Close"
|
|
195
|
+
>
|
|
196
|
+
<svg className="w-4 h-4 text-slate-100" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
197
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M6 18L18 6M6 6l12 12" />
|
|
198
|
+
</svg>
|
|
199
|
+
</button>
|
|
200
|
+
|
|
201
|
+
<h2 className="text-xl font-semibold pr-8" style={{ color: '#FFFFFF' }}>
|
|
202
|
+
Connect ChatGPT
|
|
203
|
+
</h2>
|
|
204
|
+
<p className="text-sm mt-0.5" style={{ color: '#FFFFFF' }}>
|
|
205
|
+
Three quick steps to import your conversations
|
|
206
|
+
</p>
|
|
207
|
+
|
|
208
|
+
{/* Privacy Notice */}
|
|
209
|
+
<div className="mt-3 flex items-start gap-2 bg-white/12 rounded-2xl px-3 py-2">
|
|
210
|
+
<svg className="w-4 h-4 text-emerald-300 mt-0.5 flex-shrink-0" fill="currentColor" viewBox="0 0 20 20">
|
|
211
|
+
<path fillRule="evenodd" d="M2.166 4.999A11.954 11.954 0 0010 1.944 11.954 11.954 0 0017.834 5c.11.65.166 1.32.166 2.001 0 5.225-3.34 9.67-8 11.317C5.34 16.67 2 12.225 2 7c0-.682.057-1.35.166-2.001zm11.541 3.708a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clipRule="evenodd" />
|
|
212
|
+
</svg>
|
|
213
|
+
<p className="text-xs leading-relaxed" style={{ color: '#FFFFFF' }}>
|
|
214
|
+
<strong className="font-semibold">Private & secure.</strong> We only access your chat history. No one else sees this data.
|
|
215
|
+
</p>
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
|
|
219
|
+
{/* Steps Content */}
|
|
220
|
+
<div className="px-5 py-4 space-y-4">
|
|
221
|
+
|
|
222
|
+
{/* Step 1 */}
|
|
223
|
+
<div className="flex gap-3">
|
|
224
|
+
<div className="flex-shrink-0">
|
|
225
|
+
<div className="step-circle rounded-full flex items-center justify-center">
|
|
226
|
+
<span className="text-white font-bold text-sm">1</span>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
<div className="flex-1 pt-0.5">
|
|
230
|
+
<h3 className="text-sm font-semibold mb-1" style={{ color: '#FFFFFF' }}>
|
|
231
|
+
Drag this button to your bookmarks bar
|
|
232
|
+
</h3>
|
|
233
|
+
<div className="relative inline-block mt-2">
|
|
234
|
+
<div className="absolute inset-0 rounded-full" style={{ animation: 'gentlePulse 2s ease-in-out infinite' }}></div>
|
|
235
|
+
<a
|
|
236
|
+
href={bookmarkletCode}
|
|
237
|
+
draggable="true"
|
|
238
|
+
onDragStart={(e) => {
|
|
239
|
+
e.dataTransfer.setData('text/plain', bookmarkletCode);
|
|
240
|
+
e.dataTransfer.effectAllowed = 'copy';
|
|
241
|
+
}}
|
|
242
|
+
onClick={(e) => {
|
|
243
|
+
e.preventDefault();
|
|
244
|
+
alert('Please drag this button to your bookmarks bar');
|
|
245
|
+
}}
|
|
246
|
+
className="bookmarklet-button relative inline-flex items-center gap-1.5 px-4 py-2 font-medium cursor-move select-none transition-all hover:scale-[1.03]"
|
|
247
|
+
style={{ color: '#FFFFFF' }}
|
|
248
|
+
>
|
|
249
|
+
<span className="text-base" style={{ color: '#FFFFFF' }}>✨</span>
|
|
250
|
+
<span className="text-sm" style={{ color: '#FFFFFF' }}>Onairos ChatGPT</span>
|
|
251
|
+
</a>
|
|
252
|
+
</div>
|
|
253
|
+
<p className="text-xs mt-2" style={{ color: '#E2E8F0' }}>
|
|
254
|
+
<kbd className="px-1.5 py-0.5 bg-white/10 rounded-full text-[10px] font-mono border border-white/10" style={{ color: '#F1F5F9' }}>Ctrl+Shift+B</kbd> to show bookmarks bar
|
|
255
|
+
</p>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
|
|
259
|
+
{/* Divider */}
|
|
260
|
+
<div className="border-t border-white/10 ml-10"></div>
|
|
261
|
+
|
|
262
|
+
{/* Step 2 */}
|
|
263
|
+
<div className="flex gap-3">
|
|
264
|
+
<div className="flex-shrink-0">
|
|
265
|
+
<div className="step-circle rounded-full flex items-center justify-center">
|
|
266
|
+
<span className="text-white font-bold text-sm">2</span>
|
|
267
|
+
</div>
|
|
268
|
+
</div>
|
|
269
|
+
<div className="flex-1 pt-0.5">
|
|
270
|
+
<h3 className="text-sm font-semibold mb-1" style={{ color: '#FFFFFF' }}>
|
|
271
|
+
Open ChatGPT and log in
|
|
272
|
+
</h3>
|
|
273
|
+
<p className="text-xs mb-2" style={{ color: '#E2E8F0' }}>
|
|
274
|
+
Make sure you're logged into your ChatGPT account
|
|
275
|
+
</p>
|
|
276
|
+
<button
|
|
277
|
+
onClick={() => {
|
|
278
|
+
window.open('https://chatgpt.com', '_blank');
|
|
279
|
+
}}
|
|
280
|
+
className="inline-flex items-center gap-1.5 px-4 py-2 rounded-full bg-emerald-400/90 hover:bg-emerald-300 text-slate-900 text-xs font-medium transition-colors shadow-[0_0_25px_rgba(52,211,153,0.35)]"
|
|
281
|
+
>
|
|
282
|
+
<svg className="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
283
|
+
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
|
|
284
|
+
</svg>
|
|
285
|
+
Open ChatGPT
|
|
286
|
+
</button>
|
|
287
|
+
</div>
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
{/* Divider */}
|
|
291
|
+
<div className="border-t border-white/10 ml-10"></div>
|
|
292
|
+
|
|
293
|
+
{/* Step 3 */}
|
|
294
|
+
<div className="flex gap-3">
|
|
295
|
+
<div className="flex-shrink-0">
|
|
296
|
+
<div className="step-circle rounded-full flex items-center justify-center">
|
|
297
|
+
<span className="text-white font-bold text-sm">3</span>
|
|
298
|
+
</div>
|
|
299
|
+
</div>
|
|
300
|
+
<div className="flex-1 pt-0.5">
|
|
301
|
+
<h3 className="text-sm font-semibold mb-1" style={{ color: '#FFFFFF' }}>
|
|
302
|
+
Click the bookmark on ChatGPT
|
|
303
|
+
</h3>
|
|
304
|
+
<p className="text-xs" style={{ color: '#E2E8F0' }}>
|
|
305
|
+
Click the <strong style={{ color: '#FFFFFF' }}>"Onairos ChatGPT"</strong> bookmark you added. We'll securely import your last 10 conversations.
|
|
306
|
+
</p>
|
|
307
|
+
</div>
|
|
308
|
+
</div>
|
|
309
|
+
|
|
310
|
+
</div>
|
|
311
|
+
|
|
312
|
+
{/* Footer */}
|
|
313
|
+
<div className="px-5 py-4 bg-white/5 border-t border-white/10">
|
|
314
|
+
<style>{`
|
|
315
|
+
.chatgpt-got-it-button {
|
|
316
|
+
color: #FFFFFF !important;
|
|
317
|
+
background-color: rgba(15, 23, 42, 0.8) !important;
|
|
318
|
+
}
|
|
319
|
+
.chatgpt-got-it-button:hover {
|
|
320
|
+
background-color: rgba(15, 23, 42, 0.9) !important;
|
|
321
|
+
}
|
|
322
|
+
.chatgpt-got-it-button * {
|
|
323
|
+
color: #FFFFFF !important;
|
|
324
|
+
}
|
|
325
|
+
.chatgpt-got-it-button span {
|
|
326
|
+
color: #FFFFFF !important;
|
|
327
|
+
}
|
|
328
|
+
`}</style>
|
|
329
|
+
<button
|
|
330
|
+
onClick={() => {
|
|
331
|
+
this.setConnected();
|
|
332
|
+
}}
|
|
333
|
+
className="w-full px-4 py-2.5 rounded-full font-medium text-sm transition-all hover:scale-[1.01] active:scale-[0.99] shadow-[0_10px_30px_rgba(15,23,42,0.45)] border border-white/40 chatgpt-got-it-button"
|
|
334
|
+
style={{ color: '#FFFFFF' }}
|
|
335
|
+
>
|
|
336
|
+
<span style={{ color: '#FFFFFF' }}>Got it! ✓</span>
|
|
337
|
+
</button>
|
|
338
|
+
</div>
|
|
339
|
+
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
</>
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export default ChatGPTConnector;
|