@opentui/core 0.5.0 → 0.5.1

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.
@@ -41,7 +41,7 @@ import {
41
41
  toArrayBuffer,
42
42
  treeSitterToTextChunks,
43
43
  yoga_default
44
- } from "./chunk-bun-ctxxvhwz.js";
44
+ } from "./chunk-bun-83ry0rzt.js";
45
45
 
46
46
  // src/Renderable.ts
47
47
  import { EventEmitter } from "events";
@@ -10154,4 +10154,4 @@ Captured external output:
10154
10154
  export { h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, TextBufferView, EditBuffer, EditorView, convertThemeToStyles, SyntaxStyle, ANSI, BoxRenderable, TextBufferRenderable, CodeRenderable, isTextNodeRenderable, TextNodeRenderable, RootTextNodeRenderable, TextRenderable, NativeSpanFeed, defaultKeyAliases, mergeKeyAliases, mergeKeyBindings, getKeyBindingAction, buildKeyBindingsMap, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, EditBufferRenderableEvents, isEditBufferRenderable, EditBufferRenderable, buildKittyKeyboardFlags, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, RendererControlState, CliRenderer };
10155
10155
 
10156
10156
  //# debugId=0B8AB9B3E8D95E9A64756E2164756E21
10157
- //# sourceMappingURL=chunk-bun-v3e63tzw.js.map
10157
+ //# sourceMappingURL=chunk-bun-8fkgaxc6.js.map
@@ -40,7 +40,7 @@ import {
40
40
  toArrayBuffer,
41
41
  treeSitterToTextChunks,
42
42
  yoga_default
43
- } from "./chunk-node-savhj5rp.js";
43
+ } from "./chunk-node-m23dbcww.js";
44
44
 
45
45
  // src/Renderable.ts
46
46
  import { EventEmitter } from "events";
@@ -10153,4 +10153,4 @@ Captured external output:
10153
10153
  export { h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, TextBufferView, EditBuffer, EditorView, convertThemeToStyles, SyntaxStyle, ANSI, BoxRenderable, TextBufferRenderable, CodeRenderable, isTextNodeRenderable, TextNodeRenderable, RootTextNodeRenderable, TextRenderable, NativeSpanFeed, defaultKeyAliases, mergeKeyAliases, mergeKeyBindings, getKeyBindingAction, buildKeyBindingsMap, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, EditBufferRenderableEvents, isEditBufferRenderable, EditBufferRenderable, buildKittyKeyboardFlags, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, RendererControlState, CliRenderer };
10154
10154
 
10155
10155
  //# debugId=19BC632C369BDFA064756E2164756E21
10156
- //# sourceMappingURL=chunk-node-1j69hr31.js.map
10156
+ //# sourceMappingURL=chunk-node-0yw3x5m7.js.map
@@ -13836,10 +13836,14 @@ function getOpenTUILib(libPath) {
13836
13836
  returns: "u32"
13837
13837
  },
13838
13838
  imageInfo: { args: ["ptr", "u32", "ptr"], returns: "u32" },
13839
+ imageRetainIccCache: { args: [], returns: "void" },
13840
+ imageReleaseIccCache: { args: [], returns: "void" },
13841
+ imageTestFailIccProfileCopyAllocationOnce: { args: [], returns: "void" },
13839
13842
  imageDecode: { args: ["ptr", "u32", "ptr"], returns: "u32" },
13840
13843
  imageCreateFromRgba: { args: ["ptr", "u64", "u32", "u32", "u32", "ptr"], returns: "u32" },
13841
13844
  imageDestroy: { args: ["u32"], returns: "void" },
13842
13845
  imageGetInfo: { args: ["u32", "ptr"], returns: "u32" },
13846
+ imageMaterialize: { args: ["u32"], returns: "u32" },
13843
13847
  imageGetPixelsPtr: { args: ["u32"], returns: "ptr" },
13844
13848
  imageClone: { args: ["u32", "ptr"], returns: "u32" },
13845
13849
  imageCopyPixels: { args: ["u32", "ptr", "u64", "u32", "u8"], returns: "u32" },
