@particle-academy/react-fancy 5.38.0 → 5.40.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.
- package/CHANGELOG.md +76 -0
- package/dist/{index-CazpqSsk.d.ts → Composer.types-CuSPnaOt.d.cts} +1 -4
- package/dist/{index-CazpqSsk.d.cts → Composer.types-CuSPnaOt.d.ts} +1 -4
- package/dist/{chunk-Z4GO6N6N.js → chunk-2JOWGYAJ.js} +322 -408
- package/dist/chunk-2JOWGYAJ.js.map +1 -0
- package/dist/{chunk-TZHK3LEW.cjs → chunk-35TZQIIN.cjs} +17 -8
- package/dist/chunk-35TZQIIN.cjs.map +1 -0
- package/dist/{chunk-RYKPYILS.cjs → chunk-6TZPM43Q.cjs} +325 -408
- package/dist/chunk-6TZPM43Q.cjs.map +1 -0
- package/dist/chunk-BZOU7VJQ.cjs +231 -0
- package/dist/chunk-BZOU7VJQ.cjs.map +1 -0
- package/dist/{chunk-QLL7MWAU.cjs → chunk-FJ2GMQLC.cjs} +116 -26
- package/dist/chunk-FJ2GMQLC.cjs.map +1 -0
- package/dist/{chunk-YCV43A7D.js → chunk-H6WSJL2X.js} +17 -8
- package/dist/chunk-H6WSJL2X.js.map +1 -0
- package/dist/chunk-MXAVGOHW.js +229 -0
- package/dist/chunk-MXAVGOHW.js.map +1 -0
- package/dist/{chunk-WUV3XDJH.js → chunk-YLPVTEUH.js} +117 -27
- package/dist/chunk-YLPVTEUH.js.map +1 -0
- package/dist/command.cjs +4 -3
- package/dist/command.d.cts +12 -1
- package/dist/command.d.ts +12 -1
- package/dist/command.js +2 -1
- package/dist/composer.cjs +4 -3
- package/dist/composer.d.cts +7 -2
- package/dist/composer.d.ts +7 -2
- package/dist/composer.js +2 -1
- package/dist/{index-DXUAAZzE.d.ts → index-BsIBOwaK.d.cts} +46 -1
- package/dist/{index-DXUAAZzE.d.cts → index-S4FC1yFK.d.ts} +46 -1
- package/dist/index.cjs +13 -12
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -3
- package/dist/prompt-input.cjs +4 -2
- package/dist/prompt-input.d.cts +2 -1
- package/dist/prompt-input.d.ts +2 -1
- package/dist/prompt-input.js +3 -1
- package/package.json +1 -1
- package/dist/chunk-QLL7MWAU.cjs.map +0 -1
- package/dist/chunk-RYKPYILS.cjs.map +0 -1
- package/dist/chunk-TZHK3LEW.cjs.map +0 -1
- package/dist/chunk-WUV3XDJH.js.map +0 -1
- package/dist/chunk-YCV43A7D.js.map +0 -1
- package/dist/chunk-Z4GO6N6N.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,82 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
11
11
|
|
|
12
12
|
## [Unreleased]
|
|
13
13
|
|
|
14
|
+
## [5.40.0] - 2026-10-17
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **`<Command shouldFilter={false}>` turns off the built-in filter.** Every
|
|
19
|
+
`Command.Item` renders and the caller decides which to render; the input,
|
|
20
|
+
active index and keyboard handling are unchanged. Same name as cmdk's.
|
|
21
|
+
|
|
22
|
+
A palette with its own matching could not use `Command`: Genie 2's Command
|
|
23
|
+
Window reads `w> tynn` as "workspaces matching tynn", and every item hid itself
|
|
24
|
+
because no item's text contains `w> tynn`.
|
|
25
|
+
|
|
26
|
+
- **`query` / `onQueryChange` make the search text controllable.** Filtering for
|
|
27
|
+
yourself needs the query, and it was internal-only state — which the component
|
|
28
|
+
contract does not allow for anything an agent might read or write.
|
|
29
|
+
|
|
30
|
+
**What you must DO: nothing.** `shouldFilter` defaults to `true`, and an
|
|
31
|
+
uncontrolled `Command` keeps its own query exactly as before.
|
|
32
|
+
|
|
33
|
+
## [5.39.0] - 2026-10-15
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- **`PromptInput` gets inline paste pills** — the same ones `Composer` gained in
|
|
38
|
+
5.38.0, built on the same code (react-fancy#32, asked for by Genie 2, whose chat
|
|
39
|
+
composer this is).
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
<PromptInput budgetTokens={200_000} pasteThreshold={500} pasteImages previewChars={30}
|
|
43
|
+
onSubmit={(text, attachments) => send(text, attachments)} />
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- A paste of `pasteThreshold`+ characters becomes `Pasted text · N characters`
|
|
47
|
+
**where it was pasted**, on a line of its own. Clicking it puts the full text
|
|
48
|
+
back right there; hovering shows the first and last `previewChars`.
|
|
49
|
+
- **`pasteImages`**: a pasted image becomes an inline `Pasted image N` pill AND
|
|
50
|
+
arrives in `onSubmit`'s attachments with its File, in message order. The text
|
|
51
|
+
marks where it sat as `[Pasted image N]`.
|
|
52
|
+
- `onSubmit` receives every text pill expanded where it sits — never a marker —
|
|
53
|
+
and **a message that is only a paste can be sent**.
|
|
54
|
+
- **The send contract is unchanged**: Ctrl/⌘+Enter sends, plain Enter is a
|
|
55
|
+
newline, and the `/` and `@` pickers, drop-to-attach and the file picker all
|
|
56
|
+
work in the inline editor exactly as in the textarea.
|
|
57
|
+
- `renderPastePreview` and `pasteClassNames` restyle the pills and popover.
|
|
58
|
+
|
|
59
|
+
Asked for as chips beside the input carried as `text/plain` attachments; built
|
|
60
|
+
inline instead, to the owner's own spec given against screenshots of this
|
|
61
|
+
composer. The text still reaches the model — positioned where the person put it.
|
|
62
|
+
|
|
63
|
+
- **A quieter `PromptInput` footer**, each part opt-in:
|
|
64
|
+
- `attachButton="icon"` — paperclip only, with an accessible name and a tooltip.
|
|
65
|
+
- `sendButton="icon"` — a compact send button whose tooltip carries the shortcut
|
|
66
|
+
(`Send · Ctrl+Enter`), replacing the inline kbd hint.
|
|
67
|
+
- `meter="near-limit"` — hidden until usage passes `meterShowAt` (0.75), muted
|
|
68
|
+
until `meterWarnAt` (0.9), warning colour past it. `meter="hidden"` never
|
|
69
|
+
shows it.
|
|
70
|
+
- **`usedTokens`** — the caller's REAL usage (an agent's context, say). The
|
|
71
|
+
meter shows it plus the draft's estimate; before, it could only estimate the
|
|
72
|
+
draft as length ÷ `charsPerToken`, which is why a host had to fake the budget.
|
|
73
|
+
|
|
74
|
+
Handles: `data-react-fancy-prompt-input-attach`, `-send`, `-meter` (with
|
|
75
|
+
`data-level`: `ok` / `caution` / `warn` / `muted`).
|
|
76
|
+
|
|
77
|
+
### Changed
|
|
78
|
+
|
|
79
|
+
- `Composer` and `PromptInput` now share one implementation of inline paste
|
|
80
|
+
pills (`useInlinePaste`), so the two cannot disagree about what a pill means.
|
|
81
|
+
No behaviour change to `Composer`; all its tests pass untouched.
|
|
82
|
+
- `Composer`'s internal inline pill moved to its own file. No behaviour or API
|
|
83
|
+
change; its props were being read as `Composer`'s by the showcase's docs
|
|
84
|
+
coverage check.
|
|
85
|
+
|
|
86
|
+
**What you must DO: nothing.** Every option defaults to the old behaviour: no
|
|
87
|
+
`pasteThreshold` or `pasteImages` means the textarea you had, and the footer is
|
|
88
|
+
unchanged unless you ask.
|
|
89
|
+
|
|
14
90
|
## [5.38.0] - 2026-10-14
|
|
15
91
|
|
|
16
92
|
### 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
|
-
|
|
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
|
-
|
|
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 };
|