@aceshooting/lyra-ui 3.8.0 → 3.9.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.
Files changed (51) hide show
  1. package/README.md +3 -2
  2. package/custom-elements.json +1264 -97
  3. package/dist/components/activity-feed/activity-feed.class.d.ts +13 -1
  4. package/dist/components/activity-feed/activity-feed.class.d.ts.map +1 -1
  5. package/dist/components/activity-feed/activity-feed.class.js +10 -2
  6. package/dist/components/activity-feed/activity-feed.class.js.map +1 -1
  7. package/dist/components/graph/graph-canvas.d.ts +3 -0
  8. package/dist/components/graph/graph-canvas.d.ts.map +1 -1
  9. package/dist/components/graph/graph-canvas.js +5 -0
  10. package/dist/components/graph/graph-canvas.js.map +1 -1
  11. package/dist/components/graph/graph.class.d.ts +14 -0
  12. package/dist/components/graph/graph.class.d.ts.map +1 -1
  13. package/dist/components/graph/graph.class.js +28 -0
  14. package/dist/components/graph/graph.class.js.map +1 -1
  15. package/dist/components/graph/graph.styles.d.ts.map +1 -1
  16. package/dist/components/graph/graph.styles.js +6 -0
  17. package/dist/components/graph/graph.styles.js.map +1 -1
  18. package/dist/components/input/input.class.d.ts +3 -1
  19. package/dist/components/input/input.class.d.ts.map +1 -1
  20. package/dist/components/input/input.class.js +2 -0
  21. package/dist/components/input/input.class.js.map +1 -1
  22. package/dist/components/markdown/markdown-core.class.d.ts +334 -0
  23. package/dist/components/markdown/markdown-core.class.d.ts.map +1 -0
  24. package/dist/components/markdown/markdown-core.class.js +999 -0
  25. package/dist/components/markdown/markdown-core.class.js.map +1 -0
  26. package/dist/components/markdown/markdown-core.d.ts +2 -0
  27. package/dist/components/markdown/markdown-core.d.ts.map +1 -0
  28. package/dist/components/markdown/markdown-core.js +5 -0
  29. package/dist/components/markdown/markdown-core.js.map +1 -0
  30. package/dist/components/thread-list/thread-list.class.d.ts +10 -0
  31. package/dist/components/thread-list/thread-list.class.d.ts.map +1 -1
  32. package/dist/components/thread-list/thread-list.class.js +9 -1
  33. package/dist/components/thread-list/thread-list.class.js.map +1 -1
  34. package/dist/components/usage-badge/usage-badge.class.d.ts +10 -1
  35. package/dist/components/usage-badge/usage-badge.class.d.ts.map +1 -1
  36. package/dist/components/usage-badge/usage-badge.class.js +9 -0
  37. package/dist/components/usage-badge/usage-badge.class.js.map +1 -1
  38. package/dist/internal/root-registration-allowlist.d.ts +1 -1
  39. package/dist/internal/root-registration-allowlist.d.ts.map +1 -1
  40. package/dist/internal/root-registration-allowlist.js +1 -0
  41. package/dist/internal/root-registration-allowlist.js.map +1 -1
  42. package/dist/lyra.d.ts +3 -0
  43. package/dist/lyra.d.ts.map +1 -1
  44. package/dist/lyra.js +2 -0
  45. package/dist/lyra.js.map +1 -1
  46. package/llms-full.txt +83 -9
  47. package/llms.txt +2 -1
  48. package/package.json +31 -31
  49. package/vscode-css-data.json +7 -0
  50. package/vscode-html-data.json +106 -6
  51. package/web-types.json +129 -7
