@soffits/dsh-card-board 0.7.0 → 0.7.1
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 +4 -0
- package/README.md +1 -1
- package/client.js +46 -20
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.7.1
|
|
4
|
+
|
|
5
|
+
- A countdown step in another zone shows the wall-clock time of its own offset (`…T14:20:00-07:00` reads 14:20), and the zone's short name only when the browser's zone data agrees; otherwise it shows the offset ("GMT−7"). A browser with older zone rules no longer moves a ticket's time by an hour.
|
|
6
|
+
|
|
3
7
|
## 0.7.0
|
|
4
8
|
|
|
5
9
|
- The board is live: changes arrive over a Server-Sent Events route (`/api/card-board/events`), the page fetches only the card that changed, and a card or row that changes in front of you gets a short wash and "just now". Polling stays as the fallback while the stream is down.
|
package/README.md
CHANGED
|
@@ -152,7 +152,7 @@ A big ticking number until `to`, and the stops on the way with the next one mark
|
|
|
152
152
|
"expiresAt": "2026-03-04T10:50:00+01:00" }
|
|
153
153
|
```
|
|
154
154
|
|
|
155
|
-
A step
|
|
155
|
+
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.
|
|
156
156
|
|
|
157
157
|
### stat
|
|
158
158
|
|
package/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @soffits/dsh-card-board 0.7.
|
|
1
|
+
/* @soffits/dsh-card-board 0.7.1: 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) => {
|
|
@@ -490,9 +490,9 @@ function BarChart({ data, locale, height }) {
|
|
|
490
490
|
let base = 0;
|
|
491
491
|
parts = keys.map((key, k) => {
|
|
492
492
|
const v = Math.max(0, bar.values?.[key] ?? 0);
|
|
493
|
-
const
|
|
493
|
+
const part2 = { y0: base, y1: base + v, color: toneColor(void 0, k), x: cx - barW / 2, w: barW };
|
|
494
494
|
base += v;
|
|
495
|
-
return
|
|
495
|
+
return part2;
|
|
496
496
|
});
|
|
497
497
|
} else {
|
|
498
498
|
const each = barW / keys.length;
|
|
@@ -652,6 +652,45 @@ function Timeline({ data, locale }) {
|
|
|
652
652
|
// src/client/cards.js
|
|
653
653
|
var import_react5 = require("react");
|
|
654
654
|
var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
655
|
+
|
|
656
|
+
// src/client/steps.js
|
|
657
|
+
function ownOffset(at) {
|
|
658
|
+
const m = /(?:([+-])(\d{2}):?(\d{2})|Z)$/.exec(String(at));
|
|
659
|
+
if (!m) return null;
|
|
660
|
+
return m[1] ? (m[1] === "-" ? -1 : 1) * (Number(m[2]) * 60 + Number(m[3])) : 0;
|
|
661
|
+
}
|
|
662
|
+
function part(locale, zone, time, style) {
|
|
663
|
+
const parts = new Intl.DateTimeFormat(locale, { timeZone: zone, timeZoneName: style }).formatToParts(time);
|
|
664
|
+
return parts.find((p) => p.type === "timeZoneName")?.value ?? "";
|
|
665
|
+
}
|
|
666
|
+
function browserOffset(zone, time) {
|
|
667
|
+
const m = /([+-])(\d{1,2})(?::(\d{2}))?/.exec(part("und", zone, time, "shortOffset"));
|
|
668
|
+
return m ? (m[1] === "-" ? -1 : 1) * (Number(m[2]) * 60 + Number(m[3] ?? 0)) : 0;
|
|
669
|
+
}
|
|
670
|
+
function offsetName(offset) {
|
|
671
|
+
const abs = Math.abs(offset);
|
|
672
|
+
return `GMT${offset < 0 ? "\u2212" : "+"}${Math.floor(abs / 60)}${abs % 60 ? `:${String(abs % 60).padStart(2, "0")}` : ""}`;
|
|
673
|
+
}
|
|
674
|
+
function stepTimes(steps, locale, here = Intl.DateTimeFormat().resolvedOptions().timeZone) {
|
|
675
|
+
let lastDay = null;
|
|
676
|
+
return steps.map((step) => {
|
|
677
|
+
const time = new Date(step.at);
|
|
678
|
+
const away = Boolean(step.zone) && step.zone !== here;
|
|
679
|
+
const offset = away ? ownOffset(step.at) : null;
|
|
680
|
+
const shown = offset === null ? time : new Date(time.getTime() + offset * 6e4);
|
|
681
|
+
const zone = offset === null ? away ? step.zone : here : "UTC";
|
|
682
|
+
const day = new Intl.DateTimeFormat("en-CA", { timeZone: zone, year: "numeric", month: "2-digit", day: "2-digit" }).format(shown);
|
|
683
|
+
const showDay = day !== lastDay;
|
|
684
|
+
lastDay = day;
|
|
685
|
+
let text = new Intl.DateTimeFormat(locale, { timeZone: zone, hour: "2-digit", minute: "2-digit", ...showDay ? { weekday: "short" } : {} }).format(shown);
|
|
686
|
+
if (away) {
|
|
687
|
+
text += " " + (offset === null || browserOffset(step.zone, time) === offset ? part(locale, step.zone, time, "short") : offsetName(offset));
|
|
688
|
+
}
|
|
689
|
+
return { time, text };
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
// src/client/cards.js
|
|
655
694
|
var STATE_OF_TONE = { ok: "done", warn: "warning", bad: "error" };
|
|
656
695
|
var DIRECTION_ICON = { up: "trending-up", down: "trending-down" };
|
|
657
696
|
function StatBlock({ data, locale, compact, wash }) {
|
|
@@ -784,8 +823,8 @@ function StatusCard({ data, live, locale, rowActions }) {
|
|
|
784
823
|
var PARTS = [[5, "dayPart.morning"], [12, "dayPart.afternoon"], [18, "dayPart.evening"], [22, "dayPart.night"]];
|
|
785
824
|
function dayLine(now, locale, t) {
|
|
786
825
|
const hour = new Date(now).getHours();
|
|
787
|
-
const
|
|
788
|
-
return { text: t("dayLine", { day: new Intl.DateTimeFormat(locale, { weekday: "long" }).format(now), part: t(
|
|
826
|
+
const part2 = [...PARTS].reverse().find(([from]) => hour >= from)?.[1] ?? "dayPart.night";
|
|
827
|
+
return { text: t("dayLine", { day: new Intl.DateTimeFormat(locale, { weekday: "long" }).format(now), part: t(part2) }), dark: part2 === "dayPart.night" || part2 === "dayPart.evening" };
|
|
789
828
|
}
|
|
790
829
|
function SummaryBody({ card, locale, t, wash }) {
|
|
791
830
|
const kit = useKit();
|
|
@@ -799,19 +838,6 @@ function SummaryBody({ card, locale, t, wash }) {
|
|
|
799
838
|
card.data.chips?.length > 0 && (0, import_react5.createElement)("div", { className: "cb-chips" }, card.data.chips.map((chip, i) => (0, import_react5.createElement)(kit.Chip, { key: i, icon: chip.icon, tone: chip.tone ?? "muted", to: chip.to }, chip.text)))
|
|
800
839
|
);
|
|
801
840
|
}
|
|
802
|
-
function stepTimes(steps, locale) {
|
|
803
|
-
const here = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
804
|
-
let lastDay = null;
|
|
805
|
-
return steps.map((step) => {
|
|
806
|
-
const time = toTime(step.at);
|
|
807
|
-
const zone = step.zone ?? here;
|
|
808
|
-
const day = new Intl.DateTimeFormat("en-CA", { timeZone: zone, year: "numeric", month: "2-digit", day: "2-digit" }).format(time);
|
|
809
|
-
const showDay = day !== lastDay;
|
|
810
|
-
lastDay = day;
|
|
811
|
-
const text = new Intl.DateTimeFormat(locale, { timeZone: zone, hour: "2-digit", minute: "2-digit", ...showDay ? { weekday: "short" } : {}, ...zone !== here ? { timeZoneName: "short" } : {} }).format(time);
|
|
812
|
-
return { time, text };
|
|
813
|
-
});
|
|
814
|
-
}
|
|
815
841
|
function CountdownBody({ card, locale }) {
|
|
816
842
|
const kit = useKit();
|
|
817
843
|
const now = kit.useNow();
|
|
@@ -1021,9 +1047,9 @@ function Card({ entry, live, boardId, assistant, columns, active, locale, t, pre
|
|
|
1021
1047
|
const askName = assistant ? t("action.chatNamed", { name: assistant }) : void 0;
|
|
1022
1048
|
const named = (list) => assistant ? list?.map((action) => action.kind === "chat" && action.label === void 0 ? { ...action, label: askName } : action) : list;
|
|
1023
1049
|
const onPress = (target) => (action, extra) => press(action, extra, { card: entry.id, ...target });
|
|
1024
|
-
const rowActions = actions && ((row, list,
|
|
1050
|
+
const rowActions = actions && ((row, list, part2) => (0, import_react7.createElement)(actions.ActionBar, {
|
|
1025
1051
|
actions: named(list),
|
|
1026
|
-
part,
|
|
1052
|
+
part: part2,
|
|
1027
1053
|
states: statesOf(entry.presses, row),
|
|
1028
1054
|
compact: true,
|
|
1029
1055
|
about: about(row, rowLine(row)),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soffits/dsh-card-board",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
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",
|