wiki-formant 0.63.0 → 0.63.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/README.md CHANGED
@@ -821,7 +821,7 @@ The dispatch stays a `switch` over the wiki's own union, so a new type is a comp
821
821
 
822
822
  An editor that draws each block in place, with a list of its own (miow's), hosts the same fields in `<BlockFieldsKit kit={KIT}>`, without `<BlockEditor>`. Only the two container fields need the full editor, since they hold a block list.
823
823
 
824
- A `testimonial` is `{ quote, author, role?, avatarUrl? }`, drawn by `TestimonialView` as `figure.testimonial`: the words in a `blockquote`, then a `figcaption` holding the photo and a `span` of `strong` (who) and `small` (their role). radix-wiki and miow each had one under its own field names; a site with sized images passes `picture`, which turns the photo's URL into its `<img>` attributes.
824
+ A `testimonial` is `{ quote, author, role?, avatarUrl? }`, drawn by `TestimonialView` as `figure.testimonial`: the words in a `blockquote`, then a `figcaption` holding the photo and a `span` of `strong` (who) and `small` (their role). radix-wiki and miow each had one under its own field names; a site with sized images passes `photo`, the `<img>` attributes (`src`, `srcSet`, `sizes`) it made from `avatarUrl`. They are data, because a server component renders the view.
825
825
 
826
826
  A banner with no text of its own shows `BANNER_MESSAGES` from `wiki-formant/text`, a sentence per variant that names no wiki; `BannerView` takes it unless `message` overrides it.
827
827
 
@@ -109,11 +109,14 @@ export interface TestimonialViewProps {
109
109
  author: string;
110
110
  role?: string;
111
111
  avatarUrl?: string;
112
- /** The photo's `<img>` attributes; a site with an image pipeline passes its sized `srcSet`. Default the bare URL. */
113
- picture?: (src: string) => ImgHTMLAttributes<HTMLImageElement>;
112
+ /**
113
+ * The photo's sized `<img>` attributes, for a site with an image pipeline.
114
+ * Data, not a function: a server component renders this client view.
115
+ */
116
+ photo?: Pick<ImgHTMLAttributes<HTMLImageElement>, 'src' | 'srcSet' | 'sizes'>;
114
117
  }
115
118
  /** Someone's words over who said them, with their photo when there is one. */
116
- export declare function TestimonialView({ quote, author, role, avatarUrl, picture }: TestimonialViewProps): import("react").JSX.Element | null;
119
+ export declare function TestimonialView({ quote, author, role, avatarUrl, photo }: TestimonialViewProps): import("react").JSX.Element | null;
117
120
  /**
118
121
  * A maintenance notice.
119
122
  *
@@ -115,11 +115,11 @@ export function StatsView({ items, columns = 4, }) {
115
115
  return (_jsx("div", { className: cx('stat-grid', `stat-grid-${columns}`), children: rows.map((item, i) => (_jsxs("div", { className: "stat-card", children: [_jsxs("span", { className: "stat-value", children: [item.value, item.suffix && _jsx("span", { className: "stat-suffix", children: item.suffix })] }), _jsx("span", { className: "stat-label", children: item.label })] }, item.id ?? i))) }));
116
116
  }
117
117
  /** Someone's words over who said them, with their photo when there is one. */
118
- export function TestimonialView({ quote, author, role, avatarUrl, picture = src => ({ src }) }) {
118
+ export function TestimonialView({ quote, author, role, avatarUrl, photo }) {
119
119
  if (!quote.trim())
120
120
  return null;
121
- const photo = avatarUrl && safeLinkHref(avatarUrl);
122
- return (_jsxs("figure", { className: "testimonial", children: [_jsx("blockquote", { children: quote }), _jsxs("figcaption", { children: [photo && _jsx("img", { ...picture(photo), alt: "", loading: "lazy" }), _jsxs("span", { children: [_jsx("strong", { children: author }), role && _jsx("small", { children: role })] })] })] }));
121
+ const src = avatarUrl && safeLinkHref(avatarUrl);
122
+ return (_jsxs("figure", { className: "testimonial", children: [_jsx("blockquote", { children: quote }), _jsxs("figcaption", { children: [src && _jsx("img", { src: src, ...photo, alt: "", loading: "lazy" }), _jsxs("span", { children: [_jsx("strong", { children: author }), role && _jsx("small", { children: role })] })] })] }));
123
123
  }
124
124
  // ---- banner -----------------------------------------------------------------
125
125
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wiki-formant",
3
- "version": "0.63.0",
3
+ "version": "0.63.1",
4
4
  "description": "The portable half of a wiki: derived taxonomy and facet controls, a version-negotiating MCP transport, markdown twins, block rendering, a rich-text editor engine, conditional-GET plumbing, and the headers and CSP every origin sends.",
5
5
  "type": "module",
6
6
  "license": "MIT",