onairos 2.1.13 → 2.2.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/dist/onairos.bundle.js +1 -1
- package/dist/onairos.bundle.js.map +1 -1
- package/dist/onairos.esm.js +1 -1
- package/dist/onairos.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/DataRequest.js +189 -110
- package/src/onairosButton.jsx +1 -0
- package/src/overlay/CheckBox.jsx +83 -23
- package/src/overlay/IndividualConnection.js +145 -15
- package/src/overlay/IndividualConnectionNew.jsx +101 -22
- package/test-enhanced-data-request.html +271 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
4
|
export default function IndividualConnection({
|
|
@@ -13,35 +13,165 @@ export default function IndividualConnection({
|
|
|
13
13
|
onCheckboxChange,
|
|
14
14
|
}) {
|
|
15
15
|
return (
|
|
16
|
-
<div className=
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
<div className={`relative p-4 sm:p-6 rounded-lg overflow-hidden mb-4 transition-all duration-300 border-2 ${
|
|
17
|
+
!active
|
|
18
|
+
? 'bg-gray-50 border-gray-200 opacity-60'
|
|
19
|
+
: isChecked
|
|
20
|
+
? 'bg-green-50 border-green-400 shadow-lg transform scale-[1.02] ring-2 ring-green-200'
|
|
21
|
+
: 'bg-white border-gray-300 hover:border-blue-300 hover:shadow-md'
|
|
22
|
+
}`}>
|
|
23
|
+
|
|
24
|
+
{/* Selection Status Indicator */}
|
|
25
|
+
{isChecked && active && (
|
|
26
|
+
<div className="absolute top-2 right-2 w-8 h-8 bg-green-500 rounded-full flex items-center justify-center animate-pulse shadow-lg">
|
|
27
|
+
<svg className="w-5 h-5 text-white" fill="currentColor" viewBox="0 0 20 20">
|
|
28
|
+
<path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" />
|
|
29
|
+
</svg>
|
|
30
|
+
</div>
|
|
31
|
+
)}
|
|
32
|
+
|
|
33
|
+
<div className="relative">
|
|
34
|
+
{/* Header with title and status */}
|
|
35
|
+
<div className="flex items-center justify-between mb-4">
|
|
36
|
+
<div className="flex items-center space-x-4">
|
|
37
|
+
{/* Data type icon */}
|
|
38
|
+
<div className={`w-12 h-12 rounded-full flex items-center justify-center text-2xl transition-all duration-300 ${
|
|
39
|
+
!active
|
|
40
|
+
? 'bg-gray-200 text-gray-400'
|
|
41
|
+
: isChecked
|
|
42
|
+
? 'bg-green-500 text-white shadow-lg'
|
|
43
|
+
: 'bg-blue-500 text-white'
|
|
44
|
+
}`}>
|
|
45
|
+
{title === "Avatar" ? "👤" :
|
|
46
|
+
title === "Traits" ? "🧠" :
|
|
47
|
+
title === "Personality" ? "🎭" : "📊"}
|
|
48
|
+
</div>
|
|
49
|
+
|
|
20
50
|
<div>
|
|
51
|
+
<h3 className={`text-xl font-bold ${
|
|
52
|
+
!active ? 'text-gray-400' : isChecked ? 'text-green-700' : 'text-gray-800'
|
|
53
|
+
}`}>
|
|
54
|
+
{title === "Avatar" ? 'Avatar' :
|
|
55
|
+
title === "Traits" ? 'Personality Traits' :
|
|
56
|
+
title === "Personality" ? 'Personality Model' :
|
|
57
|
+
title}
|
|
58
|
+
</h3>
|
|
59
|
+
|
|
60
|
+
{/* Status badge */}
|
|
61
|
+
<div className={`inline-flex items-center px-3 py-1 rounded-full text-sm font-semibold ${
|
|
62
|
+
!active
|
|
63
|
+
? 'bg-red-100 text-red-700'
|
|
64
|
+
: isChecked
|
|
65
|
+
? 'bg-green-100 text-green-700'
|
|
66
|
+
: 'bg-blue-100 text-blue-700'
|
|
67
|
+
}`}>
|
|
68
|
+
{!active ? '❌ Not Available' : isChecked ? '✅ SELECTED' : '⏳ Available'}
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
{/* Enhanced Checkbox */}
|
|
75
|
+
<div className="flex items-center justify-center mb-4">
|
|
76
|
+
<label className="flex items-center cursor-pointer">
|
|
77
|
+
<div className="relative">
|
|
21
78
|
<input
|
|
22
|
-
disabled={!active}
|
|
23
79
|
type="checkbox"
|
|
24
80
|
checked={isChecked}
|
|
81
|
+
disabled={!active}
|
|
25
82
|
onChange={(e) => onCheckboxChange(e.target.checked)}
|
|
83
|
+
className="sr-only" // Hide default checkbox
|
|
26
84
|
/>
|
|
85
|
+
|
|
86
|
+
{/* Custom checkbox appearance */}
|
|
87
|
+
<div className={`
|
|
88
|
+
w-8 h-8 border-3 rounded-lg flex items-center justify-center transition-all duration-200
|
|
89
|
+
${!active
|
|
90
|
+
? 'border-gray-300 bg-gray-100 cursor-not-allowed opacity-50'
|
|
91
|
+
: isChecked
|
|
92
|
+
? 'border-green-500 bg-green-500 shadow-xl transform scale-110'
|
|
93
|
+
: 'border-gray-400 bg-white hover:border-green-400 hover:bg-green-50 hover:scale-105'
|
|
94
|
+
}
|
|
95
|
+
`}>
|
|
96
|
+
{/* Checkmark icon */}
|
|
97
|
+
{isChecked && (
|
|
98
|
+
<svg
|
|
99
|
+
className="w-6 h-6 text-white animate-bounce"
|
|
100
|
+
fill="currentColor"
|
|
101
|
+
viewBox="0 0 20 20"
|
|
102
|
+
>
|
|
103
|
+
<path
|
|
104
|
+
fillRule="evenodd"
|
|
105
|
+
d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"
|
|
106
|
+
clipRule="evenodd"
|
|
107
|
+
/>
|
|
108
|
+
</svg>
|
|
109
|
+
)}
|
|
110
|
+
</div>
|
|
27
111
|
</div>
|
|
28
|
-
|
|
112
|
+
|
|
113
|
+
{/* Selection status text */}
|
|
114
|
+
<span className={`ml-4 text-lg font-bold transition-colors duration-200 ${
|
|
115
|
+
!active
|
|
116
|
+
? 'text-gray-400'
|
|
117
|
+
: isChecked
|
|
118
|
+
? 'text-green-600'
|
|
119
|
+
: 'text-gray-700'
|
|
120
|
+
}`}>
|
|
121
|
+
{!active
|
|
122
|
+
? 'Not available'
|
|
123
|
+
: isChecked
|
|
124
|
+
? '✓ SELECTED FOR SHARING'
|
|
125
|
+
: 'Click to select'
|
|
126
|
+
}
|
|
127
|
+
</span>
|
|
128
|
+
</label>
|
|
29
129
|
</div>
|
|
30
130
|
|
|
31
|
-
|
|
32
|
-
|
|
131
|
+
{/* Status message for disabled items */}
|
|
132
|
+
<div className="flex items-center justify-center mb-4">
|
|
133
|
+
{!active && (
|
|
134
|
+
<div className="flex items-center space-x-2 text-sm text-red-700 bg-red-100 px-4 py-3 rounded-lg border-2 border-red-300">
|
|
135
|
+
<svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
|
136
|
+
<path fillRule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clipRule="evenodd" />
|
|
137
|
+
</svg>
|
|
138
|
+
<span className="font-bold">
|
|
139
|
+
{`No ${title} data available to share`}
|
|
140
|
+
</span>
|
|
141
|
+
</div>
|
|
142
|
+
)}
|
|
143
|
+
|
|
144
|
+
{isChecked && active && (
|
|
145
|
+
<div className="flex items-center space-x-2 text-sm text-green-700 bg-green-100 px-4 py-3 rounded-lg border-2 border-green-300 animate-pulse">
|
|
146
|
+
<svg className="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
|
|
147
|
+
<path fillRule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 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" />
|
|
148
|
+
</svg>
|
|
149
|
+
<span className="font-bold">
|
|
150
|
+
THIS DATA WILL BE SHARED
|
|
151
|
+
</span>
|
|
152
|
+
</div>
|
|
153
|
+
)}
|
|
33
154
|
</div>
|
|
34
155
|
|
|
156
|
+
{/* Description and rewards with enhanced styling */}
|
|
35
157
|
{descriptions && title !== "Avatar" && (
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
158
|
+
<div className="mb-3 p-3 bg-blue-50 rounded-lg border border-blue-200">
|
|
159
|
+
<p className={`text-sm font-semibold ${
|
|
160
|
+
!active ? 'text-gray-400' : 'text-blue-800'
|
|
161
|
+
}`}>
|
|
162
|
+
<span className="text-blue-600">🎯 Intent:</span> {descriptions}
|
|
163
|
+
</p>
|
|
164
|
+
</div>
|
|
39
165
|
)}
|
|
40
166
|
|
|
41
167
|
{rewards && (
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
168
|
+
<div className="mb-3 p-3 bg-yellow-50 rounded-lg border border-yellow-200">
|
|
169
|
+
<p className={`text-sm font-semibold ${
|
|
170
|
+
!active ? 'text-gray-400' : 'text-yellow-800'
|
|
171
|
+
}`}>
|
|
172
|
+
<span className="text-yellow-600">🎁 Rewards:</span> {rewards}
|
|
173
|
+
</p>
|
|
174
|
+
</div>
|
|
45
175
|
)}
|
|
46
176
|
</div>
|
|
47
177
|
</div>
|
|
@@ -11,20 +11,76 @@ function IndividualConnection(props) {
|
|
|
11
11
|
'Persona';
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
|
-
<div className={`relative p-4 sm:p-6 rounded-
|
|
15
|
-
isDisabled
|
|
14
|
+
<div className={`relative p-4 sm:p-6 rounded-lg overflow-hidden mb-4 transition-all duration-300 border-2 ${
|
|
15
|
+
isDisabled
|
|
16
|
+
? 'bg-gray-50 border-gray-200 opacity-60'
|
|
17
|
+
: selected
|
|
18
|
+
? 'bg-green-50 border-green-400 shadow-lg transform scale-[1.02]'
|
|
19
|
+
: 'bg-white border-gray-300 hover:border-blue-300 hover:shadow-md'
|
|
16
20
|
}`}>
|
|
21
|
+
|
|
22
|
+
{/* Selection Status Indicator */}
|
|
23
|
+
{selected && !isDisabled && (
|
|
24
|
+
<div className="absolute top-2 right-2 w-6 h-6 bg-green-500 rounded-full flex items-center justify-center animate-pulse">
|
|
25
|
+
<svg className="w-4 h-4 text-white" fill="currentColor" viewBox="0 0 20 20">
|
|
26
|
+
<path fillRule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clipRule="evenodd" />
|
|
27
|
+
</svg>
|
|
28
|
+
</div>
|
|
29
|
+
)}
|
|
30
|
+
|
|
17
31
|
<div className="relative">
|
|
18
|
-
|
|
32
|
+
{/* Header with title and status */}
|
|
33
|
+
<div className="flex items-center justify-between mb-4">
|
|
34
|
+
<div className="flex items-center space-x-3">
|
|
35
|
+
{/* Data type icon */}
|
|
36
|
+
<div className={`w-10 h-10 rounded-full flex items-center justify-center text-xl ${
|
|
37
|
+
isDisabled
|
|
38
|
+
? 'bg-gray-200 text-gray-400'
|
|
39
|
+
: selected
|
|
40
|
+
? 'bg-green-500 text-white'
|
|
41
|
+
: 'bg-blue-500 text-white'
|
|
42
|
+
}`}>
|
|
43
|
+
{props.title === "Avatar" ? "👤" :
|
|
44
|
+
props.title === "Traits" ? "🧠" :
|
|
45
|
+
props.title === "Personality" ? "🎭" : "📊"}
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<div>
|
|
49
|
+
<h3 className={`text-lg font-semibold ${
|
|
50
|
+
isDisabled ? 'text-gray-400' : selected ? 'text-green-700' : 'text-gray-800'
|
|
51
|
+
}`}>
|
|
52
|
+
{Insight}
|
|
53
|
+
</h3>
|
|
54
|
+
|
|
55
|
+
{/* Status badge */}
|
|
56
|
+
<div className={`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium ${
|
|
57
|
+
isDisabled
|
|
58
|
+
? 'bg-red-100 text-red-600'
|
|
59
|
+
: selected
|
|
60
|
+
? 'bg-green-100 text-green-700'
|
|
61
|
+
: 'bg-blue-100 text-blue-700'
|
|
62
|
+
}`}>
|
|
63
|
+
{isDisabled ? '❌ Not Available' : selected ? '✅ Selected' : '⏳ Available'}
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
{/* Checkbox with enhanced styling */}
|
|
70
|
+
<div className="flex items-center justify-center mb-4">
|
|
19
71
|
<Box
|
|
20
72
|
active={props.active}
|
|
21
73
|
onSelectionChange={(isSelected) => {
|
|
22
74
|
setSelected(isSelected);
|
|
23
|
-
props.onSelectionChange
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
75
|
+
if (props.onSelectionChange) {
|
|
76
|
+
props.onSelectionChange(isSelected);
|
|
77
|
+
}
|
|
78
|
+
if (props.changeGranted) {
|
|
79
|
+
if (isSelected) {
|
|
80
|
+
props.changeGranted(1);
|
|
81
|
+
} else {
|
|
82
|
+
props.changeGranted(-1);
|
|
83
|
+
}
|
|
28
84
|
}
|
|
29
85
|
}}
|
|
30
86
|
disabled={isDisabled}
|
|
@@ -32,31 +88,54 @@ function IndividualConnection(props) {
|
|
|
32
88
|
number={props.number + 1}
|
|
33
89
|
type="Test"
|
|
34
90
|
title={props.title}
|
|
91
|
+
changeGranted={props.changeGranted}
|
|
35
92
|
/>
|
|
36
93
|
</div>
|
|
37
94
|
|
|
38
|
-
|
|
95
|
+
{/* Status message for disabled items */}
|
|
96
|
+
<div className="flex items-center justify-center mb-3">
|
|
39
97
|
{isDisabled && (
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
98
|
+
<div className="flex items-center space-x-2 text-sm text-red-600 bg-red-50 px-3 py-2 rounded-lg border border-red-200">
|
|
99
|
+
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
|
|
100
|
+
<path fillRule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clipRule="evenodd" />
|
|
101
|
+
</svg>
|
|
102
|
+
<span className="font-medium">
|
|
103
|
+
{`No ${props.title} data available to share`}
|
|
104
|
+
</span>
|
|
105
|
+
</div>
|
|
106
|
+
)}
|
|
107
|
+
|
|
108
|
+
{selected && !isDisabled && (
|
|
109
|
+
<div className="flex items-center space-x-2 text-sm text-green-600 bg-green-50 px-3 py-2 rounded-lg border border-green-200">
|
|
110
|
+
<svg className="w-4 h-4" fill="currentColor" viewBox="0 0 20 20">
|
|
111
|
+
<path fillRule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 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" />
|
|
112
|
+
</svg>
|
|
113
|
+
<span className="font-medium">
|
|
114
|
+
This data will be shared
|
|
115
|
+
</span>
|
|
116
|
+
</div>
|
|
43
117
|
)}
|
|
44
118
|
</div>
|
|
45
119
|
|
|
120
|
+
{/* Description and rewards */}
|
|
46
121
|
{props.descriptions && props.title !== "Avatar" && (
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
122
|
+
<div className="mb-2">
|
|
123
|
+
<p className={`text-sm font-medium ${
|
|
124
|
+
isDisabled ? 'text-gray-400' : 'text-gray-700'
|
|
125
|
+
}`}>
|
|
126
|
+
<span className="text-blue-600 font-semibold">Intent:</span> {props.descriptions}
|
|
127
|
+
</p>
|
|
128
|
+
</div>
|
|
52
129
|
)}
|
|
53
130
|
|
|
54
131
|
{props.rewards && (
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
132
|
+
<div className="mb-2">
|
|
133
|
+
<p className={`text-sm font-medium ${
|
|
134
|
+
isDisabled ? 'text-gray-400' : 'text-gray-700'
|
|
135
|
+
}`}>
|
|
136
|
+
<span className="text-green-600 font-semibold">Rewards:</span> {props.rewards}
|
|
137
|
+
</p>
|
|
138
|
+
</div>
|
|
60
139
|
)}
|
|
61
140
|
</div>
|
|
62
141
|
</div>
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Enhanced Data Request Test - Onairos v2.2.0</title>
|
|
7
|
+
<script src="https://unpkg.com/react@18/umd/react.development.js"></script>
|
|
8
|
+
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
|
|
9
|
+
<script src="https://cdn.tailwindcss.com"></script>
|
|
10
|
+
<style>
|
|
11
|
+
body {
|
|
12
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding: 20px;
|
|
15
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
16
|
+
min-height: 100vh;
|
|
17
|
+
}
|
|
18
|
+
.demo-container {
|
|
19
|
+
max-width: 1200px;
|
|
20
|
+
margin: 0 auto;
|
|
21
|
+
background: white;
|
|
22
|
+
border-radius: 16px;
|
|
23
|
+
padding: 20px;
|
|
24
|
+
box-shadow: 0 8px 32px rgba(0,0,0,0.2);
|
|
25
|
+
}
|
|
26
|
+
.feature-badge {
|
|
27
|
+
display: inline-block;
|
|
28
|
+
padding: 4px 8px;
|
|
29
|
+
background: #10b981;
|
|
30
|
+
color: white;
|
|
31
|
+
font-size: 10px;
|
|
32
|
+
border-radius: 12px;
|
|
33
|
+
margin: 2px;
|
|
34
|
+
}
|
|
35
|
+
.version-banner {
|
|
36
|
+
background: linear-gradient(45deg, #667eea, #764ba2);
|
|
37
|
+
color: white;
|
|
38
|
+
text-align: center;
|
|
39
|
+
padding: 15px;
|
|
40
|
+
border-radius: 12px;
|
|
41
|
+
margin-bottom: 20px;
|
|
42
|
+
}
|
|
43
|
+
.demo-grid {
|
|
44
|
+
display: grid;
|
|
45
|
+
grid-template-columns: 1fr 1fr;
|
|
46
|
+
gap: 20px;
|
|
47
|
+
align-items: start;
|
|
48
|
+
}
|
|
49
|
+
.features-list {
|
|
50
|
+
background: #f8fafc;
|
|
51
|
+
padding: 20px;
|
|
52
|
+
border-radius: 12px;
|
|
53
|
+
border: 2px solid #e2e8f0;
|
|
54
|
+
}
|
|
55
|
+
@media (max-width: 768px) {
|
|
56
|
+
.demo-grid {
|
|
57
|
+
grid-template-columns: 1fr;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
</style>
|
|
61
|
+
</head>
|
|
62
|
+
<body>
|
|
63
|
+
<div class="demo-container">
|
|
64
|
+
<div class="version-banner">
|
|
65
|
+
<h1 class="text-2xl font-bold mb-2">🎉 Onairos SDK v2.2.0 - Enhanced Data Request</h1>
|
|
66
|
+
<p class="opacity-90">Complete overhaul of the DataRequest component with platform connectors and enhanced UX</p>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div class="demo-grid">
|
|
70
|
+
<!-- Live Demo -->
|
|
71
|
+
<div>
|
|
72
|
+
<h2 class="text-xl font-bold mb-4 text-center">📊 Live Demo</h2>
|
|
73
|
+
<div id="data-request-demo" class="flex justify-center"></div>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<!-- Features Overview -->
|
|
77
|
+
<div class="features-list">
|
|
78
|
+
<h3 class="text-lg font-bold mb-4">✨ New Features Implemented</h3>
|
|
79
|
+
|
|
80
|
+
<div class="mb-4">
|
|
81
|
+
<h4 class="font-semibold text-green-700 mb-2">🔌 Platform Connectors</h4>
|
|
82
|
+
<div class="text-sm text-gray-700 mb-2">
|
|
83
|
+
✅ Correct icons (📺 YouTube, 💼 LinkedIn, 🔥 Reddit, etc.)<br>
|
|
84
|
+
✅ Visual connection status (connected/not connected)<br>
|
|
85
|
+
✅ Selection feedback (green checkmark when selected)<br>
|
|
86
|
+
✅ Click to select/deselect connected platforms
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<div class="mb-4">
|
|
91
|
+
<h4 class="font-semibold text-blue-700 mb-2">🔒 Auto-Selected Basic Profile</h4>
|
|
92
|
+
<div class="text-sm text-gray-700 mb-2">
|
|
93
|
+
✅ Basic Info is automatically selected<br>
|
|
94
|
+
✅ Cannot be deselected (grayed out)<br>
|
|
95
|
+
✅ Marked as "Required" with visual indicator<br>
|
|
96
|
+
✅ Essential for all data requests
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div class="mb-4">
|
|
101
|
+
<h4 class="font-semibold text-purple-700 mb-2">💡 Enhanced Tooltips</h4>
|
|
102
|
+
<div class="text-sm text-gray-700 mb-2">
|
|
103
|
+
✅ Underlined titles with hover tooltips<br>
|
|
104
|
+
✅ Detailed explanations for each data type<br>
|
|
105
|
+
✅ Privacy links for transparency<br>
|
|
106
|
+
✅ "Learn more about privacy →" links
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<div class="mb-4">
|
|
111
|
+
<h4 class="font-semibold text-orange-700 mb-2">🎨 Visual Feedback</h4>
|
|
112
|
+
<div class="text-sm text-gray-700 mb-2">
|
|
113
|
+
✅ Green borders for selected connectors<br>
|
|
114
|
+
✅ Checkmarks for selected platforms<br>
|
|
115
|
+
✅ Status messages ("Selected", "Tap to select")<br>
|
|
116
|
+
✅ Warning when no platforms connected
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
<div class="mb-4">
|
|
121
|
+
<h4 class="font-semibold text-indigo-700 mb-2">🔄 Smart Flow Integration</h4>
|
|
122
|
+
<div class="text-sm text-gray-700">
|
|
123
|
+
✅ Receives connected accounts from onboarding<br>
|
|
124
|
+
✅ Shows only platforms connected in previous steps<br>
|
|
125
|
+
✅ Passes selection to backend for processing<br>
|
|
126
|
+
✅ Enhanced data request payload
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<div class="mt-6 p-3 bg-blue-50 border border-blue-200 rounded-lg">
|
|
131
|
+
<p class="text-blue-800 text-sm font-medium">
|
|
132
|
+
💡 Hover over underlined titles in the demo to see tooltips!
|
|
133
|
+
</p>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<!-- Usage Instructions -->
|
|
139
|
+
<div class="mt-8 p-4 bg-gray-50 border border-gray-200 rounded-lg">
|
|
140
|
+
<h3 class="font-bold mb-3">📋 What to Test</h3>
|
|
141
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-sm">
|
|
142
|
+
<div>
|
|
143
|
+
<h4 class="font-semibold text-gray-900 mb-2">Data Types Section:</h4>
|
|
144
|
+
<ul class="list-disc list-inside space-y-1 text-gray-700">
|
|
145
|
+
<li>Hover over underlined titles to see tooltips</li>
|
|
146
|
+
<li>Notice "Basic Info" is auto-selected and grayed out</li>
|
|
147
|
+
<li>Toggle "Personality" and "Preferences"</li>
|
|
148
|
+
<li>Click privacy links in tooltips</li>
|
|
149
|
+
</ul>
|
|
150
|
+
</div>
|
|
151
|
+
<div>
|
|
152
|
+
<h4 class="font-semibold text-gray-900 mb-2">Data Connectors Section:</h4>
|
|
153
|
+
<ul class="list-disc list-inside space-y-1 text-gray-700">
|
|
154
|
+
<li>Click connected platforms to select them</li>
|
|
155
|
+
<li>See visual feedback (green borders, checkmarks)</li>
|
|
156
|
+
<li>Notice disabled state for unconnected platforms</li>
|
|
157
|
+
<li>Check selection count in summary</li>
|
|
158
|
+
</ul>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<!-- Load the enhanced Onairos SDK -->
|
|
165
|
+
<script src="./dist/onairos.bundle.js"></script>
|
|
166
|
+
|
|
167
|
+
<script>
|
|
168
|
+
// Simulate connected accounts for demo
|
|
169
|
+
const mockConnectedAccounts = {
|
|
170
|
+
'YouTube': true,
|
|
171
|
+
'LinkedIn': true,
|
|
172
|
+
'Reddit': true,
|
|
173
|
+
'Instagram': false,
|
|
174
|
+
'Pinterest': false,
|
|
175
|
+
'GitHub': false,
|
|
176
|
+
'Facebook': false,
|
|
177
|
+
'Gmail': true
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
if (typeof window.Onairos !== 'undefined' && window.Onairos.OnairosButton) {
|
|
181
|
+
console.log('🎯 Onairos SDK v2.2.0 loaded successfully');
|
|
182
|
+
|
|
183
|
+
// Access DataRequest component directly for testing
|
|
184
|
+
// In real usage, this would be accessed through the OnairosButton flow
|
|
185
|
+
|
|
186
|
+
// For this demo, we'll simulate the full OnairosButton with skipToDataRequest
|
|
187
|
+
const { OnairosButton, initializeApiKey } = window.Onairos;
|
|
188
|
+
|
|
189
|
+
function handleComplete(result) {
|
|
190
|
+
console.log('✅ Data request completed:', result);
|
|
191
|
+
|
|
192
|
+
const summary = [
|
|
193
|
+
`Data types: ${result.approvedData?.join(', ') || 'None'}`,
|
|
194
|
+
`Connectors: ${result.selectedConnectors?.join(', ') || 'None'}`,
|
|
195
|
+
`Total selections: ${(result.approvedData?.length || 0) + (result.selectedConnectors?.length || 0)}`
|
|
196
|
+
];
|
|
197
|
+
|
|
198
|
+
alert(`Data Request Completed!\n\n${summary.join('\n')}\n\nCheck console for full details.`);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Initialize SDK
|
|
202
|
+
initializeApiKey({
|
|
203
|
+
apiKey: 'onairos_web_sdk_live_key_2024',
|
|
204
|
+
environment: 'development',
|
|
205
|
+
enableLogging: true
|
|
206
|
+
}).then(() => {
|
|
207
|
+
console.log('🔧 SDK initialized');
|
|
208
|
+
|
|
209
|
+
// For demo purposes, we'll create a custom component that shows DataRequest directly
|
|
210
|
+
const DataRequestDemo = () => {
|
|
211
|
+
// Mock user data with connected accounts
|
|
212
|
+
const mockUserData = {
|
|
213
|
+
email: 'demo@onairos.uk',
|
|
214
|
+
connectedAccounts: mockConnectedAccounts,
|
|
215
|
+
verified: true
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
// Get DataRequest component (we'll need to import it directly)
|
|
219
|
+
// For now, let's use the OnairosButton but force it to show DataRequest
|
|
220
|
+
return React.createElement('div', {
|
|
221
|
+
className: 'bg-white p-4 rounded-lg shadow-lg',
|
|
222
|
+
style: { minHeight: '500px' }
|
|
223
|
+
}, [
|
|
224
|
+
React.createElement('div', {
|
|
225
|
+
key: 'header',
|
|
226
|
+
className: 'text-center mb-4'
|
|
227
|
+
}, [
|
|
228
|
+
React.createElement('h3', {
|
|
229
|
+
key: 'title',
|
|
230
|
+
className: 'font-bold text-gray-900'
|
|
231
|
+
}, 'Enhanced DataRequest Component'),
|
|
232
|
+
React.createElement('p', {
|
|
233
|
+
key: 'subtitle',
|
|
234
|
+
className: 'text-sm text-gray-600'
|
|
235
|
+
}, 'Simulated with connected platforms: YouTube, LinkedIn, Reddit, Gmail')
|
|
236
|
+
]),
|
|
237
|
+
React.createElement('div', {
|
|
238
|
+
key: 'notice',
|
|
239
|
+
className: 'p-3 bg-blue-50 border border-blue-200 rounded-lg text-center'
|
|
240
|
+
}, [
|
|
241
|
+
React.createElement('p', {
|
|
242
|
+
key: 'text',
|
|
243
|
+
className: 'text-blue-800 text-sm'
|
|
244
|
+
}, '🚧 Direct DataRequest demo would require component extraction.'),
|
|
245
|
+
React.createElement('p', {
|
|
246
|
+
key: 'instruction',
|
|
247
|
+
className: 'text-blue-700 text-xs mt-1'
|
|
248
|
+
}, 'Use the full OnairosButton flow to see the enhanced DataRequest in action.')
|
|
249
|
+
])
|
|
250
|
+
]);
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
ReactDOM.render(React.createElement(DataRequestDemo), document.getElementById('data-request-demo'));
|
|
254
|
+
|
|
255
|
+
console.log('🚀 Enhanced DataRequest demo ready');
|
|
256
|
+
console.log('📊 Mock connected accounts:', mockConnectedAccounts);
|
|
257
|
+
|
|
258
|
+
}).catch(error => {
|
|
259
|
+
console.error('❌ SDK initialization failed:', error);
|
|
260
|
+
document.getElementById('data-request-demo').innerHTML =
|
|
261
|
+
`<div class="text-red-600 text-center p-4">SDK initialization failed: ${error.message}</div>`;
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
} else {
|
|
265
|
+
console.error('❌ Onairos SDK not found');
|
|
266
|
+
document.getElementById('data-request-demo').innerHTML =
|
|
267
|
+
'<div class="text-red-600 text-center p-4">Onairos SDK not found</div>';
|
|
268
|
+
}
|
|
269
|
+
</script>
|
|
270
|
+
</body>
|
|
271
|
+
</html>
|