specatlas 0.1.17 → 0.1.19

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.
Files changed (2) hide show
  1. package/dist/bin.js +34 -3
  2. package/package.json +2 -2
package/dist/bin.js CHANGED
@@ -8770,7 +8770,25 @@ function highlightCode(code, language, enabled) {
8770
8770
  }
8771
8771
  }
8772
8772
  function splitRow(line) {
8773
- return line.trim().replace(/^\|/, "").replace(/\|$/, "").split("|").map((cell) => cell.trim());
8773
+ const trimmed = line.trim().replace(/^\|/, "").replace(/\|$/, "");
8774
+ const cells = [];
8775
+ let current = "";
8776
+ for (let index = 0; index < trimmed.length; index += 1) {
8777
+ const char = trimmed[index] ?? "";
8778
+ if (char === "\\" && trimmed[index + 1] === "|") {
8779
+ current += "|";
8780
+ index += 1;
8781
+ continue;
8782
+ }
8783
+ if (char === "|") {
8784
+ cells.push(current.trim());
8785
+ current = "";
8786
+ continue;
8787
+ }
8788
+ current += char;
8789
+ }
8790
+ cells.push(current.trim());
8791
+ return cells;
8774
8792
  }
8775
8793
  function tableOfContents(markdown2, maxLevel = 2) {
8776
8794
  const entries = [];
@@ -8824,7 +8842,16 @@ function renderMarkdown(markdown2, opts = {}) {
8824
8842
  const source = code.join("\n");
8825
8843
  if (lang === "mermaid") {
8826
8844
  if (mermaidMode === "script" && opts.mermaidScriptUri) {
8827
- out.push(`<div class="mermaid-block"><pre class="mermaid">${escapeHtml(source)}</pre></div>`);
8845
+ out.push(`<div class="mermaid-block">
8846
+ <div class="diagram-tools" role="toolbar" aria-label="Herramientas del diagrama">
8847
+ <button type="button" data-diagram-zoom="out" title="Alejar" aria-label="Alejar">\u2212</button>
8848
+ <button type="button" data-diagram-zoom="in" title="Acercar" aria-label="Acercar">\uFF0B</button>
8849
+ <button type="button" data-diagram-zoom="reset" title="Tama\xF1o original" aria-label="Tama\xF1o original">100%</button>
8850
+ <button type="button" data-diagram-fullscreen title="Pantalla completa (Esc para salir)" aria-label="Pantalla completa">\u26F6</button>
8851
+ <button type="button" data-diagram-download title="Descargar SVG" aria-label="Descargar SVG">\u2913</button>
8852
+ </div>
8853
+ <div class="diagram-canvas"><pre class="mermaid">${escapeHtml(source)}</pre></div>
8854
+ </div>`);
8828
8855
  } else {
8829
8856
  out.push(
8830
8857
  `<div class="mermaid-block callout"><pre class="mermaid">${escapeHtml(source)}</pre><p><small>Diagrama mermaid \u2014 visible con la vista previa de Markdown del editor.</small></p></div>`
@@ -8928,8 +8955,12 @@ function renderMarkdown(markdown2, opts = {}) {
8928
8955
  rows.push(splitRow(lines[i] ?? ""));
8929
8956
  i += 1;
8930
8957
  }
8958
+ const width = Math.max(header.length, ...rows.map((row) => row.length));
8959
+ const pad = (cells) => [...cells, ...Array.from({ length: Math.max(0, width - cells.length) }, () => "")];
8960
+ const paddedHeader = pad(header);
8961
+ const paddedRows = rows.map((row) => pad(row));
8931
8962
  out.push(
8932
- `<table><thead><tr>${header.map((cell) => `<th>${inlineMarkdown(cell)}</th>`).join("")}</tr></thead><tbody>${rows.map((row) => `<tr>${row.map((cell) => `<td>${inlineMarkdown(cell)}</td>`).join("")}</tr>`).join("")}</tbody></table>`
8963
+ `<div class="table-wrap"><table><thead><tr>${paddedHeader.map((cell) => `<th>${inlineMarkdown(cell)}</th>`).join("")}</tr></thead><tbody>${paddedRows.map((row) => `<tr>${row.map((cell) => `<td>${inlineMarkdown(cell)}</td>`).join("")}</tr>`).join("")}</tbody></table></div>`
8933
8964
  );
8934
8965
  continue;
8935
8966
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "specatlas",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "SpecAtlas: kernel determinista de Spec-Driven Development (CLI)",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@specatlas/adapters": "0.1.1",
43
- "@specatlas/core": "0.1.14"
43
+ "@specatlas/core": "0.1.16"
44
44
  },
45
45
  "scripts": {
46
46
  "typecheck": "tsc --noEmit",