@tdacorp/hyle-sdk 0.8.1 → 0.9.0

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/next.cjs CHANGED
@@ -149,6 +149,7 @@ function createHyleClient(options) {
149
149
  const query = new URLSearchParams({ path: opts.path });
150
150
  if (opts.locale !== void 0) query.set("locale", opts.locale);
151
151
  if (opts.format !== void 0) query.set("format", opts.format);
152
+ if (opts.nav !== void 0) query.set("nav", opts.nav);
152
153
  if (opts.cursor !== void 0) query.set("cursor", opts.cursor);
153
154
  if (opts.limit !== void 0) query.set("limit", String(opts.limit));
154
155
  const reply = await get("/cp1/read/resolve", query, opts.init);
@@ -403,7 +404,8 @@ var SHAPES = {
403
404
  ] }),
404
405
  chev: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m6 3.5 4.5 4.5L6 12.5" }),
405
406
  "chev-down": /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m3.5 6 4.5 4.5L12.5 6" }),
406
- "chev-left": /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10 3.5 5.5 8 10 12.5" })
407
+ "chev-left": /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10 3.5 5.5 8 10 12.5" }),
408
+ x: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m4 4 8 8M12 4l-8 8" })
407
409
  };
408
410
  function Icon({ name, className }) {
409
411
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: className ? `hyle-ic ${className}` : "hyle-ic", viewBox: "0 0 16 16", "aria-hidden": "true", children: SHAPES[name] });
@@ -711,6 +713,8 @@ var en = {
711
713
  emptyBody: "Documents published to this section will appear here, newest first.",
712
714
  docs: "Documentation",
713
715
  menu: "Menu",
716
+ closeMenu: "Close menu",
717
+ updated: "Last updated",
714
718
  nfKind: "404 \xB7 Not found",
715
719
  nfTitle: "This page does not exist",
716
720
  nfBody: "The address may be mistyped, or the document may have been unpublished or moved.",
@@ -752,6 +756,8 @@ var fr = {
752
756
  emptyBody: "Les documents publi\xE9s dans cette section appara\xEEtront ici, du plus r\xE9cent au plus ancien.",
753
757
  docs: "Documentation",
754
758
  menu: "Menu",
759
+ closeMenu: "Fermer le menu",
760
+ updated: "Derni\xE8re mise \xE0 jour",
755
761
  nfKind: "404 \xB7 Introuvable",
756
762
  nfTitle: "Cette page n'existe pas",
757
763
  nfBody: "L'adresse est peut-\xEAtre mal saisie, ou le document a \xE9t\xE9 d\xE9publi\xE9 ou d\xE9plac\xE9.",
@@ -793,6 +799,8 @@ var es = {
793
799
  emptyBody: "Los documentos publicados en esta secci\xF3n aparecer\xE1n aqu\xED, del m\xE1s reciente al m\xE1s antiguo.",
794
800
  docs: "Documentaci\xF3n",
795
801
  menu: "Men\xFA",
802
+ closeMenu: "Cerrar el men\xFA",
803
+ updated: "\xDAltima actualizaci\xF3n",
796
804
  nfKind: "404 \xB7 No encontrada",
797
805
  nfTitle: "Esta p\xE1gina no existe",
798
806
  nfBody: "Puede que la direcci\xF3n est\xE9 mal escrita, o que el documento se haya despublicado o movido.",
@@ -1095,65 +1103,96 @@ function ListPage({ list, olderHref, description, ...base }) {
1095
1103
  ] }) : null
1096
1104
  ] }) });
1097
1105
  }
