@adecore/agents-react 0.73.5 → 0.73.6
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/chat/ui/Scrubber.js
CHANGED
|
@@ -39,7 +39,7 @@ const NOTHING_FOUND = [];
|
|
|
39
39
|
* thousand ticks are a thousand spans and not a thousand popups. An open find marks every tick it hits.
|
|
40
40
|
*/
|
|
41
41
|
export const Scrubber = memo(function Scrubber(t0) {
|
|
42
|
-
const $ = _c(
|
|
42
|
+
const $ = _c(127);
|
|
43
43
|
const {
|
|
44
44
|
ticks,
|
|
45
45
|
firstInView,
|
|
@@ -97,6 +97,9 @@ export const Scrubber = memo(function Scrubber(t0) {
|
|
|
97
97
|
let t15;
|
|
98
98
|
let t16;
|
|
99
99
|
let t17;
|
|
100
|
+
let t18;
|
|
101
|
+
let t19;
|
|
102
|
+
let t20;
|
|
100
103
|
let t6;
|
|
101
104
|
let t7;
|
|
102
105
|
let t8;
|
|
@@ -113,16 +116,16 @@ export const Scrubber = memo(function Scrubber(t0) {
|
|
|
113
116
|
const hoveredTick = hovered === null ? null : ticks[hovered] ?? null;
|
|
114
117
|
const hoveredSlot = hovered === null ? null : slotOf(layout, hovered);
|
|
115
118
|
const anchorY = hoveredSlot === null ? null : layout.slots[hoveredSlot].y;
|
|
116
|
-
let
|
|
119
|
+
let t21;
|
|
117
120
|
bb0: {
|
|
118
121
|
const element = strip;
|
|
119
122
|
if (anchorY === null || element === null) {
|
|
120
|
-
|
|
123
|
+
t21 = undefined;
|
|
121
124
|
break bb0;
|
|
122
125
|
}
|
|
123
|
-
let
|
|
124
|
-
if ($[
|
|
125
|
-
|
|
126
|
+
let t22;
|
|
127
|
+
if ($[40] !== anchorY || $[41] !== element) {
|
|
128
|
+
t22 = () => {
|
|
126
129
|
const rect = element.getBoundingClientRect();
|
|
127
130
|
return DOMRect.fromRect({
|
|
128
131
|
x: rect.left,
|
|
@@ -131,69 +134,70 @@ export const Scrubber = memo(function Scrubber(t0) {
|
|
|
131
134
|
height: 0
|
|
132
135
|
});
|
|
133
136
|
};
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
+
$[40] = anchorY;
|
|
138
|
+
$[41] = element;
|
|
139
|
+
$[42] = t22;
|
|
137
140
|
} else {
|
|
138
|
-
|
|
141
|
+
t22 = $[42];
|
|
139
142
|
}
|
|
140
|
-
let
|
|
141
|
-
if ($[
|
|
142
|
-
|
|
143
|
+
let t23;
|
|
144
|
+
if ($[43] !== element || $[44] !== t22) {
|
|
145
|
+
t23 = {
|
|
143
146
|
contextElement: element,
|
|
144
|
-
getBoundingClientRect:
|
|
147
|
+
getBoundingClientRect: t22
|
|
145
148
|
};
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
+
$[43] = element;
|
|
150
|
+
$[44] = t22;
|
|
151
|
+
$[45] = t23;
|
|
149
152
|
} else {
|
|
150
|
-
|
|
153
|
+
t23 = $[45];
|
|
151
154
|
}
|
|
152
|
-
|
|
155
|
+
t21 = t23;
|
|
153
156
|
}
|
|
154
|
-
const anchor =
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
$[
|
|
157
|
+
const anchor = t21;
|
|
158
|
+
const bandHeight = layout.slots.length * layout.pitch;
|
|
159
|
+
let t22;
|
|
160
|
+
if ($[46] !== layout) {
|
|
161
|
+
t22 = e => messageAt(layout, e.clientY - e.currentTarget.getBoundingClientRect().top + layout.top);
|
|
162
|
+
$[46] = layout;
|
|
163
|
+
$[47] = t22;
|
|
160
164
|
} else {
|
|
161
|
-
|
|
165
|
+
t22 = $[47];
|
|
162
166
|
}
|
|
163
|
-
const pointAt =
|
|
164
|
-
let
|
|
165
|
-
if ($[
|
|
166
|
-
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
167
|
+
const pointAt = t22;
|
|
168
|
+
let t23;
|
|
169
|
+
if ($[48] !== chat) {
|
|
170
|
+
t23 = tick_1 => tick_1 === null ? [] : Object.values(CARD_ACTIONS).filter(action => action.offers(tick_1, chat));
|
|
171
|
+
$[48] = chat;
|
|
172
|
+
$[49] = t23;
|
|
169
173
|
} else {
|
|
170
|
-
|
|
174
|
+
t23 = $[49];
|
|
171
175
|
}
|
|
172
|
-
actionsFor =
|
|
176
|
+
actionsFor = t23;
|
|
173
177
|
const actions = actionsFor(hoveredTick);
|
|
174
|
-
let
|
|
175
|
-
if ($[
|
|
176
|
-
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
178
|
+
let t24;
|
|
179
|
+
if ($[50] !== chat) {
|
|
180
|
+
t24 = tick_2 => tick_2 === null || chat === null ? null : tick_2.bookmark?.itemId ?? (tick_2.kind === "person" ? tick_2.id : null);
|
|
181
|
+
$[50] = chat;
|
|
182
|
+
$[51] = t24;
|
|
179
183
|
} else {
|
|
180
|
-
|
|
184
|
+
t24 = $[51];
|
|
181
185
|
}
|
|
182
|
-
const markableOf =
|
|
186
|
+
const markableOf = t24;
|
|
183
187
|
menuTick = menuIndex === null ? null : ticks[menuIndex] ?? null;
|
|
184
|
-
let
|
|
185
|
-
if ($[
|
|
186
|
-
|
|
187
|
-
$[
|
|
188
|
-
$[
|
|
189
|
-
$[
|
|
188
|
+
let t25;
|
|
189
|
+
if ($[52] !== markableOf || $[53] !== menuTick) {
|
|
190
|
+
t25 = markableOf(menuTick);
|
|
191
|
+
$[52] = markableOf;
|
|
192
|
+
$[53] = menuTick;
|
|
193
|
+
$[54] = t25;
|
|
190
194
|
} else {
|
|
191
|
-
|
|
195
|
+
t25 = $[54];
|
|
192
196
|
}
|
|
193
|
-
menuMarkable =
|
|
194
|
-
let
|
|
195
|
-
if ($[
|
|
196
|
-
|
|
197
|
+
menuMarkable = t25;
|
|
198
|
+
let t26;
|
|
199
|
+
if ($[55] !== actionsFor || $[56] !== layout || $[57] !== markableOf || $[58] !== strip || $[59] !== ticks) {
|
|
200
|
+
t26 = e_0 => {
|
|
197
201
|
const index = strip === null || cameThroughPortal(e_0) ? null : messageAt(layout, e_0.clientY - strip.getBoundingClientRect().top);
|
|
198
202
|
const tick_3 = index === null ? null : ticks[index] ?? null;
|
|
199
203
|
if (tick_3 === null || actionsFor(tick_3).length === 0 && markableOf(tick_3) === null) {
|
|
@@ -202,87 +206,99 @@ export const Scrubber = memo(function Scrubber(t0) {
|
|
|
202
206
|
}
|
|
203
207
|
setMenuIndex(index);
|
|
204
208
|
};
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
209
|
+
$[55] = actionsFor;
|
|
210
|
+
$[56] = layout;
|
|
211
|
+
$[57] = markableOf;
|
|
212
|
+
$[58] = strip;
|
|
213
|
+
$[59] = ticks;
|
|
214
|
+
$[60] = t26;
|
|
211
215
|
} else {
|
|
212
|
-
|
|
216
|
+
t26 = $[60];
|
|
213
217
|
}
|
|
214
|
-
const onContextMenu =
|
|
218
|
+
const onContextMenu = t26;
|
|
219
|
+
t19 = setStrip;
|
|
220
|
+
t20 = "relative h-full w-full";
|
|
215
221
|
T3 = ContextMenu.Root;
|
|
216
|
-
|
|
222
|
+
t18 = setMenuOpen;
|
|
217
223
|
T2 = ContextMenu.Trigger;
|
|
218
|
-
t15 = "
|
|
219
|
-
|
|
224
|
+
t15 = "absolute inset-x-0";
|
|
225
|
+
if ($[61] !== bandHeight || $[62] !== layout) {
|
|
226
|
+
t16 = {
|
|
227
|
+
top: layout.top,
|
|
228
|
+
height: bandHeight
|
|
229
|
+
};
|
|
230
|
+
$[61] = bandHeight;
|
|
231
|
+
$[62] = layout;
|
|
232
|
+
$[63] = t16;
|
|
233
|
+
} else {
|
|
234
|
+
t16 = $[63];
|
|
235
|
+
}
|
|
236
|
+
t17 = onContextMenu;
|
|
220
237
|
T1 = PreviewCard.Root;
|
|
221
238
|
t12 = cardOpen && !menuOpen;
|
|
222
239
|
t13 = setCardOpen;
|
|
223
|
-
let
|
|
224
|
-
if ($[
|
|
225
|
-
|
|
226
|
-
$[
|
|
227
|
-
$[
|
|
240
|
+
let t27;
|
|
241
|
+
if ($[64] !== t) {
|
|
242
|
+
t27 = t("scrubber.strip");
|
|
243
|
+
$[64] = t;
|
|
244
|
+
$[65] = t27;
|
|
228
245
|
} else {
|
|
229
|
-
|
|
246
|
+
t27 = $[65];
|
|
230
247
|
}
|
|
231
|
-
let
|
|
232
|
-
if ($[
|
|
233
|
-
|
|
248
|
+
let t28;
|
|
249
|
+
if ($[66] !== hovered || $[67] !== pointAt) {
|
|
250
|
+
t28 = e_1 => {
|
|
234
251
|
setPointing(true);
|
|
235
252
|
const index_0 = pointAt(e_1);
|
|
236
253
|
if (index_0 !== hovered) {
|
|
237
254
|
setHovered(index_0);
|
|
238
255
|
}
|
|
239
256
|
};
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
257
|
+
$[66] = hovered;
|
|
258
|
+
$[67] = pointAt;
|
|
259
|
+
$[68] = t28;
|
|
243
260
|
} else {
|
|
244
|
-
|
|
261
|
+
t28 = $[68];
|
|
245
262
|
}
|
|
246
|
-
let
|
|
247
|
-
if ($[
|
|
248
|
-
|
|
249
|
-
$[
|
|
263
|
+
let t29;
|
|
264
|
+
if ($[69] === Symbol.for("react.memo_cache_sentinel")) {
|
|
265
|
+
t29 = () => setPointing(false);
|
|
266
|
+
$[69] = t29;
|
|
250
267
|
} else {
|
|
251
|
-
|
|
268
|
+
t29 = $[69];
|
|
252
269
|
}
|
|
253
|
-
let
|
|
254
|
-
if ($[
|
|
255
|
-
|
|
270
|
+
let t30;
|
|
271
|
+
if ($[70] !== onPick || $[71] !== pointAt) {
|
|
272
|
+
t30 = e_2 => {
|
|
256
273
|
const index_1 = pointAt(e_2);
|
|
257
274
|
if (index_1 !== null) {
|
|
258
275
|
onPick(index_1);
|
|
259
276
|
}
|
|
260
277
|
};
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
278
|
+
$[70] = onPick;
|
|
279
|
+
$[71] = pointAt;
|
|
280
|
+
$[72] = t30;
|
|
264
281
|
} else {
|
|
265
|
-
|
|
282
|
+
t30 = $[72];
|
|
266
283
|
}
|
|
267
|
-
let
|
|
268
|
-
if ($[
|
|
269
|
-
|
|
270
|
-
ref: setStrip,
|
|
284
|
+
let t31;
|
|
285
|
+
if ($[73] !== t27 || $[74] !== t28 || $[75] !== t30) {
|
|
286
|
+
t31 = /*#__PURE__*/_jsx("div", {
|
|
271
287
|
role: "navigation",
|
|
272
|
-
"aria-label":
|
|
288
|
+
"aria-label": t27,
|
|
273
289
|
className: "relative h-full w-full cursor-pointer select-none",
|
|
274
|
-
onPointerMove:
|
|
275
|
-
onPointerLeave:
|
|
276
|
-
onClick:
|
|
290
|
+
onPointerMove: t28,
|
|
291
|
+
onPointerLeave: t29,
|
|
292
|
+
onClick: t30
|
|
277
293
|
});
|
|
278
|
-
$[
|
|
279
|
-
$[
|
|
280
|
-
$[
|
|
281
|
-
$[
|
|
294
|
+
$[73] = t27;
|
|
295
|
+
$[74] = t28;
|
|
296
|
+
$[75] = t30;
|
|
297
|
+
$[76] = t31;
|
|
282
298
|
} else {
|
|
283
|
-
|
|
299
|
+
t31 = $[76];
|
|
284
300
|
}
|
|
285
|
-
const
|
|
301
|
+
const t32 = layout.slots.map((slot, index_2) => {
|
|
286
302
|
const distance = pointing && hoveredSlot !== null ? Math.abs(index_2 - hoveredSlot) : null;
|
|
287
303
|
const bright = slot.marked || slotInView(slot, inView) || distance === 0;
|
|
288
304
|
return /*#__PURE__*/_jsxs(Fragment, {
|
|
@@ -290,7 +306,7 @@ export const Scrubber = memo(function Scrubber(t0) {
|
|
|
290
306
|
"aria-hidden": true,
|
|
291
307
|
className: clsx("absolute left-1 rounded-full transition-[width,opacity] duration-100 ease-out motion-reduce:transition-none", slot.marked ? "bg-accent" : slot.kind === "wake" ? "bg-text-muted" : "bg-text", bright ? "opacity-100" : "opacity-30"),
|
|
292
308
|
style: {
|
|
293
|
-
top: slot.y,
|
|
309
|
+
top: slot.y - layout.top,
|
|
294
310
|
height: TICK_HEIGHT_PX,
|
|
295
311
|
width: tickWidth(slot.kind, distance)
|
|
296
312
|
}
|
|
@@ -298,25 +314,25 @@ export const Scrubber = memo(function Scrubber(t0) {
|
|
|
298
314
|
"aria-hidden": true,
|
|
299
315
|
className: clsx("absolute right-0 rounded-full bg-chat-find", index_2 === currentSlot ? "opacity-100" : "opacity-50"),
|
|
300
316
|
style: {
|
|
301
|
-
top: slot.y,
|
|
317
|
+
top: slot.y - layout.top,
|
|
302
318
|
height: TICK_HEIGHT_PX,
|
|
303
319
|
width: FOUND_WIDTH_PX
|
|
304
320
|
}
|
|
305
321
|
})]
|
|
306
322
|
}, slot.first);
|
|
307
323
|
});
|
|
308
|
-
if ($[
|
|
324
|
+
if ($[77] !== t31 || $[78] !== t32) {
|
|
309
325
|
t14 = /*#__PURE__*/_jsx(PreviewCard.Trigger, {
|
|
310
326
|
delay: 150,
|
|
311
327
|
closeDelay: 150,
|
|
312
|
-
render:
|
|
313
|
-
children:
|
|
328
|
+
render: t31,
|
|
329
|
+
children: t32
|
|
314
330
|
});
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
$[
|
|
331
|
+
$[77] = t31;
|
|
332
|
+
$[78] = t32;
|
|
333
|
+
$[79] = t14;
|
|
318
334
|
} else {
|
|
319
|
-
t14 = $[
|
|
335
|
+
t14 = $[79];
|
|
320
336
|
}
|
|
321
337
|
T0 = PreviewCard.Popup;
|
|
322
338
|
t6 = anchor;
|
|
@@ -391,10 +407,13 @@ export const Scrubber = memo(function Scrubber(t0) {
|
|
|
391
407
|
$[30] = t15;
|
|
392
408
|
$[31] = t16;
|
|
393
409
|
$[32] = t17;
|
|
394
|
-
$[33] =
|
|
395
|
-
$[34] =
|
|
396
|
-
$[35] =
|
|
397
|
-
$[36] =
|
|
410
|
+
$[33] = t18;
|
|
411
|
+
$[34] = t19;
|
|
412
|
+
$[35] = t20;
|
|
413
|
+
$[36] = t6;
|
|
414
|
+
$[37] = t7;
|
|
415
|
+
$[38] = t8;
|
|
416
|
+
$[39] = t9;
|
|
398
417
|
} else {
|
|
399
418
|
T0 = $[18];
|
|
400
419
|
T1 = $[19];
|
|
@@ -411,14 +430,17 @@ export const Scrubber = memo(function Scrubber(t0) {
|
|
|
411
430
|
t15 = $[30];
|
|
412
431
|
t16 = $[31];
|
|
413
432
|
t17 = $[32];
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
433
|
+
t18 = $[33];
|
|
434
|
+
t19 = $[34];
|
|
435
|
+
t20 = $[35];
|
|
436
|
+
t6 = $[36];
|
|
437
|
+
t7 = $[37];
|
|
438
|
+
t8 = $[38];
|
|
439
|
+
t9 = $[39];
|
|
418
440
|
}
|
|
419
|
-
let
|
|
420
|
-
if ($[
|
|
421
|
-
|
|
441
|
+
let t21;
|
|
442
|
+
if ($[80] !== T0 || $[81] !== t10 || $[82] !== t11 || $[83] !== t6 || $[84] !== t7 || $[85] !== t8 || $[86] !== t9) {
|
|
443
|
+
t21 = /*#__PURE__*/_jsx(T0, {
|
|
422
444
|
anchor: t6,
|
|
423
445
|
side: t7,
|
|
424
446
|
align: t8,
|
|
@@ -426,117 +448,133 @@ export const Scrubber = memo(function Scrubber(t0) {
|
|
|
426
448
|
className: t10,
|
|
427
449
|
children: t11
|
|
428
450
|
});
|
|
429
|
-
$[
|
|
430
|
-
$[
|
|
431
|
-
$[
|
|
432
|
-
$[
|
|
433
|
-
$[
|
|
434
|
-
$[
|
|
435
|
-
$[
|
|
436
|
-
$[
|
|
451
|
+
$[80] = T0;
|
|
452
|
+
$[81] = t10;
|
|
453
|
+
$[82] = t11;
|
|
454
|
+
$[83] = t6;
|
|
455
|
+
$[84] = t7;
|
|
456
|
+
$[85] = t8;
|
|
457
|
+
$[86] = t9;
|
|
458
|
+
$[87] = t21;
|
|
437
459
|
} else {
|
|
438
|
-
|
|
460
|
+
t21 = $[87];
|
|
439
461
|
}
|
|
440
|
-
let
|
|
441
|
-
if ($[
|
|
442
|
-
|
|
462
|
+
let t22;
|
|
463
|
+
if ($[88] !== T1 || $[89] !== t12 || $[90] !== t13 || $[91] !== t14 || $[92] !== t21) {
|
|
464
|
+
t22 = /*#__PURE__*/_jsxs(T1, {
|
|
443
465
|
open: t12,
|
|
444
466
|
onOpenChange: t13,
|
|
445
|
-
children: [t14,
|
|
467
|
+
children: [t14, t21]
|
|
446
468
|
});
|
|
447
|
-
$[
|
|
448
|
-
$[
|
|
449
|
-
$[
|
|
450
|
-
$[
|
|
451
|
-
$[
|
|
452
|
-
$[
|
|
469
|
+
$[88] = T1;
|
|
470
|
+
$[89] = t12;
|
|
471
|
+
$[90] = t13;
|
|
472
|
+
$[91] = t14;
|
|
473
|
+
$[92] = t21;
|
|
474
|
+
$[93] = t22;
|
|
453
475
|
} else {
|
|
454
|
-
|
|
476
|
+
t22 = $[93];
|
|
455
477
|
}
|
|
456
|
-
let
|
|
457
|
-
if ($[
|
|
458
|
-
|
|
478
|
+
let t23;
|
|
479
|
+
if ($[94] !== T2 || $[95] !== t15 || $[96] !== t16 || $[97] !== t17 || $[98] !== t22) {
|
|
480
|
+
t23 = /*#__PURE__*/_jsx(T2, {
|
|
459
481
|
className: t15,
|
|
460
|
-
|
|
461
|
-
|
|
482
|
+
style: t16,
|
|
483
|
+
onContextMenu: t17,
|
|
484
|
+
children: t22
|
|
462
485
|
});
|
|
463
|
-
$[
|
|
464
|
-
$[
|
|
465
|
-
$[
|
|
466
|
-
$[
|
|
467
|
-
$[
|
|
486
|
+
$[94] = T2;
|
|
487
|
+
$[95] = t15;
|
|
488
|
+
$[96] = t16;
|
|
489
|
+
$[97] = t17;
|
|
490
|
+
$[98] = t22;
|
|
491
|
+
$[99] = t23;
|
|
468
492
|
} else {
|
|
469
|
-
|
|
493
|
+
t23 = $[99];
|
|
470
494
|
}
|
|
471
|
-
let
|
|
472
|
-
if ($[
|
|
473
|
-
|
|
495
|
+
let t24;
|
|
496
|
+
if ($[100] !== actionsFor || $[101] !== chat || $[102] !== menuTick || $[103] !== t) {
|
|
497
|
+
t24 = menuTick !== null && actionsFor(menuTick).map(action_1 => /*#__PURE__*/_jsxs(ContextMenu.Item, {
|
|
474
498
|
onClick: () => action_1.run(menuTick, chat),
|
|
475
499
|
children: [/*#__PURE__*/_jsx(Icon, {
|
|
476
500
|
icon: action_1.icon,
|
|
477
501
|
size: 14
|
|
478
502
|
}), " ", t(action_1.label)]
|
|
479
503
|
}, action_1.label));
|
|
480
|
-
$[
|
|
481
|
-
$[
|
|
482
|
-
$[
|
|
483
|
-
$[
|
|
484
|
-
$[
|
|
504
|
+
$[100] = actionsFor;
|
|
505
|
+
$[101] = chat;
|
|
506
|
+
$[102] = menuTick;
|
|
507
|
+
$[103] = t;
|
|
508
|
+
$[104] = t24;
|
|
485
509
|
} else {
|
|
486
|
-
|
|
510
|
+
t24 = $[104];
|
|
487
511
|
}
|
|
488
|
-
let
|
|
489
|
-
if ($[
|
|
490
|
-
|
|
491
|
-
$[
|
|
492
|
-
$[
|
|
493
|
-
$[
|
|
494
|
-
$[
|
|
512
|
+
let t25;
|
|
513
|
+
if ($[105] !== actionsFor || $[106] !== menuMarkable || $[107] !== menuTick) {
|
|
514
|
+
t25 = menuTick !== null && actionsFor(menuTick).length > 0 && menuMarkable !== null && /*#__PURE__*/_jsx(ContextMenu.Separator, {});
|
|
515
|
+
$[105] = actionsFor;
|
|
516
|
+
$[106] = menuMarkable;
|
|
517
|
+
$[107] = menuTick;
|
|
518
|
+
$[108] = t25;
|
|
495
519
|
} else {
|
|
496
|
-
|
|
520
|
+
t25 = $[108];
|
|
497
521
|
}
|
|
498
|
-
let
|
|
499
|
-
if ($[
|
|
500
|
-
|
|
522
|
+
let t26;
|
|
523
|
+
if ($[109] !== chat || $[110] !== menuIndex || $[111] !== menuMarkable || $[112] !== onPick) {
|
|
524
|
+
t26 = chat !== null && menuIndex !== null && menuMarkable !== null && /*#__PURE__*/_jsx(BookmarkMenuItems, {
|
|
501
525
|
chatId: chat.chatId,
|
|
502
526
|
itemId: menuMarkable,
|
|
503
527
|
onName: () => onPick(menuIndex)
|
|
504
528
|
});
|
|
505
|
-
$[
|
|
506
|
-
$[
|
|
507
|
-
$[
|
|
508
|
-
$[
|
|
509
|
-
$[
|
|
529
|
+
$[109] = chat;
|
|
530
|
+
$[110] = menuIndex;
|
|
531
|
+
$[111] = menuMarkable;
|
|
532
|
+
$[112] = onPick;
|
|
533
|
+
$[113] = t26;
|
|
510
534
|
} else {
|
|
511
|
-
|
|
535
|
+
t26 = $[113];
|
|
512
536
|
}
|
|
513
|
-
let
|
|
514
|
-
if ($[
|
|
515
|
-
|
|
516
|
-
children: [
|
|
537
|
+
let t27;
|
|
538
|
+
if ($[114] !== t24 || $[115] !== t25 || $[116] !== t26) {
|
|
539
|
+
t27 = /*#__PURE__*/_jsxs(ContextMenu.Popup, {
|
|
540
|
+
children: [t24, t25, t26]
|
|
517
541
|
});
|
|
518
|
-
$[
|
|
519
|
-
$[
|
|
520
|
-
$[
|
|
521
|
-
$[
|
|
542
|
+
$[114] = t24;
|
|
543
|
+
$[115] = t25;
|
|
544
|
+
$[116] = t26;
|
|
545
|
+
$[117] = t27;
|
|
522
546
|
} else {
|
|
523
|
-
|
|
547
|
+
t27 = $[117];
|
|
524
548
|
}
|
|
525
|
-
let
|
|
526
|
-
if ($[
|
|
527
|
-
|
|
528
|
-
onOpenChange:
|
|
529
|
-
children: [
|
|
549
|
+
let t28;
|
|
550
|
+
if ($[118] !== T3 || $[119] !== t18 || $[120] !== t23 || $[121] !== t27) {
|
|
551
|
+
t28 = /*#__PURE__*/_jsxs(T3, {
|
|
552
|
+
onOpenChange: t18,
|
|
553
|
+
children: [t23, t27]
|
|
530
554
|
});
|
|
531
|
-
$[
|
|
532
|
-
$[
|
|
533
|
-
$[
|
|
534
|
-
$[
|
|
535
|
-
$[
|
|
555
|
+
$[118] = T3;
|
|
556
|
+
$[119] = t18;
|
|
557
|
+
$[120] = t23;
|
|
558
|
+
$[121] = t27;
|
|
559
|
+
$[122] = t28;
|
|
560
|
+
} else {
|
|
561
|
+
t28 = $[122];
|
|
562
|
+
}
|
|
563
|
+
let t29;
|
|
564
|
+
if ($[123] !== t19 || $[124] !== t20 || $[125] !== t28) {
|
|
565
|
+
t29 = /*#__PURE__*/_jsx("div", {
|
|
566
|
+
ref: t19,
|
|
567
|
+
className: t20,
|
|
568
|
+
children: t28
|
|
569
|
+
});
|
|
570
|
+
$[123] = t19;
|
|
571
|
+
$[124] = t20;
|
|
572
|
+
$[125] = t28;
|
|
573
|
+
$[126] = t29;
|
|
536
574
|
} else {
|
|
537
|
-
|
|
575
|
+
t29 = $[126];
|
|
538
576
|
}
|
|
539
|
-
return
|
|
577
|
+
return t29;
|
|
540
578
|
});
|
|
541
579
|
function _temp(tick) {
|
|
542
580
|
return tick.kind;
|
|
@@ -769,7 +769,7 @@ export function TableRenderer(t0) {
|
|
|
769
769
|
T0 = ScrollArea;
|
|
770
770
|
t5 = "both";
|
|
771
771
|
t6 = "chat-ui-flat max-h-80 w-full rounded-xl bg-ui-tile";
|
|
772
|
-
t7 = "chat-ui-flat px-1.5 pb-1.5";
|
|
772
|
+
t7 = "chat-ui-flat overscroll-y-auto px-1.5 pb-1.5";
|
|
773
773
|
t2 = t("blocks.table.label", {
|
|
774
774
|
columns: columns.map(_temp4).join(", ")
|
|
775
775
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adecore/agents-react",
|
|
3
|
-
"version": "0.73.
|
|
3
|
+
"version": "0.73.6",
|
|
4
4
|
"description": "React agent chat threads, composers, approvals, provider accounts and usage views.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -72,12 +72,12 @@
|
|
|
72
72
|
"test:visuals": "bun --config=integration.bunfig.toml --conditions=source test ./src/chat/visual-viewport.integration.test.ts"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@adecore/agent-contracts": "0.73.
|
|
76
|
-
"@adecore/editor": "0.73.
|
|
77
|
-
"@adecore/editor-react": "0.73.
|
|
78
|
-
"@adecore/intelligent-ui": "0.73.
|
|
79
|
-
"@adecore/merge": "0.73.
|
|
80
|
-
"@adecore/utils": "0.73.
|
|
75
|
+
"@adecore/agent-contracts": "0.73.6",
|
|
76
|
+
"@adecore/editor": "0.73.6",
|
|
77
|
+
"@adecore/editor-react": "0.73.6",
|
|
78
|
+
"@adecore/intelligent-ui": "0.73.6",
|
|
79
|
+
"@adecore/merge": "0.73.6",
|
|
80
|
+
"@adecore/utils": "0.73.6",
|
|
81
81
|
"@codemirror/commands": "^6.11.1",
|
|
82
82
|
"@codemirror/language": "^6.13.1",
|
|
83
83
|
"@codemirror/state": "^6.7.6",
|
|
@@ -101,14 +101,14 @@
|
|
|
101
101
|
"zustand": "^5.1.0"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
|
-
"@adecore/ui": "^0.73.
|
|
104
|
+
"@adecore/ui": "^0.73.6",
|
|
105
105
|
"i18next": "^26.4.2 || ^27.0.0",
|
|
106
106
|
"react": "^19.3.0",
|
|
107
107
|
"react-dom": "^19.3.0",
|
|
108
108
|
"react-i18next": "^17.0.15 || ^18.0.0"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
|
-
"@adecore/ui": "0.73.
|
|
111
|
+
"@adecore/ui": "0.73.6",
|
|
112
112
|
"@types/bun": "^1.4.4",
|
|
113
113
|
"@types/react": "^19.3.0",
|
|
114
114
|
"@types/react-dom": "^19.3.0",
|
package/src/chat/ui/Scrubber.tsx
CHANGED
|
@@ -132,7 +132,11 @@ export const Scrubber = memo(function Scrubber({
|
|
|
132
132
|
};
|
|
133
133
|
}, [anchorY, strip]);
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
// Only the band the ticks stand in answers the pointer, so the empty height above and below it stays the thread's.
|
|
136
|
+
const bandHeight = layout.slots.length * layout.pitch;
|
|
137
|
+
|
|
138
|
+
const pointAt = (e: ReactMouseEvent<HTMLDivElement>): number | null =>
|
|
139
|
+
messageAt(layout, e.clientY - e.currentTarget.getBoundingClientRect().top + layout.top);
|
|
136
140
|
|
|
137
141
|
const actionsFor = (tick: ScrubberTick | null): CardAction[] =>
|
|
138
142
|
tick === null ? [] : Object.values(CARD_ACTIONS).filter((action) => action.offers(tick, chat));
|
|
@@ -161,115 +165,119 @@ export const Scrubber = memo(function Scrubber({
|
|
|
161
165
|
};
|
|
162
166
|
|
|
163
167
|
return (
|
|
164
|
-
<
|
|
165
|
-
<ContextMenu.
|
|
166
|
-
<
|
|
167
|
-
<PreviewCard.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
<span
|
|
203
|
-
aria-hidden
|
|
204
|
-
className={clsx(
|
|
205
|
-
'absolute left-1 rounded-full transition-[width,opacity] duration-100 ease-out motion-reduce:transition-none',
|
|
206
|
-
slot.marked ? 'bg-accent' : slot.kind === 'wake' ? 'bg-text-muted' : 'bg-text',
|
|
207
|
-
bright ? 'opacity-100' : 'opacity-30'
|
|
208
|
-
)}
|
|
209
|
-
style={{ top: slot.y, height: TICK_HEIGHT_PX, width: tickWidth(slot.kind, distance) }}
|
|
210
|
-
/>
|
|
211
|
-
{slot.found && (
|
|
168
|
+
<div ref={setStrip} className="relative h-full w-full">
|
|
169
|
+
<ContextMenu.Root onOpenChange={setMenuOpen}>
|
|
170
|
+
<ContextMenu.Trigger className="absolute inset-x-0" style={{ top: layout.top, height: bandHeight }} onContextMenu={onContextMenu}>
|
|
171
|
+
<PreviewCard.Root open={cardOpen && !menuOpen} onOpenChange={setCardOpen}>
|
|
172
|
+
<PreviewCard.Trigger
|
|
173
|
+
delay={150}
|
|
174
|
+
closeDelay={150}
|
|
175
|
+
render={
|
|
176
|
+
<div
|
|
177
|
+
role="navigation"
|
|
178
|
+
aria-label={t('scrubber.strip')}
|
|
179
|
+
className="relative h-full w-full cursor-pointer select-none"
|
|
180
|
+
onPointerMove={(e) => {
|
|
181
|
+
setPointing(true);
|
|
182
|
+
const index = pointAt(e);
|
|
183
|
+
|
|
184
|
+
if (index !== hovered) {
|
|
185
|
+
setHovered(index);
|
|
186
|
+
}
|
|
187
|
+
}}
|
|
188
|
+
onPointerLeave={() => setPointing(false)}
|
|
189
|
+
onClick={(e) => {
|
|
190
|
+
const index = pointAt(e);
|
|
191
|
+
|
|
192
|
+
if (index !== null) {
|
|
193
|
+
onPick(index);
|
|
194
|
+
}
|
|
195
|
+
}}
|
|
196
|
+
/>
|
|
197
|
+
}
|
|
198
|
+
>
|
|
199
|
+
{layout.slots.map((slot, index) => {
|
|
200
|
+
const distance = pointing && hoveredSlot !== null ? Math.abs(index - hoveredSlot) : null;
|
|
201
|
+
// A bookmark is a place to find again from anywhere, so it never dims with the rest.
|
|
202
|
+
const bright = slot.marked || slotInView(slot, inView) || distance === 0;
|
|
203
|
+
|
|
204
|
+
return (
|
|
205
|
+
<Fragment key={slot.first}>
|
|
212
206
|
<span
|
|
213
207
|
aria-hidden
|
|
214
|
-
className={clsx(
|
|
215
|
-
|
|
208
|
+
className={clsx(
|
|
209
|
+
'absolute left-1 rounded-full transition-[width,opacity] duration-100 ease-out motion-reduce:transition-none',
|
|
210
|
+
slot.marked ? 'bg-accent' : slot.kind === 'wake' ? 'bg-text-muted' : 'bg-text',
|
|
211
|
+
bright ? 'opacity-100' : 'opacity-30'
|
|
212
|
+
)}
|
|
213
|
+
style={{ top: slot.y - layout.top, height: TICK_HEIGHT_PX, width: tickWidth(slot.kind, distance) }}
|
|
216
214
|
/>
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
<div className="flex items-baseline justify-between gap-3 text-xs text-text-faint">
|
|
227
|
-
{hoveredTick.bookmark === null ? (
|
|
228
|
-
<span>{hoveredTick.kind === 'person' ? t('rows.user.heading') : t('scrubber.tasks')}</span>
|
|
229
|
-
) : (
|
|
230
|
-
<span className="flex min-w-0 items-center gap-1 self-center text-text-muted">
|
|
231
|
-
<Icon icon={Bookmark} size={12} className="shrink-0 text-accent" />
|
|
232
|
-
<span className="truncate">{hoveredTick.bookmark.name ?? t('bookmarks.unnamed')}</span>
|
|
233
|
-
</span>
|
|
215
|
+
{slot.found && (
|
|
216
|
+
<span
|
|
217
|
+
aria-hidden
|
|
218
|
+
className={clsx(
|
|
219
|
+
'absolute right-0 rounded-full bg-chat-find',
|
|
220
|
+
index === currentSlot ? 'opacity-100' : 'opacity-50'
|
|
221
|
+
)}
|
|
222
|
+
style={{ top: slot.y - layout.top, height: TICK_HEIGHT_PX, width: FOUND_WIDTH_PX }}
|
|
223
|
+
/>
|
|
234
224
|
)}
|
|
235
|
-
|
|
225
|
+
</Fragment>
|
|
226
|
+
);
|
|
227
|
+
})}
|
|
228
|
+
</PreviewCard.Trigger>
|
|
229
|
+
<PreviewCard.Popup anchor={anchor} side="right" align="center" sideOffset={4} className="w-72">
|
|
230
|
+
{hoveredTick !== null && (
|
|
231
|
+
<>
|
|
232
|
+
<div className="px-2.5 pt-1.5 pb-2">
|
|
233
|
+
<div className="flex items-baseline justify-between gap-3 text-xs text-text-faint">
|
|
234
|
+
{hoveredTick.bookmark === null ? (
|
|
235
|
+
<span>{hoveredTick.kind === 'person' ? t('rows.user.heading') : t('scrubber.tasks')}</span>
|
|
236
|
+
) : (
|
|
237
|
+
<span className="flex min-w-0 items-center gap-1 self-center text-text-muted">
|
|
238
|
+
<Icon icon={Bookmark} size={12} className="shrink-0 text-accent" />
|
|
239
|
+
<span className="truncate">{hoveredTick.bookmark.name ?? t('bookmarks.unnamed')}</span>
|
|
240
|
+
</span>
|
|
241
|
+
)}
|
|
242
|
+
<time className="tabular-nums">{timeOf(hoveredTick.createdAt)}</time>
|
|
243
|
+
</div>
|
|
244
|
+
<p className="mt-1 line-clamp-4 text-sm break-words whitespace-pre-line text-text">
|
|
245
|
+
{hoveredTick.text.slice(0, PREVIEW_CHARS) || t('pickers.stash.noText')}
|
|
246
|
+
</p>
|
|
236
247
|
</div>
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
)
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
)}
|
|
272
|
-
</ContextMenu.Popup>
|
|
273
|
-
</ContextMenu.Root>
|
|
248
|
+
{actions.length > 0 && (
|
|
249
|
+
<>
|
|
250
|
+
<Menu.Separator />
|
|
251
|
+
{actions.map((action) => (
|
|
252
|
+
<button
|
|
253
|
+
key={action.label}
|
|
254
|
+
type="button"
|
|
255
|
+
className="menu-item w-full hover:bg-surface-hover"
|
|
256
|
+
onClick={() => action.run(hoveredTick, chat)}
|
|
257
|
+
>
|
|
258
|
+
<Icon icon={action.icon} size={14} /> {t(action.label)}
|
|
259
|
+
</button>
|
|
260
|
+
))}
|
|
261
|
+
</>
|
|
262
|
+
)}
|
|
263
|
+
</>
|
|
264
|
+
)}
|
|
265
|
+
</PreviewCard.Popup>
|
|
266
|
+
</PreviewCard.Root>
|
|
267
|
+
</ContextMenu.Trigger>
|
|
268
|
+
<ContextMenu.Popup>
|
|
269
|
+
{menuTick !== null &&
|
|
270
|
+
actionsFor(menuTick).map((action) => (
|
|
271
|
+
<ContextMenu.Item key={action.label} onClick={() => action.run(menuTick, chat)}>
|
|
272
|
+
<Icon icon={action.icon} size={14} /> {t(action.label)}
|
|
273
|
+
</ContextMenu.Item>
|
|
274
|
+
))}
|
|
275
|
+
{menuTick !== null && actionsFor(menuTick).length > 0 && menuMarkable !== null && <ContextMenu.Separator />}
|
|
276
|
+
{chat !== null && menuIndex !== null && menuMarkable !== null && (
|
|
277
|
+
<BookmarkMenuItems chatId={chat.chatId} itemId={menuMarkable} onName={() => onPick(menuIndex)} />
|
|
278
|
+
)}
|
|
279
|
+
</ContextMenu.Popup>
|
|
280
|
+
</ContextMenu.Root>
|
|
281
|
+
</div>
|
|
274
282
|
);
|
|
275
283
|
});
|
|
@@ -300,8 +300,13 @@ export function TableRenderer({ node, context }: UiRendererProps<UiProps<'Table'
|
|
|
300
300
|
|
|
301
301
|
return (
|
|
302
302
|
<div className="flex flex-col items-start gap-1.5">
|
|
303
|
-
{/* Flat on both parts: a section drops the frame's ground and the viewport's padding.
|
|
304
|
-
|
|
303
|
+
{/* Flat on both parts: a section drops the frame's ground and the viewport's padding.
|
|
304
|
+
A wheel at the table's end goes on to the thread, which a bounce in the table would swallow. */}
|
|
305
|
+
<ScrollArea
|
|
306
|
+
axis="both"
|
|
307
|
+
className="chat-ui-flat max-h-80 w-full rounded-xl bg-ui-tile"
|
|
308
|
+
viewportClassName="chat-ui-flat overscroll-y-auto px-1.5 pb-1.5"
|
|
309
|
+
>
|
|
305
310
|
<table
|
|
306
311
|
aria-label={t('blocks.table.label', { columns: columns.map((column) => column.title).join(', ') })}
|
|
307
312
|
className={clsx(
|