@epam/ai-dial-chat-shared 1.3.0-dev.13 → 1.3.0-dev.130
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/ConfirmationDialog/ConfirmationDialog.d.ts +41 -0
- package/components/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -0
- package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.d.ts +33 -0
- package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.d.ts.map +1 -0
- package/components/ConfirmationIdentityCard/ConfirmationIdentityCard.module.scss.js +5 -4
- package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.d.ts +33 -0
- package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.d.ts.map +1 -0
- package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.js +2 -2
- package/components/ConfirmationIdentityRow/ConfirmationIdentityRow.module.scss.js +3 -2
- package/components/ConfirmationView/ConfirmationFooter.d.ts +41 -0
- package/components/ConfirmationView/ConfirmationFooter.d.ts.map +1 -0
- package/components/ConfirmationView/ConfirmationFooter.js +1 -1
- package/components/ConfirmationView/ConfirmationView.d.ts +57 -0
- package/components/ConfirmationView/ConfirmationView.d.ts.map +1 -0
- package/components/ConfirmationView/ConfirmationView.js +16 -15
- package/components/ConfirmationView/ConfirmationView.module.scss.js +6 -5
- package/components/CopyButton/CopyButton.d.ts +19 -0
- package/components/CopyButton/CopyButton.d.ts.map +1 -0
- package/components/DeleteConfirmationDialog/DeleteConfirmationDialog.d.ts +41 -0
- package/components/DeleteConfirmationDialog/DeleteConfirmationDialog.d.ts.map +1 -0
- package/components/DeleteConfirmationDialog/DeleteConfirmationDialog.js +34 -0
- package/components/DeleteConfirmationView/DeleteConfirmationView.d.ts +49 -0
- package/components/DeleteConfirmationView/DeleteConfirmationView.d.ts.map +1 -0
- package/components/DeleteConfirmationView/DeleteConfirmationView.js +37 -0
- package/components/DeleteConfirmationView/DeleteConfirmationView.module.scss.js +7 -0
- package/components/DeploymentIcon/DeploymentIcon.d.ts +36 -0
- package/components/DeploymentIcon/DeploymentIcon.d.ts.map +1 -0
- package/components/DeploymentIcon/DeploymentIcon.module.scss.js +3 -2
- package/components/EntityHeader/EntityHeader.d.ts +38 -0
- package/components/EntityHeader/EntityHeader.d.ts.map +1 -0
- package/components/EntityHeader/EntityHeader.js +1 -1
- package/components/EntityTypeLabel/EntityTypeLabel.d.ts +18 -0
- package/components/EntityTypeLabel/EntityTypeLabel.d.ts.map +1 -0
- package/components/FeaturedChip/FeaturedChip.d.ts +16 -0
- package/components/FeaturedChip/FeaturedChip.d.ts.map +1 -0
- package/components/InitialsAvatar/InitialsAvatar.d.ts +15 -0
- package/components/InitialsAvatar/InitialsAvatar.d.ts.map +1 -0
- package/components/ItemHeader/ItemHeader.d.ts +40 -0
- package/components/ItemHeader/ItemHeader.d.ts.map +1 -0
- package/components/ItemHeader/ItemHeader.js +4 -1
- package/components/ItemHeader/ItemHeader.module.scss.js +5 -4
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts +55 -0
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.d.ts.map +1 -0
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.js +27 -27
- package/components/MarkdownRenderer/CodeBlock/CodeBlock.module.scss.js +9 -8
- package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts +7 -0
- package/components/MarkdownRenderer/CodeBlock/syntax-theme.d.ts.map +1 -0
- package/components/MarkdownRenderer/MDMessageViewer.d.ts +66 -0
- package/components/MarkdownRenderer/MDMessageViewer.d.ts.map +1 -0
- package/components/MarkdownRenderer/MDMessageViewer.js +14 -12
- package/components/MarkdownRenderer/MarkdownRenderer.d.ts +139 -0
- package/components/MarkdownRenderer/MarkdownRenderer.d.ts.map +1 -0
- package/components/MarkdownRenderer/MarkdownRenderer.js +140 -133
- package/components/MarkdownRenderer/MarkdownRenderer.module.scss.js +9 -8
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.d.ts +18 -0
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.d.ts.map +1 -0
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +1 -1
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.module.scss.js +5 -4
- package/components/MarkdownRenderer/PlainTextRenderer.d.ts +39 -0
- package/components/MarkdownRenderer/PlainTextRenderer.d.ts.map +1 -0
- package/components/MarkdownRenderer/PlainTextRenderer.js +1 -1
- package/components/MarkdownRenderer/Table/MarkdownTable.d.ts +47 -0
- package/components/MarkdownRenderer/Table/MarkdownTable.d.ts.map +1 -0
- package/components/MarkdownRenderer/Table/MarkdownTable.js +35 -31
- package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +14 -13
- package/components/MarkdownRenderer/Table/TableHeader.d.ts +22 -0
- package/components/MarkdownRenderer/Table/TableHeader.d.ts.map +1 -0
- package/components/MarkdownRenderer/Table/TableHeader.module.scss.js +3 -2
- package/components/MarkdownRenderer/Table/table-serialization.d.ts +16 -0
- package/components/MarkdownRenderer/Table/table-serialization.d.ts.map +1 -0
- package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.d.ts +27 -0
- package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.d.ts.map +1 -0
- package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts +9 -0
- package/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.d.ts.map +1 -0
- package/components/MarkdownRenderer/ThinkingShimmer.d.ts +17 -0
- package/components/MarkdownRenderer/ThinkingShimmer.d.ts.map +1 -0
- package/components/MarkdownRenderer/markdown-class-names.d.ts +10 -0
- package/components/MarkdownRenderer/markdown-class-names.d.ts.map +1 -0
- package/components/MarkdownRenderer/markdown-whitespace.d.ts +15 -0
- package/components/MarkdownRenderer/markdown-whitespace.d.ts.map +1 -0
- package/components/MarkdownRenderer/markdown-whitespace.js +14 -0
- package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.d.ts +25 -0
- package/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.d.ts.map +1 -0
- package/components/PanelEmptyState/PanelEmptyState.d.ts +22 -0
- package/components/PanelEmptyState/PanelEmptyState.d.ts.map +1 -0
- package/components/PanelEmptyState/PanelEmptyState.js +12 -9
- package/components/PanelEmptyState/PanelEmptyState.module.scss.js +3 -2
- package/components/ResourceSummary/ResourceSummary.d.ts +49 -0
- package/components/ResourceSummary/ResourceSummary.d.ts.map +1 -0
- package/components/ResourceSummary/ResourceSummary.module.scss.js +5 -4
- package/components/TextRefinementField/TextRefinementField.d.ts +33 -0
- package/components/TextRefinementField/TextRefinementField.d.ts.map +1 -0
- package/components/TextRefinementField/TextRefinementField.js +27 -17
- package/constants/breakpoint.d.ts +9 -0
- package/constants/breakpoint.d.ts.map +1 -0
- package/constants/breakpoint.js +1 -1
- package/constants/dial.d.ts +5 -0
- package/constants/dial.d.ts.map +1 -0
- package/constants/entity-colors.d.ts +6 -0
- package/constants/entity-colors.d.ts.map +1 -0
- package/constants/icon.d.ts +14 -0
- package/constants/icon.d.ts.map +1 -0
- package/constants/markdown-editor.d.ts +2 -0
- package/constants/markdown-editor.d.ts.map +1 -0
- package/constants/mime-types.d.ts +27 -0
- package/constants/mime-types.d.ts.map +1 -0
- package/constants/public-class-names.d.ts +13 -0
- package/constants/public-class-names.d.ts.map +1 -0
- package/constants/resizable-fields.d.ts +5 -0
- package/constants/resizable-fields.d.ts.map +1 -0
- package/constants/select-list.d.ts +4 -0
- package/constants/select-list.d.ts.map +1 -0
- package/constants/tag-input.d.ts +2 -0
- package/constants/tag-input.d.ts.map +1 -0
- package/entry-points/file-manager.d.ts +5 -0
- package/entry-points/file-manager.d.ts.map +1 -0
- package/entry-points/markdown.d.ts +19 -0
- package/entry-points/markdown.d.ts.map +1 -0
- package/file-manager/DialFileManagerShell/DialFileManagerShell.d.ts +65 -0
- package/file-manager/DialFileManagerShell/DialFileManagerShell.d.ts.map +1 -0
- package/file-manager/DialFileManagerShell/DialFileManagerShell.js +296 -255
- package/file-manager/DialFileManagerShell/DialFileManagerShell.module.scss.js +4 -0
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.d.ts +89 -0
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.d.ts.map +1 -0
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +3 -6
- package/file-manager/OperationLoaderModal/OperationLoaderModal.d.ts +17 -0
- package/file-manager/OperationLoaderModal/OperationLoaderModal.d.ts.map +1 -0
- package/file-manager/OperationLoaderModal/OperationLoaderModal.js +1 -1
- package/file-manager/attach-result.d.ts +9 -0
- package/file-manager/attach-result.d.ts.map +1 -0
- package/file-manager/file-manager-controller.d.ts +129 -0
- package/file-manager/file-manager-controller.d.ts.map +1 -0
- package/file-manager/file-manager-variant.d.ts +21 -0
- package/file-manager/file-manager-variant.d.ts.map +1 -0
- package/file-manager/file-upload-validation.d.ts +8 -0
- package/file-manager/file-upload-validation.d.ts.map +1 -0
- package/file-manager/index.d.ts +11 -0
- package/file-manager/index.d.ts.map +1 -0
- package/file-manager/labels.d.ts +175 -0
- package/file-manager/labels.d.ts.map +1 -0
- package/file-manager/path.d.ts +12 -0
- package/file-manager/path.d.ts.map +1 -0
- package/file-manager/shell-styles.d.ts +11 -0
- package/file-manager/shell-styles.d.ts.map +1 -0
- package/file-manager/upload-batch.d.ts +75 -0
- package/file-manager/upload-batch.d.ts.map +1 -0
- package/file-manager/upload-batch.js +6 -2
- package/file-manager/upload-queue.d.ts +45 -0
- package/file-manager/upload-queue.d.ts.map +1 -0
- package/file-manager/upload-queue.js +45 -13
- package/file-manager/useGridEditingScroll/useGridEditingScroll.d.ts +27 -0
- package/file-manager/useGridEditingScroll/useGridEditingScroll.d.ts.map +1 -0
- package/file-manager.d.ts +2 -506
- package/file-manager.js +4 -4
- package/hooks/useAvailableHeightCap.d.ts +30 -0
- package/hooks/useAvailableHeightCap.d.ts.map +1 -0
- package/hooks/useAvailableHeightCap.js +1 -1
- package/hooks/useCodeCopy.d.ts +6 -0
- package/hooks/useCodeCopy.d.ts.map +1 -0
- package/hooks/useCollapsedText.d.ts +27 -0
- package/hooks/useCollapsedText.d.ts.map +1 -0
- package/hooks/useHorizontalOverflow.d.ts +21 -0
- package/hooks/useHorizontalOverflow.d.ts.map +1 -0
- package/hooks/useIsMobile.d.ts +3 -0
- package/hooks/useIsMobile.d.ts.map +1 -0
- package/hooks/useIsMobile.js +1 -1
- package/hooks/useStreamedMarkdownContent.d.ts +3 -0
- package/hooks/useStreamedMarkdownContent.d.ts.map +1 -0
- package/hooks/useTextRefinement.d.ts +44 -0
- package/hooks/useTextRefinement.d.ts.map +1 -0
- package/hooks/useUnsavedChangesGuard.d.ts +14 -0
- package/hooks/useUnsavedChangesGuard.d.ts.map +1 -0
- package/hooks/useUnsavedChangesGuard.js +1 -5
- package/index.css +3 -2
- package/index.d.ts +79 -3072
- package/index.d.ts.map +1 -0
- package/index.js +68 -64
- package/markdown.d.ts +2 -465
- package/markdown.js +3 -2
- package/models/annotation.d.ts +143 -0
- package/models/annotation.d.ts.map +1 -0
- package/models/application-visualizer.d.ts +67 -0
- package/models/application-visualizer.d.ts.map +1 -0
- package/models/auth.d.ts +26 -0
- package/models/auth.d.ts.map +1 -0
- package/models/chat.d.ts +407 -0
- package/models/chat.d.ts.map +1 -0
- package/models/conversation-classification.d.ts +9 -0
- package/models/conversation-classification.d.ts.map +1 -0
- package/models/conversation-transfer.d.ts +96 -0
- package/models/conversation-transfer.d.ts.map +1 -0
- package/models/custom-visualizer.d.ts +61 -0
- package/models/custom-visualizer.d.ts.map +1 -0
- package/models/deployment-configuration.d.ts +55 -0
- package/models/deployment-configuration.d.ts.map +1 -0
- package/models/deployment-features.d.ts +17 -0
- package/models/deployment-features.d.ts.map +1 -0
- package/models/deployment.d.ts +31 -0
- package/models/deployment.d.ts.map +1 -0
- package/models/dial-model.d.ts +19 -0
- package/models/dial-model.d.ts.map +1 -0
- package/models/entity.d.ts +15 -0
- package/models/entity.d.ts.map +1 -0
- package/models/import-export.d.ts +23 -0
- package/models/import-export.d.ts.map +1 -0
- package/models/inline-segment.d.ts +11 -0
- package/models/inline-segment.d.ts.map +1 -0
- package/models/locale.d.ts +19 -0
- package/models/locale.d.ts.map +1 -0
- package/models/text-refinement.d.ts +18 -0
- package/models/text-refinement.d.ts.map +1 -0
- package/models/theme.d.ts +36 -0
- package/models/theme.d.ts.map +1 -0
- package/models/tool-menu-item.d.ts +13 -0
- package/models/tool-menu-item.d.ts.map +1 -0
- package/package.json +3 -3
- package/types/attachment.d.ts +25 -0
- package/types/attachment.d.ts.map +1 -0
- package/types/code-editor.d.ts +8 -0
- package/types/code-editor.d.ts.map +1 -0
- package/types/entity-type.d.ts +10 -0
- package/types/entity-type.d.ts.map +1 -0
- package/types/file-manager-node.d.ts +17 -0
- package/types/file-manager-node.d.ts.map +1 -0
- package/types/mime-type.d.ts +59 -0
- package/types/mime-type.d.ts.map +1 -0
- package/utils/annotation.d.ts +29 -0
- package/utils/annotation.d.ts.map +1 -0
- package/utils/avatar-color.d.ts +10 -0
- package/utils/avatar-color.d.ts.map +1 -0
- package/utils/base64-json.d.ts +14 -0
- package/utils/base64-json.d.ts.map +1 -0
- package/utils/base64-json.js +4 -0
- package/utils/build-css-vars.d.ts +4 -0
- package/utils/build-css-vars.d.ts.map +1 -0
- package/utils/copy-to-clipboard.d.ts +18 -0
- package/utils/copy-to-clipboard.d.ts.map +1 -0
- package/utils/entity-field-limits.d.ts +11 -0
- package/utils/entity-field-limits.d.ts.map +1 -0
- package/utils/entity-type.d.ts +5 -0
- package/utils/entity-type.d.ts.map +1 -0
- package/utils/file-download.d.ts +21 -0
- package/utils/file-download.d.ts.map +1 -0
- package/utils/format-file-size.d.ts +3 -0
- package/utils/format-file-size.d.ts.map +1 -0
- package/utils/format-last-used.d.ts +3 -0
- package/utils/format-last-used.d.ts.map +1 -0
- package/utils/format-price.d.ts +7 -0
- package/utils/format-price.d.ts.map +1 -0
- package/utils/format-price.js +10 -10
- package/utils/generate-uuid.d.ts +3 -0
- package/utils/generate-uuid.d.ts.map +1 -0
- package/utils/initials.d.ts +3 -0
- package/utils/initials.d.ts.map +1 -0
- package/utils/inline-segments.d.ts +38 -0
- package/utils/inline-segments.d.ts.map +1 -0
- package/utils/inline-segments.js +53 -0
- package/utils/is-audio-transcription-supported.d.ts +3 -0
- package/utils/is-audio-transcription-supported.d.ts.map +1 -0
- package/utils/is-skill-selection-unsupported.d.ts +3 -0
- package/utils/is-skill-selection-unsupported.d.ts.map +1 -0
- package/utils/latex.d.ts +22 -0
- package/utils/latex.d.ts.map +1 -0
- package/utils/latex.js +47 -41
- package/utils/markdown-html.d.ts +14 -0
- package/utils/markdown-html.d.ts.map +1 -0
- package/utils/markdown-html.js +11 -0
- package/utils/merge-class.d.ts +4 -0
- package/utils/merge-class.d.ts.map +1 -0
- package/utils/message-attachment-to-display.d.ts +22 -0
- package/utils/message-attachment-to-display.d.ts.map +1 -0
- package/utils/message-attachment-to-display.js +1 -1
- package/utils/message.d.ts +4 -0
- package/utils/message.d.ts.map +1 -0
- package/utils/mime-type.d.ts +22 -0
- package/utils/mime-type.d.ts.map +1 -0
- package/utils/mime-type.js +1 -1
- package/utils/prompt-variables.d.ts +62 -0
- package/utils/prompt-variables.d.ts.map +1 -0
- package/utils/prompt-variables.js +5 -9
- package/utils/string-utils.d.ts +11 -0
- package/utils/string-utils.d.ts.map +1 -0
- package/utils/syntax-highlighting.d.ts +8 -0
- package/utils/syntax-highlighting.d.ts.map +1 -0
- package/utils/syntax-highlighting.js +8 -8
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { MarkdownRendererClassNames, MarkdownRendererColors } from './MarkdownRenderer';
|
|
3
|
+
/** Props for {@link PlainTextRenderer}. */
|
|
4
|
+
export interface PlainTextRendererProps {
|
|
5
|
+
/** Message text. Rendered verbatim — never parsed as Markdown or HTML. */
|
|
6
|
+
content: string;
|
|
7
|
+
/** Classes applied to the renderer root. */
|
|
8
|
+
containerClassName?: string;
|
|
9
|
+
/** When true, appended content is revealed gradually for smoother streaming updates. */
|
|
10
|
+
isStreaming?: boolean;
|
|
11
|
+
/** Reveal speed used while `isStreaming` is true. Defaults to 120 characters per second. */
|
|
12
|
+
streamCharactersPerSecond?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Typography classes. Only `p` is read — the single paragraph the renderer
|
|
15
|
+
* emits — so the same object a Markdown message is styled with keeps both
|
|
16
|
+
* formats on one type scale.
|
|
17
|
+
*/
|
|
18
|
+
classNames?: Pick<MarkdownRendererClassNames, 'p'>;
|
|
19
|
+
/**
|
|
20
|
+
* Label shown with a shimmer animation while `isStreaming` is true and no
|
|
21
|
+
* content has arrived yet. Defaults to `'Thinking'`.
|
|
22
|
+
*/
|
|
23
|
+
thinkingLabel?: string;
|
|
24
|
+
/** Color overrides applied as CSS custom properties. */
|
|
25
|
+
colors?: Pick<MarkdownRendererColors, 'thinkingPrimary' | 'thinkingSecondary'>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Renders message text as plain text: no Markdown pipeline, no raw HTML, no
|
|
29
|
+
* syntax highlighting. The text is a React text child, so it is escaped by
|
|
30
|
+
* construction — a table, a heading, or `**bold**` reaches the reader exactly
|
|
31
|
+
* as the model emitted it, which is what a conversation's `plain_text`
|
|
32
|
+
* response format promises.
|
|
33
|
+
*
|
|
34
|
+
* Lives beside {@link MarkdownRenderer} because it is the other half of the
|
|
35
|
+
* same choice: both render an assistant message body, and both are selected
|
|
36
|
+
* by `MDMessageViewer` from the conversation's response format.
|
|
37
|
+
*/
|
|
38
|
+
export declare const PlainTextRenderer: FC<PlainTextRendererProps>;
|
|
39
|
+
//# sourceMappingURL=PlainTextRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlainTextRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/MarkdownRenderer/PlainTextRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,KAAK,EACV,0BAA0B,EAC1B,sBAAsB,EACvB,MAAM,oBAAoB,CAAC;AAG5B,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,4CAA4C;IAC5C,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wFAAwF;IACxF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,4FAA4F;IAC5F,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC;;;;OAIG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;IACnD;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,MAAM,CAAC,EAAE,IAAI,CACX,sBAAsB,EACtB,iBAAiB,GAAG,mBAAmB,CACxC,CAAC;CACH;AAKD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAuCxD,CAAC"}
|
|
@@ -12,7 +12,7 @@ var a = {}, o = r(({ content: r, containerClassName: o, isStreaming: s, streamCh
|
|
|
12
12
|
}) : /* @__PURE__ */ i("div", {
|
|
13
13
|
className: o,
|
|
14
14
|
children: /* @__PURE__ */ i("p", {
|
|
15
|
-
className: e(l.p, "
|
|
15
|
+
className: e(l.p, "[overflow-wrap:anywhere] break-words whitespace-pre-wrap"),
|
|
16
16
|
children: f
|
|
17
17
|
})
|
|
18
18
|
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { MarkdownTableActionLabels } from './table-serialization';
|
|
3
|
+
export { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, MARKDOWN_TABLE_CSV_MIME_TYPE, MarkdownTableCopyFormat, serializeMarkdownTableRows, type MarkdownTableActionLabels, } from './table-serialization';
|
|
4
|
+
export type { MarkdownTableHeaderAction } from './useMarkdownTableActions/useMarkdownTableActions';
|
|
5
|
+
/** Per-element className overrides for {@link MarkdownTable}. */
|
|
6
|
+
export interface MarkdownTableClassNames {
|
|
7
|
+
/** Extra classes on the outer table wrapper. */
|
|
8
|
+
tableWrapper?: string;
|
|
9
|
+
/** Typography class for the table. Defaults to `'dial-small-text'`. */
|
|
10
|
+
tableFont?: string;
|
|
11
|
+
/** Extra classes on the scrollable table region. */
|
|
12
|
+
tableScrollContainer?: string;
|
|
13
|
+
}
|
|
14
|
+
/** CSS custom-property overrides for the `MarkdownTable` component. */
|
|
15
|
+
export interface MarkdownTableColors {
|
|
16
|
+
/** Scroll container border color. */
|
|
17
|
+
border?: string;
|
|
18
|
+
/** Scrollbar thumb/track color. */
|
|
19
|
+
scrollbar?: string;
|
|
20
|
+
/** Edge-fade mask color; only its alpha is used. Defaults to `--stroke-focus-black`. */
|
|
21
|
+
fade?: string;
|
|
22
|
+
/** Divider color between rows. Defaults to `--stroke-tertiary`. */
|
|
23
|
+
rowDivider?: string;
|
|
24
|
+
/** Background of a body row on hover. Defaults to `--bg-control-accent-alpha-hover`. */
|
|
25
|
+
rowHoverBackground?: string;
|
|
26
|
+
}
|
|
27
|
+
/** Props for {@link MarkdownTable}. */
|
|
28
|
+
export interface MarkdownTableProps {
|
|
29
|
+
/** Table body/children rendered inside the scrollable wrapper (typically `<thead>`/`<tbody>` from react-markdown). */
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
/** Per-element className overrides. */
|
|
32
|
+
classNames: MarkdownTableClassNames;
|
|
33
|
+
/** Color overrides applied as CSS custom properties. */
|
|
34
|
+
colors?: MarkdownTableColors;
|
|
35
|
+
/** Localized labels for table actions. Supplying them enables the action bar. */
|
|
36
|
+
actionLabels?: MarkdownTableActionLabels;
|
|
37
|
+
/** Filename used when downloading the table as CSV. Defaults to `'table.csv'`. */
|
|
38
|
+
downloadFilename?: string;
|
|
39
|
+
/** When true, table actions are hidden while content is still arriving. */
|
|
40
|
+
isStreaming?: boolean;
|
|
41
|
+
onOpenInCanvas?: (markdown: string) => void;
|
|
42
|
+
/** Accessible label for the horizontally scrollable region. Defaults to `'Scrollable table'`. */
|
|
43
|
+
scrollRegionAriaLabel?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Renders a responsive Markdown table with an end fade while more columns are available. */
|
|
46
|
+
export declare const MarkdownTable: FC<MarkdownTableProps>;
|
|
47
|
+
//# sourceMappingURL=MarkdownTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownTable.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/Table/MarkdownTable.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EAAE,EACP,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAQf,OAAO,EAKL,KAAK,yBAAyB,EAC/B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,wCAAwC,EACxC,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,EAC1B,KAAK,yBAAyB,GAC/B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,yBAAyB,EAAE,MAAM,mDAAmD,CAAC;AAEnG,iEAAiE;AACjE,MAAM,WAAW,uBAAuB;IACtC,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,uEAAuE;AACvE,MAAM,WAAW,mBAAmB;IAClC,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wFAAwF;IACxF,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IACjC,sHAAsH;IACtH,QAAQ,EAAE,SAAS,CAAC;IACpB,uCAAuC;IACvC,UAAU,EAAE,uBAAuB,CAAC;IACpC,wDAAwD;IACxD,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,iFAAiF;IACjF,YAAY,CAAC,EAAE,yBAAyB,CAAC;IACzC,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,2EAA2E;IAC3E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,iGAAiG;IACjG,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAID,6FAA6F;AAC7F,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,CA6JhD,CAAC"}
|
|
@@ -5,66 +5,70 @@ import { downloadTextFile as r } from "../../../utils/file-download.js";
|
|
|
5
5
|
import { CHAT_SHARED_CLASS as i } from "../../../constants/public-class-names.js";
|
|
6
6
|
import { useHorizontalOverflow as a } from "../../../hooks/useHorizontalOverflow.js";
|
|
7
7
|
import o from "./MarkdownTable.module.scss.js";
|
|
8
|
-
import {
|
|
9
|
-
import { useMarkdownTableActions as
|
|
10
|
-
import { ElementSize as
|
|
11
|
-
import { memo as
|
|
12
|
-
import { jsx as
|
|
8
|
+
import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as s, MARKDOWN_TABLE_CSV_MIME_TYPE as c, MarkdownTableCopyFormat as l, serializeMarkdownTableRows as u } from "./table-serialization.js";
|
|
9
|
+
import { useMarkdownTableActions as d } from "./useMarkdownTableActions/useMarkdownTableActions.js";
|
|
10
|
+
import { ElementSize as f, GhostIconButton as p } from "@epam/ai-dial-ui-kit";
|
|
11
|
+
import { memo as m, useCallback as h, useEffect as g, useRef as _, useState as v } from "react";
|
|
12
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
13
13
|
//#region src/components/MarkdownRenderer/Table/MarkdownTable.tsx
|
|
14
|
-
var
|
|
15
|
-
let [O, k] =
|
|
14
|
+
var x = 2e3, S = m(({ children: s, classNames: m, colors: S, actionLabels: C, downloadFilename: w, isStreaming: T, onOpenInCanvas: E, scrollRegionAriaLabel: D = "Scrollable table" }) => {
|
|
15
|
+
let [O, k] = v(!1), A = _(null), { scrollContainerRef: j, contentRef: M, hasContentBeyondStart: N, hasContentBeyondEnd: P, handleScroll: F } = a(), I = t({
|
|
16
16
|
"--cm-markdown-border": S?.border,
|
|
17
17
|
"--cm-table-scrollbar": S?.scrollbar,
|
|
18
18
|
"--cm-table-fade": S?.fade,
|
|
19
19
|
"--cm-table-row-divider": S?.rowDivider,
|
|
20
20
|
"--cm-table-row-hover-bg": S?.rowHoverBackground
|
|
21
21
|
}), L = N || P;
|
|
22
|
-
|
|
22
|
+
g(() => () => {
|
|
23
23
|
A.current != null && clearTimeout(A.current);
|
|
24
24
|
}, []);
|
|
25
|
-
let R =
|
|
25
|
+
let R = h(() => {
|
|
26
26
|
let e = M.current;
|
|
27
|
-
e
|
|
27
|
+
if (e == null) return;
|
|
28
|
+
let t = u(Array.from(e.rows), l.Markdown);
|
|
29
|
+
n(t).then((e) => {
|
|
28
30
|
e && (A.current != null && clearTimeout(A.current), k(!0), A.current = setTimeout(() => {
|
|
29
31
|
k(!1);
|
|
30
|
-
},
|
|
32
|
+
}, x));
|
|
31
33
|
});
|
|
32
|
-
}, [M]), z =
|
|
34
|
+
}, [M]), z = h(() => {
|
|
33
35
|
let e = M.current;
|
|
34
|
-
e
|
|
35
|
-
|
|
36
|
+
if (e == null) return;
|
|
37
|
+
let t = u(Array.from(e.rows), l.Csv);
|
|
38
|
+
r(`\uFEFF${t}`, w ?? "table.csv", c);
|
|
39
|
+
}, [M, w]), B = h(() => {
|
|
36
40
|
let e = M.current;
|
|
37
|
-
e
|
|
38
|
-
}, [M, E]), V =
|
|
41
|
+
e != null && E != null && E(u(Array.from(e.rows), l.Markdown));
|
|
42
|
+
}, [M, E]), V = d({
|
|
39
43
|
actionLabels: C,
|
|
40
44
|
isCopied: O,
|
|
41
45
|
onCopy: R,
|
|
42
46
|
onDownloadCsv: z,
|
|
43
47
|
onOpenInCanvas: E == null ? void 0 : B
|
|
44
48
|
}), H = V.length > 0 && !T;
|
|
45
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ b("div", {
|
|
46
50
|
style: I,
|
|
47
|
-
className: e("group/table relative w-full
|
|
51
|
+
className: e("group/table relative w-full max-w-full min-w-0 [overflow:clip] rounded-xl border", o.tableContainer, m.tableWrapper, i.table),
|
|
48
52
|
children: [
|
|
49
|
-
H && /* @__PURE__ */
|
|
53
|
+
H && /* @__PURE__ */ y("div", {
|
|
50
54
|
className: "sticky top-0 z-10 h-0",
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
className: "absolute
|
|
53
|
-
children: V.map((e) => /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ y("div", {
|
|
56
|
+
className: "absolute inset-e-2 top-2 flex items-center gap-1 rounded-lg border border-tertiary bg-layer-raised px-2 py-1 opacity-0 shadow-xs transition-opacity group-hover/table:opacity-100 focus-within:opacity-100",
|
|
57
|
+
children: V.map((e) => /* @__PURE__ */ y(p, {
|
|
54
58
|
tooltipProps: { tooltip: e.label },
|
|
55
59
|
"aria-label": e.label,
|
|
56
|
-
icon: /* @__PURE__ */
|
|
60
|
+
icon: /* @__PURE__ */ y("span", {
|
|
57
61
|
"aria-hidden": !0,
|
|
58
62
|
children: e.icon
|
|
59
63
|
}),
|
|
60
|
-
size:
|
|
64
|
+
size: f.Small,
|
|
61
65
|
onClick: e.onClick
|
|
62
66
|
}, e.label))
|
|
63
67
|
})
|
|
64
68
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ y("div", {
|
|
66
70
|
ref: j,
|
|
67
|
-
className: e("w-full
|
|
71
|
+
className: e("w-full max-w-full min-w-0 overflow-x-auto", o.scrollContainer, m.tableScrollContainer, {
|
|
68
72
|
[o.tableScrollFadeBoth]: N && P,
|
|
69
73
|
[o.tableScrollFadeStart]: N && !P,
|
|
70
74
|
[o.tableScrollFadeEnd]: !N && P
|
|
@@ -73,13 +77,13 @@ var b = 2e3, x = p(({ children: p, classNames: x, colors: S, actionLabels: C, do
|
|
|
73
77
|
role: L ? "region" : void 0,
|
|
74
78
|
"aria-label": L ? D : void 0,
|
|
75
79
|
tabIndex: L ? 0 : void 0,
|
|
76
|
-
children: /* @__PURE__ */
|
|
80
|
+
children: /* @__PURE__ */ y("table", {
|
|
77
81
|
ref: M,
|
|
78
|
-
className: e("w-max min-w-full border-collapse",
|
|
79
|
-
children:
|
|
82
|
+
className: e("w-max min-w-full border-collapse", m.tableFont ?? "dial-small-text"),
|
|
83
|
+
children: s
|
|
80
84
|
})
|
|
81
85
|
}),
|
|
82
|
-
C?.copyLabel && /* @__PURE__ */
|
|
86
|
+
C?.copyLabel && /* @__PURE__ */ y("span", {
|
|
83
87
|
"aria-live": "polite",
|
|
84
88
|
className: "sr-only",
|
|
85
89
|
role: "status",
|
|
@@ -89,4 +93,4 @@ var b = 2e3, x = p(({ children: p, classNames: x, colors: S, actionLabels: C, do
|
|
|
89
93
|
});
|
|
90
94
|
});
|
|
91
95
|
//#endregion
|
|
92
|
-
export {
|
|
96
|
+
export { s as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, c as MARKDOWN_TABLE_CSV_MIME_TYPE, S as MarkdownTable, l as MarkdownTableCopyFormat, u as serializeMarkdownTableRows };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
//#region src/components/MarkdownRenderer/Table/MarkdownTable.module.scss
|
|
2
|
+
var e = "_tableContainer_1qw2e_1", t = "_tableContainerLight_1qw2e_6", n = "_copiedIcon_1qw2e_10", r = "_scrollContainer_1qw2e_14", i = "_tableHeaderCell_1qw2e_30", a = "_sectionRow_1qw2e_37", o = "_rowDivider_1qw2e_41", s = "_row_1qw2e_41", c = "_tableScrollFadeEnd_1qw2e_51", l = "_tableScrollFadeStart_1qw2e_59", u = "_tableScrollFadeBoth_1qw2e_67", d = {
|
|
3
|
+
tableContainer: e,
|
|
4
|
+
tableContainerLight: t,
|
|
5
|
+
copiedIcon: n,
|
|
6
|
+
scrollContainer: r,
|
|
7
|
+
tableHeaderCell: i,
|
|
8
|
+
sectionRow: a,
|
|
9
|
+
rowDivider: o,
|
|
10
|
+
row: s,
|
|
11
|
+
tableScrollFadeEnd: c,
|
|
12
|
+
tableScrollFadeStart: l,
|
|
13
|
+
tableScrollFadeBoth: u
|
|
13
14
|
};
|
|
14
15
|
//#endregion
|
|
15
|
-
export {
|
|
16
|
+
export { n as copiedIcon, d as default, s as row, o as rowDivider, r as scrollContainer, a as sectionRow, e as tableContainer, t as tableContainerLight, i as tableHeaderCell, u as tableScrollFadeBoth, c as tableScrollFadeEnd, l as tableScrollFadeStart };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
/** A single action rendered by {@link TableHeader}. */
|
|
3
|
+
export interface TableHeaderAction {
|
|
4
|
+
/** Stable accessible name and tooltip text. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Decorative icon content rendered inside the action button. */
|
|
7
|
+
icon: ReactNode;
|
|
8
|
+
/** Called when the action button is activated. */
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
}
|
|
11
|
+
/** Props for {@link TableHeader}. */
|
|
12
|
+
export interface TableHeaderProps {
|
|
13
|
+
/** Content rendered at the inline start of the header. */
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
/** Action descriptors rendered as icon buttons at the inline end. */
|
|
16
|
+
actions?: TableHeaderAction[];
|
|
17
|
+
/** Extra classes merged onto the header. */
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Reusable table header with caller-supplied leading content and actions. */
|
|
21
|
+
export declare const TableHeader: FC<TableHeaderProps>;
|
|
22
|
+
//# sourceMappingURL=TableHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/Table/TableHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3C,uDAAuD;AACvD,MAAM,WAAW,iBAAiB;IAChC,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,IAAI,EAAE,SAAS,CAAC;IAChB,kDAAkD;IAClD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,qEAAqE;IACrE,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC9B,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,8EAA8E;AAC9E,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAgC5C,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare enum MarkdownTableCopyFormat {
|
|
2
|
+
Csv = "csv",
|
|
3
|
+
Markdown = "markdown"
|
|
4
|
+
}
|
|
5
|
+
/** Default filename used when downloading a Markdown table as CSV. */
|
|
6
|
+
export declare const DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME = "table.csv";
|
|
7
|
+
/** MIME type used when downloading a Markdown table as CSV. */
|
|
8
|
+
export declare const MARKDOWN_TABLE_CSV_MIME_TYPE = "text/csv;charset=utf-8";
|
|
9
|
+
export interface MarkdownTableActionLabels {
|
|
10
|
+
copyLabel?: string;
|
|
11
|
+
copiedLabel?: string;
|
|
12
|
+
downloadCsvLabel?: string;
|
|
13
|
+
openInCanvasLabel?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const serializeMarkdownTableRows: (rows: readonly HTMLTableRowElement[], format: MarkdownTableCopyFormat) => string;
|
|
16
|
+
//# sourceMappingURL=table-serialization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-serialization.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/Table/table-serialization.ts"],"names":[],"mappings":"AAAA,oBAAY,uBAAuB;IACjC,GAAG,QAAQ;IACX,QAAQ,aAAa;CACtB;AAED,sEAAsE;AACtE,eAAO,MAAM,wCAAwC,cAAc,CAAC;AACpE,+DAA+D;AAC/D,eAAO,MAAM,4BAA4B,2BAA2B,CAAC;AAErE,MAAM,WAAW,yBAAyB;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAsID,eAAO,MAAM,0BAA0B,GACrC,MAAM,SAAS,mBAAmB,EAAE,EACpC,QAAQ,uBAAuB,KAC9B,MAiBF,CAAC"}
|
package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { MarkdownTableActionLabels } from '../table-serialization';
|
|
3
|
+
/** A table action rendered as an icon button. */
|
|
4
|
+
export interface MarkdownTableHeaderAction {
|
|
5
|
+
/** Stable accessible name and tooltip text. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Decorative icon content. */
|
|
8
|
+
icon: ReactNode;
|
|
9
|
+
/** Called when the action is activated. */
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
}
|
|
12
|
+
/** Params for {@link useMarkdownTableActions}. */
|
|
13
|
+
export interface UseMarkdownTableActionsParams {
|
|
14
|
+
/** Localized labels for table actions. `undefined` yields no actions. */
|
|
15
|
+
actionLabels: MarkdownTableActionLabels | undefined;
|
|
16
|
+
/** Whether the table has just been copied (shows a checkmark on the copy button). */
|
|
17
|
+
isCopied: boolean;
|
|
18
|
+
/** Called when the copy action is activated. */
|
|
19
|
+
onCopy: () => void;
|
|
20
|
+
/** Called when the download-as-CSV action is activated. */
|
|
21
|
+
onDownloadCsv: () => void;
|
|
22
|
+
/** Called when the open-in-canvas action is activated. Omit to hide that action. */
|
|
23
|
+
onOpenInCanvas?: () => void;
|
|
24
|
+
}
|
|
25
|
+
/** Builds the {@link MarkdownTableHeaderAction} list for a table's action bar from its localized labels. */
|
|
26
|
+
export declare const useMarkdownTableActions: ({ actionLabels, isCopied, onCopy, onDownloadCsv, onOpenInCanvas, }: UseMarkdownTableActionsParams) => MarkdownTableHeaderAction[];
|
|
27
|
+
//# sourceMappingURL=useMarkdownTableActions.d.ts.map
|
package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMarkdownTableActions.d.ts","sourceRoot":"","sources":["../../../../../src/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAExE,iDAAiD;AACjD,MAAM,WAAW,yBAAyB;IACxC,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,IAAI,EAAE,SAAS,CAAC;IAChB,2CAA2C;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,kDAAkD;AAClD,MAAM,WAAW,6BAA6B;IAC5C,yEAAyE;IACzE,YAAY,EAAE,yBAAyB,GAAG,SAAS,CAAC;IACpD,qFAAqF;IACrF,QAAQ,EAAE,OAAO,CAAC;IAClB,gDAAgD;IAChD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,2DAA2D;IAC3D,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED,4GAA4G;AAC5G,eAAO,MAAM,uBAAuB,GAAI,oEAMrC,6BAA6B,KAAG,yBAAyB,EAyD3D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
/** Props for {@link MarkdownTaskCheckbox}. */
|
|
3
|
+
export interface MarkdownTaskCheckboxProps {
|
|
4
|
+
/** Whether the GFM task-list item is checked. Defaults to `false`. */
|
|
5
|
+
checked?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Read-only checkbox for GFM task-list items (`- [ ]` / `- [x]`). */
|
|
8
|
+
export declare const MarkdownTaskCheckbox: FC<MarkdownTaskCheckboxProps>;
|
|
9
|
+
//# sourceMappingURL=MarkdownTaskCheckbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownTaskCheckbox.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownRenderer/TaskCheckbox/MarkdownTaskCheckbox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,8CAA8C;AAC9C,MAAM,WAAW,yBAAyB;IACxC,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,sEAAsE;AACtE,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,yBAAyB,CAM9D,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { MarkdownRendererColors } from './MarkdownRenderer';
|
|
3
|
+
/** Props for {@link ThinkingShimmer}. */
|
|
4
|
+
export interface ThinkingShimmerProps {
|
|
5
|
+
/** Text rendered with the shimmer animation. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Gradient color overrides applied as CSS custom properties. */
|
|
8
|
+
colors?: Pick<MarkdownRendererColors, 'thinkingPrimary' | 'thinkingSecondary'>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The "thinking" placeholder both message renderers show while a stream has
|
|
12
|
+
* started but no content has arrived yet. Owns the mapping from the public
|
|
13
|
+
* color props to the gradient's CSS variables — `thinkingPrimary` drives
|
|
14
|
+
* `--cm-thinking-inverted` — so that mapping exists in one place.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ThinkingShimmer: FC<ThinkingShimmerProps>;
|
|
17
|
+
//# sourceMappingURL=ThinkingShimmer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThinkingShimmer.d.ts","sourceRoot":"","sources":["../../../src/components/MarkdownRenderer/ThinkingShimmer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAGjE,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,MAAM,CAAC,EAAE,IAAI,CACX,sBAAsB,EACtB,iBAAiB,GAAG,mBAAmB,CACxC,CAAC;CACH;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAapD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MarkdownRendererClassNames } from './MarkdownRenderer';
|
|
2
|
+
/** Default typography classNames for rendering markdown with full visual hierarchy. */
|
|
3
|
+
export declare const DEFAULT_MARKDOWN_CLASS_NAMES: MarkdownRendererClassNames;
|
|
4
|
+
/**
|
|
5
|
+
* {@link DEFAULT_MARKDOWN_CLASS_NAMES} with the body copy one step down the
|
|
6
|
+
* type scale. Headings, code, and tables are unchanged — only the text that
|
|
7
|
+
* dominates a long answer shrinks, so more of it fits on a narrow viewport.
|
|
8
|
+
*/
|
|
9
|
+
export declare const COMPACT_MARKDOWN_CLASS_NAMES: MarkdownRendererClassNames;
|
|
10
|
+
//# sourceMappingURL=markdown-class-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-class-names.d.ts","sourceRoot":"","sources":["../../../src/components/MarkdownRenderer/markdown-class-names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAErE,uFAAuF;AACvF,eAAO,MAAM,4BAA4B,EAAE,0BAe1C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,EAAE,0BAI1C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Minimal hast node shape walked by {@link rehypePreserveSpaces}. */
|
|
2
|
+
interface HastNodeLike {
|
|
3
|
+
/** Node type — `'element'`, `'text'`, `'root'`, … */
|
|
4
|
+
type: string;
|
|
5
|
+
/** Tag name of an element node. */
|
|
6
|
+
tagName?: string;
|
|
7
|
+
/** Text of a text node. */
|
|
8
|
+
value?: string;
|
|
9
|
+
/** Child nodes of a parent node. */
|
|
10
|
+
children?: HastNodeLike[];
|
|
11
|
+
}
|
|
12
|
+
/** Rehype plugin that keeps runs of consecutive spaces in prose visible instead of letting HTML collapse them to one. */
|
|
13
|
+
export declare const rehypePreserveSpaces: () => (tree: HastNodeLike) => void;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=markdown-whitespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-whitespace.d.ts","sourceRoot":"","sources":["../../../src/components/MarkdownRenderer/markdown-whitespace.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,UAAU,YAAY;IACpB,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,mCAAmC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AA8BD,yHAAyH;AACzH,eAAO,MAAM,oBAAoB,SAAU,MAAM,YAAY,SAE5D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/components/MarkdownRenderer/markdown-whitespace.ts
|
|
2
|
+
var e = /* @__PURE__ */ new Set([
|
|
3
|
+
"code",
|
|
4
|
+
"pre",
|
|
5
|
+
"math",
|
|
6
|
+
"script",
|
|
7
|
+
"style"
|
|
8
|
+
]), t = "\xA0", n = / {2,}/g, r = (e) => `${t.repeat(e.length - 1)} `, i = (t) => {
|
|
9
|
+
t.type === "text" && t.value ? t.value = t.value.replace(n, r) : t.type === "element" && t.tagName && e.has(t.tagName) || t.children?.forEach(i);
|
|
10
|
+
}, a = () => (e) => {
|
|
11
|
+
i(e);
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { a as rehypePreserveSpaces };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
/** Props for {@link MarkdownWithPlaceholders}. */
|
|
3
|
+
export interface MarkdownWithPlaceholdersProps {
|
|
4
|
+
/** Raw markdown string to render, read-only. */
|
|
5
|
+
content: string;
|
|
6
|
+
/** Typography class overrides applied to `<h1>`–`<h6>`. Defaults to no override. */
|
|
7
|
+
headingClassName?: string;
|
|
8
|
+
/** Accessible label for the copy button in code blocks. Forwarded to {@link MarkdownRenderer}; defaults to `'Copy code'`. */
|
|
9
|
+
codeBlockCopyLabel?: string;
|
|
10
|
+
/** Status announced after a code block has been copied. Forwarded to {@link MarkdownRenderer}; defaults to `'Copied!'`. */
|
|
11
|
+
codeBlockCopiedLabel?: string;
|
|
12
|
+
/** Accessible label for the download button in code blocks. Forwarded to {@link MarkdownRenderer}; defaults to `'Download code'`. */
|
|
13
|
+
codeBlockDownloadLabel?: string;
|
|
14
|
+
/** Accessible label for a table's scrollable region. Forwarded to {@link MarkdownRenderer}; defaults to `'Scrollable table'`. */
|
|
15
|
+
tableScrollRegionAriaLabel?: string;
|
|
16
|
+
/** Accessible label for a block formula's scrollable region. Forwarded to {@link MarkdownRenderer}; defaults to `'Scrollable formula'`. */
|
|
17
|
+
mathScrollRegionAriaLabel?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Renders read-only markdown with every `{{param}}` token wrapped in a
|
|
21
|
+
* `cat-prompt-variable`-classed span the host can style apart from the
|
|
22
|
+
* surrounding prose.
|
|
23
|
+
*/
|
|
24
|
+
export declare const MarkdownWithPlaceholders: FC<MarkdownWithPlaceholdersProps>;
|
|
25
|
+
//# sourceMappingURL=MarkdownWithPlaceholders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownWithPlaceholders.d.ts","sourceRoot":"","sources":["../../../src/components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAO3B,kDAAkD;AAClD,MAAM,WAAW,6BAA6B;IAC5C,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6HAA6H;IAC7H,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,2HAA2H;IAC3H,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,qIAAqI;IACrI,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,iIAAiI;IACjI,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,2IAA2I;IAC3I,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC;AAKD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,EAAE,EAAE,CAAC,6BAA6B,CAsBtE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
/** CSS custom-property overrides for the `PanelEmptyState` component. */
|
|
3
|
+
export interface PanelEmptyStateColors {
|
|
4
|
+
/** Label text color. */
|
|
5
|
+
label?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Props for `PanelEmptyState`. */
|
|
8
|
+
export interface PanelEmptyStateProps {
|
|
9
|
+
/** Primary message of the empty state. */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Color overrides applied as CSS custom properties. */
|
|
12
|
+
colors?: PanelEmptyStateColors;
|
|
13
|
+
/** CSS class applied to the label text. Defaults to `'dial-tiny-text'`. */
|
|
14
|
+
labelClassName?: string;
|
|
15
|
+
/** CSS class applied to the empty-state container. */
|
|
16
|
+
containerClassName?: string;
|
|
17
|
+
/** Decorative illustration above the label. Defaults to the kit's `NoDataContent` document mark. */
|
|
18
|
+
icon?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
/** Centered empty-state block for use inside a sidebar panel body. */
|
|
21
|
+
export declare const PanelEmptyState: FC<PanelEmptyStateProps>;
|
|
22
|
+
//# sourceMappingURL=PanelEmptyState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelEmptyState.d.ts","sourceRoot":"","sources":["../../../src/components/PanelEmptyState/PanelEmptyState.tsx"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKtD,yEAAyE;AACzE,MAAM,WAAW,qBAAqB;IACpC,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,mCAAmC;AACnC,MAAM,WAAW,oBAAoB;IACnC,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oGAAoG;IACpG,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,sEAAsE;AACtE,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAuBpD,CAAC"}
|
|
@@ -5,14 +5,17 @@ import { NoDataContent as r } from "@epam/ai-dial-ui-kit";
|
|
|
5
5
|
import { memo as i } from "react";
|
|
6
6
|
import { jsx as a } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/PanelEmptyState/PanelEmptyState.tsx
|
|
8
|
-
var o = i(({ label: i, colors: o, labelClassName: s = "dial-tiny-text", containerClassName: c, icon: l }) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
var o = i(({ label: i, colors: o, labelClassName: s = "dial-tiny-text", containerClassName: c, icon: l }) => {
|
|
9
|
+
let u = t({ "--pes-label-color": o?.label });
|
|
10
|
+
return /* @__PURE__ */ a("div", {
|
|
11
|
+
style: u,
|
|
12
|
+
children: /* @__PURE__ */ a(r, {
|
|
13
|
+
title: i,
|
|
14
|
+
icon: l,
|
|
15
|
+
titleClassName: e(n.label, s),
|
|
16
|
+
className: c
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
});
|
|
17
20
|
//#endregion
|
|
18
21
|
export { o as PanelEmptyState };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { EntityHeaderItem } from '../../models/entity';
|
|
3
|
+
/** CSS custom-property overrides for the `ResourceSummary` row. */
|
|
4
|
+
export interface ResourceSummaryColors {
|
|
5
|
+
/** Row border color. Defaults to `--stroke-tertiary`. */
|
|
6
|
+
border?: string;
|
|
7
|
+
/** Row background color. Defaults to `--bg-layer-sunken`. */
|
|
8
|
+
background?: string;
|
|
9
|
+
/** Version tag border color. Defaults to `--stroke-tertiary`. */
|
|
10
|
+
versionTagBorder?: string;
|
|
11
|
+
/** Version tag background color. Defaults to `--bg-control-accent-alpha`. */
|
|
12
|
+
versionTagBackground?: string;
|
|
13
|
+
/** Version tag text color. Defaults to `--text-accent`. */
|
|
14
|
+
versionTagText?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Typography overrides for the `ResourceSummary` row. */
|
|
17
|
+
export interface ResourceSummaryTypography {
|
|
18
|
+
/** Typography class applied to the version tag. Defaults to `'dial-tiny-text'`. */
|
|
19
|
+
versionTagClassName?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Style overrides for `ResourceSummary`. */
|
|
22
|
+
export interface ResourceSummaryStyles {
|
|
23
|
+
/** Color overrides applied as CSS custom properties. */
|
|
24
|
+
colors?: ResourceSummaryColors;
|
|
25
|
+
/** Typography class overrides. */
|
|
26
|
+
typography?: ResourceSummaryTypography;
|
|
27
|
+
}
|
|
28
|
+
/** Props for `ResourceSummary`. */
|
|
29
|
+
export interface ResourceSummaryProps {
|
|
30
|
+
/** Entity shown in the row as an icon, type label, name, and version tag. Ignored when `children` is set. */
|
|
31
|
+
item?: EntityHeaderItem;
|
|
32
|
+
/** Row content rendered instead of the entity header and version tag. */
|
|
33
|
+
children?: ReactNode;
|
|
34
|
+
/** Version tag text; `{version}` is replaced with `item.version`. The tag is omitted when `item.version` is empty. Defaults to `'Version {version} · current'`. */
|
|
35
|
+
versionLabel?: string;
|
|
36
|
+
/** Whether the version is shown as a trailing tag. When `false` it is shown inline after the name instead. Defaults to `true`. */
|
|
37
|
+
hasVersionTag?: boolean;
|
|
38
|
+
/** Size of the entity icon. Defaults to `40`. */
|
|
39
|
+
iconSize?: number;
|
|
40
|
+
/** CSS class applied to the row. */
|
|
41
|
+
className?: string;
|
|
42
|
+
/** Style overrides. */
|
|
43
|
+
styles?: ResourceSummaryStyles;
|
|
44
|
+
/** Color overrides applied as CSS custom properties. Prefer `styles.colors`. */
|
|
45
|
+
colors?: ResourceSummaryColors;
|
|
46
|
+
}
|
|
47
|
+
/** Bordered summary row pairing an entity's identity block with its current-version tag. */
|
|
48
|
+
export declare const ResourceSummary: FC<ResourceSummaryProps>;
|
|
49
|
+
//# sourceMappingURL=ResourceSummary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResourceSummary.d.ts","sourceRoot":"","sources":["../../../src/components/ResourceSummary/ResourceSummary.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAM5D,mEAAmE;AACnE,MAAM,WAAW,qBAAqB;IACpC,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6EAA6E;IAC7E,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,0DAA0D;AAC1D,MAAM,WAAW,yBAAyB;IACxC,mFAAmF;IACnF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,6CAA6C;AAC7C,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,kCAAkC;IAClC,UAAU,CAAC,EAAE,yBAAyB,CAAC;CACxC;AAED,mCAAmC;AACnC,MAAM,WAAW,oBAAoB;IACnC,6GAA6G;IAC7G,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,mKAAmK;IACnK,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kIAAkI;IAClI,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,gFAAgF;IAChF,MAAM,CAAC,EAAE,qBAAqB,CAAC;CAChC;AAED,4FAA4F;AAC5F,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CA2DpD,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region src/components/ResourceSummary/ResourceSummary.module.scss
|
|
2
|
+
var e = "_row_1csuq_1", t = "_versionTag_1csuq_7", n = {
|
|
3
|
+
row: e,
|
|
4
|
+
versionTag: t
|
|
4
5
|
};
|
|
5
6
|
//#endregion
|
|
6
|
-
export {
|
|
7
|
+
export { n as default, e as row, t as versionTag };
|