@deepagents/react-input 7.8.2 → 7.9.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.
@@ -29,7 +29,7 @@ or a plain textarea.
29
29
  | Feature | Status | Local Contract |
30
30
  | ---------------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
31
31
  | Structured composer state | Supported | The editor serializes to `ComposerState`; public submissions expose only canonical `prompt`, `persistedPrompt`, and semantic items. Editor-only marks never become a parallel transport protocol. |
32
- | Public compound API | Supported | `Composer.Root`, `Content`, `Toolbar`, `Editor`, `RemoteImages`, `Attachments`, `Error`, `Popup`, `Shortcuts`, `Footer`, `AttachFiles`, `AddRemoteImage`, `InsertPaste`, `InsertRichLink`, `Submit`, and `Reset`. Action triggers are Base UI `Button`s, so `render`, `nativeButton`, and `focusableWhenDisabled` come from it. |
32
+ | Public compound API | Supported | `Composer.Root`, `Content`, `Toolbar`, `Editor`, `RemoteImages`, `Attachments`, `Error`, `Popup`, `Shortcuts`, `Footer`, `AttachFiles`, `AddRemoteImage`, `InsertPaste`, `InsertRichLink`, `Dictate`, `CancelDictation`, `Submit`, and `Reset`. Action triggers are Base UI `Button`s, so `render`, `nativeButton`, and `focusableWhenDisabled` come from it. |
33
33
  | Host initialization | Supported | Hosts pass restorable prompt content through `initialDraft`. Controller-only fields such as cursor, inline error, history cursor, reverse search, and kill buffer stay internal. |
34
34
  | Draft persistence | Supported | `Composer.Root` accepts a host-supplied `draftKey`, hydrates that draft from `localStorage`, writes on state changes, holds it while an asynchronous `onSubmit` is in flight, clears it on success, and restores it on failure. |
35
35
  | Slash commands | Supported | Slash suggestions complete into editable prompt text. Custom prompts use plain `/prompts:<id>` text and expand at submission; built-in command marks remain editor-only. Unknown or disabled leading commands preserve the draft and show inline errors. |
@@ -44,7 +44,8 @@ or a plain textarea.
44
44
  | Remote images | Supported | Remote images can submit without prompt text, can be keyboard selected/removed, and affect attachment renumbering. |
45
45
  | Media attachments | Supported | Pasted, dropped, and file-input image, video, and audio files keep their `File` in `Composer.Root` memory behind a required internal attachment ID. Public `image`, `video`, and `audio` submission items contain the required `File`; they never expose an ID or path. Because browser `File`s are not persistable, drafts and history retain the surrounding text but omit attachments entirely. `Composer.Attachments` renders object-URL previews with a remove button, and `Composer.AttachFiles` opens a hidden `image/*,video/*,audio/*` file input. No size or count limits. |
46
46
  | Empty submission policy | Host-owned | `onSubmit` fires for every submit gesture, including an empty editor (synthesized empty payload). Hosts decide whether an empty submission is meaningful (e.g. payloads living outside the editor, like annotations) and guard in `onSubmit`. Empty submissions are never recorded in history; `disabled` and modal guards still block the gesture itself. |
47
- | Disabled/modal guard | Supported | `disabled` blocks typing, paste, toolbar mutations, keyboard submit, action triggers, and remote-image-only submit while still rendering current content. |
47
+ | Dictation | Supported | `Composer.Root` takes `dictation={{ transcribe(audio, { signal }) }}`; `Composer.Dictate`, `Composer.CancelDictation` and `useComposerDictation()` read one dictation per composer and throw without it. A dictation ends by cancel (nothing goes in), stop (the trimmed text goes in at the cursor, with a space before it when the character before the cursor is not whitespace) or the composer's submit (it waits for the text, inserts it, then submits). Recording uses the browser's `MediaRecorder`; no recorder gives `unavailable`. See `docs/dictation`. |
48
+ | Disabled/modal guard | Supported | `disabled` blocks typing, paste, toolbar mutations, keyboard submit, action triggers, and remote-image-only submit, and cancels an active dictation, while still rendering current content. |
48
49
  | Prompt length cap | Supported | `maxExpandedTextChars` rejects oversized expanded text before `onSubmit` and preserves the visible draft plus hidden paste payloads. |
49
50
  | Shortcut overlay | Supported | `?` toggles shortcuts only while the draft is empty; non-empty `?` remains editable text. Terminal paste-burst state is not implemented. |
50
51
  | Queue handoff | Supported as host-owned | `onSubmit` emits the narrow transport separately from a `ComposerDraftSource`. The host stores immutable resolved execution alongside the editable persisted source and its persistable paste sidecars. |
package/dist/browser.d.ts CHANGED
@@ -3,6 +3,10 @@ export { Composer } from './lib/Composer.tsx';
3
3
  export { useComposer } from './lib/ComposerContext.ts';
4
4
  export type { ComposerAcceptSuggestionOptions, ComposerActions, ComposerContextApi, ComposerMeta, } from './lib/ComposerContext.ts';
5
5
  export type { ComposerAttachmentsProps } from './lib/ComposerAttachments.tsx';
6
+ export { useComposerDictation } from './lib/dictation/ComposerDictationContext.ts';
7
+ export type { ComposerDictation, ComposerDictationApi, DictationEnd, DictationState, } from './lib/dictation/ComposerDictationContext.ts';
8
+ export type { ComposerCancelDictationProps, ComposerDictateProps, } from './lib/dictation/ComposerDictationParts.tsx';
9
+ export { DictationError, type DictationErrorCode, } from './lib/dictation/DictationError.ts';
6
10
  export { ComposerTokenText } from './lib/ComposerTokenText.tsx';
7
11
  export { PersistedPromptText } from './lib/PersistedPromptText.tsx';
8
12
  export { reconstructPersistedPromptSelection } from './lib/persisted-prompt-selection.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,YAAY,EACV,+BAA+B,EAC/B,eAAe,EACf,kBAAkB,EAClB,YAAY,GACb,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,mCAAmC,EAAE,MAAM,qCAAqC,CAAC;AAC1F,YAAY,EACV,iBAAiB,EACjB,2BAA2B,EAC3B,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,2BAA2B,E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