@blockrun/franklin 3.21.4 → 3.21.5
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/dist/ui/app.js +12 -1
- package/package.json +1 -1
package/dist/ui/app.js
CHANGED
|
@@ -23,6 +23,13 @@ const DISABLE_BRACKETED_PASTE = '\x1b[?2004l';
|
|
|
23
23
|
const USER_PROMPT_COLOR = '#FFD700';
|
|
24
24
|
const PASTE_BLOCK_START = '\uE000PASTE:';
|
|
25
25
|
const PASTE_BLOCK_END = ':PASTE\uE001';
|
|
26
|
+
// Only collapse pastes of >= this many lines into a [Pasted ~N lines] block.
|
|
27
|
+
// Short pastes (one-liners, 2-4 line snippets) inline as plain text so the
|
|
28
|
+
// model sees them verbatim and the user can read what they pasted in the
|
|
29
|
+
// input box. 5 lines is a sweet spot — long enough to skip multi-line code
|
|
30
|
+
// dumps and log tails, short enough that ordinary prose pastes still show
|
|
31
|
+
// inline.
|
|
32
|
+
const PASTE_COLLAPSE_LINE_THRESHOLD = 5;
|
|
26
33
|
const DISABLE_AUTO_WRAP = '\x1b[?7l';
|
|
27
34
|
const ENABLE_AUTO_WRAP = '\x1b[?7h';
|
|
28
35
|
function stripPasteMarkers(input) {
|
|
@@ -193,7 +200,11 @@ function PromptTextInput({ value, onChange, onSubmit, placeholder = '', focus =
|
|
|
193
200
|
pasteBufferRef.current += text;
|
|
194
201
|
if (!hasPasteEnd)
|
|
195
202
|
return;
|
|
196
|
-
|
|
203
|
+
const buffered = pasteBufferRef.current;
|
|
204
|
+
const lineCount = buffered.length === 0 ? 0 : buffered.split('\n').length;
|
|
205
|
+
text = lineCount >= PASTE_COLLAPSE_LINE_THRESHOLD
|
|
206
|
+
? encodePasteBlock(buffered)
|
|
207
|
+
: buffered;
|
|
197
208
|
pasteBufferRef.current = '';
|
|
198
209
|
pasteActiveRef.current = false;
|
|
199
210
|
}
|
package/package.json
CHANGED