@epam/ai-dial-chat-shared 1.2.0-dev.20 → 1.2.0-dev.207

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.
Files changed (39) hide show
  1. package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +64 -63
  2. package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +6 -6
  3. package/components/MarkdownRenderer/MDMessageViewer.js +23 -17
  4. package/components/MarkdownRenderer/MarkdownRenderer.js +88 -90
  5. package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +19 -18
  6. package/components/MarkdownRenderer/PlainTextRenderer.js +21 -0
  7. package/components/MarkdownRenderer/Table/MarkdownTable.js +71 -56
  8. package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +11 -11
  9. package/components/MarkdownRenderer/Table/TableHeader.js +18 -21
  10. package/components/MarkdownRenderer/Table/table-serialization.js +23 -3
  11. package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.js +48 -62
  12. package/components/MarkdownRenderer/ThinkingShimmer.js +14 -0
  13. package/components/TextRefinementField/TextRefinementField.js +86 -0
  14. package/constants/dial.js +2 -2
  15. package/constants/mime-types.js +49 -2
  16. package/constants/public-class-names.js +10 -0
  17. package/constants/resizable-fields.js +2 -2
  18. package/file-manager/DialFileManagerShell/DialFileManagerShell.js +247 -236
  19. package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +34 -32
  20. package/file-manager/OperationLoaderModal/OperationLoaderModal.js +17 -20
  21. package/file-manager/upload-batch.js +2 -2
  22. package/file-manager/upload-queue.js +17 -0
  23. package/file-manager.d.ts +31 -18
  24. package/file-manager.js +4 -3
  25. package/hooks/useTextRefinement.js +66 -0
  26. package/index.css +2 -2
  27. package/index.d.ts +322 -39
  28. package/index.js +60 -56
  29. package/markdown.d.ts +61 -8
  30. package/markdown.js +13 -11
  31. package/package.json +3 -3
  32. package/types/attachment.js +1 -1
  33. package/utils/entity-field-limits.js +4 -0
  34. package/utils/file-download.js +6 -6
  35. package/utils/is-skill-selection-unsupported.js +4 -0
  36. package/utils/latex.js +5 -3
  37. package/utils/merge-class.js +5 -4
  38. package/utils/mime-type.js +10 -6
  39. package/file-manager/UploadProgressModal/UploadProgressModal.js +0 -56
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,63 @@ 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 { getAttachmentTypeFromMime as v, inferMimeTypeFromPath as y, stripUrlQueryAndFragment as b } from "./utils/mime-type.js";
11
- import { isAnnotationSelector as x, normalizePersistedHtmlTagAttachmentType as S, normalizeRawAnnotations as C } from "./utils/annotation.js";
12
- import { PROHIBITED_CONVERSATION_NAME_CHARS_RE as w, getUtf8ByteLength as T, sanitizeConversationName as E, stripTrailingDots as D, truncateToUtf8Bytes as O } from "./utils/string-utils.js";
13
- import { mergeClasses as k } from "./utils/merge-class.js";
14
- import { buildCssVars as A } from "./utils/build-css-vars.js";
15
- import { isStatusMessage as j } from "./utils/message.js";
16
- import { messageAttachmentToDisplayAttachment as M, messageAttachmentsToDisplayAttachments as N } from "./utils/message-attachment-to-display.js";
17
- import { MIME_TYPE_AUDIO_PREFIX as P, MIME_TYPE_EXT_MAP as F, MIME_TYPE_WILDCARD as I } from "./constants/mime-types.js";
18
- import { isAudioTranscriptionSupported as L } from "./utils/is-audio-transcription-supported.js";
19
- import { copyMarkdownAsRichText as R, copyToClipboard as z, markdownToRichTextHtml as B } from "./utils/copy-to-clipboard.js";
20
- import { formatLastUsed as V } from "./utils/format-last-used.js";
21
- import { formatFileSize as H } from "./utils/format-file-size.js";
22
- import { formatCost as U, formatPrice as W, formatUnitPrice as G } from "./utils/format-price.js";
23
- import { base64ToBlob as K, downloadTextFile as q, ensureDownloadFilename as J, getFileExtensionForLanguage as Y, triggerAnchorDownload as X, triggerBlobDownload as Z, tryBase64ToBytes as Q } from "./utils/file-download.js";
24
- import { ENTITY_TYPE_BG_COLOR as $, ENTITY_TYPE_COLOR as ee } from "./constants/entity-colors.js";
25
- import { PROMPT_PARAM_DEFAULT_SEPARATOR as te, PROMPT_PARAM_PATTERN as ne, PROMPT_VARIABLE_CLASS_NAME as re, buildPromptParamDefaults as ie, extractPromptParams as ae, rehypePromptVariables as oe, resolvePromptParams as se } from "./utils/prompt-variables.js";
26
- import { generateUUID as ce } from "./utils/generate-uuid.js";
27
- import { BASE_LG_ICON_PROPS as le, BASE_MD_ICON_PROPS as ue } from "./constants/icon.js";
28
- import { HIDDEN_FILE as de } from "./constants/dial.js";
29
- import { TAG_INPUT_TAG_CLASS_NAME as fe } from "./constants/tag-input.js";
30
- import { MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as pe, RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE as me, RESIZABLE_TEXTAREA_CLASS_NAME as he } from "./constants/resizable-fields.js";
31
- import { MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as ge } from "./constants/markdown-editor.js";
32
- import { SELECT_LIST_MAX_HEIGHT_CLASS_NAME as _e, SELECT_LIST_MAX_HEIGHT_PX as ve } from "./constants/select-list.js";
33
- import { DESKTOP_BREAKPOINT_PX as ye, DESKTOP_MEDIA_QUERY as be, MOBILE_MAX_WIDTH_PX as xe, MOBILE_MEDIA_QUERY as Se } from "./constants/breakpoint.js";
34
- import { pickAvatarColor as Ce } from "./utils/avatar-color.js";
35
- import { extractInitials as we } from "./utils/initials.js";
36
- import { InitialsAvatar as Te } from "./components/InitialsAvatar/InitialsAvatar.js";
37
- import { DeploymentIcon as Ee } from "./components/DeploymentIcon/DeploymentIcon.js";
38
- import { CopyButton as De, CopyIconButton as Oe } from "./components/CopyButton/CopyButton.js";
39
- import { PanelEmptyState as ke } from "./components/PanelEmptyState/PanelEmptyState.js";
40
- import { ItemHeader as Ae } from "./components/ItemHeader/ItemHeader.js";
41
- import { EntityTypeLabel as je } from "./components/EntityTypeLabel/EntityTypeLabel.js";
42
- import { FeaturedChip as Me } from "./components/FeaturedChip/FeaturedChip.js";
43
- import { EntityHeader as Ne } from "./components/EntityHeader/EntityHeader.js";
44
- import { ResourceSummary as Pe } from "./components/ResourceSummary/ResourceSummary.js";
45
- import { TableHeader as Fe } from "./components/MarkdownRenderer/Table/TableHeader.js";
46
- import { useCodeCopy as Ie } from "./hooks/useCodeCopy.js";
47
- import { restrainedSyntaxTheme as Le } from "./components/MarkdownRenderer/CodeBlock/syntax-theme.js";
48
- import { MarkdownCodeBlock as Re } from "./components/MarkdownRenderer/CodeBlock/CodeBlock.js";
49
- import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as ze, MARKDOWN_TABLE_CSV_MIME_TYPE as Be, MarkdownTableCopyFormat as Ve, serializeMarkdownTableRows as He } from "./components/MarkdownRenderer/Table/table-serialization.js";
50
- import { MarkdownTable as Ue } from "./components/MarkdownRenderer/Table/MarkdownTable.js";
51
- import { MarkdownRenderer as We, defaultMarkdownComponents as Ge } from "./components/MarkdownRenderer/MarkdownRenderer.js";
52
- import { COMPACT_MARKDOWN_CLASS_NAMES as Ke, DEFAULT_MARKDOWN_CLASS_NAMES as qe } from "./components/MarkdownRenderer/markdown-class-names.js";
53
- import { MDMessageViewer as Je } from "./components/MarkdownRenderer/MDMessageViewer.js";
54
- import { MarkdownWithPlaceholders as Ye } from "./components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js";
55
- import { useCollapsedText as Xe } from "./hooks/useCollapsedText.js";
56
- import { useAvailableHeightCap as Ze } from "./hooks/useAvailableHeightCap.js";
57
- import { useIsMobile as Qe } from "./hooks/useIsMobile.js";
58
- import { DialFileManagerActionProfile as $e, DialFileManagerVariant as et } from "./file-manager/file-manager-variant.js";
59
- import { getParentFolderPath as tt, isHiddenPath as nt } from "./file-manager/path.js";
60
- import { FileUploadStatus as rt } from "./file-manager/upload-batch.js";
61
- import { useGridEditingScroll as it } from "./file-manager/useGridEditingScroll/useGridEditingScroll.js";
62
- import { OperationLoaderModal as at } from "./file-manager/OperationLoaderModal/OperationLoaderModal.js";
63
- import { UploadProgressModal as ot } from "./file-manager/UploadProgressModal/UploadProgressModal.js";
64
- export { f as AttachmentErrorReason, p as AttachmentType, le as BASE_LG_ICON_PROPS, ue as BASE_MD_ICON_PROPS, Ke 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, De as CopyButton, Oe as CopyIconButton, qe as DEFAULT_MARKDOWN_CLASS_NAMES, ze as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, ye as DESKTOP_BREAKPOINT_PX, be as DESKTOP_MEDIA_QUERY, Ee as DeploymentIcon, $e as DialFileManagerActionProfile, et as DialFileManagerVariant, $ as ENTITY_TYPE_BG_COLOR, ee as ENTITY_TYPE_COLOR, Ne as EntityHeader, je as EntityTypeLabel, Me as FeaturedChip, h as FileExtension, rt as FileUploadStatus, a as FilterTab, de as HIDDEN_FILE, Te as InitialsAvatar, Ae as ItemHeader, pe as MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME, ge as MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME, Be as MARKDOWN_TABLE_CSV_MIME_TYPE, Je as MDMessageViewer, g as MIMEType, P as MIME_TYPE_AUDIO_PREFIX, F as MIME_TYPE_EXT_MAP, I as MIME_TYPE_WILDCARD, xe as MOBILE_MAX_WIDTH_PX, Se as MOBILE_MEDIA_QUERY, Re as MarkdownCodeBlock, We as MarkdownRenderer, Ue as MarkdownTable, Ve as MarkdownTableCopyFormat, Ye as MarkdownWithPlaceholders, o as MessageRating, s as MessageRole, at as OperationLoaderModal, w as PROHIBITED_CONVERSATION_NAME_CHARS_RE, te as PROMPT_PARAM_DEFAULT_SEPARATOR, ne as PROMPT_PARAM_PATTERN, re as PROMPT_VARIABLE_CLASS_NAME, ke as PanelEmptyState, me as RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE, he as RESIZABLE_TEXTAREA_CLASS_NAME, c as RequestStatus, Pe as ResourceSummary, d as ResponseFormat, _e as SELECT_LIST_MAX_HEIGHT_CLASS_NAME, ve as SELECT_LIST_MAX_HEIGHT_PX, l as StageStatus, u as StatusEvent, fe as TAG_INPUT_TAG_CLASS_NAME, Fe as TableHeader, ot as UploadProgressModal, K as base64ToBlob, A as buildCssVars, ie as buildPromptParamDefaults, R as copyMarkdownAsRichText, z as copyToClipboard, Ge as defaultMarkdownComponents, q as downloadTextFile, J as ensureDownloadFilename, we as extractInitials, ae as extractPromptParams, U as formatCost, H as formatFileSize, V as formatLastUsed, W as formatPrice, G as formatUnitPrice, ce as generateUUID, v as getAttachmentTypeFromMime, Y as getFileExtensionForLanguage, tt as getParentFolderPath, T as getUtf8ByteLength, y as inferMimeTypeFromPath, x as isAnnotationSelector, L as isAudioTranscriptionSupported, nt as isHiddenPath, j as isStatusMessage, B as markdownToRichTextHtml, k as mergeClasses, M as messageAttachmentToDisplayAttachment, N as messageAttachmentsToDisplayAttachments, S as normalizePersistedHtmlTagAttachmentType, C as normalizeRawAnnotations, Ce as pickAvatarColor, oe as rehypePromptVariables, se as resolvePromptParams, Le as restrainedSyntaxTheme, E as sanitizeConversationName, He as serializeMarkdownTableRows, D as stripTrailingDots, b as stripUrlQueryAndFragment, X as triggerAnchorDownload, Z as triggerBlobDownload, O as truncateToUtf8Bytes, Q as tryBase64ToBytes, Ze as useAvailableHeightCap, Ie as useCodeCopy, Xe as useCollapsedText, it as useGridEditingScroll, Qe as useIsMobile };
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 { ENTITY_DESCRIPTION_MAX_LENGTH as F, ENTITY_INSTRUCTIONS_MAX_LENGTH as I, ENTITY_NAME_MAX_LENGTH as L, exceedsMaxLength as R, hasControlCharacters as z } from "./utils/entity-field-limits.js";
14
+ import { mergeClasses as B } from "./utils/merge-class.js";
15
+ import { buildCssVars as V } from "./utils/build-css-vars.js";
16
+ import { isStatusMessage as H } from "./utils/message.js";
17
+ import { messageAttachmentToDisplayAttachment as U, messageAttachmentsToDisplayAttachments as W } from "./utils/message-attachment-to-display.js";
18
+ import { isAudioTranscriptionSupported as G } from "./utils/is-audio-transcription-supported.js";
19
+ import { copyMarkdownAsRichText as K, copyToClipboard as q, markdownToRichTextHtml as J } from "./utils/copy-to-clipboard.js";
20
+ import { formatLastUsed as Y } from "./utils/format-last-used.js";
21
+ import { formatFileSize as X } from "./utils/format-file-size.js";
22
+ import { formatCost as Z, formatPrice as Q, formatUnitPrice as $ } from "./utils/format-price.js";
23
+ import { base64ToBlob as ee, downloadTextFile as te, ensureDownloadFilename as ne, getFileExtensionForLanguage as re, triggerAnchorDownload as ie, triggerBlobDownload as ae, tryBase64ToBytes as oe } from "./utils/file-download.js";
24
+ import { ENTITY_TYPE_BG_COLOR as se, ENTITY_TYPE_COLOR as ce } from "./constants/entity-colors.js";
25
+ import { PROMPT_PARAM_DEFAULT_SEPARATOR as le, PROMPT_PARAM_PATTERN as ue, PROMPT_VARIABLE_CLASS_NAME as de, buildPromptParamDefaults as fe, extractPromptParams as pe, rehypePromptVariables as me, resolvePromptParams as he } from "./utils/prompt-variables.js";
26
+ import { generateUUID as ge } from "./utils/generate-uuid.js";
27
+ import { BASE_LG_ICON_PROPS as _e, BASE_MD_ICON_PROPS as ve } from "./constants/icon.js";
28
+ import { HIDDEN_FILE as ye, PUBLIC_BUCKET as be } from "./constants/dial.js";
29
+ import { TAG_INPUT_TAG_CLASS_NAME as xe } from "./constants/tag-input.js";
30
+ import { MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME as Se, MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME as Ce, RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE as we, RESIZABLE_TEXTAREA_CLASS_NAME as Te } from "./constants/resizable-fields.js";
31
+ import { MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME as Ee } from "./constants/markdown-editor.js";
32
+ import { SELECT_LIST_MAX_HEIGHT_CLASS_NAME as De, SELECT_LIST_MAX_HEIGHT_PX as Oe } from "./constants/select-list.js";
33
+ import { DESKTOP_BREAKPOINT_PX as ke, DESKTOP_MEDIA_QUERY as Ae, MOBILE_MAX_WIDTH_PX as je, MOBILE_MEDIA_QUERY as Me } from "./constants/breakpoint.js";
34
+ import { pickAvatarColor as Ne } from "./utils/avatar-color.js";
35
+ import { extractInitials as Pe } from "./utils/initials.js";
36
+ import { InitialsAvatar as Fe } from "./components/InitialsAvatar/InitialsAvatar.js";
37
+ import { DeploymentIcon as Ie } from "./components/DeploymentIcon/DeploymentIcon.js";
38
+ import { CopyButton as Le, CopyIconButton as Re } from "./components/CopyButton/CopyButton.js";
39
+ import { PanelEmptyState as ze } from "./components/PanelEmptyState/PanelEmptyState.js";
40
+ import { ItemHeader as Be } from "./components/ItemHeader/ItemHeader.js";
41
+ import { EntityTypeLabel as Ve } from "./components/EntityTypeLabel/EntityTypeLabel.js";
42
+ import { FeaturedChip as He } from "./components/FeaturedChip/FeaturedChip.js";
43
+ import { EntityHeader as Ue } from "./components/EntityHeader/EntityHeader.js";
44
+ import { ResourceSummary as We } from "./components/ResourceSummary/ResourceSummary.js";
45
+ import { TableHeader as Ge } from "./components/MarkdownRenderer/Table/TableHeader.js";
46
+ import { TextRefinementState as Ke, useTextRefinement as qe } from "./hooks/useTextRefinement.js";
47
+ import { TextRefinementField as Je } from "./components/TextRefinementField/TextRefinementField.js";
48
+ import { CHAT_SHARED_CLASS as Ye } from "./constants/public-class-names.js";
49
+ import { useCodeCopy as Xe } from "./hooks/useCodeCopy.js";
50
+ import { restrainedSyntaxTheme as Ze } from "./components/MarkdownRenderer/CodeBlock/syntax-theme.js";
51
+ import { MarkdownCodeBlock as Qe } from "./components/MarkdownRenderer/CodeBlock/CodeBlock.js";
52
+ import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as $e, MARKDOWN_TABLE_CSV_MIME_TYPE as et, MarkdownTableCopyFormat as tt, serializeMarkdownTableRows as nt } from "./components/MarkdownRenderer/Table/table-serialization.js";
53
+ import { MarkdownTable as rt } from "./components/MarkdownRenderer/Table/MarkdownTable.js";
54
+ import { MarkdownRenderer as it, defaultMarkdownComponents as at } from "./components/MarkdownRenderer/MarkdownRenderer.js";
55
+ import { COMPACT_MARKDOWN_CLASS_NAMES as ot, DEFAULT_MARKDOWN_CLASS_NAMES as st } from "./components/MarkdownRenderer/markdown-class-names.js";
56
+ import { PlainTextRenderer as ct } from "./components/MarkdownRenderer/PlainTextRenderer.js";
57
+ import { MDMessageViewer as lt } from "./components/MarkdownRenderer/MDMessageViewer.js";
58
+ import { MarkdownWithPlaceholders as ut } from "./components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js";
59
+ import { useCollapsedText as dt } from "./hooks/useCollapsedText.js";
60
+ import { useAvailableHeightCap as ft } from "./hooks/useAvailableHeightCap.js";
61
+ import { useIsMobile as pt } from "./hooks/useIsMobile.js";
62
+ import { DialFileManagerActionProfile as mt, DialFileManagerVariant as ht } from "./file-manager/file-manager-variant.js";
63
+ import { getParentFolderPath as gt, isHiddenPath as _t } from "./file-manager/path.js";
64
+ import { FileUploadStatus as vt, isUploadInProgress as yt } from "./file-manager/upload-batch.js";
65
+ import { useGridEditingScroll as bt } from "./file-manager/useGridEditingScroll/useGridEditingScroll.js";
66
+ import { OperationLoaderModal as xt } from "./file-manager/OperationLoaderModal/OperationLoaderModal.js";
67
+ import { isSkillSelectionUnsupported as St } from "./utils/is-skill-selection-unsupported.js";
68
+ export { f as AttachmentErrorReason, p as AttachmentType, _e as BASE_LG_ICON_PROPS, ve as BASE_MD_ICON_PROPS, Ye as CHAT_SHARED_CLASS, ot 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, Le as CopyButton, Re as CopyIconButton, st as DEFAULT_MARKDOWN_CLASS_NAMES, $e as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, ke as DESKTOP_BREAKPOINT_PX, Ae as DESKTOP_MEDIA_QUERY, Ie as DeploymentIcon, mt as DialFileManagerActionProfile, ht as DialFileManagerVariant, F as ENTITY_DESCRIPTION_MAX_LENGTH, I as ENTITY_INSTRUCTIONS_MAX_LENGTH, L as ENTITY_NAME_MAX_LENGTH, se as ENTITY_TYPE_BG_COLOR, ce as ENTITY_TYPE_COLOR, Ue as EntityHeader, Ve as EntityTypeLabel, He as FeaturedChip, h as FileExtension, vt as FileUploadStatus, a as FilterTab, ye as HIDDEN_FILE, Fe as InitialsAvatar, Be as ItemHeader, Se as MARKDOWN_EDITOR_FILL_HEIGHT_CLASS_NAME, Ce as MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME, Ee as MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME, et as MARKDOWN_TABLE_CSV_MIME_TYPE, lt 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, je as MOBILE_MAX_WIDTH_PX, Me as MOBILE_MEDIA_QUERY, Qe as MarkdownCodeBlock, it as MarkdownRenderer, rt as MarkdownTable, tt as MarkdownTableCopyFormat, ut as MarkdownWithPlaceholders, o as MessageRating, s as MessageRole, xt as OperationLoaderModal, A as PROHIBITED_CONVERSATION_NAME_CHARS_RE, le as PROMPT_PARAM_DEFAULT_SEPARATOR, ue as PROMPT_PARAM_PATTERN, de as PROMPT_VARIABLE_CLASS_NAME, be as PUBLIC_BUCKET, ze as PanelEmptyState, ct as PlainTextRenderer, we as RESIZABLE_FIELD_MAX_HEIGHT_CSS_VARIABLE, Te as RESIZABLE_TEXTAREA_CLASS_NAME, c as RequestStatus, We as ResourceSummary, d as ResponseFormat, De as SELECT_LIST_MAX_HEIGHT_CLASS_NAME, Oe as SELECT_LIST_MAX_HEIGHT_PX, l as StageStatus, u as StatusEvent, xe as TAG_INPUT_TAG_CLASS_NAME, Ge as TableHeader, Je as TextRefinementField, Ke as TextRefinementState, ee as base64ToBlob, V as buildCssVars, fe as buildPromptParamDefaults, K as copyMarkdownAsRichText, q as copyToClipboard, at as defaultMarkdownComponents, te as downloadTextFile, ne as ensureDownloadFilename, R as exceedsMaxLength, Pe as extractInitials, pe as extractPromptParams, Z as formatCost, X as formatFileSize, Y as formatLastUsed, Q as formatPrice, $ as formatUnitPrice, ge as generateUUID, S as getAttachmentTypeFromMime, C as getBaseMimeType, re as getFileExtensionForLanguage, gt as getParentFolderPath, j as getUtf8ByteLength, z as hasControlCharacters, w as inferMimeTypeFromPath, D as isAnnotationSelector, G as isAudioTranscriptionSupported, _t as isHiddenPath, St as isSkillSelectionUnsupported, H as isStatusMessage, yt as isUploadInProgress, J as markdownToRichTextHtml, B as mergeClasses, U as messageAttachmentToDisplayAttachment, W as messageAttachmentsToDisplayAttachments, T as normalizeMimeType, O as normalizePersistedHtmlTagAttachmentType, k as normalizeRawAnnotations, Ne as pickAvatarColor, me as rehypePromptVariables, he as resolvePromptParams, Ze as restrainedSyntaxTheme, M as sanitizeConversationName, nt as serializeMarkdownTableRows, N as stripTrailingDots, E as stripUrlQueryAndFragment, ie as triggerAnchorDownload, ae as triggerBlobDownload, P as truncateToUtf8Bytes, oe as tryBase64ToBytes, ft as useAvailableHeightCap, Xe as useCodeCopy, dt as useCollapsedText, bt as useGridEditingScroll, pt as useIsMobile, qe as useTextRefinement };
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
- copyCsvLabel?: string;
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 header action rendered as an icon button. */
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;
@@ -309,13 +317,20 @@ export declare interface MarkdownWithPlaceholdersProps {
309
317
  headingClassName?: string;
310
318
  }
