@waniwani/sdk 0.16.0 → 0.17.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.
@@ -357,6 +357,13 @@ interface ChatAppearance {
357
357
  theme?: ThemePreset;
358
358
  /** Per-property overrides applied on top of the preset. */
359
359
  variables?: ChatTheme;
360
+ /**
361
+ * Render assistant messages inside a filled bubble (background + padding +
362
+ * radius), styled by `variables.assistantBubbleColor` /
363
+ * `assistantBubbleTextColor`. Defaults to `false` — assistant messages
364
+ * render as plain text. Opt in for a "both sides bubbled" chat style.
365
+ */
366
+ assistantBubble?: boolean;
360
367
  }
361
368
  /**
362
369
  * Tool-call activity rendering mode. Steps are grouped into one collapsible
@@ -406,6 +413,20 @@ interface ChatTheme {
406
413
  statusColor?: string;
407
414
  /** Tool call JSON section background. Defaults to light gray / #262626 in dark. */
408
415
  toolCardColor?: string;
416
+ /** Text color inside the user message bubble. Falls back to `primaryForeground`. */
417
+ userBubbleTextColor?: string;
418
+ /** Text color inside the assistant message bubble (only visible when `appearance.assistantBubble` is enabled). Falls back to `textColor`. */
419
+ assistantBubbleTextColor?: string;
420
+ /** Horizontal padding inside message bubbles (px). Defaults to 16. */
421
+ messagePaddingX?: number;
422
+ /** Vertical padding inside message bubbles (px). Defaults to 12. */
423
+ messagePaddingY?: number;
424
+ /** Max width of a message bubble as a CSS length/percentage. Defaults to `"80%"`. */
425
+ messageMaxWidth?: string;
426
+ /** Base font size for message text (px). When unset, messages use the CSS default of `1rem` (16px at the standard root font size). */
427
+ fontSize?: number;
428
+ /** Base line height for message text (unitless string, e.g. `"1.5"`). Defaults to `"1.5"`. */
429
+ lineHeight?: string;
409
430
  }
410
431
  interface WelcomeConfig {
411
432
  /** Icon displayed above the title. Accepts any React node (e.g. an SVG or img). */
@@ -429,6 +450,27 @@ interface SuggestionsConfig {
429
450
  */
430
451
  dynamic?: boolean;
431
452
  }
453
+ /**
454
+ * Per-slot class name overrides for the chat widget. Each string is appended
455
+ * to the slot's own classes (merged with `tailwind-merge`, `ww` prefix). Use
456
+ * with your own (prefixed or plain) CSS to restyle any element. In the React
457
+ * path these reach into internals directly; in the `<script>` embed, prefer
458
+ * the stable `.ww-*` semantic classes with a `data-css` stylesheet.
459
+ */
460
+ interface ChatClassNames {
461
+ /** Root chat container. */
462
+ root?: string;
463
+ /** Sticky header bar. */
464
+ header?: string;
465
+ /** Every message wrapper (both roles). */
466
+ message?: string;
467
+ /** The user message bubble content. */
468
+ userBubble?: string;
469
+ /** The assistant message bubble content. */
470
+ assistantBubble?: string;
471
+ /** The input bar container. */
472
+ input?: string;
473
+ }
432
474
  interface ChatBaseProps {
433
475
  /** Waniwani project API key */
434
476
  apiKey?: string;
@@ -450,6 +492,8 @@ interface ChatBaseProps {
450
492
  * See `ChatAppearance` for the shape.
451
493
  */
452
494
  appearance?: ChatAppearance;
495
+ /** Per-slot class name overrides. See {@link ChatClassNames}. */
496
+ classNames?: ChatClassNames;
453
497
  /** Additional headers to send with chat API requests */
454
498
  headers?: Record<string, string>;
455
499
  /** Additional body fields to send with each chat request */
@@ -826,6 +870,8 @@ interface WaniwaniChatOverrides {
826
870
  * ```
827
871
  */
828
872
  appearance?: ChatAppearance;
873
+ /** Per-slot class name overrides. See `ChatClassNames`. */
874
+ classNames?: ChatClassNames;
829
875
  /** Chat API URL. Defaults to `https://app.waniwani.ai/api/mcp/chat`. */
830
876
  api?: string;
831
877
  /** Override the MCP server URL (rarely needed). */