@nxgt/material-core 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +143 -1
- package/dist/file-preview/describe-file.d.ts +30 -0
- package/dist/file-preview/describe-file.d.ts.map +1 -0
- package/dist/file-preview/file-kind.d.ts +41 -0
- package/dist/file-preview/file-kind.d.ts.map +1 -0
- package/dist/file-preview/index.d.ts +10 -0
- package/dist/file-preview/index.d.ts.map +1 -0
- package/dist/file-preview/index.js +260 -0
- package/dist/file-preview/index.js.map +13 -0
- package/dist/file-preview/safe-url.d.ts +22 -0
- package/dist/file-preview/safe-url.d.ts.map +1 -0
- package/dist/file-preview/text-preview.d.ts +32 -0
- package/dist/file-preview/text-preview.d.ts.map +1 -0
- package/dist/lib/date-range.d.ts +84 -0
- package/dist/lib/date-range.d.ts.map +1 -0
- package/dist/lib/date-range.js +105 -0
- package/dist/lib/date-range.js.map +10 -0
- package/dist/lib/slider-ticks.d.ts +7 -0
- package/dist/lib/slider-ticks.d.ts.map +1 -0
- package/dist/lib/slider-ticks.js +16 -0
- package/dist/lib/slider-ticks.js.map +10 -0
- package/dist/pdf-viewer/index.d.ts +1 -0
- package/dist/pdf-viewer/index.d.ts.map +1 -1
- package/dist/pdf-viewer/index.js +68 -33
- package/dist/pdf-viewer/index.js.map +6 -4
- package/dist/pdf-viewer/pdf-pin-page.d.ts +16 -0
- package/dist/pdf-viewer/pdf-pin-page.d.ts.map +1 -0
- package/dist/pdf-viewer/pdf-scroll-spy.d.ts +2 -8
- package/dist/pdf-viewer/pdf-scroll-spy.d.ts.map +1 -1
- package/dist/pdf-viewer/pdf-user-input.d.ts +7 -0
- package/dist/pdf-viewer/pdf-user-input.d.ts.map +1 -0
- package/docs/roadmap.md +15 -5
- package/docs/troubleshooting.md +65 -0
- package/package.json +20 -2
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pure half of both libraries' `DateRangeField`: the built-in presets'
|
|
3
|
+
* ranges, a preset's state against the field's rules and value, and the time
|
|
4
|
+
* of day on each end. Plain `Date` maths in the local time zone; nothing reads
|
|
5
|
+
* the clock unless you leave `now` out.
|
|
6
|
+
*/
|
|
7
|
+
/** Both ends of a range, set. */
|
|
8
|
+
export type DayRange = {
|
|
9
|
+
from: Date;
|
|
10
|
+
to: Date;
|
|
11
|
+
};
|
|
12
|
+
/** A range being picked: `to` is unset until the second day is. */
|
|
13
|
+
export type PartialDayRange = {
|
|
14
|
+
from?: Date;
|
|
15
|
+
to?: Date;
|
|
16
|
+
};
|
|
17
|
+
/** The built-in presets, in the order a field lists them. */
|
|
18
|
+
export declare const DATE_RANGE_PRESET_IDS: readonly ["today", "yesterday", "last-7-days", "last-30-days", "this-month", "last-month", "this-year"];
|
|
19
|
+
export type DateRangePresetId = (typeof DATE_RANGE_PRESET_IDS)[number];
|
|
20
|
+
/**
|
|
21
|
+
* A preset of your own: its label, and its range or a function of "now"
|
|
22
|
+
* that returns one (called each time the list renders).
|
|
23
|
+
*/
|
|
24
|
+
export type DateRangePreset = {
|
|
25
|
+
label: string;
|
|
26
|
+
range: DayRange | ((now: Date) => DayRange);
|
|
27
|
+
};
|
|
28
|
+
/** What a field's `presets` takes: a built-in id, or a preset of your own. */
|
|
29
|
+
export type DateRangePresetOption = DateRangePresetId | DateRangePreset;
|
|
30
|
+
/** What a day must not be: a rule of the field's, and its first and last day. */
|
|
31
|
+
export type DateRangeRules = {
|
|
32
|
+
isDayDisabled?: (day: Date) => boolean;
|
|
33
|
+
min?: Date;
|
|
34
|
+
max?: Date;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* A built-in preset's range at `now`, both ends at the start of their day.
|
|
38
|
+
* The last N days end today and count it; this month and this year run from
|
|
39
|
+
* their first day to today; last month is the whole previous month.
|
|
40
|
+
*/
|
|
41
|
+
export declare function presetRange(id: DateRangePresetId, now?: Date): DayRange;
|
|
42
|
+
/**
|
|
43
|
+
* A preset's range at `now`: a built-in id's, or yours (called with `now`).
|
|
44
|
+
* With `withTime`, a built-in range ends at 23:59 on its last day, so it
|
|
45
|
+
* covers that day; your own ranges keep the times you gave them.
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolvePresetRange(preset: DateRangePresetOption, now?: Date, { withTime }?: {
|
|
48
|
+
withTime?: boolean;
|
|
49
|
+
}): DayRange;
|
|
50
|
+
/** Whether two ranges cover the same days (times are not compared). */
|
|
51
|
+
export declare function isSameDayRange(a: PartialDayRange | undefined, b: PartialDayRange | undefined): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Whether a field cannot take `range`: its end comes before its start (a
|
|
54
|
+
* preset of your own with its ends reversed), it starts before `min`, ends
|
|
55
|
+
* after `max`, or either end is a day `isDayDisabled` rules out. The days
|
|
56
|
+
* between the ends are not checked, as the calendar lets a range span a
|
|
57
|
+
* disabled day.
|
|
58
|
+
*/
|
|
59
|
+
export declare function isRangeDisabled(range: DayRange, rules?: DateRangeRules): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* `day`'s date with `time`'s hours and minutes; the start of `day` without
|
|
62
|
+
* a `time`. Seconds and milliseconds are dropped.
|
|
63
|
+
*/
|
|
64
|
+
export declare function withTimeOf(day: Date, time?: Date): Date;
|
|
65
|
+
/** `day` at 23:59, the end time a preset gets when the field shows times. */
|
|
66
|
+
export declare function endOfDayTime(day: Date): Date;
|
|
67
|
+
/**
|
|
68
|
+
* The range with its end no earlier than its start: an end before the start
|
|
69
|
+
* becomes the start (the same day and time). The field calls it after a time
|
|
70
|
+
* change, after a day pick (through `keepRangeTimes`) and after a preset
|
|
71
|
+
* pick; the only end that can come first is an earlier time on the start's
|
|
72
|
+
* day. A range missing an end, or already in order, is returned as it is. A
|
|
73
|
+
* preset with its ends reversed never reaches it: `isRangeDisabled` disables
|
|
74
|
+
* it.
|
|
75
|
+
*/
|
|
76
|
+
export declare function clampRangeEnd<R extends PartialDayRange>(range: R): R;
|
|
77
|
+
/**
|
|
78
|
+
* Days picked on a calendar, with times: each end keeps the time `previous`
|
|
79
|
+
* had at the same end. An end that had none starts at 00:00 or ends at 23:59
|
|
80
|
+
* (`endOfDayTime`), as a built-in preset does, so the range covers its last
|
|
81
|
+
* day. The end is then clamped to the start (`clampRangeEnd`).
|
|
82
|
+
*/
|
|
83
|
+
export declare function keepRangeTimes<R extends PartialDayRange>(next: R, previous?: PartialDayRange): R;
|
|
84
|
+
//# sourceMappingURL=date-range.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-range.d.ts","sourceRoot":"","sources":["../../src/lib/date-range.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,iCAAiC;AACjC,MAAM,MAAM,QAAQ,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,EAAE,EAAE,IAAI,CAAA;CAAE,CAAC;AAEhD,mEAAmE;AACnE,MAAM,MAAM,eAAe,GAAG;IAAE,IAAI,CAAC,EAAE,IAAI,CAAC;IAAC,EAAE,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEzD,6DAA6D;AAC7D,eAAO,MAAM,qBAAqB,yGAQxB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,QAAQ,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC;CAC5C,CAAC;AAEF,8EAA8E;AAC9E,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG,eAAe,CAAC;AAExE,iFAAiF;AACjF,MAAM,MAAM,cAAc,GAAG;IAC5B,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,OAAO,CAAC;IACvC,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;CACX,CAAC;AAcF;;;;GAIG;AACH,wBAAgB,WAAW,CAC1B,EAAE,EAAE,iBAAiB,EACrB,GAAG,GAAE,IAAiB,GACpB,QAAQ,CAyBV;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,qBAAqB,EAC7B,GAAG,GAAE,IAAiB,EACtB,EAAE,QAAgB,EAAE,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/C,QAAQ,CAQV;AAED,uEAAuE;AACvE,wBAAgB,cAAc,CAC7B,CAAC,EAAE,eAAe,GAAG,SAAS,EAC9B,CAAC,EAAE,eAAe,GAAG,SAAS,WAI9B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,GAAE,cAAmB,WAM1E;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,QAIhD;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,GAAG,EAAE,IAAI,QAIrC;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,eAAe,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAIpE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,eAAe,EACvD,IAAI,EAAE,CAAC,EACP,QAAQ,CAAC,EAAE,eAAe,GACxB,CAAC,CAQH"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// src/lib/date-range.ts
|
|
2
|
+
var DATE_RANGE_PRESET_IDS = [
|
|
3
|
+
"today",
|
|
4
|
+
"yesterday",
|
|
5
|
+
"last-7-days",
|
|
6
|
+
"last-30-days",
|
|
7
|
+
"this-month",
|
|
8
|
+
"last-month",
|
|
9
|
+
"this-year"
|
|
10
|
+
];
|
|
11
|
+
function startOfDay(date) {
|
|
12
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
13
|
+
}
|
|
14
|
+
function addDays(date, days) {
|
|
15
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);
|
|
16
|
+
}
|
|
17
|
+
function sameDay(a, b) {
|
|
18
|
+
return startOfDay(a).getTime() === startOfDay(b).getTime();
|
|
19
|
+
}
|
|
20
|
+
function presetRange(id, now = new Date) {
|
|
21
|
+
const today = startOfDay(now);
|
|
22
|
+
const year = today.getFullYear();
|
|
23
|
+
const month = today.getMonth();
|
|
24
|
+
switch (id) {
|
|
25
|
+
case "today":
|
|
26
|
+
return { from: today, to: today };
|
|
27
|
+
case "yesterday": {
|
|
28
|
+
const day = addDays(today, -1);
|
|
29
|
+
return { from: day, to: day };
|
|
30
|
+
}
|
|
31
|
+
case "last-7-days":
|
|
32
|
+
return { from: addDays(today, -6), to: today };
|
|
33
|
+
case "last-30-days":
|
|
34
|
+
return { from: addDays(today, -29), to: today };
|
|
35
|
+
case "this-month":
|
|
36
|
+
return { from: new Date(year, month, 1), to: today };
|
|
37
|
+
case "last-month":
|
|
38
|
+
return {
|
|
39
|
+
from: new Date(year, month - 1, 1),
|
|
40
|
+
to: new Date(year, month, 0)
|
|
41
|
+
};
|
|
42
|
+
case "this-year":
|
|
43
|
+
return { from: new Date(year, 0, 1), to: today };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function resolvePresetRange(preset, now = new Date, { withTime = false } = {}) {
|
|
47
|
+
if (typeof preset !== "string") {
|
|
48
|
+
return typeof preset.range === "function" ? preset.range(now) : preset.range;
|
|
49
|
+
}
|
|
50
|
+
const range = presetRange(preset, now);
|
|
51
|
+
return withTime ? { from: range.from, to: endOfDayTime(range.to) } : range;
|
|
52
|
+
}
|
|
53
|
+
function isSameDayRange(a, b) {
|
|
54
|
+
if (!a?.from || !a.to || !b?.from || !b.to)
|
|
55
|
+
return false;
|
|
56
|
+
return sameDay(a.from, b.from) && sameDay(a.to, b.to);
|
|
57
|
+
}
|
|
58
|
+
function isRangeDisabled(range, rules = {}) {
|
|
59
|
+
const { isDayDisabled, min, max } = rules;
|
|
60
|
+
if (range.to.getTime() < range.from.getTime())
|
|
61
|
+
return true;
|
|
62
|
+
if (min && startOfDay(range.from) < startOfDay(min))
|
|
63
|
+
return true;
|
|
64
|
+
if (max && startOfDay(range.to) > startOfDay(max))
|
|
65
|
+
return true;
|
|
66
|
+
return Boolean(isDayDisabled?.(range.from) || isDayDisabled?.(range.to));
|
|
67
|
+
}
|
|
68
|
+
function withTimeOf(day, time) {
|
|
69
|
+
const next = startOfDay(day);
|
|
70
|
+
if (time)
|
|
71
|
+
next.setHours(time.getHours(), time.getMinutes());
|
|
72
|
+
return next;
|
|
73
|
+
}
|
|
74
|
+
function endOfDayTime(day) {
|
|
75
|
+
const next = startOfDay(day);
|
|
76
|
+
next.setHours(23, 59);
|
|
77
|
+
return next;
|
|
78
|
+
}
|
|
79
|
+
function clampRangeEnd(range) {
|
|
80
|
+
const { from, to } = range;
|
|
81
|
+
if (!from || !to || to.getTime() >= from.getTime())
|
|
82
|
+
return range;
|
|
83
|
+
return { ...range, to: new Date(from) };
|
|
84
|
+
}
|
|
85
|
+
function keepRangeTimes(next, previous) {
|
|
86
|
+
return clampRangeEnd({
|
|
87
|
+
...next,
|
|
88
|
+
from: next.from && withTimeOf(next.from, previous?.from),
|
|
89
|
+
to: next.to && (previous?.to ? withTimeOf(next.to, previous.to) : endOfDayTime(next.to))
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
DATE_RANGE_PRESET_IDS,
|
|
94
|
+
clampRangeEnd,
|
|
95
|
+
endOfDayTime,
|
|
96
|
+
isRangeDisabled,
|
|
97
|
+
isSameDayRange,
|
|
98
|
+
keepRangeTimes,
|
|
99
|
+
presetRange,
|
|
100
|
+
resolvePresetRange,
|
|
101
|
+
withTimeOf
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
//# debugId=DE919010B55B550A64756E2164756E21
|
|
105
|
+
//# sourceMappingURL=date-range.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lib/date-range.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\n * The pure half of both libraries' `DateRangeField`: the built-in presets'\n * ranges, a preset's state against the field's rules and value, and the time\n * of day on each end. Plain `Date` maths in the local time zone; nothing reads\n * the clock unless you leave `now` out.\n */\n\n/** Both ends of a range, set. */\nexport type DayRange = { from: Date; to: Date };\n\n/** A range being picked: `to` is unset until the second day is. */\nexport type PartialDayRange = { from?: Date; to?: Date };\n\n/** The built-in presets, in the order a field lists them. */\nexport const DATE_RANGE_PRESET_IDS = [\n\t'today',\n\t'yesterday',\n\t'last-7-days',\n\t'last-30-days',\n\t'this-month',\n\t'last-month',\n\t'this-year',\n] as const;\n\nexport type DateRangePresetId = (typeof DATE_RANGE_PRESET_IDS)[number];\n\n/**\n * A preset of your own: its label, and its range or a function of \"now\"\n * that returns one (called each time the list renders).\n */\nexport type DateRangePreset = {\n\tlabel: string;\n\trange: DayRange | ((now: Date) => DayRange);\n};\n\n/** What a field's `presets` takes: a built-in id, or a preset of your own. */\nexport type DateRangePresetOption = DateRangePresetId | DateRangePreset;\n\n/** What a day must not be: a rule of the field's, and its first and last day. */\nexport type DateRangeRules = {\n\tisDayDisabled?: (day: Date) => boolean;\n\tmin?: Date;\n\tmax?: Date;\n};\n\nfunction startOfDay(date: Date) {\n\treturn new Date(date.getFullYear(), date.getMonth(), date.getDate());\n}\n\nfunction addDays(date: Date, days: number) {\n\treturn new Date(date.getFullYear(), date.getMonth(), date.getDate() + days);\n}\n\nfunction sameDay(a: Date, b: Date) {\n\treturn startOfDay(a).getTime() === startOfDay(b).getTime();\n}\n\n/**\n * A built-in preset's range at `now`, both ends at the start of their day.\n * The last N days end today and count it; this month and this year run from\n * their first day to today; last month is the whole previous month.\n */\nexport function presetRange(\n\tid: DateRangePresetId,\n\tnow: Date = new Date(),\n): DayRange {\n\tconst today = startOfDay(now);\n\tconst year = today.getFullYear();\n\tconst month = today.getMonth();\n\tswitch (id) {\n\t\tcase 'today':\n\t\t\treturn { from: today, to: today };\n\t\tcase 'yesterday': {\n\t\t\tconst day = addDays(today, -1);\n\t\t\treturn { from: day, to: day };\n\t\t}\n\t\tcase 'last-7-days':\n\t\t\treturn { from: addDays(today, -6), to: today };\n\t\tcase 'last-30-days':\n\t\t\treturn { from: addDays(today, -29), to: today };\n\t\tcase 'this-month':\n\t\t\treturn { from: new Date(year, month, 1), to: today };\n\t\tcase 'last-month':\n\t\t\treturn {\n\t\t\t\tfrom: new Date(year, month - 1, 1),\n\t\t\t\tto: new Date(year, month, 0),\n\t\t\t};\n\t\tcase 'this-year':\n\t\t\treturn { from: new Date(year, 0, 1), to: today };\n\t}\n}\n\n/**\n * A preset's range at `now`: a built-in id's, or yours (called with `now`).\n * With `withTime`, a built-in range ends at 23:59 on its last day, so it\n * covers that day; your own ranges keep the times you gave them.\n */\nexport function resolvePresetRange(\n\tpreset: DateRangePresetOption,\n\tnow: Date = new Date(),\n\t{ withTime = false }: { withTime?: boolean } = {},\n): DayRange {\n\tif (typeof preset !== 'string') {\n\t\treturn typeof preset.range === 'function'\n\t\t\t? preset.range(now)\n\t\t\t: preset.range;\n\t}\n\tconst range = presetRange(preset, now);\n\treturn withTime ? { from: range.from, to: endOfDayTime(range.to) } : range;\n}\n\n/** Whether two ranges cover the same days (times are not compared). */\nexport function isSameDayRange(\n\ta: PartialDayRange | undefined,\n\tb: PartialDayRange | undefined,\n) {\n\tif (!a?.from || !a.to || !b?.from || !b.to) return false;\n\treturn sameDay(a.from, b.from) && sameDay(a.to, b.to);\n}\n\n/**\n * Whether a field cannot take `range`: its end comes before its start (a\n * preset of your own with its ends reversed), it starts before `min`, ends\n * after `max`, or either end is a day `isDayDisabled` rules out. The days\n * between the ends are not checked, as the calendar lets a range span a\n * disabled day.\n */\nexport function isRangeDisabled(range: DayRange, rules: DateRangeRules = {}) {\n\tconst { isDayDisabled, min, max } = rules;\n\tif (range.to.getTime() < range.from.getTime()) return true;\n\tif (min && startOfDay(range.from) < startOfDay(min)) return true;\n\tif (max && startOfDay(range.to) > startOfDay(max)) return true;\n\treturn Boolean(isDayDisabled?.(range.from) || isDayDisabled?.(range.to));\n}\n\n/**\n * `day`'s date with `time`'s hours and minutes; the start of `day` without\n * a `time`. Seconds and milliseconds are dropped.\n */\nexport function withTimeOf(day: Date, time?: Date) {\n\tconst next = startOfDay(day);\n\tif (time) next.setHours(time.getHours(), time.getMinutes());\n\treturn next;\n}\n\n/** `day` at 23:59, the end time a preset gets when the field shows times. */\nexport function endOfDayTime(day: Date) {\n\tconst next = startOfDay(day);\n\tnext.setHours(23, 59);\n\treturn next;\n}\n\n/**\n * The range with its end no earlier than its start: an end before the start\n * becomes the start (the same day and time). The field calls it after a time\n * change, after a day pick (through `keepRangeTimes`) and after a preset\n * pick; the only end that can come first is an earlier time on the start's\n * day. A range missing an end, or already in order, is returned as it is. A\n * preset with its ends reversed never reaches it: `isRangeDisabled` disables\n * it.\n */\nexport function clampRangeEnd<R extends PartialDayRange>(range: R): R {\n\tconst { from, to } = range;\n\tif (!from || !to || to.getTime() >= from.getTime()) return range;\n\treturn { ...range, to: new Date(from) };\n}\n\n/**\n * Days picked on a calendar, with times: each end keeps the time `previous`\n * had at the same end. An end that had none starts at 00:00 or ends at 23:59\n * (`endOfDayTime`), as a built-in preset does, so the range covers its last\n * day. The end is then clamped to the start (`clampRangeEnd`).\n */\nexport function keepRangeTimes<R extends PartialDayRange>(\n\tnext: R,\n\tprevious?: PartialDayRange,\n): R {\n\treturn clampRangeEnd({\n\t\t...next,\n\t\tfrom: next.from && withTimeOf(next.from, previous?.from),\n\t\tto:\n\t\t\tnext.to &&\n\t\t\t(previous?.to ? withTimeOf(next.to, previous.to) : endOfDayTime(next.to)),\n\t});\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";AAcO,IAAM,wBAAwB;AAAA,EACpC;AAAA,EACA;AAAA,EAC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C,KAAW;AAAA,EACvC,MAAM,OAAO,WAAW,GAAG;AAAA,EAC3B,KAAK,SAAS,IAAI,EAAE;AAAA,EACpB,OAAO;AAAA;AAYD,SAAS,aAAwC,CAAC,OAAa;AAAA,EACrE,QAAQ,MAAM,OAAO;AAAA,EACrB,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,QAAQ,KAAK,KAAK,QAAQ;AAAA,IAAG,OAAO;AAAA,EAC3D,OAAO,KAAK,OAAO,IAAI,IAAI,KAAK,IAAI,EAAE;AAAA;AAShC,SAAS,cAAyC,CACxD,MACA,UACI;AAAA,EACJ,OAAO,cAAc;AAAA,OACjB;AAAA,IACH,MAAM,KAAK,QAAQ,WAAW,KAAK,MAAM,UAAU,IAAI;AAAA,IACvD,IACC,KAAK,OACJ,UAAU,KAAK,WAAW,KAAK,IAAI,SAAS,EAAE,IAAI,aAAa,KAAK,EAAE;AAAA,EACzE,CAAC;AAAA;",
|
|
8
|
+
"debugId": "DE919010B55B550A64756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The values a slider's tick marks sit at, from `min` to `max` inclusive:
|
|
3
|
+
* `false` none, a number that many, `true` one per `step` (or 5 without one).
|
|
4
|
+
* Always 2 to 21 marks, evenly spaced; one when `min` and `max` are equal.
|
|
5
|
+
*/
|
|
6
|
+
export declare function tickValues(min: number, max: number, ticks: boolean | number, step?: number): number[];
|
|
7
|
+
//# sourceMappingURL=slider-ticks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-ticks.d.ts","sourceRoot":"","sources":["../../src/lib/slider-ticks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,UAAU,CACzB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,GAAG,MAAM,EACvB,IAAI,CAAC,EAAE,MAAM,YAeb"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/lib/slider-ticks.ts
|
|
2
|
+
function tickValues(min, max, ticks, step) {
|
|
3
|
+
if (ticks === false)
|
|
4
|
+
return [];
|
|
5
|
+
let count = typeof ticks === "number" ? ticks : step && step > 0 ? Math.round((max - min) / step) + 1 : 5;
|
|
6
|
+
count = Math.min(Math.max(Math.round(count), 2), 21);
|
|
7
|
+
if (max === min)
|
|
8
|
+
return [min];
|
|
9
|
+
return Array.from({ length: count }, (_, index) => min + (max - min) * index / (count - 1));
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
tickValues
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//# debugId=68EBFB8D67762FE364756E2164756E21
|
|
16
|
+
//# sourceMappingURL=slider-ticks.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/lib/slider-ticks.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\n * The values a slider's tick marks sit at, from `min` to `max` inclusive:\n * `false` none, a number that many, `true` one per `step` (or 5 without one).\n * Always 2 to 21 marks, evenly spaced; one when `min` and `max` are equal.\n */\nexport function tickValues(\n\tmin: number,\n\tmax: number,\n\tticks: boolean | number,\n\tstep?: number,\n) {\n\tif (ticks === false) return [];\n\tlet count =\n\t\ttypeof ticks === 'number'\n\t\t\t? ticks\n\t\t\t: step && step > 0\n\t\t\t\t? Math.round((max - min) / step) + 1\n\t\t\t\t: 5;\n\tcount = Math.min(Math.max(Math.round(count), 2), 21);\n\tif (max === min) return [min];\n\treturn Array.from(\n\t\t{ length: count },\n\t\t(_, index) => min + ((max - min) * index) / (count - 1),\n\t);\n}\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";AAKO,SAAS,UAAU,CACzB,KACA,KACA,OACA,MACC;AAAA,EACD,IAAI,UAAU;AAAA,IAAO,OAAO,CAAC;AAAA,EAC7B,IAAI,QACH,OAAO,UAAU,WACd,QACA,QAAQ,OAAO,IACd,KAAK,OAAO,MAAM,OAAO,IAAI,IAAI,IACjC;AAAA,EACL,QAAQ,KAAK,IAAI,KAAK,IAAI,KAAK,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE;AAAA,EACnD,IAAI,QAAQ;AAAA,IAAK,OAAO,CAAC,GAAG;AAAA,EAC5B,OAAO,MAAM,KACZ,EAAE,QAAQ,MAAM,GAChB,CAAC,GAAG,UAAU,OAAQ,MAAM,OAAO,SAAU,QAAQ,EACtD;AAAA;",
|
|
8
|
+
"debugId": "68EBFB8D67762FE364756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -9,6 +9,7 @@ export * from './pdf-document-search';
|
|
|
9
9
|
export * from './pdf-escape';
|
|
10
10
|
export * from './pdf-page-geometry';
|
|
11
11
|
export * from './pdf-page-sizes';
|
|
12
|
+
export * from './pdf-pin-page';
|
|
12
13
|
export * from './pdf-scroll-spy';
|
|
13
14
|
export * from './pdf-text-search';
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pdf-viewer/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pdf-viewer/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
|
package/dist/pdf-viewer/index.js
CHANGED
|
@@ -215,6 +215,24 @@ function createPageSizesLoader(onSizes) {
|
|
|
215
215
|
}
|
|
216
216
|
};
|
|
217
217
|
}
|
|
218
|
+
// src/pdf-viewer/pdf-user-input.ts
|
|
219
|
+
var USER_SCROLL_EVENTS = [
|
|
220
|
+
"wheel",
|
|
221
|
+
"touchstart",
|
|
222
|
+
"pointerdown",
|
|
223
|
+
"keydown"
|
|
224
|
+
];
|
|
225
|
+
function listenForUserInput(target, run) {
|
|
226
|
+
for (const type of USER_SCROLL_EVENTS) {
|
|
227
|
+
target.addEventListener(type, run, { capture: true, passive: true });
|
|
228
|
+
}
|
|
229
|
+
return () => {
|
|
230
|
+
for (const type of USER_SCROLL_EVENTS) {
|
|
231
|
+
target.removeEventListener(type, run, { capture: true });
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
|
|
218
236
|
// src/pdf-viewer/pdf-scroll-spy.ts
|
|
219
237
|
function mostVisiblePage(view, pages) {
|
|
220
238
|
let best = null;
|
|
@@ -244,38 +262,6 @@ function scrollIntoArea(node, block, behavior = "smooth") {
|
|
|
244
262
|
top -= (view.height - box.height) / 2;
|
|
245
263
|
area.scrollTo({ top: Math.max(0, top), behavior });
|
|
246
264
|
}
|
|
247
|
-
var USER_SCROLL_EVENTS = [
|
|
248
|
-
"wheel",
|
|
249
|
-
"touchstart",
|
|
250
|
-
"pointerdown",
|
|
251
|
-
"keydown"
|
|
252
|
-
];
|
|
253
|
-
function pinToPage(node, beforeScroll) {
|
|
254
|
-
const area = node()?.closest('[data-slot="scroll-area-viewport"]');
|
|
255
|
-
const content = area?.firstElementChild;
|
|
256
|
-
if (!area || !content || typeof ResizeObserver === "undefined") {
|
|
257
|
-
return () => {};
|
|
258
|
-
}
|
|
259
|
-
const surface = area.closest('[data-slot="scroll-area"]') ?? area;
|
|
260
|
-
const observer = new ResizeObserver(() => {
|
|
261
|
-
const target = node();
|
|
262
|
-
if (!target)
|
|
263
|
-
return;
|
|
264
|
-
beforeScroll();
|
|
265
|
-
scrollIntoArea(target, "start", "auto");
|
|
266
|
-
});
|
|
267
|
-
observer.observe(content);
|
|
268
|
-
const unpin = () => {
|
|
269
|
-
observer.disconnect();
|
|
270
|
-
for (const type of USER_SCROLL_EVENTS) {
|
|
271
|
-
surface.removeEventListener(type, unpin, true);
|
|
272
|
-
}
|
|
273
|
-
};
|
|
274
|
-
for (const type of USER_SCROLL_EVENTS) {
|
|
275
|
-
surface.addEventListener(type, unpin, { capture: true, passive: true });
|
|
276
|
-
}
|
|
277
|
-
return unpin;
|
|
278
|
-
}
|
|
279
265
|
function createScrollSpy(root, pages, onPage, idleMs = 150) {
|
|
280
266
|
let frame = 0;
|
|
281
267
|
let held = false;
|
|
@@ -313,10 +299,18 @@ function createScrollSpy(root, pages, onPage, idleMs = 150) {
|
|
|
313
299
|
if (!frame)
|
|
314
300
|
frame = requestAnimationFrame(measure);
|
|
315
301
|
};
|
|
302
|
+
const onUserInput = (event) => {
|
|
303
|
+
const target = event.target;
|
|
304
|
+
if (!target || !root()?.contains(target))
|
|
305
|
+
return;
|
|
306
|
+
held = false;
|
|
307
|
+
clearTimeout(idle);
|
|
308
|
+
};
|
|
316
309
|
document.addEventListener("scroll", onScroll, {
|
|
317
310
|
capture: true,
|
|
318
311
|
passive: true
|
|
319
312
|
});
|
|
313
|
+
const stopInput = listenForUserInput(document, onUserInput);
|
|
320
314
|
return {
|
|
321
315
|
hold() {
|
|
322
316
|
held = true;
|
|
@@ -326,6 +320,7 @@ function createScrollSpy(root, pages, onPage, idleMs = 150) {
|
|
|
326
320
|
},
|
|
327
321
|
stop() {
|
|
328
322
|
document.removeEventListener("scroll", onScroll, { capture: true });
|
|
323
|
+
stopInput();
|
|
329
324
|
cancelAnimationFrame(frame);
|
|
330
325
|
clearTimeout(idle);
|
|
331
326
|
}
|
|
@@ -347,6 +342,45 @@ function revealHit(findPage, hit, beforeScroll = () => {}, timeout = 5000) {
|
|
|
347
342
|
frame = requestAnimationFrame(look);
|
|
348
343
|
return () => cancelAnimationFrame(frame);
|
|
349
344
|
}
|
|
345
|
+
|
|
346
|
+
// src/pdf-viewer/pdf-pin-page.ts
|
|
347
|
+
var VIEWPORT = '[data-slot="scroll-area-viewport"]';
|
|
348
|
+
function pinToPage(node, beforeScroll, onRelease = () => {}) {
|
|
349
|
+
const area = node()?.closest(VIEWPORT);
|
|
350
|
+
const content = area?.firstElementChild;
|
|
351
|
+
if (!area || !content || typeof ResizeObserver === "undefined") {
|
|
352
|
+
onRelease();
|
|
353
|
+
return () => {};
|
|
354
|
+
}
|
|
355
|
+
const surface = area.closest('[data-slot="scroll-area"]') ?? area;
|
|
356
|
+
const observer = new ResizeObserver(() => {
|
|
357
|
+
const target = node();
|
|
358
|
+
if (!target)
|
|
359
|
+
return;
|
|
360
|
+
beforeScroll();
|
|
361
|
+
scrollIntoArea(target, "start", "auto");
|
|
362
|
+
});
|
|
363
|
+
observer.observe(content);
|
|
364
|
+
let pinned = true;
|
|
365
|
+
const unpin = () => {
|
|
366
|
+
if (!pinned)
|
|
367
|
+
return;
|
|
368
|
+
pinned = false;
|
|
369
|
+
observer.disconnect();
|
|
370
|
+
stopListening();
|
|
371
|
+
onRelease();
|
|
372
|
+
};
|
|
373
|
+
const stopListening = listenForUserInput(surface, unpin);
|
|
374
|
+
return unpin;
|
|
375
|
+
}
|
|
376
|
+
function pinHolds(node) {
|
|
377
|
+
const area = node?.closest(VIEWPORT);
|
|
378
|
+
if (!node || !area)
|
|
379
|
+
return false;
|
|
380
|
+
const atEnd = area.scrollTop + area.clientHeight >= area.scrollHeight - 2;
|
|
381
|
+
const offset = node.getBoundingClientRect().top - area.getBoundingClientRect().top;
|
|
382
|
+
return atEnd && offset >= -2 || Math.abs(offset) <= 2;
|
|
383
|
+
}
|
|
350
384
|
export {
|
|
351
385
|
DEFAULT_PAGE_SIZE,
|
|
352
386
|
FIT_PAGES,
|
|
@@ -364,6 +398,7 @@ export {
|
|
|
364
398
|
mostVisiblePage,
|
|
365
399
|
pageRotation,
|
|
366
400
|
pageTextFromItems,
|
|
401
|
+
pinHolds,
|
|
367
402
|
pinToPage,
|
|
368
403
|
placeholderSize,
|
|
369
404
|
readPageSizes,
|
|
@@ -376,5 +411,5 @@ export {
|
|
|
376
411
|
withPageMatches
|
|
377
412
|
};
|
|
378
413
|
|
|
379
|
-
//# debugId=
|
|
414
|
+
//# debugId=71863DCA45A690D164756E2164756E21
|
|
380
415
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/pdf-viewer/pdf-escape.ts", "../src/pdf-viewer/pdf-text-search.ts", "../src/pdf-viewer/pdf-document-search.ts", "../src/pdf-viewer/pdf-page-geometry.ts", "../src/pdf-viewer/pdf-page-sizes.ts", "../src/pdf-viewer/pdf-scroll-spy.ts"],
|
|
3
|
+
"sources": ["../src/pdf-viewer/pdf-escape.ts", "../src/pdf-viewer/pdf-text-search.ts", "../src/pdf-viewer/pdf-document-search.ts", "../src/pdf-viewer/pdf-page-geometry.ts", "../src/pdf-viewer/pdf-page-sizes.ts", "../src/pdf-viewer/pdf-user-input.ts", "../src/pdf-viewer/pdf-scroll-spy.ts", "../src/pdf-viewer/pdf-pin-page.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"export function escapeHtml(text: string): string {\n\treturn text\n\t\t.replace(/&/g, '&')\n\t\t.replace(/</g, '<')\n\t\t.replace(/>/g, '>')\n\t\t.replace(/\"/g, '"')\n\t\t.replace(/'/g, ''');\n}\n\nexport function mapPdfOutline(items: unknown): {\n\ttitle: string;\n\tdest: unknown;\n\titems: ReturnType<typeof mapPdfOutline>;\n}[] {\n\tif (!Array.isArray(items)) return [];\n\treturn items.map((item) => {\n\t\tconst node = item as {\n\t\t\ttitle?: string;\n\t\t\tdest?: unknown;\n\t\t\titems?: unknown;\n\t\t};\n\t\treturn {\n\t\t\ttitle: String(node.title ?? ''),\n\t\t\tdest: node.dest ?? null,\n\t\t\titems: mapPdfOutline(node.items),\n\t\t};\n\t});\n}\n",
|
|
6
6
|
"import { escapeHtml } from './pdf-escape';\n\n/** One item of `page.getTextContent()`: marked-content items have no `str`. */\nexport type PdfTextItem = { str?: string; hasEOL?: boolean };\n\n/** A page's text, and where each text item starts in it. */\nexport type PdfPageText = { text: string; starts: number[] };\n\n/** A match in a page's text: `end` is exclusive. */\nexport type PdfTextRange = { start: number; end: number };\n\n/** Joins the items' text, a line break after each item that ends a line. */\nexport function pageTextFromItems(items: readonly PdfTextItem[]): PdfPageText {\n\tlet text = '';\n\tconst starts: number[] = [];\n\tfor (const item of items) {\n\t\tstarts.push(text.length);\n\t\ttext += item.str ?? '';\n\t\tif (item.hasEOL) text += '\\n';\n\t}\n\treturn { text, starts };\n}\n\n/**\n * Lower case, accents and ligatures dropped (`Café` and `fi` match `cafe` and\n * `fi`), every run of white space one space; `origin` maps each folded\n * character back to its index in `text`.\n */\nfunction fold(text: string) {\n\tlet folded = '';\n\tconst origin: number[] = [];\n\tlet space = false;\n\tfor (let index = 0; index < text.length; index += 1) {\n\t\tconst char = text.charAt(index);\n\t\tif (/\\s/.test(char)) {\n\t\t\tif (!space) {\n\t\t\t\tfolded += ' ';\n\t\t\t\torigin.push(index);\n\t\t\t}\n\t\t\tspace = true;\n\t\t\tcontinue;\n\t\t}\n\t\tspace = false;\n\t\tfor (const part of char\n\t\t\t.normalize('NFKD')\n\t\t\t.replace(/\\p{M}/gu, '')\n\t\t\t.toLowerCase()) {\n\t\t\tfolded += part;\n\t\t\torigin.push(index);\n\t\t}\n\t}\n\treturn { folded, origin };\n}\n\n/** Every match of `query` in `text`, ignoring case, accents and spacing. */\nexport function findTextMatches(text: string, query: string): PdfTextRange[] {\n\tconst needle = fold(query.trim()).folded;\n\tif (!needle) return [];\n\tconst { folded, origin } = fold(text);\n\tconst matches: PdfTextRange[] = [];\n\tlet from = 0;\n\tfor (;;) {\n\t\tconst at = folded.indexOf(needle, from);\n\t\tif (at < 0) return matches;\n\t\tconst last = origin[at + needle.length - 1] ?? 0;\n\t\tmatches.push({ start: origin[at] ?? 0, end: last + 1 });\n\t\tfrom = at + needle.length;\n\t}\n}\n\n/**\n * One text item's HTML, its part of each match wrapped in\n * `<mark class=\"pdf-highlight\" data-hit=\"…\">`. A match across items gets a\n * mark in each; the current one also carries `data-current`.\n */\nexport function highlightItemHtml(\n\tstr: string,\n\titemStart: number,\n\tmatches: readonly PdfTextRange[],\n\tcurrent = -1,\n) {\n\tconst itemEnd = itemStart + str.length;\n\tlet html = '';\n\tlet at = itemStart;\n\tmatches.forEach((match, hit) => {\n\t\tif (match.end <= at || match.start >= itemEnd) return;\n\t\tconst start = Math.max(match.start, at);\n\t\tconst end = Math.min(match.end, itemEnd);\n\t\tconst mark = hit === current ? ' data-current=\"true\"' : '';\n\t\thtml += escapeHtml(str.slice(at - itemStart, start - itemStart));\n\t\thtml += `<mark class=\"pdf-highlight\" data-hit=\"${hit}\"${mark}>`;\n\t\thtml += `${escapeHtml(str.slice(start - itemStart, end - itemStart))}</mark>`;\n\t\tat = end;\n\t});\n\treturn html + escapeHtml(str.slice(at - itemStart));\n}\n",
|
|
7
7
|
"import {\n\tfindTextMatches,\n\ttype PdfPageText,\n\ttype PdfTextItem,\n\ttype PdfTextRange,\n\tpageTextFromItems,\n} from './pdf-text-search';\n\n/** Where a match sits: its page, and its rank among that page's matches. */\nexport type PdfSearchHit = { page: number; hit: number };\n\nexport type PdfTextSource = {\n\tnumPages: number;\n\tgetPage: (pageNumber: number) => Promise<{\n\t\tgetTextContent: () => Promise<{ items: readonly unknown[] }>;\n\t}>;\n};\n\nconst texts = new WeakMap<object, Map<number, Promise<PdfPageText>>>();\n\n/** A page's text, read once per document. */\nexport function loadPageText(pdf: PdfTextSource, pageNumber: number) {\n\tlet pages = texts.get(pdf);\n\tif (!pages) {\n\t\tpages = new Map();\n\t\ttexts.set(pdf, pages);\n\t}\n\tlet text = pages.get(pageNumber);\n\tif (!text) {\n\t\tconst cache = pages;\n\t\t// Without marked content, like the text layer: item i is span i.\n\t\ttext = pdf\n\t\t\t.getPage(pageNumber)\n\t\t\t.then((page) => page.getTextContent())\n\t\t\t.then(({ items }) => pageTextFromItems(items as PdfTextItem[]));\n\t\t// A failed read is tried again by the next search.\n\t\ttext.catch(() => cache.delete(pageNumber));\n\t\tpages.set(pageNumber, text);\n\t}\n\treturn text;\n}\n\n/** A page the search has read: its text and the matches in it. */\nexport type PdfPageMatches = {\n\tpage: number;\n\ttext: PdfPageText;\n\tmatches: PdfTextRange[];\n};\n\n/**\n * Searches every page in order, drawn or not, and reports the pages read: the\n * first one at once, then `chunk` at a time. A report per page would have the\n * reader draw every page again after each one read, a quadratic first search.\n * Stops once `isCancelled` says so.\n */\nexport async function searchDocument(\n\tpdf: PdfTextSource,\n\tquery: string,\n\tonPages: (pages: PdfPageMatches[]) => void,\n\tisCancelled: () => boolean = () => false,\n\tchunk = 25,\n) {\n\tlet found: PdfPageMatches[] = [];\n\tfor (let page = 1; page <= pdf.numPages; page += 1) {\n\t\tconst text = await loadPageText(pdf, page);\n\t\tif (isCancelled()) return;\n\t\tfound.push({ page, text, matches: findTextMatches(text.text, query) });\n\t\tif (page === 1 || found.length >= chunk || page === pdf.numPages) {\n\t\t\tonPages(found);\n\t\t\tfound = [];\n\t\t}\n\t}\n}\n\n/** Each page's text and matches, as far as the search has read. */\nexport type PdfDocumentMatches = {\n\ttexts: (PdfPageText | undefined)[];\n\tmatches: PdfTextRange[][];\n};\n\n/** `found` with a batch of pages read, copied once for the whole batch. */\nexport function withPageMatches(\n\tfound: PdfDocumentMatches,\n\tpages: readonly PdfPageMatches[],\n): PdfDocumentMatches {\n\tconst texts = [...found.texts];\n\tconst matches = [...found.matches];\n\tfor (const { page, text, matches: inPage } of pages) {\n\t\ttexts[page - 1] = text;\n\t\tmatches[page - 1] = inPage;\n\t}\n\treturn { texts, matches };\n}\n\n/**\n * The rank `delta` away from `from`, wrapping; from none (-1), the first\n * match forward or the last one back.\n */\nexport function stepHit(from: number, delta: number, count: number) {\n\tif (count <= 0) return -1;\n\tif (from < 0) return delta > 0 ? 0 : count - 1;\n\treturn (((from + delta) % count) + count) % count;\n}\n\n/** The hit at a document-wide rank, from each page's match count. */\nexport function hitAt(\n\tcounts: readonly (number | undefined)[],\n\tindex: number,\n): PdfSearchHit | null {\n\tlet rest = index;\n\tfor (let page = 0; page < counts.length; page += 1) {\n\t\tconst count = counts[page] ?? 0;\n\t\tif (rest < count) return { page: page + 1, hit: rest };\n\t\trest -= count;\n\t}\n\treturn null;\n}\n",
|
|
8
8
|
"/**\n * How the reader sizes a page: to the viewport's width, to the whole page, or\n * at a zoom the user chose.\n */\nexport type FitMode = 'width' | 'page' | 'custom';\n\n/**\n * A page's size in PDF points (1/72 inch), before any rotation, and the\n * rotation the page asks for itself (its `/Rotate`, in degrees clockwise).\n */\nexport type PdfPageSize = { width: number; height: number; rotate?: number };\n\n/** Used until a page's own size is known: US Letter. */\nexport const DEFAULT_PAGE_SIZE: PdfPageSize = { width: 612, height: 792 };\n\n/**\n * The fit zoom fits the first pages only, the ones read when the document\n * opens: pages read later never move it. A wider page further on is shown at\n * that zoom (and scrolls sideways in fit width).\n */\nexport const FIT_PAGES = 25;\n\n/** Room kept around the pages: the list's padding on each side. */\nexport const PAGE_PADDING = 32;\n\n// The reader's own MIN_SCALE and MAX_SCALE; kept here so this file stays\n// shared.\nconst MIN_FIT_SCALE = 0.25;\nconst MAX_FIT_SCALE = 5;\n\n/**\n * The rotation a page is drawn at: its own `/Rotate` plus the reader's, from\n * 0 to 270. `undefined` while the page's own is not known and the reader adds\n * none, so the renderer keeps the page's. Once the reader turns the pages, a\n * page whose size is not read yet (past the first chunk) is drawn at the\n * reader's rotation alone until its size arrives, then drawn again.\n */\nexport function pageRotation(\n\tsize: PdfPageSize | undefined,\n\trotation: number,\n): number | undefined {\n\tif (!size && !rotation) return undefined;\n\tconst turn = (size?.rotate ?? 0) + rotation;\n\treturn ((turn % 360) + 360) % 360;\n}\n\n/** The page's size on screen: turned by its own `/Rotate` and `rotation`. */\nexport function rotatedSize(size: PdfPageSize, rotation: number): PdfPageSize {\n\tconst turn = (size.rotate ?? 0) + rotation;\n\tconst quarter = ((turn % 180) + 180) % 180 === 90;\n\treturn quarter\n\t\t? { width: size.height, height: size.width }\n\t\t: { width: size.width, height: size.height };\n}\n\n/**\n * The widest and the tallest of the known pages, rotated. Fitting on it keeps\n * every page inside the box with one scale, so the zoom does not jump while\n * scrolling from an A4 page to a landscape one.\n */\nexport function largestPage(\n\tsizes: readonly (PdfPageSize | undefined)[],\n\trotation: number,\n): PdfPageSize {\n\tlet width = 0;\n\tlet height = 0;\n\tfor (const size of sizes) {\n\t\tif (!size) continue;\n\t\tconst turned = rotatedSize(size, rotation);\n\t\twidth = Math.max(width, turned.width);\n\t\theight = Math.max(height, turned.height);\n\t}\n\treturn width && height\n\t\t? { width, height }\n\t\t: rotatedSize(DEFAULT_PAGE_SIZE, rotation);\n}\n\n/**\n * The scale at which the largest page fits the box's width, or all of it,\n * within the reader's zoom range: a tiny page does not fit to 4000%.\n */\nexport function fitScale(\n\tmode: Exclude<FitMode, 'custom'>,\n\tlargest: PdfPageSize,\n\tbox: { width: number; height: number },\n\tpadding = PAGE_PADDING,\n) {\n\tconst byWidth = (box.width - padding) / largest.width;\n\tconst scale =\n\t\tmode === 'width'\n\t\t\t? byWidth\n\t\t\t: Math.min(byWidth, (box.height - padding) / largest.height);\n\treturn Math.min(MAX_FIT_SCALE, Math.max(MIN_FIT_SCALE, scale));\n}\n\n/**\n * The reader's zoom in fit width or fit page: the largest of the first\n * `FIT_PAGES` pages, rotated, fitted to the box.\n */\nexport function readerFitScale(\n\tmode: Exclude<FitMode, 'custom'>,\n\tsizes: readonly (PdfPageSize | undefined)[],\n\trotation: number,\n\tbox: { width: number; height: number },\n) {\n\treturn fitScale(mode, largestPage(sizes.slice(0, FIT_PAGES), rotation), box);\n}\n\n/** Pixel size of a page's placeholder before it renders. */\nexport function placeholderSize(\n\tsize: PdfPageSize | undefined,\n\tscale: number,\n\trotation: number,\n) {\n\tconst turned = rotatedSize(size ?? DEFAULT_PAGE_SIZE, rotation);\n\treturn {\n\t\twidth: Math.round(turned.width * scale),\n\t\theight: Math.round(turned.height * scale),\n\t};\n}\n",
|
|
9
9
|
"import { FIT_PAGES, type PdfPageSize } from './pdf-page-geometry';\n\ntype SizedPage = {\n\t/** The page's own `/Rotate`, in degrees (pdf.js `PDFPageProxy.rotate`). */\n\trotate?: number;\n\tgetViewport: (options: { scale: number; rotation: number }) => {\n\t\twidth: number;\n\t\theight: number;\n\t};\n};\n\nexport type PdfSizedDocument = {\n\tnumPages: number;\n\tgetPage: (pageNumber: number) => Promise<SizedPage>;\n};\n\n/** What a load handler receives: `getPage` is optional for older callers. */\nexport type PdfLoadedDocument = Pick<PdfSizedDocument, 'numPages'> &\n\tPartial<Pick<PdfSizedDocument, 'getPage'>>;\n\n/**\n * Reads every page's size, unrotated, and its own `/Rotate`, `chunk` pages\n * at a time (at most `chunk` page objects asked for at once): the first chunk\n * at once, the rest in the background. `onSizes` gets the list known so far\n * after each chunk; the first report holds the pages the fit zoom is computed\n * from (`FIT_PAGES`), so later chunks never move it. `isCancelled` stops the\n * reading when the document changed.\n */\nexport async function readPageSizes(\n\tpdf: PdfSizedDocument,\n\tonSizes: (sizes: PdfPageSize[]) => void,\n\tisCancelled: () => boolean = () => false,\n\tchunk = FIT_PAGES,\n) {\n\tconst sizes: PdfPageSize[] = [];\n\tfor (let next = 1; next <= pdf.numPages; next += chunk) {\n\t\tconst last = Math.min(pdf.numPages, next + chunk - 1);\n\t\tconst pages = await Promise.all(\n\t\t\tArray.from({ length: last - next + 1 }, (_, index) =>\n\t\t\t\tpdf.getPage(next + index),\n\t\t\t),\n\t\t);\n\t\tif (isCancelled()) return;\n\t\tfor (const page of pages) {\n\t\t\tconst { width, height } = page.getViewport({ scale: 1, rotation: 0 });\n\t\t\tconst rotate = (((page.rotate ?? 0) % 360) + 360) % 360;\n\t\t\tsizes.push(rotate ? { width, height, rotate } : { width, height });\n\t\t}\n\t\tonSizes([...sizes]);\n\t}\n}\n\n/**\n * Reads the sizes of the document last loaded. `reset` forgets it when the\n * file changes, so sizes still arriving for it never land. A document\n * without `getPage` keeps the fallback size.\n */\nexport function createPageSizesLoader(onSizes: (sizes: PdfPageSize[]) => void) {\n\tlet generation = 0;\n\treturn {\n\t\treset() {\n\t\t\tgeneration += 1;\n\t\t},\n\t\tload(pdf: PdfLoadedDocument) {\n\t\t\tgeneration += 1;\n\t\t\tif (!pdf.getPage) return Promise.resolve();\n\t\t\tconst current = generation;\n\t\t\t// pdf.js reads `this` in getPage: pass the document itself.\n\t\t\treturn readPageSizes(\n\t\t\t\tpdf as PdfSizedDocument,\n\t\t\t\tonSizes,\n\t\t\t\t() => current !== generation,\n\t\t\t).catch(() => {\n\t\t\t\t/* a page failed or the document was destroyed: the rest keep the\n\t\t\t\t fallback size */\n\t\t\t});\n\t\t},\n\t};\n}\n",
|
|
10
|
-
"/**
|
|
10
|
+
"/** What the user does to scroll a page area themselves. */\nconst USER_SCROLL_EVENTS = [\n\t'wheel',\n\t'touchstart',\n\t'pointerdown',\n\t'keydown',\n] as const;\n\n/**\n * Runs `run` on each wheel, touch, pointer or key event that reaches\n * `target`, in the capture phase. Returns a function that stops listening.\n * Internal: not re-exported from the subpath.\n */\nexport function listenForUserInput(\n\ttarget: EventTarget,\n\trun: (event: Event) => void,\n) {\n\tfor (const type of USER_SCROLL_EVENTS) {\n\t\ttarget.addEventListener(type, run, { capture: true, passive: true });\n\t}\n\treturn () => {\n\t\tfor (const type of USER_SCROLL_EVENTS) {\n\t\t\ttarget.removeEventListener(type, run, { capture: true });\n\t\t}\n\t};\n}\n",
|
|
11
|
+
"import { listenForUserInput } from './pdf-user-input';\n\n/** A vertical extent on screen, as `getBoundingClientRect` gives it. */\nexport type PdfBox = { top: number; bottom: number };\n\n/**\n * The page with the most of itself on screen, the first one on a tie; once\n * scrolled to the end, the last page on screen, however little of it shows.\n */\nexport function mostVisiblePage(\n\tview: PdfBox & { atEnd: boolean },\n\tpages: Iterable<readonly [number, PdfBox]>,\n): number | null {\n\tlet best: number | null = null;\n\tlet bestSeen = 0;\n\tlet last: number | null = null;\n\tfor (const [page, box] of pages) {\n\t\tconst seen =\n\t\t\tMath.min(box.bottom, view.bottom) - Math.max(box.top, view.top);\n\t\tif (seen <= 0) continue;\n\t\tif (last === null || page > last) last = page;\n\t\tif (\n\t\t\tseen > bestSeen ||\n\t\t\t(seen === bestSeen && best !== null && page < best)\n\t\t) {\n\t\t\tbest = page;\n\t\t\tbestSeen = seen;\n\t\t}\n\t}\n\treturn view.atEnd && last !== null ? last : best;\n}\n\n/**\n * Scrolls the page area around `node`, and nothing else: `scrollIntoView`\n * would scroll the host page too. `block` puts `node` at the area's top or\n * centre.\n */\nexport function scrollIntoArea(\n\tnode: Element,\n\tblock: 'start' | 'center',\n\tbehavior: ScrollBehavior = 'smooth',\n) {\n\tconst area = node.closest<HTMLElement>('[data-slot=\"scroll-area-viewport\"]');\n\tif (!area) return;\n\tconst box = node.getBoundingClientRect();\n\tconst view = area.getBoundingClientRect();\n\tlet top = area.scrollTop + box.top - view.top;\n\tif (block === 'center') top -= (view.height - box.height) / 2;\n\tarea.scrollTo({ top: Math.max(0, top), behavior });\n}\n\n/**\n * Reports the page most on screen as the reader's page area (`root`)\n * scrolls. `hold`\n * ignores scrolling until it has stopped for `idleMs`: the reader calls it\n * before scrolling to a page itself, so the pages it passes on the way are\n * not reported. What the user does in the page area (wheel, touch, pointer,\n * key) ends a hold: the scrolling after it is theirs.\n */\nexport function createScrollSpy(\n\troot: () => HTMLElement | null | undefined,\n\tpages: () => ReadonlyMap<number, HTMLElement>,\n\tonPage: (page: number) => void,\n\tidleMs = 150,\n) {\n\tlet frame = 0;\n\tlet held = false;\n\tlet idle: ReturnType<typeof setTimeout> | undefined;\n\tlet scroller: HTMLElement | null = null;\n\n\tconst release = () => {\n\t\tclearTimeout(idle);\n\t\tidle = setTimeout(() => {\n\t\t\theld = false;\n\t\t}, idleMs);\n\t};\n\n\tconst measure = () => {\n\t\tframe = 0;\n\t\tif (!scroller) return;\n\t\tconst view = scroller.getBoundingClientRect();\n\t\tconst atEnd =\n\t\t\tscroller.scrollTop + scroller.clientHeight >= scroller.scrollHeight - 2;\n\t\tconst boxes = Array.from(pages(), ([page, node]) => {\n\t\t\tconst { top, bottom } = node.getBoundingClientRect();\n\t\t\treturn [page, { top, bottom }] as const;\n\t\t});\n\t\tconst page = mostVisiblePage(\n\t\t\t{ top: view.top, bottom: view.bottom, atEnd },\n\t\t\tboxes,\n\t\t);\n\t\tif (page !== null) onPage(page);\n\t};\n\n\tconst onScroll = (event: Event) => {\n\t\tconst target = event.target;\n\t\tif (!(target instanceof HTMLElement) || !root()?.contains(target)) return;\n\t\t// Scrolling during a hold is not measured again on release: that would\n\t\t// report the page a jump near the end scrolled past.\n\t\tif (held) {\n\t\t\trelease();\n\t\t\treturn;\n\t\t}\n\t\tscroller = target;\n\t\tif (!frame) frame = requestAnimationFrame(measure);\n\t};\n\n\tconst onUserInput = (event: Event) => {\n\t\t// Input on the document lands on a node (an SVG icon too).\n\t\tconst target = event.target as Node | null;\n\t\tif (!target || !root()?.contains(target)) return;\n\t\theld = false;\n\t\tclearTimeout(idle);\n\t};\n\n\t// Scroll events do not bubble: listen in the capture phase, on the\n\t// document, as the page area may be rendered again under the reader.\n\t// Plain DOM rather than react-use or VueUse: this file is shared.\n\tdocument.addEventListener('scroll', onScroll, {\n\t\tcapture: true,\n\t\tpassive: true,\n\t});\n\tconst stopInput = listenForUserInput(document, onUserInput);\n\n\treturn {\n\t\thold() {\n\t\t\theld = true;\n\t\t\tcancelAnimationFrame(frame);\n\t\t\tframe = 0;\n\t\t\trelease();\n\t\t},\n\t\tstop() {\n\t\t\tdocument.removeEventListener('scroll', onScroll, { capture: true });\n\t\t\tstopInput();\n\t\t\tcancelAnimationFrame(frame);\n\t\t\tclearTimeout(idle);\n\t\t},\n\t};\n}\n\n/**\n * Scrolls a page's match to the middle of the page area once the page has\n * drawn its mark, polling each frame for up to `timeout` ms; `beforeScroll`\n * runs first. Returns a function that stops waiting.\n */\nexport function revealHit(\n\tfindPage: () => ParentNode | null | undefined,\n\thit: number,\n\tbeforeScroll: () => void = () => {},\n\ttimeout = 5000,\n) {\n\tconst until = Date.now() + timeout;\n\tlet frame = 0;\n\tconst look = () => {\n\t\tconst mark = findPage()?.querySelector(`mark[data-hit=\"${hit}\"]`);\n\t\tif (mark) {\n\t\t\tbeforeScroll();\n\t\t\tscrollIntoArea(mark, 'center');\n\t\t\treturn;\n\t\t}\n\t\tif (Date.now() < until) frame = requestAnimationFrame(look);\n\t};\n\t// The page marks the match on its next render, not now.\n\tframe = requestAnimationFrame(look);\n\treturn () => cancelAnimationFrame(frame);\n}\n",
|
|
12
|
+
"import { scrollIntoArea } from './pdf-scroll-spy';\nimport { listenForUserInput } from './pdf-user-input';\n\nconst VIEWPORT = '[data-slot=\"scroll-area-viewport\"]';\n\n/**\n * Keeps `node` at the top of the page area while the pages above it change\n * size (the zoom fitting to page sizes still arriving), until the user\n * scrolls, taps, clicks or types in the page area, or the returned function\n * is called. `beforeScroll` runs before each correction; `onRelease` once,\n * when the pin lets go (at once when there is nothing to pin).\n */\nexport function pinToPage(\n\tnode: () => Element | null | undefined,\n\tbeforeScroll: () => void,\n\tonRelease: () => void = () => {},\n) {\n\tconst area = node()?.closest(VIEWPORT);\n\tconst content = area?.firstElementChild;\n\tif (!area || !content || typeof ResizeObserver === 'undefined') {\n\t\tonRelease();\n\t\treturn () => {};\n\t}\n\t// The scroll area, not only its viewport: dragging the scrollbar counts.\n\tconst surface = area.closest('[data-slot=\"scroll-area\"]') ?? area;\n\tconst observer = new ResizeObserver(() => {\n\t\tconst target = node();\n\t\tif (!target) return;\n\t\tbeforeScroll();\n\t\tscrollIntoArea(target, 'start', 'auto');\n\t});\n\tobserver.observe(content);\n\tlet pinned = true;\n\t// A scroll event cannot tell the user's scroll from a correction; what\n\t// the user does first can.\n\tconst unpin = () => {\n\t\tif (!pinned) return;\n\t\tpinned = false;\n\t\tobserver.disconnect();\n\t\tstopListening();\n\t\tonRelease();\n\t};\n\tconst stopListening = listenForUserInput(surface, unpin);\n\treturn unpin;\n}\n\n/**\n * Whether the page area still shows `node` where a pin puts it: at the top,\n * or as near as the area can scroll (at its end). A scroll that leaves it\n * elsewhere came with no input the pin hears (find in page, a screen\n * reader's cursor, your own `scrollTop`): it is not the reader's.\n */\nexport function pinHolds(node: Element | null | undefined) {\n\tconst area = node?.closest<HTMLElement>(VIEWPORT);\n\tif (!node || !area) return false;\n\tconst atEnd = area.scrollTop + area.clientHeight >= area.scrollHeight - 2;\n\tconst offset =\n\t\tnode.getBoundingClientRect().top - area.getBoundingClientRect().top;\n\t// At the end, the pinned page may sit below the top (the area can\n\t// scroll no further), never above it: a jump to the last page left it.\n\treturn (atEnd && offset >= -2) || Math.abs(offset) <= 2;\n}\n"
|
|
11
13
|
],
|
|
12
|
-
"mappings": ";AAAO,SAAS,UAAU,CAAC,MAAsB;AAAA,EAChD,OAAO,KACL,QAAQ,MAAM,OAAO,EACrB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,MAAM,EACpB,QAAQ,MAAM,QAAQ,EACtB,QAAQ,MAAM,OAAO;AAAA;AAGjB,SAAS,aAAa,CAAC,OAI1B;AAAA,EACH,IAAI,CAAC,MAAM,QAAQ,KAAK;AAAA,IAAG,OAAO,CAAC;AAAA,EACnC,OAAO,MAAM,IAAI,CAAC,SAAS;AAAA,IAC1B,MAAM,OAAO;AAAA,IAKb,OAAO;AAAA,MACN,OAAO,OAAO,KAAK,SAAS,EAAE;AAAA,MAC9B,MAAM,KAAK,QAAQ;AAAA,MACnB,OAAO,cAAc,KAAK,KAAK;AAAA,IAChC;AAAA,GACA;AAAA;;;ACdK,SAAS,iBAAiB,CAAC,OAA4C;AAAA,EAC7E,IAAI,OAAO;A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C7B;AAAA,EACD,MAAM,OAAO,KAAK,GAAG,QAAQ,QAAQ;AAAA,EACrC,MAAM,UAAU,MAAM;AAAA,EACtB,IAAI,CAAC,QAAQ,CAAC,WAAW,OAAO,mBAAmB,aAAa;AAAA,IAC/D,UAAU;AAAA,IACV,OAAO,MAAM;AAAA,EACd;AAAA,EAEA,MAAM,UAAU,KAAK,QAAQ,2BAA2B,KAAK;AAAA,EAC7D,MAAM,WAAW,IAAI,eAAe,MAAM;AAAA,IACzC,MAAM,SAAS,KAAK;AAAA,IACpB,IAAI,CAAC;AAAA,MAAQ;AAAA,IACb,aAAa;AAAA,IACb,eAAe,QAAQ,SAAS,MAAM;AAAA,GACtC;AAAA,EACD,SAAS,QAAQ,OAAO;AAAA,EACxB,IAAI,SAAS;AAAA,EAGb,MAAM,QAAQ,MAAM;AAAA,IACnB,IAAI,CAAC;AAAA,MAAQ;AAAA,IACb,SAAS;AAAA,IACT,SAAS,WAAW;AAAA,IACpB,cAAc;AAAA,IACd,UAAU;AAAA;AAAA,EAEX,MAAM,gBAAgB,mBAAmB,SAAS,KAAK;AAAA,EACvD,OAAO;AAAA;AASD,SAAS,QAAQ,CAAC,MAAkC;AAAA,EAC1D,MAAM,OAAO,MAAM,QAAqB,QAAQ;AAAA,EAChD,IAAI,CAAC,QAAQ,CAAC;AAAA,IAAM,OAAO;AAAA,EAC3B,MAAM,QAAQ,KAAK,YAAY,KAAK,gBAAgB,KAAK,eAAe;AAAA,EACxE,MAAM,SACL,KAAK,sBAAsB,EAAE,MAAM,KAAK,sBAAsB,EAAE;AAAA,EAGjE,OAAQ,SAAS,UAAU,MAAO,KAAK,IAAI,MAAM,KAAK;AAAA;",
|
|
15
|
+
"debugId": "71863DCA45A690D164756E2164756E21",
|
|
14
16
|
"names": []
|
|
15
17
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps `node` at the top of the page area while the pages above it change
|
|
3
|
+
* size (the zoom fitting to page sizes still arriving), until the user
|
|
4
|
+
* scrolls, taps, clicks or types in the page area, or the returned function
|
|
5
|
+
* is called. `beforeScroll` runs before each correction; `onRelease` once,
|
|
6
|
+
* when the pin lets go (at once when there is nothing to pin).
|
|
7
|
+
*/
|
|
8
|
+
export declare function pinToPage(node: () => Element | null | undefined, beforeScroll: () => void, onRelease?: () => void): () => void;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the page area still shows `node` where a pin puts it: at the top,
|
|
11
|
+
* or as near as the area can scroll (at its end). A scroll that leaves it
|
|
12
|
+
* elsewhere came with no input the pin hears (find in page, a screen
|
|
13
|
+
* reader's cursor, your own `scrollTop`): it is not the reader's.
|
|
14
|
+
*/
|
|
15
|
+
export declare function pinHolds(node: Element | null | undefined): boolean;
|
|
16
|
+
//# sourceMappingURL=pdf-pin-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-pin-page.d.ts","sourceRoot":"","sources":["../../src/pdf-viewer/pdf-pin-page.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,SAAS,CACxB,IAAI,EAAE,MAAM,OAAO,GAAG,IAAI,GAAG,SAAS,EACtC,YAAY,EAAE,MAAM,IAAI,EACxB,SAAS,GAAE,MAAM,IAAe,cA6BhC;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,WASxD"}
|
|
@@ -16,19 +16,13 @@ export declare function mostVisiblePage(view: PdfBox & {
|
|
|
16
16
|
* centre.
|
|
17
17
|
*/
|
|
18
18
|
export declare function scrollIntoArea(node: Element, block: 'start' | 'center', behavior?: ScrollBehavior): void;
|
|
19
|
-
/**
|
|
20
|
-
* Keeps `node` at the top of the page area while the pages above it change
|
|
21
|
-
* size (the zoom fitting to page sizes still arriving), until the user
|
|
22
|
-
* scrolls, taps, clicks or types in the page area, or the returned function
|
|
23
|
-
* is called. `beforeScroll` runs before each correction.
|
|
24
|
-
*/
|
|
25
|
-
export declare function pinToPage(node: () => Element | null | undefined, beforeScroll: () => void): () => void;
|
|
26
19
|
/**
|
|
27
20
|
* Reports the page most on screen as the reader's page area (`root`)
|
|
28
21
|
* scrolls. `hold`
|
|
29
22
|
* ignores scrolling until it has stopped for `idleMs`: the reader calls it
|
|
30
23
|
* before scrolling to a page itself, so the pages it passes on the way are
|
|
31
|
-
* not reported.
|
|
24
|
+
* not reported. What the user does in the page area (wheel, touch, pointer,
|
|
25
|
+
* key) ends a hold: the scrolling after it is theirs.
|
|
32
26
|
*/
|
|
33
27
|
export declare function createScrollSpy(root: () => HTMLElement | null | undefined, pages: () => ReadonlyMap<number, HTMLElement>, onPage: (page: number) => void, idleMs?: number): {
|
|
34
28
|
hold(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pdf-scroll-spy.d.ts","sourceRoot":"","sources":["../../src/pdf-viewer/pdf-scroll-spy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pdf-scroll-spy.d.ts","sourceRoot":"","sources":["../../src/pdf-viewer/pdf-scroll-spy.ts"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,MAAM,MAAM,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD;;;GAGG;AACH,wBAAgB,eAAe,CAC9B,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,EACjC,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACxC,MAAM,GAAG,IAAI,CAkBf;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC7B,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,OAAO,GAAG,QAAQ,EACzB,QAAQ,GAAE,cAAyB,QASnC;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC9B,IAAI,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,EAC1C,KAAK,EAAE,MAAM,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,EAC7C,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAC9B,MAAM,SAAM;;;EA2EZ;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CACxB,QAAQ,EAAE,MAAM,UAAU,GAAG,IAAI,GAAG,SAAS,EAC7C,GAAG,EAAE,MAAM,EACX,YAAY,GAAE,MAAM,IAAe,EACnC,OAAO,SAAO,cAgBd"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs `run` on each wheel, touch, pointer or key event that reaches
|
|
3
|
+
* `target`, in the capture phase. Returns a function that stops listening.
|
|
4
|
+
* Internal: not re-exported from the subpath.
|
|
5
|
+
*/
|
|
6
|
+
export declare function listenForUserInput(target: EventTarget, run: (event: Event) => void): () => void;
|
|
7
|
+
//# sourceMappingURL=pdf-user-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pdf-user-input.d.ts","sourceRoot":"","sources":["../../src/pdf-viewer/pdf-user-input.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,cAU3B"}
|