@reblu/site-blocks 0.17.0 → 0.17.1

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
  # @reblu/site-blocks
2
2
 
3
+ ## 0.17.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 1a3c593: `MarkdownRenderer` and `SafeHtml` now style GFM tables. Tables used to render unstyled (no borders, no padding, no header emphasis); they now get theme-token borders, cell padding, a muted header row with semibold header text and `text-sm` body text, and keep the column alignment from the delimiter row. Each table scrolls horizontally inside its own `overflow-x-auto` wrapper, so a wide table no longer pushes the page sideways on mobile. No props changed.
8
+
3
9
  ## 0.17.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -127,6 +127,22 @@ of the page.** Draft it somewhere that is not the document body.
127
127
  4" still points at a `4`. The marker style (`type`) and an item's explicit number
128
128
  (`value`) survive too.
129
129
 
130
+ ### Tables scroll inside their own box
131
+
132
+ GFM tables (`| Cookie | Purpose | Duration |` plus a `| --- | --- | --- |`
133
+ delimiter row) render with theme-token borders (`border-border`), cell padding,
134
+ a `bg-muted` header row with semibold header text, and `text-sm` body text. The
135
+ alignment written in the delimiter row (`:--`, `:-:`, `--:`) is kept.
136
+
137
+ Each table sits in its own `overflow-x-auto` wrapper, so a table wider than the
138
+ reading column scrolls sideways on a phone while the page itself does not.
139
+
140
+ ### Links
141
+
142
+ Internal links (`/privacidad`, `#clause-4`) and `mailto:` links open in the same
143
+ tab. External links (`https://…`, `//…`) open in a new tab and always carry
144
+ `rel="noopener noreferrer"`.
145
+
130
146
  ### Which authored attributes survive
131
147
 
132
148
  The renderer rebuilds each element to apply the tenant's design tokens and to
package/dist/index.cjs CHANGED
@@ -13252,6 +13252,14 @@ function authorAttributes(el) {
13252
13252
  }
13253
13253
  return preserved;
13254
13254
  }
13255
+ var CELL_ALIGN_CLASSES = {
13256
+ left: "text-left",
13257
+ center: "text-center",
13258
+ right: "text-right"
13259
+ };
13260
+ function cellAlignClass(align) {
13261
+ return align ? CELL_ALIGN_CLASSES[align.toLowerCase()] : void 0;
13262
+ }
13255
13263
  function isExternalHref(href) {
13256
13264
  return !!href && /^(https?:)?\/\//.test(href);
13257
13265
  }
@@ -13385,6 +13393,36 @@ function buildOptions(headingOffset, images) {
13385
13393
  className: "absolute inset-0 h-full w-full border-0"
13386
13394
  }
13387
13395
  ) });
13396
+ // GFM tables (a cookie policy's cookie list, a price table). The table scrolls
13397
+ // inside its own wrapper so a wide one never pushes the page sideways on a phone.
13398
+ case "table":
13399
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "my-6 w-full overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", { ...author, className: "w-full border-collapse text-sm", children: children2() }) });
13400
+ case "thead":
13401
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { ...author, className: "bg-muted", children: children2() });
13402
+ case "tbody":
13403
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { ...author, children: children2() });
13404
+ case "tr":
13405
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { ...author, children: children2() });
13406
+ case "th":
13407
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
13408
+ "th",
13409
+ {
13410
+ ...author,
13411
+ className: `border border-border px-3 py-2 font-semibold text-foreground ${cellAlignClass(attribs.align) ?? "text-left"}`,
13412
+ children: children2()
13413
+ }
13414
+ );
13415
+ case "td": {
13416
+ const align = cellAlignClass(attribs.align);
13417
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
13418
+ "td",
13419
+ {
13420
+ ...author,
13421
+ className: `border border-border px-3 py-2 align-top text-foreground/90${align ? ` ${align}` : ""}`,
13422
+ children: children2()
13423
+ }
13424
+ );
13425
+ }
13388
13426
  case "hr":
13389
13427
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("hr", { ...author, className: "my-8 border-muted-foreground/30" });
13390
13428
  case "strong":