@kenkaiiii/gg-boss 4.8.1 → 4.8.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.
@@ -107694,12 +107694,40 @@ function renderMarkdownToAnsiLines({ text, theme, width, isPending = false, avai
107694
107694
  if (tableHeaders.length > 0 && tableRows.length > 0) {
107695
107695
  const styledHeaders = tableHeaders.map((header) => renderInlineMarkdownToAnsi(stripUnsafeCharacters(header), theme, theme.link));
107696
107696
  const styledRows = tableRows.map((row) => row.map((cell) => renderInlineMarkdownToAnsi(stripUnsafeCharacters(cell), theme, theme.text)));
107697
- addLines(renderAnsiTable({ headers: styledHeaders, rows: styledRows, terminalWidth: width, theme }));
107697
+ const tableLines = renderAnsiTable({
107698
+ headers: styledHeaders,
107699
+ rows: styledRows,
107700
+ terminalWidth: width,
107701
+ theme
107702
+ });
107703
+ if (isPending && availableTerminalHeight !== void 0) {
107704
+ const reservedLines = 2;
107705
+ const maxTableLinesWhenPending = Math.max(0, availableTerminalHeight - reservedLines);
107706
+ if (tableLines.length > maxTableLinesWhenPending) {
107707
+ if (maxTableLinesWhenPending < 1) {
107708
+ addLines([colorize3("... table is being written ...", theme.textMuted)]);
107709
+ } else {
107710
+ addLines(tableLines.slice(0, maxTableLinesWhenPending));
107711
+ addLines([colorize3("... generating more ...", theme.textMuted)]);
107712
+ }
107713
+ inTable = false;
107714
+ tableRows = [];
107715
+ tableHeaders = [];
107716
+ return;
107717
+ }
107718
+ }
107719
+ addLines(tableLines);
107698
107720
  }
107699
107721
  inTable = false;
107700
107722
  tableRows = [];
107701
107723
  tableHeaders = [];
107702
107724
  };
107725
+ let pendingTableTailStart = lines.length;
107726
+ if (isPending) {
107727
+ while (pendingTableTailStart > 0 && /^\s*\|/.test(lines[pendingTableTailStart - 1] ?? "") && lines.length - pendingTableTailStart < 2) {
107728
+ pendingTableTailStart -= 1;
107729
+ }
107730
+ }
107703
107731
  lines.forEach((line, index) => {
107704
107732
  if (inCodeBlock) {
107705
107733
  const fenceMatch = line.match(codeFenceRegex);
@@ -107730,7 +107758,7 @@ function renderMarkdownToAnsiLines({ text, theme, width, isPending = false, avai
107730
107758
  inTable = true;
107731
107759
  tableHeaders = tableRowMatch[1]?.split("|").map((cell) => cell.trim()) ?? [];
107732
107760
  tableRows = [];
107733
- } else {
107761
+ } else if (index < pendingTableTailStart) {
107734
107762
  addInlineLine(line);
107735
107763
  }
107736
107764
  } else if (inTable && tableSeparatorMatch) {
@@ -107742,6 +107770,9 @@ function renderMarkdownToAnsiLines({ text, theme, width, isPending = false, avai
107742
107770
  cells.length = tableHeaders.length;
107743
107771
  tableRows.push(cells);
107744
107772
  } else if (inTable && !tableRowMatch) {
107773
+ if (index >= pendingTableTailStart) {
107774
+ return;
107775
+ }
107745
107776
  flushTable();
107746
107777
  if (line.trim().length > 0)
107747
107778
  addInlineLine(line);
@@ -107767,7 +107798,7 @@ function renderMarkdownToAnsiLines({ text, theme, width, isPending = false, avai
107767
107798
  output.push(EMPTY_RENDER_LINE);
107768
107799
  lastLineEmpty = true;
107769
107800
  }
107770
- } else {
107801
+ } else if (index < pendingTableTailStart) {
107771
107802
  addInlineLine(line);
107772
107803
  }
107773
107804
  });
@@ -114696,4 +114727,4 @@ react/cjs/react-jsx-runtime.development.js:
114696
114727
  * LICENSE file in the root directory of this source tree.
114697
114728
  *)
114698
114729
  */
114699
- //# sourceMappingURL=chunk-HRWFW5HH.js.map
114730
+ //# sourceMappingURL=chunk-ROHVABKQ.js.map