311
319
 
312
- /** Renders assistant message content as formatted markdown. */
320
+ /** Renders assistant message content as formatted markdown, or as escaped plain text when `isPlainText` is set. */
313
321
  export declare const MDMessageViewer: FC<MDMessageViewerProps>;
314
322
 
315
323
  /** Props for the {@link MDMessageViewer} markdown renderer. */
316
324
  declare interface MDMessageViewerProps {
317
325
  /** Raw markdown string to render. */
318
326
  content: string;
327
+ /**
328
+ * Renders `content` verbatim as escaped plain text instead of running the
329
+ * Markdown pipeline — the conversation's `plain_text` response format.
330
+ * Markdown-only props (`components`, `urlTransform`, the code-block and
331
+ * table labels) do not apply while it is set. Defaults to `false`.
332
+ */
333
+ isPlainText?: boolean;
319
334
  /** Enables gradual reveal for appended streaming content. */
320
335
  isStreaming?: boolean;
321
336
  /**
@@ -355,6 +370,44 @@ declare interface MDMessageViewerProps {
355
370
  classNames?: MarkdownRendererClassNames;
356
371
  }
357
372
 
373
+ /**
374
+ * Renders message text as plain text: no Markdown pipeline, no raw HTML, no
375
+ * syntax highlighting. The text is a React text child, so it is escaped by
376
+ * construction — a table, a heading, or `**bold**` reaches the reader exactly
377
+ * as the model emitted it, which is what a conversation's `plain_text`
378
+ * response format promises.
379
+ *
380
+ * Lives beside {@link MarkdownRenderer} because it is the other half of the
381
+ * same choice: both render an assistant message body, and both are selected
382
+ * by `MDMessageViewer` from the conversation's response format.
383
+ */
384
+ export declare const PlainTextRenderer: FC<PlainTextRendererProps>;
385
+
386
+ /** Props for {@link PlainTextRenderer}. */
387
+ export declare interface PlainTextRendererProps {
388
+ /** Message text. Rendered verbatim — never parsed as Markdown or HTML. */
389
+ content: string;
390
+ /** Classes applied to the renderer root. */
391
+ containerClassName?: string;
392
+ /** When true, appended content is revealed gradually for smoother streaming updates. */
393
+ isStreaming?: boolean;
394
+ /** Reveal speed used while `isStreaming` is true. Defaults to 120 characters per second. */
395
+ streamCharactersPerSecond?: number;
396
+ /**
397
+ * Typography classes. Only `p` is read — the single paragraph the renderer
398
+ * emits — so the same object a Markdown message is styled with keeps both
399
+ * formats on one type scale.
400
+ */
401
+ classNames?: Pick<MarkdownRendererClassNames, 'p'>;
402
+ /**
403
+ * Label shown with a shimmer animation while `isStreaming` is true and no
404
+ * content has arrived yet. Defaults to `'Thinking'`.
405
+ */
406
+ thinkingLabel?: string;
407
+ /** Color overrides applied as CSS custom properties. */
408
+ colors?: Pick<MarkdownRendererColors, 'thinkingPrimary' | 'thinkingSecondary'>;
409
+ }
410
+
358
411
  /** Style map consumed by `react-syntax-highlighter`'s `Prism` renderer. */
359
412
  declare type PrismStyleMap = Record<string, CSSProperties>;
360
413
 
package/markdown.js CHANGED
@@ -1,11 +1,13 @@
1
- import { useCodeCopy as e } from "./hooks/useCodeCopy.js";
2
- import { restrainedSyntaxTheme as t } from "./components/MarkdownRenderer/CodeBlock/syntax-theme.js";
3
- import { MarkdownCodeBlock as n } from "./components/MarkdownRenderer/CodeBlock/CodeBlock.js";
4
- import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as r, MARKDOWN_TABLE_CSV_MIME_TYPE as i, MarkdownTableCopyFormat as a, serializeMarkdownTableRows as o } from "./components/MarkdownRenderer/Table/table-serialization.js";
5
- import { MarkdownTable as s } from "./components/MarkdownRenderer/Table/MarkdownTable.js";
6
- import { MarkdownRenderer as c, defaultMarkdownComponents as l } from "./components/MarkdownRenderer/MarkdownRenderer.js";
7
- import { COMPACT_MARKDOWN_CLASS_NAMES as u, DEFAULT_MARKDOWN_CLASS_NAMES as d } from "./components/MarkdownRenderer/markdown-class-names.js";
8
- import { MDMessageViewer as f } from "./components/MarkdownRenderer/MDMessageViewer.js";
9
- import { MarkdownWithPlaceholders as p } from "./components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js";
10
- import { useCollapsedText as m } from "./hooks/useCollapsedText.js";
11
- export { u as COMPACT_MARKDOWN_CLASS_NAMES, d as DEFAULT_MARKDOWN_CLASS_NAMES, r as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, i as MARKDOWN_TABLE_CSV_MIME_TYPE, f as MDMessageViewer, n as MarkdownCodeBlock, c as MarkdownRenderer, s as MarkdownTable, a as MarkdownTableCopyFormat, p as MarkdownWithPlaceholders, l as defaultMarkdownComponents, t as restrainedSyntaxTheme, o as serializeMarkdownTableRows, e as useCodeCopy, m as useCollapsedText };
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 { PlainTextRenderer as p } from "./components/MarkdownRenderer/PlainTextRenderer.js";
10
+ import { MDMessageViewer as m } from "./components/MarkdownRenderer/MDMessageViewer.js";
11
+ import { MarkdownWithPlaceholders as h } from "./components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js";
12
+ import { useCollapsedText as g } from "./hooks/useCollapsedText.js";
13
+ 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, m as MDMessageViewer, r as MarkdownCodeBlock, l as MarkdownRenderer, c as MarkdownTable, o as MarkdownTableCopyFormat, h as MarkdownWithPlaceholders, p as PlainTextRenderer, u as defaultMarkdownComponents, n as restrainedSyntaxTheme, s as serializeMarkdownTableRows, t as useCodeCopy, g 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.20",
4
+ "version": "1.2.0-dev.207",
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.14.2",
36
- "@epam/ai-dial-react-file-manager": "^0.2.0",
35
+ "@epam/ai-dial-ui-kit": "^0.15.0-dev.23",
36
+ "@epam/ai-dial-react-file-manager": "^0.3.0-dev.16",
37
37
  "ag-grid-community": "^35.3.0"
