@ai-matrx/records-ui 0.102.19 → 0.102.21

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/index.js CHANGED
@@ -6600,7 +6600,7 @@ function RecordValue({
6600
6600
  }
6601
6601
  if (inCell && ui.grid === "merged" && ui.renderText && typeof value === "string" && value.trim() !== "" && editorKindFor(field2) === "long_text" && !shownAsOf(field2) && !wholeValueOf(document2, field2.key) && !envelopeFor(document2, field2.key)?.absent && // A long-text cell holding a kind is drawn by the kind system below, not as markdown.
6602
6602
  !kindValueOf(value)) {
6603
- return /* @__PURE__ */ jsx27("span", { className: "block max-h-[4.5em] min-w-0 overflow-hidden whitespace-normal", "data-records-cell-text": "", children: ui.renderText(value, "cell") });
6603
+ return /* @__PURE__ */ jsx27("span", { className: "block h-[1.5em] min-w-0 overflow-hidden whitespace-normal", "data-records-cell-text": "", children: ui.renderText(value, "cell") });
6604
6604
  }
6605
6605
  if (isSignatureField(field2) && value !== null && value !== void 0 && value !== "") {
6606
6606
  return /* @__PURE__ */ jsx27(SignatureValue, { value, inCell, recordId, fieldKey: field2.key, document: document2 });
@@ -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
- let text = line.trim();
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 (line.includes("|") && SEPARATOR.test(lines[i + 1] ?? "") && !SEPARATOR.test(line)) {
19420
+ if (tableStartsAt(lines, i)) {
19438
19421
  const headers = uniqueLabels(splitPipes(line));
19439
- let j = i + 2;
19422
+ const j = findTableEnd(lines, i);
19440
19423
  const matrix = [];
19441
- while (j < lines.length && (lines[j] ?? "").includes("|") && (lines[j] ?? "").trim() !== "") {
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({
@@ -20189,7 +20169,6 @@ function UndoRedoLive({ source }) {
20189
20169
  }
20190
20170
  function UndoRedoPair({ face, onUndo, onRedo }) {
20191
20171
  const undo = { depth: { back: face.back, forward: face.forward }, busy: face.busy };
20192
- if (undo.depth.back === 0 && undo.depth.forward === 0) return null;
20193
20172
  return /* @__PURE__ */ jsxs60(Fragment22, { children: [
20194
20173
  /* @__PURE__ */ jsxs60(
20195
20174
  Button38,
@@ -23276,7 +23255,7 @@ function GridBody({
23276
23255
  {
23277
23256
  ...fills ? { className: "min-h-0 flex-1" } : {},
23278
23257
  frameHeight: fills ? "fill" : "content",
23279
- loadingRows: rememberedRowCount(rowMemoryKey, pageSize, fills ? "fill" : 5),
23258
+ loadingRows: rememberedRowCount(rowMemoryKey, pageSize, embedded ? fills ? "fill" : 5 : rememberedRowCount(`${tableId}:page:last`, pageSize, fills ? "fill" : 5)),
23280
23259
  ...!look.rowHeight ? { loadingRowHeight: RECORDS_GRID_ROW_PX } : {},
23281
23260
  data: rows,
23282
23261
  columns: tableColumns,