@laminapdf/viewer 0.2.0-alpha.5 → 0.2.0-alpha.6
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 +43 -2
- package/dist/client.d.ts +33 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +138 -19
- package/dist/client.js.map +1 -1
- package/dist/edit/session.d.ts +91 -0
- package/dist/edit/session.d.ts.map +1 -0
- package/dist/edit/session.js +179 -0
- package/dist/edit/session.js.map +1 -0
- package/dist/edit-log.d.ts +32 -0
- package/dist/edit-log.d.ts.map +1 -0
- package/dist/edit-log.js +74 -0
- package/dist/edit-log.js.map +1 -0
- package/dist/find/controller.d.ts +6 -0
- package/dist/find/controller.d.ts.map +1 -1
- package/dist/find/controller.js +69 -2
- package/dist/find/controller.js.map +1 -1
- package/dist/history/history.d.ts +9 -0
- package/dist/history/history.d.ts.map +1 -1
- package/dist/history/history.js.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/layers/link-layer.d.ts +33 -0
- package/dist/layers/link-layer.d.ts.map +1 -1
- package/dist/layers/link-layer.js +251 -3
- package/dist/layers/link-layer.js.map +1 -1
- package/dist/layers/link-preview.d.ts +77 -0
- package/dist/layers/link-preview.d.ts.map +1 -0
- package/dist/layers/link-preview.js +202 -0
- package/dist/layers/link-preview.js.map +1 -0
- package/dist/layers/text-layer.d.ts +7 -3
- package/dist/layers/text-layer.d.ts.map +1 -1
- package/dist/layers/text-layer.js +3 -5
- package/dist/layers/text-layer.js.map +1 -1
- package/dist/layout/page-layout.d.ts +7 -0
- package/dist/layout/page-layout.d.ts.map +1 -1
- package/dist/layout/page-layout.js +15 -0
- package/dist/layout/page-layout.js.map +1 -1
- package/dist/protocol.d.ts +119 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +17 -2
- package/dist/protocol.js.map +1 -1
- package/dist/thumbnails/strip.d.ts.map +1 -1
- package/dist/thumbnails/strip.js +34 -1
- package/dist/thumbnails/strip.js.map +1 -1
- package/dist/view/previews.d.ts +47 -0
- package/dist/view/previews.d.ts.map +1 -0
- package/dist/view/previews.js +97 -0
- package/dist/view/previews.js.map +1 -0
- package/dist/view/viewer.d.ts +84 -6
- package/dist/view/viewer.d.ts.map +1 -1
- package/dist/view/viewer.js +344 -12
- package/dist/view/viewer.js.map +1 -1
- package/dist/worker/document.d.ts +43 -5
- package/dist/worker/document.d.ts.map +1 -1
- package/dist/worker/document.js +72 -2
- package/dist/worker/document.js.map +1 -1
- package/dist/worker/edit.d.ts +35 -0
- package/dist/worker/edit.d.ts.map +1 -0
- package/dist/worker/edit.js +305 -0
- package/dist/worker/edit.js.map +1 -0
- package/dist/worker/find.d.ts +2 -2
- package/dist/worker/find.d.ts.map +1 -1
- package/dist/worker/find.js +3 -3
- package/dist/worker/find.js.map +1 -1
- package/dist/worker/fingerprint.d.ts +10 -0
- package/dist/worker/fingerprint.d.ts.map +1 -0
- package/dist/worker/fingerprint.js +42 -0
- package/dist/worker/fingerprint.js.map +1 -0
- package/dist/worker/methods.d.ts.map +1 -1
- package/dist/worker/methods.js +19 -0
- package/dist/worker/methods.js.map +1 -1
- package/dist/worker/navigation.d.ts +2 -2
- package/dist/worker/navigation.d.ts.map +1 -1
- package/dist/worker/navigation.js +3 -3
- package/dist/worker/navigation.js.map +1 -1
- package/dist/worker/recent-pages.d.ts +2 -0
- package/dist/worker/recent-pages.d.ts.map +1 -1
- package/dist/worker/recent-pages.js +15 -0
- package/dist/worker/recent-pages.js.map +1 -1
- package/dist/worker/session.d.ts +59 -0
- package/dist/worker/session.d.ts.map +1 -0
- package/dist/worker/session.js +152 -0
- package/dist/worker/session.js.map +1 -0
- package/dist/worker/text.d.ts +2 -2
- package/dist/worker/text.d.ts.map +1 -1
- package/dist/worker/text.js +5 -4
- package/dist/worker/text.js.map +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -48,10 +48,12 @@ The view keeps only the pages near the viewport in the DOM and paints each in tw
|
|
|
48
48
|
| `jumpToPage(index)`, `jumpToDestination(target)` | Like `goToPage` and `goToDestination`, but recorded as history jumps, so Back returns to where the view was. |
|
|
49
49
|
| `history` | Back and forward through the jumps (below). |
|
|
50
50
|
| `getState()`, `subscribe(listener)` | The view state (`currentPage`, `pageCount`, `zoom`, `percent`, `rotation`, `scrollTop`, `visibleRange`), for `useSyncExternalStore`. |
|
|
51
|
-
| `on("pagechange" \| "zoomchange" \| "renderstats", …)`, `stats()` | Events and counters. `renderstats` counts renders, for measuring performance. |
|
|
51
|
+
| `on("pagechange" \| "zoomchange" \| "renderstats" \| "invalidate", …)`, `stats()` | Events and counters. `renderstats` counts renders, for measuring performance. `invalidate` lists the pages `invalidate` redrew, each with its size in points now. |
|
|
52
52
|
| `addLayer({ name, onMount, onUnmount, onZoom })` | Mounts a layer into each page. |
|
|
53
53
|
| `keepMounted(pages)` | Keeps these pages mounted wherever the view scrolls, replacing the previous set; `[]` releases them. The text layer pins the pages a selection touches. |
|
|
54
54
|
| `pointAt(x, y)`, `positionOf(point)` | Converts between viewport positions and document points. |
|
|
55
|
+
| `pageSizes()` | Every page's displayed size in points, as the view lays it out, edits included. A thumbnail strip lays its pages out from it. |
|
|
56
|
+
| `applyEdit(ops)`, `invalidate(pages, sizes?)` | Edits the document and redraws the pages the edit touched (below). |
|
|
55
57
|
| `MIN_ZOOM`, `MAX_ZOOM` | The bounds of a percentage zoom, 10 and 800, for a zoom control's range. |
|
|
56
58
|
|
|
57
59
|
**Layers.** Each page shell stacks a canvas and three slots above it: `div.lamina-layer-text`, `div.lamina-layer-annot` and `div.lamina-layer-highlight`. The text layer fills the first, links the second and find highlights the third, through `addLayer`. A layer with another name gets its own slot on top. Every slot above the text lets the pointer through (`pointer-events: none`), so text stays selectable under it; an element a layer wants clicked, such as a link's anchor, sets `pointer-events: auto` on itself.
|
|
@@ -92,6 +94,13 @@ A left the file leaves out keeps the current horizontal scroll, and a top it lea
|
|
|
92
94
|
|
|
93
95
|
Anchors follow page order, so Tab reaches a page's links in order. Each is named by its `/Contents` or by what it does ("Link to page 3"); `links.words` gives those names in another language. Only the anchors take pointer events, so text beside a link still selects. Style them as `a.lamina-link`; the viewer adds no style sheet.
|
|
94
96
|
|
|
97
|
+
**Link previews.** The viewer asks to preview a link inside the document after 300 ms of mouse or pen hover or of visible keyboard focus, or on a 500 ms long-press with a finger that doesn't move. It cancels a long-press's click, and the long-press selects no text. Web links never preview.
|
|
98
|
+
|
|
99
|
+
The viewer emits `linkpreview` with the link, its anchor, how it was asked for (`fine`, `keyboard` or `touch`) and what it shows: a destination, or the sentence of a page action or another file's link. `linkpreviewend` follows 300 ms after the pointer leaves both the link and the preview, or when focus leaves the link. The app draws the preview with these:
|
|
100
|
+
- `viewer.preview(target, { signal })` draws where the link goes, in one render by the document's Web Worker. A destination with a point gets a crop from above and left of the point across its text column, at the reader's zoom clamped to 100–150 % and at most 480 × 180 CSS px. Any other destination gets the top of its page.
|
|
101
|
+
- It returns the bitmap, its CSS size, the destination page and the text of the lines it shows. The viewer keeps the last 8 bitmaps and closes them on a zoom or rotation change and when the document closes, so draw the bitmap at once and never close it. `stats().previewBitmaps` counts them.
|
|
102
|
+
- `viewer.holdLinkPreview(true | false)` keeps the preview while the pointer is on it, `viewer.dismissLinkPreview()` hides it on Escape or Close, and `viewer.followLinkPreview()` follows the previewed link, else the focused one.
|
|
103
|
+
|
|
95
104
|
**History.** `viewer.history` records jumps: links, `jumpToPage`, `jumpToDestination`, find's moves and thumbnail clicks. Scrolling alone records nothing. Each jump saves the view it leaves, both scroll position and zoom, so Back returns there, not only to that page.
|
|
96
105
|
- `back()`, `forward()` and `goTo(id)` move the view; `getState()` and `subscribe()` say where Back and Forward go (`back`, `forward`, `current`, each an entry with a page point and a zoom).
|
|
97
106
|
- A jump that lands where the view already is adds nothing, and a new jump drops what Forward held.
|
|
@@ -104,6 +113,32 @@ Anchors follow page order, so Tab reaches a page's links in order. Each is named
|
|
|
104
113
|
- **Keyboard and pointer.** A click, or Enter or Space, goes to that page. The arrow keys, Home and End move the focus, and only one thumbnail is in the Tab order.
|
|
105
114
|
- **Names.** Each thumbnail is named by its page label and number ("Page iv (4 of 120)") and captioned with its label. For another language, pass `label` to replace both and `name` to replace the list's own name.
|
|
106
115
|
|
|
116
|
+
**Edits.** `viewer.applyEdit(ops)` edits the open document and redraws the pages the edit touched, in one call. The ops are `@laminapdf/sdk`'s, such as `{ op: "rotatePage", args: { page, rotate: 90 } }`, and apply as one transaction. The call resolves with those pages as they are after the edit: index, ID, rotation and displayed size in points, so a quarter turn swaps width and height.
|
|
117
|
+
- **How an edit reaches the screen.** PDFium draws from the bytes it opened, so the Web Worker writes the edit into memory as an incremental update and opens the render document again from the result. The old render document keeps drawing until the new one is open. The Web Worker runs one call at a time, so every render answered before the edit drew the old file, and every render after it draws the new one. A render the view asked for before an edit and that answers after it is dropped, never cached, and asked for again.
|
|
118
|
+
- **What the viewer redraws.** Only the touched pages: their bitmaps go, here and in a thumbnail strip, and their layers read their text and links again. Every other page keeps what it drew. A page in view at its old size keeps its pixels until sharp tiles cover them, so it never flashes. A page whose size changed paints its quick pass first, and the page at the top of the viewport stays there.
|
|
119
|
+
- **What changes nothing.** An edit of the document's metadata touches no page: the Web Worker opens nothing again, and the viewer redraws nothing. A failed edit, such as one naming a page that doesn't exist, rejects and leaves the document and the pages as they were. So does an edit whose new file the backend can't open: the Web Worker undoes it. An edit that adds, removes or moves pages is refused for now, since the view finds pages by index.
|
|
120
|
+
- **When an edit can't be undone.** If the undo after a failed reopen fails too, the call rejects with `worker-failed` saying to open the document again, and every later edit does the same.
|
|
121
|
+
- **Driving it yourself.** `ViewerClient.applyEdit(ops)` makes the edit without the redraw; pass its pages to `viewer.invalidate(indices, sizes)`, which redraws any pages you name.
|
|
122
|
+
- **The zoom follows.** While the zoom fits the width or the page, a page that turned is fitted again, so a page lying on its side never runs past the window.
|
|
123
|
+
|
|
124
|
+
**The edit session.** `viewer.edits` keeps the open document's history and is the store an editor reads (`getState()`, `subscribe()`):
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
await viewer.edits.apply([{ op: "rotatePage", args: { page, rotate: 90 } }], "Rotate page 5");
|
|
128
|
+
await viewer.edits.undo(); // the page stands again
|
|
129
|
+
await viewer.edits.redo();
|
|
130
|
+
await viewer.edits.goTo(0); // back to the file as opened, in one call
|
|
131
|
+
const { history, busy, blocked, notice } = viewer.edits.getState();
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
- **One step per edit.** Each edit is a step with its label, its pages and its time. `history.steps` lists them oldest first; the first `history.position` are done and the rest are undone, ready to redo. A new edit drops the undone ones. An edit that changed nothing (setting a value the document already had) makes no step.
|
|
135
|
+
- **Undo and redo redraw too.** They draw only the pages the step touched, as an edit does, and `goTo` draws once however many steps it moves. Calls run one after another in the order they were made, so three quick presses of Undo undo three steps.
|
|
136
|
+
- **When an undo can't restore everything.** A later change can replace part of what a step changed. Then the undo restores the rest and the step is marked `partial`; `notice` holds it until the next edit, and `onReverted(listener)` hears each undo and redo with how it went. An undo that could restore nothing takes the step out of the history.
|
|
137
|
+
- **Unsaved changes.** `history.unsaved` counts the steps between the document now and the file as opened, so undoing every step leaves it clean again. The history keeps 500 steps and then drops the oldest (`history.dropped`); the steps it drops still count.
|
|
138
|
+
- **What blocks editing.** `blocked` says why the document can't be edited: none is open, or it is encrypted, or an edit failed and couldn't be undone, so it must be opened again. An encrypted file's edits can't be written yet, and `OpenedDocument.encrypted` says so when it opens.
|
|
139
|
+
- **A restart keeps the edits.** If the Web Worker crashes, the client opens the file again, replays every step, then undoes the ones that were undone, so the history and the pages are as they were (`restarted`'s `edits` is `restored`). A replay can't recreate an undo or redo that restored only part of a step, or none of it, so after one of those, or when the replay fails, the file opens as it was and `edits` is `lost`.
|
|
140
|
+
- **Without the viewer.** `ViewerClient` has the same calls (`applyEdit(ops, { label })`, `undoEdit()`, `redoEdit()`, `goToStep(n)`, `editHistory()`), each resolving with the pages to redraw and the history, and fires `edit` after each.
|
|
141
|
+
|
|
107
142
|
**Tuning.** The margin, pool size, pixel cap, cache budget and settle delay are measured by the perf harness ([Performance](#performance)); the first full run kept them.
|
|
108
143
|
|
|
109
144
|
## The document Web Worker
|
|
@@ -191,6 +226,11 @@ There is one protocol, not two: the viewer's worker is `@laminapdf/sdk/worker`'s
|
|
|
191
226
|
| `currentDocument` | — | `{ document, ticket }` of the open document, or `undefined`: `open()` asks after a cancelled open | document |
|
|
192
227
|
| `closeDocument` | — | — | document |
|
|
193
228
|
| `pageInfo` | `index` | `PageInfo` (displayed size in points, rotation, ID, label) | document |
|
|
229
|
+
| `applyEdit` | `ops`, the document's `id`, `label?` | `EditResult`: the touched pages' `PageInfo`, after the edit (empty for a metadata edit), and the edit session's `history` | document. `client.applyEdit(ops)`. Saves into memory and opens the render document again when the edit touched pages; records a step unless nothing changed |
|
|
230
|
+
| `undoEdit`, `redoEdit` | the document's `id` | `EditResult` with `reverted`: the step and how it went | document. Redraws as an edit does |
|
|
231
|
+
| `goToStep` | `position`, the document's `id` | `EditResult` with every step undone or redone | document. One redraw; a failure half way takes every move back |
|
|
232
|
+
| `editHistory` | the document's `id` | `EditHistory` | document |
|
|
233
|
+
| `restoreEdits` | `steps` (ops, label, time), `undone`, the document's `id` | `EditResult` | document. A restarted worker's replay |
|
|
194
234
|
| `find` | `query`, `FindOptions`, `pages` | `FindPageResult[]`: each page's matches as quads, and whether it has no text | `background` |
|
|
195
235
|
| `render` | ADR 0004 `RenderRequest` | `{ bitmap: ImageBitmap, width, height }` (transferred) | `visible` > `prefetch` > `background` |
|
|
196
236
|
| `memory` | — | `WorkerMemory`: the bytes of the backend's and Lamina PDF's WebAssembly memories | document. `client.memory()`; the perf harness samples it. |
|
|
@@ -246,7 +286,7 @@ cargo xtask viewer-perf [chromium|firefox|webkit] # the same, plus the job summ
|
|
|
246
286
|
|
|
247
287
|
It writes `target/viewer-perf/<browser>.json` and `summary.md`, and never fails on a missed target: no pull request lane asserts a duration ([ADR 0018](../../docs/decisions/0018-test-strategy.md#2-ci-lanes)).
|
|
248
288
|
|
|
249
|
-
**What it does.** It opens
|
|
289
|
+
**What it does.** It opens four seeded files, built with `@laminapdf/sdk` and cached in `perf/.fixtures/`: 10 pages of text with an image each (about 1 MB), 100 and 1,000 pages of text, and 300 pages of full-page images. A Vite build of `perf/page/` shows them, and `perf/serve.ts` serves that page gzipped, as Cloudflare serves the app. Playwright drives real input, so every run scrolls the same way:
|
|
250
290
|
|
|
251
291
|
| Scenario | Measures | Target |
|
|
252
292
|
| --- | --- | --- |
|
|
@@ -256,6 +296,7 @@ It writes `target/viewer-perf/<browser>.json` and `summary.md`, and never fails
|
|
|
256
296
|
| Scroll the 1,000-page file end to end, twice, with wheel steps every 20 ms; stop at a quarter, a half and three quarters | the longest main-thread task, time to sharp after each stop, peak memory, memory after each pass, cancelled renders that painted | no task > 50 ms; sharp ≤ 300 ms; ≤ 600 MB; second pass ≤ first + 5 %; 0 |
|
|
257
297
|
| Fling across the 300 image pages, then stop | time to sharp | ≤ 300 ms |
|
|
258
298
|
| Three ctrl+wheel bursts in and out on the 10-page file | the longest frame, time to sharp after each burst | reported |
|
|
299
|
+
| Turn the page in view a quarter (`viewer.applyEdit`), five times, in the 10-, 100- and 1,000-page files; on the 100-page file, go on to 20 turns in a row | the median time from the call to the page's first new pixels (its quick pass), and to sharp; the twentieth turn's first new pixels | ≤ 150 ms at 100 pages ([E1 plan §6](../../docs/plans/editor/e1-editing-foundation.md#6-redrawing-after-an-edit)) |
|
|
259
300
|
|
|
260
301
|
"Time to sharp" runs from the last scroll or zoom event to the moment every visible page turned sharp. Memory is the page's JS heap (Chromium only), the document Web Worker's WebAssembly memories (`client.memory()`), the bitmap cache and the canvases' pixels. Firefox and WebKit have no Long Tasks API, so their longest task is the longest gap between frames, which is an upper bound.
|
|
261
302
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { RenderRequest } from "@laminapdf/render";
|
|
2
|
+
import { type Op } from "@laminapdf/sdk";
|
|
2
3
|
import { type WorkerInitOptions, type WorkerWasmSource } from "@laminapdf/sdk/worker";
|
|
3
4
|
import type { FindOptions } from "./find/fold.js";
|
|
4
|
-
import { type BackendInit, type LoadProgress, type MethodName, type NetworkRecord, type OpenedDocument, type Params, type PolicyViolation, type PrintOptions, type Priority, type RenderedBitmap, type Result, type SourceInit, type ViewerOpenOptions, type WorkerNetworkLog } from "./protocol.js";
|
|
5
|
+
import { type BackendInit, type EditHistory, type EditResult, type LoadProgress, type MethodName, type NetworkRecord, type OpenedDocument, type Params, type PolicyViolation, type PrintOptions, type Priority, type RenderedBitmap, type Result, type SourceInit, type ViewerOpenOptions, type WorkerNetworkLog } from "./protocol.js";
|
|
5
6
|
/** `ViewerClient.create`'s options: the backend, Lamina PDF's WebAssembly, the timeouts, the worker and a signal to stop starting. */
|
|
6
7
|
export interface ViewerOptions {
|
|
7
8
|
/** The render engine; PDFium needs its `.wasm` URL from your bundler (`pdfium.wasm?url`). */
|
|
@@ -69,11 +70,21 @@ export interface ViewerEvents {
|
|
|
69
70
|
crashed: {
|
|
70
71
|
readonly reason: string;
|
|
71
72
|
};
|
|
72
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* A new worker serves again (and has reopened the document, unless it needed a password).
|
|
75
|
+
* `edits` says what became of the edit session's steps: `restored` (applied again, the same
|
|
76
|
+
* history), `lost` (the file is as it was opened), or absent when there were none.
|
|
77
|
+
*/
|
|
73
78
|
restarted: {
|
|
74
79
|
readonly reason: RestartReason;
|
|
75
80
|
readonly reopened: boolean;
|
|
81
|
+
readonly edits?: "restored" | "lost";
|
|
76
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* An edit, undo or redo was made (the document's semantic dirty state is `history.unsaved`):
|
|
85
|
+
* the pages it touched, as they are now, and the edit session's history.
|
|
86
|
+
*/
|
|
87
|
+
edit: EditResult;
|
|
77
88
|
/** The restarted worker can't reopen the document without its password: open it again. */
|
|
78
89
|
"password-required": Record<string, never>;
|
|
79
90
|
/** A restart failed (the backend couldn't load again, …): the client serves nothing until `stop()` works. */
|
|
@@ -115,6 +126,26 @@ export declare class ViewerClient {
|
|
|
115
126
|
get document(): OpenedDocument | undefined;
|
|
116
127
|
/** Closes the document in the worker (the worker stays, ready for another `open`). */
|
|
117
128
|
close(): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Applies `ops` to the open document as one transaction (`@laminapdf/sdk`'s ops, such as
|
|
131
|
+
* `rotatePage`), and draws the pages it touched from the edited file from then on. The edit
|
|
132
|
+
* session records it as one step named `label` ("Rotate page 5"), which undo takes back; an
|
|
133
|
+
* edit that changed nothing records none. Resolves with those pages as they now are and the
|
|
134
|
+
* history; `document` gives their new sizes too. Pass the pages to `viewer.invalidate`, or call
|
|
135
|
+
* `viewer.applyEdit`, which does both. A failed edit changes nothing. A restarted worker opens
|
|
136
|
+
* the file and applies the session's steps again (`restarted`'s `edits`).
|
|
137
|
+
*/
|
|
138
|
+
applyEdit(ops: readonly Op[], options?: ViewerCallOptions & {
|
|
139
|
+
readonly label?: string;
|
|
140
|
+
}): Promise<EditResult>;
|
|
141
|
+
/** Undoes the newest step of the edit session; the pages it touched are drawn as they were. */
|
|
142
|
+
undoEdit(options?: ViewerCallOptions): Promise<EditResult>;
|
|
143
|
+
/** Redoes the oldest undone step. */
|
|
144
|
+
redoEdit(options?: ViewerCallOptions): Promise<EditResult>;
|
|
145
|
+
/** Undoes or redoes steps until `position` of the history's steps are done, drawing once. */
|
|
146
|
+
goToStep(position: number, options?: ViewerCallOptions): Promise<EditResult>;
|
|
147
|
+
/** The edit session's history, read from the worker (after a failed call, which answers none). */
|
|
148
|
+
editHistory(options?: ViewerCallOptions): Promise<EditHistory>;
|
|
118
149
|
/**
|
|
119
150
|
* Every request the document worker has made, and had blocked, since it started: what its
|
|
120
151
|
* `network` and `csp-violation` events reported, including those sent before anyone listened.
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAoB,KAAK,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,eAAe,EAEpB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,MAAM,EAEX,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,eAAe,CAAC;AAKvB,sIAAsI;AACtI,MAAM,WAAW,aAAa;IAC5B,6FAA6F;IAC7F,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,iBAAiB,CAAC;IACvD,mGAAmG;IACnG,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvE,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;IAC/B,uB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AAgC;IAChC,SAAS,IAAI,IAAI,CAKhB;CA8EF"}
|
package/dist/client.js
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
// fires and the caller opens again with the password.
|
|
17
17
|
import { isLaminaPdfError } from "@laminapdf/sdk";
|
|
18
18
|
import { connect, Emitter, } from "@laminapdf/sdk/worker";
|
|
19
|
+
import { EditLog } from "./edit-log.js";
|
|
19
20
|
import { FirstDraw } from "./first-draw.js";
|
|
20
21
|
import { PRIORITY, renderKey, } from "./protocol.js";
|
|
21
22
|
/** Default render timeouts (ADR 0009 §3.7), in ms. */
|
|
@@ -47,6 +48,8 @@ export class ViewerClient {
|
|
|
47
48
|
/** What to reopen after a restart: the source and the options without the password. */
|
|
48
49
|
#reopen;
|
|
49
50
|
#document;
|
|
51
|
+
/** The open document's edit session, kept so a restarted worker takes it back. */
|
|
52
|
+
#edits = new EditLog();
|
|
50
53
|
/** Opens asked for so far: each open's ticket. */
|
|
51
54
|
#opens = 0;
|
|
52
55
|
#recovering;
|
|
@@ -178,6 +181,7 @@ export class ViewerClient {
|
|
|
178
181
|
}
|
|
179
182
|
this.#reopen = { source, options: rest };
|
|
180
183
|
this.#document = opened;
|
|
184
|
+
this.#edits.reset();
|
|
181
185
|
// Only once it opened: a failed open leaves the shown document's gate as it was.
|
|
182
186
|
this.#firstDraw = new FirstDraw(opened.id);
|
|
183
187
|
return opened;
|
|
@@ -195,8 +199,75 @@ export class ViewerClient {
|
|
|
195
199
|
async close() {
|
|
196
200
|
this.#reopen = undefined;
|
|
197
201
|
this.#document = undefined;
|
|
202
|
+
this.#edits.reset();
|
|
198
203
|
await this.call("closeDocument", []);
|
|
199
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Applies `ops` to the open document as one transaction (`@laminapdf/sdk`'s ops, such as
|
|
207
|
+
* `rotatePage`), and draws the pages it touched from the edited file from then on. The edit
|
|
208
|
+
* session records it as one step named `label` ("Rotate page 5"), which undo takes back; an
|
|
209
|
+
* edit that changed nothing records none. Resolves with those pages as they now are and the
|
|
210
|
+
* history; `document` gives their new sizes too. Pass the pages to `viewer.invalidate`, or call
|
|
211
|
+
* `viewer.applyEdit`, which does both. A failed edit changes nothing. A restarted worker opens
|
|
212
|
+
* the file and applies the session's steps again (`restarted`'s `edits`).
|
|
213
|
+
*/
|
|
214
|
+
applyEdit(ops, options) {
|
|
215
|
+
const label = options?.label;
|
|
216
|
+
return this.#edit((id) => this.call("applyEdit", label === undefined ? [ops, id] : [ops, id, label], options), {
|
|
217
|
+
ops,
|
|
218
|
+
label: label ?? "",
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
/** Undoes the newest step of the edit session; the pages it touched are drawn as they were. */
|
|
222
|
+
undoEdit(options) {
|
|
223
|
+
return this.#edit((id) => this.call("undoEdit", [id], options));
|
|
224
|
+
}
|
|
225
|
+
/** Redoes the oldest undone step. */
|
|
226
|
+
redoEdit(options) {
|
|
227
|
+
return this.#edit((id) => this.call("redoEdit", [id], options));
|
|
228
|
+
}
|
|
229
|
+
/** Undoes or redoes steps until `position` of the history's steps are done, drawing once. */
|
|
230
|
+
goToStep(position, options) {
|
|
231
|
+
return this.#edit((id) => this.call("goToStep", [position, id], options));
|
|
232
|
+
}
|
|
233
|
+
/** The edit session's history, read from the worker (after a failed call, which answers none). */
|
|
234
|
+
async editHistory(options) {
|
|
235
|
+
if (this.#recovering !== undefined)
|
|
236
|
+
await this.#recovering.catch(() => { });
|
|
237
|
+
const opened = this.#document;
|
|
238
|
+
const history = await this.call("editHistory", [opened?.id ?? 0], options);
|
|
239
|
+
// A failed edit clears the steps undone: what a restart would replay follows.
|
|
240
|
+
if (opened !== undefined && this.#document === opened)
|
|
241
|
+
this.#edits.take({ pages: [], history });
|
|
242
|
+
return history;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Runs one edit session call on the open document, then keeps what it changed: the pages'
|
|
246
|
+
* sizes in `document`, the steps for a restart, and an `edit` event.
|
|
247
|
+
*/
|
|
248
|
+
async #edit(call, edit) {
|
|
249
|
+
if (this.#recovering !== undefined)
|
|
250
|
+
await this.#recovering.catch(() => { });
|
|
251
|
+
const opened = this.#document;
|
|
252
|
+
// 0 names no document: the worker answers `disposed`.
|
|
253
|
+
const result = await call(opened?.id ?? 0);
|
|
254
|
+
// Another document opened meanwhile: this answer is the old one's.
|
|
255
|
+
if (opened === undefined || this.#document !== opened)
|
|
256
|
+
return result;
|
|
257
|
+
this.#takePages(opened, result);
|
|
258
|
+
this.#edits.take(result, edit);
|
|
259
|
+
this.#events.emit("edit", result);
|
|
260
|
+
return result;
|
|
261
|
+
}
|
|
262
|
+
/** The pages keep their sizes in `document`, for whoever lays them out. */
|
|
263
|
+
#takePages(opened, result) {
|
|
264
|
+
if (result.pages.length === 0)
|
|
265
|
+
return;
|
|
266
|
+
const pages = [...opened.pages];
|
|
267
|
+
for (const page of result.pages)
|
|
268
|
+
pages[page.index] = page;
|
|
269
|
+
this.#document = { ...opened, pages };
|
|
270
|
+
}
|
|
200
271
|
/**
|
|
201
272
|
* Every request the document worker has made, and had blocked, since it started: what its
|
|
202
273
|
* `network` and `csp-violation` events reported, including those sent before anyone listened.
|
|
@@ -361,33 +432,81 @@ export class ViewerClient {
|
|
|
361
432
|
terminate() {
|
|
362
433
|
this.#reopen = undefined;
|
|
363
434
|
this.#document = undefined;
|
|
435
|
+
this.#edits.reset();
|
|
364
436
|
this.#pdf.terminate();
|
|
365
437
|
}
|
|
438
|
+
/**
|
|
439
|
+
* Applies the edit session's steps to the document a new worker reopened, which is the file as
|
|
440
|
+
* first opened. When they can't all be applied again, the session starts over.
|
|
441
|
+
*/
|
|
442
|
+
/**
|
|
443
|
+
* `restored`; `lost` when the steps couldn't be replayed, and nothing was sent; `failed` when the
|
|
444
|
+
* replay failed half way, leaving edits in the model that aren't drawn.
|
|
445
|
+
*/
|
|
446
|
+
async #restoreEdits(opened) {
|
|
447
|
+
if (this.#edits.empty)
|
|
448
|
+
return undefined;
|
|
449
|
+
const replay = this.#edits.replay();
|
|
450
|
+
// A replay that can't reproduce the document would show something else as restored.
|
|
451
|
+
if (replay === undefined) {
|
|
452
|
+
this.#edits.reset();
|
|
453
|
+
return "lost";
|
|
454
|
+
}
|
|
455
|
+
const { steps, undone } = replay;
|
|
456
|
+
try {
|
|
457
|
+
const result = (await this.#pdf.request("restoreEdits", [steps, undone, opened.id], {
|
|
458
|
+
priority: PRIORITY.document,
|
|
459
|
+
}));
|
|
460
|
+
this.#takePages(opened, result);
|
|
461
|
+
this.#edits.replayed(result);
|
|
462
|
+
this.#events.emit("edit", result);
|
|
463
|
+
return "restored";
|
|
464
|
+
}
|
|
465
|
+
catch {
|
|
466
|
+
this.#edits.reset();
|
|
467
|
+
return "failed";
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Opens the document again in a restarted worker, with its edits: `reopened` when it did,
|
|
472
|
+
* `edits` what became of the session's steps. An encrypted document waits for its password.
|
|
473
|
+
*/
|
|
474
|
+
async #reopenAfterRestart() {
|
|
475
|
+
const reopen = this.#reopen;
|
|
476
|
+
if (reopen === undefined)
|
|
477
|
+
return { reopened: false, edits: undefined };
|
|
478
|
+
if (this.#document?.needsPassword === true) {
|
|
479
|
+
// The password died with the worker; it is never kept on the page.
|
|
480
|
+
this.#reopen = undefined;
|
|
481
|
+
this.#document = undefined;
|
|
482
|
+
const edits = this.#edits.empty ? undefined : "lost";
|
|
483
|
+
this.#edits.reset();
|
|
484
|
+
this.#events.emit("password-required", {});
|
|
485
|
+
return { reopened: false, edits };
|
|
486
|
+
}
|
|
487
|
+
const open = async () => {
|
|
488
|
+
this.#document = (await this.#pdf.request("openDocument", [reopen.source, reopen.options], {
|
|
489
|
+
priority: PRIORITY.document,
|
|
490
|
+
}));
|
|
491
|
+
// The restarted worker has no extract module yet: its first page goes first again.
|
|
492
|
+
this.#firstDraw = new FirstDraw(this.#document.id);
|
|
493
|
+
return this.#document;
|
|
494
|
+
};
|
|
495
|
+
const restored = await this.#restoreEdits(await open());
|
|
496
|
+
// A replay that failed half way left edits in the model that aren't drawn: open the file once
|
|
497
|
+
// more, as it was. One that never started left the file as opened, so it isn't opened again.
|
|
498
|
+
if (restored === "failed")
|
|
499
|
+
await open();
|
|
500
|
+
return { reopened: true, edits: restored === "failed" ? "lost" : restored };
|
|
501
|
+
}
|
|
366
502
|
#recover(reason) {
|
|
367
503
|
if (this.#recovering !== undefined)
|
|
368
504
|
return this.#recovering;
|
|
369
505
|
const recovering = (async () => {
|
|
370
506
|
await this.#pdf.restart();
|
|
371
507
|
await this.#pdf.request("initBackend", [this.#backend], { priority: PRIORITY.document });
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
if (reopen !== undefined) {
|
|
375
|
-
if (this.#document?.needsPassword === true) {
|
|
376
|
-
// The password died with the worker; it is never kept on the page.
|
|
377
|
-
this.#reopen = undefined;
|
|
378
|
-
this.#document = undefined;
|
|
379
|
-
this.#events.emit("password-required", {});
|
|
380
|
-
}
|
|
381
|
-
else {
|
|
382
|
-
this.#document = (await this.#pdf.request("openDocument", [reopen.source, reopen.options], {
|
|
383
|
-
priority: PRIORITY.document,
|
|
384
|
-
}));
|
|
385
|
-
// The restarted worker has no extract module yet: its first page goes first again.
|
|
386
|
-
this.#firstDraw = new FirstDraw(this.#document.id);
|
|
387
|
-
reopened = true;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
this.#events.emit("restarted", { reason, reopened });
|
|
508
|
+
const { reopened, edits } = await this.#reopenAfterRestart();
|
|
509
|
+
this.#events.emit("restarted", { reason, reopened, ...(edits === undefined ? {} : { edits }) });
|
|
391
510
|
})();
|
|
392
511
|
const tracked = recovering.finally(() => {
|
|
393
512
|
if (this.#recovering === tracked)
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,iGAAiG;AACjG,sBAAsB;AACtB,EAAE;A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,IAAI,CAAC,WAAW,KAAK,OAAO;gBAAE,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;QACjE,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC;QAC3B,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Op } from "@laminapdf/sdk";
|
|
2
|
+
import { type EditHistory, type EditResult, type OpenedDocument, type RevertedStep } from "../protocol.js";
|
|
3
|
+
/** Why the document can't be edited now. */
|
|
4
|
+
export type EditBlock =
|
|
5
|
+
/** No document is open. */
|
|
6
|
+
"no-document"
|
|
7
|
+
/** It is encrypted: its edits can't be written yet (E11 adds encrypting on save). */
|
|
8
|
+
| "encrypted"
|
|
9
|
+
/** An edit failed and couldn't be undone: it must be opened again. */
|
|
10
|
+
| "diverged";
|
|
11
|
+
/** What the edit session's interface reads. */
|
|
12
|
+
export interface EditSessionState {
|
|
13
|
+
readonly history: EditHistory;
|
|
14
|
+
/** A call is running, or waiting for the one before it. */
|
|
15
|
+
readonly busy: boolean;
|
|
16
|
+
/** Why editing is blocked; undefined when it isn't. */
|
|
17
|
+
readonly blocked: EditBlock | undefined;
|
|
18
|
+
/** The last undo or redo that left part of a step (or all of it) alone, until the next edit. */
|
|
19
|
+
readonly notice: RevertedStep | undefined;
|
|
20
|
+
/** How long the last call took from the call to its pages redrawn, in ms (E1 plan §6's measure). */
|
|
21
|
+
readonly lastMs: number | undefined;
|
|
22
|
+
}
|
|
23
|
+
/** What the session drives: the viewer's edit calls, which redraw the pages they touch. */
|
|
24
|
+
export interface EditSessionHost {
|
|
25
|
+
applyEdit(ops: readonly Op[], options: {
|
|
26
|
+
readonly label: string;
|
|
27
|
+
}): Promise<EditResult>;
|
|
28
|
+
undoEdit(): Promise<EditResult>;
|
|
29
|
+
redoEdit(): Promise<EditResult>;
|
|
30
|
+
goToStep(position: number): Promise<EditResult>;
|
|
31
|
+
/** The worker's history now, read after a call failed (a failed edit can clear the steps undone). */
|
|
32
|
+
editHistory(): Promise<EditHistory>;
|
|
33
|
+
}
|
|
34
|
+
/** Called after an undo or redo, with each step it took back or made again. */
|
|
35
|
+
export type RevertListener = (reverted: readonly RevertedStep[]) => void;
|
|
36
|
+
/** A call of the session that failed: which, the edit's label for an edit, and why. */
|
|
37
|
+
export interface EditFailure {
|
|
38
|
+
readonly call: "apply" | "undo" | "redo" | "goTo";
|
|
39
|
+
readonly label?: string;
|
|
40
|
+
readonly error: unknown;
|
|
41
|
+
}
|
|
42
|
+
/** Called when a call failed, so the interface can say so: nothing else reports it. */
|
|
43
|
+
export type FailureListener = (failure: EditFailure) => void;
|
|
44
|
+
/**
|
|
45
|
+
* A session with no document, which can do nothing: what an interface reads while none is open,
|
|
46
|
+
* in place of a store of its own.
|
|
47
|
+
*/
|
|
48
|
+
export declare const CLOSED_SESSION: {
|
|
49
|
+
/** The closed state: no steps, nothing unsaved, edits blocked. */
|
|
50
|
+
readonly getState: () => EditSessionState;
|
|
51
|
+
/** Never calls `listener`: a closed session doesn't change. */
|
|
52
|
+
readonly subscribe: (_listener: () => void) => (() => void);
|
|
53
|
+
/** Does nothing. */
|
|
54
|
+
readonly undo: () => Promise<undefined>;
|
|
55
|
+
/** Does nothing. */
|
|
56
|
+
readonly redo: () => Promise<undefined>;
|
|
57
|
+
/** Does nothing. */
|
|
58
|
+
readonly goTo: (_position: number) => Promise<undefined>;
|
|
59
|
+
};
|
|
60
|
+
/** The open document's edit session (`viewer.edits`). */
|
|
61
|
+
export declare class EditSession {
|
|
62
|
+
#private;
|
|
63
|
+
constructor(host: EditSessionHost, now?: () => number);
|
|
64
|
+
/** The session now: its history, whether a call is running, and why edits are blocked, if they are. */
|
|
65
|
+
getState: () => EditSessionState;
|
|
66
|
+
/** Calls `listener` whenever the state changes; returns the function that stops it. */
|
|
67
|
+
subscribe: (listener: () => void) => (() => void);
|
|
68
|
+
/** Calls `listener` after each undo or redo, with what it did; returns the function that stops it. */
|
|
69
|
+
onReverted(listener: RevertListener): () => void;
|
|
70
|
+
/**
|
|
71
|
+
* Calls `listener` when a call fails (the edit, undo, redo or move changed nothing); returns the
|
|
72
|
+
* function that stops it. The call's promise rejects too.
|
|
73
|
+
*/
|
|
74
|
+
onFailed(listener: FailureListener): () => void;
|
|
75
|
+
/** Starts over for `document` (undefined: none is open). */
|
|
76
|
+
reset(document: OpenedDocument | undefined): void;
|
|
77
|
+
/**
|
|
78
|
+
* Takes a history the worker gave outside a call of this session: a restarted worker's replay,
|
|
79
|
+
* or an empty one when the edits were lost.
|
|
80
|
+
*/
|
|
81
|
+
follow(history: EditHistory): void;
|
|
82
|
+
/** Applies `ops` as one step named `label` ("Rotate page 5"). Rejects as the edit failed. */
|
|
83
|
+
apply(ops: readonly Op[], label: string): Promise<EditResult>;
|
|
84
|
+
/** Undoes the newest done step; resolves undefined when there was none. */
|
|
85
|
+
undo(): Promise<EditResult | undefined>;
|
|
86
|
+
/** Redoes the oldest undone step; resolves undefined when there was none. */
|
|
87
|
+
redo(): Promise<EditResult | undefined>;
|
|
88
|
+
/** Undoes or redoes steps until `position` of them are done, in one call. */
|
|
89
|
+
goTo(position: number): Promise<EditResult | undefined>;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/edit/session.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,UAAU,EAEf,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,gBAAgB,CAAC;AAExB,4CAA4C;AAC5C,MAAM,MAAM,SAAS;AACnB,2BAA2B;AACzB,aAAa;AACf,qFAAqF;GACnF,WAAW;AACb,sEAAsE;GACpE,UAAU,CAAC;AAEf,+CAA+C;AAC/C,MAAM,WAAW,gBAAgB;IAC/B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