@particle-academy/react-fancy 5.38.0 → 5.39.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/{index-CazpqSsk.d.cts → Composer.types-CuSPnaOt.d.cts} +1 -4
  3. package/dist/{index-CazpqSsk.d.ts → Composer.types-CuSPnaOt.d.ts} +1 -4
  4. package/dist/{chunk-Z4GO6N6N.js → chunk-2JOWGYAJ.js} +322 -408
  5. package/dist/chunk-2JOWGYAJ.js.map +1 -0
  6. package/dist/{chunk-RYKPYILS.cjs → chunk-6TZPM43Q.cjs} +325 -408
  7. package/dist/chunk-6TZPM43Q.cjs.map +1 -0
  8. package/dist/chunk-BZOU7VJQ.cjs +231 -0
  9. package/dist/chunk-BZOU7VJQ.cjs.map +1 -0
  10. package/dist/{chunk-QLL7MWAU.cjs → chunk-FJ2GMQLC.cjs} +116 -26
  11. package/dist/chunk-FJ2GMQLC.cjs.map +1 -0
  12. package/dist/chunk-MXAVGOHW.js +229 -0
  13. package/dist/chunk-MXAVGOHW.js.map +1 -0
  14. package/dist/{chunk-WUV3XDJH.js → chunk-YLPVTEUH.js} +117 -27
  15. package/dist/chunk-YLPVTEUH.js.map +1 -0
  16. package/dist/composer.cjs +4 -3
  17. package/dist/composer.d.cts +7 -2
  18. package/dist/composer.d.ts +7 -2
  19. package/dist/composer.js +2 -1
  20. package/dist/{index-DXUAAZzE.d.ts → index-BsIBOwaK.d.cts} +46 -1
  21. package/dist/{index-DXUAAZzE.d.cts → index-S4FC1yFK.d.ts} +46 -1
  22. package/dist/index.cjs +10 -9
  23. package/dist/index.d.cts +3 -2
  24. package/dist/index.d.ts +3 -2
  25. package/dist/index.js +3 -2
  26. package/dist/prompt-input.cjs +4 -2
  27. package/dist/prompt-input.d.cts +2 -1
  28. package/dist/prompt-input.d.ts +2 -1
  29. package/dist/prompt-input.js +3 -1
  30. package/package.json +1 -1
  31. package/dist/chunk-QLL7MWAU.cjs.map +0 -1
  32. package/dist/chunk-RYKPYILS.cjs.map +0 -1
  33. package/dist/chunk-WUV3XDJH.js.map +0 -1
  34. package/dist/chunk-Z4GO6N6N.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -11,6 +11,63 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [5.39.0] - 2026-10-15
