pdf-tsx 0.11.0 → 0.12.0

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 (73) hide show
  1. package/README.md +43 -2
  2. package/dist/cjs/components/PDFViewer.cjs +1 -1
  3. package/dist/cjs/components/PDFViewer.module.cjs +1 -1
  4. package/dist/cjs/components/features/PDFAnnotations.cjs +1 -1
  5. package/dist/cjs/components/features/PDFAnnotations.module.cjs +1 -1
  6. package/dist/cjs/components/features/PDFAttachments.cjs +1 -1
  7. package/dist/cjs/components/features/PDFChangeFile.cjs +1 -1
  8. package/dist/cjs/components/features/PDFDownloadButton.cjs +1 -1
  9. package/dist/cjs/components/features/PDFNavigation.cjs +1 -1
  10. package/dist/cjs/components/features/PDFOutline.cjs +1 -1
  11. package/dist/cjs/components/features/PDFPageFit.cjs +1 -1
  12. package/dist/cjs/components/features/PDFPrintButton.cjs +1 -1
  13. package/dist/cjs/components/features/PDFRotationControl.cjs +1 -1
  14. package/dist/cjs/components/features/PDFSearch.cjs +1 -1
  15. package/dist/cjs/components/features/PDFSidebarToggle.cjs +1 -1
  16. package/dist/cjs/components/features/PDFSignatures.cjs +1 -1
  17. package/dist/cjs/components/features/PDFThemeToggle.cjs +1 -1
  18. package/dist/cjs/components/features/PDFThumbnails.cjs +1 -1
  19. package/dist/cjs/components/features/PDFZoomControls.cjs +1 -1
  20. package/dist/cjs/components/ui/PDFToolbar.cjs +1 -1
  21. package/dist/cjs/context/LabelsContext.cjs +1 -0
  22. package/dist/cjs/context/labelsContextValue.cjs +1 -0
  23. package/dist/cjs/hooks/useAnnotationLayer.cjs +1 -1
  24. package/dist/cjs/hooks/useAnnotations.cjs +1 -1
  25. package/dist/cjs/hooks/useLabels.cjs +1 -0
  26. package/dist/cjs/index.cjs +1 -1
  27. package/dist/cjs/labels.cjs +1 -0
  28. package/dist/cjs/pdf-tsx.css +1 -1
  29. package/dist/components/PDFViewer.d.ts +1 -0
  30. package/dist/components/features/PDFChangeFile.d.ts +1 -1
  31. package/dist/components/features/PDFDownloadButton.d.ts +1 -1
  32. package/dist/components/features/PDFNavigation.d.ts +1 -1
  33. package/dist/components/features/PDFPageFit.d.ts +1 -1
  34. package/dist/components/features/PDFPrintButton.d.ts +1 -1
  35. package/dist/components/features/PDFRotationControl.d.ts +1 -1
  36. package/dist/components/features/PDFSearch.d.ts +3 -2
  37. package/dist/components/features/PDFSidebarToggle.d.ts +1 -1
  38. package/dist/components/features/PDFThemeToggle.d.ts +1 -1
  39. package/dist/components/features/PDFZoomControls.d.ts +1 -1
  40. package/dist/context/LabelsContext.d.ts +7 -0
  41. package/dist/context/labelsContextValue.d.ts +2 -0
  42. package/dist/es/components/PDFViewer.js +309 -191
  43. package/dist/es/components/PDFViewer.module.js +21 -16
  44. package/dist/es/components/features/PDFAnnotations.js +132 -62
  45. package/dist/es/components/features/PDFAnnotations.module.js +12 -12
  46. package/dist/es/components/features/PDFAttachments.js +42 -41
  47. package/dist/es/components/features/PDFChangeFile.js +17 -16
  48. package/dist/es/components/features/PDFDownloadButton.js +15 -14
  49. package/dist/es/components/features/PDFNavigation.js +39 -38
  50. package/dist/es/components/features/PDFOutline.js +46 -45
  51. package/dist/es/components/features/PDFPageFit.js +19 -18
  52. package/dist/es/components/features/PDFPrintButton.js +14 -13
  53. package/dist/es/components/features/PDFRotationControl.js +12 -11
  54. package/dist/es/components/features/PDFSearch.js +71 -55
  55. package/dist/es/components/features/PDFSidebarToggle.js +13 -12
  56. package/dist/es/components/features/PDFSignatures.js +87 -84
  57. package/dist/es/components/features/PDFThemeToggle.js +12 -11
  58. package/dist/es/components/features/PDFThumbnails.js +33 -32
  59. package/dist/es/components/features/PDFZoomControls.js +23 -22
  60. package/dist/es/components/ui/PDFToolbar.js +56 -55
  61. package/dist/es/context/LabelsContext.js +14 -0
  62. package/dist/es/context/labelsContextValue.js +5 -0
  63. package/dist/es/hooks/useAnnotationLayer.js +37 -20
  64. package/dist/es/hooks/useAnnotations.js +5 -3
  65. package/dist/es/hooks/useLabels.js +9 -0
  66. package/dist/es/index.js +22 -21
  67. package/dist/es/labels.js +124 -0
  68. package/dist/es/pdf-tsx.css +1 -1
  69. package/dist/hooks/useAnnotationLayer.d.ts +15 -1
  70. package/dist/hooks/useLabels.d.ts +2 -0
  71. package/dist/index.d.ts +2 -0
  72. package/dist/labels.d.ts +51 -0
  73. package/package.json +2 -1
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ interface LabelsProviderProps {
3
+ children: ReactNode;
4
+ language?: "it" | "en";
5
+ }
6
+ export declare function LabelsProvider({ children, language }: LabelsProviderProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Labels } from '../labels';
2
+ export declare const LabelsContext: import('react').Context<Labels | null>;
@@ -6,216 +6,334 @@ import { isSafeUrl as i } from "../utils/url.js";
6
6
  import { useAnnotationLayer as a } from "../hooks/useAnnotationLayer.js";
