@nxgt/material-core 0.14.0-next-20261013055642 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -6
- package/README.md +26 -246
- package/dist/lib/text-match.js +21 -7
- package/dist/lib/text-match.js.map +4 -3
- 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 +76 -1
- package/dist/pdf-viewer/index.js.map +4 -3
- package/dist/pdf-viewer/pdf-link-labels.d.ts +67 -0
- package/dist/pdf-viewer/pdf-link-labels.d.ts.map +1 -0
- package/docs/roadmap.md +1 -10
- package/package.json +3 -15
- package/dist/chunks/index-54gkyr43.js +0 -23
- package/dist/chunks/index-54gkyr43.js.map +0 -10
- package/dist/chunks/index-wdn02459.js +0 -47
- package/dist/chunks/index-wdn02459.js.map +0 -10
- package/dist/data-grid/aggregates.d.ts +0 -16
- package/dist/data-grid/aggregates.d.ts.map +0 -1
- package/dist/data-grid/announce.d.ts +0 -41
- package/dist/data-grid/announce.d.ts.map +0 -1
- package/dist/data-grid/change-ops.d.ts +0 -29
- package/dist/data-grid/change-ops.d.ts.map +0 -1
- package/dist/data-grid/change-select.d.ts +0 -25
- package/dist/data-grid/change-select.d.ts.map +0 -1
- package/dist/data-grid/change-types.d.ts +0 -72
- package/dist/data-grid/change-types.d.ts.map +0 -1
- package/dist/data-grid/changes.d.ts +0 -46
- package/dist/data-grid/changes.d.ts.map +0 -1
- package/dist/data-grid/conflict-text.d.ts +0 -20
- package/dist/data-grid/conflict-text.d.ts.map +0 -1
- package/dist/data-grid/edit-messages.d.ts +0 -6
- package/dist/data-grid/edit-messages.d.ts.map +0 -1
- package/dist/data-grid/edit-session.d.ts +0 -107
- package/dist/data-grid/edit-session.d.ts.map +0 -1
- package/dist/data-grid/exports-announce.d.ts +0 -7
- package/dist/data-grid/exports-announce.d.ts.map +0 -1
- package/dist/data-grid/exports-clipboard.d.ts +0 -7
- package/dist/data-grid/exports-clipboard.d.ts.map +0 -1
- package/dist/data-grid/exports-editing.d.ts +0 -11
- package/dist/data-grid/exports-editing.d.ts.map +0 -1
- package/dist/data-grid/exports-model.d.ts +0 -10
- package/dist/data-grid/exports-model.d.ts.map +0 -1
- package/dist/data-grid/exports-navigation.d.ts +0 -8
- package/dist/data-grid/exports-navigation.d.ts.map +0 -1
- package/dist/data-grid/exports-rows.d.ts +0 -7
- package/dist/data-grid/exports-rows.d.ts.map +0 -1
- package/dist/data-grid/exports-saving.d.ts +0 -15
- package/dist/data-grid/exports-saving.d.ts.map +0 -1
- package/dist/data-grid/history.d.ts +0 -46
- package/dist/data-grid/history.d.ts.map +0 -1
- package/dist/data-grid/index.d.ts +0 -16
- package/dist/data-grid/index.d.ts.map +0 -1
- package/dist/data-grid/index.js +0 -1643
- package/dist/data-grid/index.js.map +0 -37
- package/dist/data-grid/key-types.d.ts +0 -82
- package/dist/data-grid/key-types.d.ts.map +0 -1
- package/dist/data-grid/keys.d.ts +0 -16
- package/dist/data-grid/keys.d.ts.map +0 -1
- package/dist/data-grid/model.d.ts +0 -52
- package/dist/data-grid/model.d.ts.map +0 -1
- package/dist/data-grid/msg.d.ts +0 -22
- package/dist/data-grid/msg.d.ts.map +0 -1
- package/dist/data-grid/navigation.d.ts +0 -33
- package/dist/data-grid/navigation.d.ts.map +0 -1
- package/dist/data-grid/number-codes.d.ts +0 -62
- package/dist/data-grid/number-codes.d.ts.map +0 -1
- package/dist/data-grid/number-messages.d.ts +0 -21
- package/dist/data-grid/number-messages.d.ts.map +0 -1
- package/dist/data-grid/paste-plan.d.ts +0 -43
- package/dist/data-grid/paste-plan.d.ts.map +0 -1
- package/dist/data-grid/range.d.ts +0 -52
- package/dist/data-grid/range.d.ts.map +0 -1
- package/dist/data-grid/rebase.d.ts +0 -10
- package/dist/data-grid/rebase.d.ts.map +0 -1
- package/dist/data-grid/same-value.d.ts +0 -7
- package/dist/data-grid/same-value.d.ts.map +0 -1
- package/dist/data-grid/save-answer.d.ts +0 -26
- package/dist/data-grid/save-answer.d.ts.map +0 -1
- package/dist/data-grid/save-failure.d.ts +0 -32
- package/dist/data-grid/save-failure.d.ts.map +0 -1
- package/dist/data-grid/save-queue.d.ts +0 -77
- package/dist/data-grid/save-queue.d.ts.map +0 -1
- package/dist/data-grid/save-versions.d.ts +0 -11
- package/dist/data-grid/save-versions.d.ts.map +0 -1
- package/dist/data-grid/sort-snapshot.d.ts +0 -22
- package/dist/data-grid/sort-snapshot.d.ts.map +0 -1
- package/dist/data-grid/standard-schema.d.ts +0 -38
- package/dist/data-grid/standard-schema.d.ts.map +0 -1
- package/dist/data-grid/tsv.d.ts +0 -29
- package/dist/data-grid/tsv.d.ts.map +0 -1
- package/dist/data-grid/types.d.ts +0 -89
- package/dist/data-grid/types.d.ts.map +0 -1
- package/dist/data-grid/validate.d.ts +0 -66
- package/dist/data-grid/validate.d.ts.map +0 -1
- package/dist/data-grid/version.d.ts +0 -22
- package/dist/data-grid/version.d.ts.map +0 -1
- package/dist/lib/parse-number.d.ts +0 -25
- package/dist/lib/parse-number.d.ts.map +0 -1
- package/dist/lib/parse-number.js +0 -15
- package/dist/lib/parse-number.js.map +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
# @nxgt/material-core
|
|
2
2
|
|
|
3
|
-
## 0.14.0
|
|
3
|
+
## 0.14.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
- [#
|
|
8
|
-
|
|
9
|
-
`@nxgt/material-core/parse-number`: `parseNumberInput`, `clampNumber` and `stepNumber` move here from `@nxgt/material`'s `NumberField`, plus `decimalsTyped`.
|
|
10
|
-
|
|
11
|
-
- [#699](https://github.com/softistx/nxgt-material/pull/699) [`b13f08a`](https://github.com/softistx/nxgt-material/commit/b13f08a5c1a92f362ecd4e1f365173b5a8eb88f6) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `@nxgt/material-core/data-grid`: the rest of the coming editable `DataGrid`'s pure half — the changes per cell (`editCell`, each change keeping the value and the version it was read at, per cell with the row's as the fallback; `rebase` after a refetch, a moved version and value turning a pending edit into a conflict while a cell whose value is still its base adopts the new version; a saved value, and "Keep theirs", kept as an overlay until the app's rows hold it, a refetch still read at the version a save or a conflict replaced changing nothing; `resolveConflict` with "theirs" or "mine"; a conflict outliving any edit until it is resolved; `expireSaved`; `changeCounts` and `blocking`), the save queue (`startCall`, `applyAnswer`, `applyFailure`, `applyAbort`, `retry`: one call in flight at a time; per cell up to 200 entries a call, per row once the row is left, or in one batch on `save()` with no limit, blocked while a cell is in error or in conflict; an answer is all or nothing, `versions[i]` updating entry `i`'s cells (and, with `versionScope: 'row'`, the row's other changes) and a refusal flagging its cells as errors or conflicts; paused after 3 failures in a row, an abort counting none), undo and redo (`record`, `undo`, `redo`: 100 steps, an undo is a new edit, cells changed since are skipped and counted), tab-separated copy and paste as Excel and Google Sheets write it, a cell with a quote and no line break read raw (`parseTsv`, `serializeTsv`), the all-or-nothing paste plan (`planPaste`: past the grid, locked, read-only, computed, not parsed and invalid cells listed as problems), the totals' aggregates (`aggregate`: sum, mean, min, max, count, or the app's own, over numbers only; a count of nothing is 0), the sort order kept while editing (`reconcileOrder`) and the conflict panel's two values, a cleared one reading "Cleared" (`conflictValues`).
|
|
7
|
+
- [#760](https://github.com/softistx/nxgt-material/pull/760) [`c0ddda3`](https://github.com/softistx/nxgt-material/commit/c0ddda389f84f2180b13f52dd7761d37852fdb26) Thanks [@SteveGT96](https://github.com/SteveGT96)! - PdfReader: the empty link anchors pdf.js draws over a page now have an accessible name (axe `link-name`): "Link: example.com" for an external link, "Go to page 3" for an internal one, "Link in document" when the page cannot be told; a link's own title is kept as its name. `PdfPageList` takes an optional `pdfRef` (the loaded document) to name internal links by page. New `material.pdf-reader.link-external` and `link-internal` and `link-go-to-page-titled` keys (en, fr). `@nxgt/material-core/pdf-viewer` exports the framework-free half: `linkAnnotationLabel`, `labelLinkAnchors`, `resolveDestinationPage`.
|
|
12
8
|
|
|
13
9
|
## 0.13.2
|
|
14
10
|
|
package/README.md
CHANGED
|
@@ -87,7 +87,7 @@ can reach. No other subpath imports a `node:` built-in.
|
|
|
87
87
|
| `/pdf-source` | `PdfSource` and its helpers (`toPdfjsSource`, `pdfSourceKey`, …) |
|
|
88
88
|
| `/pdf-file-name` | `resolvePdfFileName`, `DEFAULT_PDF_FILE_NAME` |
|
|
89
89
|
| `/pdf-download` | `downloadPdfFile`, `printPdfFile` — in a browser |
|
|
90
|
-
| `/pdf-viewer` | The PDF viewer's pure half: page geometry and fit (`readerFitScale`, `placeholderSize`, `rotatedSize`, `PdfPageSize`, `FitMode`), page sizes (`readPageSizes`, `createPageSizesLoader`), the scroll spy (`createScrollSpy` and its `ScrollSpyOptions`, `pageInView`, `revealHit`, `scrollIntoArea`), the opening page's pin (`pinToPage`, whose optional `onRelease` runs once when it lets go, and `pinHolds`, whether the view is still where it puts the page), text search (`pageTextFromItems`, `findTextMatches`, `searchDocument`), `escapeHtml`, `mapPdfOutline` |
|
|
90
|
+
| `/pdf-viewer` | The PDF viewer's pure half: page geometry and fit (`readerFitScale`, `placeholderSize`, `rotatedSize`, `PdfPageSize`, `FitMode`), page sizes (`readPageSizes`, `createPageSizesLoader`), the scroll spy (`createScrollSpy` and its `ScrollSpyOptions`, `pageInView`, `revealHit`, `scrollIntoArea`), the opening page's pin (`pinToPage`, whose optional `onRelease` runs once when it lets go, and `pinHolds`, whether the view is still where it puts the page), text search (`pageTextFromItems`, `findTextMatches`, `searchDocument`), `escapeHtml`, `mapPdfOutline`, link names (`linkAnnotationLabel`, `labelLinkAnchors`, `resolveDestinationPage`, with `PdfLinkLabels`, `PdfLinkAnnotation`, `PdfDestinationDocument`) |
|
|
91
91
|
| `/currency-digits` | `currencyFractionDigits` — the decimals `CurrencyField` shows |
|
|
92
92
|
| `/field-blur-layers` | `layerOf`, `openerOf`, `FieldLayers` — whose overlay a layer of the page is, for a field's blur |
|
|
93
93
|
| `/focus-control` | `firstControl`, `focusHandle`, `FocusHandle` — the first control of a field a user can reach, and a stand-in element that focuses it for a form library |
|
|
@@ -120,8 +120,6 @@ can reach. No other subpath imports a `node:` built-in.
|
|
|
120
120
|
| `/states` | `EMPTY_STATE_KINDS`, `ERROR_STATE_KINDS`, `resolveEmptyStateKind`, `isErrorKind`, `stateCopy`, `STATE_ACTION_KEYS`, `describeError`, `STATE_ILLUSTRATIONS`, `STATE_ACCENT`, `STATE_ICON` and the types `EmptyStateKind`, `ErrorStateKind`, `StateKind`, `LegacyEmptyStateVariant`, `StateFamily`, `StateCopy`, `ErrorDetail`, `StateIllustration`, `IllustrationShape`, `IllustrationTone`, `StateAccent`, `StateIconName` — the kinds, copy keys, error details and illustrations behind `EmptyState` and `ErrorState` |
|
|
121
121
|
| `/vite` | `nxgtMaterial()`, `pdfkitStandardFonts()`, `cspAssetsInlineLimit`, `CSP_NONCE_PLACEHOLDER`, `ZOD_JITLESS_SCRIPT` and the types `NxgtMaterialOptions`, `NxgtMaterialCspOptions`, `NxgtMaterialLibrary` — see below |
|
|
122
122
|
| `/pdfkit-fonts` | **Node only.** `pdfkitStandardFontDirs`, `pdfkitStandardFontFiles`, `PDFKIT_STANDARD_FONTS`, the types `PdfkitStandardFont` and `PdfkitFontsWarn` — where the app's pdfkit keeps its standard fonts, for a server tracer |
|
|
123
|
-
| `/data-grid` | **Headless**, for the editable `DataGrid` coming in `@nxgt/material`; nothing renders yet. The model (`buildGridModel`, `cellAccess`, `cellVersion` and `isNewCellVersion`), navigation (`navigate`, `gridCommandFor`), the range (`extend`, `selectAll`, `rangeCells`, …), the edit session (`editReducer`), validation (`validateCell`, `serverErrors`, `refusalsByCell`, Standard Schema), `numberCodes`, the changes per cell (`NO_CHANGES`, `editCell`, `rebase`, `resolveConflict`, `expireSaved`, `changeCounts`, `blocking`), the save queue (`IDLE_QUEUE`, `nextCall`, `startCall`, `applyAnswer`, `applyFailure`, `applyAbort`, `retry`), undo and redo (`EMPTY_HISTORY`, `record`, `undo`, `redo`), copy and paste (`parseTsv`, `serializeTsv`, `planPaste`), the totals (`aggregate`), the kept sort order (`snapshotOrder`, `reconcileOrder`, `sortingChanged`), the conflict panel's text (`conflictValues`, `conflictSummary`, `clearedText`) and the live region's descriptors (`savedMessage`, `cellStateText`, …), with the types `GridModel`, `GridColumnSpec`, `GridRowSpec`, `GridMsg`, `GridPos`, `GridRange`, `GridVersion`, `GridCode`, `GridChanges`, `GridSaveQueue`, `GridCall`, `GridSaveAnswer`, `GridHistory`, `GridStep`, `GridPasteInput`, `GridPastePlan`, `GridPasteProblem`, `GridAggregate` and `GridSort`. A cell's version is `0` or `undefined` when it does not exist yet on the server. See below |
|
|
124
|
-
| `/parse-number` | `parseNumberInput`, `decimalsTyped`, `clampNumber`, `stepNumber` — a typed number read with `,` or `.` as its decimal separator, its typed decimals, and the clamp and step behind `NumberField` |
|
|
125
123
|
|
|
126
124
|
## Usage
|
|
127
125
|
|
|
@@ -389,6 +387,31 @@ no page is in view.
|
|
|
389
387
|
const page = pageInView(area, pages); // 3
|
|
390
388
|
```
|
|
391
389
|
|
|
390
|
+
pdf.js draws a link annotation as an empty `<a>`, which axe flags (`link-name`).
|
|
391
|
+
`labelLinkAnchors` gives each such anchor in an annotation layer an `aria-label`;
|
|
392
|
+
`linkAnnotationLabel` is the pure naming rule and `resolveDestinationPage` tells
|
|
393
|
+
the page an internal destination lands on. An anchor that already has text or an
|
|
394
|
+
`aria-label` is left alone, and its own `title` is kept in the name
|
|
395
|
+
(`goToPageTitled`). Pass the labels already translated; the names it sets carry
|
|
396
|
+
`data-nxgt-link-label`, so calling it again with new labels (another language)
|
|
397
|
+
renames them.
|
|
398
|
+
|
|
399
|
+
```ts
|
|
400
|
+
import { labelLinkAnchors, resolveDestinationPage } from '@nxgt/material-core/pdf-viewer';
|
|
401
|
+
|
|
402
|
+
await labelLinkAnchors(
|
|
403
|
+
pageElement, // holds the `.annotationLayer`
|
|
404
|
+
(id) => annotations.get(id), // pdf.js annotation by id: { url?, dest? }
|
|
405
|
+
(dest) => resolveDestinationPage(pdf, dest),
|
|
406
|
+
{
|
|
407
|
+
external: (host) => `Link: ${host}`,
|
|
408
|
+
goToPage: (n) => `Go to page ${n}`,
|
|
409
|
+
goToPageTitled: (n, title) => `Go to page ${n}: ${title}`,
|
|
410
|
+
internal: 'Link in document',
|
|
411
|
+
},
|
|
412
|
+
);
|
|
413
|
+
```
|
|
414
|
+
|
|
392
415
|
### A currency's decimals: `/currency-digits`
|
|
393
416
|
|
|
394
417
|
```ts
|
|
@@ -1359,249 +1382,6 @@ You rarely call it yourself: `withNxgtPrint` (`@nxgt/material/next`) turns
|
|
|
1359
1382
|
the directories into `outputFileTracingIncludes` globs, and the Nuxt module
|
|
1360
1383
|
of `@nxgt/material-vue` adds the files to `nitro.externals.traceInclude`.
|
|
1361
1384
|
|
|
1362
|
-
### An editable grid's pure half: `/data-grid`
|
|
1363
|
-
|
|
1364
|
-
The logic behind the editable `DataGrid` that is coming to `@nxgt/material`,
|
|
1365
|
-
with nothing rendered yet: where a cell is, which cell a key moves to, what a
|
|
1366
|
-
typed text parses to, and the messages to announce. It never reads the DOM, so
|
|
1367
|
-
it also runs in a test or on a server. Positions are `{ row, col }`; the header
|
|
1368
|
-
row is `-1` and the footer rows follow the body.
|
|
1369
|
-
|
|
1370
|
-
```ts
|
|
1371
|
-
import {
|
|
1372
|
-
buildGridModel,
|
|
1373
|
-
cellVersion,
|
|
1374
|
-
gridCommandFor,
|
|
1375
|
-
gridPlatform,
|
|
1376
|
-
isGridPos,
|
|
1377
|
-
navigate,
|
|
1378
|
-
numberCodes,
|
|
1379
|
-
validateCell,
|
|
1380
|
-
type GridPos,
|
|
1381
|
-
} from '@nxgt/material-core/data-grid';
|
|
1382
|
-
|
|
1383
|
-
type Row = { id: string; outOf: number; version?: number };
|
|
1384
|
-
|
|
1385
|
-
const model = buildGridModel({
|
|
1386
|
-
columns: [
|
|
1387
|
-
{ id: 'name', label: 'Name', frozen: true },
|
|
1388
|
-
{ id: 'maths', label: 'Maths', editor: 'number' },
|
|
1389
|
-
],
|
|
1390
|
-
rows: [{ id: 'ada' }, { id: 'alan' }],
|
|
1391
|
-
});
|
|
1392
|
-
|
|
1393
|
-
// A key press is a command, and a command takes the active cell somewhere.
|
|
1394
|
-
const key = { key: 'ArrowDown', shiftKey: false, ctrlKey: false, metaKey: false, altKey: false };
|
|
1395
|
-
const command = gridCommandFor(key, 'nav', gridPlatform(navigator.platform));
|
|
1396
|
-
// { type: 'move', cmd: 'down' }
|
|
1397
|
-
|
|
1398
|
-
let active: GridPos = { row: 0, col: 1 };
|
|
1399
|
-
if (command?.type === 'move') {
|
|
1400
|
-
const next = navigate(active, command.cmd, {
|
|
1401
|
-
model,
|
|
1402
|
-
pageSize: 10,
|
|
1403
|
-
dir: 'ltr',
|
|
1404
|
-
skipReadOnly: true,
|
|
1405
|
-
});
|
|
1406
|
-
if (isGridPos(next)) active = next; // else 'exit-forward' / 'exit-back': leave the grid
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
|
-
// A number column that also takes codes, in any language, with `,` or `.`.
|
|
1410
|
-
const grades = numberCodes<Row>({
|
|
1411
|
-
min: 0,
|
|
1412
|
-
max: (row) => row.outOf,
|
|
1413
|
-
decimals: 2,
|
|
1414
|
-
codes: [{ value: 'ABS', labels: { en: 'abs', fr: 'abs' }, aliases: { fr: ['absent'] } }],
|
|
1415
|
-
});
|
|
1416
|
-
const row: Row = { id: 'ada', outOf: 20 };
|
|
1417
|
-
|
|
1418
|
-
grades.parse('abs', { lang: 'fr', row }); // { value: 'ABS' }
|
|
1419
|
-
grades.parse('12,5', { lang: 'fr', row }); // { value: 12.5 }
|
|
1420
|
-
grades.parse('25', { lang: 'en', row }); // { error: GridMsg } — "Enter a number from 0 to 20"
|
|
1421
|
-
|
|
1422
|
-
// Parse, then the column's check, then a Standard Schema: the first error wins.
|
|
1423
|
-
const result = validateCell({
|
|
1424
|
-
text: '12,5',
|
|
1425
|
-
row,
|
|
1426
|
-
parse: (text) => grades.parse(text, { lang: 'fr', row }),
|
|
1427
|
-
});
|
|
1428
|
-
// { ok: true, value: 12.5 } or { ok: false, error: GridMsg }
|
|
1429
|
-
|
|
1430
|
-
// The version the server gave a cell: per cell, else the row's.
|
|
1431
|
-
cellVersion(row, 'maths', { getRowVersion: (r) => r.version });
|
|
1432
|
-
```
|
|
1433
|
-
|
|
1434
|
-
- **Messages are descriptors.** Every error and announcement is a `GridMsg`
|
|
1435
|
-
(`{ key: 'material.data-grid.…', fallback, values? }`): the library
|
|
1436
|
-
translates `key`, and `gridFallbackText(message)` gives the English text.
|
|
1437
|
-
- **Versions are passed through unchanged.** `cellVersion` answers
|
|
1438
|
-
`getCellVersion` when it is given, else `getRowVersion`, else `undefined`;
|
|
1439
|
-
`isNewCellVersion` is true for `0` and `undefined`, a cell that does not
|
|
1440
|
-
exist yet on the server.
|
|
1441
|
-
- **Numbers are never rounded or clamped.** Too many decimals or a value out
|
|
1442
|
-
of bounds is an error. Spaces are stripped (`"1 234"` is 1234), but a
|
|
1443
|
-
second separator is refused: `"1,234"` is 1.234 and `"1,234.5"` an error.
|
|
1444
|
-
`parse` needs the row; with a bound that is a function of the row and no
|
|
1445
|
-
row, it refuses the number rather than let it through unchecked.
|
|
1446
|
-
- **A cleared cell skips the schema.** `null` still runs `validate`, but not
|
|
1447
|
-
the Standard Schema, so a `z.number()` does not refuse a clear; refuse an
|
|
1448
|
-
empty cell in `validate` (or with `numberCodes({ emptyClears: false })`).
|
|
1449
|
-
Without `parse`, the value is the text: a column whose value is not a
|
|
1450
|
-
string must give one.
|
|
1451
|
-
- **Tab in an editor always moves on.** `tabBehavior: 'exit'` makes Tab leave
|
|
1452
|
-
the grid from a cell, but a commit's Tab (`commitNext` / `commitPrev`)
|
|
1453
|
-
still walks the cells. `gridCommandFor` returns `{ type: 'swallow' }` for
|
|
1454
|
-
the browser's back and forward (Alt+Arrow, Cmd+[ and Cmd+]): call
|
|
1455
|
-
`preventDefault` and do nothing.
|
|
1456
|
-
|
|
1457
|
-
#### Saving changes: the queue
|
|
1458
|
-
|
|
1459
|
-
Each edited cell is a change that keeps the value and the version it was read
|
|
1460
|
-
at. The queue picks what the next call sends, one call at a time; the answer
|
|
1461
|
-
is all or nothing.
|
|
1462
|
-
|
|
1463
|
-
```ts
|
|
1464
|
-
import {
|
|
1465
|
-
applyAbort,
|
|
1466
|
-
applyAnswer,
|
|
1467
|
-
applyFailure,
|
|
1468
|
-
cellVersion,
|
|
1469
|
-
editCell,
|
|
1470
|
-
expireSaved,
|
|
1471
|
-
gridCellKey,
|
|
1472
|
-
type GridCall,
|
|
1473
|
-
type GridSaveAnswer,
|
|
1474
|
-
IDLE_QUEUE,
|
|
1475
|
-
NO_CHANGES,
|
|
1476
|
-
startCall,
|
|
1477
|
-
} from '@nxgt/material-core/data-grid';
|
|
1478
|
-
|
|
1479
|
-
type Row = { id: string; maths: number | null; version: number };
|
|
1480
|
-
const row: Row = { id: 'ada', maths: 12, version: 3 };
|
|
1481
|
-
// The app's save: one call, answered as a whole.
|
|
1482
|
-
declare function onSave(entries: GridCall['entries'], signal: AbortSignal): Promise<GridSaveAnswer>;
|
|
1483
|
-
|
|
1484
|
-
let changes = NO_CHANGES;
|
|
1485
|
-
let queue = IDLE_QUEUE;
|
|
1486
|
-
|
|
1487
|
-
// An edit: going back to the value read drops it again.
|
|
1488
|
-
changes = editCell(changes, {
|
|
1489
|
-
key: gridCellKey(row.id, 'maths'),
|
|
1490
|
-
base: row.maths,
|
|
1491
|
-
baseVersion: cellVersion(row, 'maths', { getRowVersion: (r) => r.version }),
|
|
1492
|
-
value: 14,
|
|
1493
|
-
});
|
|
1494
|
-
|
|
1495
|
-
// Cell mode sends everything dirty (200 entries a call at most); row mode the
|
|
1496
|
-
// rows left; batch mode only on save(), with no limit, and not while a cell is
|
|
1497
|
-
// in error or in conflict.
|
|
1498
|
-
const started = startCall(changes, queue, { mode: 'cell' });
|
|
1499
|
-
if (started) {
|
|
1500
|
-
({ changes, queue } = started); // its cells are 'saving'
|
|
1501
|
-
const { call } = started;
|
|
1502
|
-
const controller = new AbortController();
|
|
1503
|
-
try {
|
|
1504
|
-
const answer = await onSave(call.entries, controller.signal);
|
|
1505
|
-
// Versions per row (no getCellVersion): the row's other changes move too.
|
|
1506
|
-
({ changes, queue } = applyAnswer(changes, queue, call.id, answer, Date.now(), { versionScope: 'row' }));
|
|
1507
|
-
} catch {
|
|
1508
|
-
({ changes, queue } = controller.signal.aborted
|
|
1509
|
-
? applyAbort(changes, queue, call.id) // no failure counted
|
|
1510
|
-
: applyFailure(changes, queue, call.id)); // paused after 3: retry(queue)
|
|
1511
|
-
}
|
|
1512
|
-
}
|
|
1513
|
-
changes = expireSaved(changes, Date.now()); // 1.5s later: the "saved" mark goes
|
|
1514
|
-
```
|
|
1515
|
-
|
|
1516
|
-
- **`versions[i]` is entry `i`'s.** It becomes the cell's new `baseVersion`
|
|
1517
|
-
(every changed cell of the row, in row mode; with `versionScope: 'row'`,
|
|
1518
|
-
the row's other changes still on the old version too). Without one, the
|
|
1519
|
-
version the cell was read at stays, and the next `rebase` adopts the
|
|
1520
|
-
row's: a cell whose value is still its base never conflicts.
|
|
1521
|
-
- **A refusal saves nothing.** `{ ok: false, refused }` names entries by index:
|
|
1522
|
-
an `error` flags its cell, a `conflict` opens one (`resolveConflict(changes,
|
|
1523
|
-
key, 'theirs' | 'mine')`), and every other cell goes back to dirty, to be
|
|
1524
|
-
sent again. A cell edited during the call stays dirty either way. A
|
|
1525
|
-
refusal naming no cell sent is counted in `outcome.unmatched`.
|
|
1526
|
-
- **A saved value stays until the rows hold it.** It is kept as an overlay
|
|
1527
|
-
(status `'clean'` once the mark expires), as "Keep theirs" is, so the cell
|
|
1528
|
-
never flashes back to stale data. The version a save or a conflict
|
|
1529
|
-
replaced is kept as `staleVersion`: a refetch that still reads at it is
|
|
1530
|
-
older than the grid and changes nothing, and `rebase` drops the overlay
|
|
1531
|
-
once the refetched rows hold the value.
|
|
1532
|
-
- **A refetch is a `rebase`.** It compares cell versions when `getCellVersion`
|
|
1533
|
-
is given, else the row's; a pending edit whose version and value moved
|
|
1534
|
-
becomes a conflict, and a conflict outlives any edit until it is resolved.
|
|
1535
|
-
|
|
1536
|
-
```ts
|
|
1537
|
-
import {
|
|
1538
|
-
aggregate,
|
|
1539
|
-
buildGridModel,
|
|
1540
|
-
conflictValues,
|
|
1541
|
-
EMPTY_HISTORY,
|
|
1542
|
-
type GridCellKey,
|
|
1543
|
-
type GridNumberCodeValue,
|
|
1544
|
-
NO_CHANGES,
|
|
1545
|
-
numberCodes,
|
|
1546
|
-
parseTsv,
|
|
1547
|
-
planPaste,
|
|
1548
|
-
splitCellKey,
|
|
1549
|
-
undo,
|
|
1550
|
-
} from '@nxgt/material-core/data-grid';
|
|
1551
|
-
|
|
1552
|
-
const changes = NO_CHANGES; // the grid's changes
|
|
1553
|
-
const rows = new Map([['ada', { maths: 12 as GridNumberCodeValue }]]);
|
|
1554
|
-
const model = buildGridModel({
|
|
1555
|
-
columns: [{ id: 'maths', label: 'Maths', editor: 'number' }],
|
|
1556
|
-
rows: [{ id: 'ada' }],
|
|
1557
|
-
});
|
|
1558
|
-
const grades = numberCodes({ min: 0, max: 20, decimals: 2 });
|
|
1559
|
-
const [lang, locale] = ['fr', 'fr-FR'];
|
|
1560
|
-
const valueInRows = (key: GridCellKey) => {
|
|
1561
|
-
const { rowId } = splitCellKey(key);
|
|
1562
|
-
return rows.get(rowId)?.maths;
|
|
1563
|
-
};
|
|
1564
|
-
|
|
1565
|
-
// Undo is a new edit: send each of `undone.edits` through editCell; `skipped` cells changed since.
|
|
1566
|
-
const undone = undo(EMPTY_HISTORY, (key) => changes[key]?.value ?? valueInRows(key)); // null: nothing to undo
|
|
1567
|
-
|
|
1568
|
-
// A paste is all or nothing, at the matrix's own size: { ok: true, edits, range } or { ok: false, problems }.
|
|
1569
|
-
const plan = planPaste({
|
|
1570
|
-
matrix: parseTsv('14\r\n'),
|
|
1571
|
-
anchor: { row: 0, col: 0 },
|
|
1572
|
-
model,
|
|
1573
|
-
parse: (text) => grades.parse(text, { lang, row: undefined }),
|
|
1574
|
-
});
|
|
1575
|
-
|
|
1576
|
-
// Totals over numbers only: codes and empty cells are skipped.
|
|
1577
|
-
aggregate('mean', [12, 'ABS', null, 14]); // 13; aggregate('count', []) is 0
|
|
1578
|
-
|
|
1579
|
-
// The conflict panel's two values, formatted with the column's own format; a cleared one is "Cleared".
|
|
1580
|
-
conflictValues({
|
|
1581
|
-
theirs: null,
|
|
1582
|
-
yours: 12.5,
|
|
1583
|
-
format: (value) => grades.format(value as GridNumberCodeValue, { lang, locale }),
|
|
1584
|
-
}); // { theirs: Cleared, yours: "12,5" }
|
|
1585
|
-
```
|
|
1586
|
-
|
|
1587
|
-
### A typed number: `/parse-number`
|
|
1588
|
-
|
|
1589
|
-
A number typed with `,` or `.` as its decimal separator, the decimals it was
|
|
1590
|
-
typed with, and the clamp and step behind `NumberField` and the data grid's
|
|
1591
|
-
number editor.
|
|
1592
|
-
|
|
1593
|
-
```ts
|
|
1594
|
-
import { clampNumber, decimalsTyped, parseNumberInput, stepNumber } from '@nxgt/material-core/parse-number';
|
|
1595
|
-
|
|
1596
|
-
parseNumberInput('12,5'); // 12.5
|
|
1597
|
-
parseNumberInput('1 234,5'); // 1234.5: the last of `,` and `.` is the decimal separator
|
|
1598
|
-
parseNumberInput('-'); // null: empty or incomplete
|
|
1599
|
-
decimalsTyped('12,50'); // 2: a trailing zero is what the user typed
|
|
1600
|
-
clampNumber(15, 0, 10); // 10: `min` and `max` are each optional
|
|
1601
|
-
stepNumber(1.1, 1, 0.1); // 1.2: no float drift
|
|
1602
|
-
stepNumber(null, -1, 1, 0); // 0: empty starts at 0, then is clamped
|
|
1603
|
-
```
|
|
1604
|
-
|
|
1605
1385
|
## Traps
|
|
1606
1386
|
|
|
1607
1387
|
| Symptom | Fix |
|
package/dist/lib/text-match.js
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// src/lib/text-match.ts
|
|
2
|
+
var DIACRITICS = /[̀-ͯ]/g;
|
|
3
|
+
function foldText(text, locale) {
|
|
4
|
+
return lowercase(text, locale).normalize("NFD").replace(DIACRITICS, "");
|
|
5
|
+
}
|
|
6
|
+
function lowercase(text, locale) {
|
|
7
|
+
try {
|
|
8
|
+
return text.toLocaleLowerCase(locale);
|
|
9
|
+
} catch {
|
|
10
|
+
return text.toLocaleLowerCase();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function matchesText(text, query, locale) {
|
|
14
|
+
const needle = foldText(query.trim(), locale);
|
|
15
|
+
if (!needle)
|
|
16
|
+
return true;
|
|
17
|
+
return foldText(text, locale).includes(needle);
|
|
18
|
+
}
|
|
5
19
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
20
|
+
foldText,
|
|
21
|
+
matchesText
|
|
8
22
|
};
|
|
9
23
|
|
|
10
|
-
//# debugId=
|
|
24
|
+
//# debugId=FCBE43FC1537D3D864756E2164756E21
|
|
11
25
|
//# sourceMappingURL=text-match.js.map
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
3
|
+
"sources": ["../src/lib/text-match.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
+
"/**\n * Accent- and case-insensitive text matching, for a list filtered as the user\n * types: `'e'` finds \"École\", `'ecole'` finds \"ÉCOLE\".\n */\n\n/** Combining diacritical marks, which `normalize('NFD')` splits from their letter. */\nconst DIACRITICS = /[̀-ͯ]/g;\n\n/**\n * `text` lowercased for `locale` (the runtime's when omitted), then without\n * its diacritics: `foldText('Élève')` is `'eleve'`. Lowercasing comes first,\n * so a Turkish `'İ'` (`'tr'`) folds to `'i'` rather than keeping a dot.\n */\nexport function foldText(text: string, locale?: string): string {\n\treturn lowercase(text, locale).normalize('NFD').replace(DIACRITICS, '');\n}\n\nfunction lowercase(text: string, locale?: string): string {\n\ttry {\n\t\treturn text.toLocaleLowerCase(locale);\n\t} catch {\n\t\t// An invalid language tag: the runtime's own rules, never a throw.\n\t\treturn text.toLocaleLowerCase();\n\t}\n}\n\n/**\n * Whether `query` occurs in `text`, ignoring case and accents. A query of\n * spaces only matches everything, as an empty one does.\n */\nexport function matchesText(\n\ttext: string,\n\tquery: string,\n\tlocale?: string,\n): boolean {\n\tconst needle = foldText(query.trim(), locale);\n\tif (!needle) return true;\n\treturn foldText(text, locale).includes(needle);\n}\n"
|
|
5
6
|
],
|
|
6
|
-
"mappings": "",
|
|
7
|
-
"debugId": "
|
|
7
|
+
"mappings": ";AAMA,IAAM,aAAa;AAOZ,SAAS,QAAQ,CAAC,MAAc,QAAyB;AAAA,EAC/D,OAAO,UAAU,MAAM,MAAM,EAAE,UAAU,KAAK,EAAE,QAAQ,YAAY,EAAE;AAAA;AAGvE,SAAS,SAAS,CAAC,MAAc,QAAyB;AAAA,EACzD,IAAI;AAAA,IACH,OAAO,KAAK,kBAAkB,MAAM;AAAA,IACnC,MAAM;AAAA,IAEP,OAAO,KAAK,kBAAkB;AAAA;AAAA;AAQzB,SAAS,WAAW,CAC1B,MACA,OACA,QACU;AAAA,EACV,MAAM,SAAS,SAAS,MAAM,KAAK,GAAG,MAAM;AAAA,EAC5C,IAAI,CAAC;AAAA,IAAQ,OAAO;AAAA,EACpB,OAAO,SAAS,MAAM,MAAM,EAAE,SAAS,MAAM;AAAA;",
|
|
8
|
+
"debugId": "FCBE43FC1537D3D864756E2164756E21",
|
|
8
9
|
"names": []
|
|
9
10
|
}
|
|
@@ -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,gBAAgB,CAAC;AAC/B,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,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
|
package/dist/pdf-viewer/index.js
CHANGED
|
@@ -140,6 +140,78 @@ function hitAt(counts, index) {
|
|
|
140
140
|
}
|
|
141
141
|
return null;
|
|
142
142
|
}
|
|
143
|
+
// src/pdf-viewer/pdf-link-labels.ts
|
|
144
|
+
var GENERATED = /^go to page \d+$/i;
|
|
145
|
+
function linkAnnotationLabel(target, labels) {
|
|
146
|
+
const url = target.url?.trim();
|
|
147
|
+
const page = target.page && target.page > 0 ? target.page : undefined;
|
|
148
|
+
let title = target.title?.trim();
|
|
149
|
+
if (title && (title === labels.goToPage(page ?? 0) || GENERATED.test(title))) {
|
|
150
|
+
title = undefined;
|
|
151
|
+
}
|
|
152
|
+
if (title) {
|
|
153
|
+
return !url && page ? labels.goToPageTitled(page, title) : title;
|
|
154
|
+
}
|
|
155
|
+
if (url)
|
|
156
|
+
return labels.external(hostOf(url));
|
|
157
|
+
if (page)
|
|
158
|
+
return labels.goToPage(page);
|
|
159
|
+
return labels.internal;
|
|
160
|
+
}
|
|
161
|
+
function hostOf(url) {
|
|
162
|
+
try {
|
|
163
|
+
return new URL(url).host || url;
|
|
164
|
+
} catch {
|
|
165
|
+
return url;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function isRef(value) {
|
|
169
|
+
return typeof value === "object" && value !== null && typeof value.num === "number" && typeof value.gen === "number";
|
|
170
|
+
}
|
|
171
|
+
async function resolveDestinationPage(pdf, dest) {
|
|
172
|
+
if (!pdf || dest == null)
|
|
173
|
+
return;
|
|
174
|
+
try {
|
|
175
|
+
const explicit = typeof dest === "string" ? await pdf.getDestination(dest) : dest;
|
|
176
|
+
if (!Array.isArray(explicit))
|
|
177
|
+
return;
|
|
178
|
+
const target = explicit[0];
|
|
179
|
+
if (typeof target === "number")
|
|
180
|
+
return target + 1;
|
|
181
|
+
if (!isRef(target))
|
|
182
|
+
return;
|
|
183
|
+
return await pdf.getPageIndex(target) + 1;
|
|
184
|
+
} catch {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
var MARK = "data-nxgt-link-label";
|
|
189
|
+
var pending = new WeakMap;
|
|
190
|
+
async function labelLinkAnchors(layer, find, pageOf, labels) {
|
|
191
|
+
const anchors = [
|
|
192
|
+
...layer?.querySelectorAll(".annotationLayer a") ?? []
|
|
193
|
+
].filter((a) => !a.textContent?.trim() && (!a.hasAttribute("aria-label") || a.hasAttribute(MARK)) && pending.get(a) !== labels);
|
|
194
|
+
await Promise.all(anchors.map(async (anchor) => {
|
|
195
|
+
pending.set(anchor, labels);
|
|
196
|
+
try {
|
|
197
|
+
const raw = anchor.getAttribute("data-element-id") ?? anchor.parentElement?.getAttribute("data-annotation-id");
|
|
198
|
+
const annotation = raw ? find(raw) : undefined;
|
|
199
|
+
const href = anchor.getAttribute("href") ?? "";
|
|
200
|
+
const url = annotation?.url ?? (/^[a-z][a-z0-9+.-]*:/i.test(href) ? href : "");
|
|
201
|
+
const page = url ? undefined : await pageOf(annotation?.dest);
|
|
202
|
+
if (pending.get(anchor) !== labels)
|
|
203
|
+
return;
|
|
204
|
+
if (anchor.hasAttribute("aria-label") && !anchor.hasAttribute(MARK)) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
anchor.setAttribute("aria-label", linkAnnotationLabel({ url, page, title: anchor.getAttribute("title") }, labels));
|
|
208
|
+
anchor.setAttribute(MARK, "");
|
|
209
|
+
} finally {
|
|
210
|
+
if (pending.get(anchor) === labels)
|
|
211
|
+
pending.delete(anchor);
|
|
212
|
+
}
|
|
213
|
+
}));
|
|
214
|
+
}
|
|
143
215
|
// src/pdf-viewer/pdf-page-geometry.ts
|
|
144
216
|
var DEFAULT_PAGE_SIZE = { width: 612, height: 792 };
|
|
145
217
|
var FIT_PAGES = 25;
|
|
@@ -434,7 +506,9 @@ export {
|
|
|
434
506
|
fitScale,
|
|
435
507
|
highlightItemHtml,
|
|
436
508
|
hitAt,
|
|
509
|
+
labelLinkAnchors,
|
|
437
510
|
largestPage,
|
|
511
|
+
linkAnnotationLabel,
|
|
438
512
|
loadPageText,
|
|
439
513
|
mapPdfOutline,
|
|
440
514
|
mostVisiblePage,
|
|
@@ -446,6 +520,7 @@ export {
|
|
|
446
520
|
placeholderSize,
|
|
447
521
|
readPageSizes,
|
|
448
522
|
readerFitScale,
|
|
523
|
+
resolveDestinationPage,
|
|
449
524
|
revealHit,
|
|
450
525
|
rotatedSize,
|
|
451
526
|
scrollIntoArea,
|
|
@@ -454,5 +529,5 @@ export {
|
|
|
454
529
|
withPageMatches
|
|
455
530
|
};
|
|
456
531
|
|
|
457
|
-
//# debugId=
|
|
532
|
+
//# debugId=199CD1F5425F572A64756E2164756E21
|
|
458
533
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,11 @@
|
|
|
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-user-input.ts", "../src/pdf-viewer/pdf-scroll-spy.ts", "../src/pdf-viewer/pdf-pin-page.ts", "../src/pdf-viewer/pdf-reveal-hit.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-link-labels.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", "../src/pdf-viewer/pdf-reveal-hit.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
|
+
"/** The words a link anchor is named with, already translated. */\nexport type PdfLinkLabels = {\n\t/** An external link: `host` is the address's host, or the whole address. */\n\texternal: (host: string) => string;\n\t/** An internal link whose page is known. */\n\tgoToPage: (page: number) => string;\n\t/** An internal link whose destination cannot be resolved. */\n\tinternal: string;\n\t/** An internal link on a known page that has a title of its own. */\n\tgoToPageTitled: (page: number, title: string) => string;\n};\n\n/** A pdf.js object reference (`PDFDocumentProxy.getPageIndex` takes one). */\nexport type PdfRef = { num: number; gen: number };\n\n/** The part of a pdf.js link annotation a label needs. */\nexport type PdfLinkAnnotation = { url?: string; dest?: unknown };\n\n/** The part of a pdf.js document that tells where a destination lands. */\nexport type PdfDestinationDocument = {\n\tgetDestination: (name: string) => Promise<unknown[] | null>;\n\tgetPageIndex: (ref: PdfRef) => Promise<number>;\n};\n\n/** The title pdf.js gives an internal link itself. */\nconst GENERATED = /^go to page \\d+$/i;\n\n/**\n * The accessible name of a link annotation's anchor: \"Link: example.com\" for\n * an external address, \"Go to page 3\" for an internal destination on a known\n * page, else a generic one. A link's own `title` (pdf.js sets one from the\n * text it covers or the attachment's description) is kept as the name; an\n * internal link on a known page adds the page before it. Pure: no DOM, no pdf.js.\n */\nexport function linkAnnotationLabel(\n\ttarget: { url?: string | null; page?: number; title?: string | null },\n\tlabels: PdfLinkLabels,\n): string {\n\tconst url = target.url?.trim();\n\tconst page = target.page && target.page > 0 ? target.page : undefined;\n\tlet title = target.title?.trim();\n\t// pdf.js titles an internal link \"Go to page 3\" itself: that is the name,\n\t// not a text of the document to put after it.\n\tif (\n\t\ttitle &&\n\t\t(title === labels.goToPage(page ?? 0) || GENERATED.test(title))\n\t) {\n\t\ttitle = undefined;\n\t}\n\tif (title) {\n\t\treturn !url && page ? labels.goToPageTitled(page, title) : title;\n\t}\n\tif (url) return labels.external(hostOf(url));\n\tif (page) return labels.goToPage(page);\n\treturn labels.internal;\n}\n\nfunction hostOf(url: string): string {\n\ttry {\n\t\treturn new URL(url).host || url;\n\t} catch {\n\t\treturn url;\n\t}\n}\n\nfunction isRef(value: unknown): value is PdfRef {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof (value as PdfRef).num === 'number' &&\n\t\ttypeof (value as PdfRef).gen === 'number'\n\t);\n}\n\n/**\n * The 1-based page a destination (an explicit `[ref, /XYZ, ...]` array or a\n * named destination) lands on, or `undefined` when it cannot be told.\n */\nexport async function resolveDestinationPage(\n\tpdf: PdfDestinationDocument | null | undefined,\n\tdest: unknown,\n): Promise<number | undefined> {\n\tif (!pdf || dest == null) return undefined;\n\ttry {\n\t\tconst explicit =\n\t\t\ttypeof dest === 'string' ? await pdf.getDestination(dest) : dest;\n\t\tif (!Array.isArray(explicit)) return undefined;\n\t\tconst target = explicit[0];\n\t\tif (typeof target === 'number') return target + 1;\n\t\tif (!isRef(target)) return undefined;\n\t\treturn (await pdf.getPageIndex(target)) + 1;\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\n/** The few DOM members used, so a test needs no DOM. */\nexport type PdfLinkAnchor = {\n\ttextContent: string | null;\n\tparentElement: { getAttribute: (name: string) => string | null } | null;\n\thasAttribute: (name: string) => boolean;\n\tgetAttribute: (name: string) => string | null;\n\tsetAttribute: (name: string, value: string) => void;\n};\nexport type PdfLinkLayer = {\n\tquerySelectorAll: (selector: string) => Iterable<PdfLinkAnchor>;\n};\n\n/** Marks a name the reader set, so a language change can set it again. */\nconst MARK = 'data-nxgt-link-label';\n\n/** The labels each anchor is being named with, so a pending one is not asked twice. */\nconst pending = new WeakMap<object, PdfLinkLabels>();\n\n/**\n * Names every link anchor of `layer` (an annotation layer, or a page holding\n * one) that has no text: pdf.js draws them empty, so axe's `link-name` fails\n * and a screen reader says only \"link\". An `aria-label` the document or the\n * host set is left alone; one this function set is set again when `labels`\n * change (the language). `find` returns the annotation behind an id (the\n * anchor's `data-element-id`, else its section's `data-annotation-id`);\n * `pageOf` resolves its destination.\n */\nexport async function labelLinkAnchors(\n\tlayer: PdfLinkLayer | null | undefined,\n\tfind: (id: string) => PdfLinkAnnotation | undefined,\n\tpageOf: (dest: unknown) => Promise<number | undefined>,\n\tlabels: PdfLinkLabels,\n): Promise<void> {\n\tconst anchors = [\n\t\t...(layer?.querySelectorAll('.annotationLayer a') ?? []),\n\t].filter(\n\t\t(a) =>\n\t\t\t!a.textContent?.trim() &&\n\t\t\t(!a.hasAttribute('aria-label') || a.hasAttribute(MARK)) &&\n\t\t\tpending.get(a) !== labels,\n\t);\n\tawait Promise.all(\n\t\tanchors.map(async (anchor) => {\n\t\t\tpending.set(anchor, labels);\n\t\t\ttry {\n\t\t\t\tconst raw =\n\t\t\t\t\tanchor.getAttribute('data-element-id') ??\n\t\t\t\t\tanchor.parentElement?.getAttribute('data-annotation-id');\n\t\t\t\tconst annotation = raw ? find(raw) : undefined;\n\t\t\t\tconst href = anchor.getAttribute('href') ?? '';\n\t\t\t\tconst url =\n\t\t\t\t\tannotation?.url ?? (/^[a-z][a-z0-9+.-]*:/i.test(href) ? href : '');\n\t\t\t\tconst page = url ? undefined : await pageOf(annotation?.dest);\n\t\t\t\tif (pending.get(anchor) !== labels) return;\n\t\t\t\tif (anchor.hasAttribute('aria-label') && !anchor.hasAttribute(MARK)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tanchor.setAttribute(\n\t\t\t\t\t'aria-label',\n\t\t\t\t\tlinkAnnotationLabel(\n\t\t\t\t\t\t{ url, page, title: anchor.getAttribute('title') },\n\t\t\t\t\t\tlabels,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\tanchor.setAttribute(MARK, '');\n\t\t\t} finally {\n\t\t\t\tif (pending.get(anchor) === labels) pending.delete(anchor);\n\t\t\t}\n\t\t}),\n\t);\n}\n",
|
|
8
9
|
"/**\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
10
|
"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
11
|
"/** 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",
|
|
@@ -12,7 +13,7 @@
|
|
|
12
13
|
"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 *\n * It stops correcting once a scroll it did not make moved the view, up or\n * down (find in page, a screen reader's cursor, a `scrollTop`): `scrollTop`\n * is no longer the one its last correction left, and the page is off the\n * top. It does not let go then: the scroll spy reports that view\n * (`pinHolds` is false) and its owner unpins. The pages growing leave\n * `scrollTop` alone, and the browser anchoring it, or clamping it at the end\n * as the pages shrink, is not such a scroll. The pages must keep their room\n * while they draw: a page list that shrinks for a moment has its scroll\n * clamped up, which would read as such a scroll.\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\t// The `scrollTop` the placement, then each correction, left.\n\tlet placedTop = area.scrollTop;\n\tconst observer = new ResizeObserver(() => {\n\t\tconst target = node();\n\t\tif (!target) return;\n\t\tif (movedElsewhere(area, placedTop, target)) {\n\t\t\tobserver.disconnect();\n\t\t\treturn;\n\t\t}\n\t\tbeforeScroll();\n\t\tscrollIntoArea(target, 'start', 'auto');\n\t\tplacedTop = area.scrollTop;\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/** The area is at its end: it can scroll no further down. */\nconst atEnd = (area: Element) =>\n\tarea.scrollTop + area.clientHeight >= area.scrollHeight - 2;\n\n/**\n * Whether a scroll the pin did not make moved `area`, up or down, off\n * `node` since it left it at `placedTop`. Not the browser clamping it at the\n * end as the pages above shrink (at the end, above `placedTop`), nor\n * anchoring it on `node` as they grow (the page still at the top). The\n * pages of the libraries' readers keep their room while they draw, so no\n * clamp happens away from the end.\n */\nfunction movedElsewhere(area: Element, placedTop: number, node: Element) {\n\tif (Math.abs(area.scrollTop - placedTop) <= 2) return false;\n\tif (atEnd(area) && area.scrollTop < placedTop) return false;\n\treturn !pinHolds(node);\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 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(area) && offset >= -2) || Math.abs(offset) <= 2;\n}\n",
|
|
13
14
|
"import { scrollIntoArea } from './pdf-scroll-spy';\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"
|
|
14
15
|
],
|
|
15
|
-
"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,C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