Releases: arnavv-guptaa/chat-widget
Releases · arnavv-guptaa/chat-widget
Release list
v0.13.1
What's Changed
- fix(ui): keep planning loader position stable by @arnavv-guptaa in #223
Full Changelog: v0.13.0...v0.13.1
v0.12.0
Breaking
- Theming API is now exactly three required colors —
theme.modeis removed.ThemeConfigis{ backgroundColor, textColor, primaryColor }, all required hex; omitthemefor the stock palette. Invalid or partial themes are ignored whole (never half-applied). The luminance auto-contrast flip is gone: the widget renders declared colors faithfully and derives every neutral (surfaces, borders, muted/subtle text, placeholder) from one background→text ramp. Internally, background lightness only selects the syntax-highlight palette and shadow strength (.chat-dark, not part of the public API). Assistant links now use--chat-primaryinstead of a hardcoded blue. - Removed the legacy
useChatThemehook and its exports (plus the unusedAppearanceSettings/WidgetSettingscomponents). It duplicated the theming system and wrote CSS variables onto the host page'sdocumentElement, leaking outside the widget scope. aipeer dependency is now explicitly pinned to^6(#181). The widget externalizes the AI SDK so your app's single instance is used; a v5aiinstall must be upgraded.- Reminder from 0.11.0 (already live, listed for upgraders skipping versions):
@ai-sdk/reactis a required peer —npm i @ai-sdk/react— and the legacy/db+/apistore functions require a server-verifieduserId(the IDOR fix).
Fixed
- Strict-ESM consumer crash (
ERR_UNSUPPORTED_DIR_IMPORT) is gone:react-syntax-highlighterand its directory-path Prism theme imports were removed entirely (#177). Next.js RSC / Vite / Turbopack consumers no longer need workarounds — if you added a webpack alias shim forreact-syntax-highlighter/dist/esm/styles/prism, delete it after upgrading. undicimoved to runtimedependencies— the SSRF-safe ingestion loader no longer depends on a hoisting accident (#178).ActionResultCardlinkhrefs are sanitized through thesafeUrlallowlist (#179).- Radix portals and the floating launcher render inside the widget's CSS scope, fixing style bleed/mis-theming when embedded in host apps with aggressive global styles (#180).
- Internal:
@supabase/supabase-jsrestored as a devDependency so the d.ts build compiles standalone (#182).
Added
THEME_PRESETSexport — canonical named three-color presets (Light, Dark, Midnight, Cream, Forest, Ocean) for the playground preset picker; the widget package is the single source of truth.- Syntax highlighting in chat (#197): fenced code in assistant messages and tool-call code render through a lazy, ESM-clean Shiki pipeline — highlighted on expand, streaming-safe, theme-token-driven (
--shiki-light/-darkmapped to the widget's light/dark scope), always degrading to plain text on any failure. Tool output is language-detected (JSON vs text) instead of force-labeled JSON. - Open triggers (#198):
display.keyboardShortcut(e.g."mod+i"— recommended docs convention next to Cmd+K search),data-mordn-chat-open|toggle|closeattributes on any element, and adocumentCustomEvent API (mordn-chat:open|close|toggle). All routes honor the existingallowAutoReopengate and controlled-mode semantics. - Docs-aware ingestion (#207): markdown-first HTML extraction, heading-aware chunking that never splits code fences (breadcrumb context, GitHub-style anchors), deep-link citations (
url#anchor),llms.txtsources + auto-discovery onsitemap/crawl(preferLlmsTxt), CLIingest --llms, and publicchunkMarkdown/htmlToMarkdownexports. New ingest options:docsMode(defaulttrue),preferLlmsTxt(defaulttrue). - Script-tag embed (#212): self-contained
dist/embed.global.js(React bundled, scoped CSS inlined at build) withwindow.MordnChat.init/open/close/toggle/destroy, declarativedata-*auto-init, and anonymous persistent user IDs — the widget now works on MkDocs/Sphinx/Hugo/plain-HTML sites. - Server hardening (#184–#186): real request body-size cap via
maxRequestBytes(default 1 MB — oversized bodies now get413), opt-instreamTimeoutMs, memory consent checks fail closed, attachment blobs purged on conversation delete, SSRF guard on MCP server URLs (private/metadata hosts blocked by default;allowPrivateHoststo opt out), and 30s default timeouts on all hosted HTTP clients (timeoutMsper client,0disables).
Behavior changes to be aware of
- New ingests chunk docs-aware by default (
docsMode: true) — existing stored chunks are untouched until a re-ingest;contentHashwill see changed chunk text and re-embed on the next sync. sitemap/crawlingestion prefers a site'sllms.txtwhen one exists (preferLlmsTxt: falserestores old behavior).- Requests larger than 1 MB are rejected with
413unless you raisemaxRequestBytes(#184). - MCP servers on private/internal hosts are blocked unless
allowPrivateHosts: true(#185).
Internal
- CI PR gates: typecheck, build, strict-ESM import check, and a real Next App-Router consumer smoke build (#183). First behavior tests: vitest harness with handler IDOR/identity-boundary, SSRF net-guard, and URL-safety suites (#187).
- Neutral color tokens consolidated 14 → 10:
--chat-surface-deep/--chat-mutedfold into--chat-surface,--chat-surface-hoverinto--chat-hover-bg(now the 0.10 ramp stop, so hover feedback is visible),--chat-dividerinto--chat-border;--chat-text-mutedmoves 0.64 → 0.75 (icons/secondary text sit closer to the text color). All tokens are uniform HSL triplets now. These are internal names (the public theming API is unchanged), but anyone overriding--chat-*vars directly should re-check their overrides. The composer pill is a single fill (transparent textarea/form) — the old two-zone tint split is gone. - Ad-hoc
hsl(var(--chat-text) / α)blends replaced with their ramp-token equivalents, so emphasis/hover colors can't drift between code paths.