@opentui/core 0.3.3 → 0.3.4

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.
@@ -18668,6 +18668,7 @@ class CodeRenderable extends TextBufferRenderable {
18668
18668
  _drawUnstyledText;
18669
18669
  _shouldRenderTextBuffer = true;
18670
18670
  _streaming;
18671
+ _initialStyledText;
18671
18672
  _hadInitialContent = false;
18672
18673
  _lastHighlights = [];
18673
18674
  _baseHighlight;
@@ -18691,11 +18692,16 @@ class CodeRenderable extends TextBufferRenderable {
18691
18692
  this._conceal = options.conceal ?? this._contentDefaultOptions.conceal;
18692
18693
  this._drawUnstyledText = options.drawUnstyledText ?? this._contentDefaultOptions.drawUnstyledText;
18693
18694
  this._streaming = options.streaming ?? this._contentDefaultOptions.streaming;
18695
+ this._initialStyledText = options.initialStyledText;
18694
18696
  this._baseHighlight = options.baseHighlight;
18695
18697
  this._onHighlight = options.onHighlight;
18696
18698
  this._onChunks = options.onChunks;
18697
18699
  if (this._content.length > 0) {
18698
- this.textBuffer.setText(this._content);
18700
+ if (this._initialStyledText && this._drawUnstyledText) {
18701
+ this.textBuffer.setStyledText(this._initialStyledText);
18702
+ } else {
18703
+ this.textBuffer.setText(this._content);
18704
+ }
18699
18705
  this.updateTextInfo();
18700
18706
  this._shouldRenderTextBuffer = this._drawUnstyledText || !this._filetype;
18701
18707
  }
@@ -18709,11 +18715,15 @@ class CodeRenderable extends TextBufferRenderable {
18709
18715
  this._content = value;
18710
18716
  this._highlightsDirty = true;
18711
18717
  this._highlightSnapshotId++;
18712
- if (this._streaming && !this._drawUnstyledText && this._filetype) {
18718
+ if (this._streaming && this._filetype && !this._drawUnstyledText) {
18713
18719
  this.requestRender();
18714
18720
  return;
18715
18721
  }
18716
- this.textBuffer.setText(value);
18722
+ if (this._initialStyledText && this._drawUnstyledText) {
18723
+ this.textBuffer.setStyledText(this._initialStyledText);
18724
+ } else {
18725
+ this.textBuffer.setText(value);
18726
+ }
18717
18727
  this.setRenderedLineSources(undefined);
18718
18728
  this.updateTextInfo();
18719
18729
  }
@@ -18787,6 +18797,12 @@ class CodeRenderable extends TextBufferRenderable {
18787
18797
  get streaming() {
18788
18798
  return this._streaming;
18789
18799
  }
18800
+ set initialStyledText(value) {
18801
+ if (this._initialStyledText !== value) {
18802
+ this._initialStyledText = value;
18803
+ this._highlightsDirty = true;
18804
+ }
18805
+ }
18790
18806
  set streaming(value) {
18791
18807
  if (this._streaming !== value) {
18792
18808
  this._streaming = value;
@@ -18856,7 +18872,11 @@ class CodeRenderable extends TextBufferRenderable {
18856
18872
  if (this._streaming && !isInitialContent) {
18857
18873
  this._shouldRenderTextBuffer = true;
18858
18874
  } else if (shouldDrawUnstyledNow) {
18859
- this.textBuffer.setText(content);
18875
+ if (this._initialStyledText) {
18876
+ this.textBuffer.setStyledText(this._initialStyledText);
18877
+ } else {
18878
+ this.textBuffer.setText(content);
18879
+ }
18860
18880
  this.setRenderedLineSources(undefined);
18861
18881
  this._shouldRenderTextBuffer = true;
18862
18882
  } else {
@@ -25475,5 +25495,5 @@ Captured external output:
25475
25495
 
25476
25496
  export { __export, __require, MeasureMode, exports_src, isValidBorderStyle, parseBorderStyle, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, DEFAULT_FOREGROUND_RGB, DEFAULT_BACKGROUND_RGB, normalizeIndexedColorIndex, ansi256IndexToRgb, RGBA, normalizeColorValue, hexToRgb, rgbToHex, hsvToRgb, parseColor, 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, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, StdinParser, treeSitterToTextChunks, treeSitterToStyledText, stringWidth2 as stringWidth, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extensionToFiletype, basenameToFiletype, extToFiletype, pathToFiletype, infoStringToFiletype, getTreeSitterClient, ExtmarksController, createExtmarksController, TerminalPalette, createTerminalPalette, normalizeTerminalPalette, buildTerminalPaletteSignature, decodePasteBytes, stripAnsiSequences, detectLinks, TextBuffer, LogLevel2 as LogLevel, setRenderLibPath, resolveRenderLib, OptimizedBuffer, 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 };
25477
25497
 
25478
- //# debugId=A8E972EE9C6B673C64756E2164756E21
25479
- //# sourceMappingURL=index-mn090kzf.js.map
25498
+ //# debugId=3608BC5324560A8064756E2164756E21
25499
+ //# sourceMappingURL=index-54s7pk0d.js.map