@epam/ai-dial-attachment-canvas 1.1.0-dev.21 → 1.1.0-dev.211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AttachmentCanvas/AttachmentCanvas.d.ts +1 -0
- package/components/AttachmentCanvas/AttachmentCanvas.d.ts.map +1 -1
- package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts +4 -0
- package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts.map +1 -0
- package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts +2 -0
- package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
- package/components/CodeContent/CodeContent.d.ts +13 -0
- package/components/CodeContent/CodeContent.d.ts.map +1 -0
- package/components/HtmlContent/HtmlContent.d.ts +21 -0
- package/components/HtmlContent/HtmlContent.d.ts.map +1 -0
- package/components/PdfContent/PdfContent.d.ts +31 -0
- package/components/PdfContent/PdfContent.d.ts.map +1 -1
- package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts +25 -0
- package/components/VisualizerCanvasRenderer/VisualizerCanvasRenderer.d.ts.map +1 -0
- package/constants/file.d.ts +2 -0
- package/constants/file.d.ts.map +1 -1
- package/context/AttachmentCanvasContext.d.ts +7 -1
- package/context/AttachmentCanvasContext.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +5 -2
- package/index.d.ts.map +1 -1
- package/index.js +19647 -1743
- package/models/attachment-canvas.d.ts +137 -10
- package/models/attachment-canvas.d.ts.map +1 -1
- package/package.json +8 -5
- package/types/attachment-canvas.d.ts +3 -0
- package/types/attachment-canvas.d.ts.map +1 -1
- package/utils/content.d.ts +4 -0
- package/utils/content.d.ts.map +1 -1
- package/utils/download.d.ts.map +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CodeBlockTheme } from '@epam/ai-dial-chat-shared';
|
|
1
|
+
import { CodeBlockTheme, CustomVisualizerDataLayout } from '@epam/ai-dial-chat-shared';
|
|
2
2
|
import { SidebarPanelStyles } from '@epam/ai-dial-sidebar';
|
|
3
3
|
import { InputHighlightData } from '@epam/pdf-highlighter-kit';
|
|
4
4
|
import { CSSProperties } from 'react';
|
|
@@ -51,6 +51,41 @@ export interface AudioCanvasContent {
|
|
|
51
51
|
/** MIME type forwarded to the `<audio>` element (e.g. `audio/webm`). */
|
|
52
52
|
mimeType?: string;
|
|
53
53
|
}
|
|
54
|
+
/** Content payload for syntax-highlighted source-code or text file attachments. */
|
|
55
|
+
export interface CodeCanvasContent {
|
|
56
|
+
/** Discriminates the content type to select the correct renderer. */
|
|
57
|
+
type: AttachmentContentType.Code;
|
|
58
|
+
/** The raw source text to display. */
|
|
59
|
+
text: string;
|
|
60
|
+
/** `react-syntax-highlighter` language identifier (e.g. `'typescript'`). `undefined` renders plain monospace. */
|
|
61
|
+
language?: string;
|
|
62
|
+
}
|
|
63
|
+
/** Content payload for HTML file attachments or external HTML URL sources. */
|
|
64
|
+
export interface HtmlCanvasContent {
|
|
65
|
+
/** Discriminates the content type to select the correct renderer. */
|
|
66
|
+
type: AttachmentContentType.Html;
|
|
67
|
+
/** Full HTML text rendered via `srcdoc` in a sandboxed iframe. Used for file attachments. */
|
|
68
|
+
srcdoc?: string;
|
|
69
|
+
/** External URL rendered via `src` in a sandboxed iframe. Used for external link sources. */
|
|
70
|
+
url?: string;
|
|
71
|
+
}
|
|
72
|
+
/** Content payload for a custom-visualizer attachment rendered inside a sandboxed iframe. */
|
|
73
|
+
export interface VisualizerCanvasContent {
|
|
74
|
+
/** Discriminates the content type to select the correct renderer. */
|
|
75
|
+
type: AttachmentContentType.Visualizer;
|
|
76
|
+
/** Iframe `src`, resolved from the matching registry entry's `url`. */
|
|
77
|
+
url: string;
|
|
78
|
+
/** The attachment's own MIME type (not the registry entry's raw, possibly comma-separated, `contentType`). */
|
|
79
|
+
mimeType: string;
|
|
80
|
+
/** Opaque attachment payload consumed by the visualizer. */
|
|
81
|
+
data: unknown;
|
|
82
|
+
/** Presentation layout hints (`themeId`, `width`, `height`, `mobileHeight`). */
|
|
83
|
+
layout: CustomVisualizerDataLayout;
|
|
84
|
+
/** postMessage protocol namespace — MUST equal the registry entry's `title`, or the iframe never receives data. */
|
|
85
|
+
visualizerName: string;
|
|
86
|
+
/** Milliseconds to wait for a `send()` request's response before rejecting. From the registry entry; does NOT bound the handshake. */
|
|
87
|
+
requestTimeout?: number;
|
|
88
|
+
}
|
|
54
89
|
/** Content payload for attachments whose format cannot be previewed. */
|
|
55
90
|
export interface UnsupportedCanvasContent {
|
|
56
91
|
/** Discriminates the content type to select the correct renderer. */
|
|
@@ -68,13 +103,45 @@ export interface ErrorCanvasContent {
|
|
|
68
103
|
url?: string;
|
|
69
104
|
}
|
|
70
105
|
/** The content payload passed to AttachmentCanvas. */
|
|
71
|
-
export type AttachmentCanvasContent = PlainTextCanvasContent | ImageCanvasContent | AudioCanvasContent | MarkdownCanvasContent | JsonCanvasContent | PdfCanvasContent | UnsupportedCanvasContent | ErrorCanvasContent;
|
|
106
|
+
export type AttachmentCanvasContent = PlainTextCanvasContent | ImageCanvasContent | AudioCanvasContent | MarkdownCanvasContent | JsonCanvasContent | PdfCanvasContent | CodeCanvasContent | HtmlCanvasContent | VisualizerCanvasContent | UnsupportedCanvasContent | ErrorCanvasContent;
|
|
72
107
|
/** Themeable color overrides for the AttachmentCanvas content body. */
|
|
73
108
|
export interface AttachmentCanvasColors {
|
|
74
109
|
/** Primary text color for the content body. */
|
|
75
110
|
text?: string;
|
|
111
|
+
/** Status/summary line text color. Defaults to `--text-secondary`. */
|
|
112
|
+
statusText?: string;
|
|
113
|
+
/** Error icon color. Defaults to `--text-error`. */
|
|
114
|
+
errorIcon?: string;
|
|
115
|
+
/** "Open in new tab" link color in the blocked-iframe panel. Defaults to `--text-accent`. */
|
|
116
|
+
openInNewTabText?: string;
|
|
117
|
+
/** Border color of the JSON viewer wrapper. Defaults to `--stroke-secondary`. */
|
|
118
|
+
jsonBorder?: string;
|
|
119
|
+
/** Background color of the JSON viewer wrapper. Defaults to `--bg-layer-1`. */
|
|
120
|
+
jsonBackground?: string;
|
|
121
|
+
/** JSON key/label color. Defaults to `--text-primary`. */
|
|
122
|
+
jsonLabel?: string;
|
|
123
|
+
/** JSON expandable key/label color. Defaults to `--text-primary`. */
|
|
124
|
+
jsonClickableLabel?: string;
|
|
125
|
+
/** JSON punctuation (braces, commas, colons) color. Defaults to `--text-secondary`. */
|
|
126
|
+
jsonPunctuation?: string;
|
|
127
|
+
/** JSON string-literal color. Defaults to `--text-success`. */
|
|
128
|
+
jsonString?: string;
|
|
129
|
+
/** JSON number-literal color. Defaults to `--text-accent`. */
|
|
130
|
+
jsonNumber?: string;
|
|
131
|
+
/** JSON boolean-literal color. Defaults to `--text-warning`. */
|
|
132
|
+
jsonBoolean?: string;
|
|
133
|
+
/** JSON `null`-literal color. Defaults to `--text-secondary`. */
|
|
134
|
+
jsonNull?: string;
|
|
135
|
+
/** Expand/collapse triangle color. Defaults to `--text-secondary`. */
|
|
136
|
+
jsonToggleIcon?: string;
|
|
137
|
+
/** Expand/collapse triangle color on hover. Defaults to `--text-primary`. */
|
|
138
|
+
jsonToggleIconHover?: string;
|
|
139
|
+
/** Text color of the collapsed-content ellipsis. Defaults to `--text-secondary`. */
|
|
140
|
+
jsonCollapsedText?: string;
|
|
141
|
+
/** Background color of the collapsed-content ellipsis. Defaults to `--bg-layer-raised`. */
|
|
142
|
+
jsonCollapsedBackground?: string;
|
|
76
143
|
}
|
|
77
|
-
/** Themeable typography overrides for the AttachmentCanvas content body. */
|
|
144
|
+
/** Themeable typography overrides for the AttachmentCanvas plain-text content body. */
|
|
78
145
|
export interface AttachmentCanvasTypography {
|
|
79
146
|
/** CSS font-family value. */
|
|
80
147
|
fontFamily?: string;
|
|
@@ -87,27 +154,31 @@ export interface AttachmentCanvasTypography {
|
|
|
87
154
|
/** CSS letter-spacing value. */
|
|
88
155
|
letterSpacing?: string;
|
|
89
156
|
/**
|
|
90
|
-
* A single CSS utility class applied to the content body instead of
|
|
91
|
-
* individual typography
|
|
92
|
-
* are ignored.
|
|
157
|
+
* A single CSS utility class applied to the content body instead of the
|
|
158
|
+
* individual typography fields above. When set, those fields are ignored.
|
|
93
159
|
*/
|
|
94
160
|
fontClassName?: string;
|
|
161
|
+
/** CSS utility class applied to the JSON tree viewer. Defaults to `'dial-code-text'`. */
|
|
162
|
+
jsonClassName?: string;
|
|
95
163
|
}
|
|
96
|
-
/**
|
|
97
|
-
export interface
|
|
164
|
+
/** Style override prop for `AttachmentCanvasBody`'s content-rendering area. */
|
|
165
|
+
export interface AttachmentCanvasBodyStyles {
|
|
98
166
|
/** Color overrides for the content body, applied as CSS custom properties. */
|
|
99
167
|
colors?: AttachmentCanvasColors;
|
|
100
168
|
/** Typography overrides for the content body. */
|
|
101
169
|
typography?: AttachmentCanvasTypography;
|
|
102
170
|
/** Extra class name(s) merged onto the scrollable content body element. */
|
|
103
171
|
bodyClassName?: string;
|
|
104
|
-
/** Extra class name(s) merged onto the panel width wrapper. */
|
|
105
|
-
className?: string;
|
|
106
172
|
/**
|
|
107
173
|
* Arbitrary CSS custom properties applied inline to the content body.
|
|
108
174
|
* Merged after the typed color/typography vars, so they can override them.
|
|
109
175
|
*/
|
|
110
176
|
cssVars?: CSSProperties;
|
|
177
|
+
}
|
|
178
|
+
/** Combined style override prop for AttachmentCanvas. */
|
|
179
|
+
export interface AttachmentCanvasStyles extends AttachmentCanvasBodyStyles {
|
|
180
|
+
/** Extra class name(s) merged onto the panel width wrapper. */
|
|
181
|
+
className?: string;
|
|
111
182
|
/** Style overrides forwarded to the underlying SidebarPanel (panel chrome). */
|
|
112
183
|
panelStyles?: SidebarPanelStyles;
|
|
113
184
|
}
|
|
@@ -137,11 +208,31 @@ export interface AttachmentCanvasLabels {
|
|
|
137
208
|
copyJsonLabel?: string;
|
|
138
209
|
/** Tooltip and accessible label for the copy-JSON button after a successful copy. Defaults to `'Copied!'`. */
|
|
139
210
|
copiedJsonLabel?: string;
|
|
211
|
+
/** Message shown inside the visualizer canvas when the iframe handshake fails. Defaults to `'Failed to load visualizer'`. */
|
|
212
|
+
visualizerErrorLabel?: string;
|
|
213
|
+
/** Message shown when a URL-sourced iframe is blocked by the page's CSP or X-Frame-Options. Defaults to `'This page cannot be displayed in preview'`. */
|
|
214
|
+
htmlFrameBlockedLabel?: string;
|
|
215
|
+
/** Label for the "Open in new tab" fallback link shown alongside `htmlFrameBlockedLabel`. Defaults to `'Open in new tab'`. */
|
|
216
|
+
htmlOpenInNewTabLabel?: string;
|
|
217
|
+
/** Tooltip and `aria-label` for the toggle button when the rendered view is active (clicking switches to source). Defaults to `'View source'`. */
|
|
218
|
+
htmlViewSourceLabel?: string;
|
|
219
|
+
/** Tooltip and `aria-label` for the toggle button when the source view is active (clicking switches back to rendered). Defaults to `'View rendered'`. */
|
|
220
|
+
htmlViewRenderedLabel?: string;
|
|
221
|
+
/** Accessible name for the PDF viewer's floating thumbnails panel region. Defaults to `'Thumbnails'`. */
|
|
222
|
+
pdfThumbnailsLabel?: string;
|
|
223
|
+
/** Accessible label for the FAB button that opens the PDF thumbnails panel. Defaults to `'Show thumbnails'`. */
|
|
224
|
+
pdfShowThumbnailsLabel?: string;
|
|
225
|
+
/** Accessible label for the FAB button that closes the PDF thumbnails panel. Defaults to `'Hide thumbnails'`. */
|
|
226
|
+
pdfHideThumbnailsLabel?: string;
|
|
227
|
+
/** Accessible label for the current-page number input at the top of the PDF thumbnails panel. Defaults to `'Page number'`. */
|
|
228
|
+
pdfPageNumberLabel?: string;
|
|
140
229
|
}
|
|
141
230
|
/** Props for the AttachmentCanvas component. */
|
|
142
231
|
export interface AttachmentCanvasProps {
|
|
143
232
|
/** Controls visibility of the side panel. */
|
|
144
233
|
isOpen: boolean;
|
|
234
|
+
/** When `true`, renders a loading spinner instead of content and hides action buttons. Defaults to `false`. */
|
|
235
|
+
isLoading?: boolean;
|
|
145
236
|
/** Called when the user activates the built-in close button. */
|
|
146
237
|
onClose: () => void;
|
|
147
238
|
/** The attachment content to render inside the canvas. */
|
|
@@ -179,4 +270,40 @@ export interface AttachmentCanvasProps {
|
|
|
179
270
|
*/
|
|
180
271
|
loadPdf?: (url: string) => Promise<Blob>;
|
|
181
272
|
}
|
|
273
|
+
/** User-visible strings for `AttachmentCanvasBody`'s content states. */
|
|
274
|
+
export type AttachmentCanvasBodyLabels = Pick<AttachmentCanvasLabels, 'unsupportedLabel' | 'loadErrorLabel' | 'forbiddenErrorLabel' | 'visualizerErrorLabel' | 'htmlFrameBlockedLabel' | 'htmlOpenInNewTabLabel' | 'pdfThumbnailsLabel' | 'pdfShowThumbnailsLabel' | 'pdfHideThumbnailsLabel' | 'pdfPageNumberLabel'>;
|
|
275
|
+
/** Props for the `AttachmentCanvasBody` component. */
|
|
276
|
+
export interface AttachmentCanvasBodyProps {
|
|
277
|
+
/** The attachment content to render. */
|
|
278
|
+
content: AttachmentCanvasContent;
|
|
279
|
+
/** When `true`, renders a loading spinner instead of content. Defaults to `false`. */
|
|
280
|
+
isLoading?: boolean;
|
|
281
|
+
/** File name used for image `alt` text and the audio player's accessible label. */
|
|
282
|
+
fileName?: string;
|
|
283
|
+
/**
|
|
284
|
+
* Whether an `Html` content type renders its raw source instead of the
|
|
285
|
+
* sandboxed rendered view. Ignored for every other content type. Defaults
|
|
286
|
+
* to `false`. The host owns this toggle's state since the corresponding
|
|
287
|
+
* toggle button lives outside this component.
|
|
288
|
+
*/
|
|
289
|
+
isHtmlSourceView?: boolean;
|
|
290
|
+
/** User-visible strings for content states (unsupported/error/HTML-blocked messages). */
|
|
291
|
+
labels?: AttachmentCanvasBodyLabels;
|
|
292
|
+
/** Style overrides for the content body. */
|
|
293
|
+
styles?: AttachmentCanvasBodyStyles;
|
|
294
|
+
/** Syntax highlight color theme forwarded to MarkdownRenderer/CodeContent code blocks. */
|
|
295
|
+
codeBlockTheme?: CodeBlockTheme;
|
|
296
|
+
/**
|
|
297
|
+
* Fetches a PDF file by URL and returns its bytes as a `Blob`. Used when
|
|
298
|
+
* content type is `Pdf` to load the file before rendering. Defaults to a
|
|
299
|
+
* plain `fetch` if not provided.
|
|
300
|
+
*/
|
|
301
|
+
loadPdf?: (url: string) => Promise<Blob>;
|
|
302
|
+
/**
|
|
303
|
+
* Hides the PDF renderer's own title/zoom toolbar row for `Pdf` content —
|
|
304
|
+
* for hosts that render their own header and don't want it duplicated.
|
|
305
|
+
* Ignored for every other content type. Defaults to `false`.
|
|
306
|
+
*/
|
|
307
|
+
hidePdfToolbar?: boolean;
|
|
308
|
+
}
|
|
182
309
|
//# sourceMappingURL=attachment-canvas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/models/attachment-canvas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/models/attachment-canvas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,0BAA0B,EAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EACL,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,4BAA4B,CAAC;AAEpC,kDAAkD;AAClD,MAAM,WAAW,sBAAsB;IACrC,qEAAqE;IACrE,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC;IACtC,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,6CAA6C;AAC7C,MAAM,WAAW,kBAAkB;IACjC,qEAAqE;IACrE,IAAI,EAAE,qBAAqB,CAAC,KAAK,CAAC;IAClC,yEAAyE;IACzE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qDAAq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0BAA0B,GAAG,IAAI,CAC3C,sBAAsB,EACpB,kBAAkB,GAClB,gBAAgB,GAChB,qBAAqB,GACrB,sBAAsB,GACtB,uBAAuB,GACvB,uBAAuB,GACvB,oBAAoB,GACpB,wBAAwB,GACxB,wBAAwB,GACxB,oBAAoB,CACvB,CAAC;AAEF,sDAAsD;AACtD,MAAM,WAAW,yBAAyB;IACxC,wCAAwC;IACxC,OAAO,EAAE,uBAAuB,CAAC;IACjC,sFAAsF;IACtF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,yFAAyF;IACzF,MAAM,CAAC,EAAE,0BAA0B,CAAC;IACpC,4CAA4C;IAC5C,MAAM,CAAC,EAAE,0BAA0B,CAAC;IACpC,0FAA0F;IAC1F,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-attachment-canvas",
|
|
3
3
|
"description": "Canvas viewer for rendering attachment content — images, PDFs, JSON, markdown, and plain text",
|
|
4
|
-
"version": "1.1.0-dev.
|
|
4
|
+
"version": "1.1.0-dev.211",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -17,14 +17,17 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@epam/ai-dial-chat-shared": "1.1.0-dev.
|
|
21
|
-
"@epam/ai-dial-
|
|
22
|
-
"@epam/ai-dial-
|
|
20
|
+
"@epam/ai-dial-chat-shared": "1.1.0-dev.211",
|
|
21
|
+
"@epam/ai-dial-shared": "0.48.0",
|
|
22
|
+
"@epam/ai-dial-sidebar": "1.1.0-dev.211",
|
|
23
|
+
"@epam/ai-dial-visualizer-connector": "0.48.0",
|
|
24
|
+
"@epam/ai-dial-ui-kit": "^0.13.0-dev.26",
|
|
23
25
|
"@epam/pdf-highlighter-kit": ">=0.0.14",
|
|
24
26
|
"@tabler/icons-react": "^3.44.0",
|
|
25
27
|
"react": "^19.0.0",
|
|
26
28
|
"react-json-view-lite": "^2.5.0",
|
|
27
|
-
"
|
|
29
|
+
"react-syntax-highlighter": "^16.1.1",
|
|
30
|
+
"@epam/ai-dial-react-pdf-highlighter": "0.2.0-dev.22"
|
|
28
31
|
},
|
|
29
32
|
"dependencies": {},
|
|
30
33
|
"repository": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/types/attachment-canvas.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,oBAAY,qBAAqB;IAC/B,SAAS,eAAe;IACxB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,WAAW,gBAAgB;IAC3B,KAAK,UAAU;CAChB;AAED,iEAAiE;AACjE,oBAAY,mBAAmB;IAC7B,8EAA8E;IAC9E,UAAU,gBAAgB;IAC1B,wFAAwF;IACxF,SAAS,cAAc;CACxB"}
|
|
1
|
+
{"version":3,"file":"attachment-canvas.d.ts","sourceRoot":"","sources":["../../src/types/attachment-canvas.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,oBAAY,qBAAqB;IAC/B,SAAS,eAAe;IACxB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,KAAK,UAAU;CAChB;AAED,iEAAiE;AACjE,oBAAY,mBAAmB;IAC7B,8EAA8E;IAC9E,UAAU,gBAAgB;IAC1B,wFAAwF;IACxF,SAAS,cAAc;CACxB"}
|
package/utils/content.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ErrorCanvasContent, UnsupportedCanvasContent } from '../models/attachment-canvas';
|
|
2
2
|
/** Returns true if the file name has an extension known to be text-previewable. */
|
|
3
3
|
export declare const isTextPreviewable: (name: string) => boolean;
|
|
4
|
+
/** Returns true if the file name has an HTML extension (`html` or `htm`). */
|
|
5
|
+
export declare const isHtmlPreviewable: (name: string) => boolean;
|
|
6
|
+
/** Maps a lowercased file extension (without leading dot) to a `react-syntax-highlighter` language identifier. Returns `undefined` for unmapped extensions. */
|
|
7
|
+
export declare const extensionToLanguage: (ext: string) => string | undefined;
|
|
4
8
|
/** Creates an unsupported-format content payload. */
|
|
5
9
|
export declare const createUnsupportedCanvasContent: (url?: string) => UnsupportedCanvasContent;
|
|
6
10
|
/** Creates a content payload for a file that failed to load (network error or non-403 failure). */
|
package/utils/content.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/utils/content.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,6BAA6B,CAAC;AAMrC,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,OAIhD,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,8BAA8B,GACzC,MAAM,MAAM,KACX,wBAGD,CAAC;AAEH,mGAAmG;AACnG,eAAO,MAAM,4BAA4B,GACvC,MAAM,MAAM,KACX,kBAID,CAAC;AAEH,mGAAmG;AACnG,eAAO,MAAM,4BAA4B,GACvC,MAAM,MAAM,KACX,kBAID,CAAC"}
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/utils/content.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,6BAA6B,CAAC;AAMrC,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,OAIhD,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,OAIhD,CAAC;AAoDF,+JAA+J;AAC/J,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,SAC/B,CAAC;AAE7B,qDAAqD;AACrD,eAAO,MAAM,8BAA8B,GACzC,MAAM,MAAM,KACX,wBAGD,CAAC;AAEH,mGAAmG;AACnG,eAAO,MAAM,4BAA4B,GACvC,MAAM,MAAM,KACX,kBAID,CAAC;AAEH,mGAAmG;AACnG,eAAO,MAAM,4BAA4B,GACvC,MAAM,MAAM,KACX,kBAID,CAAC"}
|
package/utils/download.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/utils/download.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAM3E,kEAAkE;AAClE,eAAO,MAAM,cAAc,GAAI,SAAS,uBAAuB,KAAG,
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/utils/download.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAM3E,kEAAkE;AAClE,eAAO,MAAM,cAAc,GAAI,SAAS,uBAAuB,KAAG,OAsBjE,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,GAAU,KAAK,MAAM,KAAG,OAAO,CAAC,IAAI,CAIhE,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,GACpC,SAAS,uBAAuB,EAChC,WAAW,MAAM,KAChB,IAoDF,CAAC"}
|