38
38
  },
39
39
  "peerDependenciesMeta": {
@@ -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
  }({});
@@ -0,0 +1,4 @@
1
+ //#region src/utils/entity-field-limits.ts
2
+ var e = 256, t = 2e3, n = 5e4, r = /\p{Cc}/u, i = (e, t) => e.length > t, a = (e) => r.test(e);
3
+ //#endregion
4
+ export { t as ENTITY_DESCRIPTION_MAX_LENGTH, n as ENTITY_INSTRUCTIONS_MAX_LENGTH, e as ENTITY_NAME_MAX_LENGTH, i as exceedsMaxLength, a as hasControlCharacters };
@@ -1,5 +1,5 @@
1
- import { stripUrlQueryAndFragment as e } from "./mime-type.js";
2
- import { MIME_TYPE_EXT_MAP as t } from "../constants/mime-types.js";
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 e = t[a];
13
- if (e != null) return `${n}.${e}`;
12
+ let t = e[a];
13
+ if (t != null) return `${n}.${t}`;
14
14
  }
15
15
  if (i != null) {
16
- let t = r(e(i).split("/").pop() ?? "");
17
- if (t != null) return `${n}.${t}`;
16
+ let e = r(t(i).split("/").pop() ?? "");
17
+ if (e != null) return `${n}.${e}`;
18
18
  }
