@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
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { type PropertyValues, type TemplateResult } from 'lit';
|
|
2
2
|
import { LyraElement } from '../../internal/lyra-element.js';
|
|
3
3
|
import { type CalendarDay } from './calendar-grid.js';
|
|
4
|
+
/**
|
|
5
|
+
* A linear RGB ramp cannot contain more than 256 visually distinct integer
|
|
6
|
+
* steps on any channel. Keeping the bucket count within that bound avoids an
|
|
7
|
+
* untrusted attribute/property value turning the ramp into an unbounded
|
|
8
|
+
* allocation without discarding any useful color resolution.
|
|
9
|
+
*/
|
|
10
|
+
export declare const MAX_BUCKET_COUNT = 256;
|
|
4
11
|
/** A cell cursor in matrix mode. */
|
|
5
12
|
export interface MatrixCellPos {
|
|
6
13
|
row: number;
|
|
@@ -30,6 +37,13 @@ export interface HeatmapAnnotation {
|
|
|
30
37
|
* string to `0` via `Number.parseInt(..., 16)` returning `NaN`).
|
|
31
38
|
*/
|
|
32
39
|
export declare function hexToRgb(hex: string): [number, number, number] | null;
|
|
40
|
+
/**
|
|
41
|
+
* Normalizes a bucket count to the safe, renderable range. Non-finite values
|
|
42
|
+
* restore the public default; finite values are floored and clamped to
|
|
43
|
+
* `[2, MAX_BUCKET_COUNT]`. Flooring keeps the ramp array's length in exact
|
|
44
|
+
* agreement with the count used by `quartileBucket()`.
|
|
45
|
+
*/
|
|
46
|
+
export declare function normalizeBucketCount(bucketCount: number): number;
|
|
33
47
|
/**
|
|
34
48
|
* Resolves any syntactically valid CSS `<color>` — hex, `rgb()`, `hsl()`,
|
|
35
49
|
* `oklch()`, a named color, etc. — to an `[r, g, b]` triple.
|
|
@@ -54,12 +68,16 @@ export declare function mixColor(fromColor: string, toColor: string, t: number):
|
|
|
54
68
|
* - `"matrix"` (default): a `rowLabels` x `colLabels` grid of `values`. `-1`
|
|
55
69
|
* (or any non-finite value) is treated as "no data". `scale="sqrt"`
|
|
56
70
|
* compresses the ramp via `sqrtStep()` so one heavy cell doesn't wash out
|
|
57
|
-
* the rest; the default `"linear"` scale maps linearly instead.
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* `
|
|
61
|
-
*
|
|
62
|
-
*
|
|
71
|
+
* the rest; the default `"linear"` scale maps linearly instead.
|
|
72
|
+
* - `"calendar"`: a GitHub-style Sunday-Saturday (or `firstDayOfWeek`-anchored
|
|
73
|
+
* — see below) x week grid built from `days`. `scale` governs its
|
|
74
|
+
* bucketing too: the default `"linear"` buckets by `quartileBucket()`
|
|
75
|
+
* (today's original behavior, unchanged); `"sqrt"` instead compresses via
|
|
76
|
+
* the same `sqrtStep()` magnitude compression matrix mode uses, so one
|
|
77
|
+
* heavy day doesn't wash out the rest. As in matrix mode, a cell whose
|
|
78
|
+
* `value` is negative or non-finite is treated as "no data" rather than
|
|
79
|
+
* being bucketed — as is a grid position with no matching entry in `days`
|
|
80
|
+
* at all (a gap in a sparse calendar).
|
|
63
81
|
*
|
|
64
82
|
* The sequential color ramp's endpoints are read from the
|
|
65
83
|
* `--lyra-heatmap-scale-lo`/`-hi` custom properties (declared in
|
|
@@ -83,7 +101,21 @@ export declare function mixColor(fromColor: string, toColor: string, t: number):
|
|
|
83
101
|
* week column — drawing, hit-testing, the focus ring, and month-label
|
|
84
102
|
* positioning all consult it consistently, so a consumer can pixel-align a
|
|
85
103
|
* calendar's week columns with a sibling chart's coordinate system. Unset
|
|
86
|
-
* (the default) keeps the original evenly-spaced formula.
|
|
104
|
+
* (the default) keeps the original evenly-spaced formula. `rowY` is its
|
|
105
|
+
* calendar-mode vertical analogue — overrides the y-origin computed for each
|
|
106
|
+
* weekday row, consulted consistently by drawing, hit-testing, and the focus
|
|
107
|
+
* ring via the private `rowYFor()` helper (mirroring `columnXFor()` exactly).
|
|
108
|
+
*
|
|
109
|
+
* `firstDayOfWeek` (calendar mode only, default `0`/Sunday, no-op in matrix
|
|
110
|
+
* mode) anchors the calendar grid at a different weekday — `0`-`6`, same
|
|
111
|
+
* numbering as `CalendarCellPos.weekday` (`0` Sunday .. `6` Saturday) —
|
|
112
|
+
* threaded into `buildCalendarGrid()`.
|
|
113
|
+
*
|
|
114
|
+
* `cellSize`/`fitToWidth` (previously matrix-mode only) also drive calendar
|
|
115
|
+
* mode's per-cell size: unset, calendar mode keeps today's original 11px
|
|
116
|
+
* cell size unchanged; explicitly set, the same fixed size (or, with
|
|
117
|
+
* `fitToWidth`, the same host-width-derived size matrix mode already
|
|
118
|
+
* supports) governs calendar mode's grid too.
|
|
87
119
|
*
|
|
88
120
|
* @customElement lyra-heatmap
|
|
89
121
|
* @event lyra-cell-click - Fired on click, or Enter/Space on the
|
|
@@ -91,28 +123,67 @@ export declare function mixColor(fromColor: string, toColor: string, t: number):
|
|
|
91
123
|
* `detail: { date, value }` in calendar mode. `cellText` overrides the
|
|
92
124
|
* built-in English "Row X, Col Y: value" / "Mon DD: value" template used for
|
|
93
125
|
* both the hover tooltip and the keyboard live-region announcement.
|
|
94
|
-
* @csspart base
|
|
126
|
+
* @csspart base - The heatmap wrapper.
|
|
127
|
+
* @csspart canvas - The heatmap canvas.
|
|
128
|
+
* @csspart tooltip - The hover tooltip.
|
|
129
|
+
* @csspart live-region - The visually hidden keyboard announcement region.
|
|
130
|
+
* @csspart legend - The color legend.
|
|
131
|
+
* @csspart legend-lo - The low legend endpoint.
|
|
132
|
+
* @csspart legend-hi - The high legend endpoint.
|
|
133
|
+
* @csspart legend-annotation - An annotation label.
|
|
95
134
|
*/
|
|
96
135
|
export declare class LyraHeatmap extends LyraElement {
|
|
97
136
|
static styles: import("lit").CSSResultGroup[];
|
|
98
137
|
rowLabels: string[];
|
|
99
138
|
colLabels: string[];
|
|
100
139
|
values: number[][];
|
|
101
|
-
|
|
140
|
+
private _cellSize?;
|
|
141
|
+
/**
|
|
142
|
+
* Effective per-cell size (CSS px). Originally matrix-mode only; now also
|
|
143
|
+
* governs calendar mode's cell size (replacing the previously hardcoded
|
|
144
|
+
* 11px constant there) once explicitly set. Left unset, each mode keeps
|
|
145
|
+
* its own original default — `DEFAULT_MATRIX_CELL_SIZE` (22) in matrix
|
|
146
|
+
* mode, `CAL_CELL` (11) in calendar mode — so an existing consumer who
|
|
147
|
+
* never touches `cellSize` sees no change in either mode. Set explicitly
|
|
148
|
+
* (attribute or property), the same value governs both modes alike.
|
|
149
|
+
*/
|
|
150
|
+
get cellSize(): number;
|
|
151
|
+
set cellSize(value: number);
|
|
102
152
|
valueLabel: string;
|
|
153
|
+
/**
|
|
154
|
+
* `"linear"` (default) maps values linearly to the color ramp in matrix
|
|
155
|
+
* mode, and buckets calendar-mode values via `quartileBucket()` — both
|
|
156
|
+
* unchanged from before this property governed calendar mode too.
|
|
157
|
+
* `"sqrt"` compresses via `sqrtStep()`'s square-root magnitude compression
|
|
158
|
+
* instead, in *both* modes, so one heavy cell/day doesn't wash out the
|
|
159
|
+
* rest of a skewed dataset.
|
|
160
|
+
*/
|
|
103
161
|
scale: 'linear' | 'sqrt';
|
|
104
162
|
/**
|
|
105
163
|
* When set, `cellSize` is derived from the host's measured `clientWidth`
|
|
106
164
|
* on every draw (including ResizeObserver-triggered redraws) instead of
|
|
107
165
|
* the fixed `cell-size` attribute, so the grid actually fills the
|
|
108
166
|
* available width. Without this, canvas dimensions are computed purely
|
|
109
|
-
* from `PAD_LEFT + cols * cellSize
|
|
110
|
-
*
|
|
167
|
+
* from `PAD_LEFT + cols * cellSize` (matrix mode) or
|
|
168
|
+
* `CAL_PAD_LEFT + weekCount * cellSize` (calendar mode), so a
|
|
169
|
+
* resize-triggered redraw is a geometric no-op. Originally matrix-mode
|
|
170
|
+
* only; now applies to calendar mode too.
|
|
111
171
|
*/
|
|
112
172
|
fitToWidth: boolean;
|
|
113
173
|
mode: 'matrix' | 'calendar';
|
|
114
174
|
days: CalendarDay[];
|
|
115
|
-
|
|
175
|
+
/**
|
|
176
|
+
* Calendar mode only (no-op in matrix mode): anchors the calendar grid at
|
|
177
|
+
* a different weekday instead of always Sunday — `0`-`6`, same numbering
|
|
178
|
+
* as `CalendarCellPos.weekday` (`0` Sunday .. `6` Saturday, matching
|
|
179
|
+
* `CalendarCell.weekday`'s existing convention). Threaded into
|
|
180
|
+
* `buildCalendarGrid()`. Defaults to `0` (Sunday), unchanged from before
|
|
181
|
+
* this property existed.
|
|
182
|
+
*/
|
|
183
|
+
firstDayOfWeek: number;
|
|
184
|
+
private _bucketCount;
|
|
185
|
+
get bucketCount(): number;
|
|
186
|
+
set bucketCount(value: number);
|
|
116
187
|
/** Cells to ring-highlight — `row`/`col` in matrix mode, `date` in calendar mode. See `HeatmapAnnotation`. */
|
|
117
188
|
annotations: HeatmapAnnotation[];
|
|
118
189
|
/** Formats the per-cell tooltip and keyboard live-region text — receives the cell position
|
|
@@ -132,11 +203,44 @@ export declare class LyraHeatmap extends LyraElement {
|
|
|
132
203
|
* formula unchanged. Ignored in matrix mode.
|
|
133
204
|
*/
|
|
134
205
|
columnX?: (index: number) => number;
|
|
206
|
+
/**
|
|
207
|
+
* Calendar mode only: overrides the y-origin (canvas-local CSS px) of
|
|
208
|
+
* weekday row `weekday` (0-based, same indexing as
|
|
209
|
+
* `CalendarCellPos.weekday`). The vertical analogue of `columnX` — consulted
|
|
210
|
+
* consistently by every calendar-mode geometry call site that computes a
|
|
211
|
+
* cell's y-coordinate from its weekday — drawing, hit-testing, and the
|
|
212
|
+
* keyboard focus ring — via the private `rowYFor()` helper (mirroring
|
|
213
|
+
* `columnXFor()`'s exact dispatch-with-computed-fallback shape). Also
|
|
214
|
+
* consulted at `weekday = 7` (one past the last row) to size the canvas's
|
|
215
|
+
* height, mirroring how `columnX` is consulted at `week = weekCount` to
|
|
216
|
+
* size its width — so a function that spaces rows out further than the
|
|
217
|
+
* default formula still gets a canvas tall enough to paint every row.
|
|
218
|
+
* Unset (the default) keeps today's evenly-spaced `CAL_LABEL_H + weekday *
|
|
219
|
+
* (cellSize + CAL_GAP)` formula unchanged. Ignored in matrix mode.
|
|
220
|
+
*/
|
|
221
|
+
rowY?: (weekday: number) => number;
|
|
135
222
|
private canvas?;
|
|
136
223
|
private resizeObserver?;
|
|
224
|
+
private drawRafId?;
|
|
137
225
|
private dprQuery?;
|
|
226
|
+
private colorSchemeQuery?;
|
|
227
|
+
private themeObserver?;
|
|
228
|
+
private themeRefreshQueued;
|
|
138
229
|
/** The current value range, refreshed once per update cycle by `willUpdate()`. See `computeValueRange()`. */
|
|
139
230
|
private cachedValueRange;
|
|
231
|
+
/**
|
|
232
|
+
* The calendar-mode grid layout, refreshed by `willUpdate()` only when
|
|
233
|
+
* `days` actually changes (see `computeValueRange()`'s twin comment above)
|
|
234
|
+
* — `buildCalendarGrid()` parses every date, filters invalid ones, and does
|
|
235
|
+
* a full `.slice().sort()` for month labels, so recomputing it from
|
|
236
|
+
* `drawCalendar()`, `hitTestCalendar()`, `calendarCellAt()`, and
|
|
237
|
+
* `onCalendarKeyDown()` independently would redo that work 2-4x for a
|
|
238
|
+
* single hover/click/keydown.
|
|
239
|
+
*/
|
|
240
|
+
private cachedCalendarGrid;
|
|
241
|
+
private cachedCalendarSortedValues;
|
|
242
|
+
private cachedCalendarCellsByPos;
|
|
243
|
+
private cachedRamp;
|
|
140
244
|
/** The cell currently under the pointer (`null` when not hovering one) — drives `[part="tooltip"]`. */
|
|
141
245
|
private hoverCell;
|
|
142
246
|
/** The roving keyboard-focus cell cursor, moved by arrow keys — drives the
|
|
@@ -161,6 +265,9 @@ export declare class LyraHeatmap extends LyraElement {
|
|
|
161
265
|
disconnectedCallback(): void;
|
|
162
266
|
private watchDpr;
|
|
163
267
|
private onDprChange;
|
|
268
|
+
private onColorSchemeChange;
|
|
269
|
+
private queueThemeRefresh;
|
|
270
|
+
private watchTheme;
|
|
164
271
|
protected willUpdate(changed: PropertyValues): void;
|
|
165
272
|
/**
|
|
166
273
|
* The real (non-no-data) value range across `values` (or `days` in
|
|
@@ -172,7 +279,9 @@ export declare class LyraHeatmap extends LyraElement {
|
|
|
172
279
|
* suffices instead of one per consumer.
|
|
173
280
|
*/
|
|
174
281
|
private computeValueRange;
|
|
175
|
-
protected updated(): void;
|
|
282
|
+
protected updated(changed: PropertyValues): void;
|
|
283
|
+
/** Redraws canvas content after an upstream token or theme change. */
|
|
284
|
+
refreshTheme(): void;
|
|
176
285
|
/** Reads the customizable ramp endpoints off the host's computed style. */
|
|
177
286
|
private scaleEndpoints;
|
|
178
287
|
/** Resolves the `--lyra-color-text-quiet` chrome token for axis labels. */
|
|
@@ -186,16 +295,39 @@ export declare class LyraHeatmap extends LyraElement {
|
|
|
186
295
|
/** Reads the customizable canvas-drawn annotation-ring stroke color off the host's computed style. */
|
|
187
296
|
private annotationColor;
|
|
188
297
|
private draw;
|
|
298
|
+
private scheduleDraw;
|
|
299
|
+
private colorRamp;
|
|
300
|
+
/**
|
|
301
|
+
* Effective per-cell size in calendar mode — mirrors `matrixCellSize()`
|
|
302
|
+
* exactly: `fitToWidth` derives it from the host's measured width,
|
|
303
|
+
* otherwise it's the (possibly explicitly-set) `cellSize` property, which
|
|
304
|
+
* itself falls back to today's original 11px calendar default when left
|
|
305
|
+
* unset (see `cellSize`'s accessor doc comment). Shared by `columnXFor()`,
|
|
306
|
+
* `rowYFor()`, `drawCalendar()`, and the hit-testing below (`weekAtX()`,
|
|
307
|
+
* `weekdayAtY()`, `cellRect()`) so they always agree on exactly the same
|
|
308
|
+
* geometry as what's actually painted.
|
|
309
|
+
*/
|
|
310
|
+
private calendarCellSize;
|
|
189
311
|
/**
|
|
190
312
|
* Calendar-mode week-column x-origin (canvas-local CSS px) — `columnX(week)`
|
|
191
|
-
* when set, otherwise the original evenly-spaced formula
|
|
192
|
-
*
|
|
313
|
+
* when set, otherwise the original evenly-spaced formula (now derived from
|
|
314
|
+
* `calendarCellSize()` rather than the fixed `CAL_CELL` constant). Shared
|
|
315
|
+
* by every calendar-mode drawing and hit-testing call site (`drawCalendar()`,
|
|
193
316
|
* `hitTestCalendar()`/`weekAtX()`, `cellRect()`) so painted geometry and
|
|
194
317
|
* interactive hit-testing never disagree — mirrors the existing
|
|
195
318
|
* `matrixCellSize()` invariant for matrix mode's
|
|
196
319
|
* `drawMatrix()`/`hitTestMatrix()`/`cellRect()`.
|
|
197
320
|
*/
|
|
198
321
|
private columnXFor;
|
|
322
|
+
/**
|
|
323
|
+
* Calendar-mode weekday-row y-origin (canvas-local CSS px) — `rowY(weekday)`
|
|
324
|
+
* when set, otherwise the original evenly-spaced formula (now derived from
|
|
325
|
+
* `calendarCellSize()` rather than the fixed `CAL_CELL` constant). The
|
|
326
|
+
* vertical analogue of `columnXFor()`, mirroring its exact
|
|
327
|
+
* dispatch-with-computed-fallback shape and shared by the same
|
|
328
|
+
* drawing/hit-testing/focus-ring call sites.
|
|
329
|
+
*/
|
|
330
|
+
private rowYFor;
|
|
199
331
|
/**
|
|
200
332
|
* Inverse of `columnXFor()`: resolves an x position (canvas-local CSS px)
|
|
201
333
|
* to the week column it falls in, or `null` if it's outside every column
|
|
@@ -208,16 +340,25 @@ export declare class LyraHeatmap extends LyraElement {
|
|
|
208
340
|
*/
|
|
209
341
|
private weekAtX;
|
|
210
342
|
/**
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
* (
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
*
|
|
220
|
-
*
|
|
343
|
+
* Inverse of `rowYFor()`: resolves a y position (canvas-local CSS px) to
|
|
344
|
+
* the weekday row it falls in (0-6), or `null` if it's outside every row.
|
|
345
|
+
* Mirrors `weekAtX()`'s closed-form-vs-scan split for the same reason: the
|
|
346
|
+
* default spacing has a closed-form inverse; an arbitrary `rowY` override
|
|
347
|
+
* doesn't.
|
|
348
|
+
*/
|
|
349
|
+
private weekdayAtY;
|
|
350
|
+
/**
|
|
351
|
+
* Locale-derived weekday-axis labels for the 7 rows drawn down the left of
|
|
352
|
+
* the calendar grid. Only indices 1, 3, and 5 (relative to `firstWeekStart`)
|
|
353
|
+
* are filled in — matching today's sparse every-other-day label density —
|
|
354
|
+
* the rest stay blank. `firstWeekStart` is always the UTC
|
|
355
|
+
* `firstDayOfWeek`-weekday by construction (see `buildCalendarGrid()`), so
|
|
356
|
+
* weekday index 0..6 is a fixed positional mapping relative to it (with the
|
|
357
|
+
* default `firstDayOfWeek` of 0, that's the original Sun..Sat mapping,
|
|
358
|
+
* unchanged); only the label *text* for indices 1/3/5 is derived here, via
|
|
359
|
+
* `Intl.DateTimeFormat` on a real UTC date that actually falls on that
|
|
360
|
+
* weekday, so it follows the runtime locale instead of a hardcoded English
|
|
361
|
+
* array (see `calendarCellText()`'s tooltip text for the same pattern).
|
|
221
362
|
*/
|
|
222
363
|
private weekdayLabels;
|
|
223
364
|
private drawCalendar;
|