@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 +6 -0
- package/dist/index.cjs +4 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -25
- package/dist/index.js.map +1 -1
- package/dist/table-shape.cjs +4 -24
- package/dist/table-shape.cjs.map +1 -1
- package/dist/table-shape.js +5 -25
- package/dist/table-shape.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -19119,7 +19119,7 @@ function ImportWizard({ tableId, source, onDone, onWrote, className }) {
|
|
|
19119
19119
|
}
|
|
19120
19120
|
|
|
19121
19121
|
// src/tableShape.ts
|
|
19122
|
-
import { codeSpanText as codeSpanText2, mapInlineCodeSpans } from "@ai-matrx/content-ir/source";
|
|
19122
|
+
import { codeSpanText as codeSpanText2, findTableEnd, mapInlineCodeSpans, rowCells, tableStartsAt } from "@ai-matrx/content-ir/source";
|
|
19123
19123
|
import { humanizeIdentifier as humanizeIdentifier9 } from "@ai-matrx/kit/text-case";
|
|
19124
19124
|
import { parseDelimited as readDelimited } from "@ai-matrx/kit/delimited";
|
|
19125
19125
|
var FEWEST_LIST_ITEMS = 2;
|
|
@@ -19167,25 +19167,8 @@ function nameAbove(lines, lineIndex) {
|
|
|
19167
19167
|
}
|
|
19168
19168
|
return null;
|
|
19169
19169
|
}
|
|
19170
|
-
var SEPARATOR = /^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/;
|
|
19171
19170
|
function splitPipes(line) {
|
|
19172
|
-
|
|
19173
|
-
if (text.startsWith("|")) text = text.slice(1);
|
|
19174
|
-
if (text.endsWith("|") && !text.endsWith("\\|")) text = text.slice(0, -1);
|
|
19175
|
-
const cells = [];
|
|
19176
|
-
let cell2 = "";
|
|
19177
|
-
for (let i = 0; i < text.length; i += 1) {
|
|
19178
|
-
const ch = text[i];
|
|
19179
|
-
if (ch === "\\" && text[i + 1] === "|") {
|
|
19180
|
-
cell2 += "\\|";
|
|
19181
|
-
i += 1;
|
|
19182
|
-
} else if (ch === "|") {
|
|
19183
|
-
cells.push(cell2);
|
|
19184
|
-
cell2 = "";
|
|
19185
|
-
} else cell2 += ch;
|
|
19186
|
-
}
|
|
19187
|
-
cells.push(cell2);
|
|
19188
|
-
return cells.map(cellWords);
|
|
19171
|
+
return rowCells(line).map(cellWords);
|
|
19189
19172
|
}
|
|
19190
19173
|
var LIST_ITEM = /^(\s*)(?:[-*+•]|\d{1,3}[.)])\s+(?:\[[ xX]\]\s+)?(.*)$/;
|
|
19191
19174
|
var KEY_VALUE = /^\s*(?:\*\*|__)?([^:*_|]{1,40}?)(?::(?:\*\*|__)|(?:\*\*|__):|:)\s+(.+)$/;
|
|
@@ -19434,14 +19417,11 @@ function readTableShapes(text) {
|
|
|
19434
19417
|
i = j + 1;
|
|
19435
19418
|
continue;
|
|
19436
19419
|
}
|
|
19437
|
-
if (
|
|
19420
|
+
if (tableStartsAt(lines, i)) {
|
|
19438
19421
|
const headers = uniqueLabels(splitPipes(line));
|
|
19439
|
-
|
|
19422
|
+
const j = findTableEnd(lines, i);
|
|
19440
19423
|
const matrix = [];
|
|
19441
|
-
|
|
19442
|
-
matrix.push(splitPipes(lines[j]));
|
|
19443
|
-
j += 1;
|
|
19444
|
-
}
|
|
19424
|
+
for (let r = i + 2; r < j; r += 1) matrix.push(splitPipes(lines[r]));
|
|
19445
19425
|
const rows = rowsOf(headers, matrix);
|
|
19446
19426
|
if (headers.length >= 1 && rows.length >= 1) {
|
|
19447
19427
|
shapes.push({
|