@adea-ai/ui 0.68.2 → 0.69.1

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 (46) hide show
  1. package/README.md +79 -15
  2. package/dist/NOTICE +55 -24
  3. package/dist/components/conversation/atomic/chat-composer.d.ts +20 -0
  4. package/dist/components/conversation/atomic/chat-composer.d.ts.map +1 -0
  5. package/dist/components/conversation/atomic/chat-composer.js +69 -0
  6. package/dist/components/conversation/atomic/chat-composer.js.map +1 -0
  7. package/dist/components/conversation/atomic/index.d.ts +3 -0
  8. package/dist/components/conversation/atomic/index.d.ts.map +1 -0
  9. package/dist/components/conversation/atomic/index.js +2 -0
  10. package/dist/components/conversation/chat-composer.d.ts +12 -21
  11. package/dist/components/conversation/chat-composer.d.ts.map +1 -1
  12. package/dist/components/conversation/chat-composer.js +33 -403
  13. package/dist/components/conversation/chat-composer.js.map +1 -1
  14. package/dist/components/conversation/internal/chat-composer-shell.d.ts +38 -0
  15. package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -0
  16. package/dist/components/conversation/internal/chat-composer-shell.js +423 -0
  17. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -0
  18. package/dist/components/conversation/paste-preview.d.ts +11 -0
  19. package/dist/components/conversation/paste-preview.d.ts.map +1 -0
  20. package/dist/components/conversation/paste-preview.js +28 -0
  21. package/dist/components/conversation/paste-preview.js.map +1 -0
  22. package/dist/components/conversation/paste-token-editor.d.ts +26 -0
  23. package/dist/components/conversation/paste-token-editor.d.ts.map +1 -0
  24. package/dist/components/conversation/paste-token-editor.js +570 -0
  25. package/dist/components/conversation/paste-token-editor.js.map +1 -0
  26. package/dist/components/conversation/paste-tokens.d.ts.map +1 -1
  27. package/dist/components/conversation/paste-tokens.js +11 -2
  28. package/dist/components/conversation/paste-tokens.js.map +1 -1
  29. package/dist/r/conversation.json +26 -0
  30. package/dist/r/registry.json +26 -0
  31. package/dist/r/src/components/conversation/atomic/chat-composer.tsx +57 -0
  32. package/dist/r/src/components/conversation/atomic/index.ts +6 -0
  33. package/dist/r/src/components/conversation/chat-composer.tsx +39 -331
  34. package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +390 -0
  35. package/dist/r/src/components/conversation/paste-preview.ts +35 -0
  36. package/dist/r/src/components/conversation/paste-token-editor.tsx +672 -0
  37. package/dist/r/src/components/conversation/paste-tokens.ts +15 -2
  38. package/package.json +1 -1
  39. package/registry.json +26 -0
  40. package/src/components/conversation/atomic/chat-composer.tsx +57 -0
  41. package/src/components/conversation/atomic/index.ts +6 -0
  42. package/src/components/conversation/chat-composer.tsx +39 -331
  43. package/src/components/conversation/internal/chat-composer-shell.tsx +390 -0
  44. package/src/components/conversation/paste-preview.ts +35 -0
  45. package/src/components/conversation/paste-token-editor.tsx +672 -0
  46. package/src/components/conversation/paste-tokens.ts +15 -2
package/README.md CHANGED
@@ -279,19 +279,29 @@ host contributions in `context`.
279
279
 
280
280
  This is an unshipped release proposal for UI issue #21, dependent on the
281
281
  packing/IME/follow/busy PRs #16/#18/#19/#20. It is not full donor Chat,
282
- canonical runtime restoration or application adoption. The donor's paste-token
283
- editor, sent-prompt undo/history, manual resize, upload/skill/voice/optimizer and
284
- stop/resume operations are not claimed by these ports. They require their own
285
- mapped reusable behavior or application composition as the owning issues specify.
282
+ canonical runtime restoration or application adoption. The separately scoped,
283
+ opt-in paste-token editor for issue #532 is documented below. Sent-prompt
284
+ undo/history, manual resize, upload/skill/voice/optimizer and stop/resume
285
+ operations are not claimed by these ports. They require their own mapped reusable
286
+ behavior or application composition as the owning issues specify.
286
287
 
