@tdacorp/hyle-sdk 0.24.0 → 0.26.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.
Files changed (46) hide show
  1. package/README.md +7 -5
  2. package/dist/{embed-B7T--kTT.d.cts → brand-CwXvdSkk.d.ts} +14 -2
  3. package/dist/{embed-DavTgSU4.d.ts → brand-IuZSB9UX.d.cts} +14 -2
  4. package/dist/check-routes-bin.js +10 -5
  5. package/dist/{chunk-4REU4HJI.js → chunk-3UQGU62T.js} +22 -5
  6. package/dist/{chunk-SY2FMIRZ.js → chunk-IDBQSMWT.js} +1 -1
  7. package/dist/{chunk-5TKJH2XC.js → chunk-NUQQ6VHH.js} +267 -43
  8. package/dist/{chunk-Y3BACEWA.js → chunk-T4EZAQFU.js} +129 -3
  9. package/dist/chunk-VAR2B7S6.js +82 -0
  10. package/dist/{chunk-U74B7AUG.js → chunk-ZWKAEWEW.js} +22 -74
  11. package/dist/{client-BErei7cE.d.ts → client-B2zi_BGq.d.ts} +11 -4
  12. package/dist/{client-DrB2vcTi.d.cts → client-DBZTvcCh.d.cts} +11 -4
  13. package/dist/comments.cjs +25 -1
  14. package/dist/comments.js +4 -2
  15. package/dist/html.cjs +129 -3
  16. package/dist/html.js +1 -1
  17. package/dist/index.cjs +22 -5
  18. package/dist/index.d.cts +4 -4
  19. package/dist/index.d.ts +4 -4
  20. package/dist/index.js +1 -1
  21. package/dist/next.cjs +674 -211
  22. package/dist/next.d.cts +44 -18
  23. package/dist/next.d.ts +44 -18
  24. package/dist/next.js +241 -135
  25. package/dist/react.cjs +401 -46
  26. package/dist/react.d.cts +114 -4
  27. package/dist/react.d.ts +114 -4
  28. package/dist/react.js +14 -4
  29. package/dist/reactions.cjs +25 -1
  30. package/dist/reactions.js +4 -2
  31. package/dist/{resolve-03IVloXU.d.cts → resolve-0nGnsIHo.d.cts} +1 -1
  32. package/dist/{resolve-BseM68oy.d.ts → resolve-CguSaZLa.d.ts} +1 -1
  33. package/dist/{revalidation-callback-BQl77tQR.d.cts → revalidation-callback-FT9ik1dh.d.cts} +11 -0
  34. package/dist/{revalidation-callback-BQl77tQR.d.ts → revalidation-callback-FT9ik1dh.d.ts} +11 -0
  35. package/dist/share-client.cjs +498 -0
  36. package/dist/share-client.d.cts +99 -0
  37. package/dist/share-client.d.ts +99 -0
  38. package/dist/share-client.js +390 -0
  39. package/dist/styles.css +176 -1
  40. package/dist/{types-Dx-fEiZd.d.cts → types-CdaIzSjg.d.cts} +10 -3
  41. package/dist/{types-Dx-fEiZd.d.ts → types-CdaIzSjg.d.ts} +10 -3
  42. package/dist/use-cache.cjs +10 -5
  43. package/dist/use-cache.d.cts +3 -3
  44. package/dist/use-cache.d.ts +3 -3
  45. package/dist/use-cache.js +2 -2
  46. 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, ReactNode } from 'react';
3
- import { H as HyleComponents, P as PageBaseProps, E as EngagementConfig, J as JsonLdConfig } from './embed-B7T--kTT.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-B7T--kTT.cjs';
3
+ import { H as HyleComponents, P as PageBaseProps, E as EngagementConfig, J as JsonLdConfig, S as ShareHost } from './brand-IuZSB9UX.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 './brand-IuZSB9UX.cjs';
5
5
  export { H as HastLimitError, i as isSafeUrl, s as sanitizeHast, a as scopeId } from './sanitize-BpY_AdZh.cjs';
6
- import { m as ResolvedArticle, L as ListItem, r as TocEntry, o as ResolvedList, c as EngageListing, T as ThemeRef } from './types-Dx-fEiZd.cjs';
6
+ import { n as ResolvedArticle, L as ListItem, s as TocEntry, p as ResolvedList, c as EngageListing, T as ThemeRef } from './types-CdaIzSjg.cjs';
7
7
  import 'hast';
