@epam/ai-dial-attachment-canvas 1.1.0-dev.124 → 1.1.0-dev.125

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.
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentCanvas.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCanvas/AttachmentCanvas.tsx"],"names":[],"mappings":"AAgCA,OAAO,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAwkB5E,wGAAwG;AACxG,eAAO,MAAM,gBAAgB,6DAA6B,CAAC"}
1
+ {"version":3,"file":"AttachmentCanvas.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCanvas/AttachmentCanvas.tsx"],"names":[],"mappings":"AA4BA,OAAO,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAwkB5E,wGAAwG;AACxG,eAAO,MAAM,gBAAgB,6DAA6B,CAAC"}
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, DialLinkButton as _, DialLoader as v, DialSelect as y, DialSpinner as b, ElementSize as x, GhostIconButton as S, SelectSize as C, mergeClasses as w } from "@epam/ai-dial-ui-kit";
3
+ import { DIAL_ICON_SIZE as p, DialButton as m, DialCheckbox as h, DialEllipsisTooltip as g, DialLinkButton as _, DialLoader as v, DialSelect as y, ElementSize as b, GhostIconButton 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";
@@ -17537,7 +17537,7 @@ var oc = {
17537
17537
  className: "relative h-full",
17538
17538
  children: [l && /* @__PURE__ */ I("div", {
17539
17539
  className: "absolute inset-0 flex items-center justify-center",
17540
- children: /* @__PURE__ */ I(b, {})
17540
+ children: /* @__PURE__ */ I(C, {})
17541
17541
  }), /* @__PURE__ */ I("iframe", {
17542
17542
  ref: p,
17543
17543
  title: r,
@@ -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: v = !1, selectedPages: b, selectedHighlightId: S, viewerOptions: E }) => {
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: v = !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,
@@ -34357,7 +34357,7 @@ var Om = hm.map((e) => ({
34357
34357
  onThumbnailsLoaded: h,
34358
34358
  onViewerReady: _,
34359
34359
  showLoaderOverlay: v,
34360
- selectedPages: b
34360
+ selectedPages: x
34361
34361
  });
34362
34362
  return /* @__PURE__ */ L("div", {
34363
34363
  className: w("flex flex-col self-center gap-4 py-3 px-6 h-full w-full bg-layer-2", l),
@@ -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: x.Small,
34388
+ size: b.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: x.Small,
34394
+ size: b.Small,
34395
34395
  iconAfter: /* @__PURE__ */ I(O, { size: 16 }),
34396
34396
  "aria-label": "Previous occurrence",
34397
34397
  onClick: () => oe(-1)
@@ -34407,7 +34407,7 @@ var Om = hm.map((e) => ({
34407
34407
  /* @__PURE__ */ I("div", {
34408
34408
  className: "h-6",
34409
34409
  children: /* @__PURE__ */ I(y, {
34410
- size: C.Sm,
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,
34413
34413
  value: ee,
@@ -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: x.Small,
34421
+ size: b.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: x.Small,
34428
+ size: b.Small,
34429
34429
  onClick: () => N(1)
34430
34430
  })
34431
34431
  ]
@@ -34438,13 +34438,13 @@ var Om = hm.map((e) => ({
34438
34438
  k && /* @__PURE__ */ I(ym, {
34439
34439
  pdf: k,
34440
34440
  highlights: a,
34441
- selectedHighlightId: s ? a[M]?.id : S,
34441
+ selectedHighlightId: s ? a[M]?.id : C,
34442
34442
  selectedPageNumber: c,
34443
34443
  zoom: ee,
34444
34444
  onTotalPagesChange: d,
34445
34445
  onViewerReady: se,
34446
34446
  containerClassName: u,
34447
- selectedPages: b,
34447
+ selectedPages: x,
34448
34448
  viewerOptions: E
34449
34449
  }),
34450
34450
  ae && /* @__PURE__ */ I(xm, { className: "absolute inset-0 z-10" }),
@@ -34646,7 +34646,7 @@ var Om = hm.map((e) => ({
34646
34646
  }),
34647
34647
  s === "loading" && /* @__PURE__ */ L("div", {
34648
34648
  className: o("absolute inset-0 flex flex-col items-center justify-center gap-2", Im.loadingOverlay),
34649
- children: [/* @__PURE__ */ I(b, {}), t && /* @__PURE__ */ I("p", {
34649
+ children: [/* @__PURE__ */ I(C, {}), t && /* @__PURE__ */ I("p", {
34650
34650
  className: o("text-center", Im.statusLabel),
34651
34651
  children: t
34652
34652
  })]
@@ -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: x = "Copied!", visualizerErrorLabel: C, 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 }) => {
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: b = "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(() => {
@@ -34836,7 +34836,7 @@ var Om = hm.map((e) => ({
34836
34836
  }, s.url);
34837
34837
  case R.Visualizer: return /* @__PURE__ */ I(Lm, {
34838
34838
  content: s,
34839
- errorLabel: C
34839
+ errorLabel: S
34840
34840
  });
34841
34841
  case R.Unsupported: return /* @__PURE__ */ I("p", {
34842
34842
  className: o("text-center", Rm.statusLabel),
@@ -34865,7 +34865,7 @@ var Om = hm.map((e) => ({
34865
34865
  w,
34866
34866
  D,
34867
34867
  O,
34868
- C,
34868
+ S,
34869
34869
  ne,
34870
34870
  re,
34871
34871
  je,
@@ -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(S, {
34893
+ Je && /* @__PURE__ */ I(x, {
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(S, {
34904
+ Ye && /* @__PURE__ */ I(x, {
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(S, {
34914
+ Xe && /* @__PURE__ */ I(x, {
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(S, {
34924
+ Ze && /* @__PURE__ */ I(x, {
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 ? x : y,
34931
- tooltipProps: { tooltip: ke ? x : y },
34930
+ "aria-label": ke ? b : y,
34931
+ tooltipProps: { tooltip: ke ? b : y },
34932
34932
  onClick: Re
34933
34933
  }),
34934
- Qe && /* @__PURE__ */ I(S, {
34934
+ Qe && /* @__PURE__ */ I(x, {
34935
34935
  icon: /* @__PURE__ */ I(j, {
34936
34936
  size: p.LG,
34937
34937
  stroke: 1.5
@@ -34944,7 +34944,7 @@ var Om = hm.map((e) => ({
34944
34944
  children: /* @__PURE__ */ I("div", {
34945
34945
  style: !n && (s.type === R.PlainText || s.type === R.Code) ? qe : void 0,
34946
34946
  className: o(n ? "flex h-full items-center justify-center" : $e, He),
34947
- children: n ? /* @__PURE__ */ I(b, {}) : et
34947
+ children: n ? /* @__PURE__ */ I(C, {}) : et
34948
34948
  })
34949
34949
  });
34950
34950
  }), Hm = {
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.124",
4
+ "version": "1.1.0-dev.125",
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.124",
20
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.125",
21
21
  "@epam/ai-dial-shared": "0.48.0",
22
- "@epam/ai-dial-sidebar": "1.1.0-dev.124",
22
+ "@epam/ai-dial-sidebar": "1.1.0-dev.125",
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",