287
288
  The composed-input packed fixture checks collapse/draft retention, shelf unmount,
288
289
  focus restoration, failed-delivery recovery, controlled busy mode, its alternate
289
290
  gesture, native IME defaults and external Tailwind styles under both exports and
290
291
  both engines, including reference-only queue eligibility/steer refusal and the
291
- pending-delivery state with its explicitly scanned spinner CSS. Its measured gzip JS baseline is 53,344/53,435 bytes with a 54 KiB cap
292
- and 42,366 raw CSS bytes under the shared 42 KiB cap. The three browser fixtures total 100
293
- check groups, with the native Node SSR expanded/collapsed checks reported separately, retain one Solid runtime/JS chunk each, and exclude unrelated units.
294
- All four selected Kiro NOTICE sections and the license must survive the tarball.
292
+ pending-delivery state with its explicitly scanned spinner CSS. On the current
293
+ actual-tarball run, its gzip JS is 53,554 bytes compiled and 53,650 bytes Solid,
294
+ below the unchanged 55,296-byte cap; CSS is 41,624 bytes under the shared 43,008-byte
295
+ cap. The separate atomic fixture measures 58,922/59,043 gzip JS and 42,289 CSS.
296
+ Its measured incremental cost over the same-condition composed fixture is
297
+ 5,368/5,393 gzip JS, with 751 bytes of headroom under the accepted 6 KiB feature
298
+ increment ceiling, and 665 additional CSS bytes. The gate applies the 6 KiB
299
+ limit to that paired-fixture delta; modules retained in both bundles are excluded
300
+ from the increment. The unchanged 54 KiB composed ceiling and shared 43,008-byte
301
+ CSS ceiling still apply, and no production bundle cap has changed. The gate checks
302
+ both export conditions and engines, reports native Node SSR separately, and keeps
303
+ plain/atomic module ownership separate. Selected Kiro NOTICE attributions and the
304
+ license must survive the tarball.
295
305
  Native CSS content sizing replaces live-field measurement on the two verified
296
306
  engines, both of which support it; legacy-engine fallback is not claimed.
297
307
 
@@ -299,17 +309,21 @@ The release gate `bun run check:packed-conversation` installs the actual tarball
299
309
  with optional engines absent, checks compiled and Solid browser conditions in
300
310
  Chromium and WebKit, and compiles installed Solid source for native Node SSR.
301
311
  The expanded server output includes the input and context; collapsed output
302
- keeps the draft preview while omitting both. Browser cases check opaque menu
303
- surfaces, control sizing, streaming follow, IME ownership, draft recovery,
304
- collapse/focus, busy actions and pending spinner styling.
312
+ keeps the draft preview while omitting both, and token-mode SSR retains its
313
+ highlight mirror and token text. Browser cases check opaque menu surfaces,
314
+ control sizing, streaming follow, IME ownership, draft recovery, collapse/focus,
315
+ busy actions, pending spinner styling, atomic token paste/pruning, accessible
316
+ previews and the referenced-block submit snapshot.
305
317
 
306
318
  External CSS discovery includes the exact component files used by the fixture,
307
- Button's `src/lib/variants.ts`, and menu compositions' `src/lib/overlay.ts`.
319
+ Button's `src/lib/variants.ts`, the token editor and Tooltip source, and menu
320
+ compositions' `src/lib/overlay.ts`.
308
321
  `node_modules` is excluded from automatic Tailwind scanning; importing a
309
322
  stylesheet alone does not discover these shared class strings. Stories are
310
- excluded from discovery. Complete measured raw CSS is 37,060 bytes for plain
311
- conversation, 40,644 for busy controls, and 42,366 for composed input; all remain
312
- under the existing 42 KiB cap. Existing gzip JS caps remain 26, 50 and 54 KiB,
323
+ excluded from discovery. Earlier plain and busy CSS measurements were 37,060
324
+ and 40,644 bytes; current composed and atomic fixture measurements are listed
325
+ above, all under the existing shared 43,008-byte cap. Existing gzip JS caps
326
+ remain 26, 50 and 54 KiB for the plain, busy and composed fixtures,
313
327
  respectively. This fixture proves the published component contract; mounted
314
328
  Adea/Cortana services, hydration and manual IME/assistive-technology acceptance
315
329
  remain application evidence lanes.
