@react-pdf-kit/viewer 2.7.0-beta.0 → 2.7.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.
@@ -3,44 +3,46 @@ import { useLayoutContainer as t } from "../../../contexts/LayoutContainerContex
3
3
  import { useToolbarComponentContext as n } from "../../../contexts/ToolbarComponentContext.js";
4
4
  import { useToolComponentContext as r } from "../../../contexts/ToolComponentContext.js";
5
5
  import { useSearchContext as i } from "../../../contexts/SearchContext.js";
6
- import { useLocalizationContext as a } from "../../../contexts/LocalizationContext.js";
7
- import { t as ee } from "../../../LoaderIcon-D9YjinGf.js";
8
- import { useIconToolContext as o } from "../../../contexts/IconToolContext.js";
9
- import { t as s } from "../../../Button-jStpvb3T.js";
10
- import { t as c } from "../../../Input-Bb_-ljl1.js";
11
- import { useIconContext as l } from "../../../contexts/IconContext.js";
12
- import { useViewportContext as te } from "../../../contexts/ViewportContext.js";
13
- import { t as u } from "../../../RPTooltip-ZZoFqP7C.js";
14
- import { t as d } from "../../../DropDown-DikL-krI.js";
15
- import { InfoIcon as f } from "../../icons/InfoIcon.js";
16
- import { SearchIcon as p } from "../../icons/SearchIcon.js";
17
- import { t as m } from "../../../SearchTool.module-DUkVXfOn.js";
18
- import { t as h } from "../../../Checkbox-Brta-YKG.js";
19
- import { ClearIcon as g } from "../../icons/ClearIcon.js";
20
- import { SearchResultNavigator as _ } from "./SearchResultNavigator.js";
21
- import { SearchCloseButton as v } from "./SearchCloseButton.js";
22
- import { useCallback as y, useEffect as b, useMemo as x, useRef as S, useState as C } from "react";
23
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
6
+ import { useLocalizationContext as ee } from "../../../contexts/LocalizationContext.js";
7
+ import { t as te } from "../../../LoaderIcon-D9YjinGf.js";
8
+ import { useIconToolContext as a } from "../../../contexts/IconToolContext.js";
9
+ import { t as o } from "../../../Button-jStpvb3T.js";
10
+ import { t as s } from "../../../Input-Bb_-ljl1.js";
11
+ import { useIconContext as c } from "../../../contexts/IconContext.js";
12
+ import { useViewportContext as ne } from "../../../contexts/ViewportContext.js";
13
+ import { t as l } from "../../../RPTooltip-ZZoFqP7C.js";
14
+ import { t as re } from "../../../DropDown-DikL-krI.js";
15
+ import { InfoIcon as u } from "../../icons/InfoIcon.js";
16
+ import { SearchIcon as d } from "../../icons/SearchIcon.js";
17
+ import { t as f } from "../../../SearchTool.module-DUkVXfOn.js";
18
+ import { t as p } from "../../../Checkbox-Brta-YKG.js";
19
+ import { ClearIcon as m } from "../../icons/ClearIcon.js";
20
+ import { SearchResultNavigator as h } from "./SearchResultNavigator.js";
21
+ import { SearchCloseButton as g } from "./SearchCloseButton.js";
22
+ import { useCallback as _, useEffect as v, useMemo as y, useRef as b, useState as x } from "react";
23
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
24
24
  //#region lib/components/layout/toolbar/SearchTool.tsx
