@vincemakes/kiso-tui-cells 0.32.1 → 0.32.2
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/render.d.ts +15 -0
- package/dist/render.js +20 -0
- package/dist/strings.js +14 -4
- package/package.json +1 -1
package/dist/render.d.ts
CHANGED
|
@@ -176,6 +176,21 @@ export declare function foldThinking(block: string): string;
|
|
|
176
176
|
* the line the pipe has always written, which is what keeps the two
|
|
177
177
|
* renderings one shape rather than two. */
|
|
178
178
|
export declare function foldThinkingRow(block: string, room: number): string;
|
|
179
|
+
/**
|
|
180
|
+
* DC-60 (0.32.2) — the words of a turn, whatever shape its content took.
|
|
181
|
+
*
|
|
182
|
+
* A turn that carries an image is an ARRAY of blocks (text, image, text…)
|
|
183
|
+
* in the durable log. Its echo — the user chip while the session runs, the
|
|
184
|
+
* transcript's replay, the session listing — must say the words and mark
|
|
185
|
+
* the image, and it must say them from ONE definition: the live echo used
|
|
186
|
+
* to pass a string through and an array became an empty chip, while the
|
|
187
|
+
* transcript path projected the array on its own. The image mark is
|
|
188
|
+
* "(image)"; the bytes are never shown.
|
|
189
|
+
*/
|
|
190
|
+
export declare function echoText(content: string | readonly {
|
|
191
|
+
readonly type?: string;
|
|
192
|
+
readonly text?: string;
|
|
193
|
+
}[]): string;
|
|
179
194
|
/** v2b — the [result] echo truncates at 160 chars + a /last hint. */
|
|
180
195
|
export declare function foldResult(content: string): string;
|
|
181
196
|
/**
|
package/dist/render.js
CHANGED
|
@@ -142,6 +142,26 @@ export function foldThinkingRow(block, room) {
|
|
|
142
142
|
: trimmed.slice(0, 100);
|
|
143
143
|
return `${p.dim}…${head}${suffix}${p.reset}`;
|
|
144
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* DC-60 (0.32.2) — the words of a turn, whatever shape its content took.
|
|
147
|
+
*
|
|
148
|
+
* A turn that carries an image is an ARRAY of blocks (text, image, text…)
|
|
149
|
+
* in the durable log. Its echo — the user chip while the session runs, the
|
|
150
|
+
* transcript's replay, the session listing — must say the words and mark
|
|
151
|
+
* the image, and it must say them from ONE definition: the live echo used
|
|
152
|
+
* to pass a string through and an array became an empty chip, while the
|
|
153
|
+
* transcript path projected the array on its own. The image mark is
|
|
154
|
+
* "(image)"; the bytes are never shown.
|
|
155
|
+
*/
|
|
156
|
+
export function echoText(content) {
|
|
157
|
+
if (typeof content === "string")
|
|
158
|
+
return content;
|
|
159
|
+
return content
|
|
160
|
+
.map((b) => (b.type === "text" ? (b.text ?? "") : "(image)"))
|
|
161
|
+
.join(" ")
|
|
162
|
+
.replace(/ +/g, " ")
|
|
163
|
+
.trim();
|
|
164
|
+
}
|
|
145
165
|
/** v2b — the [result] echo truncates at 160 chars + a /last hint. */
|
|
146
166
|
export function foldResult(content) {
|
|
147
167
|
const flat = content.replaceAll("\n", " ");
|
package/dist/strings.js
CHANGED
|
@@ -205,6 +205,12 @@ export const KEY_BINDINGS = [
|
|
|
205
205
|
{ keys: "alt+⌫ / alt+d", what: "delete word (ctrl+w too)" },
|
|
206
206
|
{ keys: "ctrl+x", what: "copy the last answer" },
|
|
207
207
|
{ keys: "ctrl+z / ctrl+y", what: "undo / redo" },
|
|
208
|
+
// REL-0152-D15/D16 — the image paste. It is on the sheet because a
|
|
209
|
+
// terminal's own Cmd+V only ever pastes TEXT: a human with an image on
|
|
210
|
+
// the clipboard has no way to discover this key by trying the obvious
|
|
211
|
+
// one, which is exactly the case the sheet exists for. It pairs with
|
|
212
|
+
// the undo row above and keeps the table's count even.
|
|
213
|
+
{ keys: "ctrl+v", what: "attach a clipboard image" },
|
|
208
214
|
];
|
|
209
215
|
/**
|
|
210
216
|
* TUI2-R2pre ④ — THE display-verb table (the integrator's ruling).
|
|
@@ -294,7 +300,10 @@ const SHEET_GRID = [
|
|
|
294
300
|
// exactly as its comment predicted it would.
|
|
295
301
|
[10, 11],
|
|
296
302
|
[12, 13],
|
|
297
|
-
|
|
303
|
+
// ctrl+v joins the undo row's neighbour: the count is even again, so
|
|
304
|
+
// the last row pairs instead of standing alone. The warning three
|
|
305
|
+
// comments up applies unchanged — this grid does not update itself.
|
|
306
|
+
[14, 15],
|
|
298
307
|
];
|
|
299
308
|
const SHEET_STOPS = [
|
|
300
309
|
[16, 43],
|
|
@@ -310,10 +319,11 @@ const SHEET_STOPS = [
|
|
|
310
319
|
// The stop is 39 here because `alt+⌫ / alt+d delete word (ctrl+w too)`
|
|
311
320
|
// is the widest first cell on the sheet — a narrower stop packs the
|
|
312
321
|
// two cells together with a single space and the column disappears.
|
|
313
|
-
// The last row
|
|
314
|
-
// list
|
|
322
|
+
// The last row PAIRS now that ctrl+v joined (it had one binding and an
|
|
323
|
+
// empty stop list); it takes a stop like its neighbours so the second
|
|
324
|
+
// column lines up rather than following a single space.
|
|
325
|
+
[39],
|
|
315
326
|
[39],
|
|
316
|
-
[],
|
|
317
327
|
];
|
|
318
328
|
/**
|
|
319
329
|
* TUI2-R1 (D) — the sheet, one screen, static.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-tui-cells",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.2",
|
|
4
4
|
"description": "kiso tui-cells — the components cell renderer (components, diff, width, the render slice). Zero runtime dependencies: input is data, output is bytes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|