@hikae/ledger-core 0.4.1 → 0.4.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/dashboard.d.ts CHANGED
@@ -17,3 +17,7 @@ export function renderDashboard(options: {
17
17
  status: HTMLElement;
18
18
  retry: HTMLElement;
19
19
  }): void;
20
+
21
+ export function stageAt(card: object, at: Date): string | null;
22
+ export function ledgerMetrics(cards: readonly object[], periods: {start:Date,end:Date,label:string}[]): {open:number,stage:Record<string,number>}[];
23
+ export function mountDashboardNavigation(container: HTMLElement): void;
package/dashboard.js CHANGED
@@ -349,4 +349,19 @@ export function renderDashboard({graphs, cards, loaded, data, failed, issueDate,
349
349
  tableArea.append(table);
350
350
  }
351
351
 
352
- export {inspectChart};
352
+ export {inspectChart, G as stageAt, ledgerMetrics};
353
+
354
+ export function mountDashboardNavigation(container) {
355
+ const buttons = [['ledger','ledger'],['dash','dashboard'],['decide','decide']].map(([view,label]) => {
356
+ const button = a('button', null, label);
357
+ button.dataset.v = view;
358
+ if (view === 'decide') {
359
+ const badge = a('span', 'badge');
360
+ badge.id = 'decidecount';
361
+ badge.hidden = true;
362
+ button.append(badge);
363
+ }
364
+ return button;
365
+ });
366
+ container.replaceChildren(...buttons);
367
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hikae/ledger-core",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Pure core shared by the local ledger agent and a host: model tier policy, issue stage machine, port interfaces.",
5
5
  "type": "module",
6
6
  "license": "MIT",