1098
- function DocsTree({ article, c }) {
1099
- const { Link, s } = c;
1100
- const current = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { children: [
1101
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Link, { href: c.href(article.publication.canonical_path), "aria-current": "page", children: article.publication.title }),
1102
- article.children.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { children: article.children.map((ch) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Link, { href: c.href(ch.canonical_path), children: ch.title }) }, ch.canonical_path)) }) : null
1103
- ] });
1104
- const nested = article.ancestors.reduceRight(
1105
- (inner, a) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { children: [
1106
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Link, { href: c.href(a.canonical_path), children: a.title }),
1107
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { children: inner })
1108
- ] }, a.canonical_path),
1109
- current
1110
- );
1111
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("nav", { className: "hyle-tree", "aria-label": s.docs, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { children: nested }) });
1106
+
1107
+ // src/react/docs.tsx
1108
+ var import_docs_enhance = require("./docs-enhance.cjs");
1109
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1110
+ var ROOT_ID = "hyle-docs";
1111
+ var NAV_ID = "hyle-docs-nav";
1112
+ function navTreeOf(article) {
1113
+ if (article.nav && !article.nav.truncated && article.nav.items.length > 0) return article.nav.items;
1114
+ const { publication: pub } = article;
1115
+ const here = {
1116
+ slug: pub.slug,
1117
+ title: pub.title,
1118
+ canonical_path: pub.canonical_path,
1119
+ children: article.children.map((child) => ({ ...child, children: [] }))
1120
+ };
1121
+ return [article.ancestors.reduceRight((inner, a) => ({ ...a, children: [inner] }), here)];
1122
+ }
1123
+ function pathTo(nodes, path) {
1124
+ for (const node of nodes) {
1125
+ if (node.canonical_path === path) return [node.canonical_path];
1126
+ const below = pathTo(node.children, path);
1127
+ if (below.length > 0) return [node.canonical_path, ...below];
1128
+ }
1129
+ return [];
1130
+ }
1131
+ function Branch({ nodes, current, onPath, c }) {
1132
+ const { Link } = c;
1133
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { children: nodes.map((node) => {
1134
+ const link = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Link, { href: c.href(node.canonical_path), ...node.canonical_path === current ? { "aria-current": "page" } : {}, children: node.title });
1135
+ if (node.children.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: link }, node.canonical_path);
1136
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { ...onPath.has(node.canonical_path) ? { open: true } : {}, children: [
1137
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("summary", { children: [
1138
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "chev" }),
1139
+ link
1140
+ ] }),
1141
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Branch, { nodes: node.children, current, onPath, c })
1142
+ ] }) }, node.canonical_path);
1143
+ }) });
1112
1144
  }
1113
1145
  function DocsPage({ article, ...base }) {
1114
1146
  const { publication: pub } = article;
1115
1147
  const c = ctx(base, pub.locale);
1116
1148
  const { Link, s } = c;
1117
1149
  const toc = Toc({ toc: article.toc, c });
1150
+ const tree = navTreeOf(article);
1151
+ const onPath = new Set(pathTo(tree, pub.canonical_path));
1118
1152
  const siteName = article.breadcrumbs[0]?.title ?? "";
1119
- const version = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "docs.version", slots: base.slots, tag: "span" });
1120
- const side = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
1121
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle-side-head", children: [
1122
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: siteName }),
1123
- version
1124
- ] }),
1125
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "docs.sidebar-header", slots: base.slots, className: "hyle-side-slot" }),
1126
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DocsTree, { article, c }),
1127
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "docs.sidebar-footer", slots: base.slots, className: "hyle-side-slot" })
1128
- ] });
1153
+ const headingIds = article.toc.filter((t) => t.depth === 2 || t.depth === 3).map((t) => scopeId(t.id));
1129
1154
  const notTranslated = article.fallback ? s.fallbackTitle.replace("{language}", languageName(article.fallback.requested_locale, c.locale)) : void 0;
1130
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle-docs", lang: c.locale, children: [
1131
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("details", { className: "hyle-nav-m", children: [
1132
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("summary", { children: [
1133
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "file" }),
1134
- s.menu,
1135
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "cur", children: pub.title }),
1136
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
1155
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle-docs", id: ROOT_ID, lang: c.locale, children: [
1156
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_docs_enhance.DocsEnhance, { headingIds, rootId: ROOT_ID }),
1157
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { type: "button", className: "hyle-nav-bar", popoverTarget: NAV_ID, children: [
1158
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "file" }),
1159
+ s.menu,
1160
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "cur", children: pub.title }),
1161
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
1162
+ ] }),
1163
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("aside", { className: "hyle-nav-d", id: NAV_ID, popover: "auto", "aria-label": s.docs, children: [
1164
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle-side-head", children: [
1165
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("b", { children: siteName }),
1166
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "docs.version", slots: base.slots, tag: "span" }),
1167
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", className: "hyle-nav-x", popoverTarget: NAV_ID, popoverTargetAction: "hide", "aria-label": s.closeMenu, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "x" }) })
1137
1168
  ] }),
1138
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { children: side })
1169
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "docs.sidebar-header", slots: base.slots, className: "hyle-side-slot" }),
1170
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("nav", { className: "hyle-tree", "aria-label": s.docs, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Branch, { nodes: tree, current: pub.canonical_path, onPath, c }) }),
1171
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "docs.sidebar-footer", slots: base.slots, className: "hyle-side-slot" })
1139
1172
  ] }),
1140
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("aside", { className: "hyle-nav-d", "aria-label": s.docs, children: side }),
1141
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle-docs-main", "data-hyle-page": "docs", children: [
1142
- notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
1143
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "alert" }),
1144
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
1145
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: notTranslated }),
1173
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle-docs-main", "data-hyle-page": "docs", children: [
1174
+ notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
1175
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "alert" }),
1176
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
1177
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("b", { children: notTranslated }),
1146
1178
  " ",
