react-markdown-table-ts 0.3.9 → 0.3.10

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/dist/utils.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import { InputTableData, InputTableRowData } from './types';
2
2
  /**
3
- * Calculates the maximum width for each column based on the content.
3
+ * Calculates the maximum width for each column based on the content and newline replacement rules.
4
4
  * @param inputDataRows - All rows (header and body) of the input table.
5
5
  * @param maxColumnCount - The maximum number of columns in the input table.
6
6
  * @param minWidth - The minimum width for each column. Defaults to 3.
7
+ * @param canReplaceNewlines - Whether to replace newlines with '<br>' (affects width) or a space.
7
8
  * @returns An array of maximum widths for each column.
8
9
  */
9
- export declare function calculateColumnWidths(inputDataRows: readonly InputTableRowData[], maxColumnCount: number, minWidth?: number): number[];
10
+ export declare function calculateColumnWidths(inputDataRows: readonly InputTableRowData[], maxColumnCount: number, minWidth: number | undefined, canReplaceNewlines: boolean): number[];
10
11
  /**
11
12
  * Formats a single row into a Markdown-formatted string.
12
13
  * @param columnCount - The number of columns in the table.
@@ -17,7 +18,7 @@ export declare function calculateColumnWidths(inputDataRows: readonly InputTable
17
18
  * @param canReplaceNewlines - Flag to replace newlines with <br> tags.
18
19
  * @returns The Markdown string for the row.
19
20
  */
20
- export declare function formatMarkdownRow(columnCount: number, currentRow: InputTableRowData, columnAlignments: readonly ('left' | 'right' | 'center' | 'none')[], columnWidths?: readonly number[], useTabs?: boolean, canReplaceNewlines?: boolean): string;
21
+ export declare function formatMarkdownTableBody(columnCount: number, currentRow: InputTableRowData, columnAlignments: readonly ('left' | 'right' | 'center' | 'none')[], columnWidths?: readonly number[], useTabs?: boolean, canReplaceNewlines?: boolean): string;
21
22
  /**
22
23
  * Generates the alignment row for the Markdown table syntax.
23
24
  * @param columnCount - The number of columns in the table.
@@ -26,7 +27,7 @@ export declare function formatMarkdownRow(columnCount: number, currentRow: Input
26
27
  * @param useTabs - Flag to use tabs between columns.
27
28
  * @returns The Markdown string for the alignment row.
28
29
  */
29
- export declare function formatAlignmentRow(columnCount: number, columnAlignments: readonly ('left' | 'right' | 'center' | 'none')[], columnWidths?: readonly number[], useTabs?: boolean): string;
30
+ export declare function formatMarkdownTableAlignmentRow(columnCount: number, columnAlignments: readonly ('left' | 'right' | 'center' | 'none')[], columnWidths?: readonly number[], useTabs?: boolean): string;
30
31
  /**
31
32
  * Generates a complete Markdown table string from the provided data.
32
33
  * @param inputData - The table data including headers and rows.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-markdown-table-ts",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
4
4
  "description": "A React component that converts structured data into Markdown table syntax and displays it within a `<pre>` tag.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",