@opentui/core 0.6.1 → 0.6.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/{chunk-bun-wsqkxxm5.js → chunk-bun-b3p27aka.js} +18 -3
- package/chunk-bun-b3p27aka.js.map +35 -0
- package/{chunk-bun-ww65h9av.js → chunk-bun-ehstr7d7.js} +9 -6
- package/{chunk-bun-ww65h9av.js.map → chunk-bun-ehstr7d7.js.map} +4 -4
- package/{chunk-node-jh6t3wnm.js → chunk-node-fs50qdd7.js} +9 -6
- package/{chunk-node-jh6t3wnm.js.map → chunk-node-fs50qdd7.js.map} +4 -4
- package/{chunk-node-f7c1g447.js → chunk-node-jt82vcf9.js} +18 -3
- package/chunk-node-jt82vcf9.js.map +34 -0
- package/edit-buffer.d.ts +11 -1
- package/index.bun.js +38 -3
- package/index.bun.js.map +3 -3
- package/index.node.js +38 -3
- package/index.node.js.map +3 -3
- package/native-abi.generated.d.ts +4 -0
- package/package.json +9 -9
- 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 +2 -0
- package/chunk-bun-wsqkxxm5.js.map +0 -35
- package/chunk-node-f7c1g447.js.map +0 -34
|
@@ -244,6 +244,7 @@ var nativeSymbols = {
|
|
|
244
244
|
returns: "i32"
|
|
245
245
|
},
|
|
246
246
|
ot_edit_buffer_measure_text: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
|
|
247
|
+
ot_edit_measure_text: { args: ["ptr", "ptr", "u32", "u32", "u32", "buffer"], returns: "i32" },
|
|
247
248
|
ot_edit_buffer_set_defaults: { args: ["ptr", "buffer", "u32", "buffer"], returns: "i32" },
|
|
248
249
|
ot_syntax_style_register: { args: ["ptr", "buffer", "ptr", "u32", "buffer", "buffer"], returns: "i32" },
|
|
249
250
|
ot_syntax_style_resolve: { args: ["ptr", "buffer", "ptr", "u32", "buffer"], returns: "i32" },
|
|
@@ -7715,6 +7716,7 @@ class FFIRenderLib2 {
|
|
|
7715
7716
|
clipboardServices = new Map;
|
|
7716
7717
|
clipboardOperations = new Map;
|
|
7717
7718
|
audioEngines = new Map;
|
|
7719
|
+
editMeasureContext;
|
|
7718
7720
|
invalidStandaloneHandle = new BigUint64Array(nativeLayouts.ot_handle.size / 8);
|
|
7719
7721
|
encoder = new TextEncoder;
|
|
7720
7722
|
emptyBytes = new Uint8Array(0);
|
|
@@ -8672,6 +8674,16 @@ class FFIRenderLib2 {
|
|
|
8672
8674
|
nativeResult("ot_edit_buffer_measure_text", this.opentui.symbols.ot_edit_buffer_measure_text(pointer, handle, viewOrNull(input), input.length, output));
|
|
8673
8675
|
return output[0];
|
|
8674
8676
|
}
|
|
8677
|
+
editMeasureText(bytes, widthMethod, tabWidth) {
|
|
8678
|
+
const method = widthMethodId(widthMethod, "editor");
|
|
8679
|
+
const width = toSafeFFIU32Length(tabWidth, "Edit buffer tab width");
|
|
8680
|
+
const input = sessionBytes(bytes, "Edit buffer measure length");
|
|
8681
|
+
const output = new Uint32Array(1);
|
|
8682
|
+
this.editMeasureContext ??= this.createContext({ objectCapacity: 1, renderCellsMax: 1 });
|
|
8683
|
+
const pointer = this.nativeContextPointer(this.editMeasureContext, "ot_edit_measure_text");
|
|
8684
|
+
nativeResult("ot_edit_measure_text", this.opentui.symbols.ot_edit_measure_text(pointer, viewOrNull(input), input.length, method, width, output));
|
|
8685
|
+
return output[0];
|
|
8686
|
+
}
|
|
8675
8687
|
contextEditBufferSetDefaults(context, editBuffer, mask, style) {
|
|
8676
8688
|
const handle = encodeContextHandle(context, editBuffer);
|
|
8677
8689
|
const fields = toSafeFFIU32Length(mask, "Editor default style mask");
|
|
@@ -10534,10 +10546,13 @@ class FFIRenderLib2 {
|
|
|
10534
10546
|
if (this.clipboardServices.size > 0) {
|
|
10535
10547
|
throw new Error("Cannot dispose OpenTUI native library while clipboard services are active");
|
|
10536
10548
|
}
|
|
10537
|
-
if (this.nativeContexts.size !== this.audioEngines.size) {
|
|
10549
|
+
if (this.nativeContexts.size !== this.audioEngines.size + Number(this.editMeasureContext !== undefined)) {
|
|
10538
10550
|
throw new NativeError2("dispose", -6 /* ContextBusy */);
|
|
10539
10551
|
}
|
|
10540
10552
|
this.yogaHost?.dispose();
|
|
10553
|
+
if (this.editMeasureContext)
|
|
10554
|
+
this.releaseContext(this.editMeasureContext);
|
|
10555
|
+
this.editMeasureContext = undefined;
|
|
10541
10556
|
for (const [engine, context] of this.audioEngines) {
|
|
10542
10557
|
this.releaseContext(context);
|
|
10543
10558
|
this.audioEngines.delete(engine);
|
|
@@ -12499,5 +12514,5 @@ var yoga_default = Yoga;
|
|
|
12499
12514
|
|
|
12500
12515
|
export { nativeConstants, toArrayBuffer, singleton, getSingleton, destroySingleton, envRegistry2, registerEnvVar2, clearEnvCache2, generateEnvMarkdown2, generateEnvColored2, env2, stringWidth, resolveBundledFilePath2, Worker, TextAttributes2, ATTRIBUTE_BASE_BITS2, ATTRIBUTE_BASE_MASK2, getBaseAttributes2, DebugOverlayCorner2, TargetChannel2, DEFAULT_FOREGROUND_RGB2, DEFAULT_BACKGROUND_RGB2, normalizeIndexedColorIndex2, ansi256IndexToRgb2, RGBA2, normalizeColorValue2, hexToRgb2, rgbToHex2, hsvToRgb2, parseColor2, createTextAttributes2, attributesWithLink2, getLinkId2, visualizeRenderableTree2, isStyledText2, StyledText2, stringToStyledText2, black2, red2, green2, yellow2, blue2, magenta2, cyan2, white2, brightBlack2, brightRed2, brightGreen2, brightYellow2, brightBlue2, brightMagenta2, brightCyan2, brightWhite2, bgBlack2, bgRed2, bgGreen2, bgYellow2, bgBlue2, bgMagenta2, bgCyan2, bgWhite2, bold2, italic2, underline2, strikethrough2, dim2, reverse2, blink2, fg2, bg2, link2, t2, YogaEnumKind, YogaFloatKind, YogaValueKind, sceneSetEnum, sceneGetEnum, sceneSetFloat, sceneSetValue, sceneGetValue, sceneSetDimension, UNDEFINED_VALUE, parseYogaValue, SpanInfoStruct, NativeAudioStreamFormat2, NativeAudioStreamState2, NativeAudioStreamStateNames, NativeAudioStreamCloseReason2, isBunfsPath, normalizeBunfsPath, resolveDefaultParserAsset, resolveDefaultTreeSitterWorkerPath, resolveTreeSitterWasm, NativeAudioStreamState3, NativeAudioStreamCloseReason3, NativeAudioStreamFormat3, MAX_LINK_URL_BYTES2, NativeTextViewCommand2, NativeEditCommand2, NativeEditPositionQuery2, NativeEditorStyleMask2, NativeEditHighlightOperation2, NativeEditorCommand2, NativeEditorSelectionOperation2, NativeEditorPositionQuery2, NativeEditEvent2, NativeStyleGroup, NativeStyleFlags, NATIVE_EDGE_NONE2, NativeBorder2, NativeSceneHook2, NativeSceneFrame2, NativeScenePaintPhase2, NATIVE_BUFFER_TEXT_BYTES_MAX2, NativeSessionState2, NativeSessionRenderStatus2, NATIVE_SESSION_CONTROL_PACKET_BYTES2, NativeSessionTerminalPhase2, NativeSessionPumpStatus2, NativeStatus2, NativeError2, NativeClipboardOperationStatus2, NativeClipboardStartStatus2, NativeClipboardCancelStatus2, NativeClipboardCopyStatus2, NativeClipboardDestroyStatus2, NativeClipboardShutdownStatus2, SceneStaging, NativePaintRecorder, LogLevel2, FFIRenderLib2, setRenderLibPath2, resolveRenderLib2, Align2, BoxSizing2, Dimension2, Direction2, Display2, Edge2, Errata2, ExperimentalFeature2, FlexDirection2, Gutter2, Justify2, LogLevel3, MeasureMode2, NodeType2, Overflow2, PositionType2, Unit2, Wrap2, ALIGN_AUTO2, ALIGN_FLEX_START2, ALIGN_CENTER2, ALIGN_FLEX_END2, ALIGN_STRETCH2, ALIGN_BASELINE2, ALIGN_SPACE_BETWEEN2, ALIGN_SPACE_AROUND2, ALIGN_SPACE_EVENLY2, BOX_SIZING_BORDER_BOX2, BOX_SIZING_CONTENT_BOX2, DIMENSION_WIDTH2, DIMENSION_HEIGHT2, DIRECTION_INHERIT2, DIRECTION_LTR2, DIRECTION_RTL2, DISPLAY_FLEX2, DISPLAY_NONE2, DISPLAY_CONTENTS2, EDGE_LEFT2, EDGE_TOP2, EDGE_RIGHT2, EDGE_BOTTOM2, EDGE_START2, EDGE_END2, EDGE_HORIZONTAL2, EDGE_VERTICAL2, EDGE_ALL2, ERRATA_NONE2, ERRATA_STRETCH_FLEX_BASIS2, ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING2, ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE2, ERRATA_ALL2, ERRATA_CLASSIC2, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS2, FLEX_DIRECTION_COLUMN2, FLEX_DIRECTION_COLUMN_REVERSE2, FLEX_DIRECTION_ROW2, FLEX_DIRECTION_ROW_REVERSE2, GUTTER_COLUMN2, GUTTER_ROW2, GUTTER_ALL2, JUSTIFY_FLEX_START2, JUSTIFY_CENTER2, JUSTIFY_FLEX_END2, JUSTIFY_SPACE_BETWEEN2, JUSTIFY_SPACE_AROUND2, JUSTIFY_SPACE_EVENLY2, LOG_LEVEL_ERROR2, LOG_LEVEL_WARN2, LOG_LEVEL_INFO2, LOG_LEVEL_DEBUG2, LOG_LEVEL_VERBOSE2, LOG_LEVEL_FATAL2, MEASURE_MODE_UNDEFINED2, MEASURE_MODE_EXACTLY2, MEASURE_MODE_AT_MOST2, NODE_TYPE_DEFAULT2, NODE_TYPE_TEXT2, OVERFLOW_VISIBLE2, OVERFLOW_HIDDEN2, OVERFLOW_SCROLL2, POSITION_TYPE_STATIC2, POSITION_TYPE_RELATIVE2, POSITION_TYPE_ABSOLUTE2, UNIT_UNDEFINED2, UNIT_POINT2, UNIT_PERCENT2, UNIT_AUTO2, WRAP_NO_WRAP2, WRAP_WRAP2, WRAP_WRAP_REVERSE2, YogaStatus2, YogaError2, Config2, Node2, exports_yoga, yoga_default };
|
|
12501
12516
|
|
|
12502
|
-
//# debugId=
|
|
12503
|
-
//# sourceMappingURL=chunk-node-
|
|
12517
|
+
//# debugId=D19365815A57160264756E2164756E21
|
|
12518
|
+
//# sourceMappingURL=chunk-node-jt82vcf9.js.map
|