1147
1179
  s.fallbackBody
1148
1180
  ] })
1149
1181
  ] }) : null,
1150
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("nav", { className: "hyle-crumbs", "aria-label": s.crumbs, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ol", { children: article.breadcrumbs.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { "aria-current": i === article.breadcrumbs.length - 1 ? "page" : void 0, children: i === article.breadcrumbs.length - 1 ? b.title : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Link, { href: c.href(b.canonical_path), children: b.title }) }, b.canonical_path)) }) }),
1151
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h1", { className: "hyle-title", children: pub.title }),
1152
- pub.description ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
1182
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("nav", { className: "hyle-crumbs", "aria-label": s.crumbs, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ol", { children: article.breadcrumbs.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { "aria-current": i === article.breadcrumbs.length - 1 ? "page" : void 0, children: i === article.breadcrumbs.length - 1 ? b.title : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Link, { href: c.href(b.canonical_path), children: b.title }) }, b.canonical_path)) }) }),
1183
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", { className: "hyle-title", children: pub.title }),
1184
+ pub.description ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
1185
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { className: "hyle-updated", children: [
1186
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "calendar" }),
1187
+ s.updated,
1188
+ " ",
1189
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("time", { dateTime: pub.updated_at, title: pub.updated_at, children: formatDate(pub.updated_at, c.locale) })
1190
+ ] }),
1153
1191
  toc.narrow,
1154
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Body, { article, components: base.components, locale: c.locale }),
1155
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Pager, { prev: article.prev, next: article.next, c }),
1156
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "docs.after", slots: base.slots, className: "hyle-after" })
1192
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Body, { article, components: base.components, locale: c.locale }),
1193
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Pager, { prev: article.prev, next: article.next, c }),
1194
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "docs.after", slots: base.slots, className: "hyle-after" }),
1195
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "hyle-docs-end", "aria-hidden": "true" })
1157
1196
  ] }),
1158
1197
  toc.wide
1159
1198
  ] }) });
