<!-- GENERATED by scripts/build-llms.mjs from llms/conversation.md — do not edit this file. -->

# `lr-streaming-text-core`

- **Import** `import '@aceshooting/lyra-ui/components/lr-streaming-text-core.js';` (stable tag alias; registers the tag)
- **Class** `LyraStreamingTextCore`, also available unregistered from `@aceshooting/lyra-ui/components/conversation/streaming-text/streaming-text-core.class.js`
- **Family** `components/conversation/` — see `llms/index.md` for its siblings
- **Status** `experimental` since `16.0.0` — see the maturity and deprecation policy in `llms/shared.md`
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [llms-full.txt](../../llms-full.txt)
- **Deprecations** none
- **Optional peers** `dompurify`, `katex`, `marked`, `shiki` — see `llms/peers.md`
- **Themeable via** 13 parts, 2 custom properties — see this component's own `@csspart`/`@cssprop` list below
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`

---

## `lr-streaming-text-core`

A build-lean `<lr-streaming-text>` variant for a consumer whose fenced-code `languages` map already
covers every language it will ever stream, or who never renders fenced code at all. Every
capability — token coalescing, `contentMode` auto-detection, the blinking cursor, the
`lr-content-settled` event, the `languages` property, and the full forwarded Markdown configuration
surface (`tabSize`, `htmlMode`, `gfm`, `linkTarget`, `internalLinkPrefix`, `headingOffset`,
`highlightCode`, `headingAnchors`, `math`, `maxHeight`) — is identical to `<lr-streaming-text>`;
only which Markdown element Markdown mode composes differs: this variant renders
`<lr-markdown-core>` (`../markdown/markdown-core.js`) instead of `<lr-markdown>`, so importing this
entry point instead of `streaming-text.js` never references `<lr-markdown>`'s ~200-language
dynamic-import table at all. A fenced code block whose language isn't a key in `languages` always
renders the plain-text fallback — there is no default/full-table highlighter here to fall back to,
mirroring `<lr-markdown-core>`'s own contract.

**Properties:** `content: string = ''` — the full current text so far, identical contract to
`<lr-streaming-text>`'s own; `streaming: boolean = false` (reflected); `coalesceMs: number = 50`
(attribute `coalesce-ms`) — same trailing-edge coalesce window described in
`llms/components/lr-streaming-text.md`; `contentMode: StreamingTextContentMode = 'auto'` (attribute
`content-mode`, reflected) — `auto`
uses `looksLikeMarkdown`, `plain`/`markdown` force their named paths; `languages?:
Readonly<Record<string, ShikiLanguageInput>>` (property only) — forwarded verbatim to the composed
`<lr-markdown-core>`'s own `languages` instead of `<lr-markdown>`'s (defaulting the composed
element's own `languages` to `{}` when unset, unlike the full variant's `undefined`). The rest of
`<lr-markdown-core>`'s configuration surface forwards verbatim too, sharing the same properties,
attribute names, and defaults described under `<lr-streaming-text>`'s own **Properties** above:
`tabSize: number = 4` (attribute `tab-size`); `htmlMode: 'sanitize' | 'escape' | 'trusted' =
'sanitize'` (attribute `html-mode`); `gfm: boolean = true`; `linkTarget: string | null = '_blank'`
(attribute `link-target`, still guarded by the composed element's own
`rel="noopener noreferrer"` whenever a `target` is emitted); `internalLinkPrefix: string = ''`
(attribute `internal-link-prefix`); `headingOffset: number = 0` (attribute `heading-offset`);
`highlightCode: boolean = true` (attribute `highlight-code`); `headingAnchors: boolean = false`
(attribute `heading-anchors`); `math: boolean = false`; `maxHeight: string = ''` (attribute
`max-height`).

**Exported helper:** `looksLikeMarkdown(text: string): boolean` — the same standalone heuristic
`<lr-streaming-text>` exports and documents, in `llms/components/lr-streaming-text.md`; both tags
share one implementation.

**Events:** `lr-content-settled` (`detail: null`, composed, bubbling) — identical contract to
`<lr-streaming-text>`'s own, including the markdown-mode double-fire avoidance (here the composed
`<lr-markdown-core>` emits it instead of `<lr-markdown>`).

**Slots:** none — content renders from `content`, not a slot.

**CSS parts:** `base`, `cursor` (only rendered while `streaming` is `true`), plus every part
`<lr-markdown-core>` documents forwarded verbatim from the composed `<lr-markdown-core>` in
Markdown mode via `exportparts`: `content`, `heading`, `paragraph`, `list`, `code-block`,
`inline-code`, `link`, `table`, `blockquote`, `img`, `math` — the identical forwarded list
`<lr-streaming-text>` documents, since `<lr-markdown>` and `<lr-markdown-core>` share the same
documented part vocabulary.

**Themeable custom properties:** `--lr-inline-cursor-width` (default `var(--lr-size-0-125rem)`) and
`--lr-inline-cursor-height` (default `var(--lr-size-1em)`) — the same shared inline-cursor tokens
`<lr-streaming-text>`/`<lr-typing-indicator>` use, plus the same `--lr-space-xs`/
`--lr-transition-ambient` fallbacks described in `llms/components/lr-streaming-text.md`.

Every other capability — token coalescing mechanics, the first-assignment/`streaming`-transition
immediate-flush rules, the reduced-motion cursor degradation, and the known gotchas — is identical
to `<lr-streaming-text>`; see `llms/components/lr-streaming-text.md` for the full write-up of
shared behavior.

```html
<lr-streaming-text-core id="out" streaming></lr-streaming-text-core>
<script type="module">
  import typescript from "shiki/langs/typescript.mjs";
  const out = document.getElementById("out");
  out.languages = { typescript };
  out.content = "```typescript\nconst x = 1;\n```";
</script>
```

---