@@ -14446,6 +14450,7 @@ var NativeMeasureTargetKind = {
14446
14450
 
14447
14451
  class FFIRenderLib {
14448
14452
  opentui;
14453
+ iccCacheClient = false;
14449
14454
  yogaLayout = new Float32Array(6);
14450
14455
  yogaLayoutPtr = ptr(this.yogaLayout);
14451
14456
  ffiStructStorage = {
@@ -14512,6 +14517,8 @@ class FFIRenderLib {
14512
14517
  }
14513
14518
  constructor(libPath) {
14514
14519
  this.opentui = getOpenTUILib(libPath);
14520
+ this.imageRetainIccCache();
14521
+ this.iccCacheClient = true;
14515
14522
  try {
14516
14523
  this.setupLogging();
14517
14524
  this.setupEventBus();
@@ -14575,12 +14582,19 @@ class FFIRenderLib {
14575
14582
  this.setLogCallback(null);
14576
14583
  } finally {
14577
14584
  try {
14578
- this.opentui.close();
14585
+ if (this.iccCacheClient) {
14586
+ this.iccCacheClient = false;
14587
+ this.imageReleaseIccCache();
14588
+ }
14579
14589
  } finally {
14580
- this.eventCallbackWrapper = null;
14581
- this.logCallbackWrapper = null;
14582
- this.nativeSpanFeedCallbackWrapper = null;
14583
- this.nativeSpanFeedHandlers.clear();
14590
+ try {
14591
+ this.opentui.close();
14592
+ } finally {
14593
+ this.eventCallbackWrapper = null;
14594
+ this.logCallbackWrapper = null;
14595
+ this.nativeSpanFeedCallbackWrapper = null;
14596
+ this.nativeSpanFeedHandlers.clear();
14597
+ }
14584
14598
  }
14585
14599
  }
14586
14600
  }
@@ -16337,6 +16351,15 @@ class FFIRenderLib {
16337
16351
  imageDestroy(image) {
16338
16352
  this.opentui.symbols.imageDestroy(image);
16339
16353
  }
16354
+ imageRetainIccCache() {
16355
+ this.opentui.symbols.imageRetainIccCache();
16356
+ }
16357
+ imageReleaseIccCache() {
16358
+ this.opentui.symbols.imageReleaseIccCache();
16359
+ }
16360
+ imageTestFailIccProfileCopyAllocationOnce() {
16361
+ this.opentui.symbols.imageTestFailIccProfileCopyAllocationOnce();
16362
+ }
16340
16363
  imageGetInfo(image) {
16341
16364
  const output = new ArrayBuffer(NativeImageInfoStruct.size);
16342
16365
  const status = this.opentui.symbols.imageGetInfo(image, output);
@@ -16346,6 +16369,9 @@ class FFIRenderLib {
16346
16369
  const pointer = this.opentui.symbols.imageGetPixelsPtr(image);
16347
16370
  return pointer === null || pointer === 0 || pointer === 0n ? null : pointer;
16348
16371
  }
16372
+ imageMaterialize(image) {
16373
+ return this.opentui.symbols.imageMaterialize(image);
16374
+ }
16349
16375
  imageClone(image) {
16350
16376
  const output = new Uint32Array(1);
16351
16377
  return this.imageHandleResult(this.opentui.symbols.imageClone(image, output), output);
@@ -17391,5 +17417,5 @@ var yoga_default = Yoga;
17391
17417
 
17392
17418
  export { toArrayBuffer, singleton, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, sleep, stringWidth2 as stringWidth, resolveBundledFilePath, DEFAULT_FOREGROUND_RGB, DEFAULT_BACKGROUND_RGB, normalizeIndexedColorIndex, ansi256IndexToRgb, RGBA, normalizeColorValue, hexToRgb, rgbToHex, hsvToRgb, parseColor, isValidBorderStyle, parseBorderStyle, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, ATTRIBUTE_BASE_BITS, ATTRIBUTE_BASE_MASK, getBaseAttributes, DebugOverlayCorner, TargetChannel, createTextAttributes, attributesWithLink, getLinkId, visualizeRenderableTree, isStyledText, StyledText, stringToStyledText, black, red, green, yellow, blue, magenta, cyan, white, brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bold, italic, underline, strikethrough, dim, reverse, blink, fg, bg, link, t, hastToStyledText, SystemClock, nonAlphanumericKeys, terminalNamedSingleStrokeKeys, parseKeypress, LinearScrollAccel, MacOSScrollAccel, parseAlign, parseAlignItems, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, StdinParser, treeSitterToTextChunks, treeSitterToStyledText, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extensionToFiletype, basenameToFiletype, extToFiletype, pathToFiletype, infoStringToFiletype, getTreeSitterClient, destroyTreeSitterClient, ExtmarksController, createExtmarksController, TerminalPalette, createTerminalPalette, normalizeTerminalPalette, buildTerminalPaletteSignature, decodePasteBytes, stripAnsiSequences, ClipboardTarget, Clipboard, detectLinks, OptimizedBuffer, TextBuffer, SpanInfoStruct, NativeAudioStreamFormat, NativeAudioStreamState, NativeAudioStreamStateNames, NativeAudioStreamCloseReason, NativeAudioStreamState2 as NativeAudioStreamState1, NativeAudioStreamCloseReason2 as NativeAudioStreamCloseReason1, NativeAudioStreamFormat2 as NativeAudioStreamFormat1, LogLevel2 as LogLevel, NativeMeasureTargetKind, setRenderLibPath, resolveRenderLib, Align, BoxSizing, Dimension, Direction, Display, Edge, Errata, ExperimentalFeature, FlexDirection, Gutter, Justify, LogLevel as LogLevel1, MeasureMode, NodeType, Overflow, PositionType, Unit, Wrap, ALIGN_AUTO, ALIGN_FLEX_START, ALIGN_CENTER, ALIGN_FLEX_END, ALIGN_STRETCH, ALIGN_BASELINE, ALIGN_SPACE_BETWEEN, ALIGN_SPACE_AROUND, ALIGN_SPACE_EVENLY, BOX_SIZING_BORDER_BOX, BOX_SIZING_CONTENT_BOX, DIMENSION_WIDTH, DIMENSION_HEIGHT, DIRECTION_INHERIT, DIRECTION_LTR, DIRECTION_RTL, DISPLAY_FLEX, DISPLAY_NONE, DISPLAY_CONTENTS, EDGE_LEFT, EDGE_TOP, EDGE_RIGHT, EDGE_BOTTOM, EDGE_START, EDGE_END, EDGE_HORIZONTAL, EDGE_VERTICAL, EDGE_ALL, ERRATA_NONE, ERRATA_STRETCH_FLEX_BASIS, ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING, ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE, ERRATA_ALL, ERRATA_CLASSIC, EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS, FLEX_DIRECTION_COLUMN, FLEX_DIRECTION_COLUMN_REVERSE, FLEX_DIRECTION_ROW, FLEX_DIRECTION_ROW_REVERSE, GUTTER_COLUMN, GUTTER_ROW, GUTTER_ALL, JUSTIFY_FLEX_START, JUSTIFY_CENTER, JUSTIFY_FLEX_END, JUSTIFY_SPACE_BETWEEN, JUSTIFY_SPACE_AROUND, JUSTIFY_SPACE_EVENLY, LOG_LEVEL_ERROR, LOG_LEVEL_WARN, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_VERBOSE, LOG_LEVEL_FATAL, MEASURE_MODE_UNDEFINED, MEASURE_MODE_EXACTLY, MEASURE_MODE_AT_MOST, NODE_TYPE_DEFAULT, NODE_TYPE_TEXT, OVERFLOW_VISIBLE, OVERFLOW_HIDDEN, OVERFLOW_SCROLL, POSITION_TYPE_STATIC, POSITION_TYPE_RELATIVE, POSITION_TYPE_ABSOLUTE, UNIT_UNDEFINED, UNIT_POINT, UNIT_PERCENT, UNIT_AUTO, WRAP_NO_WRAP, WRAP_WRAP, WRAP_WRAP_REVERSE, Config, Node, exports_yoga, yoga_default };
17393
17419
 
17394
- //# debugId=5F4E42714FBFA7AA64756E2164756E21
17395
- //# sourceMappingURL=chunk-node-savhj5rp.js.map
17420
+ //# debugId=4DE83B5000E1E53964756E2164756E21
17421
+ //# sourceMappingURL=chunk-node-m23dbcww.js.map