@docmentis/udoc-viewer 0.5.24 → 0.6.1
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 +161 -28
- package/dist/package.json +7 -5
- package/dist/src/UDocClient.d.ts +42 -12
- package/dist/src/UDocClient.d.ts.map +1 -1
- package/dist/src/UDocClient.js +7 -6
- package/dist/src/UDocClient.js.map +1 -1
- package/dist/src/UDocViewer.d.ts +48 -3
- package/dist/src/UDocViewer.d.ts.map +1 -1
- package/dist/src/UDocViewer.js +139 -15
- package/dist/src/UDocViewer.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/performance/PerformanceCounter.d.ts +1 -1
- package/dist/src/performance/PerformanceCounter.d.ts.map +1 -1
- package/dist/src/performance/PerformanceCounter.js.map +1 -1
- package/dist/src/telemetry.d.ts +3 -1
- package/dist/src/telemetry.d.ts.map +1 -1
- package/dist/src/telemetry.js +11 -1
- package/dist/src/telemetry.js.map +1 -1
- package/dist/src/ui/viewer/actions.d.ts +40 -1
- package/dist/src/ui/viewer/actions.d.ts.map +1 -1
- package/dist/src/ui/viewer/components/RightPanel.d.ts.map +1 -1
- package/dist/src/ui/viewer/components/RightPanel.js +5 -1
- package/dist/src/ui/viewer/components/RightPanel.js.map +1 -1
- package/dist/src/ui/viewer/components/SearchPanel.d.ts +20 -0
- package/dist/src/ui/viewer/components/SearchPanel.d.ts.map +1 -0
- package/dist/src/ui/viewer/components/SearchPanel.js +246 -0
- package/dist/src/ui/viewer/components/SearchPanel.js.map +1 -0
- package/dist/src/ui/viewer/components/Spread.d.ts +2 -0
- package/dist/src/ui/viewer/components/Spread.d.ts.map +1 -1
- package/dist/src/ui/viewer/components/Spread.js +64 -0
- package/dist/src/ui/viewer/components/Spread.js.map +1 -1
- package/dist/src/ui/viewer/components/Toolbar.d.ts.map +1 -1
- package/dist/src/ui/viewer/components/Toolbar.js +27 -2
- package/dist/src/ui/viewer/components/Toolbar.js.map +1 -1
- package/dist/src/ui/viewer/components/Viewport.d.ts.map +1 -1
- package/dist/src/ui/viewer/components/Viewport.js +15 -2
- package/dist/src/ui/viewer/components/Viewport.js.map +1 -1
- package/dist/src/ui/viewer/effects.d.ts.map +1 -1
- package/dist/src/ui/viewer/effects.js +106 -0
- package/dist/src/ui/viewer/effects.js.map +1 -1
- package/dist/src/ui/viewer/icons.d.ts +4 -0
- package/dist/src/ui/viewer/icons.d.ts.map +1 -1
- package/dist/src/ui/viewer/icons.js +5 -0
- package/dist/src/ui/viewer/icons.js.map +1 -1
- package/dist/src/ui/viewer/reducer.d.ts.map +1 -1
- package/dist/src/ui/viewer/reducer.js +100 -6
- package/dist/src/ui/viewer/reducer.js.map +1 -1
- package/dist/src/ui/viewer/search/index.d.ts +2 -0
- package/dist/src/ui/viewer/search/index.d.ts.map +1 -0
- package/dist/src/ui/viewer/search/index.js +2 -0
- package/dist/src/ui/viewer/search/index.js.map +1 -0
- package/dist/src/ui/viewer/search/search.d.ts +19 -0
- package/dist/src/ui/viewer/search/search.d.ts.map +1 -0
- package/dist/src/ui/viewer/search/search.js +120 -0
- package/dist/src/ui/viewer/search/search.js.map +1 -0
- package/dist/src/ui/viewer/shell.d.ts.map +1 -1
- package/dist/src/ui/viewer/shell.js +59 -2
- package/dist/src/ui/viewer/shell.js.map +1 -1
- package/dist/src/ui/viewer/state.d.ts +42 -1
- package/dist/src/ui/viewer/state.d.ts.map +1 -1
- package/dist/src/ui/viewer/state.js +12 -0
- package/dist/src/ui/viewer/state.js.map +1 -1
- package/dist/src/ui/viewer/styles-inline.d.ts +1 -1
- package/dist/src/ui/viewer/styles-inline.d.ts.map +1 -1
- package/dist/src/ui/viewer/styles-inline.js +556 -153
- package/dist/src/ui/viewer/styles-inline.js.map +1 -1
- package/dist/src/ui/viewer/text/render.d.ts +2 -0
- package/dist/src/ui/viewer/text/render.d.ts.map +1 -1
- package/dist/src/ui/viewer/text/render.js +41 -111
- package/dist/src/ui/viewer/text/render.js.map +1 -1
- package/dist/src/wasm/udoc.d.ts +14 -18
- package/dist/src/wasm/udoc.js +40 -22
- package/dist/src/wasm/udoc_bg.wasm +0 -0
- package/dist/src/wasm/udoc_bg.wasm.d.ts +1 -0
- package/dist/src/worker/WorkerClient.d.ts +5 -0
- package/dist/src/worker/WorkerClient.d.ts.map +1 -1
- package/dist/src/worker/WorkerClient.js +12 -0
- package/dist/src/worker/WorkerClient.js.map +1 -1
- package/dist/src/worker/worker-inline.js +1 -1
- package/dist/src/worker/worker.d.ts +12 -0
- package/dist/src/worker/worker.d.ts.map +1 -1
- package/dist/src/worker/worker.js +47 -24
- package/dist/src/worker/worker.js.map +1 -1
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @docmentis/udoc-viewer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Universal document viewer for the web.
|
|
4
|
+
|
|
5
|
+
Open-source, framework-agnostic viewer powered by a built-from-scratch WebAssembly engine for high-fidelity rendering across PDF, DOCX, PPTX, and images.
|
|
4
6
|
|
|
5
7
|
[](https://www.npmjs.com/package/@docmentis/udoc-viewer)
|
|
6
8
|
[](./LICENSE)
|
|
@@ -13,7 +15,7 @@ A free, open-source, universal document viewer for the web. Render PDF, PPTX, an
|
|
|
13
15
|
|
|
14
16
|
Most web document viewers only handle PDF, rely on server-side rendering, or require expensive commercial licenses. udoc-viewer is different:
|
|
15
17
|
|
|
16
|
-
- **Truly universal** — PDF, PowerPoint, and images in a single viewer, with more formats coming
|
|
18
|
+
- **Truly universal** — PDF, Word, PowerPoint, and images in a single viewer, with more formats coming
|
|
17
19
|
- **High fidelity** — powered by a custom Rust/WebAssembly rendering engine, not PDF.js
|
|
18
20
|
- **Client-side only** — everything runs in the browser, no server round-trips
|
|
19
21
|
- **Framework agnostic** — works with React, Vue, Angular, Svelte, or plain HTML
|
|
@@ -24,6 +26,7 @@ Most web document viewers only handle PDF, rely on server-side rendering, or req
|
|
|
24
26
|
| Format | Extensions |
|
|
25
27
|
| ------ | ------------------------------------------------------------------------------------------------- |
|
|
26
28
|
| PDF | .pdf |
|
|
29
|
+
| DOCX | .docx |
|
|
27
30
|
| PPTX | .pptx |
|
|
28
31
|
| Images | .png, .jpg, .jpeg, .gif, .webp, .bmp, .tif, .tiff, .ico, .tga, .ppm, .pgm, .pbm, .hdr, .exr, .qoi |
|
|
29
32
|
|
|
@@ -116,7 +119,7 @@ Full working examples for every major framework are in the [`examples/`](../../e
|
|
|
116
119
|
|
|
117
120
|
## Features
|
|
118
121
|
|
|
119
|
-
- 📄 **Multi-format rendering** — PDF, PPTX, and images in one unified viewer
|
|
122
|
+
- 📄 **Multi-format rendering** — PDF, DOCX, PPTX, and images in one unified viewer
|
|
120
123
|
- 🎯 **High-fidelity output** — custom Rust rendering engine compiled to WebAssembly
|
|
121
124
|
- 🔍 **Zoom & navigation** — toolbar with zoom controls, page thumbnails, and keyboard navigation
|
|
122
125
|
- 📱 **Responsive** — works on desktop and mobile browsers
|
|
@@ -136,10 +139,6 @@ const client = await UDocClient.create({
|
|
|
136
139
|
// Custom base URL for worker and WASM files (optional)
|
|
137
140
|
// Expected files: {baseUrl}/worker.js and {baseUrl}/udoc_bg.wasm
|
|
138
141
|
baseUrl: "https://cdn.example.com/udoc/",
|
|
139
|
-
|
|
140
|
-
// Enable anonymous usage telemetry (default: true)
|
|
141
|
-
// Set to false to disable. See the Telemetry section below for details.
|
|
142
|
-
telemetry: true,
|
|
143
142
|
});
|
|
144
143
|
```
|
|
145
144
|
|
|
@@ -150,6 +149,8 @@ const viewer = await client.createViewer({
|
|
|
150
149
|
// Container element or CSS selector (required for UI mode, omit for headless)
|
|
151
150
|
container: "#viewer",
|
|
152
151
|
|
|
152
|
+
// --- View modes ---
|
|
153
|
+
|
|
153
154
|
// Scroll mode: 'continuous' or 'spread' (default: 'continuous')
|
|
154
155
|
scrollMode: "continuous",
|
|
155
156
|
|
|
@@ -157,7 +158,15 @@ const viewer = await client.createViewer({
|
|
|
157
158
|
// (default: 'single-page')
|
|
158
159
|
layoutMode: "single-page",
|
|
159
160
|
|
|
160
|
-
//
|
|
161
|
+
// Initial page rotation: 0, 90, 180, or 270 (default: 0)
|
|
162
|
+
pageRotation: 0,
|
|
163
|
+
|
|
164
|
+
// Spacing mode: 'all', 'none', 'spread-only', 'page-only' (default: 'all')
|
|
165
|
+
spacingMode: "all",
|
|
166
|
+
|
|
167
|
+
// --- Zoom ---
|
|
168
|
+
|
|
169
|
+
// Zoom mode: 'fit-spread-width', 'fit-spread-width-max', 'fit-spread-height', 'fit-spread', 'custom'
|
|
161
170
|
// (default: 'fit-spread-width')
|
|
162
171
|
zoomMode: "fit-spread-width",
|
|
163
172
|
|
|
@@ -168,6 +177,12 @@ const viewer = await client.createViewer({
|
|
|
168
177
|
// (default: [0.1, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4, 5])
|
|
169
178
|
zoomSteps: [0.1, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4, 5],
|
|
170
179
|
|
|
180
|
+
// Zoom range limits (default: 0.1 and 5)
|
|
181
|
+
minZoom: 0.1,
|
|
182
|
+
maxZoom: 5,
|
|
183
|
+
|
|
184
|
+
// --- Spacing & layout ---
|
|
185
|
+
|
|
171
186
|
// Spacing between pages in pixels (default: 10)
|
|
172
187
|
pageSpacing: 10,
|
|
173
188
|
|
|
@@ -178,28 +193,33 @@ const viewer = await client.createViewer({
|
|
|
178
193
|
// Height is derived automatically from the page aspect ratio
|
|
179
194
|
thumbnailWidth: 150,
|
|
180
195
|
|
|
181
|
-
// Initially active panel, or null for no panel (default: null)
|
|
182
|
-
// Left panels: 'thumbnail', 'outline', 'bookmarks', 'layers', 'attachments'
|
|
183
|
-
// Right panels: 'search', 'comments'
|
|
184
|
-
activePanel: null,
|
|
185
|
-
|
|
186
196
|
// Target display DPI (default: 96)
|
|
187
197
|
dpi: 96,
|
|
188
198
|
|
|
199
|
+
// --- Theme ---
|
|
200
|
+
|
|
201
|
+
// Color theme: 'light', 'dark', or 'system' (default: 'light')
|
|
202
|
+
theme: "light",
|
|
203
|
+
|
|
204
|
+
// Hide the theme toggle button (default: false)
|
|
205
|
+
disableThemeSwitching: false,
|
|
206
|
+
|
|
207
|
+
// --- Features ---
|
|
208
|
+
|
|
209
|
+
// Disable text selection and copying (default: false)
|
|
210
|
+
disableTextSelection: false,
|
|
211
|
+
|
|
189
212
|
// Enable Google Fonts for automatic font fetching (default: true)
|
|
190
213
|
googleFonts: true,
|
|
191
214
|
|
|
192
|
-
//
|
|
193
|
-
enablePerformanceCounter: false,
|
|
215
|
+
// --- Panels ---
|
|
194
216
|
|
|
195
|
-
//
|
|
196
|
-
//
|
|
197
|
-
|
|
217
|
+
// Initially active panel, or null for no panel (default: null)
|
|
218
|
+
// Left panels: 'thumbnail', 'outline', 'bookmarks', 'layers', 'attachments'
|
|
219
|
+
// Right panels: 'search', 'comments'
|
|
220
|
+
activePanel: null,
|
|
198
221
|
|
|
199
|
-
//
|
|
200
|
-
hideToolbar: false, // Hide the top toolbar
|
|
201
|
-
hideFloatingToolbar: false, // Hide the floating toolbar (page nav, zoom, view mode)
|
|
202
|
-
disableFullscreen: false, // Remove the fullscreen button
|
|
222
|
+
// Disable individual panel tabs (all default to false)
|
|
203
223
|
disableLeftPanel: false, // Disable the entire left panel area
|
|
204
224
|
disableRightPanel: false, // Disable the entire right panel area
|
|
205
225
|
disableThumbnails: false, // Disable the thumbnails tab
|
|
@@ -209,6 +229,29 @@ const viewer = await client.createViewer({
|
|
|
209
229
|
disableAttachments: false, // Disable the attachments tab
|
|
210
230
|
disableSearch: false, // Disable the search panel
|
|
211
231
|
disableComments: false, // Disable the comments panel
|
|
232
|
+
|
|
233
|
+
// --- UI visibility ---
|
|
234
|
+
|
|
235
|
+
// Hide the top toolbar (default: false)
|
|
236
|
+
hideToolbar: false,
|
|
237
|
+
|
|
238
|
+
// Hide the floating toolbar (page nav, zoom, view mode) (default: false)
|
|
239
|
+
hideFloatingToolbar: false,
|
|
240
|
+
|
|
241
|
+
// Remove the fullscreen button (default: false)
|
|
242
|
+
disableFullscreen: false,
|
|
243
|
+
|
|
244
|
+
// --- Advanced ---
|
|
245
|
+
|
|
246
|
+
// Enable performance tracking (default: false)
|
|
247
|
+
enablePerformanceCounter: false,
|
|
248
|
+
|
|
249
|
+
// Callback for performance log entries (called when enablePerformanceCounter is true)
|
|
250
|
+
onPerformanceLog: (entry) => console.log(entry),
|
|
251
|
+
|
|
252
|
+
// Hide the "Powered by docMentis" attribution link (default: false)
|
|
253
|
+
// Requires a valid license with the "no_attribution" feature
|
|
254
|
+
hideAttribution: true,
|
|
212
255
|
});
|
|
213
256
|
```
|
|
214
257
|
|
|
@@ -281,6 +324,8 @@ viewer.zoomIn();
|
|
|
281
324
|
viewer.zoomOut();
|
|
282
325
|
viewer.setZoom(1.5); // 150%
|
|
283
326
|
viewer.setZoomMode("fit-spread-width");
|
|
327
|
+
viewer.setMinZoom(0.5); // clamp minimum to 50%
|
|
328
|
+
viewer.setMaxZoom(3); // clamp maximum to 300%
|
|
284
329
|
console.log(viewer.zoom); // current zoom level
|
|
285
330
|
console.log(viewer.zoomMode); // current zoom mode
|
|
286
331
|
|
|
@@ -290,6 +335,14 @@ viewer.setLayoutMode("double-page"); // 'single-page' | 'double-page' | ...
|
|
|
290
335
|
viewer.setPageRotation(90); // 0 | 90 | 180 | 270
|
|
291
336
|
viewer.setSpacingMode("none"); // 'all' | 'none' | 'spread-only' | 'page-only'
|
|
292
337
|
|
|
338
|
+
// Theme
|
|
339
|
+
viewer.setTheme("dark"); // 'light' | 'dark' | 'system'
|
|
340
|
+
viewer.setThemeSwitchingEnabled(false); // hide theme toggle button
|
|
341
|
+
console.log(viewer.theme); // current theme
|
|
342
|
+
|
|
343
|
+
// Text selection
|
|
344
|
+
viewer.setTextSelectionEnabled(false); // disable text selection
|
|
345
|
+
|
|
293
346
|
// Fullscreen
|
|
294
347
|
viewer.setFullscreen(true);
|
|
295
348
|
console.log(viewer.isFullscreen);
|
|
@@ -321,6 +374,91 @@ viewer.openPanel("outline");
|
|
|
321
374
|
viewer.closePanel();
|
|
322
375
|
```
|
|
323
376
|
|
|
377
|
+
### Programmatic Search
|
|
378
|
+
|
|
379
|
+
Search document text programmatically — useful for custom search UIs:
|
|
380
|
+
|
|
381
|
+
```typescript
|
|
382
|
+
// Open search panel and search for text
|
|
383
|
+
viewer.search("hello world");
|
|
384
|
+
|
|
385
|
+
// Search with options
|
|
386
|
+
viewer.search("hello", { caseSensitive: true });
|
|
387
|
+
|
|
388
|
+
// Navigate between matches
|
|
389
|
+
viewer.searchNext();
|
|
390
|
+
viewer.searchPrev();
|
|
391
|
+
|
|
392
|
+
// Clear search
|
|
393
|
+
viewer.clearSearch();
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
### CSS Customization
|
|
397
|
+
|
|
398
|
+
The viewer uses CSS custom properties (variables) for all colors, shadows, and borders. Since no Shadow DOM is used, you can override any variable from your own stylesheet:
|
|
399
|
+
|
|
400
|
+
```css
|
|
401
|
+
/* Override the primary color */
|
|
402
|
+
.udoc-viewer-root {
|
|
403
|
+
--udoc-primary: #e91e63;
|
|
404
|
+
--udoc-primary-hover: #c2185b;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/* Override dark theme colors */
|
|
408
|
+
.udoc-viewer-root.udoc-viewer-dark {
|
|
409
|
+
--udoc-primary: #f48fb1;
|
|
410
|
+
--udoc-primary-hover: #f06292;
|
|
411
|
+
}
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
#### Available CSS Variables
|
|
415
|
+
|
|
416
|
+
| Variable | Description | Light Default | Dark Default |
|
|
417
|
+
| -------------------------------- | ---------------------- | ----------------------------- | ---------------------------- |
|
|
418
|
+
| **Backgrounds** | | | |
|
|
419
|
+
| `--udoc-bg-viewport` | Viewport background | `#e0e0e0` | `#1a1a1a` |
|
|
420
|
+
| `--udoc-bg-surface` | Page / card surface | `#fff` | `#2d2d2d` |
|
|
421
|
+
| `--udoc-bg-panel` | Side panel background | `#f5f5f5` | `#252525` |
|
|
422
|
+
| `--udoc-bg-panel-tabs` | Panel tab bar | `#e8e8e8` | `#1e1e1e` |
|
|
423
|
+
| `--udoc-bg-input` | Input fields | `#fff` | `#3a3a3a` |
|
|
424
|
+
| `--udoc-bg-overlay` | Modal overlay | `rgba(0,0,0,0.5)` | `rgba(0,0,0,0.7)` |
|
|
425
|
+
| **Text** | | | |
|
|
426
|
+
| `--udoc-text-primary` | Primary text | `rgba(0,0,0,0.8)` | `rgba(255,255,255,0.87)` |
|
|
427
|
+
| `--udoc-text-secondary` | Secondary text | `rgba(0,0,0,0.7)` | `rgba(255,255,255,0.7)` |
|
|
428
|
+
| `--udoc-text-muted` | Muted text | `rgba(0,0,0,0.5)` | `rgba(255,255,255,0.5)` |
|
|
429
|
+
| `--udoc-text-disabled` | Disabled text | `rgba(0,0,0,0.25)` | `rgba(255,255,255,0.25)` |
|
|
430
|
+
| `--udoc-text-placeholder` | Placeholder text | `#999` | `#777` |
|
|
431
|
+
| `--udoc-text-on-primary` | Text on primary color | `#fff` | `#fff` |
|
|
432
|
+
| **Primary color** | | | |
|
|
433
|
+
| `--udoc-primary` | Primary / accent color | `#0066cc` | `#4da6ff` |
|
|
434
|
+
| `--udoc-primary-hover` | Primary hover state | `#0052a3` | `#80bfff` |
|
|
435
|
+
| `--udoc-primary-focus-ring` | Focus ring color | `rgba(0,102,204,0.2)` | `rgba(77,166,255,0.25)` |
|
|
436
|
+
| **Borders** | | | |
|
|
437
|
+
| `--udoc-border` | Default border | `#ddd` | `#444` |
|
|
438
|
+
| `--udoc-border-input` | Input border | `#ccc` | `#555` |
|
|
439
|
+
| `--udoc-border-light` | Light border | `#eee` | `#3a3a3a` |
|
|
440
|
+
| **Shadows** | | | |
|
|
441
|
+
| `--udoc-shadow-page` | Page shadow | `0 2px 8px rgba(0,0,0,0.15)` | `0 2px 8px rgba(0,0,0,0.4)` |
|
|
442
|
+
| `--udoc-shadow-toolbar` | Toolbar shadow | `0 2px 12px rgba(0,0,0,0.15)` | `0 2px 12px rgba(0,0,0,0.4)` |
|
|
443
|
+
| `--udoc-shadow-dropdown` | Dropdown shadow | `0 4px 16px rgba(0,0,0,0.2)` | `0 4px 16px rgba(0,0,0,0.5)` |
|
|
444
|
+
| **Search** | | | |
|
|
445
|
+
| `--udoc-search-highlight` | Search match highlight | `rgba(255,200,0,0.35)` | `rgba(255,200,0,0.4)` |
|
|
446
|
+
| `--udoc-search-highlight-active` | Active match highlight | `rgba(255,140,0,0.6)` | `rgba(255,140,0,0.65)` |
|
|
447
|
+
| **Selection** | | | |
|
|
448
|
+
| `--udoc-text-selection` | Text selection color | `rgba(0,120,215,0.3)` | `rgba(77,166,255,0.35)` |
|
|
449
|
+
| **Scrollbar** | | | |
|
|
450
|
+
| `--udoc-scrollbar-thumb` | Scrollbar thumb | `rgba(0,0,0,0.3)` | `rgba(255,255,255,0.3)` |
|
|
451
|
+
| `--udoc-scrollbar-thumb-hover` | Scrollbar thumb hover | `rgba(0,0,0,0.5)` | `rgba(255,255,255,0.5)` |
|
|
452
|
+
| **Errors** | | | |
|
|
453
|
+
| `--udoc-error-bg` | Error background | `#fef2f2` | `#3a1c1c` |
|
|
454
|
+
| `--udoc-error-border` | Error border | `#fecaca` | `#6b2c2c` |
|
|
455
|
+
| `--udoc-error-text` | Error text | `#dc2626` | `#f87171` |
|
|
456
|
+
| **Progress** | | | |
|
|
457
|
+
| `--udoc-progress-track` | Progress bar track | `#e5e7eb` | `#404040` |
|
|
458
|
+
| `--udoc-progress-fill` | Progress bar fill | `#0066cc` | `#4da6ff` |
|
|
459
|
+
|
|
460
|
+
> The full list of variables is defined in `src/ui/viewer/styles.css`. All viewer styles are scoped under `.udoc-viewer-root`, so your overrides won't leak into the rest of the page.
|
|
461
|
+
|
|
324
462
|
### Events
|
|
325
463
|
|
|
326
464
|
```typescript
|
|
@@ -487,6 +625,7 @@ udoc-viewer collects anonymous, non-personally-identifiable usage data to help u
|
|
|
487
625
|
| `format` | Document format | `pdf` |
|
|
488
626
|
| `size_bucket` | File size in units of 100 KB (`floor(bytes / 100000)`) | `3` |
|
|
489
627
|
| `viewer_version` | SDK version string | `0.5.19` |
|
|
628
|
+
| `license_hash` | SHA-256 hash of the license key (empty if none) | `a1b2c3...` |
|
|
490
629
|
|
|
491
630
|
**What we do NOT collect:**
|
|
492
631
|
|
|
@@ -495,12 +634,6 @@ udoc-viewer collects anonymous, non-personally-identifiable usage data to help u
|
|
|
495
634
|
- IP addresses (disabled at the collection endpoint)
|
|
496
635
|
- Any other personally identifiable information
|
|
497
636
|
|
|
498
|
-
**Opt out** by passing `telemetry: false` when creating the client:
|
|
499
|
-
|
|
500
|
-
```js
|
|
501
|
-
const client = await UDocClient.create({ telemetry: false });
|
|
502
|
-
```
|
|
503
|
-
|
|
504
637
|
Data is sent to [PostHog](https://posthog.com) via the HTTP capture API using `navigator.sendBeacon` (with `fetch` fallback). No third-party SDK is loaded.
|
|
505
638
|
|
|
506
639
|
## Licensing
|
package/dist/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docmentis/udoc-viewer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"description": "
|
|
7
|
-
"homepage": "https://docmentis.com
|
|
6
|
+
"description": "Universal document viewer for the web — open-source, framework-agnostic viewer powered by a built-from-scratch WebAssembly engine for high-fidelity rendering across PDF, DOCX, PPTX, and images.",
|
|
7
|
+
"homepage": "https://www.docmentis.com",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/docMentis/docmentis-udoc-viewer.git",
|
|
@@ -15,16 +15,18 @@
|
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"pdf",
|
|
18
|
+
"docx",
|
|
19
|
+
"word",
|
|
18
20
|
"pptx",
|
|
19
21
|
"powerpoint",
|
|
20
22
|
"viewer",
|
|
21
23
|
"document",
|
|
22
24
|
"document-viewer",
|
|
25
|
+
"docx-viewer",
|
|
23
26
|
"pdf-viewer",
|
|
24
27
|
"wasm",
|
|
25
28
|
"webassembly",
|
|
26
|
-
"image-viewer"
|
|
27
|
-
"client-side"
|
|
29
|
+
"image-viewer"
|
|
28
30
|
],
|
|
29
31
|
"main": "dist/src/index.js",
|
|
30
32
|
"types": "dist/src/index.d.ts",
|
package/dist/src/UDocClient.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { WorkerClient } from "./worker/index.js";
|
|
7
7
|
import type { Composition, ComposePick, ExtractedFont, ExtractedImage, SplitByOutlineResult } from "./worker/index.js";
|
|
8
8
|
import { UDocViewer } from "./UDocViewer.js";
|
|
9
|
-
import type { ScrollMode, LayoutMode, ZoomMode, PanelTab } from "./ui/viewer/state.js";
|
|
9
|
+
import type { ScrollMode, LayoutMode, ZoomMode, PanelTab, ThemeMode, SpacingMode, PageRotation } from "./ui/viewer/state.js";
|
|
10
10
|
import type { PerformanceLogCallback } from "./performance/index.js";
|
|
11
11
|
/**
|
|
12
12
|
* License information for the client.
|
|
@@ -65,16 +65,6 @@ export interface ClientOptions {
|
|
|
65
65
|
* @default 'en'
|
|
66
66
|
*/
|
|
67
67
|
locale?: string;
|
|
68
|
-
/**
|
|
69
|
-
* Enable anonymous usage telemetry.
|
|
70
|
-
*
|
|
71
|
-
* When enabled, a lightweight beacon is sent on each document open
|
|
72
|
-
* with: hostname, document format, file-size bucket (per 100 KB),
|
|
73
|
-
* and viewer version. No PII or document content is collected.
|
|
74
|
-
*
|
|
75
|
-
* @default true
|
|
76
|
-
*/
|
|
77
|
-
telemetry?: boolean;
|
|
78
68
|
}
|
|
79
69
|
/**
|
|
80
70
|
* Options for creating a viewer.
|
|
@@ -225,6 +215,46 @@ export interface ViewerOptions {
|
|
|
225
215
|
* @default false
|
|
226
216
|
*/
|
|
227
217
|
disableComments?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Color theme for the viewer UI.
|
|
220
|
+
* - 'light': Light theme (default)
|
|
221
|
+
* - 'dark': Dark theme
|
|
222
|
+
* - 'system': Follow operating system preference
|
|
223
|
+
* @default 'light'
|
|
224
|
+
*/
|
|
225
|
+
theme?: ThemeMode;
|
|
226
|
+
/**
|
|
227
|
+
* Disable the theme toggle button in the toolbar.
|
|
228
|
+
* The theme can still be changed programmatically via setTheme().
|
|
229
|
+
* @default false
|
|
230
|
+
*/
|
|
231
|
+
disableThemeSwitching?: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Disable text selection in the viewer.
|
|
234
|
+
* When true, users cannot select or copy text from rendered documents.
|
|
235
|
+
* @default false
|
|
236
|
+
*/
|
|
237
|
+
disableTextSelection?: boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Initial page rotation in degrees.
|
|
240
|
+
* @default 0
|
|
241
|
+
*/
|
|
242
|
+
pageRotation?: PageRotation;
|
|
243
|
+
/**
|
|
244
|
+
* Initial spacing mode between pages and spreads.
|
|
245
|
+
* @default 'all'
|
|
246
|
+
*/
|
|
247
|
+
spacingMode?: SpacingMode;
|
|
248
|
+
/**
|
|
249
|
+
* Minimum zoom level.
|
|
250
|
+
* @default 0.1
|
|
251
|
+
*/
|
|
252
|
+
minZoom?: number;
|
|
253
|
+
/**
|
|
254
|
+
* Maximum zoom level.
|
|
255
|
+
* @default 5
|
|
256
|
+
*/
|
|
257
|
+
maxZoom?: number;
|
|
228
258
|
}
|
|
229
259
|
/**
|
|
230
260
|
* A document source can be:
|
|
@@ -273,7 +303,7 @@ export declare class UDocClient {
|
|
|
273
303
|
private options;
|
|
274
304
|
private viewers;
|
|
275
305
|
private destroyed;
|
|
276
|
-
private
|
|
306
|
+
private licenseHash;
|
|
277
307
|
private licenseInfo;
|
|
278
308
|
private constructor();
|
|
279
309
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UDocClient.d.ts","sourceRoot":"","sources":["../../src/UDocClient.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"UDocClient.d.ts","sourceRoot":"","sources":["../../src/UDocClient.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,KAAK,EAER,WAAW,EACX,WAAW,EACX,aAAa,EACb,cAAc,EACd,oBAAoB,EACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EACR,UAAU,EACV,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,WAAW,EACX,YAAY,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,WAAW;IACxB;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;IAE1B;;OAEG;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE/B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC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AC,UAAU,CAAC;IAe3D;;;;;;;;;;;;;;;OAeG;IACG,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAe7D;;;OAGG;YACW,UAAU;IAoCxB;;OAEG;IACH,OAAO,CAAC,cAAc;IAUtB;;;OAGG;IACH,OAAO,IAAI,IAAI;IAef;;;OAGG;IACH,eAAe,IAAI,YAAY;IAI/B,OAAO,CAAC,kBAAkB;CAK7B"}
|
package/dist/src/UDocClient.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Manages the WASM engine and provides document operations.
|
|
5
5
|
*/
|
|
6
6
|
import { WorkerClient } from "./worker/index.js";
|
|
7
|
+
import { hashLicense } from "./telemetry.js";
|
|
7
8
|
import { UDocViewer } from "./UDocViewer.js";
|
|
8
9
|
/**
|
|
9
10
|
* SDK entry point for document viewing.
|
|
@@ -14,12 +15,12 @@ export class UDocClient {
|
|
|
14
15
|
/**
|
|
15
16
|
* SDK version string (replaced at build time).
|
|
16
17
|
*/
|
|
17
|
-
static version = "0.
|
|
18
|
+
static version = "0.6.1";
|
|
18
19
|
workerClient;
|
|
19
20
|
options;
|
|
20
21
|
viewers = new Set();
|
|
21
22
|
destroyed = false;
|
|
22
|
-
|
|
23
|
+
licenseHash = "";
|
|
23
24
|
licenseInfo = {
|
|
24
25
|
valid: true,
|
|
25
26
|
tier: "free",
|
|
@@ -29,7 +30,6 @@ export class UDocClient {
|
|
|
29
30
|
constructor(workerClient, options) {
|
|
30
31
|
this.workerClient = workerClient;
|
|
31
32
|
this.options = options;
|
|
32
|
-
this.telemetryEnabled = options.telemetry !== false;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Create and initialize a client instance.
|
|
@@ -79,6 +79,7 @@ export class UDocClient {
|
|
|
79
79
|
const domain = typeof window !== "undefined" ? window.location.hostname : "localhost";
|
|
80
80
|
const result = await workerClient.setLicense(options.license, domain);
|
|
81
81
|
client.licenseInfo = licenseResultToInfo(result);
|
|
82
|
+
client.licenseHash = await hashLicense(options.license);
|
|
82
83
|
if (!result.valid) {
|
|
83
84
|
console.warn(`[udoc-viewer] License validation failed: ${result.error}`);
|
|
84
85
|
}
|
|
@@ -107,7 +108,7 @@ export class UDocClient {
|
|
|
107
108
|
async createViewer(options = {}) {
|
|
108
109
|
this.ensureNotDestroyed();
|
|
109
110
|
const showAttribution = !(options.hideAttribution && this.hasFeature("no_attribution"));
|
|
110
|
-
const viewer = new UDocViewer(this.workerClient, options, showAttribution,
|
|
111
|
+
const viewer = new UDocViewer(this.workerClient, options, showAttribution, UDocClient.version, this.licenseHash);
|
|
111
112
|
this.viewers.add(viewer);
|
|
112
113
|
return viewer;
|
|
113
114
|
}
|
|
@@ -187,7 +188,7 @@ export class UDocClient {
|
|
|
187
188
|
// Create viewers for the composed documents
|
|
188
189
|
const viewers = [];
|
|
189
190
|
for (const docId of newDocIds) {
|
|
190
|
-
const viewer = new UDocViewer(this.workerClient, {}, true,
|
|
191
|
+
const viewer = new UDocViewer(this.workerClient, {}, true, UDocClient.version, this.licenseHash);
|
|
191
192
|
await viewer.initializeFromDocId(docId);
|
|
192
193
|
this.viewers.add(viewer);
|
|
193
194
|
viewers.push(viewer);
|
|
@@ -229,7 +230,7 @@ export class UDocClient {
|
|
|
229
230
|
// Create viewers for the split documents
|
|
230
231
|
const viewers = [];
|
|
231
232
|
for (const newDocId of result.documentIds) {
|
|
232
|
-
const viewer = new UDocViewer(this.workerClient, {}, true,
|
|
233
|
+
const viewer = new UDocViewer(this.workerClient, {}, true, UDocClient.version, this.licenseHash);
|
|
233
234
|
await viewer.initializeFromDocId(newDocId);
|
|
234
235
|
this.viewers.add(viewer);
|
|
235
236
|
viewers.push(viewer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UDocClient.js","sourceRoot":"","sources":["../../src/UDocClient.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,C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SAAS,mBAAmB,CAAC,MAAqB;IAC9C,MAAM,mBAAmB,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAChG,OAAO;QACH,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,IAAI,EAAE,MAAM,CAAC,KAAK,IAAI,mBAAmB,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM;QAC/D,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3E,KAAK,EAAE,MAAM,CAAC,KAAK;KACtB,CAAC;AACN,CAAC"}
|
package/dist/src/UDocViewer.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { ViewerOptions } from "./UDocClient.js";
|
|
|
9
9
|
import type { Destination, OutlineItem } from "./ui/viewer/navigation.js";
|
|
10
10
|
import type { Annotation } from "./ui/viewer/annotation/index.js";
|
|
11
11
|
export type { Annotation } from "./ui/viewer/annotation/index.js";
|
|
12
|
-
import { type PanelTab, type ScrollMode, type LayoutMode, type ZoomMode, type PageRotation, type SpacingMode } from "./ui/viewer/state.js";
|
|
12
|
+
import { type PanelTab, type ScrollMode, type LayoutMode, type ZoomMode, type PageRotation, type SpacingMode, type ThemeMode } from "./ui/viewer/state.js";
|
|
13
13
|
import { type IPerformanceCounter } from "./performance/index.js";
|
|
14
14
|
/**
|
|
15
15
|
* Options for rendering a page.
|
|
@@ -138,13 +138,13 @@ export declare class UDocViewer {
|
|
|
138
138
|
private viewOverrides;
|
|
139
139
|
private currentFormat;
|
|
140
140
|
private storeUnsub;
|
|
141
|
-
private telemetryEnabled;
|
|
142
141
|
private sdkVersion;
|
|
142
|
+
private licenseHash;
|
|
143
143
|
/**
|
|
144
144
|
* @internal
|
|
145
145
|
* Use `client.createViewer()` instead.
|
|
146
146
|
*/
|
|
147
|
-
constructor(workerClient: WorkerClient, options?: ViewerOptions, showAttribution?: boolean,
|
|
147
|
+
constructor(workerClient: WorkerClient, options?: ViewerOptions, showAttribution?: boolean, sdkVersion?: string, licenseHash?: string);
|
|
148
148
|
/**
|
|
149
149
|
* Performance counter for tracking operation timings.
|
|
150
150
|
* Only records data when `enablePerformanceCounter` is true.
|
|
@@ -300,6 +300,29 @@ export declare class UDocViewer {
|
|
|
300
300
|
* Enable or disable the fullscreen button.
|
|
301
301
|
*/
|
|
302
302
|
setFullscreenEnabled(enabled: boolean): void;
|
|
303
|
+
/** Current theme mode. */
|
|
304
|
+
get theme(): ThemeMode;
|
|
305
|
+
/**
|
|
306
|
+
* Set the viewer color theme.
|
|
307
|
+
* @param theme - 'light', 'dark', or 'system'
|
|
308
|
+
*/
|
|
309
|
+
setTheme(theme: ThemeMode): void;
|
|
310
|
+
/**
|
|
311
|
+
* Enable or disable the theme toggle button in the toolbar.
|
|
312
|
+
*/
|
|
313
|
+
setThemeSwitchingEnabled(enabled: boolean): void;
|
|
314
|
+
/**
|
|
315
|
+
* Enable or disable text selection in the viewer.
|
|
316
|
+
*/
|
|
317
|
+
setTextSelectionEnabled(enabled: boolean): void;
|
|
318
|
+
/**
|
|
319
|
+
* Set the minimum zoom level.
|
|
320
|
+
*/
|
|
321
|
+
setMinZoom(zoom: number): void;
|
|
322
|
+
/**
|
|
323
|
+
* Set the maximum zoom level.
|
|
324
|
+
*/
|
|
325
|
+
setMaxZoom(zoom: number): void;
|
|
303
326
|
/**
|
|
304
327
|
* Enable or disable the entire left panel area.
|
|
305
328
|
* When disabled, the left panel is hidden and all left panel tabs are inaccessible.
|
|
@@ -325,6 +348,28 @@ export declare class UDocViewer {
|
|
|
325
348
|
* Close the currently open panel.
|
|
326
349
|
*/
|
|
327
350
|
closePanel(): void;
|
|
351
|
+
/**
|
|
352
|
+
* Search for text in the document.
|
|
353
|
+
* Opens the search panel and sets the search query.
|
|
354
|
+
*
|
|
355
|
+
* @param query - The text to search for
|
|
356
|
+
* @param options - Search options
|
|
357
|
+
*/
|
|
358
|
+
search(query: string, options?: {
|
|
359
|
+
caseSensitive?: boolean;
|
|
360
|
+
}): void;
|
|
361
|
+
/**
|
|
362
|
+
* Navigate to the next search match.
|
|
363
|
+
*/
|
|
364
|
+
searchNext(): void;
|
|
365
|
+
/**
|
|
366
|
+
* Navigate to the previous search match.
|
|
367
|
+
*/
|
|
368
|
+
searchPrev(): void;
|
|
369
|
+
/**
|
|
370
|
+
* Clear the current search query and results.
|
|
371
|
+
*/
|
|
372
|
+
clearSearch(): void;
|
|
328
373
|
/**
|
|
329
374
|
* Render a page to an image.
|
|
330
375
|
*
|