@antglobal/copilot-cards-web 0.0.0 → 1.0.0
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/README.md +1 -3
- package/dist/index.cjs.js +7211 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +1353 -0
- package/dist/index.esm.js +7081 -0
- package/dist/index.esm.js.map +1 -0
- package/package.json +39 -7
- package/LEGAL.md +0 -7
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1353 @@
|
|
|
1
|
+
import { ActionRunnerContext, CardSchemaInput, StreamingCommand, CardSchema, StreamingParserOptions, SimpleActionHandler, ActionConfigProvider, ActionChainConfig, RenderTreeNode } from '@antglobal/copilot-cards-core';
|
|
2
|
+
export { A2UIComponent, A2UIEnvelope, ActionChainConfig, ActionConfigProvider, ActionRegistry, ActionRunnerContext, ActionStep, CardSchema, CardSchemaInput, ElementLifecycle, ElementNode, ExpressionContext, ExpressionValue, LegacyCardContentItem, LegacyCardSchema, LegacyTracking, LegacyTrackingType, LifecycleManager, RenderTreeNode, SimpleActionHandler, SlotContent, SlotLayout, a2uiComponentToElement, a2uiToCommand, convertLegacySchema, createLifecycleManager, hasExpression, isA2UIEnvelope, isLegacySchema, normalizeSchema, parseSchema, registerActionHandler, registry, resolveActionRef, resolveDeep, resolveExpression, resolveExpressionValue, runActionStep, runActionSteps, validateSchema } from '@antglobal/copilot-cards-core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Core Adapter — bridges @antglobal/copilot-cards-core logic for the web-component layer.
|
|
6
|
+
*
|
|
7
|
+
* Provides a single import surface for all core functionality
|
|
8
|
+
* and adds a web-specific ActionRunnerContext factory.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
interface WebActionContextOptions {
|
|
12
|
+
/** Override the global fetch */
|
|
13
|
+
fetch?: typeof globalThis.fetch;
|
|
14
|
+
/** Custom toast handler */
|
|
15
|
+
showToast?: (message: string, level?: string, duration?: number) => void;
|
|
16
|
+
/** Custom navigation handler */
|
|
17
|
+
navigate?: (url: string, target?: string) => void;
|
|
18
|
+
/** Variable setter for setVariable actions */
|
|
19
|
+
setVariable?: (key: string, value: any) => void;
|
|
20
|
+
/** Event emitter for emit actions */
|
|
21
|
+
emit?: (eventName: string, payload?: any) => void;
|
|
22
|
+
/** Copy text to clipboard */
|
|
23
|
+
copyText?: (text: string) => void;
|
|
24
|
+
/** Abort signal for cancelling in-flight requests on dispose */
|
|
25
|
+
abortSignal?: AbortSignal;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create an ActionRunnerContext with sensible web defaults.
|
|
29
|
+
*/
|
|
30
|
+
declare function createWebActionContext(options?: WebActionContextOptions): ActionRunnerContext;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* renderCard — the primary public API for @antglobal/copilot-cards-web.
|
|
34
|
+
*
|
|
35
|
+
* Users pass in a container element and a CardSchema JSON:
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* import { renderCard } from '@card-sdk/web-component';
|
|
39
|
+
*
|
|
40
|
+
* const container = document.getElementById('card-container');
|
|
41
|
+
* const schema = { rootID: "root", elements: { ... }, variables: {} };
|
|
42
|
+
* renderCard(container, schema);
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
interface RenderCardOptions extends WebActionContextOptions {
|
|
47
|
+
/** Force mobile mode; auto-detected from viewport if omitted */
|
|
48
|
+
isMobile?: boolean;
|
|
49
|
+
/** External variables to merge into schema.variables (overrides schema defaults) */
|
|
50
|
+
variables?: Record<string, any>;
|
|
51
|
+
/** Bot ID — used to look up bot-scoped action handlers */
|
|
52
|
+
botId?: string;
|
|
53
|
+
}
|
|
54
|
+
interface CardInstance {
|
|
55
|
+
/** Dispose the card: unmount all lifecycles, remove DOM, detach listeners. */
|
|
56
|
+
dispose: () => void;
|
|
57
|
+
/** Update variables and re-render. */
|
|
58
|
+
updateVariables: (variables: Record<string, any>) => void;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Render a card schema into a container element.
|
|
62
|
+
*
|
|
63
|
+
* @returns A `CardInstance` with `dispose()` and `updateVariables()` methods.
|
|
64
|
+
*/
|
|
65
|
+
declare function renderCard(container: HTMLElement, schemaInput: CardSchemaInput, options?: RenderCardOptions): CardInstance;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Streaming Card Renderer — enables progressive card rendering via streaming commands.
|
|
69
|
+
*
|
|
70
|
+
* Unlike `renderCard()` which requires a complete schema upfront,
|
|
71
|
+
* `renderStreamingCard()` creates a card instance that can be incrementally
|
|
72
|
+
* built and updated through streaming commands from an Agent/LLM.
|
|
73
|
+
*
|
|
74
|
+
* Architecture:
|
|
75
|
+
* - StreamingParser: converts raw text chunks into typed commands
|
|
76
|
+
* - StreamingEngine: maintains state and emits change events
|
|
77
|
+
* - This module: handles DOM operations based on engine events
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
interface StreamingCardOptions extends RenderCardOptions {
|
|
81
|
+
/** Parser options (delimiter, error handler) */
|
|
82
|
+
parserOptions?: StreamingParserOptions;
|
|
83
|
+
/**
|
|
84
|
+
* Called when a card component runs an `action` step (A2UI-style user
|
|
85
|
+
* action). The payload matches the A2UI v0.9 client→server `action`
|
|
86
|
+
* message body — forward it to your agent/server as-is.
|
|
87
|
+
*/
|
|
88
|
+
onAction?: (action: A2UIActionPayload) => void;
|
|
89
|
+
/** Entrance transition for incrementally streamed-in blocks (default true). */
|
|
90
|
+
appearTransition?: boolean;
|
|
91
|
+
}
|
|
92
|
+
/** A2UI v0.9 client→server user-action payload (https://a2ui.org). */
|
|
93
|
+
interface A2UIActionPayload {
|
|
94
|
+
name: string;
|
|
95
|
+
surfaceId: string | null;
|
|
96
|
+
sourceComponentId: string;
|
|
97
|
+
timestamp: string;
|
|
98
|
+
context: Record<string, any>;
|
|
99
|
+
}
|
|
100
|
+
/** Result of finalizePartialSchema(). */
|
|
101
|
+
interface PartialFinalizeResult {
|
|
102
|
+
/** Whether the schema JSON document ultimately closed and parsed. */
|
|
103
|
+
complete: boolean;
|
|
104
|
+
/** validateSchema errors (or a stream-incomplete note). Empty = success. */
|
|
105
|
+
errors: string[];
|
|
106
|
+
}
|
|
107
|
+
interface StreamingCardInstance extends CardInstance {
|
|
108
|
+
/** Apply a single streaming command directly */
|
|
109
|
+
applyCommand(command: StreamingCommand): void;
|
|
110
|
+
/** Apply multiple commands in batch */
|
|
111
|
+
applyCommands(commands: StreamingCommand[]): void;
|
|
112
|
+
/** Feed raw text chunk (auto-parsed via StreamingParser) */
|
|
113
|
+
feed(chunk: string): void;
|
|
114
|
+
/** Flush remaining buffered content in the parser */
|
|
115
|
+
flush(): void;
|
|
116
|
+
/**
|
|
117
|
+
* Progressive rendering for LLM-emitted schema JSON that is still streaming.
|
|
118
|
+
* Call every frame with the ACCUMULATED text (append-only) — idempotent, so
|
|
119
|
+
* dropped/replayed frames are safe. Completed blocks mount incrementally;
|
|
120
|
+
* the incomplete tail never renders. Mutually exclusive with `feed()` /
|
|
121
|
+
* `applyCommand()` on the same instance.
|
|
122
|
+
*/
|
|
123
|
+
feedPartialSchema(accumulatedText: string): void;
|
|
124
|
+
/**
|
|
125
|
+
* Call when the stream ends: runs the authoritative full-document parse +
|
|
126
|
+
* validateSchema, applies the final (unpruned) tree, and reports status.
|
|
127
|
+
* `{complete:false}` = stream cut before the JSON closed (rendered blocks
|
|
128
|
+
* are kept; the host decides whether to degrade).
|
|
129
|
+
*/
|
|
130
|
+
finalizePartialSchema(): PartialFinalizeResult;
|
|
131
|
+
/** Get current schema state for a surface */
|
|
132
|
+
getSchema(surfaceId?: string): CardSchema | undefined;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Create a streaming card instance that supports progressive rendering.
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* const card = renderStreamingCard(container);
|
|
140
|
+
*
|
|
141
|
+
* // Feed raw SSE/NDJSON chunks as they arrive
|
|
142
|
+
* eventSource.onmessage = (e) => card.feed(e.data + '\n');
|
|
143
|
+
*
|
|
144
|
+
* // Or apply commands directly
|
|
145
|
+
* card.applyCommand({
|
|
146
|
+
* type: 'createSurface',
|
|
147
|
+
* surfaceId: 'main',
|
|
148
|
+
* schema: { version: '1.0', rootID: 'root', elements: {...}, variables: {} }
|
|
149
|
+
* });
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
declare function renderStreamingCard(container: HTMLElement, options?: StreamingCardOptions): StreamingCardInstance;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Streaming Transport — connects a StreamingCardInstance to a streaming data source.
|
|
156
|
+
*
|
|
157
|
+
* Provides utility functions to bridge common transport protocols
|
|
158
|
+
* (SSE, fetch streaming, WebSocket) with the streaming card renderer.
|
|
159
|
+
*/
|
|
160
|
+
|
|
161
|
+
interface StreamingConnectOptions {
|
|
162
|
+
/** URL of the streaming endpoint */
|
|
163
|
+
url: string;
|
|
164
|
+
/** HTTP method, defaults to 'GET' */
|
|
165
|
+
method?: 'GET' | 'POST';
|
|
166
|
+
/** Request body (will be JSON.stringify'd for POST) */
|
|
167
|
+
body?: any;
|
|
168
|
+
/** Custom request headers */
|
|
169
|
+
headers?: Record<string, string>;
|
|
170
|
+
/** Called when the stream ends normally */
|
|
171
|
+
onComplete?: () => void;
|
|
172
|
+
/** Called when a transport error occurs */
|
|
173
|
+
onError?: (error: Error) => void;
|
|
174
|
+
/** Called when connection is established */
|
|
175
|
+
onOpen?: () => void;
|
|
176
|
+
}
|
|
177
|
+
interface StreamingConnection {
|
|
178
|
+
/** Abort the streaming connection */
|
|
179
|
+
abort(): void;
|
|
180
|
+
/** The underlying AbortController */
|
|
181
|
+
controller: AbortController;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Connect to a fetch streaming endpoint and feed chunks to the card instance.
|
|
185
|
+
*
|
|
186
|
+
* Uses the Fetch API with ReadableStream to consume server-sent data progressively.
|
|
187
|
+
* Supports both NDJSON and SSE format responses.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```ts
|
|
191
|
+
* const card = renderStreamingCard(container);
|
|
192
|
+
* const connection = await connectStreaming(card, {
|
|
193
|
+
* url: '/api/agent/chat',
|
|
194
|
+
* method: 'POST',
|
|
195
|
+
* body: { message: 'Show me my order status' },
|
|
196
|
+
* onComplete: () => console.log('Stream finished'),
|
|
197
|
+
* onError: (err) => console.error('Stream error:', err),
|
|
198
|
+
* });
|
|
199
|
+
*
|
|
200
|
+
* // To cancel the stream:
|
|
201
|
+
* connection.abort();
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
204
|
+
declare function connectStreaming(instance: StreamingCardInstance, options: StreamingConnectOptions): Promise<StreamingConnection>;
|
|
205
|
+
interface SSEConnectOptions {
|
|
206
|
+
/** URL of the SSE endpoint */
|
|
207
|
+
url: string;
|
|
208
|
+
/** Event type to listen for, defaults to 'message' */
|
|
209
|
+
eventType?: string;
|
|
210
|
+
/** Called when the stream ends */
|
|
211
|
+
onComplete?: () => void;
|
|
212
|
+
/** Called on error */
|
|
213
|
+
onError?: (error: Event) => void;
|
|
214
|
+
/** Called when connection opens */
|
|
215
|
+
onOpen?: () => void;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Connect to a Server-Sent Events (EventSource) endpoint.
|
|
219
|
+
*
|
|
220
|
+
* This is a simpler alternative to fetch streaming for servers that
|
|
221
|
+
* support the standard SSE protocol. Each SSE message is parsed and
|
|
222
|
+
* fed to the card instance.
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* ```ts
|
|
226
|
+
* const card = renderStreamingCard(container);
|
|
227
|
+
* const connection = connectSSE(card, {
|
|
228
|
+
* url: '/api/agent/stream?session=abc123',
|
|
229
|
+
* onComplete: () => console.log('Done'),
|
|
230
|
+
* });
|
|
231
|
+
*
|
|
232
|
+
* // Later: close the connection
|
|
233
|
+
* connection.close();
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
236
|
+
declare function connectSSE(instance: StreamingCardInstance, options: SSEConnectOptions): EventSource;
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* BotSDK — high-level wrapper for integrating copilot bot cards
|
|
240
|
+
* into business applications.
|
|
241
|
+
*
|
|
242
|
+
* Usage:
|
|
243
|
+
* ```ts
|
|
244
|
+
* import { BotSDK, registry } from '@antglobal/copilot-cards-web';
|
|
245
|
+
*
|
|
246
|
+
* const bot = new BotSDK({
|
|
247
|
+
* botId: '10001',
|
|
248
|
+
* baseUrl: 'https://api.example.com',
|
|
249
|
+
* onAction: {
|
|
250
|
+
* bizRequest: async (params, ctx) => {
|
|
251
|
+
* const res = await axios.post(params.api, params.data);
|
|
252
|
+
* if (res.data.code !== 200) throw new Error('Failed');
|
|
253
|
+
* },
|
|
254
|
+
* },
|
|
255
|
+
* });
|
|
256
|
+
*
|
|
257
|
+
* // Render a card from server-delivered schema
|
|
258
|
+
* const instance = bot.renderCard(container, cardSchema, {
|
|
259
|
+
* variables: { order_id: 'ORDER_666' },
|
|
260
|
+
* });
|
|
261
|
+
* ```
|
|
262
|
+
*/
|
|
263
|
+
|
|
264
|
+
interface BotSDKOptions {
|
|
265
|
+
/** Bot ID — identifies which bot this instance is for */
|
|
266
|
+
botId: string;
|
|
267
|
+
/** Base URL for business API requests (e.g. 'https://api.example.com') */
|
|
268
|
+
baseUrl?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Source B: Batch-register custom action handler functions.
|
|
271
|
+
* These are imperative JS handlers written in the frontend project.
|
|
272
|
+
* Shorthand for calling `registry.register()` for each entry.
|
|
273
|
+
*/
|
|
274
|
+
onAction?: Record<string, SimpleActionHandler>;
|
|
275
|
+
/**
|
|
276
|
+
* Source A: Action configuration provider.
|
|
277
|
+
* Fetches declarative ActionStep[] chains from a data source
|
|
278
|
+
* (local mock for dev, remote API for production).
|
|
279
|
+
*/
|
|
280
|
+
actionProvider?: ActionConfigProvider;
|
|
281
|
+
}
|
|
282
|
+
declare class BotSDK {
|
|
283
|
+
readonly botId: string;
|
|
284
|
+
readonly baseUrl: string;
|
|
285
|
+
private _instances;
|
|
286
|
+
/** Declarative action chains loaded from actionProvider */
|
|
287
|
+
private _actionChains;
|
|
288
|
+
/** Promise that resolves when action configs are loaded */
|
|
289
|
+
private _ready;
|
|
290
|
+
constructor(options: BotSDKOptions);
|
|
291
|
+
private _loadActionConfigs;
|
|
292
|
+
/**
|
|
293
|
+
* Render a card schema into a container element.
|
|
294
|
+
*
|
|
295
|
+
* If an actionProvider was configured, this method waits for
|
|
296
|
+
* action configs to load before rendering. Declarative action
|
|
297
|
+
* chains are merged into `schema.actions`.
|
|
298
|
+
*
|
|
299
|
+
* @returns A `CardInstance` with `dispose()` and `updateVariables()` methods.
|
|
300
|
+
*/
|
|
301
|
+
renderCard(container: HTMLElement, schemaInput: CardSchemaInput, options?: RenderCardOptions): Promise<CardInstance>;
|
|
302
|
+
/**
|
|
303
|
+
* Merge loaded action chain configs into schema.actions.
|
|
304
|
+
* Provider configs are used as defaults; schema.actions takes precedence.
|
|
305
|
+
*/
|
|
306
|
+
private _mergeSchemaActions;
|
|
307
|
+
/**
|
|
308
|
+
* Dispose all card instances created by this BotSDK instance.
|
|
309
|
+
*/
|
|
310
|
+
disposeAll(): void;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* LocalActionConfigProvider — loads action chain configs from an in-memory
|
|
315
|
+
* object. Used for demo / development / testing.
|
|
316
|
+
*
|
|
317
|
+
* Usage:
|
|
318
|
+
* ```ts
|
|
319
|
+
* const provider = new LocalActionConfigProvider({
|
|
320
|
+
* '10001': [
|
|
321
|
+
* { name: 'confirmOrder', steps: [{ type: 'request', params: { ... } }] },
|
|
322
|
+
* ],
|
|
323
|
+
* });
|
|
324
|
+
* ```
|
|
325
|
+
*/
|
|
326
|
+
|
|
327
|
+
declare class LocalActionConfigProvider implements ActionConfigProvider {
|
|
328
|
+
private _configs;
|
|
329
|
+
constructor(configs?: Record<string, ActionChainConfig[]>);
|
|
330
|
+
/**
|
|
331
|
+
* Add or replace action configs for a botId.
|
|
332
|
+
*/
|
|
333
|
+
addBot(botId: string, actions: ActionChainConfig[]): void;
|
|
334
|
+
/**
|
|
335
|
+
* Remove all action configs for a botId.
|
|
336
|
+
*/
|
|
337
|
+
removeBot(botId: string): void;
|
|
338
|
+
fetchActions(botId: string): Promise<ActionChainConfig[]>;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* RemoteActionConfigProvider — fetches action chain configs from a
|
|
343
|
+
* server-side API. Used in production environments.
|
|
344
|
+
*
|
|
345
|
+
* The server stores action chain configs per botId in the database.
|
|
346
|
+
* This provider fetches them via HTTP.
|
|
347
|
+
*
|
|
348
|
+
* Expected API response format:
|
|
349
|
+
* ```json
|
|
350
|
+
* [
|
|
351
|
+
* { "name": "confirmOrder", "steps": [...], "description": "..." },
|
|
352
|
+
* { "name": "submitFeedback", "steps": [...] }
|
|
353
|
+
* ]
|
|
354
|
+
* ```
|
|
355
|
+
*
|
|
356
|
+
* Usage:
|
|
357
|
+
* ```ts
|
|
358
|
+
* const provider = new RemoteActionConfigProvider('https://api.example.com');
|
|
359
|
+
* const configs = await provider.fetchActions('10001');
|
|
360
|
+
* ```
|
|
361
|
+
*/
|
|
362
|
+
|
|
363
|
+
declare class RemoteActionConfigProvider implements ActionConfigProvider {
|
|
364
|
+
private _baseUrl;
|
|
365
|
+
private _headers;
|
|
366
|
+
private _cache;
|
|
367
|
+
constructor(baseUrl: string, options?: {
|
|
368
|
+
/** Additional HTTP headers (e.g. Authorization) */
|
|
369
|
+
headers?: Record<string, string>;
|
|
370
|
+
});
|
|
371
|
+
fetchActions(botId: string): Promise<ActionChainConfig[]>;
|
|
372
|
+
/**
|
|
373
|
+
* Clear the cache for a specific botId or all bots.
|
|
374
|
+
*/
|
|
375
|
+
clearCache(botId?: string): void;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Responsive & unit conversion utilities for web-component rendering.
|
|
380
|
+
*/
|
|
381
|
+
/**
|
|
382
|
+
* Convert a `px` value to `rem` based on a root font-size.
|
|
383
|
+
*/
|
|
384
|
+
declare function pxToRem(px: number, rootFontSize?: number): string;
|
|
385
|
+
/**
|
|
386
|
+
* Convert a `px` value to `vw` based on a design-width.
|
|
387
|
+
*/
|
|
388
|
+
declare function pxToVw(px: number, designWidth?: number): string;
|
|
389
|
+
/**
|
|
390
|
+
* Resolve a size value: if it's a number, append `px`; otherwise return as-is.
|
|
391
|
+
*/
|
|
392
|
+
declare function resolveSize(value: string | number): string;
|
|
393
|
+
/**
|
|
394
|
+
* Check if the current viewport matches "mobile" via media query.
|
|
395
|
+
* Falls back to `false` in non-browser environments.
|
|
396
|
+
*/
|
|
397
|
+
declare function isMobileViewport(breakpoint?: number): boolean;
|
|
398
|
+
/**
|
|
399
|
+
* Create a `MediaQueryList` listener that fires when mobile/desktop changes.
|
|
400
|
+
* Returns a cleanup function to remove the listener.
|
|
401
|
+
*/
|
|
402
|
+
declare function onViewportChange(callback: (isMobile: boolean) => void, breakpoint?: number): () => void;
|
|
403
|
+
/**
|
|
404
|
+
* Build an inline style string from a Record.
|
|
405
|
+
* Values are used as-is; Schema should provide complete CSS values (e.g., "14px", "500").
|
|
406
|
+
*/
|
|
407
|
+
declare function buildStyleString(styles: Record<string, string | number | undefined>): string;
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* BaseElement — abstract Custom Element base class for card components.
|
|
411
|
+
*
|
|
412
|
+
* Provides Shadow DOM encapsulation, data-driven rendering, and
|
|
413
|
+
* common style helpers. Designed to be used by `renderCard` which
|
|
414
|
+
* passes resolved props via `setData()`.
|
|
415
|
+
*
|
|
416
|
+
* Note: lifecycle management, event binding, and viewport detection
|
|
417
|
+
* are handled externally by `renderCard` / the render pipeline.
|
|
418
|
+
* BaseElement keeps itself lightweight and focused on DOM rendering.
|
|
419
|
+
*/
|
|
420
|
+
|
|
421
|
+
declare abstract class BaseElement extends HTMLElement {
|
|
422
|
+
protected _node: RenderTreeNode | null;
|
|
423
|
+
protected _props: Record<string, any>;
|
|
424
|
+
protected _isMobile: boolean;
|
|
425
|
+
constructor();
|
|
426
|
+
/**
|
|
427
|
+
* Set component data and trigger render.
|
|
428
|
+
* Called by the component renderer (from `renderCard` pipeline).
|
|
429
|
+
*/
|
|
430
|
+
setData(node: RenderTreeNode, props: Record<string, any>, isMobile: boolean): void;
|
|
431
|
+
/**
|
|
432
|
+
* Update props only (e.g. on variable change + re-render).
|
|
433
|
+
*/
|
|
434
|
+
updateProps(props: Record<string, any>, isMobile?: boolean): void;
|
|
435
|
+
/**
|
|
436
|
+
* Subclasses must implement this to render their UI into `this.shadowRoot`.
|
|
437
|
+
*/
|
|
438
|
+
protected abstract render(): void;
|
|
439
|
+
/** Convert any content value to a safe display string. */
|
|
440
|
+
protected resolveContent(content: any): string;
|
|
441
|
+
/**
|
|
442
|
+
* Build an inline CSS string from a style props object.
|
|
443
|
+
* Numeric values are resolved to `px`.
|
|
444
|
+
*/
|
|
445
|
+
protected buildInlineStyle(style?: Record<string, any>, isExpressionResult?: boolean): string;
|
|
446
|
+
/** Resolve a single size value (number → px). */
|
|
447
|
+
protected toCSS(value: string | number): string;
|
|
448
|
+
/**
|
|
449
|
+
* CSS properties whose numeric values are unitless — appending `px`
|
|
450
|
+
* to these produces invalid CSS the browser silently drops
|
|
451
|
+
* (e.g. `opacity: 0.5px`, `font-weight: 500px`, `flex: 1px`).
|
|
452
|
+
*/
|
|
453
|
+
private static readonly UNITLESS_PROPS;
|
|
454
|
+
private resolveSizeInStyle;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
declare class CardText extends BaseElement {
|
|
458
|
+
static readonly is = "ai-card-text";
|
|
459
|
+
private _prevContent;
|
|
460
|
+
private _displayedContent;
|
|
461
|
+
private _streamTimer;
|
|
462
|
+
private _contentEl;
|
|
463
|
+
private _cursorEl;
|
|
464
|
+
private _isInitialRender;
|
|
465
|
+
private _mdThrottleTimer;
|
|
466
|
+
private _mdPendingUpdate;
|
|
467
|
+
private _tooltipEl;
|
|
468
|
+
private _tooltipTimer;
|
|
469
|
+
setData(node: RenderTreeNode, props: Record<string, any>, isMobile: boolean): void;
|
|
470
|
+
protected render(): void;
|
|
471
|
+
/**
|
|
472
|
+
* Handle incremental content update in streaming mode.
|
|
473
|
+
* Called when render() is triggered again with new content while streaming.
|
|
474
|
+
*/
|
|
475
|
+
private _handleStreamingUpdate;
|
|
476
|
+
/**
|
|
477
|
+
* Start initial streaming animation from empty to full content.
|
|
478
|
+
*/
|
|
479
|
+
private _startStreamingAnimation;
|
|
480
|
+
/**
|
|
481
|
+
* Update the content DOM element with current displayed content.
|
|
482
|
+
* When markdown is enabled, throttle parsing to avoid O(n²) cost.
|
|
483
|
+
*/
|
|
484
|
+
private _updateContentDOM;
|
|
485
|
+
/**
|
|
486
|
+
* Flush pending markdown parse to DOM.
|
|
487
|
+
*/
|
|
488
|
+
private _flushMarkdown;
|
|
489
|
+
/**
|
|
490
|
+
* Remove the streaming cursor from DOM.
|
|
491
|
+
*/
|
|
492
|
+
private _removeCursor;
|
|
493
|
+
/**
|
|
494
|
+
* Remove cursor when streaming ends.
|
|
495
|
+
* Called externally when streaming prop changes to false.
|
|
496
|
+
*/
|
|
497
|
+
updateProps(props: Record<string, any>, isMobile?: boolean): void;
|
|
498
|
+
/**
|
|
499
|
+
* Parse markdown to HTML using marked.
|
|
500
|
+
*/
|
|
501
|
+
private _parseMarkdown;
|
|
502
|
+
/**
|
|
503
|
+
* When `maxLines` clamps the text, show the full text in a styled tooltip
|
|
504
|
+
* on hover — but only when the content is actually truncated, so text that
|
|
505
|
+
* fits gets no redundant tooltip. Overflow is measured after layout (rAF):
|
|
506
|
+
* a `-webkit-line-clamp` box reports the full content height via scrollHeight
|
|
507
|
+
* while clientHeight stays at the clamped line box.
|
|
508
|
+
*
|
|
509
|
+
* The tooltip replaces the native `title` (which is unstyled and takes ~1s
|
|
510
|
+
* to appear): it shows after a short 200ms hover, renders in the shadow root
|
|
511
|
+
* with `position: fixed` so ancestor `overflow: hidden` can't clip it, and
|
|
512
|
+
* flips above the anchor when it would overflow the viewport bottom.
|
|
513
|
+
*/
|
|
514
|
+
private _updateClampTitle;
|
|
515
|
+
/** Show the clamp tooltip below (or above) the anchor, kept inside the viewport. */
|
|
516
|
+
private _showClampTooltip;
|
|
517
|
+
/** Remove the clamp tooltip if present. */
|
|
518
|
+
private _hideClampTooltip;
|
|
519
|
+
/**
|
|
520
|
+
* Escape HTML to prevent XSS when not in markdown mode.
|
|
521
|
+
*/
|
|
522
|
+
private _escapeHTML;
|
|
523
|
+
disconnectedCallback(): void;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* CardButton — Custom Element for rendering button content in a card.
|
|
528
|
+
*
|
|
529
|
+
* Uses Shadow DOM for style encapsulation so card button styles
|
|
530
|
+
* never leak into or get affected by the host page.
|
|
531
|
+
*
|
|
532
|
+
* Registered as `<ai-card-button>`. Created internally by the
|
|
533
|
+
* component renderer; end-users interact via `renderCard()`.
|
|
534
|
+
*
|
|
535
|
+
* Schema example:
|
|
536
|
+
* ```json
|
|
537
|
+
* {
|
|
538
|
+
* "type": "Button",
|
|
539
|
+
* "props": {
|
|
540
|
+
* "content": { "type": "static", "value": "Submit" },
|
|
541
|
+
* "variant": "primary",
|
|
542
|
+
* "size": "medium",
|
|
543
|
+
* "disabled": false,
|
|
544
|
+
* "block": false,
|
|
545
|
+
* "style": { "borderRadius": 6 }
|
|
546
|
+
* },
|
|
547
|
+
* "events": {
|
|
548
|
+
* "onClick": [{ "type": "emit", "params": { "event": "submit" } }]
|
|
549
|
+
* }
|
|
550
|
+
* }
|
|
551
|
+
* ```
|
|
552
|
+
*/
|
|
553
|
+
|
|
554
|
+
declare class CardButton extends BaseElement {
|
|
555
|
+
static readonly is = "ai-card-button";
|
|
556
|
+
protected render(): void;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* CardInput — Custom Element for rendering input fields in a card.
|
|
561
|
+
*
|
|
562
|
+
* Uses Shadow DOM for style encapsulation so card input styles
|
|
563
|
+
* never leak into or get affected by the host page.
|
|
564
|
+
*
|
|
565
|
+
* Registered as `<ai-card-input>`. Created internally by the
|
|
566
|
+
* component renderer; end-users interact via `renderCard()`.
|
|
567
|
+
*
|
|
568
|
+
* The input value is synced to schema variables via `setVariable`
|
|
569
|
+
* action on every input/change event, enabling reactive data flow.
|
|
570
|
+
*
|
|
571
|
+
* Schema example:
|
|
572
|
+
* ```json
|
|
573
|
+
* {
|
|
574
|
+
* "type": "Input",
|
|
575
|
+
* "props": {
|
|
576
|
+
* "placeholder": "Enter your name",
|
|
577
|
+
* "inputType": "text",
|
|
578
|
+
* "variableKey": "userName",
|
|
579
|
+
* "label": "Name",
|
|
580
|
+
* "maxLength": 100,
|
|
581
|
+
* "disabled": false,
|
|
582
|
+
* "style": { "width": 300 }
|
|
583
|
+
* },
|
|
584
|
+
* "events": {
|
|
585
|
+
* "onChange": [{ "type": "emit", "params": { "event": "inputChanged" } }]
|
|
586
|
+
* }
|
|
587
|
+
* }
|
|
588
|
+
* ```
|
|
589
|
+
*/
|
|
590
|
+
|
|
591
|
+
declare class CardInput extends BaseElement {
|
|
592
|
+
static readonly is = "ai-card-input";
|
|
593
|
+
protected render(): void;
|
|
594
|
+
/** Escape HTML entities for safe insertion. */
|
|
595
|
+
private escapeHtml;
|
|
596
|
+
/** Escape attribute values for safe insertion. */
|
|
597
|
+
private escapeAttr;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* CardImage — Custom Element for rendering images in a card.
|
|
602
|
+
*
|
|
603
|
+
* Uses Shadow DOM for style encapsulation. Supports click-to-zoom
|
|
604
|
+
* lightbox functionality for viewing full-size images.
|
|
605
|
+
*
|
|
606
|
+
* Registered as `<ai-card-image>`. Created internally by the
|
|
607
|
+
* component renderer; end-users interact via `renderCard()`.
|
|
608
|
+
*
|
|
609
|
+
* Schema example:
|
|
610
|
+
* ```json
|
|
611
|
+
* {
|
|
612
|
+
* "type": "Image",
|
|
613
|
+
* "props": {
|
|
614
|
+
* "src": "https://example.com/image.jpg",
|
|
615
|
+
* "alt": "Description",
|
|
616
|
+
* "width": "200px",
|
|
617
|
+
* "height": "auto",
|
|
618
|
+
* "objectFit": "cover",
|
|
619
|
+
* "preview": true,
|
|
620
|
+
* "style": { "borderRadius": "8px" }
|
|
621
|
+
* }
|
|
622
|
+
* }
|
|
623
|
+
* ```
|
|
624
|
+
*/
|
|
625
|
+
|
|
626
|
+
declare class CardImage extends BaseElement {
|
|
627
|
+
static readonly is = "ai-card-image";
|
|
628
|
+
private _lightbox;
|
|
629
|
+
protected render(): void;
|
|
630
|
+
private bindEvents;
|
|
631
|
+
private openLightbox;
|
|
632
|
+
private closeLightbox;
|
|
633
|
+
disconnectedCallback(): void;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* CardDivider — Custom Element for rendering a divider/separator line.
|
|
638
|
+
*
|
|
639
|
+
* Supports horizontal/vertical orientation, dashed style, and text label.
|
|
640
|
+
*
|
|
641
|
+
* Schema example:
|
|
642
|
+
* ```json
|
|
643
|
+
* {
|
|
644
|
+
* "type": "Divider",
|
|
645
|
+
* "props": {
|
|
646
|
+
* "direction": "horizontal",
|
|
647
|
+
* "dashed": false,
|
|
648
|
+
* "text": "OR",
|
|
649
|
+
* "color": "#e8e8e8",
|
|
650
|
+
* "thickness": 1
|
|
651
|
+
* }
|
|
652
|
+
* }
|
|
653
|
+
* ```
|
|
654
|
+
*/
|
|
655
|
+
|
|
656
|
+
declare class CardDivider extends BaseElement {
|
|
657
|
+
static readonly is = "ai-card-divider";
|
|
658
|
+
protected render(): void;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* CardRate — Custom Element for star rating display/input.
|
|
663
|
+
*
|
|
664
|
+
* Schema example:
|
|
665
|
+
* ```json
|
|
666
|
+
* {
|
|
667
|
+
* "type": "Rate",
|
|
668
|
+
* "props": {
|
|
669
|
+
* "value": 3,
|
|
670
|
+
* "count": 5,
|
|
671
|
+
* "readonly": false,
|
|
672
|
+
* "size": 24,
|
|
673
|
+
* "gap": 4,
|
|
674
|
+
* "color": "#fadb14",
|
|
675
|
+
* "variableKey": "rating"
|
|
676
|
+
* }
|
|
677
|
+
* }
|
|
678
|
+
* ```
|
|
679
|
+
*/
|
|
680
|
+
|
|
681
|
+
declare class CardRate extends BaseElement {
|
|
682
|
+
static readonly is = "ai-card-rate";
|
|
683
|
+
/** Internal interactive value (tracks clicks before external update) */
|
|
684
|
+
private _currentValue;
|
|
685
|
+
protected render(): void;
|
|
686
|
+
/** Reset internal state when props update externally */
|
|
687
|
+
updateProps(props: Record<string, any>, isMobile?: boolean): void;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* CardTag — Custom Element for rendering a tag/badge label.
|
|
692
|
+
*
|
|
693
|
+
* Schema example:
|
|
694
|
+
* ```json
|
|
695
|
+
* {
|
|
696
|
+
* "type": "Tag",
|
|
697
|
+
* "props": {
|
|
698
|
+
* "content": "NEW",
|
|
699
|
+
* "color": "blue",
|
|
700
|
+
* "closable": false
|
|
701
|
+
* }
|
|
702
|
+
* }
|
|
703
|
+
* ```
|
|
704
|
+
*/
|
|
705
|
+
|
|
706
|
+
declare class CardTag extends BaseElement {
|
|
707
|
+
static readonly is = "ai-card-tag";
|
|
708
|
+
protected render(): void;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* CardSelect — Custom Element for a dropdown selector.
|
|
713
|
+
*
|
|
714
|
+
* Schema example:
|
|
715
|
+
* ```json
|
|
716
|
+
* {
|
|
717
|
+
* "type": "Select",
|
|
718
|
+
* "props": {
|
|
719
|
+
* "placeholder": "请选择",
|
|
720
|
+
* "options": [
|
|
721
|
+
* { "label": "选项一", "value": "1" },
|
|
722
|
+
* { "label": "选项二", "value": "2" }
|
|
723
|
+
* ],
|
|
724
|
+
* "value": ""
|
|
725
|
+
* }
|
|
726
|
+
* }
|
|
727
|
+
* ```
|
|
728
|
+
*
|
|
729
|
+
* The value is semi-controlled: a user-picked option shows on the trigger
|
|
730
|
+
* immediately even when no `onChange` action is wired, while any external
|
|
731
|
+
* `props.value` change (e.g. a variable update re-render) overrides the
|
|
732
|
+
* local pick.
|
|
733
|
+
*/
|
|
734
|
+
|
|
735
|
+
declare class CardSelect extends BaseElement {
|
|
736
|
+
private _open;
|
|
737
|
+
/** Option picked locally; shown until props.value changes externally. */
|
|
738
|
+
private _localValue;
|
|
739
|
+
/** Last seen props.value — detects external changes vs. re-renders. */
|
|
740
|
+
private _propValue;
|
|
741
|
+
private _onDocClick;
|
|
742
|
+
static readonly is = "ai-card-select";
|
|
743
|
+
protected render(): void;
|
|
744
|
+
disconnectedCallback(): void;
|
|
745
|
+
private _setOpen;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* CardPasscodeInput — Custom Element for N-digit passcode/PIN input.
|
|
750
|
+
*
|
|
751
|
+
* Renders N individual square boxes. Auto-advances focus on input.
|
|
752
|
+
* Supports paste, backspace navigation, and masked mode.
|
|
753
|
+
*
|
|
754
|
+
* Schema example:
|
|
755
|
+
* ```json
|
|
756
|
+
* {
|
|
757
|
+
* "type": "PasscodeInput",
|
|
758
|
+
* "props": {
|
|
759
|
+
* "length": 6,
|
|
760
|
+
* "mask": false,
|
|
761
|
+
* "size": 48
|
|
762
|
+
* }
|
|
763
|
+
* }
|
|
764
|
+
* ```
|
|
765
|
+
*/
|
|
766
|
+
|
|
767
|
+
declare class CardPasscodeInput extends BaseElement {
|
|
768
|
+
static readonly is = "ai-card-passcode-input";
|
|
769
|
+
protected render(): void;
|
|
770
|
+
private _emitValue;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
/**
|
|
774
|
+
* CardIcon — Custom Element for rendering icons.
|
|
775
|
+
*
|
|
776
|
+
* Supports URL-based icons (png/svg) and built-in emoji/SVG icons.
|
|
777
|
+
*
|
|
778
|
+
* Schema example:
|
|
779
|
+
* ```json
|
|
780
|
+
* {
|
|
781
|
+
* "type": "Icon",
|
|
782
|
+
* "props": {
|
|
783
|
+
* "name": "check",
|
|
784
|
+
* "src": "https://...",
|
|
785
|
+
* "size": 24,
|
|
786
|
+
* "color": "#1677ff"
|
|
787
|
+
* }
|
|
788
|
+
* }
|
|
789
|
+
* ```
|
|
790
|
+
*/
|
|
791
|
+
|
|
792
|
+
declare class CardIcon extends BaseElement {
|
|
793
|
+
static readonly is = "ai-card-icon";
|
|
794
|
+
protected render(): void;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* CardForm — Custom Element for rendering a complete form.
|
|
799
|
+
*
|
|
800
|
+
* Renders fields (text / textarea / select / passcode / rate) with
|
|
801
|
+
* labels, validation, and a submit button. On submit it collects
|
|
802
|
+
* all values and dispatches a `submit` CustomEvent.
|
|
803
|
+
*
|
|
804
|
+
* Schema example:
|
|
805
|
+
* ```json
|
|
806
|
+
* {
|
|
807
|
+
* "type": "Form",
|
|
808
|
+
* "props": {
|
|
809
|
+
* "fields": [
|
|
810
|
+
* { "name": "username", "label": "用户名", "type": "text", "required": true, "placeholder": "请输入" },
|
|
811
|
+
* { "name": "gender", "label": "性别", "type": "select", "options": [{"label":"男","value":"male"},{"label":"女","value":"female"}] },
|
|
812
|
+
* { "name": "code", "label": "验证码", "type": "passcode", "length": 6 },
|
|
813
|
+
* { "name": "score", "label": "评分", "type": "rate" },
|
|
814
|
+
* { "name": "remark", "label": "备注", "type": "textarea" }
|
|
815
|
+
* ],
|
|
816
|
+
* "submitText": "提交",
|
|
817
|
+
* "layout": "vertical"
|
|
818
|
+
* }
|
|
819
|
+
* }
|
|
820
|
+
* ```
|
|
821
|
+
*/
|
|
822
|
+
|
|
823
|
+
declare class CardForm extends BaseElement {
|
|
824
|
+
static readonly is = "ai-card-form";
|
|
825
|
+
private _values;
|
|
826
|
+
private _errors;
|
|
827
|
+
private _submitted;
|
|
828
|
+
protected render(): void;
|
|
829
|
+
private _renderField;
|
|
830
|
+
private _bindEvents;
|
|
831
|
+
private _validate;
|
|
832
|
+
updateProps(props: Record<string, any>, isMobile?: boolean): void;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* CardLoading — Custom Element for rendering a spinner loading indicator.
|
|
837
|
+
*
|
|
838
|
+
* Supports configurable spin duration, size, color, and optional text.
|
|
839
|
+
*
|
|
840
|
+
* Schema example:
|
|
841
|
+
* ```json
|
|
842
|
+
* {
|
|
843
|
+
* "type": "Loading",
|
|
844
|
+
* "props": {
|
|
845
|
+
* "size": 32,
|
|
846
|
+
* "color": "#1677ff",
|
|
847
|
+
* "duration": 1,
|
|
848
|
+
* "text": "加载中..."
|
|
849
|
+
* }
|
|
850
|
+
* }
|
|
851
|
+
* ```
|
|
852
|
+
*/
|
|
853
|
+
|
|
854
|
+
declare class CardLoading extends BaseElement {
|
|
855
|
+
static readonly is = "ai-card-loading";
|
|
856
|
+
protected render(): void;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* Component Props Type Declarations
|
|
861
|
+
*
|
|
862
|
+
* Provides TypeScript type definitions for all built-in component props.
|
|
863
|
+
* These types correspond to the props destructured from `this._props`
|
|
864
|
+
* in each component's `render()` method.
|
|
865
|
+
*/
|
|
866
|
+
interface TextProps {
|
|
867
|
+
/** Text content (static string or expression-resolved value) */
|
|
868
|
+
content?: string;
|
|
869
|
+
/** Text alignment: left / center / right */
|
|
870
|
+
align?: string;
|
|
871
|
+
/** Font size (number → px, or CSS string) */
|
|
872
|
+
fontSize?: string | number;
|
|
873
|
+
/** Font weight (e.g. 'bold', 500) */
|
|
874
|
+
fontWeight?: string | number;
|
|
875
|
+
/** Text color */
|
|
876
|
+
color?: string;
|
|
877
|
+
/** Max visible lines — enables CSS line-clamp truncation */
|
|
878
|
+
maxLines?: number;
|
|
879
|
+
/** Inline style object */
|
|
880
|
+
style?: Record<string, any>;
|
|
881
|
+
}
|
|
882
|
+
interface ButtonProps {
|
|
883
|
+
/** Button label text */
|
|
884
|
+
content?: string;
|
|
885
|
+
/** Visual variant */
|
|
886
|
+
variant?: 'primary' | 'secondary' | 'text' | 'danger';
|
|
887
|
+
/** Button size */
|
|
888
|
+
size?: 'small' | 'medium' | 'large';
|
|
889
|
+
/** Whether the button is disabled */
|
|
890
|
+
disabled?: boolean;
|
|
891
|
+
/** Whether the button stretches to full width */
|
|
892
|
+
block?: boolean;
|
|
893
|
+
/** Icon HTML rendered before text */
|
|
894
|
+
icon?: string;
|
|
895
|
+
/** Inline style object */
|
|
896
|
+
style?: Record<string, any>;
|
|
897
|
+
}
|
|
898
|
+
interface InputProps {
|
|
899
|
+
/** Placeholder text */
|
|
900
|
+
placeholder?: string;
|
|
901
|
+
/** HTML input type: text / textarea / password / number etc. */
|
|
902
|
+
inputType?: 'text' | 'textarea' | 'password' | (string & {});
|
|
903
|
+
/** Label text displayed above the input */
|
|
904
|
+
label?: string;
|
|
905
|
+
/** Initial value */
|
|
906
|
+
defaultValue?: string;
|
|
907
|
+
/** Whether the input is disabled */
|
|
908
|
+
disabled?: boolean;
|
|
909
|
+
/** Whether the input is read-only */
|
|
910
|
+
readonly?: boolean;
|
|
911
|
+
/** Maximum character length */
|
|
912
|
+
maxLength?: number;
|
|
913
|
+
/** Number of rows for textarea (default 3) */
|
|
914
|
+
rows?: number;
|
|
915
|
+
/** Inline style object */
|
|
916
|
+
style?: Record<string, any>;
|
|
917
|
+
}
|
|
918
|
+
interface ImageProps {
|
|
919
|
+
/** Image URL */
|
|
920
|
+
src?: string;
|
|
921
|
+
/** Alt text for accessibility */
|
|
922
|
+
alt?: string;
|
|
923
|
+
/** Image width (CSS value) */
|
|
924
|
+
width?: string;
|
|
925
|
+
/** Image height (CSS value) */
|
|
926
|
+
height?: string;
|
|
927
|
+
/** CSS object-fit mode (default 'cover') */
|
|
928
|
+
objectFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
929
|
+
/** Whether lightbox preview is enabled (default true) */
|
|
930
|
+
preview?: boolean;
|
|
931
|
+
/** Inline style object */
|
|
932
|
+
style?: Record<string, any>;
|
|
933
|
+
}
|
|
934
|
+
interface DividerProps {
|
|
935
|
+
/** Orientation (default 'horizontal') */
|
|
936
|
+
direction?: 'horizontal' | 'vertical';
|
|
937
|
+
/** Whether to use dashed line (default false) */
|
|
938
|
+
dashed?: boolean;
|
|
939
|
+
/** Optional text displayed on the divider */
|
|
940
|
+
text?: string;
|
|
941
|
+
/** Line color (default '#e8e8e8') */
|
|
942
|
+
color?: string;
|
|
943
|
+
/** Line thickness in px (default 1) */
|
|
944
|
+
thickness?: number;
|
|
945
|
+
/** Inline style object */
|
|
946
|
+
style?: Record<string, any>;
|
|
947
|
+
}
|
|
948
|
+
interface RateProps {
|
|
949
|
+
/** Current rating value (default 0) */
|
|
950
|
+
value?: number;
|
|
951
|
+
/** Total number of stars (default 5) */
|
|
952
|
+
count?: number;
|
|
953
|
+
/** Whether the rating is read-only (default false) */
|
|
954
|
+
readonly?: boolean;
|
|
955
|
+
/** Whether half-star selection is allowed (default false) */
|
|
956
|
+
allowHalf?: boolean;
|
|
957
|
+
/** Star size in px (default 24) */
|
|
958
|
+
size?: number;
|
|
959
|
+
/** Active star color (default '#fadb14') */
|
|
960
|
+
color?: string;
|
|
961
|
+
/** Inactive star color (default '#e8e8e8') */
|
|
962
|
+
inactiveColor?: string;
|
|
963
|
+
/** Inline style object */
|
|
964
|
+
style?: Record<string, any>;
|
|
965
|
+
}
|
|
966
|
+
interface TagProps {
|
|
967
|
+
/** Tag label text */
|
|
968
|
+
content?: string;
|
|
969
|
+
/** Preset color name or custom hex color (default 'default') */
|
|
970
|
+
color?: 'blue' | 'green' | 'red' | 'orange' | 'gold' | 'cyan' | 'purple' | 'default' | (string & {});
|
|
971
|
+
/** Whether the close button is shown (default false) */
|
|
972
|
+
closable?: boolean;
|
|
973
|
+
/** Whether to show border (default true) */
|
|
974
|
+
bordered?: boolean;
|
|
975
|
+
/** Inline style object */
|
|
976
|
+
style?: Record<string, any>;
|
|
977
|
+
}
|
|
978
|
+
interface SelectOption {
|
|
979
|
+
label: string;
|
|
980
|
+
value: string;
|
|
981
|
+
}
|
|
982
|
+
interface SelectProps {
|
|
983
|
+
/** Dropdown options list */
|
|
984
|
+
options?: SelectOption[];
|
|
985
|
+
/** Placeholder text (default '请选择') */
|
|
986
|
+
placeholder?: string;
|
|
987
|
+
/** Currently selected value */
|
|
988
|
+
value?: string;
|
|
989
|
+
/** Whether the select is disabled (default false) */
|
|
990
|
+
disabled?: boolean;
|
|
991
|
+
/** Inline style object */
|
|
992
|
+
style?: Record<string, any>;
|
|
993
|
+
}
|
|
994
|
+
interface PasscodeInputProps {
|
|
995
|
+
/** Number of passcode cells (default 6, max 10) */
|
|
996
|
+
length?: number;
|
|
997
|
+
/** Whether to mask input as password (default false) */
|
|
998
|
+
mask?: boolean;
|
|
999
|
+
/** Cell size in px (default 48) */
|
|
1000
|
+
size?: number;
|
|
1001
|
+
/** Gap between cells in px (default 8) */
|
|
1002
|
+
gap?: number;
|
|
1003
|
+
/** Whether the input is disabled (default false) */
|
|
1004
|
+
disabled?: boolean;
|
|
1005
|
+
/** Inline style object */
|
|
1006
|
+
style?: Record<string, any>;
|
|
1007
|
+
}
|
|
1008
|
+
interface IconProps {
|
|
1009
|
+
/** Built-in icon name (check/close/info/warning/error/success/star/heart/search/arrow_right) or emoji */
|
|
1010
|
+
name?: string;
|
|
1011
|
+
/** URL to a remote icon image */
|
|
1012
|
+
src?: string;
|
|
1013
|
+
/** Icon size in px (default 24) */
|
|
1014
|
+
size?: number;
|
|
1015
|
+
/** Icon color (default 'currentColor') */
|
|
1016
|
+
color?: string;
|
|
1017
|
+
/** Inline style object */
|
|
1018
|
+
style?: Record<string, any>;
|
|
1019
|
+
}
|
|
1020
|
+
interface FormField {
|
|
1021
|
+
/** Field identifier (used as key in submitted values) */
|
|
1022
|
+
name: string;
|
|
1023
|
+
/** Display label */
|
|
1024
|
+
label?: string;
|
|
1025
|
+
/** Field type (default 'text') */
|
|
1026
|
+
type?: 'text' | 'textarea' | 'select' | 'passcode' | 'rate' | 'number' | 'password';
|
|
1027
|
+
/** Placeholder text */
|
|
1028
|
+
placeholder?: string;
|
|
1029
|
+
/** Whether the field is required */
|
|
1030
|
+
required?: boolean;
|
|
1031
|
+
/** Options for select type */
|
|
1032
|
+
options?: {
|
|
1033
|
+
label: string;
|
|
1034
|
+
value: string;
|
|
1035
|
+
}[];
|
|
1036
|
+
/** Number of cells for passcode type (default 6) */
|
|
1037
|
+
length?: number;
|
|
1038
|
+
/** Initial value */
|
|
1039
|
+
defaultValue?: any;
|
|
1040
|
+
}
|
|
1041
|
+
interface FormProps {
|
|
1042
|
+
/** Form field definitions */
|
|
1043
|
+
fields?: FormField[];
|
|
1044
|
+
/** Submit button text (default '提交') */
|
|
1045
|
+
submitText?: string;
|
|
1046
|
+
/** Form layout direction (default 'vertical') */
|
|
1047
|
+
layout?: 'vertical' | 'horizontal';
|
|
1048
|
+
/** Whether the entire form is disabled (default false) */
|
|
1049
|
+
disabled?: boolean;
|
|
1050
|
+
/** Inline style object */
|
|
1051
|
+
style?: Record<string, any>;
|
|
1052
|
+
}
|
|
1053
|
+
interface LoadingProps {
|
|
1054
|
+
/** Spinner size in px (default 32) */
|
|
1055
|
+
size?: number | string;
|
|
1056
|
+
/** Spinner color (default '#1677ff') */
|
|
1057
|
+
color?: string;
|
|
1058
|
+
/** Animation duration in seconds (default 1) */
|
|
1059
|
+
duration?: number | string;
|
|
1060
|
+
/** Spinner border thickness in px (default 3) */
|
|
1061
|
+
thickness?: number;
|
|
1062
|
+
/** Optional loading text */
|
|
1063
|
+
text?: string;
|
|
1064
|
+
/** Inline style object */
|
|
1065
|
+
style?: Record<string, any>;
|
|
1066
|
+
}
|
|
1067
|
+
interface ProgressSegment {
|
|
1068
|
+
/** Numeric contribution of this segment */
|
|
1069
|
+
value: number;
|
|
1070
|
+
/** Optional legend text */
|
|
1071
|
+
label?: string;
|
|
1072
|
+
/** Segment color; falls back to ProgressProps.color */
|
|
1073
|
+
color?: string;
|
|
1074
|
+
}
|
|
1075
|
+
interface ProgressProps {
|
|
1076
|
+
/** Single progress value (default 0); ignored when segments is non-empty */
|
|
1077
|
+
value?: number;
|
|
1078
|
+
/** Maximum value; defaults to 100 in single mode or the segment total */
|
|
1079
|
+
max?: number;
|
|
1080
|
+
/** Segmented progress data; a non-empty array selects segmented mode */
|
|
1081
|
+
segments?: ProgressSegment[];
|
|
1082
|
+
/** Track height (number → px, or CSS string; default 8) */
|
|
1083
|
+
height?: number | string;
|
|
1084
|
+
/** Gap between colored segments (number → px, or CSS string; default 0) */
|
|
1085
|
+
gap?: number | string;
|
|
1086
|
+
/** Default fill and fallback segment color (default '#1677ff') */
|
|
1087
|
+
color?: string;
|
|
1088
|
+
/** Unfilled track color (default '#f0f0f0') */
|
|
1089
|
+
inactiveColor?: string;
|
|
1090
|
+
/** Show labels for labeled segments (default false) */
|
|
1091
|
+
showLegend?: boolean;
|
|
1092
|
+
/** Legend placement relative to the track (default 'bottom') */
|
|
1093
|
+
legendPosition?: 'top' | 'bottom';
|
|
1094
|
+
/** Outer wrapper inline style */
|
|
1095
|
+
style?: Record<string, any>;
|
|
1096
|
+
/** Track inline style */
|
|
1097
|
+
trackStyle?: Record<string, any>;
|
|
1098
|
+
/** Legend container inline style */
|
|
1099
|
+
legendStyle?: Record<string, any>;
|
|
1100
|
+
}
|
|
1101
|
+
interface StepIcon {
|
|
1102
|
+
/** URL to icon image */
|
|
1103
|
+
src?: string;
|
|
1104
|
+
/** Built-in name or emoji text */
|
|
1105
|
+
name?: string;
|
|
1106
|
+
/** Icon color (for emoji/SVG) */
|
|
1107
|
+
color?: string;
|
|
1108
|
+
/** Background color */
|
|
1109
|
+
bgColor?: string;
|
|
1110
|
+
/** Override global iconSize for this step */
|
|
1111
|
+
size?: number;
|
|
1112
|
+
}
|
|
1113
|
+
interface StepItem {
|
|
1114
|
+
/** Step title (required) */
|
|
1115
|
+
title: string;
|
|
1116
|
+
/** Optional description text */
|
|
1117
|
+
description?: string;
|
|
1118
|
+
/** Step status (default 'pending') */
|
|
1119
|
+
status?: 'pending' | 'processing' | 'completed' | 'failed';
|
|
1120
|
+
/** Whether this step is clickable (triggers onStepClick event) */
|
|
1121
|
+
clickable?: boolean;
|
|
1122
|
+
/** Custom event name — used to distinguish different steps in onStepClick */
|
|
1123
|
+
event?: string;
|
|
1124
|
+
/** Custom icon — overrides status default */
|
|
1125
|
+
icon?: StepIcon;
|
|
1126
|
+
}
|
|
1127
|
+
interface ConnectorConfig {
|
|
1128
|
+
/** Line width in px (default 2) */
|
|
1129
|
+
width?: number;
|
|
1130
|
+
/** Minimum line height in px (default 24) */
|
|
1131
|
+
minHeight?: number;
|
|
1132
|
+
/** Line style (default 'solid') */
|
|
1133
|
+
style?: 'solid' | 'dashed' | 'dotted';
|
|
1134
|
+
/** Default line color (default '#e8e8e8') */
|
|
1135
|
+
color?: string;
|
|
1136
|
+
/** Line color for completed steps (default '#52c41a') */
|
|
1137
|
+
completedColor?: string;
|
|
1138
|
+
/** Custom image URL for the connector (replaces color line) */
|
|
1139
|
+
src?: string;
|
|
1140
|
+
}
|
|
1141
|
+
interface StepsProps {
|
|
1142
|
+
/** Step items list */
|
|
1143
|
+
items?: StepItem[];
|
|
1144
|
+
/** Global icon size in px (default 28) */
|
|
1145
|
+
iconSize?: number;
|
|
1146
|
+
/** Title text style overrides */
|
|
1147
|
+
titleProps?: {
|
|
1148
|
+
fontSize?: string;
|
|
1149
|
+
fontWeight?: string | number;
|
|
1150
|
+
color?: string;
|
|
1151
|
+
};
|
|
1152
|
+
/** Description text style overrides */
|
|
1153
|
+
descriptionProps?: {
|
|
1154
|
+
fontSize?: string;
|
|
1155
|
+
color?: string;
|
|
1156
|
+
};
|
|
1157
|
+
/** Connector line configuration */
|
|
1158
|
+
connector?: ConnectorConfig;
|
|
1159
|
+
/** Inline style object */
|
|
1160
|
+
style?: Record<string, any>;
|
|
1161
|
+
}
|
|
1162
|
+
interface HtmlProps {
|
|
1163
|
+
/**
|
|
1164
|
+
* HTML fragment emitted by the model (semantic tags only — content is
|
|
1165
|
+
* allow-list sanitized before rendering; script/style/iframe/on* never
|
|
1166
|
+
* reach the DOM).
|
|
1167
|
+
*/
|
|
1168
|
+
content?: string;
|
|
1169
|
+
/** Max height (e.g. '480px' or 480) — overflow scrolls inside the card */
|
|
1170
|
+
maxHeight?: string | number;
|
|
1171
|
+
/** Wrapper inline style (fontSize/color act as typography baseline) */
|
|
1172
|
+
style?: Record<string, any>;
|
|
1173
|
+
}
|
|
1174
|
+
interface CollapseProps {
|
|
1175
|
+
/** Header title text (always visible) */
|
|
1176
|
+
title?: string;
|
|
1177
|
+
/** Body content (shown when expanded) */
|
|
1178
|
+
content?: string;
|
|
1179
|
+
/** Whether expanded by default (default false) */
|
|
1180
|
+
defaultExpanded?: boolean;
|
|
1181
|
+
/** Header icon (emoji or text, default '💭') */
|
|
1182
|
+
icon?: string;
|
|
1183
|
+
/** Enable Markdown rendering for body content */
|
|
1184
|
+
markdown?: boolean;
|
|
1185
|
+
/** Custom arrow icon URL (replaces built-in SVG chevron) */
|
|
1186
|
+
arrowIcon?: string;
|
|
1187
|
+
/** Wrapper inline style */
|
|
1188
|
+
style?: Record<string, any>;
|
|
1189
|
+
/** Header inline style */
|
|
1190
|
+
headerStyle?: Record<string, any>;
|
|
1191
|
+
/** Content area inline style */
|
|
1192
|
+
contentStyle?: Record<string, any>;
|
|
1193
|
+
/** Body container inline style (for layout breakout, negative margins, etc.) */
|
|
1194
|
+
bodyStyle?: Record<string, any>;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
/** Display-only horizontal progress indicator. */
|
|
1198
|
+
declare class CardProgress extends BaseElement {
|
|
1199
|
+
static readonly is = "ai-card-progress";
|
|
1200
|
+
protected render(): void;
|
|
1201
|
+
private buildLegend;
|
|
1202
|
+
private applyInlineStyle;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
/**
|
|
1206
|
+
* CardSteps — Custom Element for rendering a vertical progress/step list.
|
|
1207
|
+
*
|
|
1208
|
+
* Each step shows a status icon (built-in or custom) with a title,
|
|
1209
|
+
* optional description, and a connector line between steps.
|
|
1210
|
+
*
|
|
1211
|
+
* Schema example:
|
|
1212
|
+
* ```json
|
|
1213
|
+
* {
|
|
1214
|
+
* "type": "Steps",
|
|
1215
|
+
* "props": {
|
|
1216
|
+
* "items": [
|
|
1217
|
+
* { "title": "Document upload", "status": "completed" },
|
|
1218
|
+
* { "title": "Verifying document", "status": "processing", "description": "Usually takes 1-2 min" },
|
|
1219
|
+
* { "title": "Final review", "status": "pending" }
|
|
1220
|
+
* ],
|
|
1221
|
+
* "iconSize": 28,
|
|
1222
|
+
* "titleProps": { "fontSize": "14px", "fontWeight": 500, "color": "#1a1a1a" },
|
|
1223
|
+
* "descriptionProps": { "fontSize": "12px", "color": "#8c8c8c" },
|
|
1224
|
+
* "connector": { "width": 2, "minHeight": 24, "style": "solid", "color": "#e8e8e8", "completedColor": "#52c41a" }
|
|
1225
|
+
* }
|
|
1226
|
+
* }
|
|
1227
|
+
* ```
|
|
1228
|
+
*
|
|
1229
|
+
* Custom icon per step (overrides status default):
|
|
1230
|
+
* ```json
|
|
1231
|
+
* { "title": "Payment", "status": "completed", "icon": { "src": "https://cdn/pay.svg" } }
|
|
1232
|
+
* { "title": "Shipped", "status": "processing", "icon": { "name": "🚚" } }
|
|
1233
|
+
* ```
|
|
1234
|
+
*
|
|
1235
|
+
* Step click event (uses standard schema events, same as Button onClick):
|
|
1236
|
+
* ```json
|
|
1237
|
+
* {
|
|
1238
|
+
* "type": "Steps",
|
|
1239
|
+
* "props": {
|
|
1240
|
+
* "items": [
|
|
1241
|
+
* { "title": "Approval detail", "status": "completed", "clickable": true, "event": "openApproval" },
|
|
1242
|
+
* { "title": "Retry submit", "status": "failed", "clickable": true, "event": "retrySubmit" },
|
|
1243
|
+
* { "title": "Pending", "status": "pending" }
|
|
1244
|
+
* ]
|
|
1245
|
+
* },
|
|
1246
|
+
* "events": {
|
|
1247
|
+
* "onStepClick": [{ "type": "emit", "params": { "event": "${_event.item.event}", "payload": "${_event.item}" } }]
|
|
1248
|
+
* }
|
|
1249
|
+
* }
|
|
1250
|
+
* ```
|
|
1251
|
+
*/
|
|
1252
|
+
|
|
1253
|
+
declare class CardSteps extends BaseElement {
|
|
1254
|
+
static readonly is = "ai-card-steps";
|
|
1255
|
+
protected render(): void;
|
|
1256
|
+
/**
|
|
1257
|
+
* Render icon HTML for a step.
|
|
1258
|
+
* Priority: custom icon.src > custom icon.name > status default.
|
|
1259
|
+
*/
|
|
1260
|
+
private renderIcon;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* CardCollapse — Expandable/Collapsible panel component.
|
|
1265
|
+
*
|
|
1266
|
+
* Designed for AI "thinking" scenarios: a clickable header bar
|
|
1267
|
+
* that toggles the visibility of a detail content section.
|
|
1268
|
+
*
|
|
1269
|
+
* Uses Shadow DOM for style encapsulation.
|
|
1270
|
+
* Registered as `<ai-card-collapse>`.
|
|
1271
|
+
*/
|
|
1272
|
+
|
|
1273
|
+
declare class CardCollapse extends BaseElement {
|
|
1274
|
+
static readonly is = "ai-card-collapse";
|
|
1275
|
+
private _expanded;
|
|
1276
|
+
protected render(): void;
|
|
1277
|
+
private _toggle;
|
|
1278
|
+
private _parseMarkdown;
|
|
1279
|
+
private _escapeHTML;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
/**
|
|
1283
|
+
* CardHtml — Custom Element for rendering model-emitted HTML fragments.
|
|
1284
|
+
*
|
|
1285
|
+
* The LLM outputs HTML (h1-h6/p/ul/table/strong/... plus inline styles) as
|
|
1286
|
+
* `props.content`; this component renders it inside Shadow DOM **as-is**:
|
|
1287
|
+
* content owns its presentation (browser semantic defaults + the model's
|
|
1288
|
+
* inline `style` attributes). The component adds no typography of its own —
|
|
1289
|
+
* only functional styles (container sizing, image containment, maxHeight
|
|
1290
|
+
* scrolling, disabled passthrough). Shadow DOM keeps author styles of the
|
|
1291
|
+
* host page out while inherited font/color still flow in.
|
|
1292
|
+
*
|
|
1293
|
+
* Security: content is ALWAYS passed through `sanitizeHtml` before touching
|
|
1294
|
+
* innerHTML. Sanitization is tag/attribute allow-listed:
|
|
1295
|
+
* - non-allow-listed elements are removed WHOLE (script/style-tag/iframe/svg/…)
|
|
1296
|
+
* - all `on*` handlers and non-http(s) URLs are stripped
|
|
1297
|
+
* - inline `style` attributes render as-authored, minus layout-escape
|
|
1298
|
+
* declarations (position / z-index)
|
|
1299
|
+
* - links are forced to `target="_blank" rel="noopener noreferrer"`
|
|
1300
|
+
* Prompt-injected `<img onerror=...>` / `<script>` therefore never execute.
|
|
1301
|
+
*
|
|
1302
|
+
* Registered as `<ai-card-html>`. Created internally by the component
|
|
1303
|
+
* renderer; end-users interact via `renderCard()` / `renderStreamingCard()`.
|
|
1304
|
+
*/
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* Trim a trailing incomplete tag from streaming HTML (`<div`, `</p`, `<!--`
|
|
1308
|
+
* cut mid-way by a chunk boundary). The fragment renders cleanly this frame
|
|
1309
|
+
* and the tag completes on the next one. Textual `<` (e.g. "a < b") is left
|
|
1310
|
+
* alone — only `<` followed by a letter, `/` or `!` (or stream-edge `<`)
|
|
1311
|
+
* counts as a tag opener, matching HTML5 tokenizer rules.
|
|
1312
|
+
*/
|
|
1313
|
+
declare function trimIncompleteTag(html: string): string;
|
|
1314
|
+
/**
|
|
1315
|
+
* Allow-list sanitize an HTML fragment. Returns markup safe for innerHTML.
|
|
1316
|
+
*
|
|
1317
|
+
* Removal is whole-node for disallowed elements (their text is NOT kept —
|
|
1318
|
+
* a `<script>`'s body must never surface), attributes are stripped down to
|
|
1319
|
+
* the per-tag allow-list, and anchors get hardened targets.
|
|
1320
|
+
*/
|
|
1321
|
+
declare function sanitizeHtml(html: string): string;
|
|
1322
|
+
declare class CardHtml extends BaseElement {
|
|
1323
|
+
static readonly is = "ai-card-html";
|
|
1324
|
+
protected render(): void;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
/**
|
|
1328
|
+
* Component Renderer Registry — maps schema `type` to render functions.
|
|
1329
|
+
*
|
|
1330
|
+
* Each renderer creates a Custom Element (extending BaseElement) with
|
|
1331
|
+
* Shadow DOM for style encapsulation, then returns it as an HTMLElement
|
|
1332
|
+
* for the `renderCard` pipeline to attach events and children.
|
|
1333
|
+
*/
|
|
1334
|
+
|
|
1335
|
+
type ComponentRenderer = (node: RenderTreeNode, props: Record<string, any>, isMobile: boolean) => HTMLElement;
|
|
1336
|
+
declare const componentRenderers: Record<string, ComponentRenderer>;
|
|
1337
|
+
/**
|
|
1338
|
+
* Register a custom component renderer.
|
|
1339
|
+
* Use this to extend the SDK with your own component types.
|
|
1340
|
+
*
|
|
1341
|
+
* @example
|
|
1342
|
+
* ```ts
|
|
1343
|
+
* registerComponent('MyWidget', (node, props, isMobile) => {
|
|
1344
|
+
* const el = document.createElement('div');
|
|
1345
|
+
* // ... build your element
|
|
1346
|
+
* return el;
|
|
1347
|
+
* });
|
|
1348
|
+
* ```
|
|
1349
|
+
*/
|
|
1350
|
+
declare function registerComponent(type: string, renderer: ComponentRenderer): void;
|
|
1351
|
+
|
|
1352
|
+
export { BaseElement, BotSDK, CardButton, CardCollapse, CardDivider, CardForm, CardHtml, CardIcon, CardImage, CardInput, CardLoading, CardPasscodeInput, CardProgress, CardRate, CardSelect, CardSteps, CardTag, CardText, LocalActionConfigProvider, RemoteActionConfigProvider, buildStyleString, componentRenderers, connectSSE, connectStreaming, createWebActionContext, isMobileViewport, onViewportChange, pxToRem, pxToVw, registerComponent, renderCard, renderStreamingCard, resolveSize, sanitizeHtml, trimIncompleteTag };
|
|
1353
|
+
export type { A2UIActionPayload, BotSDKOptions, ButtonProps, CardInstance, CollapseProps, ComponentRenderer, ConnectorConfig, DividerProps, FormField, FormProps, HtmlProps, IconProps, ImageProps, InputProps, LoadingProps, PartialFinalizeResult, PasscodeInputProps, ProgressProps, ProgressSegment, RateProps, RenderCardOptions, SSEConnectOptions, SelectOption, SelectProps, StepIcon, StepItem, StepsProps, StreamingCardInstance, StreamingCardOptions, StreamingConnectOptions, StreamingConnection, TagProps, TextProps, WebActionContextOptions };
|