@floegence/floe-webapp-core 0.64.0 → 0.65.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/dist/PDFJS-LICENSE +177 -0
- package/dist/images/altText_add.svg +3 -0
- package/dist/images/altText_disclaimer.svg +3 -0
- package/dist/images/altText_done.svg +3 -0
- package/dist/images/altText_spinner.svg +30 -0
- package/dist/images/altText_warning.svg +3 -0
- package/dist/images/annotation-check.svg +11 -0
- package/dist/images/annotation-comment.svg +16 -0
- package/dist/images/annotation-help.svg +26 -0
- package/dist/images/annotation-insert.svg +10 -0
- package/dist/images/annotation-key.svg +11 -0
- package/dist/images/annotation-newparagraph.svg +11 -0
- package/dist/images/annotation-noicon.svg +7 -0
- package/dist/images/annotation-note.svg +42 -0
- package/dist/images/annotation-paperclip.svg +6 -0
- package/dist/images/annotation-paragraph.svg +16 -0
- package/dist/images/annotation-pushpin.svg +7 -0
- package/dist/images/checkmark.svg +5 -0
- package/dist/images/comment-actionsButton.svg +3 -0
- package/dist/images/comment-closeButton.svg +3 -0
- package/dist/images/comment-editButton.svg +8 -0
- package/dist/images/comment-popup-editButton.svg +5 -0
- package/dist/images/cursor-editorFreeHighlight.svg +6 -0
- package/dist/images/cursor-editorFreeText.svg +3 -0
- package/dist/images/cursor-editorInk.svg +4 -0
- package/dist/images/cursor-editorTextHighlight.svg +8 -0
- package/dist/images/editor-toolbar-delete.svg +5 -0
- package/dist/images/editor-toolbar-edit.svg +3 -0
- package/dist/images/findbarButton-next.svg +3 -0
- package/dist/images/findbarButton-previous.svg +3 -0
- package/dist/images/gv-toolbarButton-download.svg +3 -0
- package/dist/images/loading-icon.gif +0 -0
- package/dist/images/loading.svg +1 -0
- package/dist/images/messageBar_closingButton.svg +3 -0
- package/dist/images/messageBar_info.svg +3 -0
- package/dist/images/messageBar_warning.svg +3 -0
- package/dist/images/pages_closeButton.svg +3 -0
- package/dist/images/pages_selected.svg +7 -0
- package/dist/images/pages_viewArrow.svg +3 -0
- package/dist/images/pages_viewButton.svg +3 -0
- package/dist/images/secondaryToolbarButton-documentProperties.svg +3 -0
- package/dist/images/secondaryToolbarButton-firstPage.svg +3 -0
- package/dist/images/secondaryToolbarButton-handTool.svg +3 -0
- package/dist/images/secondaryToolbarButton-lastPage.svg +3 -0
- package/dist/images/secondaryToolbarButton-rotateCcw.svg +3 -0
- package/dist/images/secondaryToolbarButton-rotateCw.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollHorizontal.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollPage.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollVertical.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollWrapped.svg +3 -0
- package/dist/images/secondaryToolbarButton-selectTool.svg +3 -0
- package/dist/images/secondaryToolbarButton-spreadEven.svg +3 -0
- package/dist/images/secondaryToolbarButton-spreadNone.svg +3 -0
- package/dist/images/secondaryToolbarButton-spreadOdd.svg +3 -0
- package/dist/images/signature-properties-row-check.svg +4 -0
- package/dist/images/toolbarButton-bookmark.svg +3 -0
- package/dist/images/toolbarButton-currentOutlineItem.svg +3 -0
- package/dist/images/toolbarButton-download.svg +4 -0
- package/dist/images/toolbarButton-editorFreeText.svg +5 -0
- package/dist/images/toolbarButton-editorHighlight.svg +6 -0
- package/dist/images/toolbarButton-editorInk.svg +4 -0
- package/dist/images/toolbarButton-editorSignature.svg +6 -0
- package/dist/images/toolbarButton-editorStamp.svg +8 -0
- package/dist/images/toolbarButton-menuArrow.svg +3 -0
- package/dist/images/toolbarButton-menuArrowNova.svg +3 -0
- package/dist/images/toolbarButton-openFile.svg +3 -0
- package/dist/images/toolbarButton-pageDown.svg +3 -0
- package/dist/images/toolbarButton-pageUp.svg +3 -0
- package/dist/images/toolbarButton-presentationMode.svg +3 -0
- package/dist/images/toolbarButton-print.svg +3 -0
- package/dist/images/toolbarButton-search.svg +3 -0
- package/dist/images/toolbarButton-secondaryToolbarToggle.svg +3 -0
- package/dist/images/toolbarButton-signaturePropertiesError.svg +7 -0
- package/dist/images/toolbarButton-signaturePropertiesVerified.svg +7 -0
- package/dist/images/toolbarButton-viewAttachments.svg +3 -0
- package/dist/images/toolbarButton-viewLayers.svg +3 -0
- package/dist/images/toolbarButton-viewOutline.svg +3 -0
- package/dist/images/toolbarButton-viewThumbnail.svg +3 -0
- package/dist/images/toolbarButton-viewsManagerToggle.svg +3 -0
- package/dist/images/toolbarButton-zoomIn.svg +3 -0
- package/dist/images/toolbarButton-zoomOut.svg +3 -0
- package/dist/images/treeitem-collapsed.svg +1 -0
- package/dist/images/treeitem-expanded.svg +1 -0
- package/dist/pdf/PdfDocumentSurface.d.ts +71 -0
- package/dist/pdf/PdfDocumentSurface.js +235 -0
- package/dist/pdf/localization.d.ts +21 -0
- package/dist/pdf/localization.js +50 -0
- package/dist/pdf.css +6428 -0
- package/dist/pdf.d.ts +5 -0
- package/dist/pdf.js +7 -0
- package/package.json +16 -4
- package/scripts/pdf-assets.d.mts +2 -0
- package/scripts/pdf-assets.mjs +52 -0
package/dist/pdf.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { openPdfDocument, PdfDocumentSurface } from './pdf/PdfDocumentSurface';
|
|
2
|
+
export type { PdfSurfaceOptions, PdfEditorState, PdfSearchState, PdfPageRenderer } from './pdf/PdfDocumentSurface';
|
|
3
|
+
export type { PDFDocumentProxy, PDFPageProxy } from 'pdfjs-dist';
|
|
4
|
+
export { PdfLocalization } from './pdf/localization';
|
|
5
|
+
export type { PdfLocalize, PdfLocalizedMessage } from './pdf/localization';
|
package/dist/pdf.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floegence/floe-webapp-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.65.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -91,15 +91,26 @@
|
|
|
91
91
|
},
|
|
92
92
|
"./styles": "./dist/styles.css",
|
|
93
93
|
"./tailwind": "./dist/tailwind.css",
|
|
94
|
-
"./input-focus.css": "./dist/input-focus.css"
|
|
94
|
+
"./input-focus.css": "./dist/input-focus.css",
|
|
95
|
+
"./pdf": {
|
|
96
|
+
"types": "./dist/pdf.d.ts",
|
|
97
|
+
"import": "./dist/pdf.js"
|
|
98
|
+
},
|
|
99
|
+
"./pdf.css": "./dist/pdf.css",
|
|
100
|
+
"./pdf-assets": {
|
|
101
|
+
"types": "./scripts/pdf-assets.d.mts",
|
|
102
|
+
"import": "./scripts/pdf-assets.mjs"
|
|
103
|
+
}
|
|
95
104
|
},
|
|
96
105
|
"files": [
|
|
97
|
-
"dist"
|
|
106
|
+
"dist",
|
|
107
|
+
"scripts/pdf-assets.mjs",
|
|
108
|
+
"scripts/pdf-assets.d.mts"
|
|
98
109
|
],
|
|
99
110
|
"scripts": {
|
|
100
111
|
"dev": "node ./scripts/dev.mjs",
|
|
101
112
|
"build": "pnpm clean && pnpm build:shell-theme-css && vite build && tsc -p tsconfig.build.json && pnpm build:styles && pnpm build:assets",
|
|
102
|
-
"build:assets": "node ./scripts/copy-style-assets.mjs",
|
|
113
|
+
"build:assets": "node ./scripts/copy-style-assets.mjs && node ./scripts/build-pdf-styles.mjs",
|
|
103
114
|
"build:shell-theme-css": "node ./scripts/generate-shell-theme-css.mjs",
|
|
104
115
|
"build:styles": "vite build -c vite.styles.config.ts",
|
|
105
116
|
"typecheck": "tsc --noEmit",
|
|
@@ -114,6 +125,7 @@
|
|
|
114
125
|
"marked": "^17.0.1",
|
|
115
126
|
"mermaid": "^11.16.0",
|
|
116
127
|
"monaco-editor": "^0.55.1",
|
|
128
|
+
"pdfjs-dist": "6.3.289",
|
|
117
129
|
"shiki": "^3.21.0",
|
|
118
130
|
"solid-motionone": "^1.0.4",
|
|
119
131
|
"tailwind-merge": "^3.4.0"
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { URL } from 'node:url';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { dirname, join } from 'node:path';
|
|
4
|
+
import { readdirSync, readFileSync } from 'node:fs';
|
|
5
|
+
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const root = dirname(require.resolve('pdfjs-dist/package.json'));
|
|
8
|
+
const version = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')).version;
|
|
9
|
+
const prefix = `pdf-assets/${version}/`;
|
|
10
|
+
const files = new Map();
|
|
11
|
+
function collect(directory) {
|
|
12
|
+
for (const entry of readdirSync(join(root, directory), { withFileTypes: true })) {
|
|
13
|
+
const file = join(directory, entry.name);
|
|
14
|
+
if (entry.isDirectory()) collect(file);
|
|
15
|
+
else files.set(file.replaceAll('\\', '/'), join(root, file));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
for (const directory of ['cmaps', 'standard_fonts', 'wasm', 'iccs', 'web/images']) collect(directory);
|
|
19
|
+
files.set('pdf.worker.min.mjs', join(root, 'build/pdf.worker.min.mjs'));
|
|
20
|
+
files.set('LICENSE', join(root, 'LICENSE'));
|
|
21
|
+
for (const [name, path] of [...files]) if (name.startsWith('web/')) {
|
|
22
|
+
files.delete(name); files.set(name.slice(4), path);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Vite-compatible asset plugin. Keeps workers, CMaps, fonts, codecs and their
|
|
26
|
+
* original notices self-hosted and versioned, outside the initial JS graph. */
|
|
27
|
+
export function pdfAssetsPlugin() {
|
|
28
|
+
let base = '/';
|
|
29
|
+
return {
|
|
30
|
+
name: 'floe-pdf-assets',
|
|
31
|
+
configResolved(config) { base = config.base; },
|
|
32
|
+
resolveId(id) { if (id === 'virtual:floe-pdf-assets') return '\0virtual:floe-pdf-assets'; },
|
|
33
|
+
load(id) {
|
|
34
|
+
if (id === '\0virtual:floe-pdf-assets') return `export default new URL(${JSON.stringify(base + prefix)}, globalThis.location.href).href;`;
|
|
35
|
+
},
|
|
36
|
+
configureServer(server) {
|
|
37
|
+
server.middlewares.use((req, res, next) => {
|
|
38
|
+
const pathname = new URL(req.url, 'http://localhost').pathname;
|
|
39
|
+
const candidates = [base + prefix, '/' + prefix];
|
|
40
|
+
const matched = candidates.find(candidate => pathname.startsWith(candidate));
|
|
41
|
+
const file = matched && files.get(pathname.slice(matched.length));
|
|
42
|
+
if (!file) return next();
|
|
43
|
+
const type = file.endsWith('.mjs') ? 'text/javascript' : file.endsWith('.svg') ? 'image/svg+xml' : file.endsWith('.wasm') ? 'application/wasm' : 'application/octet-stream';
|
|
44
|
+
res.setHeader('Content-Type', type);
|
|
45
|
+
res.end(readFileSync(file));
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
generateBundle() {
|
|
49
|
+
for (const [name, file] of files) this.emitFile({ type: 'asset', fileName: prefix + name, source: readFileSync(file) });
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|