@pdf-viewer/react 1.14.0-beta.1 → 1.14.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.
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +29 -0
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +1 -1
- package/dist/main.js +19 -17
- package/dist/types/components/layout/toolbar/tools/SelectionModeSwitcherTool.d.ts +3 -0
- package/dist/types/main.d.ts +2 -1
- package/dist/types/utils/types.d.ts +7 -0
- package/dist/utils/hooks/useLicense.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as i, useCallback as S } from "react";
|
|
3
|
+
import { UIButton as u } from "../../../ui/Button.js";
|
|
4
|
+
import x from "../../../ui/RPTooltip.js";
|
|
5
|
+
import { useLocalizationContext as a } from "../../../../contexts/LocalizationContext.js";
|
|
6
|
+
import { useSelectionModeContext as h } from "../../../../contexts/SelectionModeContext.js";
|
|
7
|
+
import { SelectionMode as n } from "../../../../utils/types.js";
|
|
8
|
+
import { TextSelectionDefaultIcon as s } from "../../../icons/TextSelectionDefaultIcon.js";
|
|
9
|
+
import { HandModeDefaultIcon as M } from "../../../icons/HandModeDefaultIcon.js";
|
|
10
|
+
import "../../../../clsx-0c6e471a.js";
|
|
11
|
+
import "../../../../utils/withRef.js";
|
|
12
|
+
import "../../../../index-c9a2990a.js";
|
|
13
|
+
import "react-dom";
|
|
14
|
+
import "../../../../floating-ui.react-dom-d22a10b4.js";
|
|
15
|
+
import "../../../../utils/appConsole.js";
|
|
16
|
+
import "../../../../utils/hooks/useLocalization.js";
|
|
17
|
+
import "../../../../th_TH-d627cd51.js";
|
|
18
|
+
const U = ({ icons: d }) => {
|
|
19
|
+
const { textSelectionIcon: r, handModeIcon: c } = d ?? {}, { selectionMode: m, setSelectionMode: l } = h(), { localeMessages: o } = a(), t = i(() => m === n.TEXT, [m]), p = i(
|
|
20
|
+
() => t ? o == null ? void 0 : o.handToolTooltip : o == null ? void 0 : o.textSelectionTooltip,
|
|
21
|
+
[t, o]
|
|
22
|
+
), f = S(() => {
|
|
23
|
+
l(t ? n.HAND : n.TEXT);
|
|
24
|
+
}, [t, l]), T = i(() => t ? c ?? /* @__PURE__ */ e(M, {}) : r ?? /* @__PURE__ */ e(s, {}), [t, r, c]);
|
|
25
|
+
return /* @__PURE__ */ e(x, { content: p, children: /* @__PURE__ */ e(u, { onClick: f, "aria-label": p, children: T }) });
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
U as SelectionModeSwitcherTool
|
|
29
|
+
};
|
|
@@ -141,7 +141,7 @@ const Uo = (m) => {
|
|
|
141
141
|
if (!p || !i)
|
|
142
142
|
return null;
|
|
143
143
|
if (i)
|
|
144
|
-
return /* @__PURE__ */ o(s, { onClick: n, children: /* @__PURE__ */ e(x, { className: "rp-menu-item", content: t == null ? void 0 : t.printTooltip, children: [
|
|
144
|
+
return /* @__PURE__ */ o(s, { onClick: () => n(), children: /* @__PURE__ */ e(x, { className: "rp-menu-item", content: t == null ? void 0 : t.printTooltip, children: [
|
|
145
145
|
/* @__PURE__ */ o("div", { className: "rp-menu-item-left", children: r || /* @__PURE__ */ o(l, {}) }),
|
|
146
146
|
t == null ? void 0 : t.printLabel
|
|
147
147
|
] }) });
|
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RPProvider as
|
|
1
|
+
import { RPProvider as Mr } from "./components/RPProvider.js";
|
|
2
2
|
import { a as vr, R as Vr, S as br, b as kr, u as yr, c as Br, d as Hr } from "./ToolbarLayout.module-c133fcc0.js";
|
|
3
3
|
import { RPConfig as Or } from "./components/RPConfig.js";
|
|
4
4
|
import { RPLayout as Er } from "./components/layout/RPLayout.js";
|
|
@@ -14,15 +14,15 @@ import { useOpenFileContext as mt } from "./contexts/FileInputContext.js";
|
|
|
14
14
|
import { useZoomContext as it } from "./contexts/ZoomContext.js";
|
|
15
15
|
import { useHighlightContext as xt } from "./contexts/HighlightContext.js";
|
|
16
16
|
import { usePdfProperties as ft } from "./utils/hooks/usePdfProperties.js";
|
|
17
|
-
import { useFullScreenContext as
|
|
17
|
+
import { useFullScreenContext as at } from "./contexts/FullScreenContext.js";
|
|
18
18
|
import { usePageRotateContext as ut } from "./utils/hooks/usePageRotateContext.js";
|
|
19
19
|
import { useElementPageContext as Tt } from "./contexts/ElementPageContext.js";
|
|
20
20
|
import { ThemeSwitcherTool as ct } from "./components/layout/toolbar/tools/ThemeSwitcherTool.js";
|
|
21
21
|
import { ThumbnailTool as dt } from "./components/layout/toolbar/tools/ThumbnailTool.js";
|
|
22
22
|
import { FileUploadTool as ht } from "./components/layout/toolbar/tools/FileUploadTool.js";
|
|
23
|
-
import { FileDownloadTool as
|
|
24
|
-
import { PrintTool as
|
|
25
|
-
import { FullScreenTool as
|
|
23
|
+
import { FileDownloadTool as wt } from "./components/layout/toolbar/tools/FileDownloadTool.js";
|
|
24
|
+
import { PrintTool as Ft } from "./components/layout/toolbar/tools/PrintTool.js";
|
|
25
|
+
import { FullScreenTool as Mt } from "./components/layout/toolbar/tools/FullScreenTool.js";
|
|
26
26
|
import { PreviousPageTool as vt } from "./components/layout/toolbar/tools/PreviousPageTool.js";
|
|
27
27
|
import { NextPageTool as bt } from "./components/layout/toolbar/tools/NextPageTool.js";
|
|
28
28
|
import { InputPageTool as yt } from "./components/layout/toolbar/tools/InputPageTool.js";
|
|
@@ -34,7 +34,8 @@ import { RotateClockwiseTool as qt } from "./components/layout/toolbar/tools/Rot
|
|
|
34
34
|
import { RotateCounterclockwiseTool as Gt } from "./components/layout/toolbar/tools/RotateCounterclockwiseTool.js";
|
|
35
35
|
import { RPHorizontalBar as Kt } from "./components/layout/toolbar/tools/defaults/RPHorizontalBar.js";
|
|
36
36
|
import { RPVerticalBar as Wt } from "./components/layout/toolbar/tools/defaults/RPVerticalBar.js";
|
|
37
|
-
import {
|
|
37
|
+
import { SelectionModeSwitcherTool as Yt } from "./components/layout/toolbar/tools/SelectionModeSwitcherTool.js";
|
|
38
|
+
import { Locales as $t, ScrollMode as om, SelectionMode as rm, ThemeVariables as tm, ViewMode as mm, ZoomLevel as pm } from "./utils/types.js";
|
|
38
39
|
import "react/jsx-runtime";
|
|
39
40
|
import "react";
|
|
40
41
|
import "./contexts/DocumentPasswordContext.js";
|
|
@@ -169,14 +170,14 @@ import "./components/icons/ChevronDownIcon.js";
|
|
|
169
170
|
import "./components/layout/toolbar/ThumbnailTool.js";
|
|
170
171
|
export {
|
|
171
172
|
Ut as DocumentPropertiesTool,
|
|
172
|
-
|
|
173
|
+
wt as FileDownloadTool,
|
|
173
174
|
ht as FileUploadTool,
|
|
174
|
-
|
|
175
|
+
Mt as FullScreenTool,
|
|
175
176
|
yt as InputPageTool,
|
|
176
|
-
|
|
177
|
+
$t as Locales,
|
|
177
178
|
bt as NextPageTool,
|
|
178
179
|
vt as PreviousPageTool,
|
|
179
|
-
|
|
180
|
+
Ft as PrintTool,
|
|
180
181
|
Or as RPConfig,
|
|
181
182
|
Ur as RPController,
|
|
182
183
|
vr as RPDefaultLayout,
|
|
@@ -184,20 +185,21 @@ export {
|
|
|
184
185
|
Kt as RPHorizontalBar,
|
|
185
186
|
Er as RPLayout,
|
|
186
187
|
Vr as RPPages,
|
|
187
|
-
|
|
188
|
+
Mr as RPProvider,
|
|
188
189
|
qr as RPTheme,
|
|
189
190
|
Wt as RPVerticalBar,
|
|
190
191
|
qt as RotateClockwiseTool,
|
|
191
192
|
Gt as RotateCounterclockwiseTool,
|
|
192
|
-
|
|
193
|
+
om as ScrollMode,
|
|
193
194
|
br as SearchTool,
|
|
194
|
-
|
|
195
|
+
rm as SelectionMode,
|
|
196
|
+
Yt as SelectionModeSwitcherTool,
|
|
195
197
|
ct as ThemeSwitcherTool,
|
|
196
|
-
|
|
198
|
+
tm as ThemeVariables,
|
|
197
199
|
dt as ThumbnailTool,
|
|
198
|
-
|
|
200
|
+
mm as ViewMode,
|
|
199
201
|
Ht as ZoomInTool,
|
|
200
|
-
|
|
202
|
+
pm as ZoomLevel,
|
|
201
203
|
Et as ZoomLevelTool,
|
|
202
204
|
Ot as ZoomOutTool,
|
|
203
205
|
Kr as useDarkModeContext,
|
|
@@ -205,7 +207,7 @@ export {
|
|
|
205
207
|
rt as useDropFileZoneContext,
|
|
206
208
|
Tt as useElementPageContext,
|
|
207
209
|
kr as useFileDownload,
|
|
208
|
-
|
|
210
|
+
at as useFullScreenContext,
|
|
209
211
|
xt as useHighlightContext,
|
|
210
212
|
mt as useOpenFileContext,
|
|
211
213
|
ut as usePageRotateContext,
|
package/dist/types/main.d.ts
CHANGED
|
@@ -41,5 +41,6 @@ export { RotateClockwiseTool } from './components/layout/toolbar/tools/RotateClo
|
|
|
41
41
|
export { RotateCounterclockwiseTool } from './components/layout/toolbar/tools/RotateCounterclockwiseTool';
|
|
42
42
|
export { RPHorizontalBar } from './components/layout/toolbar/tools/defaults/RPHorizontalBar';
|
|
43
43
|
export { RPVerticalBar } from './components/layout/toolbar/tools/defaults/RPVerticalBar';
|
|
44
|
-
export
|
|
44
|
+
export { SelectionModeSwitcherTool } from './components/layout/toolbar/tools/SelectionModeSwitcherTool';
|
|
45
|
+
export type { CharacterMap, DarkModeProps, DownloadToolProps, FullScreenToolProps, Localization, MatchValue, OpenFileToolProps, PageNavigationToolProps, PdfPage, PdfProperties, PreparePrintProgress, PrintOptions, PrintParameter, PrintToolProps, RPConfigProps, RPThemeProps, RPProviderProps, RPDefaultLayoutProps, RPLayoutProps, RPIcons, RPSlots, SearchOptions, SetPageResult, ScrollModeInitialProps, ThumbnailToolProps, ViewModeInitialProps, ZoomProps, RPHorizontalBarProps, RPHorizontalBarSlots, RPHorizontalBarIcons, RPVerticalBarProps, RPVerticalBarSlots, RPVerticalBarIcons, TextHighlight, MatchHighlight, RectPosition, ThemeSwitcherIcons, ThemeSwitcherToolProps, ToolProps, ToolbarSection, ToolbarProps, SelectionModeSwitcherToolProps, SelectionModeSwitcherIcons } from './utils/types';
|
|
45
46
|
export { ViewMode, ScrollMode, ZoomLevel, Locales, ThemeVariables, SelectionMode } from './utils/types';
|
|
@@ -724,6 +724,13 @@ export interface ThemeSwitcherIcons {
|
|
|
724
724
|
export interface ThemeSwitcherToolProps {
|
|
725
725
|
icons?: ThemeSwitcherIcons;
|
|
726
726
|
}
|
|
727
|
+
export interface SelectionModeSwitcherIcons {
|
|
728
|
+
textSelectionIcon?: React.ReactNode;
|
|
729
|
+
handModeIcon?: React.ReactNode;
|
|
730
|
+
}
|
|
731
|
+
export interface SelectionModeSwitcherToolProps {
|
|
732
|
+
icons?: SelectionModeSwitcherIcons;
|
|
733
|
+
}
|
|
727
734
|
export interface ToolbarSection {
|
|
728
735
|
component: React.ReactNode;
|
|
729
736
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState as E, useCallback as h, useEffect as A } from "react";
|
|
2
2
|
import { appConsole as l } from "../appConsole.js";
|
|
3
|
-
const b = /* @__PURE__ */ new Date("2025-
|
|
3
|
+
const b = /* @__PURE__ */ new Date("2025-12-01T02:51:38.197Z"), d = "Please visit https://www.react-pdf.dev/manage-license/ to generate a new license key.", s = {
|
|
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}`,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@pdf-viewer/react",
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "A react-pdf-viewer component for React and Next.js. Suitable for react-pdf document.",
|
|
5
|
-
"version": "1.14.0-beta.
|
|
5
|
+
"version": "1.14.0-beta.2",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"react-pdf",
|
|
8
8
|
"react-pdf-viewer",
|