8
8
 
9
9
  interface HastContentProps {
@@ -296,6 +296,48 @@ declare const en: {
296
296
  unBody: string;
297
297
  viewer: ViewerLabels;
298
298
  comments: CommentStrings;
299
+ share: {
300
+ protectedTag: string;
301
+ lock: string;
302
+ lockTitle: string;
303
+ searchLabel: string;
304
+ searchHint: string;
305
+ searchNone: string;
306
+ searchScope: string;
307
+ searchCount: string;
308
+ searchOne: string;
309
+ open: string;
310
+ close: string;
311
+ documents: string;
312
+ documentCount: string;
313
+ documentPosition: string;
314
+ privateCopy: string;
315
+ noExpiry: string;
316
+ expires: string;
317
+ expiresSoon: string;
318
+ expired: string;
319
+ endedNotice: string;
320
+ soonNotice: string;
321
+ gateTitle: string;
322
+ gateBody: string;
323
+ gateWrong: string;
324
+ gatePassword: string;
325
+ gateOpen: string;
326
+ locked: string;
327
+ attemptsTitle: string;
328
+ attemptsBody: string;
329
+ attemptsOne: string;
330
+ unavailableTitle: string;
331
+ unavailableBody: string;
332
+ theme: string;
333
+ themeLight: string;
334
+ themeDark: string;
335
+ themeSystem: string;
336
+ showDocuments: string;
337
+ hideDocuments: string;
338
+ closeDocuments: string;
339
+ skip: string;
340
+ };
299
341
  };
300
342
  type Strings = typeof en;
301
343
  /** Strings for a BCP 47 tag; the primary subtag decides, anything unknown falls back to English. */
@@ -421,6 +463,74 @@ declare function HyleReactions(props: HyleReactionsProps): ReactElement;
421
463
 
422
464
  declare function DocsPage({ article, ...base }: ArticlePageProps): ReactElement;
423
465
 
466
+ /** The protected share chrome's pure parts: expiry states, dates, theme and list cookies. Shared by the server and the client islands. */
467
+ /** The viewer's theme choice (ADR 0040 chrome, decision 120). `system` is no cookie: the OS decides. */
468
+ type ShareThemeChoice = "light" | "dark" | "system";
469
+ /** The cookie that holds the theme choice. The same name hyle's own app reads, so one choice drives both hosts. */
470
+ declare const THEME_COOKIE = "hyle_theme";
471
+ /** The cookie that holds the document list state (`open` or `closed`), read on the server so there is no flash. */
472
+ declare const SIDE_COOKIE = "hyle_share_side";
473
+ /** The theme a cookie value names; anything else is `system`. */
474
+ declare function themeFromCookie(value: string | undefined): ShareThemeChoice;
475
+
476
+ /** A document of a share, as hyle reports it (`documents[]`). `description` is the document's first paragraph, when hyle sends it. */
477
+ interface ShareDocument {
478
+ readonly doc_slug: string;
479
+ readonly title: string;
480
+ readonly description?: string | null;
481
+ readonly position: number;
482
+ }
483
+ interface ShareChromeProps extends PageBaseProps {
484
+ /** The share's name: shown only once the password is right. */
485
+ readonly name: string;
486
+ /** When the share stops working, or null for none. */
487
+ readonly expiresAt: string | null;
488
+ /** The share's documents; the list is drawn in `position` order. */
489
+ readonly documents: readonly ShareDocument[];
490
+ /** The document on screen, drawn with the same `Body` a docs page uses. */
491
+ readonly article: ResolvedArticle;
492
+ /** The slug of `article`. */
493
+ readonly docSlug: string;
494
+ /** The host's logo and name (the `host` option of `drawProtectedShare`). */
495
+ readonly host?: ShareHost | undefined;
496
+ readonly theme?: ShareThemeChoice | undefined;
497
+ /** The list state from its cookie: false when the reader folded it away. */
498
+ readonly sidebarOpen?: boolean | undefined;
499
+ /** Whether `data-theme` on `<html>` follows the theme too (hyle's own host). */
500
+ readonly htmlTheme?: boolean | undefined;
501
+ /** The link of one of the share's documents. */
502
+ readonly hrefFor: (docSlug: string) => string;
503
+ /** Where the lock form posts, and the share slug it carries. */
504
+ readonly lockAction: string;
505
+ readonly slug: string;
506
+ /** The clock the expiry states are read at (injected for tests); defaults to now. */
507
+ readonly now?: number | undefined;
508
+ }
509
+ /** The protected share page: the bar, the document list, the article and its contents. Every state of the kit is drawn here. */
510
+ declare function ShareChrome(props: ShareChromeProps): ReactElement;
511
+
512
+ /**
513
+ * The gate's states (decisions 117 to 119): the password form, the same form with a wrong password, the form with a "Locked" toast
514
+ * after a lock, too many attempts, and "not available" (the same card for unknown, revoked and ended shares, so it says nothing more).
515
+ */
516
+ type ShareGateState = "password" | "wrong" | "locked" | "attempts" | "unavailable";
517
+ interface ShareGateProps extends PageBaseProps {
518
+ readonly state: ShareGateState;
519
+ /** The share slug the form carries. The gate shows no share name: it is behind the password. */
520
+ readonly slug: string;
521
+ /** Where the password form posts. */
522
+ readonly unlockAction: string;
523
+ /** The document the visitor asked for, carried through the form so the visitor lands on it after the password. */
524
+ readonly docSlug?: string | undefined;
525
+ /** Seconds to wait, for the attempts state. */
526
+ readonly retryAfterSeconds?: number | undefined;
527
+ readonly host?: ShareHost | undefined;
528
+ readonly theme?: ShareThemeChoice | undefined;
529
+ readonly htmlTheme?: boolean | undefined;
530
+ }
531
+ /** The gate: the host's brand and the theme in the bar, one centred card. The form works without JavaScript. */
532
+ declare function ShareGate({ state, slug, unlockAction, docSlug, retryAfterSeconds, host, theme, htmlTheme, ...base }: ShareGateProps): ReactElement;
533
+
424
534
  /**
425
535
  * Links a themed workspace's stylesheet (hyle ADR 0036) from the host's own asset route (`createAssetRoute`), so a strict
426
536
  * `style-src 'self'` and `font-src 'self'` CSP is enough. `precedence` makes React 19 put the link in the head and hold the
@@ -432,4 +542,4 @@ declare function HyleTheme({ theme }: {
432
542
  theme?: ThemeRef | undefined;
433
543
  }): ReactElement | null;
434
544
 
435
- export { ArticlePage, type ArticlePageProps, Comments, type CommentsProps, DocsPage, EngagementConfig, HastContent, type HastContentProps, HyleBody, type HyleBodyProps, HyleComponents, HyleReactions, type HyleReactionsProps, HyleTheme, HyleToc, type HyleTocProps, JsonLdConfig, ListPage, type ListPageProps, MermaidDiagram, type MermaidDiagramProps, NotFound, type NotFoundProps, PageBaseProps, Redirecting, type RedirectingProps, type Strings, TrustedServerHtml, Unavailable, VIEWER_LABELS_EN, type ViewerLabels, holdPrintUntil, installPrintShortcut, isClampedSource, isLargeDiagram, stringsFor, stripMermaidConfig };
545
+ export { ArticlePage, type ArticlePageProps, Comments, type CommentsProps, DocsPage, EngagementConfig, HastContent, type HastContentProps, HyleBody, type HyleBodyProps, HyleComponents, HyleReactions, type HyleReactionsProps, HyleTheme, HyleToc, type HyleTocProps, JsonLdConfig, ListPage, type ListPageProps, MermaidDiagram, type MermaidDiagramProps, NotFound, type NotFoundProps, PageBaseProps, Redirecting, type RedirectingProps, SIDE_COOKIE, ShareChrome, type ShareChromeProps, type ShareDocument, ShareGate, type ShareGateProps, type ShareGateState, ShareHost, type ShareThemeChoice, type Strings, THEME_COOKIE, TrustedServerHtml, Unavailable, VIEWER_LABELS_EN, type ViewerLabels, holdPrintUntil, installPrintShortcut, isClampedSource, isLargeDiagram, stringsFor, stripMermaidConfig, themeFromCookie };
package/dist/react.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as react from 'react';
2
2
  import { ReactElement, ReactNode } from 'react';
3
- import { H as HyleComponents, P as PageBaseProps, E as EngagementConfig, J as JsonLdConfig } from './embed-DavTgSU4.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-DavTgSU4.js';
3
+ import { H as HyleComponents, P as PageBaseProps, E as EngagementConfig, J as JsonLdConfig, S as ShareHost } from './brand-CwXvdSkk.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 './brand-CwXvdSkk.js';
5
5
  export { H as HastLimitError, i as isSafeUrl, s as sanitizeHast, a as scopeId } from './sanitize-BpY_AdZh.js';
6
- import { m as ResolvedArticle, L as ListItem, r as TocEntry, o as ResolvedList, c as EngageListing, T as ThemeRef } from './types-Dx-fEiZd.js';
6
+ import { n as ResolvedArticle, L as ListItem, s as TocEntry, p as ResolvedList, c as EngageListing, T as ThemeRef } from './types-CdaIzSjg.js';
7
7
  import 'hast';
8
8
 
9
9
  interface HastContentProps {
@@ -296,6 +296,48 @@ declare const en: {
296
296
  unBody: string;
297
297
  viewer: ViewerLabels;
298
298
  comments: CommentStrings;
299
+ share: {
300
+ protectedTag: string;
301
+ lock: string;
302
+ lockTitle: string;
303
+ searchLabel: string;
304
+ searchHint: string;
305
+ searchNone: string;
306
+ searchScope: string;
307
+ searchCount: string;
308
+ searchOne: string;
309
+ open: string;
310
+ close: string;
311
+ documents: string;
312
+ documentCount: string;
313
+ documentPosition: string;
314
+ privateCopy: string;
315
+ noExpiry: string;
316
+ expires: string;
317
+ expiresSoon: string;
318
+ expired: string;
319
+ endedNotice: string;
320
+ soonNotice: string;
321
+ gateTitle: string;
322
+ gateBody: string;
323
+ gateWrong: string;
324
+ gatePassword: string;
325
+ gateOpen: string;
326
+ locked: string;
327
+ attemptsTitle: string;
328
+ attemptsBody: string;
329
+ attemptsOne: string;
330
+ unavailableTitle: string;
331
+ unavailableBody: string;
332
+ theme: string;
333
+ themeLight: string;
334
+ themeDark: string;
335
+ themeSystem: string;
336
+ showDocuments: string;
337
+ hideDocuments: string;
338
+ closeDocuments: string;
339
+ skip: string;
340
+ };
299
341
  };
300
342
  type Strings = typeof en;
301
343
  /** Strings for a BCP 47 tag; the primary subtag decides, anything unknown falls back to English. */
@@ -421,6 +463,74 @@ declare function HyleReactions(props: HyleReactionsProps): ReactElement;
421
463
 
422
464
  declare function DocsPage({ article, ...base }: ArticlePageProps): ReactElement;
423
465
 
466
+ /** The protected share chrome's pure parts: expiry states, dates, theme and list cookies. Shared by the server and the client islands. */
467
+ /** The viewer's theme choice (ADR 0040 chrome, decision 120). `system` is no cookie: the OS decides. */
468
+ type ShareThemeChoice = "light" | "dark" | "system";
469
+ /** The cookie that holds the theme choice. The same name hyle's own app reads, so one choice drives both hosts. */
470
+ declare const THEME_COOKIE = "hyle_theme";
471
+ /** The cookie that holds the document list state (`open` or `closed`), read on the server so there is no flash. */
472
+ declare const SIDE_COOKIE = "hyle_share_side";
473
+ /** The theme a cookie value names; anything else is `system`. */
474
+ declare function themeFromCookie(value: string | undefined): ShareThemeChoice;
475
+
476
+ /** A document of a share, as hyle reports it (`documents[]`). `description` is the document's first paragraph, when hyle sends it. */
477
+ interface ShareDocument {
478
+ readonly doc_slug: string;
479
+ readonly title: string;
480
+ readonly description?: string | null;
481
+ readonly position: number;
482
+ }
483
+ interface ShareChromeProps extends PageBaseProps {
484
+ /** The share's name: shown only once the password is right. */
485
+ readonly name: string;
486
+ /** When the share stops working, or null for none. */
487
+ readonly expiresAt: string | null;
488
+ /** The share's documents; the list is drawn in `position` order. */
489
+ readonly documents: readonly ShareDocument[];
490
+ /** The document on screen, drawn with the same `Body` a docs page uses. */
491
+ readonly article: ResolvedArticle;
492
+ /** The slug of `article`. */
493
+ readonly docSlug: string;
494
+ /** The host's logo and name (the `host` option of `drawProtectedShare`). */
495
+ readonly host?: ShareHost | undefined;
496
+ readonly theme?: ShareThemeChoice | undefined;
497
+ /** The list state from its cookie: false when the reader folded it away. */
498
+ readonly sidebarOpen?: boolean | undefined;
499
+ /** Whether `data-theme` on `<html>` follows the theme too (hyle's own host). */
500
+ readonly htmlTheme?: boolean | undefined;
501
+ /** The link of one of the share's documents. */
502
+ readonly hrefFor: (docSlug: string) => string;
503
+ /** Where the lock form posts, and the share slug it carries. */
504
+ readonly lockAction: string;
505
+ readonly slug: string;
506
+ /** The clock the expiry states are read at (injected for tests); defaults to now. */
507
+ readonly now?: number | undefined;
508
+ }
509
+ /** The protected share page: the bar, the document list, the article and its contents. Every state of the kit is drawn here. */
510
+ declare function ShareChrome(props: ShareChromeProps): ReactElement;
511
+
512
+ /**
513
+ * The gate's states (decisions 117 to 119): the password form, the same form with a wrong password, the form with a "Locked" toast
514
+ * after a lock, too many attempts, and "not available" (the same card for unknown, revoked and ended shares, so it says nothing more).
515
+ */
516
+ type ShareGateState = "password" | "wrong" | "locked" | "attempts" | "unavailable";
517
+ interface ShareGateProps extends PageBaseProps {
518
+ readonly state: ShareGateState;
519
+ /** The share slug the form carries. The gate shows no share name: it is behind the password. */
520
+ readonly slug: string;
521
+ /** Where the password form posts. */
522
+ readonly unlockAction: string;
523
+ /** The document the visitor asked for, carried through the form so the visitor lands on it after the password. */
524
+ readonly docSlug?: string | undefined;
525
+ /** Seconds to wait, for the attempts state. */
526
+ readonly retryAfterSeconds?: number | undefined;
527
+ readonly host?: ShareHost | undefined;
528
+ readonly theme?: ShareThemeChoice | undefined;
529
+ readonly htmlTheme?: boolean | undefined;
530
+ }
531
+ /** The gate: the host's brand and the theme in the bar, one centred card. The form works without JavaScript. */
532
+ declare function ShareGate({ state, slug, unlockAction, docSlug, retryAfterSeconds, host, theme, htmlTheme, ...base }: ShareGateProps): ReactElement;
533
+
424
534
  /**
425
535
  * Links a themed workspace's stylesheet (hyle ADR 0036) from the host's own asset route (`createAssetRoute`), so a strict
426
536
  * `style-src 'self'` and `font-src 'self'` CSP is enough. `precedence` makes React 19 put the link in the head and hold the
@@ -432,4 +542,4 @@ declare function HyleTheme({ theme }: {
432
542
  theme?: ThemeRef | undefined;
433
543
  }): ReactElement | null;
434
544
 
435
- export { ArticlePage, type ArticlePageProps, Comments, type CommentsProps, DocsPage, EngagementConfig, HastContent, type HastContentProps, HyleBody, type HyleBodyProps, HyleComponents, HyleReactions, type HyleReactionsProps, HyleTheme, HyleToc, type HyleTocProps, JsonLdConfig, ListPage, type ListPageProps, MermaidDiagram, type MermaidDiagramProps, NotFound, type NotFoundProps, PageBaseProps, Redirecting, type RedirectingProps, type Strings, TrustedServerHtml, Unavailable, VIEWER_LABELS_EN, type ViewerLabels, holdPrintUntil, installPrintShortcut, isClampedSource, isLargeDiagram, stringsFor, stripMermaidConfig };
545
+ export { ArticlePage, type ArticlePageProps, Comments, type CommentsProps, DocsPage, EngagementConfig, HastContent, type HastContentProps, HyleBody, type HyleBodyProps, HyleComponents, HyleReactions, type HyleReactionsProps, HyleTheme, HyleToc, type HyleTocProps, JsonLdConfig, ListPage, type ListPageProps, MermaidDiagram, type MermaidDiagramProps, NotFound, type NotFoundProps, PageBaseProps, Redirecting, type RedirectingProps, SIDE_COOKIE, ShareChrome, type ShareChromeProps, type ShareDocument, ShareGate, type ShareGateProps, type ShareGateState, ShareHost, type ShareThemeChoice, type Strings, THEME_COOKIE, TrustedServerHtml, Unavailable, VIEWER_LABELS_EN, type ViewerLabels, holdPrintUntil, installPrintShortcut, isClampedSource, isLargeDiagram, stringsFor, stripMermaidConfig, themeFromCookie };
package/dist/react.js CHANGED
@@ -13,14 +13,19 @@ import {
13
13
  MermaidDiagram,
14
14
  NotFound,
15
15
  Redirecting,
16
+ SIDE_COOKIE,
17
+ ShareChrome,
18
+ ShareGate,
19
+ THEME_COOKIE,
16
20
  TrustedServerHtml,
17
21
  Unavailable,
18
22
  holdPrintUntil,
19
23
  installPrintShortcut,
20
24
  isClampedSource,
21
25
  isLargeDiagram,
22
- stripMermaidConfig
23
- } from "./chunk-5TKJH2XC.js";
26
+ stripMermaidConfig,
27
+ themeFromCookie
28
+ } from "./chunk-NUQQ6VHH.js";
24
29
  import {
25
30
  HastLimitError,
26
31
  VIEWER_LABELS_EN,
@@ -28,7 +33,7 @@ import {
28
33
  sanitizeHast,
29
34
  scopeId,
30
35
  stringsFor
31
- } from "./chunk-Y3BACEWA.js";
36
+ } from "./chunk-T4EZAQFU.js";
32
37
  import "./chunk-BDFMNY76.js";
33
38
  export {
34
39
  ArticlePage,
@@ -46,6 +51,10 @@ export {
46
51
  MermaidDiagram,
47
52
  NotFound,
48
53
  Redirecting,
54
+ SIDE_COOKIE,
55
+ ShareChrome,
56
+ ShareGate,
57
+ THEME_COOKIE,
49
58
  TrustedServerHtml,
50
59
  Unavailable,
51
60
  VIEWER_LABELS_EN,
@@ -57,5 +66,6 @@ export {
57
66
  sanitizeHast,
58
67
  scopeId,
59
68
  stringsFor,
60
- stripMermaidConfig
69
+ stripMermaidConfig,
70
+ themeFromCookie
61
71
  };
@@ -490,7 +490,31 @@ var SHAPES = {
490
490
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "8", cy: "8", r: "6" }),
491
491
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m3.8 12.2 8.4-8.4" })
492
492
  ] }),
493
- refresh: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M13 8a5 5 0 1 1-1.6-3.7M13 2.5v2.8h-2.8" })
493
+ refresh: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M13 8a5 5 0 1 1-1.6-3.7M13 2.5v2.8h-2.8" }),
494
+ lock: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
495
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "3", y: "7", width: "10", height: "7", rx: "1.3" }),
496
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M5.2 7V5a2.8 2.8 0 0 1 5.6 0v2" })
497
+ ] }),
498
+ search: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
499
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "7", cy: "7", r: "4.5" }),
500
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m10.5 10.5 3.5 3.5" })
501
+ ] }),
502
+ sun: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
503
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "8", cy: "8", r: "2.8" }),
504
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 1.5v1.8M8 12.7v1.8M1.5 8h1.8M12.7 8h1.8M3.4 3.4l1.3 1.3M11.3 11.3l1.3 1.3M3.4 12.6l1.3-1.3M11.3 4.7l1.3-1.3" })
505
+ ] }),
506
+ moon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M13 9.4A5.6 5.6 0 0 1 6.6 3a5.6 5.6 0 1 0 6.4 6.4z" }),
507
+ monitor: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
508
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "2", y: "3", width: "12", height: "8", rx: "1.3" }),
509
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M6 14h4M8 11v3" })
510
+ ] }),
511
+ sidebar: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
512
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "2", y: "3", width: "12", height: "10", rx: "1.3" }),
513
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M6.5 3v10" })
514
+ ] }),
515
+ shield: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 1.5 2.5 3.6v4c0 3.2 2.3 5.4 5.5 6.9 3.2-1.5 5.5-3.7 5.5-6.9v-4z" }),
516
+ "arrow-left": /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M13 8H3M7 4 3 8l4 4" }),
517
+ menu: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2.5 4.5h11M2.5 8h11M2.5 11.5h11" })
494
518
  };
495
519
  function Icon({ name, className }) {
496
520
  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] });
package/dist/reactions.js CHANGED
@@ -1,13 +1,15 @@
1
1
  "use client";
2
2
  import {
3
- Icon,
4
3
  ReactionBar,
5
4
  call,
6
5
  fetchPages,
7
6
  isObject,
8
7
  kindName,
9
8
  useReactions
10
- } from "./chunk-U74B7AUG.js";
9
+ } from "./chunk-ZWKAEWEW.js";
10
+ import {
11
+ Icon
12
+ } from "./chunk-VAR2B7S6.js";
11
13
 
12
14
  // src/react/reactions.tsx
13
15
  import { useEffect, useState } from "react";
@@ -1,4 +1,4 @@
1
- import { l as Resolved } from './types-Dx-fEiZd.cjs';
1
+ import { m as Resolved } from './types-CdaIzSjg.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>;
@@ -1,4 +1,4 @@
1
- import { l as Resolved } from './types-Dx-fEiZd.js';
1
+ import { m as Resolved } from './types-CdaIzSjg.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>;
@@ -35,6 +35,12 @@ interface RevalidationPayload {
35
35
  readonly epoch: number;
36
36
  readonly tags: readonly string[];
37
37
  readonly paths?: readonly string[];
38
+ readonly index_urls?: readonly IndexUrl[];
39
+ }
40
+ /** An address hyle says a search engine should re-read (docs/cp1-spec.md section 5.3.5). `locale` is the document's. */
41
+ interface IndexUrl {
42
+ readonly path: string;
43
+ readonly locale: string;
38
44
  }
39
45
  interface RevalidationCallbackOptions {
40
46
  /** This deployment's own configured workspace -- a mismatched payload is ignored (step 5), never rejected. */
@@ -56,6 +62,11 @@ interface RevalidationCallbackOptions {
56
62
  * Put work that must not be lost on your own queue here.
57
63
  */
58
64
  readonly onCommentEvent?: ((event: CommentEvent) => void | Promise<void>) | undefined;
65
+ /**
66
+ * Called with the delivery's valid `index_urls` once its purge succeeded (not on a dedupe hit, so a redelivery submits
67
+ * nothing twice). Must not wait on anything: the answer is already decided. A throw is logged and never changes the answer.
68
+ */
69
+ readonly onIndexUrls?: ((urls: readonly IndexUrl[]) => void) | undefined;
59
70
  readonly toleranceSeconds?: number;
60
71
  readonly dedupeCapacity?: number;
61
72
  /** Injectable for tests; defaults to the real wall clock. */
@@ -35,6 +35,12 @@ interface RevalidationPayload {
35
35
  readonly epoch: number;
36
36
  readonly tags: readonly string[];
37
37
  readonly paths?: readonly string[];
38
+ readonly index_urls?: readonly IndexUrl[];
39
+ }
40
+ /** An address hyle says a search engine should re-read (docs/cp1-spec.md section 5.3.5). `locale` is the document's. */
41
+ interface IndexUrl {
42
+ readonly path: string;
43
+ readonly locale: string;
38
44
  }
39
45
  interface RevalidationCallbackOptions {
40
46
  /** This deployment's own configured workspace -- a mismatched payload is ignored (step 5), never rejected. */
@@ -56,6 +62,11 @@ interface RevalidationCallbackOptions {
56
62
  * Put work that must not be lost on your own queue here.
57
63
  */
58
64
  readonly onCommentEvent?: ((event: CommentEvent) => void | Promise<void>) | undefined;
65
+ /**
66
+ * Called with the delivery's valid `index_urls` once its purge succeeded (not on a dedupe hit, so a redelivery submits
67
+ * nothing twice). Must not wait on anything: the answer is already decided. A throw is logged and never changes the answer.
68
+ */
69
+ readonly onIndexUrls?: ((urls: readonly IndexUrl[]) => void) | undefined;
59
70
  readonly toleranceSeconds?: number;
60
71
  readonly dedupeCapacity?: number;
61
72
  /** Injectable for tests; defaults to the real wall clock. */