@agentforge-io/chat-sdk 2.4.0-dev.11 → 2.4.0-dev.12

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.
Files changed (2) hide show
  1. package/dist/react.js +11 -2
  2. package/package.json +1 -1
package/dist/react.js CHANGED
@@ -546,7 +546,9 @@ function ChatWidget(props) {
546
546
  onShortcutClick(text, i);
547
547
  else
548
548
  setDraft(text);
549
- }, children: text }, `${i}-${text}`))) })), (0, jsx_runtime_1.jsxs)("div", { className: "af-input-row", children: [composerLeftSlot && ((0, jsx_runtime_1.jsx)("div", { className: "af-input-left", children: composerLeftSlot })), (0, jsx_runtime_1.jsx)("textarea", { ref: inputRef, className: "af-input", value: draft, onChange: (e) => setDraft(e.target.value), onKeyDown: onKeyDown, placeholder: inputPlaceholder ?? 'Type a message…', rows: 1,
549
+ }, children: text }, `${i}-${text}`))) })), (0, jsx_runtime_1.jsxs)("div", { className: "af-input-row", "data-loading": status === 'loading' || status === 'idle' ? '' : undefined, children: [composerLeftSlot && ((0, jsx_runtime_1.jsx)("div", { className: "af-input-left", children: composerLeftSlot })), (0, jsx_runtime_1.jsx)("textarea", { ref: inputRef, className: "af-input", value: draft, onChange: (e) => setDraft(e.target.value), onKeyDown: onKeyDown, placeholder: status === 'idle' || status === 'loading'
550
+ ? 'Preparing chat…'
551
+ : inputPlaceholder ?? 'Type a message…', rows: 1,
550
552
  // The textarea stays editable while the agent is
551
553
  // streaming so the visitor can compose their next
552
554
  // message without waiting. Only block when the
@@ -563,7 +565,12 @@ function ChatWidget(props) {
563
565
  // jumps to <body>, and the on-screen keyboard collapses.
564
566
  onPointerDown: (e) => e.preventDefault(), onClick: handleSend, disabled: sendDisabled, "aria-label": status === 'sending' || status === 'streaming'
565
567
  ? 'Sending message'
566
- : 'Send message', children: status === 'sending' || status === 'streaming' ? ((0, jsx_runtime_1.jsx)(SpinnerIcon, {})) : ((0, jsx_runtime_1.jsx)(SendIcon, {})) })] }), !bare && (0, jsx_runtime_1.jsx)("div", { className: "af-footer", children: "Powered by AgentForge" })] })] }));
568
+ : status === 'idle' || status === 'loading'
569
+ ? 'Preparing chat'
570
+ : 'Send message', children: status === 'sending' ||
571
+ status === 'streaming' ||
572
+ status === 'idle' ||
573
+ status === 'loading' ? ((0, jsx_runtime_1.jsx)(SpinnerIcon, {})) : ((0, jsx_runtime_1.jsx)(SendIcon, {})) })] }), !bare && (0, jsx_runtime_1.jsx)("div", { className: "af-footer", children: "Powered by AgentForge" })] })] }));
567
574
  }
568
575
  function MessageBubble({ message, session, readOnly, onDecision, onContinue, bare = false, showAvatar = false, avatarTheme, avatarName, avatarAgentId, speakerLabel, }) {
569
576
  const kind = message.metadata?.kind;
@@ -825,6 +832,8 @@ const WIDGET_CSS = `
825
832
  to { opacity: 1; transform: translateY(0); }
826
833
  }
827
834
  .af-input-row { padding: 12px; border-top: 1px solid var(--af-border); background: var(--af-bg); display: flex; gap: 8px; align-items: flex-end; }
835
+ .af-input-row[data-loading] .af-input { cursor: progress; opacity: 0.7; }
836
+ .af-input-row[data-loading] .af-input::placeholder { font-style: italic; }
828
837
  /* Composer left slot — hosts use this for affordance buttons that
829
838
  scope the next turn (member picker, tools menu, attachments).
830
839
  align-items: center keeps a single-line chip vertically centered
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/chat-sdk",
3
- "version": "2.4.0-dev.11",
3
+ "version": "2.4.0-dev.12",
4
4
  "description": "Framework-free chat session SDK for AgentForge public chat tokens. Headless — no DOM. Drop into any frontend (React, Vue, Svelte, vanilla) and listen for events.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",