@waniwani/sdk 0.11.27 → 0.12.1
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 +13 -0
- package/dist/chat/embed.js +66 -66
- package/dist/chat/embed.js.map +1 -1
- package/dist/chat/index.d.ts +63 -7
- package/dist/chat/index.js +7 -7
- package/dist/chat/index.js.map +1 -1
- package/dist/chat/styles.css +1 -1
- package/dist/index.d.ts +46 -69
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy/index.d.ts +40 -2
- package/dist/legacy/index.js +13 -13
- package/dist/legacy/index.js.map +1 -1
- package/dist/mcp/index.js +5 -5
- package/dist/mcp/index.js.map +1 -1
- package/package.json +1 -1
package/dist/legacy/index.d.ts
CHANGED
|
@@ -1123,6 +1123,29 @@ interface NextJsHandlerResult {
|
|
|
1123
1123
|
*/
|
|
1124
1124
|
declare function toNextJsHandler(client: WaniWaniClient, options: NextJsHandlerOptions): NextJsHandlerResult;
|
|
1125
1125
|
|
|
1126
|
+
/**
|
|
1127
|
+
* Built-in theme presets. `auto` follows the host's `prefers-color-scheme`
|
|
1128
|
+
* and switches at runtime without re-rendering.
|
|
1129
|
+
*/
|
|
1130
|
+
type ThemePreset = "light" | "dark" | "auto";
|
|
1131
|
+
/**
|
|
1132
|
+
* Appearance config for the chat widget. Pick a preset and (optionally) layer
|
|
1133
|
+
* per-property `variables` on top.
|
|
1134
|
+
*
|
|
1135
|
+
* ```ts
|
|
1136
|
+
* appearance: { theme: "dark", variables: { primaryColor: "#ff6b6b" } }
|
|
1137
|
+
* ```
|
|
1138
|
+
*
|
|
1139
|
+
* The same shape is accepted by the `embed.js` script (`init({ appearance })`),
|
|
1140
|
+
* `<WaniwaniChat overrides={{ appearance }} />`, and `<ChatEmbed appearance />`.
|
|
1141
|
+
*/
|
|
1142
|
+
interface ChatAppearance {
|
|
1143
|
+
/** Base theme preset. Defaults to `"light"`. */
|
|
1144
|
+
theme?: ThemePreset;
|
|
1145
|
+
/** Per-property overrides applied on top of the preset. */
|
|
1146
|
+
variables?: ChatTheme;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1126
1149
|
interface ChatTheme {
|
|
1127
1150
|
/** Primary brand color (bubble, send button, user messages) */
|
|
1128
1151
|
primaryColor?: string;
|
|
@@ -1136,6 +1159,10 @@ interface ChatTheme {
|
|
|
1136
1159
|
mutedColor?: string;
|
|
1137
1160
|
/** Border color */
|
|
1138
1161
|
borderColor?: string;
|
|
1162
|
+
/** Border width for the panel (px). Defaults to 0 (no border). */
|
|
1163
|
+
borderWidth?: number;
|
|
1164
|
+
/** Box-shadow shorthand applied to the panel. Use any valid CSS box-shadow string (e.g. `"0 10px 25px rgba(0,0,0,0.1)"`). Defaults to `none`. */
|
|
1165
|
+
boxShadow?: string;
|
|
1139
1166
|
/** Assistant message bubble background */
|
|
1140
1167
|
assistantBubbleColor?: string;
|
|
1141
1168
|
/** User message bubble background */
|
|
@@ -1195,8 +1222,11 @@ interface ChatBaseProps {
|
|
|
1195
1222
|
* Takes precedence over `welcomeMessage` when provided.
|
|
1196
1223
|
*/
|
|
1197
1224
|
welcome?: WelcomeConfig;
|
|
1198
|
-
/**
|
|
1199
|
-
|
|
1225
|
+
/**
|
|
1226
|
+
* Theme preset (`light`/`dark`/`auto`) plus per-property overrides.
|
|
1227
|
+
* See `ChatAppearance` for the shape.
|
|
1228
|
+
*/
|
|
1229
|
+
appearance?: ChatAppearance;
|
|
1200
1230
|
/** Additional headers to send with chat API requests */
|
|
1201
1231
|
headers?: Record<string, string>;
|
|
1202
1232
|
/** Additional body fields to send with each chat request */
|
|
@@ -1260,6 +1290,12 @@ interface ChatBaseProps {
|
|
|
1260
1290
|
activeThreadId?: string;
|
|
1261
1291
|
/** Fired whenever the active thread changes (new chat, switch, delete). */
|
|
1262
1292
|
onThreadChange?: (threadId: string) => void;
|
|
1293
|
+
/**
|
|
1294
|
+
* AI transparency notice rendered under the input (EU AI Act compliance).
|
|
1295
|
+
* Defaults to `"AI can make mistakes. Verify important information."`.
|
|
1296
|
+
* Pass a string to override the wording, or `false` to hide it entirely.
|
|
1297
|
+
*/
|
|
1298
|
+
disclaimer?: string | false;
|
|
1263
1299
|
}
|
|
1264
1300
|
/** Handler signature for MCP tool calls from widgets. */
|
|
1265
1301
|
type CallToolHandler = (params: {
|
|
@@ -1303,6 +1339,8 @@ interface ChatCardProps extends ChatBaseProps {
|
|
|
1303
1339
|
height?: number | string;
|
|
1304
1340
|
/** Additional class names applied to the root element (e.g. Tailwind classes). */
|
|
1305
1341
|
className?: string;
|
|
1342
|
+
/** Theme overrides. Legacy API; new code should use the `appearance` field on `WaniwaniChat` / `ChatEmbed`. */
|
|
1343
|
+
theme?: ChatTheme;
|
|
1306
1344
|
}
|
|
1307
1345
|
/**
|
|
1308
1346
|
* @deprecated Use `WaniwaniChat` from `@waniwani/sdk/chat` for new code.
|