@open-file-viewer/core 0.1.22 → 0.1.24
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/README.md +23 -2
- package/dist/cpp-EDJNJWGR.js +4 -0
- package/dist/cpp-EDJNJWGR.js.map +1 -0
- package/dist/index.cjs +481 -135
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +422 -135
- package/dist/index.js.map +1 -1
- package/dist/json5-EAGAEIPM.js +4 -0
- package/dist/json5-EAGAEIPM.js.map +1 -0
- package/dist/php-TTFBGZ5Q.js +4 -0
- package/dist/php-TTFBGZ5Q.js.map +1 -0
- package/dist/scala-V5QQ35QA.js +4 -0
- package/dist/scala-V5QQ35QA.js.map +1 -0
- package/dist/style.css +43 -0
- package/dist/tsx-A26VGWUK.js +5 -0
- package/dist/tsx-A26VGWUK.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,6 +24,15 @@ PDF preview requires `pdfjs-dist`:
|
|
|
24
24
|
npm install pdfjs-dist
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
### Vite / Rollup dependency chunks
|
|
28
|
+
|
|
29
|
+
Text grammars, Markdown, and email parsers load asynchronously when their plugins are first used.
|
|
30
|
+
Prism language chunks are loaded in dependency order, so applications do not need to preload parent
|
|
31
|
+
grammars such as Java before Scala. In monorepos, `resolve.dedupe: ["prismjs"]` prevents duplicate
|
|
32
|
+
Prism runtimes. Keep `/prismjs/components/` out of catch-all vendor `manualChunks` rules so the
|
|
33
|
+
side-effectful language modules remain separate on-demand chunks and execute in dependency order.
|
|
34
|
+
`postal-mime` and `@kenjiuno/msgreader` may optionally share an `ofv-email` chunk.
|
|
35
|
+
|
|
27
36
|
DWG geometry preview uses optional LibreDWG WASM. The package can be installed by applications that want the default built-in DWG linework path:
|
|
28
37
|
|
|
29
38
|
```bash
|
|
@@ -123,6 +132,14 @@ pdfPlugin({
|
|
|
123
132
|
This keeps compatibility at the cost of holding one extra copy of the PDF in memory, so use it only
|
|
124
133
|
for affected environments.
|
|
125
134
|
|
|
135
|
+
For 360 Secure Browser, 360 Extreme Browser, and older Chromium kernels, `pdfPlugin()` defaults to
|
|
136
|
+
`compatibilityMode: "auto"`. It installs the `Promise.withResolvers` compatibility shim when needed
|
|
137
|
+
and selects the matching PDF.js legacy worker. If an enterprise browser hides its 360 user-agent
|
|
138
|
+
marker, force the compatibility path with `pdfPlugin({ compatibilityMode: "legacy" })`. When
|
|
139
|
+
self-hosting that worker, point `workerSrc` to the same-version
|
|
140
|
+
`pdfjs-dist/legacy/build/pdf.worker.min.mjs`. Use `compatibilityMode: "modern"` only when targeting
|
|
141
|
+
modern Chrome or Edge exclusively.
|
|
142
|
+
|
|
126
143
|
## High-Fidelity Office Conversion
|
|
127
144
|
|
|
128
145
|
Browser-side Office renderers cannot perfectly reproduce Word/WPS layout for files with anchored
|
|
@@ -251,7 +268,7 @@ Use `toolbar.render(ctx)` when you need to replace the toolbar completely. The c
|
|
|
251
268
|
|
|
252
269
|
## Locale and Fallback Text
|
|
253
270
|
|
|
254
|
-
|
|
271
|
+
Built-in states, fallback panels, toolbar labels, and plugin messages default to English. Set `locale: "zh-CN"` for Simplified Chinese, or override individual PDF, image, text, Office, and custom-plugin strings with `messages`:
|
|
255
272
|
|
|
256
273
|
```ts
|
|
257
274
|
createViewer({
|
|
@@ -260,12 +277,16 @@ createViewer({
|
|
|
260
277
|
locale: "zh-CN",
|
|
261
278
|
messages: {
|
|
262
279
|
unsupportedTitle: "No inline preview available",
|
|
263
|
-
downloadFile: "Download original file"
|
|
280
|
+
downloadFile: "Download original file",
|
|
281
|
+
pdfPreviewFailedTitle: "Unable to open report",
|
|
282
|
+
imageDownload: "Save original image"
|
|
264
283
|
},
|
|
265
284
|
plugins
|
|
266
285
|
});
|
|
267
286
|
```
|
|
268
287
|
|
|
288
|
+
The PDF viewer includes a synchronized page navigator with previous/next buttons and a numeric page input. Enter a page number and press Enter to jump directly to it.
|
|
289
|
+
|
|
269
290
|
## License
|
|
270
291
|
|
|
271
292
|
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/plugins/prism-languages/cpp.ts"],"sourcesContent":["import \"prismjs/components/prism-c\";\nimport \"prismjs/components/prism-cpp\";\n"],"mappings":";AAAA,OAAO;AACP,OAAO;","names":[]}
|