@tangle-network/agent-app 0.43.32 → 0.43.34
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/assistant/index.d.ts +8 -2
- package/dist/assistant/index.js +10 -4
- package/dist/assistant/index.js.map +1 -1
- package/dist/{chunk-FCQP75JT.js → chunk-4M6NUHKU.js} +28 -1
- package/dist/chunk-4M6NUHKU.js.map +1 -0
- package/dist/{chunk-JJGZ54EB.js → chunk-VG6U7FAB.js} +8 -4
- package/dist/chunk-VG6U7FAB.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/sandbox/index.d.ts +3 -1
- package/dist/sandbox/index.js +1 -1
- package/dist/web-react/index.d.ts +7 -1
- package/dist/web-react/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-FCQP75JT.js.map +0 -1
- package/dist/chunk-JJGZ54EB.js.map +0 -1
|
@@ -557,6 +557,8 @@ function ChatComposer({
|
|
|
557
557
|
value,
|
|
558
558
|
onValueChange,
|
|
559
559
|
initialValue,
|
|
560
|
+
seed,
|
|
561
|
+
onSeedApplied,
|
|
560
562
|
controls,
|
|
561
563
|
controlsPlacement = "above",
|
|
562
564
|
onAttach,
|
|
@@ -591,6 +593,31 @@ function ChatComposer({
|
|
|
591
593
|
el.style.height = "auto";
|
|
592
594
|
el.style.height = `${Math.min(el.scrollHeight, MAX_HEIGHT)}px`;
|
|
593
595
|
}, [text]);
|
|
596
|
+
const prevSeedRef = useRef3(null);
|
|
597
|
+
const pendingCaretRef = useRef3(null);
|
|
598
|
+
useEffect3(() => {
|
|
599
|
+
const prev = prevSeedRef.current;
|
|
600
|
+
prevSeedRef.current = seed ?? null;
|
|
601
|
+
if (seed == null || seed === prev || isControlled) return;
|
|
602
|
+
setText(seed);
|
|
603
|
+
onSeedApplied?.();
|
|
604
|
+
const el = textareaRef.current;
|
|
605
|
+
if (el && el.value === seed) {
|
|
606
|
+
el.focus();
|
|
607
|
+
el.setSelectionRange(seed.length, seed.length);
|
|
608
|
+
} else {
|
|
609
|
+
pendingCaretRef.current = seed;
|
|
610
|
+
}
|
|
611
|
+
}, [seed, setText, onSeedApplied, isControlled]);
|
|
612
|
+
useEffect3(() => {
|
|
613
|
+
if (pendingCaretRef.current == null || pendingCaretRef.current !== text)
|
|
614
|
+
return;
|
|
615
|
+
pendingCaretRef.current = null;
|
|
616
|
+
const el = textareaRef.current;
|
|
617
|
+
if (!el) return;
|
|
618
|
+
el.focus();
|
|
619
|
+
el.setSelectionRange(text.length, text.length);
|
|
620
|
+
}, [text]);
|
|
594
621
|
useEffect3(() => {
|
|
595
622
|
if (!focusShortcut || disabled) return;
|
|
596
623
|
function onKeyDown(e) {
|
|
@@ -2606,4 +2633,4 @@ export {
|
|
|
2606
2633
|
useThinkingSeconds,
|
|
2607
2634
|
ChatMessages
|
|
2608
2635
|
};
|
|
2609
|
-
//# sourceMappingURL=chunk-
|
|
2636
|
+
//# sourceMappingURL=chunk-4M6NUHKU.js.map
|