@epam/ai-dial-chat-shared 1.2.0-dev.1 → 1.2.0-dev.101
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/MarkdownRenderer/CodeBlock/CodeBlock.js +64 -63
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +6 -6
- package/components/MarkdownRenderer/MarkdownRenderer.js +1 -1
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +19 -18
- package/components/MarkdownRenderer/Table/MarkdownTable.js +74 -56
- package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +11 -11
- package/components/MarkdownRenderer/Table/table-serialization.js +23 -3
- package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.js +48 -62
- package/constants/mime-types.js +49 -2
- package/constants/public-class-names.js +10 -0
- package/constants/resizable-fields.js +1 -1
- package/file-manager/DialFileManagerShell/DialFileManagerShell.js +160 -159
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +23 -22
- package/file-manager/UploadProgressModal/UploadProgressModal.js +26 -32
- package/file-manager.d.ts +10 -6
- package/index.css +2 -2
- package/index.d.ts +112 -9
- package/index.js +56 -56
- package/markdown.d.ts +15 -7
- package/markdown.js +12 -11
- package/package.json +3 -3
- package/types/attachment.js +1 -1
- package/utils/file-download.js +6 -6
- package/utils/latex.js +5 -3
- package/utils/merge-class.js +5 -4
- package/utils/mime-type.js +10 -6
package/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* empty css */
|
|
2
1
|
import { ConversationTransferErrorCode as e, ConversationTransferJobStatus as t, ConversationTransferSubjectKind as n, ConversationTransferUnitKind as r, ConversationTransferWarningCode as i } from "./models/conversation-transfer.js";
|
|
3
2
|
import { FilterTab as a } from "./models/conversation-classification.js";
|
|
4
3
|
import { MessageRating as o, MessageRole as s, RequestStatus as c, StageStatus as l, StatusEvent as u } from "./models/chat.js";
|
|
@@ -7,58 +6,59 @@ import { AttachmentErrorReason as f, AttachmentType as p } from "./types/attachm
|
|
|
7
6
|
import { CatalogEntityType as m } from "./types/entity-type.js";
|
|
8
7
|
import { FileExtension as h, MIMEType as g } from "./types/mime-type.js";
|
|
9
8
|
import { CodeBlockTheme as _ } from "./types/code-editor.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { isAudioTranscriptionSupported as
|
|
19
|
-
import { copyMarkdownAsRichText as
|
|
20
|
-
import { formatLastUsed as
|
|
21
|
-
import { formatFileSize as
|
|
22
|
-
import { formatCost as
|
|
23
|
-
import { base64ToBlob as
|
|
24
|
-
import { ENTITY_TYPE_BG_COLOR as
|
|
25
|
-
import { PROMPT_PARAM_DEFAULT_SEPARATOR as
|
|
26
|
-
import { generateUUID as
|
|
27
|
-
import { BASE_LG_ICON_PROPS as
|
|
28
|
-
import { HIDDEN_FILE as
|
|
29
|
-
import { TAG_INPUT_TAG_CLASS_NAME as
|
|
30
|
-
import { MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as
|
|
31
|
-
import { MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as
|
|
32
|
-
import { SELECT_LIST_MAX_HEIGHT_CLASS_NAME as
|
|
33
|
-
import { DESKTOP_BREAKPOINT_PX as
|
|
34
|
-
import { pickAvatarColor as
|
|
35
|
-
import { extractInitials as
|
|
36
|
-
import { InitialsAvatar as
|
|
37
|
-
import { DeploymentIcon as
|
|
38
|
-
import { CopyButton as
|
|
39
|
-
import { PanelEmptyState as
|
|
40
|
-
import { ItemHeader as
|
|
41
|
-
import { EntityTypeLabel as
|
|
42
|
-
import { FeaturedChip as
|
|
43
|
-
import { EntityHeader as
|
|
44
|
-
import { ResourceSummary as
|
|
45
|
-
import { TableHeader as
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
|
|
9
|
+
import { MIME_TYPE_ALIASES as v, MIME_TYPE_AUDIO_PREFIX as y, MIME_TYPE_EXT_MAP as b, MIME_TYPE_WILDCARD as x } from "./constants/mime-types.js";
|
|
10
|
+
import { getAttachmentTypeFromMime as S, getBaseMimeType as C, inferMimeTypeFromPath as w, normalizeMimeType as T, stripUrlQueryAndFragment as E } from "./utils/mime-type.js";
|
|
11
|
+
import { isAnnotationSelector as D, normalizePersistedHtmlTagAttachmentType as O, normalizeRawAnnotations as k } from "./utils/annotation.js";
|
|
12
|
+
import { PROHIBITED_CONVERSATION_NAME_CHARS_RE as A, getUtf8ByteLength as j, sanitizeConversationName as M, stripTrailingDots as N, truncateToUtf8Bytes as P } from "./utils/string-utils.js";
|
|
13
|
+
import { mergeClasses as F } from "./utils/merge-class.js";
|
|
14
|
+
import { buildCssVars as I } from "./utils/build-css-vars.js";
|
|
15
|
+
import { isStatusMessage as L } from "./utils/message.js";
|
|
16
|
+
import { messageAttachmentToDisplayAttachment as R, messageAttachmentsToDisplayAttachments as z } from "./utils/message-attachment-to-display.js";
|
|
17
|
+
import { isAudioTranscriptionSupported as B } from "./utils/is-audio-transcription-supported.js";
|
|
18
|
+
import { copyMarkdownAsRichText as V, copyToClipboard as H, markdownToRichTextHtml as U } from "./utils/copy-to-clipboard.js";
|
|
19
|
+
import { formatLastUsed as W } from "./utils/format-last-used.js";
|
|
20
|
+
import { formatFileSize as G } from "./utils/format-file-size.js";
|
|
21
|
+
import { formatCost as K, formatPrice as q, formatUnitPrice as J } from "./utils/format-price.js";
|
|
22
|
+
import { base64ToBlob as Y, downloadTextFile as X, ensureDownloadFilename as Z, getFileExtensionForLanguage as Q, triggerAnchorDownload as $, triggerBlobDownload as ee, tryBase64ToBytes as te } from "./utils/file-download.js";
|
|
23
|
+
import { ENTITY_TYPE_BG_COLOR as ne, ENTITY_TYPE_COLOR as re } from "./constants/entity-colors.js";
|
|
24
|
+
import { PROMPT_PARAM_DEFAULT_SEPARATOR as ie, PROMPT_PARAM_PATTERN as ae, PROMPT_VARIABLE_CLASS_NAME as oe, buildPromptParamDefaults as se, extractPromptParams as ce, rehypePromptVariables as le, resolvePromptParams as ue } from "./utils/prompt-variables.js";
|
|
25
|
+
import { generateUUID as de } from "./utils/generate-uuid.js";
|
|
26
|
+
import { BASE_LG_ICON_PROPS as fe, BASE_MD_ICON_PROPS as pe } from "./constants/icon.js";
|
|
27
|
+
import { HIDDEN_FILE as me } from "./constants/dial.js";
|
|
28
|
+
import { TAG_INPUT_TAG_CLASS_NAME as he } from "./constants/tag-input.js";
|
|
29
|
+
import { MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as ge, RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE as _e, RESIZABLE_TEXTAREA_CLASS_NAME as ve } from "./constants/resizable-fields.js";
|
|
30
|
+
import { MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as ye } from "./constants/markdown-editor.js";
|
|
31
|
+
import { SELECT_LIST_MAX_HEIGHT_CLASS_NAME as be, SELECT_LIST_MAX_HEIGHT_PX as xe } from "./constants/select-list.js";
|
|
32
|
+
import { DESKTOP_BREAKPOINT_PX as Se, DESKTOP_MEDIA_QUERY as Ce, MOBILE_MAX_WIDTH_PX as we, MOBILE_MEDIA_QUERY as Te } from "./constants/breakpoint.js";
|
|
33
|
+
import { pickAvatarColor as Ee } from "./utils/avatar-color.js";
|
|
34
|
+
import { extractInitials as De } from "./utils/initials.js";
|
|
35
|
+
import { InitialsAvatar as Oe } from "./components/InitialsAvatar/InitialsAvatar.js";
|
|
36
|
+
import { DeploymentIcon as ke } from "./components/DeploymentIcon/DeploymentIcon.js";
|
|
37
|
+
import { CopyButton as Ae, CopyIconButton as je } from "./components/CopyButton/CopyButton.js";
|
|
38
|
+
import { PanelEmptyState as Me } from "./components/PanelEmptyState/PanelEmptyState.js";
|
|
39
|
+
import { ItemHeader as Ne } from "./components/ItemHeader/ItemHeader.js";
|
|
40
|
+
import { EntityTypeLabel as Pe } from "./components/EntityTypeLabel/EntityTypeLabel.js";
|
|
41
|
+
import { FeaturedChip as Fe } from "./components/FeaturedChip/FeaturedChip.js";
|
|
42
|
+
import { EntityHeader as Ie } from "./components/EntityHeader/EntityHeader.js";
|
|
43
|
+
import { ResourceSummary as Le } from "./components/ResourceSummary/ResourceSummary.js";
|
|
44
|
+
import { TableHeader as Re } from "./components/MarkdownRenderer/Table/TableHeader.js";
|
|
45
|
+
import { CHAT_SHARED_CLASS as ze } from "./constants/public-class-names.js";
|
|
46
|
+
import { useCodeCopy as Be } from "./hooks/useCodeCopy.js";
|
|
47
|
+
import { restrainedSyntaxTheme as Ve } from "./components/MarkdownRenderer/CodeBlock/syntax-theme.js";
|
|
48
|
+
import { MarkdownCodeBlock as He } from "./components/MarkdownRenderer/CodeBlock/CodeBlock.js";
|
|
49
|
+
import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as Ue, MARKDOWN_TABLE_CSV_MIME_TYPE as We, MarkdownTableCopyFormat as Ge, serializeMarkdownTableRows as Ke } from "./components/MarkdownRenderer/Table/table-serialization.js";
|
|
50
|
+
import { MarkdownTable as qe } from "./components/MarkdownRenderer/Table/MarkdownTable.js";
|
|
51
|
+
import { MarkdownRenderer as Je, defaultMarkdownComponents as Ye } from "./components/MarkdownRenderer/MarkdownRenderer.js";
|
|
52
|
+
import { COMPACT_MARKDOWN_CLASS_NAMES as Xe, DEFAULT_MARKDOWN_CLASS_NAMES as Ze } from "./components/MarkdownRenderer/markdown-class-names.js";
|
|
53
|
+
import { MDMessageViewer as Qe } from "./components/MarkdownRenderer/MDMessageViewer.js";
|
|
54
|
+
import { MarkdownWithPlaceholders as $e } from "./components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js";
|
|
55
|
+
import { useCollapsedText as et } from "./hooks/useCollapsedText.js";
|
|
56
|
+
import { useAvailableHeightCap as tt } from "./hooks/useAvailableHeightCap.js";
|
|
57
|
+
import { useIsMobile as nt } from "./hooks/useIsMobile.js";
|
|
58
|
+
import { DialFileManagerActionProfile as rt, DialFileManagerVariant as it } from "./file-manager/file-manager-variant.js";
|
|
59
|
+
import { getParentFolderPath as at, isHiddenPath as ot } from "./file-manager/path.js";
|
|
60
|
+
import { FileUploadStatus as st } from "./file-manager/upload-batch.js";
|
|
61
|
+
import { useGridEditingScroll as ct } from "./file-manager/useGridEditingScroll/useGridEditingScroll.js";
|
|
62
|
+
import { OperationLoaderModal as lt } from "./file-manager/OperationLoaderModal/OperationLoaderModal.js";
|
|
63
|
+
import { UploadProgressModal as ut } from "./file-manager/UploadProgressModal/UploadProgressModal.js";
|
|
64
|
+
export { f as AttachmentErrorReason, p as AttachmentType, fe as BASE_LG_ICON_PROPS, pe as BASE_MD_ICON_PROPS, ze as CHAT_SHARED_CLASS, Xe as COMPACT_MARKDOWN_CLASS_NAMES, m as CatalogEntityType, _ as CodeBlockTheme, e as ConversationTransferErrorCode, t as ConversationTransferJobStatus, n as ConversationTransferSubjectKind, r as ConversationTransferUnitKind, i as ConversationTransferWarningCode, Ae as CopyButton, je as CopyIconButton, Ze as DEFAULT_MARKDOWN_CLASS_NAMES, Ue as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, Se as DESKTOP_BREAKPOINT_PX, Ce as DESKTOP_MEDIA_QUERY, ke as DeploymentIcon, rt as DialFileManagerActionProfile, it as DialFileManagerVariant, ne as ENTITY_TYPE_BG_COLOR, re as ENTITY_TYPE_COLOR, Ie as EntityHeader, Pe as EntityTypeLabel, Fe as FeaturedChip, h as FileExtension, st as FileUploadStatus, a as FilterTab, me as HIDDEN_FILE, Oe as InitialsAvatar, Ne as ItemHeader, ge as MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME, ye as MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME, We as MARKDOWN_TABLE_CSV_MIME_TYPE, Qe as MDMessageViewer, g as MIMEType, v as MIME_TYPE_ALIASES, y as MIME_TYPE_AUDIO_PREFIX, b as MIME_TYPE_EXT_MAP, x as MIME_TYPE_WILDCARD, we as MOBILE_MAX_WIDTH_PX, Te as MOBILE_MEDIA_QUERY, He as MarkdownCodeBlock, Je as MarkdownRenderer, qe as MarkdownTable, Ge as MarkdownTableCopyFormat, $e as MarkdownWithPlaceholders, o as MessageRating, s as MessageRole, lt as OperationLoaderModal, A as PROHIBITED_CONVERSATION_NAME_CHARS_RE, ie as PROMPT_PARAM_DEFAULT_SEPARATOR, ae as PROMPT_PARAM_PATTERN, oe as PROMPT_VARIABLE_CLASS_NAME, Me as PanelEmptyState, _e as RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE, ve as RESIZABLE_TEXTAREA_CLASS_NAME, c as RequestStatus, Le as ResourceSummary, d as ResponseFormat, be as SELECT_LIST_MAX_HEIGHT_CLASS_NAME, xe as SELECT_LIST_MAX_HEIGHT_PX, l as StageStatus, u as StatusEvent, he as TAG_INPUT_TAG_CLASS_NAME, Re as TableHeader, ut as UploadProgressModal, Y as base64ToBlob, I as buildCssVars, se as buildPromptParamDefaults, V as copyMarkdownAsRichText, H as copyToClipboard, Ye as defaultMarkdownComponents, X as downloadTextFile, Z as ensureDownloadFilename, De as extractInitials, ce as extractPromptParams, K as formatCost, G as formatFileSize, W as formatLastUsed, q as formatPrice, J as formatUnitPrice, de as generateUUID, S as getAttachmentTypeFromMime, C as getBaseMimeType, Q as getFileExtensionForLanguage, at as getParentFolderPath, j as getUtf8ByteLength, w as inferMimeTypeFromPath, D as isAnnotationSelector, B as isAudioTranscriptionSupported, ot as isHiddenPath, L as isStatusMessage, U as markdownToRichTextHtml, F as mergeClasses, R as messageAttachmentToDisplayAttachment, z as messageAttachmentsToDisplayAttachments, T as normalizeMimeType, O as normalizePersistedHtmlTagAttachmentType, k as normalizeRawAnnotations, Ee as pickAvatarColor, le as rehypePromptVariables, ue as resolvePromptParams, Ve as restrainedSyntaxTheme, M as sanitizeConversationName, Ke as serializeMarkdownTableRows, N as stripTrailingDots, E as stripUrlQueryAndFragment, $ as triggerAnchorDownload, ee as triggerBlobDownload, P as truncateToUtf8Bytes, te as tryBase64ToBytes, tt as useAvailableHeightCap, Be as useCodeCopy, et as useCollapsedText, ct as useGridEditingScroll, nt as useIsMobile };
|
package/markdown.d.ts
CHANGED
|
@@ -4,6 +4,19 @@ import { FC } from 'react';
|
|
|
4
4
|
import { Options } from 'react-markdown';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
|
|
7
|
+
export declare const CHAT_SHARED_CLASS: {
|
|
8
|
+
/** The bordered container of a fenced code block. */
|
|
9
|
+
readonly codeBlock: "dial-chat-shared-code-block";
|
|
10
|
+
/** The code block's sticky header, holding the language label and actions. */
|
|
11
|
+
readonly codeBlockHeader: "dial-chat-shared-code-block-header";
|
|
12
|
+
/** The bordered container of a Markdown table. */
|
|
13
|
+
readonly table: "dial-chat-shared-table";
|
|
14
|
+
/** The scrolling box around a Markdown table, which owns its overflow. */
|
|
15
|
+
readonly tableScroll: "dial-chat-shared-table-scroll";
|
|
16
|
+
/** The scrolling box around a display-math block. */
|
|
17
|
+
readonly mathBlock: "dial-chat-shared-math-block";
|
|
18
|
+
};
|
|
19
|
+
|
|
7
20
|
/** Color theme for syntax highlighting. */
|
|
8
21
|
declare enum CodeBlockTheme {
|
|
9
22
|
/** Dark syntax-highlighting theme. */
|
|
@@ -225,9 +238,7 @@ export declare interface MarkdownRendererProps {
|
|
|
225
238
|
export declare const MarkdownTable: FC<MarkdownTableProps>;
|
|
226
239
|
|
|
227
240
|
export declare interface MarkdownTableActionLabels {
|
|
228
|
-
|
|
229
|
-
copyTxtLabel?: string;
|
|
230
|
-
copyMarkdownLabel?: string;
|
|
241
|
+
copyLabel?: string;
|
|
231
242
|
copiedLabel?: string;
|
|
232
243
|
downloadCsvLabel?: string;
|
|
233
244
|
openInCanvasLabel?: string;
|
|
@@ -253,19 +264,16 @@ export declare interface MarkdownTableColors {
|
|
|
253
264
|
fade?: string;
|
|
254
265
|
/** Divider color between rows. Defaults to `--stroke-tertiary`. */
|
|
255
266
|
rowDivider?: string;
|
|
256
|
-
/** Background of even-indexed body rows. Defaults to `--bg-layer-base`. */
|
|
257
|
-
rowZebraBackground?: string;
|
|
258
267
|
/** Background of a body row on hover. Defaults to `--bg-control-accent-alpha-hover`. */
|
|
259
268
|
rowHoverBackground?: string;
|
|
260
269
|
}
|
|
261
270
|
|
|
262
271
|
export declare enum MarkdownTableCopyFormat {
|
|
263
272
|
Csv = "csv",
|
|
264
|
-
Txt = "txt",
|
|
265
273
|
Markdown = "markdown"
|
|
266
274
|
}
|
|
267
275
|
|
|
268
|
-
/** A table
|
|
276
|
+
/** A table action rendered as an icon button. */
|
|
269
277
|
export declare interface MarkdownTableHeaderAction {
|
|
270
278
|
/** Stable accessible name and tooltip text. */
|
|
271
279
|
label: string;
|
package/markdown.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
1
|
+
import { CHAT_SHARED_CLASS as e } from "./constants/public-class-names.js";
|
|
2
|
+
import { useCodeCopy as t } from "./hooks/useCodeCopy.js";
|
|
3
|
+
import { restrainedSyntaxTheme as n } from "./components/MarkdownRenderer/CodeBlock/syntax-theme.js";
|
|
4
|
+
import { MarkdownCodeBlock as r } from "./components/MarkdownRenderer/CodeBlock/CodeBlock.js";
|
|
5
|
+
import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as i, MARKDOWN_TABLE_CSV_MIME_TYPE as a, MarkdownTableCopyFormat as o, serializeMarkdownTableRows as s } from "./components/MarkdownRenderer/Table/table-serialization.js";
|
|
6
|
+
import { MarkdownTable as c } from "./components/MarkdownRenderer/Table/MarkdownTable.js";
|
|
7
|
+
import { MarkdownRenderer as l, defaultMarkdownComponents as u } from "./components/MarkdownRenderer/MarkdownRenderer.js";
|
|
8
|
+
import { COMPACT_MARKDOWN_CLASS_NAMES as d, DEFAULT_MARKDOWN_CLASS_NAMES as f } from "./components/MarkdownRenderer/markdown-class-names.js";
|
|
9
|
+
import { MDMessageViewer as p } from "./components/MarkdownRenderer/MDMessageViewer.js";
|
|
10
|
+
import { MarkdownWithPlaceholders as m } from "./components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js";
|
|
11
|
+
import { useCollapsedText as h } from "./hooks/useCollapsedText.js";
|
|
12
|
+
export { e as CHAT_SHARED_CLASS, d as COMPACT_MARKDOWN_CLASS_NAMES, f as DEFAULT_MARKDOWN_CLASS_NAMES, i as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, a as MARKDOWN_TABLE_CSV_MIME_TYPE, p as MDMessageViewer, r as MarkdownCodeBlock, l as MarkdownRenderer, c as MarkdownTable, o as MarkdownTableCopyFormat, m as MarkdownWithPlaceholders, u as defaultMarkdownComponents, n as restrainedSyntaxTheme, s as serializeMarkdownTableRows, t as useCodeCopy, h as useCollapsedText };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-chat-shared",
|
|
3
3
|
"description": "Shared domain models, utilities, and UI components for AI DIAL Chat libraries",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.101",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": [
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": "^19.2.8",
|
|
35
|
-
"@epam/ai-dial-ui-kit": "^0.
|
|
36
|
-
"@epam/ai-dial-react-file-manager": "^0.
|
|
35
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.12",
|
|
36
|
+
"@epam/ai-dial-react-file-manager": "^0.3.0-dev.4",
|
|
37
37
|
"ag-grid-community": "^35.3.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
package/types/attachment.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/types/attachment.ts
|
|
2
2
|
var e = /* @__PURE__ */ function(e) {
|
|
3
|
-
return e.Network = "network", e.UnsupportedType = "unsupported-type", e;
|
|
3
|
+
return e.Network = "network", e.UnsupportedType = "unsupported-type", e.FileTooLarge = "file-too-large", e;
|
|
4
4
|
}({}), t = /* @__PURE__ */ function(e) {
|
|
5
5
|
return e.File = "file", e.Image = "image", e.Audio = "audio", e.Prompt = "prompt", e.Pasted = "pasted", e.Link = "link", e;
|
|
6
6
|
}({});
|
package/utils/file-download.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { MIME_TYPE_EXT_MAP as e } from "../constants/mime-types.js";
|
|
2
|
+
import { stripUrlQueryAndFragment as t } from "./mime-type.js";
|
|
3
3
|
//#region src/utils/file-download.ts
|
|
4
4
|
var n = /^[a-zA-Z0-9]{1,10}$/, r = (e) => {
|
|
5
5
|
let t = e.lastIndexOf(".");
|
|
@@ -9,12 +9,12 @@ var n = /^[a-zA-Z0-9]{1,10}$/, r = (e) => {
|
|
|
9
9
|
}, i = (n, i, a) => {
|
|
10
10
|
if (r(n) != null) return n;
|
|
11
11
|
if (a != null) {
|
|
12
|
-
let
|
|
13
|
-
if (
|
|
12
|
+
let t = e[a];
|
|
13
|
+
if (t != null) return `${n}.${t}`;
|
|
14
14
|
}
|
|
15
15
|
if (i != null) {
|
|
16
|
-
let
|
|
17
|
-
if (
|
|
16
|
+
let e = r(t(i).split("/").pop() ?? "");
|
|
17
|
+
if (e != null) return `${n}.${e}`;
|
|
18
18
|
}
|
|
19
19
|
return n;
|
|
20
20
|
}, a = {
|
package/utils/latex.js
CHANGED
|
@@ -26,11 +26,13 @@ var e = /\$\\ce\{/g, t = /\$\\pu\{/g, n = /\$\\\\ce\{[^}]*\}\$/g, r = /\$\\\\pu\
|
|
|
26
26
|
let t = p(e), n = [], r = 0, s;
|
|
27
27
|
for (i.lastIndex = 0; (s = i.exec(e)) !== null;) {
|
|
28
28
|
let i = s.index, c = i + s[0].length, l = s[1];
|
|
29
|
-
if (
|
|
29
|
+
if (m(i, t)) continue;
|
|
30
30
|
let u = e.lastIndexOf("\n", i - 1) + 1;
|
|
31
31
|
if (e.slice(u, i).trim() !== "") continue;
|
|
32
|
-
let d =
|
|
33
|
-
|
|
32
|
+
let d = e.indexOf("\n", c), f = e.slice(c, d === -1 ? e.length : d);
|
|
33
|
+
if (!l.includes("\n") && (f.trim() !== "" || l.trim() === "")) continue;
|
|
34
|
+
let p = l.replace(a, "").replace(o, "");
|
|
35
|
+
n.push(e.slice(r, i)), n.push(`$$\n${p}\n$$${f.trim() === "" ? "" : "\n"}`), r = c;
|
|
34
36
|
}
|
|
35
37
|
return n.push(e.substring(r)), n.join("");
|
|
36
38
|
}, y = (e, t) => {
|
package/utils/merge-class.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import e from "classnames";
|
|
2
|
-
import {
|
|
2
|
+
import { extendTailwindMerge as t } from "tailwind-merge";
|
|
3
3
|
//#region src/utils/merge-class.ts
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
var n = t({ extend: { classGroups: { shadow: [{ shadow: ["chat-button"] }] } } });
|
|
5
|
+
function r(...t) {
|
|
6
|
+
return n(e(...t));
|
|
6
7
|
}
|
|
7
8
|
//#endregion
|
|
8
|
-
export {
|
|
9
|
+
export { r as mergeClasses };
|
package/utils/mime-type.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AttachmentType as e } from "../types/attachment.js";
|
|
2
2
|
import { MIMEType as t } from "../types/mime-type.js";
|
|
3
|
+
import { MIME_TYPE_ALIASES as n } from "../constants/mime-types.js";
|
|
3
4
|
//#region src/utils/mime-type.ts
|
|
4
|
-
var
|
|
5
|
+
var r = {
|
|
5
6
|
md: t.Markdown,
|
|
6
7
|
markdown: t.Markdown,
|
|
7
8
|
txt: t.Plain,
|
|
@@ -65,9 +66,12 @@ var n = {
|
|
|
65
66
|
mp3: t.MP3,
|
|
66
67
|
wav: t.WAV,
|
|
67
68
|
ogg: t.OGG
|
|
68
|
-
},
|
|
69
|
-
let t =
|
|
70
|
-
|
|
71
|
-
},
|
|
69
|
+
}, i = (e) => e.toLowerCase().split(";")[0].trim(), a = (e) => {
|
|
70
|
+
let t = i(e);
|
|
71
|
+
return n[t] ?? t;
|
|
72
|
+
}, o = (e) => e.split(/[?#]/)[0], s = (e) => {
|
|
73
|
+
let t = o(e), n = t.lastIndexOf(".");
|
|
74
|
+
if (n !== -1) return r[t.slice(n + 1).toLowerCase()];
|
|
75
|
+
}, c = (t) => t?.startsWith("image/") ? e.Image : t?.startsWith("audio/") ? e.Audio : e.File;
|
|
72
76
|
//#endregion
|
|
73
|
-
export {
|
|
77
|
+
export { c as getAttachmentTypeFromMime, i as getBaseMimeType, s as inferMimeTypeFromPath, a as normalizeMimeType, o as stripUrlQueryAndFragment };
|