@epam/ai-dial-attachment-canvas 1.0.0-dev.462 → 1.0.0-dev.469
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/components/AttachmentCanvas/AttachmentCanvas.d.ts.map +1 -1
- package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts +4 -0
- package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +4 -4
- package/index.d.ts.map +1 -1
- package/index.js +1681 -1648
- package/models/attachment-canvas.d.ts +15 -2
- package/models/attachment-canvas.d.ts.map +1 -1
- package/package.json +4 -4
- package/types/attachment-canvas.d.ts +9 -1
- package/types/attachment-canvas.d.ts.map +1 -1
- package/utils/content.d.ts +5 -1
- package/utils/content.d.ts.map +1 -1
- package/utils/download.d.ts.map +1 -1
|
@@ -2,7 +2,7 @@ import { CodeBlockTheme } from '@epam/ai-dial-chat-shared';
|
|
|
2
2
|
import { SidebarPanelStyles } from '@epam/ai-dial-sidebar';
|
|
3
3
|
import { InputHighlightData } from '@epam/pdf-highlighter-kit';
|
|
4
4
|
import { CSSProperties } from 'react';
|
|
5
|
-
import { AttachmentContentType } from '../types/attachment-canvas';
|
|
5
|
+
import { AttachmentContentType, AttachmentErrorType } from '../types/attachment-canvas';
|
|
6
6
|
/** Content payload for plain-text attachments. */
|
|
7
7
|
export interface PlainTextCanvasContent {
|
|
8
8
|
/** Discriminates the content type to select the correct renderer. */
|
|
@@ -49,8 +49,17 @@ export interface UnsupportedCanvasContent {
|
|
|
49
49
|
/** Remote URL used to download the file even though it cannot be previewed. */
|
|
50
50
|
url?: string;
|
|
51
51
|
}
|
|
52
|
+
/** Content payload for attachments whose file failed to load or that the user cannot access. */
|
|
53
|
+
export interface ErrorCanvasContent {
|
|
54
|
+
/** Discriminates the content type to select the correct renderer. */
|
|
55
|
+
type: AttachmentContentType.Error;
|
|
56
|
+
/** The kind of failure that occurred. */
|
|
57
|
+
errorType: AttachmentErrorType;
|
|
58
|
+
/** Remote URL of the file, if known. Ignored for download purposes when `errorType` is `Forbidden`. */
|
|
59
|
+
url?: string;
|
|
60
|
+
}
|
|
52
61
|
/** The content payload passed to AttachmentCanvas. */
|
|
53
|
-
export type AttachmentCanvasContent = PlainTextCanvasContent | ImageCanvasContent | MarkdownCanvasContent | JsonCanvasContent | PdfCanvasContent | UnsupportedCanvasContent;
|
|
62
|
+
export type AttachmentCanvasContent = PlainTextCanvasContent | ImageCanvasContent | MarkdownCanvasContent | JsonCanvasContent | PdfCanvasContent | UnsupportedCanvasContent | ErrorCanvasContent;
|
|
54
63
|
/** Themeable color overrides for the AttachmentCanvas content body. */
|
|
55
64
|
export interface AttachmentCanvasColors {
|
|
56
65
|
/** Primary text color for the content body. */
|
|
@@ -115,6 +124,10 @@ export interface AttachmentCanvasProps {
|
|
|
115
124
|
onCopyJson?: () => void;
|
|
116
125
|
/** Message shown in the canvas body when the content type is `Unsupported`. Defaults to `'Preview is not supported for this file'`. */
|
|
117
126
|
unsupportedLabel?: string;
|
|
127
|
+
/** Message shown in the canvas body when content type is `Error` with `errorType: LoadFailed`. Defaults to `'Failed to load file'`. */
|
|
128
|
+
loadErrorLabel?: string;
|
|
129
|
+
/** Message shown in the canvas body when content type is `Error` with `errorType: Forbidden`. Defaults to `"You don't have permission to access this file"`. */
|
|
130
|
+
forbiddenErrorLabel?: string;
|
|
118
131
|
/** Accessible label for the download button. Defaults to `'Download'`. */
|
|
119
132
|
downloadLabel?: string;
|
|
120
133
|
/** Tooltip and accessible label for the copy-text button in its default state. Defaults to `'Copy text'`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/models/attachment-canvas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/models/attachment-canvas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AAEpC,kDAAkD;AAClD,MAAM,WAAW,sBAAsB;IACrC,qEAAqE;IACrE,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC;IACtC,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,6CAA6C;AAC7C,MAAM,WAAW,kBAAkB;IACjC,qEAAqE;IACrE,IAAI,EAAE,qBAAqB,CAAC,KAAK,CAAC;IAClC,yEAAyE;IACzE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qDAAqD;AACrD,MAAM,WAAW,qBAAqB;IACpC,qEAAqE;IACrE,IAAI,EAAE,qBAAqB,CAAC,QAAQ,CAAC;IACrC,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,iDAAiD;AACjD,MAAM,WAAW,iBAAiB;IAChC,qEAAqE;IACrE,IAAI,EAAE,qBAAqB,CAAC,IAAI,CAAC;IACjC,iEAAiE;IACjE,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,gDAAgD;AAChD,MAAM,WAAW,gBAAgB;IAC/B,qEAAqE;IACrE,IAAI,EAAE,qBAAqB,CAAC,GAAG,CAAC;IAChC,4DAA4D;IA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EAAE,MAAM,CAAC;IACvB,8GAA8G;IAC9G,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,0GAA0G;IAC1G,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iFAAiF;IACjF,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,mFAAmF;IACnF,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C"}
|
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.0.0-dev.
|
|
4
|
+
"version": "1.0.0-dev.469",
|
|
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.0.0-dev.
|
|
21
|
-
"@epam/ai-dial-sidebar": "1.0.0-dev.
|
|
22
|
-
"@epam/ai-dial-ui-kit": "0.12.0-dev.
|
|
20
|
+
"@epam/ai-dial-chat-shared": "1.0.0-dev.469",
|
|
21
|
+
"@epam/ai-dial-sidebar": "1.0.0-dev.469",
|
|
22
|
+
"@epam/ai-dial-ui-kit": "0.12.0-dev.28",
|
|
23
23
|
"@epam/pdf-highlighter-kit": ">=0.0.14",
|
|
24
24
|
"@tabler/icons-react": "^3.44.0",
|
|
25
25
|
"react": "^19.0.0",
|
|
@@ -5,6 +5,14 @@ export declare enum AttachmentContentType {
|
|
|
5
5
|
Markdown = "markdown",
|
|
6
6
|
Json = "json",
|
|
7
7
|
Pdf = "pdf",
|
|
8
|
-
Unsupported = "unsupported"
|
|
8
|
+
Unsupported = "unsupported",
|
|
9
|
+
Error = "error"
|
|
10
|
+
}
|
|
11
|
+
/** The kind of failure that produced an `ErrorCanvasContent`. */
|
|
12
|
+
export declare enum AttachmentErrorType {
|
|
13
|
+
/** The file failed to load (network error or a non-`403` non-OK response). */
|
|
14
|
+
LoadFailed = "load_failed",
|
|
15
|
+
/** The file request failed with HTTP `403` — the user lacks permission to access it. */
|
|
16
|
+
Forbidden = "forbidden"
|
|
9
17
|
}
|
|
10
18
|
//# sourceMappingURL=attachment-canvas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/types/attachment-canvas.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,oBAAY,qBAAqB;IAC/B,SAAS,eAAe;IACxB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,WAAW,gBAAgB;
|
|
1
|
+
{"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/types/attachment-canvas.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,oBAAY,qBAAqB;IAC/B,SAAS,eAAe;IACxB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,WAAW,gBAAgB;IAC3B,KAAK,UAAU;CAChB;AAED,iEAAiE;AACjE,oBAAY,mBAAmB;IAC7B,8EAA8E;IAC9E,UAAU,gBAAgB;IAC1B,wFAAwF;IACxF,SAAS,cAAc;CACxB"}
|
package/utils/content.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { UnsupportedCanvasContent } from '../models/attachment-canvas';
|
|
1
|
+
import { ErrorCanvasContent, UnsupportedCanvasContent } from '../models/attachment-canvas';
|
|
2
2
|
/** Returns true if the file name has an extension known to be text-previewable. */
|
|
3
3
|
export declare const isTextPreviewable: (name: string) => boolean;
|
|
4
4
|
/** Creates an unsupported-format content payload. */
|
|
5
5
|
export declare const createUnsupportedCanvasContent: (url?: string) => UnsupportedCanvasContent;
|
|
6
|
+
/** Creates a content payload for a file that failed to load (network error or non-403 failure). */
|
|
7
|
+
export declare const createLoadErrorCanvasContent: (url?: string) => ErrorCanvasContent;
|
|
8
|
+
/** Creates a content payload for a file the current user is not permitted to access (HTTP 403). */
|
|
9
|
+
export declare const createForbiddenCanvasContent: (url?: string) => ErrorCanvasContent;
|
|
6
10
|
//# sourceMappingURL=content.d.ts.map
|
package/utils/content.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/utils/content.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/utils/content.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,6BAA6B,CAAC;AAMrC,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,OAIhD,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,8BAA8B,GACzC,MAAM,MAAM,KACX,wBAGD,CAAC;AAEH,mGAAmG;AACnG,eAAO,MAAM,4BAA4B,GACvC,MAAM,MAAM,KACX,kBAID,CAAC;AAEH,mGAAmG;AACnG,eAAO,MAAM,4BAA4B,GACvC,MAAM,MAAM,KACX,kBAID,CAAC"}
|
package/utils/download.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/utils/download.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/utils/download.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAM3E,kEAAkE;AAClE,eAAO,MAAM,cAAc,GAAI,SAAS,uBAAuB,KAAG,OAgBjE,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,IAAI,CAIhE,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,GACpC,SAAS,uBAAuB,EAChC,WAAW,MAAM,KAChB,IAsCF,CAAC"}
|