@epam/ai-dial-attachment-canvas 1.2.0-dev.288 → 1.2.0-dev.300
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/AttachmentCanvasBody/AttachmentCanvasBody.d.ts.map +1 -1
- package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
- package/index.css +2 -2
- package/index.js +289 -264
- package/models/attachment-canvas.d.ts +11 -1
- package/models/attachment-canvas.d.ts.map +1 -1
- package/package.json +5 -5
- package/utils/ooxml-table-row-highlight.d.ts.map +1 -1
package/index.js
CHANGED
|
@@ -5,39 +5,39 @@ import { SidebarOrientation as b, SidebarPanel as x } from "@epam/ai-dial-sideba
|
|
|
5
5
|
import { DIAL_ICON_SIZE as S, DIAL_KIT_ICON_STROKE as C, ElementSize as w, GhostIconButton as T, LinkButton as E, Spinner as D } from "@epam/ai-dial-ui-kit";
|
|
6
6
|
import { IconAlertTriangle as O, IconArrowsMaximize as k, IconCheck as A, IconCode as j, IconCopy as ee, IconDownload as te, IconEye as M, IconLock as ne, IconMarkdown as re, IconRefresh as ie } from "@tabler/icons-react";
|
|
7
7
|
import { createContext as N, lazy as P, memo as F, useCallback as I, useContext as ae, useEffect as L, useMemo as R, useRef as z, useState as B } from "react";
|
|
8
|
-
import { JsonView as oe, defaultStyles as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { AppBridge as
|
|
11
|
-
import { McpUiHostContextChangedNotificationSchema as
|
|
12
|
-
import { VisualizerConnectorEvents as
|
|
13
|
-
import { VisualizerConnector as
|
|
8
|
+
import { JsonView as oe, defaultStyles as se } from "react-json-view-lite";
|
|
9
|
+
import { Fragment as ce, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
10
|
+
import { AppBridge as le, AppFrame as ue } from "@mcp-ui/client";
|
|
11
|
+
import { McpUiHostContextChangedNotificationSchema as U } from "@modelcontextprotocol/ext-apps/app-bridge";
|
|
12
|
+
import { VisualizerConnectorEvents as W, VisualizerConnectorRequests as de } from "@epam/ai-dial-shared";
|
|
13
|
+
import { VisualizerConnector as G } from "@epam/ai-dial-visualizer-connector";
|
|
14
14
|
//#region src/constants/public-class-names.ts
|
|
15
|
-
var
|
|
15
|
+
var K = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
16
16
|
container: "_container_1nhig_1",
|
|
17
17
|
containerLight: "_containerLight_1nhig_5"
|
|
18
|
-
},
|
|
18
|
+
}, pe = {
|
|
19
19
|
[l.Dark]: v,
|
|
20
20
|
[l.Light]: v
|
|
21
|
-
},
|
|
21
|
+
}, me = () => P(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 = R(() => g(r), [r]), o = i == null || i === "plaintext" || !a, c =
|
|
24
|
+
}), he = F(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
|
|
25
|
+
let { text: r, language: i } = e, a = R(() => g(r), [r]), o = i == null || i === "plaintext" || !a, c = pe[t], u = t === l.Light, [d, f] = B(0), p = R(me, [d]), m = I(() => {
|
|
26
26
|
f((e) => e + 1);
|
|
27
|
-
}, []), h = /* @__PURE__ */
|
|
27
|
+
}, []), h = /* @__PURE__ */ V("pre", {
|
|
28
28
|
className: "whitespace-pre-wrap break-words p-4",
|
|
29
29
|
children: r
|
|
30
30
|
});
|
|
31
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ V("div", {
|
|
32
32
|
dir: "ltr",
|
|
33
33
|
className: _("h-full overflow-auto", fe.container, u && fe.containerLight),
|
|
34
|
-
children: o ? h : /* @__PURE__ */
|
|
34
|
+
children: o ? h : /* @__PURE__ */ V(s, {
|
|
35
35
|
retryKey: d,
|
|
36
36
|
onRetry: m,
|
|
37
37
|
pendingContent: h,
|
|
38
38
|
errorContent: h,
|
|
39
39
|
labels: n,
|
|
40
|
-
children: /* @__PURE__ */
|
|
40
|
+
children: /* @__PURE__ */ V(p, {
|
|
41
41
|
language: i,
|
|
42
42
|
style: c,
|
|
43
43
|
customStyle: {
|
|
@@ -54,7 +54,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
54
54
|
})
|
|
55
55
|
})
|
|
56
56
|
});
|
|
57
|
-
}),
|
|
57
|
+
}), ge = "dial-html-preview:render", _e = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, ve = F(({ 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] = B(!0), [d, f] = B(!1), [p, m] = B(void 0), [h, g] = B(!1), [v, y] = B(!1), b = z(null), x = z(null), S = z(!1), C = z({
|
|
59
59
|
content: e,
|
|
60
60
|
generation: 0
|
|
@@ -93,7 +93,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
93
93
|
if (u(!1), A != null) {
|
|
94
94
|
let e = b.current?.contentWindow;
|
|
95
95
|
e != null && e !== x.current && j != null && (x.current = e, e.postMessage({
|
|
96
|
-
type:
|
|
96
|
+
type: ge,
|
|
97
97
|
html: j
|
|
98
98
|
}, "*"));
|
|
99
99
|
return;
|
|
@@ -111,10 +111,10 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
111
111
|
]), te = I(() => {
|
|
112
112
|
u(!1), f(!0);
|
|
113
113
|
}, []), M = e.srcdoc ?? p, ne = e.srcdoc != null || e.resolveSourceText != null, re = e.srcdoc == null && e.resolveSourceText != null && p == null && !v;
|
|
114
|
-
if (n && ne && (M != null || h || re)) return S.current = !0, M == null ? /* @__PURE__ */
|
|
114
|
+
if (n && ne && (M != null || h || re)) return S.current = !0, M == null ? /* @__PURE__ */ V("div", {
|
|
115
115
|
className: "flex h-full items-center justify-center",
|
|
116
|
-
children: /* @__PURE__ */
|
|
117
|
-
}) : /* @__PURE__ */
|
|
116
|
+
children: /* @__PURE__ */ V(D, {})
|
|
117
|
+
}) : /* @__PURE__ */ V(he, {
|
|
118
118
|
content: {
|
|
119
119
|
type: i.Code,
|
|
120
120
|
text: M,
|
|
@@ -122,26 +122,26 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
122
122
|
},
|
|
123
123
|
codeBlockTheme: a
|
|
124
124
|
});
|
|
125
|
-
if (d) return /* @__PURE__ */
|
|
125
|
+
if (d) return /* @__PURE__ */ H("div", {
|
|
126
126
|
className: "flex h-full flex-col items-center justify-center gap-3 p-4",
|
|
127
|
-
children: [/* @__PURE__ */
|
|
127
|
+
children: [/* @__PURE__ */ V("p", {
|
|
128
128
|
className: "text-center",
|
|
129
129
|
children: s
|
|
130
|
-
}), e.url != null && /* @__PURE__ */
|
|
130
|
+
}), e.url != null && /* @__PURE__ */ V(E, {
|
|
131
131
|
href: e.url,
|
|
132
132
|
target: "_blank",
|
|
133
133
|
label: c,
|
|
134
|
-
className:
|
|
134
|
+
className: _e.openInNewTabButton,
|
|
135
135
|
textClassName: o
|
|
136
136
|
})]
|
|
137
137
|
});
|
|
138
138
|
let ie = k ? A : e.url, N = k && A == null ? e.srcdoc : void 0;
|
|
139
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ H("div", {
|
|
140
140
|
className: "relative h-full",
|
|
141
|
-
children: [l && /* @__PURE__ */
|
|
141
|
+
children: [l && /* @__PURE__ */ V("div", {
|
|
142
142
|
className: "absolute inset-0 flex items-center justify-center",
|
|
143
|
-
children: /* @__PURE__ */
|
|
144
|
-
}), /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ V(D, {})
|
|
144
|
+
}), /* @__PURE__ */ V("iframe", {
|
|
145
145
|
ref: b,
|
|
146
146
|
title: r,
|
|
147
147
|
src: ie,
|
|
@@ -152,10 +152,10 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
152
152
|
onError: te
|
|
153
153
|
}, w)]
|
|
154
154
|
});
|
|
155
|
-
}),
|
|
155
|
+
}), ye = {
|
|
156
156
|
name: "MCP-UI Host",
|
|
157
157
|
version: "1.0.0"
|
|
158
|
-
},
|
|
158
|
+
}, q = { openLinks: {} }, be = (e) => {
|
|
159
159
|
let t;
|
|
160
160
|
try {
|
|
161
161
|
t = new URL(e);
|
|
@@ -192,13 +192,13 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
192
192
|
height: Math.round(n.height)
|
|
193
193
|
}
|
|
194
194
|
} : r.current.hostContext;
|
|
195
|
-
e = new
|
|
195
|
+
e = new le(null, r.current.hostInfo ?? ye, q, { hostContext: i }), e.onopenlink = async ({ url: e }) => {
|
|
196
196
|
let t = r.current.onOpenLink;
|
|
197
197
|
return (t == null ? be(e) : t(e)) === !1 ? { isError: !0 } : {};
|
|
198
198
|
}, e.onrequestdisplaymode = async ({ mode: e }) => {
|
|
199
199
|
let t = r.current.onRequestDisplayMode, n = r.current.hostContext?.displayMode ?? "inline";
|
|
200
200
|
return { mode: t?.(e) ?? n };
|
|
201
|
-
}, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(
|
|
201
|
+
}, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(U, ({ params: e }) => {
|
|
202
202
|
let n = t.current?.querySelector("iframe");
|
|
203
203
|
n != null && xe(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
|
|
204
204
|
}), a(e);
|
|
@@ -215,12 +215,12 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
215
215
|
hasFailed: o
|
|
216
216
|
};
|
|
217
217
|
}, J = {
|
|
218
|
-
loadingOverlay: "
|
|
219
|
-
fullscreenFrame: "
|
|
220
|
-
loadingFrame: "
|
|
221
|
-
statusLabel: "
|
|
222
|
-
statusDetail: "
|
|
223
|
-
errorIcon: "
|
|
218
|
+
loadingOverlay: "_loadingOverlay_sqrel_2",
|
|
219
|
+
fullscreenFrame: "_fullscreenFrame_sqrel_21",
|
|
220
|
+
loadingFrame: "_loadingFrame_sqrel_29",
|
|
221
|
+
statusLabel: "_statusLabel_sqrel_33",
|
|
222
|
+
statusDetail: "_statusDetail_sqrel_38",
|
|
223
|
+
errorIcon: "_errorIcon_sqrel_42"
|
|
224
224
|
}, Ce = ({ content: e, errorLabel: t = "Failed to load app", onAppInfo: n }) => {
|
|
225
225
|
let [r, i] = B("loading"), [a, o] = B(), { html: s, sandboxUrl: c, toolInput: l, toolResult: u, hostContext: d } = e, f = R(() => ({ url: new URL(c) }), [c]), p = d?.displayMode === "fullscreen", m = z(null), [h, g] = B();
|
|
226
226
|
L(() => {
|
|
@@ -240,11 +240,11 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
240
240
|
...d,
|
|
241
241
|
containerDimensions: h
|
|
242
242
|
}, [d, h])), b = y || r === "error";
|
|
243
|
-
return /* @__PURE__ */
|
|
243
|
+
return /* @__PURE__ */ H("div", {
|
|
244
244
|
ref: m,
|
|
245
245
|
className: _("relative h-full min-h-[200px] w-full", p && J.fullscreenFrame, !p && r === "loading" && J.loadingFrame),
|
|
246
246
|
children: [
|
|
247
|
-
v != null && !b && /* @__PURE__ */
|
|
247
|
+
v != null && !b && /* @__PURE__ */ V(ue, {
|
|
248
248
|
html: s,
|
|
249
249
|
sandbox: f,
|
|
250
250
|
appBridge: v,
|
|
@@ -258,21 +258,21 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
258
258
|
o(e.message), i("error");
|
|
259
259
|
}
|
|
260
260
|
}),
|
|
261
|
-
!b && r === "loading" && /* @__PURE__ */
|
|
261
|
+
!b && r === "loading" && /* @__PURE__ */ V("div", {
|
|
262
262
|
className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", J.loadingOverlay),
|
|
263
|
-
children: /* @__PURE__ */
|
|
263
|
+
children: /* @__PURE__ */ V(D, {})
|
|
264
264
|
}),
|
|
265
|
-
b && /* @__PURE__ */
|
|
265
|
+
b && /* @__PURE__ */ H("div", {
|
|
266
266
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-2 p-4",
|
|
267
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ V(O, {
|
|
268
268
|
size: 60,
|
|
269
269
|
stroke: C,
|
|
270
270
|
"aria-hidden": !0,
|
|
271
271
|
className: J.errorIcon
|
|
272
|
-
}), /* @__PURE__ */
|
|
272
|
+
}), /* @__PURE__ */ H("p", {
|
|
273
273
|
role: "alert",
|
|
274
274
|
className: _("text-center", J.statusLabel),
|
|
275
|
-
children: [t, a && /* @__PURE__ */
|
|
275
|
+
children: [t, a && /* @__PURE__ */ H(ce, { children: [/* @__PURE__ */ V("br", {}), /* @__PURE__ */ V("span", {
|
|
276
276
|
className: J.statusDetail,
|
|
277
277
|
children: a
|
|
278
278
|
})] })]
|
|
@@ -281,13 +281,13 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
281
281
|
]
|
|
282
282
|
});
|
|
283
283
|
}, Y = {
|
|
284
|
-
viewer: "
|
|
285
|
-
spreadsheetCanvas: "
|
|
286
|
-
formulaPanel: "
|
|
287
|
-
formulaValue: "
|
|
288
|
-
statusOverlay: "
|
|
289
|
-
errorIcon: "
|
|
290
|
-
highlight: "
|
|
284
|
+
viewer: "_viewer_sdlt9_2",
|
|
285
|
+
spreadsheetCanvas: "_spreadsheetCanvas_sdlt9_6",
|
|
286
|
+
formulaPanel: "_formulaPanel_sdlt9_12",
|
|
287
|
+
formulaValue: "_formulaValue_sdlt9_18",
|
|
288
|
+
statusOverlay: "_statusOverlay_sdlt9_24",
|
|
289
|
+
errorIcon: "_errorIcon_sdlt9_29",
|
|
290
|
+
highlight: "_highlight_sdlt9_37"
|
|
291
291
|
}, we = (e) => {
|
|
292
292
|
if (e?.kind !== "range") return "";
|
|
293
293
|
let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
|
|
@@ -492,18 +492,18 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
492
492
|
})(), () => {
|
|
493
493
|
r = !0;
|
|
494
494
|
};
|
|
495
|
-
}, [S, u]), /* @__PURE__ */
|
|
495
|
+
}, [S, u]), /* @__PURE__ */ H("div", {
|
|
496
496
|
className: "relative flex h-full w-full min-w-0 flex-col overflow-hidden",
|
|
497
497
|
children: [
|
|
498
|
-
t.format === r.Xlsx && /* @__PURE__ */
|
|
498
|
+
t.format === r.Xlsx && /* @__PURE__ */ H("div", {
|
|
499
499
|
role: "region",
|
|
500
500
|
"aria-label": a,
|
|
501
501
|
className: _("flex min-w-0 shrink-0 items-center gap-2 border-b px-3 py-2", Y.formulaPanel),
|
|
502
|
-
children: [/* @__PURE__ */
|
|
502
|
+
children: [/* @__PURE__ */ V("span", {
|
|
503
503
|
"aria-hidden": "true",
|
|
504
504
|
className: _("shrink-0", o),
|
|
505
505
|
children: "fx"
|
|
506
|
-
}), /* @__PURE__ */
|
|
506
|
+
}), /* @__PURE__ */ V("code", {
|
|
507
507
|
dir: "ltr",
|
|
508
508
|
tabIndex: 0,
|
|
509
509
|
"aria-live": "polite",
|
|
@@ -511,19 +511,19 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
511
511
|
children: m
|
|
512
512
|
})]
|
|
513
513
|
}),
|
|
514
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ H("div", {
|
|
515
515
|
className: "relative min-h-0 w-full flex-1",
|
|
516
|
-
children: [/* @__PURE__ */
|
|
516
|
+
children: [/* @__PURE__ */ V("div", {
|
|
517
517
|
ref: l,
|
|
518
518
|
role: "document",
|
|
519
519
|
"aria-label": n,
|
|
520
520
|
"aria-busy": u,
|
|
521
521
|
className: _("h-full w-full overflow-hidden", Y.viewer)
|
|
522
|
-
}), g.length > 0 && /* @__PURE__ */
|
|
522
|
+
}), g.length > 0 && /* @__PURE__ */ V("div", {
|
|
523
523
|
role: "region",
|
|
524
524
|
"aria-label": s,
|
|
525
525
|
className: "pointer-events-none absolute inset-0 overflow-hidden",
|
|
526
|
-
children: g.map((e, t) => /* @__PURE__ */
|
|
526
|
+
children: g.map((e, t) => /* @__PURE__ */ V("div", {
|
|
527
527
|
"aria-hidden": "true",
|
|
528
528
|
style: {
|
|
529
529
|
left: `${e.left}px`,
|
|
@@ -537,24 +537,24 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
537
537
|
}, `${e.highlightId}-${t}`))
|
|
538
538
|
})]
|
|
539
539
|
}),
|
|
540
|
-
/* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ V("div", {
|
|
541
541
|
role: "status",
|
|
542
542
|
"aria-live": "polite",
|
|
543
543
|
className: "sr-only",
|
|
544
544
|
children: y ? c : ""
|
|
545
545
|
}),
|
|
546
|
-
(u || f) && /* @__PURE__ */
|
|
546
|
+
(u || f) && /* @__PURE__ */ V("div", {
|
|
547
547
|
role: f ? "alert" : void 0,
|
|
548
548
|
"aria-live": "polite",
|
|
549
549
|
className: _("absolute inset-0 flex items-center justify-center", Y.statusOverlay),
|
|
550
|
-
children: u ? /* @__PURE__ */
|
|
550
|
+
children: u ? /* @__PURE__ */ V(D, { size: 48 }) : /* @__PURE__ */ H("div", {
|
|
551
551
|
className: "flex flex-col items-center gap-2",
|
|
552
|
-
children: [/* @__PURE__ */
|
|
552
|
+
children: [/* @__PURE__ */ V(O, {
|
|
553
553
|
"aria-hidden": "true",
|
|
554
554
|
size: 60,
|
|
555
555
|
stroke: C,
|
|
556
556
|
className: Y.errorIcon
|
|
557
|
-
}), /* @__PURE__ */
|
|
557
|
+
}), /* @__PURE__ */ V("p", {
|
|
558
558
|
className: "text-center",
|
|
559
559
|
children: i
|
|
560
560
|
})]
|
|
@@ -595,19 +595,19 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
595
595
|
let e = s.current;
|
|
596
596
|
if (!e) return;
|
|
597
597
|
l("loading");
|
|
598
|
-
let t = new
|
|
598
|
+
let t = new G(e, {
|
|
599
599
|
domain: u,
|
|
600
600
|
hostDomain: window.location.origin,
|
|
601
601
|
visualizerName: d,
|
|
602
602
|
requestTimeout: f
|
|
603
|
-
}), n = !0, r = t.subscribe(`${d}/${
|
|
603
|
+
}), n = !0, r = t.subscribe(`${d}/${W.sendMessage}`, (e) => {
|
|
604
604
|
let t = Ne(e);
|
|
605
605
|
t != null && h.current?.(t);
|
|
606
606
|
});
|
|
607
607
|
return (async () => {
|
|
608
608
|
if (await t.ready(), !n) return;
|
|
609
609
|
let e = p.current;
|
|
610
|
-
if (e.type === i.GroupedVisualizer) await t.send(
|
|
610
|
+
if (e.type === i.GroupedVisualizer) await t.send(de.sendGroupedVisualizeData, {
|
|
611
611
|
attachments: e.attachments,
|
|
612
612
|
layout: e.layout
|
|
613
613
|
});
|
|
@@ -616,7 +616,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
616
616
|
layout: r,
|
|
617
617
|
...typeof i == "object" && i ? i : {}
|
|
618
618
|
};
|
|
619
|
-
await t.send(
|
|
619
|
+
await t.send(de.sendVisualizeData, {
|
|
620
620
|
mimeType: n,
|
|
621
621
|
visualizerData: a
|
|
622
622
|
});
|
|
@@ -639,7 +639,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
639
639
|
d,
|
|
640
640
|
u,
|
|
641
641
|
f
|
|
642
|
-
]), /* @__PURE__ */
|
|
642
|
+
]), /* @__PURE__ */ H("div", {
|
|
643
643
|
className: "relative h-full w-full",
|
|
644
644
|
style: m({
|
|
645
645
|
"--vs-loading-bg": a?.loadingBackground,
|
|
@@ -647,25 +647,25 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
647
647
|
"--vs-error-icon": a?.errorIcon
|
|
648
648
|
}),
|
|
649
649
|
children: [
|
|
650
|
-
/* @__PURE__ */
|
|
650
|
+
/* @__PURE__ */ V("div", {
|
|
651
651
|
ref: s,
|
|
652
652
|
className: "h-full w-full"
|
|
653
653
|
}),
|
|
654
|
-
c === "loading" && /* @__PURE__ */
|
|
654
|
+
c === "loading" && /* @__PURE__ */ H("div", {
|
|
655
655
|
className: _("absolute inset-0 flex flex-col items-center justify-center gap-2", Pe.loadingOverlay),
|
|
656
|
-
children: [/* @__PURE__ */
|
|
656
|
+
children: [/* @__PURE__ */ V(D, {}), t && /* @__PURE__ */ V("p", {
|
|
657
657
|
className: _("text-center", Pe.statusLabel),
|
|
658
658
|
children: t
|
|
659
659
|
})]
|
|
660
660
|
}),
|
|
661
|
-
c === "error" && /* @__PURE__ */
|
|
661
|
+
c === "error" && /* @__PURE__ */ H("div", {
|
|
662
662
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
663
|
-
children: [/* @__PURE__ */
|
|
663
|
+
children: [/* @__PURE__ */ V(O, {
|
|
664
664
|
size: 60,
|
|
665
665
|
stroke: C,
|
|
666
666
|
"aria-hidden": !0,
|
|
667
667
|
className: Pe.errorIcon
|
|
668
|
-
}), /* @__PURE__ */
|
|
668
|
+
}), /* @__PURE__ */ V("p", {
|
|
669
669
|
role: "alert",
|
|
670
670
|
className: _("text-center", Pe.statusLabel),
|
|
671
671
|
children: n
|
|
@@ -692,17 +692,17 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
692
692
|
let [r, i] = B(!1);
|
|
693
693
|
return L(() => {
|
|
694
694
|
i(!1);
|
|
695
|
-
}, [e]), r ? /* @__PURE__ */
|
|
695
|
+
}, [e]), r ? /* @__PURE__ */ H("div", {
|
|
696
696
|
className: "flex flex-col items-center gap-2",
|
|
697
|
-
children: [/* @__PURE__ */
|
|
697
|
+
children: [/* @__PURE__ */ V(O, {
|
|
698
698
|
size: 60,
|
|
699
699
|
stroke: C,
|
|
700
700
|
className: X.errorIcon
|
|
701
|
-
}), /* @__PURE__ */
|
|
701
|
+
}), /* @__PURE__ */ V("p", {
|
|
702
702
|
className: _("text-center", X.statusLabel),
|
|
703
703
|
children: n
|
|
704
704
|
})]
|
|
705
|
-
}) : /* @__PURE__ */
|
|
705
|
+
}) : /* @__PURE__ */ V("img", {
|
|
706
706
|
src: e,
|
|
707
707
|
alt: t ?? "",
|
|
708
708
|
className: "max-h-full max-w-full object-contain",
|
|
@@ -712,10 +712,10 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
712
712
|
i.PlainText,
|
|
713
713
|
i.Code,
|
|
714
714
|
i.Ooxml
|
|
715
|
-
]), ze = F(({ 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: g, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: S, pdfContentRetryLabel: w, xlsxFormulaLabel: T = "Formula", codeContentLoadingLabel: E, codeContentErrorLabel: k, codeContentRetryLabel: A, tableCopyLabel: j, tableCopiedLabel: ee, tableDownloadCsvLabel: te,
|
|
716
|
-
let { colors: G, typography: K, bodyClassName:
|
|
717
|
-
|
|
718
|
-
}, []), q = K?.fontClassName != null,
|
|
715
|
+
]), ze = F(({ 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: g, pdfShowThumbnailsLabel: v, pdfHideThumbnailsLabel: y, pdfPageNumberLabel: b, pdfContentLoadingLabel: x, pdfContentErrorLabel: S, pdfContentRetryLabel: w, xlsxFormulaLabel: T = "Formula", codeContentLoadingLabel: E, codeContentErrorLabel: k, codeContentRetryLabel: A, tableCopyLabel: j, tableCopiedLabel: ee, tableDownloadCsvLabel: te, codeBlockCopyLabel: M, codeBlockCopiedLabel: re, codeBlockDownloadLabel: ie, tableScrollRegionAriaLabel: N, mathScrollRegionAriaLabel: P, ooxmlHighlightsLabel: F, ooxmlHighlightNavigatedLabel: ae } = {}, styles: L, codeBlockTheme: z, tableDownloadFilename: ce, loadPdf: le, hidePdfToolbar: ue = !1, configurePdfWorker: U, onAppInfo: W, onVisualizerSendMessage: de }) => {
|
|
716
|
+
let { colors: G, typography: K, bodyClassName: fe, cssVars: pe } = L ?? {}, [me, ge] = B(0), _e = R(Ie, [me]), ye = I(() => {
|
|
717
|
+
ge((e) => e + 1);
|
|
718
|
+
}, []), q = K?.fontClassName != null, be = R(() => ({
|
|
719
719
|
...m({
|
|
720
720
|
"--ac-text": G?.text,
|
|
721
721
|
"--ac-status-text": G?.statusText,
|
|
@@ -746,8 +746,8 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
746
746
|
"--ac-line-height": q ? void 0 : K?.lineHeight,
|
|
747
747
|
"--ac-letter-spacing": q ? void 0 : K?.letterSpacing
|
|
748
748
|
}),
|
|
749
|
-
...
|
|
750
|
-
}), [
|
|
749
|
+
...pe
|
|
750
|
+
}), [L]), xe = R(() => {
|
|
751
751
|
switch (e.type) {
|
|
752
752
|
case i.Image:
|
|
753
753
|
case i.Audio:
|
|
@@ -765,39 +765,49 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
765
765
|
case i.MarkdownTable: return "flex h-full min-h-0 flex-col overflow-hidden p-4";
|
|
766
766
|
default: return "h-full overflow-auto p-4";
|
|
767
767
|
}
|
|
768
|
-
}, [e.type]),
|
|
768
|
+
}, [e.type]), Se = R(() => {
|
|
769
769
|
switch (e.type) {
|
|
770
|
-
case i.PlainText: return /* @__PURE__ */
|
|
770
|
+
case i.PlainText: return /* @__PURE__ */ V("pre", {
|
|
771
771
|
className: _("whitespace-pre-wrap break-words", X.body, K?.fontClassName),
|
|
772
772
|
children: e.text
|
|
773
773
|
});
|
|
774
|
-
case i.Image: return /* @__PURE__ */
|
|
774
|
+
case i.Image: return /* @__PURE__ */ V(Le, {
|
|
775
775
|
url: e.url,
|
|
776
776
|
fileName: r,
|
|
777
777
|
loadErrorLabel: c
|
|
778
778
|
});
|
|
779
|
-
case i.Audio: return /* @__PURE__ */
|
|
779
|
+
case i.Audio: return /* @__PURE__ */ V("audio", {
|
|
780
780
|
controls: !0,
|
|
781
781
|
controlsList: "nodownload",
|
|
782
782
|
src: e.url,
|
|
783
783
|
"aria-label": r ?? "Audio attachment",
|
|
784
784
|
className: "w-full max-w-sm",
|
|
785
785
|
preload: "metadata",
|
|
786
|
-
children: e.mimeType && /* @__PURE__ */
|
|
786
|
+
children: e.mimeType && /* @__PURE__ */ V("source", {
|
|
787
787
|
src: e.url,
|
|
788
788
|
type: e.mimeType
|
|
789
789
|
})
|
|
790
790
|
});
|
|
791
|
-
case i.Markdown: return /* @__PURE__ */
|
|
791
|
+
case i.Markdown: return /* @__PURE__ */ V(p, {
|
|
792
792
|
content: e.text,
|
|
793
793
|
isStreaming: !1,
|
|
794
|
-
codeBlockTheme:
|
|
794
|
+
codeBlockTheme: z,
|
|
795
|
+
codeBlockCopyLabel: M,
|
|
796
|
+
codeBlockCopiedLabel: re,
|
|
797
|
+
codeBlockDownloadLabel: ie,
|
|
798
|
+
tableScrollRegionAriaLabel: N,
|
|
799
|
+
mathScrollRegionAriaLabel: P,
|
|
795
800
|
classNames: u
|
|
796
801
|
});
|
|
797
|
-
case i.MarkdownTable: return /* @__PURE__ */
|
|
802
|
+
case i.MarkdownTable: return /* @__PURE__ */ V(p, {
|
|
798
803
|
content: e.text,
|
|
799
804
|
isStreaming: !1,
|
|
800
|
-
codeBlockTheme:
|
|
805
|
+
codeBlockTheme: z,
|
|
806
|
+
codeBlockCopyLabel: M,
|
|
807
|
+
codeBlockCopiedLabel: re,
|
|
808
|
+
codeBlockDownloadLabel: ie,
|
|
809
|
+
tableScrollRegionAriaLabel: N,
|
|
810
|
+
mathScrollRegionAriaLabel: P,
|
|
801
811
|
containerClassName: "flex h-full min-h-0 flex-col",
|
|
802
812
|
classNames: {
|
|
803
813
|
...u,
|
|
@@ -809,18 +819,18 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
809
819
|
copiedLabel: ee,
|
|
810
820
|
downloadCsvLabel: te
|
|
811
821
|
},
|
|
812
|
-
tableDownloadFilename:
|
|
822
|
+
tableDownloadFilename: ce
|
|
813
823
|
});
|
|
814
|
-
case i.Json: return /* @__PURE__ */
|
|
824
|
+
case i.Json: return /* @__PURE__ */ V("div", {
|
|
815
825
|
dir: "ltr",
|
|
816
826
|
className: "h-full overflow-auto",
|
|
817
|
-
children: /* @__PURE__ */
|
|
827
|
+
children: /* @__PURE__ */ V("div", {
|
|
818
828
|
className: _("m-3 overflow-auto rounded-md border", X.jsonWrapper),
|
|
819
|
-
children: /* @__PURE__ */
|
|
829
|
+
children: /* @__PURE__ */ V(oe, {
|
|
820
830
|
data: e.value,
|
|
821
831
|
style: {
|
|
822
832
|
container: _("whitespace-pre-wrap break-words p-2", K?.jsonClassName ?? "dial-code-text"),
|
|
823
|
-
basicChildStyle:
|
|
833
|
+
basicChildStyle: se.basicChildStyle,
|
|
824
834
|
childFieldsContainer: "m-0 ps-3",
|
|
825
835
|
label: _("me-1 font-semibold", X.jsonLabel),
|
|
826
836
|
clickableLabel: _("me-1 cursor-pointer font-semibold hover:underline", X.jsonClickableLabel),
|
|
@@ -838,16 +848,16 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
838
848
|
})
|
|
839
849
|
})
|
|
840
850
|
});
|
|
841
|
-
case i.Code: return /* @__PURE__ */
|
|
851
|
+
case i.Code: return /* @__PURE__ */ V(he, {
|
|
842
852
|
content: e,
|
|
843
|
-
codeBlockTheme:
|
|
853
|
+
codeBlockTheme: z,
|
|
844
854
|
labels: {
|
|
845
855
|
loadingLabel: E,
|
|
846
856
|
errorLabel: k,
|
|
847
857
|
retryLabel: A
|
|
848
858
|
}
|
|
849
859
|
});
|
|
850
|
-
case i.Html: return /* @__PURE__ */
|
|
860
|
+
case i.Html: return /* @__PURE__ */ V(ve, {
|
|
851
861
|
content: e,
|
|
852
862
|
labels: {
|
|
853
863
|
htmlFrameBlockedLabel: f,
|
|
@@ -855,25 +865,25 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
855
865
|
},
|
|
856
866
|
isSourceView: a,
|
|
857
867
|
title: r,
|
|
858
|
-
codeBlockTheme:
|
|
868
|
+
codeBlockTheme: z
|
|
859
869
|
});
|
|
860
|
-
case i.Pdf: return /* @__PURE__ */
|
|
861
|
-
retryKey:
|
|
862
|
-
onRetry:
|
|
870
|
+
case i.Pdf: return /* @__PURE__ */ V(s, {
|
|
871
|
+
retryKey: me,
|
|
872
|
+
onRetry: ye,
|
|
863
873
|
labels: {
|
|
864
874
|
loadingLabel: x,
|
|
865
875
|
errorLabel: S,
|
|
866
876
|
retryLabel: w
|
|
867
877
|
},
|
|
868
|
-
children: /* @__PURE__ */
|
|
878
|
+
children: /* @__PURE__ */ V(_e, {
|
|
869
879
|
fileName: r,
|
|
870
880
|
url: e.url,
|
|
871
881
|
highlights: e.highlights ?? [],
|
|
872
882
|
selectedHighlightId: e.selectedHighlightId,
|
|
873
883
|
selectedPageNumber: e.page,
|
|
874
|
-
loadPdf:
|
|
875
|
-
hideHeader:
|
|
876
|
-
configurePdfWorker:
|
|
884
|
+
loadPdf: le,
|
|
885
|
+
hideHeader: ue,
|
|
886
|
+
configurePdfWorker: U,
|
|
877
887
|
labels: {
|
|
878
888
|
thumbnailsLabel: g,
|
|
879
889
|
showThumbnailsLabel: v,
|
|
@@ -885,38 +895,38 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
885
895
|
}
|
|
886
896
|
})
|
|
887
897
|
}, e.url);
|
|
888
|
-
case i.Ooxml: return /* @__PURE__ */
|
|
898
|
+
case i.Ooxml: return /* @__PURE__ */ V(Oe, {
|
|
889
899
|
content: e,
|
|
890
900
|
fileName: r,
|
|
891
901
|
loadErrorLabel: c,
|
|
892
902
|
formulaLabel: T,
|
|
893
903
|
formulaLabelClassName: K?.xlsxFormulaLabelClassName ?? "dial-italic-text",
|
|
894
|
-
highlightsLabel:
|
|
895
|
-
highlightNavigatedLabel:
|
|
904
|
+
highlightsLabel: F,
|
|
905
|
+
highlightNavigatedLabel: ae
|
|
896
906
|
});
|
|
897
907
|
case i.Visualizer:
|
|
898
|
-
case i.GroupedVisualizer: return /* @__PURE__ */
|
|
908
|
+
case i.GroupedVisualizer: return /* @__PURE__ */ V(Fe, {
|
|
899
909
|
content: e,
|
|
900
910
|
errorLabel: d,
|
|
901
|
-
onSendMessage:
|
|
911
|
+
onSendMessage: de
|
|
902
912
|
});
|
|
903
|
-
case i.McpApp: return /* @__PURE__ */
|
|
913
|
+
case i.McpApp: return /* @__PURE__ */ V(Ce, {
|
|
904
914
|
content: e,
|
|
905
|
-
onAppInfo:
|
|
915
|
+
onAppInfo: W
|
|
906
916
|
});
|
|
907
|
-
case i.Unsupported: return /* @__PURE__ */
|
|
917
|
+
case i.Unsupported: return /* @__PURE__ */ V("p", {
|
|
908
918
|
className: _("text-center", X.statusLabel),
|
|
909
919
|
children: o
|
|
910
920
|
});
|
|
911
921
|
case i.Error: {
|
|
912
922
|
let t = e.errorType === n.Forbidden;
|
|
913
|
-
return /* @__PURE__ */
|
|
923
|
+
return /* @__PURE__ */ H("div", {
|
|
914
924
|
className: "flex flex-col items-center gap-2",
|
|
915
|
-
children: [
|
|
925
|
+
children: [V(t ? ne : O, {
|
|
916
926
|
size: 60,
|
|
917
927
|
stroke: C,
|
|
918
928
|
className: X.errorIcon
|
|
919
|
-
}), /* @__PURE__ */
|
|
929
|
+
}), /* @__PURE__ */ V("p", {
|
|
920
930
|
className: _("text-center", X.statusLabel),
|
|
921
931
|
children: t ? l : c
|
|
922
932
|
})]
|
|
@@ -929,20 +939,20 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
929
939
|
K?.jsonClassName,
|
|
930
940
|
K?.xlsxFormulaLabelClassName,
|
|
931
941
|
r,
|
|
932
|
-
|
|
942
|
+
z,
|
|
933
943
|
o,
|
|
934
944
|
c,
|
|
935
945
|
l,
|
|
936
946
|
d,
|
|
937
|
-
|
|
947
|
+
de,
|
|
938
948
|
f,
|
|
939
949
|
h,
|
|
940
950
|
a,
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
951
|
+
ce,
|
|
952
|
+
le,
|
|
953
|
+
ue,
|
|
954
|
+
U,
|
|
955
|
+
W,
|
|
946
956
|
g,
|
|
947
957
|
v,
|
|
948
958
|
y,
|
|
@@ -954,83 +964,88 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
954
964
|
E,
|
|
955
965
|
k,
|
|
956
966
|
A,
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
967
|
+
_e,
|
|
968
|
+
me,
|
|
969
|
+
ye,
|
|
960
970
|
j,
|
|
961
971
|
ee,
|
|
962
972
|
te,
|
|
963
973
|
M,
|
|
964
|
-
re
|
|
974
|
+
re,
|
|
975
|
+
ie,
|
|
976
|
+
N,
|
|
977
|
+
P,
|
|
978
|
+
F,
|
|
979
|
+
ae
|
|
965
980
|
]);
|
|
966
|
-
return /* @__PURE__ */
|
|
967
|
-
style: !t && Re.has(e.type) ?
|
|
968
|
-
className: _(t ? "flex h-full items-center justify-center" :
|
|
969
|
-
children: t ? /* @__PURE__ */
|
|
981
|
+
return /* @__PURE__ */ V("div", {
|
|
982
|
+
style: !t && Re.has(e.type) ? be : void 0,
|
|
983
|
+
className: _(t ? "flex h-full items-center justify-center" : xe, fe),
|
|
984
|
+
children: t ? /* @__PURE__ */ V(D, {}) : Se
|
|
970
985
|
});
|
|
971
986
|
}), Be = {
|
|
972
987
|
mcpAppDivider: "_mcpAppDivider_1jh5p_1",
|
|
973
988
|
mcpAppVersion: "_mcpAppVersion_1jh5p_5"
|
|
974
|
-
}, Ve = 2e3, He = F(({ 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: g = "Copied!", copyJsonLabel: v = "Copy as JSON", copiedJsonLabel: y = "Copied!", visualizerErrorLabel: w, 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: k = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: ne = "Open in new tab", htmlViewSourceLabel: N = "View source", htmlViewRenderedLabel: P = "View rendered", mcpAppReloadLabel: F = "Reload", pdfThumbnailsLabel: ae, pdfShowThumbnailsLabel: oe, pdfHideThumbnailsLabel:
|
|
975
|
-
let [
|
|
976
|
-
|
|
977
|
-
}, [
|
|
978
|
-
|
|
979
|
-
}, [
|
|
980
|
-
|
|
981
|
-
}, [
|
|
989
|
+
}, Ve = 2e3, He = F(({ 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: g = "Copied!", copyJsonLabel: v = "Copy as JSON", copiedJsonLabel: y = "Copied!", visualizerErrorLabel: w, 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: k = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: ne = "Open in new tab", htmlViewSourceLabel: N = "View source", htmlViewRenderedLabel: P = "View rendered", mcpAppReloadLabel: F = "Reload", pdfThumbnailsLabel: ae, pdfShowThumbnailsLabel: oe, pdfHideThumbnailsLabel: se, pdfPageNumberLabel: le, pdfContentLoadingLabel: ue, pdfContentErrorLabel: U, pdfContentRetryLabel: W, xlsxFormulaLabel: de, codeContentLoadingLabel: G, codeContentErrorLabel: fe, codeContentRetryLabel: pe, tableCopyLabel: me, tableCopiedLabel: he, tableDownloadCsvLabel: ge, codeBlockCopyLabel: _e, codeBlockCopiedLabel: ve, codeBlockDownloadLabel: ye, tableScrollRegionAriaLabel: q, mathScrollRegionAriaLabel: be, ooxmlHighlightsLabel: xe, ooxmlHighlightNavigatedLabel: Se }, onDownload: J, onCopyText: Ce, onCopyMarkdown: Y, onCopyJson: we, tableDownloadFilename: Te, isMobile: Ee = !1, defaultWidth: De, minWidth: Oe = 600, maxWidth: ke = 1500, onResizeStop: Ae, styles: je, codeBlockTheme: Me, loadPdf: Ne, configurePdfWorker: Pe, onVisualizerSendMessage: Fe }) => {
|
|
990
|
+
let [X, Ie] = B(!1), [Le, Re] = B(!1), [He, Ue] = B(!1), [Z, We] = B(!1), [Ge, Ke] = B(void 0), qe = z(null), Q = z(null), Je = z(null), Ye = I(() => {
|
|
991
|
+
Ce?.(), qe.current != null && clearTimeout(qe.current), Ie(!0), qe.current = setTimeout(() => Ie(!1), Ve);
|
|
992
|
+
}, [Ce]), Xe = I(() => {
|
|
993
|
+
Y?.(), Q.current != null && clearTimeout(Q.current), Re(!0), Q.current = setTimeout(() => Re(!1), Ve);
|
|
994
|
+
}, [Y]), Ze = I(() => {
|
|
995
|
+
we?.(), Je.current != null && clearTimeout(Je.current), Ue(!0), Je.current = setTimeout(() => Ue(!1), Ve);
|
|
996
|
+
}, [we]);
|
|
982
997
|
L(() => () => {
|
|
983
|
-
|
|
998
|
+
qe.current != null && clearTimeout(qe.current), Q.current != null && clearTimeout(Q.current), Je.current != null && clearTimeout(Je.current);
|
|
984
999
|
}, []);
|
|
985
|
-
let
|
|
986
|
-
|
|
1000
|
+
let Qe = I(() => {
|
|
1001
|
+
We((e) => !e);
|
|
987
1002
|
}, []);
|
|
988
1003
|
L(() => {
|
|
989
|
-
|
|
1004
|
+
We(!1), Ke(void 0);
|
|
990
1005
|
}, [r]);
|
|
991
|
-
let { className:
|
|
992
|
-
"--ac-mcp-app-divider":
|
|
993
|
-
"--ac-mcp-app-version":
|
|
994
|
-
}), [
|
|
995
|
-
style:
|
|
1006
|
+
let { className: $e, panelStyles: $, ...et } = je ?? {}, { colors: tt, typography: nt } = et, rt = R(() => m({
|
|
1007
|
+
"--ac-mcp-app-divider": tt?.mcpAppDividerColor,
|
|
1008
|
+
"--ac-mcp-app-version": tt?.mcpAppVersionColor
|
|
1009
|
+
}), [tt?.mcpAppDividerColor, tt?.mcpAppVersionColor]), it = r.type === i.McpApp && Ge != null ? /* @__PURE__ */ H("span", {
|
|
1010
|
+
style: rt,
|
|
996
1011
|
children: [
|
|
997
|
-
/* @__PURE__ */
|
|
998
|
-
/* @__PURE__ */
|
|
1012
|
+
/* @__PURE__ */ V("span", { children: a }),
|
|
1013
|
+
/* @__PURE__ */ V("span", {
|
|
999
1014
|
"aria-hidden": !0,
|
|
1000
1015
|
className: _("mx-1.5 inline-block h-3 w-0 border-s align-middle", Be.mcpAppDivider)
|
|
1001
1016
|
}),
|
|
1002
|
-
/* @__PURE__ */
|
|
1003
|
-
|
|
1004
|
-
className: _("ms-2",
|
|
1005
|
-
children:
|
|
1017
|
+
/* @__PURE__ */ V("span", { children: Ge.name }),
|
|
1018
|
+
Ge.version && /* @__PURE__ */ V("span", {
|
|
1019
|
+
className: _("ms-2", nt?.mcpAppVersionClassName ?? "dial-caption-text", Be.mcpAppVersion),
|
|
1020
|
+
children: Ge.version
|
|
1006
1021
|
})
|
|
1007
1022
|
]
|
|
1008
|
-
}) : a,
|
|
1009
|
-
return /* @__PURE__ */
|
|
1023
|
+
}) : a, at = !t && r.type === i.Html && (r.srcdoc != null || r.resolveSourceText != null), ot = !t && Ce != null && (r.type === i.PlainText || r.type === i.Code), st = !t && Y != null && r.type === i.Markdown, ct = !t && we != null && r.type === i.Json, lt = !t && J != null && o(r), ut = !t && r.type === i.McpApp && r.onReload != null;
|
|
1024
|
+
return /* @__PURE__ */ V(x, {
|
|
1010
1025
|
isOpen: e,
|
|
1011
1026
|
orientation: b.Right,
|
|
1012
|
-
title:
|
|
1027
|
+
title: it,
|
|
1013
1028
|
labels: {
|
|
1014
1029
|
ariaLabel: c,
|
|
1015
1030
|
closeLabel: l,
|
|
1016
1031
|
resizeLabel: u
|
|
1017
1032
|
},
|
|
1018
1033
|
onClose: n,
|
|
1019
|
-
resizable: !
|
|
1020
|
-
defaultWidth:
|
|
1021
|
-
minWidth:
|
|
1022
|
-
maxWidth:
|
|
1023
|
-
onResizeStop:
|
|
1034
|
+
resizable: !Ee,
|
|
1035
|
+
defaultWidth: De,
|
|
1036
|
+
minWidth: Oe,
|
|
1037
|
+
maxWidth: ke,
|
|
1038
|
+
onResizeStop: Ae,
|
|
1024
1039
|
styles: {
|
|
1025
|
-
|
|
1026
|
-
titleClassName:
|
|
1027
|
-
headerClassName: _("border-b border-tertiary",
|
|
1028
|
-
className: _(e ? "mobile:w-full mobile:max-w-full" : "w-0",
|
|
1040
|
+
...$,
|
|
1041
|
+
titleClassName: $?.titleClassName ?? "dial-h3-text",
|
|
1042
|
+
headerClassName: _("border-b border-tertiary", $?.headerClassName),
|
|
1043
|
+
className: _(e ? "mobile:w-full mobile:max-w-full" : "w-0", $e, $?.className, K.panel)
|
|
1029
1044
|
},
|
|
1030
1045
|
leftActions: s,
|
|
1031
|
-
rightActions:
|
|
1032
|
-
|
|
1033
|
-
icon: /* @__PURE__ */
|
|
1046
|
+
rightActions: at || ot || st || ct || lt || ut ? /* @__PURE__ */ H(ce, { children: [
|
|
1047
|
+
ut && /* @__PURE__ */ V(T, {
|
|
1048
|
+
icon: /* @__PURE__ */ V(ie, {
|
|
1034
1049
|
size: S.LG,
|
|
1035
1050
|
stroke: C,
|
|
1036
1051
|
"aria-hidden": !0
|
|
@@ -1039,63 +1054,63 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
1039
1054
|
tooltipProps: { tooltip: F },
|
|
1040
1055
|
onClick: r.type === i.McpApp ? r.onReload : void 0
|
|
1041
1056
|
}),
|
|
1042
|
-
|
|
1043
|
-
icon:
|
|
1057
|
+
at && /* @__PURE__ */ V(T, {
|
|
1058
|
+
icon: V(Z ? M : j, {
|
|
1044
1059
|
size: S.LG,
|
|
1045
1060
|
stroke: C,
|
|
1046
1061
|
"aria-hidden": !0
|
|
1047
1062
|
}),
|
|
1048
|
-
"aria-label":
|
|
1049
|
-
"aria-pressed":
|
|
1050
|
-
tooltipProps: { tooltip:
|
|
1051
|
-
onClick:
|
|
1063
|
+
"aria-label": Z ? P : N,
|
|
1064
|
+
"aria-pressed": Z,
|
|
1065
|
+
tooltipProps: { tooltip: Z ? P : N },
|
|
1066
|
+
onClick: Qe
|
|
1052
1067
|
}),
|
|
1053
|
-
|
|
1054
|
-
icon:
|
|
1068
|
+
ot && /* @__PURE__ */ V(T, {
|
|
1069
|
+
icon: V(X ? A : ee, {
|
|
1055
1070
|
size: S.LG,
|
|
1056
1071
|
stroke: C,
|
|
1057
1072
|
"aria-hidden": !0
|
|
1058
1073
|
}),
|
|
1059
|
-
"aria-label":
|
|
1060
|
-
tooltipProps: { tooltip:
|
|
1061
|
-
onClick:
|
|
1074
|
+
"aria-label": X ? p : f,
|
|
1075
|
+
tooltipProps: { tooltip: X ? p : f },
|
|
1076
|
+
onClick: Ye
|
|
1062
1077
|
}),
|
|
1063
|
-
|
|
1064
|
-
icon:
|
|
1078
|
+
st && /* @__PURE__ */ V(T, {
|
|
1079
|
+
icon: V(Le ? A : re, {
|
|
1065
1080
|
size: S.LG,
|
|
1066
1081
|
stroke: C,
|
|
1067
1082
|
"aria-hidden": !0
|
|
1068
1083
|
}),
|
|
1069
|
-
"aria-label":
|
|
1070
|
-
tooltipProps: { tooltip:
|
|
1071
|
-
onClick:
|
|
1084
|
+
"aria-label": Le ? g : h,
|
|
1085
|
+
tooltipProps: { tooltip: Le ? g : h },
|
|
1086
|
+
onClick: Xe
|
|
1072
1087
|
}),
|
|
1073
|
-
|
|
1074
|
-
icon:
|
|
1088
|
+
ct && /* @__PURE__ */ V(T, {
|
|
1089
|
+
icon: V(He ? A : ee, {
|
|
1075
1090
|
size: S.LG,
|
|
1076
1091
|
stroke: C,
|
|
1077
1092
|
"aria-hidden": !0
|
|
1078
1093
|
}),
|
|
1079
|
-
"aria-label":
|
|
1080
|
-
tooltipProps: { tooltip:
|
|
1081
|
-
onClick:
|
|
1094
|
+
"aria-label": He ? y : v,
|
|
1095
|
+
tooltipProps: { tooltip: He ? y : v },
|
|
1096
|
+
onClick: Ze
|
|
1082
1097
|
}),
|
|
1083
|
-
|
|
1084
|
-
icon: /* @__PURE__ */
|
|
1098
|
+
lt && /* @__PURE__ */ V(T, {
|
|
1099
|
+
icon: /* @__PURE__ */ V(te, {
|
|
1085
1100
|
size: S.LG,
|
|
1086
1101
|
stroke: C
|
|
1087
1102
|
}),
|
|
1088
1103
|
"aria-label": d,
|
|
1089
1104
|
tooltipProps: { tooltip: d },
|
|
1090
|
-
onClick:
|
|
1105
|
+
onClick: J
|
|
1091
1106
|
})
|
|
1092
1107
|
] }) : null,
|
|
1093
|
-
children: /* @__PURE__ */
|
|
1108
|
+
children: /* @__PURE__ */ V(ze, {
|
|
1094
1109
|
content: r,
|
|
1095
1110
|
isLoading: t,
|
|
1096
1111
|
fileName: a,
|
|
1097
|
-
isHtmlSourceView:
|
|
1098
|
-
onAppInfo: r.type === i.McpApp ?
|
|
1112
|
+
isHtmlSourceView: Z,
|
|
1113
|
+
onAppInfo: r.type === i.McpApp ? Ke : void 0,
|
|
1099
1114
|
labels: {
|
|
1100
1115
|
unsupportedLabel: E,
|
|
1101
1116
|
loadErrorLabel: D,
|
|
@@ -1105,27 +1120,32 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
1105
1120
|
htmlOpenInNewTabLabel: ne,
|
|
1106
1121
|
pdfThumbnailsLabel: ae,
|
|
1107
1122
|
pdfShowThumbnailsLabel: oe,
|
|
1108
|
-
pdfHideThumbnailsLabel:
|
|
1109
|
-
pdfPageNumberLabel:
|
|
1110
|
-
pdfContentLoadingLabel:
|
|
1111
|
-
pdfContentErrorLabel:
|
|
1112
|
-
pdfContentRetryLabel:
|
|
1113
|
-
xlsxFormulaLabel:
|
|
1114
|
-
codeContentLoadingLabel:
|
|
1123
|
+
pdfHideThumbnailsLabel: se,
|
|
1124
|
+
pdfPageNumberLabel: le,
|
|
1125
|
+
pdfContentLoadingLabel: ue,
|
|
1126
|
+
pdfContentErrorLabel: U,
|
|
1127
|
+
pdfContentRetryLabel: W,
|
|
1128
|
+
xlsxFormulaLabel: de,
|
|
1129
|
+
codeContentLoadingLabel: G,
|
|
1115
1130
|
codeContentErrorLabel: fe,
|
|
1116
|
-
codeContentRetryLabel:
|
|
1117
|
-
tableCopyLabel:
|
|
1118
|
-
tableCopiedLabel:
|
|
1119
|
-
tableDownloadCsvLabel:
|
|
1120
|
-
|
|
1121
|
-
|
|
1131
|
+
codeContentRetryLabel: pe,
|
|
1132
|
+
tableCopyLabel: me,
|
|
1133
|
+
tableCopiedLabel: he,
|
|
1134
|
+
tableDownloadCsvLabel: ge,
|
|
1135
|
+
codeBlockCopyLabel: _e,
|
|
1136
|
+
codeBlockCopiedLabel: ve,
|
|
1137
|
+
codeBlockDownloadLabel: ye,
|
|
1138
|
+
tableScrollRegionAriaLabel: q,
|
|
1139
|
+
mathScrollRegionAriaLabel: be,
|
|
1140
|
+
ooxmlHighlightsLabel: xe,
|
|
1141
|
+
ooxmlHighlightNavigatedLabel: Se
|
|
1122
1142
|
},
|
|
1123
|
-
styles:
|
|
1124
|
-
codeBlockTheme:
|
|
1125
|
-
tableDownloadFilename:
|
|
1126
|
-
loadPdf:
|
|
1127
|
-
configurePdfWorker:
|
|
1128
|
-
onVisualizerSendMessage:
|
|
1143
|
+
styles: et,
|
|
1144
|
+
codeBlockTheme: Me,
|
|
1145
|
+
tableDownloadFilename: Te,
|
|
1146
|
+
loadPdf: Ne,
|
|
1147
|
+
configurePdfWorker: Pe,
|
|
1148
|
+
onVisualizerSendMessage: Fe
|
|
1129
1149
|
})
|
|
1130
1150
|
});
|
|
1131
1151
|
}), Ue = new Set(["html", "htm"]), Z = {
|
|
@@ -1147,7 +1167,7 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
1147
1167
|
[r.Xlsx]: Z.xlsx,
|
|
1148
1168
|
[r.Pptx]: Z.pptx,
|
|
1149
1169
|
[r.Csv]: f.CSV
|
|
1150
|
-
},
|
|
1170
|
+
}, Q = (e, t) => {
|
|
1151
1171
|
let n = t?.split(";", 1)[0].trim().toLowerCase();
|
|
1152
1172
|
if (n != null) {
|
|
1153
1173
|
let e = Ke[n];
|
|
@@ -1155,13 +1175,13 @@ var de = { panel: "dial-attachment-canvas-panel" }, fe = {
|
|
|
1155
1175
|
}
|
|
1156
1176
|
let r = e.lastIndexOf(".");
|
|
1157
1177
|
if (r !== -1) return Ge[e.slice(r + 1).toLowerCase()];
|
|
1158
|
-
},
|
|
1159
|
-
let n =
|
|
1178
|
+
}, Je = (e, t) => Q(e, t) != null, Ye = (e, t) => {
|
|
1179
|
+
let n = Q(e, t);
|
|
1160
1180
|
return n == null ? void 0 : qe[n];
|
|
1161
|
-
},
|
|
1181
|
+
}, Xe = (e) => {
|
|
1162
1182
|
let t = e.lastIndexOf(".");
|
|
1163
1183
|
return t === -1 ? !1 : We.has(e.slice(t + 1).toLowerCase());
|
|
1164
|
-
},
|
|
1184
|
+
}, Ze = (e) => {
|
|
1165
1185
|
let t = e.lastIndexOf(".");
|
|
1166
1186
|
return t === -1 ? !1 : Ue.has(e.slice(t + 1).toLowerCase());
|
|
1167
1187
|
}, Qe = {
|
|
@@ -1244,7 +1264,7 @@ var ot = ({ children: e }) => {
|
|
|
1244
1264
|
return L(() => () => {
|
|
1245
1265
|
let e = nt(a);
|
|
1246
1266
|
e != null && URL.revokeObjectURL(e);
|
|
1247
|
-
}, [a]), /* @__PURE__ */
|
|
1267
|
+
}, [a]), /* @__PURE__ */ V(at.Provider, {
|
|
1248
1268
|
value: R(() => ({
|
|
1249
1269
|
isOpen: t,
|
|
1250
1270
|
isLoading: r,
|
|
@@ -1271,21 +1291,21 @@ var ot = ({ children: e }) => {
|
|
|
1271
1291
|
if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
|
|
1272
1292
|
return e;
|
|
1273
1293
|
}, ct = F(({ labels: e, leftActions: t, isMobile: n = !1, defaultWidth: r, maxWidth: o, codeBlockTheme: s, tableDownloadFilename: c, loadPdf: l, configurePdfWorker: u, onVisualizerSendMessage: d }) => {
|
|
1274
|
-
let { ariaLabel: f = "Attachment preview", closeLabel: p = "Close", downloadLabel: m = "Download", unsupportedLabel: g = "Preview is not supported for this file", loadErrorLabel: _ = "Failed to load file", forbiddenErrorLabel: v = "You don't have permission to access this file", copyTextLabel: y, copiedTextLabel: b, copyMarkdownLabel: x, copiedMarkdownLabel: S, copyJsonLabel: C, copiedJsonLabel: w, htmlFrameBlockedLabel: T, htmlOpenInNewTabLabel: E, htmlViewSourceLabel: D, htmlViewRenderedLabel: O, pdfThumbnailsLabel: k, pdfShowThumbnailsLabel: A, pdfHideThumbnailsLabel: j, pdfPageNumberLabel: ee, pdfContentLoadingLabel: te, pdfContentErrorLabel: M, pdfContentRetryLabel: ne, xlsxFormulaLabel: re, codeContentLoadingLabel: ie, codeContentErrorLabel: N, codeContentRetryLabel: P, tableCopyLabel: F, tableCopiedLabel: ae, tableDownloadCsvLabel: L,
|
|
1275
|
-
a(
|
|
1276
|
-
}, [
|
|
1277
|
-
(
|
|
1278
|
-
}, [
|
|
1279
|
-
|
|
1280
|
-
}, [
|
|
1281
|
-
|
|
1282
|
-
}, [
|
|
1283
|
-
return /* @__PURE__ */
|
|
1284
|
-
isOpen:
|
|
1285
|
-
isLoading:
|
|
1286
|
-
onClose:
|
|
1287
|
-
content:
|
|
1288
|
-
fileName:
|
|
1294
|
+
let { ariaLabel: f = "Attachment preview", closeLabel: p = "Close", downloadLabel: m = "Download", unsupportedLabel: g = "Preview is not supported for this file", loadErrorLabel: _ = "Failed to load file", forbiddenErrorLabel: v = "You don't have permission to access this file", copyTextLabel: y, copiedTextLabel: b, copyMarkdownLabel: x, copiedMarkdownLabel: S, copyJsonLabel: C, copiedJsonLabel: w, htmlFrameBlockedLabel: T, htmlOpenInNewTabLabel: E, htmlViewSourceLabel: D, htmlViewRenderedLabel: O, pdfThumbnailsLabel: k, pdfShowThumbnailsLabel: A, pdfHideThumbnailsLabel: j, pdfPageNumberLabel: ee, pdfContentLoadingLabel: te, pdfContentErrorLabel: M, pdfContentRetryLabel: ne, xlsxFormulaLabel: re, codeContentLoadingLabel: ie, codeContentErrorLabel: N, codeContentRetryLabel: P, tableCopyLabel: F, tableCopiedLabel: ae, tableDownloadCsvLabel: L, codeBlockCopyLabel: R, codeBlockCopiedLabel: z, codeBlockDownloadLabel: B, tableScrollRegionAriaLabel: oe, mathScrollRegionAriaLabel: se, ooxmlHighlightsLabel: ce, ooxmlHighlightNavigatedLabel: H } = e ?? {}, { isOpen: le, isLoading: ue, content: U, fileName: W, closeCanvas: de } = st(), G = I(() => {
|
|
1295
|
+
a(U, W);
|
|
1296
|
+
}, [U, W]), K = I(() => {
|
|
1297
|
+
(U.type === i.PlainText || U.type === i.Code) && h(U.text);
|
|
1298
|
+
}, [U]), fe = I(() => {
|
|
1299
|
+
U.type === i.Markdown && h(U.text);
|
|
1300
|
+
}, [U]), pe = I(() => {
|
|
1301
|
+
U.type === i.Json && h(JSON.stringify(U.value, null, 2));
|
|
1302
|
+
}, [U]);
|
|
1303
|
+
return /* @__PURE__ */ V(He, {
|
|
1304
|
+
isOpen: le,
|
|
1305
|
+
isLoading: ue,
|
|
1306
|
+
onClose: de,
|
|
1307
|
+
content: U,
|
|
1308
|
+
fileName: W,
|
|
1289
1309
|
leftActions: t,
|
|
1290
1310
|
labels: {
|
|
1291
1311
|
ariaLabel: f,
|
|
@@ -1318,13 +1338,18 @@ var ot = ({ children: e }) => {
|
|
|
1318
1338
|
tableCopyLabel: F,
|
|
1319
1339
|
tableCopiedLabel: ae,
|
|
1320
1340
|
tableDownloadCsvLabel: L,
|
|
1321
|
-
|
|
1322
|
-
|
|
1341
|
+
codeBlockCopyLabel: R,
|
|
1342
|
+
codeBlockCopiedLabel: z,
|
|
1343
|
+
codeBlockDownloadLabel: B,
|
|
1344
|
+
tableScrollRegionAriaLabel: oe,
|
|
1345
|
+
mathScrollRegionAriaLabel: se,
|
|
1346
|
+
ooxmlHighlightsLabel: ce,
|
|
1347
|
+
ooxmlHighlightNavigatedLabel: H
|
|
1323
1348
|
},
|
|
1324
1349
|
onDownload: G,
|
|
1325
|
-
onCopyText:
|
|
1326
|
-
onCopyMarkdown:
|
|
1327
|
-
onCopyJson:
|
|
1350
|
+
onCopyText: U.type === i.PlainText || U.type === i.Code ? K : void 0,
|
|
1351
|
+
onCopyMarkdown: U.type === i.Markdown ? fe : void 0,
|
|
1352
|
+
onCopyJson: U.type === i.Json ? pe : void 0,
|
|
1328
1353
|
tableDownloadFilename: c,
|
|
1329
1354
|
isMobile: n,
|
|
1330
1355
|
defaultWidth: r,
|
|
@@ -1335,29 +1360,29 @@ var ot = ({ children: e }) => {
|
|
|
1335
1360
|
onVisualizerSendMessage: d
|
|
1336
1361
|
});
|
|
1337
1362
|
}), lt = {
|
|
1338
|
-
frame: "
|
|
1339
|
-
header: "
|
|
1340
|
-
title: "
|
|
1363
|
+
frame: "_frame_1ys0b_1",
|
|
1364
|
+
header: "_header_1ys0b_6",
|
|
1365
|
+
title: "_title_1ys0b_10"
|
|
1341
1366
|
}, ut = F(({ content: e, height: t, onExpand: n, expandAriaLabel: r, actionsGroupAriaLabel: i = "Visualizer actions", frameTitle: a, loadingLabel: o, errorLabel: s, titleClassName: c = "dial-small-semi-text", isBorderless: l = !1, isTitleHidden: u = !1, colors: d, onVisualizerSendMessage: f }) => {
|
|
1342
1367
|
let p = e.visualizerName.trim(), h = !u && p !== "";
|
|
1343
|
-
return /* @__PURE__ */
|
|
1368
|
+
return /* @__PURE__ */ H("div", {
|
|
1344
1369
|
className: _("flex w-full min-w-0 flex-col overflow-hidden", !l && ["rounded-xl border", lt.frame]),
|
|
1345
1370
|
style: m({
|
|
1346
1371
|
"--igv-bg": d?.background,
|
|
1347
1372
|
"--igv-border": d?.border,
|
|
1348
1373
|
"--igv-title-text": d?.titleText
|
|
1349
1374
|
}),
|
|
1350
|
-
children: [/* @__PURE__ */
|
|
1375
|
+
children: [/* @__PURE__ */ H("div", {
|
|
1351
1376
|
className: _("flex min-h-10 items-center gap-2 py-2", h ? "justify-between" : "justify-end", !l && ["border-b px-4", lt.header]),
|
|
1352
|
-
children: [h && /* @__PURE__ */
|
|
1377
|
+
children: [h && /* @__PURE__ */ V("span", {
|
|
1353
1378
|
className: _("min-w-0 truncate", c, lt.title),
|
|
1354
1379
|
children: p
|
|
1355
|
-
}), /* @__PURE__ */
|
|
1380
|
+
}), /* @__PURE__ */ V("div", {
|
|
1356
1381
|
role: "toolbar",
|
|
1357
1382
|
"aria-label": i,
|
|
1358
1383
|
className: "flex items-center gap-1",
|
|
1359
|
-
children: /* @__PURE__ */
|
|
1360
|
-
icon: /* @__PURE__ */
|
|
1384
|
+
children: /* @__PURE__ */ V(T, {
|
|
1385
|
+
icon: /* @__PURE__ */ V(k, {
|
|
1361
1386
|
size: S.SM,
|
|
1362
1387
|
stroke: C,
|
|
1363
1388
|
"aria-hidden": !0
|
|
@@ -1367,10 +1392,10 @@ var ot = ({ children: e }) => {
|
|
|
1367
1392
|
onClick: n
|
|
1368
1393
|
})
|
|
1369
1394
|
})]
|
|
1370
|
-
}), /* @__PURE__ */
|
|
1395
|
+
}), /* @__PURE__ */ V("div", {
|
|
1371
1396
|
className: "w-full",
|
|
1372
1397
|
style: { height: `${t}px` },
|
|
1373
|
-
children: /* @__PURE__ */
|
|
1398
|
+
children: /* @__PURE__ */ V(Fe, {
|
|
1374
1399
|
content: e,
|
|
1375
1400
|
loadingLabel: o,
|
|
1376
1401
|
errorLabel: s,
|
|
@@ -1407,14 +1432,14 @@ var ot = ({ children: e }) => {
|
|
|
1407
1432
|
let i = await e.resolveTextContent(t);
|
|
1408
1433
|
if (i != null) return r(i, t.name, n);
|
|
1409
1434
|
}
|
|
1410
|
-
let l =
|
|
1435
|
+
let l = Q("", a);
|
|
1411
1436
|
if (l != null) return r(await e.resolveOoxmlContent(t, l) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1412
1437
|
switch (a) {
|
|
1413
1438
|
case f.PDF: return r(await e.resolvePdfContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1414
1439
|
case f.Markdown: return r(await e.resolveMarkdownContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1415
1440
|
case f.JSON: return r(await e.resolveJsonContent(t) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1416
1441
|
}
|
|
1417
|
-
let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h =
|
|
1442
|
+
let u = t.name ?? "", p = u.lastIndexOf("."), m = p === -1 ? "" : u.slice(p + 1).toLowerCase(), h = Q(u);
|
|
1418
1443
|
if (h != null) return r(await e.resolveOoxmlContent(t, h) ?? $(e.resolveContentUrl(t)), t.name, n);
|
|
1419
1444
|
switch (m) {
|
|
1420
1445
|
case d.Markdown:
|
|
@@ -1431,8 +1456,8 @@ var ot = ({ children: e }) => {
|
|
|
1431
1456
|
return i == null ? !1 : r(i, t.name, n);
|
|
1432
1457
|
}
|
|
1433
1458
|
}
|
|
1434
|
-
let g = t.name != null &&
|
|
1435
|
-
if (t.name != null && !
|
|
1459
|
+
let g = t.name != null && Ze(t.name) || t.url != null && Ze(dt(t.url));
|
|
1460
|
+
if (t.name != null && !Xe(t.name) && !g) return r($(e.resolveContentUrl(t)), t.name, n);
|
|
1436
1461
|
if (g) {
|
|
1437
1462
|
let a = await e.resolveHtmlContent(t);
|
|
1438
1463
|
return a == null ? e.hasTextSource(t) ? r($(e.resolveContentUrl(t)), t.name, n) : t.url == null ? !1 : r({
|
|
@@ -1485,4 +1510,4 @@ var ot = ({ children: e }) => {
|
|
|
1485
1510
|
]) };
|
|
1486
1511
|
};
|
|
1487
1512
|
//#endregion
|
|
1488
|
-
export {
|
|
1513
|
+
export { K as ATTACHMENT_CANVAS_CLASS, He as AttachmentCanvas, ze as AttachmentCanvasBody, ct as AttachmentCanvasContainer, ot as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, he as CodeContent, ge as HTML_PREVIEW_FRAME_RENDER_MESSAGE, ut as InlineGroupedVisualizer, Ce as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, tt as createForbiddenCanvasContent, et as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, $e as extensionToLanguage, Ae as findVisualizerForApplication, ke as findVisualizerForMime, Q as getOoxmlFileType, Ye as getOoxmlMimeType, je as groupedVisualizerCanvasKey, o as isDownloadable, Ze as isHtmlPreviewable, Je as isOoxmlPreviewable, Xe as isTextPreviewable, Me as partitionAttachmentsForApplicationVisualizer, st as useAttachmentCanvas, ft as useOpenAttachmentCanvas };
|