@opentui/core 0.8.1 → 0.8.3
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/NativeSession.d.ts +1 -1
- package/{chunk-bun-wdetc10w.js → chunk-bun-12ttbayv.js} +61 -3
- package/chunk-bun-12ttbayv.js.map +35 -0
- package/{chunk-bun-ved2tpxm.js → chunk-bun-psdzwx7h.js} +30 -17
- package/{chunk-bun-ved2tpxm.js.map → chunk-bun-psdzwx7h.js.map} +6 -6
- package/{chunk-node-m8mjyx7h.js → chunk-node-88t8pbzy.js} +61 -3
- package/chunk-node-88t8pbzy.js.map +34 -0
- package/{chunk-node-tpjmjvn7.js → chunk-node-drh8dgw6.js} +30 -17
- package/{chunk-node-tpjmjvn7.js.map → chunk-node-drh8dgw6.js.map} +6 -6
- package/index.bun.js +23 -28
- package/index.bun.js.map +6 -6
- package/index.node.js +23 -28
- package/index.node.js.map +6 -6
- package/native-abi.generated.d.ts +86 -0
- package/node-assets.js +1 -1
- package/node-assets.js.map +3 -3
- package/package.json +9 -9
- package/renderables/EmbeddedTerminal.d.ts +6 -0
- package/renderables/Markdown.d.ts +0 -5
- package/renderables/markdown-parser.d.ts +1 -0
- package/renderer.d.ts +1 -0
- package/testing.bun.js +2 -2
- package/testing.js +2 -2
- package/yoga.bun.js +1 -1
- package/yoga.js +1 -1
- package/zig.d.ts +5 -0
- package/chunk-bun-wdetc10w.js.map +0 -35
- package/chunk-node-m8mjyx7h.js.map +0 -34
package/index.node.js
CHANGED
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
Gutter2,
|
|
120
120
|
MeasureMode2,
|
|
121
121
|
exports_yoga
|
|
122
|
-
} from "./chunk-node-
|
|
122
|
+
} from "./chunk-node-88t8pbzy.js";
|
|
123
123
|
import {
|
|
124
124
|
isValidBorderStyle2,
|
|
125
125
|
parseBorderStyle2,
|
|
@@ -253,7 +253,7 @@ import {
|
|
|
253
253
|
CliRenderEvents2,
|
|
254
254
|
RendererControlState2,
|
|
255
255
|
CliRenderer2
|
|
256
|
-
} from "./chunk-node-
|
|
256
|
+
} from "./chunk-node-drh8dgw6.js";
|
|
257
257
|
// src/syntax-style.ts
|
|
258
258
|
function cloneStyle(style) {
|
|
259
259
|
return {
|
|
@@ -4742,7 +4742,10 @@ class AudioRecorder extends EventEmitter {
|
|
|
4742
4742
|
await this.writeFully(createWavHeader(this.sampleRate, this.channels, Number(this.dataBytesWritten)), 0, "finalize");
|
|
4743
4743
|
if (this.terminationRequest != null)
|
|
4744
4744
|
return;
|
|
4745
|
-
await this.fileHandle.sync()
|
|
4745
|
+
await this.fileHandle.sync().catch((cause) => {
|
|
4746
|
+
if (cause.code !== "ERR_ACCESS_DENIED")
|
|
4747
|
+
throw cause;
|
|
4748
|
+
});
|
|
4746
4749
|
if (this.terminationRequest != null)
|
|
4747
4750
|
return;
|
|
4748
4751
|
await this.fileHandle.close();
|
|
@@ -8162,6 +8165,11 @@ class EmbeddedTerminalRenderable extends Renderable2 {
|
|
|
8162
8165
|
}
|
|
8163
8166
|
};
|
|
8164
8167
|
}
|
|
8168
|
+
getScroll() {
|
|
8169
|
+
if (!this.handle)
|
|
8170
|
+
return { offset: 0, total: 0, visible: 0 };
|
|
8171
|
+
return this.lib.contextEmbeddedTerminalScrollbar(this.handle.context, this.handle);
|
|
8172
|
+
}
|
|
8165
8173
|
write(data) {
|
|
8166
8174
|
if (!this.handle)
|
|
8167
8175
|
return;
|
|
@@ -11794,7 +11802,9 @@ class TextTableRenderable extends Renderable2 {
|
|
|
11794
11802
|
|
|
11795
11803
|
// src/renderables/markdown-parser.ts
|
|
11796
11804
|
function parseMarkdownIncremental(newContent, prevState, trailingUnstable = 2) {
|
|
11797
|
-
if (
|
|
11805
|
+
if (trailingUnstable === 0 && prevState?.content === newContent && prevState.stableTokenCount === prevState.tokens.length)
|
|
11806
|
+
return prevState;
|
|
11807
|
+
if (!prevState || prevState.tokens.length === 0 || trailingUnstable === 0) {
|
|
11798
11808
|
try {
|
|
11799
11809
|
const tokens = x.lex(newContent, { gfm: true });
|
|
11800
11810
|
return {
|
|
@@ -11824,19 +11834,12 @@ function parseMarkdownIncremental(newContent, prevState, trailingUnstable = 2) {
|
|
|
11824
11834
|
}
|
|
11825
11835
|
const stableTokens = prevState.tokens.slice(0, reuseCount);
|
|
11826
11836
|
const remainingContent = newContent.slice(offset);
|
|
11827
|
-
if (!remainingContent) {
|
|
11828
|
-
return {
|
|
11829
|
-
content: newContent,
|
|
11830
|
-
tokens: stableTokens,
|
|
11831
|
-
stableTokenCount: stableTokens.length
|
|
11832
|
-
};
|
|
11833
|
-
}
|
|
11834
11837
|
try {
|
|
11835
11838
|
const newTokens = x.lex(remainingContent, { gfm: true });
|
|
11836
11839
|
return {
|
|
11837
11840
|
content: newContent,
|
|
11838
11841
|
tokens: [...stableTokens, ...newTokens],
|
|
11839
|
-
stableTokenCount:
|
|
11842
|
+
stableTokenCount: stableTokens.length
|
|
11840
11843
|
};
|
|
11841
11844
|
} catch {
|
|
11842
11845
|
try {
|
|
@@ -12086,6 +12089,7 @@ class MarkdownRenderable extends Renderable2 {
|
|
|
12086
12089
|
if (this._streaming !== value) {
|
|
12087
12090
|
this.assertMutable();
|
|
12088
12091
|
this._streaming = value;
|
|
12092
|
+
this._parseState = parseMarkdownIncremental(this._content, this._parseState, value ? 2 : 0);
|
|
12089
12093
|
this.updateBlocks(true);
|
|
12090
12094
|
}
|
|
12091
12095
|
}
|
|
@@ -13334,8 +13338,9 @@ class MarkdownRenderable extends Renderable2 {
|
|
|
13334
13338
|
this._stableBlockCount = 0;
|
|
13335
13339
|
return;
|
|
13336
13340
|
}
|
|
13337
|
-
|
|
13338
|
-
|
|
13341
|
+
if (this._parseState?.content !== this._content) {
|
|
13342
|
+
this._parseState = parseMarkdownIncremental(this._content, this._parseState, this._streaming ? 2 : 0);
|
|
13343
|
+
}
|
|
13339
13344
|
const tokens = this._parseState.tokens;
|
|
13340
13345
|
if (tokens.length === 0 && this._content.length > 0) {
|
|
13341
13346
|
this.clearBlockStates();
|
|
@@ -13365,7 +13370,7 @@ class MarkdownRenderable extends Renderable2 {
|
|
|
13365
13370
|
const token = blockTokens[i];
|
|
13366
13371
|
const nextToken = blockTokens[i + 1];
|
|
13367
13372
|
const existing = this._blockStates[blockIndex];
|
|
13368
|
-
if (existing && existing.tokenRaw === token.raw && existing.token.type === token.type) {
|
|
13373
|
+
if (existing && existing.tokenRaw === token.raw && existing.token.type === token.type && (existing.canUpdateInPlace || !forceTableRefresh)) {
|
|
13369
13374
|
existing.token = token;
|
|
13370
13375
|
if (forceTableRefresh) {
|
|
13371
13376
|
this.updateBlockRenderable(existing, token, blockIndex, nextToken, true);
|
|
@@ -13451,16 +13456,6 @@ class MarkdownRenderable extends Renderable2 {
|
|
|
13451
13456
|
this._blockStates = [];
|
|
13452
13457
|
this._stableBlockCount = 0;
|
|
13453
13458
|
}
|
|
13454
|
-
rerenderBlocks() {
|
|
13455
|
-
if (this._internalBlockMode === "top-level") {
|
|
13456
|
-
this.updateBlocks(true);
|
|
13457
|
-
return;
|
|
13458
|
-
}
|
|
13459
|
-
for (let i = 0;i < this._blockStates.length; i++) {
|
|
13460
|
-
const state = this._blockStates[i];
|
|
13461
|
-
this.updateBlockRenderable(state, state.token, i, this._blockStates[i + 1]?.token, true);
|
|
13462
|
-
}
|
|
13463
|
-
}
|
|
13464
13459
|
clearCache() {
|
|
13465
13460
|
this._parseState = null;
|
|
13466
13461
|
this.clearBlockStates();
|
|
@@ -13470,7 +13465,7 @@ class MarkdownRenderable extends Renderable2 {
|
|
|
13470
13465
|
refreshStyles() {
|
|
13471
13466
|
this._styleDirty = false;
|
|
13472
13467
|
this._ctx.nativeScene.lifecyclePasses.refresh(this);
|
|
13473
|
-
this.
|
|
13468
|
+
this.updateBlocks(true);
|
|
13474
13469
|
this.requestRender();
|
|
13475
13470
|
}
|
|
13476
13471
|
markStyleDirty() {
|
|
@@ -13482,7 +13477,7 @@ class MarkdownRenderable extends Renderable2 {
|
|
|
13482
13477
|
return;
|
|
13483
13478
|
this._styleDirty = false;
|
|
13484
13479
|
this._ctx.nativeScene.lifecyclePasses.refresh(this);
|
|
13485
|
-
this.
|
|
13480
|
+
this.updateBlocks(true);
|
|
13486
13481
|
}
|
|
13487
13482
|
_needsLifecyclePass() {
|
|
13488
13483
|
if (this.onLifecyclePass !== this.applyStyleChanges)
|
|
@@ -16316,5 +16311,5 @@ export {
|
|
|
16316
16311
|
yellow2 as yellow
|
|
16317
16312
|
};
|
|
16318
16313
|
|
|
16319
|
-
//# debugId=
|
|
16314
|
+
//# debugId=FF321BC67FD1ABE664756E2164756E21
|
|
16320
16315
|
//# sourceMappingURL=index.node.js.map
|