@soffits/dsh-card-board 0.12.0 → 0.14.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.14.0
|
|
4
|
+
|
|
5
|
+
A countdown can carry up to 24 steps (was 8), enough for a whole travel day from waking up to landing. The next step is still marked and the passed ones dimmed.
|
|
6
|
+
|
|
7
|
+
## 0.13.0
|
|
8
|
+
|
|
9
|
+
A stat item can carry an `icon`: a big tinted tile beside its label and number, like a Home Assistant tile, coloured with `iconTone`, the item's `tone` or the card's. A stat block with icons lays its numbers out in an even grid, and on a phone, where two numbers share a row, each tile sits above its words so the numbers keep their width. A countdown's `data.icon` sits the same way before the big number. The tile is 48 px (44 above a chart or rows, 40–42 on a phone). Needs dsh-ui-kit 0.5.0 for `trophy`, `medal`, `weight` and the high and low thermometers.
|
|
10
|
+
|
|
3
11
|
## 0.12.0
|
|
4
12
|
|
|
5
13
|
- Every list and status row now has an Ask button without declaring one, the way every card has its chat button: it opens a new conversation with that row and its card attached ("Ask Robin" when the board names an `assistant`). A row that declares its own `chat` action keeps it, and a row with all six buttons taken gets none. Rows without a `key` get it too: the chat names the row by its place in the card.
|
package/README.md
CHANGED
|
@@ -143,10 +143,10 @@ A chip with `to` (an ISO time) gets a ticking "in 1d 19h" after its text.
|
|
|
143
143
|
|
|
144
144
|
### countdown
|
|
145
145
|
|
|
146
|
-
A big ticking number until `to`, and the stops on the way with the next one marked. After `to` it says "now"; after `expiresAt` the card hides itself, so whoever writes it needn't remove it on time.
|
|
146
|
+
A big ticking number until `to`, and the stops on the way (up to 24) with the next one marked and the passed ones dimmed. After `to` it says "now"; after `expiresAt` the card hides itself, so whoever writes it needn't remove it on time.
|
|
147
147
|
|
|
148
148
|
```json
|
|
149
|
-
{ "to": "2026-03-04T07:40:00+01:00", "label": "until the train leaves", "sub": "3 h 10 m, one change",
|
|
149
|
+
{ "to": "2026-03-04T07:40:00+01:00", "label": "until the train leaves", "sub": "3 h 10 m, one change", "icon": "luggage",
|
|
150
150
|
"steps": [
|
|
151
151
|
{ "at": "2026-03-04T07:15:00+01:00", "label": "At the station" },
|
|
152
152
|
{ "at": "2026-03-04T10:50:00+01:00", "label": "Arrive in Marseille", "sub": "14° and sunny", "zone": "Europe/Paris" }
|
|
@@ -154,7 +154,7 @@ A big ticking number until `to`, and the stops on the way with the next one mark
|
|
|
154
154
|
"expiresAt": "2026-03-04T10:50:00+01:00" }
|
|
155
155
|
```
|
|
156
156
|
|
|
157
|
-
A step with a `zone` (an IANA name) other than the viewer's shows the wall-clock time of its own offset, so write the local time from the ticket with its offset; the zone's short name follows when the browser's zone data agrees, the offset ("GMT−7") when it doesn't.
|
|
157
|
+
`icon` puts a big tile, tinted with the card's `tone`, before the number. A step with a `zone` (an IANA name) other than the viewer's shows the wall-clock time of its own offset, so write the local time from the ticket with its offset; the zone's short name follows when the browser's zone data agrees, the offset ("GMT−7") when it doesn't.
|
|
158
158
|
|
|
159
159
|
### stat
|
|
160
160
|
|
|
@@ -162,7 +162,7 @@ One to six big numbers.
|
|
|
162
162
|
|
|
163
163
|
```json
|
|
164
164
|
{ "items": [
|
|
165
|
-
{ "label": "Temperature", "value": 4.5, "unit": "°C", "sub": "feels like 1 °C",
|
|
165
|
+
{ "label": "Temperature", "value": 4.5, "unit": "°C", "icon": "thermometer", "sub": "feels like 1 °C",
|
|
166
166
|
"delta": { "text": "2.1° colder than yesterday", "tone": "accent", "dir": "down" },
|
|
167
167
|
"strip": [{ "label": "11", "value": 5.6, "icon": "sun" }, { "label": "12", "value": 6.2, "icon": "sun", "on": true }] },
|
|
168
168
|
{ "label": "Spent this month", "value": 3423, "unit": "of 4,310", "progress": { "value": 3423, "max": 4310, "text": "on pace for 4,286" } },
|
|
@@ -170,7 +170,7 @@ One to six big numbers.
|
|
|
170
170
|
] }
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
-
`value` is a number or a string (for numbers you've already formatted). `tone` on an item colours its value. Each item may add a `delta` (a change in words, with a tone and a `dir` of `up`, `down` or `flat` for its arrow), a `progress` bar, a `spark` line or a `strip` of small values with icons, like the next hours of weather (`on` marks one).
|
|
173
|
+
`value` is a number or a string (for numbers you've already formatted). `tone` on an item colours its value. `icon` draws a big tile beside the label and number, tinted with `iconTone`, else the item's `tone`, else the card's (a gold coin beside a plain balance: `"icon": "coins", "iconTone": "warn"`). Give it to the numbers a glance should find by picture, not to every item; the reasoning is in [docs/decisions/stat-icons.md](docs/decisions/stat-icons.md). Each item may add a `delta` (a change in words, with a tone and a `dir` of `up`, `down` or `flat` for its arrow), a `progress` bar, a `spark` line or a `strip` of small values with icons, like the next hours of weather (`on` marks one).
|
|
174
174
|
|
|
175
175
|
### line
|
|
176
176
|
|
package/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @soffits/dsh-card-board 0.
|
|
1
|
+
/* @soffits/dsh-card-board 0.14.0: built by scripts/build.mjs from src/client/. Do not edit. */
|
|
2
2
|
window.__ModuleLoader__.load({
|
|
3
3
|
id: "@soffits/dsh-card-board",
|
|
4
4
|
factory: (require) => {
|
|
@@ -98,6 +98,19 @@ h3.cb-truncOpen{overflow:visible}
|
|
|
98
98
|
.cb-delta{display:flex;align-items:center;gap:3px;font-size:12px;font-weight:500;line-height:18px}
|
|
99
99
|
.cb-statSub{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}
|
|
100
100
|
.cb-statProgress{display:flex;flex-direction:column;gap:4px;min-width:180px;margin-top:4px}
|
|
101
|
+
/* an item with an icon: a big tinted tile beside its label and number, the rest under the words */
|
|
102
|
+
.cb-stats{--cb-statTile:48px}
|
|
103
|
+
.cb-statsCompact{--cb-statTile:44px}
|
|
104
|
+
.cb-statsIcons{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,136px),1fr));gap:16px 24px}
|
|
105
|
+
.cb-statsIcons>.cb-statWide{grid-column:1/-1}
|
|
106
|
+
.cb-statIcon .cb-statProgress{min-width:0}
|
|
107
|
+
.cb-statIcon{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:12px;row-gap:2px;align-content:start}
|
|
108
|
+
.cb-statIcon>*{grid-column:2}
|
|
109
|
+
.cb-statIcon>.cb-statTile{grid-column:1;grid-row:1/span 2;align-self:center}
|
|
110
|
+
.cb-statIcon>.cb-strip{grid-column:1/-1}
|
|
111
|
+
.cb-statTile.uk-tile,.cb-countdownTile.uk-tile{width:var(--cb-statTile);height:var(--cb-statTile);border-radius:calc(var(--cb-statTile) * .3)}
|
|
112
|
+
.cb-statTile svg,.cb-countdownTile svg{width:calc(var(--cb-statTile) * .54);height:calc(var(--cb-statTile) * .54)}
|
|
113
|
+
.cb-countdownHead{--cb-statTile:52px}
|
|
101
114
|
.cb-strip{display:flex;justify-content:space-between;gap:4px;margin:10px 0 0;padding:0;list-style:none}
|
|
102
115
|
.cb-strip li{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:0;color:var(--dsw-alias-label-tertiary);font-size:11px;font-variant-numeric:tabular-nums}
|
|
103
116
|
.cb-strip b{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:500}
|
|
@@ -193,6 +206,14 @@ h3.cb-truncOpen{overflow:visible}
|
|
|
193
206
|
.cb-card-summary{position:relative}
|
|
194
207
|
.cb-summaryText{font-size:16px;line-height:24px}
|
|
195
208
|
.cb-statValue{font-size:24px;line-height:30px}
|
|
209
|
+
.cb-stats{--cb-statTile:42px}
|
|
210
|
+
.cb-statsIcons{column-gap:16px}
|
|
211
|
+
.cb-statIcon{column-gap:10px}
|
|
212
|
+
.cb-statsPaired>.cb-statIcon:not(.cb-statWide){grid-template-columns:minmax(0,1fr)}
|
|
213
|
+
.cb-statsPaired>.cb-statIcon:not(.cb-statWide)>*{grid-column:1}
|
|
214
|
+
.cb-statsPaired>.cb-statIcon:not(.cb-statWide)>.cb-statTile{grid-row:auto;align-self:start;margin-bottom:6px}
|
|
215
|
+
.cb-statsCompact{--cb-statTile:40px}
|
|
216
|
+
.cb-countdownHead{--cb-statTile:46px}
|
|
196
217
|
}
|
|
197
218
|
/* Touch and pointer: cards and rows answer a hover and a press, in DSH's own interactive colours and motion. */
|
|
198
219
|
.cb-card{transition:box-shadow var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease),transform var(--ds-transition-duration,.2s) var(--ds-ease-in-out,ease)}
|
|
@@ -984,11 +1005,14 @@ function EasedNumber({ value, locale }) {
|
|
|
984
1005
|
const decimals = Math.min(3, (String(value).split(".")[1] ?? "").length);
|
|
985
1006
|
return formatNumber(shown === value ? value : Number(shown.toFixed(decimals)), locale);
|
|
986
1007
|
}
|
|
987
|
-
function StatBlock({ data, locale, compact, wash }) {
|
|
1008
|
+
function StatBlock({ data, locale, compact, wash, tone }) {
|
|
988
1009
|
const kit = useKit();
|
|
989
|
-
|
|
1010
|
+
const iconic = data.items.some((item) => item.icon);
|
|
1011
|
+
const paired = iconic && data.items.filter((item) => !item.strip).length > 1;
|
|
1012
|
+
return (0, import_react6.createElement)("div", { className: ["cb-stats", compact && "cb-statsCompact", iconic && "cb-statsIcons", paired && "cb-statsPaired"].filter(Boolean).join(" ") }, data.items.map((item, i) => (0, import_react6.createElement)(
|
|
990
1013
|
item.link ? "a" : "div",
|
|
991
|
-
{ key: i, className:
|
|
1014
|
+
{ key: i, className: ["cb-stat", item.strip && "cb-statWide", item.link && "cb-statLink", item.icon && "cb-statIcon"].filter(Boolean).join(" "), ...item.link ? linkProps(item.link) : {} },
|
|
1015
|
+
item.icon && (0, import_react6.createElement)(kit.Tile, { icon: item.icon, tone: item.iconTone ?? item.tone ?? tone ?? "muted", size: compact ? 44 : 48, className: "cb-statTile" }),
|
|
992
1016
|
(0, import_react6.createElement)("div", { className: "cb-statLabel" }, (0, import_react6.createElement)(Trunc, { as: "span", text: item.label }), i === 0 && wash && (0, import_react6.createElement)(kit.JustNow)),
|
|
993
1017
|
(0, import_react6.createElement)(
|
|
994
1018
|
"div",
|
|
@@ -1207,6 +1231,7 @@ function CountdownBody({ card, locale }) {
|
|
|
1207
1231
|
(0, import_react6.createElement)(
|
|
1208
1232
|
"div",
|
|
1209
1233
|
{ className: "cb-countdownHead" },
|
|
1234
|
+
data.icon && (0, import_react6.createElement)(kit.Tile, { icon: data.icon, tone: card.tone ?? "muted", size: 52, className: "cb-countdownTile" }),
|
|
1210
1235
|
(0, import_react6.createElement)(kit.Countdown, { to: data.to }),
|
|
1211
1236
|
(0, import_react6.createElement)(
|
|
1212
1237
|
"div",
|
|
@@ -1438,7 +1463,7 @@ function Body({ card, live, wash, locale, t, rowActions, all, onOpenRow, rowCont
|
|
|
1438
1463
|
const data = card.data;
|
|
1439
1464
|
switch (card.type) {
|
|
1440
1465
|
case "stat":
|
|
1441
|
-
return (0, import_react10.createElement)(StatBlock, { data, locale, wash });
|
|
1466
|
+
return (0, import_react10.createElement)(StatBlock, { data, locale, wash, tone: card.tone });
|
|
1442
1467
|
case "list":
|
|
1443
1468
|
return (0, import_react10.createElement)(ListCard, { data, live, locale, t, rowActions, ask: card.ask, all, onOpenRow, rowControls });
|
|
1444
1469
|
case "status":
|
|
@@ -1548,7 +1573,7 @@ function Card({ entry, live, boardId, assistant, tracks, active, locale, t, pres
|
|
|
1548
1573
|
(0, import_react10.createElement)("div", { className: "cb-summaryAside" }, live.fresh && (0, import_react10.createElement)(kit.NewDot), chat)
|
|
1549
1574
|
);
|
|
1550
1575
|
}
|
|
1551
|
-
const statBlock = card.stat && (0, import_react10.createElement)(StatBlock, { data: card.stat, locale, compact: true, wash: wash !== "" });
|
|
1576
|
+
const statBlock = card.stat && (0, import_react10.createElement)(StatBlock, { data: card.stat, locale, compact: true, wash: wash !== "", tone: card.tone });
|
|
1552
1577
|
const body = (0, import_react10.createElement)(Body, { card, live, wash: wash !== "", locale, t, rowActions, all: sheet, onOpenRow, rowControls });
|
|
1553
1578
|
return (0, import_react10.createElement)(
|
|
1554
1579
|
"section",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"value": 4.5,
|
|
17
17
|
"unit": "°C",
|
|
18
|
+
"icon": "cloud-sun",
|
|
18
19
|
"delta": {
|
|
19
20
|
"text": {
|
|
20
21
|
"en": "2.1° colder than yesterday",
|
|
@@ -68,7 +69,8 @@
|
|
|
68
69
|
"zh": "湿度"
|
|
69
70
|
},
|
|
70
71
|
"value": 71,
|
|
71
|
-
"unit": "%"
|
|
72
|
+
"unit": "%",
|
|
73
|
+
"icon": "droplets"
|
|
72
74
|
}
|
|
73
75
|
]
|
|
74
76
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soffits/dsh-card-board",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "A data-driven card board for DeepSeek Harness: scripts write small JSON cards, the Web UI shows each person the boards they may see.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/src/schema.js
CHANGED
|
@@ -24,6 +24,8 @@ export const INVERSE_KINDS = Object.freeze(['done', 'snooze', 'event'])
|
|
|
24
24
|
export const UNDO_KIND = 'undo'
|
|
25
25
|
/** Suggested steps per card or row: a few clear next moves, not a menu. */
|
|
26
26
|
export const MAX_STEPS = 3
|
|
27
|
+
/** Stops on a countdown's track: a whole travel day is more than eight. */
|
|
28
|
+
export const MAX_COUNTDOWN_STEPS = 24
|
|
27
29
|
export const ACTION_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,99}$/
|
|
28
30
|
/** Row keys: stable ids, so the page can tell which row changed. The same shape as action ids. */
|
|
29
31
|
export const KEY_PATTERN = ACTION_ID_PATTERN
|
|
@@ -289,13 +291,16 @@ function statData(c, data, path) {
|
|
|
289
291
|
if (!c.array(data.items, join(path, 'items'), { min: 1, max: 6 })) return
|
|
290
292
|
data.items.forEach((item, i) => {
|
|
291
293
|
const p = join(join(path, 'items'), i)
|
|
292
|
-
if (!c.object(item, p, ['label', 'value'], ['unit', 'delta', 'sub', 'tone', 'spark', 'progress', 'strip', 'link'])) return
|
|
294
|
+
if (!c.object(item, p, ['label', 'value'], ['unit', 'delta', 'sub', 'tone', 'icon', 'iconTone', 'spark', 'progress', 'strip', 'link'])) return
|
|
293
295
|
c.optional(item, 'link', v => isSafeLink(v) || c.fail(join(p, 'link'), 'must be an http(s) URL or a path starting with /'))
|
|
294
296
|
c.label(item.label, join(p, 'label'))
|
|
295
297
|
c.labelOrNumber(item.value, join(p, 'value'))
|
|
296
298
|
c.optional(item, 'unit', v => c.label(v, join(p, 'unit'), { max: 20 }))
|
|
297
299
|
c.optional(item, 'sub', v => c.label(v, join(p, 'sub')))
|
|
298
300
|
tone(c, item, p)
|
|
301
|
+
icon(c, item, p)
|
|
302
|
+
c.optional(item, 'iconTone', v => c.oneOf(v, join(p, 'iconTone'), TONES))
|
|
303
|
+
if (item.iconTone !== undefined && item.icon === undefined) c.fail(join(p, 'iconTone'), 'needs an icon')
|
|
299
304
|
c.optional(item, 'delta', delta => {
|
|
300
305
|
const dp = join(p, 'delta')
|
|
301
306
|
if (!c.object(delta, dp, ['text'], ['tone', 'dir'])) return
|
|
@@ -521,15 +526,16 @@ function summaryData(c, data, path) {
|
|
|
521
526
|
}
|
|
522
527
|
|
|
523
528
|
function countdownData(c, data, path) {
|
|
524
|
-
if (!c.object(data, path, ['to', 'label'], ['sub', 'steps', 'expiresAt'])) return
|
|
529
|
+
if (!c.object(data, path, ['to', 'label'], ['sub', 'icon', 'steps', 'expiresAt'])) return
|
|
525
530
|
const toOk = c.dateTime(data.to, join(path, 'to'))
|
|
531
|
+
icon(c, data, path)
|
|
526
532
|
c.label(data.label, join(path, 'label'))
|
|
527
533
|
c.optional(data, 'sub', v => c.label(v, join(path, 'sub')))
|
|
528
534
|
c.optional(data, 'expiresAt', v => {
|
|
529
535
|
if (c.dateTime(v, join(path, 'expiresAt')) && toOk && Date.parse(v) < Date.parse(data.to)) c.fail(join(path, 'expiresAt'), 'must not be before to')
|
|
530
536
|
})
|
|
531
537
|
c.optional(data, 'steps', steps => {
|
|
532
|
-
if (!c.array(steps, join(path, 'steps'), { min: 1, max:
|
|
538
|
+
if (!c.array(steps, join(path, 'steps'), { min: 1, max: MAX_COUNTDOWN_STEPS })) return
|
|
533
539
|
steps.forEach((step, i) => {
|
|
534
540
|
const p = join(join(path, 'steps'), i)
|
|
535
541
|
if (!c.object(step, p, ['at', 'label'], ['sub', 'zone'])) return
|