@vibecook/ghosttea-react 0.13.8 → 0.14.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/dist/TerminalSurface.js +25 -4
- package/dist/TerminalSurface.js.map +1 -1
- package/dist/renderers/webgpu-renderer.d.ts +7 -1
- package/dist/renderers/webgpu-renderer.d.ts.map +1 -1
- package/dist/renderers/webgpu-renderer.js +25 -6
- package/dist/renderers/webgpu-renderer.js.map +1 -1
- package/dist/routed-activation.d.ts +10 -0
- package/dist/routed-activation.d.ts.map +1 -1
- package/dist/routed-activation.js +28 -0
- package/dist/routed-activation.js.map +1 -1
- package/dist/routed-control.d.ts +4 -1
- package/dist/routed-control.d.ts.map +1 -1
- package/dist/routed-control.js +81 -2
- package/dist/routed-control.js.map +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +65 -5
- package/dist/runtime.js.map +1 -1
- package/dist/terminal-render.worker.js +28 -7
- package/dist/terminal-render.worker.js.map +2 -2
- package/package.json +4 -4
|
@@ -1542,6 +1542,13 @@ function ordered2(selection) {
|
|
|
1542
1542
|
function cellLength(text) {
|
|
1543
1543
|
return splitGraphemes(text).reduce((total, grapheme) => total + graphemeCellWidth(grapheme), 0);
|
|
1544
1544
|
}
|
|
1545
|
+
function nativeCellEnd(glyphs) {
|
|
1546
|
+
return glyphs.reduce((end, glyph) => Math.max(end, glyph.cellStart + glyph.cellSpan), 0);
|
|
1547
|
+
}
|
|
1548
|
+
function selectionRowCellLength(text, glyphs) {
|
|
1549
|
+
const trailing = text.slice(text.trimEnd().length);
|
|
1550
|
+
return Math.max(cellLength(text), nativeCellEnd(glyphs) + cellLength(trailing));
|
|
1551
|
+
}
|
|
1545
1552
|
var BOX_DIRECTIONS = /* @__PURE__ */ new Map([
|
|
1546
1553
|
["\u2500", "lr"],
|
|
1547
1554
|
["\u2501", "lr"],
|
|
@@ -1602,7 +1609,7 @@ var BOX_DIRECTIONS = /* @__PURE__ */ new Map([
|
|
|
1602
1609
|
["\u2570", "ru"]
|
|
1603
1610
|
]);
|
|
1604
1611
|
var ROUNDED_BOX_CORNERS = /* @__PURE__ */ new Set(["\u256D", "\u256E", "\u256F", "\u2570"]);
|
|
1605
|
-
function specialDrawingCells(text) {
|
|
1612
|
+
function specialDrawingCells(text, glyphs) {
|
|
1606
1613
|
const box = /* @__PURE__ */ new Map();
|
|
1607
1614
|
const block = /* @__PURE__ */ new Map();
|
|
1608
1615
|
let column = 0;
|
|
@@ -1623,6 +1630,9 @@ function specialDrawingCells(text) {
|
|
|
1623
1630
|
}
|
|
1624
1631
|
}
|
|
1625
1632
|
if (simple) return { box, block };
|
|
1633
|
+
if (glyphs?.length && (text.includes("\u200D") || nativeCellEnd(glyphs) !== cellLength(text.trimEnd()))) {
|
|
1634
|
+
return { box, block };
|
|
1635
|
+
}
|
|
1626
1636
|
box.clear();
|
|
1627
1637
|
block.clear();
|
|
1628
1638
|
column = 0;
|
|
@@ -2456,7 +2466,7 @@ var WebGpuTerminalRenderer = class _WebGpuTerminalRenderer {
|
|
|
2456
2466
|
for (const row of renderRows) {
|
|
2457
2467
|
if (row < start.row || row > end.row) continue;
|
|
2458
2468
|
const first = row === start.row ? start.column : 0;
|
|
2459
|
-
const last = row === end.row ? end.column : Math.max(0,
|
|
2469
|
+
const last = row === end.row ? end.column : Math.max(0, selectionRowCellLength(view.rows[row] ?? "", view.nativeRows[row] ?? []) - 1);
|
|
2460
2470
|
pushRectangle(
|
|
2461
2471
|
rectangleVertices,
|
|
2462
2472
|
(ORIGIN_X + first * CELL_WIDTH) * scale,
|
|
@@ -2473,7 +2483,7 @@ var WebGpuTerminalRenderer = class _WebGpuTerminalRenderer {
|
|
|
2473
2483
|
const selectionInstanceCount = rectangleVertices.length / 10 - backgroundInstanceCount;
|
|
2474
2484
|
if (hasNativeRows) {
|
|
2475
2485
|
for (const row of renderRows) {
|
|
2476
|
-
const { box: boxCells, block: blockCells } = specialDrawingCells(view.rows[row] ?? "");
|
|
2486
|
+
const { box: boxCells, block: blockCells } = specialDrawingCells(view.rows[row] ?? "", view.nativeRows[row]);
|
|
2477
2487
|
for (const instance of view.nativeRows[row] ?? []) {
|
|
2478
2488
|
const definition = view.glyphDefinitions.get(instance.glyphId);
|
|
2479
2489
|
if (!definition) continue;
|
|
@@ -2672,7 +2682,7 @@ var WebGpuTerminalRenderer = class _WebGpuTerminalRenderer {
|
|
|
2672
2682
|
for (const row of renderRows) {
|
|
2673
2683
|
if (row < start.row || row > end.row) continue;
|
|
2674
2684
|
const first = row === start.row ? start.column : 0;
|
|
2675
|
-
const last = row === end.row ? end.column : Math.max(0,
|
|
2685
|
+
const last = row === end.row ? end.column : Math.max(0, selectionRowCellLength(view.rows[row] ?? "", view.nativeRows[row] ?? []) - 1);
|
|
2676
2686
|
pushRectangle(
|
|
2677
2687
|
rectangleVertices,
|
|
2678
2688
|
(ORIGIN_X + first * CELL_WIDTH) * scale,
|
|
@@ -2690,7 +2700,7 @@ var WebGpuTerminalRenderer = class _WebGpuTerminalRenderer {
|
|
|
2690
2700
|
const hasNativeRows = view.nativeRows.some((row) => row.length > 0);
|
|
2691
2701
|
if (hasNativeRows) {
|
|
2692
2702
|
for (const row of renderRows) {
|
|
2693
|
-
const { box: boxCells, block: blockCells } = specialDrawingCells(view.rows[row] ?? "");
|
|
2703
|
+
const { box: boxCells, block: blockCells } = specialDrawingCells(view.rows[row] ?? "", view.nativeRows[row]);
|
|
2694
2704
|
for (const instance of view.nativeRows[row] ?? []) {
|
|
2695
2705
|
const definition = view.glyphDefinitions.get(instance.glyphId);
|
|
2696
2706
|
if (!definition) continue;
|
|
@@ -3329,7 +3339,9 @@ var ROUTED_MESSAGE_TYPES = [
|
|
|
3329
3339
|
"FramesLegAttached",
|
|
3330
3340
|
"TransportCredit",
|
|
3331
3341
|
"SceneApplied",
|
|
3332
|
-
"CalibrationPing"
|
|
3342
|
+
"CalibrationPing",
|
|
3343
|
+
"SelectionTextRequest",
|
|
3344
|
+
"SelectionTextResult"
|
|
3333
3345
|
];
|
|
3334
3346
|
var ROUTED_LEG_OUTBOUND = {
|
|
3335
3347
|
control: [
|
|
@@ -3341,7 +3353,8 @@ var ROUTED_LEG_OUTBOUND = {
|
|
|
3341
3353
|
"DemandAccepted",
|
|
3342
3354
|
"CellActivationStatus",
|
|
3343
3355
|
"GeometryCommitted",
|
|
3344
|
-
"GeometryRefused"
|
|
3356
|
+
"GeometryRefused",
|
|
3357
|
+
"SelectionTextResult"
|
|
3345
3358
|
],
|
|
3346
3359
|
frames: ["ConnectionAccepted", "ConnectionRefused", "LegHeartbeatAck", "FramesLegAttached", "AttachRefused"]
|
|
3347
3360
|
};
|
|
@@ -3424,6 +3437,14 @@ function hasActivation(record) {
|
|
|
3424
3437
|
}
|
|
3425
3438
|
function validateRoutedBody(type, body) {
|
|
3426
3439
|
switch (type) {
|
|
3440
|
+
case "SelectionTextRequest":
|
|
3441
|
+
case "SelectionTextResult": {
|
|
3442
|
+
if (!isNonEmptyString(body.requestId) || body.requestId.length > 64 || !isNonEmptyString(body.sessionId) || body.sessionId.length > 256 || !isNonEmptyString(body.activationId) || body.activationId.length > 256 || !isCounter(body.leaseEpoch))
|
|
3443
|
+
return false;
|
|
3444
|
+
if (type === "SelectionTextResult")
|
|
3445
|
+
return typeof body.text === "string" && body.error === void 0 || body.text === void 0 && (body.error === "UNAVAILABLE" || body.error === "TOO_LARGE");
|
|
3446
|
+
return [body.startColumn, body.endColumn].every((value) => isCounter(value) && value <= 65535) && [body.startRow, body.endRow].every((value) => isCounter(value) && value <= 4294967295) && typeof body.selectAll === "boolean";
|
|
3447
|
+
}
|
|
3427
3448
|
case "ConnectionHello":
|
|
3428
3449
|
return isCounter(body.protocolMajor) && isCounter(body.protocolMinor) && (body.channel === "control" || body.channel === "frames") && isRoutedCellTransportGrant(body.transportGrant) && (body.receiverCapacities === void 0 || isRoutedReceiverCapacities(body.receiverCapacities)) && isStringArray(body.capabilities);
|
|
3429
3450
|
case "ConnectionAccepted":
|