@thehammer/template-verification 0.2.11 → 0.2.13
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/dist/components/VerifiedField.vue.d.ts +40 -10
- package/dist/lib/discrepancy.d.ts +10 -1
- package/dist/style.css +1 -1
- package/dist/template-verification.js +165 -156
- package/dist/types.d.ts +51 -5
- package/package.json +1 -1
|
@@ -24,16 +24,46 @@ import type { MetaCarrier } from "../types";
|
|
|
24
24
|
* hover panel, so the same sentence reaches a screen reader and a mouse
|
|
25
25
|
* hovering the glyph, and neither costs a second piece of chrome in the page.
|
|
26
26
|
*
|
|
27
|
-
* ====
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
27
|
+
* ==== NOTHING MOVES, AND NOTHING IS COVERED ====
|
|
28
|
+
*
|
|
29
|
+
* Two requirements, and the shape below is the one that satisfies BOTH.
|
|
30
|
+
*
|
|
31
|
+
* 1. NO REFLOW. Turning the overlay on or off, or a field going from
|
|
32
|
+
* "unverified" to "verified", must not move a single character of the
|
|
33
|
+
* letter. The document is the deliverable, and a reviewer toggling the
|
|
34
|
+
* overlay must be looking at the same pagination they will print.
|
|
35
|
+
* 2. NO OCCLUSION. The value must stay fully readable. A mark that hides the
|
|
36
|
+
* claimant's surname or the year of the accident makes the letter unusable,
|
|
37
|
+
* which is worse than any layout wobble.
|
|
38
|
+
*
|
|
39
|
+
* The mark therefore lives in a PERMANENTLY RESERVED SLOT: `.tv-mark-slot` is
|
|
40
|
+
* an empty fixed-width inline-block rendered beside every value ALWAYS —
|
|
41
|
+
* overlay on, overlay off, tracked or untracked, on screen and on paper. It is
|
|
42
|
+
* the slot, not the mark, that occupies the inline space, so the space never
|
|
43
|
+
* appears or disappears and nothing ever reflows. The mark is absolutely
|
|
44
|
+
* positioned INSIDE that slot, so its own width — a bare confidence dot, a
|
|
45
|
+
* verified chip, either of them wearing a discrepancy flag — can never push a
|
|
46
|
+
* character either.
|
|
47
|
+
*
|
|
48
|
+
* Two earlier shapes, and why each one loses:
|
|
49
|
+
*
|
|
50
|
+
* - `inline-flex` row with a gap (the original): every mark pushed the rest of
|
|
51
|
+
* its line along, so the whole letter reflowed the moment the overlay was
|
|
52
|
+
* switched on. Fails (1).
|
|
53
|
+
* - Absolute at `right: 0` against the wrapper, occupying zero inline space
|
|
54
|
+
* (the shape this replaces): it bought (1) by overlaying the last characters
|
|
55
|
+
* of the value — `Abdinasir Abdi` rendered as `Abdinasir ✔`, `October 23,
|
|
56
|
+
* 2024` as `October 23, 2 ✔`. Fails (2), and fails it on exactly the two
|
|
57
|
+
* fields a reader most needs. `left: 100%` is the same trade with the damage
|
|
58
|
+
* moved onto whatever the template wrote next, which is no better.
|
|
59
|
+
*
|
|
60
|
+
* What the reserved slot costs, stated plainly: about one-and-a-bit character
|
|
61
|
+
* widths of permanent space after every data point, present even in print. That
|
|
62
|
+
* is the price of never covering a value, and it is deliberately paid in the
|
|
63
|
+
* one place a document can absorb it — inter-word space — rather than on top of
|
|
64
|
+
* the words themselves. It is NOT hidden by the `@media print` chrome rule: the
|
|
65
|
+
* slot is not chrome, so the printed page is laid out identically to the screen
|
|
66
|
+
* and only the glyph goes away.
|
|
37
67
|
*/
|
|
38
68
|
type __VLS_Props = {
|
|
39
69
|
source?: MetaCarrier;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CandidateSet, DataPointMeta } from "../types";
|
|
1
|
+
import type { CandidateSet, Correction, DataPointMeta } from "../types";
|
|
2
2
|
/**
|
|
3
3
|
* A data point is in discrepancy when two or more PRESENT candidates hold
|
|
4
4
|
* differing values. A single candidate (or none) can never disagree with itself.
|
|
@@ -20,3 +20,12 @@ export declare function candidatesDisagree(candidates?: CandidateSet | null): bo
|
|
|
20
20
|
* which wording the mark's accessible name carries.
|
|
21
21
|
*/
|
|
22
22
|
export declare function isSourceDiscrepancy(meta?: DataPointMeta | null): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* True when a data point carries a `correction` (SG-406) — "we normalised/typo-fixed this
|
|
25
|
+
* value" provenance the block dedupe recorded, DISTINCT from a source-document conflict.
|
|
26
|
+
* Never implies `isSourceDiscrepancy`/`hasDiscrepancy`, and the reverse: a genuine conflict
|
|
27
|
+
* carries no `correction` unless the same value was also corrected.
|
|
28
|
+
*/
|
|
29
|
+
export declare function hasCorrection(meta?: DataPointMeta | null): boolean;
|
|
30
|
+
/** The correction record, or null/undefined when this data point carries none. */
|
|
31
|
+
export declare function correctionOf(meta?: DataPointMeta | null): Correction | null | undefined;
|