@@ -1208,8 +1247,9 @@ function fetchResolver(options) {
1208
1247
  const client = createHyleClient({ baseUrl: options.baseUrl, token: options.token });
1209
1248
  const revalidate = options.revalidate ?? DEFAULT_REVALIDATE;
1210
1249
  const tags = workspaceTags(options.workspaceId, options.sections);
1211
- return (path, locale, limit, cursor) => client.resolve({
1250
+ return (path, locale, limit, cursor, nav) => client.resolve({
1212
1251
  path,
1252
+ ...nav !== void 0 ? { nav } : {},
1213
1253
  ...locale !== void 0 ? { locale } : {},
1214
1254
  ...limit !== void 0 ? { limit } : {},
1215
1255
  ...cursor !== void 0 ? { cursor } : {},
@@ -1241,7 +1281,7 @@ function isRejectedRequest(error) {
1241
1281
  }
1242
1282
 
1243
1283
  // src/next/page.tsx
1244
- var import_jsx_runtime5 = require("react/jsx-runtime");
1284
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1245
1285
  function hylePage(options) {
1246
1286
  const resolve = resolverFor(options);
1247
1287
  return async function HylePage({ params, searchParams }) {
@@ -1249,17 +1289,17 @@ function hylePage(options) {
1249
1289
  if (path === void 0) (0, import_navigation2.notFound)();
1250
1290
  try {
1251
1291
  const cursor = options.paginate === "searchParams" ? validCursor((await searchParams)?.cursor) : void 0;
1252
- const result = await resolve(path, locale, options.listLimit, cursor);
1292
+ const result = await resolve(path, locale, options.listLimit, cursor, options.layout === "docs" ? "tree" : void 0);
1253
1293
  switch (result.kind) {
1254
1294
  case "article": {
1255
1295
  const props = { article: result, components: options.components, slots: options.slots, locale, toHref };
1256
- return options.layout === "docs" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DocsPage, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ArticlePage, { ...props });
1296
+ return options.layout === "docs" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DocsPage, { ...props }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ArticlePage, { ...props });
1257
1297
  }
1258
1298
  case "list": {
1259
1299
  const list = options.list?.title ? { ...result, section: { ...result.section, title: options.list.title } } : result;
1260
1300
  const next = options.paginate === "searchParams" ? validCursor(result.next_cursor) : void 0;
1261
1301
  const olderHref = next ? `${toHref(path)}?cursor=${next}` : void 0;
1262
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ListPage, { list, ...olderHref ? { olderHref } : {}, ...options.list?.description ? { description: options.list.description } : {}, components: options.components, slots: options.slots, locale, toHref });
1302
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ListPage, { list, ...olderHref ? { olderHref } : {}, ...options.list?.description ? { description: options.list.description } : {}, components: options.components, slots: options.slots, locale, toHref });
1263
1303
  }
1264
1304
  case "redirect": {
1265
1305
  const to = safeRedirectTarget(result.to);
@@ -1319,7 +1359,7 @@ function hyleMetadata(options) {
1319
1359
  const { path, locale, toHref } = routeContext(options, await params ?? {});
1320
1360
  if (path === void 0) return {};
1321
1361
  try {
1322
- const result = await resolve(path, locale, options.listLimit);
1362
+ const result = await resolve(path, locale, options.listLimit, void 0, options.layout === "docs" ? "tree" : void 0);
1323
1363
  if (result.kind === "list") {
1324
1364
  const title = options.list?.title || result.section.title;
1325
1365
  const description2 = options.list?.description;
package/dist/next.d.cts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { ReactElement } from 'react';
2
- import { H as HyleComponents, a as HyleSlots } from './types-DnPzhrFx.cjs';
3
- import { F as FetchResolverOptions, H as HyleResolver } from './resolve-36-Ng1H0.cjs';
4
- export { f as fetchResolver, w as workspaceTags } from './resolve-36-Ng1H0.cjs';
2
+ import { H as HyleComponents, a as HyleSlots } from './types-BPPZrYOZ.cjs';
3
+ import { F as FetchResolverOptions, H as HyleResolver } from './resolve-D2rnnho9.cjs';
4
+ export { f as fetchResolver, w as workspaceTags } from './resolve-D2rnnho9.cjs';
5
5
  import { MetadataRoute, Metadata } from 'next';
6
6
  import { a as RevalidationCallbackRoute } from './revalidation-callback-D7Ms_Puz.cjs';
7
- import './types-CwBCPh6K.cjs';
7
+ import './types-CHxH5E0S.cjs';
8
8
 
9
9
  type RouteParams = Record<string, string | string[] | undefined>;
10
10
  interface CommonOptions {
package/dist/next.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { ReactElement } from 'react';
2
- import { H as HyleComponents, a as HyleSlots } from './types-BoyBWF2F.js';
3
- import { F as FetchResolverOptions, H as HyleResolver } from './resolve-1rQntRBh.js';
4
- export { f as fetchResolver, w as workspaceTags } from './resolve-1rQntRBh.js';
2
+ import { H as HyleComponents, a as HyleSlots } from './types-C1eCQ2As.js';
3
+ import { F as FetchResolverOptions, H as HyleResolver } from './resolve-Dpb6Orsj.js';
4
+ export { f as fetchResolver, w as workspaceTags } from './resolve-Dpb6Orsj.js';
5
5
  import { MetadataRoute, Metadata } from 'next';
6
6
  import { a as RevalidationCallbackRoute } from './revalidation-callback-D7Ms_Puz.js';
7
- import './types-CwBCPh6K.js';
7
+ import './types-CHxH5E0S.js';
8
8
 
9
9
  type RouteParams = Record<string, string | string[] | undefined>;
10
10
  interface CommonOptions {
package/dist/next.js CHANGED
@@ -2,18 +2,18 @@ import {
2
2
  ArticlePage,
3
3
  DocsPage,
4
4
  ListPage
5
- } from "./chunk-LGW2KP4X.js";
5
+ } from "./chunk-6LW33475.js";
6
6
  import {
7
7
  DEFAULT_REVALIDATE,
8
8
  fetchResolver,
9
9
  workspaceTags
10
- } from "./chunk-N4QYPO7S.js";
10
+ } from "./chunk-XKR74Y5G.js";
11
11
  import {
12
12
  Cp1ClientError,
13
13
  createHyleClient,
14
14
  createRevalidationCallbackRoute,
15
15
  listPublicationPaths
16
- } from "./chunk-EBNIKRQH.js";
16
+ } from "./chunk-54JF4E53.js";
17
17
  import {
18
18
  ASSET_CONTENT_TYPES,
19
19
  ASSET_FILE
@@ -87,7 +87,7 @@ function hylePage(options) {
87
87
  if (path === void 0) notFound();
88
88
  try {
89
89
  const cursor = options.paginate === "searchParams" ? validCursor((await searchParams)?.cursor) : void 0;
90
- const result = await resolve(path, locale, options.listLimit, cursor);
90
+ const result = await resolve(path, locale, options.listLimit, cursor, options.layout === "docs" ? "tree" : void 0);
91
91
  switch (result.kind) {
92
92
  case "article": {
93
93
  const props = { article: result, components: options.components, slots: options.slots, locale, toHref };
@@ -157,7 +157,7 @@ function hyleMetadata(options) {
157
157
  const { path, locale, toHref } = routeContext(options, await params ?? {});
158
158
  if (path === void 0) return {};
159
159
  try {
160
- const result = await resolve(path, locale, options.listLimit);
160
+ const result = await resolve(path, locale, options.listLimit, void 0, options.layout === "docs" ? "tree" : void 0);
161
161
  if (result.kind === "list") {
162
162
  const title = options.list?.title || result.section.title;
163
163
  const description2 = options.list?.description;
package/dist/react.cjs CHANGED
@@ -86,7 +86,8 @@ var SHAPES = {
86
86
  ] }),
87
87
  chev: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m6 3.5 4.5 4.5L6 12.5" }),
88
88
  "chev-down": /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m3.5 6 4.5 4.5L12.5 6" }),
89
- "chev-left": /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10 3.5 5.5 8 10 12.5" })
89
+ "chev-left": /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10 3.5 5.5 8 10 12.5" }),
90
+ x: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m4 4 8 8M12 4l-8 8" })
90
91
  };
91
92
  function Icon({ name, className }) {
92
93
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className: className ? `hyle-ic ${className}` : "hyle-ic", viewBox: "0 0 16 16", "aria-hidden": "true", children: SHAPES[name] });
@@ -394,6 +395,8 @@ var en = {
394
395
  emptyBody: "Documents published to this section will appear here, newest first.",
395
396
  docs: "Documentation",
396
397
  menu: "Menu",
398
+ closeMenu: "Close menu",
399
+ updated: "Last updated",
397
400
  nfKind: "404 \xB7 Not found",
398
401
  nfTitle: "This page does not exist",
399
402
  nfBody: "The address may be mistyped, or the document may have been unpublished or moved.",
@@ -435,6 +438,8 @@ var fr = {
435
438
  emptyBody: "Les documents publi\xE9s dans cette section appara\xEEtront ici, du plus r\xE9cent au plus ancien.",
436
439
  docs: "Documentation",
437
440
  menu: "Menu",
441
+ closeMenu: "Fermer le menu",
442
+ updated: "Derni\xE8re mise \xE0 jour",
438
443
  nfKind: "404 \xB7 Introuvable",
439
444
  nfTitle: "Cette page n'existe pas",
440
445
  nfBody: "L'adresse est peut-\xEAtre mal saisie, ou le document a \xE9t\xE9 d\xE9publi\xE9 ou d\xE9plac\xE9.",
@@ -476,6 +481,8 @@ var es = {
476
481
  emptyBody: "Los documentos publicados en esta secci\xF3n aparecer\xE1n aqu\xED, del m\xE1s reciente al m\xE1s antiguo.",
477
482
  docs: "Documentaci\xF3n",
478
483
  menu: "Men\xFA",
484
+ closeMenu: "Cerrar el men\xFA",
485
+ updated: "\xDAltima actualizaci\xF3n",
479
486
  nfKind: "404 \xB7 No encontrada",
480
487
  nfTitle: "Esta p\xE1gina no existe",
481
488
  nfBody: "Puede que la direcci\xF3n est\xE9 mal escrita, o que el documento se haya despublicado o movido.",
@@ -778,69 +785,6 @@ function ListPage({ list, olderHref, description, ...base }) {
778
785
  ] }) : null
779
786
  ] }) });
780
787
  }
781
- function DocsTree({ article, c }) {
782
- const { Link, s } = c;
783
- const current = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { children: [
784
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Link, { href: c.href(article.publication.canonical_path), "aria-current": "page", children: article.publication.title }),
785
- article.children.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { children: article.children.map((ch) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Link, { href: c.href(ch.canonical_path), children: ch.title }) }, ch.canonical_path)) }) : null
786
- ] });
787
- const nested = article.ancestors.reduceRight(
788
- (inner, a) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { children: [
789
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Link, { href: c.href(a.canonical_path), children: a.title }),
790
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { children: inner })
791
- ] }, a.canonical_path),
792
- current
793
- );
794
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("nav", { className: "hyle-tree", "aria-label": s.docs, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ul", { children: nested }) });
795
- }
796
- function DocsPage({ article, ...base }) {
797
- const { publication: pub } = article;
798
- const c = ctx(base, pub.locale);
799
- const { Link, s } = c;
800
- const toc = Toc({ toc: article.toc, c });
801
- const siteName = article.breadcrumbs[0]?.title ?? "";
802
- const version = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "docs.version", slots: base.slots, tag: "span" });
803
- const side = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
804
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle-side-head", children: [
805
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: siteName }),
806
- version
807
- ] }),
808
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "docs.sidebar-header", slots: base.slots, className: "hyle-side-slot" }),
809
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DocsTree, { article, c }),
810
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "docs.sidebar-footer", slots: base.slots, className: "hyle-side-slot" })
811
- ] });
812
- const notTranslated = article.fallback ? s.fallbackTitle.replace("{language}", languageName(article.fallback.requested_locale, c.locale)) : void 0;
813
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle-docs", lang: c.locale, children: [
814
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("details", { className: "hyle-nav-m", children: [
815
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("summary", { children: [
816
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "file" }),
817
- s.menu,
818
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "cur", children: pub.title }),
819
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
820
- ] }),
821
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { children: side })
822
- ] }),
823
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("aside", { className: "hyle-nav-d", "aria-label": s.docs, children: side }),
824
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle-docs-main", "data-hyle-page": "docs", children: [
825
- notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
826
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: "alert" }),
827
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
828
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("b", { children: notTranslated }),
829
- " ",
830
- s.fallbackBody
831
- ] })
832
- ] }) : null,
833
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("nav", { className: "hyle-crumbs", "aria-label": s.crumbs, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ol", { children: article.breadcrumbs.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("li", { "aria-current": i === article.breadcrumbs.length - 1 ? "page" : void 0, children: i === article.breadcrumbs.length - 1 ? b.title : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Link, { href: c.href(b.canonical_path), children: b.title }) }, b.canonical_path)) }) }),
834
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h1", { className: "hyle-title", children: pub.title }),
835
- pub.description ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
836
- toc.narrow,
837
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Body, { article, components: base.components, locale: c.locale }),
838
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Pager, { prev: article.prev, next: article.next, c }),
839
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Slot, { name: "docs.after", slots: base.slots, className: "hyle-after" })
840
- ] }),
841
- toc.wide
842
- ] }) });
843
- }
844
788
  function NotFound({ path, homeHref = "/", ...base }) {
845
789
  const c = ctx(base, "en");
846
790
  const { Link, s } = c;
@@ -889,6 +833,100 @@ function Redirecting({ from, to, ...base }) {
889
833
  extra ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { "data-slot": "redirecting.body", className: "fine", children: extra }) : null
890
834
  ] }) });
