@aceshooting/lyra-ui 2.0.0 → 2.1.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.
- package/README.md +87 -14
- package/custom-elements.json +11555 -5539
- package/dist/components/app-rail/app-rail-item.d.ts +30 -0
- package/dist/components/app-rail/app-rail-item.js +68 -0
- package/dist/components/app-rail/app-rail-item.styles.d.ts +1 -0
- package/dist/components/app-rail/app-rail-item.styles.js +65 -0
- package/dist/components/app-rail/app-rail.d.ts +21 -24
- package/dist/components/app-rail/app-rail.js +68 -132
- package/dist/components/app-rail/app-rail.styles.js +5 -2
- package/dist/components/attachment-chip/attachment-chip.d.ts +38 -11
- package/dist/components/attachment-chip/attachment-chip.js +73 -29
- package/dist/components/attachment-trigger/attachment-trigger.d.ts +13 -0
- package/dist/components/attachment-trigger/attachment-trigger.js +13 -1
- package/dist/components/attachment-trigger/attachment-trigger.styles.js +28 -6
- package/dist/components/chart/bar-chart.js +2 -18
- package/dist/components/chart/box-plot.d.ts +25 -1
- package/dist/components/chart/box-plot.js +136 -6
- package/dist/components/chart/box-plot.styles.js +13 -0
- package/dist/components/chart/bubble-chart.js +2 -18
- package/dist/components/chart/chart.d.ts +54 -10
- package/dist/components/chart/chart.js +182 -39
- package/dist/components/chart/doughnut-chart.js +2 -18
- package/dist/components/chart/histogram-bin.d.ts +5 -2
- package/dist/components/chart/histogram-bin.js +12 -4
- package/dist/components/chart/histogram.js +8 -16
- package/dist/components/chart/line-chart.js +2 -18
- package/dist/components/chart/lite-chart.d.ts +80 -3
- package/dist/components/chart/lite-chart.js +250 -53
- package/dist/components/chart/pie-chart.js +2 -18
- package/dist/components/chart/polar-area-chart.js +2 -18
- package/dist/components/chart/radar-chart.js +2 -18
- package/dist/components/chart/scatter-chart.js +2 -18
- package/dist/components/chat-composer/chat-composer.d.ts +42 -1
- package/dist/components/chat-composer/chat-composer.js +84 -3
- package/dist/components/chat-composer/chat-composer.styles.js +11 -1
- package/dist/components/chat-message/chat-message.d.ts +32 -4
- package/dist/components/chat-message/chat-message.js +57 -17
- package/dist/components/checkbox/checkbox.d.ts +66 -8
- package/dist/components/checkbox/checkbox.js +173 -50
- package/dist/components/checkbox/checkbox.styles.js +9 -2
- package/dist/components/chip/chip-group.js +8 -2
- package/dist/components/chip/chip.js +9 -2
- package/dist/components/citation-badge/citation-badge.js +21 -3
- package/dist/components/code-block/code-block.d.ts +38 -0
- package/dist/components/code-block/code-block.js +72 -7
- package/dist/components/code-block/code-loader.d.ts +44 -1
- package/dist/components/code-block/code-loader.js +63 -0
- package/dist/components/combobox/combobox.d.ts +46 -5
- package/dist/components/combobox/combobox.js +175 -35
- package/dist/components/combobox/combobox.styles.js +3 -3
- package/dist/components/context-meter/context-meter.js +17 -8
- package/dist/components/context-meter/context-meter.styles.js +0 -6
- package/dist/components/conversation-item/conversation-item.d.ts +13 -16
- package/dist/components/conversation-item/conversation-item.js +29 -20
- package/dist/components/date-picker/calendar-core.d.ts +24 -0
- package/dist/components/date-picker/calendar-core.js +51 -4
- package/dist/components/date-picker/date-input.d.ts +77 -10
- package/dist/components/date-picker/date-input.js +278 -73
- package/dist/components/date-picker/date-picker.d.ts +28 -4
- package/dist/components/date-picker/date-picker.js +95 -37
- package/dist/components/dialog/confirm.js +3 -6
- package/dist/components/dialog/dialog.d.ts +75 -31
- package/dist/components/dialog/dialog.js +147 -131
- package/dist/components/dialog/dialog.styles.js +46 -2
- package/dist/components/dock-panel/dock-panel.d.ts +8 -0
- package/dist/components/dock-panel/dock-panel.js +15 -1
- package/dist/components/dock-panel/dock-panel.styles.js +15 -1
- package/dist/components/document-preview/document-preview.d.ts +15 -7
- package/dist/components/document-preview/document-preview.js +29 -13
- package/dist/components/empty/empty.d.ts +1 -2
- package/dist/components/empty/empty.js +18 -12
- package/dist/components/empty/empty.styles.js +0 -3
- package/dist/components/export-button/export-button.d.ts +12 -0
- package/dist/components/export-button/export-button.js +33 -5
- package/dist/components/export-button/export-button.styles.js +5 -1
- package/dist/components/file-input/accept.js +2 -0
- package/dist/components/file-input/file-input.d.ts +10 -1
- package/dist/components/file-input/file-input.js +36 -5
- package/dist/components/flag/flag.d.ts +1 -1
- package/dist/components/flag/flag.js +15 -1
- package/dist/components/flag/flag.styles.js +1 -1
- package/dist/components/flag/language-map.d.ts +4 -1
- package/dist/components/flag/language-map.js +6 -3
- package/dist/components/gauge/gauge.d.ts +10 -1
- package/dist/components/gauge/gauge.js +28 -9
- package/dist/components/generation-status/generation-status.d.ts +13 -5
- package/dist/components/generation-status/generation-status.js +59 -5
- package/dist/components/graph/graph.d.ts +37 -3
- package/dist/components/graph/graph.js +132 -20
- package/dist/components/heatmap/calendar-grid.d.ts +15 -6
- package/dist/components/heatmap/calendar-grid.js +17 -6
- package/dist/components/heatmap/heatmap-scale.d.ts +5 -1
- package/dist/components/heatmap/heatmap-scale.js +8 -2
- package/dist/components/heatmap/heatmap.d.ts +166 -25
- package/dist/components/heatmap/heatmap.js +372 -89
- package/dist/components/json-viewer/json-viewer.d.ts +22 -5
- package/dist/components/json-viewer/json-viewer.js +115 -37
- package/dist/components/json-viewer/json-viewer.styles.js +2 -1
- package/dist/components/kbd/kbd.js +24 -7
- package/dist/components/live-region/live-region.d.ts +10 -1
- package/dist/components/live-region/live-region.js +42 -6
- package/dist/components/map/map.d.ts +24 -1
- package/dist/components/map/map.js +89 -24
- package/dist/components/markdown/markdown-loader.d.ts +24 -0
- package/dist/components/markdown/markdown-loader.js +35 -1
- package/dist/components/markdown/markdown.d.ts +46 -8
- package/dist/components/markdown/markdown.js +136 -31
- package/dist/components/markdown/markdown.styles.js +7 -1
- package/dist/components/media-card/media-card.d.ts +25 -17
- package/dist/components/media-card/media-card.js +43 -65
- package/dist/components/mention-popover/mention-popover.d.ts +4 -1
- package/dist/components/mention-popover/mention-popover.js +23 -5
- package/dist/components/menu/menu-item.d.ts +32 -3
- package/dist/components/menu/menu-item.js +94 -7
- package/dist/components/menu/menu-item.styles.js +8 -0
- package/dist/components/menu/menu.d.ts +25 -1
- package/dist/components/menu/menu.js +99 -3
- package/dist/components/menu/menu.styles.js +3 -2
- package/dist/components/model-select/model-select.d.ts +48 -3
- package/dist/components/model-select/model-select.js +120 -22
- package/dist/components/model-select/model-select.styles.js +17 -3
- package/dist/components/model-settings-panel/model-settings-panel.d.ts +25 -1
- package/dist/components/model-settings-panel/model-settings-panel.js +65 -1
- package/dist/components/playback/playback.d.ts +6 -2
- package/dist/components/playback/playback.js +72 -29
- package/dist/components/playback/playback.styles.js +6 -1
- package/dist/components/responsive-panel/responsive-panel.d.ts +29 -16
- package/dist/components/responsive-panel/responsive-panel.js +130 -132
- package/dist/components/responsive-panel/responsive-panel.styles.js +1 -1
- package/dist/components/result-card/result-card.d.ts +8 -2
- package/dist/components/result-card/result-card.js +9 -3
- package/dist/components/result-card/result-card.styles.js +0 -1
- package/dist/components/select/select.d.ts +59 -20
- package/dist/components/select/select.js +125 -43
- package/dist/components/skeleton/skeleton.d.ts +3 -0
- package/dist/components/skeleton/skeleton.js +7 -1
- package/dist/components/skeleton/skeleton.styles.js +5 -4
- package/dist/components/slider/slider.d.ts +57 -5
- package/dist/components/slider/slider.js +195 -80
- package/dist/components/source-card/source-card.d.ts +17 -5
- package/dist/components/source-card/source-card.js +55 -8
- package/dist/components/source-card/source-card.styles.js +1 -1
- package/dist/components/source-list/source-list.js +9 -1
- package/dist/components/sparkline/sparkline.js +34 -10
- package/dist/components/split/split.d.ts +141 -14
- package/dist/components/split/split.js +357 -52
- package/dist/components/split/split.styles.js +18 -1
- package/dist/components/stat/stat.d.ts +10 -4
- package/dist/components/stat/stat.js +46 -11
- package/dist/components/stream-status/stream-status.d.ts +27 -11
- package/dist/components/stream-status/stream-status.js +95 -13
- package/dist/components/streaming-text/streaming-text.d.ts +9 -3
- package/dist/components/streaming-text/streaming-text.js +25 -10
- package/dist/components/streaming-text/streaming-text.styles.js +3 -2
- package/dist/components/switch/switch.d.ts +52 -7
- package/dist/components/switch/switch.js +111 -40
- package/dist/components/switch/switch.styles.js +1 -1
- package/dist/components/table/table.d.ts +18 -3
- package/dist/components/table/table.js +88 -20
- package/dist/components/tabs/tabs.d.ts +23 -0
- package/dist/components/tabs/tabs.js +76 -12
- package/dist/components/tabs/tabs.styles.js +11 -0
- package/dist/components/thinking-panel/thinking-panel.d.ts +3 -1
- package/dist/components/thinking-panel/thinking-panel.js +34 -9
- package/dist/components/thinking-panel/thinking-panel.styles.js +6 -0
- package/dist/components/time-range/time-range.d.ts +59 -2
- package/dist/components/time-range/time-range.js +163 -67
- package/dist/components/toast/toast-item.d.ts +12 -3
- package/dist/components/toast/toast-item.js +90 -53
- package/dist/components/toast/toast-item.styles.js +59 -28
- package/dist/components/toast/toast.js +17 -5
- package/dist/components/toast/toaster.js +10 -1
- package/dist/components/tool-approval-dialog/tool-approval-dialog.d.ts +11 -10
- package/dist/components/tool-approval-dialog/tool-approval-dialog.js +50 -124
- package/dist/components/tool-approval-dialog/tool-approval-dialog.styles.js +1 -1
- package/dist/components/tool-call-chip/tool-call-chip.d.ts +18 -2
- package/dist/components/tool-call-chip/tool-call-chip.js +86 -25
- package/dist/components/tool-param-form/tool-param-form.d.ts +89 -28
- package/dist/components/tool-param-form/tool-param-form.js +350 -106
- package/dist/components/tool-result-dialog/tool-result-dialog.d.ts +27 -7
- package/dist/components/tool-result-dialog/tool-result-dialog.js +80 -115
- package/dist/components/tool-result-dialog/tool-result-dialog.styles.js +1 -1
- package/dist/components/tool-result-view/registry.d.ts +0 -8
- package/dist/components/tool-result-view/registry.js +7 -2
- package/dist/components/tool-result-view/tool-result-view.d.ts +6 -3
- package/dist/components/tool-result-view/tool-result-view.js +18 -4
- package/dist/components/tool-select-dialog/tool-select-dialog.d.ts +11 -11
- package/dist/components/tool-select-dialog/tool-select-dialog.js +44 -133
- package/dist/components/tool-select-dialog/tool-select-dialog.styles.js +13 -4
- package/dist/components/tree/tree-node.d.ts +4 -1
- package/dist/components/tree/tree-node.js +4 -1
- package/dist/components/tree/tree.d.ts +17 -8
- package/dist/components/tree/tree.js +21 -20
- package/dist/components/typing-indicator/typing-indicator.d.ts +12 -2
- package/dist/components/typing-indicator/typing-indicator.js +16 -4
- package/dist/components/typing-indicator/typing-indicator.styles.js +2 -2
- package/dist/components/virtual-list/virtual-list.d.ts +56 -19
- package/dist/components/virtual-list/virtual-list.js +184 -38
- package/dist/components/virtual-list/virtual-list.styles.js +12 -0
- package/dist/components/widget/widget.d.ts +5 -4
- package/dist/components/widget/widget.js +54 -120
- package/dist/components/widget/widget.styles.js +8 -2
- package/dist/components/word-cloud/word-cloud-layout.d.ts +7 -0
- package/dist/components/word-cloud/word-cloud-layout.js +20 -6
- package/dist/components/word-cloud/word-cloud.d.ts +22 -2
- package/dist/components/word-cloud/word-cloud.js +45 -6
- package/dist/components/word-cloud/word-cloud.styles.js +13 -1
- package/dist/internal/anchored-validity.d.ts +1 -0
- package/dist/internal/anchored-validity.js +86 -0
- package/dist/internal/form-associated.d.ts +7 -0
- package/dist/internal/form-associated.js +43 -4
- package/dist/internal/numbers.d.ts +12 -0
- package/dist/internal/numbers.js +26 -0
- package/dist/internal/overlay-manager.d.ts +51 -0
- package/dist/internal/overlay-manager.js +523 -0
- package/dist/internal/positioner.js +27 -3
- package/dist/internal/safe-url.d.ts +12 -0
- package/dist/internal/safe-url.js +41 -0
- package/dist/internal/tokens.styles.js +17 -11
- package/dist/lyra.d.ts +5 -2
- package/dist/lyra.js +3 -1
- package/llms-full.txt +970 -426
- package/llms.txt +5 -4
- package/package.json +19 -2
|
@@ -41,18 +41,26 @@ export class LyraSparkline extends LyraElement {
|
|
|
41
41
|
}
|
|
42
42
|
static { this.styles = [LyraElement.styles, styles]; }
|
|
43
43
|
points() {
|
|
44
|
+
// Non-finite samples (NaN/undefined/null from upstream computed data)
|
|
45
|
+
// can't be plotted or compared -- drop them up front so one bad point
|
|
46
|
+
// can't inject a literal "NaN" into the path `d` string and truncate
|
|
47
|
+
// every point that follows it.
|
|
48
|
+
const raw = this.values.filter((n) => Number.isFinite(n));
|
|
44
49
|
// Auto min/max is scanned from the full, pre-decimation `values` -- doing
|
|
45
50
|
// this after decimating would silently narrow the scale to whatever the
|
|
46
51
|
// sampled subset happens to contain, which can clip or misproportion a
|
|
47
|
-
// real extreme value that decimation happened to drop.
|
|
48
|
-
|
|
52
|
+
// real extreme value that decimation happened to drop. Skip the scan
|
|
53
|
+
// entirely when both bounds are already given explicitly -- its result
|
|
54
|
+
// would just be discarded.
|
|
49
55
|
let autoLo = raw[0];
|
|
50
56
|
let autoHi = raw[0];
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
if (this.min === undefined || this.max === undefined) {
|
|
58
|
+
for (const n of raw) {
|
|
59
|
+
if (n < autoLo)
|
|
60
|
+
autoLo = n;
|
|
61
|
+
if (n > autoHi)
|
|
62
|
+
autoHi = n;
|
|
63
|
+
}
|
|
56
64
|
}
|
|
57
65
|
const lo = this.min ?? autoLo;
|
|
58
66
|
const hi = this.max ?? autoHi;
|
|
@@ -67,7 +75,14 @@ export class LyraSparkline extends LyraElement {
|
|
|
67
75
|
willUpdate() {
|
|
68
76
|
const v = this.values;
|
|
69
77
|
this.setAttribute('role', 'img');
|
|
70
|
-
|
|
78
|
+
const last = v.at(-1);
|
|
79
|
+
// Real-world computed data (ratios, averages, percentages) carries
|
|
80
|
+
// floating-point noise that isn't meaningful to announce -- round it for
|
|
81
|
+
// the label the same way a human-facing value would be formatted.
|
|
82
|
+
const formattedLast = typeof last === 'number' && Number.isFinite(last)
|
|
83
|
+
? last.toLocaleString(undefined, { maximumFractionDigits: 2 })
|
|
84
|
+
: last;
|
|
85
|
+
this.setAttribute('aria-label', v.length ? `Trend of ${v.length} values, last ${formattedLast}` : 'No data');
|
|
71
86
|
}
|
|
72
87
|
render() {
|
|
73
88
|
const v = this.values;
|
|
@@ -84,16 +99,25 @@ export class LyraSparkline extends LyraElement {
|
|
|
84
99
|
const slot = VIEW / pts.length;
|
|
85
100
|
const barWidth = Math.min(4, Math.max(1, slot * 0.7));
|
|
86
101
|
const bars = pts.map(([x, y]) => {
|
|
87
|
-
|
|
102
|
+
// Clamp symmetrically: a value below an explicit `min` pushes `y`
|
|
103
|
+
// above VIEW, and a value above an explicit `max` pushes it below 0 --
|
|
104
|
+
// only clamping one side left the other free to draw a negative-y,
|
|
105
|
+
// oversized rect that bled outside the sparkline's box.
|
|
106
|
+
const barY = Math.min(VIEW, Math.max(0, y));
|
|
88
107
|
return svg `<rect part="bar" x="${x - barWidth / 2}" y="${barY}" width="${barWidth}" height="${VIEW - barY}"></rect>`;
|
|
89
108
|
});
|
|
90
109
|
return html `<svg viewBox="0 0 ${VIEW} ${VIEW}" preserveAspectRatio="none" aria-hidden="true">
|
|
91
110
|
${bars}
|
|
92
111
|
</svg>`;
|
|
93
112
|
}
|
|
113
|
+
// pts can end up empty even though `values` itself isn't -- e.g. every
|
|
114
|
+
// entry was non-finite and got filtered out -- so the single-point
|
|
115
|
+
// fallback below can't assume pts[0] exists.
|
|
94
116
|
const d = pts.length > 1
|
|
95
117
|
? pts.map(([x, y], i) => `${i ? 'L' : 'M'}${x},${y}`).join(' ')
|
|
96
|
-
:
|
|
118
|
+
: pts.length === 1
|
|
119
|
+
? `M${pts[0][0]},${pts[0][1]} L${pts[0][0]},${pts[0][1]}`
|
|
120
|
+
: '';
|
|
97
121
|
return html `<svg viewBox="0 0 ${VIEW} ${VIEW}" preserveAspectRatio="none" aria-hidden="true">
|
|
98
122
|
${this.type === 'area' ? svg `<path part="area" d="${d} L${VIEW},${VIEW} L0,${VIEW} Z"></path>` : ''}
|
|
99
123
|
<path part="line" d="${d}"></path>
|
|
@@ -7,6 +7,14 @@ export interface PanelConstraint {
|
|
|
7
7
|
minPx?: number;
|
|
8
8
|
maxPx?: number;
|
|
9
9
|
}
|
|
10
|
+
export type SplitConstraintIssueReason = 'minimum-total' | 'maximum-total' | 'minimum-exceeds-maximum';
|
|
11
|
+
export interface SplitConstraintIssueDetail {
|
|
12
|
+
reason: SplitConstraintIssueReason;
|
|
13
|
+
panelCount: number;
|
|
14
|
+
minimumTotal: number;
|
|
15
|
+
maximumTotal: number | null;
|
|
16
|
+
containerSize: number;
|
|
17
|
+
}
|
|
10
18
|
/** Which pane (if any) participates in responsive collapse (see `collapse`). */
|
|
11
19
|
export type SplitCollapseMode = 'start' | 'end' | 'none';
|
|
12
20
|
/** The collapsing pane's current responsive state — `'wide'` is the normal
|
|
@@ -14,6 +22,9 @@ export type SplitCollapseMode = 'start' | 'end' | 'none';
|
|
|
14
22
|
* clamps it to `railWidth`; `'floating'` lifts it out of the flex flow as an
|
|
15
23
|
* overlay above the other pane. */
|
|
16
24
|
export type SplitCollapseState = 'wide' | 'rail' | 'floating';
|
|
25
|
+
/** What can be *assigned* to `collapseState` -- `'auto'` is a write-only
|
|
26
|
+
* sentinel; see the `collapseState` accessor doc. */
|
|
27
|
+
export type SplitCollapseStateInput = SplitCollapseState | 'auto';
|
|
17
28
|
export interface SplitCollapseChangeDetail {
|
|
18
29
|
state: SplitCollapseState;
|
|
19
30
|
}
|
|
@@ -33,19 +44,58 @@ export interface SplitCollapseChangeDetail {
|
|
|
33
44
|
* icon-only/collapsed UI of its own; slotted content is expected to adapt to
|
|
34
45
|
* its own clamped width (e.g. via its own container query).
|
|
35
46
|
*
|
|
47
|
+
* `collapseState` is a public accessor with force/auto semantics mirroring
|
|
48
|
+
* `<lyra-app-rail>`'s `mode`: it's normally derived automatically from the
|
|
49
|
+
* measured container width (via a `ResizeObserver` on `[part="base"]`)
|
|
50
|
+
* whenever it crosses `railBreakpoint`/`floatBreakpoint`, but assigning it a
|
|
51
|
+
* concrete `'wide'`/`'rail'`/`'floating'` value pins it there and stops that
|
|
52
|
+
* automatic tracking — useful for a consumer-driven toggle (e.g. a button
|
|
53
|
+
* that forces `'floating'` regardless of width). Assigning the write-only
|
|
54
|
+
* `'auto'` sentinel releases the pin and immediately re-derives the state
|
|
55
|
+
* from the current measured width, resuming automatic tracking. `'auto'` is
|
|
56
|
+
* never a value this getter returns.
|
|
57
|
+
*
|
|
58
|
+
* The `'floating'` state is a hidden-by-default drawer, gated by `open`
|
|
59
|
+
* (mirrors `<lyra-app-rail>`'s mobile overlay): while `collapseState` is
|
|
60
|
+
* `'floating'` and `open` is `false` (the default), the collapsing panel
|
|
61
|
+
* renders nothing — `hidden`, out of the accessibility tree, not just
|
|
62
|
+
* visually hidden — instead of the always-visible overlay card this state
|
|
63
|
+
* rendered before `open` existed. Setting `open = true` reveals it as a
|
|
64
|
+
* focus-trapped floating panel with a `[part="backdrop"]` scrim; Escape or a
|
|
65
|
+
* backdrop click set `open` back to `false`. `open` is preserved (not reset)
|
|
66
|
+
* while `collapseState` isn't `'floating'`, but no drawer chrome renders
|
|
67
|
+
* until it is again — except that leaving `'floating'` while `open` is
|
|
68
|
+
* `true` (a breakpoint crossing back to `'wide'`/`'rail'`, or a forced
|
|
69
|
+
* reassignment) also closes it, the same way `<lyra-app-rail>` closes its
|
|
70
|
+
* mobile overlay when leaving `'mobile'` while open.
|
|
71
|
+
*
|
|
36
72
|
* @customElement lyra-split
|
|
37
73
|
* @event lyra-resize - `detail: { sizes }`, fired on every drag step/release
|
|
38
74
|
* and every keyboard step.
|
|
39
75
|
* @event lyra-split-collapse-change - `detail: { state }` (`SplitCollapseChangeDetail`),
|
|
40
76
|
* fired whenever the responsive `collapseState` actually transitions between
|
|
41
|
-
* `'wide'`/`'rail'`/`'floating'
|
|
42
|
-
*
|
|
77
|
+
* `'wide'`/`'rail'`/`'floating'` — whether from a breakpoint crossing or an
|
|
78
|
+
* explicit `collapseState` assignment. Only relevant when `collapse` isn't
|
|
79
|
+
* `"none"`; never fires otherwise. Not fired for a redundant reassignment
|
|
80
|
+
* to the state already in effect.
|
|
81
|
+
* @event lyra-split-constraints-invalid - `detail: SplitConstraintIssueDetail`,
|
|
82
|
+
* fired once when the configured panel minimums/maximums cannot describe a
|
|
83
|
+
* layout that fits the track. The splitter rejects that infeasible set for
|
|
84
|
+
* interaction and falls back to a normalized percent minimum.
|
|
43
85
|
* @slot - Panels to arrange side by side (or stacked, when `orientation="vertical"`); each direct child becomes one resizable panel.
|
|
44
86
|
* @csspart base - The flex layout wrapper (`position: relative`, so the `'floating'` collapse state can anchor to it).
|
|
45
87
|
* @csspart divider - Each divider between two panels; carries `aria-disabled="true"` and is drag/keyboard-inert while its adjacent panel is collapsed (`'rail'`/`'floating'`).
|
|
88
|
+
* @csspart backdrop - The `'floating'` drawer's scrim. Only rendered while `collapseState === 'floating'` and `open`.
|
|
46
89
|
*/
|
|
47
90
|
export declare class LyraSplit extends LyraElement {
|
|
48
91
|
static styles: import("lit").CSSResultGroup[];
|
|
92
|
+
static properties: {
|
|
93
|
+
collapseState: {
|
|
94
|
+
reflect: boolean;
|
|
95
|
+
attribute: string;
|
|
96
|
+
noAccessor: boolean;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
49
99
|
sizes: number[];
|
|
50
100
|
min: number;
|
|
51
101
|
orientation: 'horizontal' | 'vertical';
|
|
@@ -74,17 +124,74 @@ export declare class LyraSplit extends LyraElement {
|
|
|
74
124
|
/** Container width (px) below which the collapsing pane instead becomes an
|
|
75
125
|
* absolutely-positioned overlay above the other pane (`'floating'` state). */
|
|
76
126
|
floatBreakpoint: number;
|
|
127
|
+
/** Whether the `'floating'` collapse state's drawer is shown. Only
|
|
128
|
+
* meaningful while `collapseState` is `'floating'` — the value is
|
|
129
|
+
* preserved (not reset) while another state is active, but no drawer
|
|
130
|
+
* chrome renders until `collapseState` is `'floating'` again. Defaults to
|
|
131
|
+
* `false`: the collapsing pane renders nothing while floating until a
|
|
132
|
+
* consumer opts in by setting this (or it's forced open programmatically)
|
|
133
|
+
* — see the class doc. */
|
|
134
|
+
open: boolean;
|
|
77
135
|
private panelCount;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
private
|
|
136
|
+
private _collapseState;
|
|
137
|
+
private _forced;
|
|
138
|
+
private overlayActive;
|
|
139
|
+
private justOpened;
|
|
140
|
+
private releaseScrollLock?;
|
|
141
|
+
private overlayHandle?;
|
|
81
142
|
private drags;
|
|
82
143
|
private stylizedPanels;
|
|
144
|
+
private constraintIssueKey;
|
|
83
145
|
private baseEl?;
|
|
84
146
|
private collapseResizeObserver?;
|
|
85
147
|
connectedCallback(): void;
|
|
86
148
|
disconnectedCallback(): void;
|
|
87
149
|
protected firstUpdated(): void;
|
|
150
|
+
/** Both branches here derive one reactive property from another with no
|
|
151
|
+
* DOM measurement involved, so they belong in `willUpdate()` rather than
|
|
152
|
+
* `updated()`: setting a reactive property from `updated()`/
|
|
153
|
+
* `firstUpdated()` schedules a *second* update on top of the one that
|
|
154
|
+
* just finished, which Lit's dev-mode console flags ("scheduled an
|
|
155
|
+
* update ... after an update completed"). Both of these were real and
|
|
156
|
+
* reproducible in normal usage, not just test artifacts --
|
|
157
|
+
* `ensureSizes()` on any direct `sizes` assignment whose length doesn't
|
|
158
|
+
* match `panelCount` (e.g. a consumer correcting a stale layout), and the
|
|
159
|
+
* `collapseState` reset on every `collapse` -> `'none'` transition. The
|
|
160
|
+
* `collapse !== 'none'` re-arm path in `syncCollapseObserver()` still
|
|
161
|
+
* needs a freshly measured container width and stays in `updated()` --
|
|
162
|
+
* see `armCollapseObserver()`'s own doc comment for why *that* one is the
|
|
163
|
+
* documented exception instead (mirrors virtual-list.ts's
|
|
164
|
+
* `attachContainerListeners()`). */
|
|
165
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
166
|
+
/**
|
|
167
|
+
* The collapsing pane's current responsive state. Always one of the three
|
|
168
|
+
* real states — never `'auto'` — reflecting either the live measured
|
|
169
|
+
* width or, once forced, whatever was last assigned. See the class doc for
|
|
170
|
+
* the full force/auto contract (mirrors `<lyra-app-rail>`'s `mode`).
|
|
171
|
+
*/
|
|
172
|
+
get collapseState(): SplitCollapseState;
|
|
173
|
+
set collapseState(next: SplitCollapseStateInput);
|
|
174
|
+
/** The container width (px) `[part="base"]` is measured at right now --
|
|
175
|
+
* used to re-derive `collapseState` immediately when a forced value is
|
|
176
|
+
* released back to `'auto'`, outside of the `ResizeObserver`'s own
|
|
177
|
+
* (async, entry-driven) callback. Mirrors the synchronous initial read
|
|
178
|
+
* `armCollapseObserver()` already does when it (re-)arms. */
|
|
179
|
+
private currentMeasuredWidth;
|
|
180
|
+
/** Resets `collapseState` back to its `'wide'` default and releases any
|
|
181
|
+
* force, bypassing the public accessor's pin/event-emit side effects --
|
|
182
|
+
* used only for the `collapse -> 'none'` housekeeping reset in
|
|
183
|
+
* `willUpdate()`, which is purely internal bookkeeping (the feature is
|
|
184
|
+
* off entirely), not a state transition a consumer forced or observed. */
|
|
185
|
+
private resetCollapseState;
|
|
186
|
+
/** Applies an actual `collapseState` transition (no-op if `next` matches
|
|
187
|
+
* the current value): updates the field, triggers Lit's reflect/re-render
|
|
188
|
+
* via `requestUpdate`, and fires `lyra-split-collapse-change`. Shared by
|
|
189
|
+
* both the `ResizeObserver`-driven measurement path (`updateCollapseState`)
|
|
190
|
+
* and the accessor's forced-value assignment, so the two never duplicate
|
|
191
|
+
* this logic. Leaving `'floating'` while `open` is still `true` also
|
|
192
|
+
* closes the drawer -- mirrors `<lyra-app-rail>` closing its mobile
|
|
193
|
+
* overlay when `mode` leaves `'mobile'` while open. */
|
|
194
|
+
private applyCollapseStateChange;
|
|
88
195
|
private get storageFullKey();
|
|
89
196
|
private loadPersisted;
|
|
90
197
|
private persist;
|
|
@@ -118,8 +225,12 @@ export declare class LyraSplit extends LyraElement {
|
|
|
118
225
|
* meaningful to resize against while the pane is rail/floating-width). */
|
|
119
226
|
private isDividerDisabled;
|
|
120
227
|
/** Classifies a measured container width into the collapsing pane's
|
|
121
|
-
* responsive state and, only on an actual transition,
|
|
122
|
-
* `
|
|
228
|
+
* responsive state and, only on an actual transition, applies it (via the
|
|
229
|
+
* same `applyCollapseStateChange()` the accessor's forced-value path
|
|
230
|
+
* uses). Gated behind `_forced` so a pinned `collapseState` is never
|
|
231
|
+
* silently overwritten by a subsequent resize — this is also what the
|
|
232
|
+
* accessor's `'auto'` release calls (with the current measured width) to
|
|
233
|
+
* re-derive the state without duplicating the width-vs-breakpoint logic. */
|
|
123
234
|
private updateCollapseState;
|
|
124
235
|
/** Creates (idempotently) and (re-)observes `[part="base"]` with the
|
|
125
236
|
* collapse-state `ResizeObserver` — a no-op until `baseEl` exists (see
|
|
@@ -130,17 +241,33 @@ export declare class LyraSplit extends LyraElement {
|
|
|
130
241
|
* lyra-virtual-list's `containerResizeObserver` synchronous initial read. */
|
|
131
242
|
private armCollapseObserver;
|
|
132
243
|
/** Reacts to a live `collapse` property change (as opposed to the
|
|
133
|
-
* connect/first-render arming above): turns the observer on/off
|
|
134
|
-
*
|
|
135
|
-
*
|
|
244
|
+
* connect/first-render arming above): turns the observer on/off. The
|
|
245
|
+
* `collapseState` reset for the `'none'` case lives in `willUpdate()`
|
|
246
|
+
* instead (see its doc comment) so no stale rail/floating styling
|
|
247
|
+
* survives switching collapse off, without the extra render pass a
|
|
248
|
+
* property set here would cost. */
|
|
136
249
|
private syncCollapseObserver;
|
|
137
|
-
/**
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
|
|
250
|
+
/** The safe fallback for a shared percent minimum. A value above the
|
|
251
|
+
* available share is still useful as a consumer intent, but it cannot be
|
|
252
|
+
* honored for every panel at once, so reduce it proportionally. */
|
|
253
|
+
private normalizedDefaultMin;
|
|
254
|
+
/** Resolves all panel bounds together so aggregate feasibility is checked
|
|
255
|
+
* before an individual divider is asked to clamp a pair. An invalid set is
|
|
256
|
+
* rejected as a whole: interaction uses the safe shared minimum instead of
|
|
257
|
+
* exposing a divider whose minimum is greater than its maximum. */
|
|
258
|
+
private resolveConstraintBounds;
|
|
141
259
|
private percentBounds;
|
|
142
260
|
private clampPair;
|
|
143
261
|
private applyDelta;
|
|
262
|
+
/** The collapsing pane's light-DOM element itself — the `'floating'`
|
|
263
|
+
* drawer's focus-trap/backdrop target. There's no separate shadow-DOM
|
|
264
|
+
* panel to trap focus within (unlike `<lyra-app-rail>`'s `[part="panel"]`):
|
|
265
|
+
* the slotted panel *is* the floating drawer, just repositioned via
|
|
266
|
+
* inline styles in `updated()`. */
|
|
267
|
+
private get floatingPanelEl();
|
|
268
|
+
private activateFloatingOverlay;
|
|
269
|
+
private deactivateFloatingOverlay;
|
|
270
|
+
private onBackdropClick;
|
|
144
271
|
private onPointerDown;
|
|
145
272
|
private onPointerMove;
|
|
146
273
|
private onPointerUp;
|