@columnus/shared 0.1.49 → 0.1.51

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.
@@ -4761,10 +4761,33 @@ function visitInlineContent(content, visit) {
4761
4761
  function walkInlineContent(content, parts) {
4762
4762
  visitInlineContent(content, {
4763
4763
  text: (t) => parts.push(t),
4764
- recordLink: (props) => parts.push(props.table ? `[${props.table}]` : "[record]"),
4764
+ recordLink: (props) => parts.push(props.table ? `[${props.table}]` : "[Record]"),
4765
4765
  link: (nested) => walkInlineContent(nested, parts)
4766
4766
  });
4767
4767
  }
4768
+ function walkTableCell(cell, parts) {
4769
+ if (Array.isArray(cell)) {
4770
+ walkInlineContent(cell, parts);
4771
+ return;
4772
+ }
4773
+ if (cell && typeof cell === "object") {
4774
+ const node = cell;
4775
+ if (node.type === "tableCell" && Array.isArray(node.content)) {
4776
+ walkInlineContent(node.content, parts);
4777
+ }
4778
+ }
4779
+ }
4780
+ function walkTableContent(content, parts) {
4781
+ if (!content || typeof content !== "object" || Array.isArray(content)) return;
4782
+ const rows = content.rows ?? [];
4783
+ for (const row of rows) {
4784
+ for (const cell of row.cells ?? []) {
4785
+ const before = parts.length;
4786
+ walkTableCell(cell, parts);
4787
+ if (parts.length > before) parts.push(" ");
4788
+ }
4789
+ }
4790
+ }
4768
4791
  function walkBlocks(blocks, parts) {
4769
4792
  for (const block of blocks) {
4770
4793
  if (block.type === "recordTable") {
@@ -4778,6 +4801,8 @@ function walkBlocks(blocks, parts) {
4778
4801
  parts.push("[data table]");
4779
4802
  }
4780
4803
  parts.push(" ");
4804
+ } else if (block.type === "table") {
4805
+ walkTableContent(block.content, parts);
4781
4806
  } else if (Array.isArray(block.content)) {
4782
4807
  walkInlineContent(block.content, parts);
4783
4808
  parts.push(" ");