@react-pdf-kit/viewer 2.5.0-beta.0 → 2.5.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.
Files changed (54) hide show
  1. package/dist/PaginationContext-87f832f2.js +233 -0
  2. package/dist/assets/style.css +1 -1
  3. package/dist/assets/style.js +1 -1
  4. package/dist/components/RPController.js +25 -24
  5. package/dist/components/RPPages.js +71 -64
  6. package/dist/components/RPProvider.js +4 -3
  7. package/dist/components/layout/RPDefaultLayout.js +8 -4
  8. package/dist/components/layout/RPLayout.js +8 -4
  9. package/dist/components/layout/sidebar/CustomThumbnailElement.js +53 -0
  10. package/dist/components/layout/sidebar/RPSidebar.js +8 -4
  11. package/dist/components/layout/sidebar/Thumbnail.js +59 -50
  12. package/dist/components/layout/sidebar/Thumbnails.js +29 -25
  13. package/dist/components/layout/toolbar/MostPageTool.js +1 -1
  14. package/dist/components/layout/toolbar/OtherTool.js +1 -1
  15. package/dist/components/layout/toolbar/Paginate.js +1 -1
  16. package/dist/components/layout/toolbar/RPMoreOptions.js +1 -1
  17. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  18. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  19. package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
  20. package/dist/components/layout/toolbar/SearchTool.js +1 -1
  21. package/dist/components/layout/toolbar/ToolbarCustom.js +8 -4
  22. package/dist/components/layout/toolbar/ToolbarDefault.js +8 -4
  23. package/dist/components/layout/toolbar/ToolbarLayout.js +7 -3
  24. package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +5 -3
  25. package/dist/components/layout/toolbar/tools/FirstPageTool.js +5 -3
  26. package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
  27. package/dist/components/layout/toolbar/tools/LastPageTool.js +5 -3
  28. package/dist/components/layout/toolbar/tools/NextPageTool.js +1 -1
  29. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
  30. package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +1 -1
  31. package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +1 -1
  32. package/dist/components/page/AnnotationLayer.js +1 -1
  33. package/dist/components/page/CanvasLayer.js +1 -1
  34. package/dist/components/page/DualPage.js +1 -1
  35. package/dist/components/page/DualPageWithCover.js +1 -1
  36. package/dist/components/page/RPPage.js +1 -1
  37. package/dist/components/page/SinglePage.js +1 -1
  38. package/dist/components/page/TextLayer.js +1 -1
  39. package/dist/contexts/ElementThumbnailContext.js +129 -0
  40. package/dist/contexts/PaginationContext.js +1 -1
  41. package/dist/contexts/RenderQueueProvider.js +1 -1
  42. package/dist/contexts/SearchContext.js +1 -1
  43. package/dist/main.js +111 -108
  44. package/dist/types/components/layout/sidebar/CustomThumbnailElement.d.ts +6 -0
  45. package/dist/types/contexts/ElementThumbnailContext.d.ts +11 -0
  46. package/dist/types/main.d.ts +1 -0
  47. package/dist/types/utils/types.d.ts +12 -0
  48. package/dist/utils/hooks/useLicense.js +1 -1
  49. package/dist/utils/hooks/usePaginate.js +1 -1
  50. package/dist/utils/hooks/usePresentPage.js +1 -1
  51. package/dist/utils/hooks/useScrollToPage.js +1 -1
  52. package/dist/utils/hooks/useSearch.js +1 -1
  53. package/package.json +1 -1
  54. package/dist/PaginationContext-ec777f80.js +0 -223
@@ -1,15 +1,15 @@
1
1
  import { jsx as w, jsxs as Se, Fragment as ct } from "react/jsx-runtime";
2
- import { createElement as ue, PureComponent as dt, Component as ut, memo as ft, useRef as K, useState as mt, useMemo as Ie, useCallback as se, useEffect as ee } from "react";
2
+ import { createElement as fe, PureComponent as dt, Component as ut, memo as ft, useRef as K, useState as mt, useMemo as Ie, useCallback as se, useEffect as ee } from "react";
3
3
  import { RPPage as Te } from "./page/RPPage.js";
4
4
  import { useVirtualReactWindow as pt } from "../utils/hooks/useVirtualReactWindow.js";
5
5
  import { useVirtualScrollContext as ht } from "../contexts/VirtualScrollContext.js";
