@ateam-ai-mobile/ui 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +63 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +73 -38
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/chat/JobProgressBar.tsx +57 -28
- package/src/chat/MessageBubble.tsx +26 -4
package/dist/index.d.mts
CHANGED
|
@@ -41,8 +41,11 @@ declare function TypingIndicator(): react_jsx_runtime.JSX.Element;
|
|
|
41
41
|
|
|
42
42
|
interface Props$6 {
|
|
43
43
|
progress: JobProgress;
|
|
44
|
+
/** Standalone placeholder (transparent bubble) — drop the top divider so it
|
|
45
|
+
* floats cleanly over the background. */
|
|
46
|
+
standalone?: boolean;
|
|
44
47
|
}
|
|
45
|
-
declare function JobProgressBar({ progress }: Props$6): react_jsx_runtime.JSX.Element;
|
|
48
|
+
declare function JobProgressBar({ progress, standalone }: Props$6): react_jsx_runtime.JSX.Element;
|
|
46
49
|
|
|
47
50
|
interface Props$5 {
|
|
48
51
|
columns: string[];
|
package/dist/index.d.ts
CHANGED
|
@@ -41,8 +41,11 @@ declare function TypingIndicator(): react_jsx_runtime.JSX.Element;
|
|
|
41
41
|
|
|
42
42
|
interface Props$6 {
|
|
43
43
|
progress: JobProgress;
|
|
44
|
+
/** Standalone placeholder (transparent bubble) — drop the top divider so it
|
|
45
|
+
* floats cleanly over the background. */
|
|
46
|
+
standalone?: boolean;
|
|
44
47
|
}
|
|
45
|
-
declare function JobProgressBar({ progress }: Props$6): react_jsx_runtime.JSX.Element;
|
|
48
|
+
declare function JobProgressBar({ progress, standalone }: Props$6): react_jsx_runtime.JSX.Element;
|
|
46
49
|
|
|
47
50
|
interface Props$5 {
|
|
48
51
|
columns: string[];
|
package/dist/index.js
CHANGED
|
@@ -81,7 +81,7 @@ var WARM_RED = "#C15545";
|
|
|
81
81
|
var WARM_RED_SOFT = "rgba(193, 85, 69, 0.14)";
|
|
82
82
|
var WARM_AMBER = "#D49A4E";
|
|
83
83
|
var WARM_AMBER_SOFT = "rgba(212, 154, 78, 0.16)";
|
|
84
|
-
function JobProgressBar({ progress }) {
|
|
84
|
+
function JobProgressBar({ progress, standalone }) {
|
|
85
85
|
const pulseAnim = (0, import_react.useRef)(new import_react_native.Animated.Value(0.5)).current;
|
|
86
86
|
const [elapsed, setElapsed] = (0, import_react.useState)(0);
|
|
87
87
|
const isRunning = progress.status === "running";
|
|
@@ -95,8 +95,10 @@ function JobProgressBar({ progress }) {
|
|
|
95
95
|
}
|
|
96
96
|
const anim = import_react_native.Animated.loop(
|
|
97
97
|
import_react_native.Animated.sequence([
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
// Gentle breath — a soft fade rather than a hard blink, so the running
|
|
99
|
+
// indicator recedes into the bubble instead of demanding attention.
|
|
100
|
+
import_react_native.Animated.timing(pulseAnim, { toValue: 0.55, duration: 1100, useNativeDriver: true }),
|
|
101
|
+
import_react_native.Animated.timing(pulseAnim, { toValue: 0.22, duration: 1100, useNativeDriver: true })
|
|
100
102
|
])
|
|
101
103
|
);
|
|
102
104
|
anim.start();
|
|
@@ -117,33 +119,37 @@ function JobProgressBar({ progress }) {
|
|
|
117
119
|
const statusColor = isDone ? WARM_GREEN : isError ? WARM_RED : isPaused ? WARM_AMBER : import_core.ada.orange;
|
|
118
120
|
const statusBg = isDone ? WARM_GREEN_SOFT : isError ? WARM_RED_SOFT : isPaused ? WARM_AMBER_SOFT : import_core.ada.orangeSoft;
|
|
119
121
|
if (isDone || isError) {
|
|
120
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: styles.container, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: styles.row, children: [
|
|
122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: [styles.container, standalone && styles.containerStandalone], children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: styles.row, children: [
|
|
121
123
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: [styles.dot, { backgroundColor: statusColor }] }),
|
|
122
124
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: [styles.label, { color: statusColor }], children: isDone ? "Completed" : "Failed" })
|
|
123
125
|
] }) });
|
|
124
126
|
}
|
|
125
127
|
if (isPaused) {
|
|
126
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: styles.container, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: styles.row, children: [
|
|
128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: [styles.container, standalone && styles.containerStandalone], children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: styles.row, children: [
|
|
127
129
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: [styles.dot, { backgroundColor: statusColor }] }),
|
|
128
130
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: [styles.label, { color: statusColor }], children: "Waiting for your reply" })
|
|
129
131
|
] }) });
|
|
130
132
|
}
|
|
131
|
-
const elapsedStr = progress.chainStartedAt ? `${Math.floor(elapsed / 60)}
|
|
133
|
+
const elapsedStr = progress.chainStartedAt ? elapsed < 60 ? `${elapsed}s` : `${Math.floor(elapsed / 60)}m ${elapsed % 60}s` : null;
|
|
132
134
|
const metaParts = [
|
|
133
135
|
progress.iteration != null && progress.iteration > 0 ? `iter ${progress.iteration}` : null,
|
|
134
136
|
elapsedStr
|
|
135
137
|
].filter(Boolean);
|
|
138
|
+
const labels = progress.humanLabels;
|
|
139
|
+
const label = (t) => t && labels?.[t] || t;
|
|
140
|
+
const headline = progress.humanStatus || label(progress.skillSlug) || "Processing...";
|
|
141
|
+
const showRawTool = !progress.humanStatus && !!progress.currentTool;
|
|
136
142
|
const lp = progress.liveProgress;
|
|
137
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: styles.container, children: [
|
|
143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: [styles.container, standalone && styles.containerStandalone], children: [
|
|
138
144
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: styles.row, children: [
|
|
139
145
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
140
146
|
import_react_native.Animated.View,
|
|
141
147
|
{
|
|
142
|
-
style: [styles.dot,
|
|
148
|
+
style: [styles.dot, styles.dotRunning, { opacity: pulseAnim }]
|
|
143
149
|
}
|
|
144
150
|
),
|
|
145
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: styles.skill, numberOfLines: 1, children:
|
|
146
|
-
|
|
151
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: styles.skill, numberOfLines: 1, children: headline }),
|
|
152
|
+
showRawTool && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: styles.tool, numberOfLines: 1, children: ` \u2192 ${label(progress.currentTool)}` }),
|
|
147
153
|
metaParts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: styles.meta, numberOfLines: 1, children: ` \xB7 ${metaParts.join(" \xB7 ")}` })
|
|
148
154
|
] }),
|
|
149
155
|
!!lp?.message && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_native.View, { style: styles.liveProgressRow, children: [
|
|
@@ -156,10 +162,10 @@ function JobProgressBar({ progress }) {
|
|
|
156
162
|
] }),
|
|
157
163
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.Text, { style: styles.liveProgressMsg, numberOfLines: 1, children: lp.message })
|
|
158
164
|
] }),
|
|
159
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style:
|
|
165
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native.View, { style: styles.progressTrack, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
160
166
|
import_react_native.Animated.View,
|
|
161
167
|
{
|
|
162
|
-
style: [styles.progressFill, {
|
|
168
|
+
style: [styles.progressFill, { opacity: pulseAnim }]
|
|
163
169
|
}
|
|
164
170
|
) })
|
|
165
171
|
] });
|
|
@@ -171,6 +177,12 @@ var styles = import_react_native.StyleSheet.create({
|
|
|
171
177
|
borderTopWidth: 1,
|
|
172
178
|
borderTopColor: import_core.ada.border
|
|
173
179
|
},
|
|
180
|
+
// Standalone (transparent-bubble) placeholder — no divider/top spacing.
|
|
181
|
+
containerStandalone: {
|
|
182
|
+
marginTop: 0,
|
|
183
|
+
paddingTop: 0,
|
|
184
|
+
borderTopWidth: 0
|
|
185
|
+
},
|
|
174
186
|
row: {
|
|
175
187
|
flexDirection: "row",
|
|
176
188
|
alignItems: "center",
|
|
@@ -178,21 +190,26 @@ var styles = import_react_native.StyleSheet.create({
|
|
|
178
190
|
overflow: "hidden"
|
|
179
191
|
},
|
|
180
192
|
dot: {
|
|
181
|
-
width:
|
|
182
|
-
height:
|
|
183
|
-
borderRadius:
|
|
193
|
+
width: 6,
|
|
194
|
+
height: 6,
|
|
195
|
+
borderRadius: 3,
|
|
184
196
|
marginRight: 6,
|
|
185
197
|
flexShrink: 0
|
|
186
198
|
},
|
|
199
|
+
// Running dot: soft orange, not the full-saturation accent.
|
|
200
|
+
dotRunning: {
|
|
201
|
+
backgroundColor: "rgba(255, 122, 40, 0.6)"
|
|
202
|
+
},
|
|
187
203
|
label: {
|
|
188
204
|
fontSize: import_core.fontSize.xs,
|
|
189
205
|
fontWeight: "600"
|
|
190
206
|
},
|
|
191
|
-
// Running state text segments
|
|
207
|
+
// Running state text segments — muted so the indicator blends into the
|
|
208
|
+
// bubble rather than shouting in orange.
|
|
192
209
|
skill: {
|
|
193
210
|
fontSize: import_core.fontSize.xs,
|
|
194
|
-
fontWeight: "
|
|
195
|
-
color: import_core.ada.
|
|
211
|
+
fontWeight: "500",
|
|
212
|
+
color: import_core.ada.inkSoft,
|
|
196
213
|
flexShrink: 1
|
|
197
214
|
},
|
|
198
215
|
tool: {
|
|
@@ -218,19 +235,23 @@ var styles = import_react_native.StyleSheet.create({
|
|
|
218
235
|
},
|
|
219
236
|
liveProgressMsg: {
|
|
220
237
|
fontSize: import_core.fontSize.xs,
|
|
221
|
-
color: import_core.ada.
|
|
238
|
+
color: import_core.ada.inkSoft,
|
|
222
239
|
flex: 1
|
|
223
240
|
},
|
|
224
241
|
progressTrack: {
|
|
225
|
-
height:
|
|
226
|
-
borderRadius:
|
|
227
|
-
marginTop:
|
|
228
|
-
overflow: "hidden"
|
|
242
|
+
height: 2,
|
|
243
|
+
borderRadius: 1,
|
|
244
|
+
marginTop: 8,
|
|
245
|
+
overflow: "hidden",
|
|
246
|
+
// Barely-there rail so the bar reads as a hint, not a status meter.
|
|
247
|
+
backgroundColor: "rgba(26, 20, 16, 0.05)"
|
|
229
248
|
},
|
|
230
249
|
progressFill: {
|
|
231
250
|
height: "100%",
|
|
232
|
-
width: "
|
|
233
|
-
borderRadius:
|
|
251
|
+
width: "55%",
|
|
252
|
+
borderRadius: 1,
|
|
253
|
+
// Muted orange — present but recessive.
|
|
254
|
+
backgroundColor: "rgba(255, 122, 40, 0.4)"
|
|
234
255
|
}
|
|
235
256
|
});
|
|
236
257
|
|
|
@@ -1140,6 +1161,8 @@ function MessageBubble({ message }) {
|
|
|
1140
1161
|
const isUser = message.role === "user";
|
|
1141
1162
|
const isSystem = message.role === "system";
|
|
1142
1163
|
const isNotification = !isUser && message.kind === "notification";
|
|
1164
|
+
const st = message.jobProgress?.status;
|
|
1165
|
+
const isProgressOnly = !isUser && (st === "running" || st === "paused") && (!message.content?.trim() || message.content === "Working on it...");
|
|
1143
1166
|
const [copied, setCopied] = (0, import_react7.useState)("");
|
|
1144
1167
|
const showCopied = (0, import_react7.useCallback)((label) => {
|
|
1145
1168
|
setCopied(label);
|
|
@@ -1175,7 +1198,8 @@ function MessageBubble({ message }) {
|
|
|
1175
1198
|
styles6.bubble,
|
|
1176
1199
|
isUser && styles6.bubbleUser,
|
|
1177
1200
|
isSystem && styles6.bubbleSystem,
|
|
1178
|
-
isNotification && styles6.bubbleNotification
|
|
1201
|
+
isNotification && styles6.bubbleNotification,
|
|
1202
|
+
isProgressOnly && styles6.bubbleProgress
|
|
1179
1203
|
],
|
|
1180
1204
|
children: [
|
|
1181
1205
|
isNotification && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_native7.View, { style: styles6.notificationHeader, children: [
|
|
@@ -1208,12 +1232,15 @@ function MessageBubble({ message }) {
|
|
|
1208
1232
|
isUser ? (
|
|
1209
1233
|
// Hide the "See attachment" placeholder when the bubble already shows the photo.
|
|
1210
1234
|
message.content && !(message.content === "See attachment" && message.attachments?.length) ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native7.Text, { selectable: true, style: styles6.userText, children: message.content }) : null
|
|
1235
|
+
) : isProgressOnly ? (
|
|
1236
|
+
// No "Working on it…" text — the indicator below is the whole message.
|
|
1237
|
+
null
|
|
1211
1238
|
) : renderAssistantContent(message.content, copyText),
|
|
1212
1239
|
!!copied && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native7.View, { style: styles6.copiedBadge, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native7.Text, { style: styles6.copiedText, children: copied }) }),
|
|
1213
1240
|
message.toolCalls && message.toolCalls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ToolCallsBadge, { calls: message.toolCalls }),
|
|
1214
|
-
message.jobProgress && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(JobProgressBar, { progress: message.jobProgress }),
|
|
1241
|
+
message.jobProgress && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(JobProgressBar, { progress: message.jobProgress, standalone: isProgressOnly }),
|
|
1215
1242
|
!isUser && message.actions && message.actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(UIActionsRow, { actions: message.actions }),
|
|
1216
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native7.Text, { style: [styles6.timeText, isUser && styles6.timeTextUser], children: formatTime(message.timestamp) })
|
|
1243
|
+
!isProgressOnly && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native7.Text, { style: [styles6.timeText, isUser && styles6.timeTextUser], children: formatTime(message.timestamp) })
|
|
1217
1244
|
]
|
|
1218
1245
|
}
|
|
1219
1246
|
),
|
|
@@ -1336,6 +1363,14 @@ var styles6 = import_react_native7.StyleSheet.create({
|
|
|
1336
1363
|
backgroundColor: import_core9.ada.userBubble,
|
|
1337
1364
|
borderColor: "transparent"
|
|
1338
1365
|
},
|
|
1366
|
+
// Live-chain placeholder: no fill, no border, tighter padding — the
|
|
1367
|
+
// indicator floats over the background instead of sitting in a bubble.
|
|
1368
|
+
bubbleProgress: {
|
|
1369
|
+
backgroundColor: "transparent",
|
|
1370
|
+
borderColor: "transparent",
|
|
1371
|
+
paddingHorizontal: 4,
|
|
1372
|
+
paddingVertical: 2
|
|
1373
|
+
},
|
|
1339
1374
|
bubbleSystem: {
|
|
1340
1375
|
backgroundColor: import_core9.ada.orangeSoft,
|
|
1341
1376
|
borderColor: import_core9.ada.orange,
|