15
+
16
+ ### Added
17
+
18
+ - **`PromptInput` gets inline paste pills** — the same ones `Composer` gained in
19
+ 5.38.0, built on the same code (react-fancy#32, asked for by Genie 2, whose chat
20
+ composer this is).
21
+
22
+ ```tsx
23
+ <PromptInput budgetTokens={200_000} pasteThreshold={500} pasteImages previewChars={30}
24
+ onSubmit={(text, attachments) => send(text, attachments)} />
25
+ ```
26
+
27
+ - A paste of `pasteThreshold`+ characters becomes `Pasted text · N characters`
28
+ **where it was pasted**, on a line of its own. Clicking it puts the full text
29
+ back right there; hovering shows the first and last `previewChars`.
30
+ - **`pasteImages`**: a pasted image becomes an inline `Pasted image N` pill AND
31
+ arrives in `onSubmit`'s attachments with its File, in message order. The text
32
+ marks where it sat as `[Pasted image N]`.
33
+ - `onSubmit` receives every text pill expanded where it sits — never a marker —
34
+ and **a message that is only a paste can be sent**.
35
+ - **The send contract is unchanged**: Ctrl/⌘+Enter sends, plain Enter is a
36
+ newline, and the `/` and `@` pickers, drop-to-attach and the file picker all
37
+ work in the inline editor exactly as in the textarea.
38
+ - `renderPastePreview` and `pasteClassNames` restyle the pills and popover.
39
+
40
+ Asked for as chips beside the input carried as `text/plain` attachments; built
41
+ inline instead, to the owner's own spec given against screenshots of this
42
+ composer. The text still reaches the model — positioned where the person put it.
43
+
44
+ - **A quieter `PromptInput` footer**, each part opt-in:
45
+ - `attachButton="icon"` — paperclip only, with an accessible name and a tooltip.
46
+ - `sendButton="icon"` — a compact send button whose tooltip carries the shortcut
47
+ (`Send · Ctrl+Enter`), replacing the inline kbd hint.
48
+ - `meter="near-limit"` — hidden until usage passes `meterShowAt` (0.75), muted
49
+ until `meterWarnAt` (0.9), warning colour past it. `meter="hidden"` never
50
+ shows it.
51
+ - **`usedTokens`** — the caller's REAL usage (an agent's context, say). The
52
+ meter shows it plus the draft's estimate; before, it could only estimate the
53
+ draft as length ÷ `charsPerToken`, which is why a host had to fake the budget.
54
+
55
+ Handles: `data-react-fancy-prompt-input-attach`, `-send`, `-meter` (with
56
+ `data-level`: `ok` / `caution` / `warn` / `muted`).
57
+
58
+ ### Changed
59
+
60
+ - `Composer` and `PromptInput` now share one implementation of inline paste
61
+ pills (`useInlinePaste`), so the two cannot disagree about what a pill means.
62
+ No behaviour change to `Composer`; all its tests pass untouched.
63
+ - `Composer`'s internal inline pill moved to its own file. No behaviour or API
64
+ change; its props were being read as `Composer`'s by the showcase's docs
65
+ coverage check.
66
+
67
+ **What you must DO: nothing.** Every option defaults to the old behaviour: no
68
+ `pasteThreshold` or `pasteImages` means the textarea you had, and the footer is
69
+ unchanged unless you ask.
70
+
14
71
  ## [5.38.0] - 2026-10-14
15
72
 
16
73
  ### Added
@@ -1,4 +1,3 @@
1
- import * as react from 'react';
2
1
  import { ReactNode } from 'react';
3
2
 
4
3
  /**
@@ -247,6 +246,4 @@ interface ComposerProps {
247
246
  onHeldImagesChange?: (images: HeldImage[]) => void;
248
247
  }
249
248
 
250
- declare const Composer: react.ForwardRefExoticComponent<ComposerProps & react.RefAttributes<HTMLDivElement>>;
251
-
252
- export { Composer as C, type HeldImage as H, type PasteEventLike as P, type UsePastePillsOptions as U, type ComposerPasteClassNames as a, type ComposerPastePreview as b, type ComposerProps as c, type ComposerSubmitExtras as d, type HeldPaste as e, type UsePastePillsResult as f, pasteMarker as p, usePastePills as u };
249
+ export { type ComposerPasteClassNames as C, type HeldImage as H, type PasteEventLike as P, type UsePastePillsOptions as U, type ComposerPastePreview as a, type ComposerProps as b, type ComposerSubmitExtras as c, type HeldPaste as d, type UsePastePillsResult as e, pasteMarker as p, usePastePills as u };
@@ -1,4 +1,3 @@
1
- import * as react from 'react';
2
1
  import { ReactNode } from 'react';
3
2
 
4
3
  /**
@@ -247,6 +246,4 @@ interface ComposerProps {
247
246
  onHeldImagesChange?: (images: HeldImage[]) => void;
248
247
  }
249
248
 
250
- declare const Composer: react.ForwardRefExoticComponent<ComposerProps & react.RefAttributes<HTMLDivElement>>;
251
-
252
- export { Composer as C, type HeldImage as H, type PasteEventLike as P, type UsePastePillsOptions as U, type ComposerPasteClassNames as a, type ComposerPastePreview as b, type ComposerProps as c, type ComposerSubmitExtras as d, type HeldPaste as e, type UsePastePillsResult as f, pasteMarker as p, usePastePills as u };
249
+ export { type ComposerPasteClassNames as C, type HeldImage as H, type PasteEventLike as P, type UsePastePillsOptions as U, type ComposerPastePreview as a, type ComposerProps as b, type ComposerSubmitExtras as c, type HeldPaste as d, type UsePastePillsResult as e, pasteMarker as p, usePastePills as u };