@react-pdf-kit/viewer 2.0.0-beta.11 → 2.0.0-beta.12

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.
Files changed (181) hide show
  1. package/dist/{Combination-54a77a7a.js → Combination-136ff99c.js} +184 -187
  2. package/dist/Paginate.module-4eef00aa.js +8 -0
  3. package/dist/RPLayout.module-b4b23e29.js +14 -0
  4. package/dist/RPSplitter-f6acf13b.js +71 -0
  5. package/dist/ToolbarLayout.module-6e339802.js +12 -0
  6. package/dist/assets/style.css +1 -1
  7. package/dist/assets/style.js +32 -30
  8. package/dist/components/RPController.js +1 -1
  9. package/dist/components/RPDropFileZone.js +1 -1
  10. package/dist/components/RPPages.js +544 -497
  11. package/dist/components/RPProvider.js +32 -22
  12. package/dist/components/icons/DualPageWithCoverIcon.js +22 -0
  13. package/dist/components/layout/LayoutContainer.js +1 -1
  14. package/dist/components/layout/LayoutWrapper.js +1 -1
  15. package/dist/components/layout/RPDefaultLayout.js +58 -36
  16. package/dist/components/layout/RPLayout.js +32 -28
  17. package/dist/components/layout/SkipLink.js +29 -0
  18. package/dist/components/layout/WrapperLayout.js +1 -1
  19. package/dist/components/layout/sidebar/RPSidebar.js +32 -37
  20. package/dist/components/layout/sidebar/RPSplitter.js +6 -59
  21. package/dist/components/layout/sidebar/Thumbnail.js +57 -48
  22. package/dist/components/layout/sidebar/Thumbnails.js +9 -9
  23. package/dist/components/layout/toolbar/DarkModeTool.js +1 -1
  24. package/dist/components/layout/toolbar/DocumentDialog.js +28 -28
  25. package/dist/components/layout/toolbar/DocumentProperties.js +3 -3
  26. package/dist/components/layout/toolbar/FileDownloadTool.js +3 -3
  27. package/dist/components/layout/toolbar/FileUploadTool.js +3 -3
  28. package/dist/components/layout/toolbar/FullScreenTool.js +3 -3
  29. package/dist/components/layout/toolbar/MenuItem.js +2 -2
  30. package/dist/components/layout/toolbar/MenuSeparator.js +2 -2
  31. package/dist/components/layout/toolbar/MostPageTool.js +3 -3
  32. package/dist/components/layout/toolbar/OtherTool.js +43 -34
  33. package/dist/components/layout/toolbar/Paginate.js +53 -46
  34. package/dist/components/layout/toolbar/PrintTool.js +3 -3
  35. package/dist/components/layout/toolbar/RPMenuItem.js +2 -2
  36. package/dist/components/layout/toolbar/RPMoreOptions.js +45 -44
  37. package/dist/components/layout/toolbar/RPToolbar.js +7 -6
  38. package/dist/components/layout/toolbar/RPToolbarEnd.js +6 -5
  39. package/dist/components/layout/toolbar/RotateTool.js +3 -3
  40. package/dist/components/layout/toolbar/ScrollModeTool.js +37 -37
  41. package/dist/components/layout/toolbar/SearchCloseButton.js +1 -1
  42. package/dist/components/layout/toolbar/SearchResultNavigator.js +44 -24
  43. package/dist/components/layout/toolbar/SearchTool.js +138 -117
  44. package/dist/components/layout/toolbar/SelectionModeTool.js +3 -3
  45. package/dist/components/layout/toolbar/ThumbnailTool.js +1 -1
  46. package/dist/components/layout/toolbar/ToolbarCustom.js +43 -27
  47. package/dist/components/layout/toolbar/ToolbarDefault.js +42 -33
  48. package/dist/components/layout/toolbar/ToolbarLayout.js +9 -8
  49. package/dist/components/layout/toolbar/ViewModeTool.js +43 -34
  50. package/dist/components/layout/toolbar/ZoomTool.js +3 -3
  51. package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +2 -2
  52. package/dist/components/layout/toolbar/tools/DualPageTool.js +3 -3
  53. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +202 -0
  54. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +6 -6
  55. package/dist/components/layout/toolbar/tools/FileUploadTool.js +5 -5
  56. package/dist/components/layout/toolbar/tools/FirstPageTool.js +197 -0
  57. package/dist/components/layout/toolbar/tools/FullScreenTool.js +16 -15
  58. package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +37 -0
  59. package/dist/components/layout/toolbar/tools/InputPageTool.js +35 -28
  60. package/dist/components/layout/toolbar/tools/LastPageTool.js +197 -0
  61. package/dist/components/layout/toolbar/tools/NextPageTool.js +9 -8
  62. package/dist/components/layout/toolbar/tools/PageScrollingTool.js +37 -0
  63. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +15 -14
  64. package/dist/components/layout/toolbar/tools/PrintTool.js +4 -4
  65. package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +12 -5
  66. package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +9 -9
  67. package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +18 -10
  68. package/dist/components/layout/toolbar/tools/SinglePageTool.js +2 -2
  69. package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +10 -2
  70. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +13 -12
  71. package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +37 -0
  72. package/dist/components/layout/toolbar/tools/ZoomInTool.js +15 -14
  73. package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +1 -1
  74. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +75 -41
  75. package/dist/components/layout/toolbar/tools/ZoomOutTool.js +12 -11
  76. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +7 -6
  77. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +1 -1
  78. package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +11 -11
  79. package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +22 -15
  80. package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +20 -13
  81. package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +22 -14
  82. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +35 -19
  83. package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +21 -14
  84. package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +33 -19
  85. package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +54 -36
  86. package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +39 -23
  87. package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +52 -29
  88. package/dist/components/page/AnnotationLayer.js +76 -69
  89. package/dist/components/page/CanvasLayer.js +1 -1
  90. package/dist/components/page/CustomElement.js +1 -1
  91. package/dist/components/page/DualPage.js +1 -1
  92. package/dist/components/page/DualPageWithCover.js +131 -0
  93. package/dist/components/page/RPPage.js +1 -1
  94. package/dist/components/page/SinglePage.js +1 -1
  95. package/dist/components/page/TextHighlightLayer.js +1 -1
  96. package/dist/components/page/TextLayer.js +1 -1
  97. package/dist/components/ui/Button.js +14 -12
  98. package/dist/components/ui/Checkbox.js +84 -77
  99. package/dist/components/ui/DropDown.js +2 -2
  100. package/dist/components/ui/Input.js +12 -11
  101. package/dist/components/ui/LoadingIndicator.js +1 -1
  102. package/dist/components/ui/PasswordModal.js +44 -30
  103. package/dist/contexts/DimensionPagesContext.js +1 -1
  104. package/dist/contexts/DropFileZoneContext.js +1 -1
  105. package/dist/contexts/ElementPageContext.js +1 -1
  106. package/dist/contexts/EventCallbackContext.js +12 -8
  107. package/dist/contexts/FileInputContext.js +1 -1
  108. package/dist/contexts/HighlightContext.js +1 -1
  109. package/dist/contexts/LocalizationContext.js +1 -1
  110. package/dist/contexts/PagesRotateContext.js +1 -1
  111. package/dist/contexts/PaginationContext.js +1 -1
  112. package/dist/contexts/PrintContext.js +1 -1
  113. package/dist/contexts/RPDocumentContext.js +1 -1
  114. package/dist/contexts/RenderQueueProvider.js +1 -1
  115. package/dist/contexts/RotationContext.js +1 -1
  116. package/dist/contexts/ScrollModeContext.js +1 -1
  117. package/dist/contexts/SearchContext.js +1 -1
  118. package/dist/contexts/SelectionModeContext.js +1 -1
  119. package/dist/contexts/ThumbnailsContext.js +1 -1
  120. package/dist/contexts/ViewModeContext.js +19 -15
  121. package/dist/contexts/ZoomContext.js +1 -1
  122. package/dist/de_DE-a553b162.js +489 -0
  123. package/dist/{index-4baea9b5.js → index-61f59539.js} +1 -1
  124. package/dist/main.js +115 -99
  125. package/dist/types/components/icons/DualPageWithCoverIcon.d.ts +2 -0
  126. package/dist/types/components/layout/LayoutContainer.d.ts +1 -5
  127. package/dist/types/components/layout/LayoutWrapper.d.ts +1 -5
  128. package/dist/types/components/layout/SkipLink.d.ts +7 -0
  129. package/dist/types/components/layout/sidebar/Thumbnails.d.ts +1 -3
  130. package/dist/types/components/layout/toolbar/RPToolbar.d.ts +1 -3
  131. package/dist/types/components/layout/toolbar/tools/DualPageWithCoverTool.d.ts +3 -0
  132. package/dist/types/components/layout/toolbar/tools/FirstPageTool.d.ts +3 -0
  133. package/dist/types/components/layout/toolbar/tools/HorizontalScrollingTool.d.ts +3 -0
  134. package/dist/types/components/layout/toolbar/tools/LastPageTool.d.ts +3 -0
  135. package/dist/types/components/layout/toolbar/tools/PageScrollingTool.d.ts +3 -0
  136. package/dist/types/components/layout/toolbar/tools/VerticalScrollingTool.d.ts +3 -0
  137. package/dist/types/components/page/DualPageWithCover.d.ts +5 -0
  138. package/dist/types/components/page/RPPage.d.ts +1 -3
  139. package/dist/types/components/ui/Button.d.ts +1 -3
  140. package/dist/types/components/ui/Checkbox.d.ts +1 -0
  141. package/dist/types/components/ui/Input.d.ts +1 -3
  142. package/dist/types/components/ui/RPTooltip.d.ts +1 -3
  143. package/dist/types/locales/de_DE.json.d.ts +83 -0
  144. package/dist/types/locales/en_US.json.d.ts +2 -0
  145. package/dist/types/locales/it_IT.json.d.ts +2 -0
  146. package/dist/types/locales/pt_PT.json.d.ts +2 -0
  147. package/dist/types/locales/th_TH.json.d.ts +2 -0
  148. package/dist/types/locales/zh_CN.json.d.ts +2 -0
  149. package/dist/types/main.d.ts +7 -1
  150. package/dist/types/utils/annotations.d.ts +10 -1
  151. package/dist/types/utils/calculatePage.d.ts +3 -3
  152. package/dist/types/utils/hooks/usePresentPage.d.ts +2 -1
  153. package/dist/types/utils/hooks/useTextSelection.d.ts +7 -0
  154. package/dist/types/utils/types.d.ts +34 -3
  155. package/dist/types/utils/withRef.d.ts +5 -4
  156. package/dist/utils/annotations.js +145 -150
  157. package/dist/utils/calculatePage.js +17 -11
  158. package/dist/utils/getZoomLevel.js +9 -9
  159. package/dist/utils/highlight.js +139 -139
  160. package/dist/utils/hooks/useFileDownload.js +1 -1
  161. package/dist/utils/hooks/useLicense.js +1 -1
  162. package/dist/utils/hooks/useLoadPdf.js +1 -1
  163. package/dist/utils/hooks/useLocalization.js +12 -11
  164. package/dist/utils/hooks/usePageRotateContext.js +1 -1
  165. package/dist/utils/hooks/usePaginate.js +1 -1
  166. package/dist/utils/hooks/usePinch.js +1 -1
  167. package/dist/utils/hooks/usePresentPage.js +45 -45
  168. package/dist/utils/hooks/usePrint.js +1 -1
  169. package/dist/utils/hooks/useRotate.js +1 -1
  170. package/dist/utils/hooks/useScrollToPage.js +1 -1
  171. package/dist/utils/hooks/useSearch.js +76 -62
  172. package/dist/utils/hooks/useTextSelection.js +76 -0
  173. package/dist/utils/hooks/useThumbnail.js +1 -1
  174. package/dist/utils/hooks/useVirtualReactWindow.js +60 -42
  175. package/dist/utils/types.js +14 -13
  176. package/dist/utils/withRef.js +5 -5
  177. package/package.json +2 -3
  178. package/dist/Paginate.module-206a7d7d.js +0 -8
  179. package/dist/RPLayout.module-967bf4bc.js +0 -13
  180. package/dist/ToolbarLayout.module-1fee0a18.js +0 -11
  181. package/dist/th_TH-d627cd51.js +0 -398
