@nxgt/material-core 0.13.2 → 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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @nxgt/material-core
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Minor Changes
6
+
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`.
8
+
3
9
  ## 0.13.2
4
10
 
5
11
  ### Patch Changes
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 |
@@ -387,6 +387,31 @@ no page is in view.
387
387
  const page = pageInView(area, pages); // 3
388
388
  ```
389
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
+
390
415
  ### A currency's decimals: `/currency-digits`
391
416
 
392
417
  ```ts
@@ -7,6 +7,7 @@
7
7
  */
8
8
  export * from './pdf-document-search';
9
9
  export * from './pdf-escape';
10
+ export * from './pdf-link-labels';
10
11
  export * from './pdf-page-geometry';
11
12
  export * from './pdf-page-sizes';
12
13
  export * from './pdf-pin-page';
@@ -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"}
@@ -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=16B77F33AD8699A864756E2164756E21
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, '&amp;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;')\n\t\t.replace(/\"/g, '&quot;')\n\t\t.replace(/'/g, '&#39;');\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,CAAC,OAA4C;AAAA,EAC7E,IAAI,OAAO;AAAA,EACX,MAAM,SAAmB,CAAC;AAAA,EAC1B,WAAW,QAAQ,OAAO;AAAA,IACzB,OAAO,KAAK,KAAK,MAAM;AAAA,IACvB,QAAQ,KAAK,OAAO;AAAA,IACpB,IAAI,KAAK;AAAA,MAAQ,QAAQ;AAAA;AAAA,EAC1B;AAAA,EACA,OAAO,EAAE,MAAM,OAAO;AAAA;AAQvB,SAAS,IAAI,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,IAAI,IAAI;AAAA,EAC3B,IAAI,QAAQ;AAAA,EACZ,MAAM,OAAO,MAAM;AAAA,IAClB,MAAM,OAAO,SAAS,GAAG,cAAc,kBAAkB,OAAO;AAAA,IAChE,IAAI,MAAM;AAAA,MACT,aAAa;AAAA,MACb,eAAe,MAAM,QAAQ;AAAA,MAC7B;AAAA,IACD;AAAA,IACA,IAAI,KAAK,IAAI,IAAI;AAAA,MAAO,QAAQ,sBAAsB,IAAI;AAAA;AAAA,EAG3D,QAAQ,sBAAsB,IAAI;AAAA,EAClC,OAAO,MAAM,qBAAqB,KAAK;AAAA;",
17
+ "debugId": "199CD1F5425F572A64756E2164756E21",
17
18
  "names": []
18
19
  }
@@ -0,0 +1,67 @@
1
+ /** The words a link anchor is named with, already translated. */
2
+ export type PdfLinkLabels = {
3
+ /** An external link: `host` is the address's host, or the whole address. */
4
+ external: (host: string) => string;
5
+ /** An internal link whose page is known. */
6
+ goToPage: (page: number) => string;
7
+ /** An internal link whose destination cannot be resolved. */
8
+ internal: string;
9
+ /** An internal link on a known page that has a title of its own. */
10
+ goToPageTitled: (page: number, title: string) => string;
11
+ };
12
+ /** A pdf.js object reference (`PDFDocumentProxy.getPageIndex` takes one). */
13
+ export type PdfRef = {
14
+ num: number;
15
+ gen: number;
16
+ };
17
+ /** The part of a pdf.js link annotation a label needs. */
18
+ export type PdfLinkAnnotation = {
19
+ url?: string;
20
+ dest?: unknown;
21
+ };
22
+ /** The part of a pdf.js document that tells where a destination lands. */
23
+ export type PdfDestinationDocument = {
24
+ getDestination: (name: string) => Promise<unknown[] | null>;
25
+ getPageIndex: (ref: PdfRef) => Promise<number>;
26
+ };
27
+ /**
28
+ * The accessible name of a link annotation's anchor: "Link: example.com" for
29
+ * an external address, "Go to page 3" for an internal destination on a known
30
+ * page, else a generic one. A link's own `title` (pdf.js sets one from the
31
+ * text it covers or the attachment's description) is kept as the name; an
32
+ * internal link on a known page adds the page before it. Pure: no DOM, no pdf.js.
33
+ */
34
+ export declare function linkAnnotationLabel(target: {
35
+ url?: string | null;
36
+ page?: number;
37
+ title?: string | null;
38
+ }, labels: PdfLinkLabels): string;
39
+ /**
40
+ * The 1-based page a destination (an explicit `[ref, /XYZ, ...]` array or a
41
+ * named destination) lands on, or `undefined` when it cannot be told.
42
+ */
43
+ export declare function resolveDestinationPage(pdf: PdfDestinationDocument | null | undefined, dest: unknown): Promise<number | undefined>;
44
+ /** The few DOM members used, so a test needs no DOM. */
45
+ export type PdfLinkAnchor = {
46
+ textContent: string | null;
47
+ parentElement: {
48
+ getAttribute: (name: string) => string | null;
49
+ } | null;
50
+ hasAttribute: (name: string) => boolean;
51
+ getAttribute: (name: string) => string | null;
52
+ setAttribute: (name: string, value: string) => void;
53
+ };
54
+ export type PdfLinkLayer = {
55
+ querySelectorAll: (selector: string) => Iterable<PdfLinkAnchor>;
56
+ };
57
+ /**
58
+ * Names every link anchor of `layer` (an annotation layer, or a page holding
59
+ * one) that has no text: pdf.js draws them empty, so axe's `link-name` fails
60
+ * and a screen reader says only "link". An `aria-label` the document or the
61
+ * host set is left alone; one this function set is set again when `labels`
62
+ * change (the language). `find` returns the annotation behind an id (the
63
+ * anchor's `data-element-id`, else its section's `data-annotation-id`);
64
+ * `pageOf` resolves its destination.
65
+ */
66
+ export declare function labelLinkAnchors(layer: PdfLinkLayer | null | undefined, find: (id: string) => PdfLinkAnnotation | undefined, pageOf: (dest: unknown) => Promise<number | undefined>, labels: PdfLinkLabels): Promise<void>;
67
+ //# sourceMappingURL=pdf-link-labels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdf-link-labels.d.ts","sourceRoot":"","sources":["../../src/pdf-viewer/pdf-link-labels.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,MAAM,aAAa,GAAG;IAC3B,4EAA4E;IAC5E,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACnC,4CAA4C;IAC5C,QAAQ,EAAE,CAAC,IAAI,EAAE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,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAC;IACxE,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACxC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;IAC9C,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD,CAAC;AACF,MAAM,MAAM,YAAY,GAAG;IAC1B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,QAAQ,CAAC,aAAa,CAAC,CAAC;CAChE,CAAC;AAQF;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CACrC,KAAK,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,EACtC,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,iBAAiB,GAAG,SAAS,EACnD,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,EACtD,MAAM,EAAE,aAAa,GACnB,OAAO,CAAC,IAAI,CAAC,CAsCf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material-core",
3
- "version": "0.13.2",
3
+ "version": "0.14.0",
4
4
  "description": "The framework-free core of @nxgt/material and @nxgt/material-vue: the PDF document model and its react-pdf renderer, print formatters, PDF file helpers, the PDF viewer's pure modules, the currency digits, the file-size formatter, the field-blur layers, a field's first focusable control, a repeatable row group's focus and announcement rules, the aria-describedby joiner, the inert background of a modal layer, Escape forwarded while an overlay closes and kept for a field's open list, the Toaster's touch-hover guard and its focus hand-back, the page's Content Security Policy nonce, the server and build side of the CSP (a nonce per request, the policy header, hashes, zod's jitless script), an object built on first use, the zod issue messages, the date range presets, the debounce, accent-insensitive text matching and the race-free async search behind Autocomplete and SearchField, the submit guard, the code error map, an avatar's initials, the two-factor helpers (a grouped TOTP secret, the recovery codes' file, a text download), the empty and error states' kinds, copy keys, error details and illustration geometry, printing one element of the page, the file preview's kind detection and text reader, the background presets' engine (a seeded generator, scattering, motif shapes, a safe SVG scene format, the activity observer), the pdfkit fonts Vite plugin, the nxgtMaterial() Vite plugin (a strict CSP by hash or nonce, fonts, a styles check), a CSP-safe Vite assetsInlineLimit and the Node-only pdfkit fonts resolution for Next.js and Nuxt builds",
5
5
  "license": "MIT",
6
6
  "bugs": {