@epam/ai-dial-attachment-canvas 1.3.0-dev.124 → 1.3.0-dev.126
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.
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import "./PdfContent.css";
|
|
2
|
+
import { a as e, n as t, r as n } from "./LazyContentBoundary-tNE1ExbI.js";
|
|
3
|
+
import { mergeClasses as r } from "@epam/ai-dial-chat-shared";
|
|
4
|
+
import { DIAL_ICON_SIZE as i, DIAL_KIT_ICON_STROKE as a, Dropdown as o, ElementSize as s, FabButton as c, Input as ee } from "@epam/ai-dial-ui-kit";
|
|
5
|
+
import { IconMenu2 as te, IconX as ne } from "@tabler/icons-react";
|
|
6
|
+
import { useCallback as l, useEffect as u, useId as re, useRef as d, useState as f } from "react";
|
|
7
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
|
+
import { DocumentPreview as ie, PageThumbnail as ae } from "@epam/ai-dial-react-pdf-highlighter";
|
|
9
|
+
var oe = { viewer: "_viewer_1gfxm_1" }, h = null, se = (e) => (h ||= new Promise((t, n) => {
|
|
10
|
+
try {
|
|
11
|
+
t(e());
|
|
12
|
+
} catch (e) {
|
|
13
|
+
n(e);
|
|
14
|
+
}
|
|
15
|
+
}).catch((e) => {
|
|
16
|
+
throw h = null, e;
|
|
17
|
+
}), h), ce = 15, g = 3, le = 172, ue = 400, _ = 150, de = 60, v = ({ url: h, highlights: v, selectedHighlightId: y, selectedPageNumber: b, loadPdf: x, configurePdfWorker: S, hideHeader: fe = !1, onLoadError: C, labels: { thumbnailsLabel: pe = "Thumbnails", showThumbnailsLabel: me = "Show thumbnails", hideThumbnailsLabel: he = "Hide thumbnails", pageNumberLabel: ge = "Page number", loadingLabel: _e = "Loading…", errorLabel: ve = "Failed to load content", retryLabel: w = "Retry" } = {} }) => {
|
|
18
|
+
let [T, E] = f(() => S ? "preparing" : "ready"), [ye, be] = f(0), xe = l(async (t) => {
|
|
19
|
+
try {
|
|
20
|
+
return await (x ?? e)(t);
|
|
21
|
+
} catch (e) {
|
|
22
|
+
throw C?.(t), e;
|
|
23
|
+
}
|
|
24
|
+
}, [x, C]);
|
|
25
|
+
u(() => {
|
|
26
|
+
if (!S) return;
|
|
27
|
+
E("preparing");
|
|
28
|
+
let e = !1;
|
|
29
|
+
return se(S).then(() => {
|
|
30
|
+
e || E("ready");
|
|
31
|
+
}).catch(() => {
|
|
32
|
+
e || E("error");
|
|
33
|
+
}), () => {
|
|
34
|
+
e = !0;
|
|
35
|
+
};
|
|
36
|
+
}, [S, ye]);
|
|
37
|
+
let Se = l(() => {
|
|
38
|
+
be((e) => e + 1);
|
|
39
|
+
}, []), D = re(), [O, Ce] = f(0), [k, A] = f(/* @__PURE__ */ new Map()), [j, we] = f(!1), [M, N] = f(() => b ?? (y ? v.find((e) => e.id === y)?.bboxes[0]?.page ?? 1 : 1)), P = d(null), F = d(null), [Te, I] = f([]), [L, R] = f(le), [z, Ee] = f(ue), [De, B] = f(0), V = d(!1), H = d(0), U = d(null);
|
|
40
|
+
u(() => {
|
|
41
|
+
if (b != null) {
|
|
42
|
+
N(b);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (!y) return;
|
|
46
|
+
let e = v.find((e) => e.id === y)?.bboxes[0]?.page;
|
|
47
|
+
e != null && N(e);
|
|
48
|
+
}, [
|
|
49
|
+
b,
|
|
50
|
+
y,
|
|
51
|
+
v
|
|
52
|
+
]), u(() => {
|
|
53
|
+
let e = F.current;
|
|
54
|
+
if (!j || !e) return;
|
|
55
|
+
let t = new ResizeObserver((e) => {
|
|
56
|
+
let t = e[0]?.contentRect.height;
|
|
57
|
+
t && Ee(t);
|
|
58
|
+
});
|
|
59
|
+
return t.observe(e), () => t.disconnect();
|
|
60
|
+
}, [j]);
|
|
61
|
+
let Oe = l((e) => {
|
|
62
|
+
if (!e || V.current) return;
|
|
63
|
+
let t = e.getBoundingClientRect().height;
|
|
64
|
+
t > 0 && (V.current = !0, R(t));
|
|
65
|
+
}, []), ke = l((e) => {
|
|
66
|
+
H.current = e.currentTarget.scrollTop, U.current ??= requestAnimationFrame(() => {
|
|
67
|
+
U.current = null, B(H.current);
|
|
68
|
+
});
|
|
69
|
+
}, []);
|
|
70
|
+
u(() => () => {
|
|
71
|
+
U.current != null && cancelAnimationFrame(U.current);
|
|
72
|
+
}, []);
|
|
73
|
+
let W = l((e) => {
|
|
74
|
+
if (O === 0) return;
|
|
75
|
+
let t = Math.max(0, (M - 1) * L - e.clientHeight / 2 + L / 2);
|
|
76
|
+
H.current = t, B(t), e.scrollTop = t;
|
|
77
|
+
}, [
|
|
78
|
+
M,
|
|
79
|
+
O,
|
|
80
|
+
L
|
|
81
|
+
]), Ae = l((e) => {
|
|
82
|
+
F.current = e, e && W(e);
|
|
83
|
+
}, [W]);
|
|
84
|
+
u(() => {
|
|
85
|
+
let e = F.current;
|
|
86
|
+
e && W(e);
|
|
87
|
+
}, [W]);
|
|
88
|
+
let G = Math.max(0, Math.floor(De / L) - g), je = Math.ceil(z / L) + 6, K = Math.min(O - 1, G + je);
|
|
89
|
+
u(() => {
|
|
90
|
+
if (O === 0) return;
|
|
91
|
+
let e = Math.min(O, ce);
|
|
92
|
+
I(Array.from({ length: e }, (e, t) => t + 1));
|
|
93
|
+
}, [O]), u(() => {
|
|
94
|
+
if (!j || O === 0) return;
|
|
95
|
+
let e = setTimeout(() => {
|
|
96
|
+
I((e) => {
|
|
97
|
+
let t = new Set(e), n = !1;
|
|
98
|
+
for (let e = G + 1; e <= K + 1; e++) t.has(e) || (t.add(e), n = !0);
|
|
99
|
+
return n ? Array.from(t).sort((e, t) => e - t) : e;
|
|
100
|
+
});
|
|
101
|
+
}, _);
|
|
102
|
+
return () => clearTimeout(e);
|
|
103
|
+
}, [
|
|
104
|
+
j,
|
|
105
|
+
G,
|
|
106
|
+
K,
|
|
107
|
+
O
|
|
108
|
+
]), u(() => {
|
|
109
|
+
if (O === 0) return;
|
|
110
|
+
let e = setTimeout(() => {
|
|
111
|
+
let e = Math.ceil(z / L / 2) + g, t = Math.max(0, M - 1 - e), n = Math.min(O - 1, M - 1 + e);
|
|
112
|
+
I((e) => {
|
|
113
|
+
let r = new Set(e), i = !1;
|
|
114
|
+
for (let e = t + 1; e <= n + 1; e++) r.has(e) || (r.add(e), i = !0);
|
|
115
|
+
return i ? Array.from(r).sort((e, t) => e - t) : e;
|
|
116
|
+
});
|
|
117
|
+
}, _);
|
|
118
|
+
return () => clearTimeout(e);
|
|
119
|
+
}, [
|
|
120
|
+
M,
|
|
121
|
+
O,
|
|
122
|
+
z,
|
|
123
|
+
L
|
|
124
|
+
]);
|
|
125
|
+
let Me = l((e) => {
|
|
126
|
+
A((t) => new Map([...t, ...e]));
|
|
127
|
+
}, []), [q, Ne] = f(!1), Pe = l((e) => {
|
|
128
|
+
P.current = e, Ne(!0);
|
|
129
|
+
}, []), J = d(null);
|
|
130
|
+
u(() => {
|
|
131
|
+
if (!q) return;
|
|
132
|
+
let e = J.current, t = e?.querySelector(".pdf-container"), n = e?.querySelector(".pdf-highlight-viewer");
|
|
133
|
+
if (!t || !n) return;
|
|
134
|
+
let r = () => {
|
|
135
|
+
let e = n.scrollWidth - n.clientWidth;
|
|
136
|
+
e > 0 && (n.scrollLeft = e / 2);
|
|
137
|
+
};
|
|
138
|
+
r();
|
|
139
|
+
let i = new ResizeObserver(r);
|
|
140
|
+
i.observe(t), i.observe(n);
|
|
141
|
+
let a = P.current?.getZoom(), o = 0, s, c = () => {
|
|
142
|
+
let e = P.current?.getZoom();
|
|
143
|
+
e !== a && (a = e, o = de), o > 0 && (r(), --o), s = requestAnimationFrame(c);
|
|
144
|
+
};
|
|
145
|
+
return s = requestAnimationFrame(c), () => {
|
|
146
|
+
cancelAnimationFrame(s), i.disconnect();
|
|
147
|
+
};
|
|
148
|
+
}, [q]), u(() => {
|
|
149
|
+
if (!q || y || b != null) return;
|
|
150
|
+
let e = requestAnimationFrame(() => {
|
|
151
|
+
P.current?.navigateToPage(1);
|
|
152
|
+
});
|
|
153
|
+
return () => cancelAnimationFrame(e);
|
|
154
|
+
}, [
|
|
155
|
+
q,
|
|
156
|
+
y,
|
|
157
|
+
b
|
|
158
|
+
]);
|
|
159
|
+
let Y = l((e) => {
|
|
160
|
+
N(e), P.current?.navigateToPage(e);
|
|
161
|
+
}, []), Fe = l((e) => {
|
|
162
|
+
N(e);
|
|
163
|
+
}, []), [X, Z] = f(() => String(M));
|
|
164
|
+
u(() => {
|
|
165
|
+
Z(String(M));
|
|
166
|
+
}, [M]);
|
|
167
|
+
let Q = l((e) => {
|
|
168
|
+
let t = Number(e);
|
|
169
|
+
Number.isInteger(t) && t >= 1 && t <= O ? Y(t) : Z(String(M));
|
|
170
|
+
}, [
|
|
171
|
+
O,
|
|
172
|
+
M,
|
|
173
|
+
Y
|
|
174
|
+
]);
|
|
175
|
+
if (!h) return null;
|
|
176
|
+
if (T === "preparing") return /* @__PURE__ */ p(n, { loadingLabel: _e });
|
|
177
|
+
if (T === "error") return /* @__PURE__ */ p(t, {
|
|
178
|
+
errorLabel: ve,
|
|
179
|
+
retryLabel: w,
|
|
180
|
+
onRetry: Se
|
|
181
|
+
});
|
|
182
|
+
let $ = [];
|
|
183
|
+
for (let e = G + 1; e <= K + 1 && e <= O; e++) $.push(/* @__PURE__ */ p("div", {
|
|
184
|
+
ref: e === G + 1 ? Oe : void 0,
|
|
185
|
+
children: /* @__PURE__ */ p(ae, {
|
|
186
|
+
pageNum: e,
|
|
187
|
+
onSelectPage: Y,
|
|
188
|
+
isSelected: M === e,
|
|
189
|
+
isLoading: !k.has(e),
|
|
190
|
+
thumbnailUrl: k.get(e) ?? null
|
|
191
|
+
})
|
|
192
|
+
}, e));
|
|
193
|
+
let Ie = G * L, Le = Math.max(0, O - K - 1) * L;
|
|
194
|
+
return /* @__PURE__ */ m("div", {
|
|
195
|
+
className: "relative flex h-full overflow-hidden",
|
|
196
|
+
children: [O > 0 && /* @__PURE__ */ p("div", {
|
|
197
|
+
className: "absolute inset-s-3 top-3 z-10",
|
|
198
|
+
children: /* @__PURE__ */ p(o, {
|
|
199
|
+
open: j,
|
|
200
|
+
onOpenChange: we,
|
|
201
|
+
allowedPlacements: ["bottom-start"],
|
|
202
|
+
matchReferenceWidth: !1,
|
|
203
|
+
initialFocus: -1,
|
|
204
|
+
renderOverlay: () => /* @__PURE__ */ m("div", {
|
|
205
|
+
className: "flex w-36 flex-col",
|
|
206
|
+
children: [/* @__PURE__ */ p("div", {
|
|
207
|
+
className: "w-[88px] shrink-0 p-1",
|
|
208
|
+
children: /* @__PURE__ */ p(ee, {
|
|
209
|
+
size: s.Small,
|
|
210
|
+
"aria-label": ge,
|
|
211
|
+
value: X,
|
|
212
|
+
postfix: `/ ${O}`,
|
|
213
|
+
inputMode: "numeric",
|
|
214
|
+
onChange: (e) => Z(e ?? ""),
|
|
215
|
+
onBlur: () => Q(X),
|
|
216
|
+
onKeyDown: (e) => {
|
|
217
|
+
e.key === "Enter" && Q(X);
|
|
218
|
+
}
|
|
219
|
+
})
|
|
220
|
+
}), /* @__PURE__ */ m("div", {
|
|
221
|
+
ref: Ae,
|
|
222
|
+
id: D,
|
|
223
|
+
role: "region",
|
|
224
|
+
"aria-label": pe,
|
|
225
|
+
onScroll: ke,
|
|
226
|
+
className: "max-h-[min(70vh,calc(var(--fui-available-height,70vh)-2.5rem))] min-h-0 [scrollbar-gutter:stable_both-edges] overflow-x-hidden overflow-y-auto p-1",
|
|
227
|
+
children: [
|
|
228
|
+
/* @__PURE__ */ p("div", { style: { height: Ie } }),
|
|
229
|
+
$,
|
|
230
|
+
/* @__PURE__ */ p("div", { style: { height: Le } })
|
|
231
|
+
]
|
|
232
|
+
})]
|
|
233
|
+
}),
|
|
234
|
+
children: /* @__PURE__ */ p(c, {
|
|
235
|
+
icon: p(j ? ne : te, {
|
|
236
|
+
size: i.LG,
|
|
237
|
+
stroke: a,
|
|
238
|
+
"aria-hidden": !0
|
|
239
|
+
}),
|
|
240
|
+
"aria-label": j ? he : me,
|
|
241
|
+
"aria-expanded": j,
|
|
242
|
+
"aria-controls": j ? D : void 0
|
|
243
|
+
})
|
|
244
|
+
})
|
|
245
|
+
}), /* @__PURE__ */ p("div", {
|
|
246
|
+
ref: J,
|
|
247
|
+
className: r("min-w-0 flex-1 overflow-hidden", oe.viewer),
|
|
248
|
+
children: /* @__PURE__ */ p(ie, {
|
|
249
|
+
fileUrl: h,
|
|
250
|
+
loadFileCb: xe,
|
|
251
|
+
highlights: v,
|
|
252
|
+
selectedHighlightId: y,
|
|
253
|
+
selectedPageNumber: b,
|
|
254
|
+
showOccurrences: !1,
|
|
255
|
+
onTotalPagesChange: Ce,
|
|
256
|
+
thumbnailPageNumbers: Te,
|
|
257
|
+
onThumbnailsLoaded: Me,
|
|
258
|
+
onViewerReady: Pe,
|
|
259
|
+
onCurrentPageChange: Fe,
|
|
260
|
+
viewerOptions: { enableVirtualScrolling: !0 },
|
|
261
|
+
containerClassName: fe ? "[&>div:first-child]:hidden" : void 0
|
|
262
|
+
})
|
|
263
|
+
})]
|
|
264
|
+
});
|
|
265
|
+
};
|
|
266
|
+
//#endregion
|
|
267
|
+
export { v as PdfContent };
|
package/index.js
CHANGED
|
@@ -95,9 +95,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
|
|
|
95
95
|
type: ge,
|
|
96
96
|
html: ee
|
|
97
97
|
}, "*"));
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
if (!(k || O)) try {
|
|
98
|
+
} else if (!(k || O)) try {
|
|
101
99
|
b.current?.contentDocument ?? f(!0);
|
|
102
100
|
} catch {
|
|
103
101
|
f(!0);
|
|
@@ -346,7 +344,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
|
|
|
346
344
|
let [{ DocxDocument: n, DocxScrollViewer: r }, { chartEx: o }, { createDocxHighlightSurface: c }] = await Promise.all([
|
|
347
345
|
import("@silurus/ooxml/docx"),
|
|
348
346
|
import("@silurus/ooxml/chart-ex"),
|
|
349
|
-
import("./ooxml-highlight-surfaces-
|
|
347
|
+
import("./ooxml-highlight-surfaces-C18JJb0P.js")
|
|
350
348
|
]), l = await n.load(t.url, { chartEx: o });
|
|
351
349
|
if (i()) throw l.destroy(), new De();
|
|
352
350
|
let u = r.fromDocument(e, l, {
|
|
@@ -366,7 +364,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
|
|
|
366
364
|
let [{ PptxPresentation: n, PptxScrollViewer: r }, { chartEx: o }, { createPptxHighlightSurface: c }] = await Promise.all([
|
|
367
365
|
import("@silurus/ooxml/pptx"),
|
|
368
366
|
import("@silurus/ooxml/chart-ex"),
|
|
369
|
-
import("./ooxml-highlight-surfaces-
|
|
367
|
+
import("./ooxml-highlight-surfaces-C18JJb0P.js")
|
|
370
368
|
]), l = await n.load(t.url, { chartEx: o });
|
|
371
369
|
if (i()) throw l.destroy(), new De();
|
|
372
370
|
let u = r.fromPresentation(e, l, {
|
|
@@ -386,7 +384,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
|
|
|
386
384
|
let [{ XlsxViewer: n }, { chartEx: r }, { createXlsxHighlightSurface: c }] = await Promise.all([
|
|
387
385
|
import("@silurus/ooxml/xlsx"),
|
|
388
386
|
import("@silurus/ooxml/chart-ex"),
|
|
389
|
-
import("./ooxml-highlight-surfaces-
|
|
387
|
+
import("./ooxml-highlight-surfaces-C18JJb0P.js")
|
|
390
388
|
]), l = new n(e, {
|
|
391
389
|
showZoomSlider: !0,
|
|
392
390
|
chartEx: r,
|
|
@@ -565,15 +563,11 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
|
|
|
565
563
|
let n = e.toLowerCase();
|
|
566
564
|
return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
|
|
567
565
|
}, Ae = (e, t) => {
|
|
568
|
-
if (
|
|
566
|
+
if (e != null && e !== "") return Object.prototype.hasOwnProperty.call(t, e) ? t[e] : void 0;
|
|
569
567
|
}, je = (e) => `${e}:grouped-visualizer`, Me = (e, t) => {
|
|
570
568
|
let n = (t.contentType ?? "").split(",").map((e) => e.trim().toLowerCase()).filter((e) => e !== ""), r = [], i = [];
|
|
571
569
|
return e.forEach((e) => {
|
|
572
|
-
|
|
573
|
-
r.push(e);
|
|
574
|
-
return;
|
|
575
|
-
}
|
|
576
|
-
i.push(e);
|
|
570
|
+
e.url != null && e.url !== "" && (n.length === 0 || n.includes(e.contentType.toLowerCase())) ? r.push(e) : i.push(e);
|
|
577
571
|
}), {
|
|
578
572
|
claimed: r,
|
|
579
573
|
unclaimed: i
|
|
@@ -686,7 +680,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
|
|
|
686
680
|
jsonExpandIcon: "_jsonExpandIcon_13ogb_54",
|
|
687
681
|
jsonCollapseIcon: "_jsonCollapseIcon_13ogb_67",
|
|
688
682
|
jsonCollapsedContent: "_jsonCollapsedContent_13ogb_84"
|
|
689
|
-
}, Ie = () => N(async () => ({ default: (await import("./PdfContent-
|
|
683
|
+
}, Ie = () => N(async () => ({ default: (await import("./PdfContent-DRDP8g36.js")).PdfContent })), Le = ({ url: e, fileName: t, loadErrorLabel: n }) => {
|
|
690
684
|
let [r, i] = z(!1);
|
|
691
685
|
return I(() => {
|
|
692
686
|
i(!1);
|
|
@@ -706,7 +700,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
|
|
|
706
700
|
className: "max-h-full max-w-full object-contain",
|
|
707
701
|
onError: () => i(!0)
|
|
708
702
|
});
|
|
709
|
-
}, Re = new Set([
|
|
703
|
+
}, Re = /* @__PURE__ */ new Set([
|
|
710
704
|
i.PlainText,
|
|
711
705
|
i.Code,
|
|
712
706
|
i.Ooxml
|
|
@@ -1159,11 +1153,11 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
|
|
|
1159
1153
|
onVisualizerSendMessage: Fe
|
|
1160
1154
|
})
|
|
1161
1155
|
});
|
|
1162
|
-
}), Ue = new Set(["html", "htm"]), Z = {
|
|
1156
|
+
}), Ue = /* @__PURE__ */ new Set(["html", "htm"]), Z = {
|
|
1163
1157
|
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1164
1158
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
1165
1159
|
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
1166
|
-
}, We = new Set(/* @__PURE__ */ "txt.md.markdown.json.jsonl.ndjson.xml.csv.tsv.yaml.yml.toml.ini.conf.cfg.css.scss.sass.less.js.jsx.ts.tsx.mjs.cjs.mts.cts.py.rb.go.rs.java.kt.swift.c.h.cpp.cs.sh.bash.zsh.fish.ps1.log.env.gitignore.dockerfile.makefile.sql".split(".")), Ge = {
|
|
1160
|
+
}, We = /* @__PURE__ */ new Set(/* @__PURE__ */ "txt.md.markdown.json.jsonl.ndjson.xml.csv.tsv.yaml.yml.toml.ini.conf.cfg.css.scss.sass.less.js.jsx.ts.tsx.mjs.cjs.mts.cts.py.rb.go.rs.java.kt.swift.c.h.cpp.cs.sh.bash.zsh.fish.ps1.log.env.gitignore.dockerfile.makefile.sql".split(".")), Ge = {
|
|
1167
1161
|
docx: r.Docx,
|
|
1168
1162
|
xlsx: r.Xlsx,
|
|
1169
1163
|
pptx: r.Pptx,
|
|
@@ -1191,10 +1185,10 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
|
|
|
1191
1185
|
return n == null ? void 0 : qe[n];
|
|
1192
1186
|
}, Xe = (e) => {
|
|
1193
1187
|
let t = e.lastIndexOf(".");
|
|
1194
|
-
return t
|
|
1188
|
+
return t !== -1 && We.has(e.slice(t + 1).toLowerCase());
|
|
1195
1189
|
}, Ze = (e) => {
|
|
1196
1190
|
let t = e.lastIndexOf(".");
|
|
1197
|
-
return t
|
|
1191
|
+
return t !== -1 && Ue.has(e.slice(t + 1).toLowerCase());
|
|
1198
1192
|
}, Qe = {
|
|
1199
1193
|
xml: "xml",
|
|
1200
1194
|
csv: "plaintext",
|
|
@@ -1255,7 +1249,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, G = {
|
|
|
1255
1249
|
errorType: n.Forbidden,
|
|
1256
1250
|
...e != null && { url: e }
|
|
1257
1251
|
}), nt = (e) => {
|
|
1258
|
-
if (
|
|
1252
|
+
if (e.type === i.Image || e.type === i.Audio || e.type === i.Pdf || e.type === i.Ooxml) return e.url.startsWith("blob:") ? e.url : void 0;
|
|
1259
1253
|
}, rt = (e) => {
|
|
1260
1254
|
let t = nt(e);
|
|
1261
1255
|
t != null && URL.revokeObjectURL(t);
|
|
@@ -1457,28 +1451,28 @@ var ot = ({ children: e }) => {
|
|
|
1457
1451
|
case d.Markdown:
|
|
1458
1452
|
case d.MarkdownAlt: {
|
|
1459
1453
|
let i = await e.resolveMarkdownContent(t);
|
|
1460
|
-
return i
|
|
1454
|
+
return i != null && r(i, t.name, n);
|
|
1461
1455
|
}
|
|
1462
1456
|
case d.JSON: {
|
|
1463
1457
|
let i = await e.resolveJsonContent(t);
|
|
1464
|
-
return i
|
|
1458
|
+
return i != null && r(i, t.name, n);
|
|
1465
1459
|
}
|
|
1466
1460
|
case d.PDF: {
|
|
1467
1461
|
let i = await e.resolvePdfContent(t);
|
|
1468
|
-
return i
|
|
1462
|
+
return i != null && r(i, t.name, n);
|
|
1469
1463
|
}
|
|
1470
1464
|
}
|
|
1471
1465
|
let g = t.name != null && Ze(t.name) || t.url != null && Ze(dt(t.url));
|
|
1472
1466
|
if (t.name != null && !Xe(t.name) && !g) return r($(e.resolveContentUrl(t)), t.name, n);
|
|
1473
1467
|
if (g) {
|
|
1474
1468
|
let a = await e.resolveHtmlContent(t);
|
|
1475
|
-
return a == null ? e.hasTextSource(t) ? r($(e.resolveContentUrl(t)), t.name, n) : t.url
|
|
1469
|
+
return a == null ? e.hasTextSource(t) ? r($(e.resolveContentUrl(t)), t.name, n) : t.url != null && r({
|
|
1476
1470
|
type: i.Html,
|
|
1477
1471
|
url: t.url
|
|
1478
1472
|
}, t.name, n) : r(a, t.name, n);
|
|
1479
1473
|
}
|
|
1480
1474
|
let _ = await e.resolveCodeContent(t, $e(m));
|
|
1481
|
-
return _
|
|
1475
|
+
return _ != null && r(_, t.name, n);
|
|
1482
1476
|
}, [
|
|
1483
1477
|
o,
|
|
1484
1478
|
s,
|
|
@@ -1489,11 +1483,11 @@ var ot = ({ children: e }) => {
|
|
|
1489
1483
|
switch (t.type) {
|
|
1490
1484
|
case c.Image: {
|
|
1491
1485
|
let r = e.resolveImageContent(t);
|
|
1492
|
-
return r
|
|
1486
|
+
return r != null && (l?.(), n(r, t.name, o), !0);
|
|
1493
1487
|
}
|
|
1494
1488
|
case c.Audio: {
|
|
1495
1489
|
let e = t.playUrl ?? t.url;
|
|
1496
|
-
return e
|
|
1490
|
+
return e != null && (n({
|
|
1497
1491
|
type: i.Audio,
|
|
1498
1492
|
url: e,
|
|
1499
1493
|
mimeType: t.contentType || void 0
|
|
@@ -32,11 +32,7 @@ var n = 4 / 3, r = 9525, i = 2, a = 1, o = 0, s = 16, c = .25, l = () => {
|
|
|
32
32
|
let t = [...e].sort((e, t) => e.top - t.top || e.left - t.left), n = [];
|
|
33
33
|
for (let e of t) {
|
|
34
34
|
let t = n.at(-1), r = t != null && Math.abs(t.top - e.top) <= i && Math.abs(t.height - e.height) <= i, o = t != null && e.left <= t.left + t.width + a;
|
|
35
|
-
|
|
36
|
-
t.width = Math.max(t.left + t.width, e.left + e.width) - t.left, t.height = Math.max(t.height, e.height);
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
n.push({ ...e });
|
|
35
|
+
r && o ? (t.width = Math.max(t.left + t.width, e.left + e.width) - t.left, t.height = Math.max(t.height, e.height)) : n.push({ ...e });
|
|
40
36
|
}
|
|
41
37
|
return n;
|
|
42
38
|
}, h = (e, t, n) => Math.min(Math.max(e, t), n), g = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), _ = (e, t, n) => {
|
|
@@ -67,11 +63,7 @@ var n = 4 / 3, r = 9525, i = 2, a = 1, o = 0, s = 16, c = .25, l = () => {
|
|
|
67
63
|
let e = h(n - t.start, 0, t.end - t.start), i = o(t, e, h(r - t.start, e, t.end - t.start));
|
|
68
64
|
if (i == null) continue;
|
|
69
65
|
let c = s.get(t.surfaceIndex);
|
|
70
|
-
|
|
71
|
-
s.set(t.surfaceIndex, [i]);
|
|
72
|
-
continue;
|
|
73
|
-
}
|
|
74
|
-
c.push(i);
|
|
66
|
+
c == null ? s.set(t.surfaceIndex, [i]) : c.push(i);
|
|
75
67
|
}
|
|
76
68
|
for (let [e, t] of s) s.set(e, m(t));
|
|
77
69
|
return s;
|
|
@@ -118,7 +110,7 @@ var n = 4 / 3, r = 9525, i = 2, a = 1, o = 0, s = 16, c = .25, l = () => {
|
|
|
118
110
|
});
|
|
119
111
|
}, x = (e) => e.rotation !== 0 || (e.textBodyRotation ?? 0) !== 0 || e.shapeFlipH === !0 || e.shapeFlipV === !0, S = ({ location: e, runs: t, measure: n }) => {
|
|
120
112
|
let r = [], i = "";
|
|
121
|
-
for (let n of t) n.shapeId != null && String(n.shapeId) === e.shapeId &&
|
|
113
|
+
for (let n of t) n.shapeId != null && String(n.shapeId) === e.shapeId && n.origin !== "master" && n.origin !== "layout" && (r.push({
|
|
122
114
|
run: n,
|
|
123
115
|
box: {
|
|
124
116
|
x: n.shapeX + n.inShapeX,
|
|
@@ -129,7 +121,7 @@ var n = 4 / 3, r = 9525, i = 2, a = 1, o = 0, s = 16, c = .25, l = () => {
|
|
|
129
121
|
start: i.length,
|
|
130
122
|
end: i.length + n.text.length,
|
|
131
123
|
surfaceIndex: o
|
|
132
|
-
}), i += n.text)
|
|
124
|
+
}), i += n.text);
|
|
133
125
|
return y(r, i, e.start, e.endExclusive, e.text, x, ({ run: e, box: t }, r, i) => v(e.text, t, e.font, 0, !1, r, i, n)).get(o) ?? [];
|
|
134
126
|
}, C = (e, t) => {
|
|
135
127
|
let n = t.indexOf(e);
|
|
@@ -223,7 +215,7 @@ var n = 4 / 3, r = 9525, i = 2, a = 1, o = 0, s = 16, c = .25, l = () => {
|
|
|
223
215
|
}, M = (e, n) => {
|
|
224
216
|
if (!Number.isSafeInteger(e.occurrence) || e.occurrence < 1) return [];
|
|
225
217
|
let r = /* @__PURE__ */ new Map();
|
|
226
|
-
for (let e of n) e.tableCell
|
|
218
|
+
for (let e of n) e.tableCell != null && e.shapeId != null && e.origin !== "master" && e.origin !== "layout" && O(r, JSON.stringify([
|
|
227
219
|
e.elementIndex,
|
|
228
220
|
e.shapeId,
|
|
229
221
|
e.tableCell.row
|
|
@@ -428,7 +420,7 @@ var n = 4 / 3, r = 9525, i = 2, a = 1, o = 0, s = 16, c = .25, l = () => {
|
|
|
428
420
|
for (let n of e) for (let e of n.locations) {
|
|
429
421
|
if (e.kind !== t.XlsxCellRange) continue;
|
|
430
422
|
let s = C(e.sheet, r.sheetNames);
|
|
431
|
-
if (
|
|
423
|
+
if (s != null && s === r.sheetIndex) for (let t of T({
|
|
432
424
|
location: e,
|
|
433
425
|
getCellViewportRect: (e) => {
|
|
434
426
|
let t = r.getCellViewportRect(e);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-attachment-canvas",
|
|
3
3
|
"description": "Canvas viewer for rendering attachment content — images, PDFs, Office documents, CSV, JSON, markdown, and plain text",
|
|
4
|
-
"version": "1.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.126",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
"react-json-view-lite": "^2.5.0",
|
|
23
23
|
"react-syntax-highlighter": "^16.1.1",
|
|
24
24
|
"@epam/ai-dial-react-pdf-highlighter": "0.3.0-dev.6",
|
|
25
|
-
"@epam/ai-dial-visualizer-connector": "1.3.0-dev.
|
|
25
|
+
"@epam/ai-dial-visualizer-connector": "1.3.0-dev.126",
|
|
26
26
|
"@epam/pdf-highlighter-kit": "^0.0.19",
|
|
27
27
|
"@mcp-ui/client": "^7.1.1",
|
|
28
28
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
29
29
|
"@modelcontextprotocol/ext-apps": "1.7.5",
|
|
30
30
|
"pdfjs-dist": "^5.4.149",
|
|
31
|
-
"@epam/ai-dial-sidebar": "1.3.0-dev.
|
|
31
|
+
"@epam/ai-dial-sidebar": "1.3.0-dev.126"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
34
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.126",
|
|
35
35
|
"@epam/ai-dial-ui-kit": "^0.16.0-dev.20",
|
|
36
36
|
"react": "^19.2.8"
|
|
37
37
|
},
|
package/PdfContent-BR6khcNW.js
DELETED
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
import "./PdfContent.css";
|
|
2
|
-
import { a as e, n as t, r as n } from "./LazyContentBoundary-tNE1ExbI.js";
|
|
3
|
-
import { mergeClasses as r } from "@epam/ai-dial-chat-shared";
|
|
4
|
-
import { DIAL_ICON_SIZE as i, DIAL_KIT_ICON_STROKE as a, Dropdown as o, ElementSize as s, FabButton as c, Input as ee } from "@epam/ai-dial-ui-kit";
|
|
5
|
-
import { IconMenu2 as te, IconX as ne } from "@tabler/icons-react";
|
|
6
|
-
import { useCallback as l, useEffect as u, useId as d, useRef as f, useState as p } from "react";
|
|
7
|
-
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
8
|
-
import { DocumentPreview as re, PageThumbnail as ie } from "@epam/ai-dial-react-pdf-highlighter";
|
|
9
|
-
var g = { viewer: "_viewer_1gfxm_1" }, _ = null, ae = (e) => (_ ||= new Promise((t, n) => {
|
|
10
|
-
try {
|
|
11
|
-
t(e());
|
|
12
|
-
} catch (e) {
|
|
13
|
-
n(e);
|
|
14
|
-
}
|
|
15
|
-
}).catch((e) => {
|
|
16
|
-
throw _ = null, e;
|
|
17
|
-
}), _), oe = 15, v = 3, se = 172, ce = 400, y = 150, le = 60, b = ({ url: _, highlights: b, selectedHighlightId: x, selectedPageNumber: S, loadPdf: C, configurePdfWorker: w, hideHeader: ue = !1, onLoadError: T, labels: { thumbnailsLabel: de = "Thumbnails", showThumbnailsLabel: fe = "Show thumbnails", hideThumbnailsLabel: pe = "Hide thumbnails", pageNumberLabel: me = "Page number", loadingLabel: he = "Loading…", errorLabel: ge = "Failed to load content", retryLabel: _e = "Retry" } = {} }) => {
|
|
18
|
-
let [E, D] = p(() => w ? "preparing" : "ready"), [ve, ye] = p(0), be = l(async (t) => {
|
|
19
|
-
try {
|
|
20
|
-
return await (C ?? e)(t);
|
|
21
|
-
} catch (e) {
|
|
22
|
-
throw T?.(t), e;
|
|
23
|
-
}
|
|
24
|
-
}, [C, T]);
|
|
25
|
-
u(() => {
|
|
26
|
-
if (!w) return;
|
|
27
|
-
D("preparing");
|
|
28
|
-
let e = !1;
|
|
29
|
-
return ae(w).then(() => {
|
|
30
|
-
e || D("ready");
|
|
31
|
-
}).catch(() => {
|
|
32
|
-
e || D("error");
|
|
33
|
-
}), () => {
|
|
34
|
-
e = !0;
|
|
35
|
-
};
|
|
36
|
-
}, [w, ve]);
|
|
37
|
-
let xe = l(() => {
|
|
38
|
-
ye((e) => e + 1);
|
|
39
|
-
}, []), O = d(), [k, Se] = p(0), [A, j] = p(/* @__PURE__ */ new Map()), [M, Ce] = p(!1), [N, P] = p(() => S ?? (x ? b.find((e) => e.id === x)?.bboxes[0]?.page ?? 1 : 1)), F = f(null), I = f(null), [we, L] = p([]), [R, Te] = p(se), [z, Ee] = p(ce), [De, B] = p(0), V = f(!1), H = f(0), U = f(null);
|
|
40
|
-
u(() => {
|
|
41
|
-
if (S != null) {
|
|
42
|
-
P(S);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (!x) return;
|
|
46
|
-
let e = b.find((e) => e.id === x)?.bboxes[0]?.page;
|
|
47
|
-
e != null && P(e);
|
|
48
|
-
}, [
|
|
49
|
-
S,
|
|
50
|
-
x,
|
|
51
|
-
b
|
|
52
|
-
]), u(() => {
|
|
53
|
-
let e = I.current;
|
|
54
|
-
if (!M || !e) return;
|
|
55
|
-
let t = new ResizeObserver((e) => {
|
|
56
|
-
let t = e[0]?.contentRect.height;
|
|
57
|
-
t && Ee(t);
|
|
58
|
-
});
|
|
59
|
-
return t.observe(e), () => t.disconnect();
|
|
60
|
-
}, [M]);
|
|
61
|
-
let Oe = l((e) => {
|
|
62
|
-
if (!e || V.current) return;
|
|
63
|
-
let t = e.getBoundingClientRect().height;
|
|
64
|
-
t > 0 && (V.current = !0, Te(t));
|
|
65
|
-
}, []), ke = l((e) => {
|
|
66
|
-
H.current = e.currentTarget.scrollTop, U.current ??= requestAnimationFrame(() => {
|
|
67
|
-
U.current = null, B(H.current);
|
|
68
|
-
});
|
|
69
|
-
}, []);
|
|
70
|
-
u(() => () => {
|
|
71
|
-
U.current != null && cancelAnimationFrame(U.current);
|
|
72
|
-
}, []);
|
|
73
|
-
let W = l((e) => {
|
|
74
|
-
if (k === 0) return;
|
|
75
|
-
let t = Math.max(0, (N - 1) * R - e.clientHeight / 2 + R / 2);
|
|
76
|
-
H.current = t, B(t), e.scrollTop = t;
|
|
77
|
-
}, [
|
|
78
|
-
N,
|
|
79
|
-
k,
|
|
80
|
-
R
|
|
81
|
-
]), Ae = l((e) => {
|
|
82
|
-
I.current = e, e && W(e);
|
|
83
|
-
}, [W]);
|
|
84
|
-
u(() => {
|
|
85
|
-
let e = I.current;
|
|
86
|
-
e && W(e);
|
|
87
|
-
}, [W]);
|
|
88
|
-
let G = Math.max(0, Math.floor(De / R) - v), je = Math.ceil(z / R) + v * 2, K = Math.min(k - 1, G + je);
|
|
89
|
-
u(() => {
|
|
90
|
-
if (k === 0) return;
|
|
91
|
-
let e = Math.min(k, oe);
|
|
92
|
-
L(Array.from({ length: e }, (e, t) => t + 1));
|
|
93
|
-
}, [k]), u(() => {
|
|
94
|
-
if (!M || k === 0) return;
|
|
95
|
-
let e = setTimeout(() => {
|
|
96
|
-
L((e) => {
|
|
97
|
-
let t = new Set(e), n = !1;
|
|
98
|
-
for (let e = G + 1; e <= K + 1; e++) t.has(e) || (t.add(e), n = !0);
|
|
99
|
-
return n ? Array.from(t).sort((e, t) => e - t) : e;
|
|
100
|
-
});
|
|
101
|
-
}, y);
|
|
102
|
-
return () => clearTimeout(e);
|
|
103
|
-
}, [
|
|
104
|
-
M,
|
|
105
|
-
G,
|
|
106
|
-
K,
|
|
107
|
-
k
|
|
108
|
-
]), u(() => {
|
|
109
|
-
if (k === 0) return;
|
|
110
|
-
let e = setTimeout(() => {
|
|
111
|
-
let e = Math.ceil(z / R / 2) + v, t = Math.max(0, N - 1 - e), n = Math.min(k - 1, N - 1 + e);
|
|
112
|
-
L((e) => {
|
|
113
|
-
let r = new Set(e), i = !1;
|
|
114
|
-
for (let e = t + 1; e <= n + 1; e++) r.has(e) || (r.add(e), i = !0);
|
|
115
|
-
return i ? Array.from(r).sort((e, t) => e - t) : e;
|
|
116
|
-
});
|
|
117
|
-
}, y);
|
|
118
|
-
return () => clearTimeout(e);
|
|
119
|
-
}, [
|
|
120
|
-
N,
|
|
121
|
-
k,
|
|
122
|
-
z,
|
|
123
|
-
R
|
|
124
|
-
]);
|
|
125
|
-
let Me = l((e) => {
|
|
126
|
-
j((t) => new Map([...t, ...e]));
|
|
127
|
-
}, []), [q, Ne] = p(!1), Pe = l((e) => {
|
|
128
|
-
F.current = e, Ne(!0);
|
|
129
|
-
}, []), J = f(null);
|
|
130
|
-
u(() => {
|
|
131
|
-
if (!q) return;
|
|
132
|
-
let e = J.current, t = e?.querySelector(".pdf-container"), n = e?.querySelector(".pdf-highlight-viewer");
|
|
133
|
-
if (!t || !n) return;
|
|
134
|
-
let r = () => {
|
|
135
|
-
let e = n.scrollWidth - n.clientWidth;
|
|
136
|
-
e > 0 && (n.scrollLeft = e / 2);
|
|
137
|
-
};
|
|
138
|
-
r();
|
|
139
|
-
let i = new ResizeObserver(r);
|
|
140
|
-
i.observe(t), i.observe(n);
|
|
141
|
-
let a = F.current?.getZoom(), o = 0, s, c = () => {
|
|
142
|
-
let e = F.current?.getZoom();
|
|
143
|
-
e !== a && (a = e, o = le), o > 0 && (r(), --o), s = requestAnimationFrame(c);
|
|
144
|
-
};
|
|
145
|
-
return s = requestAnimationFrame(c), () => {
|
|
146
|
-
cancelAnimationFrame(s), i.disconnect();
|
|
147
|
-
};
|
|
148
|
-
}, [q]), u(() => {
|
|
149
|
-
if (!q || x || S != null) return;
|
|
150
|
-
let e = requestAnimationFrame(() => {
|
|
151
|
-
F.current?.navigateToPage(1);
|
|
152
|
-
});
|
|
153
|
-
return () => cancelAnimationFrame(e);
|
|
154
|
-
}, [
|
|
155
|
-
q,
|
|
156
|
-
x,
|
|
157
|
-
S
|
|
158
|
-
]);
|
|
159
|
-
let Y = l((e) => {
|
|
160
|
-
P(e), F.current?.navigateToPage(e);
|
|
161
|
-
}, []), Fe = l((e) => {
|
|
162
|
-
P(e);
|
|
163
|
-
}, []), [X, Z] = p(() => String(N));
|
|
164
|
-
u(() => {
|
|
165
|
-
Z(String(N));
|
|
166
|
-
}, [N]);
|
|
167
|
-
let Q = l((e) => {
|
|
168
|
-
let t = Number(e);
|
|
169
|
-
Number.isInteger(t) && t >= 1 && t <= k ? Y(t) : Z(String(N));
|
|
170
|
-
}, [
|
|
171
|
-
k,
|
|
172
|
-
N,
|
|
173
|
-
Y
|
|
174
|
-
]);
|
|
175
|
-
if (!_) return null;
|
|
176
|
-
if (E === "preparing") return /* @__PURE__ */ m(n, { loadingLabel: he });
|
|
177
|
-
if (E === "error") return /* @__PURE__ */ m(t, {
|
|
178
|
-
errorLabel: ge,
|
|
179
|
-
retryLabel: _e,
|
|
180
|
-
onRetry: xe
|
|
181
|
-
});
|
|
182
|
-
let $ = [];
|
|
183
|
-
for (let e = G + 1; e <= K + 1 && e <= k; e++) $.push(/* @__PURE__ */ m("div", {
|
|
184
|
-
ref: e === G + 1 ? Oe : void 0,
|
|
185
|
-
children: /* @__PURE__ */ m(ie, {
|
|
186
|
-
pageNum: e,
|
|
187
|
-
onSelectPage: Y,
|
|
188
|
-
isSelected: N === e,
|
|
189
|
-
isLoading: !A.has(e),
|
|
190
|
-
thumbnailUrl: A.get(e) ?? null
|
|
191
|
-
})
|
|
192
|
-
}, e));
|
|
193
|
-
let Ie = G * R, Le = Math.max(0, k - K - 1) * R;
|
|
194
|
-
return /* @__PURE__ */ h("div", {
|
|
195
|
-
className: "relative flex h-full overflow-hidden",
|
|
196
|
-
children: [k > 0 && /* @__PURE__ */ m("div", {
|
|
197
|
-
className: "absolute inset-s-3 top-3 z-10",
|
|
198
|
-
children: /* @__PURE__ */ m(o, {
|
|
199
|
-
open: M,
|
|
200
|
-
onOpenChange: Ce,
|
|
201
|
-
allowedPlacements: ["bottom-start"],
|
|
202
|
-
matchReferenceWidth: !1,
|
|
203
|
-
initialFocus: -1,
|
|
204
|
-
renderOverlay: () => /* @__PURE__ */ h("div", {
|
|
205
|
-
className: "flex w-36 flex-col",
|
|
206
|
-
children: [/* @__PURE__ */ m("div", {
|
|
207
|
-
className: "w-[88px] shrink-0 p-1",
|
|
208
|
-
children: /* @__PURE__ */ m(ee, {
|
|
209
|
-
size: s.Small,
|
|
210
|
-
"aria-label": me,
|
|
211
|
-
value: X,
|
|
212
|
-
postfix: `/ ${k}`,
|
|
213
|
-
inputMode: "numeric",
|
|
214
|
-
onChange: (e) => Z(e ?? ""),
|
|
215
|
-
onBlur: () => Q(X),
|
|
216
|
-
onKeyDown: (e) => {
|
|
217
|
-
e.key === "Enter" && Q(X);
|
|
218
|
-
}
|
|
219
|
-
})
|
|
220
|
-
}), /* @__PURE__ */ h("div", {
|
|
221
|
-
ref: Ae,
|
|
222
|
-
id: O,
|
|
223
|
-
role: "region",
|
|
224
|
-
"aria-label": de,
|
|
225
|
-
onScroll: ke,
|
|
226
|
-
className: "max-h-[min(70vh,calc(var(--fui-available-height,70vh)-2.5rem))] min-h-0 [scrollbar-gutter:stable_both-edges] overflow-x-hidden overflow-y-auto p-1",
|
|
227
|
-
children: [
|
|
228
|
-
/* @__PURE__ */ m("div", { style: { height: Ie } }),
|
|
229
|
-
$,
|
|
230
|
-
/* @__PURE__ */ m("div", { style: { height: Le } })
|
|
231
|
-
]
|
|
232
|
-
})]
|
|
233
|
-
}),
|
|
234
|
-
children: /* @__PURE__ */ m(c, {
|
|
235
|
-
icon: m(M ? ne : te, {
|
|
236
|
-
size: i.LG,
|
|
237
|
-
stroke: a,
|
|
238
|
-
"aria-hidden": !0
|
|
239
|
-
}),
|
|
240
|
-
"aria-label": M ? pe : fe,
|
|
241
|
-
"aria-expanded": M,
|
|
242
|
-
"aria-controls": M ? O : void 0
|
|
243
|
-
})
|
|
244
|
-
})
|
|
245
|
-
}), /* @__PURE__ */ m("div", {
|
|
246
|
-
ref: J,
|
|
247
|
-
className: r("min-w-0 flex-1 overflow-hidden", g.viewer),
|
|
248
|
-
children: /* @__PURE__ */ m(re, {
|
|
249
|
-
fileUrl: _,
|
|
250
|
-
loadFileCb: be,
|
|
251
|
-
highlights: b,
|
|
252
|
-
selectedHighlightId: x,
|
|
253
|
-
selectedPageNumber: S,
|
|
254
|
-
showOccurrences: !1,
|
|
255
|
-
onTotalPagesChange: Se,
|
|
256
|
-
thumbnailPageNumbers: we,
|
|
257
|
-
onThumbnailsLoaded: Me,
|
|
258
|
-
onViewerReady: Pe,
|
|
259
|
-
onCurrentPageChange: Fe,
|
|
260
|
-
viewerOptions: { enableVirtualScrolling: !0 },
|
|
261
|
-
containerClassName: ue ? "[&>div:first-child]:hidden" : void 0
|
|
262
|
-
})
|
|
263
|
-
})]
|
|
264
|
-
});
|
|
265
|
-
};
|
|
266
|
-
//#endregion
|
|
267
|
-
export { b as PdfContent };
|