@epam/ai-dial-chat-shared 1.2.0-dev.15 → 1.2.0-dev.152
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/MDMessageViewer.js +23 -17
- package/components/MarkdownRenderer/MarkdownRenderer.js +88 -90
- package/components/MarkdownRenderer/Math/MarkdownMathBlock.js +19 -18
- package/components/MarkdownRenderer/PlainTextRenderer.js +21 -0
- package/components/MarkdownRenderer/Table/MarkdownTable.js +71 -56
- package/components/MarkdownRenderer/Table/MarkdownTable.module.scss.js +11 -11
- package/components/MarkdownRenderer/Table/TableHeader.js +18 -21
- package/components/MarkdownRenderer/Table/table-serialization.js +23 -3
- package/components/MarkdownRenderer/Table/useMarkdownTableActions/useMarkdownTableActions.js +48 -62
- package/components/MarkdownRenderer/ThinkingShimmer.js +14 -0
- package/components/TextRefinementField/TextRefinementField.js +84 -0
- 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 +169 -159
- package/file-manager/FileManagerAttachModal/FileManagerAttachModal.js +29 -30
- package/file-manager/OperationLoaderModal/OperationLoaderModal.js +17 -20
- package/file-manager/UploadProgressModal/UploadProgressModal.js +26 -35
- package/file-manager.d.ts +10 -6
- package/hooks/useTextRefinement.js +66 -0
- package/index.css +2 -2
- package/index.d.ts +262 -10
- package/index.js +60 -56
- package/markdown.d.ts +61 -8
- package/markdown.js +13 -11
- package/package.json +3 -3
- package/types/attachment.js +1 -1
- package/utils/file-download.js +6 -6
- package/utils/is-skill-selection-unsupported.js +4 -0
- package/utils/latex.js +5 -3
- package/utils/merge-class.js +5 -4
- package/utils/mime-type.js +10 -6
package/index.d.ts
CHANGED
|
@@ -70,6 +70,57 @@ export declare interface AnnotationTarget {
|
|
|
70
70
|
selector?: AnnotationSelector;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
/**
|
|
74
|
+
* A single application → grouped visualizer mapping from the
|
|
75
|
+
* `APPLICATION_VISUALIZERS` registry. Field semantics are fixed by
|
|
76
|
+
* already-deployed visualizer applications and operator configurations
|
|
77
|
+
* carried over from legacy Chat 0.x, which is why `contentType` is optional
|
|
78
|
+
* here while `CustomVisualizer.contentType` is required.
|
|
79
|
+
*/
|
|
80
|
+
export declare interface ApplicationVisualizer {
|
|
81
|
+
/**
|
|
82
|
+
* The postMessage protocol namespace, NOT a display label. Every message
|
|
83
|
+
* exchanged with the iframe is prefixed `${title}/…`, and the iframe-side
|
|
84
|
+
* visualizer application must be constructed with this identical string
|
|
85
|
+
* as its `appName`. A mismatch is a silent failure — the iframe loads but
|
|
86
|
+
* never receives data. Also used as the inline frame's header text.
|
|
87
|
+
*/
|
|
88
|
+
title: string;
|
|
89
|
+
/** Human-readable description of the visualizer. Accepted for operator-configuration parity; not consumed by host logic. */
|
|
90
|
+
description?: string;
|
|
91
|
+
/** Icon URL or identifier for the visualizer. Accepted for operator-configuration parity; not consumed by host logic. */
|
|
92
|
+
icon?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Comma-separated list of MIME types this entry claims (e.g.
|
|
95
|
+
* `'application/vnd.plotly.v1+json'` or
|
|
96
|
+
* `'application/vnd.plotly.v1+json, application/vnd.vega.v5+json'`).
|
|
97
|
+
* Stored verbatim; splitting happens at lookup time. When omitted, the
|
|
98
|
+
* entry claims every attachment that carries a URL.
|
|
99
|
+
*/
|
|
100
|
+
contentType?: string;
|
|
101
|
+
/** Absolute HTTP(S) URL of the visualizer iframe. */
|
|
102
|
+
url: string;
|
|
103
|
+
/** Milliseconds to wait for a `send()` request's `/RESPONSE` before rejecting. Defaults to `10000`. Does NOT bound the initial handshake. */
|
|
104
|
+
requestTimeout?: number;
|
|
105
|
+
/** Suggested initial width of the visualizer surface in pixels. Forwarded as-is in `CustomVisualizerDataLayout`. */
|
|
106
|
+
width?: number;
|
|
107
|
+
/** Suggested initial height of the visualizer surface in pixels. Forwarded as-is in `CustomVisualizerDataLayout`, and used by the host to size the inline frame. */
|
|
108
|
+
height?: number;
|
|
109
|
+
/** Suggested height on mobile viewports in pixels. Forwarded as-is in `CustomVisualizerDataLayout`, and used by the host to size the inline frame on mobile. */
|
|
110
|
+
mobileHeight?: number;
|
|
111
|
+
/** Whether the host should pass auth info to the visualizer. Accepted for operator-configuration parity; inert, because 1.0 auth is server-side and the browser holds no access token. */
|
|
112
|
+
passAuthInfo?: boolean;
|
|
113
|
+
/** Whether the host should pass an explicit access token. Accepted for operator-configuration parity; inert, because 1.0 auth is server-side and the browser holds no access token. */
|
|
114
|
+
passExplicitToken?: boolean;
|
|
115
|
+
/** When `true`, the host renders the inline frame without its border, rounded corners, background, and header divider. */
|
|
116
|
+
borderless?: boolean;
|
|
117
|
+
/** When `true`, the host hides the inline frame's header title text; the header actions stay visible. */
|
|
118
|
+
withoutTitle?: boolean;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** The `APPLICATION_VISUALIZERS` registry: application id → grouped visualizer entry. */
|
|
122
|
+
export declare type ApplicationVisualizerRegistry = Record<string, ApplicationVisualizer>;
|
|
123
|
+
|
|
73
124
|
/** Attachment selected locally by the user before it is sent to the backend. */
|
|
74
125
|
export declare interface Attachment extends DisplayAttachment {
|
|
75
126
|
/** The underlying browser `File` object selected by the user. */
|
|
@@ -93,7 +144,9 @@ export declare enum AttachmentErrorReason {
|
|
|
93
144
|
/** Upload failed because the device was offline. */
|
|
94
145
|
Network = "network",
|
|
95
146
|
/** File MIME type is not in the deployment's inputAttachmentTypes list. */
|
|
96
|
-
UnsupportedType = "unsupported-type"
|
|
147
|
+
UnsupportedType = "unsupported-type",
|
|
148
|
+
/** File size exceeds the configured maximum attachment size. */
|
|
149
|
+
FileTooLarge = "file-too-large"
|
|
97
150
|
}
|
|
98
151
|
|
|
99
152
|
/** A file attachment referenced by a citation — same shape as `MessageAttachment` but scoped to annotations. */
|
|
@@ -174,6 +227,19 @@ export declare enum CatalogEntityType {
|
|
|
174
227
|
Prompt = "PROMPT"
|
|
175
228
|
}
|
|
176
229
|
|
|
230
|
+
export declare const CHAT_SHARED_CLASS: {
|
|
231
|
+
/** The bordered container of a fenced code block. */
|
|
232
|
+
readonly codeBlock: "dial-chat-shared-code-block";
|
|
233
|
+
/** The code block's sticky header, holding the language label and actions. */
|
|
234
|
+
readonly codeBlockHeader: "dial-chat-shared-code-block-header";
|
|
235
|
+
/** The bordered container of a Markdown table. */
|
|
236
|
+
readonly table: "dial-chat-shared-table";
|
|
237
|
+
/** The scrolling box around a Markdown table, which owns its overflow. */
|
|
238
|
+
readonly tableScroll: "dial-chat-shared-table-scroll";
|
|
239
|
+
/** The scrolling box around a display-math block. */
|
|
240
|
+
readonly mathBlock: "dial-chat-shared-math-block";
|
|
241
|
+
};
|
|
242
|
+
|
|
177
243
|
/** Color theme for syntax highlighting. */
|
|
178
244
|
export declare enum CodeBlockTheme {
|
|
179
245
|
/** Dark syntax-highlighting theme. */
|
|
@@ -222,6 +288,8 @@ export declare interface Conversation {
|
|
|
222
288
|
assistantModelId: string;
|
|
223
289
|
/** Response format used when rendering messages. */
|
|
224
290
|
responseFormat?: ResponseFormat;
|
|
291
|
+
/** Open, feature-keyed container for conversation-level view state. This change owns only the `annotations` key; any other key is opaque and preserved as-is. */
|
|
292
|
+
customViewState?: Record<string, unknown>;
|
|
225
293
|
}
|
|
226
294
|
|
|
227
295
|
/** Metadata returned by the DIAL file/conversation listing API for a single resource node. */
|
|
@@ -276,6 +344,8 @@ export declare interface ConversationTransferJob {
|
|
|
276
344
|
* {@link ConversationTransferJobStatus.Warning}.
|
|
277
345
|
*/
|
|
278
346
|
warningCode?: ConversationTransferWarningCode;
|
|
347
|
+
/** Untranslated names of skipped attachments, when available for this warning. */
|
|
348
|
+
warningNames?: string[];
|
|
279
349
|
}
|
|
280
350
|
|
|
281
351
|
/** Lifecycle status of a queued export/import job. */
|
|
@@ -1176,6 +1246,9 @@ export declare const generateUUID: () => string;
|
|
|
1176
1246
|
/** Classifies a MIME type into an `AttachmentType` by prefix (`image/*` / `audio/*`), defaulting to `File`. */
|
|
1177
1247
|
export declare const getAttachmentTypeFromMime: (mimeType: string | undefined) => AttachmentType;
|
|
1178
1248
|
|
|
1249
|
+
/** Lowercases a MIME type and strips its parameters, e.g. `'Application/JSON; charset=utf-8'` -> `'application/json'`. */
|
|
1250
|
+
export declare const getBaseMimeType: (mimeType: string) => string;
|
|
1251
|
+
|
|
1179
1252
|
/** Returns the file extension (without a leading dot) for a fenced-code-block language identifier, defaulting to `txt`. */
|
|
1180
1253
|
export declare const getFileExtensionForLanguage: (language: string) => string;
|
|
1181
1254
|
|
|
@@ -1192,6 +1265,24 @@ export declare const getParentFolderPath: (path: string) => string;
|
|
|
1192
1265
|
/** Returns the UTF-8 byte length of `str`. */
|
|
1193
1266
|
export declare const getUtf8ByteLength: (str: string) => number;
|
|
1194
1267
|
|
|
1268
|
+
/** A single attachment handed to a grouped visualizer inside `SEND_GROUPED_VISUALIZE_DATA`. */
|
|
1269
|
+
export declare interface GroupedAttachmentItem {
|
|
1270
|
+
/** Absolute URL of the attachment, resolved by the host before sending. */
|
|
1271
|
+
url: string;
|
|
1272
|
+
/** The attachment's own MIME type. */
|
|
1273
|
+
mimeType: string;
|
|
1274
|
+
/** Presentation layout plus the opaque per-attachment payload. */
|
|
1275
|
+
visualizerData: CustomVisualizerData;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
/** Payload of a `SEND_GROUPED_VISUALIZE_DATA` request: every claimed attachment plus the shared presentation layout. */
|
|
1279
|
+
export declare interface GroupedAttachmentsData {
|
|
1280
|
+
/** One item per claimed attachment, in the message's attachment order. */
|
|
1281
|
+
attachments: GroupedAttachmentItem[];
|
|
1282
|
+
/** Presentation layout hints shared by every item. */
|
|
1283
|
+
layout: CustomVisualizerDataLayout;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1195
1286
|
/** Minimal hast shapes this plugin reads and writes. */
|
|
1196
1287
|
declare interface HastNode {
|
|
1197
1288
|
type: string;
|
|
@@ -1245,6 +1336,9 @@ export declare const isAudioTranscriptionSupported: (types?: string[]) => boolea
|
|
|
1245
1336
|
/** Returns true when any path segment starts with a dot (hidden file or folder). */
|
|
1246
1337
|
export declare const isHiddenPath: (path: string) => boolean;
|
|
1247
1338
|
|
|
1339
|
+
/** Whether a selected skill lacks explicitly confirmed support. */
|
|
1340
|
+
export declare const isSkillSelectionUnsupported: (skillUrl: string | null | undefined, isSkillsSupported: boolean | undefined) => boolean;
|
|
1341
|
+
|
|
1248
1342
|
/** Returns `true` when `msg` is a `StatusMessage`. */
|
|
1249
1343
|
export declare const isStatusMessage: (msg: Message | StatusMessage) => msg is StatusMessage;
|
|
1250
1344
|
|
|
@@ -1285,7 +1379,7 @@ export declare interface ItemHeaderProps {
|
|
|
1285
1379
|
shouldTruncateTitle?: boolean;
|
|
1286
1380
|
}
|
|
1287
1381
|
|
|
1288
|
-
export declare const MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME = "[&_.w-md-editor]:max-h-[var(--resizable-field-max-height,70vh)]";
|
|
1382
|
+
export declare const MARKDOWN_EDITOR_MAX_HEIGHT_CLASS_NAME = "[&_.w-md-editor:not(.w-md-editor-fullscreen)]:max-h-[var(--resizable-field-max-height,70vh)]";
|
|
1289
1383
|
|
|
1290
1384
|
export declare const MARKDOWN_EDITOR_PREVIEW_LIST_CLASS_NAME = "[&_.wmde-markdown>ol]:list-decimal [&_.wmde-markdown_ul]:list-disc [&_.wmde-markdown_ul_ul]:list-[circle] [&_.wmde-markdown_ul_ul_ul]:list-[square]";
|
|
1291
1385
|
|
|
@@ -1487,9 +1581,7 @@ export declare interface MarkdownRendererProps {
|
|
|
1487
1581
|
export declare const MarkdownTable: FC<MarkdownTableProps>;
|
|
1488
1582
|
|
|
1489
1583
|
export declare interface MarkdownTableActionLabels {
|
|
1490
|
-
|
|
1491
|
-
copyTxtLabel?: string;
|
|
1492
|
-
copyMarkdownLabel?: string;
|
|
1584
|
+
copyLabel?: string;
|
|
1493
1585
|
copiedLabel?: string;
|
|
1494
1586
|
downloadCsvLabel?: string;
|
|
1495
1587
|
openInCanvasLabel?: string;
|
|
@@ -1515,19 +1607,16 @@ export declare interface MarkdownTableColors {
|
|
|
1515
1607
|
fade?: string;
|
|
1516
1608
|
/** Divider color between rows. Defaults to `--stroke-tertiary`. */
|
|
1517
1609
|
rowDivider?: string;
|
|
1518
|
-
/** Background of even-indexed body rows. Defaults to `--bg-layer-base`. */
|
|
1519
|
-
rowZebraBackground?: string;
|
|
1520
1610
|
/** Background of a body row on hover. Defaults to `--bg-control-accent-alpha-hover`. */
|
|
1521
1611
|
rowHoverBackground?: string;
|
|
1522
1612
|
}
|
|
1523
1613
|
|
|
1524
1614
|
export declare enum MarkdownTableCopyFormat {
|
|
1525
1615
|
Csv = "csv",
|
|
1526
|
-
Txt = "txt",
|
|
1527
1616
|
Markdown = "markdown"
|
|
1528
1617
|
}
|
|
1529
1618
|
|
|
1530
|
-
/** A table
|
|
1619
|
+
/** A table action rendered as an icon button. */
|
|
1531
1620
|
export declare interface MarkdownTableHeaderAction {
|
|
1532
1621
|
/** Stable accessible name and tooltip text. */
|
|
1533
1622
|
label: string;
|
|
@@ -1578,13 +1667,20 @@ export declare interface MarkdownWithPlaceholdersProps {
|
|
|
1578
1667
|
headingClassName?: string;
|
|
1579
1668
|
}
|
|
1580
1669
|
|
|
1581
|
-
/** Renders assistant message content as formatted markdown. */
|
|
1670
|
+
/** Renders assistant message content as formatted markdown, or as escaped plain text when `isPlainText` is set. */
|
|
1582
1671
|
export declare const MDMessageViewer: FC<MDMessageViewerProps>;
|
|
1583
1672
|
|
|
1584
1673
|
/** Props for the {@link MDMessageViewer} markdown renderer. */
|
|
1585
1674
|
declare interface MDMessageViewerProps {
|
|
1586
1675
|
/** Raw markdown string to render. */
|
|
1587
1676
|
content: string;
|
|
1677
|
+
/**
|
|
1678
|
+
* Renders `content` verbatim as escaped plain text instead of running the
|
|
1679
|
+
* Markdown pipeline — the conversation's `plain_text` response format.
|
|
1680
|
+
* Markdown-only props (`components`, `urlTransform`, the code-block and
|
|
1681
|
+
* table labels) do not apply while it is set. Defaults to `false`.
|
|
1682
|
+
*/
|
|
1683
|
+
isPlainText?: boolean;
|
|
1588
1684
|
/** Enables gradual reveal for appended streaming content. */
|
|
1589
1685
|
isStreaming?: boolean;
|
|
1590
1686
|
/**
|
|
@@ -1753,6 +1849,21 @@ export declare interface MessageState {
|
|
|
1753
1849
|
tool_execution_history?: ToolExecutionHistoryMessage[];
|
|
1754
1850
|
}
|
|
1755
1851
|
|
|
1852
|
+
/**
|
|
1853
|
+
* Maps non-canonical MIME type spellings to the canonical type they denote.
|
|
1854
|
+
*
|
|
1855
|
+
* Deployments declare their `inputAttachmentTypes` by hand, while DIAL Core
|
|
1856
|
+
* stores the content type a browser or an upload client reported, so the two
|
|
1857
|
+
* sides routinely disagree on which of several equivalent spellings to use for
|
|
1858
|
+
* the same format (`text/json` vs `application/json`). Resolving both through
|
|
1859
|
+
* this map before comparing them keeps a declared type matching the files it
|
|
1860
|
+
* is meant to describe.
|
|
1861
|
+
*
|
|
1862
|
+
* Only aliases for one and the same format belong here — never a pair of
|
|
1863
|
+
* distinct formats that happen to share an extension.
|
|
1864
|
+
*/
|
|
1865
|
+
export declare const MIME_TYPE_ALIASES: Record<string, string>;
|
|
1866
|
+
|
|
1756
1867
|
/** MIME type prefix shared by all audio content types. */
|
|
1757
1868
|
export declare const MIME_TYPE_AUDIO_PREFIX = "audio/";
|
|
1758
1869
|
|
|
@@ -1822,6 +1933,14 @@ export declare const MOBILE_MAX_WIDTH_PX: number;
|
|
|
1822
1933
|
/** `matchMedia` query matching the mobile/tablet band (up to 1279px). */
|
|
1823
1934
|
export declare const MOBILE_MEDIA_QUERY = "(max-width: 1279px)";
|
|
1824
1935
|
|
|
1936
|
+
/**
|
|
1937
|
+
* Returns the canonical spelling of a MIME type: parameters stripped, lowercased,
|
|
1938
|
+
* and known aliases resolved through `MIME_TYPE_ALIASES` (`'text/json'` ->
|
|
1939
|
+
* `'application/json'`). Wildcards and unrecognized types are returned unchanged
|
|
1940
|
+
* apart from that normalization.
|
|
1941
|
+
*/
|
|
1942
|
+
export declare const normalizeMimeType: (mimeType: string) => string;
|
|
1943
|
+
|
|
1825
1944
|
/**
|
|
1826
1945
|
* Repairs persisted `html_tag` annotations created by older normalizers that
|
|
1827
1946
|
* defaulted every non-HTML source to PDF. An explicit, recognized file
|
|
@@ -1917,6 +2036,44 @@ export declare interface PdfBBoxSelector {
|
|
|
1917
2036
|
/** Returns a deterministic colour-pair for the given display name. */
|
|
1918
2037
|
export declare const pickAvatarColor: (name: string) => AvatarColorEntry;
|
|
1919
2038
|
|
|
2039
|
+
/**
|
|
2040
|
+
* Renders message text as plain text: no Markdown pipeline, no raw HTML, no
|
|
2041
|
+
* syntax highlighting. The text is a React text child, so it is escaped by
|
|
2042
|
+
* construction — a table, a heading, or `**bold**` reaches the reader exactly
|
|
2043
|
+
* as the model emitted it, which is what a conversation's `plain_text`
|
|
2044
|
+
* response format promises.
|
|
2045
|
+
*
|
|
2046
|
+
* Lives beside {@link MarkdownRenderer} because it is the other half of the
|
|
2047
|
+
* same choice: both render an assistant message body, and both are selected
|
|
2048
|
+
* by `MDMessageViewer` from the conversation's response format.
|
|
2049
|
+
*/
|
|
2050
|
+
export declare const PlainTextRenderer: FC<PlainTextRendererProps>;
|
|
2051
|
+
|
|
2052
|
+
/** Props for {@link PlainTextRenderer}. */
|
|
2053
|
+
export declare interface PlainTextRendererProps {
|
|
2054
|
+
/** Message text. Rendered verbatim — never parsed as Markdown or HTML. */
|
|
2055
|
+
content: string;
|
|
2056
|
+
/** Classes applied to the renderer root. */
|
|
2057
|
+
containerClassName?: string;
|
|
2058
|
+
/** When true, appended content is revealed gradually for smoother streaming updates. */
|
|
2059
|
+
isStreaming?: boolean;
|
|
2060
|
+
/** Reveal speed used while `isStreaming` is true. Defaults to 120 characters per second. */
|
|
2061
|
+
streamCharactersPerSecond?: number;
|
|
2062
|
+
/**
|
|
2063
|
+
* Typography classes. Only `p` is read — the single paragraph the renderer
|
|
2064
|
+
* emits — so the same object a Markdown message is styled with keeps both
|
|
2065
|
+
* formats on one type scale.
|
|
2066
|
+
*/
|
|
2067
|
+
classNames?: Pick<MarkdownRendererClassNames, 'p'>;
|
|
2068
|
+
/**
|
|
2069
|
+
* Label shown with a shimmer animation while `isStreaming` is true and no
|
|
2070
|
+
* content has arrived yet. Defaults to `'Thinking'`.
|
|
2071
|
+
*/
|
|
2072
|
+
thinkingLabel?: string;
|
|
2073
|
+
/** Color overrides applied as CSS custom properties. */
|
|
2074
|
+
colors?: Pick<MarkdownRendererColors, 'thinkingPrimary' | 'thinkingSecondary'>;
|
|
2075
|
+
}
|
|
2076
|
+
|
|
1920
2077
|
/**
|
|
1921
2078
|
* Selector that targets a character range inside a single shape on one PPTX
|
|
1922
2079
|
* slide. Confirmed against captured DIAL Core responses: unlike
|
|
@@ -2265,6 +2422,84 @@ export declare interface TextCharacterRangeSelector {
|
|
|
2265
2422
|
end: number;
|
|
2266
2423
|
}
|
|
2267
2424
|
|
|
2425
|
+
/** Asynchronous rewriting callback supplied by the consuming host. */
|
|
2426
|
+
export declare type TextRefinementCallback = (value: string, signal: AbortSignal) => Promise<string>;
|
|
2427
|
+
|
|
2428
|
+
/** Label row with Refine/Undo actions and live feedback around one refinable field. */
|
|
2429
|
+
export declare const TextRefinementField: FC<TextRefinementFieldProps>;
|
|
2430
|
+
|
|
2431
|
+
/** Props for `TextRefinementField`. */
|
|
2432
|
+
export declare interface TextRefinementFieldProps {
|
|
2433
|
+
/** When false, renders `children` alone — no label row, actions, or feedback. */
|
|
2434
|
+
isEnabled: boolean;
|
|
2435
|
+
/** Id of the labelled control; also the prefix for the label and error ids. */
|
|
2436
|
+
fieldId: string;
|
|
2437
|
+
/** Visible field label; names the group. */
|
|
2438
|
+
label: string;
|
|
2439
|
+
/** Class applied to the `<label>`, after the kit `Label` defaults. */
|
|
2440
|
+
labelClassName?: string;
|
|
2441
|
+
/** Marks the label as required. */
|
|
2442
|
+
required?: boolean;
|
|
2443
|
+
/** Action, status, and error copy. */
|
|
2444
|
+
labels?: TextRefinementLabels;
|
|
2445
|
+
/** The field's `useTextRefinement` result. */
|
|
2446
|
+
refinement: TextRefinementResult;
|
|
2447
|
+
/** Disables both actions. */
|
|
2448
|
+
disabled: boolean;
|
|
2449
|
+
/** Class applied to the status message and the error message. */
|
|
2450
|
+
feedbackClassName?: string;
|
|
2451
|
+
/** Class applied to the error message, after `feedbackClassName`. */
|
|
2452
|
+
errorClassName?: string;
|
|
2453
|
+
/** The refinable control, whose id must equal `fieldId`. */
|
|
2454
|
+
children: ReactNode;
|
|
2455
|
+
}
|
|
2456
|
+
|
|
2457
|
+
/** Translatable copy for `TextRefinementField`; every key has an English default. */
|
|
2458
|
+
export declare interface TextRefinementLabels {
|
|
2459
|
+
/** Refinement copy. Defaults to 'Refine with AI'. */
|
|
2460
|
+
refineWithAiLabel?: string;
|
|
2461
|
+
/** Refinement copy. Defaults to 'Undo'. */
|
|
2462
|
+
refineUndoLabel?: string;
|
|
2463
|
+
/** Refinement copy. Defaults to 'Could not refine this text. Please try again.'. */
|
|
2464
|
+
refineErrorLabel?: string;
|
|
2465
|
+
/** Refinement copy. Defaults to 'Refining text'. */
|
|
2466
|
+
refinePendingAriaLabel?: string;
|
|
2467
|
+
/** Refinement copy. Defaults to 'Text refined. Undo is available.'. */
|
|
2468
|
+
refineSuccessAriaLabel?: string;
|
|
2469
|
+
/** Refinement copy. Defaults to 'Original text restored.'. */
|
|
2470
|
+
refineUndoAriaLabel?: string;
|
|
2471
|
+
/** Refinement copy. Defaults to 'No changes were needed.'. */
|
|
2472
|
+
refineUnchangedAriaLabel?: string;
|
|
2473
|
+
}
|
|
2474
|
+
|
|
2475
|
+
/** Controls and feedback for a single field. */
|
|
2476
|
+
export declare interface TextRefinementResult {
|
|
2477
|
+
/** Current field-local feedback state. */
|
|
2478
|
+
state: TextRefinementState;
|
|
2479
|
+
/** Whether this field has a request in progress. */
|
|
2480
|
+
isPending: boolean;
|
|
2481
|
+
/** Whether the current value can be refined. */
|
|
2482
|
+
canRefine: boolean;
|
|
2483
|
+
/** Whether an original baseline can be restored. */
|
|
2484
|
+
canUndo: boolean;
|
|
2485
|
+
/** Refines the latest committed value; duplicate activation is ignored. */
|
|
2486
|
+
refine: () => Promise<void>;
|
|
2487
|
+
/** Restores the baseline from before the first successful refinement. */
|
|
2488
|
+
undo: () => void;
|
|
2489
|
+
/** Cancels work and clears feedback and Undo without modifying the value. */
|
|
2490
|
+
reset: () => void;
|
|
2491
|
+
}
|
|
2492
|
+
|
|
2493
|
+
/** Field-local refinement feedback state. */
|
|
2494
|
+
export declare enum TextRefinementState {
|
|
2495
|
+
Idle = "idle",
|
|
2496
|
+
Pending = "pending",
|
|
2497
|
+
Success = "success",
|
|
2498
|
+
Error = "error",
|
|
2499
|
+
Restored = "restored",
|
|
2500
|
+
Unchanged = "unchanged"
|
|
2501
|
+
}
|
|
2502
|
+
|
|
2268
2503
|
/** A single selectable UI theme. */
|
|
2269
2504
|
export declare interface Theme {
|
|
2270
2505
|
/** Unique theme identifier (e.g. `'dark'`, `'light'`). */
|
|
@@ -2502,4 +2737,21 @@ export declare interface UserProfile {
|
|
|
2502
2737
|
isAdmin: boolean;
|
|
2503
2738
|
}
|
|
2504
2739
|
|
|
2740
|
+
/** Preserves an author's draft and Undo baseline across asynchronous controlled updates. */
|
|
2741
|
+
export declare const useTextRefinement: (options: UseTextRefinementOptions) => TextRefinementResult;
|
|
2742
|
+
|
|
2743
|
+
/** Controlled value and lifecycle inputs for one refinable field. */
|
|
2744
|
+
export declare interface UseTextRefinementOptions {
|
|
2745
|
+
/** Current controlled field value. */
|
|
2746
|
+
value: string;
|
|
2747
|
+
/** Host rewriting callback. Omission disables refinement and clears its state. */
|
|
2748
|
+
onRefine?: TextRefinementCallback;
|
|
2749
|
+
/** Publishes a successful result or the original Undo baseline. */
|
|
2750
|
+
onChange: (value: string) => void;
|
|
2751
|
+
/** Disables refinement and cancels active work when true. Defaults to false. */
|
|
2752
|
+
disabled?: boolean;
|
|
2753
|
+
/** Draft identity; changing it resets state even when text is equal. */
|
|
2754
|
+
resetKey?: unknown;
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2505
2757
|
export { }
|
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 {
|
|
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 { TextRefinementState as ze, useTextRefinement as Be } from "./hooks/useTextRefinement.js";
|
|
46
|
+
import { TextRefinementField as Ve } from "./components/TextRefinementField/TextRefinementField.js";
|
|
47
|
+
import { CHAT_SHARED_CLASS as He } from "./constants/public-class-names.js";
|
|
48
|
+
import { useCodeCopy as Ue } from "./hooks/useCodeCopy.js";
|
|
49
|
+
import { restrainedSyntaxTheme as We } from "./components/MarkdownRenderer/CodeBlock/syntax-theme.js";
|
|
50
|
+
import { MarkdownCodeBlock as Ge } from "./components/MarkdownRenderer/CodeBlock/CodeBlock.js";
|
|
51
|
+
import { DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME as Ke, MARKDOWN_TABLE_CSV_MIME_TYPE as qe, MarkdownTableCopyFormat as Je, serializeMarkdownTableRows as Ye } from "./components/MarkdownRenderer/Table/table-serialization.js";
|
|
52
|
+
import { MarkdownTable as Xe } from "./components/MarkdownRenderer/Table/MarkdownTable.js";
|
|
53
|
+
import { MarkdownRenderer as Ze, defaultMarkdownComponents as Qe } from "./components/MarkdownRenderer/MarkdownRenderer.js";
|
|
54
|
+
import { COMPACT_MARKDOWN_CLASS_NAMES as $e, DEFAULT_MARKDOWN_CLASS_NAMES as et } from "./components/MarkdownRenderer/markdown-class-names.js";
|
|
55
|
+
import { PlainTextRenderer as tt } from "./components/MarkdownRenderer/PlainTextRenderer.js";
|
|
56
|
+
import { MDMessageViewer as nt } from "./components/MarkdownRenderer/MDMessageViewer.js";
|
|
57
|
+
import { MarkdownWithPlaceholders as rt } from "./components/MarkdownWithPlaceholders/MarkdownWithPlaceholders.js";
|
|
58
|
+
import { useCollapsedText as it } from "./hooks/useCollapsedText.js";
|
|
59
|
+
import { useAvailableHeightCap as at } from "./hooks/useAvailableHeightCap.js";
|
|
60
|
+
import { useIsMobile as ot } from "./hooks/useIsMobile.js";
|
|
61
|
+
import { DialFileManagerActionProfile as st, DialFileManagerVariant as ct } from "./file-manager/file-manager-variant.js";
|
|
62
|
+
import { getParentFolderPath as lt, isHiddenPath as ut } from "./file-manager/path.js";
|
|
63
|
+
import { FileUploadStatus as dt } from "./file-manager/upload-batch.js";
|
|
64
|
+
import { useGridEditingScroll as ft } from "./file-manager/useGridEditingScroll/useGridEditingScroll.js";
|
|
65
|
+
import { OperationLoaderModal as pt } from "./file-manager/OperationLoaderModal/OperationLoaderModal.js";
|
|
66
|
+
import { UploadProgressModal as mt } from "./file-manager/UploadProgressModal/UploadProgressModal.js";
|
|
67
|
+
import { isSkillSelectionUnsupported as ht } from "./utils/is-skill-selection-unsupported.js";
|
|
68
|
+
export { f as AttachmentErrorReason, p as AttachmentType, fe as BASE_LG_ICON_PROPS, pe as BASE_MD_ICON_PROPS, He as CHAT_SHARED_CLASS, $e 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, et as DEFAULT_MARKDOWN_CLASS_NAMES, Ke as DEFAULT_MARKDOWN_TABLE_DOWNLOAD_FILENAME, Se as DESKTOP_BREAKPOINT_PX, Ce as DESKTOP_MEDIA_QUERY, ke as DeploymentIcon, st as DialFileManagerActionProfile, ct 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, dt 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, qe as MARKDOWN_TABLE_CSV_MIME_TYPE, nt 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, Ge as MarkdownCodeBlock, Ze as MarkdownRenderer, Xe as MarkdownTable, Je as MarkdownTableCopyFormat, rt as MarkdownWithPlaceholders, o as MessageRating, s as MessageRole, pt 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, tt as PlainTextRenderer, _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, Ve as TextRefinementField, ze as TextRefinementState, mt as UploadProgressModal, Y as base64ToBlob, I as buildCssVars, se as buildPromptParamDefaults, V as copyMarkdownAsRichText, H as copyToClipboard, Qe 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, lt as getParentFolderPath, j as getUtf8ByteLength, w as inferMimeTypeFromPath, D as isAnnotationSelector, B as isAudioTranscriptionSupported, ut as isHiddenPath, ht as isSkillSelectionUnsupported, 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, We as restrainedSyntaxTheme, M as sanitizeConversationName, Ye as serializeMarkdownTableRows, N as stripTrailingDots, E as stripUrlQueryAndFragment, $ as triggerAnchorDownload, ee as triggerBlobDownload, P as truncateToUtf8Bytes, te as tryBase64ToBytes, at as useAvailableHeightCap, Ue as useCodeCopy, it as useCollapsedText, ft as useGridEditingScroll, ot as useIsMobile, Be as useTextRefinement };
|