7
7
  import { usePDFLoader as ee } from "../hooks/usePDFLoader.js";
8
8
  import { usePDFRenderer as te } from "../hooks/usePDFRenderer.js";
9
- import { useOverlayRects as o } from "../hooks/useOverlayRects.js";
10
- import { computeFit as s } from "../utils/pdfFit.js";
11
- import { ThemeProvider as c } from "../context/ThemeContext.js";
12
- import l from "./PDFViewer.module.js";
13
- import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
14
- import * as h from "pdfjs-dist";
15
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
9
+ import { useOverlayRects as ne } from "../hooks/useOverlayRects.js";
10
+ import { computeFit as o } from "../utils/pdfFit.js";
11
+ import { ThemeProvider as re } from "../context/ThemeContext.js";
12
+ import { LabelsProvider as ie } from "../context/LabelsContext.js";
13
+ import s from "./PDFViewer.module.js";
14
+ import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
15
+ import * as ae from "pdfjs-dist";
16
+ import { Fragment as oe, jsx as p, jsxs as m } from "react/jsx-runtime";
16
17
  //#region src/components/PDFViewer.tsx
17
- var y = 2, b = ({ file: b, workerSrc: x, sidebar: S, toolbar: C, onChangeFile: w, themeOverrides: ne, defaultTheme: re, defaultFit: T, className: E, style: ie }) => {
18
- d(() => {
19
- h.GlobalWorkerOptions.workerSrc = x;
20
- }, [x]);
21
- let [D, O] = m(1), [k, A] = m(0), [j, M] = m(null), [N, ae] = m([]), [P, F] = m(!1), [I, L] = m(T ?? null), R = p(null), z = p([]), B = p([]), V = p(k);
22
- d(() => {
23
- V.current = k;
24
- }, [k]);
25
- let [H, U] = m(null);
26
- H !== b && (U(b), M(null));
27
- let { pdf: W, numPages: G, loading: K } = ee(b);
28
- d(() => {
29
- W && (z.current = Array(W.numPages).fill(null), B.current = Array(W.numPages).fill(null));
30
- }, [W]), d(() => {
31
- !W || !T || !R.current || s(T, W, R.current, V.current).then(O);
32
- }, [W, T]);
33
- let q = p(I);
34
- d(() => {
35
- q.current = I;
36
- }, [I]), d(() => {
37
- if (!W || !R.current) return;
38
- let e = R.current, t = new ResizeObserver(() => {
39
- q.current && s(q.current, W, e, V.current).then(O);
18
+ var h = 2, g = ({ file: g, workerSrc: _, sidebar: se, toolbar: v, onChangeFile: y, themeOverrides: ce, defaultTheme: le, defaultFit: b, language: ue, className: x, style: de }) => {
19
+ l(() => {
20
+ ae.GlobalWorkerOptions.workerSrc = _;
21
+ }, [_]);
22
+ let [S, C] = f(1), [w, T] = f(0), [E, D] = f(null), [O, k] = f([]), [A, fe] = f(!1), [j, M] = f(b ?? null), [N, P] = f(null), F = d(null), I = d([]), L = d([]), R = d(w);
23
+ l(() => {
24
+ R.current = w;
25
+ }, [w]);
26
+ let [z, B] = f(null);
27
+ z !== g && (B(g), D(null));
28
+ let { pdf: V, numPages: H, loading: pe } = ee(g);
29
+ l(() => {
30
+ V && (I.current = Array(V.numPages).fill(null), L.current = Array(V.numPages).fill(null));
31
+ }, [V]), l(() => {
32
+ !V || !b || !F.current || o(b, V, F.current, R.current).then(C);
33
+ }, [V, b]);
34
+ let U = d(j);
35
+ l(() => {
36
+ U.current = j;
37
+ }, [j]), l(() => {
38
+ if (!V || !F.current) return;
39
+ let e = F.current, t = new ResizeObserver(() => {
40
+ U.current && o(U.current, V, e, R.current).then(C);
40
41
  });
41
42
  return t.observe(e), () => t.disconnect();
42
- }, [W]);
43
- let { currentPage: J, goToPage: Y } = t({
44
- numPages: G,
45
- containerRef: R,
46
- pageRefs: z
47
- }), X = f(() => {
48
- if (G === 0) return [];
49
- let e = /* @__PURE__ */ new Set(), t = Math.max(J - y, 1), n = Math.min(J + y, G);
43
+ }, [V]);
44
+ let { currentPage: W, goToPage: G } = t({
45
+ numPages: H,
46
+ containerRef: F,
47
+ pageRefs: I
48
+ }), K = u(() => {
49
+ if (H === 0) return [];
50
+ let e = /* @__PURE__ */ new Set(), t = Math.max(W - h, 1), n = Math.min(W + h, H);
50
51
  for (let r = t; r <= n; r++) e.add(r);
51
- j && e.add(j.page);
52
- for (let t of N) e.add(t.page);
52
+ E && e.add(E.page);
53
+ for (let t of O) e.add(t.page);
53
54
  return Array.from(e).sort((e, t) => e - t);
54
55
  }, [
55
- J,
56
- G,
57
- j,
58
- N
59
- ]), { pageSizes: oe, renderedPages: Z } = te({
60
- pdf: W,
61
- zoom: D,
62
- rotation: k,
63
- visiblePages: X,
64
- canvasRefs: B
65
- }), Q = f(() => {
66
- let e = new Set(X);
67
- for (let t of Z) e.add(t);
56
+ W,
57
+ H,
58
+ E,
59
+ O
60
+ ]), { pageSizes: me, renderedPages: q } = te({
61
+ pdf: V,
62
+ zoom: S,
63
+ rotation: w,
64
+ visiblePages: K,
65
+ canvasRefs: L
66
+ }), J = u(() => {
67
+ let e = new Set(K);
68
+ for (let t of q) e.add(t);
68
69
  return Array.from(e).sort((e, t) => e - t);
69
- }, [X, Z]);
70
+ }, [K, q]);
70
71
  n({
71
- pdf: W,
72
- currentPage: J,
73
- goToPage: Y,
74
- setZoom: O,
75
- setRotation: A,
76
- setFitMode: L
72
+ pdf: V,
73
+ currentPage: W,
74
+ goToPage: G,
75
+ setZoom: C,
76
+ setRotation: T,
77
+ setFitMode: M
77
78
  });
78
- let se = r({
79
- pdf: W,
80
- zoom: D,
81
- rotation: k,
82
- mountedPages: Q,
83
- canvasRefs: B
84
- }), ce = a({
85
- pdf: W,
86
- zoom: D,
87
- rotation: k,
88
- mountedPages: Q,
89
- goToPage: Y
90
- }), { overlayRect: $, searchOverlays: le } = o({
91
- pdf: W,
92
- highlight: j,
93
- searchMatches: N,
94
- zoom: D,
95
- rotation: k
96
- }), ue = u((e, t) => {
79
+ let he = r({
80
+ pdf: V,
81
+ zoom: S,
82
+ rotation: w,
83
+ mountedPages: J,
84
+ canvasRefs: L
85
+ }), { linkOverlays: ge, noteOverlays: _e } = a({
86
+ pdf: V,
87
+ zoom: S,
88
+ rotation: w,
89
+ mountedPages: J,
90
+ goToPage: G
91
+ });
92
+ l(() => {
93
+ if (!N) return;
94
+ let e = () => P(null), t = (e) => {
95
+ e.key === "Escape" && P(null);
96
+ };
97
+ return document.addEventListener("click", e), document.addEventListener("keydown", t), () => {
98
+ document.removeEventListener("click", e), document.removeEventListener("keydown", t);
99
+ };
100
+ }, [N]);
101
+ let { overlayRect: Y, searchOverlays: ve } = ne({
102
+ pdf: V,
103
+ highlight: E,
104
+ searchMatches: O,
105
+ zoom: S,
106
+ rotation: w
107
+ }), ye = c((e, t) => {
97
108
  (!e.url || !i(e.url)) && (t.preventDefault(), e.url || e._handleClick());
98
- }, []), de = f(() => ({
99
- pdf: W,
100
- numPages: G,
101
- zoom: D,
102
- setZoom: O,
103
- rotation: k,
104
- setRotation: A,
105
- currentPage: J,
106
- goToPage: Y,
107
- containerRef: R,
108
- canvasRefs: B,
109
- file: b,
110
- highlight: j,
111
- setHighlight: M,
112
- searchMatches: N,
113
- setSearchMatches: ae,
114
- onChangeFile: w,
115
- sidebarCollapsed: P,
116
- setSidebarCollapsed: F,
117
- fitMode: I,
118
- setFitMode: L
109
+ }, []), X = d(null), Z = c((e, t) => {
110
+ X.current && clearTimeout(X.current);
111
+ let n = t.clientY > window.innerHeight * .6;
112
+ P({
113
+ x: Math.min(t.clientX, window.innerWidth - 304),
114
+ y: n ? window.innerHeight - t.clientY + 8 : t.clientY + 12,
115
+ above: n,
116
+ contents: e.contents,
117
+ title: e.title
118
+ });
119
+ }, []), Q = c(() => {
120
+ X.current = setTimeout(() => P(null), 200);
121
+ }, []), $ = c((e) => {
122
+ D({
123
+ page: e.page,
124
+ pdfRect: e.pdfRect
125
+ }), G(e.page);
126
+ }, [D, G]), be = u(() => ({
127
+ pdf: V,
128
+ numPages: H,
129
+ zoom: S,
130
+ setZoom: C,
131
+ rotation: w,
132
+ setRotation: T,
133
+ currentPage: W,
134
+ goToPage: G,
135
+ containerRef: F,
136
+ canvasRefs: L,
137
+ file: g,
138
+ highlight: E,
139
+ setHighlight: D,
140
+ searchMatches: O,
141
+ setSearchMatches: k,
142
+ onChangeFile: y,
143
+ sidebarCollapsed: A,
144
+ setSidebarCollapsed: fe,
145
+ fitMode: j,
146
+ setFitMode: M
119
147
  }), [
148
+ V,
149
+ H,
150
+ S,
151
+ w,
120
152
  W,
121
153
  G,
122
- D,
123
- k,
124
- J,
125
- Y,
126
- b,
127
- j,
128
- N,
129
- w,
130
- P,
131
- I
154
+ g,
155
+ E,
156
+ O,
157
+ y,
158
+ A,
159
+ j
132
160
  ]);
133
- return /* @__PURE__ */ _(c, {
134
- themeOverrides: ne,
135
- defaultTheme: re,
136
- children: /* @__PURE__ */ _(e.Provider, {
137
- value: de,
138
- children: /* @__PURE__ */ v("div", {
139
- className: `${l.appLayout}${E ? ` ${E}` : ""}`,
140
- style: ie,
141
- children: [C && /* @__PURE__ */ _("div", {
142
- className: l.toolbar,
143
- children: C
144
- }), /* @__PURE__ */ v("div", {
145
- className: l.body,
146
- children: [S, /* @__PURE__ */ v("div", {
147
- className: l.scrollContainer,
148
- ref: R,
149
- children: [K && /* @__PURE__ */ _("div", { className: l.documentLoading }), Array.from({ length: G }, (e, t) => {
150
- let n = Z.has(t + 1), r = oe[t], a = Q.includes(t + 1);
151
- return /* @__PURE__ */ v("div", {
152
- className: l.pageWrapper,
153
- ref: (e) => {
154
- z.current[t] = e;
155
- },
156
- style: r ? {
157
- width: r.width,
158
- height: r.height
159
- } : void 0,
160
- children: [
161
- r && !n && /* @__PURE__ */ _("div", {
162
- className: l.pageSkeleton,
163
- style: {
164
- width: r.width,
165
- height: r.height
166
- }
167
- }),
168
- a && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("canvas", {
169
- className: l.pageCanvas,
170
- ref: (e) => {
171
- B.current[t] = e;
172
- },
173
- style: { display: n ? "block" : "none" }
174
- }), /* @__PURE__ */ _("div", {
175
- className: `textLayer ${l.textLayer}`,
176
- ref: (e) => {
177
- se.current[t] = e;
178
- }
179
- })] }),
180
- ce.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ _("a", {
181
- className: l.linkOverlay,
182
- href: e.url && i(e.url) ? e.url : "#",
183
- target: "_blank",
184
- rel: "noopener noreferrer",
185
- style: {
186
- left: e.x,
187
- top: e.y,
188
- width: e.width,
189
- height: e.height
190
- },
191
- onClick: (t) => ue(e, t)
192
- }, t)),
193
- le.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ _("div", {
194
- className: l.searchMatchOverlay,
195
- style: {
196
- left: e.x,
197
- top: e.y,
198
- width: e.width,
199
- height: e.height
200
- }
201
- }, t)),
202
- j && $?.page === t + 1 && /* @__PURE__ */ _("div", {
203
- className: l.highlightOverlay,
204
- style: {
205
- left: $.x,
206
- top: $.y,
207
- width: $.width,
208
- height: $.height
209
- }
210
- })
211
- ]
212
- }, `${t}-${k}`);
161
+ return /* @__PURE__ */ p(re, {
162
+ themeOverrides: ce,
163
+ defaultTheme: le,
164
+ children: /* @__PURE__ */ p(ie, {
165
+ language: ue,
166
+ children: /* @__PURE__ */ m(e.Provider, {
167
+ value: be,
168
+ children: [/* @__PURE__ */ m("div", {
169
+ className: `${s.appLayout}${x ? ` ${x}` : ""}`,
170
+ style: de,
171
+ children: [v && /* @__PURE__ */ p("div", {
172
+ className: s.toolbar,
173
+ children: v
174
+ }), /* @__PURE__ */ m("div", {
175
+ className: s.body,
176
+ children: [se, /* @__PURE__ */ m("div", {
177
+ className: s.scrollContainer,
178
+ ref: F,
179
+ children: [pe && /* @__PURE__ */ p("div", { className: s.documentLoading }), Array.from({ length: H }, (e, t) => {
180
+ let n = q.has(t + 1), r = me[t], a = J.includes(t + 1);
181
+ return /* @__PURE__ */ m("div", {
182
+ className: s.pageWrapper,
183
+ ref: (e) => {
184
+ I.current[t] = e;
185
+ },
186
+ style: r ? {
187
+ width: r.width,
188
+ height: r.height
189
+ } : void 0,
190
+ children: [
191
+ r && !n && /* @__PURE__ */ p("div", {
192
+ className: s.pageSkeleton,
193
+ style: {
194
+ width: r.width,
195
+ height: r.height
196
+ }
197
+ }),
198
+ a && /* @__PURE__ */ m(oe, { children: [/* @__PURE__ */ p("canvas", {
199
+ className: s.pageCanvas,
200
+ ref: (e) => {
201
+ L.current[t] = e;
202
+ },
203
+ style: { display: n ? "block" : "none" }
204
+ }), /* @__PURE__ */ p("div", {
205
+ className: `textLayer ${s.textLayer}`,
206
+ ref: (e) => {
207
+ he.current[t] = e;
208
+ }
209
+ })] }),
210
+ ge.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ p("a", {
211
+ className: s.linkOverlay,
212
+ href: e.url && i(e.url) ? e.url : "#",
213
+ target: "_blank",
214
+ rel: "noopener noreferrer",
215
+ style: {
216
+ left: e.x,
217
+ top: e.y,
218
+ width: e.width,
219
+ height: e.height
220
+ },
221
+ onClick: (t) => ye(e, t)
222
+ }, t)),
223
+ _e.filter((e) => e.page === t + 1).map((e, t) => e.subtype === "Text" ? /* @__PURE__ */ p("div", {
224
+ className: s.noteIconOverlay,
225
+ style: {
226
+ left: e.x,
227
+ top: e.y,
228
+ width: Math.max(e.width, 26),
229
+ height: Math.max(e.height, 26)
230
+ },
231
+ onMouseEnter: (t) => Z(e, t),
232
+ onMouseLeave: Q,
233
+ onClick: () => $(e),
234
+ children: /* @__PURE__ */ m("svg", {
235
+ width: "22",
236
+ height: "22",
237
+ viewBox: "0 0 12 12",
238
+ fill: "none",
239
+ "aria-hidden": "true",
240
+ children: [
241
+ /* @__PURE__ */ p("rect", {
242
+ x: "0.5",
243
+ y: "0.5",
244
+ width: "9",
245
+ height: "8",
246
+ rx: "1",
247
+ fill: "rgba(255,210,0,0.9)",
248
+ stroke: "rgba(160,120,0,0.7)",
249
+ strokeWidth: "1"
250
+ }),
251
+ /* @__PURE__ */ p("path", {
252
+ d: "M9.5 5.5v3l2.5-3z",
253
+ fill: "rgba(255,210,0,0.9)",
254
+ stroke: "rgba(160,120,0,0.7)",
255
+ strokeWidth: "1"
256
+ }),
257
+ /* @__PURE__ */ p("line", {
258
+ x1: "2",
259
+ y1: "3",
260
+ x2: "8",
261
+ y2: "3",
262
+ stroke: "rgba(90,60,0,0.8)",
263
+ strokeWidth: "1",
264
+ strokeLinecap: "round"
265
+ }),
266
+ /* @__PURE__ */ p("line", {
267
+ x1: "2",
268
+ y1: "5.5",
269
+ x2: "7",
270
+ y2: "5.5",
271
+ stroke: "rgba(90,60,0,0.8)",
272
+ strokeWidth: "1",
273
+ strokeLinecap: "round"
274
+ })
275
+ ]
276
+ })
277
+ }, t) : /* @__PURE__ */ p("div", {
278
+ className: s.noteOverlay,
279
+ style: {
280
+ left: e.x,
281
+ top: e.y,
282
+ width: e.width,
283
+ height: e.height
284
+ },
285
+ onMouseEnter: (t) => Z(e, t),
286
+ onMouseLeave: Q,
287
+ onClick: () => $(e)
288
+ }, t)),
289
+ ve.filter((e) => e.page === t + 1).map((e, t) => /* @__PURE__ */ p("div", {
290
+ className: s.searchMatchOverlay,
291
+ style: {
292
+ left: e.x,
293
+ top: e.y,
294
+ width: e.width,
295
+ height: e.height
296
+ }
297
+ }, t)),
298
+ E && Y?.page === t + 1 && /* @__PURE__ */ p("div", {
299
+ className: s.highlightOverlay,
300
+ style: {
301
+ left: Y.x,
302
+ top: Y.y,
303
+ width: Y.width,
304
+ height: Y.height
305
+ }
306
+ })
307
+ ]
308
+ }, `${t}-${w}`);
309
+ })]
213
310
  })]
214
311
  })]
312
+ }), N && /* @__PURE__ */ m("div", {
313
+ className: s.notePopover,
314
+ style: N.above ? {
315
+ left: N.x,
316
+ bottom: N.y
317
+ } : {
318
+ left: N.x,
319
+ top: N.y
320
+ },
321
+ onMouseEnter: () => {
322
+ X.current && clearTimeout(X.current);
323
+ },
324
+ onMouseLeave: Q,
325
+ onClick: (e) => e.stopPropagation(),
326
+ children: [N.title && /* @__PURE__ */ p("div", {
327
+ className: s.notePopoverTitle,
328
+ children: N.title
329
+ }), /* @__PURE__ */ p("p", {
330
+ className: s.notePopoverContent,
331
+ children: N.contents
332
+ })]
215
333
  })]
216
334
  })
217
335
  })
218
336
  });
219
337
  };
220
338
  //#endregion
221
- export { b as default };
339
+ export { g as default };
@@ -1,20 +1,25 @@
1
1
  var e = {
2
- appLayout: "_appLayout_18euq_1",
3
- body: "_body_18euq_9",
4
- toolbar: "_toolbar_18euq_17",
5
- scrollContainer: "_scrollContainer_18euq_29",
6
- pageWrapper: "_pageWrapper_18euq_40",
7
- pageCanvas: "_pageCanvas_18euq_45",
8
- textLayer: "_textLayer_18euq_54",
9
- markedContent: "_markedContent_18euq_80",
10
- endOfContent: "_endOfContent_18euq_95",
11
- selecting: "_selecting_18euq_104",
12
- documentLoading: "_documentLoading_18euq_124",
13
- spin: "_spin_18euq_1",
14
- pageSkeleton: "_pageSkeleton_18euq_144",
15
- highlightOverlay: "_highlightOverlay_18euq_173",
16
- linkOverlay: "_linkOverlay_18euq_182",
17
- searchMatchOverlay: "_searchMatchOverlay_18euq_189"
2
+ appLayout: "_appLayout_jb06o_1",
3
+ body: "_body_jb06o_9",
4
+ toolbar: "_toolbar_jb06o_17",
5
+ scrollContainer: "_scrollContainer_jb06o_29",
6
+ pageWrapper: "_pageWrapper_jb06o_40",
7
+ pageCanvas: "_pageCanvas_jb06o_45",
8
+ textLayer: "_textLayer_jb06o_54",
9
+ markedContent: "_markedContent_jb06o_80",
10
+ endOfContent: "_endOfContent_jb06o_95",
11
+ selecting: "_selecting_jb06o_104",
12
+ documentLoading: "_documentLoading_jb06o_124",
13
+ spin: "_spin_jb06o_1",
14
+ pageSkeleton: "_pageSkeleton_jb06o_144",
15
+ highlightOverlay: "_highlightOverlay_jb06o_173",
16
+ linkOverlay: "_linkOverlay_jb06o_182",
17
+ searchMatchOverlay: "_searchMatchOverlay_jb06o_189",
18
+ noteOverlay: "_noteOverlay_jb06o_197",
19
+ noteIconOverlay: "_noteIconOverlay_jb06o_204",
20
+ notePopover: "_notePopover_jb06o_221",
21
+ notePopoverTitle: "_notePopoverTitle_jb06o_234",
22
+ notePopoverContent: "_notePopoverContent_jb06o_241"
18
23
  };
19
24
  //#endregion
20
25
  export { e as default };