@ai-matrx/records-ui 0.102.19 → 0.102.20

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog — @ai-matrx/records-ui
2
2
 
3
+ ## 0.102.20
4
+
5
+ - `readTableShapes` reads markdown tables through THE GFM rule (`tableStartsAt` / `findTableEnd` / `rowCells` from `@ai-matrx/content-ir/source`) instead of a private pipe splitter and delimiter regex: edge pipes optional, `\|` stays in its cell, and the table ends where chat and the editor end it (AP-2).
6
+
7
+ **Consumer action:** none.
8
+
3
9
  ## 0.102.19
4
10
 
5
11
  Automatic changed-only republish (docs/metadata drift since the last tag — see
package/dist/index.cjs CHANGED
@@ -19501,25 +19501,8 @@ function nameAbove(lines, lineIndex) {
19501
19501
  }
19502
19502
  return null;
19503
19503
  }
19504
- var SEPARATOR = /^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/;
19505
19504
  function splitPipes(line) {
19506
- let text = line.trim();
19507
- if (text.startsWith("|")) text = text.slice(1);
19508
- if (text.endsWith("|") && !text.endsWith("\\|")) text = text.slice(0, -1);
19509
- const cells = [];
19510
- let cell2 = "";
19511
- for (let i = 0; i < text.length; i += 1) {
19512
- const ch = text[i];
19513
- if (ch === "\\" && text[i + 1] === "|") {
19514
- cell2 += "\\|";
19515
- i += 1;
19516
- } else if (ch === "|") {
19517
- cells.push(cell2);
19518
- cell2 = "";
19519
- } else cell2 += ch;
19520
- }
19521
- cells.push(cell2);
19522
- return cells.map(cellWords);
19505
+ return (0, import_source2.rowCells)(line).map(cellWords);
19523
19506
  }
19524
19507
  var LIST_ITEM = /^(\s*)(?:[-*+•]|\d{1,3}[.)])\s+(?:\[[ xX]\]\s+)?(.*)$/;
19525
19508
  var KEY_VALUE = /^\s*(?:\*\*|__)?([^:*_|]{1,40}?)(?::(?:\*\*|__)|(?:\*\*|__):|:)\s+(.+)$/;
@@ -19768,14 +19751,11 @@ function readTableShapes(text) {
19768
19751
  i = j + 1;
19769
19752
  continue;
19770
19753
  }
19771
- if (line.includes("|") && SEPARATOR.test(lines[i + 1] ?? "") && !SEPARATOR.test(line)) {
19754
+ if ((0, import_source2.tableStartsAt)(lines, i)) {
19772
19755
  const headers = uniqueLabels(splitPipes(line));
19773
- let j = i + 2;
19756
+ const j = (0, import_source2.findTableEnd)(lines, i);
19774
19757
  const matrix = [];
19775
- while (j < lines.length && (lines[j] ?? "").includes("|") && (lines[j] ?? "").trim() !== "") {
19776
- matrix.push(splitPipes(lines[j]));
19777
- j += 1;
19778
- }
19758
+ for (let r = i + 2; r < j; r += 1) matrix.push(splitPipes(lines[r]));
19779
19759
  const rows = rowsOf(headers, matrix);
19780
19760
  if (headers.length >= 1 && rows.length >= 1) {
19781
19761
  shapes.push({