fleuron 0.1.1 → 0.2.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/README.md +7 -7
- package/dist/client.d.ts +33 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +35 -10
- package/dist/client.js.map +1 -1
- package/dist/engine.d.ts +2 -2
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +38 -9
- package/dist/engine.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/preview.d.ts +153 -19
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +378 -38
- package/dist/preview.js.map +1 -1
- package/dist/protocol.d.ts +35 -5
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +10 -2
- package/dist/protocol.js.map +1 -1
- package/dist/svg.d.ts +13 -4
- package/dist/svg.d.ts.map +1 -1
- package/dist/svg.js +142 -15
- package/dist/svg.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wire.d.ts +55 -12
- package/dist/wire.d.ts.map +1 -1
- package/dist/wire.js +36 -6
- package/dist/wire.js.map +1 -1
- package/package.json +1 -1
- package/wasm/fleuron.d.ts +26 -16
- package/wasm/fleuron.js +36 -18
- package/wasm/fleuron_bg.wasm +0 -0
- package/wasm/fleuron_bg.wasm.d.ts +2 -2
package/dist/preview.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A preview, mounted: markdown in, a page on screen.
|
|
3
3
|
*
|
|
4
4
|
* The worker, the module, the postcard buffer and the display structure
|
|
5
|
-
* are what this is built out of, not what it asks a caller to
|
|
5
|
+
* are what this is built out of, not what it asks a caller to supply.
|
|
6
6
|
* A host that wants them keeps having them, since the client, the
|
|
7
7
|
* protocol, the reader and the painter are all still exported. A host
|
|
8
8
|
* that only wants to see the book says where to put it and hands over
|
|
@@ -17,7 +17,14 @@
|
|
|
17
17
|
* host that wants a fixed delay puts one in front of these calls.
|
|
18
18
|
*/
|
|
19
19
|
import { Client } from './client.js';
|
|
20
|
+
import { styleOp, } from './protocol.js';
|
|
20
21
|
import { faceFamily, paintPage } from './svg.js';
|
|
22
|
+
/**
|
|
23
|
+
* How many pages either side of the one on screen a preview keeps
|
|
24
|
+
* decoded. A page turn within this radius paints from what is
|
|
25
|
+
* already held; one past it asks the worker.
|
|
26
|
+
*/
|
|
27
|
+
const HOLD_RADIUS = 1;
|
|
21
28
|
/**
|
|
22
29
|
* A book on screen, and the worker behind it.
|
|
23
30
|
*
|
|
@@ -32,9 +39,55 @@ export class Preview {
|
|
|
32
39
|
client;
|
|
33
40
|
options;
|
|
34
41
|
faces = new Map();
|
|
35
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Every image's own bytes, by url, kept independent of the transfer
|
|
44
|
+
* that moved the ones sent across the wall: a copy taken before the
|
|
45
|
+
* op went out, since the buffer handed to the engine is empty on
|
|
46
|
+
* this side afterwards.
|
|
47
|
+
*/
|
|
48
|
+
imageBytes = new Map();
|
|
49
|
+
/**
|
|
50
|
+
* A blob url per image currently drawn by a held page, by its own
|
|
51
|
+
* url. Built and revoked by {@link syncAssetCache}: a book with
|
|
52
|
+
* more images than are ever on screen at once does not keep a blob
|
|
53
|
+
* open, and its decode, for every one of them.
|
|
54
|
+
*/
|
|
36
55
|
pixels = new Map();
|
|
37
|
-
|
|
56
|
+
/**
|
|
57
|
+
* The pages this preview currently keeps decoded, by folio. Bounded
|
|
58
|
+
* to a window around the page on screen rather than the whole
|
|
59
|
+
* book: what makes a page turn instant is prefetching a neighbour
|
|
60
|
+
* before it is asked for, not holding every page there is.
|
|
61
|
+
*/
|
|
62
|
+
held = new Map();
|
|
63
|
+
/**
|
|
64
|
+
* The generation `held` was built under. A reply for a different
|
|
65
|
+
* generation means an edit landed, and drops whatever was held
|
|
66
|
+
* before inserting: a page from the book before the edit is not
|
|
67
|
+
* one to paint over it.
|
|
68
|
+
*/
|
|
69
|
+
heldGeneration = -1;
|
|
70
|
+
/**
|
|
71
|
+
* Pages currently being asked for from the worker, whether the
|
|
72
|
+
* page turned to or a background prefetch of a neighbour, to the
|
|
73
|
+
* generation they were asked for under. Asking again for one
|
|
74
|
+
* already here — including a page left and come back to before its
|
|
75
|
+
* first request landed — joins it rather than opening a second
|
|
76
|
+
* request for the same page.
|
|
77
|
+
*
|
|
78
|
+
* Keyed on generation, not just the folio, so a fetch left over
|
|
79
|
+
* from the generation before an edit cannot clear the marker a
|
|
80
|
+
* fresh fetch for the same folio placed under the new one when the
|
|
81
|
+
* old one finally lands and finds itself answering a book that no
|
|
82
|
+
* longer stands.
|
|
83
|
+
*/
|
|
84
|
+
pending = new Map();
|
|
85
|
+
/** The whole run's tables and diagnostics, which ride every reply
|
|
86
|
+
* regardless of which pages it carried. */
|
|
87
|
+
fonts = [];
|
|
88
|
+
assets = [];
|
|
89
|
+
bookWarnings = [];
|
|
90
|
+
bookPages = 0;
|
|
38
91
|
showing;
|
|
39
92
|
scale;
|
|
40
93
|
constructor(element, worker, options) {
|
|
@@ -51,6 +104,7 @@ export class Preview {
|
|
|
51
104
|
};
|
|
52
105
|
this.client = new Client(transport);
|
|
53
106
|
worker.addEventListener('message', (event) => this.client.receive(event.data));
|
|
107
|
+
this.element.addEventListener('copy', this.onCopy);
|
|
54
108
|
}
|
|
55
109
|
/**
|
|
56
110
|
* Opens a worker, loads the module into it, and takes the element
|
|
@@ -68,7 +122,7 @@ export class Preview {
|
|
|
68
122
|
setup.push({ op: 'split', level: options.split });
|
|
69
123
|
}
|
|
70
124
|
for (const [url, bytes] of Object.entries(options.images ?? {})) {
|
|
71
|
-
setup.push(preview.
|
|
125
|
+
setup.push(preview.keepImage(url, bytes));
|
|
72
126
|
}
|
|
73
127
|
if (setup.length > 0) {
|
|
74
128
|
await preview.client.apply(setup);
|
|
@@ -95,8 +149,9 @@ export class Preview {
|
|
|
95
149
|
await this.render([{ op: 'remove', name }]);
|
|
96
150
|
}
|
|
97
151
|
/**
|
|
98
|
-
* Names the book.
|
|
99
|
-
*
|
|
152
|
+
* Names the book. The PDF export reads the name, and layout reads
|
|
153
|
+
* `extra.language`, which chooses the hyphenation patterns, so a
|
|
154
|
+
* rename alone costs no layout.
|
|
100
155
|
*/
|
|
101
156
|
async setMetadata(metadata) {
|
|
102
157
|
await this.render([{ op: 'metadata', metadata }]);
|
|
@@ -113,9 +168,14 @@ export class Preview {
|
|
|
113
168
|
async edit(name, text) {
|
|
114
169
|
await this.render([{ op: 'edit', name, text }]);
|
|
115
170
|
}
|
|
116
|
-
/**
|
|
171
|
+
/**
|
|
172
|
+
* Sets the author styling, cascading over the built-in sheet:
|
|
173
|
+
* one sheet as CSS text, or the layers a host built its styling
|
|
174
|
+
* out of, in cascade order. Later sheets win, and a warning names
|
|
175
|
+
* the sheet its declaration was written in.
|
|
176
|
+
*/
|
|
117
177
|
async setStyle(css) {
|
|
118
|
-
await this.render([
|
|
178
|
+
await this.render([styleOp(css)]);
|
|
119
179
|
}
|
|
120
180
|
/** Registers a face for the session's life. */
|
|
121
181
|
async addFont(bytes) {
|
|
@@ -129,30 +189,79 @@ export class Preview {
|
|
|
129
189
|
* and a page with nothing where the image was.
|
|
130
190
|
*/
|
|
131
191
|
async addImage(url, bytes) {
|
|
132
|
-
await this.render([this.
|
|
192
|
+
await this.render([this.keepImage(url, bytes)]);
|
|
133
193
|
}
|
|
134
|
-
/**
|
|
194
|
+
/**
|
|
195
|
+
* Lays the book out again and repaints, asking only for the page on
|
|
196
|
+
* screen rather than the whole book. An edit drops whatever pages
|
|
197
|
+
* were held, since the book they came from no longer stands.
|
|
198
|
+
*/
|
|
135
199
|
async render(ops = []) {
|
|
136
|
-
const
|
|
137
|
-
|
|
200
|
+
const generation = this.client.generationFor(ops);
|
|
201
|
+
const target = Math.max(this.showing, 1);
|
|
202
|
+
const reply = await this.client.preview(ops, { first: target - 1, count: 1 });
|
|
203
|
+
if (reply === null) {
|
|
138
204
|
return;
|
|
139
205
|
}
|
|
140
|
-
this.
|
|
141
|
-
|
|
206
|
+
this.absorb(reply, generation);
|
|
207
|
+
this.showing = Math.min(Math.max(this.showing, 1), Math.max(this.bookPages, 1));
|
|
208
|
+
if (!this.held.has(this.showing)) {
|
|
209
|
+
// The edit changed how many pages the book has, and the page
|
|
210
|
+
// that was asked for clamped to one this reply did not carry.
|
|
211
|
+
const fix = await this.client.preview([], { first: this.showing - 1, count: 1 });
|
|
212
|
+
if (fix !== null && generation === this.heldGeneration) {
|
|
213
|
+
this.absorb(fix, generation);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
this.prune();
|
|
217
|
+
this.syncAssetCache();
|
|
218
|
+
await this.load();
|
|
142
219
|
this.paint();
|
|
143
|
-
this.
|
|
220
|
+
this.notify();
|
|
221
|
+
this.prefetchNeighbours();
|
|
144
222
|
}
|
|
145
223
|
/** How many pages the book set to. */
|
|
146
224
|
get pages() {
|
|
147
|
-
return this.
|
|
225
|
+
return this.bookPages;
|
|
148
226
|
}
|
|
149
227
|
/** The page on screen, counting from 1. */
|
|
150
228
|
get page() {
|
|
151
229
|
return this.showing;
|
|
152
230
|
}
|
|
153
231
|
set page(number) {
|
|
154
|
-
|
|
155
|
-
this.
|
|
232
|
+
const clamped = Math.min(Math.max(Math.round(number), 1), Math.max(this.pages, 1));
|
|
233
|
+
if (clamped === this.showing && this.held.has(clamped)) {
|
|
234
|
+
// Already on screen and painted: a render already notified for
|
|
235
|
+
// it, and a host that re-assigns the same page on every one of
|
|
236
|
+
// its own re-renders (a React effect keyed on the page it
|
|
237
|
+
// reads back, say) must not see that turn into a render of its
|
|
238
|
+
// own. `held` is checked rather than just the number, so a
|
|
239
|
+
// jump that failed outright (the worker answered with an
|
|
240
|
+
// error, say) — holding nothing — is still retried by asking
|
|
241
|
+
// again, rather than stuck with no way back short of
|
|
242
|
+
// navigating off the page and back.
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
this.showing = clamped;
|
|
246
|
+
if (this.held.has(clamped)) {
|
|
247
|
+
// Already decoded, from an earlier prefetch or an edit that
|
|
248
|
+
// requested it directly: paints without asking the worker.
|
|
249
|
+
this.prune();
|
|
250
|
+
this.syncAssetCache();
|
|
251
|
+
this.paint();
|
|
252
|
+
this.notify();
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
// Not held: the frame stays as it is until the page asked for
|
|
256
|
+
// arrives, rather than blank in the meantime. `fetchPage` joins
|
|
257
|
+
// a request already in flight for it — a page left and come
|
|
258
|
+
// back to before its own request landed, or one already asked
|
|
259
|
+
// for as a neighbour's prefetch — and paints it once it lands,
|
|
260
|
+
// since by then it may be the page on screen whichever request
|
|
261
|
+
// brought it in.
|
|
262
|
+
this.fetchPage(clamped);
|
|
263
|
+
}
|
|
264
|
+
this.prefetchNeighbours();
|
|
156
265
|
}
|
|
157
266
|
/** Points to CSS pixels. */
|
|
158
267
|
get zoom() {
|
|
@@ -172,14 +281,14 @@ export class Preview {
|
|
|
172
281
|
}
|
|
173
282
|
/** Everything the run had to complain about. */
|
|
174
283
|
get warnings() {
|
|
175
|
-
return this.
|
|
284
|
+
return this.bookWarnings;
|
|
176
285
|
}
|
|
177
286
|
/**
|
|
178
|
-
* The markup on screen, or a page that is not
|
|
179
|
-
*
|
|
287
|
+
* The markup on screen, or a page that is not held. Empty before
|
|
288
|
+
* the first render, and for a page outside the held window.
|
|
180
289
|
*/
|
|
181
290
|
svg(number = this.showing) {
|
|
182
|
-
const page = this.
|
|
291
|
+
const page = this.held.get(number);
|
|
183
292
|
return page === undefined ? '' : paintPage(page, this.painting());
|
|
184
293
|
}
|
|
185
294
|
/**
|
|
@@ -191,6 +300,7 @@ export class Preview {
|
|
|
191
300
|
}
|
|
192
301
|
/** Closes the worker and gives the element back. */
|
|
193
302
|
destroy() {
|
|
303
|
+
this.element.removeEventListener('copy', this.onCopy);
|
|
194
304
|
for (const face of this.faces.values()) {
|
|
195
305
|
this.element.ownerDocument.fonts.delete(face);
|
|
196
306
|
}
|
|
@@ -199,32 +309,251 @@ export class Preview {
|
|
|
199
309
|
URL.revokeObjectURL(url);
|
|
200
310
|
}
|
|
201
311
|
this.pixels.clear();
|
|
312
|
+
this.imageBytes.clear();
|
|
313
|
+
this.held.clear();
|
|
202
314
|
this.element.replaceChildren();
|
|
203
315
|
this.worker.terminate();
|
|
204
316
|
}
|
|
205
317
|
/**
|
|
206
|
-
* Keeps a
|
|
207
|
-
*
|
|
318
|
+
* Keeps a copy of an image's bytes and hands the original to the
|
|
319
|
+
* engine.
|
|
208
320
|
*
|
|
209
|
-
* The
|
|
321
|
+
* The copy is taken before the op is sent, because the bytes move
|
|
210
322
|
* across the wall rather than being copied and the buffer is empty
|
|
211
|
-
* on this side afterwards.
|
|
323
|
+
* on this side afterwards. No blob is made here: {@link
|
|
324
|
+
* syncAssetCache} makes one only once a held page actually draws
|
|
325
|
+
* this url, which for most images in a book-sized manuscript is
|
|
326
|
+
* never at the same time as every other one.
|
|
212
327
|
*/
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
if (
|
|
216
|
-
|
|
328
|
+
keepImage(url, bytes) {
|
|
329
|
+
const previous = this.pixels.get(url);
|
|
330
|
+
if (previous !== undefined) {
|
|
331
|
+
// Stale bytes replaced: the blob over them answers for an
|
|
332
|
+
// image that no longer exists, so it goes now rather than
|
|
333
|
+
// waiting on a page that may never come held again to notice.
|
|
334
|
+
URL.revokeObjectURL(previous);
|
|
335
|
+
this.pixels.delete(url);
|
|
217
336
|
}
|
|
218
|
-
this.
|
|
337
|
+
this.imageBytes.set(url, bytes.slice());
|
|
219
338
|
return { op: 'image', url, bytes };
|
|
220
339
|
}
|
|
340
|
+
/**
|
|
341
|
+
* Fetches one page not already pending, absorbing it and painting
|
|
342
|
+
* it if it is — or by the time it lands, has become — the page on
|
|
343
|
+
* screen. Shared by a page turn and a neighbour prefetch, so
|
|
344
|
+
* whichever of them asks first, the other joins it rather than
|
|
345
|
+
* opening a second request for the same page: what the request was
|
|
346
|
+
* *for* is decided when it lands, by whether `showing` still names
|
|
347
|
+
* it, not by which caller happened to start it.
|
|
348
|
+
*
|
|
349
|
+
* Errors are swallowed the way a missing face is elsewhere:
|
|
350
|
+
* nothing here is awaited by a caller that could catch one, and the
|
|
351
|
+
* frame simply stays as it was, retried the next time this page is
|
|
352
|
+
* asked for.
|
|
353
|
+
*/
|
|
354
|
+
fetchPage(target) {
|
|
355
|
+
if (this.pending.has(target)) {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
const generation = this.heldGeneration;
|
|
359
|
+
this.pending.set(target, generation);
|
|
360
|
+
this.client
|
|
361
|
+
.preview([], { first: target - 1, count: 1 })
|
|
362
|
+
.then(async (reply) => {
|
|
363
|
+
if (reply === null || generation !== this.heldGeneration) {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
this.absorb(reply, generation);
|
|
367
|
+
// Pruned whether or not this is the page on screen: `showing`
|
|
368
|
+
// may have moved on again while this was in flight, and its
|
|
369
|
+
// own window is what a page fetched for a target that far
|
|
370
|
+
// away landed outside of.
|
|
371
|
+
this.prune();
|
|
372
|
+
this.syncAssetCache();
|
|
373
|
+
if (this.showing !== target) {
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
await this.load();
|
|
377
|
+
this.paint();
|
|
378
|
+
this.notify();
|
|
379
|
+
})
|
|
380
|
+
.catch(() => undefined)
|
|
381
|
+
.finally(() => {
|
|
382
|
+
// Only clears the marker this fetch itself placed: a
|
|
383
|
+
// generation change may have cleared `pending` outright and
|
|
384
|
+
// let a fresh fetch for the same folio claim it under the
|
|
385
|
+
// new generation, which this must not remove out from under
|
|
386
|
+
// it.
|
|
387
|
+
if (this.pending.get(target) === generation) {
|
|
388
|
+
this.pending.delete(target);
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Warms the pages either side of the one on screen, so a page turn
|
|
394
|
+
* in either direction paints from what is already held rather than
|
|
395
|
+
* asking the worker.
|
|
396
|
+
*/
|
|
397
|
+
prefetchNeighbours() {
|
|
398
|
+
for (const target of [this.showing - 1, this.showing + 1]) {
|
|
399
|
+
if (target >= 1 && target <= this.bookPages && !this.held.has(target)) {
|
|
400
|
+
this.fetchPage(target);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Folds a reply into the held pages, keyed by folio rather than by
|
|
406
|
+
* its position in the reply. A reply for a generation `held` was
|
|
407
|
+
* not built under drops whatever was held before inserting: an
|
|
408
|
+
* edit is not undone by a page fetched against the book before it.
|
|
409
|
+
*/
|
|
410
|
+
absorb(reply, generation) {
|
|
411
|
+
if (generation !== this.heldGeneration) {
|
|
412
|
+
this.held.clear();
|
|
413
|
+
// A fetch still in flight for the generation before this one
|
|
414
|
+
// is answering a question about a book that no longer stands;
|
|
415
|
+
// its own generation check will discard the reply, but leaving
|
|
416
|
+
// its target `pending` until then would dedupe away a fresh
|
|
417
|
+
// fetch for the same folio in this generation, silently
|
|
418
|
+
// skipping it rather than prefetching it anew.
|
|
419
|
+
this.pending.clear();
|
|
420
|
+
this.heldGeneration = generation;
|
|
421
|
+
}
|
|
422
|
+
this.fonts = reply.fonts;
|
|
423
|
+
this.assets = reply.assets;
|
|
424
|
+
this.bookWarnings = reply.warnings;
|
|
425
|
+
this.bookPages = reply.bookPages;
|
|
426
|
+
reply.pages.forEach((page, index) => {
|
|
427
|
+
this.held.set(reply.first + index + 1, page);
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
/** Drops whatever is held outside the window around the page on screen. */
|
|
431
|
+
prune() {
|
|
432
|
+
const low = this.showing - HOLD_RADIUS;
|
|
433
|
+
const high = this.showing + HOLD_RADIUS;
|
|
434
|
+
for (const folio of this.held.keys()) {
|
|
435
|
+
if (folio < low || folio > high) {
|
|
436
|
+
this.held.delete(folio);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Blobs every image a held page draws that does not have one yet,
|
|
442
|
+
* and revokes every blob no held page draws any more. Run after
|
|
443
|
+
* {@link prune}, over `held` as a whole rather than page by page:
|
|
444
|
+
* an asset two held pages share is not revoked for one of them
|
|
445
|
+
* dropping out while the other still stands.
|
|
446
|
+
*
|
|
447
|
+
* A url the host has not supplied bytes for is simply absent from
|
|
448
|
+
* `imageBytes`, the same gap the painter's asset resolver already
|
|
449
|
+
* falls back from — this adds no failure mode of its own, only an
|
|
450
|
+
* eviction of what was already optional.
|
|
451
|
+
*/
|
|
452
|
+
syncAssetCache() {
|
|
453
|
+
const needed = new Set();
|
|
454
|
+
for (const page of this.held.values()) {
|
|
455
|
+
for (const item of page.items) {
|
|
456
|
+
if (item.kind === 'image') {
|
|
457
|
+
const url = this.assets[item.asset]?.url;
|
|
458
|
+
if (url !== undefined) {
|
|
459
|
+
needed.add(url);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
for (const url of needed) {
|
|
465
|
+
if (!this.pixels.has(url)) {
|
|
466
|
+
const bytes = this.imageBytes.get(url);
|
|
467
|
+
if (bytes !== undefined) {
|
|
468
|
+
this.pixels.set(url, URL.createObjectURL(new Blob([bytes.slice()], { type: mediaType(bytes) })));
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
for (const [url, blobUrl] of this.pixels) {
|
|
473
|
+
if (!needed.has(url)) {
|
|
474
|
+
URL.revokeObjectURL(blobUrl);
|
|
475
|
+
this.pixels.delete(url);
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
221
479
|
paint() {
|
|
222
480
|
this.frame.innerHTML = this.svg();
|
|
223
481
|
}
|
|
482
|
+
/**
|
|
483
|
+
* Copies the selection layer's own text, reconstructed from the
|
|
484
|
+
* range's own boundaries rather than trusted to the browser's
|
|
485
|
+
* default serialization across `<text>` siblings — SVG text
|
|
486
|
+
* elements are not block boxes, and nothing guarantees a browser
|
|
487
|
+
* puts a line break between two of them the way it would between
|
|
488
|
+
* paragraphs. This is the pdf.js pattern: the layer under the
|
|
489
|
+
* pointer draws nothing, and copy answers from what it holds.
|
|
490
|
+
*/
|
|
491
|
+
onCopy = (event) => {
|
|
492
|
+
const text = this.selectedText();
|
|
493
|
+
if (text === null) {
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
event.clipboardData?.setData('text/plain', text);
|
|
497
|
+
event.preventDefault();
|
|
498
|
+
};
|
|
499
|
+
/**
|
|
500
|
+
* The selection's own text, one line's slice per line it touches,
|
|
501
|
+
* joined in reading order. `null` for a selection with nothing in
|
|
502
|
+
* it, or one that lies outside this preview altogether — a host's
|
|
503
|
+
* own text elsewhere on the page is not this preview's to answer
|
|
504
|
+
* for.
|
|
505
|
+
*/
|
|
506
|
+
selectedText() {
|
|
507
|
+
const selection = this.element.ownerDocument.getSelection();
|
|
508
|
+
if (selection === null || selection.isCollapsed || selection.rangeCount === 0) {
|
|
509
|
+
return null;
|
|
510
|
+
}
|
|
511
|
+
const range = selection.getRangeAt(0);
|
|
512
|
+
if (!this.frame.contains(range.commonAncestorContainer)) {
|
|
513
|
+
return null;
|
|
514
|
+
}
|
|
515
|
+
const lines = [...this.frame.querySelectorAll('text[data-selection-line]')];
|
|
516
|
+
const parts = [];
|
|
517
|
+
for (const line of lines) {
|
|
518
|
+
if (!range.intersectsNode(line)) {
|
|
519
|
+
continue;
|
|
520
|
+
}
|
|
521
|
+
const full = line.textContent ?? '';
|
|
522
|
+
const start = line.contains(range.startContainer)
|
|
523
|
+
? boundaryOffset(line, range.startContainer, range.startOffset)
|
|
524
|
+
: 0;
|
|
525
|
+
const end = line.contains(range.endContainer)
|
|
526
|
+
? boundaryOffset(line, range.endContainer, range.endOffset)
|
|
527
|
+
: full.length;
|
|
528
|
+
parts.push(full.slice(start, end));
|
|
529
|
+
}
|
|
530
|
+
return parts.length === 0 ? null : parts.join('\n');
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Calls {@link PreviewOptions.onRender}, if the page on screen is
|
|
534
|
+
* held: built fresh from `held` and the run's tables rather than
|
|
535
|
+
* threaded through from whichever fetch put it there, so a host
|
|
536
|
+
* hears about every page that reaches the screen the same way,
|
|
537
|
+
* cached or just arrived.
|
|
538
|
+
*/
|
|
539
|
+
notify() {
|
|
540
|
+
const page = this.held.get(this.showing);
|
|
541
|
+
if (page === undefined) {
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
this.options.onRender?.({
|
|
545
|
+
pages: [page],
|
|
546
|
+
first: this.showing - 1,
|
|
547
|
+
bookPages: this.bookPages,
|
|
548
|
+
fonts: this.fonts,
|
|
549
|
+
assets: this.assets,
|
|
550
|
+
warnings: this.bookWarnings,
|
|
551
|
+
});
|
|
552
|
+
}
|
|
224
553
|
painting() {
|
|
225
554
|
return {
|
|
226
|
-
fonts: this.
|
|
227
|
-
assets: this.
|
|
555
|
+
fonts: this.fonts,
|
|
556
|
+
assets: this.assets,
|
|
228
557
|
zoom: this.scale,
|
|
229
558
|
...(this.options.paper === undefined ? {} : { paper: this.options.paper }),
|
|
230
559
|
...(this.options.ink === undefined ? {} : { ink: this.options.ink }),
|
|
@@ -232,8 +561,8 @@ export class Preview {
|
|
|
232
561
|
};
|
|
233
562
|
}
|
|
234
563
|
/**
|
|
235
|
-
* Loads the faces the
|
|
236
|
-
* engine shaped with.
|
|
564
|
+
* Loads the faces the held pages draw with, from the same files
|
|
565
|
+
* the engine shaped with.
|
|
237
566
|
*
|
|
238
567
|
* The bundled face is why this asks the module rather than the
|
|
239
568
|
* network: it is inside the module, and there is no URL to fetch
|
|
@@ -241,12 +570,12 @@ export class Preview {
|
|
|
241
570
|
* the painter's fallback stack is what the reader sees instead of
|
|
242
571
|
* a blank page. `faces: 'host'` is that stack on purpose.
|
|
243
572
|
*/
|
|
244
|
-
async load(
|
|
573
|
+
async load() {
|
|
245
574
|
if (this.options.faces === 'host') {
|
|
246
575
|
return;
|
|
247
576
|
}
|
|
248
577
|
const used = new Set();
|
|
249
|
-
for (const page of
|
|
578
|
+
for (const page of this.held.values()) {
|
|
250
579
|
for (const item of page.items) {
|
|
251
580
|
if (item.kind === 'text') {
|
|
252
581
|
used.add(item.fontId);
|
|
@@ -262,7 +591,7 @@ export class Preview {
|
|
|
262
591
|
// Registered as what it is, so that asking for it by that
|
|
263
592
|
// slope and weight is an exact match and the browser
|
|
264
593
|
// synthesises nothing over the cut the engine shaped with.
|
|
265
|
-
const attributes = this.
|
|
594
|
+
const attributes = this.fonts[id]?.attributes;
|
|
266
595
|
const face = new FontFace(faceFamily(id), bytes.buffer, {
|
|
267
596
|
style: attributes?.italic === true ? 'italic' : 'normal',
|
|
268
597
|
weight: String(attributes?.weight ?? 400),
|
|
@@ -277,6 +606,17 @@ export class Preview {
|
|
|
277
606
|
}
|
|
278
607
|
}
|
|
279
608
|
}
|
|
609
|
+
/**
|
|
610
|
+
* A range boundary's offset into one selection line's text, whichever
|
|
611
|
+
* kind of node it landed on. Inside the line's own text node the
|
|
612
|
+
* offset is already a character index; on the `<text>` element
|
|
613
|
+
* itself — which has exactly that one child — it is a child index, 0
|
|
614
|
+
* before it and 1 after, so it becomes the two ends of the line's own
|
|
615
|
+
* text rather than a stray zero.
|
|
616
|
+
*/
|
|
617
|
+
function boundaryOffset(line, container, offset) {
|
|
618
|
+
return container === line.firstChild ? offset : offset === 0 ? 0 : (line.textContent ?? '').length;
|
|
619
|
+
}
|
|
280
620
|
/**
|
|
281
621
|
* What an image is, read off its own first bytes.
|
|
282
622
|
*
|
package/dist/preview.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preview.js","sourceRoot":"","sources":["../src/preview.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,MAAM,EAAkB,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAA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