@tangle-network/agent-app 0.46.24 → 0.46.25

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.
@@ -9,7 +9,7 @@ import "../chunk-ENLRJYVW.js";
9
9
  import "../chunk-GEYACSFW.js";
10
10
  import {
11
11
  ChatComposer
12
- } from "../chunk-P2EC5VHG.js";
12
+ } from "../chunk-GAKGTIJ4.js";
13
13
  import "../chunk-L7MB2LLM.js";
14
14
  import {
15
15
  ModelPicker
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ComposerModeControls,
3
3
  EntryComposer
4
- } from "../chunk-P2EC5VHG.js";
4
+ } from "../chunk-GAKGTIJ4.js";
5
5
  import "../chunk-L7MB2LLM.js";
6
6
  import "../chunk-YDOQE47G.js";
7
7
  import "../chunk-EDTWGSQT.js";
@@ -272,7 +272,7 @@ import {
272
272
  } from "react";
273
273
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
274
274
  function createLazyMentionEditor() {
275
- return lazy(() => import("./mention-editor-WW7UVZMR.js").then((m) => m.loadMentionEditor()));
275
+ return lazy(() => import("./mention-editor-2ZSKDB32.js").then((m) => m.loadMentionEditor()));
276
276
  }
277
277
  var MentionEditorBoundary = class extends Component {
278
278
  state = { error: null };
@@ -513,9 +513,9 @@ function ChatComposer({
513
513
  if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "l") {
514
514
  if (mentionEnabled) {
515
515
  const focus = richFocusRef.current;
516
- if (!focus) return;
517
516
  e.preventDefault();
518
- focus();
517
+ if (focus) focus();
518
+ else textareaRef.current?.focus();
519
519
  } else {
520
520
  e.preventDefault();
521
521
  textareaRef.current?.focus();
@@ -768,6 +768,23 @@ function ChatComposer({
768
768
  const showAbove = controls != null && controlsPlacement === "above";
769
769
  const showInline = controls != null && !showAbove;
770
770
  const inputMinHeight = minRows * LINE_HEIGHT + TEXTAREA_PADDING_Y;
771
+ const textareaInput = /* @__PURE__ */ jsx(
772
+ "textarea",
773
+ {
774
+ ref: textareaRef,
775
+ value: text,
776
+ onChange: (e) => setText(e.target.value),
777
+ onKeyDown: handleKeyDown,
778
+ onPaste: onAttach ? handlePaste : void 0,
779
+ placeholder,
780
+ disabled,
781
+ autoFocus,
782
+ rows: minRows,
783
+ style: { minHeight: inputMinHeight, maxHeight },
784
+ "aria-label": "Message input",
785
+ className: "w-full resize-none bg-transparent px-1.5 py-1 text-base leading-6 text-foreground outline-none placeholder:text-muted-foreground disabled:opacity-50"
786
+ }
787
+ );
771
788
  return /* @__PURE__ */ jsxs(
772
789
  "div",
773
790
  {
@@ -919,11 +936,9 @@ function ChatComposer({
919
936
  className: `flex flex-col gap-1.5 rounded-2xl border border-card-edge bg-card px-3 py-2.5 transition focus-within:border-primary/40 focus-within:ring-2 focus-within:ring-primary/15 ${floating ? "shadow-raised" : ""}`,
920
937
  children: [
921
938
  mention ? (
922
- // The editor arrives as a lazy chunk; until it lands, a read-only
923
- // textarea with the same metrics holds the layout so the card
924
- // doesn't jump. The boundary contains a failed load (e.g. the
925
- // missing-peer error) to the input area instead of unmounting the
926
- // host's region.
939
+ // The editor arrives as a lazy chunk. The basic textarea stays usable
940
+ // through its download and initialization. The boundary contains a
941
+ // failed load instead of unmounting the host's region.
927
942
  /* @__PURE__ */ jsx(
928
943
  MentionEditorBoundary,
929
944
  {
@@ -933,64 +948,30 @@ function ChatComposer({
933
948
  },
934
949
  onFailed: () => setEditorFailed(true),
935
950
  draft: text,
936
- children: /* @__PURE__ */ jsx(
937
- Suspense,
951
+ children: /* @__PURE__ */ jsx(Suspense, { fallback: textareaInput, children: /* @__PURE__ */ jsx(
952
+ MentionEditor,
938
953
  {
939
- fallback: /* @__PURE__ */ jsx(
940
- "textarea",
941
- {
942
- rows: minRows,
943
- value: text,
944
- readOnly: true,
945
- disabled: true,
946
- placeholder,
947
- "aria-label": "Message input",
948
- style: { minHeight: inputMinHeight, maxHeight },
949
- className: "w-full resize-none bg-transparent px-1.5 py-1 text-base leading-6 text-foreground outline-none placeholder:text-muted-foreground disabled:opacity-50"
950
- }
951
- ),
952
- children: /* @__PURE__ */ jsx(
953
- MentionEditor,
954
- {
955
- value: text,
956
- onChange: setText,
957
- onSubmit: send,
958
- placeholder,
959
- disabled,
960
- autoFocus,
961
- minHeight: inputMinHeight,
962
- maxHeight,
963
- mention,
964
- registerFocus: registerRichFocus,
965
- onPasteFiles: onAttach ? ingestPastedFiles : void 0
966
- }
967
- )
954
+ value: text,
955
+ onChange: setText,
956
+ onSubmit: send,
957
+ placeholder,
958
+ disabled,
959
+ autoFocus,
960
+ minHeight: inputMinHeight,
961
+ maxHeight,
962
+ mention,
963
+ fallback: textareaInput,
964
+ registerFocus: registerRichFocus,
965
+ onPasteFiles: onAttach ? ingestPastedFiles : void 0
968
966
  }
969
- )
967
+ ) })
970
968
  },
971
969
  editorEpoch
972
970
  )
973
971
  ) : (
974
- // Focus: `outline-none` is safe because the card above draws the
975
- // keyboard indicator through `focus-within:` — one ring for
976
- // whichever input mode is mounted.
977
- /* @__PURE__ */ jsx(
978
- "textarea",
979
- {
980
- ref: textareaRef,
981
- value: text,
982
- onChange: (e) => setText(e.target.value),
983
- onKeyDown: handleKeyDown,
984
- onPaste: onAttach ? handlePaste : void 0,
985
- placeholder,
986
- disabled,
987
- autoFocus,
988
- rows: minRows,
989
- style: { minHeight: inputMinHeight, maxHeight },
990
- "aria-label": "Message input",
991
- className: "w-full resize-none bg-transparent px-1.5 py-1 text-base leading-6 text-foreground outline-none placeholder:text-muted-foreground disabled:opacity-50"
992
- }
993
- )
972
+ // The card draws the keyboard indicator through `focus-within:`, so
973
+ // the input does not need a second outline.
974
+ textareaInput
994
975
  ),
995
976
  /* @__PURE__ */ jsxs("div", { className: "flex items-end gap-2", children: [
996
977
  onAttach && /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1894,4 +1875,4 @@ export {
1894
1875
  ComposerModeControls,
1895
1876
  EntryComposer
1896
1877
  };
1897
- //# sourceMappingURL=chunk-P2EC5VHG.js.map
1878
+ //# sourceMappingURL=chunk-GAKGTIJ4.js.map