@epam/ai-dial-attachment-canvas 1.2.0-dev.48 → 1.2.0-dev.50
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/constants/public-class-names.d.ts +11 -0
- package/constants/public-class-names.d.ts.map +1 -0
- package/index.css +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +143 -142
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentCanvas.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCanvas/AttachmentCanvas.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AttachmentCanvas.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCanvas/AttachmentCanvas.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AA+W5E,wGAAwG;AACxG,eAAO,MAAM,gBAAgB,6DAA6B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const ATTACHMENT_CANVAS_CLASS: {
|
|
2
|
+
/**
|
|
3
|
+
* The canvas panel wrapper — the element `@epam/ai-dial-sidebar` gives the
|
|
4
|
+
* panel's width and slide transition, which is the outer box a host sizes or
|
|
5
|
+
* positions. It is **not** the `aside` inside it: that one carries
|
|
6
|
+
* `dial-sb-aside`, so a host targeting the region itself descends from this
|
|
7
|
+
* class.
|
|
8
|
+
*/
|
|
9
|
+
readonly panel: "dial-attachment-canvas-panel";
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=public-class-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-class-names.d.ts","sourceRoot":"","sources":["../../src/constants/public-class-names.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,uBAAuB;IAClC;;;;;;OAMG;;CAEK,CAAC"}
|
package/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
._GzYRV{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;line-height:1.2}._3eOF8{margin-right:5px;font-weight:700}._3eOF8+._3eOF8{margin-left:-5px}._1MFti{cursor:pointer}._f10Tu{-webkit-user-select:none;user-select:none;margin-right:5px;font-size:1.2em}._1UmXx:after{content:"▸"}._1LId0:after{content:"▾"}._1pNG9{margin-right:5px}._1pNG9:after{content:"...";font-size:.8em}._2IvMF{background:#eee}._2bkNM{margin:0;padding:0 10px}._1BXBN{margin:0;padding:0}._1MGIk{color:#000;margin-right:5px;font-weight:600}._3uHL6{color:#000}._2T6PJ,._1Gho6{color:#df113a}._vGjyY{color:#2a3f3c}._1bQdo{color:#0b75f5}._3zQKs{color:#469038}._1xvuR{color:#43413d}._oLqym,._2AXVT,._2KJWg{color:#000}._11RoI{background:#002b36}._17H2C,._3QHg2,._3fDAz{color:#fdf6e3}._2bSDX{color:#fdf6e3;margin-right:5px;font-weight:bolder}._gsbQL{color:#fdf6e3}._LaAZe,._GTKgm{color:#81b5ac}._Chy1W{color:#cb4b16}._2bveF{color:#d33682}._2vRm-{color:#ae81ff}._1prJR{color:#268bd2}._container_1nhig_1{background:var(--cc-bg,var(--bg-layer-raised,#fcfcfc))}._containerLight_1nhig_5{background:var(--cc-bg,var(--bg-layer-base,#f5f7fa))}._openInNewTabButton_c1arc_1{color:var(--ac-open-in-new-tab-text,var(--text-accent,#1d4ed8))}._loadingOverlay_1aric_1{background-color:var(--mcp-loading-bg,var(--bg-layer-1,#e0e6f0))}._fullscreenFrame_1aric_20 iframe{width:100%!important;max-width:none!important;height:100%!important;max-height:none!important}._statusLabel_1aric_27{color:var(--mcp-status-text,var(--text-primary,#161b2d))}._errorIcon_1aric_31{color:var(--mcp-error-icon,var(--text-error,#ae2f2f))}._viewer_1w97n_2{background:var(--ac-ooxml-bg,var(--bg-layer-raised,#fcfcfc))}._spreadsheetCanvas_1w97n_6{width:100%;height:100%;display:block}._formulaPanel_1w97n_12{border-color:var(--ac-ooxml-formula-border,var(--stroke-secondary,#d1dbea));background:var(--ac-ooxml-bg,var(--bg-layer-raised,#fcfcfc));color:var(--ac-ooxml-formula-text,var(--text-primary,#161b2d))}._formulaValue_1w97n_18{border-color:var(--ac-ooxml-formula-border,var(--stroke-secondary,#d1dbea));background:var(--ac-ooxml-formula-bg,var(--bg-layer-base,#f5f7fa));color:var(--ac-ooxml-formula-text,var(--text-primary,#161b2d))}._statusOverlay_1w97n_24{background:var(--ac-ooxml-bg,var(--bg-layer-raised,#fcfcfc));color:var(--ac-status-text,var(--text-secondary,#57647a))}._errorIcon_1w97n_29{color:var(--ac-error-icon,var(--text-error,#ae2f2f))}._highlight_1w97n_37{border:1px solid var(--ac-ooxml-highlight-border,var(--stroke-accent,#5c8dea));background:var(--ac-ooxml-highlight-bg,transparent);opacity:.55;border-radius:2px}._highlight_1w97n_37[data-selected=true]{opacity:1;border-width:2px}._highlight_1w97n_37[data-clipped=true]{border-right:none;border-top-right-radius:0;border-bottom-right-radius:0}._loadingOverlay_12637_1{background-color:var(--vs-loading-bg,var(--bg-layer-sunken,#eef1f7))}._statusLabel_12637_5{color:var(--vs-status-text,var(--text-primary,#161b2d))}._errorIcon_12637_9{color:var(--vs-error-icon,var(--text-error,#ae2f2f))}._body_13ogb_4{color:var(--ac-text,var(--text-primary,#161b2d));font-family:var(--ac-font-family);font-size:var(--ac-font-size);font-weight:var(--ac-font-weight);line-height:var(--ac-line-height);letter-spacing:var(--ac-letter-spacing)}._statusLabel_13ogb_13{color:var(--ac-status-text,var(--text-secondary,#57647a))}._errorIcon_13ogb_17{color:var(--ac-error-icon,var(--text-error,#ae2f2f))}._jsonWrapper_13ogb_21{border-color:var(--ac-json-border,var(--stroke-secondary,#d1dbea));background-color:var(--ac-json-bg,var(--bg-layer-base,#f5f7fa))}._jsonLabel_13ogb_26{color:var(--ac-json-label,var(--text-primary,#161b2d))}._jsonClickableLabel_13ogb_30{color:var(--ac-json-clickable-label,var(--text-primary,#161b2d))}._jsonPunctuation_13ogb_34{color:var(--ac-json-punctuation,var(--text-secondary,#57647a))}._jsonStringValue_13ogb_38{color:var(--ac-json-string,var(--text-success,#007274))}._jsonNumberValue_13ogb_42{color:var(--ac-json-number,var(--text-accent,#1d4ed8))}._jsonBooleanValue_13ogb_46{color:var(--ac-json-boolean,var(--text-warning,#7f6300))}._jsonNullValue_13ogb_50{color:var(--ac-json-null,var(--text-secondary,#57647a))}._jsonExpandIcon_13ogb_54{color:var(--ac-json-toggle-icon,var(--text-secondary,#57647a))}._jsonExpandIcon_13ogb_54:hover{color:var(--ac-json-toggle-icon-hover,var(--text-primary,#161b2d))}._jsonExpandIcon_13ogb_54:after{content:"▶";vertical-align:middle;font-size:.6em}._jsonCollapseIcon_13ogb_67{color:var(--ac-json-toggle-icon,var(--text-secondary,#57647a))}._jsonCollapseIcon_13ogb_67:hover{color:var(--ac-json-toggle-icon-hover,var(--text-primary,#161b2d))}._jsonCollapseIcon_13ogb_67:after{content:"▼";vertical-align:middle;font-size:.6em}.pdf-container:has(+.pdf-container){padding:0}._jsonCollapsedContent_13ogb_84{color:var(--ac-json-collapsed-text,var(--text-secondary,#57647a));background-color:var(--ac-json-collapsed-bg,var(--bg-layer-raised,#fcfcfc));font-size:.75em}._jsonCollapsedContent_13ogb_84:after{content:"…"}._frame_g47g7_1{background-color:var(--igv-bg,var(--bg-layer-2,#f3f4f6));border-color:var(--igv-border,var(--stroke-tertiary,#dde1e6))}._header_g47g7_6{border-block-end-color:var(--igv-border,var(--stroke-tertiary,#dde1e6))}._title_g47g7_10{color:var(--igv-title-text,var(--text-primary,#161b2d))}
|
|
2
|
-
.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.start-3{inset-inline-start:.75rem}.top-3{top:.75rem}.z-10{z-index:10}.m-0{margin:0}.m-3{margin:.75rem}.my-0{margin-bottom:0;margin-top:0}.me-1{margin-inline-end:.25rem}.block{display:block}.inline{display:inline}.flex{display:flex}.table{display:table}.table-row{display:table-row}.grid{display:grid}.hidden{display:none}.h-8{height:2rem}.h-full{height:100%}.max-h-\[70vh\]{max-height:70vh}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-10{min-height:2.5rem}.w-0{width:0}.w-36{width:9rem}.w-full{width:100%}.min-w-0{min-width:0}.max-w-full{max-width:100%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:4px}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-none{border-style:none}.border-tertiary{border-color:var(--stroke-tertiary,#e0e6f0)}.object-contain{-o-object-fit:contain;object-fit:contain}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.ps-3{padding-inline-start:.75rem}.text-center{text-align:center}.text-sm{font-size:.875rem;line-height:1.25rem}.font-semibold{font-weight:600}.italic{font-style:italic}.text-secondary{color:var(--text-secondary,#57647a)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\[scrollbar-gutter\:stable\]{scrollbar-gutter:stable}.hover\:underline:hover{text-decoration-line:underline}.focus-visible\:outline:focus-visible{outline-style:solid;outline-width:1px}.focus-visible\:outline-focus:focus-visible{outline-color:var(--stroke-focus-black,var(--stroke-focus,#161b2d))}@media (max-width:1279px){.mobile\:w-full{width:100%}.mobile\:max-w-full{max-width:100%}}.\[\&\>div\:first-child\]\:hidden>div:first-child{display:none}
|
|
2
|
+
.sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.start-3{inset-inline-start:.75rem}.top-3{top:.75rem}.z-10{z-index:10}.m-0{margin:0}.m-3{margin:.75rem}.my-0{margin-bottom:0;margin-top:0}.me-1{margin-inline-end:.25rem}.block{display:block}.inline{display:inline}.flex{display:flex}.table{display:table}.table-row{display:table-row}.grid{display:grid}.hidden{display:none}.h-8{height:2rem}.h-full{height:100%}.max-h-\[70vh\]{max-height:70vh}.max-h-full{max-height:100%}.min-h-0{min-height:0}.min-h-10{min-height:2.5rem}.w-0{width:0}.w-36{width:9rem}.w-full{width:100%}.min-w-0{min-width:0}.max-w-full{max-width:100%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.truncate{overflow:hidden;text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:4px}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-none{border-style:none}.border-tertiary{border-color:var(--stroke-tertiary,#e0e6f0)}.object-contain{-o-object-fit:contain;object-fit:contain}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.ps-3{padding-inline-start:.75rem}.text-center{text-align:center}.text-sm{font-size:.875rem;line-height:1.25rem}.font-semibold{font-weight:600}.italic{font-style:italic}.text-secondary{color:var(--text-secondary,#57647a)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.\[scrollbar-gutter\:stable\]{scrollbar-gutter:stable}.hover\:underline:hover{text-decoration-line:underline}.focus-visible\:outline:focus-visible{outline-style:solid;outline-width:1px}.focus-visible\:outline-focus:focus-visible{outline-color:var(--stroke-focus-black,var(--stroke-focus,#161b2d))}@media (max-width:1279px){.mobile\:w-full{width:100%}.mobile\:max-w-full{max-width:100%}}.\[\&\>div\:first-child\]\:hidden>div:first-child{display:none}
|
package/index.d.ts
CHANGED
|
@@ -18,4 +18,5 @@ export { createForbiddenCanvasContent, createLoadErrorCanvasContent, createUnsup
|
|
|
18
18
|
export { downloadAttachmentContent, isDownloadable } from './utils/download';
|
|
19
19
|
export { findVisualizerForApplication, findVisualizerForMime, groupedVisualizerCanvasKey, partitionAttachmentsForApplicationVisualizer, } from './utils/visualizer';
|
|
20
20
|
export type { ApplicationVisualizerPartition } from './utils/visualizer';
|
|
21
|
+
export { ATTACHMENT_CANVAS_CLASS } from './constants/public-class-names';
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,kEAAkE,CAAC;AAC7G,YAAY,EAAE,8BAA8B,EAAE,MAAM,kEAAkE,CAAC;AACvH,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,YAAY,EACV,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,8DAA8D,CAAC;AACvG,YAAY,EACV,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,8DAA8D,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,YAAY,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AACxG,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAClG,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,8BAA8B,EAC9B,gCAAgC,GACjC,MAAM,yDAAyD,CAAC;AACjE,YAAY,EACV,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,8BAA8B,EAC9B,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,EACzB,cAAc,EACd,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC5B,8BAA8B,EAC9B,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,EAC1B,4CAA4C,GAC7C,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gDAAgD,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,kEAAkE,CAAC;AAC7G,YAAY,EAAE,8BAA8B,EAAE,MAAM,kEAAkE,CAAC;AACvH,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,YAAY,EACV,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,8DAA8D,CAAC;AACvG,YAAY,EACV,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,8DAA8D,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,CAAC;AAC9F,YAAY,EAAE,yBAAyB,EAAE,MAAM,wDAAwD,CAAC;AACxG,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,yDAAyD,CAAC;AAClG,YAAY,EACV,oBAAoB,EACpB,kBAAkB,EAClB,8BAA8B,EAC9B,gCAAgC,GACjC,MAAM,yDAAyD,CAAC;AACjE,YAAY,EACV,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,8BAA8B,EAC9B,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,EACzB,cAAc,EACd,sBAAsB,EACtB,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC5B,8BAA8B,EAC9B,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACrB,0BAA0B,EAC1B,4CAA4C,GAC7C,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/index.js
CHANGED
|
@@ -11,17 +11,18 @@ import { AppBridge as V, AppFrame as ue } from "@mcp-ui/client";
|
|
|
11
11
|
import { McpUiHostContextChangedNotificationSchema as de } from "@modelcontextprotocol/ext-apps/app-bridge";
|
|
12
12
|
import { VisualizerConnectorRequests as H } from "@epam/ai-dial-shared";
|
|
13
13
|
import { VisualizerConnector as fe } from "@epam/ai-dial-visualizer-connector";
|
|
14
|
-
|
|
14
|
+
//#region src/constants/public-class-names.ts
|
|
15
|
+
var pe = { panel: "dial-attachment-canvas-panel" }, me = {
|
|
15
16
|
container: "_container_1nhig_1",
|
|
16
17
|
containerLight: "_containerLight_1nhig_5"
|
|
17
|
-
},
|
|
18
|
+
}, U = {
|
|
18
19
|
[l.Dark]: _,
|
|
19
20
|
[l.Light]: _
|
|
20
|
-
},
|
|
21
|
+
}, he = () => j(async () => {
|
|
21
22
|
let { Prism: e } = await import("react-syntax-highlighter");
|
|
22
23
|
return { default: e };
|
|
23
|
-
}),
|
|
24
|
-
let { text: r, language: i } = e, a = i == null || i === "plaintext", o =
|
|
24
|
+
}), ge = M(({ content: e, codeBlockTheme: t = l.Light, labels: n }) => {
|
|
25
|
+
let { text: r, language: i } = e, a = i == null || i === "plaintext", o = U[t], c = t === l.Light, [u, d] = L(0), f = F(he, [u]), p = N(() => {
|
|
25
26
|
d((e) => e + 1);
|
|
26
27
|
}, []), m = /* @__PURE__ */ z("pre", {
|
|
27
28
|
className: "whitespace-pre-wrap break-words p-4",
|
|
@@ -29,7 +30,7 @@ var pe = {
|
|
|
29
30
|
});
|
|
30
31
|
return /* @__PURE__ */ z("div", {
|
|
31
32
|
dir: "ltr",
|
|
32
|
-
className: g("h-full overflow-auto",
|
|
33
|
+
className: g("h-full overflow-auto", me.container, c && me.containerLight),
|
|
33
34
|
children: a ? m : /* @__PURE__ */ z(s, {
|
|
34
35
|
retryKey: u,
|
|
35
36
|
onRetry: p,
|
|
@@ -53,7 +54,7 @@ var pe = {
|
|
|
53
54
|
})
|
|
54
55
|
})
|
|
55
56
|
});
|
|
56
|
-
}),
|
|
57
|
+
}), _e = { openInNewTabButton: "_openInNewTabButton_c1arc_1" }, ve = M(({ content: e, labels: t, isSourceView: n, title: r, codeBlockTheme: a, openInNewTabButtonTypographyClassName: o = "dial-body-semi-text" }) => {
|
|
57
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);
|
|
58
59
|
P(() => {
|
|
59
60
|
u(!0), f(!1);
|
|
@@ -67,7 +68,7 @@ var pe = {
|
|
|
67
68
|
}, [e.srcdoc]), h = N(() => {
|
|
68
69
|
u(!1), f(!0);
|
|
69
70
|
}, []);
|
|
70
|
-
if (n && e.srcdoc != null) return /* @__PURE__ */ z(
|
|
71
|
+
if (n && e.srcdoc != null) return /* @__PURE__ */ z(ge, {
|
|
71
72
|
content: {
|
|
72
73
|
type: i.Code,
|
|
73
74
|
text: e.srcdoc,
|
|
@@ -84,7 +85,7 @@ var pe = {
|
|
|
84
85
|
href: e.url,
|
|
85
86
|
target: "_blank",
|
|
86
87
|
label: c,
|
|
87
|
-
className:
|
|
88
|
+
className: _e.openInNewTabButton,
|
|
88
89
|
textClassName: o
|
|
89
90
|
})]
|
|
90
91
|
});
|
|
@@ -105,10 +106,10 @@ var pe = {
|
|
|
105
106
|
onError: h
|
|
106
107
|
})]
|
|
107
108
|
});
|
|
108
|
-
}),
|
|
109
|
+
}), ye = {
|
|
109
110
|
name: "MCP-UI Host",
|
|
110
111
|
version: "1.0.0"
|
|
111
|
-
},
|
|
112
|
+
}, be = { openLinks: {} }, xe = (e) => {
|
|
112
113
|
let t;
|
|
113
114
|
try {
|
|
114
115
|
t = new URL(e);
|
|
@@ -122,14 +123,14 @@ var pe = {
|
|
|
122
123
|
return !1;
|
|
123
124
|
}
|
|
124
125
|
return !0;
|
|
125
|
-
},
|
|
126
|
+
}, Se = (e, t, n) => {
|
|
126
127
|
if (n) {
|
|
127
128
|
e.style.maxWidth = "", e.style.maxHeight = "";
|
|
128
129
|
return;
|
|
129
130
|
}
|
|
130
131
|
let r = t;
|
|
131
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`));
|
|
132
|
-
},
|
|
133
|
+
}, Ce = (e, t, n) => {
|
|
133
134
|
let r = I(e);
|
|
134
135
|
P(() => {
|
|
135
136
|
r.current = e;
|
|
@@ -138,15 +139,15 @@ var pe = {
|
|
|
138
139
|
return P(() => {
|
|
139
140
|
let e = null;
|
|
140
141
|
try {
|
|
141
|
-
e = new V(null,
|
|
142
|
+
e = new V(null, ye, be, { hostContext: r.current.hostContext }), e.onopenlink = async ({ url: e }) => {
|
|
142
143
|
let t = r.current.onOpenLink;
|
|
143
|
-
return (t == null ?
|
|
144
|
+
return (t == null ? xe(e) : t(e)) === !1 ? { isError: !0 } : {};
|
|
144
145
|
}, e.onrequestdisplaymode = async ({ mode: e }) => {
|
|
145
146
|
let t = r.current.onRequestDisplayMode, n = r.current.hostContext?.displayMode ?? "inline";
|
|
146
147
|
return { mode: t?.(e) ?? n };
|
|
147
148
|
}, e.oncalltool = (e) => r.current.onToolCall(e.name, e.arguments), e.setNotificationHandler(de, ({ params: e }) => {
|
|
148
149
|
let n = t.current?.querySelector("iframe");
|
|
149
|
-
n != null &&
|
|
150
|
+
n != null && Se(n, e.containerDimensions, r.current.hostContext?.displayMode === "fullscreen");
|
|
150
151
|
}), a(e);
|
|
151
152
|
} catch (e) {
|
|
152
153
|
console.error("[useMcpAppBridge] Error creating AppBridge:", e), s(!0);
|
|
@@ -160,12 +161,12 @@ var pe = {
|
|
|
160
161
|
appBridge: i,
|
|
161
162
|
hasFailed: o
|
|
162
163
|
};
|
|
163
|
-
},
|
|
164
|
+
}, we = {
|
|
164
165
|
loadingOverlay: "_loadingOverlay_1aric_1",
|
|
165
166
|
fullscreenFrame: "_fullscreenFrame_1aric_20",
|
|
166
167
|
statusLabel: "_statusLabel_1aric_27",
|
|
167
168
|
errorIcon: "_errorIcon_1aric_31"
|
|
168
|
-
},
|
|
169
|
+
}, Te = ({ content: e, errorLabel: t = "Failed to load app" }) => {
|
|
169
170
|
let [n, r] = L("loading"), { html: i, sandboxUrl: a, toolInput: o, toolResult: s, hostContext: c } = e, l = F(() => ({ url: new URL(a) }), [a]), u = c?.displayMode === "fullscreen", d = I(null), [f, p] = L();
|
|
170
171
|
P(() => {
|
|
171
172
|
let e = d.current;
|
|
@@ -180,13 +181,13 @@ var pe = {
|
|
|
180
181
|
});
|
|
181
182
|
return t.observe(e), () => t.disconnect();
|
|
182
183
|
}, []);
|
|
183
|
-
let { appBridge: m, hasFailed: h } =
|
|
184
|
+
let { appBridge: m, hasFailed: h } = Ce(e, d, F(() => c == null || f == null ? c : {
|
|
184
185
|
...c,
|
|
185
186
|
containerDimensions: f
|
|
186
187
|
}, [c, f])), _ = h || n === "error";
|
|
187
188
|
return /* @__PURE__ */ B("div", {
|
|
188
189
|
ref: d,
|
|
189
|
-
className: g("relative h-full w-full", u &&
|
|
190
|
+
className: g("relative h-full w-full", u && we.fullscreenFrame),
|
|
190
191
|
children: [
|
|
191
192
|
m != null && /* @__PURE__ */ z(ue, {
|
|
192
193
|
html: i,
|
|
@@ -199,7 +200,7 @@ var pe = {
|
|
|
199
200
|
onError: () => r("error")
|
|
200
201
|
}),
|
|
201
202
|
!_ && n === "loading" && /* @__PURE__ */ z("div", {
|
|
202
|
-
className: g("absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
203
|
+
className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", we.loadingOverlay),
|
|
203
204
|
children: /* @__PURE__ */ z(E, {})
|
|
204
205
|
}),
|
|
205
206
|
_ && /* @__PURE__ */ B("div", {
|
|
@@ -208,10 +209,10 @@ var pe = {
|
|
|
208
209
|
size: 60,
|
|
209
210
|
stroke: S,
|
|
210
211
|
"aria-hidden": !0,
|
|
211
|
-
className:
|
|
212
|
+
className: we.errorIcon
|
|
212
213
|
}), /* @__PURE__ */ z("p", {
|
|
213
214
|
role: "alert",
|
|
214
|
-
className: g("text-center",
|
|
215
|
+
className: g("text-center", we.statusLabel),
|
|
215
216
|
children: t
|
|
216
217
|
})]
|
|
217
218
|
})
|
|
@@ -225,13 +226,13 @@ var pe = {
|
|
|
225
226
|
statusOverlay: "_statusOverlay_1w97n_24",
|
|
226
227
|
errorIcon: "_errorIcon_1w97n_29",
|
|
227
228
|
highlight: "_highlight_1w97n_37"
|
|
228
|
-
},
|
|
229
|
+
}, Ee = (e) => {
|
|
229
230
|
if (e?.kind !== "range") return "";
|
|
230
231
|
let { activeCell: t } = e.selection, n = e.cells.find(({ address: e }) => e.row === t.row && e.col === t.col);
|
|
231
232
|
if (n == null) return "";
|
|
232
233
|
let r = n.formula;
|
|
233
234
|
return r == null || r.trim().length === 0 ? n.displayText : r.startsWith("=") ? r : `=${r}`;
|
|
234
|
-
},
|
|
235
|
+
}, De = async (e, t, { onError: n, onXlsxSelectionContextChange: i }) => {
|
|
235
236
|
switch (t) {
|
|
236
237
|
case r.Docx: {
|
|
237
238
|
let [{ DocxScrollViewer: t }, { chartEx: r }] = await Promise.all([import("@silurus/ooxml/docx"), import("@silurus/ooxml/chart-ex")]);
|
|
@@ -273,7 +274,7 @@ var pe = {
|
|
|
273
274
|
});
|
|
274
275
|
}
|
|
275
276
|
}
|
|
276
|
-
},
|
|
277
|
+
}, Oe = async (e, t, n, i) => {
|
|
277
278
|
let { onError: a, onXlsxSelectionContextChange: o, onGeometryInvalidated: s } = n;
|
|
278
279
|
switch (t.format) {
|
|
279
280
|
case r.Docx: {
|
|
@@ -282,7 +283,7 @@ var pe = {
|
|
|
282
283
|
import("@silurus/ooxml/chart-ex"),
|
|
283
284
|
import("./ooxml-highlight-surfaces-BzgOKpBV.js")
|
|
284
285
|
]), l = await n.load(t.url, { chartEx: o });
|
|
285
|
-
if (i()) throw l.destroy(), new
|
|
286
|
+
if (i()) throw l.destroy(), new ke();
|
|
286
287
|
let u = r.fromDocument(e, l, {
|
|
287
288
|
enableTextSelection: !0,
|
|
288
289
|
refitOnResize: !0,
|
|
@@ -302,7 +303,7 @@ var pe = {
|
|
|
302
303
|
import("@silurus/ooxml/chart-ex"),
|
|
303
304
|
import("./ooxml-highlight-surfaces-BzgOKpBV.js")
|
|
304
305
|
]), l = await n.load(t.url, { chartEx: o });
|
|
305
|
-
if (i()) throw l.destroy(), new
|
|
306
|
+
if (i()) throw l.destroy(), new ke();
|
|
306
307
|
let u = r.fromPresentation(e, l, {
|
|
307
308
|
enableTextSelection: !0,
|
|
308
309
|
refitOnResize: !0,
|
|
@@ -336,11 +337,11 @@ var pe = {
|
|
|
336
337
|
};
|
|
337
338
|
}
|
|
338
339
|
case r.Csv: {
|
|
339
|
-
let r = await
|
|
340
|
+
let r = await De(e, t.format, n);
|
|
340
341
|
return await r.load(t.url), { viewer: r };
|
|
341
342
|
}
|
|
342
343
|
}
|
|
343
|
-
},
|
|
344
|
+
}, ke = class extends Error {}, Ae = ({ content: t, fileName: n, loadErrorLabel: i, formulaLabel: a, formulaLabelClassName: o, highlightsLabel: s = "Cited locations", highlightNavigatedLabel: c = "Scrolled to the cited location" }) => {
|
|
344
345
|
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);
|
|
345
346
|
O.current = x;
|
|
346
347
|
let k = I(void 0);
|
|
@@ -366,7 +367,7 @@ var pe = {
|
|
|
366
367
|
i || (d(!1), p(!0));
|
|
367
368
|
},
|
|
368
369
|
onXlsxSelectionContextChange: (e) => {
|
|
369
|
-
i || h(
|
|
370
|
+
i || h(Ee(e));
|
|
370
371
|
},
|
|
371
372
|
onGeometryInvalidated: s
|
|
372
373
|
}, f = () => {
|
|
@@ -375,14 +376,14 @@ var pe = {
|
|
|
375
376
|
return e.addEventListener("scroll", s, !0), k.current = s, (async () => {
|
|
376
377
|
try {
|
|
377
378
|
if (w) {
|
|
378
|
-
let r = await
|
|
379
|
+
let r = await Oe(e, t, u, o);
|
|
379
380
|
if (i) {
|
|
380
381
|
r.viewer.destroy(), r.engine?.destroy();
|
|
381
382
|
return;
|
|
382
383
|
}
|
|
383
384
|
n = r, T.current = r.highlights, f();
|
|
384
385
|
} else {
|
|
385
|
-
let r = await
|
|
386
|
+
let r = await De(e, t.format, u);
|
|
386
387
|
if (i) {
|
|
387
388
|
r.destroy();
|
|
388
389
|
return;
|
|
@@ -392,7 +393,7 @@ var pe = {
|
|
|
392
393
|
if (i) return;
|
|
393
394
|
d(!1), await c();
|
|
394
395
|
} catch (t) {
|
|
395
|
-
if (t instanceof
|
|
396
|
+
if (t instanceof ke || i) return;
|
|
396
397
|
n?.viewer.destroy(), n?.engine?.destroy(), n = void 0, T.current = void 0, e.replaceChildren(), d(!1), p(!0);
|
|
397
398
|
}
|
|
398
399
|
})(), () => {
|
|
@@ -492,11 +493,11 @@ var pe = {
|
|
|
492
493
|
})
|
|
493
494
|
]
|
|
494
495
|
});
|
|
495
|
-
},
|
|
496
|
+
}, je = {
|
|
496
497
|
loadingOverlay: "_loadingOverlay_12637_1",
|
|
497
498
|
statusLabel: "_statusLabel_12637_5",
|
|
498
499
|
errorIcon: "_errorIcon_12637_9"
|
|
499
|
-
},
|
|
500
|
+
}, Me = ({ content: e, loadingLabel: t, errorLabel: n = "Failed to load visualizer", frameTitle: r, colors: a }) => {
|
|
500
501
|
let o = I(null), [s, c] = L("loading"), { url: l, visualizerName: u, requestTimeout: d } = e, f = I(e);
|
|
501
502
|
return f.current = e, P(() => {
|
|
502
503
|
let e = o.current;
|
|
@@ -556,9 +557,9 @@ var pe = {
|
|
|
556
557
|
className: "h-full w-full"
|
|
557
558
|
}),
|
|
558
559
|
s === "loading" && /* @__PURE__ */ B("div", {
|
|
559
|
-
className: g("absolute inset-0 flex flex-col items-center justify-center gap-2",
|
|
560
|
+
className: g("absolute inset-0 flex flex-col items-center justify-center gap-2", je.loadingOverlay),
|
|
560
561
|
children: [/* @__PURE__ */ z(E, {}), t && /* @__PURE__ */ z("p", {
|
|
561
|
-
className: g("text-center",
|
|
562
|
+
className: g("text-center", je.statusLabel),
|
|
562
563
|
children: t
|
|
563
564
|
})]
|
|
564
565
|
}),
|
|
@@ -568,10 +569,10 @@ var pe = {
|
|
|
568
569
|
size: 60,
|
|
569
570
|
stroke: S,
|
|
570
571
|
"aria-hidden": !0,
|
|
571
|
-
className:
|
|
572
|
+
className: je.errorIcon
|
|
572
573
|
}), /* @__PURE__ */ z("p", {
|
|
573
574
|
role: "alert",
|
|
574
|
-
className: g("text-center",
|
|
575
|
+
className: g("text-center", je.statusLabel),
|
|
575
576
|
children: n
|
|
576
577
|
})]
|
|
577
578
|
})
|
|
@@ -592,7 +593,7 @@ var pe = {
|
|
|
592
593
|
jsonExpandIcon: "_jsonExpandIcon_13ogb_54",
|
|
593
594
|
jsonCollapseIcon: "_jsonCollapseIcon_13ogb_67",
|
|
594
595
|
jsonCollapsedContent: "_jsonCollapsedContent_13ogb_84"
|
|
595
|
-
},
|
|
596
|
+
}, Ne = () => j(async () => ({ default: (await import("./PdfContent-BoAtghsO.js")).PdfContent })), Pe = ({ url: e, fileName: t, loadErrorLabel: n }) => {
|
|
596
597
|
let [r, i] = L(!1);
|
|
597
598
|
return P(() => {
|
|
598
599
|
i(!1);
|
|
@@ -612,14 +613,14 @@ var pe = {
|
|
|
612
613
|
className: "max-h-full max-w-full object-contain",
|
|
613
614
|
onError: () => i(!0)
|
|
614
615
|
});
|
|
615
|
-
},
|
|
616
|
+
}, Fe = new Set([
|
|
616
617
|
i.PlainText,
|
|
617
618
|
i.Code,
|
|
618
619
|
i.Ooxml
|
|
619
|
-
]),
|
|
620
|
-
let { colors: R, typography: V, bodyClassName: ue, cssVars: de } = A ?? {}, [H, fe] = L(0), pe = F(
|
|
620
|
+
]), Ie = M(({ 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: A, codeBlockTheme: j, tableDownloadFilename: M, loadPdf: se, hidePdfToolbar: P = !1, configurePdfWorker: I }) => {
|
|
621
|
+
let { colors: R, typography: V, bodyClassName: ue, cssVars: de } = A ?? {}, [H, fe] = L(0), pe = F(Ne, [H]), me = N(() => {
|
|
621
622
|
fe((e) => e + 1);
|
|
622
|
-
}, []), U = V?.fontClassName != null,
|
|
623
|
+
}, []), U = V?.fontClassName != null, he = F(() => ({
|
|
623
624
|
...m({
|
|
624
625
|
"--ac-text": R?.text,
|
|
625
626
|
"--ac-status-text": R?.statusText,
|
|
@@ -651,7 +652,7 @@ var pe = {
|
|
|
651
652
|
"--ac-letter-spacing": U ? void 0 : V?.letterSpacing
|
|
652
653
|
}),
|
|
653
654
|
...de
|
|
654
|
-
}), [A]),
|
|
655
|
+
}), [A]), _e = F(() => {
|
|
655
656
|
switch (e.type) {
|
|
656
657
|
case i.Image:
|
|
657
658
|
case i.Audio:
|
|
@@ -675,7 +676,7 @@ var pe = {
|
|
|
675
676
|
className: g("whitespace-pre-wrap break-words", G.body, V?.fontClassName),
|
|
676
677
|
children: e.text
|
|
677
678
|
});
|
|
678
|
-
case i.Image: return /* @__PURE__ */ z(
|
|
679
|
+
case i.Image: return /* @__PURE__ */ z(Pe, {
|
|
679
680
|
url: e.url,
|
|
680
681
|
fileName: r,
|
|
681
682
|
loadErrorLabel: c
|
|
@@ -741,7 +742,7 @@ var pe = {
|
|
|
741
742
|
})
|
|
742
743
|
})
|
|
743
744
|
});
|
|
744
|
-
case i.Code: return /* @__PURE__ */ z(
|
|
745
|
+
case i.Code: return /* @__PURE__ */ z(ge, {
|
|
745
746
|
content: e,
|
|
746
747
|
codeBlockTheme: j,
|
|
747
748
|
labels: {
|
|
@@ -750,7 +751,7 @@ var pe = {
|
|
|
750
751
|
retryLabel: ee
|
|
751
752
|
}
|
|
752
753
|
});
|
|
753
|
-
case i.Html: return /* @__PURE__ */ z(
|
|
754
|
+
case i.Html: return /* @__PURE__ */ z(ve, {
|
|
754
755
|
content: e,
|
|
755
756
|
labels: {
|
|
756
757
|
htmlFrameBlockedLabel: f,
|
|
@@ -788,7 +789,7 @@ var pe = {
|
|
|
788
789
|
}
|
|
789
790
|
})
|
|
790
791
|
}, e.url);
|
|
791
|
-
case i.Ooxml: return /* @__PURE__ */ z(
|
|
792
|
+
case i.Ooxml: return /* @__PURE__ */ z(Ae, {
|
|
792
793
|
content: e,
|
|
793
794
|
fileName: r,
|
|
794
795
|
loadErrorLabel: c,
|
|
@@ -798,11 +799,11 @@ var pe = {
|
|
|
798
799
|
highlightNavigatedLabel: oe
|
|
799
800
|
});
|
|
800
801
|
case i.Visualizer:
|
|
801
|
-
case i.GroupedVisualizer: return /* @__PURE__ */ z(
|
|
802
|
+
case i.GroupedVisualizer: return /* @__PURE__ */ z(Me, {
|
|
802
803
|
content: e,
|
|
803
804
|
errorLabel: d
|
|
804
805
|
});
|
|
805
|
-
case i.McpApp: return /* @__PURE__ */ z(
|
|
806
|
+
case i.McpApp: return /* @__PURE__ */ z(Te, { content: e });
|
|
806
807
|
case i.Unsupported: return /* @__PURE__ */ z("p", {
|
|
807
808
|
className: g("text-center", G.statusLabel),
|
|
808
809
|
children: o
|
|
@@ -861,28 +862,28 @@ var pe = {
|
|
|
861
862
|
oe
|
|
862
863
|
]);
|
|
863
864
|
return /* @__PURE__ */ z("div", {
|
|
864
|
-
style: !t &&
|
|
865
|
-
className: g(t ? "flex h-full items-center justify-center" :
|
|
865
|
+
style: !t && Fe.has(e.type) ? he : void 0,
|
|
866
|
+
className: g(t ? "flex h-full items-center justify-center" : _e, ue),
|
|
866
867
|
children: t ? /* @__PURE__ */ z(E, {}) : ye
|
|
867
868
|
});
|
|
868
|
-
}),
|
|
869
|
-
let [
|
|
870
|
-
|
|
871
|
-
}, [
|
|
872
|
-
|
|
873
|
-
}, [
|
|
874
|
-
|
|
875
|
-
}, [
|
|
869
|
+
}), Le = 2e3, Re = M(({ isOpen: e, isLoading: t = !1, onClose: n, content: r, fileName: a, labels: { ariaLabel: s, closeLabel: c = "Close", resizeLabel: l = "Resize panel", downloadLabel: u = "Download", copyTextLabel: d = "Copy text", copiedTextLabel: f = "Copied!", copyMarkdownLabel: p = "Copy as Markdown", copiedMarkdownLabel: m = "Copied!", copyJsonLabel: h = "Copy as JSON", copiedJsonLabel: _ = "Copied!", visualizerErrorLabel: v, unsupportedLabel: C = "Preview is not supported for this file", loadErrorLabel: T = "Failed to load file", forbiddenErrorLabel: E = "You don't have permission to access this file", htmlFrameBlockedLabel: D = "This page cannot be displayed in preview", htmlOpenInNewTabLabel: O = "Open in new tab", htmlViewSourceLabel: ie = "View source", htmlViewRenderedLabel: A = "View rendered", mcpAppReloadLabel: j = "Reload", pdfThumbnailsLabel: M, pdfShowThumbnailsLabel: se, pdfHideThumbnailsLabel: F, pdfPageNumberLabel: ce, pdfContentLoadingLabel: le, pdfContentErrorLabel: V, pdfContentRetryLabel: ue, xlsxFormulaLabel: de, codeContentLoadingLabel: H, codeContentErrorLabel: fe, codeContentRetryLabel: me, tableCopyLabel: U, tableCopiedLabel: he, tableDownloadCsvLabel: ge, ooxmlHighlightsLabel: _e, ooxmlHighlightNavigatedLabel: ve }, onDownload: ye, onCopyText: be, onCopyMarkdown: xe, onCopyJson: Se, tableDownloadFilename: Ce, isMobile: we = !1, defaultWidth: Te, minWidth: W = 600, maxWidth: Ee = 1500, onResizeStop: De, styles: Oe, codeBlockTheme: ke, loadPdf: Ae, configurePdfWorker: je }) => {
|
|
870
|
+
let [Me, G] = L(!1), [Ne, Pe] = L(!1), [Fe, Re] = L(!1), [K, q] = L(!1), J = I(null), Y = I(null), X = I(null), ze = N(() => {
|
|
871
|
+
be?.(), J.current != null && clearTimeout(J.current), G(!0), J.current = setTimeout(() => G(!1), Le);
|
|
872
|
+
}, [be]), Z = N(() => {
|
|
873
|
+
xe?.(), Y.current != null && clearTimeout(Y.current), Pe(!0), Y.current = setTimeout(() => Pe(!1), Le);
|
|
874
|
+
}, [xe]), Be = N(() => {
|
|
875
|
+
Se?.(), X.current != null && clearTimeout(X.current), Re(!0), X.current = setTimeout(() => Re(!1), Le);
|
|
876
|
+
}, [Se]);
|
|
876
877
|
P(() => () => {
|
|
877
878
|
J.current != null && clearTimeout(J.current), Y.current != null && clearTimeout(Y.current), X.current != null && clearTimeout(X.current);
|
|
878
879
|
}, []);
|
|
879
|
-
let
|
|
880
|
+
let Ve = N(() => {
|
|
880
881
|
q((e) => !e);
|
|
881
882
|
}, []);
|
|
882
883
|
P(() => {
|
|
883
884
|
q(!1);
|
|
884
885
|
}, [r]);
|
|
885
|
-
let { className:
|
|
886
|
+
let { className: He, panelStyles: Q, ...Ue } = Oe ?? {}, We = !t && r.type === i.Html && r.srcdoc != null, $ = !t && be != null && (r.type === i.PlainText || r.type === i.Code), Ge = !t && xe != null && r.type === i.Markdown, Ke = !t && Se != null && r.type === i.Json, qe = !t && ye != null && o(r), Je = !t && r.type === i.McpApp && r.onReload != null;
|
|
886
887
|
return /* @__PURE__ */ z(b, {
|
|
887
888
|
isOpen: e,
|
|
888
889
|
orientation: y.Right,
|
|
@@ -893,19 +894,19 @@ var pe = {
|
|
|
893
894
|
resizeLabel: l
|
|
894
895
|
},
|
|
895
896
|
onClose: n,
|
|
896
|
-
resizable: !
|
|
897
|
-
defaultWidth:
|
|
897
|
+
resizable: !we,
|
|
898
|
+
defaultWidth: Te,
|
|
898
899
|
minWidth: W,
|
|
899
|
-
maxWidth:
|
|
900
|
-
onResizeStop:
|
|
900
|
+
maxWidth: Ee,
|
|
901
|
+
onResizeStop: De,
|
|
901
902
|
styles: {
|
|
902
903
|
...Q,
|
|
903
904
|
titleClassName: Q?.titleClassName ?? "dial-h3-text",
|
|
904
905
|
headerClassName: g("border-b border-tertiary", Q?.headerClassName),
|
|
905
|
-
className: g(e ? "mobile:w-full mobile:max-w-full" : "w-0",
|
|
906
|
+
className: g(e ? "mobile:w-full mobile:max-w-full" : "w-0", He, Q?.className, pe.panel)
|
|
906
907
|
},
|
|
907
|
-
rightActions:
|
|
908
|
-
|
|
908
|
+
rightActions: We || $ || Ge || Ke || qe || Je ? /* @__PURE__ */ B(R, { children: [
|
|
909
|
+
Je && /* @__PURE__ */ z(w, {
|
|
909
910
|
icon: /* @__PURE__ */ z(oe, {
|
|
910
911
|
size: x.LG,
|
|
911
912
|
stroke: S,
|
|
@@ -915,7 +916,7 @@ var pe = {
|
|
|
915
916
|
tooltipProps: { tooltip: j },
|
|
916
917
|
onClick: r.type === i.McpApp ? r.onReload : void 0
|
|
917
918
|
}),
|
|
918
|
-
|
|
919
|
+
We && /* @__PURE__ */ z(w, {
|
|
919
920
|
icon: z(K ? re : ee, {
|
|
920
921
|
size: x.LG,
|
|
921
922
|
stroke: S,
|
|
@@ -924,49 +925,49 @@ var pe = {
|
|
|
924
925
|
"aria-label": K ? A : ie,
|
|
925
926
|
"aria-pressed": K,
|
|
926
927
|
tooltipProps: { tooltip: K ? A : ie },
|
|
927
|
-
onClick:
|
|
928
|
+
onClick: Ve
|
|
928
929
|
}),
|
|
929
930
|
$ && /* @__PURE__ */ z(w, {
|
|
930
|
-
icon: z(
|
|
931
|
+
icon: z(Me ? k : te, {
|
|
931
932
|
size: x.LG,
|
|
932
933
|
stroke: S,
|
|
933
934
|
"aria-hidden": !0
|
|
934
935
|
}),
|
|
935
|
-
"aria-label":
|
|
936
|
-
tooltipProps: { tooltip:
|
|
937
|
-
onClick:
|
|
936
|
+
"aria-label": Me ? f : d,
|
|
937
|
+
tooltipProps: { tooltip: Me ? f : d },
|
|
938
|
+
onClick: ze
|
|
938
939
|
}),
|
|
939
|
-
|
|
940
|
-
icon: z(
|
|
940
|
+
Ge && /* @__PURE__ */ z(w, {
|
|
941
|
+
icon: z(Ne ? k : ae, {
|
|
941
942
|
size: x.LG,
|
|
942
943
|
stroke: S,
|
|
943
944
|
"aria-hidden": !0
|
|
944
945
|
}),
|
|
945
|
-
"aria-label":
|
|
946
|
-
tooltipProps: { tooltip:
|
|
946
|
+
"aria-label": Ne ? m : p,
|
|
947
|
+
tooltipProps: { tooltip: Ne ? m : p },
|
|
947
948
|
onClick: Z
|
|
948
949
|
}),
|
|
949
|
-
|
|
950
|
-
icon: z(
|
|
950
|
+
Ke && /* @__PURE__ */ z(w, {
|
|
951
|
+
icon: z(Fe ? k : te, {
|
|
951
952
|
size: x.LG,
|
|
952
953
|
stroke: S,
|
|
953
954
|
"aria-hidden": !0
|
|
954
955
|
}),
|
|
955
|
-
"aria-label":
|
|
956
|
-
tooltipProps: { tooltip:
|
|
957
|
-
onClick:
|
|
956
|
+
"aria-label": Fe ? _ : h,
|
|
957
|
+
tooltipProps: { tooltip: Fe ? _ : h },
|
|
958
|
+
onClick: Be
|
|
958
959
|
}),
|
|
959
|
-
|
|
960
|
+
qe && /* @__PURE__ */ z(w, {
|
|
960
961
|
icon: /* @__PURE__ */ z(ne, {
|
|
961
962
|
size: x.LG,
|
|
962
963
|
stroke: S
|
|
963
964
|
}),
|
|
964
965
|
"aria-label": u,
|
|
965
966
|
tooltipProps: { tooltip: u },
|
|
966
|
-
onClick:
|
|
967
|
+
onClick: ye
|
|
967
968
|
})
|
|
968
969
|
] }) : null,
|
|
969
|
-
children: /* @__PURE__ */ z(
|
|
970
|
+
children: /* @__PURE__ */ z(Ie, {
|
|
970
971
|
content: r,
|
|
971
972
|
isLoading: t,
|
|
972
973
|
fileName: a,
|
|
@@ -988,18 +989,18 @@ var pe = {
|
|
|
988
989
|
xlsxFormulaLabel: de,
|
|
989
990
|
codeContentLoadingLabel: H,
|
|
990
991
|
codeContentErrorLabel: fe,
|
|
991
|
-
codeContentRetryLabel:
|
|
992
|
-
tableCopyLabel:
|
|
993
|
-
tableCopiedLabel:
|
|
994
|
-
tableDownloadCsvLabel:
|
|
995
|
-
ooxmlHighlightsLabel:
|
|
996
|
-
ooxmlHighlightNavigatedLabel:
|
|
992
|
+
codeContentRetryLabel: me,
|
|
993
|
+
tableCopyLabel: U,
|
|
994
|
+
tableCopiedLabel: he,
|
|
995
|
+
tableDownloadCsvLabel: ge,
|
|
996
|
+
ooxmlHighlightsLabel: _e,
|
|
997
|
+
ooxmlHighlightNavigatedLabel: ve
|
|
997
998
|
},
|
|
998
|
-
styles:
|
|
999
|
-
codeBlockTheme:
|
|
1000
|
-
tableDownloadFilename:
|
|
1001
|
-
loadPdf:
|
|
1002
|
-
configurePdfWorker:
|
|
999
|
+
styles: Ue,
|
|
1000
|
+
codeBlockTheme: ke,
|
|
1001
|
+
tableDownloadFilename: Ce,
|
|
1002
|
+
loadPdf: Ae,
|
|
1003
|
+
configurePdfWorker: je
|
|
1003
1004
|
})
|
|
1004
1005
|
});
|
|
1005
1006
|
}), K = new Set(["html", "htm"]), q = {
|
|
@@ -1016,7 +1017,7 @@ var pe = {
|
|
|
1016
1017
|
[q.xlsx]: r.Xlsx,
|
|
1017
1018
|
[q.pptx]: r.Pptx,
|
|
1018
1019
|
[f.CSV]: r.Csv
|
|
1019
|
-
},
|
|
1020
|
+
}, ze = {
|
|
1020
1021
|
[r.Docx]: q.docx,
|
|
1021
1022
|
[r.Xlsx]: q.xlsx,
|
|
1022
1023
|
[r.Pptx]: q.pptx,
|
|
@@ -1029,16 +1030,16 @@ var pe = {
|
|
|
1029
1030
|
}
|
|
1030
1031
|
let r = e.lastIndexOf(".");
|
|
1031
1032
|
if (r !== -1) return Y[e.slice(r + 1).toLowerCase()];
|
|
1032
|
-
},
|
|
1033
|
+
}, Be = (e, t) => Z(e, t) != null, Ve = (e, t) => {
|
|
1033
1034
|
let n = Z(e, t);
|
|
1034
|
-
return n == null ? void 0 :
|
|
1035
|
-
},
|
|
1035
|
+
return n == null ? void 0 : ze[n];
|
|
1036
|
+
}, He = (e) => {
|
|
1036
1037
|
let t = e.lastIndexOf(".");
|
|
1037
1038
|
return t === -1 ? !1 : J.has(e.slice(t + 1).toLowerCase());
|
|
1038
1039
|
}, Q = (e) => {
|
|
1039
1040
|
let t = e.lastIndexOf(".");
|
|
1040
1041
|
return t === -1 ? !1 : K.has(e.slice(t + 1).toLowerCase());
|
|
1041
|
-
},
|
|
1042
|
+
}, Ue = {
|
|
1042
1043
|
xml: "xml",
|
|
1043
1044
|
csv: "plaintext",
|
|
1044
1045
|
tsv: "plaintext",
|
|
@@ -1086,39 +1087,39 @@ var pe = {
|
|
|
1086
1087
|
gitignore: "plaintext",
|
|
1087
1088
|
dockerfile: "plaintext",
|
|
1088
1089
|
makefile: "plaintext"
|
|
1089
|
-
},
|
|
1090
|
+
}, We = (e) => Ue[e], $ = (e) => ({
|
|
1090
1091
|
type: i.Unsupported,
|
|
1091
1092
|
...e != null && { url: e }
|
|
1092
|
-
}),
|
|
1093
|
+
}), Ge = (e) => ({
|
|
1093
1094
|
type: i.Error,
|
|
1094
1095
|
errorType: n.LoadFailed,
|
|
1095
1096
|
...e != null && { url: e }
|
|
1096
|
-
}),
|
|
1097
|
+
}), Ke = (e) => ({
|
|
1097
1098
|
type: i.Error,
|
|
1098
1099
|
errorType: n.Forbidden,
|
|
1099
1100
|
...e != null && { url: e }
|
|
1100
|
-
}),
|
|
1101
|
+
}), qe = (e) => {
|
|
1101
1102
|
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;
|
|
1102
|
-
},
|
|
1103
|
-
let t =
|
|
1103
|
+
}, Je = (e) => {
|
|
1104
|
+
let t = qe(e);
|
|
1104
1105
|
t != null && URL.revokeObjectURL(t);
|
|
1105
|
-
},
|
|
1106
|
+
}, Ye = {
|
|
1106
1107
|
type: i.PlainText,
|
|
1107
1108
|
text: ""
|
|
1108
|
-
},
|
|
1109
|
-
|
|
1110
|
-
var
|
|
1111
|
-
let [t, n] = L(!1), [r, i] = L(!1), [a, o] = L(
|
|
1109
|
+
}, Xe = A(void 0);
|
|
1110
|
+
Xe.displayName = "AttachmentCanvasContext";
|
|
1111
|
+
var Ze = ({ children: e }) => {
|
|
1112
|
+
let [t, n] = L(!1), [r, i] = L(!1), [a, o] = L(Ye), [s, c] = L(void 0), [l, u] = L(void 0), d = N((e, t) => {
|
|
1112
1113
|
c(e), u(t), i(!0), n(!0);
|
|
1113
1114
|
}, []), f = N((e, t, r) => {
|
|
1114
1115
|
o(e), c(t), u(r), i(!1), n(!0);
|
|
1115
1116
|
}, []), p = N(() => {
|
|
1116
|
-
o(
|
|
1117
|
+
o(Ye), n(!1), i(!1), u(void 0);
|
|
1117
1118
|
}, []);
|
|
1118
1119
|
return P(() => () => {
|
|
1119
|
-
let e =
|
|
1120
|
+
let e = qe(a);
|
|
1120
1121
|
e != null && URL.revokeObjectURL(e);
|
|
1121
|
-
}, [a]), /* @__PURE__ */ z(
|
|
1122
|
+
}, [a]), /* @__PURE__ */ z(Xe.Provider, {
|
|
1122
1123
|
value: F(() => ({
|
|
1123
1124
|
isOpen: t,
|
|
1124
1125
|
isLoading: r,
|
|
@@ -1140,12 +1141,12 @@ var Xe = ({ children: e }) => {
|
|
|
1140
1141
|
]),
|
|
1141
1142
|
children: e
|
|
1142
1143
|
});
|
|
1143
|
-
},
|
|
1144
|
-
let e = se(
|
|
1144
|
+
}, Qe = () => {
|
|
1145
|
+
let e = se(Xe);
|
|
1145
1146
|
if (!e) throw Error("useAttachmentCanvas must be used within an AttachmentCanvasProvider");
|
|
1146
1147
|
return e;
|
|
1147
|
-
},
|
|
1148
|
-
let { ariaLabel: l = "Attachment preview", closeLabel: u = "Close", downloadLabel: d = "Download", unsupportedLabel: f = "Preview is not supported for this file", loadErrorLabel: p = "Failed to load file", forbiddenErrorLabel: m = "You don't have permission to access this file", copyTextLabel: g, copiedTextLabel: _, copyMarkdownLabel: v, copiedMarkdownLabel: y, copyJsonLabel: b, copiedJsonLabel: x, htmlFrameBlockedLabel: S, htmlOpenInNewTabLabel: C, htmlViewSourceLabel: w, htmlViewRenderedLabel: T, pdfThumbnailsLabel: E, pdfShowThumbnailsLabel: D, pdfHideThumbnailsLabel: O, pdfPageNumberLabel: k, pdfContentLoadingLabel: ee, pdfContentErrorLabel: te, pdfContentRetryLabel: ne, xlsxFormulaLabel: re, codeContentLoadingLabel: ie, codeContentErrorLabel: ae, codeContentRetryLabel: oe, tableCopyLabel: A, tableCopiedLabel: j, tableDownloadCsvLabel: M, ooxmlHighlightsLabel: se, ooxmlHighlightNavigatedLabel: P } = e ?? {}, { isOpen: F, isLoading: I, content: L, fileName: ce, closeCanvas: le } =
|
|
1148
|
+
}, $e = M(({ labels: e, isMobile: t = !1, defaultWidth: n, maxWidth: r, codeBlockTheme: o, tableDownloadFilename: s, configurePdfWorker: c }) => {
|
|
1149
|
+
let { ariaLabel: l = "Attachment preview", closeLabel: u = "Close", downloadLabel: d = "Download", unsupportedLabel: f = "Preview is not supported for this file", loadErrorLabel: p = "Failed to load file", forbiddenErrorLabel: m = "You don't have permission to access this file", copyTextLabel: g, copiedTextLabel: _, copyMarkdownLabel: v, copiedMarkdownLabel: y, copyJsonLabel: b, copiedJsonLabel: x, htmlFrameBlockedLabel: S, htmlOpenInNewTabLabel: C, htmlViewSourceLabel: w, htmlViewRenderedLabel: T, pdfThumbnailsLabel: E, pdfShowThumbnailsLabel: D, pdfHideThumbnailsLabel: O, pdfPageNumberLabel: k, pdfContentLoadingLabel: ee, pdfContentErrorLabel: te, pdfContentRetryLabel: ne, xlsxFormulaLabel: re, codeContentLoadingLabel: ie, codeContentErrorLabel: ae, codeContentRetryLabel: oe, tableCopyLabel: A, tableCopiedLabel: j, tableDownloadCsvLabel: M, ooxmlHighlightsLabel: se, ooxmlHighlightNavigatedLabel: P } = e ?? {}, { isOpen: F, isLoading: I, content: L, fileName: ce, closeCanvas: le } = Qe(), R = N(() => {
|
|
1149
1150
|
a(L, ce);
|
|
1150
1151
|
}, [L, ce]), B = N(() => {
|
|
1151
1152
|
(L.type === i.PlainText || L.type === i.Code) && h(L.text);
|
|
@@ -1154,7 +1155,7 @@ var Xe = ({ children: e }) => {
|
|
|
1154
1155
|
}, [L]), ue = N(() => {
|
|
1155
1156
|
L.type === i.Json && h(JSON.stringify(L.value, null, 2));
|
|
1156
1157
|
}, [L]);
|
|
1157
|
-
return /* @__PURE__ */ z(
|
|
1158
|
+
return /* @__PURE__ */ z(Re, {
|
|
1158
1159
|
isOpen: F,
|
|
1159
1160
|
isLoading: I,
|
|
1160
1161
|
onClose: le,
|
|
@@ -1205,23 +1206,23 @@ var Xe = ({ children: e }) => {
|
|
|
1205
1206
|
codeBlockTheme: o,
|
|
1206
1207
|
configurePdfWorker: c
|
|
1207
1208
|
});
|
|
1208
|
-
}),
|
|
1209
|
+
}), et = {
|
|
1209
1210
|
frame: "_frame_g47g7_1",
|
|
1210
1211
|
header: "_header_g47g7_6",
|
|
1211
1212
|
title: "_title_g47g7_10"
|
|
1212
|
-
},
|
|
1213
|
+
}, tt = M(({ 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 }) => {
|
|
1213
1214
|
let u = e.visualizerName.trim();
|
|
1214
1215
|
return /* @__PURE__ */ B("div", {
|
|
1215
|
-
className: g("flex w-full min-w-0 flex-col overflow-hidden rounded-xl border",
|
|
1216
|
+
className: g("flex w-full min-w-0 flex-col overflow-hidden rounded-xl border", et.frame),
|
|
1216
1217
|
style: m({
|
|
1217
1218
|
"--igv-bg": l?.background,
|
|
1218
1219
|
"--igv-border": l?.border,
|
|
1219
1220
|
"--igv-title-text": l?.titleText
|
|
1220
1221
|
}),
|
|
1221
1222
|
children: [/* @__PURE__ */ B("div", {
|
|
1222
|
-
className: g("flex min-h-10 items-center justify-between gap-2 border-b px-4 py-2",
|
|
1223
|
+
className: g("flex min-h-10 items-center justify-between gap-2 border-b px-4 py-2", et.header),
|
|
1223
1224
|
children: [/* @__PURE__ */ z("span", {
|
|
1224
|
-
className: g("min-w-0 truncate", c,
|
|
1225
|
+
className: g("min-w-0 truncate", c, et.title),
|
|
1225
1226
|
children: u
|
|
1226
1227
|
}), /* @__PURE__ */ z("div", {
|
|
1227
1228
|
role: "toolbar",
|
|
@@ -1241,7 +1242,7 @@ var Xe = ({ children: e }) => {
|
|
|
1241
1242
|
}), /* @__PURE__ */ z("div", {
|
|
1242
1243
|
className: "w-full",
|
|
1243
1244
|
style: { height: `${t}px` },
|
|
1244
|
-
children: /* @__PURE__ */ z(
|
|
1245
|
+
children: /* @__PURE__ */ z(Me, {
|
|
1245
1246
|
content: e,
|
|
1246
1247
|
loadingLabel: o,
|
|
1247
1248
|
errorLabel: s,
|
|
@@ -1249,12 +1250,12 @@ var Xe = ({ children: e }) => {
|
|
|
1249
1250
|
})
|
|
1250
1251
|
})]
|
|
1251
1252
|
});
|
|
1252
|
-
}),
|
|
1253
|
+
}), nt = (e, t) => {
|
|
1253
1254
|
let n = e.toLowerCase();
|
|
1254
1255
|
return t.find((e) => e.contentType.split(",").some((e) => e.trim().toLowerCase() === n && e.trim() !== ""));
|
|
1255
|
-
},
|
|
1256
|
+
}, rt = (e, t) => {
|
|
1256
1257
|
if (!(e == null || e === "")) return Object.prototype.hasOwnProperty.call(t, e) ? t[e] : void 0;
|
|
1257
|
-
},
|
|
1258
|
+
}, it = (e) => `${e}:grouped-visualizer`, at = (e, t) => {
|
|
1258
1259
|
let n = (t.contentType ?? "").split(",").map((e) => e.trim().toLowerCase()).filter((e) => e !== ""), r = [], i = [];
|
|
1259
1260
|
return e.forEach((e) => {
|
|
1260
1261
|
if (e.url != null && e.url !== "" && (n.length === 0 || n.includes(e.contentType.toLowerCase()))) {
|
|
@@ -1266,7 +1267,7 @@ var Xe = ({ children: e }) => {
|
|
|
1266
1267
|
claimed: r,
|
|
1267
1268
|
unclaimed: i
|
|
1268
1269
|
};
|
|
1269
|
-
},
|
|
1270
|
+
}, ot = (e) => {
|
|
1270
1271
|
let t;
|
|
1271
1272
|
try {
|
|
1272
1273
|
t = new URL(e).pathname;
|
|
@@ -1279,13 +1280,13 @@ var Xe = ({ children: e }) => {
|
|
|
1279
1280
|
} catch {
|
|
1280
1281
|
return n;
|
|
1281
1282
|
}
|
|
1282
|
-
},
|
|
1283
|
-
let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } =
|
|
1283
|
+
}, st = (e, t) => {
|
|
1284
|
+
let { openCanvas: n, openCanvasLoading: r, closeCanvas: a } = Qe(), { customVisualizers: o, themeId: s, onBeforeOpen: l } = t, u = N(async (t, n, r) => {
|
|
1284
1285
|
if (t.url == null && t.referenceUrl != null) {
|
|
1285
1286
|
let i = e.resolveReferencePdfContent(t);
|
|
1286
1287
|
if (i != null) return r(i, t.name, n);
|
|
1287
1288
|
}
|
|
1288
|
-
let a = t.contentType.toLowerCase(), c =
|
|
1289
|
+
let a = t.contentType.toLowerCase(), c = nt(a, o);
|
|
1289
1290
|
if (c != null) {
|
|
1290
1291
|
let i = await e.resolveVisualizerContent(t, c, s);
|
|
1291
1292
|
if (i != null) return r(i, t.name, n);
|
|
@@ -1318,8 +1319,8 @@ var Xe = ({ children: e }) => {
|
|
|
1318
1319
|
return i == null ? !1 : r(i, t.name, n);
|
|
1319
1320
|
}
|
|
1320
1321
|
}
|
|
1321
|
-
let g = t.name != null && Q(t.name) || t.url != null && Q(
|
|
1322
|
-
if (t.name != null && !
|
|
1322
|
+
let g = t.name != null && Q(t.name) || t.url != null && Q(ot(t.url));
|
|
1323
|
+
if (t.name != null && !He(t.name) && !g) return r($(e.resolveContentUrl(t)), t.name, n);
|
|
1323
1324
|
if (g) {
|
|
1324
1325
|
let a = await e.resolveHtmlContent(t);
|
|
1325
1326
|
return a == null ? e.hasTextSource(t) ? r($(e.resolveContentUrl(t)), t.name, n) : t.url == null ? !1 : r({
|
|
@@ -1327,7 +1328,7 @@ var Xe = ({ children: e }) => {
|
|
|
1327
1328
|
url: t.url
|
|
1328
1329
|
}, t.name, n) : r(a, t.name, n);
|
|
1329
1330
|
}
|
|
1330
|
-
let _ = await e.resolveCodeContent(t,
|
|
1331
|
+
let _ = await e.resolveCodeContent(t, We(m));
|
|
1331
1332
|
return _ == null ? !1 : r(_, t.name, n);
|
|
1332
1333
|
}, [
|
|
1333
1334
|
o,
|
|
@@ -1335,7 +1336,7 @@ var Xe = ({ children: e }) => {
|
|
|
1335
1336
|
e
|
|
1336
1337
|
]);
|
|
1337
1338
|
return { openAttachmentCanvas: N(async (t, o = t.id, s) => {
|
|
1338
|
-
let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (
|
|
1339
|
+
let d = () => s == null || s(), f = (e, t, r) => d() ? (n(e, t, r), !0) : (Je(e), !1);
|
|
1339
1340
|
switch (t.type) {
|
|
1340
1341
|
case c.Image: {
|
|
1341
1342
|
let r = e.resolveImageContent(t);
|
|
@@ -1372,4 +1373,4 @@ var Xe = ({ children: e }) => {
|
|
|
1372
1373
|
]) };
|
|
1373
1374
|
};
|
|
1374
1375
|
//#endregion
|
|
1375
|
-
export {
|
|
1376
|
+
export { pe as ATTACHMENT_CANVAS_CLASS, Re as AttachmentCanvas, Ie as AttachmentCanvasBody, $e as AttachmentCanvasContainer, Ze as AttachmentCanvasProvider, i as AttachmentContentType, n as AttachmentErrorType, ge as CodeContent, tt as InlineGroupedVisualizer, Te as McpAppCanvasRenderer, r as OoxmlFileType, t as OoxmlHighlightKind, Ke as createForbiddenCanvasContent, Ge as createLoadErrorCanvasContent, $ as createUnsupportedCanvasContent, a as downloadAttachmentContent, We as extensionToLanguage, rt as findVisualizerForApplication, nt as findVisualizerForMime, Z as getOoxmlFileType, Ve as getOoxmlMimeType, it as groupedVisualizerCanvasKey, o as isDownloadable, Q as isHtmlPreviewable, Be as isOoxmlPreviewable, He as isTextPreviewable, at as partitionAttachmentsForApplicationVisualizer, Qe as useAttachmentCanvas, st as useOpenAttachmentCanvas };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-attachment-canvas",
|
|
3
3
|
"description": "Canvas viewer for rendering attachment content — images, PDFs, Office documents, CSV, JSON, markdown, and plain text",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.50",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
30
30
|
"@modelcontextprotocol/ext-apps": "1.7.5",
|
|
31
31
|
"pdfjs-dist": "^5.4.149",
|
|
32
|
-
"@epam/ai-dial-sidebar": "1.2.0-dev.
|
|
32
|
+
"@epam/ai-dial-sidebar": "1.2.0-dev.50"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
35
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.50",
|
|
36
36
|
"@epam/ai-dial-ui-kit": "^0.15.0-dev.7",
|
|
37
37
|
"react": "^19.2.8"
|
|
38
38
|
},
|