@kingtech/react-pdf-viewer 0.0.0-stage → 1.0.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 +35 -0
- package/LICENSE +21 -0
- package/NOTICE +14 -0
- package/README.md +67 -2
- package/dist/PdfViewer.d.ts +23 -0
- package/dist/components/ContinuousPages.d.ts +23 -0
- package/dist/components/ErrorView.d.ts +10 -0
- package/dist/components/LoadingView.d.ts +6 -0
- package/dist/components/PageInput.d.ts +11 -0
- package/dist/components/PasswordPrompt.d.ts +10 -0
- package/dist/components/PdfPageCanvas.d.ts +53 -0
- package/dist/components/SearchBar.d.ts +18 -0
- package/dist/components/Thumbnails.d.ts +16 -0
- package/dist/components/Toolbar.d.ts +30 -0
- package/dist/components/ToolbarButton.d.ts +15 -0
- package/dist/components/ToolbarMenu.d.ts +25 -0
- package/dist/components/icons.d.ts +60 -0
- package/dist/core/download.d.ts +4 -0
- package/dist/core/env.d.ts +2 -0
- package/dist/core/errors.d.ts +19 -0
- package/dist/core/fileName.d.ts +10 -0
- package/dist/core/geometry.d.ts +25 -0
- package/dist/core/linkService.d.ts +29 -0
- package/dist/core/loadSource.d.ts +22 -0
- package/dist/core/pdfjs.d.ts +80 -0
- package/dist/core/print.d.ts +16 -0
- package/dist/core/scale.d.ts +26 -0
- package/dist/core/search.d.ts +36 -0
- package/dist/hooks/useControllableState.d.ts +19 -0
- package/dist/hooks/useDevicePixelRatio.d.ts +2 -0
- package/dist/hooks/useDocumentSearch.d.ts +13 -0
- package/dist/hooks/useElementSize.d.ts +13 -0
- package/dist/hooks/useFullscreen.d.ts +18 -0
- package/dist/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts +18 -0
- package/dist/hooks/useMediaQuery.d.ts +2 -0
- package/dist/hooks/usePageRenderer.d.ts +74 -0
- package/dist/hooks/usePdfDocument.d.ts +31 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +2290 -0
- package/dist/index.js.map +1 -0
- package/dist/labels.d.ts +64 -0
- package/dist/styles.css +2 -0
- package/dist/types.d.ts +324 -0
- package/package.json +95 -4
package/dist/styles.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
@layer rpv{.rpv-root{--_rpv-viewport-max-width:var(--rpv-viewport-max-width,650px);--_rpv-viewport-min-height:var(--rpv-viewport-min-height,712px);--_rpv-viewport-max-height:var(--rpv-viewport-max-height,800px);--_rpv-viewport-padding:var(--rpv-viewport-padding,0px);--_rpv-toolbar-max-width:var(--rpv-toolbar-max-width,482px);box-sizing:border-box;width:100%;max-width:100%;height:auto;font-family:var(--rpv-font-family,inherit);background:0 0;border:none;border-radius:8px;outline:none;flex-direction:column;align-items:center;display:flex;position:relative}.rpv-root *,.rpv-root :before,.rpv-root :after{box-sizing:border-box}.rpv-root[data-compact]{--_rpv-viewport-max-width:100%;--_rpv-viewport-min-height:var(--rpv-viewport-min-height-compact,400px);--_rpv-viewport-max-height:100%;--_rpv-viewport-padding:var(--rpv-viewport-padding-compact,16px)}.rpv-root[data-fullscreen]{--_rpv-viewport-min-height:0px;--_rpv-viewport-max-width:100%;--_rpv-viewport-max-height:100%;--_rpv-viewport-padding:var(--rpv-viewport-padding-fullscreen,32px);--_rpv-toolbar-max-width:100%;height:100vh;height:100dvh}.rpv-root[data-presentation=native],.rpv-root[data-presentation=overlay]{background:var(--rpv-fullscreen-bg,#fff);border-radius:0;height:100%}.rpv-root[data-presentation=overlay]{z-index:var(--rpv-overlay-z-index,1300);position:fixed;inset:0}.rpv-viewport{width:100%;max-width:var(--_rpv-viewport-max-width);min-height:var(--_rpv-viewport-min-height);max-height:var(--_rpv-viewport-max-height);padding:var(--_rpv-viewport-padding);margin-bottom:var(--rpv-viewport-margin-bottom,64px);overscroll-behavior:contain;background:0 0;flex:auto;align-items:flex-start;display:flex;position:relative;overflow:auto}.rpv-viewport:focus-visible{outline:2px solid var(--rpv-accent,#1976d2);outline-offset:2px}.rpv-root[data-toolbar-position=top] .rpv-viewport{margin-bottom:0}.rpv-page{box-sizing:content-box;background:var(--rpv-page-bg,#fff);border:var(--rpv-page-border,1px solid #ddd);border-radius:var(--rpv-page-radius,4px);box-shadow:var(--rpv-page-shadow,0 2px 8px #0000001a);flex:none;margin-inline:auto;position:relative;overflow:hidden}.rpv-page__canvas-host,.rpv-page__canvas{width:100%;height:100%;display:block}.rpv-page[data-state=error]{min-width:min(100%,320px);min-height:240px}.rpv-page[data-state=error] .rpv-page__canvas-host{display:none}.rpv-toolbar-wrapper{max-width:var(--_rpv-toolbar-max-width);justify-content:center;display:flex}.rpv-toolbar{min-height:var(--rpv-toolbar-min-height,48px);padding:0 var(--rpv-toolbar-padding-x,16px);margin-bottom:var(--rpv-toolbar-margin-bottom,40px);font-size:var(--rpv-label-font-size,14px);font-weight:var(--rpv-label-font-weight,600);color:var(--rpv-toolbar-fg,#fff);background:var(--rpv-toolbar-bg,#54646e);border-radius:var(--rpv-toolbar-radius,8px);flex-wrap:nowrap;flex:none;justify-content:space-between;align-items:center;column-gap:0;line-height:1.43;display:flex;position:relative}.rpv-toolbar[data-extended]{column-gap:var(--rpv-toolbar-group-gap,16px)}.rpv-root[data-toolbar-position=top] .rpv-toolbar{margin-bottom:16px}.rpv-toolbar__group{align-items:center;gap:var(--rpv-toolbar-gap,8px);flex:none;display:flex}.rpv-menu-anchor{display:inline-flex;position:relative}.rpv-menu{z-index:10;min-width:208px;color:var(--rpv-menu-fg,#1f2a30);background:var(--rpv-menu-bg,#fff);border:1px solid var(--rpv-menu-border,#00000014);box-shadow:var(--rpv-menu-shadow,0 10px 28px #0f172a2e, 0 2px 6px #0f172a1f);transform-origin:100% 100%;border-radius:10px;flex-direction:column;gap:2px;margin:0;padding:6px;font-size:14px;font-weight:500;line-height:1.4;animation:.12s ease-out rpv-menu-in;display:flex;position:absolute;bottom:calc(100% + 14px);right:-8px}.rpv-menu[data-placement=bottom]{transform-origin:100% 0;top:calc(100% + 14px);bottom:auto}@keyframes rpv-menu-in{0%{opacity:0;transform:translateY(4px)scale(.98)}}@media (prefers-reduced-motion:reduce){.rpv-menu{animation:none}}.rpv-menu__item{width:100%;min-height:40px;font:inherit;color:inherit;text-align:left;white-space:nowrap;cursor:pointer;background:0 0;border:0;border-radius:6px;align-items:center;gap:12px;margin:0;padding:0 12px;display:flex}.rpv-menu__item:hover:not([aria-disabled=true]),.rpv-menu__item:focus-visible{background:var(--rpv-menu-hover-bg,#54646e1f);outline:none}.rpv-menu__item:focus-visible{box-shadow:inset 0 0 0 2px var(--rpv-accent,#1976d2)}.rpv-menu__item[aria-disabled=true]{cursor:default;opacity:.45}.rpv-menu__icon{color:var(--rpv-menu-icon-fg,#54646e);flex:none;display:flex}.rpv-menu__icon .rpv-icon{width:20px;height:20px}.rpv-root.rpv-theme-dark .rpv-menu{--rpv-menu-bg:#2b363c;--rpv-menu-fg:#eceff1;--rpv-menu-icon-fg:#b0bec5;--rpv-menu-border:#ffffff14;--rpv-menu-hover-bg:#ffffff14}@media (prefers-color-scheme:dark){.rpv-root.rpv-theme-auto .rpv-menu{--rpv-menu-bg:#2b363c;--rpv-menu-fg:#eceff1;--rpv-menu-icon-fg:#b0bec5;--rpv-menu-border:#ffffff14;--rpv-menu-hover-bg:#ffffff14}}.rpv-toolbar__label{min-width:40px;font-size:var(--rpv-label-font-size,14px);font-weight:var(--rpv-label-font-weight,600);letter-spacing:.01071em;text-align:center;white-space:nowrap;margin:0;line-height:1.43}.rpv-toolbar__pages{min-width:80px}.rpv-root[data-compact] .rpv-toolbar__pages{min-width:40px}.rpv-button{width:var(--rpv-button-size,34px);height:var(--rpv-button-size,34px);font:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent;background:0 0;border:0;border-radius:50%;flex:none;justify-content:center;align-items:center;margin:0;padding:0;transition:background-color .15s cubic-bezier(.4,0,.2,1);display:inline-flex}.rpv-button:hover:not(:disabled){background:var(--rpv-button-hover-bg,#ffffff1a)}@media (hover:none){.rpv-button:hover:not(:disabled){background:0 0}}.rpv-button:focus-visible{outline:var(--rpv-focus-ring,2px solid #fff);outline-offset:var(--rpv-focus-ring-offset,2px)}.rpv-button:disabled{color:var(--rpv-button-disabled-fg,#ffffff4d);cursor:default}.rpv-icon{width:var(--rpv-icon-size,24px);height:var(--rpv-icon-size,24px);fill:currentColor;flex:none}.rpv-loading{z-index:1;flex-direction:column;align-items:center;gap:16px;display:flex;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.rpv-loading__text,.rpv-print-status__text{letter-spacing:.00938em;color:var(--rpv-muted-fg,#0009);margin:0;font-size:1rem;line-height:1.5}.rpv-spinner{width:40px;height:40px;color:var(--rpv-accent,#1976d2);animation:1.4s linear infinite rpv-spin;display:inline-block}.rpv-spinner svg{display:block}.rpv-spinner circle{stroke:currentColor;stroke-dasharray:80 200;stroke-dashoffset:0;animation:1.4s ease-in-out infinite rpv-dash}@keyframes rpv-spin{to{transform:rotate(360deg)}}@keyframes rpv-dash{0%{stroke-dasharray:1 200;stroke-dashoffset:0}50%{stroke-dasharray:100 200;stroke-dashoffset:-15px}to{stroke-dasharray:100 200;stroke-dashoffset:-125px}}@media (prefers-reduced-motion:reduce){.rpv-spinner,.rpv-spinner circle{animation-duration:4s}}.rpv-error-area{width:100%;max-width:var(--_rpv-viewport-max-width)}.rpv-error{flex-direction:column;justify-content:center;align-items:center;width:100%;height:400px;padding:32px;display:flex}.rpv-error--page{height:100%;min-height:240px;padding:16px}.rpv-alert{letter-spacing:.01071em;max-width:100%;color:var(--rpv-error-fg,#5f2120);background:var(--rpv-error-bg,#fdeded);border-radius:4px;margin-bottom:16px;padding:6px 16px;font-size:.875rem;font-weight:400;line-height:1.43;display:flex}.rpv-alert__icon{color:var(--rpv-error-icon,#d32f2f);margin-right:12px;padding:7px 0;display:flex}.rpv-alert__icon .rpv-icon{width:22px;height:22px}.rpv-alert__message{overflow-wrap:anywhere;min-width:0;padding:8px 0}.rpv-text-button{min-width:64px;font:inherit;letter-spacing:.02857em;text-transform:uppercase;color:var(--rpv-text-button-fg,#1565c0);cursor:pointer;background:0 0;border:1px solid;border-radius:4px;padding:6px 16px;font-size:.875rem;font-weight:500;line-height:1.75}.rpv-text-button:hover{background:color-mix(in srgb, currentColor 8%, transparent)}.rpv-text-button:focus-visible{outline:2px solid var(--rpv-accent,#1976d2);outline-offset:2px}.rpv-print-status{z-index:2;background:#ffffffd9;flex-direction:column;justify-content:center;align-items:center;gap:16px;animation:.15s ease-out .4s both rpv-fade-in;display:flex;position:absolute;inset:0}@keyframes rpv-fade-in{0%{opacity:0}to{opacity:1}}.rpv-root.rpv-theme-dark{--rpv-toolbar-bg:#263238;--rpv-toolbar-fg:#eceff1;--rpv-focus-ring:2px solid #90caf9;--rpv-page-border:1px solid #37474f;--rpv-page-shadow:0 2px 12px #0009;--rpv-accent:#90caf9;--rpv-text-button-fg:#90caf9;--rpv-muted-fg:#ffffffb3;--rpv-error-bg:#160b0b;--rpv-error-fg:#f4c7c7;--rpv-error-icon:#f44336;--rpv-fullscreen-bg:#121212;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}.rpv-root.rpv-theme-dark .rpv-print-status{background:#121212d9}@media (prefers-color-scheme:dark){.rpv-root.rpv-theme-auto{--rpv-toolbar-bg:#263238;--rpv-toolbar-fg:#eceff1;--rpv-focus-ring:2px solid #90caf9;--rpv-page-border:1px solid #37474f;--rpv-page-shadow:0 2px 12px #0009;--rpv-accent:#90caf9;--rpv-text-button-fg:#90caf9;--rpv-muted-fg:#ffffffb3;--rpv-error-bg:#160b0b;--rpv-error-fg:#f4c7c7;--rpv-error-icon:#f44336;--rpv-fullscreen-bg:#121212;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}}.rpv-sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.rpv-page{--scale-round-x:1px;--scale-round-y:1px}.rpv-page__layers{position:absolute;inset:0}.rpv-page [data-main-rotation="90"]{transform:rotate(90deg)translateY(-100%)}.rpv-page [data-main-rotation="180"]{transform:rotate(180deg)translate(-100%,-100%)}.rpv-page [data-main-rotation="270"]{transform:rotate(270deg)translate(-100%)}.rpv-page .textLayer{--min-font-size:1;--text-scale-factor:calc(var(--total-scale-factor) * var(--min-font-size));--min-font-size-inv:calc(1 / var(--min-font-size));z-index:0;text-align:initial;letter-spacing:normal;word-spacing:normal;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;caret-color:canvastext;opacity:1;transform-origin:0 0;line-height:1;position:absolute;inset:0;overflow:clip}.rpv-page .textLayer :is(span,br){color:#0000;white-space:pre;cursor:text;transform-origin:0 0;-webkit-user-select:text;user-select:text;position:absolute}.rpv-page .textLayer>:not(.markedContent),.rpv-page .textLayer .markedContent span:not(.markedContent){--font-height:0;--scale-x:1;--rotate:0deg;z-index:1;font-size:calc(var(--text-scale-factor) * var(--font-height));transform:rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv))}.rpv-page .textLayer .markedContent{display:contents}.rpv-page .textLayer span[role=img]{cursor:default;-webkit-user-select:none;user-select:none}.rpv-page .textLayer ::selection{background:var(--rpv-selection-bg,#0000ff40)}.rpv-page .textLayer br::selection{background:0 0}.rpv-page .textLayer .endOfContent{z-index:0;cursor:default;-webkit-user-select:none;user-select:none;display:block;position:absolute;inset:100% 0 0}.rpv-page .textLayer.selecting .endOfContent{top:0}.rpv-page .textLayer .highlight{background-color:var(--rpv-search-highlight,#ffd50080);border-radius:3px;margin:-1px;padding:1px}.rpv-page .textLayer .highlight.appended{position:initial}.rpv-page .textLayer .highlight.selected{background-color:var(--rpv-search-highlight-selected,#ff6f0099)}.rpv-page .annotationLayer{z-index:1;pointer-events:none;transform-origin:0 0;position:absolute;top:0;left:0}.rpv-page .annotationLayer section{box-sizing:border-box;text-align:initial;pointer-events:auto;transform-origin:0 0;position:absolute}.rpv-page .annotationLayer .linkAnnotation>a{width:100%;height:100%;font-size:1em;position:absolute;top:0;left:0}.rpv-page .annotationLayer .linkAnnotation>a:hover{background:#ff03;box-shadow:0 2px 10px #ff09}.rpv-page .annotationLayer .linkAnnotation>a:focus-visible{outline:2px solid var(--rpv-accent,#1976d2);outline-offset:1px}.rpv-pages{gap:var(--rpv-page-gap,16px);flex-direction:column;flex:none;align-items:center;margin-inline:auto;display:flex}.rpv-page-slot{flex:none;position:relative}.rpv-page-slot>.rpv-page{margin:0}.rpv-body{flex:auto;justify-content:center;gap:12px;width:100%;min-height:0;display:flex}.rpv-body>.rpv-viewport,.rpv-body>.rpv-error-area{flex:auto}.rpv-thumbnails{width:var(--rpv-thumbnails-width,148px);max-height:var(--_rpv-viewport-max-height);margin-bottom:var(--rpv-viewport-margin-bottom,64px);overscroll-behavior:contain;flex:none;padding:4px;overflow-y:auto}.rpv-root:not([data-fullscreen]) .rpv-thumbnails{max-height:var(--_rpv-viewport-min-height)}.rpv-thumbnails__list{flex-direction:column;gap:10px;margin:0;padding:0;list-style:none;display:flex}.rpv-thumbnail{width:100%;font:inherit;color:inherit;cursor:pointer;background:0 0;border:2px solid #0000;border-radius:6px;flex-direction:column;align-items:center;gap:4px;padding:6px;display:flex}.rpv-thumbnail:hover{background:#0000000d}.rpv-thumbnail[aria-current=page]{border-color:var(--rpv-accent,#1976d2)}.rpv-thumbnail:focus-visible{outline:2px solid var(--rpv-accent,#1976d2);outline-offset:2px}.rpv-thumbnail .rpv-page{box-shadow:none;margin:0}.rpv-thumbnail__placeholder{background:var(--rpv-page-bg,#fff);border:var(--rpv-page-border,1px solid #ddd);width:112px;height:145px;display:block}.rpv-thumbnail__number{color:var(--rpv-muted-fg,#0009);font-size:12px}.rpv-search{width:100%;max-width:var(--_rpv-viewport-max-width);color:var(--rpv-search-fg,#37474f);background:var(--rpv-search-bg,#fff);border:var(--rpv-page-border,1px solid #ddd);border-radius:8px;align-items:center;gap:4px;margin-bottom:12px;padding:4px 8px;display:flex}.rpv-search__icon{color:var(--rpv-muted-fg,#0009);display:flex}.rpv-search__input{min-width:0;height:32px;font:inherit;color:inherit;background:0 0;border:0;outline:none;flex:1;padding:0 6px}.rpv-search:focus-within{outline:2px solid var(--rpv-accent,#1976d2);outline-offset:-1px}.rpv-search__status{min-width:5em;color:var(--rpv-muted-fg,#0009);text-align:right;white-space:nowrap;font-size:14px}.rpv-search .rpv-button:hover:not(:disabled){background:#0000000f}.rpv-search .rpv-button:disabled{color:#0000004d}.rpv-search .rpv-button:focus-visible{outline:2px solid var(--rpv-accent,#1976d2)}.rpv-toolbar__pages--input{white-space:nowrap;justify-content:center;align-items:center;gap:8px;display:inline-flex}.rpv-toolbar .rpv-page-input{transition:background-color .15s,border-color .15s;box-sizing:border-box!important;width:calc(var(--rpv-page-input-chars,2) * 1ch + 22px)!important;min-width:0!important;max-width:none!important;height:28px!important;min-height:0!important;font:inherit!important;font-variant-numeric:tabular-nums!important;color:var(--rpv-toolbar-fg,#fff)!important;text-align:center!important;appearance:none!important;background:var(--rpv-page-input-bg,#00000038)!important;border:1px solid var(--rpv-page-input-border,#ffffff59)!important;box-shadow:none!important;border-radius:6px!important;margin:0!important;padding:0 6px!important}.rpv-toolbar .rpv-page-input:hover:not(:disabled){border-color:#ffffffb3!important}.rpv-toolbar .rpv-page-input:focus-visible{outline-offset:1px;outline:2px solid #ffffff59;border-color:var(--rpv-toolbar-fg,#fff)!important;background:#00000052!important}.rpv-toolbar .rpv-page-input::selection{color:inherit;background:#ffffff59}.rpv-toolbar .rpv-page-input:disabled{opacity:.5}.rpv-zoom-reset{min-width:48px;height:28px;font:inherit;color:inherit;text-align:center;cursor:pointer;background:0 0;border:1px solid #0000;border-radius:6px;margin:0;padding:0 8px;transition:background-color .15s,border-color .15s}.rpv-zoom-reset:hover{background:var(--rpv-button-hover-bg,#ffffff1a);border-color:#ffffff40}.rpv-zoom-reset:focus-visible{outline:var(--rpv-focus-ring,2px solid #fff);outline-offset:var(--rpv-focus-ring-offset,2px)}.rpv-password-area{justify-content:center;align-items:center;min-height:400px;padding:32px;display:flex}.rpv-password{color:#1b2430;background:var(--rpv-page-bg,#fff);border:var(--rpv-page-border,1px solid #ddd);width:min(100%,340px);box-shadow:var(--rpv-page-shadow,0 2px 8px #0000001a);border-radius:8px;flex-direction:column;gap:10px;margin:auto;padding:24px;display:flex}.rpv-password__title{margin:0;font-weight:600}.rpv-password__error{color:var(--rpv-error-fg,#5f2120);margin:0}.rpv-password label{font-size:14px}.rpv-password input{height:36px;font:inherit;border:1px solid #8a94a3;border-radius:6px;padding:0 10px}.rpv-password input:focus-visible{outline:2px solid var(--rpv-accent,#1976d2);outline-offset:1px}.rpv-root.rpv-theme-dark .rpv-search{--rpv-search-fg:#eceff1;--rpv-search-bg:#1e272c}.rpv-root.rpv-theme-dark .rpv-search .rpv-button:disabled{color:#ffffff4d}.rpv-root.rpv-theme-dark .rpv-password{color:#eceff1;background:var(--rpv-page-bg,#1e272c)}@media (prefers-color-scheme:dark){.rpv-root.rpv-theme-auto .rpv-search{--rpv-search-fg:#eceff1;--rpv-search-bg:#1e272c}.rpv-root.rpv-theme-auto .rpv-search .rpv-button:disabled{color:#ffffff4d}.rpv-root.rpv-theme-auto .rpv-password{color:#eceff1;background:var(--rpv-page-bg,#1e272c)}}}
|
|
2
|
+
/*$vite$:1*/
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { getDocument, PDFDocumentProxy } from 'pdfjs-dist';
|
|
2
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
import { PageRenderInfo } from './hooks/usePageRenderer.js';
|
|
4
|
+
import { PdfViewerLabels } from './labels.js';
|
|
5
|
+
/**
|
|
6
|
+
* A PDF document source.
|
|
7
|
+
*
|
|
8
|
+
* - `string` / `URL`: fetched by the viewer (see {@link PdfRequestOptions}).
|
|
9
|
+
* - `ArrayBuffer` / `Uint8Array` / `Blob` (including `File`): read directly, nothing is uploaded.
|
|
10
|
+
*
|
|
11
|
+
* Strings compare by value; every other source compares by identity, so keep binary sources
|
|
12
|
+
* referentially stable (e.g. in state) to avoid reloading on every render.
|
|
13
|
+
*/
|
|
14
|
+
export type PdfSource = string | URL | ArrayBuffer | Uint8Array | Blob;
|
|
15
|
+
/** Clockwise rotation in degrees, relative to the page's natural orientation. */
|
|
16
|
+
export type Rotation =
|
|
17
|
+
/** Upright (the page's natural orientation). */
|
|
18
|
+
0
|
|
19
|
+
/** A quarter turn clockwise. */
|
|
20
|
+
| 90
|
|
21
|
+
/** Upside down. */
|
|
22
|
+
| 180
|
|
23
|
+
/** A quarter turn counter-clockwise. */
|
|
24
|
+
| 270;
|
|
25
|
+
/**
|
|
26
|
+
* How fullscreen is presented.
|
|
27
|
+
*
|
|
28
|
+
* - `'controlled'`: layout-only; the parent decides how to present fullscreen.
|
|
29
|
+
* - `'native'`: the browser Fullscreen API on the viewer root, falling back to `'overlay'`.
|
|
30
|
+
* - `'overlay'`: a fixed, full-viewport layer with a focus trap; `Esc` closes it.
|
|
31
|
+
*/
|
|
32
|
+
export type FullscreenMode =
|
|
33
|
+
/** Layout only: the parent decides how to present fullscreen. */
|
|
34
|
+
'controlled'
|
|
35
|
+
/** The browser Fullscreen API on the viewer root, falling back to `'overlay'`. */
|
|
36
|
+
| 'native'
|
|
37
|
+
/** A fixed, full-viewport layer with a focus trap and scroll lock; `Esc` closes it. */
|
|
38
|
+
| 'overlay';
|
|
39
|
+
/** Identifies a toolbar control. */
|
|
40
|
+
export type ToolbarAction = 'zoomOut' | 'zoomLevel' | 'zoomIn' | 'previousPage' | 'pageIndicator' | 'nextPage' | 'fullscreen' | 'rotate' | 'download' | 'print';
|
|
41
|
+
/** Lifecycle status of a document load. */
|
|
42
|
+
export type PdfDocumentStatus =
|
|
43
|
+
/** No source, or an HTTP error that `onHttpError` handled. */
|
|
44
|
+
'idle'
|
|
45
|
+
/** Fetching or parsing the document. */
|
|
46
|
+
| 'loading'
|
|
47
|
+
/** The document is loaded and pages can render. */
|
|
48
|
+
| 'ready'
|
|
49
|
+
/** Loading failed; the error is available. */
|
|
50
|
+
| 'error';
|
|
51
|
+
/** Machine-readable category of a {@link PdfViewerError}. */
|
|
52
|
+
export type PdfViewerErrorCode =
|
|
53
|
+
/** The `pdfjs-dist` module or its worker failed to load. */
|
|
54
|
+
'PDFJS_LOAD_FAILED'
|
|
55
|
+
/** `fetch` rejected (offline, CORS, DNS, …). */
|
|
56
|
+
| 'NETWORK_ERROR'
|
|
57
|
+
/** The server answered with a non-2xx status (`status` is set). */
|
|
58
|
+
| 'HTTP_ERROR'
|
|
59
|
+
/** The bytes are not a valid PDF. */
|
|
60
|
+
| 'INVALID_PDF'
|
|
61
|
+
/** The document is encrypted and no password was supplied. */
|
|
62
|
+
| 'PASSWORD_REQUIRED'
|
|
63
|
+
/** The supplied password is wrong. */
|
|
64
|
+
| 'INCORRECT_PASSWORD'
|
|
65
|
+
/** A page failed to render. */
|
|
66
|
+
| 'RENDER_FAILED'
|
|
67
|
+
/** Saving the document failed. */
|
|
68
|
+
| 'DOWNLOAD_FAILED'
|
|
69
|
+
/** Printing failed. */
|
|
70
|
+
| 'PRINT_FAILED'
|
|
71
|
+
/** Anything else. */
|
|
72
|
+
| 'UNKNOWN';
|
|
73
|
+
/**
|
|
74
|
+
* A typed viewer error. Aborted loads and canceled renders are never reported as errors.
|
|
75
|
+
*/
|
|
76
|
+
export interface PdfViewerError {
|
|
77
|
+
/** Error category. */
|
|
78
|
+
readonly code: PdfViewerErrorCode;
|
|
79
|
+
/** Human-readable message. For `HTTP_ERROR` it comes from `getHttpErrorMessage`. */
|
|
80
|
+
readonly message: string;
|
|
81
|
+
/** HTTP status, for `HTTP_ERROR`. */
|
|
82
|
+
readonly status?: number;
|
|
83
|
+
/** The underlying error, when there is one. */
|
|
84
|
+
readonly cause?: unknown;
|
|
85
|
+
}
|
|
86
|
+
type DocumentInitParameters = NonNullable<Parameters<typeof getDocument>[0]>;
|
|
87
|
+
/**
|
|
88
|
+
* Per-instance options forwarded to `pdfjs-dist`'s `getDocument` (for example `cMapUrl`,
|
|
89
|
+
* `standardFontDataUrl` or `verbosity`). Source-related options are managed by the viewer.
|
|
90
|
+
*/
|
|
91
|
+
export type PdfJsDocumentOptions = Omit<DocumentInitParameters, 'url' | 'data' | 'password' | 'range' | 'worker' | 'httpHeaders' | 'withCredentials'>;
|
|
92
|
+
/** Controls how string and `URL` sources are fetched. */
|
|
93
|
+
export interface PdfRequestOptions {
|
|
94
|
+
/** Extra `fetch` options (headers, credentials, …) for URL sources. */
|
|
95
|
+
requestInit?: RequestInit | undefined;
|
|
96
|
+
/** Replaces `fetch` entirely, e.g. with an authenticated client. */
|
|
97
|
+
fetcher?: ((url: string, init: RequestInit) => Promise<Response>) | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Called for non-2xx responses. Return `true` when handled (for example after redirecting to a
|
|
100
|
+
* sign-in page): the viewer then shows its empty state and does not call `onError`.
|
|
101
|
+
*/
|
|
102
|
+
onHttpError?: ((response: Response) => boolean | void | Promise<boolean | void>) | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Builds the message for an `HTTP_ERROR`. Return `undefined` to use the default, which reads an
|
|
105
|
+
* RFC 7807 body (`detail`, then `title`), then a JSON string body, then
|
|
106
|
+
* `Failed to fetch PDF: {status} {statusText}`.
|
|
107
|
+
*/
|
|
108
|
+
getHttpErrorMessage?: ((response: Response) => Promise<string | undefined>) | undefined;
|
|
109
|
+
}
|
|
110
|
+
/** Toolbar customization. */
|
|
111
|
+
export interface ToolbarConfig {
|
|
112
|
+
/** Toolbar placement. Default `'bottom'`. */
|
|
113
|
+
position?: 'bottom' | 'top' | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Actions to show. Their order within each group is fixed.
|
|
116
|
+
*
|
|
117
|
+
* @defaultValue all actions
|
|
118
|
+
*/
|
|
119
|
+
actions?: readonly ToolbarAction[] | undefined;
|
|
120
|
+
/** Actions hidden in compact, non-fullscreen mode. Default `['rotate', 'print']`. */
|
|
121
|
+
hiddenWhenCompact?: readonly ToolbarAction[] | undefined;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Imperative viewer API, available through `ref` and passed to `renderToolbar`. Values are a
|
|
125
|
+
* snapshot of the render that produced the object.
|
|
126
|
+
*/
|
|
127
|
+
export interface PdfViewerApi {
|
|
128
|
+
readonly status: PdfDocumentStatus;
|
|
129
|
+
/** Page count; `0` without a document. */
|
|
130
|
+
readonly numPages: number;
|
|
131
|
+
/** Current 1-based page, clamped to the document. */
|
|
132
|
+
readonly page: number;
|
|
133
|
+
/** Current scale (1 = 100%). */
|
|
134
|
+
readonly scale: number;
|
|
135
|
+
readonly rotation: Rotation;
|
|
136
|
+
readonly fullscreen: boolean;
|
|
137
|
+
/** Whether `zoomIn()` would change the scale. */
|
|
138
|
+
readonly canZoomIn: boolean;
|
|
139
|
+
/** Whether `zoomOut()` would change the scale. */
|
|
140
|
+
readonly canZoomOut: boolean;
|
|
141
|
+
goToPage(page: number): void;
|
|
142
|
+
nextPage(): void;
|
|
143
|
+
previousPage(): void;
|
|
144
|
+
zoomIn(): void;
|
|
145
|
+
zoomOut(): void;
|
|
146
|
+
/** Sets the scale, clamped to `[minScale, maxScale]`. */
|
|
147
|
+
setScale(scale: number): void;
|
|
148
|
+
/** Returns to `defaultScale`. */
|
|
149
|
+
resetZoom(): void;
|
|
150
|
+
/** Rotates by 90° clockwise (default) or counter-clockwise. */
|
|
151
|
+
rotate(direction?: 'cw' | 'ccw'): void;
|
|
152
|
+
toggleFullscreen(): void;
|
|
153
|
+
/** Saves the loaded document (no second request). */
|
|
154
|
+
download(): Promise<void>;
|
|
155
|
+
/** Prints according to `printMode`. */
|
|
156
|
+
print(): Promise<void>;
|
|
157
|
+
/** Loads the source again. */
|
|
158
|
+
reload(): void;
|
|
159
|
+
/** The loaded PDF.js document, for advanced use. */
|
|
160
|
+
getDocument(): PDFDocumentProxy | null;
|
|
161
|
+
}
|
|
162
|
+
/** Props for `PdfViewer`. Every piece of state supports the value / defaultValue / onChange trio. */
|
|
163
|
+
export interface PdfViewerProps extends PdfRequestOptions {
|
|
164
|
+
/** The document. `null`, `undefined` and `''` show the empty state. */
|
|
165
|
+
source: PdfSource | null | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* Download file name: a `File`'s name, else the URL's last `.pdf` segment, else `document.pdf`.
|
|
168
|
+
*
|
|
169
|
+
* @defaultValue derived from the source
|
|
170
|
+
*/
|
|
171
|
+
fileName?: string | undefined;
|
|
172
|
+
/** Controlled 1-based page. */
|
|
173
|
+
page?: number | undefined;
|
|
174
|
+
/** Initial page when uncontrolled, and the page a new document opens on. Default `1`. */
|
|
175
|
+
defaultPage?: number | undefined;
|
|
176
|
+
onPageChange?: ((page: number) => void) | undefined;
|
|
177
|
+
/** Controlled scale (1 = 100%). */
|
|
178
|
+
scale?: number | undefined;
|
|
179
|
+
/** Initial scale when uncontrolled; also the "reset zoom" target. Default `1`. */
|
|
180
|
+
defaultScale?: number | undefined;
|
|
181
|
+
onScaleChange?: ((scale: number) => void) | undefined;
|
|
182
|
+
/** Controlled rotation, relative to each page's natural orientation. */
|
|
183
|
+
rotation?: Rotation | undefined;
|
|
184
|
+
/** Initial rotation when uncontrolled. Default `0`. */
|
|
185
|
+
defaultRotation?: Rotation | undefined;
|
|
186
|
+
onRotationChange?: ((rotation: Rotation) => void) | undefined;
|
|
187
|
+
/** Controlled fullscreen state. */
|
|
188
|
+
fullscreen?: boolean | undefined;
|
|
189
|
+
/** Initial fullscreen state when uncontrolled. Default `false`. */
|
|
190
|
+
defaultFullscreen?: boolean | undefined;
|
|
191
|
+
onFullscreenChange?: ((fullscreen: boolean) => void) | undefined;
|
|
192
|
+
/**
|
|
193
|
+
* How fullscreen is presented. `'controlled'`: layout only, the parent presents it. `'native'`:
|
|
194
|
+
* the browser Fullscreen API on the viewer, falling back to `'overlay'`. `'overlay'`: a fixed
|
|
195
|
+
* full-viewport layer with a focus trap and scroll lock; `Esc` closes it.
|
|
196
|
+
*
|
|
197
|
+
* @defaultValue `'controlled'` when `fullscreen` is passed, else `'native'`
|
|
198
|
+
*/
|
|
199
|
+
fullscreenMode?: FullscreenMode | undefined;
|
|
200
|
+
/** Zoom floor. Default `0.25`. */
|
|
201
|
+
minScale?: number | undefined;
|
|
202
|
+
/** Zoom ceiling. Default `5`. */
|
|
203
|
+
maxScale?: number | undefined;
|
|
204
|
+
/** Zoom button increment. Default `0.05`. */
|
|
205
|
+
scaleStep?: number | undefined;
|
|
206
|
+
/** Opt-in preset ladder; the zoom buttons step between presets instead of by `scaleStep`. */
|
|
207
|
+
zoomLevels?: readonly number[] | undefined;
|
|
208
|
+
/** At the default scale, shrink the page to the available width. Default `true`. */
|
|
209
|
+
fitWidthAtDefaultScale?: boolean | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* Opt-in: at the default scale, scale the page to fill the width (`'width'`) or to fit entirely
|
|
212
|
+
* (`'page'`). Zooming away from the default scale shows the page at true size. Default `'none'`.
|
|
213
|
+
*/
|
|
214
|
+
fitMode?: 'none' | 'width' | 'page' | undefined;
|
|
215
|
+
/** Password for encrypted documents. */
|
|
216
|
+
password?: string | undefined;
|
|
217
|
+
/** Per-instance `getDocument` overrides. */
|
|
218
|
+
pdfjsOptions?: PdfJsDocumentOptions | undefined;
|
|
219
|
+
/** `false` hides the toolbar; an object customizes it. Default `true`. */
|
|
220
|
+
toolbar?: boolean | ToolbarConfig | undefined;
|
|
221
|
+
/** Viewport width (px) below which the compact layout applies. Default `960`. */
|
|
222
|
+
compactBreakpoint?: number | undefined;
|
|
223
|
+
/**
|
|
224
|
+
* Keyboard shortcuts while focus is inside the viewer (never while typing in a field, or with
|
|
225
|
+
* Alt, Ctrl or ⌘ held). Default `true`.
|
|
226
|
+
*
|
|
227
|
+
* @shortcut PageUp Previous page.
|
|
228
|
+
* @shortcut PageDown Next page.
|
|
229
|
+
* @shortcut ArrowLeft Previous page; a zoomed page scrolls horizontally first.
|
|
230
|
+
* @shortcut ArrowRight Next page; a zoomed page scrolls horizontally first.
|
|
231
|
+
* @shortcut Home First page.
|
|
232
|
+
* @shortcut End Last page.
|
|
233
|
+
* @shortcut + Zoom in (`=` also works).
|
|
234
|
+
* @shortcut - Zoom out (`_` also works).
|
|
235
|
+
* @shortcut 0 Reset zoom to `defaultScale`.
|
|
236
|
+
* @shortcut r Rotate clockwise.
|
|
237
|
+
* @shortcut Shift+R Rotate counter-clockwise.
|
|
238
|
+
* @shortcut f Toggle fullscreen.
|
|
239
|
+
*/
|
|
240
|
+
keyboardShortcuts?: boolean | undefined;
|
|
241
|
+
/** `'render'` prints through a hidden iframe; `'open-url'` opens the PDF in a new tab. Default `'render'`. */
|
|
242
|
+
printMode?: 'render' | 'open-url' | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* Canvas pixel budget per page (4096 × 4096). Above it, resolution degrades gracefully.
|
|
245
|
+
*
|
|
246
|
+
* @defaultValue `16777216`
|
|
247
|
+
*/
|
|
248
|
+
maxCanvasPixels?: number | undefined;
|
|
249
|
+
/**
|
|
250
|
+
* Label overrides (i18n). Keep the object stable (e.g. at module scope).
|
|
251
|
+
*
|
|
252
|
+
* @defaultValue English (`defaultLabels`)
|
|
253
|
+
*/
|
|
254
|
+
labels?: Partial<PdfViewerLabels> | undefined;
|
|
255
|
+
/**
|
|
256
|
+
* BCP 47 locale for number formatting, e.g. `'hu-HU'`.
|
|
257
|
+
*
|
|
258
|
+
* @defaultValue the browser locale
|
|
259
|
+
*/
|
|
260
|
+
locale?: string | undefined;
|
|
261
|
+
/** Page layout: `'single'` or `'continuous'` vertical scrolling. Default `'single'`. */
|
|
262
|
+
layout?: 'single' | 'continuous' | undefined;
|
|
263
|
+
/** Selectable text layer (copy, find, assistive technology). Default `false`. */
|
|
264
|
+
textLayer?: boolean | undefined;
|
|
265
|
+
/** Clickable links: internal links navigate, external links open in a new tab. Default `false`. */
|
|
266
|
+
annotationLayer?: boolean | undefined;
|
|
267
|
+
/** Editable page number in the toolbar. Default `false`. */
|
|
268
|
+
pageInput?: boolean | undefined;
|
|
269
|
+
/** The zoom label becomes a button that resets zoom. Default `false`. */
|
|
270
|
+
zoomReset?: boolean | undefined;
|
|
271
|
+
/** Ctrl/⌘ + wheel and trackpad-pinch zoom, anchored at the pointer. Default `false`. */
|
|
272
|
+
wheelZoom?: boolean | undefined;
|
|
273
|
+
/** Ask for the password of encrypted documents instead of showing an error. Default `false`. */
|
|
274
|
+
passwordPrompt?: boolean | undefined;
|
|
275
|
+
/** Replaces the built-in password prompt. */
|
|
276
|
+
renderPasswordPrompt?: ((context: {
|
|
277
|
+
incorrect: boolean;
|
|
278
|
+
submit: (password: string) => void;
|
|
279
|
+
}) => ReactNode) | undefined;
|
|
280
|
+
/** Page thumbnails sidebar (hidden in compact, non-fullscreen mode). Default `false`. */
|
|
281
|
+
thumbnails?: boolean | undefined;
|
|
282
|
+
/**
|
|
283
|
+
* Find-in-document bar with highlighting (implies the text layer). Default `false`.
|
|
284
|
+
*
|
|
285
|
+
* @shortcut Ctrl+F Focus the search field (`⌘+F` on macOS); `Enter` and `Shift+Enter` step through matches, `Escape` clears.
|
|
286
|
+
*/
|
|
287
|
+
search?: boolean | undefined;
|
|
288
|
+
/** Replaces the loading view. */
|
|
289
|
+
renderLoading?: (() => ReactNode) | undefined;
|
|
290
|
+
/** Replaces the error view (document and page errors). */
|
|
291
|
+
renderError?: ((error: PdfViewerError, actions: {
|
|
292
|
+
retry: () => void;
|
|
293
|
+
}) => ReactNode) | undefined;
|
|
294
|
+
/** Replaces the toolbar; receives the viewer API. */
|
|
295
|
+
renderToolbar?: ((api: PdfViewerApi) => ReactNode) | undefined;
|
|
296
|
+
/** Replaces the empty view. */
|
|
297
|
+
renderEmpty?: (() => ReactNode) | undefined;
|
|
298
|
+
/** Called when a document is ready. */
|
|
299
|
+
onDocumentLoad?: ((info: {
|
|
300
|
+
numPages: number;
|
|
301
|
+
fingerprint: string;
|
|
302
|
+
}) => void) | undefined;
|
|
303
|
+
/** Called after each completed page render. */
|
|
304
|
+
onPageRender?: ((info: PageRenderInfo) => void) | undefined;
|
|
305
|
+
/** Called for every failure except aborts, canceled renders and handled HTTP errors. */
|
|
306
|
+
onError?: ((error: PdfViewerError) => void) | undefined;
|
|
307
|
+
/** Return `false` to prevent the default download. */
|
|
308
|
+
onDownload?: ((context: {
|
|
309
|
+
fileName: string;
|
|
310
|
+
data: Uint8Array;
|
|
311
|
+
}) => void | false) | undefined;
|
|
312
|
+
/** Return `false` to prevent the default print. */
|
|
313
|
+
onPrint?: (() => void | false) | undefined;
|
|
314
|
+
className?: string | undefined;
|
|
315
|
+
style?: CSSProperties | undefined;
|
|
316
|
+
id?: string | undefined;
|
|
317
|
+
/**
|
|
318
|
+
* Accessible name of the viewer region.
|
|
319
|
+
*
|
|
320
|
+
* @defaultValue `labels.viewer`
|
|
321
|
+
*/
|
|
322
|
+
'aria-label'?: string | undefined;
|
|
323
|
+
}
|
|
324
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,97 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kingtech/react-pdf-viewer",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Accessible, themeable React PDF viewer built on PDF.js: zoom, rotation, fullscreen, search, thumbnails, download and print, with no UI-kit dependency.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"pdf",
|
|
8
|
+
"pdf-viewer",
|
|
9
|
+
"pdfjs",
|
|
10
|
+
"pdf.js",
|
|
11
|
+
"pdfjs-dist",
|
|
12
|
+
"viewer",
|
|
13
|
+
"document-viewer",
|
|
14
|
+
"accessible",
|
|
15
|
+
"a11y",
|
|
16
|
+
"ssr"
|
|
17
|
+
],
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"author": "Gyula Kiraly (https://github.com/kiralygyula92)",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/kiralygyula92/react-pdf-viewer.git",
|
|
23
|
+
"directory": "packages/react-pdf-viewer"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://react-pdf-viewer-chi.vercel.app/react-pdf-viewer/",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/kiralygyula92/react-pdf-viewer/issues"
|
|
28
|
+
},
|
|
29
|
+
"type": "module",
|
|
30
|
+
"sideEffects": [
|
|
31
|
+
"**/*.css"
|
|
32
|
+
],
|
|
33
|
+
"main": "./dist/index.js",
|
|
34
|
+
"module": "./dist/index.js",
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./dist/index.d.ts",
|
|
39
|
+
"import": "./dist/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./styles.css": "./dist/styles.css",
|
|
42
|
+
"./package.json": "./package.json"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"CHANGELOG.md",
|
|
47
|
+
"NOTICE"
|
|
48
|
+
],
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "vite build",
|
|
51
|
+
"prepack": "vite build",
|
|
52
|
+
"typecheck": "tsc --noEmit",
|
|
53
|
+
"test": "vitest run",
|
|
54
|
+
"test:watch": "vitest",
|
|
55
|
+
"qa": "publint --strict && attw --pack . --profile esm-only --exclude-entrypoints ./styles.css && size-limit"
|
|
56
|
+
},
|
|
57
|
+
"peerDependencies": {
|
|
58
|
+
"pdfjs-dist": "^6.0.0",
|
|
59
|
+
"react": ">=18.0.0",
|
|
60
|
+
"react-dom": ">=18.0.0"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
64
|
+
"@size-limit/preset-small-lib": "^14.0.0",
|
|
65
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
66
|
+
"@testing-library/react": "^16.3.3",
|
|
67
|
+
"@testing-library/user-event": "^14.6.7",
|
|
68
|
+
"@types/react": "^19.3.0",
|
|
69
|
+
"@types/react-dom": "^19.3.0",
|
|
70
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
71
|
+
"axe-core": "^4.13.0",
|
|
72
|
+
"jsdom": "^30.1.0",
|
|
73
|
+
"pdfjs-dist": "^6.3.289",
|
|
74
|
+
"publint": "^0.3.24",
|
|
75
|
+
"react": "^19.3.0",
|
|
76
|
+
"react-dom": "^19.3.0",
|
|
77
|
+
"size-limit": "^14.0.0",
|
|
78
|
+
"vite": "^8.3.0",
|
|
79
|
+
"vite-plugin-dts": "^5.1.1",
|
|
80
|
+
"vitest": "^5.0.1"
|
|
81
|
+
},
|
|
82
|
+
"publishConfig": {
|
|
83
|
+
"access": "public"
|
|
84
|
+
},
|
|
85
|
+
"size-limit": [
|
|
86
|
+
{
|
|
87
|
+
"name": "main entry (excluding peer dependencies)",
|
|
88
|
+
"path": "dist/index.js",
|
|
89
|
+
"limit": "20 kB",
|
|
90
|
+
"ignore": [
|
|
91
|
+
"react",
|
|
92
|
+
"react-dom",
|
|
93
|
+
"pdfjs-dist"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|