@nxgt/material-core 0.13.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @nxgt/material-core
2
2
 
3
+ ## 0.13.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#734](https://github.com/softistx/nxgt-material/pull/734) [`6b0e2ba`](https://github.com/softistx/nxgt-material/commit/6b0e2ba696c62b3d3b3552453dead94e1c7bf3fd) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `pinToPage` makes no further correction once a scroll it did not make (find in page, a screen reader's cursor, a `scrollTop`) moved the view down: a second correction within the same scroll-spy hold no longer scrolls back to the opening page, so `PdfReader` reports that scroll and lets go ([#678](https://github.com/softistx/nxgt-material/issues/678)). Scroll anchoring is not taken for such a scroll; a scroll up is lost if the pages change size again within the hold, as it looks like the browser clamping the scroll while a page redraws.
8
+
3
9
  ## 0.13.0
4
10
 
5
11
  ### Minor Changes
package/README.md CHANGED
@@ -339,8 +339,15 @@ ignores it: give `createScrollSpy` the option `readerPosition`, which says
339
339
  whether the view is still where the reader put it, and the spy measures once,
340
340
  two frames after release (past a resize's correction), when a held scroll
341
341
  left it elsewhere. Its fourth argument is `{ idleMs?, readerPosition? }`; a
342
- bare number is still `idleMs`. Not covered: a second correction within the
343
- same hold puts the view back where the reader put it, and that scroll is lost.
342
+ bare number is still `idleMs`. Once such a scroll moved the view down, the
343
+ pin makes no further correction (it would scroll back to the page): it tells
344
+ a scroll it did not make by a `scrollTop` past the one its last correction
345
+ left, with the page off the top; the browser anchoring the scroll on the page
346
+ is not taken for one. It does not let go itself then, and `onRelease` does
347
+ not run: call the function it returned once your spy reports the view. A
348
+ scroll up is still corrected, and lost if a correction follows within the
349
+ hold: the browser clamping the scroll as the pages shrink, even for a moment,
350
+ looks the same.
344
351
 
345
352
  ```ts
346
353
  import {
@@ -365,12 +365,18 @@ function pinToPage(node, beforeScroll, onRelease = () => {}) {
365
365
  return () => {};
366
366
  }
367
367
  const surface = area.closest('[data-slot="scroll-area"]') ?? area;
368
+ let placedTop = area.scrollTop;
368
369
  const observer = new ResizeObserver(() => {
369
370
  const target = node();
370
371
  if (!target)
371
372
  return;
373
+ if (movedElsewhere(area, placedTop, target)) {
374
+ observer.disconnect();
375
+ return;
376
+ }
372
377
  beforeScroll();
373
378
  scrollIntoArea(target, "start", "auto");
379
+ placedTop = area.scrollTop;
374
380
  });
375
381
  observer.observe(content);
376
382
  let pinned = true;
@@ -385,6 +391,9 @@ function pinToPage(node, beforeScroll, onRelease = () => {}) {
385
391
  const stopListening = listenForUserInput(surface, unpin);
386
392
  return unpin;
387
393
  }
394
+ function movedElsewhere(area, placedTop, node) {
395
+ return area.scrollTop > placedTop + 2 && !pinHolds(node);
396
+ }
388
397
  function pinHolds(node) {
389
398
  const area = node?.closest(VIEWPORT);
390
399
  if (!node || !area)
@@ -441,5 +450,5 @@ export {
441
450
  withPageMatches
442
451
  };
443
452
 
444
- //# debugId=B919180681EC282C64756E2164756E21
453
+ //# debugId=6179B70E72FE3BCD64756E2164756E21
445
454
  //# sourceMappingURL=index.js.map
@@ -8,11 +8,11 @@
8
8
  "/**\n * How the reader sizes a page: to the viewport's width, to the whole page, or\n * at a zoom the user chose.\n */\nexport type FitMode = 'width' | 'page' | 'custom';\n\n/**\n * A page's size in PDF points (1/72 inch), before any rotation, and the\n * rotation the page asks for itself (its `/Rotate`, in degrees clockwise).\n */\nexport type PdfPageSize = { width: number; height: number; rotate?: number };\n\n/** Used until a page's own size is known: US Letter. */\nexport const DEFAULT_PAGE_SIZE: PdfPageSize = { width: 612, height: 792 };\n\n/**\n * The fit zoom fits the first pages only, the ones read when the document\n * opens: pages read later never move it. A wider page further on is shown at\n * that zoom (and scrolls sideways in fit width).\n */\nexport const FIT_PAGES = 25;\n\n/** Room kept around the pages: the list's padding on each side. */\nexport const PAGE_PADDING = 32;\n\n// The reader's own MIN_SCALE and MAX_SCALE; kept here so this file stays\n// shared.\nconst MIN_FIT_SCALE = 0.25;\nconst MAX_FIT_SCALE = 5;\n\n/**\n * The rotation a page is drawn at: its own `/Rotate` plus the reader's, from\n * 0 to 270. `undefined` while the page's own is not known and the reader adds\n * none, so the renderer keeps the page's. Once the reader turns the pages, a\n * page whose size is not read yet (past the first chunk) is drawn at the\n * reader's rotation alone until its size arrives, then drawn again.\n */\nexport function pageRotation(\n\tsize: PdfPageSize | undefined,\n\trotation: number,\n): number | undefined {\n\tif (!size && !rotation) return undefined;\n\tconst turn = (size?.rotate ?? 0) + rotation;\n\treturn ((turn % 360) + 360) % 360;\n}\n\n/** The page's size on screen: turned by its own `/Rotate` and `rotation`. */\nexport function rotatedSize(size: PdfPageSize, rotation: number): PdfPageSize {\n\tconst turn = (size.rotate ?? 0) + rotation;\n\tconst quarter = ((turn % 180) + 180) % 180 === 90;\n\treturn quarter\n\t\t? { width: size.height, height: size.width }\n\t\t: { width: size.width, height: size.height };\n}\n\n/**\n * The widest and the tallest of the known pages, rotated. Fitting on it keeps\n * every page inside the box with one scale, so the zoom does not jump while\n * scrolling from an A4 page to a landscape one.\n */\nexport function largestPage(\n\tsizes: readonly (PdfPageSize | undefined)[],\n\trotation: number,\n): PdfPageSize {\n\tlet width = 0;\n\tlet height = 0;\n\tfor (const size of sizes) {\n\t\tif (!size) continue;\n\t\tconst turned = rotatedSize(size, rotation);\n\t\twidth = Math.max(width, turned.width);\n\t\theight = Math.max(height, turned.height);\n\t}\n\treturn width && height\n\t\t? { width, height }\n\t\t: rotatedSize(DEFAULT_PAGE_SIZE, rotation);\n}\n\n/**\n * The scale at which the largest page fits the box's width, or all of it,\n * within the reader's zoom range: a tiny page does not fit to 4000%.\n */\nexport function fitScale(\n\tmode: Exclude<FitMode, 'custom'>,\n\tlargest: PdfPageSize,\n\tbox: { width: number; height: number },\n\tpadding = PAGE_PADDING,\n) {\n\tconst byWidth = (box.width - padding) / largest.width;\n\tconst scale =\n\t\tmode === 'width'\n\t\t\t? byWidth\n\t\t\t: Math.min(byWidth, (box.height - padding) / largest.height);\n\treturn Math.min(MAX_FIT_SCALE, Math.max(MIN_FIT_SCALE, scale));\n}\n\n/**\n * The reader's zoom in fit width or fit page: the largest of the first\n * `FIT_PAGES` pages, rotated, fitted to the box.\n */\nexport function readerFitScale(\n\tmode: Exclude<FitMode, 'custom'>,\n\tsizes: readonly (PdfPageSize | undefined)[],\n\trotation: number,\n\tbox: { width: number; height: number },\n) {\n\treturn fitScale(mode, largestPage(sizes.slice(0, FIT_PAGES), rotation), box);\n}\n\n/** Pixel size of a page's placeholder before it renders. */\nexport function placeholderSize(\n\tsize: PdfPageSize | undefined,\n\tscale: number,\n\trotation: number,\n) {\n\tconst turned = rotatedSize(size ?? DEFAULT_PAGE_SIZE, rotation);\n\treturn {\n\t\twidth: Math.round(turned.width * scale),\n\t\theight: Math.round(turned.height * scale),\n\t};\n}\n",
9
9
  "import { FIT_PAGES, type PdfPageSize } from './pdf-page-geometry';\n\ntype SizedPage = {\n\t/** The page's own `/Rotate`, in degrees (pdf.js `PDFPageProxy.rotate`). */\n\trotate?: number;\n\tgetViewport: (options: { scale: number; rotation: number }) => {\n\t\twidth: number;\n\t\theight: number;\n\t};\n};\n\nexport type PdfSizedDocument = {\n\tnumPages: number;\n\tgetPage: (pageNumber: number) => Promise<SizedPage>;\n};\n\n/** What a load handler receives: `getPage` is optional for older callers. */\nexport type PdfLoadedDocument = Pick<PdfSizedDocument, 'numPages'> &\n\tPartial<Pick<PdfSizedDocument, 'getPage'>>;\n\n/**\n * Reads every page's size, unrotated, and its own `/Rotate`, `chunk` pages\n * at a time (at most `chunk` page objects asked for at once): the first chunk\n * at once, the rest in the background. `onSizes` gets the list known so far\n * after each chunk; the first report holds the pages the fit zoom is computed\n * from (`FIT_PAGES`), so later chunks never move it. `isCancelled` stops the\n * reading when the document changed.\n */\nexport async function readPageSizes(\n\tpdf: PdfSizedDocument,\n\tonSizes: (sizes: PdfPageSize[]) => void,\n\tisCancelled: () => boolean = () => false,\n\tchunk = FIT_PAGES,\n) {\n\tconst sizes: PdfPageSize[] = [];\n\tfor (let next = 1; next <= pdf.numPages; next += chunk) {\n\t\tconst last = Math.min(pdf.numPages, next + chunk - 1);\n\t\tconst pages = await Promise.all(\n\t\t\tArray.from({ length: last - next + 1 }, (_, index) =>\n\t\t\t\tpdf.getPage(next + index),\n\t\t\t),\n\t\t);\n\t\tif (isCancelled()) return;\n\t\tfor (const page of pages) {\n\t\t\tconst { width, height } = page.getViewport({ scale: 1, rotation: 0 });\n\t\t\tconst rotate = (((page.rotate ?? 0) % 360) + 360) % 360;\n\t\t\tsizes.push(rotate ? { width, height, rotate } : { width, height });\n\t\t}\n\t\tonSizes([...sizes]);\n\t}\n}\n\n/**\n * Reads the sizes of the document last loaded. `reset` forgets it when the\n * file changes, so sizes still arriving for it never land. A document\n * without `getPage` keeps the fallback size.\n */\nexport function createPageSizesLoader(onSizes: (sizes: PdfPageSize[]) => void) {\n\tlet generation = 0;\n\treturn {\n\t\treset() {\n\t\t\tgeneration += 1;\n\t\t},\n\t\tload(pdf: PdfLoadedDocument) {\n\t\t\tgeneration += 1;\n\t\t\tif (!pdf.getPage) return Promise.resolve();\n\t\t\tconst current = generation;\n\t\t\t// pdf.js reads `this` in getPage: pass the document itself.\n\t\t\treturn readPageSizes(\n\t\t\t\tpdf as PdfSizedDocument,\n\t\t\t\tonSizes,\n\t\t\t\t() => current !== generation,\n\t\t\t).catch(() => {\n\t\t\t\t/* a page failed or the document was destroyed: the rest keep the\n\t\t\t\t fallback size */\n\t\t\t});\n\t\t},\n\t};\n}\n",
10
10
  "/** What the user does to scroll a page area themselves. */\nconst USER_SCROLL_EVENTS = [\n\t'wheel',\n\t'touchstart',\n\t'pointerdown',\n\t'keydown',\n] as const;\n\n/**\n * Runs `run` on each wheel, touch, pointer or key event that reaches\n * `target`, in the capture phase. Returns a function that stops listening.\n * Internal: not re-exported from the subpath.\n */\nexport function listenForUserInput(\n\ttarget: EventTarget,\n\trun: (event: Event) => void,\n) {\n\tfor (const type of USER_SCROLL_EVENTS) {\n\t\ttarget.addEventListener(type, run, { capture: true, passive: true });\n\t}\n\treturn () => {\n\t\tfor (const type of USER_SCROLL_EVENTS) {\n\t\t\ttarget.removeEventListener(type, run, { capture: true });\n\t\t}\n\t};\n}\n",
11
- "import { listenForUserInput } from './pdf-user-input';\n\n/** A vertical extent on screen, as `getBoundingClientRect` gives it. */\nexport type PdfBox = { top: number; bottom: number };\n\n/**\n * The page with the most of itself on screen, the first one on a tie; once\n * scrolled to the end, the last page on screen, however little of it shows.\n */\nexport function mostVisiblePage(\n\tview: PdfBox & { atEnd: boolean },\n\tpages: Iterable<readonly [number, PdfBox]>,\n): number | null {\n\tlet best: number | null = null;\n\tlet bestSeen = 0;\n\tlet last: number | null = null;\n\tfor (const [page, box] of pages) {\n\t\tconst seen =\n\t\t\tMath.min(box.bottom, view.bottom) - Math.max(box.top, view.top);\n\t\tif (seen <= 0) continue;\n\t\tif (last === null || page > last) last = page;\n\t\tif (\n\t\t\tseen > bestSeen ||\n\t\t\t(seen === bestSeen && best !== null && page < best)\n\t\t) {\n\t\t\tbest = page;\n\t\t\tbestSeen = seen;\n\t\t}\n\t}\n\treturn view.atEnd && last !== null ? last : best;\n}\n\n/**\n * Scrolls the page area around `node`, and nothing else: `scrollIntoView`\n * would scroll the host page too. `block` puts `node` at the area's top or\n * centre.\n */\nexport function scrollIntoArea(\n\tnode: Element,\n\tblock: 'start' | 'center',\n\tbehavior: ScrollBehavior = 'smooth',\n) {\n\tconst area = node.closest<HTMLElement>('[data-slot=\"scroll-area-viewport\"]');\n\tif (!area) return;\n\tconst box = node.getBoundingClientRect();\n\tconst view = area.getBoundingClientRect();\n\tlet top = area.scrollTop + box.top - view.top;\n\tif (block === 'center') top -= (view.height - box.height) / 2;\n\tarea.scrollTo({ top: Math.max(0, top), behavior });\n}\n\n/** The page most on screen in `scroller`, as `mostVisiblePage` picks it. */\nexport function pageInView(\n\tscroller: HTMLElement,\n\tpages: ReadonlyMap<number, HTMLElement>,\n) {\n\tconst view = scroller.getBoundingClientRect();\n\tconst atEnd =\n\t\tscroller.scrollTop + scroller.clientHeight >= scroller.scrollHeight - 2;\n\tconst boxes = Array.from(pages, ([page, node]) => {\n\t\tconst { top, bottom } = node.getBoundingClientRect();\n\t\treturn [page, { top, bottom }] as const;\n\t});\n\treturn mostVisiblePage({ top: view.top, bottom: view.bottom, atEnd }, boxes);\n}\n\n/** `createScrollSpy`'s options; a bare number is `idleMs`. */\nexport type ScrollSpyOptions = {\n\t/** How long scrolling must stop before a hold ends (150 ms). */\n\tidleMs?: number;\n\t/** Whether the view is still where the reader put it (always, by default). */\n\treaderPosition?: () => boolean;\n};\n\nconst spyOptions = (options: number | ScrollSpyOptions) =>\n\ttypeof options === 'number' ? { idleMs: options } : options;\n\n/**\n * Scroll events do not bubble: listens in the capture phase, on the\n * document, as the page area may be rendered again under the reader. Plain\n * DOM rather than react-use or VueUse: this file is shared.\n */\nfunction listenForScroll(onScroll: (event: Event) => void) {\n\tdocument.addEventListener('scroll', onScroll, {\n\t\tcapture: true,\n\t\tpassive: true,\n\t});\n\treturn () =>\n\t\tdocument.removeEventListener('scroll', onScroll, { capture: true });\n}\n\n/**\n * Runs `run` on the second frame from now, after the ResizeObserver\n * callbacks of the first. Returns a function that cancels it.\n */\nfunction afterResize(run: () => void) {\n\tlet id = requestAnimationFrame(() => {\n\t\tid = requestAnimationFrame(run);\n\t});\n\treturn () => cancelAnimationFrame(id);\n}\n\n/**\n * Reports the page most on screen as the reader's page area (`root`)\n * scrolls. `hold`\n * ignores scrolling until it has stopped for `idleMs`: the reader calls it\n * before scrolling to a page itself, so the pages it passes on the way are\n * not reported. What the user does in the page area (wheel, touch, pointer,\n * key) ends a hold: the scrolling after it is theirs, and a scroll the hold\n * ignored is measured.\n *\n * `readerPosition` says whether the view is still where the reader put it.\n * When the area scrolled during a hold and, two frames after release (once\n * a resize has had its correction), it is not (a scroll with no input\n * landed within the hold: find in page, a screen reader, a `scrollTop`),\n * the spy measures once. Two frames, as a frame runs before ResizeObserver:\n * the second sees a correction's hold, which cancels the check, rather than\n * the layout the correction is about to fix.\n *\n * Not covered: a second correction within the same hold, after such a\n * scroll, puts the view back where the reader put it, and the scroll is\n * then lost.\n */\nexport function createScrollSpy(\n\troot: () => HTMLElement | null | undefined,\n\tpages: () => ReadonlyMap<number, HTMLElement>,\n\tonPage: (page: number) => void,\n\toptions: number | ScrollSpyOptions = {},\n) {\n\tconst { idleMs = 150, readerPosition = () => true } = spyOptions(options);\n\tlet frame = 0;\n\tlet held = false;\n\tlet heldScroll = false; // the area scrolled during the current hold\n\tlet idle: ReturnType<typeof setTimeout> | undefined;\n\tlet scroller: HTMLElement | null = null;\n\tlet cancelCheck = () => {};\n\n\tconst measure = () => {\n\t\tframe = 0;\n\t\tconst page = scroller && pageInView(scroller, pages());\n\t\tif (page) onPage(page);\n\t};\n\n\tconst release = () => {\n\t\tclearTimeout(idle);\n\t\tidle = setTimeout(() => {\n\t\t\theld = false;\n\t\t\tif (heldScroll) {\n\t\t\t\tcancelCheck = afterResize(() => {\n\t\t\t\t\tif (!frame && !readerPosition()) measure();\n\t\t\t\t});\n\t\t\t}\n\t\t\theldScroll = false;\n\t\t}, idleMs);\n\t};\n\n\tconst onScroll = (event: Event) => {\n\t\tconst target = event.target;\n\t\tif (!(target instanceof HTMLElement) || !root()?.contains(target)) return;\n\t\tscroller = target;\n\t\t// Measured on release only off the reader's position: a jump near\n\t\t// the end would report the last page, which it scrolled past.\n\t\tif (held) {\n\t\t\theldScroll = true;\n\t\t\trelease();\n\t\t\treturn;\n\t\t}\n\t\tif (!frame) frame = requestAnimationFrame(measure);\n\t};\n\n\tconst onUserInput = (event: Event) => {\n\t\t// Input on the document lands on a node (an SVG icon too).\n\t\tconst target = event.target as Node | null;\n\t\tif (!target || !root()?.contains(target)) return;\n\t\tif (heldScroll && !frame) frame = requestAnimationFrame(measure);\n\t\theld = false;\n\t\theldScroll = false;\n\t\tclearTimeout(idle);\n\t};\n\n\tconst stopScroll = listenForScroll(onScroll);\n\tconst stopInput = listenForUserInput(document, onUserInput);\n\n\treturn {\n\t\thold() {\n\t\t\theld = true;\n\t\t\tcancelCheck();\n\t\t\tcancelAnimationFrame(frame);\n\t\t\tframe = 0;\n\t\t\trelease();\n\t\t},\n\t\tstop() {\n\t\t\tstopScroll();\n\t\t\tstopInput();\n\t\t\tcancelCheck();\n\t\t\tcancelAnimationFrame(frame);\n\t\t\tclearTimeout(idle);\n\t\t},\n\t};\n}\n",
12
- "import { scrollIntoArea } from './pdf-scroll-spy';\nimport { listenForUserInput } from './pdf-user-input';\n\nconst VIEWPORT = '[data-slot=\"scroll-area-viewport\"]';\n\n/**\n * Keeps `node` at the top of the page area while the pages above it change\n * size (the zoom fitting to page sizes still arriving), until the user\n * scrolls, taps, clicks or types in the page area, or the returned function\n * is called. `beforeScroll` runs before each correction; `onRelease` once,\n * when the pin lets go (at once when there is nothing to pin).\n */\nexport function pinToPage(\n\tnode: () => Element | null | undefined,\n\tbeforeScroll: () => void,\n\tonRelease: () => void = () => {},\n) {\n\tconst area = node()?.closest(VIEWPORT);\n\tconst content = area?.firstElementChild;\n\tif (!area || !content || typeof ResizeObserver === 'undefined') {\n\t\tonRelease();\n\t\treturn () => {};\n\t}\n\t// The scroll area, not only its viewport: dragging the scrollbar counts.\n\tconst surface = area.closest('[data-slot=\"scroll-area\"]') ?? area;\n\tconst observer = new ResizeObserver(() => {\n\t\tconst target = node();\n\t\tif (!target) return;\n\t\tbeforeScroll();\n\t\tscrollIntoArea(target, 'start', 'auto');\n\t});\n\tobserver.observe(content);\n\tlet pinned = true;\n\t// A scroll event cannot tell the user's scroll from a correction; what\n\t// the user does first can.\n\tconst unpin = () => {\n\t\tif (!pinned) return;\n\t\tpinned = false;\n\t\tobserver.disconnect();\n\t\tstopListening();\n\t\tonRelease();\n\t};\n\tconst stopListening = listenForUserInput(surface, unpin);\n\treturn unpin;\n}\n\n/**\n * Whether the page area still shows `node` where a pin puts it: at the top,\n * or as near as the area can scroll (at its end). A scroll that leaves it\n * elsewhere came with no input the pin hears (find in page, a screen\n * reader's cursor, your own `scrollTop`): it is not the reader's.\n */\nexport function pinHolds(node: Element | null | undefined) {\n\tconst area = node?.closest<HTMLElement>(VIEWPORT);\n\tif (!node || !area) return false;\n\tconst atEnd = area.scrollTop + area.clientHeight >= area.scrollHeight - 2;\n\tconst offset =\n\t\tnode.getBoundingClientRect().top - area.getBoundingClientRect().top;\n\t// At the end, the pinned page may sit below the top (the area can\n\t// scroll no further), never above it: a jump to the last page left it.\n\treturn (atEnd && offset >= -2) || Math.abs(offset) <= 2;\n}\n",
11
+ "import { listenForUserInput } from './pdf-user-input';\n\n/** A vertical extent on screen, as `getBoundingClientRect` gives it. */\nexport type PdfBox = { top: number; bottom: number };\n\n/**\n * The page with the most of itself on screen, the first one on a tie; once\n * scrolled to the end, the last page on screen, however little of it shows.\n */\nexport function mostVisiblePage(\n\tview: PdfBox & { atEnd: boolean },\n\tpages: Iterable<readonly [number, PdfBox]>,\n): number | null {\n\tlet best: number | null = null;\n\tlet bestSeen = 0;\n\tlet last: number | null = null;\n\tfor (const [page, box] of pages) {\n\t\tconst seen =\n\t\t\tMath.min(box.bottom, view.bottom) - Math.max(box.top, view.top);\n\t\tif (seen <= 0) continue;\n\t\tif (last === null || page > last) last = page;\n\t\tif (\n\t\t\tseen > bestSeen ||\n\t\t\t(seen === bestSeen && best !== null && page < best)\n\t\t) {\n\t\t\tbest = page;\n\t\t\tbestSeen = seen;\n\t\t}\n\t}\n\treturn view.atEnd && last !== null ? last : best;\n}\n\n/**\n * Scrolls the page area around `node`, and nothing else: `scrollIntoView`\n * would scroll the host page too. `block` puts `node` at the area's top or\n * centre.\n */\nexport function scrollIntoArea(\n\tnode: Element,\n\tblock: 'start' | 'center',\n\tbehavior: ScrollBehavior = 'smooth',\n) {\n\tconst area = node.closest<HTMLElement>('[data-slot=\"scroll-area-viewport\"]');\n\tif (!area) return;\n\tconst box = node.getBoundingClientRect();\n\tconst view = area.getBoundingClientRect();\n\tlet top = area.scrollTop + box.top - view.top;\n\tif (block === 'center') top -= (view.height - box.height) / 2;\n\tarea.scrollTo({ top: Math.max(0, top), behavior });\n}\n\n/** The page most on screen in `scroller`, as `mostVisiblePage` picks it. */\nexport function pageInView(\n\tscroller: HTMLElement,\n\tpages: ReadonlyMap<number, HTMLElement>,\n) {\n\tconst view = scroller.getBoundingClientRect();\n\tconst atEnd =\n\t\tscroller.scrollTop + scroller.clientHeight >= scroller.scrollHeight - 2;\n\tconst boxes = Array.from(pages, ([page, node]) => {\n\t\tconst { top, bottom } = node.getBoundingClientRect();\n\t\treturn [page, { top, bottom }] as const;\n\t});\n\treturn mostVisiblePage({ top: view.top, bottom: view.bottom, atEnd }, boxes);\n}\n\n/** `createScrollSpy`'s options; a bare number is `idleMs`. */\nexport type ScrollSpyOptions = {\n\t/** How long scrolling must stop before a hold ends (150 ms). */\n\tidleMs?: number;\n\t/** Whether the view is still where the reader put it (always, by default). */\n\treaderPosition?: () => boolean;\n};\n\nconst spyOptions = (options: number | ScrollSpyOptions) =>\n\ttypeof options === 'number' ? { idleMs: options } : options;\n\n/**\n * Scroll events do not bubble: listens in the capture phase, on the\n * document, as the page area may be rendered again under the reader. Plain\n * DOM rather than react-use or VueUse: this file is shared.\n */\nfunction listenForScroll(onScroll: (event: Event) => void) {\n\tdocument.addEventListener('scroll', onScroll, {\n\t\tcapture: true,\n\t\tpassive: true,\n\t});\n\treturn () =>\n\t\tdocument.removeEventListener('scroll', onScroll, { capture: true });\n}\n\n/**\n * Runs `run` on the second frame from now, after the ResizeObserver\n * callbacks of the first. Returns a function that cancels it.\n */\nfunction afterResize(run: () => void) {\n\tlet id = requestAnimationFrame(() => {\n\t\tid = requestAnimationFrame(run);\n\t});\n\treturn () => cancelAnimationFrame(id);\n}\n\n/**\n * Reports the page most on screen as the reader's page area (`root`)\n * scrolls. `hold`\n * ignores scrolling until it has stopped for `idleMs`: the reader calls it\n * before scrolling to a page itself, so the pages it passes on the way are\n * not reported. What the user does in the page area (wheel, touch, pointer,\n * key) ends a hold: the scrolling after it is theirs, and a scroll the hold\n * ignored is measured.\n *\n * `readerPosition` says whether the view is still where the reader put it.\n * When the area scrolled during a hold and, two frames after release (once\n * a resize has had its correction), it is not (a scroll with no input\n * landed within the hold: find in page, a screen reader, a `scrollTop`),\n * the spy measures once. Two frames, as a frame runs before ResizeObserver:\n * the second sees a correction's hold, which cancels the check, rather than\n * the layout the correction is about to fix. A pin (`pinToPage`) makes no\n * second correction after such a scroll down; one up is lost to it.\n */\nexport function createScrollSpy(\n\troot: () => HTMLElement | null | undefined,\n\tpages: () => ReadonlyMap<number, HTMLElement>,\n\tonPage: (page: number) => void,\n\toptions: number | ScrollSpyOptions = {},\n) {\n\tconst { idleMs = 150, readerPosition = () => true } = spyOptions(options);\n\tlet frame = 0;\n\tlet held = false;\n\tlet heldScroll = false; // the area scrolled during the current hold\n\tlet idle: ReturnType<typeof setTimeout> | undefined;\n\tlet scroller: HTMLElement | null = null;\n\tlet cancelCheck = () => {};\n\n\tconst measure = () => {\n\t\tframe = 0;\n\t\tconst page = scroller && pageInView(scroller, pages());\n\t\tif (page) onPage(page);\n\t};\n\n\tconst release = () => {\n\t\tclearTimeout(idle);\n\t\tidle = setTimeout(() => {\n\t\t\theld = false;\n\t\t\tif (heldScroll) {\n\t\t\t\tcancelCheck = afterResize(() => {\n\t\t\t\t\tif (!frame && !readerPosition()) measure();\n\t\t\t\t});\n\t\t\t}\n\t\t\theldScroll = false;\n\t\t}, idleMs);\n\t};\n\n\tconst onScroll = (event: Event) => {\n\t\tconst target = event.target;\n\t\tif (!(target instanceof HTMLElement) || !root()?.contains(target)) return;\n\t\tscroller = target;\n\t\t// Measured on release only off the reader's position: a jump near\n\t\t// the end would report the last page, which it scrolled past.\n\t\tif (held) {\n\t\t\theldScroll = true;\n\t\t\trelease();\n\t\t\treturn;\n\t\t}\n\t\tif (!frame) frame = requestAnimationFrame(measure);\n\t};\n\n\tconst onUserInput = (event: Event) => {\n\t\t// Input on the document lands on a node (an SVG icon too).\n\t\tconst target = event.target as Node | null;\n\t\tif (!target || !root()?.contains(target)) return;\n\t\tif (heldScroll && !frame) frame = requestAnimationFrame(measure);\n\t\theld = false;\n\t\theldScroll = false;\n\t\tclearTimeout(idle);\n\t};\n\n\tconst stopScroll = listenForScroll(onScroll);\n\tconst stopInput = listenForUserInput(document, onUserInput);\n\n\treturn {\n\t\thold() {\n\t\t\theld = true;\n\t\t\tcancelCheck();\n\t\t\tcancelAnimationFrame(frame);\n\t\t\tframe = 0;\n\t\t\trelease();\n\t\t},\n\t\tstop() {\n\t\t\tstopScroll();\n\t\t\tstopInput();\n\t\t\tcancelCheck();\n\t\t\tcancelAnimationFrame(frame);\n\t\t\tclearTimeout(idle);\n\t\t},\n\t};\n}\n",
12
+ "import { scrollIntoArea } from './pdf-scroll-spy';\nimport { listenForUserInput } from './pdf-user-input';\n\nconst VIEWPORT = '[data-slot=\"scroll-area-viewport\"]';\n\n/**\n * Keeps `node` at the top of the page area while the pages above it change\n * size (the zoom fitting to page sizes still arriving), until the user\n * scrolls, taps, clicks or types in the page area, or the returned function\n * is called. `beforeScroll` runs before each correction; `onRelease` once,\n * when the pin lets go (at once when there is nothing to pin).\n *\n * It stops correcting once a scroll it did not make moved the view down\n * (find in page, a screen reader's cursor, a `scrollTop`): `scrollTop` is\n * past the one its last correction left, and the page is off the top. It\n * does not let go then: the scroll spy reports that view (`pinHolds` is\n * false) and its owner unpins. The pages growing leave `scrollTop` alone,\n * and the browser anchoring it is not such a scroll. A scroll up is still\n * corrected: it looks like the browser clamping the scroll as the pages\n * shrink.\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/**\n * Whether a scroll the pin did not make moved `area` down, off `node`,\n * since it left it at `placedTop`. Only down: the browser clamps the scroll\n * up when the pages shrink, even for a moment within a frame (a page drawn\n * again), which no observer sees; a correction puts that right. Not the\n * browser anchoring it on `node` as the pages above grow either (the page\n * still at the top).\n */\nfunction movedElsewhere(area: Element, placedTop: number, node: Element) {\n\treturn area.scrollTop > placedTop + 2 && !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 atEnd = area.scrollTop + area.clientHeight >= area.scrollHeight - 2;\n\tconst offset =\n\t\tnode.getBoundingClientRect().top - area.getBoundingClientRect().top;\n\t// At the end, the pinned page may sit below the top (the area can\n\t// scroll no further), never above it: a jump to the last page left it.\n\treturn (atEnd && offset >= -2) || Math.abs(offset) <= 2;\n}\n",
13
13
  "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
14
  ],
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,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ClC,OAAO,MAAM,qBAAqB,KAAK;AAAA;",
16
+ "debugId": "6179B70E72FE3BCD64756E2164756E21",
17
17
  "names": []
18
18
  }
@@ -4,6 +4,15 @@
4
4
  * scrolls, taps, clicks or types in the page area, or the returned function
5
5
  * is called. `beforeScroll` runs before each correction; `onRelease` once,
6
6
  * when the pin lets go (at once when there is nothing to pin).
7
+ *
8
+ * It stops correcting once a scroll it did not make moved the view down
9
+ * (find in page, a screen reader's cursor, a `scrollTop`): `scrollTop` is
10
+ * past the one its last correction left, and the page is off the top. It
11
+ * does not let go then: the scroll spy reports that view (`pinHolds` is
12
+ * false) and its owner unpins. The pages growing leave `scrollTop` alone,
13
+ * and the browser anchoring it is not such a scroll. A scroll up is still
14
+ * corrected: it looks like the browser clamping the scroll as the pages
15
+ * shrink.
7
16
  */
8
17
  export declare function pinToPage(node: () => Element | null | undefined, beforeScroll: () => void, onRelease?: () => void): () => void;
9
18
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"pdf-pin-page.d.ts","sourceRoot":"","sources":["../../src/pdf-viewer/pdf-pin-page.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,SAAS,CACxB,IAAI,EAAE,MAAM,OAAO,GAAG,IAAI,GAAG,SAAS,EACtC,YAAY,EAAE,MAAM,IAAI,EACxB,SAAS,GAAE,MAAM,IAAe,cA6BhC;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,WASxD"}
1
+ {"version":3,"file":"pdf-pin-page.d.ts","sourceRoot":"","sources":["../../src/pdf-viewer/pdf-pin-page.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,SAAS,CACxB,IAAI,EAAE,MAAM,OAAO,GAAG,IAAI,GAAG,SAAS,EACtC,YAAY,EAAE,MAAM,IAAI,EACxB,SAAS,GAAE,MAAM,IAAe,cAoChC;AAcD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,WASxD"}
@@ -40,11 +40,8 @@ export type ScrollSpyOptions = {
40
40
  * landed within the hold: find in page, a screen reader, a `scrollTop`),
41
41
  * the spy measures once. Two frames, as a frame runs before ResizeObserver:
42
42
  * the second sees a correction's hold, which cancels the check, rather than
43
- * the layout the correction is about to fix.
44
- *
45
- * Not covered: a second correction within the same hold, after such a
46
- * scroll, puts the view back where the reader put it, and the scroll is
47
- * then lost.
43
+ * the layout the correction is about to fix. A pin (`pinToPage`) makes no
44
+ * second correction after such a scroll down; one up is lost to it.
48
45
  */
49
46
  export declare function createScrollSpy(root: () => HTMLElement | null | undefined, pages: () => ReadonlyMap<number, HTMLElement>, onPage: (page: number) => void, options?: number | ScrollSpyOptions): {
50
47
  hold(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"pdf-scroll-spy.d.ts","sourceRoot":"","sources":["../../src/pdf-viewer/pdf-scroll-spy.ts"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,MAAM,MAAM,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD;;;GAGG;AACH,wBAAgB,eAAe,CAC9B,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,EACjC,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACxC,MAAM,GAAG,IAAI,CAkBf;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC7B,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,OAAO,GAAG,QAAQ,EACzB,QAAQ,GAAE,cAAyB,QASnC;AAED,4EAA4E;AAC5E,wBAAgB,UAAU,CACzB,QAAQ,EAAE,WAAW,EACrB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,iBAUvC;AAED,8DAA8D;AAC9D,MAAM,MAAM,gBAAg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,CAAC;CAC/B,CAAC;AA8BF;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAC9B,IAAI,EAAE,MAAM,WAAW,GAAG,IAAI,GAAG,SAAS,EAC1C,KAAK,EAAE,MAAM,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,EAC7C,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAC9B,OAAO,GAAE,MAAM,GAAG,gBAAqB;;;EAwEvC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material-core",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
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": {