Refresh UI components and showcase; release updated framework packages
This commit is contained in:
1 parent
d800228585
commit
c77f5e1cec
293 files changed
+22544
-35778
No files matched your search
@@ -27,6 +27,8 @@ function formatBytes(bytes: number): string {
|
||||
|
||||
/** Mount a preview, including local File/Blob sources. Dispose before reusing the host. */
|
||||
export interface MountViewerOptions {
|
||||
/** Hide the visual filename while retaining accessible labels and download names. */
|
||||
hideName?: boolean;
|
||||
richPdf?: boolean;
|
||||
/**
|
||||
* Opens covering the page, with a Close control that returns it inline. This
|
||||
@@ -83,6 +85,8 @@ export function mountViewer(
|
||||
toolbar.querySelector<HTMLElement>("[data-viewer-title]") ??
|
||||
element("span", source.name || "File");
|
||||
title.textContent = source.name || "File";
|
||||
title.hidden = options.hideName === true;
|
||||
title.setAttribute('data-viewer-title','');
|
||||
if (!toolbar.contains(title)) toolbar.append(title);
|
||||
const controls = toolbar.querySelector<HTMLElement>("[data-viewer-controls]") ?? element("span");
|
||||
const actions = toolbar.querySelector<HTMLElement>("[data-viewer-actions]") ?? element("span");
|
||||
@@ -399,6 +403,7 @@ export function startViewerRuntime(root: Document = document): () => void {
|
||||
const signature = [
|
||||
host.dataset.files,
|
||||
host.dataset.richPdf,
|
||||
host.dataset.hideName,
|
||||
host.dataset.fullScreen,
|
||||
host.dataset.layout,
|
||||
host.dataset.src,
|
||||
@@ -425,6 +430,7 @@ export function startViewerRuntime(root: Document = document): () => void {
|
||||
},
|
||||
{
|
||||
richPdf: host.dataset.richPdf === "true",
|
||||
hideName: host.dataset.hideName === "true",
|
||||
fullScreen: host.dataset.fullScreen === "true",
|
||||
layout: host.dataset.layout === "page" ? "page" : "inline",
|
||||
},
|
||||
@@ -442,6 +448,7 @@ export function startViewerRuntime(root: Document = document): () => void {
|
||||
attributes: true,
|
||||
attributeFilter: [
|
||||
"data-full-screen",
|
||||
"data-hide-name",
|
||||
"data-layout",
|
||||
"data-files",
|
||||
"data-rich-pdf",
|
||||
|
||||
Reference in new issue
Block a user