fleuron 0.1.2 → 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/README.md
CHANGED
|
@@ -31,8 +31,8 @@ session, fetches the fonts the book was set in, and paints a page as
|
|
|
31
31
|
SVG. The encoded buffer, the worker messages and the display structure
|
|
32
32
|
are handled internally, and all three stay exported.
|
|
33
33
|
|
|
34
|
-
`fleuron-react` is the same thing as a component,
|
|
35
|
-
|
|
34
|
+
`fleuron-react` is the same thing as a component, with no engine logic
|
|
35
|
+
of its own.
|
|
36
36
|
|
|
37
37
|
## In a worker
|
|
38
38
|
|
|
@@ -50,7 +50,7 @@ self.onmessage = ({ data }) => {
|
|
|
50
50
|
|
|
51
51
|
```js
|
|
52
52
|
// the host
|
|
53
|
-
import { Client, paintPage } from 'fleuron';
|
|
53
|
+
import { Client, paintPage, styleOp } from 'fleuron';
|
|
54
54
|
|
|
55
55
|
const worker = new Worker(new URL('./fleuron.worker.js', import.meta.url), { type: 'module' });
|
|
56
56
|
const client = new Client({ post: (request, transfer) => worker.postMessage(request, transfer) });
|
|
@@ -58,7 +58,7 @@ worker.onmessage = ({ data }) => client.receive(data);
|
|
|
58
58
|
|
|
59
59
|
const output = await client.preview([
|
|
60
60
|
{ op: 'markdown', name: 'manuscript.md', text: markdown },
|
|
61
|
-
|
|
61
|
+
styleOp(css),
|
|
62
62
|
]);
|
|
63
63
|
if (output !== null) {
|
|
64
64
|
element.innerHTML = paintPage(output.pages[0], { fonts: output.fonts });
|
|
@@ -79,7 +79,7 @@ styling, and every stage between them and the page. A second render
|
|
|
79
79
|
pays for the edit rather than for the book.
|
|
80
80
|
|
|
81
81
|
```js
|
|
82
|
-
await client.preview([
|
|
82
|
+
await client.preview([styleOp('@page { margin-bottom: 84pt }')]);
|
|
83
83
|
await client.preview([{ op: 'edit', name: 'ch03.md', text }]);
|
|
84
84
|
await client.apply([{ op: 'font', bytes }]);
|
|
85
85
|
```
|
|
@@ -103,12 +103,12 @@ const pdf = renderPdf(markdown, css);
|
|
|
103
103
|
## The display structure
|
|
104
104
|
|
|
105
105
|
`client.preview` hands back pages of text runs, rules and images, in
|
|
106
|
-
points, origin top left. Each text run
|
|
106
|
+
points, origin top left. Each text run has the string it was shaped
|
|
107
107
|
from and each glyph a byte range into it, which is what a painter needs
|
|
108
108
|
for selection and copy-and-paste.
|
|
109
109
|
|
|
110
110
|
`paintPage` draws one of them as SVG. Each run becomes one `<text>`
|
|
111
|
-
|
|
111
|
+
with an x for every character in it, so the browser places the
|
|
112
112
|
glyphs where the engine put them instead of working out positions of
|
|
113
113
|
its own. `exportPdf` writes the same pages as PDF.
|
|
114
114
|
|
package/dist/client.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { type LayoutOutput } from './wire.js';
|
|
|
7
7
|
/** How a request reaches the worker. */
|
|
8
8
|
export interface Transport {
|
|
9
9
|
/**
|
|
10
|
-
* Sends one request. `transfer`
|
|
10
|
+
* Sends one request. `transfer` lists the buffers that should move
|
|
11
11
|
* rather than be copied: font and image bytes, which the host has
|
|
12
12
|
* no reason to keep a second copy of.
|
|
13
13
|
*/
|
|
@@ -15,6 +15,13 @@ export interface Transport {
|
|
|
15
15
|
}
|
|
16
16
|
/** A render that was overtaken: nothing came back, and nothing should be painted. */
|
|
17
17
|
export declare const SUPERSEDED: null;
|
|
18
|
+
/** A slice of the book's pages: `count` of them, starting at `first`. */
|
|
19
|
+
export interface Range {
|
|
20
|
+
/** The first page to send, counting from 0. */
|
|
21
|
+
first: number;
|
|
22
|
+
/** How many pages to send. */
|
|
23
|
+
count: number;
|
|
24
|
+
}
|
|
18
25
|
/**
|
|
19
26
|
* A client over one worker.
|
|
20
27
|
*
|
|
@@ -31,8 +38,15 @@ export declare class Client {
|
|
|
31
38
|
constructor(transport: Transport);
|
|
32
39
|
/** Hands a reply from the worker to whoever is waiting for it. */
|
|
33
40
|
receive(response: Response): void;
|
|
34
|
-
/** The generation
|
|
41
|
+
/** The current generation. Raised only by a render whose `ops` is non-empty. */
|
|
35
42
|
get current(): number;
|
|
43
|
+
/**
|
|
44
|
+
* The generation a call to {@link Client.render}/{@link Client.preview}
|
|
45
|
+
* with these `ops` will be answered under, without sending anything.
|
|
46
|
+
* A caller that tags what it fetches with a generation of its own
|
|
47
|
+
* asks here rather than mirror the rule this raises it by.
|
|
48
|
+
*/
|
|
49
|
+
generationFor(ops: Op[]): number;
|
|
36
50
|
/**
|
|
37
51
|
* What the last painted render cost, counted in stage runs rather
|
|
38
52
|
* than milliseconds: a cache that served shows here, where a clock
|
|
@@ -45,11 +59,19 @@ export declare class Client {
|
|
|
45
59
|
paint: number;
|
|
46
60
|
};
|
|
47
61
|
/**
|
|
48
|
-
* Applies inputs and asks for a display structure
|
|
62
|
+
* Applies inputs and asks for a display structure, `range` naming
|
|
63
|
+
* which pages of it rather than the whole book. Resolves to `null`
|
|
49
64
|
* when a later render overtook this one, or when its reply came
|
|
50
65
|
* back behind the current generation.
|
|
66
|
+
*
|
|
67
|
+
* A ranged request (both `ops` empty and `range` given) is a
|
|
68
|
+
* question about the book as it stands, not a render: within the
|
|
69
|
+
* generation it was asked under, it never overtakes, and is never
|
|
70
|
+
* overtaken by, another render or range. An edit still raises the
|
|
71
|
+
* generation, and a range asked for before one arrives resolves to
|
|
72
|
+
* `null` once it lands, the same as any other stale reply.
|
|
51
73
|
*/
|
|
52
|
-
preview(ops?: Op[]): Promise<LayoutOutput | null>;
|
|
74
|
+
preview(ops?: Op[], range?: Range): Promise<LayoutOutput | null>;
|
|
53
75
|
/** The same, as PDF bytes. */
|
|
54
76
|
exportPdf(ops?: Op[]): Promise<Uint8Array | null>;
|
|
55
77
|
/**
|
|
@@ -67,8 +89,14 @@ export declare class Client {
|
|
|
67
89
|
* Applies inputs and asks for bytes: the display structure as the
|
|
68
90
|
* engine encoded it, or a PDF. `null` when this render was
|
|
69
91
|
* overtaken.
|
|
92
|
+
*
|
|
93
|
+
* The generation only raises when `ops` changed something. A range
|
|
94
|
+
* fetch with nothing to apply asks about the current generation
|
|
95
|
+
* rather than opening a new one, so it cannot be outrun by, or
|
|
96
|
+
* outrun, a sibling range fetch that shares it — only a real edit
|
|
97
|
+
* moves the generation such requests are answering against.
|
|
70
98
|
*/
|
|
71
|
-
render(ops: Op[], want: Want): Promise<Uint8Array | null>;
|
|
99
|
+
render(ops: Op[], want: Want, range?: Range): Promise<Uint8Array | null>;
|
|
72
100
|
private send;
|
|
73
101
|
}
|
|
74
102
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],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,OAAO,CAAC,IAAI;CAgCb"}
|
package/dist/client.js
CHANGED
|
@@ -31,10 +31,19 @@ export class Client {
|
|
|
31
31
|
this.waiting.delete(response.id);
|
|
32
32
|
settle(response);
|
|
33
33
|
}
|
|
34
|
-
/** The generation
|
|
34
|
+
/** The current generation. Raised only by a render whose `ops` is non-empty. */
|
|
35
35
|
get current() {
|
|
36
36
|
return this.generation;
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* The generation a call to {@link Client.render}/{@link Client.preview}
|
|
40
|
+
* with these `ops` will be answered under, without sending anything.
|
|
41
|
+
* A caller that tags what it fetches with a generation of its own
|
|
42
|
+
* asks here rather than mirror the rule this raises it by.
|
|
43
|
+
*/
|
|
44
|
+
generationFor(ops) {
|
|
45
|
+
return ops.length > 0 ? this.generation + 1 : this.generation;
|
|
46
|
+
}
|
|
38
47
|
/**
|
|
39
48
|
* What the last painted render cost, counted in stage runs rather
|
|
40
49
|
* than milliseconds: a cache that served shows here, where a clock
|
|
@@ -45,12 +54,20 @@ export class Client {
|
|
|
45
54
|
return { style, lines, flow, paint };
|
|
46
55
|
}
|
|
47
56
|
/**
|
|
48
|
-
* Applies inputs and asks for a display structure
|
|
57
|
+
* Applies inputs and asks for a display structure, `range` naming
|
|
58
|
+
* which pages of it rather than the whole book. Resolves to `null`
|
|
49
59
|
* when a later render overtook this one, or when its reply came
|
|
50
60
|
* back behind the current generation.
|
|
61
|
+
*
|
|
62
|
+
* A ranged request (both `ops` empty and `range` given) is a
|
|
63
|
+
* question about the book as it stands, not a render: within the
|
|
64
|
+
* generation it was asked under, it never overtakes, and is never
|
|
65
|
+
* overtaken by, another render or range. An edit still raises the
|
|
66
|
+
* generation, and a range asked for before one arrives resolves to
|
|
67
|
+
* `null` once it lands, the same as any other stale reply.
|
|
51
68
|
*/
|
|
52
|
-
async preview(ops = []) {
|
|
53
|
-
const bytes = await this.render(ops, 'preview');
|
|
69
|
+
async preview(ops = [], range) {
|
|
70
|
+
const bytes = await this.render(ops, 'preview', range);
|
|
54
71
|
return bytes === SUPERSEDED ? SUPERSEDED : decodeDisplayList(bytes);
|
|
55
72
|
}
|
|
56
73
|
/** The same, as PDF bytes. */
|
|
@@ -80,16 +97,22 @@ export class Client {
|
|
|
80
97
|
* Applies inputs and asks for bytes: the display structure as the
|
|
81
98
|
* engine encoded it, or a PDF. `null` when this render was
|
|
82
99
|
* overtaken.
|
|
100
|
+
*
|
|
101
|
+
* The generation only raises when `ops` changed something. A range
|
|
102
|
+
* fetch with nothing to apply asks about the current generation
|
|
103
|
+
* rather than opening a new one, so it cannot be outrun by, or
|
|
104
|
+
* outrun, a sibling range fetch that shares it — only a real edit
|
|
105
|
+
* moves the generation such requests are answering against.
|
|
83
106
|
*/
|
|
84
|
-
async render(ops, want) {
|
|
85
|
-
this.generation
|
|
86
|
-
const response = await this.send({ ops, want, generation: this.generation });
|
|
107
|
+
async render(ops, want, range) {
|
|
108
|
+
this.generation = this.generationFor(ops);
|
|
109
|
+
const response = await this.send({ ops, want, generation: this.generation, ...range });
|
|
87
110
|
if (!isRendered(response)) {
|
|
88
111
|
return SUPERSEDED;
|
|
89
112
|
}
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
//
|
|
113
|
+
// Only overtaking among the requests the worker already had shows
|
|
114
|
+
// up there. A reply can also be outrun in flight, which only the
|
|
115
|
+
// host can see.
|
|
93
116
|
if (response.generation < this.generation) {
|
|
94
117
|
return SUPERSEDED;
|
|
95
118
|
}
|
|
@@ -104,6 +127,8 @@ export class Client {
|
|
|
104
127
|
ops: what.ops,
|
|
105
128
|
...(what.want === undefined ? {} : { want: what.want }),
|
|
106
129
|
...(what.font === undefined ? {} : { font: what.font }),
|
|
130
|
+
...(what.first === undefined ? {} : { first: what.first }),
|
|
131
|
+
...(what.count === undefined ? {} : { count: what.count }),
|
|
107
132
|
};
|
|
108
133
|
const transfer = request.ops
|
|
109
134
|
.filter((op) => op.op === 'font' || op.op === 'image')
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAmD,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,iBAAiB,EAAqB,MAAM,WAAW,CAAC;AAYjE,qFAAqF;AACrF,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAmD,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,iBAAiB,EAAqB,MAAM,WAAW,CAAC;AAYjE,qFAAqF;AACrF,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC;AAU/B;;;;;;GAMG;AACH,MAAM,OAAO,MAAM;IACA,SAAS,CAAY;IACrB,OAAO,GAAG,IAAI,GAAG,EAAwC,CAAC;IACnE,EAAE,GAAG,CAAC,CAAC;IACP,UAAU,GAAG,CAAC,CAAC;IACf,QAAQ,GAAqC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAElE,YAAY,SAAoB;QAC9B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAED,kEAAkE;IAClE,OAAO,CAAC,QAAkB;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC7C,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACnB,CAAC;IAED,gFAAgF;IAChF,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,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,CAAC,IAAI,EAAE,CAAC;YACvD,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;YAC1D,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;SAC3D,CAAC;QACF,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG;aACzB,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,MAAM,IAAI,EAAE,CAAC,EAAE,KAAK,OAAO,CAAC;aACrD,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,MAAqB,CAAC,CAAC;QAC/C,OAAO,IAAI,OAAO,CAAW,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC/C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,EAAE;gBACxC,IAAI,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACvB,MAAM,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;gBACpC,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,QAAQ,CAAC,CAAC;gBACpB,CAAC;YACH,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/engine.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Requests are applied in the order they arrive and renders are not.
|
|
6
6
|
* A render that a later request overtakes before it starts is
|
|
7
|
-
* dropped, and the inputs it
|
|
7
|
+
* dropped, and the inputs it was sent with are applied all the same. So a
|
|
8
8
|
* dropped render leaves no stage half-built, and the render that
|
|
9
9
|
* follows it produces exactly what it would have produced had nobody
|
|
10
10
|
* typed.
|
|
@@ -27,7 +27,7 @@ export type Reply = (response: Response, transfer: ArrayBuffer[]) => void;
|
|
|
27
27
|
/**
|
|
28
28
|
* Loads the module and opens a session over it.
|
|
29
29
|
*
|
|
30
|
-
* One session per worker: it
|
|
30
|
+
* One session per worker: it keeps the manuscript, the styling and
|
|
31
31
|
* every stage between them, which is what makes the second render of
|
|
32
32
|
* a book cost what changed rather than the book.
|
|
33
33
|
*/
|
package/dist/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAa,EAAE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAM,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE3D,gCAAgC;AAChC,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,kEAAkE;AAClE,MAAM,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;AAO1E;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAG/E;AAED,0DAA0D;AAC1D,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IACvC,OAAO,CAAC,QAAQ,CAAS;gBAEb,OAAO,EAAE,OAAO;IAI5B,iEAAiE;IACjE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAK5C,qCAAqC;IACrC,IAAI,IAAI,IAAI;YAIE,KAAK;IAqBnB,OAAO,CAAC,GAAG;IAmCX,OAAO,CAAC,OAAO;IAWf,OAAO,CAAC,KAAK;
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAa,EAAE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAM,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE3D,gCAAgC;AAChC,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,kEAAkE;AAClE,MAAM,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;AAO1E;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAG/E;AAED,0DAA0D;AAC1D,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAiB;IACvC,OAAO,CAAC,QAAQ,CAAS;gBAEb,OAAO,EAAE,OAAO;IAI5B,iEAAiE;IACjE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAK5C,qCAAqC;IACrC,IAAI,IAAI,IAAI;YAIE,KAAK;IAqBnB,OAAO,CAAC,GAAG;IAmCX,OAAO,CAAC,OAAO;IAWf,OAAO,CAAC,KAAK;CAoDd"}
|
package/dist/engine.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Requests are applied in the order they arrive and renders are not.
|
|
6
6
|
* A render that a later request overtakes before it starts is
|
|
7
|
-
* dropped, and the inputs it
|
|
7
|
+
* dropped, and the inputs it was sent with are applied all the same. So a
|
|
8
8
|
* dropped render leaves no stage half-built, and the render that
|
|
9
9
|
* follows it produces exactly what it would have produced had nobody
|
|
10
10
|
* typed.
|
|
@@ -13,7 +13,7 @@ import init, { Session } from '../wasm/fleuron.js';
|
|
|
13
13
|
/**
|
|
14
14
|
* Loads the module and opens a session over it.
|
|
15
15
|
*
|
|
16
|
-
* One session per worker: it
|
|
16
|
+
* One session per worker: it keeps the manuscript, the styling and
|
|
17
17
|
* every stage between them, which is what makes the second render of
|
|
18
18
|
* a book cost what changed rather than the book.
|
|
19
19
|
*/
|
|
@@ -73,7 +73,7 @@ export class Engine {
|
|
|
73
73
|
reply({ id, generation, applied: true }, []);
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
if (!render && request
|
|
76
|
+
if (!render && !isQuestion(request)) {
|
|
77
77
|
reply({ id, generation, superseded: true }, []);
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
@@ -98,7 +98,7 @@ export class Engine {
|
|
|
98
98
|
case 'font':
|
|
99
99
|
return this.session.fontBytes(request.font ?? 0);
|
|
100
100
|
default:
|
|
101
|
-
return this.session.preview();
|
|
101
|
+
return this.session.preview(request.first, request.count);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
apply(op) {
|
|
@@ -134,21 +134,50 @@ export class Engine {
|
|
|
134
134
|
this.session.setContent(op.json);
|
|
135
135
|
break;
|
|
136
136
|
case 'style':
|
|
137
|
-
|
|
137
|
+
// A host that writes its own plumbing writes it in plain
|
|
138
|
+
// JavaScript, where the op's type reaches nothing, so what
|
|
139
|
+
// arrives is checked rather than assumed.
|
|
140
|
+
if (!Array.isArray(op.sheets) ||
|
|
141
|
+
op.sheets.some((sheet) => typeof sheet?.name !== 'string' || typeof sheet?.css !== 'string')) {
|
|
142
|
+
throw new Error("the style op takes { op: 'style', sheets: [{ name, css }] }");
|
|
143
|
+
}
|
|
144
|
+
this.session.setStyle(op.sheets.map((sheet) => sheet.name), op.sheets.map((sheet) => sheet.css));
|
|
138
145
|
break;
|
|
139
146
|
}
|
|
140
147
|
}
|
|
141
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Whether a request is a question rather than a render: asking for a
|
|
151
|
+
* face's bytes, or asking which pages of the book as it stands — no
|
|
152
|
+
* `ops` of its own — fall in a range. Neither overtakes a render nor
|
|
153
|
+
* is overtaken by one, or by a sibling question, since neither says
|
|
154
|
+
* what the last edit produced.
|
|
155
|
+
*
|
|
156
|
+
* A range alone does not make a question: an edit that also names a
|
|
157
|
+
* range, to fetch the one page it changed rather than the whole
|
|
158
|
+
* book, still says what that edit produced and is a render like any
|
|
159
|
+
* other for supersession's sake.
|
|
160
|
+
*/
|
|
161
|
+
function isQuestion(request) {
|
|
162
|
+
return (request.want === 'font' ||
|
|
163
|
+
(request.want === 'preview' &&
|
|
164
|
+
request.ops.length === 0 &&
|
|
165
|
+
request.first !== undefined &&
|
|
166
|
+
request.count !== undefined));
|
|
167
|
+
}
|
|
142
168
|
/**
|
|
143
169
|
* Which request in a batch is the one whose render still matters.
|
|
144
170
|
*
|
|
145
|
-
* A question is not a render
|
|
146
|
-
*
|
|
171
|
+
* A question is not a render, so it is never the answer here and
|
|
172
|
+
* never marked superseded for losing to one: see {@link isQuestion}.
|
|
147
173
|
*/
|
|
148
174
|
function lastRenderIn(batch) {
|
|
149
175
|
for (let index = batch.length - 1; index >= 0; index -= 1) {
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
176
|
+
const request = batch[index]?.request;
|
|
177
|
+
if (request === undefined || isQuestion(request)) {
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
if (request.want === 'preview' || request.want === 'pdf') {
|
|
152
181
|
return index;
|
|
153
182
|
}
|
|
154
183
|
}
|
package/dist/engine.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.js","sourceRoot":"","sources":["../src/eng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,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CACpC,CAAC;gBACF,MAAM;QACV,CAAC;IACH,CAAC;CACF;AAED;;;;;;;;;;;GAWG;AACH,SAAS,UAAU,CAAC,OAAgB;IAClC,OAAO,CACL,OAAO,CAAC,IAAI,KAAK,MAAM;QACvB,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS;YACzB,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC;YACxB,OAAO,CAAC,KAAK,KAAK,SAAS;YAC3B,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAC/B,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,YAAY,CAAC,KAAgB;IACpC,KAAK,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC1D,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QACtC,IAAI,OAAO,KAAK,SAAS,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACjD,SAAS;QACX,CAAC;QACD,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC;YACzD,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC,CAAC;AACZ,CAAC;AAED,oEAAoE;AACpE,SAAS,MAAM;IACb,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export { Client, SUPERSEDED, type Transport } from './client.js';
|
|
14
14
|
export { Engine, createEngine, type EngineOptions, type Reply } from './engine.js';
|
|
15
|
-
export { isFailed, isRendered, type Applied, type Failed, type Metadata, type Op, type Rendered, type Request, type Response, type Source, type Superseded, type Want, } from './protocol.js';
|
|
15
|
+
export { isFailed, isRendered, styleOp, type Applied, type Failed, type Metadata, type Op, type Rendered, type Request, type Response, type Sheet, type Source, type Superseded, type Want, } from './protocol.js';
|
|
16
16
|
export { Preview, type PreviewOptions } from './preview.js';
|
|
17
17
|
export { VERSION } from './version.js';
|
|
18
18
|
export { faceFamily, paintPage, type PaintOptions } from './svg.js';
|
|
19
|
-
export { WIRE_VERSION, WireError, decodeDisplayList, wireVersionOf, type Asset, type DrawItem, type AxisSetting, type FaceAttributes, type FontRefEntry, type Glyph, type ImageItem, type Intrinsic, type LayoutOutput, type Page, type RectItem, type Side, type TextItem, type Warning, } from './wire.js';
|
|
19
|
+
export { WIRE_VERSION, WireError, decodeDisplayList, wireVersionOf, type Asset, type DrawItem, type AxisSetting, type FaceAttributes, type Features, type FontRefEntry, type Glyph, type ImageItem, type Intrinsic, type LayoutOutput, type Page, type RectItem, type Side, type TextItem, type Warning, } from './wire.js';
|
|
20
20
|
export { Session, render, renderPdf, wireVersion } from '../wasm/fleuron.js';
|
|
21
21
|
export { default as initWasm, initSync, type InitInput, type SyncInitInput } from '../wasm/fleuron.js';
|
|
22
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,KAAK,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EACL,QAAQ,EACR,UAAU,EACV,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,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,EACb,KAAK,EAAE,EACP,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,IAAI,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EACL,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,KAAK,KAAK,EACV,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,IAAI,EACT,KAAK,QAAQ,EACb,KAAK,OAAO,GACb,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export { Client, SUPERSEDED } from './client.js';
|
|
14
14
|
export { Engine, createEngine } from './engine.js';
|
|
15
|
-
export { isFailed, isRendered, } from './protocol.js';
|
|
15
|
+
export { isFailed, isRendered, styleOp, } from './protocol.js';
|
|
16
16
|
export { Preview } from './preview.js';
|
|
17
17
|
export { VERSION } from './version.js';
|
|
18
18
|
export { faceFamily, paintPage } from './svg.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAkB,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAkC,MAAM,aAAa,CAAC;AACnF,OAAO,EACL,QAAQ,EACR,UAAU,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAkB,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAkC,MAAM,aAAa,CAAC;AACnF,OAAO,EACL,QAAQ,EACR,UAAU,EACV,OAAO,GAYR,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAuB,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAqB,MAAM,UAAU,CAAC;AACpE,OAAO,EACL,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,aAAa,GAgBd,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,QAAQ,EAAsC,MAAM,oBAAoB,CAAC"}
|