hono-decks 0.4.5 → 1.0.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.ja.md +1 -0
- package/README.md +1 -0
- package/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +61 -8
- package/dist/bin.js +14 -4
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +14 -4
- package/dist/mod.d.ts +1 -1
- package/dist/mod.js +5 -1
- package/dist/node.d.ts +4 -4
- package/dist/node.js +75 -12
- package/dist/vite.js +15 -5
- package/package.json +1 -1
package/README.ja.md
CHANGED
|
@@ -253,6 +253,7 @@ export default defineDecksConfig({
|
|
|
253
253
|
- `hono-decks/advanced`: `defineDecks()`、`decksRouter()`、`deckContext()`、raw renderer など独自 pipeline 用
|
|
254
254
|
- `hono-decks/client`: browser hydration
|
|
255
255
|
- `hono-decks/node`: compiler と Node filesystem adapter
|
|
256
|
+
- `hono-decks/vite`: 開発中のcompileとwatchをViteへ組み込むintegration
|
|
256
257
|
- `hono-decks/cli`: programmatic CLI runner
|
|
257
258
|
|
|
258
259
|
通常の generated workflow では root entry だけを import します。`hono-decks/advanced` は custom `DeckSource` や router をゼロから組み立てる場合に限定してください。
|
package/README.md
CHANGED
|
@@ -259,6 +259,7 @@ Image generation is intentionally not part of the core package. The <code>exampl
|
|
|
259
259
|
- <code>hono-decks/advanced</code>: <code>defineDecks()</code>, <code>decksRouter()</code>, <code>deckContext()</code>, raw renderers, and other low-level pipeline APIs
|
|
260
260
|
- <code>hono-decks/client</code>: browser hydration
|
|
261
261
|
- <code>hono-decks/node</code>: the compiler and Node filesystem adapter
|
|
262
|
+
- <code>hono-decks/vite</code>: Vite integration that compiles and watches decks during development
|
|
262
263
|
- <code>hono-decks/cli</code>: the programmatic CLI runner
|
|
263
264
|
|
|
264
265
|
The generated workflow normally imports only the root entry. Use <code>hono-decks/advanced</code> only when assembling a custom <code>DeckSource</code> or router from the lower-level primitives.
|
package/dist/advanced.d.ts
CHANGED
|
@@ -616,4 +616,4 @@ declare function serveDecksClientEntry(clientEntry: string, options?: ServeDecks
|
|
|
616
616
|
//#region src/source/manifest-source.d.ts
|
|
617
617
|
declare function manifestDeckSource<E extends Env = any>(manifest: DeckManifest): DeckSource<E>;
|
|
618
618
|
//#endregion
|
|
619
|
-
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 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 };
|
|
619
|
+
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 };
|
package/dist/advanced.js
CHANGED
|
@@ -333,10 +333,13 @@ function defineSlideComponents(input) {
|
|
|
333
333
|
}
|
|
334
334
|
function createMdxComponents(registry, input = {}) {
|
|
335
335
|
const components = {
|
|
336
|
-
img: (props) => jsx("img", rewriteAssetProps(props, input.assets)),
|
|
337
|
-
a: (props) => jsx("a", rewriteAssetProps(props, input.assets))
|
|
336
|
+
img: (props) => jsx("img", rewriteAssetProps(props ?? {}, input.assets)),
|
|
337
|
+
a: (props) => jsx("a", rewriteAssetProps(props ?? {}, input.assets))
|
|
338
|
+
};
|
|
339
|
+
for (const [name, definition] of Object.entries(registry)) components[name] = (props) => {
|
|
340
|
+
const resolvedProps = props ?? {};
|
|
341
|
+
return renderRegisteredComponent(name, definition, resolvedProps, resolvedProps.children, input.assets);
|
|
338
342
|
};
|
|
339
|
-
for (const [name, definition] of Object.entries(registry)) components[name] = (props = {}) => renderRegisteredComponent(name, definition, props, props.children, input.assets);
|
|
340
343
|
return components;
|
|
341
344
|
}
|
|
342
345
|
function heroImage(props) {
|
|
@@ -391,7 +394,11 @@ function codeBlockText(value) {
|
|
|
391
394
|
if (value === null || value === void 0 || typeof value === "boolean") return "";
|
|
392
395
|
if (typeof value === "string" || typeof value === "number") return String(value);
|
|
393
396
|
if (isJsxValue(value)) return codeBlockText(value.props?.children);
|
|
394
|
-
|
|
397
|
+
try {
|
|
398
|
+
return JSON.stringify(value) ?? "";
|
|
399
|
+
} catch {
|
|
400
|
+
return "";
|
|
401
|
+
}
|
|
395
402
|
}
|
|
396
403
|
function renderSlideNodes(nodes, input = {}) {
|
|
397
404
|
return normalizeVoidElementSpacing(nodes.map((node) => String(renderSlideNode(node, input))).join(""));
|
|
@@ -707,6 +714,7 @@ function renderPresentationScript(nonce) {
|
|
|
707
714
|
let isTransitioning = false;
|
|
708
715
|
let pendingNavigation = null;
|
|
709
716
|
let transitionToken = 0;
|
|
717
|
+
let touchStart = null;
|
|
710
718
|
|
|
711
719
|
function fitDeck() {
|
|
712
720
|
if (!(stage instanceof HTMLElement) || !(deck instanceof HTMLElement)) return;
|
|
@@ -748,10 +756,10 @@ function renderPresentationScript(nonce) {
|
|
|
748
756
|
const entries = slideFires(slide).map((fire) => {
|
|
749
757
|
const rawAt = fire.getAttribute("data-fire-at");
|
|
750
758
|
let position;
|
|
751
|
-
if (rawAt !== null &&
|
|
759
|
+
if (rawAt !== null && /^[0-9]+$/.test(rawAt)) {
|
|
752
760
|
position = Number(rawAt);
|
|
753
761
|
} else {
|
|
754
|
-
const offset = rawAt !== null && /^[+-]
|
|
762
|
+
const offset = rawAt !== null && /^[+-][0-9]+$/.test(rawAt) ? Number(rawAt) : 1;
|
|
755
763
|
cursor += offset;
|
|
756
764
|
position = cursor;
|
|
757
765
|
}
|
|
@@ -1039,6 +1047,33 @@ function renderPresentationScript(nonce) {
|
|
|
1039
1047
|
if (action === "overview") toggleOverview();
|
|
1040
1048
|
}
|
|
1041
1049
|
|
|
1050
|
+
function isInteractiveTouchTarget(target) {
|
|
1051
|
+
return target instanceof Element && Boolean(target.closest("a,button,input,select,textarea,[contenteditable],[role='button']"));
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
function handleTouchStart(event) {
|
|
1055
|
+
if (event.touches.length !== 1 || isInteractiveTouchTarget(event.target)) {
|
|
1056
|
+
touchStart = null;
|
|
1057
|
+
return;
|
|
1058
|
+
}
|
|
1059
|
+
const touch = event.touches[0];
|
|
1060
|
+
touchStart = { x: touch.clientX, y: touch.clientY };
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
function handleTouchEnd(event) {
|
|
1064
|
+
if (!touchStart || event.changedTouches.length !== 1) {
|
|
1065
|
+
touchStart = null;
|
|
1066
|
+
return;
|
|
1067
|
+
}
|
|
1068
|
+
const touch = event.changedTouches[0];
|
|
1069
|
+
const deltaX = touch.clientX - touchStart.x;
|
|
1070
|
+
const deltaY = touch.clientY - touchStart.y;
|
|
1071
|
+
touchStart = null;
|
|
1072
|
+
const threshold = Math.max(48, window.innerWidth * 0.08);
|
|
1073
|
+
if (Math.abs(deltaX) < threshold || Math.abs(deltaX) <= Math.abs(deltaY) * 1.25) return;
|
|
1074
|
+
handleCommand(deltaX < 0 ? "next" : "previous");
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1042
1077
|
async function toggleFullscreen() {
|
|
1043
1078
|
if (document.fullscreenElement) {
|
|
1044
1079
|
await document.exitFullscreen?.();
|
|
@@ -1062,6 +1097,9 @@ function renderPresentationScript(nonce) {
|
|
|
1062
1097
|
if (event.key === "p") handleCommand("presenter");
|
|
1063
1098
|
if (event.key === "o") handleCommand("overview");
|
|
1064
1099
|
});
|
|
1100
|
+
document.addEventListener("touchstart", handleTouchStart, { passive: true });
|
|
1101
|
+
document.addEventListener("touchend", handleTouchEnd, { passive: true });
|
|
1102
|
+
document.addEventListener("touchcancel", () => { touchStart = null; }, { passive: true });
|
|
1065
1103
|
|
|
1066
1104
|
window.addEventListener("message", (event) => {
|
|
1067
1105
|
const message = event.data;
|
|
@@ -2137,7 +2175,7 @@ async function renderDeckViewerPage(input) {
|
|
|
2137
2175
|
${document.head}
|
|
2138
2176
|
</head>
|
|
2139
2177
|
<body>
|
|
2140
|
-
${await renderJsxValue(
|
|
2178
|
+
${await renderJsxValue(content)}
|
|
2141
2179
|
${renderViewerScript(document.nonce)}
|
|
2142
2180
|
</body>
|
|
2143
2181
|
</html>`;
|
|
@@ -2469,10 +2507,25 @@ async function renderDeckExternalEmbedResponse(input) {
|
|
|
2469
2507
|
mountPath,
|
|
2470
2508
|
title: deck.meta.title ?? slug
|
|
2471
2509
|
}, input.document, input.options.document);
|
|
2510
|
+
const viewerOptions = typeof input.options.viewer === "function" ? await input.options.viewer(input.context) : input.options.viewer;
|
|
2511
|
+
const controls = viewerOptions?.controls === void 0 ? { items: (_defaults, context) => [{
|
|
2512
|
+
type: "link",
|
|
2513
|
+
key: "open-viewer",
|
|
2514
|
+
href: context.meta.paths.viewer,
|
|
2515
|
+
label: "Open full viewer in new tab",
|
|
2516
|
+
icon: "external-link",
|
|
2517
|
+
attributes: {
|
|
2518
|
+
"aria-label": "Open full viewer in new tab",
|
|
2519
|
+
"data-hono-decks-viewer-link": true,
|
|
2520
|
+
target: "_blank",
|
|
2521
|
+
rel: "noreferrer"
|
|
2522
|
+
}
|
|
2523
|
+
}] } : viewerOptions.controls;
|
|
2472
2524
|
const viewer = await createDeckViewerEmbed({
|
|
2473
2525
|
deck,
|
|
2474
2526
|
mountPath,
|
|
2475
|
-
...
|
|
2527
|
+
...viewerOptions,
|
|
2528
|
+
controls,
|
|
2476
2529
|
availablePages: input.availablePages,
|
|
2477
2530
|
nonce: document.nonce
|
|
2478
2531
|
});
|
package/dist/bin.js
CHANGED
|
@@ -262,7 +262,7 @@ function takeKnownStringWithWarning(attrs, key, values, fallback, warnings, code
|
|
|
262
262
|
if (typeof value === "string" && values.includes(value)) return value;
|
|
263
263
|
warnings.push({
|
|
264
264
|
code,
|
|
265
|
-
message: `Unknown ${key} value "${
|
|
265
|
+
message: `Unknown ${key} value "${formatFrontmatterValue(value)}"; using ${fallback}.`,
|
|
266
266
|
...slideIndex !== void 0 ? { slideIndex } : {}
|
|
267
267
|
});
|
|
268
268
|
return fallback;
|
|
@@ -274,7 +274,7 @@ function takeTransitionDuration(attrs, warnings, slideIndex) {
|
|
|
274
274
|
if (typeof value === "string" && isValidTransitionDuration(value)) return value;
|
|
275
275
|
warnings.push({
|
|
276
276
|
code: "invalid-transition-duration",
|
|
277
|
-
message: `Invalid transitionDuration value "${
|
|
277
|
+
message: `Invalid transitionDuration value "${formatFrontmatterValue(value)}"; ignoring it.`,
|
|
278
278
|
...slideIndex !== void 0 ? { slideIndex } : {}
|
|
279
279
|
});
|
|
280
280
|
}
|
|
@@ -285,10 +285,20 @@ function takeTransitionEasing(attrs, warnings, slideIndex) {
|
|
|
285
285
|
if (typeof value === "string" && isValidTransitionEasing(value)) return value;
|
|
286
286
|
warnings.push({
|
|
287
287
|
code: "invalid-transition-easing",
|
|
288
|
-
message: `Invalid transitionEasing value "${
|
|
288
|
+
message: `Invalid transitionEasing value "${formatFrontmatterValue(value)}"; ignoring it.`,
|
|
289
289
|
...slideIndex !== void 0 ? { slideIndex } : {}
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
|
+
function formatFrontmatterValue(value) {
|
|
293
|
+
if (typeof value === "string") return value;
|
|
294
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return value.toString();
|
|
295
|
+
if (value === null) return "null";
|
|
296
|
+
try {
|
|
297
|
+
return JSON.stringify(value) ?? "";
|
|
298
|
+
} catch {
|
|
299
|
+
return "[unserializable value]";
|
|
300
|
+
}
|
|
301
|
+
}
|
|
292
302
|
function isValidTransitionDuration(value) {
|
|
293
303
|
return value.split(",").map((item) => item.trim()).every((item) => /^(?:\d+|\d*\.\d+)(?:ms|s)$/.test(item));
|
|
294
304
|
}
|
|
@@ -1130,7 +1140,7 @@ function fireAtAttributeValue(value) {
|
|
|
1130
1140
|
function zennEmbedNode(node, input) {
|
|
1131
1141
|
if (node.type !== "paragraph" || !Array.isArray(node.children) || node.children.length !== 2) return void 0;
|
|
1132
1142
|
const [prefix, link] = node.children;
|
|
1133
|
-
if (prefix?.type !== "text" ||
|
|
1143
|
+
if (prefix?.type !== "text" || typeof prefix.value !== "string" || prefix.value.trim() !== "@") return void 0;
|
|
1134
1144
|
if (link?.type !== "link" || typeof link.url !== "string") return void 0;
|
|
1135
1145
|
const name = collectMarkdownText(link).trim().toLowerCase();
|
|
1136
1146
|
if (name === "youtube") return mdxElement("EmbedFrame", [
|
package/dist/cli.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ interface RunHonoDecksCliInput {
|
|
|
7
7
|
/** Stops a long-running `compile --watch` command. */
|
|
8
8
|
signal?: AbortSignal;
|
|
9
9
|
/** Test/tooling hook for filesystem watching. */
|
|
10
|
-
watchFileSystem?(path: string, options: {
|
|
10
|
+
watchFileSystem?(this: void, path: string, options: {
|
|
11
11
|
recursive: boolean;
|
|
12
12
|
}, listener: (eventType: "rename" | "change", filename: string | null) => void): {
|
|
13
13
|
close(): void;
|
package/dist/cli.js
CHANGED
|
@@ -261,7 +261,7 @@ function takeKnownStringWithWarning(attrs, key, values, fallback, warnings, code
|
|
|
261
261
|
if (typeof value === "string" && values.includes(value)) return value;
|
|
262
262
|
warnings.push({
|
|
263
263
|
code,
|
|
264
|
-
message: `Unknown ${key} value "${
|
|
264
|
+
message: `Unknown ${key} value "${formatFrontmatterValue(value)}"; using ${fallback}.`,
|
|
265
265
|
...slideIndex !== void 0 ? { slideIndex } : {}
|
|
266
266
|
});
|
|
267
267
|
return fallback;
|
|
@@ -273,7 +273,7 @@ function takeTransitionDuration(attrs, warnings, slideIndex) {
|
|
|
273
273
|
if (typeof value === "string" && isValidTransitionDuration(value)) return value;
|
|
274
274
|
warnings.push({
|
|
275
275
|
code: "invalid-transition-duration",
|
|
276
|
-
message: `Invalid transitionDuration value "${
|
|
276
|
+
message: `Invalid transitionDuration value "${formatFrontmatterValue(value)}"; ignoring it.`,
|
|
277
277
|
...slideIndex !== void 0 ? { slideIndex } : {}
|
|
278
278
|
});
|
|
279
279
|
}
|
|
@@ -284,10 +284,20 @@ function takeTransitionEasing(attrs, warnings, slideIndex) {
|
|
|
284
284
|
if (typeof value === "string" && isValidTransitionEasing(value)) return value;
|
|
285
285
|
warnings.push({
|
|
286
286
|
code: "invalid-transition-easing",
|
|
287
|
-
message: `Invalid transitionEasing value "${
|
|
287
|
+
message: `Invalid transitionEasing value "${formatFrontmatterValue(value)}"; ignoring it.`,
|
|
288
288
|
...slideIndex !== void 0 ? { slideIndex } : {}
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
|
+
function formatFrontmatterValue(value) {
|
|
292
|
+
if (typeof value === "string") return value;
|
|
293
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return value.toString();
|
|
294
|
+
if (value === null) return "null";
|
|
295
|
+
try {
|
|
296
|
+
return JSON.stringify(value) ?? "";
|
|
297
|
+
} catch {
|
|
298
|
+
return "[unserializable value]";
|
|
299
|
+
}
|
|
300
|
+
}
|
|
291
301
|
function isValidTransitionDuration(value) {
|
|
292
302
|
return value.split(",").map((item) => item.trim()).every((item) => /^(?:\d+|\d*\.\d+)(?:ms|s)$/.test(item));
|
|
293
303
|
}
|
|
@@ -1129,7 +1139,7 @@ function fireAtAttributeValue(value) {
|
|
|
1129
1139
|
function zennEmbedNode(node, input) {
|
|
1130
1140
|
if (node.type !== "paragraph" || !Array.isArray(node.children) || node.children.length !== 2) return void 0;
|
|
1131
1141
|
const [prefix, link] = node.children;
|
|
1132
|
-
if (prefix?.type !== "text" ||
|
|
1142
|
+
if (prefix?.type !== "text" || typeof prefix.value !== "string" || prefix.value.trim() !== "@") return void 0;
|
|
1133
1143
|
if (link?.type !== "link" || typeof link.url !== "string") return void 0;
|
|
1134
1144
|
const name = collectMarkdownText(link).trim().toLowerCase();
|
|
1135
1145
|
if (name === "youtube") return mdxElement("EmbedFrame", [
|
package/dist/mod.d.ts
CHANGED
|
@@ -521,4 +521,4 @@ interface R2AssetSourceOptions<E extends Env = any> {
|
|
|
521
521
|
}
|
|
522
522
|
declare function withR2Assets<E extends Env = any>(source: DeckSource<E>, options: R2AssetSourceOptions<E>): DeckSource<E>;
|
|
523
523
|
//#endregion
|
|
524
|
-
export { type AssetRef, type CompileWarning, type CompiledDeck, type CompiledSlide, type ComponentPlaceholder, type ConfiguredDecks, type DeckBrowserRunBinding, type DeckBrowserRunPdfOptions, type DeckBrowserRunPngOptions, 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 DeckViewerOptions, type DeckViewerPart, type DeckViewerParts, type DeckViewerRenderControlItem, type DeckViewerRenderInput, type DecksBuildConfig, type DecksConfig, type DecksRouterConfig, type DecksRouterExtension, type DecksRouterOptions, type DecksRouterPagesOptions, type DecksRouterPresenterOptions, type MaybePromise, type R2AssetKeyInput, type R2AssetSourceOptions, type R2BucketLike, type R2BucketResolver, type R2ObjectBodyLike, type R2ObjectHttpMetadataLike, type ResolvedDeckDocument, SLIDE_TRANSITIONS, type SlideComponent, type SlideComponentDefinition, type SlideComponentInput, type SlideComponentProps, type SlideComponentRegistry, type SlideFrontmatter, type SlideTransition, createDeckPaths, createDeckViewerEmbed, defineDecksConfig, defineSlideComponents, withR2Assets };
|
|
524
|
+
export { type AssetRef, type CompileWarning, type CompiledDeck, type CompiledSlide, type ComponentPlaceholder, type ConfiguredDecks, type DeckBrowserRunBinding, type DeckBrowserRunPdfOptions, type DeckBrowserRunPngOptions, 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 DecksRouterConfig, type DecksRouterExtension, type DecksRouterOptions, type DecksRouterPagesOptions, type DecksRouterPresenterOptions, type MaybePromise, type R2AssetKeyInput, type R2AssetSourceOptions, type R2BucketLike, type R2BucketResolver, type R2ObjectBodyLike, type R2ObjectHttpMetadataLike, type ResolvedDeckDocument, SLIDE_TRANSITIONS, type SlideComponent, type SlideComponentDefinition, type SlideComponentInput, type SlideComponentProps, type SlideComponentRegistry, type SlideFrontmatter, type SlideTransition, createDeckPaths, createDeckViewerEmbed, defineDecksConfig, defineSlideComponents, withR2Assets };
|
package/dist/mod.js
CHANGED
|
@@ -292,7 +292,11 @@ function codeBlockText(value) {
|
|
|
292
292
|
if (value === null || value === void 0 || typeof value === "boolean") return "";
|
|
293
293
|
if (typeof value === "string" || typeof value === "number") return String(value);
|
|
294
294
|
if (isJsxValue(value)) return codeBlockText(value.props?.children);
|
|
295
|
-
|
|
295
|
+
try {
|
|
296
|
+
return JSON.stringify(value) ?? "";
|
|
297
|
+
} catch {
|
|
298
|
+
return "";
|
|
299
|
+
}
|
|
296
300
|
}
|
|
297
301
|
async function renderJsxValue(value) {
|
|
298
302
|
const resolved = value instanceof Promise ? await value : value;
|
package/dist/node.d.ts
CHANGED
|
@@ -295,7 +295,7 @@ interface CompileDecksInput extends BuildDeckManifestFromFileSystemInput {
|
|
|
295
295
|
out: string;
|
|
296
296
|
ogpCacheFile?: string;
|
|
297
297
|
refreshOgp?: boolean;
|
|
298
|
-
resolveOgp?(url: string): Promise<LinkCardOgpMetadata | undefined>;
|
|
298
|
+
resolveOgp?(this: void, url: string): Promise<LinkCardOgpMetadata | undefined>;
|
|
299
299
|
}
|
|
300
300
|
declare function compileDecks(input: CompileDecksInput): Promise<DeckManifest>;
|
|
301
301
|
declare function buildDeckManifestFromFileSystem(input: BuildDeckManifestFromFileSystemInput): Promise<DeckManifest>;
|
|
@@ -307,8 +307,8 @@ declare function writeDecksRouterModule(input: WriteDecksRouterModuleInput): Pro
|
|
|
307
307
|
interface CreateLocalDeckIOInput {
|
|
308
308
|
cwd: string;
|
|
309
309
|
root: string;
|
|
310
|
-
pathExists?(path: string): boolean;
|
|
311
|
-
watchFileSystem?(path: string, options: {
|
|
310
|
+
pathExists?(this: void, path: string): boolean;
|
|
311
|
+
watchFileSystem?(this: void, path: string, options: {
|
|
312
312
|
recursive: boolean;
|
|
313
313
|
}, listener: (eventType: "rename" | "change", filename: string | null) => void): {
|
|
314
314
|
close(): void;
|
|
@@ -326,7 +326,7 @@ interface CreateLocalDevSlidesAppInput {
|
|
|
326
326
|
interface LocalDevSlidesApp {
|
|
327
327
|
app: Hono;
|
|
328
328
|
localDeckIO: LocalDeckIO;
|
|
329
|
-
stop()
|
|
329
|
+
stop: () => void;
|
|
330
330
|
}
|
|
331
331
|
declare function createLocalDevSlidesApp(input: CreateLocalDevSlidesAppInput): Promise<LocalDevSlidesApp>;
|
|
332
332
|
//#endregion
|
package/dist/node.js
CHANGED
|
@@ -275,7 +275,7 @@ function takeKnownStringWithWarning(attrs, key, values, fallback, warnings, code
|
|
|
275
275
|
if (typeof value === "string" && values.includes(value)) return value;
|
|
276
276
|
warnings.push({
|
|
277
277
|
code,
|
|
278
|
-
message: `Unknown ${key} value "${
|
|
278
|
+
message: `Unknown ${key} value "${formatFrontmatterValue(value)}"; using ${fallback}.`,
|
|
279
279
|
...slideIndex !== void 0 ? { slideIndex } : {}
|
|
280
280
|
});
|
|
281
281
|
return fallback;
|
|
@@ -287,7 +287,7 @@ function takeTransitionDuration(attrs, warnings, slideIndex) {
|
|
|
287
287
|
if (typeof value === "string" && isValidTransitionDuration(value)) return value;
|
|
288
288
|
warnings.push({
|
|
289
289
|
code: "invalid-transition-duration",
|
|
290
|
-
message: `Invalid transitionDuration value "${
|
|
290
|
+
message: `Invalid transitionDuration value "${formatFrontmatterValue(value)}"; ignoring it.`,
|
|
291
291
|
...slideIndex !== void 0 ? { slideIndex } : {}
|
|
292
292
|
});
|
|
293
293
|
}
|
|
@@ -298,10 +298,20 @@ function takeTransitionEasing(attrs, warnings, slideIndex) {
|
|
|
298
298
|
if (typeof value === "string" && isValidTransitionEasing(value)) return value;
|
|
299
299
|
warnings.push({
|
|
300
300
|
code: "invalid-transition-easing",
|
|
301
|
-
message: `Invalid transitionEasing value "${
|
|
301
|
+
message: `Invalid transitionEasing value "${formatFrontmatterValue(value)}"; ignoring it.`,
|
|
302
302
|
...slideIndex !== void 0 ? { slideIndex } : {}
|
|
303
303
|
});
|
|
304
304
|
}
|
|
305
|
+
function formatFrontmatterValue(value) {
|
|
306
|
+
if (typeof value === "string") return value;
|
|
307
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return value.toString();
|
|
308
|
+
if (value === null) return "null";
|
|
309
|
+
try {
|
|
310
|
+
return JSON.stringify(value) ?? "";
|
|
311
|
+
} catch {
|
|
312
|
+
return "[unserializable value]";
|
|
313
|
+
}
|
|
314
|
+
}
|
|
305
315
|
function isValidTransitionDuration(value) {
|
|
306
316
|
return value.split(",").map((item) => item.trim()).every((item) => /^(?:\d+|\d*\.\d+)(?:ms|s)$/.test(item));
|
|
307
317
|
}
|
|
@@ -1328,7 +1338,7 @@ function fireAtAttributeValue(value) {
|
|
|
1328
1338
|
function zennEmbedNode(node, input) {
|
|
1329
1339
|
if (node.type !== "paragraph" || !Array.isArray(node.children) || node.children.length !== 2) return void 0;
|
|
1330
1340
|
const [prefix, link] = node.children;
|
|
1331
|
-
if (prefix?.type !== "text" ||
|
|
1341
|
+
if (prefix?.type !== "text" || typeof prefix.value !== "string" || prefix.value.trim() !== "@") return void 0;
|
|
1332
1342
|
if (link?.type !== "link" || typeof link.url !== "string") return void 0;
|
|
1333
1343
|
const name = collectMarkdownText(link).trim().toLowerCase();
|
|
1334
1344
|
if (name === "youtube") return mdxElement("EmbedFrame", [
|
|
@@ -2756,10 +2766,13 @@ function defineSlideComponents(input) {
|
|
|
2756
2766
|
}
|
|
2757
2767
|
function createMdxComponents(registry, input = {}) {
|
|
2758
2768
|
const components = {
|
|
2759
|
-
img: (props) => jsx("img", rewriteAssetProps(props, input.assets)),
|
|
2760
|
-
a: (props) => jsx("a", rewriteAssetProps(props, input.assets))
|
|
2769
|
+
img: (props) => jsx("img", rewriteAssetProps(props ?? {}, input.assets)),
|
|
2770
|
+
a: (props) => jsx("a", rewriteAssetProps(props ?? {}, input.assets))
|
|
2771
|
+
};
|
|
2772
|
+
for (const [name, definition] of Object.entries(registry)) components[name] = (props) => {
|
|
2773
|
+
const resolvedProps = props ?? {};
|
|
2774
|
+
return renderRegisteredComponent(name, definition, resolvedProps, resolvedProps.children, input.assets);
|
|
2761
2775
|
};
|
|
2762
|
-
for (const [name, definition] of Object.entries(registry)) components[name] = (props = {}) => renderRegisteredComponent(name, definition, props, props.children, input.assets);
|
|
2763
2776
|
return components;
|
|
2764
2777
|
}
|
|
2765
2778
|
function heroImage(props) {
|
|
@@ -2814,7 +2827,11 @@ function codeBlockText(value) {
|
|
|
2814
2827
|
if (value === null || value === void 0 || typeof value === "boolean") return "";
|
|
2815
2828
|
if (typeof value === "string" || typeof value === "number") return String(value);
|
|
2816
2829
|
if (isJsxValue(value)) return codeBlockText(value.props?.children);
|
|
2817
|
-
|
|
2830
|
+
try {
|
|
2831
|
+
return JSON.stringify(value) ?? "";
|
|
2832
|
+
} catch {
|
|
2833
|
+
return "";
|
|
2834
|
+
}
|
|
2818
2835
|
}
|
|
2819
2836
|
function renderSlideNodes(nodes, input = {}) {
|
|
2820
2837
|
return normalizeVoidElementSpacing(nodes.map((node) => String(renderSlideNode(node, input))).join(""));
|
|
@@ -3130,6 +3147,7 @@ function renderPresentationScript(nonce) {
|
|
|
3130
3147
|
let isTransitioning = false;
|
|
3131
3148
|
let pendingNavigation = null;
|
|
3132
3149
|
let transitionToken = 0;
|
|
3150
|
+
let touchStart = null;
|
|
3133
3151
|
|
|
3134
3152
|
function fitDeck() {
|
|
3135
3153
|
if (!(stage instanceof HTMLElement) || !(deck instanceof HTMLElement)) return;
|
|
@@ -3171,10 +3189,10 @@ function renderPresentationScript(nonce) {
|
|
|
3171
3189
|
const entries = slideFires(slide).map((fire) => {
|
|
3172
3190
|
const rawAt = fire.getAttribute("data-fire-at");
|
|
3173
3191
|
let position;
|
|
3174
|
-
if (rawAt !== null &&
|
|
3192
|
+
if (rawAt !== null && /^[0-9]+$/.test(rawAt)) {
|
|
3175
3193
|
position = Number(rawAt);
|
|
3176
3194
|
} else {
|
|
3177
|
-
const offset = rawAt !== null && /^[+-]
|
|
3195
|
+
const offset = rawAt !== null && /^[+-][0-9]+$/.test(rawAt) ? Number(rawAt) : 1;
|
|
3178
3196
|
cursor += offset;
|
|
3179
3197
|
position = cursor;
|
|
3180
3198
|
}
|
|
@@ -3462,6 +3480,33 @@ function renderPresentationScript(nonce) {
|
|
|
3462
3480
|
if (action === "overview") toggleOverview();
|
|
3463
3481
|
}
|
|
3464
3482
|
|
|
3483
|
+
function isInteractiveTouchTarget(target) {
|
|
3484
|
+
return target instanceof Element && Boolean(target.closest("a,button,input,select,textarea,[contenteditable],[role='button']"));
|
|
3485
|
+
}
|
|
3486
|
+
|
|
3487
|
+
function handleTouchStart(event) {
|
|
3488
|
+
if (event.touches.length !== 1 || isInteractiveTouchTarget(event.target)) {
|
|
3489
|
+
touchStart = null;
|
|
3490
|
+
return;
|
|
3491
|
+
}
|
|
3492
|
+
const touch = event.touches[0];
|
|
3493
|
+
touchStart = { x: touch.clientX, y: touch.clientY };
|
|
3494
|
+
}
|
|
3495
|
+
|
|
3496
|
+
function handleTouchEnd(event) {
|
|
3497
|
+
if (!touchStart || event.changedTouches.length !== 1) {
|
|
3498
|
+
touchStart = null;
|
|
3499
|
+
return;
|
|
3500
|
+
}
|
|
3501
|
+
const touch = event.changedTouches[0];
|
|
3502
|
+
const deltaX = touch.clientX - touchStart.x;
|
|
3503
|
+
const deltaY = touch.clientY - touchStart.y;
|
|
3504
|
+
touchStart = null;
|
|
3505
|
+
const threshold = Math.max(48, window.innerWidth * 0.08);
|
|
3506
|
+
if (Math.abs(deltaX) < threshold || Math.abs(deltaX) <= Math.abs(deltaY) * 1.25) return;
|
|
3507
|
+
handleCommand(deltaX < 0 ? "next" : "previous");
|
|
3508
|
+
}
|
|
3509
|
+
|
|
3465
3510
|
async function toggleFullscreen() {
|
|
3466
3511
|
if (document.fullscreenElement) {
|
|
3467
3512
|
await document.exitFullscreen?.();
|
|
@@ -3485,6 +3530,9 @@ function renderPresentationScript(nonce) {
|
|
|
3485
3530
|
if (event.key === "p") handleCommand("presenter");
|
|
3486
3531
|
if (event.key === "o") handleCommand("overview");
|
|
3487
3532
|
});
|
|
3533
|
+
document.addEventListener("touchstart", handleTouchStart, { passive: true });
|
|
3534
|
+
document.addEventListener("touchend", handleTouchEnd, { passive: true });
|
|
3535
|
+
document.addEventListener("touchcancel", () => { touchStart = null; }, { passive: true });
|
|
3488
3536
|
|
|
3489
3537
|
window.addEventListener("message", (event) => {
|
|
3490
3538
|
const message = event.data;
|
|
@@ -4497,7 +4545,7 @@ async function renderDeckViewerPage(input) {
|
|
|
4497
4545
|
${document.head}
|
|
4498
4546
|
</head>
|
|
4499
4547
|
<body>
|
|
4500
|
-
${await renderJsxValue(
|
|
4548
|
+
${await renderJsxValue(content)}
|
|
4501
4549
|
${renderViewerScript(document.nonce)}
|
|
4502
4550
|
</body>
|
|
4503
4551
|
</html>`;
|
|
@@ -4829,10 +4877,25 @@ async function renderDeckExternalEmbedResponse(input) {
|
|
|
4829
4877
|
mountPath,
|
|
4830
4878
|
title: deck.meta.title ?? slug
|
|
4831
4879
|
}, input.document, input.options.document);
|
|
4880
|
+
const viewerOptions = typeof input.options.viewer === "function" ? await input.options.viewer(input.context) : input.options.viewer;
|
|
4881
|
+
const controls = viewerOptions?.controls === void 0 ? { items: (_defaults, context) => [{
|
|
4882
|
+
type: "link",
|
|
4883
|
+
key: "open-viewer",
|
|
4884
|
+
href: context.meta.paths.viewer,
|
|
4885
|
+
label: "Open full viewer in new tab",
|
|
4886
|
+
icon: "external-link",
|
|
4887
|
+
attributes: {
|
|
4888
|
+
"aria-label": "Open full viewer in new tab",
|
|
4889
|
+
"data-hono-decks-viewer-link": true,
|
|
4890
|
+
target: "_blank",
|
|
4891
|
+
rel: "noreferrer"
|
|
4892
|
+
}
|
|
4893
|
+
}] } : viewerOptions.controls;
|
|
4832
4894
|
const viewer = await createDeckViewerEmbed({
|
|
4833
4895
|
deck,
|
|
4834
4896
|
mountPath,
|
|
4835
|
-
...
|
|
4897
|
+
...viewerOptions,
|
|
4898
|
+
controls,
|
|
4836
4899
|
availablePages: input.availablePages,
|
|
4837
4900
|
nonce: document.nonce
|
|
4838
4901
|
});
|
package/dist/vite.js
CHANGED
|
@@ -261,7 +261,7 @@ function takeKnownStringWithWarning(attrs, key, values, fallback, warnings, code
|
|
|
261
261
|
if (typeof value === "string" && values.includes(value)) return value;
|
|
262
262
|
warnings.push({
|
|
263
263
|
code,
|
|
264
|
-
message: `Unknown ${key} value "${
|
|
264
|
+
message: `Unknown ${key} value "${formatFrontmatterValue(value)}"; using ${fallback}.`,
|
|
265
265
|
...slideIndex !== void 0 ? { slideIndex } : {}
|
|
266
266
|
});
|
|
267
267
|
return fallback;
|
|
@@ -273,7 +273,7 @@ function takeTransitionDuration(attrs, warnings, slideIndex) {
|
|
|
273
273
|
if (typeof value === "string" && isValidTransitionDuration(value)) return value;
|
|
274
274
|
warnings.push({
|
|
275
275
|
code: "invalid-transition-duration",
|
|
276
|
-
message: `Invalid transitionDuration value "${
|
|
276
|
+
message: `Invalid transitionDuration value "${formatFrontmatterValue(value)}"; ignoring it.`,
|
|
277
277
|
...slideIndex !== void 0 ? { slideIndex } : {}
|
|
278
278
|
});
|
|
279
279
|
}
|
|
@@ -284,10 +284,20 @@ function takeTransitionEasing(attrs, warnings, slideIndex) {
|
|
|
284
284
|
if (typeof value === "string" && isValidTransitionEasing(value)) return value;
|
|
285
285
|
warnings.push({
|
|
286
286
|
code: "invalid-transition-easing",
|
|
287
|
-
message: `Invalid transitionEasing value "${
|
|
287
|
+
message: `Invalid transitionEasing value "${formatFrontmatterValue(value)}"; ignoring it.`,
|
|
288
288
|
...slideIndex !== void 0 ? { slideIndex } : {}
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
|
+
function formatFrontmatterValue(value) {
|
|
292
|
+
if (typeof value === "string") return value;
|
|
293
|
+
if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") return value.toString();
|
|
294
|
+
if (value === null) return "null";
|
|
295
|
+
try {
|
|
296
|
+
return JSON.stringify(value) ?? "";
|
|
297
|
+
} catch {
|
|
298
|
+
return "[unserializable value]";
|
|
299
|
+
}
|
|
300
|
+
}
|
|
291
301
|
function isValidTransitionDuration(value) {
|
|
292
302
|
return value.split(",").map((item) => item.trim()).every((item) => /^(?:\d+|\d*\.\d+)(?:ms|s)$/.test(item));
|
|
293
303
|
}
|
|
@@ -1129,7 +1139,7 @@ function fireAtAttributeValue(value) {
|
|
|
1129
1139
|
function zennEmbedNode(node, input) {
|
|
1130
1140
|
if (node.type !== "paragraph" || !Array.isArray(node.children) || node.children.length !== 2) return void 0;
|
|
1131
1141
|
const [prefix, link] = node.children;
|
|
1132
|
-
if (prefix?.type !== "text" ||
|
|
1142
|
+
if (prefix?.type !== "text" || typeof prefix.value !== "string" || prefix.value.trim() !== "@") return void 0;
|
|
1133
1143
|
if (link?.type !== "link" || typeof link.url !== "string") return void 0;
|
|
1134
1144
|
const name = collectMarkdownText(link).trim().toLowerCase();
|
|
1135
1145
|
if (name === "youtube") return mdxElement("EmbedFrame", [
|
|
@@ -1993,7 +2003,7 @@ function honoDecks(options = {}) {
|
|
|
1993
2003
|
if (!server) return;
|
|
1994
2004
|
const next = /* @__PURE__ */ new Set([deckRoot, configPath]);
|
|
1995
2005
|
const removed = [...watchedPaths].filter((path) => !next.has(path));
|
|
1996
|
-
if (removed.length > 0)
|
|
2006
|
+
if (removed.length > 0) server.watcher.unwatch(removed);
|
|
1997
2007
|
server.watcher.add([...next]);
|
|
1998
2008
|
watchedPaths = next;
|
|
1999
2009
|
};
|