@aceshooting/lyra-ui 8.0.0 → 8.2.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 (61) hide show
  1. package/CHANGELOG.md +199 -17
  2. package/custom-elements.json +1 -1
  3. package/dist/components/agent-tools/mcp-app/mcp-app.class.js +1 -1
  4. package/dist/components/agent-tools/terminal/terminal.class.js +2 -2
  5. package/dist/components/agent-tools/tool-param-form/tool-param-form.class.d.ts +5 -0
  6. package/dist/components/agent-tools/tool-param-form/tool-param-form.class.js +1 -1
  7. package/dist/components/charts/chart/chart.class.js +1 -1
  8. package/dist/components/conversation/selection-toolbar/selection-toolbar.class.d.ts +5 -0
  9. package/dist/components/conversation/selection-toolbar/selection-toolbar.class.js +1 -1
  10. package/dist/components/conversation/widget-renderer/widget-renderer.class.js +1 -1
  11. package/dist/components/data/data-grid/data-grid.class.js +1 -1
  12. package/dist/components/data/flow-minimap/flow-minimap.class.js +1 -1
  13. package/dist/components/data/graph-query-builder/graph-query-builder.class.d.ts +4 -0
  14. package/dist/components/data/graph-query-builder/graph-query-builder.class.js +1 -1
  15. package/dist/components/data/query-builder/query-builder.class.js +2 -2
  16. package/dist/components/data/table/table.class.js +2 -2
  17. package/dist/components/data/table/table.styles.js +8 -3
  18. package/dist/components/data/tree/tree-item.styles.js +11 -3
  19. package/dist/components/data/tree/tree.class.d.ts +11 -0
  20. package/dist/components/data/tree/tree.class.js +1 -1
  21. package/dist/components/forms/checkbox-group/checkbox-group.class.d.ts +3 -0
  22. package/dist/components/forms/checkbox-group/checkbox-group.class.js +1 -1
  23. package/dist/components/forms/icon-button/icon-button.class.js +1 -1
  24. package/dist/components/forms/locale-picker/locale-picker.class.d.ts +3 -0
  25. package/dist/components/forms/locale-picker/locale-picker.class.js +4 -3
  26. package/dist/components/forms/locale-picker/locale-picker.styles.js +4 -0
  27. package/dist/components/forms/radio/radio-group.class.d.ts +3 -0
  28. package/dist/components/forms/radio/radio-group.class.js +1 -1
  29. package/dist/components/forms/rubric-form/rubric-form.class.d.ts +3 -0
  30. package/dist/components/forms/rubric-form/rubric-form.class.js +1 -1
  31. package/dist/components/forms/switch/switch.styles.js +9 -0
  32. package/dist/components/media/attachment-chip/attachment-chip.class.js +2 -2
  33. package/dist/components/media/avatar/avatar.class.js +2 -2
  34. package/dist/components/media/flag/flag.class.js +2 -2
  35. package/dist/components/retrieval/entity-card/entity-card.class.js +1 -1
  36. package/dist/components/retrieval/knowledge-graph-explorer/knowledge-graph-explorer.class.js +1 -1
  37. package/dist/components/utility/icon/icon.class.js +1 -1
  38. package/dist/components/viewers/archive-viewer/archive-viewer.class.js +1 -1
  39. package/dist/components/viewers/ebook-viewer/ebook-viewer.class.js +1 -1
  40. package/dist/components/viewers/notebook-viewer/notebook-viewer.class.js +3 -2
  41. package/dist/components/viewers/page-rail/page-rail.class.js +2 -0
  42. package/dist/components/viewers/spreadsheet-viewer/spreadsheet-viewer.class.js +1 -1
  43. package/dist/internal/anchor-target.js +1 -1
  44. package/dist/internal/package-metadata.d.ts +1 -1
  45. package/dist/internal/package-metadata.js +1 -1
  46. package/dist/internal/safe-svg.d.ts +13 -0
  47. package/dist/internal/safe-svg.js +1 -0
  48. package/dist/testing/happy-dom-shims.d.ts +4 -0
  49. package/dist/testing/happy-dom-shims.js +1 -1
  50. package/llms/components/lr-attachment-chip.md +18 -10
  51. package/llms/components/lr-checkbox-group.md +2 -0
  52. package/llms/components/lr-graph-query-builder.md +3 -1
  53. package/llms/components/lr-locale-picker.md +6 -4
  54. package/llms/components/lr-radio-group.md +3 -1
  55. package/llms/components/lr-rubric-form.md +2 -0
  56. package/llms/components/lr-tool-param-form.md +3 -0
  57. package/llms/peers.md +3 -3
  58. package/llms-full.txt +36 -15
  59. package/package.json +9 -8
  60. package/vscode-html-data.json +7 -7
  61. package/web-types.json +8 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,185 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5944ba7: Add a `click()` override to five multi-control form wrapper elements —