@@ -0,0 +1,334 @@
1
+ import { type TemplateResult, type PropertyValues } from 'lit';
2
+ import { LyraElement } from '../../internal/lyra-element.js';
3
+ import { type LyraAnchorTargetEventMap } from '../../internal/anchor-target.js';
4
+ import type { LyraAnchor, LyraAnchorKind } from '../document-viewer/anchors.js';
5
+ import { type ShikiLanguageInput } from '../code-block/code-loader.js';
6
+ /** One entry of `getHeadingTree()`'s document-ordered outline. `level` already reflects
7
+ * `heading-offset` -- it always matches the rendered `<h${level}>` tag, not the source `#` count. */
8
+ export interface MarkdownHeadingItem {
9
+ id: string;
10
+ label: string;
11
+ level: number;
12
+ }
13
+ export interface LyraMarkdownCoreEventMap extends LyraAnchorTargetEventMap {
14
+ 'lyra-render-error': CustomEvent<{
15
+ error: unknown;
16
+ }>;
17
+ 'lyra-link-click': CustomEvent<{
18
+ href: string;
19
+ internal: boolean;
20
+ }>;
21
+ }
22
+ declare class LyraMarkdownCoreBase extends LyraElement<LyraMarkdownCoreEventMap> {
23
+ }
24
+ declare const LyraMarkdownCore_base: typeof LyraMarkdownCoreBase & (new (...args: any[]) => import("../../internal/anchor-target.js").LyraAnchorTarget & {
25
+ renderAnchorLiveRegion(): unknown;
26
+ });
27
+ /**
28
+ * `<lyra-markdown-core>` — a build-lean variant of `<lyra-markdown>` for a consumer whose
29
+ * `languages` map already covers every language it will ever render. Every other capability (GFM
30
+ * tables, fenced code blocks, links, blockquotes, heading anchors, text-quote highlights, math) is
31
+ * identical to `<lyra-markdown>` -- only fenced-code-block highlighting differs: this component's
32
+ * own module never textually contains a call to (or import of) `loadShikiHighlighter` (the
33
+ * ~200-language default dynamic-import table `<lyra-markdown>` calls unconditionally unless its
34
+ * *runtime* `languagesOnly` flag is `true` -- a flag on that same module a bundler can't prove
35
+ * always-true, so the unconditional call stays in the build output regardless). A consumer
36
+ * importing this entry point instead of `markdown.js` gets a genuinely shiki-full-table-free
37
+ * build. A fenced block whose language isn't a key in `languages` always renders the plain-text
38
+ * fallback -- there is no default/full-table highlighter here to fall back to, mirroring
39
+ * `<lyra-code-block-core>`'s identical contract for the sibling component.
40
+ *
41
+ * Built on the optional peer dependencies `marked` (parsing) and `dompurify` (sanitizing), both
42
+ * lazy-loaded via `markdown-loader.ts` on first connect.
43
+ *
44
+ * Rendering never ships unsanitized or broken markup silently:
45
+ * - If `marked` fails to load, or throws while parsing malformed input, the
46
+ * component falls back to plain text (`white-space: pre-wrap`, no HTML
47
+ * parsing at all) and fires `lyra-render-error`.
48
+ * - If `sanitize` is `true` (the default) and `dompurify` fails to load, the
49
+ * component *also* falls back to plain text + `lyra-render-error` — it
50
+ * never renders marked's raw HTML output when sanitization was requested
51
+ * (or defaulted to) but is unavailable, even though `marked` itself loaded
52
+ * fine.
53
+ * - If `sanitize` is explicitly `false`, marked's raw output renders as-is
54
+ * regardless of whether `dompurify` is installed — the consumer opted out
55
+ * of sanitization, so `dompurify`'s absence is irrelevant to that path.
56
+ *
57
+ * That same plain-text fallback rendering (`data-fallback` on the `content`
58
+ * part) is also, unconditionally and by default, a brief *transient* state on
59
+ * every connect, not just a failure path: `connectedCallback()`'s dynamic
60
+ * `import()` of `marked`/`dompurify` (see `markdown-loader.ts`) is
61
+ * asynchronous, so the very first paint of any `<lyra-markdown>` on a page
62
+ * shows plain text for at least one microtask — even when both peers are
63
+ * already installed and load without error — until that import resolves and
64
+ * a second render replaces it with the real Markdown output. Set
65
+ * `eager-load` to skip that window once the shared dependency cache is
66
+ * already warm; see that property's doc for exactly what "warm" requires.
67
+ *
68
+ * `heading`/`code`/`blockquote`/`table`/`link`/`image` tokens are rendered
69
+ * through a `marked` renderer override that injects `part="..."` attributes
70
+ * directly into the produced HTML — a single pass, not a second DOM walk
71
+ * after insertion.
72
+ *
73
+ * Fenced code blocks are syntax-highlighted via the same fine-grained `shiki/core` recipe
74
+ * `<lyra-code-block-core>` uses (`highlightCode`, default `true` — gated by whether a fenced
75
+ * block's language is a key in `languages`, since there is no default highlighter here to gate on
76
+ * "is shiki installed at all"). The very first render of any content is always plain (identical to
77
+ * `<lyra-markdown>`'s own output); highlighting arrives as an asynchronous upgrade one render
78
+ * later, once the fine-grained highlighter resolves. No highlighting is attempted while
79
+ * `streaming` is `true` — it applies once a stream settles, so there is no added per-chunk cost
80
+ * while content is still arriving.
81
+ *
82
+ * When `heading-anchors` is set, every rendered heading's slug (computed via the shared
83
+ * GitHub-slugger-style `Slugger`) is stamped as its `id`; `getHeadingTree()` computes that same
84
+ * outline on every parse regardless of `heading-anchors`, so a host can build a table of contents
85
+ * even while ids aren't in the DOM yet. `scrollToAnchor()` (from the adopted `DocumentAnchorTarget`
86
+ * mixin) resolves `fragment` anchors against that outline and `text-quote` anchors via
87
+ * `internal/text-quote.ts`'s shared scope/resolve helpers; `highlights` re-resolve by quote after
88
+ * every render (never by node identity), so a highlight painted before a `streaming` update
89
+ * finishes still finds its quote once the matching text arrives. Highlight painting uses
90
+ * `internal/text-highlights.ts`'s `acquireHighlightHandle()` -- the CSS Custom Highlight API where
91
+ * the browser supports it (no DOM mutation at all), a `<mark>`-wrap fallback otherwise.
92
+ *
93
+ * `math` renders `$...$`/`$$...$$` TeX as MathML via the optional `katex` peer's
94
+ * `renderToString(tex, { output: 'mathml' })` -- MathML Core renders natively and accessibly in
95
+ * evergreen browsers with no extra stylesheet or webfont needing to cross the shadow boundary. A
96
+ * missing `katex` peer renders the literal, unparsed TeX source (delimiters included) and fires one
97
+ * `lyra-render-error`.
98
+ *
99
+ * @customElement lyra-markdown-core
100
+ * @event lyra-link-click - Fired (and the click prevented) when a rendered
101
+ * link's `href` starts with `internal-link-prefix`. `detail: { href:
102
+ * string, internal: true }`. Ordinary external links navigate normally
103
+ * (in `link-target`) and never fire this event.
104
+ * @event lyra-render-error - Fired whenever rendering falls back to plain
105
+ * text, or `math` is set but the `katex` peer isn't installed. `detail: { error: unknown }`.
106
+ * @event lyra-highlight-activate - A painted `text-quote` highlight was clicked. `detail: { id }`.
107
+ * @event lyra-text-select - Fired on selection end inside the rendered content. `detail: { text,
108
+ * anchor, rects }`; `anchor` is a `text-quote` `LyraAnchor` scoped to the rendered content, or
109
+ * `null` if the selection couldn't be anchored.
110
+ * @event lyra-anchor-result - Fired after an `anchor` property assignment or a `scrollToAnchor()`
111
+ * call is applied. `detail: { found }`.
112
+ * @csspart content - The wrapper around the rendered (or plain-text
113
+ * fallback) output.
114
+ * @csspart heading - Every rendered `<h1>`–`<h6>` (shifted by
115
+ * `heading-offset`).
116
+ * @csspart paragraph - Every rendered `<p>`.
117
+ * @csspart list - Every rendered `<ul>`/`<ol>`.
118
+ * @csspart code-block - Every rendered fenced/indented `<pre>`.
119
+ * @csspart inline-code - Every rendered inline `<code>` span (backtick spans, not fenced blocks).
120
+ * @csspart link - Every rendered `<a>`.
121
+ * @csspart table - Every rendered `<table>`.
122
+ * @csspart blockquote - Every rendered `<blockquote>`.
123
+ * @csspart img - Every rendered `<img>`.
124
+ * @csspart math - A rendered inline or block math span (`data-display="inline"|"block"`).
125
+ */
126
+ export declare class LyraMarkdownCore extends LyraMarkdownCore_base {
127
+ static styles: import("lit").CSSResultGroup[];
128
+ /** The Markdown source to render. */
129
+ content: string;
130
+ /** Sanitize marked's HTML output with DOMPurify before rendering. See the
131
+ * class doc for what happens when this is `true` (the default) but the
132
+ * `dompurify` peer isn't installed. */
133
+ sanitize: boolean;
134
+ /** When `true`, overrides marked's `html` renderer hook to emit the HTML-escaped source text
135
+ * instead of passing raw/sanitized markup through -- for a consumer rendering arbitrary
136
+ * already-written content (e.g. a historical chat/agent transcript full of code/XML/HTML
137
+ * snippets) where a stray angle bracket should render as visible text, not a real DOM element.
138
+ * Still lets GFM tables/lists/etc. render normally -- only raw embedded HTML is affected.
139
+ * `false` (the default) reproduces today's exact `marked`-default (sanitized-when-`sanitize`)
140
+ * passthrough behavior. */
141
+ escapeHtml: boolean;
142
+ /** Enable GitHub-flavored Markdown (tables, strikethrough, autolinks, task lists). */
143
+ gfm: boolean;
144
+ /** `target` applied to every rendered `<a>`, with `rel="noopener
145
+ * noreferrer"` always added alongside it whenever a `target` is emitted.
146
+ * `'_blank'` (the default) preserves today's exact output. Set to `null`
147
+ * (or the empty string, e.g. via the `link-target=""` attribute) to omit
148
+ * `target`/`rel` entirely, so rendered links open in the same tab. */
149
+ linkTarget: string | null;
150
+ /** When set, a rendered link whose `href` starts with this prefix is
151
+ * treated as internal — its click is intercepted and reported via
152
+ * `lyra-link-click` instead of navigating. Empty (the default) means
153
+ * every link is treated as external. */
154
+ internalLinkPrefix: string;
155
+ /** Added to every rendered heading's source `token.depth` before emitting
156
+ * `<h${depth}>` — e.g. `heading-offset="2"` renders a source `#` as
157
+ * `<h3>` and a source `##` as `<h4>`. The result is clamped to `[1, 6]`
158
+ * (a source `######` with a positive offset stays at `<h6>` rather than
159
+ * overflowing past the HTML heading levels; the floor at `1` is
160
+ * defensive, since this property is meant to be additive-only). `0`
161
+ * (the default) preserves today's exact `<h${token.depth}>` output. */
162
+ headingOffset: number;
163
+ /** When `true`, `connectedCallback()` skips awaiting `loadMarkdownDeps()`'s
164
+ * dynamic `import()` if the shared `marked`/`dompurify` module cache (see
165
+ * `markdown-loader.ts`'s `getMarkdownDepsIfLoaded()`) has *already*
166
+ * resolved — e.g. because an earlier `<lyra-markdown>` instance on the
167
+ * page already finished loading, or the consumer primed the cache
168
+ * directly by calling `loadMarkdownDeps()` themselves at startup — and
169
+ * renders synchronously instead. When the cache isn't warm yet (most
170
+ * notably: the very first `<lyra-markdown>` ever connected on a page,
171
+ * since nothing has called `loadMarkdownDeps()` before it), this still
172
+ * falls back to the normal async path — a dynamic `import()` can't be
173
+ * made synchronous, so this is a fast path for the common "already warm"
174
+ * case, not a hard guarantee. `false` (the default) is byte-identical to
175
+ * today: always the async `import()`, fallback-text window included. */
176
+ eagerLoad: boolean;
177
+ /** Signals that `content` is still arriving incrementally. Content changes
178
+ * continue to render immediately; while this is `true`, the host remains
179
+ * `aria-busy="true"` so assistive technology knows the rendered document
180
+ * is not final. Set it back to `false` with the final content update.
181
+ * Reflects so a consumer can also target `lyra-markdown[streaming]`. */
182
+ streaming: boolean;
183
+ /** Syntax-highlights fenced code blocks via the same optional `shiki` peer `<lyra-code-block>`
184
+ * uses. `true` (the default) upgrades every fenced block from plain `<pre><code>` once the peer
185
+ * is available -- a pure upgrade, not a behavior change gated on opt-in, since it's itself gated
186
+ * transparently by whether `shiki` is installed at all (an app that never installs it sees
187
+ * byte-identical output to today). Set `false` to keep plain output even when `shiki` is
188
+ * installed. No effect while `streaming` is `true` -- see that property's own doc. */
189
+ highlightCode: boolean;
190
+ /** Grammar definitions this instance can highlight, e.g. `{ json: jsonGrammar }` (import from
191
+ * `shiki/langs/<name>.mjs`), forwarded verbatim to `loadShikiHighlighterCore()` -- same shape as
192
+ * `<lyra-code-block-core>`'s own `languages`. This component has no default/full-table
193
+ * highlighter to fall back to -- a fenced block whose language isn't a key here always renders
194
+ * the plain-text fallback. Empty (the default) never highlights anything. */
195
+ languages: Record<string, ShikiLanguageInput>;
196
+ /** Stamps a computed slug as `id` on every rendered heading. `getHeadingTree()` computes the
197
+ * same slugs regardless of this property -- it only controls whether the `id` attribute is
198
+ * emitted into the rendered DOM. `false` (the default) preserves today's exact output.
199
+ *
200
+ * When `sanitize` is also on (the default), a slug whose *value* collides with a real
201
+ * `document` property name (e.g. a heading literally titled "Title", "Location", or "Forms"
202
+ * slugs to `title`/`location`/`forms`) has its `id` silently stripped by DOMPurify's DOM-
203
+ * clobbering protection (`SANITIZE_DOM`) -- `getHeadingTree()` still reports that heading's slug
204
+ * either way, but `scrollToAnchor({ kind: 'fragment', id })` still resolves it correctly even
205
+ * without a DOM `id` present, via its own position-based fallback lookup. */
206
+ headingAnchors: boolean;
207
+ /** Renders `$...$`/`$$...$$` TeX via the optional `katex` peer, as MathML. `false` (the
208
+ * default) renders `$...$` literally, unparsed -- today's exact output. */
209
+ math: boolean;
210
+ /** Anchor kinds this component resolves via `scrollToAnchor()`. Readonly. */
211
+ readonly anchorKinds: readonly LyraAnchorKind[];
212
+ private renderedHtml;
213
+ private deps?;
214
+ /** Document-ordered heading outline computed on every parse (see `getHeadingTree()`), regardless
215
+ * of `headingAnchors`. */
216
+ private headingTree;
217
+ /** Lazily acquired the first time a highlight needs painting; released on disconnect. */
218
+ private highlightHandle?;
219
+ /** The most recently resolved `text-quote` highlight ranges, kept for `onContentClick()`'s
220
+ * coordinate hit-test -- the CSS Custom Highlight API paints ranges without creating any DOM
221
+ * element to attach a click listener to, so activation is resolved by comparing the click point
222
+ * against each range's own `getClientRects()` instead, uniformly across both paint paths. */
223
+ private resolvedHighlightRanges;
224
+ /** Guards `lyra-render-error` so a permanently-missing `katex` peer reports once per instance,
225
+ * not on every subsequent re-render while `math` stays on. Reset whenever `math` toggles. */
226
+ private mathFailureReported;
227
+ /** `(lang, code)` -> already-highlighted HTML, content-addressed (see `PendingHighlight`'s doc).
228
+ * Persists across renders of this instance; populated asynchronously by `highlightPending()`.
229
+ * Never consulted while `streaming` is `true` or `highlightCode` is `false` -- both gates live
230
+ * in the `code()` renderer inside `parseMarkdown()`. Bounded to {@link HIGHLIGHT_CACHE_MAX}
231
+ * entries, least-recently-used first out, via `getCachedHighlight()`/`setCachedHighlight()` --
232
+ * always go through those instead of the map directly so hits refresh recency. */
233
+ private highlightCache;
234
+ /** LRU read: a hit is re-inserted so Map iteration order (insertion order) keeps the first key
235
+ * the least recently used one -- the entry `setCachedHighlight()` evicts when full. */
236
+ private getCachedHighlight;
237
+ private setCachedHighlight;
238
+ /** Bumped on every `highlightPending()` call, including ones that end up not actually loading
239
+ * anything -- guards against a newer `content`/`streaming` change superseding an older in-flight
240
+ * highlight, exactly mirroring `<lyra-code-block>`'s own `highlightToken` field for the identical
241
+ * race (an async grammar load resolving after a newer call already produced correct output). */
242
+ private highlightToken;
243
+ /** Keys from `PendingHighlight` that failed to highlight -- peer missing, language unrecognized,
244
+ * or tokenization threw. Once a key lands here, `code()` stops re-discovering it as pending on
245
+ * every future render. Without this, a permanently-unhighlightable block (e.g. an unrecognized
246
+ * language) would never get cached, so every `renderMarkdown()` pass -- including the one
247
+ * `highlightPending()` itself triggers on completion -- would rediscover it as pending and retry
248
+ * it again, forever. Mirrors `code-loader.ts`'s own `unsupportedLanguages` Set, which exists for
249
+ * the identical reason one level down (a single unrecognized `language` value on
250
+ * `<lyra-code-block>`). */
251
+ private failedHighlightKeys;
252
+ connectedCallback(): void;
253
+ disconnectedCallback(): void;
254
+ /** Binds selection -> `lyra-text-select` once, on the stable `[part="content"]` wrapper --
255
+ * re-renders only replace that wrapper's children via `unsafeHTML`, never the wrapper itself.
256
+ * `bindTextSelection` is `protected` on the mixin's own narrowed return type (deliberately not
257
+ * part of `LyraAnchorTarget`'s public surface -- see `anchor-target.ts`'s class doc), so it's
258
+ * reached the same way that module's own tests do: through a cast, without declaring a no-op
259
+ * passthrough override just to satisfy the type checker. */
260
+ protected firstUpdated(): void;
261
+ protected willUpdate(changed: PropertyValues): void;
262
+ protected updated(changed: PropertyValues): void;
263
+ private renderMarkdown;
264
+ private applyFallback;
265
+ /** Kicks off the shared `katex` load the first time `math` needs it and no attempt is already
266
+ * in flight (module-scoped, so every `<lyra-markdown>` instance on the page shares one load --
267
+ * mirrors `markdown-loader.ts`'s own warm-cache shape). Skipped entirely under
268
+ * `__setKatexForTesting()` -- that seam controls math-rendering behavior directly and must never
269
+ * race a real, unmocked `import('katex')` settling underneath it. */
270
+ private maybeLoadKatex;
271
+ /** Fires `lyra-render-error` once per instance for a permanently-missing `katex` peer. Called
272
+ * only once `renderMarkdown()` has confirmed the peer is actually missing (`katexOverride` or
273
+ * the resolved module is `null`) -- a math token rendering its literal fallback while the load
274
+ * is merely still in flight (the same one-microtask transient window every other optional peer
275
+ * in this component has) never reports an error on its own. */
276
+ private reportMathFailure;
277
+ /** Kicks off async highlighting for `pendingKeys` (see `highlightPending()`) unless there's
278
+ * nothing to do, `highlightCode` is off, or `streaming` is on -- called from both of
279
+ * `renderMarkdown()`'s exit points (the `sanitize=false` early return and the normal sanitized
280
+ * path), since highlighting is independent of that decision. */
281
+ private maybeHighlightPending;
282
+ /** Loads whatever shiki grammars `pendingKeys` need, tokenizes each pending block concurrently,
283
+ * populates `highlightCache` with the results, then triggers one more `renderMarkdown()` pass so
284
+ * the newly-cached entries actually reach the screen. A pending key whose language isn't a key in
285
+ * `languages`, or otherwise fails to tokenize, is recorded in `failedHighlightKeys` -- it stays
286
+ * uncached, so `code()` keeps emitting its plain fallback for it on every future render, and
287
+ * `code()` also stops re-discovering it as pending (see `failedHighlightKeys`'s own doc for why
288
+ * that matters: without it, the `renderMarkdown()` call at the end of this method would
289
+ * rediscover the same permanently-uncacheable key as pending on every pass, forever). Does not
290
+ * block or delay any other pending key -- each is tried independently via `Promise.all`. */
291
+ private highlightPending;
292
+ private parseMarkdown;
293
+ /** A document-ordered, flattened heading outline -- computed on every parse regardless of
294
+ * `headingAnchors` (see that property's own doc). A caller building a table of contents can rely
295
+ * on this even while `heading-anchors` is off. */
296
+ getHeadingTree(): MarkdownHeadingItem[];
297
+ private contentRoot;
298
+ protected applyAnchor(anchor: LyraAnchor): Promise<boolean>;
299
+ private applyFragmentAnchor;
300
+ /** `headingAnchors` may be off, so a target heading might carry no `id` attribute in the DOM --
301
+ * re-derives the same slug order `getHeadingTree()` was built in and matches by position
302
+ * instead of by attribute. */
303
+ private findHeadingByComputedId;
304
+ private applyTextQuoteAnchor;
305
+ /** Overrides `DocumentAnchorTarget`'s default (whole render-root) selection scope, matching
306
+ * `heading`'s slug computation and `applyTextQuoteAnchor()` above: only `[part="content"]` is a
307
+ * meaningful text-quote scope, so a selection that somehow reaches outside it (there is no other
308
+ * text in this component's shadow tree today, but the live region could grow one) never leaks
309
+ * into a captured anchor. */
310
+ protected computeSelectionAnchor(range: Range): LyraAnchor | null;
311
+ private ensureHighlightHandle;
312
+ /** Re-resolves every `text-quote` highlight against the current rendered content and repaints
313
+ * via `acquireHighlightHandle()` -- resolution is always by quote text, never by node identity,
314
+ * so a highlight set before its quote exists in `content` yet (e.g. mid-`streaming`) simply
315
+ * paints nothing until a later render's text actually contains it. `fragment` highlights aren't
316
+ * painted (there is no literal span of text to wrap/underline for a whole section). */
317
+ private repaintHighlights;
318
+ /** Hit-tests a click point against every currently-resolved highlight's `getClientRects()`,
319
+ * topmost (last-resolved) first. The CSS Custom Highlight API paints ranges without creating any
320
+ * DOM element to attach a click listener to, so this is the only activation path that works
321
+ * identically on both paint paths -- mirrors `<lyra-pdf-viewer>`'s own coordinate-based
322
+ * `onPageClick()` hit-test for the same reason (its own painted highlights sit under a text
323
+ * layer that intercepts most pointer events). */
324
+ private hitTestHighlightAt;
325
+ private onContentClick;
326
+ render(): TemplateResult;
327
+ }
328
+ declare global {
329
+ interface HTMLElementTagNameMap {
330
+ 'lyra-markdown-core': LyraMarkdownCore;
331
+ }
332
+ }
333
+ export {};
334
+ //# sourceMappingURL=markdown-core.class.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-core.class.d.ts","sourceRoot":"","sources":["../../../src/components/markdown/markdown-core.class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KA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