@vielzeug/codex 26.10.1 → 26.10.2
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/data/catalog.json +45 -43
- package/data/llms-full.txt +152 -1
- package/data/llms.txt +1 -1
- package/data/manifest.json +1 -1
- package/data/packages/focus.json +7 -4
- package/data/packages/prism.json +2 -2
- package/data/search.json +8 -8
- package/package.json +2 -2
package/data/catalog.json
CHANGED
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"coins"
|
|
74
74
|
],
|
|
75
75
|
"slug": "arsenal",
|
|
76
|
-
"version": "26.10.
|
|
76
|
+
"version": "26.10.1"
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
"availableDocPages": [
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"refine"
|
|
124
124
|
],
|
|
125
125
|
"slug": "assay",
|
|
126
|
-
"version": "26.10.
|
|
126
|
+
"version": "26.10.1"
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
129
|
"availableDocPages": [
|
|
@@ -165,7 +165,7 @@
|
|
|
165
165
|
"ward"
|
|
166
166
|
],
|
|
167
167
|
"slug": "clockwork",
|
|
168
|
-
"version": "26.10.
|
|
168
|
+
"version": "26.10.1"
|
|
169
169
|
},
|
|
170
170
|
{
|
|
171
171
|
"availableDocPages": [
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
"refine"
|
|
198
198
|
],
|
|
199
199
|
"slug": "codex",
|
|
200
|
-
"version": "26.10.
|
|
200
|
+
"version": "26.10.1"
|
|
201
201
|
},
|
|
202
202
|
{
|
|
203
203
|
"availableDocPages": [
|
|
@@ -267,7 +267,7 @@
|
|
|
267
267
|
"spell"
|
|
268
268
|
],
|
|
269
269
|
"slug": "coins",
|
|
270
|
-
"version": "26.10.
|
|
270
|
+
"version": "26.10.1"
|
|
271
271
|
},
|
|
272
272
|
{
|
|
273
273
|
"availableDocPages": [
|
|
@@ -308,7 +308,7 @@
|
|
|
308
308
|
"rune"
|
|
309
309
|
],
|
|
310
310
|
"slug": "conduit",
|
|
311
|
-
"version": "26.10.
|
|
311
|
+
"version": "26.10.1"
|
|
312
312
|
},
|
|
313
313
|
{
|
|
314
314
|
"availableDocPages": [
|
|
@@ -353,7 +353,7 @@
|
|
|
353
353
|
"postmaster"
|
|
354
354
|
],
|
|
355
355
|
"slug": "courier",
|
|
356
|
-
"version": "26.10.
|
|
356
|
+
"version": "26.10.1"
|
|
357
357
|
},
|
|
358
358
|
{
|
|
359
359
|
"availableDocPages": [
|
|
@@ -399,7 +399,7 @@
|
|
|
399
399
|
"refine"
|
|
400
400
|
],
|
|
401
401
|
"slug": "dnd",
|
|
402
|
-
"version": "26.10.
|
|
402
|
+
"version": "26.10.1"
|
|
403
403
|
},
|
|
404
404
|
{
|
|
405
405
|
"availableDocPages": [
|
|
@@ -441,7 +441,7 @@
|
|
|
441
441
|
"herald"
|
|
442
442
|
],
|
|
443
443
|
"slug": "familiar",
|
|
444
|
-
"version": "26.10.
|
|
444
|
+
"version": "26.10.1"
|
|
445
445
|
},
|
|
446
446
|
{
|
|
447
447
|
"availableDocPages": [
|
|
@@ -508,7 +508,7 @@
|
|
|
508
508
|
"courier"
|
|
509
509
|
],
|
|
510
510
|
"slug": "flux",
|
|
511
|
-
"version": "26.10.
|
|
511
|
+
"version": "26.10.1"
|
|
512
512
|
},
|
|
513
513
|
{
|
|
514
514
|
"availableDocPages": [
|
|
@@ -526,6 +526,7 @@
|
|
|
526
526
|
"exports": [
|
|
527
527
|
"createListNavigation",
|
|
528
528
|
"createGridNavigation",
|
|
529
|
+
"createQuickLookGrid",
|
|
529
530
|
"captureFocus",
|
|
530
531
|
"restoreFocus",
|
|
531
532
|
"rescueFocus"
|
|
@@ -537,7 +538,8 @@
|
|
|
537
538
|
"keyboard",
|
|
538
539
|
"accessibility",
|
|
539
540
|
"list navigation",
|
|
540
|
-
"grid navigation"
|
|
541
|
+
"grid navigation",
|
|
542
|
+
"quick look"
|
|
541
543
|
],
|
|
542
544
|
"name": "@vielzeug/focus",
|
|
543
545
|
"related": [
|
|
@@ -546,7 +548,7 @@
|
|
|
546
548
|
"ore"
|
|
547
549
|
],
|
|
548
550
|
"slug": "focus",
|
|
549
|
-
"version": "26.10.
|
|
551
|
+
"version": "26.10.1"
|
|
550
552
|
},
|
|
551
553
|
{
|
|
552
554
|
"availableDocPages": [
|
|
@@ -587,7 +589,7 @@
|
|
|
587
589
|
"assay"
|
|
588
590
|
],
|
|
589
591
|
"slug": "forge",
|
|
590
|
-
"version": "26.10.
|
|
592
|
+
"version": "26.10.1"
|
|
591
593
|
},
|
|
592
594
|
{
|
|
593
595
|
"availableDocPages": [
|
|
@@ -625,7 +627,7 @@
|
|
|
625
627
|
"keymap"
|
|
626
628
|
],
|
|
627
629
|
"slug": "gesture",
|
|
628
|
-
"version": "26.10.
|
|
630
|
+
"version": "26.10.1"
|
|
629
631
|
},
|
|
630
632
|
{
|
|
631
633
|
"availableDocPages": [
|
|
@@ -669,7 +671,7 @@
|
|
|
669
671
|
"familiar"
|
|
670
672
|
],
|
|
671
673
|
"slug": "herald",
|
|
672
|
-
"version": "26.10.
|
|
674
|
+
"version": "26.10.1"
|
|
673
675
|
},
|
|
674
676
|
{
|
|
675
677
|
"availableDocPages": [
|
|
@@ -712,7 +714,7 @@
|
|
|
712
714
|
"tempo"
|
|
713
715
|
],
|
|
714
716
|
"slug": "illusionist",
|
|
715
|
-
"version": "26.10.
|
|
717
|
+
"version": "26.10.1"
|
|
716
718
|
},
|
|
717
719
|
{
|
|
718
720
|
"availableDocPages": [
|
|
@@ -757,7 +759,7 @@
|
|
|
757
759
|
"ore"
|
|
758
760
|
],
|
|
759
761
|
"slug": "keymap",
|
|
760
|
-
"version": "26.10.
|
|
762
|
+
"version": "26.10.1"
|
|
761
763
|
},
|
|
762
764
|
{
|
|
763
765
|
"availableDocPages": [
|
|
@@ -804,7 +806,7 @@
|
|
|
804
806
|
"vault"
|
|
805
807
|
],
|
|
806
808
|
"slug": "ledger",
|
|
807
|
-
"version": "26.10.
|
|
809
|
+
"version": "26.10.1"
|
|
808
810
|
},
|
|
809
811
|
{
|
|
810
812
|
"availableDocPages": [
|
|
@@ -850,7 +852,7 @@
|
|
|
850
852
|
"courier"
|
|
851
853
|
],
|
|
852
854
|
"slug": "lingua",
|
|
853
|
-
"version": "26.10.
|
|
855
|
+
"version": "26.10.1"
|
|
854
856
|
},
|
|
855
857
|
{
|
|
856
858
|
"availableDocPages": [
|
|
@@ -888,7 +890,7 @@
|
|
|
888
890
|
"herald"
|
|
889
891
|
],
|
|
890
892
|
"slug": "mesh",
|
|
891
|
-
"version": "26.10.
|
|
893
|
+
"version": "26.10.1"
|
|
892
894
|
},
|
|
893
895
|
{
|
|
894
896
|
"availableDocPages": [
|
|
@@ -925,7 +927,7 @@
|
|
|
925
927
|
"ore"
|
|
926
928
|
],
|
|
927
929
|
"slug": "necromancer",
|
|
928
|
-
"version": "26.10.
|
|
930
|
+
"version": "26.10.1"
|
|
929
931
|
},
|
|
930
932
|
{
|
|
931
933
|
"availableDocPages": [
|
|
@@ -965,7 +967,7 @@
|
|
|
965
967
|
"prism"
|
|
966
968
|
],
|
|
967
969
|
"slug": "orbit",
|
|
968
|
-
"version": "26.10.
|
|
970
|
+
"version": "26.10.1"
|
|
969
971
|
},
|
|
970
972
|
{
|
|
971
973
|
"availableDocPages": [
|
|
@@ -1029,7 +1031,7 @@
|
|
|
1029
1031
|
"orbit"
|
|
1030
1032
|
],
|
|
1031
1033
|
"slug": "ore",
|
|
1032
|
-
"version": "26.10.
|
|
1034
|
+
"version": "26.10.1"
|
|
1033
1035
|
},
|
|
1034
1036
|
{
|
|
1035
1037
|
"availableDocPages": [
|
|
@@ -1073,7 +1075,7 @@
|
|
|
1073
1075
|
"ripple"
|
|
1074
1076
|
],
|
|
1075
1077
|
"slug": "postmaster",
|
|
1076
|
-
"version": "26.10.
|
|
1078
|
+
"version": "26.10.1"
|
|
1077
1079
|
},
|
|
1078
1080
|
{
|
|
1079
1081
|
"availableDocPages": [
|
|
@@ -1116,7 +1118,7 @@
|
|
|
1116
1118
|
"orbit"
|
|
1117
1119
|
],
|
|
1118
1120
|
"slug": "prism",
|
|
1119
|
-
"version": "26.10.
|
|
1121
|
+
"version": "26.10.1"
|
|
1120
1122
|
},
|
|
1121
1123
|
{
|
|
1122
1124
|
"availableDocPages": [
|
|
@@ -1180,7 +1182,7 @@
|
|
|
1180
1182
|
"clockwork"
|
|
1181
1183
|
],
|
|
1182
1184
|
"slug": "pulse",
|
|
1183
|
-
"version": "26.10.
|
|
1185
|
+
"version": "26.10.1"
|
|
1184
1186
|
},
|
|
1185
1187
|
{
|
|
1186
1188
|
"availableDocPages": [
|
|
@@ -1298,7 +1300,7 @@
|
|
|
1298
1300
|
"keymap"
|
|
1299
1301
|
],
|
|
1300
1302
|
"slug": "refine",
|
|
1301
|
-
"version": "26.10.
|
|
1303
|
+
"version": "26.10.1"
|
|
1302
1304
|
},
|
|
1303
1305
|
{
|
|
1304
1306
|
"availableDocPages": [
|
|
@@ -1351,7 +1353,7 @@
|
|
|
1351
1353
|
"ledger"
|
|
1352
1354
|
],
|
|
1353
1355
|
"slug": "ripple",
|
|
1354
|
-
"version": "26.10.
|
|
1356
|
+
"version": "26.10.1"
|
|
1355
1357
|
},
|
|
1356
1358
|
{
|
|
1357
1359
|
"availableDocPages": [
|
|
@@ -1405,7 +1407,7 @@
|
|
|
1405
1407
|
"familiar"
|
|
1406
1408
|
],
|
|
1407
1409
|
"slug": "rune",
|
|
1408
|
-
"version": "26.10.
|
|
1410
|
+
"version": "26.10.1"
|
|
1409
1411
|
},
|
|
1410
1412
|
{
|
|
1411
1413
|
"availableDocPages": [
|
|
@@ -1446,7 +1448,7 @@
|
|
|
1446
1448
|
"refine"
|
|
1447
1449
|
],
|
|
1448
1450
|
"slug": "sandbox",
|
|
1449
|
-
"version": "26.10.
|
|
1451
|
+
"version": "26.10.1"
|
|
1450
1452
|
},
|
|
1451
1453
|
{
|
|
1452
1454
|
"availableDocPages": [
|
|
@@ -1497,7 +1499,7 @@
|
|
|
1497
1499
|
"ripple"
|
|
1498
1500
|
],
|
|
1499
1501
|
"slug": "scout",
|
|
1500
|
-
"version": "26.10.
|
|
1502
|
+
"version": "26.10.1"
|
|
1501
1503
|
},
|
|
1502
1504
|
{
|
|
1503
1505
|
"availableDocPages": [
|
|
@@ -1550,7 +1552,7 @@
|
|
|
1550
1552
|
"refine"
|
|
1551
1553
|
],
|
|
1552
1554
|
"slug": "scroll",
|
|
1553
|
-
"version": "26.10.
|
|
1555
|
+
"version": "26.10.1"
|
|
1554
1556
|
},
|
|
1555
1557
|
{
|
|
1556
1558
|
"availableDocPages": [
|
|
@@ -1597,7 +1599,7 @@
|
|
|
1597
1599
|
"gesture"
|
|
1598
1600
|
],
|
|
1599
1601
|
"slug": "sentinel",
|
|
1600
|
-
"version": "26.10.
|
|
1602
|
+
"version": "26.10.1"
|
|
1601
1603
|
},
|
|
1602
1604
|
{
|
|
1603
1605
|
"availableDocPages": [
|
|
@@ -1637,7 +1639,7 @@
|
|
|
1637
1639
|
"refine"
|
|
1638
1640
|
],
|
|
1639
1641
|
"slug": "sigil",
|
|
1640
|
-
"version": "26.10.
|
|
1642
|
+
"version": "26.10.1"
|
|
1641
1643
|
},
|
|
1642
1644
|
{
|
|
1643
1645
|
"availableDocPages": [
|
|
@@ -1701,7 +1703,7 @@
|
|
|
1701
1703
|
"wayfinder"
|
|
1702
1704
|
],
|
|
1703
1705
|
"slug": "sourcerer",
|
|
1704
|
-
"version": "26.10.
|
|
1706
|
+
"version": "26.10.1"
|
|
1705
1707
|
},
|
|
1706
1708
|
{
|
|
1707
1709
|
"availableDocPages": [
|
|
@@ -1760,7 +1762,7 @@
|
|
|
1760
1762
|
"vault"
|
|
1761
1763
|
],
|
|
1762
1764
|
"slug": "spell",
|
|
1763
|
-
"version": "26.10.
|
|
1765
|
+
"version": "26.10.1"
|
|
1764
1766
|
},
|
|
1765
1767
|
{
|
|
1766
1768
|
"availableDocPages": [
|
|
@@ -1799,7 +1801,7 @@
|
|
|
1799
1801
|
"ripple"
|
|
1800
1802
|
],
|
|
1801
1803
|
"slug": "tandem",
|
|
1802
|
-
"version": "26.10.
|
|
1804
|
+
"version": "26.10.1"
|
|
1803
1805
|
},
|
|
1804
1806
|
{
|
|
1805
1807
|
"availableDocPages": [
|
|
@@ -1840,7 +1842,7 @@
|
|
|
1840
1842
|
"herald"
|
|
1841
1843
|
],
|
|
1842
1844
|
"slug": "tavern",
|
|
1843
|
-
"version": "26.10.
|
|
1845
|
+
"version": "26.10.1"
|
|
1844
1846
|
},
|
|
1845
1847
|
{
|
|
1846
1848
|
"availableDocPages": [
|
|
@@ -1908,7 +1910,7 @@
|
|
|
1908
1910
|
"vault"
|
|
1909
1911
|
],
|
|
1910
1912
|
"slug": "tempo",
|
|
1911
|
-
"version": "26.10.
|
|
1913
|
+
"version": "26.10.1"
|
|
1912
1914
|
},
|
|
1913
1915
|
{
|
|
1914
1916
|
"availableDocPages": [
|
|
@@ -1959,7 +1961,7 @@
|
|
|
1959
1961
|
"ripple"
|
|
1960
1962
|
],
|
|
1961
1963
|
"slug": "vault",
|
|
1962
|
-
"version": "26.10.
|
|
1964
|
+
"version": "26.10.1"
|
|
1963
1965
|
},
|
|
1964
1966
|
{
|
|
1965
1967
|
"availableDocPages": [
|
|
@@ -2005,7 +2007,7 @@
|
|
|
2005
2007
|
"refine"
|
|
2006
2008
|
],
|
|
2007
2009
|
"slug": "ward",
|
|
2008
|
-
"version": "26.10.
|
|
2010
|
+
"version": "26.10.1"
|
|
2009
2011
|
},
|
|
2010
2012
|
{
|
|
2011
2013
|
"availableDocPages": [
|
|
@@ -2059,8 +2061,8 @@
|
|
|
2059
2061
|
"herald"
|
|
2060
2062
|
],
|
|
2061
2063
|
"slug": "wayfinder",
|
|
2062
|
-
"version": "26.10.
|
|
2064
|
+
"version": "26.10.1"
|
|
2063
2065
|
}
|
|
2064
2066
|
],
|
|
2065
|
-
"version": "26.10.
|
|
2067
|
+
"version": "26.10.1"
|
|
2066
2068
|
}
|
package/data/llms-full.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Vielzeug: Full Documentation
|
|
2
2
|
|
|
3
|
-
> Complete documentation for 41 packages. Version: 26.10.
|
|
3
|
+
> Complete documentation for 41 packages. Version: 26.10.1
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -6370,6 +6370,7 @@ list.addEventListener('keydown', (event) => {
|
|
|
6370
6370
|
| Zero dependencies | n/a | |
|
|
6371
6371
|
| RTL mirroring | Manual | Built in |
|
|
6372
6372
|
| Grid navigation | Flat only | `createGridNavigation()` |
|
|
6373
|
+
| Quick Look grids | Manual Space handling | `createQuickLookGrid()` |
|
|
6373
6374
|
| Typeahead | Manual | Optional via `typeahead` |
|
|
6374
6375
|
| Focus restoration | Manual capture | `captureFocus()` / `restoreFocus()` |
|
|
6375
6376
|
|
|
@@ -6413,6 +6414,7 @@ container.removeEventListener('keydown', onKeydown);
|
|
|
6413
6414
|
|
|
6414
6415
|
- `createListNavigation()`: pure composite navigation with explicit handled/change results
|
|
6415
6416
|
- `createGridNavigation()`: two-dimensional arrow-key navigation with fixed or measured columns
|
|
6417
|
+
- `createQuickLookGrid()`: tile-grid arrow browsing with a Space preview key for card pickers
|
|
6416
6418
|
- Orientation and direction support: vertical/horizontal/both with LTR/RTL defaults
|
|
6417
6419
|
- Dynamic item queries: disabled filtering and loop control
|
|
6418
6420
|
- Optional typeahead: label-based navigation in key-driven lists
|
|
@@ -6439,6 +6441,7 @@ container.removeEventListener('keydown', onKeydown);
|
|
|
6439
6441
|
| --- | --- | --- | --- |
|
|
6440
6442
|
| `createListNavigation()` | Build keyboard navigation for composite widgets | Sync | Apply returned changes to DOM focus |
|
|
6441
6443
|
| `createGridNavigation()` | Build two-dimensional arrow-key navigation for grids | Sync | Columns resolve per navigation: responsive grids need a getter |
|
|
6444
|
+
| `createQuickLookGrid()` | Build arrow-key tile browsing with a preview key for card grids | Sync | The preview key consumes Space: the focused button never activates |
|
|
6442
6445
|
| `restoreFocus()` | Restore focus to a target or fallback | Sync | Returns `false` when neither target can receive focus |
|
|
6443
6446
|
| `rescueFocus()` | Re-home focus after the focused element unmounts | Sync | Returns `false` when focus is already on a real element |
|
|
6444
6447
|
| `captureFocus()` | Capture active focus for one later restoration | Sync | The returned function is one-shot |
|
|
@@ -6536,6 +6539,41 @@ Unlike `createListNavigation`, items are not skipped when disabled: skipping in
|
|
|
6536
6539
|
|
|
6537
6540
|
---
|
|
6538
6541
|
|
|
6542
|
+
### `createQuickLookGrid()`
|
|
6543
|
+
|
|
6544
|
+
```ts
|
|
6545
|
+
function createQuickLookGrid(options: QuickLookGridOptions): QuickLookGrid;
|
|
6546
|
+
```
|
|
6547
|
+
|
|
6548
|
+
Creates keyboard browsing over a tile grid with a Quick Look key: arrows and Home/End move focus through the items (delegating to `createGridNavigation()`) and `inspectKey` previews the item under the event instead of activating it: the pair every card picker needs.
|
|
6549
|
+
|
|
6550
|
+
| Parameter | Type | Description |
|
|
6551
|
+
| --- | --- | --- |
|
|
6552
|
+
| `options` | `QuickLookGridOptions` | Item lookup, active-index source, column resolution, preview key, wrapping, and inspection callback. |
|
|
6553
|
+
|
|
6554
|
+
**Returns:** `QuickLookGrid`.
|
|
6555
|
+
|
|
6556
|
+
**Example**
|
|
6557
|
+
|
|
6558
|
+
```ts
|
|
6559
|
+
import { createQuickLookGrid } from '@vielzeug/focus';
|
|
6560
|
+
|
|
6561
|
+
const quickLook = createQuickLookGrid({
|
|
6562
|
+
getItems: () => [...grid.querySelectorAll('.tile')],
|
|
6563
|
+
onInspect: (item, index) => previewCard(index),
|
|
6564
|
+
});
|
|
6565
|
+
|
|
6566
|
+
grid.addEventListener('keydown', (event) => quickLook.handleKeydown(event));
|
|
6567
|
+
```
|
|
6568
|
+
|
|
6569
|
+
| Member | Return | Contract |
|
|
6570
|
+
| --- | --- | --- |
|
|
6571
|
+
| `handleKeydown(event)` | `void` | Routes one `keydown`: navigation keys move focus to the reported item, `inspectKey` calls `preventDefault()`/`stopPropagation()` then `onInspect(item, index)`. Unrecognized, already-prevented, composing, modifier, and disabled events pass through. |
|
|
6572
|
+
|
|
6573
|
+
`columns` defaults to the rendered row length at the active item (items sharing its top edge), which follows the grid's own responsive wrapping without a media query; supply `columns` to read a track list instead. `getActiveIndex` defaults to the item that is or contains `document.activeElement`; supply it when focus sits on a wrapper around the item. `inspectKey` defaults to `' '` (Space), the platform preview key. The recognizer pairs with a pointer long-press at the call site as the touch counterpart of `onInspect`.
|
|
6574
|
+
|
|
6575
|
+
---
|
|
6576
|
+
|
|
6539
6577
|
### `restoreFocus()`
|
|
6540
6578
|
|
|
6541
6579
|
```ts
|
|
@@ -6696,6 +6734,20 @@ type GridNavigation = {
|
|
|
6696
6734
|
set(index: number): void;
|
|
6697
6735
|
};
|
|
6698
6736
|
|
|
6737
|
+
type QuickLookGridOptions = {
|
|
6738
|
+
columns?: GridColumns;
|
|
6739
|
+
disabled?: MaybeGetter;
|
|
6740
|
+
getActiveIndex?: () => number;
|
|
6741
|
+
getItems: () => readonly HTMLElement[];
|
|
6742
|
+
inspectKey?: string;
|
|
6743
|
+
loop?: boolean;
|
|
6744
|
+
onInspect: (item: HTMLElement, index: number) => void;
|
|
6745
|
+
};
|
|
6746
|
+
|
|
6747
|
+
type QuickLookGrid = {
|
|
6748
|
+
handleKeydown(event: KeyboardEvent): void;
|
|
6749
|
+
};
|
|
6750
|
+
|
|
6699
6751
|
type FocusTarget = HTMLElement | SVGElement | null | undefined | (() => HTMLElement | SVGElement | null | undefined);
|
|
6700
6752
|
|
|
6701
6753
|
type RestoreFocusOptions = {
|
|
@@ -6823,6 +6875,25 @@ grid.addEventListener('keydown', (event) => {
|
|
|
6823
6875
|
|
|
6824
6876
|
`columns` resolves on every navigation, so responsive grids can read a media query and measured grids can read the rendered row length. Clamping is the default; set `loop: true` to wrap moves around the grid's edges by flat index. Items are never skipped when disabled: skipping in two dimensions would break row alignment.
|
|
6825
6877
|
|
|
6878
|
+
## Browse Card Grids with Quick Look
|
|
6879
|
+
|
|
6880
|
+
Use `createQuickLookGrid()` for card pickers, where arrows walk the tiles and Space previews the focused card instead of activating it: the WAI-ARIA Quick Look convention. The primitive pairs the navigation with the preview key, consumes the Space press so the focused button never toggles, and reports the item through `onInspect`:
|
|
6881
|
+
|
|
6882
|
+
```ts
|
|
6883
|
+
import { createQuickLookGrid } from '@vielzeug/focus';
|
|
6884
|
+
|
|
6885
|
+
const tiles = () => [...grid.querySelectorAll('.tile')];
|
|
6886
|
+
|
|
6887
|
+
const quickLook = createQuickLookGrid({
|
|
6888
|
+
getItems: tiles,
|
|
6889
|
+
onInspect: (_item, index) => openPreview(index),
|
|
6890
|
+
});
|
|
6891
|
+
|
|
6892
|
+
grid.addEventListener('keydown', (event) => quickLook.handleKeydown(event));
|
|
6893
|
+
```
|
|
6894
|
+
|
|
6895
|
+
Leave `columns` unset to measure the rendered row length at the focused tile, which follows the grid's own responsive wrapping without a media query. Supply `getActiveIndex` when focus may sit on a wrapper around the item rather than the item itself. Enter keeps activating the focused tile through its own handler: only the preview key is intercepted. A pointer long-press recognizer is the touch counterpart of `onInspect`; pair them at the call site.
|
|
6896
|
+
|
|
6826
6897
|
## Restore Focus
|
|
6827
6898
|
|
|
6828
6899
|
Capture focus before opening a transient surface, then invoke the one-shot restorer when it closes:
|
|
@@ -16839,6 +16910,8 @@ interface Datum {
|
|
|
16839
16910
|
key: TKey;
|
|
16840
16911
|
value: number;
|
|
16841
16912
|
meta?: Record;
|
|
16913
|
+
dash?: string; // stroke-dasharray for this datum's marks, e.g. '5 5'
|
|
16914
|
+
opacity?: number; // opacity multiplier 0-1 for this datum's marks, e.g. 0.4
|
|
16842
16915
|
}
|
|
16843
16916
|
|
|
16844
16917
|
type ContinuousDatum = Datum;
|
|
@@ -16847,6 +16920,7 @@ interface Series {
|
|
|
16847
16920
|
name: string;
|
|
16848
16921
|
data: TDatum[];
|
|
16849
16922
|
color?: string;
|
|
16923
|
+
id?: string; // stable data-series-id on the series group; defaults to series-
|
|
16850
16924
|
}
|
|
16851
16925
|
|
|
16852
16926
|
interface ChartEvent {
|
|
@@ -16864,6 +16938,23 @@ interface SeriesValue {
|
|
|
16864
16938
|
|
|
16865
16939
|
Line and area series use `ContinuousDatum`; bar series accept the complete `Datum` key range. On line, area, and bar charts, `datum`/`series` name the series nearest the pointer, and `values` lists every series at that key (a missing value is `undefined`). `originalEvent` is a `MouseEvent`, or a `KeyboardEvent` for keyboard navigation.
|
|
16866
16940
|
|
|
16941
|
+
#### Per-datum presentation
|
|
16942
|
+
|
|
16943
|
+
`dash` and `opacity` style an individual datum's marks without splitting the series — the usual case is a forecast tail where points past "today" are faded or dashed. They are styling-only: interaction, tooltip, and accessibility behavior never change. Support is per chart type:
|
|
16944
|
+
|
|
16945
|
+
| Chart | `dash` | `opacity` |
|
|
16946
|
+
| --- | --- | --- |
|
|
16947
|
+
| Bar | `stroke-dasharray` on the datum's `rect`, plus a 1px series-color stroke so the dash is visible on the fill. | Element `opacity` on the datum's `rect`. |
|
|
16948
|
+
| Line | The segment from this datum to the next (Chart.js-style segments). The last datum's `dash` has no segment and is ignored. | That same segment, plus this datum's own point marker. |
|
|
16949
|
+
| Area | The top line's segment from this datum to the next (last datum ignored). The fill keeps the series-level treatment. | Same segment on the top line. |
|
|
16950
|
+
| Sparkline, pie, radar | Ignored. | Ignored. |
|
|
16951
|
+
|
|
16952
|
+
Consecutive datums that share one `dash`/`opacity` render as a single path run. Absent fields keep the series/theme default, and a series with no presentation fields renders byte-identically to a chart that never used them. See [Forecast / emphasis styling](./usage.md#forecast--emphasis-styling).
|
|
16953
|
+
|
|
16954
|
+
#### Stable series identity
|
|
16955
|
+
|
|
16956
|
+
`Series.id` is rendered as `data-series-id` on the chart's series group (`.prism-line-series`, `.prism-bar-series`, `.prism-area-series`, `.prism-radar-series`) so tooltips, tests, and external CSS can address a series without positional assumptions. Characters outside `[A-Za-z0-9_-]` are replaced with `-`. It defaults to `series-`, which only stays stable while the series order does — set `id` to survive reordering.
|
|
16957
|
+
|
|
16867
16958
|
---
|
|
16868
16959
|
|
|
16869
16960
|
### Chart configurations
|
|
@@ -17380,6 +17471,66 @@ const chart = createAreaChart(container, {
|
|
|
17380
17471
|
|
|
17381
17472
|
`fillOpacity` overrides the theme opacity for one series.
|
|
17382
17473
|
|
|
17474
|
+
## Forecast / emphasis styling
|
|
17475
|
+
|
|
17476
|
+
A single series often mixes points that should look different — actuals plus a
|
|
17477
|
+
forecast tail, or a run that crossed a budget. Rather than split the series,
|
|
17478
|
+
carry `dash` and `opacity` on the individual datums. They are styling-only:
|
|
17479
|
+
tooltips, hover, keyboard, and screen-reader behavior never change.
|
|
17480
|
+
|
|
17481
|
+
For a forecast tail, map a parallel `types` array onto the datums:
|
|
17482
|
+
|
|
17483
|
+
```ts
|
|
17484
|
+
import { createLineChart } from '@vielzeug/prism';
|
|
17485
|
+
|
|
17486
|
+
const types = ['REAL', 'REAL', 'FORECAST', 'FORECAST'];
|
|
17487
|
+
|
|
17488
|
+
const chart = createLineChart(container, {
|
|
17489
|
+
series: [
|
|
17490
|
+
{
|
|
17491
|
+
name: 'Cost',
|
|
17492
|
+
data: values.map((value, i) => ({
|
|
17493
|
+
key: months[i],
|
|
17494
|
+
value,
|
|
17495
|
+
...(types[i] === 'FORECAST' ? { dash: '5 5', opacity: 0.4 } : {}),
|
|
17496
|
+
})),
|
|
17497
|
+
},
|
|
17498
|
+
],
|
|
17499
|
+
});
|
|
17500
|
+
```
|
|
17501
|
+
|
|
17502
|
+
On a line chart, a datum's `dash` styles the segment from that point to the
|
|
17503
|
+
next, so the forecast run renders dashed while the actuals stay solid; its
|
|
17504
|
+
`opacity` fades that segment and the point marker. The last datum's `dash` has
|
|
17505
|
+
no segment to paint and is ignored. On a bar chart, both fields apply to that
|
|
17506
|
+
datum's own bar — a `dash` adds a 1px series-color stroke so the dash reads on
|
|
17507
|
+
the filled rect. On an area chart they style the top line only; the fill keeps
|
|
17508
|
+
its series-level treatment.
|
|
17509
|
+
|
|
17510
|
+
The same mapping fades bars:
|
|
17511
|
+
|
|
17512
|
+
```ts
|
|
17513
|
+
import { createBarChart } from '@vielzeug/prism';
|
|
17514
|
+
|
|
17515
|
+
const chart = createBarChart(container, {
|
|
17516
|
+
series: [
|
|
17517
|
+
{
|
|
17518
|
+
name: 'Cost',
|
|
17519
|
+
data: values.map((value, i) => ({
|
|
17520
|
+
key: months[i],
|
|
17521
|
+
value,
|
|
17522
|
+
...(types[i] === 'FORECAST' ? { dash: '5 5', opacity: 0.4 } : {}),
|
|
17523
|
+
})),
|
|
17524
|
+
},
|
|
17525
|
+
],
|
|
17526
|
+
});
|
|
17527
|
+
```
|
|
17528
|
+
|
|
17529
|
+
Because the fields live on the data, a normal `update(newSeries)` re-applies
|
|
17530
|
+
them; removing the fields on the next update clears the styling. A series with
|
|
17531
|
+
no `dash`/`opacity` anywhere renders exactly as it did before these fields
|
|
17532
|
+
existed.
|
|
17533
|
+
|
|
17383
17534
|
## Pie, Donut, and Semi-circle Charts
|
|
17384
17535
|
|
|
17385
17536
|
All three variants use `createPieChart` with the `variant` field:
|
package/data/llms.txt
CHANGED
package/data/manifest.json
CHANGED