@@ -1,63 +1,63 @@
1
- import { jsx as r, Fragment as f, jsxs as i } from "react/jsx-runtime";
2
- import { G as C } from "../../../index-4baea9b5.js";
3
- import { MenuItem as e } from "./MenuItem.js";
4
- import { useToolbarComponentContext as L } from "../../../contexts/ToolbarComponentContext.js";
5
- import { PageScrollingIcon as h } from "../../icons/PageScrollingIcon.js";
6
- import { VerticalScrollingIcon as T } from "../../icons/VerticalScrollingIcon.js";
7
- import { HorizontalScrollingIcon as s } from "../../icons/HorizontalScrollingIcon.js";
8
- import { useScrollModeContext as N } from "../../../contexts/ScrollModeContext.js";
9
- import { ViewMode as G, ScrollMode as l } from "../../../utils/types.js";
10
- import { CheckIcon as p } from "../../icons/CheckIcon.js";
1
+ import { jsx as r, Fragment as L, jsxs as i } from "react/jsx-runtime";
2
+ import { G as f } from "../../../index-61f59539.js";
3
+ import { MenuItem as p } from "./MenuItem.js";
4
+ import { useToolbarComponentContext as h } from "../../../contexts/ToolbarComponentContext.js";
5
+ import { PageScrollingIcon as T } from "../../icons/PageScrollingIcon.js";
6
+ import { VerticalScrollingIcon as s } from "../../icons/VerticalScrollingIcon.js";
7
+ import { HorizontalScrollingIcon as N } from "../../icons/HorizontalScrollingIcon.js";
8
+ import { useScrollModeContext as G } from "../../../contexts/ScrollModeContext.js";
9
+ import { ViewMode as a, ScrollMode as l } from "../../../utils/types.js";
10
+ import { CheckIcon as u } from "../../icons/CheckIcon.js";
11
11
  import { useViewModeContext as O } from "../../../contexts/ViewModeContext.js";
