@skillre/dsh-plugin-work-dashboard 0.12.0 → 0.13.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.
@@ -0,0 +1,60 @@
1
+ /**
2
+ * POC 3.2 report page: the offline form a colleague edits, plus the read-only
3
+ * return receipt it produces.
4
+ *
5
+ * ## Contract
6
+ *
7
+ * The Host writes the shell and the data block; this module only supplies two
8
+ * strings:
9
+ *
10
+ * - `REPORT_STYLE` — embedded in a `<style>` element.
11
+ * - `REPORT_PAGE_SCRIPT` — embedded in a `<script>` element **after** the DOM
12
+ * nodes `<main id="app"></main>` and
13
+ * a `<script type="application/json" id="poc-report-input">` data block (with its
14
+ * matching closing tag) that carries the page payload.
15
+ *
16
+ * Everything else is built here. The page has to work from `file://` with no
17
+ * network, so there are no imports, no fonts, no images and no requests.
18
+ *
19
+ * ## Why the script is a function rendered through `toString()`
20
+ *
21
+ * The script is write-once plain JavaScript that runs inside the generated HTML
22
+ * page. If it were a template literal it would get no TypeScript checking at
23
+ * all — the first symptom of a typo would be a blank page on a colleague's
24
+ * laptop. So the browser code lives in `reportPage()`, a normal typed function,
25
+ * and is serialised with `Function.prototype.toString()`. Everything it needs is
26
+ * declared inside it: no module scope, no Host constants, no `Node` APIs.
27
+ *
28
+ * The generated return receipt is a self-contained HTML file. It repeats the
29
+ * payload in `<script type="application/json" id="poc-return-data">` (escaped,
30
+ * never executed) and lists the same facts as readable cards for a recipient
31
+ * who just double-clicks the file. The receipt carries no scripts beyond that
32
+ * inert JSON block.
33
+ *
34
+ * ## The payload (poc-report/1, ledger_version 3.2)
35
+ *
36
+ * `changes[]` is one entry per project the colleague actually filled in:
37
+ *
38
+ * - `new`: `{ poc_id, identity, gate0, stage_notes?, round? }`
39
+ * - `progress`: `{ poc_id, base, stage_notes?, round }`
40
+ *
41
+ * `round` is `{ submission_id, date, type, change, lines[], next_plans[] }`.
42
+ * Facts only: no `seq`, no Gate verdicts, no `review`. Execution state lives on
43
+ * each line and is not a result. Empty optional fields are omitted rather than
44
+ * sent as `null`, so "not answered" stays distinguishable from "answered empty".
45
+ *
46
+ * ## Host integration
47
+ *
48
+ * Drafts are stored under `poc-report-draft:<form_id>` and are discarded when
49
+ * the form's per-project `base` digests change, so a draft can never be applied
50
+ * on top of a different baseline.
51
+ */
52
+ /**
53
+ * The page script, ready to embed inside a script element.
54
+ *
55
+ * `reportPage` is serialised rather than hand-written as a string so that
56
+ * TypeScript checks the browser code and a typo cannot silently ship as a blank
57
+ * page. The wrapper is an IIFE: the embedded script gets no globals, and the
58
+ * function's own `'use strict'` keeps accidental globals out.
59
+ */
60
+ export declare const REPORT_PAGE_SCRIPT: string;