hono-decks 0.4.3 → 0.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/dist/advanced.d.ts +1 -1
- package/dist/advanced.js +17 -1
- package/dist/mod.d.ts +1 -1
- package/dist/mod.js +16 -0
- package/dist/node.d.ts +1 -1
- package/dist/node.js +17 -1
- package/package.json +1 -1
package/dist/advanced.d.ts
CHANGED
|
@@ -200,7 +200,7 @@ interface DeckManifest {
|
|
|
200
200
|
}
|
|
201
201
|
//#endregion
|
|
202
202
|
//#region src/renderer/control-icons.d.ts
|
|
203
|
-
type DeckControlIconName = "deck-list" | "home" | "viewer" | "projection" | "presenter" | "previous" | "next" | "fullscreen" | "print" | "details" | "export-pdf" | "export-png";
|
|
203
|
+
type DeckControlIconName = "deck-list" | "home" | "viewer" | "projection" | "presenter" | "previous" | "next" | "fullscreen" | "external-link" | "print" | "details" | "export-pdf" | "export-png";
|
|
204
204
|
declare function renderControlIcon(name: DeckControlIconName, className?: string): DeckRenderable;
|
|
205
205
|
declare function renderControlIconHtml(name: DeckControlIconName, className?: string): string;
|
|
206
206
|
declare function controlIconLabel(name: DeckControlIconName): string;
|
package/dist/advanced.js
CHANGED
|
@@ -545,6 +545,7 @@ function controlIconLabel(name) {
|
|
|
545
545
|
case "previous": return "Previous slide";
|
|
546
546
|
case "next": return "Next slide";
|
|
547
547
|
case "fullscreen": return "Toggle fullscreen";
|
|
548
|
+
case "external-link": return "Open link in new tab";
|
|
548
549
|
case "print": return "Print view";
|
|
549
550
|
case "details": return "Details";
|
|
550
551
|
case "export-pdf": return "Export PDF";
|
|
@@ -561,6 +562,7 @@ function controlIconPathHtml(name) {
|
|
|
561
562
|
case "previous": return "<path d=\"M15 6l-6 6 6 6\" />";
|
|
562
563
|
case "next": return "<path d=\"M9 6l6 6-6 6\" />";
|
|
563
564
|
case "fullscreen": return "<path d=\"M8 3H5a2 2 0 0 0-2 2v3\" /><path d=\"M16 3h3a2 2 0 0 1 2 2v3\" /><path d=\"M8 21H5a2 2 0 0 1-2-2v-3\" /><path d=\"M16 21h3a2 2 0 0 0 2-2v-3\" />";
|
|
565
|
+
case "external-link": return "<path d=\"M15 3h6v6\" /><path d=\"M10 14 21 3\" /><path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" />";
|
|
564
566
|
case "print": return "<path d=\"M6 9V3h12v6\" /><path d=\"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2\" /><path d=\"M6 14h12v7H6z\" />";
|
|
565
567
|
case "details": return "<circle cx=\"12\" cy=\"12\" r=\"9\" /><path d=\"M12 11v5\" /><path d=\"M12 8h.01\" />";
|
|
566
568
|
case "export-pdf": return "<path d=\"M14 3v4a2 2 0 0 0 2 2h4\" /><path d=\"M5 3h9l6 6v12H5z\" /><path d=\"M8 15h8\" /><path d=\"M8 18h5\" />";
|
|
@@ -602,6 +604,11 @@ function controlIconPaths(name) {
|
|
|
602
604
|
jsx("path", { d: "M8 21H5a2 2 0 0 1-2-2v-3" }),
|
|
603
605
|
jsx("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
|
|
604
606
|
];
|
|
607
|
+
case "external-link": return [
|
|
608
|
+
jsx("path", { d: "M15 3h6v6" }),
|
|
609
|
+
jsx("path", { d: "M10 14 21 3" }),
|
|
610
|
+
jsx("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })
|
|
611
|
+
];
|
|
605
612
|
case "print": return [
|
|
606
613
|
jsx("path", { d: "M6 9V3h12v6" }),
|
|
607
614
|
jsx("path", { d: "M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" }),
|
|
@@ -1779,6 +1786,7 @@ function renderViewerScript(nonce) {
|
|
|
1779
1786
|
const iframe = root.querySelector("iframe");
|
|
1780
1787
|
const frameOrigin = iframe?.src ? new URL(iframe.src, window.location.href).origin : window.location.origin;
|
|
1781
1788
|
const position = root.querySelector("[data-slide-position]");
|
|
1789
|
+
const viewerLinks = Array.from(root.querySelectorAll("[data-hono-decks-viewer-link]"));
|
|
1782
1790
|
const printPath = root.getAttribute("data-hono-decks-print-path") || "";
|
|
1783
1791
|
|
|
1784
1792
|
if (position && viewport) viewport.append(position);
|
|
@@ -1834,6 +1842,14 @@ function renderViewerScript(nonce) {
|
|
|
1834
1842
|
params.set("slide", String(message.index + 1));
|
|
1835
1843
|
params.set("step", String(Number.isInteger(message.stepIndex) ? message.stepIndex : 0));
|
|
1836
1844
|
window.history.replaceState(null, "", url);
|
|
1845
|
+
for (const link of viewerLinks) {
|
|
1846
|
+
const href = link.getAttribute("href");
|
|
1847
|
+
if (!href) continue;
|
|
1848
|
+
const viewerUrl = new URL(href, window.location.href);
|
|
1849
|
+
viewerUrl.searchParams.set("slide", params.get("slide"));
|
|
1850
|
+
viewerUrl.searchParams.set("step", params.get("step"));
|
|
1851
|
+
link.setAttribute("href", viewerUrl.href);
|
|
1852
|
+
}
|
|
1837
1853
|
}
|
|
1838
1854
|
|
|
1839
1855
|
function handleMessage(event) {
|
|
@@ -2521,7 +2537,7 @@ function withFrameAncestors(currentPolicy, ancestors) {
|
|
|
2521
2537
|
return directives.join("; ");
|
|
2522
2538
|
}
|
|
2523
2539
|
function externalEmbedPageStyle() {
|
|
2524
|
-
return `:root{color-scheme:dark;background:#050816}html,body{width:100%;height:100%;margin:0;overflow:hidden}body{min-height:100vh}@supports (height:100dvh){body{min-height:100dvh}}.hono-decks-embedded-viewer{width:100%;height:100%;min-height:0}.hono-decks-embedded-viewer .hono-decks-viewer-shell{position:relative;height:100%;grid-template-rows:minmax(0,1fr)}.hono-decks-embedded-viewer .hono-decks-viewport{width:min(100%,calc(100vh * 16 / 9));max-height:100%}@supports (height:100dvh){.hono-decks-embedded-viewer .hono-decks-viewport{width:min(100%,calc(100dvh * 16 / 9))}}.hono-decks-embedded-viewer .hono-decks-viewer-controls{bottom:max(.25rem,env(safe-area-inset-bottom,0px));z-index:4}`;
|
|
2540
|
+
return `:root{color-scheme:dark;background:#050816}html,body{width:100%;height:100%;margin:0;overflow:hidden}body{min-height:100vh}@supports (height:100dvh){body{min-height:100dvh}}.hono-decks-embedded-viewer{width:100%;height:100%;min-height:0;overflow:hidden}.hono-decks-embedded-viewer .hono-decks-viewer-shell{position:relative;height:100%;grid-template-rows:minmax(0,1fr);overflow:hidden}.hono-decks-embedded-viewer .hono-decks-viewport{width:min(100%,calc(100vh * 16 / 9));max-height:100%}@supports (height:100dvh){.hono-decks-embedded-viewer .hono-decks-viewport{width:min(100%,calc(100dvh * 16 / 9))}}.hono-decks-embedded-viewer .hono-decks-viewer-controls{bottom:max(.25rem,env(safe-area-inset-bottom,0px));z-index:4}`;
|
|
2525
2541
|
}
|
|
2526
2542
|
function escapeHtml$1(value) {
|
|
2527
2543
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|
package/dist/mod.d.ts
CHANGED
|
@@ -153,7 +153,7 @@ interface DeckManifest {
|
|
|
153
153
|
}
|
|
154
154
|
//#endregion
|
|
155
155
|
//#region src/renderer/control-icons.d.ts
|
|
156
|
-
type DeckControlIconName = "deck-list" | "home" | "viewer" | "projection" | "presenter" | "previous" | "next" | "fullscreen" | "print" | "details" | "export-pdf" | "export-png";
|
|
156
|
+
type DeckControlIconName = "deck-list" | "home" | "viewer" | "projection" | "presenter" | "previous" | "next" | "fullscreen" | "external-link" | "print" | "details" | "export-pdf" | "export-png";
|
|
157
157
|
//#endregion
|
|
158
158
|
//#region src/server/paths.d.ts
|
|
159
159
|
/** All public URLs for one deck. */
|
package/dist/mod.js
CHANGED
|
@@ -333,6 +333,7 @@ function controlIconLabel(name) {
|
|
|
333
333
|
case "previous": return "Previous slide";
|
|
334
334
|
case "next": return "Next slide";
|
|
335
335
|
case "fullscreen": return "Toggle fullscreen";
|
|
336
|
+
case "external-link": return "Open link in new tab";
|
|
336
337
|
case "print": return "Print view";
|
|
337
338
|
case "details": return "Details";
|
|
338
339
|
case "export-pdf": return "Export PDF";
|
|
@@ -349,6 +350,7 @@ function controlIconPathHtml(name) {
|
|
|
349
350
|
case "previous": return "<path d=\"M15 6l-6 6 6 6\" />";
|
|
350
351
|
case "next": return "<path d=\"M9 6l6 6-6 6\" />";
|
|
351
352
|
case "fullscreen": return "<path d=\"M8 3H5a2 2 0 0 0-2 2v3\" /><path d=\"M16 3h3a2 2 0 0 1 2 2v3\" /><path d=\"M8 21H5a2 2 0 0 1-2-2v-3\" /><path d=\"M16 21h3a2 2 0 0 0 2-2v-3\" />";
|
|
353
|
+
case "external-link": return "<path d=\"M15 3h6v6\" /><path d=\"M10 14 21 3\" /><path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" />";
|
|
352
354
|
case "print": return "<path d=\"M6 9V3h12v6\" /><path d=\"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2\" /><path d=\"M6 14h12v7H6z\" />";
|
|
353
355
|
case "details": return "<circle cx=\"12\" cy=\"12\" r=\"9\" /><path d=\"M12 11v5\" /><path d=\"M12 8h.01\" />";
|
|
354
356
|
case "export-pdf": return "<path d=\"M14 3v4a2 2 0 0 0 2 2h4\" /><path d=\"M5 3h9l6 6v12H5z\" /><path d=\"M8 15h8\" /><path d=\"M8 18h5\" />";
|
|
@@ -390,6 +392,11 @@ function controlIconPaths(name) {
|
|
|
390
392
|
jsx("path", { d: "M8 21H5a2 2 0 0 1-2-2v-3" }),
|
|
391
393
|
jsx("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
|
|
392
394
|
];
|
|
395
|
+
case "external-link": return [
|
|
396
|
+
jsx("path", { d: "M15 3h6v6" }),
|
|
397
|
+
jsx("path", { d: "M10 14 21 3" }),
|
|
398
|
+
jsx("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })
|
|
399
|
+
];
|
|
393
400
|
case "print": return [
|
|
394
401
|
jsx("path", { d: "M6 9V3h12v6" }),
|
|
395
402
|
jsx("path", { d: "M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" }),
|
|
@@ -475,6 +482,7 @@ function renderViewerScript(nonce) {
|
|
|
475
482
|
const iframe = root.querySelector("iframe");
|
|
476
483
|
const frameOrigin = iframe?.src ? new URL(iframe.src, window.location.href).origin : window.location.origin;
|
|
477
484
|
const position = root.querySelector("[data-slide-position]");
|
|
485
|
+
const viewerLinks = Array.from(root.querySelectorAll("[data-hono-decks-viewer-link]"));
|
|
478
486
|
const printPath = root.getAttribute("data-hono-decks-print-path") || "";
|
|
479
487
|
|
|
480
488
|
if (position && viewport) viewport.append(position);
|
|
@@ -530,6 +538,14 @@ function renderViewerScript(nonce) {
|
|
|
530
538
|
params.set("slide", String(message.index + 1));
|
|
531
539
|
params.set("step", String(Number.isInteger(message.stepIndex) ? message.stepIndex : 0));
|
|
532
540
|
window.history.replaceState(null, "", url);
|
|
541
|
+
for (const link of viewerLinks) {
|
|
542
|
+
const href = link.getAttribute("href");
|
|
543
|
+
if (!href) continue;
|
|
544
|
+
const viewerUrl = new URL(href, window.location.href);
|
|
545
|
+
viewerUrl.searchParams.set("slide", params.get("slide"));
|
|
546
|
+
viewerUrl.searchParams.set("step", params.get("step"));
|
|
547
|
+
link.setAttribute("href", viewerUrl.href);
|
|
548
|
+
}
|
|
533
549
|
}
|
|
534
550
|
|
|
535
551
|
function handleMessage(event) {
|
package/dist/node.d.ts
CHANGED
|
@@ -331,7 +331,7 @@ interface LocalDevSlidesApp {
|
|
|
331
331
|
declare function createLocalDevSlidesApp(input: CreateLocalDevSlidesAppInput): Promise<LocalDevSlidesApp>;
|
|
332
332
|
//#endregion
|
|
333
333
|
//#region src/renderer/control-icons.d.ts
|
|
334
|
-
type DeckControlIconName = "deck-list" | "home" | "viewer" | "projection" | "presenter" | "previous" | "next" | "fullscreen" | "print" | "details" | "export-pdf" | "export-png";
|
|
334
|
+
type DeckControlIconName = "deck-list" | "home" | "viewer" | "projection" | "presenter" | "previous" | "next" | "fullscreen" | "external-link" | "print" | "details" | "export-pdf" | "export-png";
|
|
335
335
|
//#endregion
|
|
336
336
|
//#region src/server/paths.d.ts
|
|
337
337
|
/** All public URLs for one deck. */
|
package/dist/node.js
CHANGED
|
@@ -2968,6 +2968,7 @@ function controlIconLabel(name) {
|
|
|
2968
2968
|
case "previous": return "Previous slide";
|
|
2969
2969
|
case "next": return "Next slide";
|
|
2970
2970
|
case "fullscreen": return "Toggle fullscreen";
|
|
2971
|
+
case "external-link": return "Open link in new tab";
|
|
2971
2972
|
case "print": return "Print view";
|
|
2972
2973
|
case "details": return "Details";
|
|
2973
2974
|
case "export-pdf": return "Export PDF";
|
|
@@ -2984,6 +2985,7 @@ function controlIconPathHtml(name) {
|
|
|
2984
2985
|
case "previous": return "<path d=\"M15 6l-6 6 6 6\" />";
|
|
2985
2986
|
case "next": return "<path d=\"M9 6l6 6-6 6\" />";
|
|
2986
2987
|
case "fullscreen": return "<path d=\"M8 3H5a2 2 0 0 0-2 2v3\" /><path d=\"M16 3h3a2 2 0 0 1 2 2v3\" /><path d=\"M8 21H5a2 2 0 0 1-2-2v-3\" /><path d=\"M16 21h3a2 2 0 0 0 2-2v-3\" />";
|
|
2988
|
+
case "external-link": return "<path d=\"M15 3h6v6\" /><path d=\"M10 14 21 3\" /><path d=\"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\" />";
|
|
2987
2989
|
case "print": return "<path d=\"M6 9V3h12v6\" /><path d=\"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2\" /><path d=\"M6 14h12v7H6z\" />";
|
|
2988
2990
|
case "details": return "<circle cx=\"12\" cy=\"12\" r=\"9\" /><path d=\"M12 11v5\" /><path d=\"M12 8h.01\" />";
|
|
2989
2991
|
case "export-pdf": return "<path d=\"M14 3v4a2 2 0 0 0 2 2h4\" /><path d=\"M5 3h9l6 6v12H5z\" /><path d=\"M8 15h8\" /><path d=\"M8 18h5\" />";
|
|
@@ -3025,6 +3027,11 @@ function controlIconPaths(name) {
|
|
|
3025
3027
|
jsx("path", { d: "M8 21H5a2 2 0 0 1-2-2v-3" }),
|
|
3026
3028
|
jsx("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
|
|
3027
3029
|
];
|
|
3030
|
+
case "external-link": return [
|
|
3031
|
+
jsx("path", { d: "M15 3h6v6" }),
|
|
3032
|
+
jsx("path", { d: "M10 14 21 3" }),
|
|
3033
|
+
jsx("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })
|
|
3034
|
+
];
|
|
3028
3035
|
case "print": return [
|
|
3029
3036
|
jsx("path", { d: "M6 9V3h12v6" }),
|
|
3030
3037
|
jsx("path", { d: "M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" }),
|
|
@@ -4139,6 +4146,7 @@ function renderViewerScript(nonce) {
|
|
|
4139
4146
|
const iframe = root.querySelector("iframe");
|
|
4140
4147
|
const frameOrigin = iframe?.src ? new URL(iframe.src, window.location.href).origin : window.location.origin;
|
|
4141
4148
|
const position = root.querySelector("[data-slide-position]");
|
|
4149
|
+
const viewerLinks = Array.from(root.querySelectorAll("[data-hono-decks-viewer-link]"));
|
|
4142
4150
|
const printPath = root.getAttribute("data-hono-decks-print-path") || "";
|
|
4143
4151
|
|
|
4144
4152
|
if (position && viewport) viewport.append(position);
|
|
@@ -4194,6 +4202,14 @@ function renderViewerScript(nonce) {
|
|
|
4194
4202
|
params.set("slide", String(message.index + 1));
|
|
4195
4203
|
params.set("step", String(Number.isInteger(message.stepIndex) ? message.stepIndex : 0));
|
|
4196
4204
|
window.history.replaceState(null, "", url);
|
|
4205
|
+
for (const link of viewerLinks) {
|
|
4206
|
+
const href = link.getAttribute("href");
|
|
4207
|
+
if (!href) continue;
|
|
4208
|
+
const viewerUrl = new URL(href, window.location.href);
|
|
4209
|
+
viewerUrl.searchParams.set("slide", params.get("slide"));
|
|
4210
|
+
viewerUrl.searchParams.set("step", params.get("step"));
|
|
4211
|
+
link.setAttribute("href", viewerUrl.href);
|
|
4212
|
+
}
|
|
4197
4213
|
}
|
|
4198
4214
|
|
|
4199
4215
|
function handleMessage(event) {
|
|
@@ -4881,7 +4897,7 @@ function withFrameAncestors(currentPolicy, ancestors) {
|
|
|
4881
4897
|
return directives.join("; ");
|
|
4882
4898
|
}
|
|
4883
4899
|
function externalEmbedPageStyle() {
|
|
4884
|
-
return `:root{color-scheme:dark;background:#050816}html,body{width:100%;height:100%;margin:0;overflow:hidden}body{min-height:100vh}@supports (height:100dvh){body{min-height:100dvh}}.hono-decks-embedded-viewer{width:100%;height:100%;min-height:0}.hono-decks-embedded-viewer .hono-decks-viewer-shell{position:relative;height:100%;grid-template-rows:minmax(0,1fr)}.hono-decks-embedded-viewer .hono-decks-viewport{width:min(100%,calc(100vh * 16 / 9));max-height:100%}@supports (height:100dvh){.hono-decks-embedded-viewer .hono-decks-viewport{width:min(100%,calc(100dvh * 16 / 9))}}.hono-decks-embedded-viewer .hono-decks-viewer-controls{bottom:max(.25rem,env(safe-area-inset-bottom,0px));z-index:4}`;
|
|
4900
|
+
return `:root{color-scheme:dark;background:#050816}html,body{width:100%;height:100%;margin:0;overflow:hidden}body{min-height:100vh}@supports (height:100dvh){body{min-height:100dvh}}.hono-decks-embedded-viewer{width:100%;height:100%;min-height:0;overflow:hidden}.hono-decks-embedded-viewer .hono-decks-viewer-shell{position:relative;height:100%;grid-template-rows:minmax(0,1fr);overflow:hidden}.hono-decks-embedded-viewer .hono-decks-viewport{width:min(100%,calc(100vh * 16 / 9));max-height:100%}@supports (height:100dvh){.hono-decks-embedded-viewer .hono-decks-viewport{width:min(100%,calc(100dvh * 16 / 9))}}.hono-decks-embedded-viewer .hono-decks-viewer-controls{bottom:max(.25rem,env(safe-area-inset-bottom,0px));z-index:4}`;
|
|
4885
4901
|
}
|
|
4886
4902
|
function escapeHtml$2(value) {
|
|
4887
4903
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """).replaceAll("'", "'");
|