@smart-cloud/ai-kit-ui 1.5.37 → 1.5.39

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.
@@ -1,6 +1,14 @@
1
1
  import type { AnswerPresentation } from "@smart-cloud/ai-kit-core";
2
+ export interface AnswerCarouselLabels {
3
+ previous: string;
4
+ next: string;
5
+ position: string;
6
+ region: string;
7
+ }
8
+ export declare const AnswerCarouselLabelsContext: import("react").Context<AnswerCarouselLabels>;
2
9
  /** The same source-independent layouts render approved REST, MCP and CPT data. */
3
- export declare function AnswerPresentationView({ presentation, locale }: {
10
+ export declare function AnswerPresentationView({ presentation, locale, carouselLabels }: {
4
11
  presentation?: AnswerPresentation;
5
12
  locale?: string;
13
+ carouselLabels?: Partial<AnswerCarouselLabels>;
6
14
  }): import("react").JSX.Element | null;
@@ -0,0 +1,16 @@
1
+ import { type CatalogPage } from "@smart-cloud/ai-kit-core";
2
+ export interface CatalogPageLabels {
3
+ catalogPreviousLabel: string;
4
+ catalogNextLabel: string;
5
+ catalogResultsLabel: string;
6
+ catalogOfLabel: string;
7
+ catalogMoreAvailableLabel: string;
8
+ catalogExpiredLabel: string;
9
+ }
10
+ export declare function catalogPageNavigation(input: unknown, direction: "next" | "previous", busy: boolean, now?: number): string | undefined;
11
+ export declare function CatalogPageControls({ page: input, labels, busy, onNavigate }: {
12
+ page: CatalogPage;
13
+ labels: CatalogPageLabels;
14
+ busy?: boolean;
15
+ onNavigate: (handle: string, label: string) => void;
16
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,16 @@
1
+ import { type ComponentPropsWithoutRef } from "react";
2
+ import type { ExtraProps } from "react-markdown";
3
+ export interface ChatMarkdownImageLabels {
4
+ enlarge: string;
5
+ close: string;
6
+ preview: string;
7
+ unavailable: string;
8
+ }
9
+ /** Authored block labels can override these without changing runtime language. */
10
+ export declare const ChatMarkdownImageLabelsContext: import("react").Context<ChatMarkdownImageLabels>;
11
+ /** ReactMarkdown has already sanitized src; do not introduce another URL or srcSet. */
12
+ export declare function ChatMarkdownImage({ src, alt, title, labels: suppliedLabels }: ComponentPropsWithoutRef<"img"> & ExtraProps & {
13
+ labels?: Partial<ChatMarkdownImageLabels>;
14
+ }): import("react").JSX.Element;
15
+ /** A Markdown linked image must not produce an interactive button inside a link. */
16
+ export declare function ChatMarkdownLink({ children, node, ...props }: ComponentPropsWithoutRef<"a"> & ExtraProps): import("react").JSX.Element;
@@ -57,6 +57,9 @@ export type ChatStreamOptions = {
57
57
  locale: string;
58
58
  /** Selected only after a verified backend capability advertises this schema. */
59
59
  presentationVersion?: 1 | 2;
60
+ /** Selected only after verified ai.catalog.pagination capability discovery; handles contain no client-selected queries. */
61
+ catalogPageVersion?: 1;
62
+ catalogContinuation?: string;
60
63
  sessionId?: string;
61
64
  requestId: string;
62
65
  resume?: ChatStreamCheckpoint;
@@ -94,8 +97,11 @@ export declare function summarizeChatActivities(activities: ChatActivity[]): {
94
97
  otherTools: number;
95
98
  };
96
99
  export declare function chatPresentationVersionForCapabilities(capabilities?: Record<string, unknown>): 1 | 2;
100
+ export declare function chatCatalogPageVersionForCapabilities(capabilities?: Record<string, unknown>): 1 | undefined;
97
101
  /** The same negotiation applies to HTTP prompts and every stream resume frame. */
98
102
  export declare function discoverChatPresentationVersion(): Promise<1 | 2>;
103
+ /** Older or unverified backends must never receive the new catalog request fields. */
104
+ export declare function discoverChatCatalogPageVersion(): Promise<1 | undefined>;
99
105
  /** The backend advertises streaming only when its WebSocket route is ready. */
100
106
  export declare function discoverChatStreamUrl(): Promise<string | undefined>;
101
107
  export declare function sendChatStreamCancel(socket: WebSocket | null, checkpoint: ChatStreamCheckpoint | undefined): void;
@@ -1149,6 +1149,120 @@
1149
1149
  }
1150
1150
 
1151
1151
  /* Markdown formatting */
1152
+ .ai-answer-carousel-controls {
1153
+ display: flex;
1154
+ align-items: center;
1155
+ justify-content: space-between;
1156
+ flex-wrap: wrap;
1157
+ gap: .5rem;
1158
+ margin-bottom: .5rem;
1159
+ }
1160
+
1161
+ .ai-answer-carousel-controls button {
1162
+ min-width: 2.75rem;
1163
+ min-height: 2.75rem;
1164
+ padding: .5rem .75rem;
1165
+ border: 1px solid currentColor;
1166
+ border-radius: var(--ai-kit-radius-sm, .75rem);
1167
+ color: inherit;
1168
+ background: transparent;
1169
+ cursor: pointer;
1170
+ }
1171
+
1172
+ .ai-answer-carousel-controls button[aria-disabled="true"] {
1173
+ opacity: .45;
1174
+ cursor: default;
1175
+ }
1176
+
1177
+ .ai-answer-carousel-track {
1178
+ touch-action: pan-x pan-y;
1179
+ scrollbar-width: thin;
1180
+ }
1181
+
1182
+ @media (prefers-reduced-motion: reduce) {
1183
+ .ai-answer-carousel-track { scroll-behavior: auto; }
1184
+ }
1185
+
1186
+ /* Scope images at any Markdown nesting depth, including product images in lists. */
1187
+ .ai-chat-bubble .ai-chat-image-trigger {
1188
+ display: inline-block;
1189
+ max-width: 100%;
1190
+ min-width: 0;
1191
+ padding: 0;
1192
+ border: 0;
1193
+ border-radius: var(--ai-kit-radius, 4px);
1194
+ background: transparent;
1195
+ line-height: 0;
1196
+ vertical-align: middle;
1197
+ overflow: hidden;
1198
+ cursor: zoom-in;
1199
+ }
1200
+
1201
+ .ai-chat-bubble img.ai-chat-markdown-image {
1202
+ display: block;
1203
+ width: auto;
1204
+ height: auto;
1205
+ max-width: 100%;
1206
+ max-height: 16rem;
1207
+ object-fit: contain;
1208
+ }
1209
+
1210
+ .ai-chat-image-trigger:focus-visible,
1211
+ .ai-chat-image-dismiss:focus-visible {
1212
+ outline: 2px solid currentColor;
1213
+ outline-offset: 2px;
1214
+ }
1215
+
1216
+ .ai-chat-image-modal-inner {
1217
+ padding: 1rem;
1218
+ overflow: hidden;
1219
+ }
1220
+
1221
+ .ai-chat-image-modal {
1222
+ display: flex;
1223
+ flex-direction: column;
1224
+ width: max-content;
1225
+ max-width: calc(100vw - 2rem);
1226
+ max-height: calc(100dvh - 2rem);
1227
+ overflow: hidden;
1228
+ }
1229
+
1230
+ .ai-chat-image-modal-header {
1231
+ flex-shrink: 0;
1232
+ min-height: 3rem;
1233
+ }
1234
+
1235
+ .ai-chat-image-modal-title {
1236
+ overflow: hidden;
1237
+ text-overflow: ellipsis;
1238
+ white-space: nowrap;
1239
+ }
1240
+
1241
+ .ai-chat-image-modal-body {
1242
+ min-width: 0;
1243
+ min-height: 0;
1244
+ overflow: hidden;
1245
+ }
1246
+
1247
+ .ai-chat-image-dismiss {
1248
+ display: block;
1249
+ max-width: 100%;
1250
+ padding: 0;
1251
+ border: 0;
1252
+ background: transparent;
1253
+ cursor: zoom-out;
1254
+ overflow: hidden;
1255
+ }
1256
+
1257
+ .ai-chat-image-dismiss img {
1258
+ display: block;
1259
+ width: auto;
1260
+ height: auto;
1261
+ max-width: 100%;
1262
+ max-height: calc(100dvh - 8rem);
1263
+ object-fit: contain;
1264
+ }
1265
+
1152
1266
  .ai-feature-root p,
1153
1267
  .doc-search-root p,
1154
1268
  .ai-feature-root ul,