Make PDF Viewer a native feature
- Move the PDF Viewer plugin into src/lib/features/pdf/ with pdfjs-dist 6.4.299 (minified builds). - A static pdf document type marks PDF files and opens them as tabs. The first PDF tab loads the module. - The worker, the character maps, the fonts, and the decoders come from the app. One worker for each tab. - The toolbar uses IconButton and the shared tooltip, with the new zoom-in, zoom-out, fit-width, and rotate icons. - Add THIRD_PARTY_NOTICES.md for PDF.js and xterm. - Update the tests, the menu inventory, the docs, and UI-059.
This commit is contained in:
@@ -12,7 +12,7 @@ import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
/** The feature folders. The runtime files directly in `src/lib/features/` stay in the main bundle. */
|
||||
export const FEATURE_FOLDERS = ["git", "background", "terminal"];
|
||||
export const FEATURE_FOLDERS = ["git", "background", "terminal", "pdf"];
|
||||
/** Libraries that only features need. */
|
||||
export const FEATURE_LIBRARIES = ["@xterm", "pdfjs-dist", "yaml"];
|
||||
|
||||
|
||||
@@ -57,6 +57,11 @@ export const TABLE = {
|
||||
pdf: {
|
||||
plugin: { id: "runestone.pdf-viewer", repo: "runestone-pdf-viewer", tag: "v0.0.5", zip: `${PLUGIN_RELEASES}/RuneStone_PDF_Viewer/releases/runestone.pdf-viewer-0.0.5.zip` },
|
||||
nativeKey: "pdf",
|
||||
/**
|
||||
* Both modes use the same names. Native: the tree row opens a PDF tab, and the first tab loads the PDF Viewer feature
|
||||
* and PDF.js (src/lib/features/pdf/), so the action includes that load. Each page canvas is an image named "PDF page N",
|
||||
* and the page field is a spin button named "Page number". Enter in the field goes to the page.
|
||||
*/
|
||||
row: '[data-tree-rel="sample.pdf"]',
|
||||
firstPage: "PDF page 1",
|
||||
pageInput: "Page number",
|
||||
|
||||
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'node:url';
|
||||
|
||||
const root = fileURLToPath(new URL('../', import.meta.url));
|
||||
const pluginRepos = process.env.RUNESTONE_PLUGIN_REPOS || path.resolve(root, '..');
|
||||
export const projects = ['RuneStone', 'RuneStone_Project_Management', 'RuneStone_Background_Slideshow', 'RuneStone_Local_Autocomplete', 'RuneStone_PDF_Viewer', 'RuneStone_CSV_Viewer'];
|
||||
export const projects = ['RuneStone', 'RuneStone_Project_Management', 'RuneStone_Background_Slideshow', 'RuneStone_Local_Autocomplete', 'RuneStone_CSV_Viewer'];
|
||||
const patterns = {
|
||||
action: /\b(?:showActionMenu|actionMenu)\s*\(/g,
|
||||
svelteMenu: /<ContextMenu\b/g,
|
||||
|
||||
Reference in New Issue
Block a user