feat(transcode): add PDF preview, sprite generation, and annotation support

This commit is contained in:
yiling
2026-07-18 10:32:38 +08:00
parent 3383079787
commit bc1491bed5
31 changed files with 928 additions and 46 deletions
+3
View File
@@ -451,6 +451,9 @@ export * from "./download_original_file.js";
export * from "./zoom_out.js";
export * from "./zoom_in.js";
export * from "./fit.js";
export * from "./previous_page.js";
export * from "./next_page.js";
export * from "./page_of_pages.js";
export * from "./copy_image_to_clipboard.js";
export * from "./download_original_image.js";
export * from "./no_item_selected.js";
+3
View File
@@ -453,6 +453,9 @@ export * from './download_original_file.js'
export * from './zoom_out.js'
export * from './zoom_in.js'
export * from './fit.js'
export * from './previous_page.js'
export * from './next_page.js'
export * from './page_of_pages.js'
export * from './copy_image_to_clipboard.js'
export * from './download_original_image.js'
export * from './no_item_selected.js'
+1 -1
View File
@@ -10,7 +10,7 @@ const en_fit = /** @type {(inputs: FitInputs) => LocalizedString} */ () => {
};
const zh_fit = /** @type {(inputs: FitInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`适应`)
return /** @type {LocalizedString} */ (`适应窗口`)
};
/**
+16
View File
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Next Page" |
*
* @param {Next_PageInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const next_page: ((inputs?: Next_PageInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Next_PageInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Next_PageInputs = {};
+29
View File
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Next_PageInputs */
const en_next_page = /** @type {(inputs: Next_PageInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Next Page`)
};
const zh_next_page = /** @type {(inputs: Next_PageInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`下一页`)
};
/**
* | output |
* | --- |
* | "Next Page" |
*
* @param {Next_PageInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const next_page = /** @type {((inputs?: Next_PageInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Next_PageInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_next_page(inputs)
return zh_next_page(inputs)
});
+19
View File
@@ -0,0 +1,19 @@
/**
* | output |
* | --- |
* | "Page {current} of {total}" |
*
* @param {Page_Of_PagesInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const page_of_pages: ((inputs: Page_Of_PagesInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Page_Of_PagesInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Page_Of_PagesInputs = {
current: NonNullable<unknown>;
total: NonNullable<unknown>;
};
+29
View File
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{ current: NonNullable<unknown>, total: NonNullable<unknown> }} Page_Of_PagesInputs */
const en_page_of_pages = /** @type {(inputs: Page_Of_PagesInputs) => LocalizedString} */ (i) => {
return /** @type {LocalizedString} */ (`Page ${i?.current} of ${i?.total}`)
};
const zh_page_of_pages = /** @type {(inputs: Page_Of_PagesInputs) => LocalizedString} */ (i) => {
return /** @type {LocalizedString} */ (`第 ${i?.current} / ${i?.total} 页`)
};
/**
* | output |
* | --- |
* | "Page {current} of {total}" |
*
* @param {Page_Of_PagesInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const page_of_pages = /** @type {((inputs: Page_Of_PagesInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Page_Of_PagesInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_page_of_pages(inputs)
return zh_page_of_pages(inputs)
});
+16
View File
@@ -0,0 +1,16 @@
/**
* | output |
* | --- |
* | "Previous Page" |
*
* @param {Previous_PageInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const previous_page: ((inputs?: Previous_PageInputs, options?: {
locale?: "en" | "zh";
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Previous_PageInputs, {
locale?: "en" | "zh";
}, {}>;
export type LocalizedString = import("../runtime.js").LocalizedString;
export type Previous_PageInputs = {};
+29
View File
@@ -0,0 +1,29 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js';
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Previous_PageInputs */
const en_previous_page = /** @type {(inputs: Previous_PageInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Previous Page`)
};
const zh_previous_page = /** @type {(inputs: Previous_PageInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`上一页`)
};
/**
* | output |
* | --- |
* | "Previous Page" |
*
* @param {Previous_PageInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const previous_page = /** @type {((inputs?: Previous_PageInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Previous_PageInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === "en") return en_previous_page(inputs)
return zh_previous_page(inputs)
});