@pdf-viewer/react 1.0.0 → 1.0.1-rc.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.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
import { DocumentContextType, RPSrc,
|
|
2
|
+
import { DocumentContextType, RPSrc, CharacterMap, LoadPDFOptions } from '../utils/types';
|
|
3
3
|
import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
|
|
4
4
|
declare const DocumentContext: React.Context<DocumentContextType>;
|
|
5
5
|
interface Props extends PropsWithChildren, LoadPDFOptions {
|
|
6
6
|
src?: RPSrc;
|
|
7
|
-
characterMap?:
|
|
7
|
+
characterMap?: CharacterMap;
|
|
8
8
|
onLoaded?: (pdfDocument: PDFDocumentProxy) => void;
|
|
9
9
|
}
|
|
10
10
|
export declare const DocumentProvider: FC<Props>;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -19,5 +19,5 @@ export { useSearchContext } from './contexts/SearchContext';
|
|
|
19
19
|
export { usePdfProperties } from './utils/hooks/usePdfProperties';
|
|
20
20
|
export { useFullScreenContext } from './contexts/FullScreenContext';
|
|
21
21
|
export { type PDFDocumentProxy } from 'pdfjs-dist';
|
|
22
|
-
export type {
|
|
22
|
+
export type { CharacterMap, DarkModeProps, DownloadToolProps, FullScreenToolProps, Localization, MatchValue, OpenFileToolProps, PageNavigationToolProps, PdfPage, PdfProperties, PreparePrintProgress, PrintToolProps, RPConfigProps, RPThemeProps, RPProviderProps, RPLayoutProps, RPIcons, RPSlots, SearchOptions, SetPageResult, ScrollModeProps, ThumbnailToolProps, ViewModeProps, ZoomProps } from './utils/types';
|
|
23
23
|
export { ViewMode, ScrollMode, ZoomLevel } from './utils/types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api.js';
|
|
2
|
-
import { PdfPage, RPSrc,
|
|
3
|
-
export declare const useLoadPdf: (src?: RPSrc, characterMap?:
|
|
2
|
+
import { PdfPage, RPSrc, CharacterMap, LoadPDFOptions } from '../types';
|
|
3
|
+
export declare const useLoadPdf: (src?: RPSrc, characterMap?: CharacterMap, options?: LoadPDFOptions) => {
|
|
4
4
|
pdf: PDFDocumentProxy | undefined;
|
|
5
5
|
pages: Map<number, PdfPage>;
|
|
6
6
|
loading: boolean;
|
|
@@ -418,14 +418,14 @@ export interface LayerProviderProps extends PropsWithChildren {
|
|
|
418
418
|
textLayer?: boolean;
|
|
419
419
|
}
|
|
420
420
|
export type RPThemeProps = RPThemeContextType;
|
|
421
|
-
export interface
|
|
421
|
+
export interface CharacterMap {
|
|
422
422
|
url: string;
|
|
423
423
|
isCompressed: boolean;
|
|
424
424
|
}
|
|
425
425
|
export interface RPProviderProps extends PropsWithChildren, LoadPDFOptions, RPControllerProps {
|
|
426
426
|
src: RPSrc;
|
|
427
427
|
workerUrl?: string;
|
|
428
|
-
characterMap?:
|
|
428
|
+
characterMap?: CharacterMap;
|
|
429
429
|
}
|
|
430
430
|
export interface RPControllerProps extends PropsWithChildren, DarkModeProviderProps, RotateProviderProps, LayerProviderProps, ZoomProviderProps, PageProviderProps, ViewportProps, ScrollModeProps {
|
|
431
431
|
initialSearch?: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState as g, useCallback as E, useEffect as h } from "react";
|
|
2
2
|
import { appConsole as l } from "../appConsole.js";
|
|
3
|
-
const A = /* @__PURE__ */ new Date("2025-03-
|
|
3
|
+
const A = /* @__PURE__ */ new Date("2025-03-04T08:37:41.016Z"), d = "Please visit https://www.react-pdf.dev/license-management/ to generate a new license key.", o = {
|
|
4
4
|
invalidLicense: `You are currently using without a valid license. ${d}`,
|
|
5
5
|
mismatchedDomain: `Your license key is not valid for the current domain / IP. ${d}`,
|
|
6
6
|
expired: `Your license key has expired. ${d}`,
|