@epam/ai-dial-attachment-canvas 1.2.0-dev.142 → 1.2.0-dev.148
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 +3 -1
- package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
- package/index.js +393 -391
- package/models/attachment-canvas.d.ts +3 -1
- package/models/attachment-canvas.d.ts.map +1 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -4,40 +4,40 @@ import { AttachmentType as c, CodeBlockTheme as l, DEFAULT_MARKDOWN_CLASS_NAMES
|
|
|
4
4
|
import { SidebarOrientation as y, SidebarPanel as b } from "@epam/ai-dial-sidebar";
|
|
5
5
|
import { DIAL_ICON_SIZE as x, DIAL_KIT_ICON_STROKE as S, ElementSize as C, GhostIconButton as w, LinkButton as T, Spinner as E } from "@epam/ai-dial-ui-kit";
|
|
6
6
|
import { IconAlertTriangle as D, IconArrowsMaximize as O, IconCheck as k, IconCode as ee, IconCopy as te, IconDownload as ne, IconEye as re, IconLock as ie, IconMarkdown as ae, IconRefresh as oe } from "@tabler/icons-react";
|
|
7
|
-
import { createContext as
|
|
8
|
-
import { JsonView as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { AppBridge as
|
|
11
|
-
import { McpUiHostContextChangedNotificationSchema as
|
|
12
|
-
import { VisualizerConnectorRequests as
|
|
13
|
-
import { VisualizerConnector as
|
|
7
|
+
import { createContext as se, lazy as A, memo as j, useCallback as M, useContext as N, useEffect as P, useMemo as F, useRef as I, useState as L } from "react";
|
|
8
|
+
import { JsonView as ce, defaultStyles as R } from "react-json-view-lite";
|
|
9
|
+
import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
10
|
+
import { AppBridge as H, AppFrame as U } from "@mcp-ui/client";
|
|
11
|
+
import { McpUiHostContextChangedNotificationSchema as le } from "@modelcontextprotocol/ext-apps/app-bridge";
|
|
12
|
+
import { VisualizerConnectorRequests as ue } from "@epam/ai-dial-shared";
|
|
13
|
+
import { VisualizerConnector as de } from "@epam/ai-dial-visualizer-connector";
|
|
14
14
|
//#region src/constants/public-class-names.ts
|
|
15
|
-
var
|
|
15
|
+
var fe = { panel: "dial-attachment-canvas-panel" }, pe = {
|
|
16
16
|
container: "_container_1nhig_1",
|
|
17
17
|
containerLight: "_containerLight_1nhig_5"
|
|
18
|
-
},
|
|
18
|
+
}, me = {
|
|
19
19
|
[l.Dark]: _,
|
|
20
20
|
[l.Light]: _
|
|
21
|
-
},
|
|
21
|
+
}, W = () => A(async () => {
|
|
22
22
|
let { Prism: e } = await import("react-syntax-highlighter");
|
|
23
23
|
return { default: e };
|
|
24
|
-
}),
|
|
25
|
-
let { text: r, language: i } = e, a = i == null || i === "plaintext", o =
|
|
24
|
+
}), he = j(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
|
|
25
|
+
let { text: r, language: i } = e, a = i == null || i === "plaintext", o = me[t], c = t === l.Light, [u, d] = L(0), f = F(W, [u]), p = M(() => {
|
|
26
26
|
d((e) => e + 1);
|
|
27
|
-
}, []), m = /* @__PURE__ */
|
|
27
|
+
}, []), m = /* @__PURE__ */ B("pre", {
|
|
28
28
|
className: "whitespace-pre-wrap break-words p-4",
|
|
29
29
|
children: r
|
|
30
30
|
});
|
|
31
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ B("div", {
|
|
32
32
|
dir: "ltr",
|
|
33
|
-
className: g("h-full overflow-auto",
|
|
34
|
-
children: a ? m : /* @__PURE__ */
|
|
33
|
+
className: g("h-full overflow-auto", pe.container, c && pe.containerLight),
|
|
34
|
+
children: a ? m : /* @__PURE__ */ B(s, {
|
|
35
35
|
retryKey: u,
|
|
36
36
|
onRetry: p,
|
|
37
37
|
pendingContent: m,
|
|
38
38
|
errorContent: m,
|
|
39
39
|
labels: n,
|
|
40
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ B(f, {
|
|
41
41
|
language: i,
|
|
42
42
|
style: o,
|
|
43
43
|
customStyle: {
|
|
@@ -54,21 +54,21 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
54
54
|
})
|
|
55
55
|
})
|
|
56
56
|
});
|
|
57
|
-
}),
|
|
57
|
+
}), ge = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, _e = j(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
|
|
58
58
|
let { htmlFrameBlockedLabel: s = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: c = "Open in new tab" } = t, [l, u] = L(!0), [d, f] = L(!1), p = I(null);
|
|
59
59
|
P(() => {
|
|
60
60
|
u(!0), f(!1);
|
|
61
61
|
}, [e]);
|
|
62
|
-
let m =
|
|
62
|
+
let m = M((t) => {
|
|
63
63
|
if (u(!1), e.srcdoc == null) try {
|
|
64
64
|
p.current?.contentDocument ?? f(!0);
|
|
65
65
|
} catch {
|
|
66
66
|
f(!0);
|
|
67
67
|
}
|
|
68
|
-
}, [e.srcdoc]), h =
|
|
68
|
+
}, [e.srcdoc]), h = M(() => {
|
|
69
69
|
u(!1), f(!0);
|
|
70
70
|
}, []);
|
|
71
|
-
if (n && e.srcdoc != null) return /* @__PURE__ */
|
|
71
|
+
if (n && e.srcdoc != null) return /* @__PURE__ */ B(he, {
|
|
72
72
|
content: {
|
|
73
73
|
type: i.Code,
|
|
74
74
|
text: e.srcdoc,
|
|
@@ -76,26 +76,26 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
76
76
|
},
|
|
77
77
|
codeBlockTheme: a
|
|
78
78
|
});
|
|
79
|
-
if (d) return /* @__PURE__ */
|
|
79
|
+
if (d) return /* @__PURE__ */ V("div", {
|
|
80
80
|
className: "flex h-full flex-col items-center justify-center gap-3 p-4",
|
|
81
|
-
children: [/* @__PURE__ */
|
|
81
|
+
children: [/* @__PURE__ */ B("p", {
|
|
82
82
|
className: "text-center",
|
|
83
83
|
children: s
|
|
84
|
-
}), e.url != null && /* @__PURE__ */
|
|
84
|
+
}), e.url != null && /* @__PURE__ */ B(T, {
|
|
85
85
|
href: e.url,
|
|
86
86
|
target: "_blank",
|
|
87
87
|
label: c,
|
|
88
|
-
className:
|
|
88
|
+
className: ge.openInNewTabButton,
|
|
89
89
|
textClassName: o
|
|
90
90
|
})]
|
|
91
91
|
});
|
|
92
92
|
let _ = e.srcdoc != null, v = _ ? void 0 : e.url, y = _ ? e.srcdoc : void 0;
|
|
93
|
-
return /* @__PURE__ */
|
|
93
|
+
return /* @__PURE__ */ V("div", {
|
|
94
94
|
className: "relative h-full",
|
|
95
|
-
children: [l && /* @__PURE__ */
|
|
95
|
+
children: [l && /* @__PURE__ */ B("div", {
|
|
96
96
|
className: "absolute inset-0 flex items-center justify-center",
|
|
97
|
-
children: /* @__PURE__ */
|
|
98
|
-
}), /* @__PURE__ */
|
|
97
|
+
children: /* @__PURE__ */ B(E, {})
|
|
98
|
+
}), /* @__PURE__ */ B("iframe", {
|
|
99
99
|
ref: p,
|
|
100
100
|
title: r,
|
|
101
101
|
src: v,
|
|
@@ -106,10 +106,10 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
106
106
|
onError: h
|
|
107
107
|
})]
|
|
108
108
|
});
|
|
109
|
-
}),
|
|
109
|
+
}), ve = {
|
|
110
110
|
name: "MCP-UI Host",
|
|
111
111
|
version: "1.0.0"
|
|
112
|
-
},
|
|
112
|
+
}, ye = { openLinks: {} }, be = (e) => {
|
|
113
113
|
let t;
|
|
114
114
|
try {
|
|
115
115
|
t = new URL(e);
|
|
@@ -123,14 +123,14 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
123
123
|
return !1;
|
|
124
124
|
}
|
|
125
125
|
return !0;
|
|
126
|
-
},
|
|
126
|
+
}, xe = (e, t, n) => {
|
|
127
127
|
if (n) {
|
|
128
128
|
e.style.maxWidth = "", e.style.maxHeight = "";
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
let r = t;
|
|
132
132
|
r != null && (r.width != null && (e.style.width = `${r.width}px`), r.maxWidth != null && (e.style.maxWidth = `${r.maxWidth}px`), r.height != null && (e.style.height = `${r.height}px`), r.maxHeight != null && (e.style.maxHeight = `${r.maxHeight}px`));
|
|
133
|
-
},
|
|
133
|
+
}, Se = (e, t, n) => {
|
|
134
134
|
let r = I(e);
|
|
135
135
|
P(() => {
|
|
136
136
|
r.current = e;
|
|
@@ -146,15 +146,15 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
146
146
|
height: Math.round(n.height)
|
|
147
147
|
}
|
|
148
148
|
} : r.current.hostContext;
|
|
149
|
-
e = new
|
|
149
|
+
e = new H(null, r.current.hostInfo ?? ve, ye, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
|
|
150
150
|
let t = r.current.onOpenLink;
|
|
151
|
-
return (t == null ?
|
|
151
|
+
return (t == null ? be(e) : t(e)) === !1 ? { isError: !0 } : {};
|
|
152
152
|
}, e.onrequestdisplaymode = async ({ mode: e }) => {
|
|
153
153
|
let t = r.current.onRequestDisplayMode, n = r.current.hostContext?.displayMode ?? "inline";
|
|
154
154
|
return { mode: t?.(e) ?? n };
|
|
155
|
-
}, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(
|
|
155
|
+
}, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(le, ({ params: e }) => {
|
|
156
156
|
let n = t.current?.querySelector("iframe");
|
|
157
|
-
n != null &&
|
|
157
|
+
n != null && xe(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
|
|
158
158
|
}), a(e);
|
|
159
159
|
} catch (e) {
|
|
160
160
|
console.error("[useMcpAppBridge] Error creating AppBridge:", e), s(!0);
|
|
@@ -168,14 +168,14 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
168
168
|
appBridge: i,
|
|
169
169
|
hasFailed: o
|
|
170
170
|
};
|
|
171
|
-
},
|
|
171
|
+
}, G = {
|
|
172
172
|
loadingOverlay: "_loadingOverlay_iea4a_2",
|
|
173
173
|
fullscreenFrame: "_fullscreenFrame_iea4a_21",
|
|
174
174
|
loadingFrame: "_loadingFrame_iea4a_29",
|
|
175
175
|
statusLabel: "_statusLabel_iea4a_33",
|
|
176
176
|
statusDetail: "_statusDetail_iea4a_38",
|
|
177
177
|
errorIcon: "_errorIcon_iea4a_42"
|
|
178
|
-
},
|
|
178
|
+
}, Ce = ({ content: e, errorLabel: t = "Failed to load app", onAppInfo: n }) => {
|
|
179
179
|
let [r, i] = L("loading"), [a, o] = L(), { html: s, sandboxUrl: c, toolInput: l, toolResult: u, hostContext: d } = e, f = F(() => ({ url: new URL(c) }), [c]), p = d?.displayMode === "fullscreen", m = I(null), [h, _] = L();
|
|
180
180
|
P(() => {
|
|
181
181
|
let e = m.current;
|
|
@@ -190,15 +190,15 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
190
190
|
});
|
|
191
191
|
return t.observe(e), () => t.disconnect();
|
|
192
192
|
}, []);
|
|
193
|
-
let { appBridge: v, hasFailed: y } =
|
|
193
|
+
let { appBridge: v, hasFailed: y } = Se(e, m, F(() => d == null || h == null ? d : {
|
|
194
194
|
...d,
|
|
195
195
|
containerDimensions: h
|
|
196
196
|
}, [d, h])), b = y || r === "error";
|
|
197
|
-
return /* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ V("div", {
|
|
198
198
|
ref: m,
|
|
199
|
-
className: g("relative h-full min-h-[200px] w-full", p &&
|
|
199
|
+
className: g("relative h-full min-h-[200px] w-full", p && G.fullscreenFrame, !p && r === "loading" && G.loadingFrame),
|
|
200
200
|
children: [
|
|
201
|
-
v != null && !b && /* @__PURE__ */
|
|
201
|
+
v != null && !b && /* @__PURE__ */ B(U, {
|
|
202
202
|
html: s,
|
|
203
203
|
sandbox: f,
|
|
204
204
|
appBridge: v,
|
|
@@ -212,29 +212,29 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
212
212
|
o(e.message), i("error");
|
|
213
213
|
}
|
|
214
214
|
}),
|
|
215
|
-
!b && r === "loading" && /* @__PURE__ */
|
|
216
|
-
className: g("absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
217
|
-
children: /* @__PURE__ */
|
|
215
|
+
!b && r === "loading" && /* @__PURE__ */ B("div", {
|
|
216
|
+
className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", G.loadingOverlay),
|
|
217
|
+
children: /* @__PURE__ */ B(E, {})
|
|
218
218
|
}),
|
|
219
|
-
b && /* @__PURE__ */
|
|
219
|
+
b && /* @__PURE__ */ V("div", {
|
|
220
220
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-2 p-4",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ B(D, {
|
|
222
222
|
size: 60,
|
|
223
223
|
stroke: S,
|
|
224
224
|
"aria-hidden": !0,
|
|
225
|
-
className:
|
|
226
|
-
}), /* @__PURE__ */
|
|
225
|
+
className: G.errorIcon
|
|
226
|
+
}), /* @__PURE__ */ V("p", {
|
|
227
227
|
role: "alert",
|
|
228
|
-
className: g("text-center",
|
|
229
|
-
children: [t, a && /* @__PURE__ */
|
|
230
|
-
className:
|
|
228
|
+
className: g("text-center", G.statusLabel),
|
|
229
|
+
children: [t, a && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("br", {}), /* @__PURE__ */ B("span", {
|
|
230
|
+
className: G.statusDetail,
|
|
231
231
|
children: a
|
|
232
232
|
})] })]
|
|
233
233
|
})]
|
|
234
234
|
})
|
|
235
235
|
]
|
|
236
236
|
});
|
|
237
|
-
},
|
|
237
|
+
}, K = {
|
|
238
238
|
viewer: "_viewer_1w97n_2",
|
|
239
239
|
spreadsheetCanvas: "_spreadsheetCanvas_1w97n_6",
|
|
240
240
|
formulaPanel: "_formulaPanel_1w97n_12",
|
|
@@ -242,13 +242,13 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
242
242
|
statusOverlay: "_statusOverlay_1w97n_24",
|
|
243
243
|
errorIcon: "_errorIcon_1w97n_29",
|
|
244
244
|
highlight: "_highlight_1w97n_37"
|
|
245
|
-
},
|
|
245
|
+
}, we = (e) => {
|
|
246
246
|
if (e?.kind !== "range") return "";
|
|
247
247
|
let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
|
|
248
248
|
if (n == null) return "";
|
|
249
249
|
let r = n.formula;
|
|
250
250
|
return r == null || r.trim().length === 0 ? n.displayText : r.startsWith("=") ? r : `=${r}`;
|
|
251
|
-
},
|
|
251
|
+
}, Te = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
|
|
252
252
|
switch (t) {
|
|
253
253
|
case r.Docx: {
|
|
254
254
|
let [{ DocxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/docx"), import("@silurus/ooxml/chart-ex")]);
|
|
@@ -270,7 +270,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
270
270
|
}
|
|
271
271
|
case r.Csv: {
|
|
272
272
|
let { XlsxSheetViewer: t } = await import("@silurus/ooxml/xlsx"), r = document.createElement("canvas");
|
|
273
|
-
r.className =
|
|
273
|
+
r.className = K.spreadsheetCanvas, e.replaceChildren(r);
|
|
274
274
|
let i = new t(r, {
|
|
275
275
|
showScrollbars: !0,
|
|
276
276
|
onError: n
|
|
@@ -294,7 +294,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
|
-
},
|
|
297
|
+
}, Ee = async (e, t, n, i) => {
|
|
298
298
|
let { onError: a, onXlsxSelectionContextChange: o, onGeometryInvalidated: s } = n;
|
|
299
299
|
switch (t.format) {
|
|
300
300
|
case r.Docx: {
|
|
@@ -303,7 +303,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
303
303
|
import("@silurus/ooxml/chart-ex"),
|
|
304
304
|
import("./ooxml-highlight-surfaces-BzgOKpBV.js")
|
|
305
305
|
]), l = await n.load(t.url, { chartEx: o });
|
|
306
|
-
if (i()) throw l.destroy(), new
|
|
306
|
+
if (i()) throw l.destroy(), new De();
|
|
307
307
|
let u = r.fromDocument(e, l, {
|
|
308
308
|
enableTextSelection: !0,
|
|
309
309
|
refitOnResize: !0,
|
|
@@ -323,7 +323,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
323
323
|
import("@silurus/ooxml/chart-ex"),
|
|
324
324
|
import("./ooxml-highlight-surfaces-BzgOKpBV.js")
|
|
325
325
|
]), l = await n.load(t.url, { chartEx: o });
|
|
326
|
-
if (i()) throw l.destroy(), new
|
|
326
|
+
if (i()) throw l.destroy(), new De();
|
|
327
327
|
let u = r.fromPresentation(e, l, {
|
|
328
328
|
enableTextSelection: !0,
|
|
329
329
|
refitOnResize: !0,
|
|
@@ -357,11 +357,11 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
357
357
|
};
|
|
358
358
|
}
|
|
359
359
|
case r.Csv: {
|
|
360
|
-
let r = await
|
|
360
|
+
let r = await Te(e, t.format, n);
|
|
361
361
|
return await r.load(t.url), { viewer: r };
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
},
|
|
364
|
+
}, De = class extends Error {}, Oe = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, highlightsLabel: s = "Cited locations", highlightNavigatedLabel: c = "Scrolled to the cited location" }) => {
|
|
365
365
|
let l = I(null), [u, d] = L(!0), [f, p] = L(!1), [m, h] = L(""), [_, v] = L([]), [y, b] = L(!1), { highlights: x, selectedHighlightId: C } = t, w = x != null && x.length > 0, T = I(void 0), O = I(x);
|
|
366
366
|
O.current = x;
|
|
367
367
|
let k = I(void 0);
|
|
@@ -387,7 +387,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
387
387
|
i || (d(!1), p(!0));
|
|
388
388
|
},
|
|
389
389
|
onXlsxSelectionContextChange: (e) => {
|
|
390
|
-
i || h(
|
|
390
|
+
i || h(we(e));
|
|
391
391
|
},
|
|
392
392
|
onGeometryInvalidated: s
|
|
393
393
|
}, f = () => {
|
|
@@ -398,14 +398,14 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
398
398
|
return e.addEventListener("scroll", s, !0), k.current = s, (async () => {
|
|
399
399
|
try {
|
|
400
400
|
if (w) {
|
|
401
|
-
let r = await
|
|
401
|
+
let r = await Ee(e, t, u, o);
|
|
402
402
|
if (i) {
|
|
403
403
|
r.viewer.destroy(), r.engine?.destroy();
|
|
404
404
|
return;
|
|
405
405
|
}
|
|
406
406
|
n = r, T.current = r.highlights, f();
|
|
407
407
|
} else {
|
|
408
|
-
let r = await
|
|
408
|
+
let r = await Te(e, t.format, u);
|
|
409
409
|
if (i) {
|
|
410
410
|
r.destroy();
|
|
411
411
|
return;
|
|
@@ -416,7 +416,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
416
416
|
if (i) return;
|
|
417
417
|
d(!1), await c();
|
|
418
418
|
} catch (t) {
|
|
419
|
-
if (t instanceof
|
|
419
|
+
if (t instanceof De || i) return;
|
|
420
420
|
n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, T.current = void 0, e.replaceChildren(), d(!1), p(!0);
|
|
421
421
|
}
|
|
422
422
|
})(), () => {
|
|
@@ -446,38 +446,38 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
446
446
|
})(), () => {
|
|
447
447
|
r = !0;
|
|
448
448
|
};
|
|
449
|
-
}, [C, u]), /* @__PURE__ */
|
|
449
|
+
}, [C, u]), /* @__PURE__ */ V("div", {
|
|
450
450
|
className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
|
|
451
451
|
children: [
|
|
452
|
-
t.format === r.Xlsx && /* @__PURE__ */
|
|
452
|
+
t.format === r.Xlsx && /* @__PURE__ */ V("div", {
|
|
453
453
|
role: "region",
|
|
454
454
|
"aria-label": a,
|
|
455
|
-
className: g("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2",
|
|
456
|
-
children: [/* @__PURE__ */
|
|
455
|
+
className: g("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", K.formulaPanel),
|
|
456
|
+
children: [/* @__PURE__ */ B("span", {
|
|
457
457
|
"aria-hidden": "true",
|
|
458
458
|
className: g("shrink-0", o),
|
|
459
459
|
children: "fx"
|
|
460
|
-
}), /* @__PURE__ */
|
|
460
|
+
}), /* @__PURE__ */ B("code", {
|
|
461
461
|
dir: "ltr",
|
|
462
462
|
tabIndex: 0,
|
|
463
463
|
"aria-live": "polite",
|
|
464
|
-
className: g("h-8 min-w-0 flex-1 overflow-x-auto whitespace-nowrap rounded border px-2 py-1 text-sm focus-visible:outline focus-visible:outline-focus",
|
|
464
|
+
className: g("h-8 min-w-0 flex-1 overflow-x-auto whitespace-nowrap rounded border px-2 py-1 text-sm focus-visible:outline focus-visible:outline-focus", K.formulaValue),
|
|
465
465
|
children: m
|
|
466
466
|
})]
|
|
467
467
|
}),
|
|
468
|
-
/* @__PURE__ */
|
|
468
|
+
/* @__PURE__ */ V("div", {
|
|
469
469
|
className: "relative min-h-0 w-full flex-1",
|
|
470
|
-
children: [/* @__PURE__ */
|
|
470
|
+
children: [/* @__PURE__ */ B("div", {
|
|
471
471
|
ref: l,
|
|
472
472
|
role: "document",
|
|
473
473
|
"aria-label": n,
|
|
474
474
|
"aria-busy": u,
|
|
475
|
-
className: g("h-full w-full overflow-hidden",
|
|
476
|
-
}), _.length > 0 && /* @__PURE__ */
|
|
475
|
+
className: g("h-full w-full overflow-hidden", K.viewer)
|
|
476
|
+
}), _.length > 0 && /* @__PURE__ */ B("div", {
|
|
477
477
|
role: "region",
|
|
478
478
|
"aria-label": s,
|
|
479
479
|
className: "pointer-events-none absolute inset-0 overflow-hidden",
|
|
480
|
-
children: _.map((e, t) => /* @__PURE__ */
|
|
480
|
+
children: _.map((e, t) => /* @__PURE__ */ B("div", {
|
|
481
481
|
"aria-hidden": "true",
|
|
482
482
|
style: {
|
|
483
483
|
left: `${e.left}px`,
|
|
@@ -487,28 +487,28 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
487
487
|
},
|
|
488
488
|
"data-selected": e.highlightId === C,
|
|
489
489
|
"data-clipped": e.isClippedAtEnd === !0,
|
|
490
|
-
className: g("absolute",
|
|
490
|
+
className: g("absolute", K.highlight)
|
|
491
491
|
}, `${e.highlightId}-${t}`))
|
|
492
492
|
})]
|
|
493
493
|
}),
|
|
494
|
-
/* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ B("div", {
|
|
495
495
|
role: "status",
|
|
496
496
|
"aria-live": "polite",
|
|
497
497
|
className: "sr-only",
|
|
498
498
|
children: y ? c : ""
|
|
499
499
|
}),
|
|
500
|
-
(u || f) && /* @__PURE__ */
|
|
500
|
+
(u || f) && /* @__PURE__ */ B("div", {
|
|
501
501
|
role: f ? "alert" : void 0,
|
|
502
502
|
"aria-live": "polite",
|
|
503
|
-
className: g("absolute inset-0 flex items-center justify-center",
|
|
504
|
-
children: u ? /* @__PURE__ */
|
|
503
|
+
className: g("absolute inset-0 flex items-center justify-center", K.statusOverlay),
|
|
504
|
+
children: u ? /* @__PURE__ */ B(E, { size: 48 }) : /* @__PURE__ */ V("div", {
|
|
505
505
|
className: "flex flex-col items-center gap-2",
|
|
506
|
-
children: [/* @__PURE__ */
|
|
506
|
+
children: [/* @__PURE__ */ B(D, {
|
|
507
507
|
"aria-hidden": "true",
|
|
508
508
|
size: 60,
|
|
509
509
|
stroke: S,
|
|
510
|
-
className:
|
|
511
|
-
}), /* @__PURE__ */
|
|
510
|
+
className: K.errorIcon
|
|
511
|
+
}), /* @__PURE__ */ B("p", {
|
|
512
512
|
className: "text-center",
|
|
513
513
|
children: i
|
|
514
514
|
})]
|
|
@@ -516,17 +516,17 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
516
516
|
})
|
|
517
517
|
]
|
|
518
518
|
});
|
|
519
|
-
},
|
|
519
|
+
}, ke = {
|
|
520
520
|
loadingOverlay: "_loadingOverlay_12637_1",
|
|
521
521
|
statusLabel: "_statusLabel_12637_5",
|
|
522
522
|
errorIcon: "_errorIcon_12637_9"
|
|
523
|
-
},
|
|
523
|
+
}, Ae = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a }) => {
|
|
524
524
|
let o = I(null), [s, c] = L("loading"), { url: l, visualizerName: u, requestTimeout: d } = e, f = I(e);
|
|
525
525
|
return f.current = e, P(() => {
|
|
526
526
|
let e = o.current;
|
|
527
527
|
if (!e) return;
|
|
528
528
|
c("loading");
|
|
529
|
-
let t = new
|
|
529
|
+
let t = new de(e, {
|
|
530
530
|
domain: l,
|
|
531
531
|
hostDomain: window.location.origin,
|
|
532
532
|
visualizerName: u,
|
|
@@ -535,7 +535,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
535
535
|
return (async () => {
|
|
536
536
|
if (await t.ready(), !n) return;
|
|
537
537
|
let e = f.current;
|
|
538
|
-
if (e.type === i.GroupedVisualizer) await t.send(
|
|
538
|
+
if (e.type === i.GroupedVisualizer) await t.send(ue.sendGroupedVisualizeData, {
|
|
539
539
|
attachments: e.attachments,
|
|
540
540
|
layout: e.layout
|
|
541
541
|
});
|
|
@@ -544,7 +544,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
544
544
|
layout: r,
|
|
545
545
|
...typeof i == "object" && i ? i : {}
|
|
546
546
|
};
|
|
547
|
-
await t.send(
|
|
547
|
+
await t.send(ue.sendVisualizeData, {
|
|
548
548
|
mimeType: n,
|
|
549
549
|
visualizerData: a
|
|
550
550
|
});
|
|
@@ -567,7 +567,7 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
567
567
|
u,
|
|
568
568
|
l,
|
|
569
569
|
d
|
|
570
|
-
]), /* @__PURE__ */
|
|
570
|
+
]), /* @__PURE__ */ V("div", {
|
|
571
571
|
className: "relative h-full w-full",
|
|
572
572
|
style: m({
|
|
573
573
|
"--vs-loading-bg": a?.loadingBackground,
|
|
@@ -575,33 +575,33 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
575
575
|
"--vs-error-icon": a?.errorIcon
|
|
576
576
|
}),
|
|
577
577
|
children: [
|
|
578
|
-
/* @__PURE__ */
|
|
578
|
+
/* @__PURE__ */ B("div", {
|
|
579
579
|
ref: o,
|
|
580
580
|
className: "h-full w-full"
|
|
581
581
|
}),
|
|
582
|
-
s === "loading" && /* @__PURE__ */
|
|
583
|
-
className: g("absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
584
|
-
children: [/* @__PURE__ */
|
|
585
|
-
className: g("text-center",
|
|
582
|
+
s === "loading" && /* @__PURE__ */ V("div", {
|
|
583
|
+
className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", ke.loadingOverlay),
|
|
584
|
+
children: [/* @__PURE__ */ B(E, {}), t && /* @__PURE__ */ B("p", {
|
|
585
|
+
className: g("text-center", ke.statusLabel),
|
|
586
586
|
children: t
|
|
587
587
|
})]
|
|
588
588
|
}),
|
|
589
|
-
s === "error" && /* @__PURE__ */
|
|
589
|
+
s === "error" && /* @__PURE__ */ V("div", {
|
|
590
590
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
591
|
-
children: [/* @__PURE__ */
|
|
591
|
+
children: [/* @__PURE__ */ B(D, {
|
|
592
592
|
size: 60,
|
|
593
593
|
stroke: S,
|
|
594
594
|
"aria-hidden": !0,
|
|
595
|
-
className:
|
|
596
|
-
}), /* @__PURE__ */
|
|
595
|
+
className: ke.errorIcon
|
|
596
|
+
}), /* @__PURE__ */ B("p", {
|
|
597
597
|
role: "alert",
|
|
598
|
-
className: g("text-center",
|
|
598
|
+
className: g("text-center", ke.statusLabel),
|
|
599
599
|
children: n
|
|
600
600
|
})]
|
|
601
601
|
})
|
|
602
602
|
]
|
|
603
603
|
});
|
|
604
|
-
},
|
|
604
|
+
}, q = {
|
|
605
605
|
body: "_body_13ogb_4",
|
|
606
606
|
statusLabel: "_statusLabel_13ogb_13",
|
|
607
607
|
errorIcon: "_errorIcon_13ogb_17",
|
|
@@ -616,66 +616,66 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
616
616
|
jsonExpandIcon: "_jsonExpandIcon_13ogb_54",
|
|
617
617
|
jsonCollapseIcon: "_jsonCollapseIcon_13ogb_67",
|
|
618
618
|
jsonCollapsedContent: "_jsonCollapsedContent_13ogb_84"
|
|
619
|
-
},
|
|
619
|
+
}, je = () => A(async () => ({ default: (await import("./PdfContent-BoAtghsO.js")).PdfContent })), Me = ({ url: e, fileName: t, loadErrorLabel: n }) => {
|
|
620
620
|
let [r, i] = L(!1);
|
|
621
621
|
return P(() => {
|
|
622
622
|
i(!1);
|
|
623
|
-
}, [e]), r ? /* @__PURE__ */
|
|
623
|
+
}, [e]), r ? /* @__PURE__ */ V("div", {
|
|
624
624
|
className: "flex flex-col items-center gap-2",
|
|
625
|
-
children: [/* @__PURE__ */
|
|
625
|
+
children: [/* @__PURE__ */ B(D, {
|
|
626
626
|
size: 60,
|
|
627
627
|
stroke: S,
|
|
628
|
-
className:
|
|
629
|
-
}), /* @__PURE__ */
|
|
630
|
-
className: g("text-center",
|
|
628
|
+
className: q.errorIcon
|
|
629
|
+
}), /* @__PURE__ */ B("p", {
|
|
630
|
+
className: g("text-center", q.statusLabel),
|
|
631
631
|
children: n
|
|
632
632
|
})]
|
|
633
|
-
}) : /* @__PURE__ */
|
|
633
|
+
}) : /* @__PURE__ */ B("img", {
|
|
634
634
|
src: e,
|
|
635
635
|
alt: t ?? "",
|
|
636
636
|
className: "max-h-full max-w-full object-contain",
|
|
637
637
|
onError: () => i(!0)
|
|
638
638
|
});
|
|
639
|
-
},
|
|
639
|
+
}, Ne = new Set([
|
|
640
640
|
i.PlainText,
|
|
641
641
|
i.Code,
|
|
642
642
|
i.Ooxml
|
|
643
|
-
]),
|
|
644
|
-
let { colors:
|
|
645
|
-
|
|
646
|
-
}, []),
|
|
643
|
+
]), Pe = j(({ content: e, isLoading: t = !1, fileName: r, isHtmlSourceView: a = !1, labels: { unsupportedLabel: o = "Preview is not supported for this file", loadErrorLabel: c = "Failed to load file", forbiddenErrorLabel: l = "You don't have permission to access this file", visualizerErrorLabel: d, htmlFrameBlockedLabel: f = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: h = "Open in new tab", pdfThumbnailsLabel: _, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: C, pdfContentRetryLabel: w, xlsxFormulaLabel: T = "Formula", codeContentLoadingLabel: O, codeContentErrorLabel: k, codeContentRetryLabel: ee, tableCopyLabel: te, tableCopiedLabel: ne, tableDownloadCsvLabel: re, ooxmlHighlightsLabel: ae, ooxmlHighlightNavigatedLabel: oe } = {}, styles: se, codeBlockTheme: A, tableDownloadFilename: j, loadPdf: N, hidePdfToolbar: P = !1, configurePdfWorker: I, onAppInfo: z }) => {
|
|
644
|
+
let { colors: H, typography: U, bodyClassName: le, cssVars: ue } = se ?? {}, [de, fe] = L(0), pe = F(je, [de]), me = M(() => {
|
|
645
|
+
fe((e) => e + 1);
|
|
646
|
+
}, []), W = U?.fontClassName != null, ge = F(() => ({
|
|
647
647
|
...m({
|
|
648
|
-
"--ac-text":
|
|
649
|
-
"--ac-status-text":
|
|
650
|
-
"--ac-error-icon":
|
|
651
|
-
"--ac-open-in-new-tab-text":
|
|
652
|
-
"--ac-json-border":
|
|
653
|
-
"--ac-json-bg":
|
|
654
|
-
"--ac-json-label":
|
|
655
|
-
"--ac-json-clickable-label":
|
|
656
|
-
"--ac-json-punctuation":
|
|
657
|
-
"--ac-json-string":
|
|
658
|
-
"--ac-json-number":
|
|
659
|
-
"--ac-json-boolean":
|
|
660
|
-
"--ac-json-null":
|
|
661
|
-
"--ac-json-toggle-icon":
|
|
662
|
-
"--ac-json-toggle-icon-hover":
|
|
663
|
-
"--ac-ooxml-bg":
|
|
664
|
-
"--ac-ooxml-formula-border":
|
|
665
|
-
"--ac-ooxml-formula-bg":
|
|
666
|
-
"--ac-ooxml-formula-text":
|
|
667
|
-
"--ac-ooxml-highlight-border":
|
|
668
|
-
"--ac-ooxml-highlight-bg":
|
|
669
|
-
"--ac-json-collapsed-text":
|
|
670
|
-
"--ac-json-collapsed-bg":
|
|
671
|
-
"--ac-font-family":
|
|
672
|
-
"--ac-font-size":
|
|
673
|
-
"--ac-font-weight":
|
|
674
|
-
"--ac-line-height":
|
|
675
|
-
"--ac-letter-spacing":
|
|
648
|
+
"--ac-text": H?.text,
|
|
649
|
+
"--ac-status-text": H?.statusText,
|
|
650
|
+
"--ac-error-icon": H?.errorIcon,
|
|
651
|
+
"--ac-open-in-new-tab-text": H?.openInNewTabText,
|
|
652
|
+
"--ac-json-border": H?.jsonBorder,
|
|
653
|
+
"--ac-json-bg": H?.jsonBackground,
|
|
654
|
+
"--ac-json-label": H?.jsonLabel,
|
|
655
|
+
"--ac-json-clickable-label": H?.jsonClickableLabel,
|
|
656
|
+
"--ac-json-punctuation": H?.jsonPunctuation,
|
|
657
|
+
"--ac-json-string": H?.jsonString,
|
|
658
|
+
"--ac-json-number": H?.jsonNumber,
|
|
659
|
+
"--ac-json-boolean": H?.jsonBoolean,
|
|
660
|
+
"--ac-json-null": H?.jsonNull,
|
|
661
|
+
"--ac-json-toggle-icon": H?.jsonToggleIcon,
|
|
662
|
+
"--ac-json-toggle-icon-hover": H?.jsonToggleIconHover,
|
|
663
|
+
"--ac-ooxml-bg": H?.ooxmlBackground,
|
|
664
|
+
"--ac-ooxml-formula-border": H?.ooxmlFormulaBorder,
|
|
665
|
+
"--ac-ooxml-formula-bg": H?.ooxmlFormulaBackground,
|
|
666
|
+
"--ac-ooxml-formula-text": H?.ooxmlFormulaText,
|
|
667
|
+
"--ac-ooxml-highlight-border": H?.ooxmlHighlightBorder,
|
|
668
|
+
"--ac-ooxml-highlight-bg": H?.ooxmlHighlightBackground,
|
|
669
|
+
"--ac-json-collapsed-text": H?.jsonCollapsedText,
|
|
670
|
+
"--ac-json-collapsed-bg": H?.jsonCollapsedBackground,
|
|
671
|
+
"--ac-font-family": W ? void 0 : U?.fontFamily,
|
|
672
|
+
"--ac-font-size": W ? void 0 : U?.fontSize,
|
|
673
|
+
"--ac-font-weight": W ? void 0 : U?.fontWeight,
|
|
674
|
+
"--ac-line-height": W ? void 0 : U?.lineHeight,
|
|
675
|
+
"--ac-letter-spacing": W ? void 0 : U?.letterSpacing
|
|
676
676
|
}),
|
|
677
|
-
...
|
|
678
|
-
}), [
|
|
677
|
+
...ue
|
|
678
|
+
}), [se]), ve = F(() => {
|
|
679
679
|
switch (e.type) {
|
|
680
680
|
case i.Image:
|
|
681
681
|
case i.Audio:
|
|
@@ -693,38 +693,38 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
693
693
|
case i.MarkdownTable: return "flex h-full min-h-0 flex-col overflow-hidden p-4";
|
|
694
694
|
default: return "h-full overflow-auto p-4";
|
|
695
695
|
}
|
|
696
|
-
}, [e.type]),
|
|
696
|
+
}, [e.type]), ye = F(() => {
|
|
697
697
|
switch (e.type) {
|
|
698
|
-
case i.PlainText: return /* @__PURE__ */
|
|
699
|
-
className: g("whitespace-pre-wrap break-words",
|
|
698
|
+
case i.PlainText: return /* @__PURE__ */ B("pre", {
|
|
699
|
+
className: g("whitespace-pre-wrap break-words", q.body, U?.fontClassName),
|
|
700
700
|
children: e.text
|
|
701
701
|
});
|
|
702
|
-
case i.Image: return /* @__PURE__ */
|
|
702
|
+
case i.Image: return /* @__PURE__ */ B(Me, {
|
|
703
703
|
url: e.url,
|
|
704
704
|
fileName: r,
|
|
705
705
|
loadErrorLabel: c
|
|
706
706
|
});
|
|
707
|
-
case i.Audio: return /* @__PURE__ */
|
|
707
|
+
case i.Audio: return /* @__PURE__ */ B("audio", {
|
|
708
708
|
controls: !0,
|
|
709
709
|
src: e.url,
|
|
710
710
|
"aria-label": r ?? "Audio attachment",
|
|
711
711
|
className: "w-full max-w-sm",
|
|
712
712
|
preload: "metadata",
|
|
713
|
-
children: e.mimeType && /* @__PURE__ */
|
|
713
|
+
children: e.mimeType && /* @__PURE__ */ B("source", {
|
|
714
714
|
src: e.url,
|
|
715
715
|
type: e.mimeType
|
|
716
716
|
})
|
|
717
717
|
});
|
|
718
|
-
case i.Markdown: return /* @__PURE__ */
|
|
718
|
+
case i.Markdown: return /* @__PURE__ */ B(p, {
|
|
719
719
|
content: e.text,
|
|
720
720
|
isStreaming: !1,
|
|
721
|
-
codeBlockTheme:
|
|
721
|
+
codeBlockTheme: A,
|
|
722
722
|
classNames: u
|
|
723
723
|
});
|
|
724
|
-
case i.MarkdownTable: return /* @__PURE__ */
|
|
724
|
+
case i.MarkdownTable: return /* @__PURE__ */ B(p, {
|
|
725
725
|
content: e.text,
|
|
726
726
|
isStreaming: !1,
|
|
727
|
-
codeBlockTheme:
|
|
727
|
+
codeBlockTheme: A,
|
|
728
728
|
containerClassName: "flex h-full min-h-0 flex-col",
|
|
729
729
|
classNames: {
|
|
730
730
|
...u,
|
|
@@ -736,45 +736,45 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
736
736
|
copiedLabel: ne,
|
|
737
737
|
downloadCsvLabel: re
|
|
738
738
|
},
|
|
739
|
-
tableDownloadFilename:
|
|
739
|
+
tableDownloadFilename: j
|
|
740
740
|
});
|
|
741
|
-
case i.Json: return /* @__PURE__ */
|
|
741
|
+
case i.Json: return /* @__PURE__ */ B("div", {
|
|
742
742
|
dir: "ltr",
|
|
743
743
|
className: "h-full overflow-auto",
|
|
744
|
-
children: /* @__PURE__ */
|
|
745
|
-
className: g("m-3 overflow-auto rounded-md border",
|
|
746
|
-
children: /* @__PURE__ */
|
|
744
|
+
children: /* @__PURE__ */ B("div", {
|
|
745
|
+
className: g("m-3 overflow-auto rounded-md border", q.jsonWrapper),
|
|
746
|
+
children: /* @__PURE__ */ B(ce, {
|
|
747
747
|
data: e.value,
|
|
748
748
|
style: {
|
|
749
|
-
container: g("whitespace-pre-wrap break-words p-2",
|
|
750
|
-
basicChildStyle:
|
|
749
|
+
container: g("whitespace-pre-wrap break-words p-2", U?.jsonClassName ?? "dial-code-text"),
|
|
750
|
+
basicChildStyle: R.basicChildStyle,
|
|
751
751
|
childFieldsContainer: "m-0 ps-3",
|
|
752
|
-
label: g("me-1 font-semibold",
|
|
753
|
-
clickableLabel: g("me-1 cursor-pointer font-semibold hover:underline",
|
|
754
|
-
nullValue: g("italic",
|
|
755
|
-
undefinedValue: g("italic",
|
|
756
|
-
stringValue:
|
|
757
|
-
booleanValue:
|
|
758
|
-
numberValue:
|
|
759
|
-
otherValue: g("italic",
|
|
760
|
-
punctuation: g("me-1",
|
|
761
|
-
collapseIcon: g("me-1 cursor-pointer select-none transition-colors",
|
|
762
|
-
expandIcon: g("me-1 cursor-pointer select-none transition-colors",
|
|
763
|
-
collapsedContent: g("me-1 cursor-pointer rounded px-1",
|
|
752
|
+
label: g("me-1 font-semibold", q.jsonLabel),
|
|
753
|
+
clickableLabel: g("me-1 cursor-pointer font-semibold hover:underline", q.jsonClickableLabel),
|
|
754
|
+
nullValue: g("italic", q.jsonNullValue),
|
|
755
|
+
undefinedValue: g("italic", q.jsonNullValue),
|
|
756
|
+
stringValue: q.jsonStringValue,
|
|
757
|
+
booleanValue: q.jsonBooleanValue,
|
|
758
|
+
numberValue: q.jsonNumberValue,
|
|
759
|
+
otherValue: g("italic", q.jsonNullValue),
|
|
760
|
+
punctuation: g("me-1", q.jsonPunctuation),
|
|
761
|
+
collapseIcon: g("me-1 cursor-pointer select-none transition-colors", q.jsonCollapseIcon),
|
|
762
|
+
expandIcon: g("me-1 cursor-pointer select-none transition-colors", q.jsonExpandIcon),
|
|
763
|
+
collapsedContent: g("me-1 cursor-pointer rounded px-1", q.jsonCollapsedContent)
|
|
764
764
|
}
|
|
765
765
|
})
|
|
766
766
|
})
|
|
767
767
|
});
|
|
768
|
-
case i.Code: return /* @__PURE__ */
|
|
768
|
+
case i.Code: return /* @__PURE__ */ B(he, {
|
|
769
769
|
content: e,
|
|
770
|
-
codeBlockTheme:
|
|
770
|
+
codeBlockTheme: A,
|
|
771
771
|
labels: {
|
|
772
772
|
loadingLabel: O,
|
|
773
773
|
errorLabel: k,
|
|
774
774
|
retryLabel: ee
|
|
775
775
|
}
|
|
776
776
|
});
|
|
777
|
-
case i.Html: return /* @__PURE__ */
|
|
777
|
+
case i.Html: return /* @__PURE__ */ B(_e, {
|
|
778
778
|
content: e,
|
|
779
779
|
labels: {
|
|
780
780
|
htmlFrameBlockedLabel: f,
|
|
@@ -782,23 +782,23 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
782
782
|
},
|
|
783
783
|
isSourceView: a,
|
|
784
784
|
title: r,
|
|
785
|
-
codeBlockTheme:
|
|
785
|
+
codeBlockTheme: A
|
|
786
786
|
});
|
|
787
|
-
case i.Pdf: return /* @__PURE__ */
|
|
788
|
-
retryKey:
|
|
789
|
-
onRetry:
|
|
787
|
+
case i.Pdf: return /* @__PURE__ */ B(s, {
|
|
788
|
+
retryKey: de,
|
|
789
|
+
onRetry: me,
|
|
790
790
|
labels: {
|
|
791
791
|
loadingLabel: x,
|
|
792
792
|
errorLabel: C,
|
|
793
793
|
retryLabel: w
|
|
794
794
|
},
|
|
795
|
-
children: /* @__PURE__ */
|
|
795
|
+
children: /* @__PURE__ */ B(pe, {
|
|
796
796
|
fileName: r,
|
|
797
797
|
url: e.url,
|
|
798
798
|
highlights: e.highlights ?? [],
|
|
799
799
|
selectedHighlightId: e.selectedHighlightId,
|
|
800
800
|
selectedPageNumber: e.page,
|
|
801
|
-
loadPdf:
|
|
801
|
+
loadPdf: N,
|
|
802
802
|
hideHeader: P,
|
|
803
803
|
configurePdfWorker: I,
|
|
804
804
|
labels: {
|
|
@@ -812,38 +812,38 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
812
812
|
}
|
|
813
813
|
})
|
|
814
814
|
}, e.url);
|
|
815
|
-
case i.Ooxml: return /* @__PURE__ */
|
|
815
|
+
case i.Ooxml: return /* @__PURE__ */ B(Oe, {
|
|
816
816
|
content: e,
|
|
817
817
|
fileName: r,
|
|
818
818
|
loadErrorLabel: c,
|
|
819
819
|
formulaLabel: T,
|
|
820
|
-
formulaLabelClassName:
|
|
820
|
+
formulaLabelClassName: U?.xlsxFormulaLabelClassName ?? "dial-italic-text",
|
|
821
821
|
highlightsLabel: ae,
|
|
822
822
|
highlightNavigatedLabel: oe
|
|
823
823
|
});
|
|
824
824
|
case i.Visualizer:
|
|
825
|
-
case i.GroupedVisualizer: return /* @__PURE__ */
|
|
825
|
+
case i.GroupedVisualizer: return /* @__PURE__ */ B(Ae, {
|
|
826
826
|
content: e,
|
|
827
827
|
errorLabel: d
|
|
828
828
|
});
|
|
829
|
-
case i.McpApp: return /* @__PURE__ */
|
|
829
|
+
case i.McpApp: return /* @__PURE__ */ B(Ce, {
|
|
830
830
|
content: e,
|
|
831
|
-
onAppInfo:
|
|
831
|
+
onAppInfo: z
|
|
832
832
|
});
|
|
833
|
-
case i.Unsupported: return /* @__PURE__ */
|
|
834
|
-
className: g("text-center",
|
|
833
|
+
case i.Unsupported: return /* @__PURE__ */ B("p", {
|
|
834
|
+
className: g("text-center", q.statusLabel),
|
|
835
835
|
children: o
|
|
836
836
|
});
|
|
837
837
|
case i.Error: {
|
|
838
838
|
let t = e.errorType === n.Forbidden;
|
|
839
|
-
return /* @__PURE__ */
|
|
839
|
+
return /* @__PURE__ */ V("div", {
|
|
840
840
|
className: "flex flex-col items-center gap-2",
|
|
841
|
-
children: [
|
|
841
|
+
children: [B(t ? ie : D, {
|
|
842
842
|
size: 60,
|
|
843
843
|
stroke: S,
|
|
844
|
-
className:
|
|
845
|
-
}), /* @__PURE__ */
|
|
846
|
-
className: g("text-center",
|
|
844
|
+
className: q.errorIcon
|
|
845
|
+
}), /* @__PURE__ */ B("p", {
|
|
846
|
+
className: g("text-center", q.statusLabel),
|
|
847
847
|
children: t ? l : c
|
|
848
848
|
})]
|
|
849
849
|
});
|
|
@@ -851,11 +851,11 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
851
851
|
}
|
|
852
852
|
}, [
|
|
853
853
|
e,
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
854
|
+
U?.fontClassName,
|
|
855
|
+
U?.jsonClassName,
|
|
856
|
+
U?.xlsxFormulaLabelClassName,
|
|
857
857
|
r,
|
|
858
|
-
|
|
858
|
+
A,
|
|
859
859
|
o,
|
|
860
860
|
c,
|
|
861
861
|
l,
|
|
@@ -863,11 +863,11 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
863
863
|
f,
|
|
864
864
|
h,
|
|
865
865
|
a,
|
|
866
|
-
|
|
867
|
-
|
|
866
|
+
j,
|
|
867
|
+
N,
|
|
868
868
|
P,
|
|
869
869
|
I,
|
|
870
|
-
|
|
870
|
+
z,
|
|
871
871
|
_,
|
|
872
872
|
v,
|
|
873
873
|
y,
|
|
@@ -879,69 +879,69 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
879
879
|
O,
|
|
880
880
|
k,
|
|
881
881
|
ee,
|
|
882
|
+
pe,
|
|
883
|
+
de,
|
|
882
884
|
me,
|
|
883
|
-
fe,
|
|
884
|
-
he,
|
|
885
885
|
te,
|
|
886
886
|
ne,
|
|
887
887
|
re,
|
|
888
888
|
ae,
|
|
889
889
|
oe
|
|
890
890
|
]);
|
|
891
|
-
return /* @__PURE__ */
|
|
892
|
-
style: !t &&
|
|
893
|
-
className: g(t ? "flex h-full items-center justify-center" :
|
|
894
|
-
children: t ? /* @__PURE__ */
|
|
891
|
+
return /* @__PURE__ */ B("div", {
|
|
892
|
+
style: !t && Ne.has(e.type) ? ge : void 0,
|
|
893
|
+
className: g(t ? "flex h-full items-center justify-center" : ve, le),
|
|
894
|
+
children: t ? /* @__PURE__ */ B(E, {}) : ye
|
|
895
895
|
});
|
|
896
|
-
}),
|
|
896
|
+
}), Fe = {
|
|
897
897
|
mcpAppDivider: "_mcpAppDivider_1jh5p_1",
|
|
898
898
|
mcpAppVersion: "_mcpAppVersion_1jh5p_5"
|
|
899
|
-
},
|
|
900
|
-
let [Me, Ne] = L(!1), [
|
|
901
|
-
Se?.(),
|
|
902
|
-
}, [Se]), We =
|
|
903
|
-
|
|
904
|
-
}, [
|
|
905
|
-
|
|
906
|
-
}, [
|
|
899
|
+
}, Ie = 2e3, Le = j(({ isOpen: e, isLoading: t = !1, onClose: n, content: r, fileName: a, leftActions: s, labels: { ariaLabel: c, closeLabel: l = "Close", resizeLabel: u = "Resize panel", downloadLabel: d = "Download", copyTextLabel: f = "Copy text", copiedTextLabel: p = "Copied!", copyMarkdownLabel: h = "Copy as Markdown", copiedMarkdownLabel: _ = "Copied!", copyJsonLabel: v = "Copy as JSON", copiedJsonLabel: C = "Copied!", visualizerErrorLabel: T, unsupportedLabel: E = "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: ie = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: se = "Open in new tab", htmlViewSourceLabel: A = "View source", htmlViewRenderedLabel: j = "View rendered", mcpAppReloadLabel: N = "Reload", pdfThumbnailsLabel: ce, pdfShowThumbnailsLabel: R, pdfHideThumbnailsLabel: H, pdfPageNumberLabel: U, pdfContentLoadingLabel: le, pdfContentErrorLabel: ue, pdfContentRetryLabel: de, xlsxFormulaLabel: pe, codeContentLoadingLabel: me, codeContentErrorLabel: W, codeContentRetryLabel: he, tableCopyLabel: ge, tableCopiedLabel: _e, tableDownloadCsvLabel: ve, ooxmlHighlightsLabel: ye, ooxmlHighlightNavigatedLabel: be }, onDownload: xe, onCopyText: Se, onCopyMarkdown: G, onCopyJson: Ce, tableDownloadFilename: K, isMobile: we = !1, defaultWidth: Te, minWidth: Ee = 600, maxWidth: De = 1500, onResizeStop: Oe, styles: ke, codeBlockTheme: Ae, loadPdf: q, configurePdfWorker: je }) => {
|
|
900
|
+
let [Me, Ne] = L(!1), [Le, Re] = L(!1), [J, ze] = L(!1), [Y, Be] = L(!1), [Ve, X] = L(void 0), Z = I(null), He = I(null), Q = I(null), Ue = M(() => {
|
|
901
|
+
Se?.(), Z.current != null && clearTimeout(Z.current), Ne(!0), Z.current = setTimeout(() => Ne(!1), Ie);
|
|
902
|
+
}, [Se]), We = M(() => {
|
|
903
|
+
G?.(), He.current != null && clearTimeout(He.current), Re(!0), He.current = setTimeout(() => Re(!1), Ie);
|
|
904
|
+
}, [G]), Ge = M(() => {
|
|
905
|
+
Ce?.(), Q.current != null && clearTimeout(Q.current), ze(!0), Q.current = setTimeout(() => ze(!1), Ie);
|
|
906
|
+
}, [Ce]);
|
|
907
907
|
P(() => () => {
|
|
908
|
-
|
|
908
|
+
Z.current != null && clearTimeout(Z.current), He.current != null && clearTimeout(He.current), Q.current != null && clearTimeout(Q.current);
|
|
909
909
|
}, []);
|
|
910
|
-
let
|
|
910
|
+
let $ = M(() => {
|
|
911
911
|
Be((e) => !e);
|
|
912
912
|
}, []);
|
|
913
913
|
P(() => {
|
|
914
|
-
Be(!1),
|
|
914
|
+
Be(!1), X(void 0);
|
|
915
915
|
}, [r]);
|
|
916
|
-
let { className:
|
|
917
|
-
"--ac-mcp-app-divider":
|
|
918
|
-
"--ac-mcp-app-version":
|
|
919
|
-
}), [
|
|
920
|
-
style:
|
|
916
|
+
let { className: Ke, panelStyles: qe, ...Je } = ke ?? {}, { colors: Ye, typography: Xe } = Je, Ze = F(() => m({
|
|
917
|
+
"--ac-mcp-app-divider": Ye?.mcpAppDividerColor,
|
|
918
|
+
"--ac-mcp-app-version": Ye?.mcpAppVersionColor
|
|
919
|
+
}), [Ye?.mcpAppDividerColor, Ye?.mcpAppVersionColor]), Qe = r.type === i.McpApp && Ve != null ? /* @__PURE__ */ V("span", {
|
|
920
|
+
style: Ze,
|
|
921
921
|
children: [
|
|
922
|
-
/* @__PURE__ */
|
|
923
|
-
/* @__PURE__ */
|
|
922
|
+
/* @__PURE__ */ B("span", { children: a }),
|
|
923
|
+
/* @__PURE__ */ B("span", {
|
|
924
924
|
"aria-hidden": !0,
|
|
925
|
-
className: g("mx-1.5 inline-block h-3 w-0 border-s align-middle",
|
|
925
|
+
className: g("mx-1.5 inline-block h-3 w-0 border-s align-middle", Fe.mcpAppDivider)
|
|
926
926
|
}),
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
Ve.version && /* @__PURE__ */
|
|
929
|
-
className: g("ms-2",
|
|
927
|
+
/* @__PURE__ */ B("span", { children: Ve.name }),
|
|
928
|
+
Ve.version && /* @__PURE__ */ B("span", {
|
|
929
|
+
className: g("ms-2", Xe?.mcpAppVersionClassName ?? "dial-caption-text", Fe.mcpAppVersion),
|
|
930
930
|
children: Ve.version
|
|
931
931
|
})
|
|
932
932
|
]
|
|
933
|
-
}) : a,
|
|
934
|
-
return /* @__PURE__ */
|
|
933
|
+
}) : a, $e = !t && r.type === i.Html && r.srcdoc != null, et = !t && Se != null && (r.type === i.PlainText || r.type === i.Code), tt = !t && G != null && r.type === i.Markdown, nt = !t && Ce != null && r.type === i.Json, rt = !t && xe != null && o(r), it = !t && r.type === i.McpApp && r.onReload != null;
|
|
934
|
+
return /* @__PURE__ */ B(b, {
|
|
935
935
|
isOpen: e,
|
|
936
936
|
orientation: y.Right,
|
|
937
|
-
title:
|
|
937
|
+
title: Qe,
|
|
938
938
|
labels: {
|
|
939
|
-
ariaLabel:
|
|
940
|
-
closeLabel:
|
|
941
|
-
resizeLabel:
|
|
939
|
+
ariaLabel: c,
|
|
940
|
+
closeLabel: l,
|
|
941
|
+
resizeLabel: u
|
|
942
942
|
},
|
|
943
943
|
onClose: n,
|
|
944
|
-
resizable: !
|
|
944
|
+
resizable: !we,
|
|
945
945
|
defaultWidth: Te,
|
|
946
946
|
minWidth: Ee,
|
|
947
947
|
maxWidth: De,
|
|
@@ -950,94 +950,95 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
950
950
|
...qe,
|
|
951
951
|
titleClassName: qe?.titleClassName ?? "dial-h3-text",
|
|
952
952
|
headerClassName: g("border-b border-tertiary", qe?.headerClassName),
|
|
953
|
-
className: g(e ? "mobile:w-full mobile:max-w-full" : "w-0",
|
|
953
|
+
className: g(e ? "mobile:w-full mobile:max-w-full" : "w-0", Ke, qe?.className, fe.panel)
|
|
954
954
|
},
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
955
|
+
leftActions: s,
|
|
956
|
+
rightActions: $e || et || tt || nt || rt || it ? /* @__PURE__ */ V(z, { children: [
|
|
957
|
+
it && /* @__PURE__ */ B(w, {
|
|
958
|
+
icon: /* @__PURE__ */ B(oe, {
|
|
958
959
|
size: x.LG,
|
|
959
960
|
stroke: S,
|
|
960
961
|
"aria-hidden": !0
|
|
961
962
|
}),
|
|
962
|
-
"aria-label":
|
|
963
|
-
tooltipProps: { tooltip:
|
|
963
|
+
"aria-label": N,
|
|
964
|
+
tooltipProps: { tooltip: N },
|
|
964
965
|
onClick: r.type === i.McpApp ? r.onReload : void 0
|
|
965
966
|
}),
|
|
966
|
-
|
|
967
|
-
icon:
|
|
967
|
+
$e && /* @__PURE__ */ B(w, {
|
|
968
|
+
icon: B(Y ? re : ee, {
|
|
968
969
|
size: x.LG,
|
|
969
970
|
stroke: S,
|
|
970
971
|
"aria-hidden": !0
|
|
971
972
|
}),
|
|
972
|
-
"aria-label":
|
|
973
|
-
"aria-pressed":
|
|
974
|
-
tooltipProps: { tooltip:
|
|
975
|
-
onClick:
|
|
973
|
+
"aria-label": Y ? j : A,
|
|
974
|
+
"aria-pressed": Y,
|
|
975
|
+
tooltipProps: { tooltip: Y ? j : A },
|
|
976
|
+
onClick: $
|
|
976
977
|
}),
|
|
977
|
-
|
|
978
|
-
icon:
|
|
978
|
+
et && /* @__PURE__ */ B(w, {
|
|
979
|
+
icon: B(Me ? k : te, {
|
|
979
980
|
size: x.LG,
|
|
980
981
|
stroke: S,
|
|
981
982
|
"aria-hidden": !0
|
|
982
983
|
}),
|
|
983
|
-
"aria-label": Me ?
|
|
984
|
-
tooltipProps: { tooltip: Me ?
|
|
984
|
+
"aria-label": Me ? p : f,
|
|
985
|
+
tooltipProps: { tooltip: Me ? p : f },
|
|
985
986
|
onClick: Ue
|
|
986
987
|
}),
|
|
987
|
-
|
|
988
|
-
icon:
|
|
988
|
+
tt && /* @__PURE__ */ B(w, {
|
|
989
|
+
icon: B(Le ? k : ae, {
|
|
989
990
|
size: x.LG,
|
|
990
991
|
stroke: S,
|
|
991
992
|
"aria-hidden": !0
|
|
992
993
|
}),
|
|
993
|
-
"aria-label":
|
|
994
|
-
tooltipProps: { tooltip:
|
|
994
|
+
"aria-label": Le ? _ : h,
|
|
995
|
+
tooltipProps: { tooltip: Le ? _ : h },
|
|
995
996
|
onClick: We
|
|
996
997
|
}),
|
|
997
|
-
|
|
998
|
-
icon:
|
|
998
|
+
nt && /* @__PURE__ */ B(w, {
|
|
999
|
+
icon: B(J ? k : te, {
|
|
999
1000
|
size: x.LG,
|
|
1000
1001
|
stroke: S,
|
|
1001
1002
|
"aria-hidden": !0
|
|
1002
1003
|
}),
|
|
1003
|
-
"aria-label":
|
|
1004
|
-
tooltipProps: { tooltip:
|
|
1004
|
+
"aria-label": J ? C : v,
|
|
1005
|
+
tooltipProps: { tooltip: J ? C : v },
|
|
1005
1006
|
onClick: Ge
|
|
1006
1007
|
}),
|
|
1007
|
-
|
|
1008
|
-
icon: /* @__PURE__ */
|
|
1008
|
+
rt && /* @__PURE__ */ B(w, {
|
|
1009
|
+
icon: /* @__PURE__ */ B(ne, {
|
|
1009
1010
|
size: x.LG,
|
|
1010
1011
|
stroke: S
|
|
1011
1012
|
}),
|
|
1012
|
-
"aria-label":
|
|
1013
|
-
tooltipProps: { tooltip:
|
|
1013
|
+
"aria-label": d,
|
|
1014
|
+
tooltipProps: { tooltip: d },
|
|
1014
1015
|
onClick: xe
|
|
1015
1016
|
})
|
|
1016
1017
|
] }) : null,
|
|
1017
|
-
children: /* @__PURE__ */
|
|
1018
|
+
children: /* @__PURE__ */ B(Pe, {
|
|
1018
1019
|
content: r,
|
|
1019
1020
|
isLoading: t,
|
|
1020
1021
|
fileName: a,
|
|
1021
|
-
isHtmlSourceView:
|
|
1022
|
-
onAppInfo: r.type === i.McpApp ?
|
|
1022
|
+
isHtmlSourceView: Y,
|
|
1023
|
+
onAppInfo: r.type === i.McpApp ? X : void 0,
|
|
1023
1024
|
labels: {
|
|
1024
|
-
unsupportedLabel:
|
|
1025
|
-
loadErrorLabel:
|
|
1026
|
-
forbiddenErrorLabel:
|
|
1027
|
-
visualizerErrorLabel:
|
|
1028
|
-
htmlFrameBlockedLabel:
|
|
1029
|
-
htmlOpenInNewTabLabel:
|
|
1030
|
-
pdfThumbnailsLabel:
|
|
1025
|
+
unsupportedLabel: E,
|
|
1026
|
+
loadErrorLabel: D,
|
|
1027
|
+
forbiddenErrorLabel: O,
|
|
1028
|
+
visualizerErrorLabel: T,
|
|
1029
|
+
htmlFrameBlockedLabel: ie,
|
|
1030
|
+
htmlOpenInNewTabLabel: se,
|
|
1031
|
+
pdfThumbnailsLabel: ce,
|
|
1031
1032
|
pdfShowThumbnailsLabel: R,
|
|
1032
|
-
pdfHideThumbnailsLabel:
|
|
1033
|
-
pdfPageNumberLabel:
|
|
1034
|
-
pdfContentLoadingLabel:
|
|
1033
|
+
pdfHideThumbnailsLabel: H,
|
|
1034
|
+
pdfPageNumberLabel: U,
|
|
1035
|
+
pdfContentLoadingLabel: le,
|
|
1035
1036
|
pdfContentErrorLabel: ue,
|
|
1036
1037
|
pdfContentRetryLabel: de,
|
|
1037
|
-
xlsxFormulaLabel:
|
|
1038
|
+
xlsxFormulaLabel: pe,
|
|
1038
1039
|
codeContentLoadingLabel: me,
|
|
1039
|
-
codeContentErrorLabel:
|
|
1040
|
-
codeContentRetryLabel:
|
|
1040
|
+
codeContentErrorLabel: W,
|
|
1041
|
+
codeContentRetryLabel: he,
|
|
1041
1042
|
tableCopyLabel: ge,
|
|
1042
1043
|
tableCopiedLabel: _e,
|
|
1043
1044
|
tableDownloadCsvLabel: ve,
|
|
@@ -1046,48 +1047,48 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
1046
1047
|
},
|
|
1047
1048
|
styles: Je,
|
|
1048
1049
|
codeBlockTheme: Ae,
|
|
1049
|
-
tableDownloadFilename:
|
|
1050
|
-
loadPdf:
|
|
1051
|
-
configurePdfWorker:
|
|
1050
|
+
tableDownloadFilename: K,
|
|
1051
|
+
loadPdf: q,
|
|
1052
|
+
configurePdfWorker: je
|
|
1052
1053
|
})
|
|
1053
1054
|
});
|
|
1054
|
-
}),
|
|
1055
|
+
}), Re = new Set(["html", "htm"]), J = {
|
|
1055
1056
|
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
1056
1057
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
1057
1058
|
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
|
1058
|
-
},
|
|
1059
|
+
}, ze = 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(".")), Y = {
|
|
1059
1060
|
docx: r.Docx,
|
|
1060
1061
|
xlsx: r.Xlsx,
|
|
1061
1062
|
pptx: r.Pptx,
|
|
1062
1063
|
csv: r.Csv
|
|
1063
|
-
},
|
|
1064
|
-
[
|
|
1065
|
-
[
|
|
1066
|
-
[
|
|
1064
|
+
}, Be = {
|
|
1065
|
+
[J.docx]: r.Docx,
|
|
1066
|
+
[J.xlsx]: r.Xlsx,
|
|
1067
|
+
[J.pptx]: r.Pptx,
|
|
1067
1068
|
[f.CSV]: r.Csv
|
|
1068
|
-
},
|
|
1069
|
-
[r.Docx]:
|
|
1070
|
-
[r.Xlsx]:
|
|
1071
|
-
[r.Pptx]:
|
|
1069
|
+
}, Ve = {
|
|
1070
|
+
[r.Docx]: J.docx,
|
|
1071
|
+
[r.Xlsx]: J.xlsx,
|
|
1072
|
+
[r.Pptx]: J.pptx,
|
|
1072
1073
|
[r.Csv]: f.CSV
|
|
1073
|
-
},
|
|
1074
|
+
}, X = (e, t) => {
|
|
1074
1075
|
let n = t?.split(";", 1)[0].trim().toLowerCase();
|
|
1075
1076
|
if (n != null) {
|
|
1076
|
-
let e =
|
|
1077
|
+
let e = Be[n];
|
|
1077
1078
|
if (e != null) return e;
|
|
1078
1079
|
}
|
|
1079
1080
|
let r = e.lastIndexOf(".");
|
|
1080
|
-
if (r !== -1) return
|
|
1081
|
-
},
|
|
1082
|
-
let n =
|
|
1083
|
-
return n == null ? void 0 :
|
|
1084
|
-
},
|
|
1085
|
-
let t = e.lastIndexOf(".");
|
|
1086
|
-
return t === -1 ? !1 : J.has(e.slice(t + 1).toLowerCase());
|
|
1087
|
-
}, We = (e) => {
|
|
1081
|
+
if (r !== -1) return Y[e.slice(r + 1).toLowerCase()];
|
|
1082
|
+
}, Z = (e, t) => X(e, t) != null, He = (e, t) => {
|
|
1083
|
+
let n = X(e, t);
|
|
1084
|
+
return n == null ? void 0 : Ve[n];
|
|
1085
|
+
}, Q = (e) => {
|
|
1088
1086
|
let t = e.lastIndexOf(".");
|
|
1089
1087
|
return t === -1 ? !1 : ze.has(e.slice(t + 1).toLowerCase());
|
|
1090
|
-
},
|
|
1088
|
+
}, Ue = (e) => {
|
|
1089
|
+
let t = e.lastIndexOf(".");
|
|
1090
|
+
return t === -1 ? !1 : Re.has(e.slice(t + 1).toLowerCase());
|
|
1091
|
+
}, We = {
|
|
1091
1092
|
xml: "xml",
|
|
1092
1093
|
csv: "plaintext",
|
|
1093
1094
|
tsv: "plaintext",
|
|
@@ -1135,39 +1136,39 @@ var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
|
1135
1136
|
gitignore: "plaintext",
|
|
1136
1137
|
dockerfile: "plaintext",
|
|
1137
1138
|
makefile: "plaintext"
|
|
1138
|
-
},
|
|
1139
|
+
}, Ge = (e) => We[e], $ = (e) => ({
|
|
1139
1140
|
type: i.Unsupported,
|
|
1140
1141
|
...e != null && { url: e }
|
|
1141
|
-
}),
|
|
1142
|
+
}), Ke = (e) => ({
|
|
1142
1143
|
type: i.Error,
|
|
1143
1144
|
errorType: n.LoadFailed,
|
|
1144
1145
|
...e != null && { url: e }
|
|
1145
|
-
}),
|
|
1146
|
+
}), qe = (e) => ({
|
|
1146
1147
|
type: i.Error,
|
|
1147
1148
|
errorType: n.Forbidden,
|
|
1148
1149
|
...e != null && { url: e }
|
|
1149
|
-
}),
|
|
1150
|
+
}), Je = (e) => {
|
|
1150
1151
|
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;
|
|
1151
1152
|
}, Ye = (e) => {
|
|
1152
|
-
let t =
|
|
1153
|
+
let t = Je(e);
|
|
1153
1154
|
t != null && URL.revokeObjectURL(t);
|
|
1154
1155
|
}, Xe = {
|
|
1155
1156
|
type: i.PlainText,
|
|
1156
1157
|
text: ""
|
|
1157
|
-
}, Ze =
|
|
1158
|
+
}, Ze = se(void 0);
|
|
1158
1159
|
Ze.displayName = "AttachmentCanvasContext";
|
|
1159
1160
|
var Qe = ({ children: e }) => {
|
|
1160
|
-
let [t, n] = L(!1), [r, i] = L(!1), [a, o] = L(Xe), [s, c] = L(void 0), [l, u] = L(void 0), d =
|
|
1161
|
+
let [t, n] = L(!1), [r, i] = L(!1), [a, o] = L(Xe), [s, c] = L(void 0), [l, u] = L(void 0), d = M((e, t) => {
|
|
1161
1162
|
c(e), u(t), i(!0), n(!0);
|
|
1162
|
-
}, []), f =
|
|
1163
|
+
}, []), f = M((e, t, r) => {
|
|
1163
1164
|
o(e), c(t), u(r), i(!1), n(!0);
|
|
1164
|
-
}, []), p =
|
|
1165
|
+
}, []), p = M(() => {
|
|
1165
1166
|
o(Xe), n(!1), i(!1), u(void 0);
|
|
1166
1167
|
}, []);
|
|
1167
1168
|
return P(() => () => {
|
|
1168
|
-
let e =
|
|
1169
|
+
let e = Je(a);
|
|
1169
1170
|
e != null && URL.revokeObjectURL(e);
|
|
1170
|
-
}, [a]), /* @__PURE__ */
|
|
1171
|
+
}, [a]), /* @__PURE__ */ B(Ze.Provider, {
|
|
1171
1172
|
value: F(() => ({
|
|
1172
1173
|
isOpen: t,
|
|
1173
1174
|
isLoading: r,
|
|
@@ -1190,95 +1191,96 @@ var Qe = ({ children: e }) => {
|
|
|
1190
1191
|
children: e
|
|
1191
1192
|
});
|
|
1192
1193
|
}, $e = () => {
|
|
1193
|
-
let e =
|
|
1194
|
+
let e = N(Ze);
|
|
1194
1195
|
if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
|
|
1195
1196
|
return e;
|
|
1196
|
-
}, et =
|
|
1197
|
-
let { ariaLabel:
|
|
1198
|
-
a(R,
|
|
1199
|
-
}, [R,
|
|
1197
|
+
}, et = j(({ labels: e, leftActions: t, isMobile: n = !1, defaultWidth: r, maxWidth: o, codeBlockTheme: s, tableDownloadFilename: c, loadPdf: l, configurePdfWorker: u }) => {
|
|
1198
|
+
let { ariaLabel: d = "Attachment preview", closeLabel: f = "Close", downloadLabel: p = "Download", unsupportedLabel: m = "Preview is not supported for this file", loadErrorLabel: g = "Failed to load file", forbiddenErrorLabel: _ = "You don't have permission to access this file", copyTextLabel: v, copiedTextLabel: y, copyMarkdownLabel: b, copiedMarkdownLabel: x, copyJsonLabel: S, copiedJsonLabel: C, htmlFrameBlockedLabel: w, htmlOpenInNewTabLabel: T, htmlViewSourceLabel: E, htmlViewRenderedLabel: D, pdfThumbnailsLabel: O, pdfShowThumbnailsLabel: k, pdfHideThumbnailsLabel: ee, pdfPageNumberLabel: te, pdfContentLoadingLabel: ne, pdfContentErrorLabel: re, pdfContentRetryLabel: ie, xlsxFormulaLabel: ae, codeContentLoadingLabel: oe, codeContentErrorLabel: se, codeContentRetryLabel: A, tableCopyLabel: j, tableCopiedLabel: N, tableDownloadCsvLabel: P, ooxmlHighlightsLabel: F, ooxmlHighlightNavigatedLabel: I } = e ?? {}, { isOpen: L, isLoading: ce, content: R, fileName: z, closeCanvas: V } = $e(), H = M(() => {
|
|
1199
|
+
a(R, z);
|
|
1200
|
+
}, [R, z]), U = M(() => {
|
|
1200
1201
|
(R.type === i.PlainText || R.type === i.Code) && h(R.text);
|
|
1201
|
-
}, [R]),
|
|
1202
|
+
}, [R]), le = M(() => {
|
|
1202
1203
|
R.type === i.Markdown && h(R.text);
|
|
1203
|
-
}, [R]), ue =
|
|
1204
|
+
}, [R]), ue = M(() => {
|
|
1204
1205
|
R.type === i.Json && h(JSON.stringify(R.value, null, 2));
|
|
1205
1206
|
}, [R]);
|
|
1206
|
-
return /* @__PURE__ */
|
|
1207
|
-
isOpen:
|
|
1208
|
-
isLoading:
|
|
1209
|
-
onClose:
|
|
1207
|
+
return /* @__PURE__ */ B(Le, {
|
|
1208
|
+
isOpen: L,
|
|
1209
|
+
isLoading: ce,
|
|
1210
|
+
onClose: V,
|
|
1210
1211
|
content: R,
|
|
1211
|
-
fileName:
|
|
1212
|
+
fileName: z,
|
|
1213
|
+
leftActions: t,
|
|
1212
1214
|
labels: {
|
|
1213
|
-
ariaLabel:
|
|
1214
|
-
closeLabel:
|
|
1215
|
-
downloadLabel:
|
|
1216
|
-
copyTextLabel:
|
|
1217
|
-
copiedTextLabel:
|
|
1218
|
-
copyMarkdownLabel:
|
|
1219
|
-
copiedMarkdownLabel:
|
|
1220
|
-
copyJsonLabel:
|
|
1221
|
-
copiedJsonLabel:
|
|
1222
|
-
unsupportedLabel:
|
|
1223
|
-
loadErrorLabel:
|
|
1224
|
-
forbiddenErrorLabel:
|
|
1225
|
-
htmlFrameBlockedLabel:
|
|
1226
|
-
htmlOpenInNewTabLabel:
|
|
1227
|
-
htmlViewSourceLabel:
|
|
1228
|
-
htmlViewRenderedLabel:
|
|
1229
|
-
pdfThumbnailsLabel:
|
|
1230
|
-
pdfShowThumbnailsLabel:
|
|
1231
|
-
pdfHideThumbnailsLabel:
|
|
1232
|
-
pdfPageNumberLabel:
|
|
1233
|
-
pdfContentLoadingLabel:
|
|
1234
|
-
pdfContentErrorLabel:
|
|
1235
|
-
pdfContentRetryLabel:
|
|
1236
|
-
xlsxFormulaLabel:
|
|
1237
|
-
codeContentLoadingLabel:
|
|
1238
|
-
codeContentErrorLabel:
|
|
1215
|
+
ariaLabel: d,
|
|
1216
|
+
closeLabel: f,
|
|
1217
|
+
downloadLabel: p,
|
|
1218
|
+
copyTextLabel: v,
|
|
1219
|
+
copiedTextLabel: y,
|
|
1220
|
+
copyMarkdownLabel: b,
|
|
1221
|
+
copiedMarkdownLabel: x,
|
|
1222
|
+
copyJsonLabel: S,
|
|
1223
|
+
copiedJsonLabel: C,
|
|
1224
|
+
unsupportedLabel: m,
|
|
1225
|
+
loadErrorLabel: g,
|
|
1226
|
+
forbiddenErrorLabel: _,
|
|
1227
|
+
htmlFrameBlockedLabel: w,
|
|
1228
|
+
htmlOpenInNewTabLabel: T,
|
|
1229
|
+
htmlViewSourceLabel: E,
|
|
1230
|
+
htmlViewRenderedLabel: D,
|
|
1231
|
+
pdfThumbnailsLabel: O,
|
|
1232
|
+
pdfShowThumbnailsLabel: k,
|
|
1233
|
+
pdfHideThumbnailsLabel: ee,
|
|
1234
|
+
pdfPageNumberLabel: te,
|
|
1235
|
+
pdfContentLoadingLabel: ne,
|
|
1236
|
+
pdfContentErrorLabel: re,
|
|
1237
|
+
pdfContentRetryLabel: ie,
|
|
1238
|
+
xlsxFormulaLabel: ae,
|
|
1239
|
+
codeContentLoadingLabel: oe,
|
|
1240
|
+
codeContentErrorLabel: se,
|
|
1239
1241
|
codeContentRetryLabel: A,
|
|
1240
1242
|
tableCopyLabel: j,
|
|
1241
|
-
tableCopiedLabel:
|
|
1242
|
-
tableDownloadCsvLabel:
|
|
1243
|
-
ooxmlHighlightsLabel:
|
|
1244
|
-
ooxmlHighlightNavigatedLabel:
|
|
1243
|
+
tableCopiedLabel: N,
|
|
1244
|
+
tableDownloadCsvLabel: P,
|
|
1245
|
+
ooxmlHighlightsLabel: F,
|
|
1246
|
+
ooxmlHighlightNavigatedLabel: I
|
|
1245
1247
|
},
|
|
1246
|
-
onDownload:
|
|
1247
|
-
onCopyText: R.type === i.PlainText || R.type === i.Code ?
|
|
1248
|
-
onCopyMarkdown: R.type === i.Markdown ?
|
|
1248
|
+
onDownload: H,
|
|
1249
|
+
onCopyText: R.type === i.PlainText || R.type === i.Code ? U : void 0,
|
|
1250
|
+
onCopyMarkdown: R.type === i.Markdown ? le : void 0,
|
|
1249
1251
|
onCopyJson: R.type === i.Json ? ue : void 0,
|
|
1250
|
-
tableDownloadFilename:
|
|
1251
|
-
isMobile:
|
|
1252
|
-
defaultWidth:
|
|
1253
|
-
maxWidth:
|
|
1254
|
-
codeBlockTheme:
|
|
1255
|
-
configurePdfWorker:
|
|
1256
|
-
loadPdf:
|
|
1252
|
+
tableDownloadFilename: c,
|
|
1253
|
+
isMobile: n,
|
|
1254
|
+
defaultWidth: r,
|
|
1255
|
+
maxWidth: o,
|
|
1256
|
+
codeBlockTheme: s,
|
|
1257
|
+
configurePdfWorker: u,
|
|
1258
|
+
loadPdf: l
|
|
1257
1259
|
});
|
|
1258
1260
|
}), tt = {
|
|
1259
1261
|
frame: "_frame_g47g7_1",
|
|
1260
1262
|
header: "_header_g47g7_6",
|
|
1261
1263
|
title: "_title_g47g7_10"
|
|
1262
|
-
}, nt =
|
|
1264
|
+
}, nt = j(({ content: e, height: t, onExpand: n, expandAriaLabel: r, actionsGroupAriaLabel: i = "Visualizer actions", frameTitle: a, loadingLabel: o, errorLabel: s, titleClassName: c = "dial-small-semi-text", colors: l }) => {
|
|
1263
1265
|
let u = e.visualizerName.trim();
|
|
1264
|
-
return /* @__PURE__ */
|
|
1266
|
+
return /* @__PURE__ */ V("div", {
|
|
1265
1267
|
className: g("flex w-full min-w-0 flex-col overflow-hidden rounded-xl border", tt.frame),
|
|
1266
1268
|
style: m({
|
|
1267
1269
|
"--igv-bg": l?.background,
|
|
1268
1270
|
"--igv-border": l?.border,
|
|
1269
1271
|
"--igv-title-text": l?.titleText
|
|
1270
1272
|
}),
|
|
1271
|
-
children: [/* @__PURE__ */
|
|
1273
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1272
1274
|
className: g("flex min-h-10 items-center justify-between gap-2 border-b px-4 py-2", tt.header),
|
|
1273
|
-
children: [/* @__PURE__ */
|
|
1275
|
+
children: [/* @__PURE__ */ B("span", {
|
|
1274
1276
|
className: g("min-w-0 truncate", c, tt.title),
|
|
1275
1277
|
children: u
|
|
1276
|
-
}), /* @__PURE__ */
|
|
1278
|
+
}), /* @__PURE__ */ B("div", {
|
|
1277
1279
|
role: "toolbar",
|
|
1278
1280
|
"aria-label": i,
|
|
1279
1281
|
className: "flex items-center gap-1",
|
|
1280
|
-
children: /* @__PURE__ */
|
|
1281
|
-
icon: /* @__PURE__ */
|
|
1282
|
+
children: /* @__PURE__ */ B(w, {
|
|
1283
|
+
icon: /* @__PURE__ */ B(O, {
|
|
1282
1284
|
size: x.SM,
|
|
1283
1285
|
stroke: S,
|
|
1284
1286
|
"aria-hidden": !0
|
|
@@ -1288,10 +1290,10 @@ var Qe = ({ children: e }) => {
|
|
|
1288
1290
|
onClick: n
|
|
1289
1291
|
})
|
|
1290
1292
|
})]
|
|
1291
|
-
}), /* @__PURE__ */
|
|
1293
|
+
}), /* @__PURE__ */ B("div", {
|
|
1292
1294
|
className: "w-full",
|
|
1293
1295
|
style: { height: `${t}px` },
|
|
1294
|
-
children: /* @__PURE__ */
|
|
1296
|
+
children: /* @__PURE__ */ B(Ae, {
|
|
1295
1297
|
content: e,
|
|
1296
1298
|
loadingLabel: o,
|
|
1297
1299
|
errorLabel: s,
|
|
@@ -1330,7 +1332,7 @@ var Qe = ({ children: e }) => {
|
|
|
1330
1332
|
return n;
|
|
1331
1333
|
}
|
|
1332
1334
|
}, ct = (e, t) => {
|
|
1333
|
-
let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = $e(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u =
|
|
1335
|
+
let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = $e(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = M(async (t, n, r) => {
|
|
1334
1336
|
if (t.url == null && t.referenceUrl != null) {
|
|
1335
1337
|
let i = e.resolveReferencePdfContent(t);
|
|
1336
1338
|
if (i != null) return r(i, t.name, n);
|
|
@@ -1344,15 +1346,15 @@ var Qe = ({ children: e }) => {
|
|
|
1344
1346
|
let i = await e.resolveTextContent(t);
|
|
1345
1347
|
if (i != null) return r(i, t.name, n);
|
|
1346
1348
|
}
|
|
1347
|
-
let l =
|
|
1348
|
-
if (l != null) return r(await e.resolveOoxmlContent(t, l) ??
|
|
1349
|
+
let l = X("", a);
|
|
1350
|
+
if (l != null) return r(await e.resolveOoxmlContent(t, l) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1349
1351
|
switch (a) {
|
|
1350
|
-
case f.PDF: return r(await e.resolvePdfContent(t) ??
|
|
1351
|
-
case f.Markdown: return r(await e.resolveMarkdownContent(t) ??
|
|
1352
|
-
case f.JSON: return r(await e.resolveJsonContent(t) ??
|
|
1352
|
+
case f.PDF: return r(await e.resolvePdfContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1353
|
+
case f.Markdown: return r(await e.resolveMarkdownContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1354
|
+
case f.JSON: return r(await e.resolveJsonContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1353
1355
|
}
|
|
1354
|
-
let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h =
|
|
1355
|
-
if (h != null) return r(await e.resolveOoxmlContent(t, h) ??
|
|
1356
|
+
let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h = X(u);
|
|
1357
|
+
if (h != null) return r(await e.resolveOoxmlContent(t, h) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1356
1358
|
switch (m) {
|
|
1357
1359
|
case d.Markdown:
|
|
1358
1360
|
case d.MarkdownAlt: {
|
|
@@ -1368,23 +1370,23 @@ var Qe = ({ children: e }) => {
|
|
|
1368
1370
|
return i == null ? !1 : r(i, t.name, n);
|
|
1369
1371
|
}
|
|
1370
1372
|
}
|
|
1371
|
-
let g = t.name != null &&
|
|
1372
|
-
if (t.name != null && !
|
|
1373
|
+
let g = t.name != null && Ue(t.name) || t.url != null && Ue(st(t.url));
|
|
1374
|
+
if (t.name != null && !Q(t.name) && !g) return r($(e.resolveContentUrl(t)), t.name, n);
|
|
1373
1375
|
if (g) {
|
|
1374
1376
|
let a = await e.resolveHtmlContent(t);
|
|
1375
|
-
return a == null ? e.hasTextSource(t) ? r(
|
|
1377
|
+
return a == null ? e.hasTextSource(t) ? r($(e.resolveContentUrl(t)), t.name, n) : t.url == null ? !1 : r({
|
|
1376
1378
|
type: i.Html,
|
|
1377
1379
|
url: t.url
|
|
1378
1380
|
}, t.name, n) : r(a, t.name, n);
|
|
1379
1381
|
}
|
|
1380
|
-
let _ = await e.resolveCodeContent(t,
|
|
1382
|
+
let _ = await e.resolveCodeContent(t, Ge(m));
|
|
1381
1383
|
return _ == null ? !1 : r(_, t.name, n);
|
|
1382
1384
|
}, [
|
|
1383
1385
|
o,
|
|
1384
1386
|
s,
|
|
1385
1387
|
e
|
|
1386
1388
|
]);
|
|
1387
|
-
return { openAttachmentCanvas:
|
|
1389
|
+
return { openAttachmentCanvas: M(async (t, o = t.id, s) => {
|
|
1388
1390
|
let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (Ye(e), !1);
|
|
1389
1391
|
switch (t.type) {
|
|
1390
1392
|
case c.Image: {
|
|
@@ -1422,4 +1424,4 @@ var Qe = ({ children: e }) => {
|
|
|
1422
1424
|
]) };
|
|
1423
1425
|
};
|
|
1424
1426
|
//#endregion
|
|
1425
|
-
export {
|
|
1427
|
+
export { fe as ATTACHMENT_CANVAS_CLASS, Le as AttachmentCanvas, Pe as AttachmentCanvasBody, et as AttachmentCanvasContainer, Qe as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, he as CodeContent, nt as InlineGroupedVisualizer, Ce as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, qe as createForbiddenCanvasContent, Ke as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, Ge as extensionToLanguage, it as findVisualizerForApplication, rt as findVisualizerForMime, X as getOoxmlFileType, He as getOoxmlMimeType, at as groupedVisualizerCanvasKey, o as isDownloadable, Ue as isHtmlPreviewable, Z as isOoxmlPreviewable, Q as isTextPreviewable, ot as partitionAttachmentsForApplicationVisualizer, $e as useAttachmentCanvas, ct as useOpenAttachmentCanvas };
|