diff --git a/apps/website/content/docs/chat/getting-started/installation.mdx b/apps/website/content/docs/chat/getting-started/installation.mdx index e5cdc0fb6..6221c3839 100644 --- a/apps/website/content/docs/chat/getting-started/installation.mdx +++ b/apps/website/content/docs/chat/getting-started/installation.mdx @@ -16,10 +16,10 @@ Required for the build toolchain and package installation. ## Install the package ```bash -npm install @ngaf/chat +npm install @ngaf/chat marked ``` -That's it. The chat components ship with their own design tokens and component-encapsulated styles. **No PostCSS config, no global stylesheet import, no Tailwind required.** +`marked` is required for parsing assistant markdown. Beyond that: the chat components ship with their own design tokens and component-encapsulated styles. **No PostCSS config, no global stylesheet import, no Tailwind required.** ## Peer Dependencies @@ -35,10 +35,10 @@ That's it. The chat components ship with their own design tokens and component-e | `@ngaf/partial-json` | `^0.0.1` | Yes | | `@json-render/core` | `^0.16.0` | Yes | | `@langchain/core` | `^1.1.33` | Yes | -| `marked` | `^15.0.0 \|\| ^16.0.0` | Optional | +| `marked` | `^15.0.0 \|\| ^16.0.0` | Yes | - -The `marked` package is optional. When installed, AI messages render as full markdown (headings, code blocks, tables, lists). Without it, the library falls back to plain text with `
` newline conversion. + +`marked` parses AI message content into HTML (headings, code blocks, tables, lists). It is a required peer; the library ships a defensive plain-text fallback for resilience, but the rendered output is unusable without `marked` installed. ## Configure provideChat() (optional) diff --git a/apps/website/content/docs/chat/getting-started/quickstart.mdx b/apps/website/content/docs/chat/getting-started/quickstart.mdx index 8932a4805..03519b69d 100644 --- a/apps/website/content/docs/chat/getting-started/quickstart.mdx +++ b/apps/website/content/docs/chat/getting-started/quickstart.mdx @@ -10,9 +10,11 @@ Angular 20+ project with an agent provider configured. See [Agent Installation]( ```bash -npm install @ngaf/chat +npm install @ngaf/chat marked ``` +`marked` is the markdown renderer used for assistant messages. + diff --git a/libs/chat/package.json b/libs/chat/package.json index 4a39e2f34..28507f890 100644 --- a/libs/chat/package.json +++ b/libs/chat/package.json @@ -1,6 +1,6 @@ { "name": "@ngaf/chat", - "version": "0.0.3", + "version": "0.0.4", "exports": { ".": { "types": "./index.d.ts", @@ -26,11 +26,6 @@ "rxjs": "~7.8.0", "marked": "^15.0.0 || ^16.0.0" }, - "peerDependenciesMeta": { - "marked": { - "optional": true - } - }, "license": "MIT", "repository": { "type": "git", diff --git a/libs/chat/src/lib/compositions/chat/chat.component.ts b/libs/chat/src/lib/compositions/chat/chat.component.ts index de94d7372..068180f65 100644 --- a/libs/chat/src/lib/compositions/chat/chat.component.ts +++ b/libs/chat/src/lib/compositions/chat/chat.component.ts @@ -63,7 +63,12 @@ import type { ChatRenderEvent } from './chat-render-event'; padding: 60px 20px; color: var(--ngaf-chat-text-muted); text-align: center; + flex: 1; + min-height: 0; } + .chat-empty[hidden] { display: none; } + .chat-empty__title { font-size: 1.125rem; font-weight: 500; color: var(--ngaf-chat-text); margin: 0; } + .chat-empty__sub { margin: 0; font-size: var(--ngaf-chat-font-size-sm); } .chat-empty__title { font-size: 1.125rem; font-weight: 500; color: var(--ngaf-chat-text); margin: 0; } .chat-empty__sub { margin: 0; font-size: var(--ngaf-chat-font-size-sm); } .chat-scroll { flex: 1; min-height: 0; overflow-y: auto; } @@ -85,11 +90,12 @@ import type { ChatRenderEvent } from './chat-render-event';
- @if (agent().messages().length === 0 && !agent().isLoading()) { -
- -
- } +
+ +

How can I help?

+

Ask anything to get started.

+
+
diff --git a/libs/chat/src/lib/primitives/chat-input/chat-input.component.ts b/libs/chat/src/lib/primitives/chat-input/chat-input.component.ts index 4fa9d6dfe..a1e2e7539 100644 --- a/libs/chat/src/lib/primitives/chat-input/chat-input.component.ts +++ b/libs/chat/src/lib/primitives/chat-input/chat-input.component.ts @@ -44,7 +44,8 @@ export function submitMessage(