postext-folio 0.52.5 → 0.52.7

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.
Files changed (73) hide show
  1. package/dist/postext/book.d.ts +35 -0
  2. package/dist/postext/book.d.ts.map +1 -0
  3. package/dist/postext/book.js +96 -0
  4. package/dist/postext/book.js.map +1 -0
  5. package/dist/postext/constants.d.ts +36 -0
  6. package/dist/postext/constants.d.ts.map +1 -0
  7. package/dist/postext/constants.js +13 -0
  8. package/dist/postext/constants.js.map +1 -0
  9. package/dist/postext/pageVideos.d.ts +26 -0
  10. package/dist/postext/pageVideos.d.ts.map +1 -0
  11. package/dist/postext/pageVideos.js +276 -0
  12. package/dist/postext/pageVideos.js.map +1 -0
  13. package/dist/postext/painting.d.ts +30 -0
  14. package/dist/postext/painting.d.ts.map +1 -0
  15. package/dist/postext/painting.js +167 -0
  16. package/dist/postext/painting.js.map +1 -0
  17. package/dist/postext/sharp.d.ts +19 -0
  18. package/dist/postext/sharp.d.ts.map +1 -0
  19. package/dist/postext/sharp.js +121 -0
  20. package/dist/postext/sharp.js.map +1 -0
  21. package/dist/postext/state.d.ts +29 -0
  22. package/dist/postext/state.d.ts.map +1 -0
  23. package/dist/postext/state.js +2 -0
  24. package/dist/postext/state.js.map +1 -0
  25. package/dist/postext/sweep.d.ts +24 -0
  26. package/dist/postext/sweep.d.ts.map +1 -0
  27. package/dist/postext/sweep.js +37 -0
  28. package/dist/postext/sweep.js.map +1 -0
  29. package/dist/postext/types.d.ts +77 -0
  30. package/dist/postext/types.d.ts.map +1 -0
  31. package/dist/postext/types.js +2 -0
  32. package/dist/postext/types.js.map +1 -0
  33. package/dist/postext.d.ts +6 -124
  34. package/dist/postext.d.ts.map +1 -1
  35. package/dist/postext.js +87 -732
  36. package/dist/postext.js.map +1 -1
  37. package/dist/viewer/constants.d.ts +30 -0
  38. package/dist/viewer/constants.d.ts.map +1 -0
  39. package/dist/viewer/constants.js +49 -0
  40. package/dist/viewer/constants.js.map +1 -0
  41. package/dist/viewer/input.d.ts +15 -0
  42. package/dist/viewer/input.d.ts.map +1 -0
  43. package/dist/viewer/input.js +142 -0
  44. package/dist/viewer/input.js.map +1 -0
  45. package/dist/viewer/layout.d.ts +24 -0
  46. package/dist/viewer/layout.d.ts.map +1 -0
  47. package/dist/viewer/layout.js +183 -0
  48. package/dist/viewer/layout.js.map +1 -0
  49. package/dist/viewer/lens.d.ts +42 -0
  50. package/dist/viewer/lens.d.ts.map +1 -0
  51. package/dist/viewer/lens.js +166 -0
  52. package/dist/viewer/lens.js.map +1 -0
  53. package/dist/viewer/pointer.d.ts +37 -0
  54. package/dist/viewer/pointer.d.ts.map +1 -0
  55. package/dist/viewer/pointer.js +250 -0
  56. package/dist/viewer/pointer.js.map +1 -0
  57. package/dist/viewer/state.d.ts +70 -0
  58. package/dist/viewer/state.d.ts.map +1 -0
  59. package/dist/viewer/state.js +2 -0
  60. package/dist/viewer/state.js.map +1 -0
  61. package/dist/viewer/turning.d.ts +34 -0
  62. package/dist/viewer/turning.d.ts.map +1 -0
  63. package/dist/viewer/turning.js +156 -0
  64. package/dist/viewer/turning.js.map +1 -0
  65. package/dist/viewer/types.d.ts +241 -0
  66. package/dist/viewer/types.d.ts.map +1 -0
  67. package/dist/viewer/types.js +2 -0
  68. package/dist/viewer/types.js.map +1 -0
  69. package/dist/viewer.d.ts +3 -242
  70. package/dist/viewer.d.ts.map +1 -1
  71. package/dist/viewer.js +104 -976
  72. package/dist/viewer.js.map +1 -1
  73. package/package.json +3 -3
