@tdacorp/hyle-sdk 0.14.1 → 0.17.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/README.md +20 -8
- package/dist/check-routes-bin.js +10 -8
- package/dist/{chunk-4V4VKB3O.js → chunk-DMK4XQLU.js} +470 -385
- package/dist/{chunk-R5EMI4HQ.js → chunk-PJMJMP66.js} +3 -1
- package/dist/comments.cjs +6 -4
- package/dist/comments.js +6 -5
- package/dist/{diagram-viewer-DYX6R63Y.js → diagram-viewer-FJPED4SN.js} +46 -26
- package/dist/{embed-B76zRRPa.d.cts → embed-BmdwA2G9.d.cts} +9 -4
- package/dist/{embed-SqOBGI-E.d.ts → embed-DNTZ2UXv.d.ts} +9 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/labels-nmukKYgL.d.cts +37 -0
- package/dist/labels-nmukKYgL.d.ts +37 -0
- package/dist/mermaid-diagram.cjs +59 -30
- package/dist/mermaid-diagram.d.cts +4 -37
- package/dist/mermaid-diagram.d.ts +4 -37
- package/dist/mermaid-diagram.js +7 -5
- package/dist/mermaid-image.cjs +1382 -0
- package/dist/mermaid-image.d.cts +29 -0
- package/dist/mermaid-image.d.ts +29 -0
- package/dist/mermaid-image.js +94 -0
- package/dist/next.cjs +1330 -1118
- package/dist/next.d.cts +61 -11
- package/dist/next.d.ts +61 -11
- package/dist/next.js +922 -793
- package/dist/react.cjs +267 -184
- package/dist/react.d.cts +29 -6
- package/dist/react.d.ts +29 -6
- package/dist/react.js +1 -1
- package/dist/{resolve-DC2ccfwA.d.ts → resolve-Ae7UFjsQ.d.ts} +1 -1
- package/dist/{resolve-DKLVftk_.d.cts → resolve-euZ4-aC9.d.cts} +1 -1
- package/dist/styles.css +11 -22
- package/dist/{types-ByodIyEv.d.cts → types-Czt887Iv.d.cts} +19 -3
- package/dist/{types-ByodIyEv.d.ts → types-Czt887Iv.d.ts} +19 -3
- package/dist/use-cache.d.cts +2 -2
- package/dist/use-cache.d.ts +2 -2
- package/package.json +1 -1
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, E as EngagementConfig, J as JsonLdConfig } from './embed-
|
|
4
|
-
export { A as ArticleRef, C as CalloutKind, d as CalloutProps, e as CodeBlockProps, b as EmbedHeading, f as HyleArticleView, g as HyleArticleViewProps, h as HyleListView, i as HyleListViewProps, a as HyleSlots, I as ImageProps, L as LinkProps, j as ListItemProps, M as MermaidProps, O as OgImage } from './embed-
|
|
3
|
+
import { H as HyleComponents, P as PageBaseProps, E as EngagementConfig, J as JsonLdConfig } from './embed-BmdwA2G9.cjs';
|
|
4
|
+
export { A as ArticleRef, C as CalloutKind, d as CalloutProps, e as CodeBlockProps, b as EmbedHeading, f as HyleArticleView, g as HyleArticleViewProps, h as HyleListView, i as HyleListViewProps, a as HyleSlots, I as ImageProps, L as LinkProps, j as ListItemProps, M as MermaidProps, O as OgImage } from './embed-BmdwA2G9.cjs';
|
|
5
5
|
import { Root } from 'hast';
|
|
6
|
-
import { h as ResolvedArticle, j as ResolvedList, c as EngageListing } from './types-
|
|
6
|
+
import { h as ResolvedArticle, L as ListItem, j as ResolvedList, c as EngageListing } from './types-Czt887Iv.cjs';
|
|
7
7
|
|
|
8
8
|
interface HastContentProps {
|
|
9
9
|
/** `content.tree` from an article result. Anything that is not a hast root renders nothing. */
|
|
@@ -73,10 +73,12 @@ interface MermaidDiagramProps {
|
|
|
73
73
|
title: string;
|
|
74
74
|
/** Shown when Mermaid cannot render the source. */
|
|
75
75
|
errorText: string;
|
|
76
|
+
/** Accessible name of the loader shown while the diagram renders (English when omitted). */
|
|
77
|
+
loadingText?: string;
|
|
76
78
|
/** Strings of the diagram viewer (English when omitted). */
|
|
77
79
|
labels?: ViewerLabels;
|
|
78
80
|
}
|
|
79
|
-
declare function MermaidDiagram({ source, title, errorText, labels }: MermaidDiagramProps): react.JSX.Element;
|
|
81
|
+
declare function MermaidDiagram({ source, title, errorText, loadingText, labels }: MermaidDiagramProps): react.JSX.Element;
|
|
80
82
|
|
|
81
83
|
/**
|
|
82
84
|
* Defense in depth. hyle sanitizes server-side (packages/renderer/src/render.ts); this guard repeats the same allowlist
|
|
@@ -187,11 +189,17 @@ declare const en: {
|
|
|
187
189
|
caution: string;
|
|
188
190
|
diagram: string;
|
|
189
191
|
diagramError: string;
|
|
192
|
+
diagramLoading: string;
|
|
193
|
+
diagramSource: string;
|
|
190
194
|
contentError: string;
|
|
191
195
|
fallbackTitle: string;
|
|
192
196
|
fallbackBody: string;
|
|
197
|
+
readingTime: string;
|
|
198
|
+
readingTimeLabel: string;
|
|
193
199
|
older: string;
|
|
194
200
|
viewAll: string;
|
|
201
|
+
moreInSection: string;
|
|
202
|
+
subPages: string;
|
|
195
203
|
readAtSource: string;
|
|
196
204
|
emptyTitle: string;
|
|
197
205
|
emptyBody: string;
|
|
@@ -233,9 +241,20 @@ interface ArticlePageProps extends PageBaseProps {
|
|
|
233
241
|
jsonLd?: JsonLdConfig | undefined;
|
|
234
242
|
/** The validated og:image URL, put in the BlogPosting `image`. */
|
|
235
243
|
imageUrl?: string | undefined;
|
|
244
|
+
/** The image's size when known, so the BlogPosting `image` becomes an ImageObject. */
|
|
245
|
+
imageWidth?: number | undefined;
|
|
246
|
+
imageHeight?: number | undefined;
|
|
247
|
+
/**
|
|
248
|
+
* "More in this section" (`items`, the host's choice of siblings) and the article's own `children`, rendered after the pager with
|
|
249
|
+
* `HyleListView`. `hylePage` fills it from the `related` option. A list with no items renders nothing.
|
|
250
|
+
*/
|
|
251
|
+
related?: {
|
|
252
|
+
title?: string | undefined;
|
|
253
|
+
items: readonly ListItem[];
|
|
254
|
+
} | undefined;
|
|
236
255
|
}
|
|
237
256
|
|
|
238
|
-
declare function ArticlePage({ article, engagement, origin, jsonLd, imageUrl, ...base }: ArticlePageProps): ReactElement;
|
|
257
|
+
declare function ArticlePage({ article, engagement, origin, jsonLd, imageUrl, imageWidth, imageHeight, related, ...base }: ArticlePageProps): ReactElement;
|
|
239
258
|
interface ListPageProps extends PageBaseProps {
|
|
240
259
|
list: ResolvedList;
|
|
241
260
|
/** Where "Older posts" goes; omit to hide it. The list endpoint is cursor based, so a host builds this from `list.next_cursor`. */
|
|
@@ -246,8 +265,12 @@ interface ListPageProps extends PageBaseProps {
|
|
|
246
265
|
origin?: string | undefined;
|
|
247
266
|
/** The list's own site path (what `hylePage` resolved). */
|
|
248
267
|
path?: string | undefined;
|
|
268
|
+
/** With `origin` and `path`, joins the CollectionPage to the host's WebSite and Organization graph (see `JsonLdConfig`). */
|
|
269
|
+
jsonLd?: JsonLdConfig | undefined;
|
|
270
|
+
/** The page's `?cursor=`, put in the JSON-LD url and @id. */
|
|
271
|
+
cursor?: string | undefined;
|
|
249
272
|
}
|
|
250
|
-
declare function ListPage({ list, olderHref, description, origin, path, ...base }: ListPageProps): ReactElement;
|
|
273
|
+
declare function ListPage({ list, olderHref, description, origin, path, jsonLd, cursor, ...base }: ListPageProps): ReactElement;
|
|
251
274
|
interface NotFoundProps extends PageBaseProps {
|
|
252
275
|
/** The path that was not found, shown to the visitor. */
|
|
253
276
|
path?: string;
|
package/dist/react.d.ts
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, E as EngagementConfig, J as JsonLdConfig } from './embed-
|
|
4
|
-
export { A as ArticleRef, C as CalloutKind, d as CalloutProps, e as CodeBlockProps, b as EmbedHeading, f as HyleArticleView, g as HyleArticleViewProps, h as HyleListView, i as HyleListViewProps, a as HyleSlots, I as ImageProps, L as LinkProps, j as ListItemProps, M as MermaidProps, O as OgImage } from './embed-
|
|
3
|
+
import { H as HyleComponents, P as PageBaseProps, E as EngagementConfig, J as JsonLdConfig } from './embed-DNTZ2UXv.js';
|
|
4
|
+
export { A as ArticleRef, C as CalloutKind, d as CalloutProps, e as CodeBlockProps, b as EmbedHeading, f as HyleArticleView, g as HyleArticleViewProps, h as HyleListView, i as HyleListViewProps, a as HyleSlots, I as ImageProps, L as LinkProps, j as ListItemProps, M as MermaidProps, O as OgImage } from './embed-DNTZ2UXv.js';
|
|
5
5
|
import { Root } from 'hast';
|
|
6
|
-
import { h as ResolvedArticle, j as ResolvedList, c as EngageListing } from './types-
|
|
6
|
+
import { h as ResolvedArticle, L as ListItem, j as ResolvedList, c as EngageListing } from './types-Czt887Iv.js';
|
|
7
7
|
|
|
8
8
|
interface HastContentProps {
|
|
9
9
|
/** `content.tree` from an article result. Anything that is not a hast root renders nothing. */
|
|
@@ -73,10 +73,12 @@ interface MermaidDiagramProps {
|
|
|
73
73
|
title: string;
|
|
74
74
|
/** Shown when Mermaid cannot render the source. */
|
|
75
75
|
errorText: string;
|
|
76
|
+
/** Accessible name of the loader shown while the diagram renders (English when omitted). */
|
|
77
|
+
loadingText?: string;
|
|
76
78
|
/** Strings of the diagram viewer (English when omitted). */
|
|
77
79
|
labels?: ViewerLabels;
|
|
78
80
|
}
|
|
79
|
-
declare function MermaidDiagram({ source, title, errorText, labels }: MermaidDiagramProps): react.JSX.Element;
|
|
81
|
+
declare function MermaidDiagram({ source, title, errorText, loadingText, labels }: MermaidDiagramProps): react.JSX.Element;
|
|
80
82
|
|
|
81
83
|
/**
|
|
82
84
|
* Defense in depth. hyle sanitizes server-side (packages/renderer/src/render.ts); this guard repeats the same allowlist
|
|
@@ -187,11 +189,17 @@ declare const en: {
|
|
|
187
189
|
caution: string;
|
|
188
190
|
diagram: string;
|
|
189
191
|
diagramError: string;
|
|
192
|
+
diagramLoading: string;
|
|
193
|
+
diagramSource: string;
|
|
190
194
|
contentError: string;
|
|
191
195
|
fallbackTitle: string;
|
|
192
196
|
fallbackBody: string;
|
|
197
|
+
readingTime: string;
|
|
198
|
+
readingTimeLabel: string;
|
|
193
199
|
older: string;
|
|
194
200
|
viewAll: string;
|
|
201
|
+
moreInSection: string;
|
|
202
|
+
subPages: string;
|
|
195
203
|
readAtSource: string;
|
|
196
204
|
emptyTitle: string;
|
|
197
205
|
emptyBody: string;
|
|
@@ -233,9 +241,20 @@ interface ArticlePageProps extends PageBaseProps {
|
|
|
233
241
|
jsonLd?: JsonLdConfig | undefined;
|
|
234
242
|
/** The validated og:image URL, put in the BlogPosting `image`. */
|
|
235
243
|
imageUrl?: string | undefined;
|
|
244
|
+
/** The image's size when known, so the BlogPosting `image` becomes an ImageObject. */
|
|
245
|
+
imageWidth?: number | undefined;
|
|
246
|
+
imageHeight?: number | undefined;
|
|
247
|
+
/**
|
|
248
|
+
* "More in this section" (`items`, the host's choice of siblings) and the article's own `children`, rendered after the pager with
|
|
249
|
+
* `HyleListView`. `hylePage` fills it from the `related` option. A list with no items renders nothing.
|
|
250
|
+
*/
|
|
251
|
+
related?: {
|
|
252
|
+
title?: string | undefined;
|
|
253
|
+
items: readonly ListItem[];
|
|
254
|
+
} | undefined;
|
|
236
255
|
}
|
|
237
256
|
|
|
238
|
-
declare function ArticlePage({ article, engagement, origin, jsonLd, imageUrl, ...base }: ArticlePageProps): ReactElement;
|
|
257
|
+
declare function ArticlePage({ article, engagement, origin, jsonLd, imageUrl, imageWidth, imageHeight, related, ...base }: ArticlePageProps): ReactElement;
|
|
239
258
|
interface ListPageProps extends PageBaseProps {
|
|
240
259
|
list: ResolvedList;
|
|
241
260
|
/** Where "Older posts" goes; omit to hide it. The list endpoint is cursor based, so a host builds this from `list.next_cursor`. */
|
|
@@ -246,8 +265,12 @@ interface ListPageProps extends PageBaseProps {
|
|
|
246
265
|
origin?: string | undefined;
|
|
247
266
|
/** The list's own site path (what `hylePage` resolved). */
|
|
248
267
|
path?: string | undefined;
|
|
268
|
+
/** With `origin` and `path`, joins the CollectionPage to the host's WebSite and Organization graph (see `JsonLdConfig`). */
|
|
269
|
+
jsonLd?: JsonLdConfig | undefined;
|
|
270
|
+
/** The page's `?cursor=`, put in the JSON-LD url and @id. */
|
|
271
|
+
cursor?: string | undefined;
|
|
249
272
|
}
|
|
250
|
-
declare function ListPage({ list, olderHref, description, origin, path, ...base }: ListPageProps): ReactElement;
|
|
273
|
+
declare function ListPage({ list, olderHref, description, origin, path, jsonLd, cursor, ...base }: ListPageProps): ReactElement;
|
|
251
274
|
interface NotFoundProps extends PageBaseProps {
|
|
252
275
|
/** The path that was not found, shown to the visitor. */
|
|
253
276
|
path?: string;
|
package/dist/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as Resolved } from './types-
|
|
1
|
+
import { R as Resolved } from './types-Czt887Iv.js';
|
|
2
2
|
|
|
3
3
|
/** Resolves a site path to a result. The two built-in strategies are `fetchResolver` (default) and `cachedResolver` (`@tdacorp/hyle-sdk/next/use-cache`). */
|
|
4
4
|
type HyleResolver = (path: string, locale: string | undefined, limit?: number, cursor?: string, nav?: "tree", format?: "md") => Promise<Resolved>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { R as Resolved } from './types-
|
|
1
|
+
import { R as Resolved } from './types-Czt887Iv.cjs';
|
|
2
2
|
|
|
3
3
|
/** Resolves a site path to a result. The two built-in strategies are `fetchResolver` (default) and `cachedResolver` (`@tdacorp/hyle-sdk/next/use-cache`). */
|
|
4
4
|
type HyleResolver = (path: string, locale: string | undefined, limit?: number, cursor?: string, nav?: "tree", format?: "md") => Promise<Resolved>;
|
package/dist/styles.css
CHANGED
|
@@ -169,6 +169,7 @@
|
|
|
169
169
|
.hyle-item .t{display:block}
|
|
170
170
|
.hyle-item time{font-size:14px;line-height:1.7;color:var(--h-text-muted);font-variant-numeric:tabular-nums}
|
|
171
171
|
.hyle-item h3,.hyle-item .t{display:block;font-family:var(--h-font-heading);font-size:1.25em;line-height:1.3;font-weight:var(--h-heading-weight);letter-spacing:var(--h-heading-tracking)}
|
|
172
|
+
.hyle-item>div:only-child{grid-column:1/-1}
|
|
172
173
|
.hyle-item p{margin-top:4px;color:var(--h-text-muted);font-size:15px;line-height:1.55}
|
|
173
174
|
.hyle-item .tags{display:flex;gap:8px;margin-top:8px}
|
|
174
175
|
@container hyle (max-width:640px){.hyle-item{grid-template-columns:minmax(0,1fr);gap:4px;margin-inline:-8px;padding:16px 8px}.hyle-item .t{display:block}
|
|
@@ -260,6 +261,7 @@ html:has(.hyle-nav-d:popover-open){overflow:hidden}
|
|
|
260
261
|
|
|
261
262
|
/* ---- prose layer: rendered markdown, plain semantic elements ---- */
|
|
262
263
|
.hyle-prose{overflow-wrap:break-word}
|
|
264
|
+
.hyle-prose img{max-width:100%;height:auto}
|
|
263
265
|
.hyle-prose>*+*{margin-top:var(--h-paragraph-gap)}
|
|
264
266
|
.hyle-prose :where(h1,h2,h3,h4){font-family:var(--h-font-heading);font-weight:var(--h-heading-weight);letter-spacing:var(--h-heading-tracking);line-height:1.25;color:var(--h-text);scroll-margin-top:calc(var(--h-sticky-top) + 24px);text-wrap:balance;position:relative}
|
|
265
267
|
.hyle-prose h1{font-size:var(--h-h1-size);line-height:1.15}
|
|
@@ -411,8 +413,15 @@ html:has(.hyle-nav-d:popover-open){overflow:hidden}
|
|
|
411
413
|
|
|
412
414
|
/* ---- additions not in the design kit (the kit mocks these; the real hast needs them) ---- */
|
|
413
415
|
.hyle .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
|
|
414
|
-
.hyle-mermaid iframe{display:block;width:100%;min-height:240px;border:0;background:transparent}
|
|
415
416
|
.hyle-mermaid>pre{padding:16px}
|
|
417
|
+
.hyle-mermaid[data-state=pending]{min-height:240px}
|
|
418
|
+
/* A stored render: the box is reserved by aspect-ratio before the image arrives, so nothing shifts. */
|
|
419
|
+
.hyle-mermaid-frame{position:relative;display:block;margin-inline:auto;width:100%;padding:0;box-sizing:content-box}
|
|
420
|
+
.hyle-mermaid-frame img{display:block;width:100%;height:auto}
|
|
421
|
+
.hyle-mermaid-loader{position:absolute;inset:0 0 auto 0;height:3px;overflow:hidden;background:var(--h-border,GrayText);opacity:.5;z-index:1}
|
|
422
|
+
.hyle-mermaid-loader::after{content:"";position:absolute;inset:0;width:40%;background:var(--h-accent,Highlight);animation:hyle-mermaid-load 1.2s ease-in-out infinite}
|
|
423
|
+
@keyframes hyle-mermaid-load{from{transform:translateX(-100%)}to{transform:translateX(250%)}}
|
|
424
|
+
@media (prefers-reduced-motion:reduce){.hyle-mermaid-loader::after{animation:none;width:100%}}
|
|
416
425
|
/* contain:paint clips the SVG and makes it the containing block of any absolute or fixed descendant, so diagram CSS cannot overlay the host page */
|
|
417
426
|
.hyle-mermaid-svg{display:flex;justify-content:center;padding:16px;contain:paint}
|
|
418
427
|
.hyle-mermaid-svg svg{position:static!important;max-width:100%;height:auto}
|
|
@@ -458,27 +467,7 @@ html.hyle-viewer-lock:has(.hv-shell:fullscreen){scrollbar-gutter:auto}
|
|
|
458
467
|
.hv-view.hv-grabbing{cursor:grabbing}
|
|
459
468
|
/* --hv-k is the current zoom, written by the viewer while something is highlighted: strokes of highlights are divided by it so they keep their on-screen width. */
|
|
460
469
|
.hv-stage{--hv-k:1;position:absolute;top:0;left:0;transform-origin:0 0}
|
|
461
|
-
|
|
462
|
-
.hv-stage .hv-n{cursor:pointer;outline:none}
|
|
463
|
-
.hv-stage .hv-n,.hv-stage .hv-e{transition:opacity .15s}
|
|
464
|
-
@media (prefers-reduced-motion:reduce){.hv-stage .hv-n,.hv-stage .hv-e{transition:none}}
|
|
465
|
-
.hv-stage.hv-plain .hv-n,.hv-stage.hv-plain .hv-e{transition:none}
|
|
466
|
-
.hv-stage.hv-active .hv-n:not(.hv-on),.hv-stage.hv-active .hv-e:not(.hv-on){opacity:var(--hv-dim)}
|
|
467
|
-
.hv-stage .hv-n:focus-visible :is(rect,polygon,circle,ellipse,path){stroke:var(--hv-focus)!important;stroke-width:calc(3px / var(--hv-k,1))!important}
|
|
468
|
-
.hv-stage .hv-n.hv-nb :is(rect,polygon,circle,ellipse,path){stroke:var(--hv-accent)!important;stroke-width:calc(2px / var(--hv-k,1))!important}
|
|
469
|
-
.hv-stage .hv-n.hv-up :is(rect,polygon,circle,ellipse,path){stroke:var(--hv-up)!important;stroke-width:calc(2.5px / var(--hv-k,1))!important}
|
|
470
|
-
.hv-stage .hv-n.hv-down :is(rect,polygon,circle,ellipse,path){stroke:var(--hv-down)!important;stroke-width:calc(2.5px / var(--hv-k,1))!important}
|
|
471
|
-
.hv-stage .hv-n.hv-sel :is(rect,polygon,circle,ellipse,path){stroke:var(--hv-accent)!important;stroke-width:calc(3.5px / var(--hv-k,1))!important}
|
|
472
|
-
.hv-stage .hv-n.hv-hit :is(rect,polygon,circle,ellipse,path){stroke:var(--hv-accent)!important;stroke-width:calc(3px / var(--hv-k,1))!important}
|
|
473
|
-
.hv-stage .hv-n.hv-cur :is(rect,polygon,circle,ellipse,path){stroke-width:calc(5px / var(--hv-k,1))!important}
|
|
474
|
-
.hv-stage text.hv-hit,.hv-stage text.hv-hit tspan{fill:var(--hv-accent)!important;font-weight:700}
|
|
475
|
-
.hv-stage text.hv-cur{text-decoration:underline}
|
|
476
|
-
.hv-stage path.hv-nb{stroke:var(--hv-accent)!important;stroke-width:calc(2.5px / var(--hv-k,1))!important}
|
|
477
|
-
.hv-stage path.hv-up{stroke:var(--hv-up)!important;stroke-width:calc(2.5px / var(--hv-k,1))!important}
|
|
478
|
-
.hv-stage path.hv-down{stroke:var(--hv-down)!important;stroke-width:calc(2.5px / var(--hv-k,1))!important}
|
|
479
|
-
.hv-stage path.hv-flow{stroke-dasharray:calc(7px / var(--hv-k,1)) calc(6px / var(--hv-k,1))!important;animation:hv-dash .9s linear infinite}
|
|
480
|
-
@keyframes hv-dash{to{stroke-dashoffset:calc(-26px / var(--hv-k,1))}}
|
|
481
|
-
@media (prefers-reduced-motion:reduce){.hv-stage path.hv-flow{animation:none}}
|
|
470
|
+
/* The diagram itself lives in the stage's shadow root, so its rules are in viewer/svg-css.ts and the SVG's own <style> cannot reach this page. */
|
|
482
471
|
|
|
483
472
|
.hv-mini{position:absolute;right:12px;bottom:44px;width:176px;height:120px;border:1px solid var(--hv-border);border-radius:var(--h-radius,6px);background:color-mix(in srgb,var(--hv-bg) 88%,transparent);color:var(--hv-muted);accent-color:var(--hv-accent);cursor:crosshair;touch-action:none}
|
|
484
473
|
@media (max-width:640px){.hv-mini{width:120px;height:82px}}
|
|
@@ -52,6 +52,22 @@ type ArticleContent = {
|
|
|
52
52
|
readonly format: "md";
|
|
53
53
|
readonly markdown: string;
|
|
54
54
|
};
|
|
55
|
+
/** The document's authored fields (tags, kicker, status label, cover, author, word count). Absent from an older server. */
|
|
56
|
+
interface DocumentMetaFields {
|
|
57
|
+
readonly tags?: readonly string[];
|
|
58
|
+
readonly kicker?: string | null;
|
|
59
|
+
readonly status?: string | null;
|
|
60
|
+
/** `path` is root-relative (`/assets/<id>`); serve it through the host's asset route. */
|
|
61
|
+
readonly cover?: {
|
|
62
|
+
readonly path: string;
|
|
63
|
+
} | null;
|
|
64
|
+
readonly author?: {
|
|
65
|
+
readonly name: string;
|
|
66
|
+
readonly url: string | null;
|
|
67
|
+
} | null;
|
|
68
|
+
/** Words in the rendered prose (code, title and math excluded), counted by the server. Absent from an older server. */
|
|
69
|
+
readonly word_count?: number | null;
|
|
70
|
+
}
|
|
55
71
|
interface ResolvedArticle {
|
|
56
72
|
readonly cp: 1;
|
|
57
73
|
readonly kind: "article";
|
|
@@ -67,7 +83,7 @@ interface ResolvedArticle {
|
|
|
67
83
|
readonly published_at: string;
|
|
68
84
|
readonly updated_at: string;
|
|
69
85
|
readonly locale: string;
|
|
70
|
-
};
|
|
86
|
+
} & DocumentMetaFields;
|
|
71
87
|
readonly content: ArticleContent;
|
|
72
88
|
readonly frontmatter: Record<string, unknown>;
|
|
73
89
|
readonly toc: readonly TocEntry[];
|
|
@@ -84,7 +100,7 @@ interface ResolvedArticle {
|
|
|
84
100
|
readonly fallback?: Fallback;
|
|
85
101
|
readonly cache: CacheInfo;
|
|
86
102
|
}
|
|
87
|
-
interface ListItem {
|
|
103
|
+
interface ListItem extends DocumentMetaFields {
|
|
88
104
|
readonly slug: string;
|
|
89
105
|
readonly title: string;
|
|
90
106
|
readonly description: string | null;
|
|
@@ -206,4 +222,4 @@ interface EngageListing {
|
|
|
206
222
|
readonly mine_held?: readonly EngageHeldComment[];
|
|
207
223
|
}
|
|
208
224
|
|
|
209
|
-
export type { Alternate as A, Breadcrumb as B, CacheInfo as C, EngageComment as E, Fallback as F, ListItem as L, MountsResult as M, NavItem as N, Resolved as R, TocEntry as T, ArticleContent as a, EngageHeldComment as b, EngageListing as c, Mount as d, Mounts as e, NavNode as f, NavTree as g, ResolvedArticle as h, ResolvedDisabled as i, ResolvedList as j, ResolvedNotFound as k, ResolvedRedirect as l };
|
|
225
|
+
export type { Alternate as A, Breadcrumb as B, CacheInfo as C, DocumentMetaFields as D, EngageComment as E, Fallback as F, ListItem as L, MountsResult as M, NavItem as N, Resolved as R, TocEntry as T, ArticleContent as a, EngageHeldComment as b, EngageListing as c, Mount as d, Mounts as e, NavNode as f, NavTree as g, ResolvedArticle as h, ResolvedDisabled as i, ResolvedList as j, ResolvedNotFound as k, ResolvedRedirect as l };
|
|
@@ -52,6 +52,22 @@ type ArticleContent = {
|
|
|
52
52
|
readonly format: "md";
|
|
53
53
|
readonly markdown: string;
|
|
54
54
|
};
|
|
55
|
+
/** The document's authored fields (tags, kicker, status label, cover, author, word count). Absent from an older server. */
|
|
56
|
+
interface DocumentMetaFields {
|
|
57
|
+
readonly tags?: readonly string[];
|
|
58
|
+
readonly kicker?: string | null;
|
|
59
|
+
readonly status?: string | null;
|
|
60
|
+
/** `path` is root-relative (`/assets/<id>`); serve it through the host's asset route. */
|
|
61
|
+
readonly cover?: {
|
|
62
|
+
readonly path: string;
|
|
63
|
+
} | null;
|
|
64
|
+
readonly author?: {
|
|
65
|
+
readonly name: string;
|
|
66
|
+
readonly url: string | null;
|
|
67
|
+
} | null;
|
|
68
|
+
/** Words in the rendered prose (code, title and math excluded), counted by the server. Absent from an older server. */
|
|
69
|
+
readonly word_count?: number | null;
|
|
70
|
+
}
|
|
55
71
|
interface ResolvedArticle {
|
|
56
72
|
readonly cp: 1;
|
|
57
73
|
readonly kind: "article";
|
|
@@ -67,7 +83,7 @@ interface ResolvedArticle {
|
|
|
67
83
|
readonly published_at: string;
|
|
68
84
|
readonly updated_at: string;
|
|
69
85
|
readonly locale: string;
|
|
70
|
-
};
|
|
86
|
+
} & DocumentMetaFields;
|
|
71
87
|
readonly content: ArticleContent;
|
|
72
88
|
readonly frontmatter: Record<string, unknown>;
|
|
73
89
|
readonly toc: readonly TocEntry[];
|
|
@@ -84,7 +100,7 @@ interface ResolvedArticle {
|
|
|
84
100
|
readonly fallback?: Fallback;
|
|
85
101
|
readonly cache: CacheInfo;
|
|
86
102
|
}
|
|
87
|
-
interface ListItem {
|
|
103
|
+
interface ListItem extends DocumentMetaFields {
|
|
88
104
|
readonly slug: string;
|
|
89
105
|
readonly title: string;
|
|
90
106
|
readonly description: string | null;
|
|
@@ -206,4 +222,4 @@ interface EngageListing {
|
|
|
206
222
|
readonly mine_held?: readonly EngageHeldComment[];
|
|
207
223
|
}
|
|
208
224
|
|
|
209
|
-
export type { Alternate as A, Breadcrumb as B, CacheInfo as C, EngageComment as E, Fallback as F, ListItem as L, MountsResult as M, NavItem as N, Resolved as R, TocEntry as T, ArticleContent as a, EngageHeldComment as b, EngageListing as c, Mount as d, Mounts as e, NavNode as f, NavTree as g, ResolvedArticle as h, ResolvedDisabled as i, ResolvedList as j, ResolvedNotFound as k, ResolvedRedirect as l };
|
|
225
|
+
export type { Alternate as A, Breadcrumb as B, CacheInfo as C, DocumentMetaFields as D, EngageComment as E, Fallback as F, ListItem as L, MountsResult as M, NavItem as N, Resolved as R, TocEntry as T, ArticleContent as a, EngageHeldComment as b, EngageListing as c, Mount as d, Mounts as e, NavNode as f, NavTree as g, ResolvedArticle as h, ResolvedDisabled as i, ResolvedList as j, ResolvedNotFound as k, ResolvedRedirect as l };
|
package/dist/use-cache.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HyleResolver } from './resolve-
|
|
2
|
-
import './types-
|
|
1
|
+
import { H as HyleResolver } from './resolve-euZ4-aC9.cjs';
|
|
2
|
+
import './types-Czt887Iv.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The exact caching strategy: a `'use cache'` function that fetches, then tags its own entry with the tags the response
|
package/dist/use-cache.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HyleResolver } from './resolve-
|
|
2
|
-
import './types-
|
|
1
|
+
import { H as HyleResolver } from './resolve-Ae7UFjsQ.js';
|
|
2
|
+
import './types-Czt887Iv.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The exact caching strategy: a `'use cache'` function that fetches, then tags its own entry with the tags the response
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tdacorp/hyle-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "hyle SDK: a typed client for hyle's resolve endpoint, a hast renderer for React, and a Next.js catch-all page with tag-based revalidation.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|