12
12
  import { useMemo as R } from "react";
13
- import { useIconContext as d } from "../../../contexts/IconContext.js";
14
- import u from "../../ui/RPTooltip.js";
13
+ import { useIconContext as I } from "../../../contexts/IconContext.js";
14
+ import d from "../../ui/RPTooltip.js";
15
15
  import { useLocalizationContext as x } from "../../../contexts/LocalizationContext.js";
16
- import { useIconToolContext as I } from "../../../contexts/IconToolContext.js";
17
- import { useToolComponentContext as v } from "../../../contexts/ToolComponentContext.js";
16
+ import { useIconToolContext as S } from "../../../contexts/IconToolContext.js";
17
+ import { useToolComponentContext as A } from "../../../contexts/ToolComponentContext.js";
18
18
  import "../../../index-c0faa594.js";
19
19
  import "react-dom";
20
20
  import "../../../index-e3ee9457.js";
21
- import "../../../Combination-54a77a7a.js";
21
+ import "../../../Combination-136ff99c.js";
22
22
  import "../../../floating-ui.react-dom-5ec29bd6.js";
23
23
  import "../../../index-655864a7.js";
24
24
  import "../../../clsx-0c6e471a.js";
25
25
  import "../../../utils/appConsole.js";
26
26
  import "../../../contexts/InitialStateContext.js";
27
- import "../../../th_TH-d627cd51.js";
27
+ import "../../../de_DE-a553b162.js";
28
28
  import "../../../utils/withRef.js";
29
29
  import "../../../utils/hooks/useLocalization.js";
