@epam/ai-dial-attachment-canvas 1.1.0-dev.29 → 1.1.0-dev.293
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 +1 -0
- package/components/AttachmentCanvas/AttachmentCanvas.d.ts.map +1 -1
- package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts +4 -0
- package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts.map +1 -0
- package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
- package/components/CodeContent/CodeContent.d.ts +13 -0
- package/components/CodeContent/CodeContent.d.ts.map +1 -0
- package/components/HtmlContent/HtmlContent.d.ts +21 -0
- package/components/HtmlContent/HtmlContent.d.ts.map +1 -0
- package/components/McpAppCanvasRenderer/McpAppCanvasRenderer.d.ts +12 -0
- package/components/McpAppCanvasRenderer/McpAppCanvasRenderer.d.ts.map +1 -0
- package/components/OoxmlContent/OoxmlContent.d.ts +14 -0
- package/components/OoxmlContent/OoxmlContent.d.ts.map +1 -0
- package/components/PdfContent/PdfContent.d.ts +31 -0
- package/components/PdfContent/PdfContent.d.ts.map +1 -1
- package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts +25 -0
- package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts.map +1 -0
- package/constants/file.d.ts +8 -0
- package/constants/file.d.ts.map +1 -1
- package/context/AttachmentCanvasContext.d.ts +4 -2
- package/context/AttachmentCanvasContext.d.ts.map +1 -1
- package/docx-TK1kGI6t.js +27179 -0
- package/highlight-rect-BuX5rWP4-BMOCuZYw.js +1037 -0
- package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts +64 -0
- package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts.map +1 -0
- package/index.css +1 -1
- package/index.d.ts +9 -3
- package/index.d.ts.map +1 -1
- package/index.js +34883 -1754
- package/models/attachment-canvas.d.ts +170 -11
- package/models/attachment-canvas.d.ts.map +1 -1
- package/package.json +14 -7
- package/pptx-DfVqSUxc.js +7410 -0
- package/render-worker-host-Br7ZDyGE-ByESfBjH.js +7 -0
- package/render-worker-host-CM1JXVqg-DGwZpsUd.js +7 -0
- package/render-worker-host-DFtd9Z-J-DU7fugLI.js +7 -0
- package/renderer-module-contract-BNGz8HvO-BmSLiM0k.js +44363 -0
- package/types/attachment-canvas.d.ts +11 -0
- package/types/attachment-canvas.d.ts.map +1 -1
- package/utils/content.d.ts +9 -0
- package/utils/content.d.ts.map +1 -1
- package/utils/download.d.ts.map +1 -1
- package/utils/visualizer.d.ts +8 -0
- package/utils/visualizer.d.ts.map +1 -0
- package/visible-index-BjesVGhg-DvGeguMs.js +133 -0
- package/xlsx-44AZTEry.js +7800 -0
|
@@ -6,9 +6,20 @@ export declare enum AttachmentContentType {
|
|
|
6
6
|
Markdown = "markdown",
|
|
7
7
|
Json = "json",
|
|
8
8
|
Pdf = "pdf",
|
|
9
|
+
Ooxml = "ooxml",
|
|
10
|
+
Code = "code",
|
|
11
|
+
Html = "html",
|
|
12
|
+
Visualizer = "visualizer",
|
|
13
|
+
McpApp = "mcp_app",
|
|
9
14
|
Unsupported = "unsupported",
|
|
10
15
|
Error = "error"
|
|
11
16
|
}
|
|
17
|
+
/** Supported Office Open XML document formats. */
|
|
18
|
+
export declare enum OoxmlFileType {
|
|
19
|
+
Docx = "docx",
|
|
20
|
+
Xlsx = "xlsx",
|
|
21
|
+
Pptx = "pptx"
|
|
22
|
+
}
|
|
12
23
|
/** The kind of failure that produced an `ErrorCanvasContent`. */
|
|
13
24
|
export declare enum AttachmentErrorType {
|
|
14
25
|
/** The file failed to load (network error or a non-`403` non-OK response). */
|
|
@@ -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,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"}
|
|
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,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,MAAM,YAAY;IAClB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;CAChB;AAED,kDAAkD;AAClD,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;CACd;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,15 @@
|
|
|
1
1
|
import { ErrorCanvasContent, UnsupportedCanvasContent } from '../models/attachment-canvas';
|
|
2
|
+
import { OoxmlFileType } from '../types/attachment-canvas';
|
|
3
|
+
/** Resolves a supported OOXML format from a MIME type or file extension. */
|
|
4
|
+
export declare const getOoxmlFileType: (name: string, mimeType?: string) => OoxmlFileType | undefined;
|
|
5
|
+
/** Returns true when a file can be rendered by the built-in OOXML viewer. */
|
|
6
|
+
export declare const isOoxmlPreviewable: (name: string, mimeType?: string) => boolean;
|
|
2
7
|
/** Returns true if the file name has an extension known to be text-previewable. */
|
|
3
8
|
export declare const isTextPreviewable: (name: string) => boolean;
|
|
9
|
+
/** Returns true if the file name has an HTML extension (`html` or `htm`). */
|
|
10
|
+
export declare const isHtmlPreviewable: (name: string) => boolean;
|
|
11
|
+
/** Maps a lowercased file extension (without leading dot) to a `react-syntax-highlighter` language identifier. Returns `undefined` for unmapped extensions. */
|
|
12
|
+
export declare const extensionToLanguage: (ext: string) => string | undefined;
|
|
4
13
|
/** Creates an unsupported-format content payload. */
|
|
5
14
|
export declare const createUnsupportedCanvasContent: (url?: string) => UnsupportedCanvasContent;
|
|
6
15
|
/** Creates a content payload for a file that failed to load (network error or non-403 failure). */
|
package/utils/content.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/utils/content.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/utils/content.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAGL,aAAa,EACd,MAAM,4BAA4B,CAAC;AAcpC,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,GAC3B,MAAM,MAAM,EACZ,WAAW,MAAM,KAChB,aAAa,GAAG,SAUlB,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,EAAE,WAAW,MAAM,KAAG,OAC3B,CAAC;AAE3C,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,OAIhD,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,OAIhD,CAAC;AAoDF,+JAA+J;AAC/J,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,SAC/B,CAAC;AAE7B,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":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAM3E,kEAAkE;AAClE,eAAO,MAAM,cAAc,GAAI,SAAS,uBAAuB,KAAG,
|
|
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,OAwBjE,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,IAsDF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CustomVisualizer } from '@epam/ai-dial-chat-shared';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the first `CustomVisualizer` registry entry whose `contentType` list
|
|
4
|
+
* (comma-separated, case-insensitive) includes `mimeType`, or `undefined` if
|
|
5
|
+
* none match. First-match-wins when multiple entries cover the same MIME type.
|
|
6
|
+
*/
|
|
7
|
+
export declare const findVisualizerForMime: (mimeType: string, visualizers: CustomVisualizer[]) => CustomVisualizer | undefined;
|
|
8
|
+
//# sourceMappingURL=visualizer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visualizer.d.ts","sourceRoot":"","sources":["../../src/utils/visualizer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAChC,UAAU,MAAM,EAChB,aAAa,gBAAgB,EAAE,KAC9B,gBAAgB,GAAG,SASrB,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Tn as e, W as t, jt as n, zt as r } from "./renderer-module-contract-BNGz8HvO-BmSLiM0k.js";
|
|
2
|
+
//#region ../../node_modules/@silurus/ooxml/dist/resource-measurement-CgMubiAI.js
|
|
3
|
+
function i(e, t) {
|
|
4
|
+
return t ? `${e}|duo:${t.clr1}:${t.clr2}` : e;
|
|
5
|
+
}
|
|
6
|
+
var a = "duotone";
|
|
7
|
+
async function o(o, s, c, l, u = {}) {
|
|
8
|
+
let { offscreenFactory: d, ...f } = u, p = await n(o, s, l, f);
|
|
9
|
+
return !c || !p ? p : t(a, i(o, c), l, async () => {
|
|
10
|
+
let { w: t, h: n } = r(p);
|
|
11
|
+
if (t <= 0 || n <= 0) return {
|
|
12
|
+
bitmap: p,
|
|
13
|
+
owned: !1
|
|
14
|
+
};
|
|
15
|
+
let i = await e(p, c, {
|
|
16
|
+
width: t,
|
|
17
|
+
height: n,
|
|
18
|
+
offscreenFactory: d
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
bitmap: i,
|
|
22
|
+
owned: i !== p
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function s(e, t) {
|
|
27
|
+
if (!Number.isSafeInteger(e) || e < 0) throw Error(`${t} must be a non-negative safe integer`);
|
|
28
|
+
}
|
|
29
|
+
function c(e, t, n) {
|
|
30
|
+
return s(e, "resource measurement"), s(t, "resource measurement"), s(n, "resource measurement limit"), e > n || t > n || t > n - e ? n === 2 ** 53 - 1 ? n : n + 1 : e + t;
|
|
31
|
+
}
|
|
32
|
+
function l(e, t = 2 ** 53 - 1) {
|
|
33
|
+
s(t, "resource measurement limit");
|
|
34
|
+
let n = 0;
|
|
35
|
+
for (let r = 0; r < e.length; r += 1) {
|
|
36
|
+
let i = e.charCodeAt(r), a;
|
|
37
|
+
if (i <= 127) a = 1;
|
|
38
|
+
else if (i <= 2047) a = 2;
|
|
39
|
+
else if (i >= 55296 && i <= 56319 && r + 1 < e.length) {
|
|
40
|
+
let t = e.charCodeAt(r + 1);
|
|
41
|
+
t >= 56320 && t <= 57343 ? (a = 4, r += 1) : a = 3;
|
|
42
|
+
} else a = 3;
|
|
43
|
+
if (n = c(n, a, t), n > t) return n;
|
|
44
|
+
}
|
|
45
|
+
return n;
|
|
46
|
+
}
|
|
47
|
+
function u(e, t = 2 ** 53 - 1) {
|
|
48
|
+
s(t, "resource measurement limit");
|
|
49
|
+
let n = c(0, 2, t);
|
|
50
|
+
if (n > t) return n;
|
|
51
|
+
for (let r = 0; r < e.length; r += 1) {
|
|
52
|
+
let i = e.charCodeAt(r), a;
|
|
53
|
+
if (i === 34 || i === 92 || i === 8 || i === 9 || i === 10 || i === 12 || i === 13) a = 2;
|
|
54
|
+
else if (i <= 31) a = 6;
|
|
55
|
+
else if (i <= 127) a = 1;
|
|
56
|
+
else if (i <= 2047) a = 2;
|
|
57
|
+
else if (i >= 55296 && i <= 56319 && r + 1 < e.length) {
|
|
58
|
+
let t = e.charCodeAt(r + 1);
|
|
59
|
+
t >= 56320 && t <= 57343 ? (a = 4, r += 1) : a = 6;
|
|
60
|
+
} else a = i >= 55296 && i <= 57343 ? 6 : 3;
|
|
61
|
+
if (n = c(n, a, t), n > t) return n;
|
|
62
|
+
}
|
|
63
|
+
return n;
|
|
64
|
+
}
|
|
65
|
+
function d(e, t) {
|
|
66
|
+
return c(0, e, t);
|
|
67
|
+
}
|
|
68
|
+
function f(e, t = 2 ** 53 - 1, n = !1) {
|
|
69
|
+
if (s(t, "resource measurement limit"), e === null) return {
|
|
70
|
+
jsonBytes: d(4, t),
|
|
71
|
+
stringValueUtf8Bytes: 0
|
|
72
|
+
};
|
|
73
|
+
if (typeof e == "string") return {
|
|
74
|
+
jsonBytes: u(e, t),
|
|
75
|
+
stringValueUtf8Bytes: l(e, t)
|
|
76
|
+
};
|
|
77
|
+
if (typeof e == "boolean") return {
|
|
78
|
+
jsonBytes: d(e ? 4 : 5, t),
|
|
79
|
+
stringValueUtf8Bytes: 0
|
|
80
|
+
};
|
|
81
|
+
if (typeof e == "number") return {
|
|
82
|
+
jsonBytes: d((Number.isFinite(e) ? String(Object.is(e, -0) ? 0 : e) : "null").length, t),
|
|
83
|
+
stringValueUtf8Bytes: 0
|
|
84
|
+
};
|
|
85
|
+
if (typeof e == "bigint") throw TypeError("BigInt values cannot be serialized to JSON");
|
|
86
|
+
if (Array.isArray(e)) {
|
|
87
|
+
let n = d(2, t), r = 0;
|
|
88
|
+
for (let i = 0; i < e.length; i += 1) {
|
|
89
|
+
i !== 0 && (n = c(n, 1, t));
|
|
90
|
+
let a = f(e[i], t, !0);
|
|
91
|
+
n = c(n, a.jsonBytes, t), r = c(r, a.stringValueUtf8Bytes, t);
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
jsonBytes: n,
|
|
95
|
+
stringValueUtf8Bytes: r
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
if (typeof e == "object") {
|
|
99
|
+
let n = d(2, t), r = 0, i = 0;
|
|
100
|
+
for (let [a, o] of Object.entries(e)) {
|
|
101
|
+
if (o === void 0 || typeof o == "function" || typeof o == "symbol") continue;
|
|
102
|
+
i++ !== 0 && (n = c(n, 1, t)), n = c(n, u(a, t), t), n = c(n, 1, t);
|
|
103
|
+
let e = f(o, t);
|
|
104
|
+
n = c(n, e.jsonBytes, t), r = c(r, e.stringValueUtf8Bytes, t);
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
jsonBytes: n,
|
|
108
|
+
stringValueUtf8Bytes: r
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
jsonBytes: n ? d(4, t) : 0,
|
|
113
|
+
stringValueUtf8Bytes: 0
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region ../../node_modules/@silurus/ooxml/dist/visible-index-BjesVGhg.js
|
|
118
|
+
function p(e, t, n, r) {
|
|
119
|
+
for (let i = e + t; i >= 0 && i < r; i += t) if (!n(i)) return i;
|
|
120
|
+
return e;
|
|
121
|
+
}
|
|
122
|
+
function m(e, t, n) {
|
|
123
|
+
if (n === 0 || !t(e)) return e;
|
|
124
|
+
let r = p(e, 1, t, n);
|
|
125
|
+
return r === e ? p(e, -1, t, n) : r;
|
|
126
|
+
}
|
|
127
|
+
function h(e, t) {
|
|
128
|
+
let n = 0;
|
|
129
|
+
for (let r = 0; r < t; r++) e(r) || n++;
|
|
130
|
+
return n;
|
|
131
|
+
}
|
|
132
|
+
//#endregion
|
|
133
|
+
export { f as a, c as i, h as n, l as o, m as r, o as s, p as t };
|