hono-decks 1.4.3 → 1.4.5
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.ja.md +1 -1
- package/README.md +1 -1
- package/dist/adapters/hono-markdown.d.ts +3 -7
- package/dist/adapters/hono-markdown.js +1 -2
- package/dist/advanced.d.ts +25 -57
- package/dist/advanced.js +23 -43
- package/dist/bin.js +32 -52
- package/dist/cli.d.ts +2 -4
- package/dist/cli.js +32 -52
- package/dist/client.d.ts +2 -6
- package/dist/client.js +1 -2
- package/dist/{file-transaction-NjDxX6Gt.js → file-transaction-BmX5WaTf.js} +2 -4
- package/dist/honox.d.ts +3 -6
- package/dist/honox.js +2 -4
- package/dist/{init-vite-BPRPonCD.js → init-vite-C1HAF3GF.js} +9 -13
- package/dist/mod.d.ts +7 -31
- package/dist/mod.js +10 -17
- package/dist/node.d.ts +25 -75
- package/dist/node.js +60 -107
- package/dist/vite.d.ts +3 -6
- package/dist/vite.js +31 -52
- package/package.json +7 -7
- package/skills/hono-decks/SKILL.md +20 -8
- package/skills/hono-decks/references/integrating.md +20 -10
- package/skills/hono-decks/references/r2-assets.md +13 -10
package/README.ja.md
CHANGED
|
@@ -78,7 +78,7 @@ npm run build
|
|
|
78
78
|
`yaml@^2.9.1 shiki@^4.5.0 @shikijs/transformers@^4.5.0`。
|
|
79
79
|
|
|
80
80
|
新しい導入では `@ts-76/hono-markdown` 0.2.1以降がパーサー2パッケージを自動導入します。利用者側で `markdown-exit`・`markdown-it-container` を追加する必要はありません。既存Void 1.1用の0.6アダプターでは従来のpeer依存をinitが補完します。
|
|
81
|
-
動作確認した組み合わせは Node >=24.22.1 <25、Void 1.2.1、Vite 8.3.4、Hono 4.13.
|
|
81
|
+
動作確認した組み合わせは Node >=24.22.1 <25、Void 1.2.1、Vite 8.3.4、Hono 4.13.16 です。既存のVoid 1.1.11アプリでは互換性のある0.6アダプターを維持し、未導入の場合も0.6を選択します。0.9.1では[Void/Cloudflare依存の既知リスク](https://github.com/ts-76/void-plugin-hono-jsx/blob/v0.9.1/docs/dependency-security.md)が残ります。
|
|
82
82
|
|
|
83
83
|
`--install` は npm/pnpm/Yarn/Bun を packageManager または lockfile から判定し、
|
|
84
84
|
不足する依存だけを追加します。互換性のない既存バージョンは自動更新せずエラーにします。
|
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ This integration requires an adapter with the `/markdown/compiler` and
|
|
|
76
76
|
`yaml@^2.9.1 shiki@^4.5.0 @shikijs/transformers@^4.5.0`.
|
|
77
77
|
|
|
78
78
|
With `@ts-76/hono-markdown` 0.2.1 or newer, parser dependencies are installed automatically. Do not add `markdown-exit` or `markdown-it-container` to new apps. Existing Void 1.1 apps using adapter 0.6 retain automatic installation of its legacy parser peers.
|
|
79
|
-
The verified host versions are Void 1.2.1, Vite 8.3.4, and Hono 4.13.
|
|
79
|
+
The verified host versions are Void 1.2.1, Vite 8.3.4, and Hono 4.13.16 on Node >=24.22.1 <25. Existing Void 1.1.11 apps keep their compatible 0.6 adapter; if it is missing, init selects 0.6 rather than forcing a host upgrade. Adapter 0.9.1 retains the documented [Void/Cloudflare dependency risks](https://github.com/ts-76/void-plugin-hono-jsx/blob/v0.9.1/docs/dependency-security.md).
|
|
80
80
|
|
|
81
81
|
`--install` selects npm/pnpm/Yarn/Bun from packageManager or lockfiles and installs
|
|
82
82
|
missing dependencies. Incompatible installed versions require an explicit update;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import "hono";
|
|
2
2
|
import "hono/jsx";
|
|
3
3
|
import "hono/utils/html";
|
|
4
|
-
//#region src/node/markdown-adapter.d.ts
|
|
5
4
|
interface MarkdownIsland {
|
|
6
5
|
id: string;
|
|
7
6
|
modulePath: string;
|
|
@@ -27,13 +26,10 @@ interface DeckMarkdownAdapter {
|
|
|
27
26
|
}>;
|
|
28
27
|
client(islands: MarkdownIsland[]): string;
|
|
29
28
|
}
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/adapters/hono-markdown.d.ts
|
|
32
29
|
/** Node-only bridge. Existing Void configs retain their original compiler/runtime pair. */
|
|
33
|
-
declare function createHonoMarkdownAdapter(cwd: string, legacy?: boolean, options?: Record<string, unknown>): Promise<DeckMarkdownAdapter>;
|
|
34
|
-
declare function createMarkdownAdapter({ cwd, options }: {
|
|
30
|
+
export declare function createHonoMarkdownAdapter(cwd: string, legacy?: boolean, options?: Record<string, unknown>): Promise<DeckMarkdownAdapter>;
|
|
31
|
+
export declare function createMarkdownAdapter({ cwd, options }: {
|
|
35
32
|
cwd: string;
|
|
36
33
|
options?: Record<string, unknown>;
|
|
37
34
|
}): Promise<DeckMarkdownAdapter>;
|
|
38
|
-
|
|
39
|
-
export { type DeckMarkdownAdapter, type MarkdownIsland, createHonoMarkdownAdapter, createMarkdownAdapter };
|
|
35
|
+
export type { DeckMarkdownAdapter, MarkdownIsland };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
|
-
|
|
4
|
+
// src/adapters/hono-markdown.ts
|
|
5
5
|
/** Node-only bridge. Existing Void configs retain their original compiler/runtime pair. */
|
|
6
6
|
async function createHonoMarkdownAdapter(cwd, legacy = false, options) {
|
|
7
7
|
const require = createRequire(resolve(cwd, "package.json"));
|
|
@@ -75,5 +75,4 @@ hydrateMarkdownIslands({ ${islands.map((island) => `${literal(island.id)}: () =>
|
|
|
75
75
|
hydrateDeckMarkdownIslands();
|
|
76
76
|
if (window.__honoDecksLive) window.__honoDecksLive.registerHydrator(hydrateDeckMarkdownIslands);`;
|
|
77
77
|
}
|
|
78
|
-
//#endregion
|
|
79
78
|
export { createHonoMarkdownAdapter, createMarkdownAdapter };
|
package/dist/advanced.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Context, Env, Handler, Hono, MiddlewareHandler } from "hono";
|
|
2
2
|
import { HtmlEscapedString } from "hono/utils/html";
|
|
3
3
|
import { Child } from "hono/jsx";
|
|
4
|
-
//#region src/shared/types.d.ts
|
|
5
4
|
type SlideNode = {
|
|
6
5
|
type: "text";
|
|
7
6
|
value: string;
|
|
@@ -21,8 +20,6 @@ type SlideNode = {
|
|
|
21
20
|
children: SlideNode[];
|
|
22
21
|
source?: string;
|
|
23
22
|
};
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/renderer/jsx-renderer.d.ts
|
|
26
23
|
type MaybePromise<T> = T | Promise<T>;
|
|
27
24
|
type DeckRenderable = Child | HtmlEscapedString;
|
|
28
25
|
type SlideComponentProps = Record<string, unknown> & {
|
|
@@ -36,10 +33,8 @@ interface SlideComponentDefinition {
|
|
|
36
33
|
}
|
|
37
34
|
type SlideComponentInput = SlideComponent | SlideComponentDefinition;
|
|
38
35
|
type SlideComponentRegistry = Record<string, SlideComponentDefinition>;
|
|
39
|
-
declare const builtInSlideComponents: SlideComponentRegistry;
|
|
40
|
-
declare function defineSlideComponents(input: Record<string, SlideComponentInput>): SlideComponentRegistry;
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region src/server/document.d.ts
|
|
36
|
+
export declare const builtInSlideComponents: SlideComponentRegistry;
|
|
37
|
+
export declare function defineSlideComponents(input: Record<string, SlideComponentInput>): SlideComponentRegistry;
|
|
43
38
|
type DeckDocumentSurface = "index" | "viewer" | "render" | "print" | "presentation" | "presenter" | "embed";
|
|
44
39
|
interface DeckDocumentRenderInput<E extends Env = any> {
|
|
45
40
|
c: Context<E>;
|
|
@@ -62,9 +57,7 @@ interface ResolvedDeckDocument {
|
|
|
62
57
|
nonce?: string;
|
|
63
58
|
head: string;
|
|
64
59
|
}
|
|
65
|
-
|
|
66
|
-
//#region src/renderer/presentation-page.d.ts
|
|
67
|
-
declare function renderCompiledDeckPage(input: {
|
|
60
|
+
export declare function renderCompiledDeckPage(input: {
|
|
68
61
|
deck: CompiledDeck;
|
|
69
62
|
mountPath: string;
|
|
70
63
|
style?: string;
|
|
@@ -75,7 +68,7 @@ declare function renderCompiledDeckPage(input: {
|
|
|
75
68
|
speakerNotes?: boolean;
|
|
76
69
|
document?: ResolvedDeckDocument;
|
|
77
70
|
}): string;
|
|
78
|
-
declare function renderCompiledDeckPageAsync(input: {
|
|
71
|
+
export declare function renderCompiledDeckPageAsync(input: {
|
|
79
72
|
deck: CompiledDeck;
|
|
80
73
|
mountPath: string;
|
|
81
74
|
style?: string;
|
|
@@ -86,32 +79,28 @@ declare function renderCompiledDeckPageAsync(input: {
|
|
|
86
79
|
speakerNotes?: boolean;
|
|
87
80
|
document?: ResolvedDeckDocument;
|
|
88
81
|
}): Promise<string>;
|
|
89
|
-
|
|
90
|
-
//#region src/renderer/compiled-render.d.ts
|
|
91
|
-
declare function renderCompiledDeck(deck: CompiledDeck, input?: {
|
|
82
|
+
export declare function renderCompiledDeck(deck: CompiledDeck, input?: {
|
|
92
83
|
components?: SlideComponentRegistry | Record<string, SlideComponentInput>;
|
|
93
84
|
speakerNotes?: boolean;
|
|
94
85
|
}): string;
|
|
95
|
-
declare function renderCompiledDeckAsync(deck: CompiledDeck, input?: {
|
|
86
|
+
export declare function renderCompiledDeckAsync(deck: CompiledDeck, input?: {
|
|
96
87
|
components?: SlideComponentRegistry | Record<string, SlideComponentInput>;
|
|
97
88
|
speakerNotes?: boolean;
|
|
98
89
|
}): Promise<string>;
|
|
99
|
-
declare function renderCompiledSlide(slide: CompiledSlide, assets?: AssetRef[], input?: {
|
|
90
|
+
export declare function renderCompiledSlide(slide: CompiledSlide, assets?: AssetRef[], input?: {
|
|
100
91
|
components?: SlideComponentRegistry | Record<string, SlideComponentInput>;
|
|
101
92
|
deck?: CompiledDeck;
|
|
102
93
|
speakerNotes?: boolean;
|
|
103
94
|
slideState?: "active" | "inactive";
|
|
104
95
|
}): string;
|
|
105
|
-
declare function renderCompiledSlideAsync(slide: CompiledSlide, assets?: AssetRef[], input?: {
|
|
96
|
+
export declare function renderCompiledSlideAsync(slide: CompiledSlide, assets?: AssetRef[], input?: {
|
|
106
97
|
components?: SlideComponentRegistry | Record<string, SlideComponentInput>;
|
|
107
98
|
deck?: CompiledDeck;
|
|
108
99
|
speakerNotes?: boolean;
|
|
109
100
|
slideState?: "active" | "inactive";
|
|
110
101
|
}): Promise<string>;
|
|
111
|
-
//#endregion
|
|
112
|
-
//#region src/deck/model.d.ts
|
|
113
102
|
type DeckKind = "directory" | "single-file";
|
|
114
|
-
declare const SLIDE_TRANSITIONS: readonly ["none", "fade", "fade-out", "slide-left", "slide-right", "slide-up", "slide-down", "view-transition"];
|
|
103
|
+
export declare const SLIDE_TRANSITIONS: readonly ["none", "fade", "fade-out", "slide-left", "slide-right", "slide-up", "slide-down", "view-transition"];
|
|
115
104
|
type SlideTransition = (typeof SLIDE_TRANSITIONS)[number];
|
|
116
105
|
interface DeckFrontmatter {
|
|
117
106
|
title?: string;
|
|
@@ -200,14 +189,10 @@ interface DeckSource<E extends Env = any> {
|
|
|
200
189
|
interface DeckManifest {
|
|
201
190
|
decks: CompiledDeck[];
|
|
202
191
|
}
|
|
203
|
-
//#endregion
|
|
204
|
-
//#region src/renderer/control-icons.d.ts
|
|
205
192
|
type DeckControlIconName = "deck-list" | "home" | "viewer" | "projection" | "presenter" | "previous" | "next" | "fullscreen" | "external-link" | "print" | "details" | "export-pdf" | "export-png";
|
|
206
|
-
declare function renderControlIcon(name: DeckControlIconName, className?: string): DeckRenderable;
|
|
207
|
-
declare function renderControlIconHtml(name: DeckControlIconName, className?: string): string;
|
|
208
|
-
declare function controlIconLabel(name: DeckControlIconName): string;
|
|
209
|
-
//#endregion
|
|
210
|
-
//#region src/server/paths.d.ts
|
|
193
|
+
export declare function renderControlIcon(name: DeckControlIconName, className?: string): DeckRenderable;
|
|
194
|
+
export declare function renderControlIconHtml(name: DeckControlIconName, className?: string): string;
|
|
195
|
+
export declare function controlIconLabel(name: DeckControlIconName): string;
|
|
211
196
|
/** All public URLs for one deck. */
|
|
212
197
|
interface DeckPaths {
|
|
213
198
|
viewer: string;
|
|
@@ -222,9 +207,7 @@ interface DeckPaths {
|
|
|
222
207
|
assets: string;
|
|
223
208
|
}
|
|
224
209
|
/** Creates the canonical route map used by routers, controls, and app code. */
|
|
225
|
-
declare function createDeckPaths(mountPath: string, slug: string): DeckPaths;
|
|
226
|
-
//#endregion
|
|
227
|
-
//#region src/server/browser-export.d.ts
|
|
210
|
+
export declare function createDeckPaths(mountPath: string, slug: string): DeckPaths;
|
|
228
211
|
interface DeckBrowserRunBinding {
|
|
229
212
|
quickAction(action: "pdf" | "screenshot", input: Record<string, unknown>): MaybePromise<Response>;
|
|
230
213
|
}
|
|
@@ -255,8 +238,6 @@ interface DeckViewerExportPaths {
|
|
|
255
238
|
pdf?: boolean;
|
|
256
239
|
png?: boolean;
|
|
257
240
|
}
|
|
258
|
-
//#endregion
|
|
259
|
-
//#region src/server/viewer.d.ts
|
|
260
241
|
interface DeckViewerOptions<E extends Env = any> {
|
|
261
242
|
controls?: false | DeckViewerControlsOptions;
|
|
262
243
|
openGraph?: boolean | DeckViewerOpenGraphOptions;
|
|
@@ -386,7 +367,7 @@ interface DeckViewerEmbed extends DeckViewerParts {
|
|
|
386
367
|
embed: DeckRenderable;
|
|
387
368
|
embedHtml: string;
|
|
388
369
|
}
|
|
389
|
-
declare function createDeckViewerParts(input: {
|
|
370
|
+
export declare function createDeckViewerParts(input: {
|
|
390
371
|
deck: CompiledDeck;
|
|
391
372
|
mountPath: string;
|
|
392
373
|
viewerStateQuery?: string;
|
|
@@ -395,9 +376,7 @@ declare function createDeckViewerParts(input: {
|
|
|
395
376
|
availablePages?: Partial<DeckViewerAvailablePages>;
|
|
396
377
|
exportPaths?: DeckViewerExportPaths;
|
|
397
378
|
}): Promise<DeckViewerParts>;
|
|
398
|
-
declare function createDeckViewerEmbed(input: DeckViewerEmbedOptions): Promise<DeckViewerEmbed>;
|
|
399
|
-
//#endregion
|
|
400
|
-
//#region src/server/external-embed.d.ts
|
|
379
|
+
export declare function createDeckViewerEmbed(input: DeckViewerEmbedOptions): Promise<DeckViewerEmbed>;
|
|
401
380
|
interface DeckExternalEmbedContext<E extends Env = any> {
|
|
402
381
|
c: Context<E>;
|
|
403
382
|
deck: CompiledDeck;
|
|
@@ -418,8 +397,6 @@ interface DeckExternalEmbedOptions<E extends Env = any> {
|
|
|
418
397
|
robots?: string | false;
|
|
419
398
|
render?(input: DeckExternalEmbedRenderInput<E>): MaybePromise<DeckRenderable>;
|
|
420
399
|
}
|
|
421
|
-
//#endregion
|
|
422
|
-
//#region src/server/router.d.ts
|
|
423
400
|
interface DecksRouterExtension<E extends Env = any> {
|
|
424
401
|
path: string;
|
|
425
402
|
router: Hono<E>;
|
|
@@ -519,12 +496,10 @@ interface DeckContextOptions<E extends Env = any> {
|
|
|
519
496
|
pages?: Pick<DecksRouterPagesOptions<E>, "print">;
|
|
520
497
|
viewer?: Pick<DeckViewerOptions<E>, "controls" | "openGraph">;
|
|
521
498
|
}
|
|
522
|
-
declare function decksRouter<E extends Env = any>(options: DecksRouterOptions<E>): Hono<E>;
|
|
523
|
-
declare function deckContext<E extends Env = any>(options: DeckContextOptions<E>): MiddlewareHandler<E & {
|
|
499
|
+
export declare function decksRouter<E extends Env = any>(options: DecksRouterOptions<E>): Hono<E>;
|
|
500
|
+
export declare function deckContext<E extends Env = any>(options: DeckContextOptions<E>): MiddlewareHandler<E & {
|
|
524
501
|
Variables: DeckContextVariables;
|
|
525
502
|
}>;
|
|
526
|
-
//#endregion
|
|
527
|
-
//#region src/server/define-decks.d.ts
|
|
528
503
|
type DecksOptions<E extends Env = any> = Omit<DecksRouterOptions<E>, "source"> & ({
|
|
529
504
|
manifest: DeckManifest;
|
|
530
505
|
decks?: never;
|
|
@@ -574,14 +549,12 @@ interface ConfiguredDecks<E extends Env = any> {
|
|
|
574
549
|
}>;
|
|
575
550
|
paths(slug: string): DeckPaths;
|
|
576
551
|
}
|
|
577
|
-
declare function defineDecks<E extends Env = any>(options: DecksOptions<E>): DefinedDecks<E>;
|
|
552
|
+
export declare function defineDecks<E extends Env = any>(options: DecksOptions<E>): DefinedDecks<E>;
|
|
578
553
|
/** Defines the single configuration consumed by the CLI and runtime. */
|
|
579
|
-
declare function defineDecksConfig<E extends Env = any>(config: DecksConfig<E>): DecksConfig<E>;
|
|
554
|
+
export declare function defineDecksConfig<E extends Env = any>(config: DecksConfig<E>): DecksConfig<E>;
|
|
580
555
|
/** Applies app configuration to generated decks and returns the primary runtime API. */
|
|
581
|
-
declare function configureDecks<E extends Env = any>(defined: DefinedDecks<E>, config: DecksConfig<E>): ConfiguredDecks<E>;
|
|
582
|
-
declare function mergeDecksRouterOptions<E extends Env = any>(base: DecksRouterOptions<E>, overrides: DecksRouterOverrides<E>): DecksRouterOptions<E>;
|
|
583
|
-
//#endregion
|
|
584
|
-
//#region src/source/r2-assets.d.ts
|
|
556
|
+
export declare function configureDecks<E extends Env = any>(defined: DefinedDecks<E>, config: DecksConfig<E>): ConfiguredDecks<E>;
|
|
557
|
+
export declare function mergeDecksRouterOptions<E extends Env = any>(base: DecksRouterOptions<E>, overrides: DecksRouterOverrides<E>): DecksRouterOptions<E>;
|
|
585
558
|
interface R2ObjectHttpMetadataLike {
|
|
586
559
|
contentType?: string;
|
|
587
560
|
cacheControl?: string;
|
|
@@ -611,16 +584,11 @@ interface R2AssetSourceOptions<E extends Env = any> {
|
|
|
611
584
|
key?(input: R2AssetKeyInput): string;
|
|
612
585
|
cacheControl?: string | false | ((input: R2AssetKeyInput) => string | false | undefined);
|
|
613
586
|
}
|
|
614
|
-
declare function withR2Assets<E extends Env = any>(source: DeckSource<E>, options: R2AssetSourceOptions<E>): DeckSource<E>;
|
|
615
|
-
//#endregion
|
|
616
|
-
//#region src/server/client-entry.d.ts
|
|
587
|
+
export declare function withR2Assets<E extends Env = any>(source: DeckSource<E>, options: R2AssetSourceOptions<E>): DeckSource<E>;
|
|
617
588
|
interface ServeDecksClientEntryOptions {
|
|
618
589
|
cacheControl?: string | false;
|
|
619
590
|
contentType?: string;
|
|
620
591
|
}
|
|
621
|
-
declare function serveDecksClientEntry(clientEntry: string, options?: ServeDecksClientEntryOptions): Handler;
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
declare function manifestDeckSource<E extends Env = any>(manifest: DeckManifest): DeckSource<E>;
|
|
625
|
-
//#endregion
|
|
626
|
-
export { type AssetRef, type CompileWarning, type CompiledDeck, type CompiledSlide, type ComponentPlaceholder, type ConfiguredDecks, type DeckBrowserRunBinding, type DeckBrowserRunPdfOptions, type DeckBrowserRunPngOptions, type DeckContextOptions, type DeckContextVariables, type DeckControlIconName, type DeckDevResolver, type DeckDevResolverInput, type DeckDocumentOptions, type DeckDocumentPageOptions, type DeckDocumentRenderInput, type DeckDocumentSurface, type DeckEntry, type DeckExportOptions, type DeckExportResolverInput, type DeckExternalEmbedContext, type DeckExternalEmbedOptions, type DeckExternalEmbedRenderInput, type DeckExternalEmbedViewerOptions, type DeckFrontmatter, type DeckIndexPageInput, type DeckIndexPageOptions, type DeckIndexRenderInput, type DeckKind, type DeckManifest, type DeckPageMeta, type DeckPaths, type DeckPresenterEnabledInput, type DeckPresenterEnabledResolver, type DeckPresenterViewerControlOptions, type DeckRenderable, type DeckRequestContext, type DeckRouteEnabled, type DeckRouteEnabledResolver, type DeckRouteSurface, type DeckRouteSurfaceInput, type DeckSource, type DeckTocItem, type DeckViewerAvailablePages, type DeckViewerControlDefaults, type DeckViewerControlItem, type DeckViewerControlItemRenderer, type DeckViewerControlKey, type DeckViewerControlRenderInput, type DeckViewerControlSlotItems, type DeckViewerControlsContext, type DeckViewerControlsItemsResolver, type DeckViewerControlsOptions, type DeckViewerDefaultControlItem, type DeckViewerEmbed, type DeckViewerEmbedOptions, type DeckViewerExportPaths, type DeckViewerLinkControlItem, type DeckViewerOpenGraphInput, type DeckViewerOpenGraphOptions, type DeckViewerOptions, type DeckViewerPart, type DeckViewerParts, type DeckViewerRenderControlItem, type DeckViewerRenderInput, type DecksBuildConfig, type DecksConfig, type DecksOptions, type DecksRouterConfig, type DecksRouterExtension, type DecksRouterOptions, type DecksRouterOverrides, type DecksRouterPagesOptions, type DecksRouterPresenterOptions, type DefinedDecks, type MaybePromise, type R2AssetKeyInput, type R2AssetSourceOptions, type R2BucketLike, type R2BucketResolver, type R2ObjectBodyLike, type R2ObjectHttpMetadataLike, type ResolvedDeckDocument, SLIDE_TRANSITIONS, type ServeDecksClientEntryOptions, type SlideComponent, type SlideComponentDefinition, type SlideComponentInput, type SlideComponentProps, type SlideComponentRegistry, type SlideFrontmatter, type SlideTransition, builtInSlideComponents, configureDecks, controlIconLabel, createDeckPaths, createDeckViewerEmbed, createDeckViewerParts, deckContext, decksRouter, defineDecks, defineDecksConfig, defineSlideComponents, manifestDeckSource, mergeDecksRouterOptions, renderCompiledDeck, renderCompiledDeckAsync, renderCompiledDeckPage, renderCompiledDeckPageAsync, renderCompiledSlide, renderCompiledSlideAsync, renderControlIcon, renderControlIconHtml, serveDecksClientEntry, withR2Assets };
|
|
592
|
+
export declare function serveDecksClientEntry(clientEntry: string, options?: ServeDecksClientEntryOptions): Handler;
|
|
593
|
+
export declare function manifestDeckSource<E extends Env = any>(manifest: DeckManifest): DeckSource<E>;
|
|
594
|
+
export type { AssetRef, CompileWarning, CompiledDeck, CompiledSlide, ComponentPlaceholder, ConfiguredDecks, DeckBrowserRunBinding, DeckBrowserRunPdfOptions, DeckBrowserRunPngOptions, DeckContextOptions, DeckContextVariables, DeckControlIconName, DeckDevResolver, DeckDevResolverInput, DeckDocumentOptions, DeckDocumentPageOptions, DeckDocumentRenderInput, DeckDocumentSurface, DeckEntry, DeckExportOptions, DeckExportResolverInput, DeckExternalEmbedContext, DeckExternalEmbedOptions, DeckExternalEmbedRenderInput, DeckExternalEmbedViewerOptions, DeckFrontmatter, DeckIndexPageInput, DeckIndexPageOptions, DeckIndexRenderInput, DeckKind, DeckManifest, DeckPageMeta, DeckPaths, DeckPresenterEnabledInput, DeckPresenterEnabledResolver, DeckPresenterViewerControlOptions, DeckRenderable, DeckRequestContext, DeckRouteEnabled, DeckRouteEnabledResolver, DeckRouteSurface, DeckRouteSurfaceInput, DeckSource, DeckTocItem, DeckViewerAvailablePages, DeckViewerControlDefaults, DeckViewerControlItem, DeckViewerControlItemRenderer, DeckViewerControlKey, DeckViewerControlRenderInput, DeckViewerControlSlotItems, DeckViewerControlsContext, DeckViewerControlsItemsResolver, DeckViewerControlsOptions, DeckViewerDefaultControlItem, DeckViewerEmbed, DeckViewerEmbedOptions, DeckViewerExportPaths, DeckViewerLinkControlItem, DeckViewerOpenGraphInput, DeckViewerOpenGraphOptions, DeckViewerOptions, DeckViewerPart, DeckViewerParts, DeckViewerRenderControlItem, DeckViewerRenderInput, DecksBuildConfig, DecksConfig, DecksOptions, DecksRouterConfig, DecksRouterExtension, DecksRouterOptions, DecksRouterOverrides, DecksRouterPagesOptions, DecksRouterPresenterOptions, DefinedDecks, MaybePromise, R2AssetKeyInput, R2AssetSourceOptions, R2BucketLike, R2BucketResolver, R2ObjectBodyLike, R2ObjectHttpMetadataLike, ResolvedDeckDocument, ServeDecksClientEntryOptions, SlideComponent, SlideComponentDefinition, SlideComponentInput, SlideComponentProps, SlideComponentRegistry, SlideFrontmatter, SlideTransition };
|
package/dist/advanced.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Hono } from "hono";
|
|
|
2
2
|
import { raw } from "hono/html";
|
|
3
3
|
import { Fragment, jsx } from "hono/jsx/jsx-runtime";
|
|
4
4
|
import { HtmlEscapedCallbackPhase, resolveCallback } from "hono/utils/html";
|
|
5
|
-
|
|
5
|
+
// src/source/manifest-source.ts
|
|
6
6
|
function manifestDeckSource(manifest) {
|
|
7
7
|
const decks = new Map(manifest.decks.map((deck) => [deck.slug, deck]));
|
|
8
8
|
return {
|
|
@@ -41,8 +41,7 @@ function findLocalAsset(assets, slug, assetPath) {
|
|
|
41
41
|
return asset.publicPath.endsWith(suffix);
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
|
|
45
|
-
//#region src/deck/model.ts
|
|
44
|
+
// src/deck/model.ts
|
|
46
45
|
const SLIDE_TRANSITIONS = [
|
|
47
46
|
"none",
|
|
48
47
|
"fade",
|
|
@@ -63,8 +62,7 @@ var RenderError = class extends Error {
|
|
|
63
62
|
this.name = "RenderError";
|
|
64
63
|
}
|
|
65
64
|
};
|
|
66
|
-
|
|
67
|
-
//#region src/renderer/asset-rewrite.ts
|
|
65
|
+
// src/renderer/asset-rewrite.ts
|
|
68
66
|
function rewriteLocalAssetUrls(html, assets) {
|
|
69
67
|
const localAssets = assets.filter((asset) => asset.type === "local");
|
|
70
68
|
if (localAssets.length === 0) return html;
|
|
@@ -101,8 +99,7 @@ function escapeHtml$8(value) {
|
|
|
101
99
|
function decodeHtml(value) {
|
|
102
100
|
return value.replaceAll(""", "\"").replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
103
101
|
}
|
|
104
|
-
|
|
105
|
-
//#region src/renderer/jsx-renderer.ts
|
|
102
|
+
// src/renderer/jsx-renderer.ts
|
|
106
103
|
const builtInSlideComponents = defineSlideComponents({
|
|
107
104
|
Fire: (props) => {
|
|
108
105
|
if (props.order !== void 0) throw new Error("The Fire \"order\" prop is not supported. Fires reveal in source order.");
|
|
@@ -345,10 +342,11 @@ function createMdxComponents(registry, input = {}) {
|
|
|
345
342
|
function heroImage(props) {
|
|
346
343
|
const image = typeof props.image === "string" ? props.image : typeof props.src === "string" ? props.src : void 0;
|
|
347
344
|
if (!image) return "";
|
|
345
|
+
const alt = typeof props.alt === "string" && props.alt ? props.alt : typeof props.title === "string" ? props.title : "Hero image";
|
|
348
346
|
return jsx("img", {
|
|
349
347
|
class: "mdx-hero-image",
|
|
350
348
|
src: image,
|
|
351
|
-
alt
|
|
349
|
+
alt
|
|
352
350
|
});
|
|
353
351
|
}
|
|
354
352
|
function stringProp(value) {
|
|
@@ -535,8 +533,7 @@ function localAssetRelativePath(sourcePath) {
|
|
|
535
533
|
function normalizeVoidElementSpacing(html) {
|
|
536
534
|
return html.replace(/<(img|br|hr)([^<>]*)\/>/g, "<$1$2 />");
|
|
537
535
|
}
|
|
538
|
-
|
|
539
|
-
//#region src/renderer/control-icons.ts
|
|
536
|
+
// src/renderer/control-icons.ts
|
|
540
537
|
function renderControlIcon(name, className = "hono-decks-control-icon") {
|
|
541
538
|
return jsx("svg", {
|
|
542
539
|
class: className,
|
|
@@ -665,8 +662,7 @@ function controlIconPaths(name) {
|
|
|
665
662
|
];
|
|
666
663
|
}
|
|
667
664
|
}
|
|
668
|
-
|
|
669
|
-
//#region src/renderer/presentation-style.ts
|
|
665
|
+
// src/renderer/presentation-style.ts
|
|
670
666
|
const PRESENTATION_DESIGN_WIDTH = 1920;
|
|
671
667
|
const PRESENTATION_DESIGN_HEIGHT = 1080;
|
|
672
668
|
function presentationDesignCssVariables() {
|
|
@@ -767,8 +763,7 @@ body[data-hono-decks-print-preview] [data-hono-decks-fire]{visibility:visible!im
|
|
|
767
763
|
@media print{.hono-decks-embed-viewport iframe,.hono-decks-tweet-embed iframe,.hono-decks-tweet-embed .twitter-tweet{display:none!important}.hono-decks-embed-print-fallback{display:grid;width:100%;height:100%;place-items:center;overflow:hidden;background:var(--hono-decks-card-background);color:var(--hono-decks-accent-color);text-decoration:none}.hono-decks-embed-print-fallback:has(.hono-decks-embed-print-poster){display:block}.hono-decks-embed-print-poster+span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}.hono-decks-tweet-print-fallback{display:flex;min-height:12rem;align-items:center;justify-content:center;border:1px solid var(--hono-decks-border-color);border-radius:8px;background:var(--hono-decks-card-background);color:var(--hono-decks-accent-color);text-decoration:none}}
|
|
768
764
|
@media (prefers-reduced-motion: reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;transition-delay:0s!important}.slide[data-active-transition]{transform:none!important}}`;
|
|
769
765
|
}
|
|
770
|
-
|
|
771
|
-
//#region src/server/document.ts
|
|
766
|
+
// src/server/document.ts
|
|
772
767
|
async function resolveDeckDocument(input, options, overrides) {
|
|
773
768
|
const page = {
|
|
774
769
|
lang: options?.lang,
|
|
@@ -799,8 +794,7 @@ async function resolveDocumentValue(value, input) {
|
|
|
799
794
|
function escapeHtml$7(value) {
|
|
800
795
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
|
801
796
|
}
|
|
802
|
-
|
|
803
|
-
//#region src/renderer/presentation-script.ts
|
|
797
|
+
// src/renderer/presentation-script.ts
|
|
804
798
|
function renderLiveReloadScript(eventsPath, nonce) {
|
|
805
799
|
return `<script${documentNonceAttribute(nonce)}>
|
|
806
800
|
(() => {
|
|
@@ -1459,8 +1453,7 @@ function renderPresentationScript(nonce) {
|
|
|
1459
1453
|
function escapeHtml$6(value) {
|
|
1460
1454
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
|
1461
1455
|
}
|
|
1462
|
-
|
|
1463
|
-
//#region src/renderer/presentation-page.ts
|
|
1456
|
+
// src/renderer/presentation-page.ts
|
|
1464
1457
|
function presentationPageTitle(deck) {
|
|
1465
1458
|
return deck.meta.title ?? deck.slug;
|
|
1466
1459
|
}
|
|
@@ -1748,8 +1741,7 @@ function renderPresenterScript(slideCount, nonce) {
|
|
|
1748
1741
|
function escapeHtml$5(value) {
|
|
1749
1742
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
|
1750
1743
|
}
|
|
1751
|
-
|
|
1752
|
-
//#region src/renderer/compiled-render.ts
|
|
1744
|
+
// src/renderer/compiled-render.ts
|
|
1753
1745
|
function renderCompiledDeck(deck, input = {}) {
|
|
1754
1746
|
const components = normalizeComponents(input.components);
|
|
1755
1747
|
return `<main class="hono-decks-stage" data-hono-decks-stage data-deck-slug="${escapeHtml$4(deck.slug)}"><div class="hono-decks-deck" data-hono-decks-deck>${deck.slides.map((slide) => renderCompiledSlide(slide, deck.assets, {
|
|
@@ -1861,8 +1853,7 @@ function formatErrorMessage$1(error) {
|
|
|
1861
1853
|
if (error instanceof Error) return error.message;
|
|
1862
1854
|
return String(error);
|
|
1863
1855
|
}
|
|
1864
|
-
|
|
1865
|
-
//#region src/server/client-entry.ts
|
|
1856
|
+
// src/server/client-entry.ts
|
|
1866
1857
|
function serveDecksClientEntry(clientEntry, options = {}) {
|
|
1867
1858
|
return (c) => {
|
|
1868
1859
|
const headers = { "content-type": options.contentType ?? "text/javascript; charset=utf-8" };
|
|
@@ -1871,8 +1862,7 @@ function serveDecksClientEntry(clientEntry, options = {}) {
|
|
|
1871
1862
|
return c.body(clientEntry, 200, headers);
|
|
1872
1863
|
};
|
|
1873
1864
|
}
|
|
1874
|
-
|
|
1875
|
-
//#region src/server/path-utils.ts
|
|
1865
|
+
// src/server/path-utils.ts
|
|
1876
1866
|
function extractAssetPath(path, slug) {
|
|
1877
1867
|
const marker = `/${slug}/assets/`;
|
|
1878
1868
|
const markerIndex = path.indexOf(marker);
|
|
@@ -1895,8 +1885,7 @@ function resolveGeneratedClientEntryUrl(options, mountPath) {
|
|
|
1895
1885
|
function normalizeClientEntryAssetPath(path = "/_assets/client.js") {
|
|
1896
1886
|
return (path.startsWith("/") ? path : `/${path}`).replace(/\/{2,}/g, "/");
|
|
1897
1887
|
}
|
|
1898
|
-
|
|
1899
|
-
//#region src/server/paths.ts
|
|
1888
|
+
// src/server/paths.ts
|
|
1900
1889
|
/** Creates the canonical route map used by routers, controls, and app code. */
|
|
1901
1890
|
function createDeckPaths(mountPath, slug) {
|
|
1902
1891
|
const mount = normalizeMountPath(mountPath);
|
|
@@ -1924,8 +1913,7 @@ function normalizeMountPath(value) {
|
|
|
1924
1913
|
while (end > start && trimmed[end - 1] === "/") end -= 1;
|
|
1925
1914
|
return `/${trimmed.slice(start, end)}`;
|
|
1926
1915
|
}
|
|
1927
|
-
|
|
1928
|
-
//#region src/server/browser-export.ts
|
|
1916
|
+
// src/server/browser-export.ts
|
|
1929
1917
|
async function renderDeckBrowserExport(c, options, format) {
|
|
1930
1918
|
const slug = c.req.param("slug");
|
|
1931
1919
|
if (!slug) return c.json({
|
|
@@ -2066,8 +2054,7 @@ function safeFilename$1(value) {
|
|
|
2066
2054
|
while (end > start && sanitized[end - 1] === "-") end -= 1;
|
|
2067
2055
|
return sanitized.slice(start, end) || "deck";
|
|
2068
2056
|
}
|
|
2069
|
-
|
|
2070
|
-
//#region src/server/viewer-script.ts
|
|
2057
|
+
// src/server/viewer-script.ts
|
|
2071
2058
|
const VIEWER_STATE_MESSAGE_TYPE = "hono-decks:state";
|
|
2072
2059
|
const VIEWER_COMMAND_MESSAGE_TYPE = "hono-decks:command";
|
|
2073
2060
|
function renderViewerScript(nonce) {
|
|
@@ -2227,8 +2214,7 @@ function renderViewerScript(nonce) {
|
|
|
2227
2214
|
function escapeHtml$3(value) {
|
|
2228
2215
|
return value.replaceAll("&", "&").replaceAll("\"", """).replaceAll("<", "<").replaceAll(">", ">");
|
|
2229
2216
|
}
|
|
2230
|
-
|
|
2231
|
-
//#region src/server/viewer-style.ts
|
|
2217
|
+
// src/server/viewer-style.ts
|
|
2232
2218
|
const VIEWER_ASPECT_RATIO = "16/9";
|
|
2233
2219
|
function viewerViewportRule() {
|
|
2234
2220
|
return `.hono-decks-viewport{width:min(100%,calc((100vh - 58px) * 16 / 9));aspect-ratio:${VIEWER_ASPECT_RATIO};position:relative;overflow:hidden;touch-action:pan-y}
|
|
@@ -2300,8 +2286,7 @@ ${root} .hono-decks-viewer-toc button{font:inherit}
|
|
|
2300
2286
|
@media (pointer:coarse){${root} .hono-decks-mobile-navigation{display:inline-flex;pointer-events:auto}}
|
|
2301
2287
|
@media (prefers-reduced-motion: reduce){${root},${root} *{scroll-behavior:auto!important;animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}}`;
|
|
2302
2288
|
}
|
|
2303
|
-
|
|
2304
|
-
//#region src/server/viewer.ts
|
|
2289
|
+
// src/server/viewer.ts
|
|
2305
2290
|
async function createDeckViewerParts(input) {
|
|
2306
2291
|
const slug = input.deck.slug;
|
|
2307
2292
|
const title = input.deck.meta.title ?? slug;
|
|
@@ -2756,8 +2741,7 @@ function safeHref(value) {
|
|
|
2756
2741
|
if (/^[^/?#.]+:/i.test(trimmed)) return void 0;
|
|
2757
2742
|
return value;
|
|
2758
2743
|
}
|
|
2759
|
-
|
|
2760
|
-
//#region src/server/external-embed.ts
|
|
2744
|
+
// src/server/external-embed.ts
|
|
2761
2745
|
async function renderDeckExternalEmbedResponse(input) {
|
|
2762
2746
|
const { c, deck, slug, mountPath } = input.context;
|
|
2763
2747
|
const enabled = input.options.enabled;
|
|
@@ -2861,8 +2845,7 @@ function externalEmbedPageStyle() {
|
|
|
2861
2845
|
function escapeHtml$1(value) {
|
|
2862
2846
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
|
2863
2847
|
}
|
|
2864
|
-
|
|
2865
|
-
//#region src/server/router.ts
|
|
2848
|
+
// src/server/router.ts
|
|
2866
2849
|
function decksRouter(options) {
|
|
2867
2850
|
const router = new Hono();
|
|
2868
2851
|
if (options.clientEntryAsset) router.get(normalizeClientEntryAssetPath(options.clientEntryAssetPath), serveDecksClientEntry(options.clientEntryAsset));
|
|
@@ -3307,8 +3290,7 @@ function formatErrorMessage(error) {
|
|
|
3307
3290
|
if (error instanceof Error) return error.message;
|
|
3308
3291
|
return String(error);
|
|
3309
3292
|
}
|
|
3310
|
-
|
|
3311
|
-
//#region src/server/define-decks.ts
|
|
3293
|
+
// src/server/define-decks.ts
|
|
3312
3294
|
function defineDecks(options) {
|
|
3313
3295
|
const manifest = Array.isArray(options.decks) ? { decks: options.decks } : options.manifest;
|
|
3314
3296
|
if (!manifest) throw new Error("defineDecks requires either decks or manifest.");
|
|
@@ -3490,8 +3472,7 @@ function mergePresenterOptions(base, override) {
|
|
|
3490
3472
|
viewerControl
|
|
3491
3473
|
};
|
|
3492
3474
|
}
|
|
3493
|
-
|
|
3494
|
-
//#region src/source/r2-assets.ts
|
|
3475
|
+
// src/source/r2-assets.ts
|
|
3495
3476
|
function withR2Assets(source, options) {
|
|
3496
3477
|
return {
|
|
3497
3478
|
async listDecks(c) {
|
|
@@ -3577,5 +3558,4 @@ function applyHttpMetadata(headers, metadata) {
|
|
|
3577
3558
|
function resolveCacheControl(input, options) {
|
|
3578
3559
|
return typeof options.cacheControl === "function" ? options.cacheControl(input) : options.cacheControl;
|
|
3579
3560
|
}
|
|
3580
|
-
//#endregion
|
|
3581
3561
|
export { SLIDE_TRANSITIONS, builtInSlideComponents, configureDecks, controlIconLabel, createDeckPaths, createDeckViewerEmbed, createDeckViewerParts, deckContext, decksRouter, defineDecks, defineDecksConfig, defineSlideComponents, manifestDeckSource, mergeDecksRouterOptions, renderCompiledDeck, renderCompiledDeckAsync, renderCompiledDeckPage, renderCompiledDeckPageAsync, renderCompiledSlide, renderCompiledSlideAsync, renderControlIcon, renderControlIconHtml, serveDecksClientEntry, withR2Assets };
|