@adecore/agents-react 0.37.3 → 0.39.0
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/agents/AgentModelLabel.d.ts +10 -0
- package/dist/agents/AgentModelLabel.js +97 -0
- package/dist/chat/logic/visual-height.d.ts +1 -0
- package/dist/chat/logic/visual-height.js +1 -1
- package/dist/chat/ui/Composer.js +385 -360
- package/dist/chat/ui/HostMenuItems.d.ts +4 -0
- package/dist/chat/ui/HostMenuItems.js +15 -0
- package/dist/chat/ui/Pickers.d.ts +2 -1
- package/dist/chat/ui/Pickers.js +126 -123
- package/dist/chat/ui/PromptEditor.d.ts +19 -0
- package/dist/chat/ui/PromptEditor.js +115 -0
- package/dist/chat/ui/Timeline.d.ts +2 -1
- package/dist/chat/ui/Timeline.js +13 -1
- package/dist/chat/ui/VisualFrame.d.ts +8 -0
- package/dist/chat/ui/VisualFrame.js +217 -115
- package/dist/chat/ui/composer/ComposerControls.d.ts +3 -0
- package/dist/chat/ui/composer/ComposerControls.js +235 -38
- package/dist/chat/ui/composer/key-handler.d.ts +1 -1
- package/dist/chat/ui/composer/key-handler.js +3 -11
- package/dist/chat/ui/composer/prompt-picks.d.ts +4 -0
- package/dist/chat/ui/composer/prompt-picks.js +14 -0
- package/dist/chat/ui/composer/use-composer-menus.d.ts +4 -49
- package/dist/chat/ui/composer/use-composer-menus.js +65 -519
- package/dist/chat/ui/composer/use-prompt-menus.d.ts +73 -0
- package/dist/chat/ui/composer/use-prompt-menus.js +536 -0
- package/dist/chat/ui/index.d.ts +4 -0
- package/dist/chat/ui/index.js +3 -0
- package/dist/chat/ui/rows/GeneratedImageRow.js +8 -4
- package/dist/chat/ui/rows/VisualRow.js +184 -142
- package/dist/chat/ui/rows/row-rhythm.js +6 -4
- package/dist/host-hooks.d.ts +2 -1
- package/dist/host-hooks.js +6 -0
- package/dist/host.d.ts +27 -1
- package/dist/index.d.ts +1 -1
- package/dist/locales/en/agent-chat.d.ts +1 -0
- package/dist/locales/en/agent-chat.js +1 -0
- package/dist/locales/nl/agent-chat.d.ts +1 -0
- package/dist/locales/nl/agent-chat.js +1 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.js +1 -0
- package/dist/theme.css +3 -0
- package/package.json +8 -8
- package/src/agents/AgentModelLabel.tsx +40 -0
- package/src/chat/logic/visual-height.ts +1 -1
- package/src/chat/ui/Composer.tsx +12 -3
- package/src/chat/ui/HostMenuItems.tsx +11 -0
- package/src/chat/ui/Pickers.tsx +4 -1
- package/src/chat/ui/PromptEditor.tsx +130 -0
- package/src/chat/ui/Timeline.tsx +22 -1
- package/src/chat/ui/VisualFrame.tsx +68 -21
- package/src/chat/ui/composer/ComposerControls.tsx +65 -15
- package/src/chat/ui/composer/key-handler.ts +3 -9
- package/src/chat/ui/composer/prompt-picks.ts +17 -0
- package/src/chat/ui/composer/use-composer-menus.ts +18 -275
- package/src/chat/ui/composer/use-prompt-menus.ts +341 -0
- package/src/chat/ui/index.ts +4 -0
- package/src/chat/ui/rows/GeneratedImageRow.tsx +9 -4
- package/src/chat/ui/rows/VisualRow.tsx +5 -1
- package/src/chat/ui/rows/row-rhythm.ts +6 -4
- package/src/host-hooks.ts +9 -1
- package/src/host.ts +45 -1
- package/src/index.ts +3 -0
- package/src/locales/en/agent-chat.ts +1 -0
- package/src/locales/nl/agent-chat.ts +1 -0
- package/src/providers/index.ts +1 -0
- package/src/theme.css +3 -0
package/dist/chat/ui/Composer.js
CHANGED
|
@@ -43,7 +43,7 @@ import { usePromptHistory } from './composer/use-prompt-history.js';
|
|
|
43
43
|
import { usePromptHold } from './composer/use-prompt-hold.js';
|
|
44
44
|
import { surfacePartOf } from './composer/surface.js';
|
|
45
45
|
import { useTakeBack } from './composer/use-take-back.js';
|
|
46
|
-
import { useHostExtraPrompts, useHostSendDelivery } from '../../host-hooks.js';
|
|
46
|
+
import { useHostComposerSendActions, useHostExtraPrompts, useHostSendDelivery } from '../../host-hooks.js';
|
|
47
47
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
48
48
|
function sendLabelKey(busy, steerable, delivery) {
|
|
49
49
|
if (!busy) {
|
|
@@ -55,7 +55,7 @@ function sendLabelKey(busy, steerable, delivery) {
|
|
|
55
55
|
return delivery === 'steer' ? 'composer.steerButton' : 'composer.queueWithSteerButton';
|
|
56
56
|
}
|
|
57
57
|
export function Composer(t0) {
|
|
58
|
-
const $ = _c(
|
|
58
|
+
const $ = _c(239);
|
|
59
59
|
const {
|
|
60
60
|
chatId,
|
|
61
61
|
info,
|
|
@@ -205,6 +205,7 @@ export function Composer(t0) {
|
|
|
205
205
|
const continuable = useContinuableTurn(chatId, info);
|
|
206
206
|
const [sentFor, setSentFor] = useState(null);
|
|
207
207
|
const extraPrompts = useHostExtraPrompts(scope.id, chatId);
|
|
208
|
+
const sendActions = useHostComposerSendActions(scope.id, chatId);
|
|
208
209
|
let t11;
|
|
209
210
|
if ($[35] !== continuable || $[36] !== onSend) {
|
|
210
211
|
t11 = (text, extras) => {
|
|
@@ -367,16 +368,8 @@ export function Composer(t0) {
|
|
|
367
368
|
}
|
|
368
369
|
useEffect(t21, t22);
|
|
369
370
|
let t23;
|
|
370
|
-
if ($[66] !==
|
|
371
|
-
t23 =
|
|
372
|
-
$[66] = box;
|
|
373
|
-
$[67] = t23;
|
|
374
|
-
} else {
|
|
375
|
-
t23 = $[67];
|
|
376
|
-
}
|
|
377
|
-
let t24;
|
|
378
|
-
if ($[68] !== chatId || $[69] !== draft.text || $[70] !== files.noteKey || $[71] !== history || $[72] !== host || $[73] !== menus || $[74] !== sendKey || $[75] !== submit || $[76] !== t23 || $[77] !== toggleStash) {
|
|
379
|
-
t24 = composerKeyHandler({
|
|
371
|
+
if ($[66] !== chatId || $[67] !== draft.text || $[68] !== files.noteKey || $[69] !== history || $[70] !== host || $[71] !== menus || $[72] !== sendKey || $[73] !== submit || $[74] !== toggleStash) {
|
|
372
|
+
t23 = composerKeyHandler({
|
|
380
373
|
chatId,
|
|
381
374
|
host,
|
|
382
375
|
sendKey,
|
|
@@ -385,44 +378,42 @@ export function Composer(t0) {
|
|
|
385
378
|
history,
|
|
386
379
|
noteKey: files.noteKey,
|
|
387
380
|
toggleStash,
|
|
388
|
-
setText: t23,
|
|
389
381
|
submit
|
|
390
382
|
});
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
393
|
-
$[
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
$[
|
|
400
|
-
$[
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
const onKeyDown = t24;
|
|
383
|
+
$[66] = chatId;
|
|
384
|
+
$[67] = draft.text;
|
|
385
|
+
$[68] = files.noteKey;
|
|
386
|
+
$[69] = history;
|
|
387
|
+
$[70] = host;
|
|
388
|
+
$[71] = menus;
|
|
389
|
+
$[72] = sendKey;
|
|
390
|
+
$[73] = submit;
|
|
391
|
+
$[74] = toggleStash;
|
|
392
|
+
$[75] = t23;
|
|
393
|
+
} else {
|
|
394
|
+
t23 = $[75];
|
|
395
|
+
}
|
|
396
|
+
const onKeyDown = t23;
|
|
406
397
|
const pointSurface = _temp4;
|
|
407
|
-
let
|
|
408
|
-
if ($[
|
|
409
|
-
|
|
398
|
+
let t24;
|
|
399
|
+
if ($[76] !== writable) {
|
|
400
|
+
t24 = event_0 => {
|
|
410
401
|
if (!writable || event_0.button !== 0 || event_0.defaultPrevented || surfacePartOf(event_0.target, event_0.currentTarget) !== "surface") {
|
|
411
402
|
return;
|
|
412
403
|
}
|
|
413
404
|
event_0.preventDefault();
|
|
414
405
|
inputRef.current?.setCaret(Infinity);
|
|
415
406
|
};
|
|
416
|
-
$[
|
|
417
|
-
$[
|
|
407
|
+
$[76] = writable;
|
|
408
|
+
$[77] = t24;
|
|
418
409
|
} else {
|
|
419
|
-
|
|
410
|
+
t24 = $[77];
|
|
420
411
|
}
|
|
421
|
-
const pressSurface =
|
|
422
|
-
const
|
|
423
|
-
let
|
|
424
|
-
if ($[
|
|
425
|
-
|
|
412
|
+
const pressSurface = t24;
|
|
413
|
+
const t25 = "chat-composer-content pointer-events-none relative z-10 w-full";
|
|
414
|
+
let t26;
|
|
415
|
+
if ($[78] !== atEnd || $[79] !== chatId || $[80] !== readOnly || $[81] !== t) {
|
|
416
|
+
t26 = !atEnd && !readOnly && /*#__PURE__*/_jsx("div", {
|
|
426
417
|
className: "absolute inset-x-0 bottom-full mb-2 flex justify-center",
|
|
427
418
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
|
428
419
|
label: t("composer.jumpToEnd"),
|
|
@@ -439,477 +430,511 @@ export function Composer(t0) {
|
|
|
439
430
|
})
|
|
440
431
|
})
|
|
441
432
|
});
|
|
442
|
-
$[
|
|
443
|
-
$[
|
|
444
|
-
$[
|
|
445
|
-
$[
|
|
446
|
-
$[
|
|
433
|
+
$[78] = atEnd;
|
|
434
|
+
$[79] = chatId;
|
|
435
|
+
$[80] = readOnly;
|
|
436
|
+
$[81] = t;
|
|
437
|
+
$[82] = t26;
|
|
447
438
|
} else {
|
|
448
|
-
|
|
439
|
+
t26 = $[82];
|
|
449
440
|
}
|
|
450
|
-
let
|
|
451
|
-
if ($[
|
|
452
|
-
|
|
441
|
+
let t27;
|
|
442
|
+
if ($[83] !== chatId) {
|
|
443
|
+
t27 = /*#__PURE__*/_jsx(ChatActivity, {
|
|
453
444
|
chatId: chatId
|
|
454
445
|
});
|
|
455
|
-
$[
|
|
456
|
-
$[
|
|
446
|
+
$[83] = chatId;
|
|
447
|
+
$[84] = t27;
|
|
457
448
|
} else {
|
|
458
|
-
|
|
449
|
+
t27 = $[84];
|
|
459
450
|
}
|
|
460
|
-
const
|
|
461
|
-
let
|
|
462
|
-
if ($[
|
|
463
|
-
|
|
464
|
-
$[
|
|
465
|
-
$[
|
|
451
|
+
const t28 = files.dragging ? "border-accent bg-[color-mix(in_srgb,var(--accent-soft)_60%,var(--surface-raised))]" : "border-border bg-[color-mix(in_srgb,var(--surface-raised)_92%,transparent)]";
|
|
452
|
+
let t29;
|
|
453
|
+
if ($[85] !== t28) {
|
|
454
|
+
t29 = clsx("@container/composer pointer-events-auto flex flex-col overflow-hidden rounded-2xl border shadow-float backdrop-blur-[14px] focus-ring-within", t28);
|
|
455
|
+
$[85] = t28;
|
|
456
|
+
$[86] = t29;
|
|
466
457
|
} else {
|
|
467
|
-
|
|
458
|
+
t29 = $[86];
|
|
468
459
|
}
|
|
469
|
-
const
|
|
460
|
+
const t30 = files.dropTarget;
|
|
470
461
|
const T0 = PromptComposer;
|
|
471
|
-
const
|
|
472
|
-
const
|
|
473
|
-
let
|
|
474
|
-
if ($[
|
|
475
|
-
|
|
476
|
-
$[
|
|
462
|
+
const t31 = !empty;
|
|
463
|
+
const t32 = capabilities?.denyReason === true;
|
|
464
|
+
let t33;
|
|
465
|
+
if ($[87] === Symbol.for("react.memo_cache_sentinel")) {
|
|
466
|
+
t33 = () => inputRef.current?.focus();
|
|
467
|
+
$[87] = t33;
|
|
468
|
+
} else {
|
|
469
|
+
t33 = $[87];
|
|
470
|
+
}
|
|
471
|
+
const t34 = writable && "data-[text-cursor]:cursor-text";
|
|
472
|
+
let t35;
|
|
473
|
+
if ($[88] !== t34) {
|
|
474
|
+
t35 = clsx(t34);
|
|
475
|
+
$[88] = t34;
|
|
476
|
+
$[89] = t35;
|
|
477
477
|
} else {
|
|
478
|
-
|
|
478
|
+
t35 = $[89];
|
|
479
479
|
}
|
|
480
|
-
const t35 = writable && "data-[text-cursor]:cursor-text";
|
|
481
480
|
let t36;
|
|
482
|
-
if ($[91] !==
|
|
483
|
-
t36 =
|
|
484
|
-
|
|
481
|
+
if ($[90] !== chatId || $[91] !== info) {
|
|
482
|
+
t36 = /*#__PURE__*/_jsx(LimitDock, {
|
|
483
|
+
chatId: chatId,
|
|
484
|
+
info: info
|
|
485
|
+
});
|
|
486
|
+
$[90] = chatId;
|
|
487
|
+
$[91] = info;
|
|
485
488
|
$[92] = t36;
|
|
486
489
|
} else {
|
|
487
490
|
t36 = $[92];
|
|
488
491
|
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
+
const t37 = capabilities?.goals;
|
|
493
|
+
let t38;
|
|
494
|
+
if ($[93] !== chatId || $[94] !== info || $[95] !== t37) {
|
|
495
|
+
t38 = /*#__PURE__*/_jsx(GoalDock, {
|
|
492
496
|
chatId: chatId,
|
|
493
|
-
info: info
|
|
497
|
+
info: info,
|
|
498
|
+
goals: t37
|
|
494
499
|
});
|
|
495
500
|
$[93] = chatId;
|
|
496
501
|
$[94] = info;
|
|
497
502
|
$[95] = t37;
|
|
503
|
+
$[96] = t38;
|
|
498
504
|
} else {
|
|
499
|
-
|
|
505
|
+
t38 = $[96];
|
|
500
506
|
}
|
|
501
|
-
const t38 = capabilities?.goals;
|
|
502
507
|
let t39;
|
|
503
|
-
if ($[
|
|
504
|
-
t39 = /*#__PURE__*/_jsx(
|
|
505
|
-
chatId: chatId,
|
|
506
|
-
info: info,
|
|
507
|
-
goals: t38
|
|
508
|
-
});
|
|
509
|
-
$[96] = chatId;
|
|
510
|
-
$[97] = info;
|
|
511
|
-
$[98] = t38;
|
|
512
|
-
$[99] = t39;
|
|
513
|
-
} else {
|
|
514
|
-
t39 = $[99];
|
|
515
|
-
}
|
|
516
|
-
let t40;
|
|
517
|
-
if ($[100] !== chatId || $[101] !== compactionOffer || $[102] !== controls.compact || $[103] !== scope) {
|
|
518
|
-
t40 = compactionOffer && /*#__PURE__*/_jsx(ResumeCompactionDock, {
|
|
508
|
+
if ($[97] !== chatId || $[98] !== compactionOffer || $[99] !== controls.compact || $[100] !== scope) {
|
|
509
|
+
t39 = compactionOffer && /*#__PURE__*/_jsx(ResumeCompactionDock, {
|
|
519
510
|
tokens: compactionOffer.tokens,
|
|
520
511
|
reason: compactionOffer.reason,
|
|
521
512
|
onCompact: controls.compact,
|
|
522
513
|
onDismiss: () => dismissResumeCompaction(scope, chatId, compactionOffer.turnId)
|
|
523
514
|
});
|
|
524
|
-
$[
|
|
525
|
-
$[
|
|
526
|
-
$[
|
|
527
|
-
$[
|
|
528
|
-
$[
|
|
515
|
+
$[97] = chatId;
|
|
516
|
+
$[98] = compactionOffer;
|
|
517
|
+
$[99] = controls.compact;
|
|
518
|
+
$[100] = scope;
|
|
519
|
+
$[101] = t39;
|
|
529
520
|
} else {
|
|
530
|
-
|
|
521
|
+
t39 = $[101];
|
|
531
522
|
}
|
|
532
|
-
let
|
|
533
|
-
if ($[
|
|
534
|
-
|
|
523
|
+
let t40;
|
|
524
|
+
if ($[102] !== menus) {
|
|
525
|
+
t40 = /*#__PURE__*/_jsx(ComposerMenu, {
|
|
535
526
|
menus: menus
|
|
536
527
|
});
|
|
537
|
-
$[
|
|
538
|
-
$[
|
|
528
|
+
$[102] = menus;
|
|
529
|
+
$[103] = t40;
|
|
539
530
|
} else {
|
|
540
|
-
|
|
531
|
+
t40 = $[103];
|
|
541
532
|
}
|
|
542
|
-
let
|
|
543
|
-
if ($[
|
|
544
|
-
|
|
533
|
+
let t41;
|
|
534
|
+
if ($[104] !== chatId || $[105] !== info.queuePaused || $[106] !== queue || $[107] !== takeBack || $[108] !== takingBack) {
|
|
535
|
+
t41 = queue.length > 0 && /*#__PURE__*/_jsx(QueuedMessages, {
|
|
545
536
|
chatId: chatId,
|
|
546
537
|
queue: queue,
|
|
547
538
|
paused: info.queuePaused === true,
|
|
548
539
|
takingBack: takingBack !== null,
|
|
549
540
|
onEdit: message => void takeBack(message)
|
|
550
541
|
});
|
|
551
|
-
$[
|
|
552
|
-
$[
|
|
553
|
-
$[
|
|
554
|
-
$[
|
|
555
|
-
$[
|
|
556
|
-
$[
|
|
542
|
+
$[104] = chatId;
|
|
543
|
+
$[105] = info.queuePaused;
|
|
544
|
+
$[106] = queue;
|
|
545
|
+
$[107] = takeBack;
|
|
546
|
+
$[108] = takingBack;
|
|
547
|
+
$[109] = t41;
|
|
557
548
|
} else {
|
|
558
|
-
|
|
549
|
+
t41 = $[109];
|
|
559
550
|
}
|
|
560
|
-
let
|
|
561
|
-
if ($[
|
|
562
|
-
|
|
551
|
+
let t42;
|
|
552
|
+
if ($[110] !== box.removeQuote || $[111] !== chatId || $[112] !== draft.quote || $[113] !== draft.quoteSource || $[114] !== notice || $[115] !== t) {
|
|
553
|
+
t42 = draft.quote !== "" && /*#__PURE__*/_jsx(DraftQuote, {
|
|
563
554
|
chatId: chatId,
|
|
564
555
|
quote: draft.quote,
|
|
565
556
|
source: draft.quoteSource,
|
|
566
557
|
onRemove: box.removeQuote,
|
|
567
558
|
onSourceGone: () => notice.setNotice(t("rows.user.quoteGone"), "info")
|
|
568
559
|
});
|
|
569
|
-
$[
|
|
570
|
-
$[
|
|
571
|
-
$[
|
|
572
|
-
$[
|
|
573
|
-
$[
|
|
574
|
-
$[
|
|
575
|
-
$[
|
|
560
|
+
$[110] = box.removeQuote;
|
|
561
|
+
$[111] = chatId;
|
|
562
|
+
$[112] = draft.quote;
|
|
563
|
+
$[113] = draft.quoteSource;
|
|
564
|
+
$[114] = notice;
|
|
565
|
+
$[115] = t;
|
|
566
|
+
$[116] = t42;
|
|
576
567
|
} else {
|
|
577
|
-
|
|
568
|
+
t42 = $[116];
|
|
578
569
|
}
|
|
579
|
-
let
|
|
580
|
-
if ($[
|
|
581
|
-
|
|
570
|
+
let t43;
|
|
571
|
+
if ($[117] !== box.removeAttachment || $[118] !== draft.attachments) {
|
|
572
|
+
t43 = draft.attachments.length > 0 && /*#__PURE__*/_jsx(DraftAttachments, {
|
|
582
573
|
attachments: draft.attachments,
|
|
583
574
|
onRemove: box.removeAttachment
|
|
584
575
|
});
|
|
585
|
-
$[
|
|
586
|
-
$[
|
|
587
|
-
$[
|
|
576
|
+
$[117] = box.removeAttachment;
|
|
577
|
+
$[118] = draft.attachments;
|
|
578
|
+
$[119] = t43;
|
|
588
579
|
} else {
|
|
589
|
-
|
|
580
|
+
t43 = $[119];
|
|
590
581
|
}
|
|
591
|
-
const
|
|
592
|
-
let
|
|
593
|
-
if ($[
|
|
594
|
-
|
|
582
|
+
const t44 = !writable;
|
|
583
|
+
let t45;
|
|
584
|
+
if ($[120] !== box || $[121] !== history || $[122] !== hold || $[123] !== menus) {
|
|
585
|
+
t45 = (value, selection, state) => {
|
|
595
586
|
hold.noteInput();
|
|
596
587
|
box.setText(value);
|
|
597
588
|
menus.setMenuIndex(0);
|
|
598
589
|
menus.trackTriggers(value, selection, state);
|
|
599
590
|
history.edited(value);
|
|
600
591
|
};
|
|
601
|
-
$[
|
|
602
|
-
$[
|
|
603
|
-
$[
|
|
604
|
-
$[
|
|
605
|
-
$[
|
|
592
|
+
$[120] = box;
|
|
593
|
+
$[121] = history;
|
|
594
|
+
$[122] = hold;
|
|
595
|
+
$[123] = menus;
|
|
596
|
+
$[124] = t45;
|
|
606
597
|
} else {
|
|
607
|
-
|
|
598
|
+
t45 = $[124];
|
|
608
599
|
}
|
|
609
|
-
let
|
|
610
|
-
if ($[
|
|
611
|
-
|
|
600
|
+
let t46;
|
|
601
|
+
if ($[125] !== hold || $[126] !== menus) {
|
|
602
|
+
t46 = () => {
|
|
612
603
|
menus.close();
|
|
613
604
|
hold.release("blur");
|
|
614
605
|
};
|
|
615
|
-
$[
|
|
616
|
-
$[
|
|
617
|
-
$[
|
|
606
|
+
$[125] = hold;
|
|
607
|
+
$[126] = menus;
|
|
608
|
+
$[127] = t46;
|
|
618
609
|
} else {
|
|
619
|
-
|
|
610
|
+
t46 = $[127];
|
|
620
611
|
}
|
|
621
|
-
let
|
|
622
|
-
if ($[
|
|
623
|
-
|
|
612
|
+
let t47;
|
|
613
|
+
if ($[128] !== dictationToolbar || $[129] !== draft.text || $[130] !== editorExtensions || $[131] !== files.onCopy || $[132] !== files.onPaste || $[133] !== focused || $[134] !== hold.setComposing || $[135] !== menus.inputAria || $[136] !== menus.trackTriggers || $[137] !== onKeyDown || $[138] !== placeholder || $[139] !== t44 || $[140] !== t45 || $[141] !== t46) {
|
|
614
|
+
t47 = /*#__PURE__*/_jsx(ComposerInput, {
|
|
624
615
|
ref: inputRef,
|
|
625
616
|
dictationToolbar: dictationToolbar,
|
|
626
617
|
className: "composer-input select-text text-sm leading-normal text-text",
|
|
627
618
|
value: draft.text,
|
|
628
619
|
placeholder: placeholder,
|
|
629
|
-
disabled:
|
|
620
|
+
disabled: t44,
|
|
630
621
|
tabbable: focused,
|
|
631
622
|
extensions: editorExtensions,
|
|
632
623
|
aria: menus.inputAria,
|
|
633
|
-
onChange:
|
|
624
|
+
onChange: t45,
|
|
634
625
|
onSelectionChange: menus.trackTriggers,
|
|
635
|
-
onBlur:
|
|
626
|
+
onBlur: t46,
|
|
636
627
|
onComposing: hold.setComposing,
|
|
637
628
|
onKeyDown: onKeyDown,
|
|
638
629
|
onPaste: files.onPaste,
|
|
639
630
|
onCopy: files.onCopy
|
|
640
631
|
});
|
|
641
|
-
$[
|
|
642
|
-
$[
|
|
643
|
-
$[
|
|
644
|
-
$[
|
|
645
|
-
$[
|
|
646
|
-
$[
|
|
647
|
-
$[
|
|
648
|
-
$[
|
|
649
|
-
$[
|
|
650
|
-
$[
|
|
651
|
-
$[
|
|
652
|
-
$[
|
|
653
|
-
$[
|
|
654
|
-
$[
|
|
655
|
-
$[
|
|
656
|
-
} else {
|
|
657
|
-
|
|
632
|
+
$[128] = dictationToolbar;
|
|
633
|
+
$[129] = draft.text;
|
|
634
|
+
$[130] = editorExtensions;
|
|
635
|
+
$[131] = files.onCopy;
|
|
636
|
+
$[132] = files.onPaste;
|
|
637
|
+
$[133] = focused;
|
|
638
|
+
$[134] = hold.setComposing;
|
|
639
|
+
$[135] = menus.inputAria;
|
|
640
|
+
$[136] = menus.trackTriggers;
|
|
641
|
+
$[137] = onKeyDown;
|
|
642
|
+
$[138] = placeholder;
|
|
643
|
+
$[139] = t44;
|
|
644
|
+
$[140] = t45;
|
|
645
|
+
$[141] = t46;
|
|
646
|
+
$[142] = t47;
|
|
647
|
+
} else {
|
|
648
|
+
t47 = $[142];
|
|
658
649
|
}
|
|
659
|
-
let
|
|
660
|
-
if ($[
|
|
661
|
-
|
|
650
|
+
let t48;
|
|
651
|
+
if ($[143] !== notice.notice || $[144] !== notice.tone) {
|
|
652
|
+
t48 = notice.notice && /*#__PURE__*/_jsx("div", {
|
|
662
653
|
className: clsx("px-5 pb-1 text-xs @max-md/composer:px-3.5", notice.tone === "error" ? "text-status-error" : "text-text-muted"),
|
|
663
654
|
role: notice.tone === "error" ? "alert" : "status",
|
|
664
655
|
children: notice.notice
|
|
665
656
|
});
|
|
666
|
-
$[
|
|
667
|
-
$[
|
|
668
|
-
$[
|
|
657
|
+
$[143] = notice.notice;
|
|
658
|
+
$[144] = notice.tone;
|
|
659
|
+
$[145] = t48;
|
|
669
660
|
} else {
|
|
670
|
-
|
|
661
|
+
t48 = $[145];
|
|
671
662
|
}
|
|
672
|
-
const
|
|
663
|
+
const t49 = guard.visible && /*#__PURE__*/_jsxs("div", {
|
|
673
664
|
className: clsx("px-5 pb-1 text-right text-xs tabular-nums @max-md/composer:px-3.5", guard.tooLong ? "text-status-error" : "text-text-faint"),
|
|
674
665
|
children: [formatNumber(guard.count), " / ", formatNumber(PROMPT_MAX_CHARS), guard.tooLong && ` ${t("composer.tooLong")}`]
|
|
675
666
|
});
|
|
676
667
|
const T1 = ComposerControls;
|
|
677
|
-
const
|
|
678
|
-
const
|
|
679
|
-
const
|
|
680
|
-
const
|
|
668
|
+
const t50 = capabilities?.attachments !== false;
|
|
669
|
+
const t51 = !busy || !empty;
|
|
670
|
+
const t52 = empty || !writable || guard.tooLong;
|
|
671
|
+
const t53 = t(sendLabelKey(busy, steerable, sendDelivery));
|
|
672
|
+
let t54;
|
|
673
|
+
if ($[146] !== draft.text || $[147] !== sendKey) {
|
|
674
|
+
t54 = sendShortcut(sendKey, draft.text.includes("\n"));
|
|
675
|
+
$[146] = draft.text;
|
|
676
|
+
$[147] = sendKey;
|
|
677
|
+
$[148] = t54;
|
|
678
|
+
} else {
|
|
679
|
+
t54 = $[148];
|
|
680
|
+
}
|
|
681
681
|
let t55;
|
|
682
|
-
if ($[149] !==
|
|
683
|
-
t55 =
|
|
684
|
-
$[149] =
|
|
685
|
-
$[150] =
|
|
686
|
-
$[151] = t55;
|
|
682
|
+
if ($[149] !== submit) {
|
|
683
|
+
t55 = alternate => submit(alternate ? "alternate" : "default");
|
|
684
|
+
$[149] = submit;
|
|
685
|
+
$[150] = t55;
|
|
687
686
|
} else {
|
|
688
|
-
t55 = $[
|
|
687
|
+
t55 = $[150];
|
|
689
688
|
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
689
|
+
const t56 = continuable !== null && continuable !== sentFor && empty && writable && pending.length === 0 && extraPrompts.length === 0 ? continueTurn : null;
|
|
690
|
+
const t57 = scope.id;
|
|
691
|
+
let t58;
|
|
692
|
+
if ($[151] !== draft.quote || $[152] !== draft.text) {
|
|
693
|
+
t58 = withQuote(draft.quote, draft.text.trim());
|
|
694
|
+
$[151] = draft.quote;
|
|
695
|
+
$[152] = draft.text;
|
|
696
|
+
$[153] = t58;
|
|
695
697
|
} else {
|
|
696
|
-
|
|
698
|
+
t58 = $[153];
|
|
697
699
|
}
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
onContinue: t57
|
|
700
|
+
let t59;
|
|
701
|
+
if ($[154] !== chatId || $[155] !== info.provider || $[156] !== info.runtimeMode || $[157] !== info.selection || $[158] !== scope.id || $[159] !== t58) {
|
|
702
|
+
t59 = {
|
|
703
|
+
scopeId: t57,
|
|
704
|
+
chatId,
|
|
705
|
+
text: t58,
|
|
706
|
+
provider: info.provider,
|
|
707
|
+
selection: info.selection,
|
|
708
|
+
runtimeMode: info.runtimeMode
|
|
708
709
|
};
|
|
709
|
-
$[154] =
|
|
710
|
-
$[155] =
|
|
711
|
-
$[156] =
|
|
712
|
-
$[157] =
|
|
713
|
-
$[158] =
|
|
714
|
-
$[159] =
|
|
715
|
-
$[160] =
|
|
710
|
+
$[154] = chatId;
|
|
711
|
+
$[155] = info.provider;
|
|
712
|
+
$[156] = info.runtimeMode;
|
|
713
|
+
$[157] = info.selection;
|
|
714
|
+
$[158] = scope.id;
|
|
715
|
+
$[159] = t58;
|
|
716
|
+
$[160] = t59;
|
|
716
717
|
} else {
|
|
717
|
-
|
|
718
|
+
t59 = $[160];
|
|
718
719
|
}
|
|
719
|
-
let
|
|
720
|
-
if ($[161] !==
|
|
721
|
-
|
|
720
|
+
let t60;
|
|
721
|
+
if ($[161] !== sendActions || $[162] !== t51 || $[163] !== t52 || $[164] !== t53 || $[165] !== t54 || $[166] !== t55 || $[167] !== t56 || $[168] !== t59) {
|
|
722
|
+
t60 = {
|
|
723
|
+
visible: t51,
|
|
724
|
+
disabled: t52,
|
|
725
|
+
label: t53,
|
|
726
|
+
kbd: t54,
|
|
727
|
+
onSend: t55,
|
|
728
|
+
onContinue: t56,
|
|
729
|
+
actions: sendActions,
|
|
730
|
+
draft: t59
|
|
731
|
+
};
|
|
732
|
+
$[161] = sendActions;
|
|
733
|
+
$[162] = t51;
|
|
734
|
+
$[163] = t52;
|
|
735
|
+
$[164] = t53;
|
|
736
|
+
$[165] = t54;
|
|
737
|
+
$[166] = t55;
|
|
738
|
+
$[167] = t56;
|
|
739
|
+
$[168] = t59;
|
|
740
|
+
$[169] = t60;
|
|
741
|
+
} else {
|
|
742
|
+
t60 = $[169];
|
|
743
|
+
}
|
|
744
|
+
let t61;
|
|
745
|
+
if ($[170] !== files) {
|
|
746
|
+
t61 = picked => {
|
|
722
747
|
files.addFiles(picked);
|
|
723
748
|
inputRef.current?.focus();
|
|
724
749
|
};
|
|
725
|
-
$[
|
|
726
|
-
$[
|
|
750
|
+
$[170] = files;
|
|
751
|
+
$[171] = t61;
|
|
727
752
|
} else {
|
|
728
|
-
|
|
753
|
+
t61 = $[171];
|
|
729
754
|
}
|
|
730
|
-
let
|
|
731
|
-
if ($[
|
|
732
|
-
|
|
755
|
+
let t62;
|
|
756
|
+
if ($[172] !== writable) {
|
|
757
|
+
t62 = added => {
|
|
733
758
|
if (writable) {
|
|
734
759
|
inputRef.current?.insert(added);
|
|
735
760
|
}
|
|
736
761
|
};
|
|
737
|
-
$[
|
|
738
|
-
$[
|
|
762
|
+
$[172] = writable;
|
|
763
|
+
$[173] = t62;
|
|
739
764
|
} else {
|
|
740
|
-
|
|
765
|
+
t62 = $[173];
|
|
741
766
|
}
|
|
742
|
-
let
|
|
743
|
-
if ($[
|
|
744
|
-
|
|
767
|
+
let t63;
|
|
768
|
+
if ($[174] !== T1 || $[175] !== chatId || $[176] !== controls || $[177] !== info || $[178] !== providerFixed || $[179] !== restoreStashed || $[180] !== setDictationToolbar || $[181] !== t50 || $[182] !== t60 || $[183] !== t61 || $[184] !== t62 || $[185] !== writable) {
|
|
769
|
+
t63 = /*#__PURE__*/_jsx(T1, {
|
|
745
770
|
chatId: chatId,
|
|
746
771
|
info: info,
|
|
747
772
|
providerFixed: providerFixed,
|
|
748
773
|
writable: writable,
|
|
749
|
-
attachable:
|
|
774
|
+
attachable: t50,
|
|
750
775
|
controls: controls,
|
|
751
|
-
send:
|
|
776
|
+
send: t60,
|
|
752
777
|
dictationToolbar: setDictationToolbar,
|
|
753
|
-
onFiles:
|
|
778
|
+
onFiles: t61,
|
|
754
779
|
onRestore: restoreStashed,
|
|
755
|
-
insert:
|
|
780
|
+
insert: t62
|
|
756
781
|
});
|
|
757
|
-
$[
|
|
758
|
-
$[
|
|
759
|
-
$[
|
|
760
|
-
$[
|
|
761
|
-
$[
|
|
762
|
-
$[
|
|
763
|
-
$[
|
|
764
|
-
$[
|
|
765
|
-
$[
|
|
766
|
-
$[
|
|
767
|
-
$[
|
|
768
|
-
$[
|
|
769
|
-
$[
|
|
770
|
-
} else {
|
|
771
|
-
|
|
782
|
+
$[174] = T1;
|
|
783
|
+
$[175] = chatId;
|
|
784
|
+
$[176] = controls;
|
|
785
|
+
$[177] = info;
|
|
786
|
+
$[178] = providerFixed;
|
|
787
|
+
$[179] = restoreStashed;
|
|
788
|
+
$[180] = setDictationToolbar;
|
|
789
|
+
$[181] = t50;
|
|
790
|
+
$[182] = t60;
|
|
791
|
+
$[183] = t61;
|
|
792
|
+
$[184] = t62;
|
|
793
|
+
$[185] = writable;
|
|
794
|
+
$[186] = t63;
|
|
795
|
+
} else {
|
|
796
|
+
t63 = $[186];
|
|
772
797
|
}
|
|
773
|
-
let
|
|
774
|
-
if ($[
|
|
775
|
-
|
|
776
|
-
className:
|
|
798
|
+
let t64;
|
|
799
|
+
if ($[187] !== pointSurface || $[188] !== pressSurface || $[189] !== t35 || $[190] !== t36 || $[191] !== t38 || $[192] !== t39 || $[193] !== t40 || $[194] !== t41 || $[195] !== t42 || $[196] !== t43 || $[197] !== t47 || $[198] !== t48 || $[199] !== t49 || $[200] !== t63) {
|
|
800
|
+
t64 = /*#__PURE__*/_jsxs("div", {
|
|
801
|
+
className: t35,
|
|
777
802
|
onPointerOver: pointSurface,
|
|
778
803
|
onMouseDown: pressSurface,
|
|
779
|
-
children: [
|
|
804
|
+
children: [t36, t38, t39, t40, t41, t42, t43, t47, t48, t49, t63]
|
|
780
805
|
});
|
|
781
|
-
$[
|
|
782
|
-
$[
|
|
783
|
-
$[
|
|
784
|
-
$[
|
|
785
|
-
$[
|
|
786
|
-
$[
|
|
787
|
-
$[
|
|
788
|
-
$[
|
|
789
|
-
$[
|
|
790
|
-
$[
|
|
791
|
-
$[
|
|
792
|
-
$[
|
|
793
|
-
$[
|
|
794
|
-
$[
|
|
795
|
-
$[
|
|
796
|
-
} else {
|
|
797
|
-
|
|
798
|
-
}
|
|
799
|
-
let
|
|
800
|
-
if ($[
|
|
801
|
-
|
|
806
|
+
$[187] = pointSurface;
|
|
807
|
+
$[188] = pressSurface;
|
|
808
|
+
$[189] = t35;
|
|
809
|
+
$[190] = t36;
|
|
810
|
+
$[191] = t38;
|
|
811
|
+
$[192] = t39;
|
|
812
|
+
$[193] = t40;
|
|
813
|
+
$[194] = t41;
|
|
814
|
+
$[195] = t42;
|
|
815
|
+
$[196] = t43;
|
|
816
|
+
$[197] = t47;
|
|
817
|
+
$[198] = t48;
|
|
818
|
+
$[199] = t49;
|
|
819
|
+
$[200] = t63;
|
|
820
|
+
$[201] = t64;
|
|
821
|
+
} else {
|
|
822
|
+
t64 = $[201];
|
|
823
|
+
}
|
|
824
|
+
let t65;
|
|
825
|
+
if ($[202] !== T0 || $[203] !== answerPromptsElsewhere || $[204] !== chatId || $[205] !== disabled || $[206] !== focused || $[207] !== hold || $[208] !== pending || $[209] !== t31 || $[210] !== t32 || $[211] !== t33 || $[212] !== t64) {
|
|
826
|
+
t65 = /*#__PURE__*/_jsx(T0, {
|
|
802
827
|
chatId: chatId,
|
|
803
828
|
pending: pending,
|
|
804
829
|
focused: focused,
|
|
805
830
|
onShowElsewhere: answerPromptsElsewhere,
|
|
806
831
|
disabled: disabled,
|
|
807
|
-
hasDraft:
|
|
808
|
-
denyReason:
|
|
809
|
-
onAllAnswered:
|
|
832
|
+
hasDraft: t31,
|
|
833
|
+
denyReason: t32,
|
|
834
|
+
onAllAnswered: t33,
|
|
810
835
|
hold: hold,
|
|
811
|
-
children:
|
|
812
|
-
});
|
|
813
|
-
$[193] = T0;
|
|
814
|
-
$[194] = answerPromptsElsewhere;
|
|
815
|
-
$[195] = chatId;
|
|
816
|
-
$[196] = disabled;
|
|
817
|
-
$[197] = focused;
|
|
818
|
-
$[198] = hold;
|
|
819
|
-
$[199] = pending;
|
|
820
|
-
$[200] = t32;
|
|
821
|
-
$[201] = t33;
|
|
822
|
-
$[202] = t34;
|
|
823
|
-
$[203] = t62;
|
|
824
|
-
$[204] = t63;
|
|
825
|
-
} else {
|
|
826
|
-
t63 = $[204];
|
|
827
|
-
}
|
|
828
|
-
let t64;
|
|
829
|
-
if ($[205] !== files.dropTarget || $[206] !== t30 || $[207] !== t63) {
|
|
830
|
-
t64 = /*#__PURE__*/_jsx("div", {
|
|
831
|
-
className: t30,
|
|
832
|
-
...t31,
|
|
833
|
-
children: t63
|
|
836
|
+
children: t64
|
|
834
837
|
});
|
|
835
|
-
$[
|
|
836
|
-
$[
|
|
837
|
-
$[
|
|
838
|
-
$[
|
|
839
|
-
|
|
840
|
-
|
|
838
|
+
$[202] = T0;
|
|
839
|
+
$[203] = answerPromptsElsewhere;
|
|
840
|
+
$[204] = chatId;
|
|
841
|
+
$[205] = disabled;
|
|
842
|
+
$[206] = focused;
|
|
843
|
+
$[207] = hold;
|
|
844
|
+
$[208] = pending;
|
|
845
|
+
$[209] = t31;
|
|
846
|
+
$[210] = t32;
|
|
847
|
+
$[211] = t33;
|
|
848
|
+
$[212] = t64;
|
|
849
|
+
$[213] = t65;
|
|
850
|
+
} else {
|
|
851
|
+
t65 = $[213];
|
|
841
852
|
}
|
|
842
|
-
const t65 = controls.confirmClear;
|
|
843
853
|
let t66;
|
|
844
|
-
if ($[
|
|
845
|
-
t66 =
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
$[211] = t;
|
|
855
|
-
$[212] = t67;
|
|
854
|
+
if ($[214] !== files.dropTarget || $[215] !== t29 || $[216] !== t65) {
|
|
855
|
+
t66 = /*#__PURE__*/_jsx("div", {
|
|
856
|
+
className: t29,
|
|
857
|
+
...t30,
|
|
858
|
+
children: t65
|
|
859
|
+
});
|
|
860
|
+
$[214] = files.dropTarget;
|
|
861
|
+
$[215] = t29;
|
|
862
|
+
$[216] = t65;
|
|
863
|
+
$[217] = t66;
|
|
856
864
|
} else {
|
|
857
|
-
|
|
865
|
+
t66 = $[217];
|
|
858
866
|
}
|
|
867
|
+
const t67 = controls.confirmClear;
|
|
859
868
|
let t68;
|
|
860
|
-
if ($[
|
|
861
|
-
t68 = t("composer.clear.
|
|
862
|
-
$[
|
|
863
|
-
$[
|
|
869
|
+
if ($[218] !== t) {
|
|
870
|
+
t68 = t("composer.clear.title");
|
|
871
|
+
$[218] = t;
|
|
872
|
+
$[219] = t68;
|
|
864
873
|
} else {
|
|
865
|
-
t68 = $[
|
|
874
|
+
t68 = $[219];
|
|
866
875
|
}
|
|
867
876
|
let t69;
|
|
868
|
-
if ($[
|
|
869
|
-
t69 = t("composer.
|
|
870
|
-
$[
|
|
871
|
-
$[
|
|
877
|
+
if ($[220] !== t) {
|
|
878
|
+
t69 = t("composer.clear.description");
|
|
879
|
+
$[220] = t;
|
|
880
|
+
$[221] = t69;
|
|
872
881
|
} else {
|
|
873
|
-
t69 = $[
|
|
882
|
+
t69 = $[221];
|
|
874
883
|
}
|
|
875
884
|
let t70;
|
|
876
|
-
if ($[
|
|
877
|
-
t70 =
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
885
|
+
if ($[222] !== t) {
|
|
886
|
+
t70 = t("composer.clear.confirm");
|
|
887
|
+
$[222] = t;
|
|
888
|
+
$[223] = t70;
|
|
889
|
+
} else {
|
|
890
|
+
t70 = $[223];
|
|
891
|
+
}
|
|
892
|
+
let t71;
|
|
893
|
+
if ($[224] !== t) {
|
|
894
|
+
t71 = t("composer.notice.clearFailed");
|
|
895
|
+
$[224] = t;
|
|
896
|
+
$[225] = t71;
|
|
897
|
+
} else {
|
|
898
|
+
t71 = $[225];
|
|
899
|
+
}
|
|
900
|
+
let t72;
|
|
901
|
+
if ($[226] !== controls.cancelClear || $[227] !== controls.confirmClear || $[228] !== controls.forceClearThread || $[229] !== t68 || $[230] !== t69 || $[231] !== t70 || $[232] !== t71) {
|
|
902
|
+
t72 = /*#__PURE__*/_jsx(PromptDialog, {
|
|
903
|
+
open: t67,
|
|
904
|
+
title: t68,
|
|
905
|
+
description: t69,
|
|
906
|
+
confirmLabel: t70,
|
|
882
907
|
danger: true,
|
|
883
|
-
fallbackMessage:
|
|
908
|
+
fallbackMessage: t71,
|
|
884
909
|
onConfirm: controls.forceClearThread,
|
|
885
910
|
onOpenChange: controls.cancelClear
|
|
886
911
|
});
|
|
887
|
-
$[
|
|
888
|
-
$[
|
|
889
|
-
$[
|
|
890
|
-
$[
|
|
891
|
-
$[
|
|
892
|
-
$[
|
|
893
|
-
$[
|
|
894
|
-
$[
|
|
895
|
-
} else {
|
|
896
|
-
|
|
897
|
-
}
|
|
898
|
-
let
|
|
899
|
-
if ($[
|
|
900
|
-
|
|
901
|
-
className:
|
|
902
|
-
children: [
|
|
912
|
+
$[226] = controls.cancelClear;
|
|
913
|
+
$[227] = controls.confirmClear;
|
|
914
|
+
$[228] = controls.forceClearThread;
|
|
915
|
+
$[229] = t68;
|
|
916
|
+
$[230] = t69;
|
|
917
|
+
$[231] = t70;
|
|
918
|
+
$[232] = t71;
|
|
919
|
+
$[233] = t72;
|
|
920
|
+
} else {
|
|
921
|
+
t72 = $[233];
|
|
922
|
+
}
|
|
923
|
+
let t73;
|
|
924
|
+
if ($[234] !== t26 || $[235] !== t27 || $[236] !== t66 || $[237] !== t72) {
|
|
925
|
+
t73 = /*#__PURE__*/_jsxs("div", {
|
|
926
|
+
className: t25,
|
|
927
|
+
children: [t26, t27, t66, t72]
|
|
903
928
|
});
|
|
904
|
-
$[
|
|
905
|
-
$[
|
|
906
|
-
$[
|
|
907
|
-
$[
|
|
908
|
-
$[
|
|
929
|
+
$[234] = t26;
|
|
930
|
+
$[235] = t27;
|
|
931
|
+
$[236] = t66;
|
|
932
|
+
$[237] = t72;
|
|
933
|
+
$[238] = t73;
|
|
909
934
|
} else {
|
|
910
|
-
|
|
935
|
+
t73 = $[238];
|
|
911
936
|
}
|
|
912
|
-
return
|
|
937
|
+
return t73;
|
|
913
938
|
}
|
|
914
939
|
function _temp4(event) {
|
|
915
940
|
event.currentTarget.toggleAttribute("data-text-cursor", surfacePartOf(event.target, event.currentTarget) !== "action");
|