@pdf-viewer/react 1.4.0-beta.1 → 1.4.0-beta.2
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,30 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { appConsole as
|
|
4
|
-
import { LoaderIcon as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as d, useContext as i } from "react";
|
|
3
|
+
import { appConsole as m } from "../utils/appConsole.js";
|
|
4
|
+
import { LoaderIcon as s } from "../components/icons/LoaderIcon.js";
|
|
5
|
+
const t = d({
|
|
6
6
|
LoaderImageComponent: void 0
|
|
7
|
-
}),
|
|
8
|
-
const o =
|
|
9
|
-
return typeof o.LoaderImageComponent > "u" &&
|
|
10
|
-
},
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}, [r]);
|
|
15
|
-
const i = () => e ? (e == null ? void 0 : e.trim().startsWith("<svg")) ? /* @__PURE__ */ t("span", { dangerouslySetInnerHTML: { __html: e } }) : /* @__PURE__ */ t("img", { src: e, alt: "react-pdf-viewer-loader" }) : /* @__PURE__ */ t(p, {});
|
|
16
|
-
return /* @__PURE__ */ t(
|
|
17
|
-
n.Provider,
|
|
7
|
+
}), u = () => {
|
|
8
|
+
const o = i(t);
|
|
9
|
+
return typeof o.LoaderImageComponent > "u" && m.error("Please use this hooks inside children component of RPProvider"), o;
|
|
10
|
+
}, C = ({ children: o, loaderImage: e }) => {
|
|
11
|
+
const n = () => e || /* @__PURE__ */ r(s, {});
|
|
12
|
+
return /* @__PURE__ */ r(
|
|
13
|
+
t.Provider,
|
|
18
14
|
{
|
|
19
15
|
value: {
|
|
20
|
-
LoaderImageComponent:
|
|
16
|
+
LoaderImageComponent: n
|
|
21
17
|
},
|
|
22
18
|
children: o
|
|
23
19
|
}
|
|
24
20
|
);
|
|
25
21
|
};
|
|
26
22
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
t as LoaderContext,
|
|
24
|
+
C as LoaderProvider,
|
|
25
|
+
u as useLoaderContext
|
|
30
26
|
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { LoaderImage } from '../utils/types';
|
|
3
|
+
interface LoaderContextType {
|
|
4
|
+
LoaderImageComponent?: () => JSX.Element | undefined;
|
|
5
|
+
}
|
|
3
6
|
export declare const LoaderContext: import('react').Context<LoaderContextType>;
|
|
4
7
|
interface Props extends PropsWithChildren {
|
|
5
|
-
loaderImage?:
|
|
8
|
+
loaderImage?: LoaderImage;
|
|
6
9
|
}
|
|
7
10
|
export declare const useLoaderContext: () => LoaderContextType;
|
|
8
11
|
export declare const LoaderProvider: FC<PropsWithChildren<Props>>;
|
|
@@ -582,10 +582,11 @@ export interface SelectionModeContextType {
|
|
|
582
582
|
export interface SelectionModeProps {
|
|
583
583
|
initialSelectionMode?: SelectionMode;
|
|
584
584
|
}
|
|
585
|
+
export type LoaderImage = JSX.Element;
|
|
585
586
|
export interface LoadPDFOptions {
|
|
586
587
|
onLoadError?: (error: any) => void;
|
|
587
588
|
onLoaded?: (pdfDocument: PDFDocumentProxy) => void;
|
|
588
|
-
loaderImage?:
|
|
589
|
+
loaderImage?: LoaderImage;
|
|
589
590
|
}
|
|
590
591
|
export interface ScrollPosition {
|
|
591
592
|
left: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState as g, useCallback as h, useEffect as E } from "react";
|
|
2
2
|
import { appConsole as l } from "../appConsole.js";
|
|
3
|
-
const A = /* @__PURE__ */ new Date("2025-04-
|
|
3
|
+
const A = /* @__PURE__ */ new Date("2025-04-10T10:49:34.429Z"), 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}`,
|