@opentui/core 0.2.0 → 0.2.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/NativeSpanFeed.d.ts +2 -2
- package/README.md +2 -1
- package/buffer.d.ts +3 -3
- package/edit-buffer.d.ts +1 -1
- package/editor-view.d.ts +1 -1
- package/{index-mch6dv67.js → index-d07rkqtc.js} +252 -37
- package/{index-mch6dv67.js.map → index-d07rkqtc.js.map} +5 -5
- package/{index-mw2x3082.js → index-jv9g79dk.js} +694 -237
- package/{index-mw2x3082.js.map → index-jv9g79dk.js.map} +16 -15
- package/index-p147fdyc.js +44 -0
- package/index-p147fdyc.js.map +10 -0
- package/{index-epp5y71w.js → index-yedf4bn5.js} +3 -3
- package/index.js +2 -2
- package/lib/clipboard.d.ts +1 -1
- package/lib/terminal-palette.d.ts +12 -5
- package/package.json +14 -20
- package/platform/ffi.d.ts +64 -2
- package/renderer.d.ts +10 -4
- package/runtime-plugin-support-configure.d.ts +4 -0
- package/runtime-plugin-support-configure.js +18 -0
- package/runtime-plugin-support-configure.js.map +9 -0
- package/runtime-plugin-support.d.ts +3 -3
- package/runtime-plugin-support.js +7 -16
- package/runtime-plugin-support.js.map +3 -3
- package/runtime-plugin.js +3 -3
- package/syntax-style.d.ts +1 -1
- package/testing.js +1 -1
- package/text-buffer-view.d.ts +1 -1
- package/text-buffer.d.ts +1 -1
- package/zig-structs.d.ts +2 -2
- package/zig.d.ts +1 -1
- package/3d/SpriteResourceManager.d.ts +0 -74
- package/3d/SpriteUtils.d.ts +0 -13
- package/3d/TextureUtils.d.ts +0 -24
- package/3d/ThreeRenderable.d.ts +0 -40
- package/3d/WGPURenderer.d.ts +0 -61
- package/3d/animation/ExplodingSpriteEffect.d.ts +0 -71
- package/3d/animation/PhysicsExplodingSpriteEffect.d.ts +0 -76
- package/3d/animation/SpriteAnimator.d.ts +0 -124
- package/3d/animation/SpriteParticleGenerator.d.ts +0 -62
- package/3d/canvas.d.ts +0 -44
- package/3d/index.d.ts +0 -12
- package/3d/physics/PlanckPhysicsAdapter.d.ts +0 -19
- package/3d/physics/RapierPhysicsAdapter.d.ts +0 -19
- package/3d/physics/physics-interface.d.ts +0 -27
- package/3d.d.ts +0 -2
- package/3d.js +0 -34041
- package/3d.js.map +0 -155
- /package/{index-epp5y71w.js.map → index-yedf4bn5.js.map} +0 -0
package/NativeSpanFeed.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Pointer } from "
|
|
1
|
+
import { type Pointer } from "./platform/ffi.js";
|
|
2
2
|
import type { NativeSpanFeedOptions } from "./zig-structs.js";
|
|
3
3
|
export type { GrowthPolicy, NativeSpanFeedOptions, NativeSpanFeedStats } from "./zig-structs.js";
|
|
4
4
|
export type DataHandler = (data: Uint8Array) => void | Promise<void>;
|
|
@@ -7,7 +7,7 @@ export type DataHandler = (data: Uint8Array) => void | Promise<void>;
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class NativeSpanFeed {
|
|
9
9
|
static create(options?: NativeSpanFeedOptions): NativeSpanFeed;
|
|
10
|
-
static attach(streamPtr:
|
|
10
|
+
static attach(streamPtr: Pointer, _options?: NativeSpanFeedOptions): NativeSpanFeed;
|
|
11
11
|
readonly streamPtr: Pointer;
|
|
12
12
|
private readonly lib;
|
|
13
13
|
private readonly eventHandler;
|
package/README.md
CHANGED
package/buffer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RGBA } from "./lib/index.js";
|
|
2
2
|
import { type RenderLib } from "./zig.js";
|
|
3
|
-
import { type Pointer } from "
|
|
3
|
+
import { type Pointer, type PointerInput } from "./platform/ffi.js";
|
|
4
4
|
import { type BorderStyle, type BorderSides } from "./lib/index.js";
|
|
5
5
|
import { TargetChannel, type WidthMethod, type CapturedLine } from "./types.js";
|
|
6
6
|
import type { TextBufferView } from "./text-buffer-view.js";
|
|
@@ -57,8 +57,8 @@ export declare class OptimizedBuffer {
|
|
|
57
57
|
destroy(): void;
|
|
58
58
|
drawTextBuffer(textBufferView: TextBufferView, x: number, y: number): void;
|
|
59
59
|
drawEditorView(editorView: EditorView, x: number, y: number): void;
|
|
60
|
-
drawSuperSampleBuffer(x: number, y: number, pixelDataPtr:
|
|
61
|
-
drawPackedBuffer(dataPtr:
|
|
60
|
+
drawSuperSampleBuffer(x: number, y: number, pixelDataPtr: PointerInput, pixelDataLength: number, format: "bgra8unorm" | "rgba8unorm", alignedBytesPerRow: number): void;
|
|
61
|
+
drawPackedBuffer(dataPtr: PointerInput, dataLen: number, posX: number, posY: number, terminalWidthCells: number, terminalHeightCells: number): void;
|
|
62
62
|
drawGrayscaleBuffer(posX: number, posY: number, intensities: Float32Array, srcWidth: number, srcHeight: number, fg?: RGBA | null, bg?: RGBA | null): void;
|
|
63
63
|
drawGrayscaleBufferSupersampled(posX: number, posY: number, intensities: Float32Array, srcWidth: number, srcHeight: number, fg?: RGBA | null, bg?: RGBA | null): void;
|
|
64
64
|
resize(width: number, height: number): void;
|
package/edit-buffer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type LogicalCursor, type RenderLib } from "./zig.js";
|
|
2
|
-
import { type Pointer } from "
|
|
2
|
+
import { type Pointer } from "./platform/ffi.js";
|
|
3
3
|
import { type WidthMethod, type Highlight } from "./types.js";
|
|
4
4
|
import { RGBA } from "./lib/RGBA.js";
|
|
5
5
|
import { EventEmitter } from "events";
|
package/editor-view.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RGBA } from "./lib/RGBA.js";
|
|
2
2
|
import { type RenderLib, type VisualCursor, type LineInfo } from "./zig.js";
|
|
3
|
-
import { type Pointer } from "
|
|
3
|
+
import { type Pointer } from "./platform/ffi.js";
|
|
4
4
|
import type { EditBuffer } from "./edit-buffer.js";
|
|
5
5
|
export interface Viewport {
|
|
6
6
|
offsetY: number;
|
|
@@ -175,6 +175,7 @@ import {
|
|
|
175
175
|
stripAnsiSequences,
|
|
176
176
|
t,
|
|
177
177
|
terminalNamedSingleStrokeKeys,
|
|
178
|
+
toArrayBuffer,
|
|
178
179
|
treeSitterToStyledText,
|
|
179
180
|
treeSitterToTextChunks,
|
|
180
181
|
underline,
|
|
@@ -182,7 +183,7 @@ import {
|
|
|
182
183
|
white,
|
|
183
184
|
wrapWithDelegates,
|
|
184
185
|
yellow
|
|
185
|
-
} from "./index-
|
|
186
|
+
} from "./index-jv9g79dk.js";
|
|
186
187
|
|
|
187
188
|
// src/index.ts
|
|
188
189
|
var exports_src2 = {};
|
|
@@ -2770,16 +2771,6 @@ class SlotRenderable extends Renderable {
|
|
|
2770
2771
|
}
|
|
2771
2772
|
}
|
|
2772
2773
|
// src/NativeSpanFeed.ts
|
|
2773
|
-
import { toArrayBuffer } from "bun:ffi";
|
|
2774
|
-
function toPointer(value) {
|
|
2775
|
-
if (typeof value === "bigint") {
|
|
2776
|
-
if (value > BigInt(Number.MAX_SAFE_INTEGER)) {
|
|
2777
|
-
throw new Error("Pointer exceeds safe integer range");
|
|
2778
|
-
}
|
|
2779
|
-
return Number(value);
|
|
2780
|
-
}
|
|
2781
|
-
return value;
|
|
2782
|
-
}
|
|
2783
2774
|
function toNumber(value) {
|
|
2784
2775
|
return typeof value === "bigint" ? Number(value) : value;
|
|
2785
2776
|
}
|
|
@@ -2800,12 +2791,11 @@ class NativeSpanFeed {
|
|
|
2800
2791
|
}
|
|
2801
2792
|
static attach(streamPtr, _options) {
|
|
2802
2793
|
const lib = resolveRenderLib();
|
|
2803
|
-
const
|
|
2804
|
-
|
|
2805
|
-
lib.
|
|
2806
|
-
const status = lib.attachNativeSpanFeed(ptr);
|
|
2794
|
+
const stream = new NativeSpanFeed(streamPtr);
|
|
2795
|
+
lib.registerNativeSpanFeedStream(streamPtr, stream.eventHandler);
|
|
2796
|
+
const status = lib.attachNativeSpanFeed(streamPtr);
|
|
2807
2797
|
if (status !== 0) {
|
|
2808
|
-
lib.unregisterNativeSpanFeedStream(
|
|
2798
|
+
lib.unregisterNativeSpanFeedStream(streamPtr);
|
|
2809
2799
|
throw new Error(`Failed to attach stream: ${status}`);
|
|
2810
2800
|
}
|
|
2811
2801
|
return stream;
|
|
@@ -2939,7 +2929,7 @@ class NativeSpanFeed {
|
|
|
2939
2929
|
break;
|
|
2940
2930
|
}
|
|
2941
2931
|
case 6 /* Error */: {
|
|
2942
|
-
const code = arg0;
|
|
2932
|
+
const code = toNumber(arg0);
|
|
2943
2933
|
for (const handler of this.errorHandlers)
|
|
2944
2934
|
handler(code);
|
|
2945
2935
|
break;
|
|
@@ -3815,49 +3805,271 @@ class LineNumberRenderable extends Renderable {
|
|
|
3815
3805
|
}
|
|
3816
3806
|
}
|
|
3817
3807
|
}
|
|
3818
|
-
// ../../node_modules/.bun/diff@
|
|
3808
|
+
// ../../node_modules/.bun/diff@9.0.0/node_modules/diff/libesm/patch/parse.js
|
|
3819
3809
|
function parsePatch(uniDiff) {
|
|
3820
3810
|
const diffstr = uniDiff.split(/\n/), list = [];
|
|
3821
3811
|
let i = 0;
|
|
3812
|
+
function isGitDiffHeader(line) {
|
|
3813
|
+
return /^diff --git /.test(line);
|
|
3814
|
+
}
|
|
3815
|
+
function isDiffHeader(line) {
|
|
3816
|
+
return isGitDiffHeader(line) || /^Index:\s/.test(line) || /^diff(?: -r \w+)+\s/.test(line);
|
|
3817
|
+
}
|
|
3818
|
+
function isFileHeader(line) {
|
|
3819
|
+
return /^(---|\+\+\+)\s/.test(line);
|
|
3820
|
+
}
|
|
3821
|
+
function isHunkHeader(line) {
|
|
3822
|
+
return /^@@\s/.test(line);
|
|
3823
|
+
}
|
|
3822
3824
|
function parseIndex() {
|
|
3825
|
+
var _a;
|
|
3823
3826
|
const index = {};
|
|
3827
|
+
index.hunks = [];
|
|
3824
3828
|
list.push(index);
|
|
3829
|
+
let seenDiffHeader = false;
|
|
3825
3830
|
while (i < diffstr.length) {
|
|
3826
3831
|
const line = diffstr[i];
|
|
3827
|
-
if (
|
|
3832
|
+
if (isFileHeader(line) || isHunkHeader(line)) {
|
|
3828
3833
|
break;
|
|
3829
3834
|
}
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3835
|
+
if (isGitDiffHeader(line)) {
|
|
3836
|
+
if (seenDiffHeader) {
|
|
3837
|
+
return;
|
|
3838
|
+
}
|
|
3839
|
+
seenDiffHeader = true;
|
|
3840
|
+
index.isGit = true;
|
|
3841
|
+
const paths = parseGitDiffHeader(line);
|
|
3842
|
+
if (paths) {
|
|
3843
|
+
index.oldFileName = paths.oldFileName;
|
|
3844
|
+
index.newFileName = paths.newFileName;
|
|
3845
|
+
}
|
|
3846
|
+
i++;
|
|
3847
|
+
while (i < diffstr.length) {
|
|
3848
|
+
const extLine = diffstr[i];
|
|
3849
|
+
if (isFileHeader(extLine) || isHunkHeader(extLine) || isDiffHeader(extLine)) {
|
|
3850
|
+
break;
|
|
3851
|
+
}
|
|
3852
|
+
const renameFromMatch = /^rename from (.*)/.exec(extLine);
|
|
3853
|
+
if (renameFromMatch) {
|
|
3854
|
+
index.oldFileName = "a/" + unquoteIfQuoted(renameFromMatch[1]);
|
|
3855
|
+
index.isRename = true;
|
|
3856
|
+
}
|
|
3857
|
+
const renameToMatch = /^rename to (.*)/.exec(extLine);
|
|
3858
|
+
if (renameToMatch) {
|
|
3859
|
+
index.newFileName = "b/" + unquoteIfQuoted(renameToMatch[1]);
|
|
3860
|
+
index.isRename = true;
|
|
3861
|
+
}
|
|
3862
|
+
const copyFromMatch = /^copy from (.*)/.exec(extLine);
|
|
3863
|
+
if (copyFromMatch) {
|
|
3864
|
+
index.oldFileName = "a/" + unquoteIfQuoted(copyFromMatch[1]);
|
|
3865
|
+
index.isCopy = true;
|
|
3866
|
+
}
|
|
3867
|
+
const copyToMatch = /^copy to (.*)/.exec(extLine);
|
|
3868
|
+
if (copyToMatch) {
|
|
3869
|
+
index.newFileName = "b/" + unquoteIfQuoted(copyToMatch[1]);
|
|
3870
|
+
index.isCopy = true;
|
|
3871
|
+
}
|
|
3872
|
+
const newFileModeMatch = /^new file mode (\d+)/.exec(extLine);
|
|
3873
|
+
if (newFileModeMatch) {
|
|
3874
|
+
index.isCreate = true;
|
|
3875
|
+
index.newMode = newFileModeMatch[1];
|
|
3876
|
+
}
|
|
3877
|
+
const deletedFileModeMatch = /^deleted file mode (\d+)/.exec(extLine);
|
|
3878
|
+
if (deletedFileModeMatch) {
|
|
3879
|
+
index.isDelete = true;
|
|
3880
|
+
index.oldMode = deletedFileModeMatch[1];
|
|
3881
|
+
}
|
|
3882
|
+
const oldModeMatch = /^old mode (\d+)/.exec(extLine);
|
|
3883
|
+
if (oldModeMatch) {
|
|
3884
|
+
index.oldMode = oldModeMatch[1];
|
|
3885
|
+
}
|
|
3886
|
+
const newModeMatch = /^new mode (\d+)/.exec(extLine);
|
|
3887
|
+
if (newModeMatch) {
|
|
3888
|
+
index.newMode = newModeMatch[1];
|
|
3889
|
+
}
|
|
3890
|
+
if (/^Binary files /.test(extLine)) {
|
|
3891
|
+
index.isBinary = true;
|
|
3892
|
+
}
|
|
3893
|
+
i++;
|
|
3894
|
+
}
|
|
3895
|
+
continue;
|
|
3896
|
+
} else if (isDiffHeader(line)) {
|
|
3897
|
+
if (seenDiffHeader) {
|
|
3898
|
+
return;
|
|
3899
|
+
}
|
|
3900
|
+
seenDiffHeader = true;
|
|
3901
|
+
const headerMatch = /^(?:Index:|diff(?: -r \w+)+)\s+/.exec(line);
|
|
3902
|
+
if (headerMatch) {
|
|
3903
|
+
index.index = line.substring(headerMatch[0].length).trim();
|
|
3904
|
+
}
|
|
3833
3905
|
}
|
|
3834
3906
|
i++;
|
|
3835
3907
|
}
|
|
3836
3908
|
parseFileHeader(index);
|
|
3837
3909
|
parseFileHeader(index);
|
|
3838
|
-
index.
|
|
3910
|
+
if (index.oldFileName === undefined !== (index.newFileName === undefined)) {
|
|
3911
|
+
throw new Error("Missing " + (index.oldFileName !== undefined ? '"+++ ..."' : '"--- ..."') + " file header for " + ((_a = index.oldFileName) !== null && _a !== undefined ? _a : index.newFileName));
|
|
3912
|
+
}
|
|
3839
3913
|
while (i < diffstr.length) {
|
|
3840
3914
|
const line = diffstr[i];
|
|
3841
|
-
if (
|
|
3915
|
+
if (isDiffHeader(line) || isFileHeader(line) || /^===================================================================/.test(line)) {
|
|
3842
3916
|
break;
|
|
3843
|
-
} else if (
|
|
3917
|
+
} else if (isHunkHeader(line)) {
|
|
3844
3918
|
index.hunks.push(parseHunk());
|
|
3845
|
-
} else if (line) {
|
|
3846
|
-
throw new Error("Unknown line " + (i + 1) + " " + JSON.stringify(line));
|
|
3847
3919
|
} else {
|
|
3848
3920
|
i++;
|
|
3849
3921
|
}
|
|
3850
3922
|
}
|
|
3851
3923
|
}
|
|
3924
|
+
function parseGitDiffHeader(line) {
|
|
3925
|
+
const rest = line.substring("diff --git ".length);
|
|
3926
|
+
if (rest.startsWith('"')) {
|
|
3927
|
+
const oldPath = parseQuotedFileName(rest);
|
|
3928
|
+
if (oldPath === null) {
|
|
3929
|
+
return null;
|
|
3930
|
+
}
|
|
3931
|
+
const afterOld = rest.substring(oldPath.rawLength + 1);
|
|
3932
|
+
let newFileName;
|
|
3933
|
+
if (afterOld.startsWith('"')) {
|
|
3934
|
+
const newPath = parseQuotedFileName(afterOld);
|
|
3935
|
+
if (newPath === null) {
|
|
3936
|
+
return null;
|
|
3937
|
+
}
|
|
3938
|
+
newFileName = newPath.fileName;
|
|
3939
|
+
} else {
|
|
3940
|
+
newFileName = afterOld;
|
|
3941
|
+
}
|
|
3942
|
+
return {
|
|
3943
|
+
oldFileName: oldPath.fileName,
|
|
3944
|
+
newFileName
|
|
3945
|
+
};
|
|
3946
|
+
}
|
|
3947
|
+
const quoteIdx = rest.indexOf('"');
|
|
3948
|
+
if (quoteIdx > 0) {
|
|
3949
|
+
const oldFileName = rest.substring(0, quoteIdx - 1);
|
|
3950
|
+
const newPath = parseQuotedFileName(rest.substring(quoteIdx));
|
|
3951
|
+
if (newPath === null) {
|
|
3952
|
+
return null;
|
|
3953
|
+
}
|
|
3954
|
+
return {
|
|
3955
|
+
oldFileName,
|
|
3956
|
+
newFileName: newPath.fileName
|
|
3957
|
+
};
|
|
3958
|
+
}
|
|
3959
|
+
if (rest.startsWith("a/")) {
|
|
3960
|
+
const splits = [];
|
|
3961
|
+
let idx = 0;
|
|
3962
|
+
while (true) {
|
|
3963
|
+
idx = rest.indexOf(" b/", idx + 1);
|
|
3964
|
+
if (idx === -1) {
|
|
3965
|
+
break;
|
|
3966
|
+
}
|
|
3967
|
+
splits.push(idx);
|
|
3968
|
+
}
|
|
3969
|
+
if (splits.length > 0) {
|
|
3970
|
+
const mid = splits[Math.floor(splits.length / 2)];
|
|
3971
|
+
return {
|
|
3972
|
+
oldFileName: rest.substring(0, mid),
|
|
3973
|
+
newFileName: rest.substring(mid + 1)
|
|
3974
|
+
};
|
|
3975
|
+
}
|
|
3976
|
+
}
|
|
3977
|
+
return null;
|
|
3978
|
+
}
|
|
3979
|
+
function unquoteIfQuoted(s) {
|
|
3980
|
+
if (s.startsWith('"')) {
|
|
3981
|
+
const parsed = parseQuotedFileName(s);
|
|
3982
|
+
if (parsed) {
|
|
3983
|
+
return parsed.fileName;
|
|
3984
|
+
}
|
|
3985
|
+
}
|
|
3986
|
+
return s;
|
|
3987
|
+
}
|
|
3988
|
+
function parseQuotedFileName(s) {
|
|
3989
|
+
if (!s.startsWith('"')) {
|
|
3990
|
+
return null;
|
|
3991
|
+
}
|
|
3992
|
+
let result = "";
|
|
3993
|
+
let j = 1;
|
|
3994
|
+
while (j < s.length) {
|
|
3995
|
+
if (s[j] === '"') {
|
|
3996
|
+
return { fileName: result, rawLength: j + 1 };
|
|
3997
|
+
}
|
|
3998
|
+
if (s[j] === "\\" && j + 1 < s.length) {
|
|
3999
|
+
j++;
|
|
4000
|
+
switch (s[j]) {
|
|
4001
|
+
case "a":
|
|
4002
|
+
result += "\x07";
|
|
4003
|
+
break;
|
|
4004
|
+
case "b":
|
|
4005
|
+
result += "\b";
|
|
4006
|
+
break;
|
|
4007
|
+
case "f":
|
|
4008
|
+
result += "\f";
|
|
4009
|
+
break;
|
|
4010
|
+
case "n":
|
|
4011
|
+
result += `
|
|
4012
|
+
`;
|
|
4013
|
+
break;
|
|
4014
|
+
case "r":
|
|
4015
|
+
result += "\r";
|
|
4016
|
+
break;
|
|
4017
|
+
case "t":
|
|
4018
|
+
result += "\t";
|
|
4019
|
+
break;
|
|
4020
|
+
case "v":
|
|
4021
|
+
result += "\v";
|
|
4022
|
+
break;
|
|
4023
|
+
case "\\":
|
|
4024
|
+
result += "\\";
|
|
4025
|
+
break;
|
|
4026
|
+
case '"':
|
|
4027
|
+
result += '"';
|
|
4028
|
+
break;
|
|
4029
|
+
case "0":
|
|
4030
|
+
case "1":
|
|
4031
|
+
case "2":
|
|
4032
|
+
case "3":
|
|
4033
|
+
case "4":
|
|
4034
|
+
case "5":
|
|
4035
|
+
case "6":
|
|
4036
|
+
case "7": {
|
|
4037
|
+
if (j + 2 >= s.length || s[j + 1] < "0" || s[j + 1] > "7" || s[j + 2] < "0" || s[j + 2] > "7") {
|
|
4038
|
+
return null;
|
|
4039
|
+
}
|
|
4040
|
+
const bytes = [parseInt(s.substring(j, j + 3), 8)];
|
|
4041
|
+
j += 3;
|
|
4042
|
+
while (s[j] === "\\" && s[j + 1] >= "0" && s[j + 1] <= "7") {
|
|
4043
|
+
if (j + 3 >= s.length || s[j + 2] < "0" || s[j + 2] > "7" || s[j + 3] < "0" || s[j + 3] > "7") {
|
|
4044
|
+
return null;
|
|
4045
|
+
}
|
|
4046
|
+
bytes.push(parseInt(s.substring(j + 1, j + 4), 8));
|
|
4047
|
+
j += 4;
|
|
4048
|
+
}
|
|
4049
|
+
result += new TextDecoder("utf-8").decode(new Uint8Array(bytes));
|
|
4050
|
+
continue;
|
|
4051
|
+
}
|
|
4052
|
+
default:
|
|
4053
|
+
return null;
|
|
4054
|
+
}
|
|
4055
|
+
} else {
|
|
4056
|
+
result += s[j];
|
|
4057
|
+
}
|
|
4058
|
+
j++;
|
|
4059
|
+
}
|
|
4060
|
+
return null;
|
|
4061
|
+
}
|
|
3852
4062
|
function parseFileHeader(index) {
|
|
3853
|
-
const
|
|
3854
|
-
if (
|
|
3855
|
-
const data =
|
|
3856
|
-
let fileName = data[0]
|
|
3857
|
-
if (
|
|
3858
|
-
fileName =
|
|
3859
|
-
}
|
|
3860
|
-
|
|
4063
|
+
const fileHeaderMatch = /^(---|\+\+\+)\s+/.exec(diffstr[i]);
|
|
4064
|
+
if (fileHeaderMatch) {
|
|
4065
|
+
const prefix = fileHeaderMatch[1], data = diffstr[i].substring(3).trim().split("\t", 2), header = (data[1] || "").trim();
|
|
4066
|
+
let fileName = data[0];
|
|
4067
|
+
if (fileName.startsWith('"')) {
|
|
4068
|
+
fileName = unquoteIfQuoted(fileName);
|
|
4069
|
+
} else {
|
|
4070
|
+
fileName = fileName.replace(/\\\\/g, "\\");
|
|
4071
|
+
}
|
|
4072
|
+
if (prefix === "---") {
|
|
3861
4073
|
index.oldFileName = fileName;
|
|
3862
4074
|
index.oldHeader = header;
|
|
3863
4075
|
} else {
|
|
@@ -3912,6 +4124,9 @@ function parsePatch(uniDiff) {
|
|
|
3912
4124
|
if (removeCount !== hunk.oldLines) {
|
|
3913
4125
|
throw new Error("Removed line count did not match for hunk at line " + (chunkHeaderIndex + 1));
|
|
3914
4126
|
}
|
|
4127
|
+
if (i < diffstr.length && diffstr[i] && /^[+ -]/.test(diffstr[i]) && !isFileHeader(diffstr[i])) {
|
|
4128
|
+
throw new Error("Hunk at line " + (chunkHeaderIndex + 1) + " has more lines than expected (expected " + hunk.oldLines + " old lines and " + hunk.newLines + " new lines)");
|
|
4129
|
+
}
|
|
3915
4130
|
return hunk;
|
|
3916
4131
|
}
|
|
3917
4132
|
while (i < diffstr.length) {
|
|
@@ -10774,5 +10989,5 @@ class TimeToFirstDrawRenderable extends Renderable {
|
|
|
10774
10989
|
}
|
|
10775
10990
|
export { DistortionEffect, VignetteEffect, CloudsEffect, FlamesEffect, CRTRollingBarEffect, RainbowTextEffect, applyScanlines, applyInvert, applyNoise, applyChromaticAberration, applyAsciiArt, applyBrightness, applyGain, applySaturation, BloomEffect, SEPIA_MATRIX, PROTANOPIA_SIM_MATRIX, DEUTERANOPIA_SIM_MATRIX, TRITANOPIA_SIM_MATRIX, ACHROMATOPSIA_MATRIX, PROTANOPIA_COMP_MATRIX, DEUTERANOPIA_COMP_MATRIX, TRITANOPIA_COMP_MATRIX, TECHNICOLOR_MATRIX, SOLARIZATION_MATRIX, SYNTHWAVE_MATRIX, GREENSCALE_MATRIX, GRAYSCALE_MATRIX, INVERT_MATRIX, Timeline, engine, createTimeline, SlotRegistry, createSlotRegistry, createCoreSlotRegistry, registerCorePlugin, resolveCoreSlot, SlotRenderable, NativeSpanFeed, FrameBufferRenderable, ASCIIFontRenderable, Generic, Box, Text, ASCIIFont, Input, Select, TabSelect, FrameBuffer, Code, ScrollBox, vstyles, VRenderable, LineNumberRenderable, DiffRenderable, defaultTextareaKeyBindings, TextareaRenderable, InputRenderableEvents, InputRenderable, TextTableRenderable, MarkdownRenderable, SliderRenderable, ScrollBarRenderable, ArrowRenderable, ScrollBoxRenderable, SelectRenderableEvents, SelectRenderable, TabSelectRenderableEvents, TabSelectRenderable, TimeToFirstDrawRenderable, exports_src2 as exports_src };
|
|
10776
10991
|
|
|
10777
|
-
//# debugId=
|
|
10778
|
-
//# sourceMappingURL=index-
|
|
10992
|
+
//# debugId=C6958AB1304EEF3C64756E2164756E21
|
|
10993
|
+
//# sourceMappingURL=index-d07rkqtc.js.map
|