@@ -0,0 +1,35 @@
1
+ import { type VDTDocument, type VDTPage, type FolioPaperConfig } from 'postext';
2
+ import type { FolioAppearance } from '../viewer.js';
3
+ /** Whether the document's first page is a recto: page 1, or a chapter
4
+ * continued after an even number of pages. */
5
+ export declare function firstPageIsRecto(doc: VDTDocument): boolean;
6
+ /** A page's width and height as bound: the trim box, since a book is cut
7
+ * (a sheet laid out with cut lines also carries the bleed, the slug and
8
+ * the crop marks, none of which a bound page shows). */
9
+ export declare function trimmedSize(page: VDTPage, doc: VDTDocument): {
10
+ width: number;
11
+ height: number;
12
+ };
13
+ /** The page's colour, for blank pages: white when it has none. */
14
+ export declare function paperOf(doc: VDTDocument): string;
15
+ /** How the document's book is presented: its `folio` settings, its page
16
+ * width, the book's pages before and after it (a chapter of a longer
17
+ * book), with the host's own appearance laid over them. The pages round
18
+ * it are the host's word when it gives them (`extraPages`: a host laying
19
+ * a book out a chapter at a time knows the chapters after this one, which
20
+ * the document only knows when it was given the book's page count). A
21
+ * newspaper trim (`page.sizePreset` broadsheet, berliner, tabloid or
22
+ * compact) shows folded newsprint unless the settings name a stock or a
23
+ * binding (#506). */
24
+ export declare function appearanceOf(doc: VDTDocument, own: FolioAppearance | undefined): FolioAppearance;
25
+ /** The paper a page is printed on, when a `:::paper` run sets one. */
26
+ export declare const pagePaperOf: (page: VDTPage | undefined) => FolioPaperConfig | undefined;
27
+ export declare function signature(of: VDTPage | VDTDocument["config"]): string;
28
+ /**
29
+ * Which paintings a new layout can keep: new page index → old page index,
30
+ * for every page of `wanted` that is the same page as a painted one (the
31
+ * same object, or one that reads the same). Each old painting goes to one
32
+ * page at most.
33
+ */
34
+ export declare function carriedPaintings(before: readonly VDTPage[], painted: Iterable<number>, next: readonly VDTPage[], wanted: Iterable<number>): Map<number, number>;
35
+ //# sourceMappingURL=book.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"book.d.ts","sourceRoot":"","sources":["../../src/postext/book.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,OAAO,EAAoC,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAClH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD;+CAC+C;AAC/C,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAE1D;AAED;;yDAEyD;AACzD,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAG9F;AAED,kEAAkE;AAClE,wBAAgB,OAAO,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAGhD;AAED;;;;;;;;sBAQsB;AACtB,wBAAgB,YAAY,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,eAAe,GAAG,SAAS,GAAG,eAAe,CAmBhG;AAED,sEAAsE;AACtE,eAAO,MAAM,WAAW,GAAI,MAAM,OAAO,GAAG,SAAS,iCAA8D,CAAC;AAKpH,wBAAgB,SAAS,CAAC,EAAE,EAAE,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAOrE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,OAAO,EAAE,EAC1B,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,EACzB,IAAI,EAAE,SAAS,OAAO,EAAE,EACxB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,GACvB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAoBrB"}
@@ -0,0 +1,96 @@
1
+ // A document as a book: its recto rule, trimmed page size, paper and
2
+ // appearance, and the paintings a new layout can keep (#1276: split out of
3
+ // postext.ts).
4
+ import { folioForTrim, resolveFolioConfig } from 'postext';
5
+ /** Whether the document's first page is a recto: page 1, or a chapter
6
+ * continued after an even number of pages. */
7
+ export function firstPageIsRecto(doc) {
8
+ return (doc.pageIndexOffset ?? 0) % 2 === 0;
9
+ }
10
+ /** A page's width and height as bound: the trim box, since a book is cut
11
+ * (a sheet laid out with cut lines also carries the bleed, the slug and
12
+ * the crop marks, none of which a bound page shows). */
13
+ export function trimmedSize(page, doc) {
14
+ const inset = Math.max(0, doc.trimOffset);
15
+ return { width: page.width - 2 * inset, height: page.height - 2 * inset };
16
+ }
17
+ /** The page's colour, for blank pages: white when it has none. */
18
+ export function paperOf(doc) {
19
+ const hex = doc.config.page.backgroundColor.hex;
20
+ return hex && hex !== "transparent" ? hex : "#fff";
21
+ }
22
+ /** How the document's book is presented: its `folio` settings, its page
23
+ * width, the book's pages before and after it (a chapter of a longer
24
+ * book), with the host's own appearance laid over them. The pages round
25
+ * it are the host's word when it gives them (`extraPages`: a host laying
26
+ * a book out a chapter at a time knows the chapters after this one, which
27
+ * the document only knows when it was given the book's page count). A
28
+ * newspaper trim (`page.sizePreset` broadsheet, berliner, tabloid or
29
+ * compact) shows folded newsprint unless the settings name a stock or a
30
+ * binding (#506). */
31
+ export function appearanceOf(doc, own) {
32
+ const page = doc.pages[0];
33
+ const before = Math.max(0, own?.extraPages?.before ?? doc.pageIndexOffset ?? 0);
34
+ const after = Math.max(0, own?.extraPages?.after ?? (doc.bookPageCount ?? 0) - before - doc.pages.length);
35
+ const folio = folioForTrim(own && "folio" in own ? own.folio : doc.config.folio, doc.config.page.sizePreset);
36
+ // The document's own covers: the book's first page (a recto) and its
37
+ // last, when that is a verso (an even page number). A chapter from the
38
+ // middle of the book has neither: its first and last leaves are paper
39
+ // (#449).
40
+ const ownCovers = resolveFolioConfig(folio).binding.cover === "pages";
41
+ const total = before + doc.pages.length;
42
+ return {
43
+ covers: { front: ownCovers && before === 0, back: ownCovers && after === 0 && total % 2 === 0 },
44
+ // Page sizes are in device pixels at the page's dpi.
45
+ ...(page ? { pageWidthMm: (trimmedSize(page, doc).width * 25.4) / (doc.config.page.dpi || 300) } : {}),
46
+ ...own,
47
+ folio,
48
+ extraPages: { before, after },
49
+ };
50
+ }
51
+ /** The paper a page is printed on, when a `:::paper` run sets one. */
52
+ export const pagePaperOf = (page) => page?.paper;
53
+ /** What a page is painted from, as text: two pages with the same
54
+ * signature under the same config paint the same. */
55
+ const signatures = new WeakMap();
56
+ export function signature(of) {
57
+ let sig = signatures.get(of);
58
+ if (sig === undefined) {
59
+ sig = JSON.stringify(of);
60
+ signatures.set(of, sig);
61
+ }
62
+ return sig;
63
+ }
64
+ /**
65
+ * Which paintings a new layout can keep: new page index → old page index,
66
+ * for every page of `wanted` that is the same page as a painted one (the
67
+ * same object, or one that reads the same). Each old painting goes to one
68
+ * page at most.
69
+ */
70
+ export function carriedPaintings(before, painted, next, wanted) {
71
+ const carried = new Map();
72
+ const byPage = new Map();
73
+ for (const k of painted)
74
+ if (before[k])
75
+ byPage.set(before[k], k);
76
+ if (byPage.size === 0)
77
+ return carried;
78
+ let bySignature = null;
79
+ for (const i of wanted) {
80
+ const page = next[i];
81
+ if (!page)
82
+ continue;
83
+ let k = byPage.get(page);
84
+ if (k === undefined) {
85
+ bySignature ??= new Map([...byPage].map(([p, j]) => [signature(p), j]));
86
+ k = bySignature.get(signature(page));
87
+ }
88
+ if (k === undefined)
89
+ continue;
90
+ carried.set(i, k);
91
+ byPage.delete(before[k]);
92
+ bySignature = null;
93
+ }
94
+ return carried;
95
+ }
96
+ //# sourceMappingURL=book.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"book.js","sourceRoot":"","sources":["../../src/postext/book.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,2EAA2E;AAC3E,eAAe;AACf,OAAO,EAAkC,YAAY,EAAE,kBAAkB,EAAyB,MAAM,SAAS,CAAC;AAGlH;+CAC+C;AAC/C,MAAM,UAAU,gBAAgB,CAAC,GAAgB;IAC/C,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AAED;;yDAEyD;AACzD,MAAM,UAAU,WAAW,CAAC,IAAa,EAAE,GAAgB;IACzD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IAC1C,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,KAAK,EAAE,CAAC;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AAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACjE,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,OAAO,CAAC;IACtC,IAAI,WAAW,GAA+B,IAAI,CAAC;IACnD,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI;YAAE,SAAS;QACpB,IAAI,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;YACpB,WAAW,KAAK,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YACxE,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,CAAC,KAAK,SAAS;YAAE,SAAS;QAC9B,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAClB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAE,CAAC,CAAC;QAC1B,WAAW,GAAG,IAAI,CAAC;IACrB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { VDTDocument } from 'postext';
2
+ import type { PageVideoSpot } from '../videos.js';
3
+ /** A video playing (or paused) on a page: its element, the spot it fills,
4
+ * whether it has a frame on show, whether it plays muted only because it
5
+ * started on its own, whether it plays alongside the others
6
+ * (`player.exclusive: false`) and the exclusive video it waits for. */
7
+ export interface PagePlayer {
8
+ page: number;
9
+ spot: PageVideoSpot;
10
+ element: HTMLVideoElement;
11
+ release?: () => void;
12
+ shown: boolean;
13
+ autoMuted: boolean;
14
+ alongside: boolean;
15
+ heldBy: PagePlayer | null;
16
+ }
17
+ /** The reader has asked for less motion: no video starts on its own to
18
+ * play alongside the others. */
19
+ export declare const reducedMotion: () => boolean;
20
+ /** How long the book must stay as it is before a video set to play on its
21
+ * own starts (a host's layouts settling, a run of turns). */
22
+ export declare const AUTOPLAY_SETTLE_MS = 700;
23
+ /** The most pixels a page is painted in for the magnifying glass. */
24
+ export declare const SHARP_MAX_PIXELS = 24000000;
25
+ /** A page painted for the glass (see `paintSharp`). */
26
+ export interface Sharp {
27
+ canvas: HTMLCanvasElement;
28
+ bare: HTMLCanvasElement | null;
29
+ width: number;
30
+ doc: VDTDocument;
31
+ }
32
+ /** How long a resize settles before the pages are painted at the new size. */
33
+ export declare const RESIZE_SETTLE_MS = 120;
34
+ export declare const onIdle: (cb: () => void) => number;
35
+ export declare const cancelIdle: (id: number) => void;
36
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/postext/constants.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD;;;wEAGwE;AACxE,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;CAC3B;AAED;iCACiC;AACjC,eAAO,MAAM,aAAa,eAAmG,CAAC;AAE9H;8DAC8D;AAC9D,eAAO,MAAM,kBAAkB,MAAM,CAAC;AAEtC,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,WAAO,CAAC;AAErC,uDAAuD;AACvD,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,WAAW,CAAC;CAClB;AAED,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,eAAO,MAAM,MAAM,GAAI,IAAI,MAAM,IAAI,KAAG,MAC2F,CAAC;AACpI,eAAO,MAAM,UAAU,GAAI,IAAI,MAAM,SAA2F,CAAC"}
@@ -0,0 +1,13 @@
1
+ /** The reader has asked for less motion: no video starts on its own to
2
+ * play alongside the others. */
3
+ export const reducedMotion = () => typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
4
+ /** How long the book must stay as it is before a video set to play on its
5
+ * own starts (a host's layouts settling, a run of turns). */
6
+ export const AUTOPLAY_SETTLE_MS = 700;
7
+ /** The most pixels a page is painted in for the magnifying glass. */
8
+ export const SHARP_MAX_PIXELS = 24e6;
9
+ /** How long a resize settles before the pages are painted at the new size. */
10
+ export const RESIZE_SETTLE_MS = 120;
11
+ export const onIdle = (cb) => typeof requestIdleCallback === "function" ? requestIdleCallback(cb, { timeout: 500 }) : setTimeout(cb, 50);
12
+ export const cancelIdle = (id) => (typeof cancelIdleCallback === "function" ? cancelIdleCallback(id) : clearTimeout(id));
13
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/postext/constants.ts"],"names":[],"mappings":"AAqBA;iCACiC;AACjC,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,OAAO,UAAU,KAAK,UAAU,IAAI,UAAU,CAAC,kCAAkC,CAAC,CAAC,OAAO,CAAC;AAE9H;8DAC8D;AAC9D,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAEtC,qEAAqE;AACrE,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAUrC,8EAA8E;AAC9E,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAEpC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAc,EAAU,EAAE,CAC/C,OAAO,mBAAmB,KAAK,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAE,UAAU,CAAC,EAAE,EAAE,EAAE,CAAuB,CAAC;AACpI,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAU,EAAE,EAAE,CAAC,CAAC,OAAO,kBAAkB,KAAK,UAAU,CAAC,CAAC,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { type PageVideoSpot } from '../videos.js';
2
+ import { type PagePlayer } from './constants.js';
3
+ import type { FolioPagePoint } from '../viewer.js';
4
+ import type { FolioDocumentOptions } from './types.js';
5
+ import type { FolioDocumentState, FolioDocumentLate } from './state.js';
6
+ /** What createDocumentVideos takes from createFolioFromDocument. */
7
+ export interface DocumentVideosDeps {
8
+ options: FolioDocumentOptions;
9
+ ds: FolioDocumentState;
10
+ dlate: FolioDocumentLate;
11
+ }
12
+ export declare function createDocumentVideos(deps: DocumentVideosDeps): {
13
+ autoplayed: Set<string>;
14
+ autoStarted: Set<string>;
15
+ spotsOf: (i: number) => PageVideoSpot[];
16
+ urlOf: (spot: PageVideoSpot) => string | undefined;
17
+ spotAt: (point: FolioPagePoint) => PageVideoSpot | undefined;
18
+ stopPlayer: (p: PagePlayer, state?: "stopped" | "error") => void;
19
+ stopVideos: () => void;
20
+ startVideo: (page: number, spot: PageVideoSpot, auto?: boolean) => void;
21
+ toggleVideoAt: (point: FolioPagePoint) => boolean;
22
+ togglePlaying: (p: PagePlayer) => void;
23
+ scheduleAutoplay: () => void;
24
+ followVideos: () => void;
25
+ };
26
+ //# sourceMappingURL=pageVideos.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageVideos.d.ts","sourceRoot":"","sources":["../../src/postext/pageVideos.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAA+F,MAAM,cAAc,CAAC;AAC/I,OAAO,EAAE,KAAK,UAAU,EAAqC,MAAM,gBAAgB,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAExE,oEAAoE;AACpE,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,EAAE,EAAE,kBAAkB,CAAC;IACvB,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,kBAAkB;;;iBAiBvC,MAAM,KAAG,aAAa,EAAE;kBAUvB,aAAa,KAAG,MAAM,GAAG,SAAS;oBAKhC,cAAc,KAAG,aAAa,GAAG,SAAS;oBAmB1C,UAAU,UAAS,SAAS,GAAG,OAAO;;uBA4CnC,MAAM,QAAQ,aAAa;2BAiFvB,cAAc,KAAG,OAAO;uBAW5B,UAAU;;;EAmErC"}
@@ -0,0 +1,276 @@
1
+ // The videos on the document book's pages (#477, #507): their spots, the
2
+ // players, starting, stopping, autoplay and following the turns (#1276:
3
+ // split out of postext.ts).
4
+ import { pageVideoSpots, spotContains, makeWay, attachVideoSource, isHlsVideo, autoplayPlan, autoKey } from '../videos.js';
5
+ import { AUTOPLAY_SETTLE_MS, reducedMotion } from './constants.js';
6
+ export function createDocumentVideos(deps) {
7
+ const { options, ds, dlate } = deps;
8
+ // ── Videos on the pages (#477, #507) ──
9
+ /** The video spots of each page of the current document, as found. */
10
+ let spots = new Map();
11
+ /** The videos playing (or paused) on the pages, in the order they
12
+ * started. */
13
+ ds.players = [];
14
+ /** The videos that have started on their own once (`player.autoplay`
15
+ * with `exclusive`). */
16
+ const autoplayed = new Set();
17
+ /** The videos playing alongside that have started on their own since
18
+ * their page last came into view (`page|key`). */
19
+ const autoStarted = new Set();
20
+ const spotsOf = (i) => {
21
+ let found = spots.get(i);
22
+ if (!found) {
23
+ const page = ds.current.pages[i];
24
+ found = page ? pageVideoSpots(page, ds.current) : [];
25
+ spots.set(i, found);
26
+ }
27
+ return found;
28
+ };
29
+ /** Where a self-hosted video plays from: its file, else its address. */
30
+ const urlOf = (spot) => {
31
+ const v = spot.video;
32
+ if (v.source !== "file")
33
+ return undefined;
34
+ return (v.fileId ? options.videoUrl?.(v.fileId) : undefined) ?? v.link;
35
+ };
36
+ const spotAt = (point) => options.videos === false ? undefined : spotsOf(point.page).find((s) => urlOf(s) && spotContains(s, point.x, point.y));
37
+ const playerOf = (page, spot) => ds.players.find((p) => p.page === page && p.spot.key === spot.key);
38
+ const onShow = (p) => dlate.viewer.state.pages.includes(p.page);
39
+ const report = (p, state) => {
40
+ options.onVideo?.({ resourceId: p.spot.resourceId, page: p.page, state });
41
+ };
42
+ /** Shows the videos that have a frame to show on their pages. */
43
+ function showVideos() {
44
+ dlate.viewer.setPageVideos(ds.players
45
+ .filter((p) => p.shown)
46
+ .map((p) => ({ page: p.page, element: p.element, origin: p.spot.origin, across: p.spot.across, down: p.spot.down, ...(p.spot.crop ? { crop: p.spot.crop } : {}) })));
47
+ }
48
+ /** Stops a video: its poster shows again, and the videos it held go on. */
49
+ function stopPlayer(p, state = "stopped") {
50
+ if (!ds.players.includes(p))
51
+ return;
52
+ ds.players = ds.players.filter((q) => q !== p);
53
+ report(p, state);
54
+ p.element.pause();
55
+ p.release?.();
56
+ if (p.shown)
57
+ showVideos();
58
+ resumeHeld(p);
59
+ }
60
+ function stopVideos() {
61
+ for (const p of [...ds.players])
62
+ stopPlayer(p);
63
+ }
64
+ /** The videos playing alongside that `by` held go on (on show only),
65
+ * and those set to play on their own that have not started yet start. */
66
+ function resumeHeld(by) {
67
+ if (by.alongside)
68
+ return;
69
+ for (const q of ds.players) {
70
+ if (q.heldBy !== by)
71
+ continue;
72
+ q.heldBy = null;
73
+ if (onShow(q))
74
+ void q.element.play().catch(() => { });
75
+ }
76
+ if (!ds.turning)
77
+ autoplayOn(dlate.viewer.state.pages, { exclusive: false });
78
+ }
79
+ /** A video starts (or goes on): the others make way for it (see
80
+ * `makeWay`). */
81
+ function makeWayFor(p) {
82
+ p.heldBy = null;
83
+ // Those waiting for another exclusive video wait for this one now.
84
+ if (!p.alongside)
85
+ for (const q of ds.players)
86
+ if (q.heldBy)
87
+ q.heldBy = p;
88
+ const list = [...ds.players.filter((q) => q !== p), p].map((q) => ({ q, alongside: q.alongside, paused: q.element.paused }));
89
+ const way = makeWay(list[list.length - 1], list);
90
+ for (const { q } of way.hold) {
91
+ q.heldBy = p;
92
+ q.element.pause();
93
+ }
94
+ for (const { q } of way.pause)
95
+ q.element.pause();
96
+ for (const { q } of way.stop)
97
+ stopPlayer(q);
98
+ }
99
+ /** Plays the video at `spot` on `page`, from its start; `auto` when it
100
+ * starts on its own. */
101
+ function startVideo(page, spot, auto = false) {
102
+ const url = urlOf(spot);
103
+ if (!url)
104
+ return;
105
+ const player = spot.video.player;
106
+ const alongside = player.exclusive === false;
107
+ const element = document.createElement("video");
108
+ element.playsInline = true;
109
+ element.preload = "auto";
110
+ // WebGL draws the picture only when its server allows the read.
111
+ if (!/^(blob|data):/i.test(url))
112
+ element.crossOrigin = "anonymous";
113
+ const range = { start: spot.video.start ?? 0, end: spot.video.end };
114
+ // A loop from the file's start loops by itself (seamlessly); one from
115
+ // later on is sent back by hand.
116
+ element.loop = player.loop && !range.start;
117
+ // A video that starts on its own has its sound once the reader has
118
+ // clicked or typed on the page (the browser allows it then); before
119
+ // that it starts muted, as browsers require, and a click unmutes it.
120
+ // One playing alongside always starts muted on its own: a page of
121
+ // living pictures is a quiet one.
122
+ const activated = navigator.userActivation?.hasBeenActive ?? false;
123
+ element.muted = player.muted || (auto && (alongside || !activated));
124
+ const entry = { page, spot, element, shown: false, autoMuted: !player.muted && element.muted, alongside, heldBy: null };
125
+ // The others make way at once (an exclusive one, still loading, holds
126
+ // the videos playing alongside from now).
127
+ ds.players = [...ds.players, entry];
128
+ makeWayFor(entry);
129
+ const live = () => ds.players.includes(entry);
130
+ element.addEventListener("error", () => live() && stopPlayer(entry, "error"));
131
+ element.addEventListener("loadedmetadata", () => {
132
+ if (range.start)
133
+ element.currentTime = range.start;
134
+ }, { once: true });
135
+ element.addEventListener("loadeddata", () => {
136
+ if (!live())
137
+ return;
138
+ entry.shown = true;
139
+ showVideos();
140
+ }, { once: true });
141
+ element.addEventListener("play", () => live() && makeWayFor(entry));
142
+ element.addEventListener("playing", () => live() && report(entry, "playing"));
143
+ element.addEventListener("pause", () => {
144
+ if (!live() || element.ended)
145
+ return;
146
+ report(entry, "paused");
147
+ resumeHeld(entry);
148
+ });
149
+ const atEnd = () => {
150
+ if (!live())
151
+ return;
152
+ if (player.loop) {
153
+ element.currentTime = range.start;
154
+ void element.play().catch(() => { });
155
+ }
156
+ else
157
+ stopPlayer(entry);
158
+ };
159
+ element.addEventListener("ended", atEnd);
160
+ element.addEventListener("timeupdate", () => {
161
+ if (range.end && element.currentTime >= range.end)
162
+ atEnd();
163
+ });
164
+ // The picture's height on screen: an HLS stream needs no larger variant.
165
+ const size = dlate.viewer.pageSize;
166
+ const maxHeight = Math.max(Math.hypot(spot.down.x * size.deviceWidth, spot.down.y * size.deviceHeight), Math.hypot(spot.across.x * size.deviceWidth, spot.across.y * size.deviceHeight));
167
+ void attachVideoSource(element, url, { hls: isHlsVideo(spot.video, url), maxHeight, corsTag: true }).then((release) => {
168
+ if (!live())
169
+ return release();
170
+ entry.release = release;
171
+ // Held back already (an exclusive video started meanwhile).
172
+ if (entry.heldBy)
173
+ return;
174
+ // The click's gesture lets it play with sound; a browser that still
175
+ // refuses gets it muted.
176
+ element.play().catch((err) => {
177
+ if (!live())
178
+ return;
179
+ if (err?.name === "NotAllowedError" && !element.muted) {
180
+ element.muted = true;
181
+ entry.autoMuted = !player.muted;
182
+ return element.play();
183
+ }
184
+ throw err;
185
+ }).catch(() => live() && stopPlayer(entry, "error"));
186
+ }, () => live() && stopPlayer(entry, "error"));
187
+ }
188
+ /** A click at a point of a page: plays, pauses or resumes the video
189
+ * printed there. */
190
+ function toggleVideoAt(point) {
191
+ const spot = spotAt(point);
192
+ if (!spot)
193
+ return false;
194
+ const p = playerOf(point.page, spot);
195
+ if (p)
196
+ togglePlaying(p);
197
+ else
198
+ startVideo(point.page, spot);
199
+ return true;
200
+ }
201
+ /** A click (or Space) on a video playing: one that started on its own
202
+ * is unmuted first; otherwise it pauses or resumes. */
203
+ function togglePlaying(p) {
204
+ if (p.autoMuted && !p.element.paused) {
205
+ p.autoMuted = false;
206
+ p.element.muted = false;
207
+ return;
208
+ }
209
+ if (p.element.paused)
210
+ void p.element.play().catch(() => { });
211
+ else
212
+ p.element.pause();
213
+ }
214
+ /** Autoplay waits for the book to settle: a host lays a book out in
215
+ * steps (a chapter, then the whole book), and only the spread the reader
216
+ * is left looking at counts as shown. */
217
+ ds.autoTimer = 0;
218
+ const scheduleAutoplay = () => {
219
+ clearTimeout(ds.autoTimer);
220
+ ds.autoTimer = window.setTimeout(() => {
221
+ if (!ds.turning)
222
+ autoplayOn(dlate.viewer.state.pages);
223
+ }, AUTOPLAY_SETTLE_MS);
224
+ };
225
+ /**
226
+ * The videos on show set to play on their own (`player.autoplay`) start,
227
+ * muted. One playing alongside the others (`exclusive: false`) starts
228
+ * each time its page comes into view (not while an exclusive video
229
+ * plays there, nor when the reader asks for less motion); an exclusive
230
+ * one, the first time its spread is shown and never again in this
231
+ * viewer, when no other exclusive video is on.
232
+ */
233
+ function autoplayOn(pages, { exclusive = true } = {}) {
234
+ if (options.videos === false)
235
+ return;
236
+ const state = {
237
+ players: ds.players.map((p) => ({ page: p.page, key: p.spot.key, alongside: p.alongside, paused: p.element.paused, shown: p.shown })),
238
+ autoplayed,
239
+ autoStarted,
240
+ };
241
+ for (const { page, spot } of autoplayPlan(pages, spotsOf, (s) => !!urlOf(s), state, { exclusive, reducedMotion: reducedMotion() })) {
242
+ if (spot.video.player.exclusive === false)
243
+ autoStarted.add(autoKey(page, spot.key));
244
+ else
245
+ autoplayed.add(spot.key);
246
+ startVideo(page, spot, true);
247
+ }
248
+ }
249
+ /** A new layout: each video follows its resource to where the layout
250
+ * puts it, or stops when it is gone (or, at rest, off the pages on
251
+ * show). */
252
+ function followVideos() {
253
+ spots = new Map();
254
+ let moved = false;
255
+ for (const p of [...ds.players]) {
256
+ const near = [p.page, ...dlate.viewer.state.pages];
257
+ for (let i = 0; i < ds.current.pages.length; i++)
258
+ near.push(i);
259
+ const at = near.find((i) => spotsOf(i).some((s) => s.key === p.spot.key && urlOf(s) === urlOf(p.spot)));
260
+ if (at === undefined || (!ds.turning && !dlate.viewer.state.pages.includes(at))) {
261
+ stopPlayer(p);
262
+ continue;
263
+ }
264
+ p.page = at;
265
+ p.spot = spotsOf(at).find((s) => s.key === p.spot.key && urlOf(s) === urlOf(p.spot));
266
+ moved ||= p.shown;
267
+ }
268
+ if (moved)
269
+ showVideos();
270
+ }
271
+ return {
272
+ autoplayed, autoStarted, spotsOf, urlOf, spotAt, stopPlayer, stopVideos, startVideo,
273
+ toggleVideoAt, togglePlaying, scheduleAutoplay, followVideos
274
+ };
275
+ }
276
+ //# sourceMappingURL=pageVideos.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageVideos.js","sourceRoot":"","sources":["../../src/postext/pageVideos.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wEAAwE;AACxE,4BAA4B;AAC5B,OAAO,EAAsB,cAAc,EAAE,YAAY,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,YA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B,EAAE,YAAY;KAC7D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { type FolioPaperConfig } from 'postext';
2
+ import type { FolioState } from '../viewer.js';
3
+ import type { FolioDocumentOptions } from './types.js';
4
+ import type { FolioDocumentState, FolioDocumentLate } from './state.js';
5
+ /** What createDocumentPainting takes from createFolioFromDocument. */
6
+ export interface DocumentPaintingDeps {
7
+ options: FolioDocumentOptions;
8
+ reach: number;
9
+ slotWidth: () => number;
10
+ sources: () => ("" | {
11
+ paper?: FolioPaperConfig | undefined;
12
+ src: HTMLCanvasElement;
13
+ alt: string;
14
+ } | {
15
+ src: "";
16
+ paper: FolioPaperConfig;
17
+ })[];
18
+ ds: FolioDocumentState;
19
+ dlate: FolioDocumentLate;
20
+ }
21
+ export declare function createDocumentPainting(deps: DocumentPaintingDeps): {
22
+ wanted: () => Set<number>;
23
+ paint: (i: number, width: number) => void;
24
+ free: (canvas: HTMLCanvasElement | null | undefined) => void;
25
+ decorate: (i: number) => boolean;
26
+ refresh: (urgent: number[]) => void;
27
+ startSweep: (target: number[]) => void;
28
+ around: (state: FolioState) => number[];
29
+ };
30
+ //# sourceMappingURL=painting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"painting.d.ts","sourceRoot":"","sources":["../../src/postext/painting.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAIpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAExE,sEAAsE;AACtE,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC,EAAE,GAAG;QAAE,KAAK,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;QAAC,GAAG,EAAE,iBAAiB,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;KAAE,GAAG;QAAE,GAAG,EAAE,EAAE,CAAC;QAAC,KAAK,EAAE,gBAAgB,CAAC;KAAE,CAAC,EAAE,CAAC;IAC/I,EAAE,EAAE,kBAAkB,CAAC;IACvB,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,oBAAoB;kBAK5C,GAAG,CAAC,MAAM,CAAC;eAUZ,MAAM,SAAS,MAAM;mBAuBjB,iBAAiB,GAAG,IAAI,GAAG,SAAS;kBAMrC,MAAM,KAAG,OAAO;sBAgCZ,MAAM,EAAE;yBA2BL,MAAM,EAAE;oBAqCb,UAAU;EAQlC"}