19
19
  return n;
20
20
  }, a = {
@@ -0,0 +1,4 @@
1
+ //#region src/utils/is-skill-selection-unsupported.ts
2
+ var e = (e, t) => !!e?.trim() && t !== !0;
3
+ //#endregion
4
+ export { e as isSkillSelectionUnsupported };
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 (!l.includes("\n") || m(i, t)) continue;
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 = l.replace(a, "").replace(o, ""), f = e.indexOf("\n", c), p = e.slice(c, f === -1 ? e.length : f);
33
- n.push(e.slice(r, i)), n.push(`$$\n${d}\n$$${p.trim() === "" ? "" : "\n"}`), r = c;
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) => {
@@ -1,8 +1,9 @@
1
1
  import e from "classnames";
2
- import { twMerge as t } from "tailwind-merge";
2
+ import { extendTailwindMerge as t } from "tailwind-merge";
3
3
  //#region src/utils/merge-class.ts
4
- function n(...n) {
5
- return t(e(...n));
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 { n as mergeClasses };
9
+ export { r as mergeClasses };
@@ -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 n = {
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
- }, r = (e) => e.split(/[?#]/)[0], i = (e) => {
69
- let t = r(e), i = t.lastIndexOf(".");
70
- if (i !== -1) return n[t.slice(i + 1).toLowerCase()];
71
- }, a = (t) => t?.startsWith("image/") ? e.Image : t?.startsWith("audio/") ? e.Audio : e.File;
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 { a as getAttachmentTypeFromMime, i as inferMimeTypeFromPath, r as stripUrlQueryAndFragment };
77
+ export { c as getAttachmentTypeFromMime, i as getBaseMimeType, s as inferMimeTypeFromPath, a as normalizeMimeType, o as stripUrlQueryAndFragment };
@@ -1,56 +0,0 @@
1
- import { DialFileName as e, NeutralButton as t, Popup as n } from "@epam/ai-dial-ui-kit";
2
- import { memo as r, useCallback as i } from "react";
3
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
- //#region src/file-manager/UploadProgressModal/UploadProgressModal.tsx
5
- var s = ({ batchState: r, uploadProgressTitle: s, uploadProgressText: c, cancelLabel: l, onCancel: u }) => {
6
- let { files: d } = r, f = i((e) => e === void 0 ? null : /* @__PURE__ */ a("div", {
7
- className: "h-1 w-full overflow-hidden rounded-full bg-control-disable-primary",
8
- "data-qa": "uploading-indicator",
9
- role: "progressbar",
10
- "aria-valuemin": 0,
11
- "aria-valuemax": 100,
12
- "aria-valuenow": e,
13
- children: /* @__PURE__ */ a("div", {
14
- className: "h-full rounded-full bg-control-accent transition-all duration-300",
15
- style: { width: `${e}%` }
16
- })
17
- }), []);
18
- return /* @__PURE__ */ a(n, {
19
- className: "!h-fit !max-h-full !w-[400px] mobile:!w-full desktop:!max-h-[693px]",
20
- open: r.isOpen,
21
- closeOnOutsideClick: !1,
22
- hideClose: !0,
23
- onClose: u,
24
- footer: /* @__PURE__ */ a("div", {
25
- className: "flex justify-end gap-2 px-6 py-4",
26
- children: /* @__PURE__ */ a(t, {
27
- label: l,
28
- onClick: u
29
- })
30
- }),
31
- header: /* @__PURE__ */ o("div", {
32
- className: "flex flex-col gap-2",
33
- children: [/* @__PURE__ */ a("div", { children: s }), /* @__PURE__ */ a("div", {
34
- className: "dial-small-text text-secondary",
35
- "data-qa": "uploading-items-count",
36
- children: c
37
- })]
38
- }),
39
- children: /* @__PURE__ */ a("div", {
40
- className: "flex h-full max-h-full flex-col gap-4 px-6",
41
- children: /* @__PURE__ */ a("div", {
42
- className: "flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto",
43
- children: d.map((t) => /* @__PURE__ */ a("div", {
44
- className: "rounded bg-layer-sunken px-3 py-2",
45
- children: /* @__PURE__ */ a(e, {
46
- name: t.name,
47
- details: f(t.percent)
48
- })
49
- }, t.id))
50
- })
51
- })
52
- });
53
- };
54
- r(s);
55
- //#endregion
56
- export { s as UploadProgressModal };