@@ -323,6 +337,56 @@ Local packed interaction gates require `bunx playwright install chromium webkit`
323
337
  after dependency installation. On Linux, use `--with-deps` when required system
324
338
  libraries are absent. Automation uses headless disposable browser contexts.
325
339
 
340
+ ## Paste-token model (issue #532 selected unit)
341
+
342
+ `@adea-ai/ui/components/conversation` also exports the pure paste-token model:
343
+ `PasteBlock`, `isPasteBlock`, `countLines`, `shouldCollapse`, `nextSeq`,
344
+ `formatToken`, `findTokenRanges`, `tokenRangeAt`, `pruneBlocks`, `expandAll`,
345
+ `recollapsePastes`, `remapCarriedBlocks`, `stripTrailingBlankLines`, and the
346
+ threshold and marker constants. Hosts provide stable, bounded ASCII block IDs and own
347
+ draft state, persistence, message reconciliation and editor behavior. The model
348
+ does not read storage or the clipboard, upload files, edit a textarea, or
349
+ provide undo/history, previews or chips. The opt-in editor below composes this
350
+ pure model with a controlled textarea. The selected source and Apache-2.0
351
+ attribution are recorded in the issue #532 entries in `NOTICE`.
352
+
353
+ ### Controlled paste-token composer (issue #532 selected editor)
354
+
355
+ `ChatComposer` keeps its plain-text API and bundle closure. Consumers that need
356
+ atomic paste editing import `AtomicChatComposer` from the direct
357
+ `@adea-ai/ui/components/conversation/atomic` subpath. It accepts host-owned
358
+ `blocks`, a synchronous `createBlockId()` and one `onChange({ text, blocks })`
359
+ callback. Paste, native typing and pruning report the complete draft together.
360
+ Submit receives one snapshot containing `text`, the selected `action` and cloned
361
+ referenced `blocks` before delivery starts. Both entries share a private
362
+ composition shell; the UI owns no paste identity, history, storage, transport or
363
+ undo state.
364
+
365
+ The selected editor collapses text-only pastes at the existing three-line or
366
+ 200-character thresholds, supports raw Cmd/Ctrl+Shift+V for the next paste,
367
+ preserves standalone and Markdown quote-prefix placement, and keeps token
368
+ deletion, navigation, selection and dropped-text replacement atomic.
369
+ Double-click or touch expands a token. Copy and cut expand fully selected tokens
370
+ in order while partial selections remain native. An `aria-hidden` mirror
371
+ highlights tokens behind the single labeled textarea. Hover and caret previews
372
+ wait 300 ms, scan and show at most 1,200 characters across up to 12 lines, close
373
+ when their text/block/scope becomes stale, and stay suppressed on touch devices. Keyboard
374
+ users can open the token next to the caret or current selection with Alt+Down
375
+ Arrow and dismiss it with Escape.
376
+ The input announces that shortcut and the open preview through `aria-describedby`
377
+ while keeping focus in the textarea. The preview uses the existing tooltip
378
+ portal without intercepting textarea input.
379
+
380
+ Only `ClipboardEvent.clipboardData` text is read. Clipboard permissions,
381
+ images/files, uploads, rich editors, persistence, sent-prompt history and
382
+ application adoption remain with the host. The added `AtomicPasteTokens` story
383
+ shows the controlled contract; component browser and packed conversation gates
384
+ exercise Chromium and WebKit. The plain fixture retains its existing caps.
385
+ Atomic whole-bundle and incremental costs are reported above; the packed gate
386
+ enforces the accepted 6 KiB incremental ceiling while retaining the existing
387
+ composed and CSS ceilings. Donor source/test provenance is in the issue #532
388
+ editor entry in `NOTICE`.
389
+
326
390
  ## Binary layout model checkpoint
327
391
 
328
392
  UI issue #22 extracts the existing attributed bb/Muxy Adea adaptation rather
package/dist/NOTICE CHANGED
@@ -158,6 +158,61 @@ busy-action behavior compose the separately attributed units above. Caret
158
158
  selection is retained for reading collapse and local delivery feedback is fenced
159
159
  to an injected host reset key. Full Chat composition and product adoption remain
160
160
  separate gates.