891
835
  }
836
+
837
+ // src/react/docs.tsx
838
+ var import_docs_enhance = require("./docs-enhance.cjs");
839
+ var import_jsx_runtime5 = require("react/jsx-runtime");
840
+ var ROOT_ID = "hyle-docs";
841
+ var NAV_ID = "hyle-docs-nav";
842
+ function navTreeOf(article) {
843
+ if (article.nav && !article.nav.truncated && article.nav.items.length > 0) return article.nav.items;
844
+ const { publication: pub } = article;
845
+ const here = {
846
+ slug: pub.slug,
847
+ title: pub.title,
848
+ canonical_path: pub.canonical_path,
849
+ children: article.children.map((child) => ({ ...child, children: [] }))
850
+ };
851
+ return [article.ancestors.reduceRight((inner, a) => ({ ...a, children: [inner] }), here)];
852
+ }
853
+ function pathTo(nodes, path) {
854
+ for (const node of nodes) {
855
+ if (node.canonical_path === path) return [node.canonical_path];
856
+ const below = pathTo(node.children, path);
857
+ if (below.length > 0) return [node.canonical_path, ...below];
858
+ }
859
+ return [];
860
+ }
861
+ function Branch({ nodes, current, onPath, c }) {
862
+ const { Link } = c;
863
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ul", { children: nodes.map((node) => {
864
+ const link = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Link, { href: c.href(node.canonical_path), ...node.canonical_path === current ? { "aria-current": "page" } : {}, children: node.title });
865
+ if (node.children.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: link }, node.canonical_path);
866
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { ...onPath.has(node.canonical_path) ? { open: true } : {}, children: [
867
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("summary", { children: [
868
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "chev" }),
869
+ link
870
+ ] }),
871
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Branch, { nodes: node.children, current, onPath, c })
872
+ ] }) }, node.canonical_path);
873
+ }) });
874
+ }
875
+ function DocsPage({ article, ...base }) {
876
+ const { publication: pub } = article;
877
+ const c = ctx(base, pub.locale);
878
+ const { Link, s } = c;
879
+ const toc = Toc({ toc: article.toc, c });
880
+ const tree = navTreeOf(article);
881
+ const onPath = new Set(pathTo(tree, pub.canonical_path));
882
+ const siteName = article.breadcrumbs[0]?.title ?? "";
883
+ const headingIds = article.toc.filter((t) => t.depth === 2 || t.depth === 3).map((t) => scopeId(t.id));
884
+ const notTranslated = article.fallback ? s.fallbackTitle.replace("{language}", languageName(article.fallback.requested_locale, c.locale)) : void 0;
885
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Shell, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle-docs", id: ROOT_ID, lang: c.locale, children: [
886
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_docs_enhance.DocsEnhance, { headingIds, rootId: ROOT_ID }),
887
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("button", { type: "button", className: "hyle-nav-bar", popoverTarget: NAV_ID, children: [
888
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "file" }),
889
+ s.menu,
890
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "cur", children: pub.title }),
891
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "chev-down", className: "hyle-chev" })
892
+ ] }),
893
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("aside", { className: "hyle-nav-d", id: NAV_ID, popover: "auto", "aria-label": s.docs, children: [
894
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle-side-head", children: [
895
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("b", { children: siteName }),
896
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "docs.version", slots: base.slots, tag: "span" }),
897
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("button", { type: "button", className: "hyle-nav-x", popoverTarget: NAV_ID, popoverTargetAction: "hide", "aria-label": s.closeMenu, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "x" }) })
898
+ ] }),
899
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "docs.sidebar-header", slots: base.slots, className: "hyle-side-slot" }),
900
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("nav", { className: "hyle-tree", "aria-label": s.docs, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Branch, { nodes: tree, current: pub.canonical_path, onPath, c }) }),
901
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "docs.sidebar-footer", slots: base.slots, className: "hyle-side-slot" })
902
+ ] }),
903
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle-docs-main", "data-hyle-page": "docs", children: [
904
+ notTranslated ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "hyle-banner", "data-kind": "warn", role: "status", children: [
905
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "alert" }),
906
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
907
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("b", { children: notTranslated }),
908
+ " ",
909
+ s.fallbackBody
910
+ ] })
911
+ ] }) : null,
912
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("nav", { className: "hyle-crumbs", "aria-label": s.crumbs, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ol", { children: article.breadcrumbs.map((b, i) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { "aria-current": i === article.breadcrumbs.length - 1 ? "page" : void 0, children: i === article.breadcrumbs.length - 1 ? b.title : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Link, { href: c.href(b.canonical_path), children: b.title }) }, b.canonical_path)) }) }),
913
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h1", { className: "hyle-title", children: pub.title }),
914
+ pub.description ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "hyle-desc", children: pub.description }) : null,
915
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("p", { className: "hyle-updated", children: [
916
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { name: "calendar" }),
917
+ s.updated,
918
+ " ",
919
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("time", { dateTime: pub.updated_at, title: pub.updated_at, children: formatDate(pub.updated_at, c.locale) })
920
+ ] }),
921
+ toc.narrow,
922
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Body, { article, components: base.components, locale: c.locale }),
923
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Pager, { prev: article.prev, next: article.next, c }),
924
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Slot, { name: "docs.after", slots: base.slots, className: "hyle-after" }),
925
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "hyle-docs-end", "aria-hidden": "true" })
926
+ ] }),
927
+ toc.wide
928
+ ] }) });
929
+ }
892
930
  // Annotate the CommonJS export names for ESM import in node:
893
931
  0 && (module.exports = {
894
932
  ArticlePage,
package/dist/react.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
2
  import { ReactElement } from 'react';
3
- import { H as HyleComponents, P as PageBaseProps } from './types-DnPzhrFx.cjs';
4
- export { C as CalloutKind, b as CalloutProps, c as CodeBlockProps, a as HyleSlots, I as ImageProps, L as LinkProps, d as ListItemProps, M as MermaidProps } from './types-DnPzhrFx.cjs';
3
+ import { H as HyleComponents, P as PageBaseProps } from './types-BPPZrYOZ.cjs';
4
+ export { C as CalloutKind, b as CalloutProps, c as CodeBlockProps, a as HyleSlots, I as ImageProps, L as LinkProps, d as ListItemProps, M as MermaidProps } from './types-BPPZrYOZ.cjs';
5
5
  import { Root } from 'hast';
6
- import { d as ResolvedArticle, f as ResolvedList } from './types-CwBCPh6K.cjs';
6
+ import { f as ResolvedArticle, h as ResolvedList } from './types-CHxH5E0S.cjs';
7
7
 
8
8
  interface HastContentProps {
9
9
  /** `content.tree` from an article result. Anything that is not a hast root renders nothing. */
@@ -95,35 +95,6 @@ declare function isSafeUrl(value: unknown, kind: "href" | "src"): boolean;
95
95
  */
96
96
  declare function sanitizeHast(tree: unknown, title?: string): Root;
97
97
 
98
- interface ArticlePageProps extends PageBaseProps {
99
- article: ResolvedArticle;
100
- }
101
- declare function ArticlePage({ article, ...base }: ArticlePageProps): ReactElement;
102
- interface ListPageProps extends PageBaseProps {
103
- list: ResolvedList;
104
- /** Where "Older posts" goes; omit to hide it. The list endpoint is cursor based, so a host builds this from `list.next_cursor`. */
105
- olderHref?: string;
106
- /** Page description under the title. */
107
- description?: string;
108
- }
109
- declare function ListPage({ list, olderHref, description, ...base }: ListPageProps): ReactElement;
110
- declare function DocsPage({ article, ...base }: ArticlePageProps): ReactElement;
111
- interface NotFoundProps extends PageBaseProps {
112
- /** The path that was not found, shown to the visitor. */
113
- path?: string;
114
- /** Where "Go to home" goes. */
115
- homeHref?: string;
116
- }
117
- declare function NotFound({ path, homeHref, ...base }: NotFoundProps): ReactElement;
118
- /** The fail-safe state `hylePage` renders when hyle cannot be reached. It takes no error: nothing internal can reach the markup. */
119
- declare function Unavailable(base: PageBaseProps): ReactElement;
120
- interface RedirectingProps extends PageBaseProps {
121
- from?: string;
122
- to: string;
123
- }
124
- /** For a client-side explanation of a move. The Next adapter redirects on the server and never renders this. */
125
- declare function Redirecting({ from, to, ...base }: RedirectingProps): ReactElement;
126
-
127
98
  /**
128
99
  * Chrome strings for en, fr and es. The fr and es copy is a draft carried over from the design kit and has not been
129
100
  * reviewed by a native speaker. Content itself is never translated here; it comes from hyle.
@@ -154,6 +125,8 @@ declare const en: {
154
125
  emptyBody: string;
155
126
  docs: string;
156
127
  menu: string;
128
+ closeMenu: string;
129
+ updated: string;
157
130
  nfKind: string;
158
131
  nfTitle: string;
159
132
  nfBody: string;
@@ -174,4 +147,34 @@ type Strings = typeof en;
174
147
  /** Strings for a BCP 47 tag; the primary subtag decides, anything unknown falls back to English. */
175
148
  declare function stringsFor(locale: string | undefined): Strings;
176
149
 
150
+ interface ArticlePageProps extends PageBaseProps {
151
+ article: ResolvedArticle;
152
+ }
153
+ declare function ArticlePage({ article, ...base }: ArticlePageProps): ReactElement;
154
+ interface ListPageProps extends PageBaseProps {
155
+ list: ResolvedList;
156
+ /** Where "Older posts" goes; omit to hide it. The list endpoint is cursor based, so a host builds this from `list.next_cursor`. */
157
+ olderHref?: string;
158
+ /** Page description under the title. */
159
+ description?: string;
160
+ }
161
+ declare function ListPage({ list, olderHref, description, ...base }: ListPageProps): ReactElement;
162
+ interface NotFoundProps extends PageBaseProps {
163
+ /** The path that was not found, shown to the visitor. */
164
+ path?: string;
165
+ /** Where "Go to home" goes. */
166
+ homeHref?: string;
167
+ }
168
+ declare function NotFound({ path, homeHref, ...base }: NotFoundProps): ReactElement;
169
+ /** The fail-safe state `hylePage` renders when hyle cannot be reached. It takes no error: nothing internal can reach the markup. */
170
+ declare function Unavailable(base: PageBaseProps): ReactElement;
171
+ interface RedirectingProps extends PageBaseProps {
172
+ from?: string;
173
+ to: string;
174
+ }
175
+ /** For a client-side explanation of a move. The Next adapter redirects on the server and never renders this. */
176
+ declare function Redirecting({ from, to, ...base }: RedirectingProps): ReactElement;
177
+
178
+ declare function DocsPage({ article, ...base }: ArticlePageProps): ReactElement;
179
+
177
180
  export { ArticlePage, type ArticlePageProps, DocsPage, HastContent, type HastContentProps, HastLimitError, HyleComponents, ListPage, type ListPageProps, MermaidDiagram, type MermaidDiagramProps, NotFound, type NotFoundProps, PageBaseProps, Redirecting, type RedirectingProps, type Strings, TrustedServerHtml, Unavailable, isSafeUrl, sanitizeHast, scopeId, stringsFor };