@epam/ai-dial-attachment-canvas 1.1.0-dev.127 → 1.1.0-dev.128
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.
- package/index.js +21 -21
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CodeBlockTheme as e, DEFAULT_MARKDOWN_CLASS_NAMES as t, MIMEType as n, MarkdownRenderer as r, buildCssVars as i, copyToClipboard as a, mergeClasses as o, restrainedSyntaxTheme as s, triggerAnchorDownload as c, triggerBlobDownload as l, useIsMobile as u } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { SidebarOrientation as d, SidebarPanel as f } from "@epam/ai-dial-sidebar";
|
|
3
|
-
import { DIAL_ICON_SIZE as p, DialButton as m, DialCheckbox as h, DialEllipsisTooltip as g,
|
|
3
|
+
import { DIAL_ICON_SIZE as p, DialButton as m, DialCheckbox as h, DialEllipsisTooltip as g, DialLoader as _, DialSelect as v, ElementSize as y, GhostIconButton as b, LinkButton as x, SelectSize as S, Spinner as C, mergeClasses as w } from "@epam/ai-dial-ui-kit";
|
|
4
4
|
import { IconAlertTriangle as T, IconCheck as E, IconChevronDown as D, IconChevronUp as O, IconCode as k, IconCopy as A, IconDownload as j, IconEye as M, IconLock as ee, IconMarkdown as te, IconMinus as ne, IconPlus as re } from "@tabler/icons-react";
|
|
5
5
|
import ie, { createContext as ae, memo as oe, useCallback as N, useContext as se, useEffect as P, useMemo as ce, useRef as le, useState as F } from "react";
|
|
6
6
|
import { JsonView as ue, defaultStyles as de } from "react-json-view-lite";
|
|
@@ -17526,13 +17526,13 @@ var oc = {
|
|
|
17526
17526
|
children: [/* @__PURE__ */ I("p", {
|
|
17527
17527
|
className: "text-center",
|
|
17528
17528
|
children: s
|
|
17529
|
-
}), e.url != null && /* @__PURE__ */ I(
|
|
17529
|
+
}), e.url != null && /* @__PURE__ */ I(x, {
|
|
17530
17530
|
label: c,
|
|
17531
17531
|
onClick: () => window.open(e.url, "_blank", "noopener,noreferrer"),
|
|
17532
17532
|
className: o("underline hover:no-underline", cc.openInNewTabButton, a)
|
|
17533
17533
|
})]
|
|
17534
17534
|
});
|
|
17535
|
-
let g = e.srcdoc != null,
|
|
17535
|
+
let g = e.srcdoc != null, _ = g ? void 0 : e.url, v = g ? e.srcdoc : void 0;
|
|
17536
17536
|
return /* @__PURE__ */ L("div", {
|
|
17537
17537
|
className: "relative h-full",
|
|
17538
17538
|
children: [l && /* @__PURE__ */ I("div", {
|
|
@@ -17541,8 +17541,8 @@ var oc = {
|
|
|
17541
17541
|
}), /* @__PURE__ */ I("iframe", {
|
|
17542
17542
|
ref: p,
|
|
17543
17543
|
title: r,
|
|
17544
|
-
src:
|
|
17545
|
-
srcDoc:
|
|
17544
|
+
src: _,
|
|
17545
|
+
srcDoc: v,
|
|
17546
17546
|
sandbox: g ? "allow-scripts" : "allow-scripts allow-same-origin",
|
|
17547
17547
|
className: o("h-full w-full border-none", l ? "invisible" : ""),
|
|
17548
17548
|
onLoad: m,
|
|
@@ -34345,7 +34345,7 @@ var Om = hm.map((e) => ({
|
|
|
34345
34345
|
handleZoomChange: D,
|
|
34346
34346
|
handleViewerReady: k
|
|
34347
34347
|
};
|
|
34348
|
-
}, Am = ({ fileUrl: e, fileName: t, errorLabel: n, occurrencesLabel: r, unsupportedLabel: i, highlights: a, loadFileCb: o, showOccurrences: s = !0, selectedPageNumber: c, containerClassName: l, pdfViewerClassName: u, onTotalPagesChange: d, title: f, thumbnailPageNumbers: p, onThumbnailsLoaded: h, onViewerReady: _, showLoaderOverlay:
|
|
34348
|
+
}, Am = ({ fileUrl: e, fileName: t, errorLabel: n, occurrencesLabel: r, unsupportedLabel: i, highlights: a, loadFileCb: o, showOccurrences: s = !0, selectedPageNumber: c, containerClassName: l, pdfViewerClassName: u, onTotalPagesChange: d, title: f, thumbnailPageNumbers: p, onThumbnailsLoaded: h, onViewerReady: _, showLoaderOverlay: b = !1, selectedPages: x, selectedHighlightId: C, viewerOptions: E }) => {
|
|
34349
34349
|
let { file: k, isError: A, isSupportedFile: j, activeHighlightIndex: M, zoom: ee, setZoom: te, zoomSelectOptions: ie, showLoader: ae, changeIndex: oe, handleZoomChange: N, handleViewerReady: se } = km({
|
|
34350
34350
|
fileUrl: e,
|
|
34351
34351
|
fileName: t,
|
|
@@ -34356,7 +34356,7 @@ var Om = hm.map((e) => ({
|
|
|
34356
34356
|
thumbnailPageNumbers: p,
|
|
34357
34357
|
onThumbnailsLoaded: h,
|
|
34358
34358
|
onViewerReady: _,
|
|
34359
|
-
showLoaderOverlay:
|
|
34359
|
+
showLoaderOverlay: b,
|
|
34360
34360
|
selectedPages: x
|
|
34361
34361
|
});
|
|
34362
34362
|
return /* @__PURE__ */ L("div", {
|
|
@@ -34385,13 +34385,13 @@ var Om = hm.map((e) => ({
|
|
|
34385
34385
|
]
|
|
34386
34386
|
}), a.length > 0 && /* @__PURE__ */ L(fe, { children: [/* @__PURE__ */ I(m, {
|
|
34387
34387
|
className: "p-0 text-primary !h-6.5",
|
|
34388
|
-
size:
|
|
34388
|
+
size: y.Small,
|
|
34389
34389
|
iconAfter: /* @__PURE__ */ I(D, { size: 16 }),
|
|
34390
34390
|
"aria-label": "Next occurrence",
|
|
34391
34391
|
onClick: () => oe(1)
|
|
34392
34392
|
}), /* @__PURE__ */ I(m, {
|
|
34393
34393
|
className: "p-0 text-primary !h-6.5",
|
|
34394
|
-
size:
|
|
34394
|
+
size: y.Small,
|
|
34395
34395
|
iconAfter: /* @__PURE__ */ I(O, { size: 16 }),
|
|
34396
34396
|
"aria-label": "Previous occurrence",
|
|
34397
34397
|
onClick: () => oe(-1)
|
|
@@ -34406,7 +34406,7 @@ var Om = hm.map((e) => ({
|
|
|
34406
34406
|
children: [
|
|
34407
34407
|
/* @__PURE__ */ I("div", {
|
|
34408
34408
|
className: "h-6",
|
|
34409
|
-
children: /* @__PURE__ */ I(
|
|
34409
|
+
children: /* @__PURE__ */ I(v, {
|
|
34410
34410
|
size: S.Sm,
|
|
34411
34411
|
className: "bg-layer-4 !py-0 h-6 min-h-6 dial-small-text max-h-full border-transparent hover:border-hover rounded",
|
|
34412
34412
|
options: ie,
|
|
@@ -34418,14 +34418,14 @@ var Om = hm.map((e) => ({
|
|
|
34418
34418
|
className: "py-0 flex items-center justify-center rounded text-primary bg-layer-4 border border-transparent hover:border-hover",
|
|
34419
34419
|
iconAfter: /* @__PURE__ */ I(ne, { size: 16 }),
|
|
34420
34420
|
"aria-label": "Zoom out",
|
|
34421
|
-
size:
|
|
34421
|
+
size: y.Small,
|
|
34422
34422
|
onClick: () => N(-1)
|
|
34423
34423
|
}),
|
|
34424
34424
|
/* @__PURE__ */ I(m, {
|
|
34425
34425
|
className: "py-0 flex items-center justify-center rounded text-primary bg-layer-4 border border-transparent hover:border-hover",
|
|
34426
34426
|
iconAfter: /* @__PURE__ */ I(re, { size: 16 }),
|
|
34427
34427
|
"aria-label": "Zoom in",
|
|
34428
|
-
size:
|
|
34428
|
+
size: y.Small,
|
|
34429
34429
|
onClick: () => N(1)
|
|
34430
34430
|
})
|
|
34431
34431
|
]
|
|
@@ -34494,7 +34494,7 @@ var Om = hm.map((e) => ({
|
|
|
34494
34494
|
}),
|
|
34495
34495
|
r && /* @__PURE__ */ I("div", {
|
|
34496
34496
|
className: "absolute inset-0 flex items-center justify-center bg-blackout rounded-sm",
|
|
34497
|
-
children: /* @__PURE__ */ I(
|
|
34497
|
+
children: /* @__PURE__ */ I(_, {
|
|
34498
34498
|
size: 24,
|
|
34499
34499
|
fullWidth: !1,
|
|
34500
34500
|
ariaLabel: `Loading page ${e}`
|
|
@@ -34702,7 +34702,7 @@ var Om = hm.map((e) => ({
|
|
|
34702
34702
|
className: "max-h-full max-w-full object-contain",
|
|
34703
34703
|
onError: () => i(!0)
|
|
34704
34704
|
});
|
|
34705
|
-
}, Vm = oe(({ isOpen: e, isLoading: n = !1, onClose: a, content: s, fileName: c, labels: { ariaLabel: l, closeLabel: u = "Close", downloadLabel: m = "Download", copyTextLabel: h = "Copy text", copiedTextLabel: g = "Copied!", copyMarkdownLabel: _ = "Copy as Markdown", copiedMarkdownLabel: v = "Copied!", copyJsonLabel: y = "Copy as JSON", copiedJsonLabel:
|
|
34705
|
+
}, Vm = oe(({ isOpen: e, isLoading: n = !1, onClose: a, content: s, fileName: c, labels: { ariaLabel: l, closeLabel: u = "Close", downloadLabel: m = "Download", copyTextLabel: h = "Copy text", copiedTextLabel: g = "Copied!", copyMarkdownLabel: _ = "Copy as Markdown", copiedMarkdownLabel: v = "Copied!", copyJsonLabel: y = "Copy as JSON", copiedJsonLabel: x = "Copied!", visualizerErrorLabel: S, unsupportedLabel: w = "Preview is not supported for this file", loadErrorLabel: D = "Failed to load file", forbiddenErrorLabel: O = "You don't have permission to access this file", htmlFrameBlockedLabel: ne = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: re = "Open in new tab", htmlViewSourceLabel: ie = "View source", htmlViewRenderedLabel: ae = "View rendered" }, onDownload: oe, onCopyText: se, onCopyMarkdown: pe, onCopyJson: me, isMobile: he = !1, defaultWidth: ge, minWidth: ye = 600, maxWidth: be = 1500, onResizeStop: xe, styles: Se, codeBlockTheme: Ce, loadPdf: we }) => {
|
|
34706
34706
|
let [Te, Ee] = F(!1), [De, Oe] = F(!1), [ke, Ae] = F(!1), [je, Me] = F(!1), Ne = le(null), Pe = le(null), Fe = le(null), Ie = N(() => {
|
|
34707
34707
|
se?.(), Ne.current != null && clearTimeout(Ne.current), Ee(!0), Ne.current = setTimeout(() => Ee(!1), zm);
|
|
34708
34708
|
}, [se]), Le = N(() => {
|
|
@@ -34890,7 +34890,7 @@ var Om = hm.map((e) => ({
|
|
|
34890
34890
|
className: o(e ? "mobile:w-full mobile:max-w-full" : "w-0", Ue, Ge?.className)
|
|
34891
34891
|
},
|
|
34892
34892
|
rightActions: Je || Ye || Xe || Ze || Qe ? /* @__PURE__ */ L(fe, { children: [
|
|
34893
|
-
Je && /* @__PURE__ */ I(
|
|
34893
|
+
Je && /* @__PURE__ */ I(b, {
|
|
34894
34894
|
icon: I(je ? M : k, {
|
|
34895
34895
|
size: p.LG,
|
|
34896
34896
|
stroke: 1.5,
|
|
@@ -34901,7 +34901,7 @@ var Om = hm.map((e) => ({
|
|
|
34901
34901
|
tooltipProps: { tooltip: je ? ae : ie },
|
|
34902
34902
|
onClick: ze
|
|
34903
34903
|
}),
|
|
34904
|
-
Ye && /* @__PURE__ */ I(
|
|
34904
|
+
Ye && /* @__PURE__ */ I(b, {
|
|
34905
34905
|
icon: I(Te ? E : A, {
|
|
34906
34906
|
size: p.LG,
|
|
34907
34907
|
stroke: 1.5,
|
|
@@ -34911,7 +34911,7 @@ var Om = hm.map((e) => ({
|
|
|
34911
34911
|
tooltipProps: { tooltip: Te ? g : h },
|
|
34912
34912
|
onClick: Ie
|
|
34913
34913
|
}),
|
|
34914
|
-
Xe && /* @__PURE__ */ I(
|
|
34914
|
+
Xe && /* @__PURE__ */ I(b, {
|
|
34915
34915
|
icon: I(De ? E : te, {
|
|
34916
34916
|
size: p.LG,
|
|
34917
34917
|
stroke: 1.5,
|
|
@@ -34921,17 +34921,17 @@ var Om = hm.map((e) => ({
|
|
|
34921
34921
|
tooltipProps: { tooltip: De ? v : _ },
|
|
34922
34922
|
onClick: Le
|
|
34923
34923
|
}),
|
|
34924
|
-
Ze && /* @__PURE__ */ I(
|
|
34924
|
+
Ze && /* @__PURE__ */ I(b, {
|
|
34925
34925
|
icon: I(ke ? E : A, {
|
|
34926
34926
|
size: p.LG,
|
|
34927
34927
|
stroke: 1.5,
|
|
34928
34928
|
"aria-hidden": !0
|
|
34929
34929
|
}),
|
|
34930
|
-
"aria-label": ke ?
|
|
34931
|
-
tooltipProps: { tooltip: ke ?
|
|
34930
|
+
"aria-label": ke ? x : y,
|
|
34931
|
+
tooltipProps: { tooltip: ke ? x : y },
|
|
34932
34932
|
onClick: Re
|
|
34933
34933
|
}),
|
|
34934
|
-
Qe && /* @__PURE__ */ I(
|
|
34934
|
+
Qe && /* @__PURE__ */ I(b, {
|
|
34935
34935
|
icon: /* @__PURE__ */ I(j, {
|
|
34936
34936
|
size: p.LG,
|
|
34937
34937
|
stroke: 1.5
|
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, JSON, markdown, and plain text",
|
|
4
|
-
"version": "1.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.128",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@epam/ai-dial-chat-shared": "1.1.0-dev.
|
|
20
|
+
"@epam/ai-dial-chat-shared": "1.1.0-dev.128",
|
|
21
21
|
"@epam/ai-dial-shared": "0.48.0",
|
|
22
|
-
"@epam/ai-dial-sidebar": "1.1.0-dev.
|
|
22
|
+
"@epam/ai-dial-sidebar": "1.1.0-dev.128",
|
|
23
23
|
"@epam/ai-dial-visualizer-connector": "0.48.0",
|
|
24
24
|
"@epam/ai-dial-ui-kit": "^0.13.0-dev.26",
|
|
25
25
|
"@epam/pdf-highlighter-kit": ">=0.0.14",
|