8
+ `<lr-radio-group>`, `<lr-checkbox-group>`, `<lr-rubric-form>`, `<lr-graph-query-builder>`, and
9
+ `<lr-tool-param-form>` — so a host click (whether from a `<label for>` association or a
10
+ programmatic `.click()`) reaches the first relevant internal control instead of being a no-op.
11
+ `<lr-radio-group>` activates its selected (or first enabled) radio, matching its own `focus()`
12
+ override; the other four move focus to their first field.
13
+
14
+ ## 8.1.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 968d39c: Fix `<lr-locale-picker>`'s trigger button never rendering a flag for the currently selected
19
+ locale — `showFlags` only ever affected the open listbox's rows, so a consumer relying on the
20
+ default `show-flags` still saw a text-only trigger (e.g. "English") with no flag until the
21
+ dropdown was opened. The trigger now renders the same `<lr-flag>` (new `trigger-flag` part,
22
+ honoring a `country` catalog override exactly like the row does) that the matching row shows.
23
+
24
+ ### Patch Changes
25
+
26
+ - b8028f8: Fix `DocumentAnchorTarget` (the shared mixin behind every viewer's `.scrollToAnchor()`) so a
27
+ throwing `applyAnchor()` reliably degrades to a resolved `false` and still emits
28
+ `lr-anchor-result:{found:false}`, instead of leaving the promise rejected and the documented
29
+ "always reports a definite result" contract broken. A previous attempt at this (a blanket
30
+ try/catch) was reverted because it made `lr-ebook-viewer`'s own override's localized
31
+ rendition-failure alert unreachable; `scrollToAnchor()` is now split into a thin public wrapper
32
+ carrying the safety net and a `performScrollToAnchor()` the mixin's own subclasses (currently only
33
+ `lr-ebook-viewer`) can call directly to bypass it and keep full control of their own catch.
34
+ - a260188: `lr-archive-viewer` no longer binds an untrusted ZIP entry name as a DOM `id` (`renderEntry()` set
35
+ `id=${entry.name}`, a classic DOM-clobbering primitive — a crafted archive entry named e.g.
36
+ `"body"` or `"documentElement"` could shadow a global DOM property lookup for code elsewhere in the
37
+ page). Fragment-anchor resolution (`scrollToAnchor()`'s `'fragment'` kind) now matches the target
38
+ row by its rendered `textContent` instead of by `id`, and no longer delegates to the shared
39
+ `TextViewerTarget` base's generic `id`-based fragment resolution for this component.
40
+ - 21ff77f: Harden three more components against untrusted values reaching a CSS sink unvalidated (same class
41
+ of fix as the earlier ANSI-color/`align`/`open-link` hardening):
42
+
43
+ - `lr-selection-toolbar` computed its floating position directly from a caller-supplied `rect`
44
+ (`DOMRectReadOnly | null`, but nothing enforces that shape at runtime) into a `styleMap()`-bound
45
+ custom property. A non-finite or non-numeric `left`/`top`/`width`/`bottom` could produce `NaNpx`
46
+ or, since `styleMap()`'s first commit serializes the whole `style` value as one string, break out
47
+ of the declaration. Both `coordinates()` and `updateToolbarPosition()` now coerce `rect` through a
48
+ shared `safeRect()` helper before use.
49
+ - `lr-data-grid`'s `columnStyle()` wrote a column's `width` into a `--column-authored-width` custom
50
+ property with no numeric guard, unlike the sibling `gridTemplate` getter's own `Number.isFinite`
51
+ check for the same field — inconsistent, and reachable by the same first-commit `styleMap()`
52
+ string-injection class of bug above.
53
+ - `lr-entity-card`'s data-driven type-badge color only rejected `;`/`{`/`}` structural characters,
54
+ not `url(...)`, unlike every other color sink in this library. Now routed through the shared
55
+ `sanitizeCssColor()` helper.
56
+
57
+ - 38d4511: Fix `<lr-flow-minimap>` not respecting a paired `<lr-flow-canvas>`'s `locked` state. Click-to-center,
58
+ wheel-zoom, viewport-rectangle drag, and the viewport rectangle's keyboard controls now check the
59
+ linked canvas's `locked` property before calling `setViewport()`/`zoomIn()`/`zoomOut()`/`fit()`,
60
+ mirroring the same guard `<lr-flow-canvas>` already applies to each of its own gesture handlers.
61
+ Previously the minimap relied entirely on the paired canvas separately gating those calls itself;
62
+ a locked canvas now stays locked even if a `FlowCanvasLike` companion does not also guard its own
63
+ methods. The `FlowCanvasLike` structural interface gained a read-only `locked` accessor to support
64
+ this.
65
+ - fbcf0ef: Fix `installHappyDomFormAssociatedShims()`'s stub `ElementInternals` missing a `states`
66
+ (`CustomStateSet`) property. Any form-associated component that calls
67
+ `this.internals.states.add()`/`.delete()`/`.has()` (added in 8.0's custom-state work, e.g.
68
+ `lr-input`'s `blank` state) threw on its very first update under the documented happy-dom test
69
+ setup.
70
+ - 867f68c: `lr-icon` and `lr-icon-button` clone slotted custom SVG content into a real SVG namespace so it
71
+ paints reliably (Chromium doesn't reliably paint slotted SVG geometry). That clone copied every
72
+ source attribute verbatim, including event handlers (`onload`, `onclick`, ...) and `href`/
73
+ `xlink:href`, with no sanitizer in the loop — unlike a fetched `src` document, which is already
74
+ sanitized through DOMPurify. Both clone paths now drop event-handler and `href`/`xlink:href`
75
+ attributes (a new shared `isUnsafeSvgCloneAttribute()` helper); every other presentational
76
+ attribute (`d`, `fill`, `stroke`, `viewBox`, `transform`, gradient stops, ...) is unaffected.
77
+ - 21e6f07: Fix `<lr-knowledge-graph-explorer>`'s `[part="search-empty"]` "no matches" message rendering as a
78
+ direct child of the `role="list"` `[part="search-results"]` container without `role="listitem"` --
79
+ invalid ARIA, since every child of a list role must itself be `listitem` (or one of a small allowed
80
+ set), unlike the real `[part="search-result"]` match rows which already carry it. It now carries
81
+ `role="listitem"` too.
82
+ - 2e0d525: Fix `custom-elements.json` under-reporting `cssParts` for components that extend another
83
+ component's class (e.g. `<lr-number-input>` extending `<lr-input>`, `<lr-dropdown>` extending
84
+ `<lr-popover>`). The manifest-compaction step pruned any inherited-and-resolvable entry — including
85
+ CSS parts — off a subclass's own declaration, on the assumption that a consumer would walk the JS
86
+ `extends` chain to see the full contract, the same way it does for members/attributes. Unlike those,
87
+ `::part()` has no such chain for its consumers (docs generators, editor tooling, `::part()` usage
88
+ checks), which read a tag's `cssParts` list directly, per tag — exactly how `cssStates` already
89
+ behaved. `<lr-number-input>` now declares `form-control`, `form-control-label`, `input-wrapper`, and
90
+ `input` (inherited from `<lr-input>`) in addition to its own parts, and `<lr-dropdown>` now declares
91
+ `trigger`, `popup`, `dialog`, `popup__popup`, `content`, `body`, `arrow`, and `popup__arrow`
92
+ (inherited from `<lr-popover>`). 15 other components with the same inheritance shape (the icon
93
+ charts, `<lr-native-time-input>`, `<lr-radio-button>`, `<lr-accordion-item>`, `<lr-dropdown-item>`,
94
+ `<lr-tag>`, `<lr-drawer>`) gained the same correction. Generated docs (`llms/components/*.md`) and
95
+ other manifest consumers were already unaffected, since they already read parts through
96
+ `expandManifestInheritance()`; only the checked-in compact manifest itself was missing them.
97
+ - 6313c1b: `lr-avatar`'s `image`, `lr-attachment-chip`'s `thumbnail-src` and file-object preview URL, and
98
+ `lr-flag`'s pre-resolved `src` are now validated through the shared `safeMediaSrc()` helper before
99
+ reaching an `<img src>` sink, rejecting `javascript:`/other unsafe schemes. Each falls back to its
100
+ existing placeholder state (initials, the generic file glyph, or an empty render) instead of
101
+ rendering an unsafe URL.
102
+ - ad5a464: Fix partial child-event stopping in three components whose nested `<lr-virtual-list>`/child
103
+ controls only had some of their bubbling events stopped at the host boundary:
104
+
105
+ - `<lr-notebook-viewer>` and `<lr-page-rail>` each already stopped the nested `<lr-virtual-list>`'s
106
+ `lr-visible-range-changed` event from leaking past the host, but left its `lr-scroll` event (and,
107
+ for `<lr-page-rail>`, its `lr-load-more` event too) undocumented and free to bubble straight
108
+ through. Both are now stopped the same way, mirroring the existing `lr-visible-range-changed`
109
+ handling.
110
+ - `<lr-query-builder>`'s add/remove condition buttons called `addCondition()`/`removeCondition()`
111
+ directly from their `@click` handlers, bypassing the `consumeChildEvent()` helper every other
112
+ handler in the component consistently uses to stop the raw composed child event before emitting
113
+ the component's own wrapper event. The two buttons now route through `consumeChildEvent()` like
114
+ the rest of the file.
115
+
116
+ `retrieval-results.class.ts` and `tool-select-dialog.class.ts` were also audited for the same
117
+ inconsistent-stopping pattern; both already stop every child event consistently, so neither needed
118
+ a change.
119
+
120
+ - d53cec6: `lr-spreadsheet-viewer` now validates that the optional `xlsx` peer's parsed `workbook.SheetNames`
121
+ is actually an array of strings before using it, instead of trusting an unchecked type assertion.
122
+ A malformed shape (a real risk here, since the workbook is parsed from consumer-supplied,
123
+ untrusted `src` content) now surfaces the standard localized load-failure state instead of silently
124
+ producing corrupted sheet tabs.
125
+ - d84fca9: Harden three components against untrusted values reaching CSS/URL sinks unvalidated:
126
+
127
+ - `lr-terminal` and `lr-notebook-viewer`'s shared ANSI-segment styling (`segmentStyle()`) wrote a
128
+ parsed stream's `fg`/`bg` color tokens directly into an inline `style` declaration; a
129
+ crafted ANSI color escape could inject CSS syntax. Both now validate through
130
+ `sanitizeCssColor()` before the value reaches `styleMap()`.
131
+ - `lr-widget-renderer`'s agent-authored widget tree wrote an arbitrary `align` prop string
132
+ directly into `align-items` with no allowlist. Now normalized through a bounded value map;
133
+ an unrecognized value renders as unset rather than reaching the declaration list.
134
+ - `lr-mcp-app`'s `open-link` message handler forwarded a `postMessage`-supplied `href` to
135
+ consumers verbatim as long as it was a string, with no scheme validation. Now validated through
136
+ `safeLinkHref()` (rejects `javascript:`/other unsafe schemes) before the `lr-mcp-open-link`
137
+ event fires.
138
+
139
+ - 0e6d53e: Fix `lr-switch`'s thumb miscentering when a consumer styles the `track` part with a `border`.
140
+ `box-sizing: border-box` (the library-wide default) let an added border eat into the padding box
141
+ the thumb is absolutely positioned against, while the thumb's own size/travel math stayed derived
142
+ from the track's declared (border-box) dimensions -- breaking symmetric clearance on the far edge
143
+ in both the unchecked and checked states. The track part now uses `box-sizing: content-box`, so an
144
+ added border grows the track's outer footprint instead of shrinking the space the thumb positions
145
+ within, keeping clearance symmetric regardless of border width.
146
+ - 7f37a42: `<lr-table>`'s `TableColumn.cellStyle` hook now sanitizes every property/value pair before it
147
+ reaches `styleMap()`: the property name must match a safe CSS-identifier shape, the value must
148
+ contain no `;`/`{`/`}` structural characters or a `url(...)` function, and the browser must accept
149
+ the property/value pair via `CSS.supports()` (falling back to a permissive regex where
150
+ `CSS.supports` is unavailable). A custom property (`--foo`) is exempted from the `CSS.supports`
151
+ check, since arbitrary custom-property values are always valid CSS.
152
+ - 7987719: Fix `lr-table` rows and `lr-tree-item` where hovering an already-selected row/item had no visible
153
+ effect. The `:hover` rule and the selected-state resting rule both resolved to the same
154
+ `--lr-color-brand-quiet` fallback at equal CSS specificity (and, for `lr-tree-item`, the
155
+ `:host([aria-selected='true'])`-scoped selected rule outranked a bare `[part='row']:hover`
156
+ outright), so the selected rule always won and hovering produced no change. Mirrors the fix already
157
+ applied to these same files' `:active`-while-selected rules: the hover rule now also matches through
158
+ the same specificity-matching selector arm (source order deciding the tie), and its resting fill is
159
+ a distinct `color-mix()` step (using `--lr-color-mix-hover`) instead of the plain `brand-quiet`
160
+ fallback, so hovering a selected row/item is visually distinguishable from its resting state.
161
+ - 4392216: Fix `<lr-tree>`'s `expandAll()` bypassing lazy-loading. It used to set `expanded = true` directly
162
+ on every node, skipping `<lr-tree-item>`'s own `expand()` -- the only code path that emits
163
+ `lr-lazy-load` and calls `beginLazyLoad()` for a `lazy` node whose children have not been fetched
164
+ yet. A tree containing lazy nodes would render them visually expanded but empty after
165
+ `expandAll()`, with their content never actually requested. `expandAll()` now calls each node's
166
+ `expand()` directly, so a lazy node triggers the same load request whether it was expanded by a
167
+ click or by `expandAll()`.
168
+
169
+ ## 8.0.1
170
+
171
+ ### Patch Changes
172
+
173
+ - Fix three bugs surfaced by the full Chromium/Firefox/WebKit browser-engine suite:
174
+
175
+ - `lr-page-rail`: a `thumbWidth` change scheduled its thumbnail-state invalidation from a
176
+ post-render hook, forcing an extra Lit update cycle instead of reflecting the new width in the
177
+ same pass.
178
+ - `lr-graph`: a pointer-capture call on canvas pointerdown was unguarded against browsers
179
+ rejecting capture for a synthetic (non-driver) pointer id, unlike its sibling release call.
180
+ - `lr-map`: a GeoJSON-view WebGL2 load-failure flag could stay set across a re-entrant load
181
+ triggered while the real availability check was still racing a test override.
182
+
3
183
  ## 8.0.0
4
184
 
5
185
  ### Major Changes
@@ -69,13 +249,13 @@
69
249
  surfaces register from these exact paths:
70
250
 
71
251
  ```js
72
- import '@aceshooting/lyra-ui/components/lr-page.js';
73
- import '@aceshooting/lyra-ui/components/lr-video.js';
74
- import '@aceshooting/lyra-ui/components/lr-video-playlist.js';
75
- import '@aceshooting/lyra-ui/components/lr-native-time-input.js';
76
- import '@aceshooting/lyra-ui/components/lr-pan-zoom.js';
77
- import '@aceshooting/lyra-ui/components/lr-split-panel.js';
78
- import '@aceshooting/lyra-ui/components/lr-alert.js';
252
+ import "@aceshooting/lyra-ui/components/lr-page.js";
253
+ import "@aceshooting/lyra-ui/components/lr-video.js";
254
+ import "@aceshooting/lyra-ui/components/lr-video-playlist.js";
255
+ import "@aceshooting/lyra-ui/components/lr-native-time-input.js";
256
+ import "@aceshooting/lyra-ui/components/lr-pan-zoom.js";
257
+ import "@aceshooting/lyra-ui/components/lr-split-panel.js";
258
+ import "@aceshooting/lyra-ui/components/lr-alert.js";
79
259
  ```
80
260
 
81
261
  The component-family references contain the exact surface and the 7.x migration notes for
@@ -150,16 +330,18 @@
150
330
 
151
331
  Every one of these is a find-and-replace. Where the default flips, the behaviour is the upstream one.
152
332
 
153
- | 7.x | 8.0.0 | Note |
154
- | --------------------------------- | ------------------- | ------------------------------------------------------------------------------------------- |
155
- | `no-light-dismiss` | `light-dismiss` | polarity un-inverted; default flips to off |
156
- | `hide-summary` | `with-summary` | polarity un-inverted; default flips to off |
157
- | `total-items` | `total` | |
158
- | `<lr-avatar src>` | `<lr-avatar image>` | |
159
- | `<lr-drawer>` default `placement` | `start` → `end` | matches the upstream default |
160
- | `<lr-tabs>` | `<lr-tab-group>` | plus `lr-tabs-change` → `lr-tab-show`/`lr-tab-hide`, and `--lr-tabs-*` → `--lr-tab-group-*` |
161
- | `<lr-tree-node>` | `<lr-tree-item>` | |
162
- | `<lr-slider>` `fill` part | `indicator` part | |
333
+ | 7.x | 8.0.0 | Note |
334
+ | -------------------------------------------------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
335
+ | `no-light-dismiss` | `light-dismiss` | polarity un-inverted; default flips to off |
336
+ | `hide-summary` | `with-summary` | polarity un-inverted; default flips to off |
337
+ | `total-items` | `total` | |
338
+ | `<lr-avatar src>` | `<lr-avatar image>` | |
339
+ | `<lr-drawer>` default `placement` | `start` → `end` | matches the upstream default |
340
+ | `<lr-tabs>` | `<lr-tab-group>` | plus `lr-tabs-change` → `lr-tab-show`/`lr-tab-hide`, and `--lr-tabs-*` → `--lr-tab-group-*` |
341
+ | `<lr-tree-node>` | `<lr-tree-item>` | |
342
+ | `<lr-slider>` `fill` part | `indicator` part | |
343
+ | `<lr-callout variant="danger">` `[part="base"]` `role="alert"` | shared live-region sink | announcements now flow through the shared light-DOM live-region sink instead; `[part="base"]` carries `role="group"` (only when the host has an accessible label) or no role at all |
344
+ | `<lr-spinner>` `part="base"` | `part="base spinner"` | an exact-match `[part="base"]` attribute selector no longer matches; `::part(base)` is unaffected. Also gained `role="progressbar"` |
163
345
 
164
346
  The JavaScript-only string property `.autoCorrect` on `lr-input`, `lr-textarea`, and
165
347
  `lr-combobox` is now the upstream-compatible `.autocorrect` IDL, which always reads as boolean.