25
- var ne = () => {
26
- let { searchIcon: e } = l(), { searchIcon: t } = o();
27
- return e ?? t ?? /* @__PURE__ */ T(p, {});
28
- }, D = () => {
29
- let { searchClearIcon: e } = l(), { searchClearIcon: t } = o();
30
- return e ?? t ?? /* @__PURE__ */ T(g, {});
31
- }, O = ({ icon: o }) => {
32
- let { container: l } = t(), [g, O] = C(!1), k = S(g);
33
- k.current = g;
34
- let { pdf: A } = e(), [j, re] = C(null), { searchOptions: M, setSearchOptions: N, loading: ie, setSearch: P, totalMatches: F, currentMatchPosition: I, nextMatch: L, prevMatch: R, search: z } = i(), { searchTool: B = !0 } = n(), { searchTool: V = !0 } = r(), [H, U] = C(z), { localeMessages: W } = a(), { isSmallScreen: G } = te(), [K, q] = C(null), [J, ae] = C(!1), oe = y(() => {
35
- k.current && (P(""), U("")), O((e) => !e);
36
- }, [P]), Y = y(() => {
37
- P(""), U(""), O(!1);
38
- }, [P]), X = (e) => {
25
+ var ie = () => {
26
+ let { searchIcon: e } = c(), { searchIcon: t } = a();
27
+ return e ?? t ?? /* @__PURE__ */ C(d, {});
28
+ }, ae = () => {
29
+ let { searchClearIcon: e } = c(), { searchClearIcon: t } = a();
30
+ return e ?? t ?? /* @__PURE__ */ C(m, {});
31
+ }, T = ({ icon: a }) => {
32
+ let { container: c } = t(), [m, T] = x(!1), E = b(null), D = b(m);
33
+ D.current = m;
34
+ let { pdf: O } = e(), [k, A] = x(null), { searchOptions: j, setSearchOptions: M, loading: N, setSearch: P, totalMatches: F, currentMatchPosition: I, nextMatch: L, prevMatch: R, search: z } = i(), { searchTool: B = !0 } = n(), { searchTool: V = !0 } = r(), [H, U] = x(z), { localeMessages: W } = ee(), { isSmallScreen: G } = ne(), [K, q] = x(null), [oe, se] = x(!1), ce = _(() => {
35
+ D.current && (P(""), U("")), T((e) => !e);
36
+ }, [P]), J = _(() => {
37
+ P(""), U(""), T(!1), requestAnimationFrame(() => {
38
+ E.current?.focus();
39
+ });
40
+ }, [P]), Y = (e) => {
39
41
  let t = e.key === "Enter", n = e.key === " ";
40
- (t || n) && Y();
41
- }, Z = y((e) => {
42
- e.key === "Escape" && g && Y();
43
- }, [g]), se = y((e) => {
42
+ (t || n) && J();
43
+ }, X = _((e) => {
44
+ e.key === "Escape" && m && J();
45
+ }, [m]), Z = _((e) => {
44
46
  e.shiftKey && e.key === "Enter" ? R() : e.key === "Enter" && z !== H ? P(H) : e.key === "Enter" && L();
45
47
  }, [
46
48
  H,
@@ -49,38 +51,38 @@ var ne = () => {
49
51
  P,
50
52
  z
51
53
  ]);
52
- b(() => {
54
+ v(() => {
53
55
  U(z);
54
- }, [z]), b(() => {
55
- z && A && ae(!0);
56
- }, [z, A]), b(() => {
56
+ }, [z]), v(() => {
57
+ z && O && se(!0);
58
+ }, [z, O]), v(() => {
57
59
  z && z.trim() !== "" && (U(z), P(z));
58
- }, []), b(() => (window.addEventListener("keydown", Z), () => {
59
- window.removeEventListener("keydown", Z);
60
- }), [Z]), b(() => {
61
- j && setTimeout(() => {
62
- j.focus();
60
+ }, []), v(() => (window.addEventListener("keydown", X), () => {
61
+ window.removeEventListener("keydown", X);
62
+ }), [X]), v(() => {
63
+ k && setTimeout(() => {
64
+ k.focus();
63
65
  }, 0);
64
- }, [j]);
65
- let ce = y((e) => {
66
+ }, [k]);
67
+ let le = _((e) => {
66
68
  U(e.target.value);
67
- }, []), Q = y(() => {
69
+ }, []), Q = _(() => {
68
70
  U(""), P("");
69
- }, [P]), le = x(() => `${I} / ${F}`, [I, F]), { wholeWords: ue, matchCase: de } = x(() => M, [M]), fe = y((e) => {
70
- N((t) => ({
71
+ }, [P]), ue = y(() => `${I} / ${F}`, [I, F]), { wholeWords: de, matchCase: fe } = y(() => j, [j]), pe = _((e) => {
72
+ M((t) => ({
71
73
  ...t,
72
74
  matchCase: e
73
75
  }));
74
- }, [N]), pe = y((e) => {
75
- N((t) => ({
76
+ }, [M]), me = _((e) => {
77
+ M((t) => ({
76
78
  ...t,
77
79
  wholeWords: e
78
80
  }));
79
- }, [N]);
80
- b(() => {
81
- A && J && Y();
82
- }, [A, Y]);
83
- let $ = x(() => K?.querySelectorAll("[tabindex]:not([tabindex=\"-1\"])") || [], [K]), me = y((e) => {
81
+ }, [M]);
82
+ v(() => {
83
+ O && oe && J();
84
+ }, [O, J]);
85
+ let $ = y(() => K?.querySelectorAll("[tabindex]:not([tabindex=\"-1\"])") || [], [K]), he = _((e) => {
84
86
  if (e.key === "Tab") {
85
87
  let t = document.activeElement, n = -1;
86
88
  $.forEach((e, r) => {
@@ -99,53 +101,54 @@ var ne = () => {
99
101
  }
100
102
  }
101
103
  }, [$]);
102
- return !B || !V ? null : /* @__PURE__ */ T(w, { children: /* @__PURE__ */ T(d, {
103
- open: g,
104
- container: l,
104
+ return !B || !V ? null : /* @__PURE__ */ C(S, { children: /* @__PURE__ */ C(re, {
105
+ open: m,
106
+ container: c,
105
107
  side: "bottom",
106
108
  align: "start",
107
109
  tabIndex: 0,
108
110
  avoidCollisions: !1,
109
- triggerComponent: /* @__PURE__ */ T(u, {
111
+ triggerComponent: /* @__PURE__ */ C(l, {
110
112
  content: W?.searchButtonTooltip,
111
- children: /* @__PURE__ */ T(s, {
112
- active: g,
113
- onClick: oe,
113
+ children: /* @__PURE__ */ C(o, {
114
+ ref: E,
115
+ active: m,
116
+ onClick: ce,
114
117
  "aria-label": W?.searchButtonTooltip,
115
- "aria-expanded": g,
118
+ "aria-expanded": m,
116
119
  "aria-haspopup": "dialog",
117
- children: o || /* @__PURE__ */ T(ne, {})
120
+ children: a || /* @__PURE__ */ C(ie, {})
118
121
  })
119
122
  }),
120
- children: /* @__PURE__ */ E("div", {
123
+ children: /* @__PURE__ */ w("div", {
121
124
  ref: q,
122
- className: m["rp-search-tool-content"],
125
+ className: f["rp-search-tool-content"],
123
126
  tabIndex: -1,
124
- onKeyDown: me,
127
+ onKeyDown: he,
125
128
  role: "dialog",
126
129
  "aria-label": W?.searchInputTooltip || "Search dialog",
127
- children: [/* @__PURE__ */ E("div", {
128
- className: m["rp-search-tool-input-wrapper"],
129
- children: [/* @__PURE__ */ E("div", {
130
- className: m["rp-search-tool-input"],
130
+ children: [/* @__PURE__ */ w("div", {
131
+ className: f["rp-search-tool-input-wrapper"],
132
+ children: [/* @__PURE__ */ w("div", {
133
+ className: f["rp-search-tool-input"],
131
134
  children: [
132
- /* @__PURE__ */ T(u, {
135
+ /* @__PURE__ */ C(l, {
133
136
  content: W?.searchInputTooltip,
134
- children: /* @__PURE__ */ T(c, {
137
+ children: /* @__PURE__ */ C(s, {
135
138
  value: H,
136
- onKeyDown: se,
137
- onChange: ce,
138
- icon: /* @__PURE__ */ T(p, {}),
139
+ onKeyDown: Z,
140
+ onChange: le,
141
+ icon: /* @__PURE__ */ C(d, {}),
139
142
  placeholder: W?.searchInputPlaceholder,
140
- className: m["rp-search-input"],
141
- ref: re,
143
+ className: f["rp-search-input"],
144
+ ref: A,
142
145
  id: "search-input",
143
146
  name: "search-input",
144
147
  tabIndex: 0,
145
148
  "aria-label": W?.searchInputTooltip || W?.searchInputPlaceholder,
146
149
  "aria-describedby": "search-results-count",
147
- children: !!H && /* @__PURE__ */ T("span", {
148
- className: m["rp-search-tool-input-clear"],
150
+ children: !!H && /* @__PURE__ */ C("span", {
151
+ className: f["rp-search-tool-input-clear"],
149
152
  onClick: Q,
150
153
  role: "button",
151
154
  tabIndex: 0,
@@ -153,77 +156,77 @@ var ne = () => {
153
156
  onKeyDown: (e) => {
154
157
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), Q());
155
158
  },
156
- children: /* @__PURE__ */ T(D, {})
159
+ children: /* @__PURE__ */ C(ae, {})
157
160
  })
158
161
  })
159
162
  }),
160
- ie ? /* @__PURE__ */ T("span", {
163
+ N ? /* @__PURE__ */ C("span", {
161
164
  "aria-live": "polite",
162
165
  "aria-label": "Searching",
163
- children: /* @__PURE__ */ T(ee, {
164
- className: m["rp-search-loader-icon"],
166
+ children: /* @__PURE__ */ C(te, {
167
+ className: f["rp-search-loader-icon"],
165
168
  "aria-hidden": "true"
166
169
  })
167
- }) : /* @__PURE__ */ T("span", {
170
+ }) : /* @__PURE__ */ C("span", {
168
171
  id: "search-results-count",
169
172
  "aria-live": "polite",
170
- children: le
173
+ children: ue
171
174
  }),
172
- G && /* @__PURE__ */ T("div", {
173
- className: m["rp-search-tool-controls"],
174
- children: /* @__PURE__ */ T(v, {
175
- onKeyPress: X,
176
- handleClose: Y
175
+ G && /* @__PURE__ */ C("div", {
176
+ className: f["rp-search-tool-controls"],
177
+ children: /* @__PURE__ */ C(g, {
178
+ onKeyPress: Y,
179
+ handleClose: J
177
180
  })
178
181
  })
179
182
  ]
180
- }), /* @__PURE__ */ E("div", {
181
- className: m["rp-search-tool-input-checkboxes"],
183
+ }), /* @__PURE__ */ w("div", {
184
+ className: f["rp-search-tool-input-checkboxes"],
182
185
  children: [
183
- G && /* @__PURE__ */ T(_, {}),
184
- /* @__PURE__ */ T(h, {
186
+ G && /* @__PURE__ */ C(h, {}),
187
+ /* @__PURE__ */ C(p, {
185
188
  tabIndex: 0,
186
189
  name: "matchCase",
187
- value: de,
188
- onChange: fe,
190
+ value: fe,
191
+ onChange: pe,
189
192
  "aria-label": W?.searchMatchCaseLabel,
190
193
  children: W?.searchMatchCaseLabel
191
194
  }),
192
- !G && /* @__PURE__ */ T(u, {
195
+ !G && /* @__PURE__ */ C(l, {
193
196
  content: W?.searchMatchCaseTooltip,
194
- children: /* @__PURE__ */ T("div", {
195
- className: m["rp-search-icon-info"],
197
+ children: /* @__PURE__ */ C("div", {
198
+ className: f["rp-search-icon-info"],
196
199
  tabIndex: 0,
197
- children: /* @__PURE__ */ T(f, {})
200
+ children: /* @__PURE__ */ C(u, {})
198
201
  })
199
202
  }),
200
- /* @__PURE__ */ T(h, {
203
+ /* @__PURE__ */ C(p, {
201
204
  tabIndex: 0,
202
205
  name: "wholeWord",
203
- value: ue,
204
- onChange: pe,
206
+ value: de,
207
+ onChange: me,
205
208
  "aria-label": W?.searchWholeWordsLabel,
206
209
  children: W?.searchWholeWordsLabel
207
210
  }),
208
- !G && /* @__PURE__ */ T(u, {
211
+ !G && /* @__PURE__ */ C(l, {
209
212
  content: W?.searchWholeWordsTooltip,
210
- children: /* @__PURE__ */ T("div", {
213
+ children: /* @__PURE__ */ C("div", {
211
214
  tabIndex: 0,
212
- className: m["rp-search-icon-info"],
213
- children: /* @__PURE__ */ T(f, {})
215
+ className: f["rp-search-icon-info"],
216
+ children: /* @__PURE__ */ C(u, {})
214
217
  })
215
218
  })
216
219
  ]
217
220
  })]
218
- }), !G && /* @__PURE__ */ E("div", {
219
- className: m["rp-search-tool-controls"],
220
- children: [/* @__PURE__ */ T(_, {}), /* @__PURE__ */ T(v, {
221
- onKeyPress: X,
222
- handleClose: Y
221
+ }), !G && /* @__PURE__ */ w("div", {
222
+ className: f["rp-search-tool-controls"],
223
+ children: [/* @__PURE__ */ C(h, {}), /* @__PURE__ */ C(g, {
224
+ onKeyPress: Y,
225
+ handleClose: J
223
226
  })]
224
227
  })]
225
228
  })
226
229
  }) });
227
230
  };
228
231
  //#endregion
229
- export { O as SearchTool };
232
+ export { T as SearchTool };
package/dist/icons.js CHANGED
@@ -28,5 +28,4 @@ import { ThumbnailIcon as E } from "./components/icons/Thumbnail.js";
28
28
  import { t as D } from "./LightPdfIcon-DL8MYtWQ.js";
29
29
  import { t as O } from "./DarkPdfIcon-B5ehd9CV.js";
30
30
  import { ChevronDownIcon as k } from "./components/icons/ChevronDownIcon.js";
31
- import { WrappedScrollingIcon as A } from "./components/icons/WrappedScrollingIcon.js";
32
- export { f as RPIconCheck, k as RPIconChevronDown, t as RPIconChevronUp, T as RPIconClear, c as RPIconClockwise, o as RPIconClose, O as RPIconDarkPdf, l as RPIconDualPage, u as RPIconDualPageWithCover, g as RPIconFileDownloadDefault, n as RPIconFileUploadDefault, v as RPIconFullScreen, y as RPIconGoToDown, x as RPIconHandModeDefault, h as RPIconHorizontalScrolling, s as RPIconInfo, D as RPIconLightPdf, e as RPIconLoader, r as RPIconMoon, p as RPIconPageScrolling, _ as RPIconPrintDefault, w as RPIconSearch, d as RPIconSinglePage, i as RPIconSun, b as RPIconTextSelectionDefault, a as RPIconThreeDot, E as RPIconThumbnail, m as RPIconVerticalScrolling, A as RPIconWrappedScrolling, S as RPIconZoomIn, C as RPIconZoomOut };
31
+ export { f as RPIconCheck, k as RPIconChevronDown, t as RPIconChevronUp, T as RPIconClear, c as RPIconClockwise, o as RPIconClose, O as RPIconDarkPdf, l as RPIconDualPage, u as RPIconDualPageWithCover, g as RPIconFileDownloadDefault, n as RPIconFileUploadDefault, v as RPIconFullScreen, y as RPIconGoToDown, x as RPIconHandModeDefault, h as RPIconHorizontalScrolling, s as RPIconInfo, D as RPIconLightPdf, e as RPIconLoader, r as RPIconMoon, p as RPIconPageScrolling, _ as RPIconPrintDefault, w as RPIconSearch, d as RPIconSinglePage, i as RPIconSun, b as RPIconTextSelectionDefault, a as RPIconThreeDot, E as RPIconThumbnail, m as RPIconVerticalScrolling, S as RPIconZoomIn, C as RPIconZoomOut };
@@ -26,6 +26,5 @@ export { TextSelectionDefaultIcon as RPIconTextSelectionDefault } from './compon
26
26
  export { ThreeDotIcon as RPIconThreeDot } from './components/icons/ThreeDotIcon';
27
27
  export { ThumbnailIcon as RPIconThumbnail } from './components/icons/Thumbnail';
28
28
  export { VerticalScrollingIcon as RPIconVerticalScrolling } from './components/icons/VerticalScrollingIcon';
29
- export { WrappedScrollingIcon as RPIconWrappedScrolling } from './components/icons/WrappedScrollingIcon';
30
29
  export { ZoomInIcon as RPIconZoomIn } from './components/icons/ZoomInIcon';
31
30
  export { ZoomOutIcon as RPIconZoomOut } from './components/icons/ZoomOutIcon';
@@ -3,7 +3,7 @@ import { LicenseType as t } from "../types.js";
3
3
  import { appConsole as n } from "../appConsole.js";
4
4
  import { useCallback as r, useEffect as i, useState as a } from "react";
5
5
  //#region lib/utils/hooks/useLicense.ts
6
- var o = /* @__PURE__ */ new Date("2026-05-15T05:12:06.096Z"), s = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvIokvErJ0Fctu0jduSAx\ngr+5Har/VSuZLlOunS28hnlqqA+OF1apHL7RYkjBosS15yvviYdLrVWYHpHnoY4b\nHLQ9I6YX6FMB9T/VbB4xLdVdKvfi8r49aTScl5EKuSpgpPgz2VSJTfvVGcRuth/Y\nBm7PPGYdL2l2gvKDxchmmsHFPukGki9L4JOUeIVX0GXAxabENckaEH/iC1NZhX+W\nvXnpHeHuIIKlZ16LSivXNgo6BH2Z3GFdg4G3cAaXr6qNP8fsacYNqv2SpTW1viFD\nvzcGRabN25gpJAp9/syeScefWH3OiJY1lmw88oTiJbjIoiq6AkPhfn3G9mF54nvR\nkwIDAQAB\n-----END PUBLIC KEY-----", c = "Please visit https://app.react-pdf-kit.dev to generate a new license key.", l = {
6
+ var o = /* @__PURE__ */ new Date("2026-05-20T03:23:27.973Z"), s = "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvIokvErJ0Fctu0jduSAx\ngr+5Har/VSuZLlOunS28hnlqqA+OF1apHL7RYkjBosS15yvviYdLrVWYHpHnoY4b\nHLQ9I6YX6FMB9T/VbB4xLdVdKvfi8r49aTScl5EKuSpgpPgz2VSJTfvVGcRuth/Y\nBm7PPGYdL2l2gvKDxchmmsHFPukGki9L4JOUeIVX0GXAxabENckaEH/iC1NZhX+W\nvXnpHeHuIIKlZ16LSivXNgo6BH2Z3GFdg4G3cAaXr6qNP8fsacYNqv2SpTW1viFD\nvzcGRabN25gpJAp9/syeScefWH3OiJY1lmw88oTiJbjIoiq6AkPhfn3G9mF54nvR\nkwIDAQAB\n-----END PUBLIC KEY-----", c = "Please visit https://app.react-pdf-kit.dev to generate a new license key.", l = {
7
7
  invalidLicense: `You are currently using without a valid license. ${c}`,
8
8
  mismatchedDomain: `Your license key is not valid for the current domain / IP. ${c}`,
9
9
  expired: `Your license key has expired. ${c}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pdf-kit/viewer",
3
- "version": "2.7.0-beta.0",
3
+ "version": "2.7.0-beta.2",
4
4
  "private": false,
5
5
  "description": "A react-pdf-viewer component for React and Next.js. Suitable for react-pdf document.",
6
6
  "keywords": [