30
- const z = () => {
31
- const { pageScrollIcon: t } = d(), { pageScrollIcon: n } = I();
32
- return t || n || /* @__PURE__ */ r(h, {});
33
- }, A = () => {
34
- const { verticalScrollIcon: t } = d(), { verticalScrollIcon: n } = I();
30
+ const _ = () => {
31
+ const { pageScrollIcon: t } = I(), { pageScrollIcon: n } = S();
35
32
  return t || n || /* @__PURE__ */ r(T, {});
36
- }, g = () => {
37
- const { horizontalScrollIcon: t } = d(), { horizontalScrollIcon: n } = I();
33
+ }, v = () => {
34
+ const { verticalScrollIcon: t } = I(), { verticalScrollIcon: n } = S();
38
35
  return t || n || /* @__PURE__ */ r(s, {});
36
+ }, z = () => {
37
+ const { horizontalScrollIcon: t } = I(), { horizontalScrollIcon: n } = S();
38
+ return t || n || /* @__PURE__ */ r(N, {});
39
39
  }, io = () => {
40
- const { scrollModeTool: t = !0 } = L(), { scrollModeTool: n = !0 } = v(), { viewMode: S } = O(), { scrollMode: c, setScrollMode: m } = N(), { localeMessages: o } = x(), a = R(() => S === G.DUAL_PAGE, [S]);
41
- return !t || !n ? null : /* @__PURE__ */ r(f, { children: /* @__PURE__ */ i(C, { children: [
42
- /* @__PURE__ */ r(e, { onClick: () => m(l.PAGE_SCROLLING), children: /* @__PURE__ */ i(u, { className: "rp-menu-item", content: o == null ? void 0 : o.pageScrollingTooltip, children: [
43
- /* @__PURE__ */ r("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ r(z, {}) }),
40
+ const { scrollModeTool: t = !0 } = h(), { scrollModeTool: n = !0 } = A(), { viewMode: c } = O(), { scrollMode: m, setScrollMode: e } = G(), { localeMessages: o } = x(), C = R(() => c === a.DUAL_PAGE || c === a.DUAL_PAGE_WITH_COVER, [c]);
41
+ return !t || !n ? null : /* @__PURE__ */ r(L, { children: /* @__PURE__ */ i(f, { children: [
42
+ /* @__PURE__ */ r(p, { onClick: () => e(l.PAGE_SCROLLING), children: /* @__PURE__ */ i(d, { className: "rp-menu-item", content: o == null ? void 0 : o.pageScrollingTooltip, children: [
43
+ /* @__PURE__ */ r("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ r(_, {}) }),
44
44
  o == null ? void 0 : o.pageScrollingLabel,
45
- c === l.PAGE_SCROLLING ? /* @__PURE__ */ r(p, { className: "rp-menu-item-right" }) : null
45
+ m === l.PAGE_SCROLLING ? /* @__PURE__ */ r(u, { className: "rp-menu-item-right" }) : null
46
46
  ] }) }),
47
- /* @__PURE__ */ r(e, { onClick: () => m(l.VERTICAL_SCROLLING), children: /* @__PURE__ */ i(u, { className: "rp-menu-item", content: o == null ? void 0 : o.verticalScrollingTooltip, children: [
48
- /* @__PURE__ */ r("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ r(A, {}) }),
47
+ /* @__PURE__ */ r(p, { onClick: () => e(l.VERTICAL_SCROLLING), children: /* @__PURE__ */ i(d, { className: "rp-menu-item", content: o == null ? void 0 : o.verticalScrollingTooltip, children: [
48
+ /* @__PURE__ */ r("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ r(v, {}) }),
49
49
  o == null ? void 0 : o.verticalScrollingLabel,
50
- c === l.VERTICAL_SCROLLING ? /* @__PURE__ */ r(p, { className: "rp-menu-item-right" }) : null
50
+ m === l.VERTICAL_SCROLLING ? /* @__PURE__ */ r(u, { className: "rp-menu-item-right" }) : null
51
51
  ] }) }),
52
52
  /* @__PURE__ */ r(
53
- e,
53
+ p,
54
54
  {
55
- disabled: a,
56
- onClick: () => m(l.HORIZONTAL_SCROLLING),
57
- children: /* @__PURE__ */ i(u, { className: "rp-menu-item", content: o == null ? void 0 : o.horizontalTooltip, children: [
58
- /* @__PURE__ */ r("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ r(g, {}) }),
55
+ disabled: C,
56
+ onClick: () => e(l.HORIZONTAL_SCROLLING),
57
+ children: /* @__PURE__ */ i(d, { className: "rp-menu-item", content: o == null ? void 0 : o.horizontalTooltip, children: [
58
+ /* @__PURE__ */ r("div", { className: "rp-menu-item-left", children: /* @__PURE__ */ r(z, {}) }),
59
59
  o == null ? void 0 : o.horizontalLabel,
60
- c === l.HORIZONTAL_SCROLLING ? /* @__PURE__ */ r(p, { className: "rp-menu-item-right" }) : null
60
+ m === l.HORIZONTAL_SCROLLING ? /* @__PURE__ */ r(u, { className: "rp-menu-item-right" }) : null
61
61
  ] })
62
62
  }
63
63
  )
@@ -14,7 +14,7 @@ import "../../../utils/withRef.js";
14
14
  import "../../../clsx-0c6e471a.js";
15
15
  import "../../../utils/appConsole.js";
16
16
  import "../../../utils/hooks/useLocalization.js";
17
- import "../../../th_TH-d627cd51.js";
17
+ import "../../../de_DE-a553b162.js";
18
18
  const z = ({ onKeyPress: r, handleClose: i }) => {
19
19
  const { localeMessages: o } = c();
20
20
  return /* @__PURE__ */ t(m, { content: o == null ? void 0 : o.searchCloseButtonTooltip, children: /* @__PURE__ */ t(
@@ -1,10 +1,10 @@
1
- import { jsxs as e, Fragment as h, jsx as r } from "react/jsx-runtime";
2
- import p from "../../ui/RPTooltip.js";
3
- import { UIButton as m } from "../../ui/Button.js";
4
- import { ChevronUpIcon as a } from "../../icons/ChevronUpIcon.js";
5
- import { useLocalizationContext as l } from "../../../contexts/LocalizationContext.js";
1
+ import { jsxs as l, Fragment as d, jsx as r } from "react/jsx-runtime";
2
+ import m from "../../ui/RPTooltip.js";
3
+ import { UIButton as a } from "../../ui/Button.js";
4
+ import { ChevronUpIcon as e } from "../../icons/ChevronUpIcon.js";
5
+ import { useLocalizationContext as h } from "../../../contexts/LocalizationContext.js";
6
6
  import { useSearchContext as s } from "../../../contexts/SearchContext.js";
7
- import { c as o } from "../../../SearchTool.module-99f60dc7.js";
7
+ import { c as i } from "../../../SearchTool.module-99f60dc7.js";
8
8
  import "react";
9
9
  import "../../../index-c0faa594.js";
10
10
  import "react-dom";
@@ -15,7 +15,7 @@ import "../../../utils/withRef.js";
15
15
  import "../../../clsx-0c6e471a.js";
16
16
  import "../../../utils/appConsole.js";
17
17
  import "../../../utils/hooks/useLocalization.js";
18
- import "../../../th_TH-d627cd51.js";
18
+ import "../../../de_DE-a553b162.js";
19
19
  import "../../../utils/hooks/useSearch.js";
20
20
  import "../../../utils/types.js";
21
21
  import "../../../utils/highlight.js";
@@ -50,40 +50,60 @@ import "../../../contexts/SmoothScrollContext.js";
50
50
  import "../../../utils/getScrollDistance.js";
51
51
  import "../../../utils/calculatePage.js";
52
52
  import "../../../utils/getWordPositionInPage.js";
53
- const lt = () => {
54
- const { totalMatches: i, nextMatch: n, prevMatch: c } = s(), { localeMessages: t } = l();
55
- return /* @__PURE__ */ e(h, { children: [
53
+ const ht = () => {
54
+ const { totalMatches: p, nextMatch: n, prevMatch: c } = s(), { localeMessages: t } = h(), o = !p || p === 0;
55
+ return /* @__PURE__ */ l(d, { children: [
56
56
  /* @__PURE__ */ r(
57
- p,
57
+ m,
58
58
  {
59
59
  content: t == null ? void 0 : t.searchPrevTooltip,
60
- className: o["rp-search-tool-result-navigator"],
61
- children: /* @__PURE__ */ r(m, { tabIndex: 0, onClick: c, "aria-label": t == null ? void 0 : t.searchPrevTooltip, children: /* @__PURE__ */ r(
60
+ className: i["rp-search-tool-result-navigator"],
61
+ children: /* @__PURE__ */ r(
62
62
  a,
63
63
  {
64
- className: o["rp-search-tool-input-icon"],
65
- "aria-disabled": !i
64
+ tabIndex: 0,
65
+ onClick: c,
66
+ "aria-label": t == null ? void 0 : t.searchPrevTooltip,
67
+ disabled: o,
68
+ "aria-disabled": o,
69
+ children: /* @__PURE__ */ r(
70
+ e,
71
+ {
72
+ className: i["rp-search-tool-input-icon"],
73
+ "aria-hidden": "true"
74
+ }
75
+ )
66
76
  }
67
- ) })
77
+ )
68
78
  }
69
79
  ),
70
80
  /* @__PURE__ */ r(
71
- p,
81
+ m,
72
82
  {
73
83
  content: t == null ? void 0 : t.searchNextTooltip,
74
- className: o["rp-search-tool-result-navigator"],
75
- children: /* @__PURE__ */ r(m, { tabIndex: 0, onClick: n, "aria-label": t == null ? void 0 : t.searchNextTooltip, children: /* @__PURE__ */ r(
84
+ className: i["rp-search-tool-result-navigator"],
85
+ children: /* @__PURE__ */ r(
76
86
  a,
77
87
  {
78
- style: { transform: "rotate(180deg" },
79
- className: o["rp-search-tool-input-icon"],
80
- "aria-disabled": !i
88
+ tabIndex: 0,
89
+ onClick: n,
90
+ "aria-label": t == null ? void 0 : t.searchNextTooltip,
91
+ disabled: o,
92
+ "aria-disabled": o,
93
+ children: /* @__PURE__ */ r(
94
+ e,
95
+ {
96
+ style: { transform: "rotate(180deg" },
97
+ className: i["rp-search-tool-input-icon"],
98
+ "aria-hidden": "true"
99
+ }
100
+ )
81
101
  }
82
- ) })
102
+ )
83
103
  }
84
104
  )
85
105
  ] });
86
106
  };
87
107
  export {
88
- lt as SearchResultNavigator
108
+ ht as SearchResultNavigator
89
109
  };
@@ -1,26 +1,26 @@
1
- import { jsx as t, Fragment as ct, jsxs as I } from "react/jsx-runtime";
2
- import { UIButton as at } from "../../ui/Button.js";
3
- import { SearchIcon as z } from "../../icons/SearchIcon.js";
4
- import { useState as C, useCallback as i, useEffect as l, useMemo as W } from "react";
5
- import { useLayoutContainer as st } from "../../../contexts/LayoutContainerContext.js";
1
+ import { jsx as o, Fragment as at, jsxs as C } from "react/jsx-runtime";
2
+ import { UIButton as ct } from "../../ui/Button.js";
3
+ import { SearchIcon as A } from "../../icons/SearchIcon.js";
4
+ import { useState as b, useCallback as i, useEffect as l, useMemo as W } from "react";
5
+ import { useLayoutContainer as pt } from "../../../contexts/LayoutContainerContext.js";
6
6
  import { c as n } from "../../../SearchTool.module-99f60dc7.js";
7
- import { UIInput as pt } from "../../ui/Input.js";
8
- import { UICheckbox as V } from "../../ui/Checkbox.js";
9
- import { ClearIcon as mt } from "../../icons/ClearIcon.js";
7
+ import { UIInput as mt } from "../../ui/Input.js";
8
+ import { UICheckbox as $ } from "../../ui/Checkbox.js";
9
+ import { ClearIcon as ht } from "../../icons/ClearIcon.js";
10
10
  import { LoaderIcon as lt } from "../../icons/LoaderIcon.js";
11
- import { useSearchContext as ht } from "../../../contexts/SearchContext.js";
11
+ import { useSearchContext as st } from "../../../contexts/SearchContext.js";
12
12
  import { useIconContext as dt } from "../../../contexts/IconContext.js";
13
13
  import { useDocumentContext as ut } from "../../../contexts/RPDocumentContext.js";
14
- import T from "../../ui/RPTooltip.js";
14
+ import E from "../../ui/RPTooltip.js";
15
15
  import { useToolbarComponentContext as ft } from "../../../contexts/ToolbarComponentContext.js";
16
16
  import { useLocalizationContext as It } from "../../../contexts/LocalizationContext.js";
17
- import { InfoIcon as $ } from "../../icons/InfoIcon.js";
17
+ import { InfoIcon as j } from "../../icons/InfoIcon.js";
18
18
  import { useViewportContext as Ct } from "../../../contexts/ViewportContext.js";
19
- import { SearchResultNavigator as j } from "./SearchResultNavigator.js";
20
- import { SearchCloseButton as q } from "./SearchCloseButton.js";
21
- import { UIDropDown as xt } from "../../ui/DropDown.js";
22
- import { useIconToolContext as St } from "../../../contexts/IconToolContext.js";
23
- import { useToolComponentContext as bt } from "../../../contexts/ToolComponentContext.js";
19
+ import { SearchResultNavigator as q } from "./SearchResultNavigator.js";
20
+ import { SearchCloseButton as z } from "./SearchCloseButton.js";
21
+ import { UIDropDown as bt } from "../../ui/DropDown.js";
22
+ import { useIconToolContext as xt } from "../../../contexts/IconToolContext.js";
23
+ import { useToolComponentContext as St } from "../../../contexts/ToolComponentContext.js";
24
24
  import "../../../clsx-0c6e471a.js";
25
25
  import "../../../utils/withRef.js";
26
26
  import "../../../index-c0faa594.js";
@@ -29,7 +29,7 @@ import "../../../index-655864a7.js";
29
29
  import "../../icons/CheckIcon.js";
30
30
  import "../../../utils/hooks/useSearch.js";
31
31
  import "../../../utils/types.js";
32
- import "../../../th_TH-d627cd51.js";
32
+ import "../../../de_DE-a553b162.js";
33
33
  import "../../../utils/highlight.js";
34
34
  import "../../../utils/charators.js";
35
35
  import "../../../contexts/VirtualScrollContext.js";
@@ -66,171 +66,192 @@ import "../../../floating-ui.react-dom-5ec29bd6.js";
66
66
  import "../../../utils/hooks/useLocalization.js";
67
67
  import "../../icons/ChevronUpIcon.js";
68
68
  import "../../icons/CloseIcon.js";
69
- import "../../../index-4baea9b5.js";
70
- import "../../../Combination-54a77a7a.js";
71
- const Et = () => {
72
- const { searchIcon: x } = dt(), { searchIcon: v } = St();
73
- return x || v || /* @__PURE__ */ t(z, {});
69
+ import "../../../index-61f59539.js";
70
+ import "../../../Combination-136ff99c.js";
71
+ const yt = () => {
72
+ const { searchIcon: x } = dt(), { searchIcon: v } = xt();
73
+ return x || v || /* @__PURE__ */ o(A, {});
74
74
  }, jo = ({ icon: x }) => {
75
- const { container: v } = st(), [S, K] = C(!1), { pdf: b } = ut(), [w, A] = C(null), {
76
- searchOptions: L,
77
- setSearchOptions: E,
78
- loading: F,
79
- setSearch: a,
80
- totalMatches: D,
81
- currentMatchPosition: O,
82
- nextMatch: B,
75
+ const { container: v } = pt(), [s, L] = b(!1), { pdf: S } = ut(), [k, F] = b(null), {
76
+ searchOptions: D,
77
+ setSearchOptions: y,
78
+ loading: H,
79
+ setSearch: c,
80
+ totalMatches: K,
81
+ currentMatchPosition: B,
82
+ nextMatch: O,
83
83
  prevMatch: P,
84
84
  search: e
85
- } = ht(), { searchTool: H = !0 } = ft(), { searchTool: G = !0 } = bt(), [h, d] = C(e), { localeMessages: o } = It(), { isSmallScreen: u } = Ct(), [y, J] = C(null), [Q, X] = C(!1), Y = i(() => {
86
- K(!0);
87
- }, []), m = i(() => {
88
- a(""), d(""), K(!1);
89
- }, [a]), R = (r) => {
90
- const c = r.key === "Enter", f = r.key === " ";
91
- (c || f) && m();
92
- }, k = i(
85
+ } = st(), { searchTool: G = !0 } = ft(), { searchTool: J = !0 } = St(), [d, u] = b(e), { localeMessages: t } = It(), { isSmallScreen: f } = Ct(), [T, Q] = b(null), [X, Y] = b(!1), Z = i(() => {
86
+ L(!0);
87
+ }, []), h = i(() => {
88
+ c(""), u(""), L(!1);
89
+ }, [c]), R = (r) => {
90
+ const a = r.key === "Enter", I = r.key === " ";
91
+ (a || I) && h();
92
+ }, w = i(
93
93
  (r) => {
94
- r.key === "Escape" && S && m();
94
+ r.key === "Escape" && s && h();
95
95
  },
96
- [S]
97
- ), Z = i(
96
+ [s]
97
+ ), _ = i(
98
98
  (r) => {
99
- r.shiftKey && r.key === "Enter" ? P() : r.key === "Enter" && e !== h ? a(h) : r.key === "Enter" && B();
99
+ r.shiftKey && r.key === "Enter" ? P() : r.key === "Enter" && e !== d ? c(d) : r.key === "Enter" && O();
100
100
  },
101
- [h, P, B, a, e]
101
+ [d, P, O, c, e]
102
102
  );
103
103
  l(() => {
104
- d(e);
104
+ u(e);
105
105
  }, [e]), l(() => {
106
- e && b && X(!0);
107
- }, [e, b]), l(() => {
108
- e && e.trim() !== "" && (d(e), a(e));
109
- }, []), l(() => (window.addEventListener("keydown", k), () => {
110
- window.removeEventListener("keydown", k);
111
- }), [k]), l(() => {
112
- w && setTimeout(() => {
113
- w.focus();
106
+ e && S && Y(!0);
107
+ }, [e, S]), l(() => {
108
+ e && e.trim() !== "" && (u(e), c(e));
109
+ }, []), l(() => (window.addEventListener("keydown", w), () => {
110
+ window.removeEventListener("keydown", w);
111
+ }), [w]), l(() => {
112
+ k && setTimeout(() => {
113
+ k.focus();
114
114
  }, 0);
115
- }, [w]);
116
- const _ = i((r) => {
117
- d(r.target.value);
118
- }, []), g = i(() => {
119
- d(""), a("");
120
- }, [a]), M = W(() => `${O} / ${D}`, [O, D]), { wholeWords: tt, matchCase: ot } = W(() => L, [L]), rt = i(
115
+ }, [k]);
116
+ const g = i((r) => {
117
+ u(r.target.value);
118
+ }, []), U = i(() => {
119
+ u(""), c("");
120
+ }, [c]), M = W(() => `${B} / ${K}`, [B, K]), { wholeWords: tt, matchCase: ot } = W(() => D, [D]), rt = i(
121
121
  (r) => {
122
- E((c) => ({ ...c, matchCase: r }));
122
+ y((a) => ({ ...a, matchCase: r }));
123
123
  },
124
- [E]
124
+ [y]
125
125
  ), et = i(
126
126
  (r) => {
127
- E((c) => ({ ...c, wholeWords: r }));
127
+ y((a) => ({ ...a, wholeWords: r }));
128
128
  },
129
- [E]
129
+ [y]
130
130
  );
131
131
  l(() => {
132
- b && Q && m();
133
- }, [b, m]);
134
- const s = W(() => (y == null ? void 0 : y.querySelectorAll('[tabindex]:not([tabindex="-1"])')) || [], [y]), nt = i(
132
+ S && X && h();
133
+ }, [S, h]);
134
+ const p = W(() => (T == null ? void 0 : T.querySelectorAll('[tabindex]:not([tabindex="-1"])')) || [], [T]), nt = i(
135
135
  (r) => {
136
136
  if (r.key === "Tab") {
137
- const c = document.activeElement;
138
- let f = 0;
139
- s.forEach((p, it) => {
140
- p === c && (f = it);
137
+ const a = document.activeElement;
138
+ let I = 0;
139
+ p.forEach((m, it) => {
140
+ m === a && (I = it);
141
141
  });
142
- let N = f + 1;
143
- r.shiftKey && (N = f - 1);
144
- const U = s[N];
145
- if (U)
146
- U.focus();
147
- else if (N > s.length - 1) {
148
- const p = s[0];
149
- p && p.focus();
142
+ let N = I + 1;
143
+ r.shiftKey && (N = I - 1);
144
+ const V = p[N];
145
+ if (V)
146
+ V.focus();
147
+ else if (N > p.length - 1) {
148
+ const m = p[0];
149
+ m && m.focus();
150
150
  } else {
151
- const p = s[s.length - 1];
152
- p && p.focus();
151
+ const m = p[p.length - 1];
152
+ m && m.focus();
153
153
  }
154
154
  }
155
155
  },
156
- [s]
156
+ [p]
157
157
  );
158
- return !H || !G ? null : /* @__PURE__ */ t(ct, { children: /* @__PURE__ */ t(
159
- xt,
158
+ return !G || !J ? null : /* @__PURE__ */ o(at, { children: /* @__PURE__ */ o(
159
+ bt,
160
160
  {
161
- open: S,
161
+ open: s,
162
162
  container: v,
163
163
  side: "bottom",
164
164
  align: "start",
165
165
  tabIndex: 0,
166
166
  avoidCollisions: !1,
167
- triggerComponent: /* @__PURE__ */ t(T, { content: o == null ? void 0 : o.searchButtonTooltip, children: /* @__PURE__ */ t(
168
- at,
167
+ triggerComponent: /* @__PURE__ */ o(E, { content: t == null ? void 0 : t.searchButtonTooltip, children: /* @__PURE__ */ o(
168
+ ct,
169
169
  {
170
- active: S,
171
- onClick: Y,
172
- "aria-label": o == null ? void 0 : o.searchButtonTooltip,
173
- children: x || /* @__PURE__ */ t(Et, {})
170
+ active: s,
171
+ onClick: Z,
172
+ "aria-label": t == null ? void 0 : t.searchButtonTooltip,
173
+ "aria-expanded": s,
174
+ "aria-haspopup": "dialog",
175
+ children: x || /* @__PURE__ */ o(yt, {})
174
176
  }
175
177
  ) }),
176
- children: /* @__PURE__ */ I(
178
+ children: /* @__PURE__ */ C(
177
179
  "div",
178
180
  {
179
- ref: J,
181
+ ref: Q,
180
182
  className: n["rp-search-tool-content"],
181
183
  tabIndex: 0,
182
184
  onKeyDown: nt,
185
+ role: "dialog",
186
+ "aria-label": (t == null ? void 0 : t.searchInputTooltip) || "Search dialog",
183
187
  children: [
184
- /* @__PURE__ */ I("div", { className: n["rp-search-tool-input-wrapper"], children: [
185
- /* @__PURE__ */ I("div", { className: n["rp-search-tool-input"], children: [
186
- /* @__PURE__ */ t(T, { content: o == null ? void 0 : o.searchInputTooltip, children: /* @__PURE__ */ t(
187
- pt,
188
+ /* @__PURE__ */ C("div", { className: n["rp-search-tool-input-wrapper"], children: [
189
+ /* @__PURE__ */ C("div", { className: n["rp-search-tool-input"], children: [
190
+ /* @__PURE__ */ o(E, { content: t == null ? void 0 : t.searchInputTooltip, children: /* @__PURE__ */ o(
191
+ mt,
188
192
  {
189
- value: h,
190
- onKeyDown: Z,
191
- onChange: _,
192
- icon: /* @__PURE__ */ t(z, {}),
193
- placeholder: o == null ? void 0 : o.searchInputPlaceholder,
193
+ value: d,
194
+ onKeyDown: _,
195
+ onChange: g,
196
+ icon: /* @__PURE__ */ o(A, {}),
197
+ placeholder: t == null ? void 0 : t.searchInputPlaceholder,
194
198
  className: n["rp-search-input"],
195
- ref: A,
199
+ ref: F,
196
200
  id: "search-input",
197
201
  name: "search-input",
198
202
  tabIndex: 0,
199
- children: !!h && /* @__PURE__ */ t("span", { className: n["rp-search-tool-input-clear"], onClick: g, children: /* @__PURE__ */ t(mt, {}) })
203
+ "aria-label": (t == null ? void 0 : t.searchInputTooltip) || (t == null ? void 0 : t.searchInputPlaceholder),
204
+ "aria-describedby": "search-results-count",
205
+ children: !!d && /* @__PURE__ */ o(
206
+ "span",
207
+ {
208
+ className: n["rp-search-tool-input-clear"],
209
+ onClick: U,
210
+ role: "button",
211
+ tabIndex: 0,
212
+ "aria-label": (t == null ? void 0 : t.searchCloseButtonTooltip) || "Clear search",
213
+ onKeyDown: (r) => {
214
+ (r.key === "Enter" || r.key === " ") && (r.preventDefault(), U());
215
+ },
216
+ children: /* @__PURE__ */ o(ht, {})
217
+ }
218
+ )
200
219
  }
201
220
  ) }),
202
- F ? /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t(lt, { className: n["rp-search-loader-icon"] }) }) : /* @__PURE__ */ t("span", { children: M }),
203
- u && /* @__PURE__ */ t("div", { className: n["rp-search-tool-controls"], children: /* @__PURE__ */ t(q, { onKeyPress: R, handleClose: m }) })
221
+ H ? /* @__PURE__ */ o("span", { "aria-live": "polite", "aria-label": "Searching", children: /* @__PURE__ */ o(lt, { className: n["rp-search-loader-icon"], "aria-hidden": "true" }) }) : /* @__PURE__ */ o("span", { id: "search-results-count", "aria-live": "polite", children: M }),
222
+ f && /* @__PURE__ */ o("div", { className: n["rp-search-tool-controls"], children: /* @__PURE__ */ o(z, { onKeyPress: R, handleClose: h }) })
204
223
  ] }),
205
- /* @__PURE__ */ I("div", { className: n["rp-search-tool-input-checkboxes"], children: [
206
- u && /* @__PURE__ */ t(j, {}),
207
- /* @__PURE__ */ t(
208
- V,
224
+ /* @__PURE__ */ C("div", { className: n["rp-search-tool-input-checkboxes"], children: [
225
+ f && /* @__PURE__ */ o(q, {}),
226
+ /* @__PURE__ */ o(
227
+ $,
209
228
  {
210
229
  tabIndex: 0,
211
230
  name: "matchCase",
212
231
  value: ot,
213
232
  onChange: rt,
214
- children: o == null ? void 0 : o.searchMatchCaseLabel
233
+ "aria-label": t == null ? void 0 : t.searchMatchCaseLabel,
234
+ children: t == null ? void 0 : t.searchMatchCaseLabel
215
235
  }
216
236
  ),
217
- !u && /* @__PURE__ */ t(T, { content: o == null ? void 0 : o.searchMatchCaseTooltip, children: /* @__PURE__ */ t("div", { className: n["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ t($, {}) }) }),
218
- /* @__PURE__ */ t(
219
- V,
237
+ !f && /* @__PURE__ */ o(E, { content: t == null ? void 0 : t.searchMatchCaseTooltip, children: /* @__PURE__ */ o("div", { className: n["rp-search-icon-info"], tabIndex: 0, children: /* @__PURE__ */ o(j, {}) }) }),
238
+ /* @__PURE__ */ o(
239
+ $,
220
240
  {
221
241
  tabIndex: 0,
222
242
  name: "wholeWord",
223
243
  value: tt,
224
244
  onChange: et,
225
- children: o == null ? void 0 : o.searchWholeWordsLabel
245
+ "aria-label": t == null ? void 0 : t.searchWholeWordsLabel,
246
+ children: t == null ? void 0 : t.searchWholeWordsLabel
226
247
  }
227
248
  ),
228
- !u && /* @__PURE__ */ t(T, { content: o == null ? void 0 : o.searchWholeWordsTooltip, children: /* @__PURE__ */ t("div", { tabIndex: 0, className: n["rp-search-icon-info"], children: /* @__PURE__ */ t($, {}) }) })
249
+ !f && /* @__PURE__ */ o(E, { content: t == null ? void 0 : t.searchWholeWordsTooltip, children: /* @__PURE__ */ o("div", { tabIndex: 0, className: n["rp-search-icon-info"], children: /* @__PURE__ */ o(j, {}) }) })
229
250
  ] })
230
251
  ] }),
231
- !u && /* @__PURE__ */ I("div", { className: n["rp-search-tool-controls"], children: [
232
- /* @__PURE__ */ t(j, {}),
233
- /* @__PURE__ */ t(q, { onKeyPress: R, handleClose: m })
252
+ !f && /* @__PURE__ */ C("div", { className: n["rp-search-tool-controls"], children: [
253
+ /* @__PURE__ */ o(q, {}),
254
+ /* @__PURE__ */ o(z, { onKeyPress: R, handleClose: h })
234
255
  ] })
235
256
  ]
236
257
  }
@@ -1,5 +1,5 @@
1
1
  import { jsx as t, Fragment as f, jsxs as i } from "react/jsx-runtime";
2
- import { G as a } from "../../../index-4baea9b5.js";
2
+ import { G as a } from "../../../index-61f59539.js";
3
3
  import { TextSelectionDefaultIcon as h } from "../../icons/TextSelectionDefaultIcon.js";
4
4
  import { HandModeDefaultIcon as s } from "../../icons/HandModeDefaultIcon.js";
5
5
  import { CheckIcon as l } from "../../icons/CheckIcon.js";
@@ -17,11 +17,11 @@ import "react";
17
17
  import "../../../index-c0faa594.js";
18
18
  import "react-dom";
19
19
  import "../../../index-e3ee9457.js";
20
- import "../../../Combination-54a77a7a.js";
20
+ import "../../../Combination-136ff99c.js";
21
21
  import "../../../floating-ui.react-dom-5ec29bd6.js";
22
22
  import "../../../index-655864a7.js";
23
23
  import "../../../clsx-0c6e471a.js";
24
- import "../../../th_TH-d627cd51.js";
24
+ import "../../../de_DE-a553b162.js";
25
25
  import "../../../utils/appConsole.js";
26
26
  import "../../../utils/withRef.js";
27
27
  import "../../../utils/hooks/useLocalization.js";
@@ -12,7 +12,7 @@ import "../../../contexts/RPDocumentContext.js";
12
12
  import "../../../utils/hooks/useLoadPdf.js";
13
13
  import "pdfjs-dist";
14
14
  import "../../../utils/types.js";
15
- import "../../../th_TH-d627cd51.js";
15
+ import "../../../de_DE-a553b162.js";
16
16
  import "../../../utils/getThumbnailViewport.js";
17
17
  import "../../../contexts/ConfigContext.js";
18
18
  import "../../../contexts/DocumentPasswordContext.js";