161
+
162
+ ## Paste-token model translated from KiroCrew (issue #532)
163
+
164
+ `packages/ui/src/components/conversation/paste-tokens.ts` translates the pure
165
+ block and text transformations from `website/src/utils/pasteTokens.ts`, plus
166
+ the trailing-blank-line policy from `website/src/components/composerPastePolicy.ts`,
167
+ at KiroCrew revision `283e136c0f902e965a535a7c9548c57c7504fed0`.
168
+
169
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
170
+ This product includes software developed at Amazon.com, Inc.
171
+ (https://www.amazon.com/). Licensed under the Apache License, Version 2.0.
172
+
173
+ Retained: the three-line/200-character collapse thresholds; canonical marker
174
+ formatting and ranges; monotonic sequence allocation and collision remapping;
175
+ token pruning, expansion and content-based re-collapse, including the
176
+ trailing-whitespace fallback; and the linear trailing-blank-line scan. Bun unit
177
+ cases adapt the pure expectations from `website/src/test/pasteTokens.test.ts` and
178
+ the trailing-text policy from `website/src/test/ChatInput.paste.test.tsx`.
179
+
180
+ The host supplies stable block IDs. Invalid IDs/sequences, duplicate identities,
181
+ ambiguous sequence mappings and noncanonical or line-mismatched markers are
182
+ refused. React, Lexical, browser clipboard/File handling, localStorage side-table
183
+ recovery, backend message reconciliation, uploads, textarea editing, previews,
184
+ chips, undo/history and submit/persistence authority are not included. This
185
+ selected model is not rich editing, complete Chat, or application adoption.
186
+
187
+ ## Controlled paste-token editor translated from KiroCrew (issue #532)
188
+
189
+ `packages/ui/src/components/conversation/paste-token-editor.tsx` and the
190
+ `AtomicChatComposer` entry substantially translate selected text-editing
191
+ behavior from `website/src/components/ChatInput.tsx`,
192
+ `website/src/components/PasteHighlightLayer.tsx`,
193
+ `website/src/components/PasteHoverLayer.tsx`, and
194
+ `website/src/components/PastePreviewTooltip.tsx`, pinned at KiroCrew revision
195
+ `283e136c0f902e965a535a7c9548c57c7504fed0`.
196
+
197
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
198
+ This product includes software developed at Amazon.com, Inc.
199
+ (https://www.amazon.com/). Licensed under the Apache License, Version 2.0.
200
+
201
+ Retained: plain-text thresholded paste, trailing-blank cleanup, raw-paste
202
+ bypass, standalone and quote-prefix placement, atomic token deletion and
203
+ navigation, selection snapping, expansion, pruning and expanded copy/cut. The
204
+ Solid mirror and Kobalte tooltip retain the aria-hidden highlight, dwell and
205
+ caret previews, touch suppression, dismissal and `aria-describedby` association.
206
+ `AtomicChatComposer` emits a single controlled `{ text, blocks }` transaction
207
+ and submits a captured text/action/block snapshot; hosts supply IDs, state and
208
+ delivery. Browser cases translate applicable text-input expectations from
209
+ `website/src/test/ChatInputCoverage.test.tsx`,
210
+ `website/src/test/ChatInput.paste.test.tsx`, and
211
+ `website/src/test/PasteHoverLayer.test.tsx`. Upload, image/file clipboard,
212
+ optimizer, React/Lexical/Framer runtime, persistence, undo/history, and
213
+ application transport or restoration behavior are not copied. This is the
214
+ selected editor unit, not a claim of full Chat or product adoption.
215
+
161
216
  ## Appearance editor translated from Zeron
162
217
 
163
218
  The System/Light/Dark miniature composition, palette bands, theme selectors,
@@ -267,30 +322,6 @@ pane-title gesture, replacing plaintext leaf IDs and string casts with typed
267
322
  intent, an instance-local active drag payload, and cancellation/removal checks.
268
323
  Header action composition injects application keyboard controls without owning
269
324
  shortcuts or domain transitions. No new upstream source or license is introduced.
270
- ## Paste-token model translated from KiroCrew (issue #532)
271
-
272
- `packages/ui/src/components/conversation/paste-tokens.ts` translates the pure
273
- block and text transformations from `website/src/utils/pasteTokens.ts`, plus
274
- the trailing-blank-line policy from `website/src/components/composerPastePolicy.ts`,
275
- at KiroCrew revision `283e136c0f902e965a535a7c9548c57c7504fed0`.
276
-
277
- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
278
- This product includes software developed at Amazon.com, Inc.
279
- (https://www.amazon.com/). Licensed under the Apache License, Version 2.0.
280
-
281
- Retained: the three-line/200-character collapse thresholds; canonical marker
282
- formatting and ranges; monotonic sequence allocation and collision remapping;
283
- token pruning, expansion and content-based re-collapse, including the
284
- trailing-whitespace fallback; and the linear trailing-blank-line scan. Bun unit
285
- cases adapt the pure expectations from `website/src/test/pasteTokens.test.ts` and
286
- the trailing-text policy from `website/src/test/ChatInput.paste.test.tsx`.
287
-
288
- The host supplies stable block IDs. Invalid IDs/sequences, duplicate identities,
289
- ambiguous sequence mappings and noncanonical or line-mismatched markers are
290
- refused. React, Lexical, browser clipboard/File handling, localStorage side-table
291
- recovery, backend message reconciliation, uploads, textarea editing, previews,
292
- chips, undo/history and submit/persistence authority are not included. This
293
- selected model is not rich editing, complete Chat, or application adoption.
294
325
 
295
326
  ## Shared transcript composition translated from KiroCrew
296
327
 
@@ -0,0 +1,20 @@
1
+ import { type ChatComposerSharedProps, type ChatComposerSubmitInput } from '../chat-composer';
2
+ import { type PasteTokenDraft } from '../paste-token-editor';
3
+ import { type PasteBlock } from '../paste-tokens';
4
+ export type ChatComposerPasteTokens = {
5
+ /** Current host-owned backing blocks, paired with `value`. */
6
+ blocks: readonly PasteBlock[];
7
+ /** Synchronous host identity allocation; the UI owns no persistent identity. */
8
+ createBlockId: () => string;
9
+ /** One synchronous update for the complete text and surviving blocks. */
10
+ onChange: (draft: PasteTokenDraft) => void;
11
+ };
12
+ export type AtomicChatComposerProps = ChatComposerSharedProps & {
13
+ pasteTokens: ChatComposerPasteTokens;
14
+ onSubmit: (input: ChatComposerSubmitInput & {
15
+ blocks: PasteBlock[];
16
+ }) => void | Promise<void>;
17
+ };
18
+ /** Atomic editor entry, sharing the plain composer's private composition shell. */
19
+ export declare function AtomicChatComposer(props: AtomicChatComposerProps): import("solid-js").JSX.Element;
20
+ //# sourceMappingURL=chat-composer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-composer.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation/atomic/chat-composer.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,uBAAuB,EAAE,KAAK,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAE7F,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,EAAe,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE9D,MAAM,MAAM,uBAAuB,GAAG;IACpC,8DAA8D;IAC9D,MAAM,EAAE,SAAS,UAAU,EAAE,CAAA;IAC7B,gFAAgF;IAChF,aAAa,EAAE,MAAM,MAAM,CAAA;IAC3B,yEAAyE;IACzE,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAA;CAC3C,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,uBAAuB,GAAG;IAC9D,WAAW,EAAE,uBAAuB,CAAA;IACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,uBAAuB,GAAG;QAAE,MAAM,EAAE,UAAU,EAAE,CAAA;KAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9F,CAAA;AAED,mFAAmF;AACnF,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,kCA8BhE"}
@@ -0,0 +1,69 @@
1
+ import { ChatComposerShell } from "../internal/chat-composer-shell.js";
2
+ import { pruneBlocks } from "../paste-tokens.js";
3
+ import { PasteTokenEditor } from "../paste-token-editor.js";
4
+ import { createComponent, mergeProps } from "solid-js/web";
5
+ //#region src/components/conversation/atomic/chat-composer.tsx
6
+ /** Atomic editor entry, sharing the plain composer's private composition shell. */
7
+ function AtomicChatComposer(props) {
8
+ return createComponent(ChatComposerShell, mergeProps(props, {
9
+ createSubmitExtra: ({ text }) => ({ blocks: pruneBlocks(text, [...props.pasteTokens.blocks]).map((block) => ({ ...block })) }),
10
+ get onSubmit() {
11
+ return props.onSubmit;
12
+ },
13
+ renderInput: (input) => createComponent(PasteTokenEditor, {
14
+ ref(r$) {
15
+ var _ref$ = input.ref;
16
+ typeof _ref$ === "function" ? _ref$(r$) : input.ref = r$;
17
+ },
18
+ get value() {
19
+ return input.value();
20
+ },
21
+ get resetKey() {
22
+ return input.resetKey();
23
+ },
24
+ get blocks() {
25
+ return props.pasteTokens.blocks;
26
+ },
27
+ get createBlockId() {
28
+ return props.pasteTokens.createBlockId;
29
+ },
30
+ get onChange() {
31
+ return props.pasteTokens.onChange;
32
+ },
33
+ get inputLabel() {
34
+ return input.inputLabel();
35
+ },
36
+ get placeholder() {
37
+ return input.placeholder();
38
+ },
39
+ get disabled() {
40
+ return input.disabled();
41
+ },
42
+ get readOnly() {
43
+ return input.readOnly();
44
+ },
45
+ get composing() {
46
+ return input.composing;
47
+ },
48
+ get onCompositionStart() {
49
+ return input.onCompositionStart;
50
+ },
51
+ get onCompositionEnd() {
52
+ return input.onCompositionEnd;
53
+ },
54
+ get onFocus() {
55
+ return input.onFocus;
56
+ },
57
+ get onBlur() {
58
+ return input.onBlur;
59
+ },
60
+ get onKeyDown() {
61
+ return input.onKeyDown;
62
+ }
63
+ })
64
+ }));
65
+ }
66
+ //#endregion
67
+ export { AtomicChatComposer };
68
+
69
+ //# sourceMappingURL=chat-composer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-composer.js","names":["ChatComposerSharedProps","ChatComposerSubmitInput","ChatComposerShell","PasteTokenEditor","PasteTokenDraft","pruneBlocks","PasteBlock","ChatComposerPasteTokens","blocks","createBlockId","onChange","draft","AtomicChatComposerProps","pasteTokens","onSubmit","input","Promise","AtomicChatComposer","props","_$createComponent","_$mergeProps","createSubmitExtra","text","map","block","renderInput","ref","r$","_ref$","value","resetKey","inputLabel","placeholder","disabled","readOnly","composing","onCompositionStart","onCompositionEnd","onFocus","onBlur","onKeyDown","_$createComponent","_$mergeProps"],"sources":["../../../../src/components/conversation/atomic/chat-composer.tsx"],"sourcesContent":["/*\n * Controlled atomic token composer translated from KiroCrew ChatInput.tsx and\n * PasteHighlightLayer.tsx at 283e136c0f902e965a535a7c9548c57c7504fed0.\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * Licensed under Apache-2.0; see LICENSE and NOTICE.\n */\nimport { type ChatComposerSharedProps, type ChatComposerSubmitInput } from '../chat-composer'\nimport { ChatComposerShell } from '../internal/chat-composer-shell'\nimport { PasteTokenEditor, type PasteTokenDraft } from '../paste-token-editor'\nimport { pruneBlocks, type PasteBlock } from '../paste-tokens'\n\nexport type ChatComposerPasteTokens = {\n /** Current host-owned backing blocks, paired with `value`. */\n blocks: readonly PasteBlock[]\n /** Synchronous host identity allocation; the UI owns no persistent identity. */\n createBlockId: () => string\n /** One synchronous update for the complete text and surviving blocks. */\n onChange: (draft: PasteTokenDraft) => void\n}\n\nexport type AtomicChatComposerProps = ChatComposerSharedProps & {\n pasteTokens: ChatComposerPasteTokens\n onSubmit: (input: ChatComposerSubmitInput & { blocks: PasteBlock[] }) => void | Promise<void>\n}\n\n/** Atomic editor entry, sharing the plain composer's private composition shell. */\nexport function AtomicChatComposer(props: AtomicChatComposerProps) {\n return (\n <ChatComposerShell\n {...props}\n createSubmitExtra={({ text }) => ({\n blocks: pruneBlocks(text, [...props.pasteTokens.blocks]).map((block) => ({ ...block })),\n })}\n onSubmit={props.onSubmit}\n renderInput={(input) => (\n <PasteTokenEditor\n ref={input.ref}\n value={input.value()}\n resetKey={input.resetKey()}\n blocks={props.pasteTokens.blocks}\n createBlockId={props.pasteTokens.createBlockId}\n onChange={props.pasteTokens.onChange}\n inputLabel={input.inputLabel()}\n placeholder={input.placeholder()}\n disabled={input.disabled()}\n readOnly={input.readOnly()}\n composing={input.composing}\n onCompositionStart={input.onCompositionStart}\n onCompositionEnd={input.onCompositionEnd}\n onFocus={input.onFocus}\n onBlur={input.onBlur}\n onKeyDown={input.onKeyDown}\n />\n )}\n />\n )\n}\n"],"mappings":";;;;;;AA0BA,SAAgBiB,mBAAmBC,OAAgC;CACjE,OAAAC,gBACGjB,mBAAiBkB,WACZF,OAAK;EACTG,oBAAoB,EAAEC,YAAY,EAChCd,QAAQH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PasteTokenDraft } from '../paste-token-editor';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation/atomic/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,GAC7B,MAAM,iBAAiB,CAAA;AACxB,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { AtomicChatComposer } from "./chat-composer.js";
2
+ export { AtomicChatComposer };
@@ -1,19 +1,13 @@
1
- import { type JSX } from 'solid-js';
2
- import { type BusySendButtonProps, type BusySendMode } from './busy-send-button';
1
+ import type { JSX } from 'solid-js';
2
+ import type { BusySendButtonProps, BusySendMode } from './busy-send-button';
3
3
  export type ChatComposerControl = {
4
4
  /** Focus this instance; false when it is unavailable or collapsed. */
5
5
  focus: () => boolean;
6
6
  /** A typing intent, unlike merely navigating to a conversation. */
7
7
  expandAndFocus: () => boolean;
8
8
  };
9
- export type ChatComposerProps = {
9
+ export type ChatComposerSharedProps = {
10
10
  value: string;
11
- onValueChange: (value: string) => void;
12
- /** The host owns attachments and delivery; text/action are captured at the gesture. */
13
- onSubmit: (input: {
14
- text: string;
15
- action: 'send' | BusySendMode;
16
- }) => void | Promise<void>;
17
11
  /** Host scope fence; changes discard local feedback, not the host draft. */
18
12
  resetKey?: unknown;
19
13
  disabled?: boolean;
@@ -45,17 +39,14 @@ export type ChatComposerProps = {
45
39
  /** Host derives this from the pending approval presentation, not UI policy. */
46
40
  approvalFocus?: boolean;
47
41
  };
48
- /**
49
- * Kiro's composer assembly: context/options, adjacent band, approval/notices,
50
- * staged content, input/action groups and a context shelf. Reading collapse
51
- * really unmounts the input and shelf and offers a labeled way back with draft
52
- * preview. The host retains the only draft, identities, preferences and services.
53
- *
54
- * Kobalte owns the options menu. Scoped imperative typing intent replaces the
55
- * donor global lookup/broadcast so a second composer cannot receive this draft
56
- * or focus. No animation starts from hidden geometry, no global shortcut, and no
57
- * runtime/permission/voice/optimizer authority is copied. More specific chips,
58
- * approval decisions and staged-content semantics are supplied by their owners.
59
- */
42
+ export type ChatComposerSubmitInput = {
43
+ text: string;
44
+ action: 'send' | BusySendMode;
45
+ };
46
+ export type ChatComposerProps = ChatComposerSharedProps & {
47
+ onValueChange: (value: string) => void;
48
+ onSubmit: (input: ChatComposerSubmitInput) => void | Promise<void>;
49
+ };
50
+ /** Plain-text entry. Atomic paste editing is available from the separate atomic subpath. */
60
51
  export declare function ChatComposer(props: ChatComposerProps): JSX.Element;
61
52
  //# sourceMappingURL=chat-composer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chat-composer.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/chat-composer.tsx"],"names":[],"mappings":"AAOA,OAAO,EAA4D,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAS7F,OAAO,EAAkB,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGhG,MAAM,MAAM,mBAAmB,GAAG;IAChC,sEAAsE;IACtE,KAAK,EAAE,MAAM,OAAO,CAAA;IACpB,mEAAmE;IACnE,cAAc,EAAE,MAAM,OAAO,CAAA;CAC9B,CAAA;AACD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,uFAAuF;IACvF,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,YAAY,CAAA;KAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1F,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA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