6
- import { a as gt, u as vt } from "../PaginationContext-ec777f80.js";
6
+ import { a as gt, u as vt } from "../PaginationContext-87f832f2.js";
7
7
  import { useDocumentContext as _t } from "../contexts/RPDocumentContext.js";
8
8
  import { useViewModeContext as wt } from "../contexts/ViewModeContext.js";
9
9
  import { useScrollModeContext as Ct } from "../contexts/ScrollModeContext.js";
10
10
  import { SelectionMode as St, ViewMode as Re, ScrollMode as xe, ErrorType as ye } from "../utils/types.js";
11
11
  import { useFullScreenContext as It } from "../contexts/FullScreenContext.js";
12
- import { c as de } from "../clsx-0c6e471a.js";
12
+ import { c as ue } from "../clsx-0c6e471a.js";
13
13
  import { DualPage as Tt } from "./page/DualPage.js";
14
14
  import { DualPageWithCover as Rt } from "./page/DualPageWithCover.js";
15
15
  import { SinglePage as xt } from "./page/SinglePage.js";
@@ -205,8 +205,8 @@ var Jt = 150, Qt = function(e) {
205
205
  e.data;
206
206
  var r = e.rowIndex;
207
207
  return r + ":" + t;
208
- }, fe = null, me = null, pe = null;
209
- process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (fe = /* @__PURE__ */ new WeakSet(), me = /* @__PURE__ */ new WeakSet(), pe = /* @__PURE__ */ new WeakSet());
208
+ }, me = null, pe = null, he = null;
209
+ process.env.NODE_ENV !== "production" && typeof window < "u" && typeof window.WeakSet < "u" && (me = /* @__PURE__ */ new WeakSet(), pe = /* @__PURE__ */ new WeakSet(), he = /* @__PURE__ */ new WeakSet());
210
210
  function Xt(n) {
211
211
  var e, t = n.getColumnOffset, r = n.getColumnStartIndexForOffset, s = n.getColumnStopIndexForStartIndex, l = n.getColumnWidth, a = n.getEstimatedTotalHeight, c = n.getEstimatedTotalWidth, u = n.getOffsetForColumnAndAlignment, g = n.getOffsetForRowAndAlignment, h = n.getRowHeight, I = n.getRowOffset, i = n.getRowStartIndexForOffset, L = n.getRowStopIndexForStartIndex, T = n.initInstanceProps, R = n.shouldResetStyleCacheOnItemSizeChange, H = n.validateProps;
212
212
  return e = /* @__PURE__ */ function(M) {
@@ -352,11 +352,11 @@ function Xt(n) {
352
352
  }, E.componentWillUnmount = function() {
353
353
  this._resetIsScrollingTimeoutId !== null && Ue(this._resetIsScrollingTimeoutId);
354
354
  }, E.render = function() {
355
- var o = this.props, f = o.children, d = o.className, m = o.columnCount, C = o.direction, p = o.height, S = o.innerRef, O = o.innerElementType, P = o.innerTagName, x = o.itemData, z = o.itemKey, y = z === void 0 ? Qt : z, W = o.outerElementType, k = o.outerTagName, U = o.rowCount, A = o.style, G = o.useIsScrolling, D = o.width, V = this.state.isScrolling, te = this._getHorizontalRangeToRender(), re = te[0], ae = te[1], ne = this._getVerticalRangeToRender(), J = ne[0], he = ne[1], Q = [];
355
+ var o = this.props, f = o.children, d = o.className, m = o.columnCount, C = o.direction, p = o.height, S = o.innerRef, O = o.innerElementType, P = o.innerTagName, x = o.itemData, z = o.itemKey, y = z === void 0 ? Qt : z, W = o.outerElementType, k = o.outerTagName, U = o.rowCount, A = o.style, G = o.useIsScrolling, D = o.width, V = this.state.isScrolling, te = this._getHorizontalRangeToRender(), re = te[0], ae = te[1], ne = this._getVerticalRangeToRender(), J = ne[0], ge = ne[1], Q = [];
356
356
  if (m > 0 && U)
357
- for (var $ = J; $ <= he; $++)
357
+ for (var $ = J; $ <= ge; $++)
358
358
  for (var j = re; j <= ae; j++)
359
- Q.push(ue(f, {
359
+ Q.push(fe(f, {
360
360
  columnIndex: j,
361
361
  data: x,
362
362
  isScrolling: G ? V : void 0,
@@ -369,7 +369,7 @@ function Xt(n) {
369
369
  style: this._getItemStyle($, j)
370
370
  }));
371
371
  var le = a(this.props, this._instanceProps), ce = c(this.props, this._instanceProps);
372
- return ue(W || k || "div", {
372
+ return fe(W || k || "div", {
373
373
  className: d,
374
374
  onScroll: this._onScroll,
375
375
  ref: this._outerRefSetter,
@@ -382,7 +382,7 @@ function Xt(n) {
382
382
  willChange: "transform",
383
383
  direction: C
384
384
  }, A)
385
- }, ue(O || P || "div", {
385
+ }, fe(O || P || "div", {
386
386
  children: Q,
387
387
  ref: S,
388
388
  style: {
@@ -423,7 +423,7 @@ function Xt(n) {
423
423
  var Yt = function(e, t) {
424
424
  var r = e.children, s = e.direction, l = e.height, a = e.innerTagName, c = e.outerTagName, u = e.overscanColumnsCount, g = e.overscanCount, h = e.overscanRowsCount, I = e.width, i = t.instance;
425
425
  if (process.env.NODE_ENV !== "production") {
426
- if (typeof g == "number" && fe && !fe.has(i) && (fe.add(i), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof u == "number" || typeof h == "number") && me && !me.has(i) && (me.add(i), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (a != null || c != null) && pe && !pe.has(i) && (pe.add(i), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
426
+ if (typeof g == "number" && me && !me.has(i) && (me.add(i), console.warn("The overscanCount prop has been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (typeof u == "number" || typeof h == "number") && pe && !pe.has(i) && (pe.add(i), console.warn("The overscanColumnsCount and overscanRowsCount props have been deprecated. Please use the overscanColumnCount and overscanRowCount props instead.")), (a != null || c != null) && he && !he.has(i) && (he.add(i), console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead.")), r == null)
427
427
  throw Error('An invalid "children" prop has been specified. Value should be a React component. ' + ('"' + (r === null ? "null" : typeof r) + '" was specified.'));
428
428
  switch (s) {
429
429
  case "ltr":
@@ -750,7 +750,7 @@ class sr extends ut {
750
750
  overflow: "visible"
751
751
  }, R = {};
752
752
  let H = !1;
753
- return s || (i === 0 && (H = !0), T.height = 0, R.height = i, R.scaledHeight = i), l || (L === 0 && (H = !0), T.width = 0, R.width = L, R.scaledWidth = L), a && (H = !1), ue(h, {
753
+ return s || (i === 0 && (H = !0), T.height = 0, R.height = i, R.scaledHeight = i), l || (L === 0 && (H = !0), T.width = 0, R.width = L, R.scaledWidth = L), a && (H = !1), fe(h, {
754
754
  ref: this._setRef,
755
755
  style: {
756
756
  ...T,
@@ -826,8 +826,8 @@ const ar = ft(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
826
826
  estimatedColumnWidth: te,
827
827
  estimatedRowHeight: re,
828
828
  totalDimension: ae
829
- } = pt(), ne = Ot(L, 100), { onScroll: J, onTextSelect: he } = kt();
830
- Vt({ onTextSelect: he, pagesRef: r });
829
+ } = pt(), ne = Ot(L, 100), { onScroll: J, onTextSelect: ge } = kt();
830
+ Vt({ onTextSelect: ge, pagesRef: r });
831
831
  const Q = K();
832
832
  Wt(D, A, i, m);
833
833
  const $ = K({
@@ -838,37 +838,37 @@ const ar = ft(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
838
838
  const { isPressed: j } = yt(), { selectionMode: le } = bt(), { initializeGrabScroll: ce, resetGrabState: Ye } = zt({
839
839
  isPressed: j
840
840
  }), ie = Ie(() => le === St.HAND, [le]), et = Ie(() => {
841
- const v = Array.from({ length: D }, (_, B) => V(B));
841
+ const _ = Array.from({ length: D }, (v, B) => V(B));
842
842
  return {
843
843
  columnCount: D,
844
844
  isDualPageWithCover: m === Re.DUAL_PAGE_WITH_COVER,
845
- columnWidths: v,
845
+ columnWidths: _,
846
846
  totalPages: f
847
847
  };
848
- }, [D, m, V, f]), ge = se(
849
- (v) => {
850
- const _ = document.activeElement !== r;
851
- !k && _ || (["ArrowUp", "ArrowLeft"].includes(v.key) ? (v.preventDefault(), E()) : ["ArrowDown", "ArrowRight"].includes(v.key) && (v.preventDefault(), b()));
848
+ }, [D, m, V, f]), ve = se(
849
+ (_) => {
850
+ const v = document.activeElement !== r;
851
+ !k && v || (["ArrowUp", "ArrowLeft"].includes(_.key) ? (_.preventDefault(), E()) : ["ArrowDown", "ArrowRight"].includes(_.key) && (_.preventDefault(), b()));
852
852
  },
853
853
  [b, E, k, d]
854
854
  );
855
- ee(() => (window.addEventListener("keydown", ge), () => {
856
- window.removeEventListener("keydown", ge);
857
- }), [ge]), ee(() => {
855
+ ee(() => (window.addEventListener("keydown", ve), () => {
856
+ window.removeEventListener("keydown", ve);
857
+ }), [ve]), ee(() => {
858
858
  if (C.current && (C.current.style.position = "relative"), !!c)
859
- for (let v = 0; v < A; v++)
860
- for (let _ = 0; _ < D; _++)
859
+ for (let _ = 0; _ < A; _++)
860
+ for (let v = 0; v < D; v++)
861
861
  c.resetAfterIndices({
862
- columnIndex: _,
863
- rowIndex: v,
862
+ columnIndex: v,
863
+ rowIndex: _,
864
864
  shouldForceUpdate: !0
865
865
  });
866
866
  }, [A, D, U, c]);
867
867
  const tt = se(
868
- (v, _) => {
868
+ (_, v) => {
869
869
  if (!i)
870
870
  return { scrollTop: 0, scrollLeft: 0 };
871
- const B = $.current.scrollTop > _, X = $.current.scrollLeft > v;
871
+ const B = $.current.scrollTop > v, X = $.current.scrollLeft > _;
872
872
  return B || X ? $.current : {
873
873
  scrollTop: i.scrollTop,
874
874
  scrollLeft: i.scrollLeft
@@ -876,7 +876,7 @@ const ar = ft(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
876
876
  },
877
877
  [i]
878
878
  ), We = se(
879
- (v, _) => {
879
+ (_, v) => {
880
880
  if (z.current.viewMode !== m || z.current.scrollMode !== d) {
881
881
  Q.current && clearTimeout(Q.current), y.current = !0, a(o, "auto"), Q.current = setTimeout(() => {
882
882
  requestAnimationFrame(() => {
@@ -885,28 +885,35 @@ const ar = ft(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
885
885
  }, 100);
886
886
  return;
887
887
  }
888
- const X = v.scrollTop, ve = v.scrollLeft;
889
- if (!_.height || !_.width)
888
+ const X = _.scrollTop, de = _.scrollLeft;
889
+ if (!v.height || !v.width)
890
890
  return;
891
891
  y.current = !0;
892
- const { height: Y, width: _e } = _, { height: we, width: Ce } = x.current;
892
+ const { height: Y, width: _e } = v, { height: we, width: Ce } = x.current;
893
893
  if (we === Y && Ce === _e)
894
894
  return;
895
895
  if (R.current && e > 1) {
896
896
  x.current = {
897
- height: _.height,
898
- width: _.width
897
+ height: v.height,
898
+ width: v.width
899
899
  };
900
900
  return;
901
901
  }
902
902
  if (!we || !Ce) {
903
903
  x.current = {
904
- height: _.height,
905
- width: _.width
904
+ height: v.height,
905
+ width: v.width
906
906
  };
907
907
  return;
908
908
  }
909
- const it = X / we * Y, st = ve / Ce * _e, at = Math.round(Math.min(it, Y)) || 0, lt = Math.round(Math.min(st, _e)) || 0;
909
+ if (X === 0 && de === 0) {
910
+ x.current = {
911
+ height: v.height,
912
+ width: v.width
913
+ };
914
+ return;
915
+ }
916
+ const it = X / we * Y, st = de / Ce * _e, at = Math.round(Math.min(it, Y)) || 0, lt = Math.round(Math.min(st, _e)) || 0;
910
917
  W.current = setTimeout(() => {
911
918
  requestAnimationFrame(() => {
912
919
  i == null || i.scrollTo({
@@ -916,31 +923,31 @@ const ar = ft(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
916
923
  });
917
924
  });
918
925
  }, 0), x.current = {
919
- height: _.height,
920
- width: _.width
926
+ height: v.height,
927
+ width: v.width
921
928
  };
922
929
  },
923
930
  [i, m, d, a, e]
924
931
  );
925
932
  ee(() => {
926
933
  clearTimeout(W.current);
927
- const v = Array.from({ length: A }).reduce(
928
- (X, ve, Y) => X + G(Y),
934
+ const _ = Array.from({ length: A }).reduce(
935
+ (X, de, Y) => X + G(Y),
929
936
  0
930
- ), _ = Array.from({ length: D }).reduce(
931
- (X, ve, Y) => X + V(Y),
937
+ ), v = Array.from({ length: D }).reduce(
938
+ (X, de, Y) => X + V(Y),
932
939
  0
933
- ), B = tt(_, v);
934
- $.current = B, We(B, { height: v, width: _ }), I({
935
- height: v,
936
- width: _
940
+ ), B = tt(v, _);
941
+ $.current = B, We(B, { height: _, width: v }), I({
942
+ height: _,
943
+ width: v
937
944
  });
938
945
  }, [U, A, D, We]);
939
946
  const rt = se(
940
- (v) => {
947
+ (_) => {
941
948
  $.current = {
942
- scrollTop: v.scrollTop,
943
- scrollLeft: v.scrollLeft
949
+ scrollTop: _.scrollTop,
950
+ scrollLeft: _.scrollLeft
944
951
  };
945
952
  },
946
953
  [i]
@@ -953,13 +960,13 @@ const ar = ft(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
953
960
  }, [i, T, J]), ee(() => () => {
954
961
  Q.current && clearTimeout(Q.current);
955
962
  }, []);
956
- const ot = Ie(() => de(F["rp-pages-container"], {
963
+ const ot = Ie(() => ue(F["rp-pages-container"], {
957
964
  [F["rp-cursor-grab"]]: ie && !j,
958
965
  [F["rp-cursor-grabbing"]]: ie && j
959
966
  }), [ie, j]), nt = se(
960
- (v) => {
961
- if (ie && v) {
962
- const _ = de(F["rp-pages"]), B = document.querySelector(`.${_}`);
967
+ (_) => {
968
+ if (ie && _) {
969
+ const v = ue(F["rp-pages"]), B = document.querySelector(`.${v}`);
963
970
  ce(B);
964
971
  }
965
972
  },
@@ -993,22 +1000,22 @@ const ar = ft(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
993
1000
  "--scale-round-x": `${Ae(n.current.sx)[1]}px`,
994
1001
  "--scale-round-y": `${Ae(n.current.sy)[1]}px`
995
1002
  },
996
- children: /* @__PURE__ */ w(sr, { style: { minHeight: "50px" }, children: ({ width: v, height: _ }) => /* @__PURE__ */ w(
1003
+ children: /* @__PURE__ */ w(sr, { style: { minHeight: "50px" }, children: ({ width: _, height: v }) => /* @__PURE__ */ w(
997
1004
  "div",
998
1005
  {
999
1006
  "data-rp": "pages",
1000
1007
  ref: nt,
1001
1008
  style: {
1002
- width: v,
1003
- height: _,
1009
+ width: _,
1010
+ height: v,
1004
1011
  ...H && { visibility: "hidden" }
1005
1012
  },
1006
- children: d === xe.PAGE_SCROLLING ? S === ye.INVALID_OR_CORRUPTED_PDF ? /* @__PURE__ */ w("div", { className: F["rp-load-error"], style: { width: v, height: _ }, children: /* @__PURE__ */ w("div", { className: F["rp-load-error-message"], children: "Invalid or corrupted PDF file." }) }) : /* @__PURE__ */ w(
1013
+ children: d === xe.PAGE_SCROLLING ? S === ye.INVALID_OR_CORRUPTED_PDF ? /* @__PURE__ */ w("div", { className: F["rp-load-error"], style: { width: _, height: v }, children: /* @__PURE__ */ w("div", { className: F["rp-load-error-message"], children: "Invalid or corrupted PDF file." }) }) : /* @__PURE__ */ w(
1007
1014
  "div",
1008
1015
  {
1009
1016
  ref: g,
1010
- style: { width: v, height: _ },
1011
- className: de(F["rp-pages"], F["rp-page-scrolling-wrapper"]),
1017
+ style: { width: _, height: v },
1018
+ className: ue(F["rp-pages"], F["rp-page-scrolling-wrapper"]),
1012
1019
  children: m === Re.DUAL_PAGE ? /* @__PURE__ */ w(Tt, { widths: V, heights: G }) : m === Re.DUAL_PAGE_WITH_COVER ? /* @__PURE__ */ w(Rt, { widths: V, heights: G }) : /* @__PURE__ */ w(xt, { widths: V, heights: G })
1013
1020
  }
1014
1021
  ) : re ? /* @__PURE__ */ w(
@@ -1022,12 +1029,12 @@ const ar = ft(({ columnIndex: n, rowIndex: e, data: t, style: r }) => {
1022
1029
  columnCount: D,
1023
1030
  columnWidth: V,
1024
1031
  rowHeight: G,
1025
- height: _,
1026
- width: v,
1032
+ height: v,
1033
+ width: _,
1027
1034
  estimatedColumnWidth: te,
1028
1035
  estimatedRowHeight: re,
1029
1036
  rowCount: A,
1030
- className: de(
1037
+ className: ue(
1031
1038
  F["rp-pages"],
1032
1039
  d === xe.HORIZONTAL_SCROLLING ? F["rp-pages-horizontal-scroll"] : ""
1033
1040
  ),
@@ -23,7 +23,7 @@ import "../utils/hooks/usePdfProperties.js";
23
23
  import "../utils/convertPdfDate.js";
24
24
  import "../utils/formatFileSize.js";
25
25
  import "../utils/appConsole.js";
26
- import "../PaginationContext-ec777f80.js";
26
+ import "../PaginationContext-87f832f2.js";
27
27
  import "../contexts/ScrollModeContext.js";
28
28
  import "../contexts/InitialStateContext.js";
29
29
  import "../contexts/GlobalCurrentPage.js";
@@ -70,12 +70,13 @@ import "../utils/hooks/useLicense.js";
70
70
  import "../contexts/DownloadContext.js";
71
71
  import "../contexts/ElementPageContext.js";
72
72
  import "../utils/getElementPositionInPage.js";
73
+ import "../contexts/ElementThumbnailContext.js";
73
74
  import "../contexts/RenderQueueProvider.js";
74
75
  import "../utils/Queue.js";
75
76
  import "../utils/renderPage.js";
76
77
  import "./icons/LoaderIcon.js";
77
78
  import "../clsx-0c6e471a.js";
78
- const mo = (e) => {
79
+ const po = (e) => {
79
80
  const {
80
81
  children: n,
81
82
  src: o,
@@ -123,5 +124,5 @@ const mo = (e) => {
123
124
  ) });
124
125
  };
125
126
  export {
126
- mo as RPProvider
127
+ po as RPProvider
127
128
  };
@@ -22,7 +22,7 @@ import "../../clsx-0c6e471a.js";
22
22
  import "../../utils/withRef.js";
23
23
  import "../ui/Input.js";
24
24
  import "../../Paginate.module-4eef00aa.js";
25
- import "../../PaginationContext-ec777f80.js";
25
+ import "../../PaginationContext-87f832f2.js";
26
26
  import "../../utils/types.js";
27
27
  import "../../de_DE-8145915f.js";
28
28
  import "../../contexts/ScrollModeContext.js";
@@ -139,9 +139,14 @@ import "./sidebar/Thumbnail.js";
139
139
  import "../../contexts/RenderQueueProvider.js";
140
140
  import "../../utils/Queue.js";
141
141
  import "../../utils/renderPage.js";
142
+ import "./sidebar/CustomThumbnailElement.js";
143
+ import "../../contexts/ElementThumbnailContext.js";
144
+ import "../../contexts/LicenseContext.js";
145
+ import "../../utils/hooks/useLicense.js";
142
146
  import "../../contexts/ThumbnailsContext.js";
143
147
  import "../../utils/hooks/useThumbnail.js";
144
148
  import "../../utils/getThumbnailViewport.js";
149
+ import "../../utils/const.js";
145
150
  import "../../utils/hooks/useInfiniteScroll.js";
146
151
  import "../../contexts/DropFileZoneContext.js";
147
152
  import "../icons/LightPdfIcon.js";
@@ -150,12 +155,11 @@ import "../../utils/hooks/useDropFileZone.js";
150
155
  import "../../contexts/LayoutDropFileZoneContext.js";
151
156
  import "../../utils/hooks/useLoadPdf.js";
152
157
  import "../../contexts/ConfigContext.js";
153
- import "../../utils/const.js";
154
158
  import "../../utils/hooks/usePdfProperties.js";
155
159
  import "../../utils/convertPdfDate.js";
156
160
  import "../../utils/formatFileSize.js";
157
161
  import "../../contexts/ThemeContext.js";
158
- const It = L((n, a) => {
162
+ const Et = L((n, a) => {
159
163
  const {
160
164
  children: l,
161
165
  slots: s,
@@ -237,5 +241,5 @@ const It = L((n, a) => {
237
241
  ] }) }) }) }) });
238
242
  });
239
243
  export {
240
- It as RPDefaultLayout
244
+ Et as RPDefaultLayout
241
245
  };
@@ -18,7 +18,7 @@ import "../../ToolbarLayout.module-6e339802.js";
18
18
  import "./sidebar/Thumbnails.js";
19
19
  import "./sidebar/Thumbnail.js";
20
20
  import "../icons/LoaderIcon.js";
21
- import "../../PaginationContext-ec777f80.js";
21
+ import "../../PaginationContext-87f832f2.js";
22
22
  import "../../utils/types.js";
23
23
  import "../../de_DE-8145915f.js";
24
24
  import "../../contexts/ScrollModeContext.js";
@@ -44,9 +44,14 @@ import "../../contexts/RenderQueueProvider.js";
44
44
  import "../../utils/Queue.js";
45
45
  import "../../utils/renderPage.js";
46
46
  import "pdfjs-dist";
47
+ import "./sidebar/CustomThumbnailElement.js";
48
+ import "../../contexts/ElementThumbnailContext.js";
49
+ import "../../contexts/LicenseContext.js";
50
+ import "../../utils/hooks/useLicense.js";
47
51
  import "../../contexts/ThumbnailsContext.js";
48
52
  import "../../utils/hooks/useThumbnail.js";
49
53
  import "../../utils/getThumbnailViewport.js";
54
+ import "../../utils/const.js";
50
55
  import "../../utils/hooks/useInfiniteScroll.js";
51
56
  import "../../utils/withRef.js";
52
57
  import "../../contexts/ToolbarComponentContext.js";
@@ -152,7 +157,6 @@ import "./toolbar/ToolbarCustom.js";
152
157
  import "../../contexts/DropFileZoneContext.js";
153
158
  import "../../utils/hooks/useLoadPdf.js";
154
159
  import "../../contexts/ConfigContext.js";
155
- import "../../utils/const.js";
156
160
  import "../../utils/hooks/usePdfProperties.js";
157
161
  import "../../utils/convertPdfDate.js";
158
162
  import "../../utils/formatFileSize.js";
@@ -160,7 +164,7 @@ import "../icons/LightPdfIcon.js";
160
164
  import "../icons/DarkPdfIcon.js";
161
165
  import "../../utils/hooks/useDropFileZone.js";
162
166
  import "../../contexts/ThemeContext.js";
163
- const Rr = (e) => {
167
+ const Ir = (e) => {
164
168
  const {
165
169
  children: n,
166
170
  style: a,
@@ -213,5 +217,5 @@ const Rr = (e) => {
213
217
  ] }) }) }) });
214
218
  };
215
219
  export {
216
- Rr as RPLayout
220
+ Ir as RPLayout
217
221
  };
@@ -0,0 +1,53 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { useMemo as p, useRef as u, useEffect as s } from "react";
3
+ import { useElementThumbnailContext as l } from "../../../contexts/ElementThumbnailContext.js";
4
+ import "../../../utils/types.js";
5
+ import "../../../de_DE-8145915f.js";
6
+ import "../../../contexts/PagesRotateContext.js";
7
+ import "../../../contexts/RPDocumentContext.js";
8
+ import "../../../utils/hooks/useLoadPdf.js";
9
+ import "pdfjs-dist";
10
+ import "../../../utils/getThumbnailViewport.js";
11
+ import "../../../contexts/ConfigContext.js";
12
+ import "../../../contexts/DocumentPasswordContext.js";
13
+ import "../../../utils/appConsole.js";
14
+ import "../../../utils/const.js";
15
+ import "../../../utils/hooks/usePdfProperties.js";
16
+ import "../../../utils/convertPdfDate.js";
17
+ import "../../../utils/formatFileSize.js";
18
+ import "../../../contexts/RotationContext.js";
19
+ import "../../../contexts/InitialStateContext.js";
20
+ import "../../../contexts/EventCallbackContext.js";
21
+ import "../../../contexts/LicenseContext.js";
22
+ import "../../../utils/hooks/useLicense.js";
23
+ import "../../../contexts/ThumbnailsContext.js";
24
+ import "../../../utils/hooks/useThumbnail.js";
25
+ import "../../../contexts/SmoothScrollContext.js";
26
+ const c = {
27
+ "rp-custom-thumbnail-element": "_rp-custom-thumbnail-element_h5ef7_1"
28
+ }, a = ({ child: t }) => {
29
+ const r = u(null);
30
+ return s(() => {
31
+ var m;
32
+ return (m = r.current) == null || m.appendChild(t), () => {
33
+ var o;
34
+ (o = r.current) == null || o.removeChild(t);
35
+ };
36
+ }, [t]), /* @__PURE__ */ e("div", { ref: r });
37
+ }, G = ({ pageNumber: t }) => {
38
+ const { elementList: r } = l(), m = p(() => {
39
+ var o;
40
+ return (o = r[t]) == null ? void 0 : o.map((i, n) => i instanceof HTMLElement ? /* @__PURE__ */ e(a, { child: i }, n) : /* @__PURE__ */ e("div", { children: i }, n));
41
+ }, [r, t]);
42
+ return m ? /* @__PURE__ */ e(
43
+ "div",
44
+ {
45
+ className: c["rp-custom-thumbnail-element"],
46
+ "data-rp": `thumbnail-${t}-customElement`,
47
+ children: m
48
+ }
49
+ ) : null;
50
+ };
51
+ export {
52
+ G as CustomThumbnailElement
53
+ };
@@ -17,7 +17,7 @@ import "../../../contexts/LayoutContainerContext.js";
17
17
  import "../../../contexts/ViewportContext.js";
18
18
  import "./Thumbnail.js";
19
19
  import "../../icons/LoaderIcon.js";
20
- import "../../../PaginationContext-ec777f80.js";
20
+ import "../../../PaginationContext-87f832f2.js";
21
21
  import "../../../utils/types.js";
22
22
  import "../../../de_DE-8145915f.js";
23
23
  import "../../../contexts/ScrollModeContext.js";
@@ -51,8 +51,12 @@ import "../../../utils/calculatePage.js";
51
51
  import "../../../contexts/RenderQueueProvider.js";
52
52
  import "../../../utils/Queue.js";
53
53
  import "../../../utils/renderPage.js";
54
- import "../../../utils/hooks/useInfiniteScroll.js";
54
+ import "./CustomThumbnailElement.js";
55
+ import "../../../contexts/ElementThumbnailContext.js";
56
+ import "../../../contexts/LicenseContext.js";
57
+ import "../../../utils/hooks/useLicense.js";
55
58
  import "../../../utils/hooks/useThumbnail.js";
59
+ import "../../../utils/hooks/useInfiniteScroll.js";
56
60
  import "../../../index-113053cf.js";
57
61
  import "react-dom";
58
62
  import "../../../index-23911b43.js";
@@ -62,7 +66,7 @@ import "../../../utils/hooks/useLocalization.js";
62
66
  const $ = () => {
63
67
  const { thumbnailIcon: o } = k(), { thumbnailIcon: p } = P();
64
68
  return o || p || /* @__PURE__ */ t(x, {});
65
- }, zt = () => {
69
+ }, Gt = () => {
66
70
  const { active: o, setActive: p } = N(), [c, u] = T(W), e = s(null), a = s(null), { thumbnailTool: i, sidebarEnable: h } = S(), { localeMessages: r } = B(), n = C(() => {
67
71
  p((d) => !d);
68
72
  }, []), b = I(() => typeof i != "boolean" && i ? /* @__PURE__ */ t(i, { onClick: n, active: o }) : i ? /* @__PURE__ */ t(y, { content: r == null ? void 0 : r.thumbnailTooltip, children: /* @__PURE__ */ t(
@@ -105,5 +109,5 @@ const $ = () => {
105
109
  ) });
106
110
  };
107
111
  export {
108
- zt as RPSidebar
112
+ Gt as RPSidebar
109
113
  };