@thehammer/template-verification 0.2.13 → 0.2.15
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 +54 -34
- package/dist/index.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/template-verification.js +204 -193
- package/dist/types.d.ts +77 -4
- package/package.json +1 -1
|
@@ -24,46 +24,66 @@ 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
|
-
* ====
|
|
27
|
+
* ==== PLACEMENT: MOSTLY OUTSIDE THE VALUE, NEVER IN ITS OWN RESERVED SPACE ====
|
|
28
28
|
*
|
|
29
|
-
*
|
|
29
|
+
* Operator decision (SG-432 comment #4534/#4536, SG-638), verbatim: "Absolute
|
|
30
|
+
* positioned OUTSIDE of the data point, should overlay partially like 50%
|
|
31
|
+
* outside and 50% above so it covers a very small portion of the text. Hover
|
|
32
|
+
* over the text should fade to 30% the overlay checkmark, but still clickable
|
|
33
|
+
* for the action."
|
|
30
34
|
*
|
|
31
|
-
*
|
|
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.
|
|
35
|
+
* That is exactly what renders below, and nothing reserves space for it:
|
|
38
36
|
*
|
|
39
|
-
* The mark
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* character
|
|
37
|
+
* 1. NO REFLOW. The mark is always `position: absolute`, taken out of normal
|
|
38
|
+
* flow. Turning the overlay on or off, or a field going from "unverified"
|
|
39
|
+
* to "verified", moves no character — there is no slot to appear, grow, or
|
|
40
|
+
* disappear, on screen or in print.
|
|
41
|
+
* 2. MOSTLY OUTSIDE THE VALUE. The mark is centred on a point at the TOP-RIGHT
|
|
42
|
+
* corner of the value's own trailing edge — half its width sits to the
|
|
43
|
+
* right of that corner (outside the text entirely) and half sits to the
|
|
44
|
+
* left (over the last character); half its height sits above that corner
|
|
45
|
+
* (outside, above the line) and half sits below (over the top of the last
|
|
46
|
+
* character). Only that one small corner is ever covered, never the whole
|
|
47
|
+
* glyph the old zero-space `right: 0` shape used to hide (`Abdinasir Abdi`
|
|
48
|
+
* rendering as `Abdinasir ✔`).
|
|
47
49
|
*
|
|
48
|
-
*
|
|
50
|
+
* ==== ANCHORING TO THE TRAILING EDGE OF WRAPPED TEXT ====
|
|
49
51
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
52
|
+
* A value can wrap across lines, and the mark has to track wherever the LAST
|
|
53
|
+
* line ends — not the value's own bounding box, which spans every line. The
|
|
54
|
+
* fix is a trailing, zero-size `<span class="tv-mark-anchor">`, written as the
|
|
55
|
+
* next inline SIBLING immediately after `.tv-field-value` (both children of
|
|
56
|
+
* `.tv-field`) — not nested inside the value, so the mark's own glyph is never
|
|
57
|
+
* part of the value's own text/accessible content (copy/paste and
|
|
58
|
+
* `.textContent` on the value read exactly the value, nothing appended). As
|
|
59
|
+
* an ordinary inline box with zero width and zero height, the anchor takes up
|
|
60
|
+
* no visual space and is laid out by the browser exactly where an extra
|
|
61
|
+
* character would have gone — because inline layout is one continuous
|
|
62
|
+
* formatting context across element boundaries, a `<span>` boundary does not
|
|
63
|
+
* start a new line, so the anchor lands on whatever line the value's own text
|
|
64
|
+
* wrapped to, exactly as if it were one more character of that text. It is
|
|
65
|
+
* `position: relative`, so it is the positioning containing block for the
|
|
66
|
+
* mark, which is `position: absolute; left: 0; top: 0; transform:
|
|
67
|
+
* translate(-50%, -50%)` inside it — centring the mark's box exactly on the
|
|
68
|
+
* anchor's own (0, 0) point, which is what produces the 50%-outside / 50%-
|
|
69
|
+
* above split described above. This is the correct technique for inline text
|
|
70
|
+
* specifically because an inline box's position is resolved by the same
|
|
71
|
+
* line-breaking algorithm that wraps the text itself; a box anchored to
|
|
72
|
+
* `.tv-field-value`'s own (single) bounding rect cannot express "the end of
|
|
73
|
+
* whichever line is last."
|
|
59
74
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* the
|
|
65
|
-
*
|
|
66
|
-
*
|
|
75
|
+
* ==== HOVER FADE, STILL CLICKABLE, FULL OPACITY ON FOCUS ====
|
|
76
|
+
*
|
|
77
|
+
* `.tv-field-value:hover ~ .tv-mark-anchor .tv-overlay` fades the mark to 30%
|
|
78
|
+
* opacity while the VALUE is hovered (the general-sibling combinator reaches
|
|
79
|
+
* the anchor from its preceding sibling). `.tv-overlay:hover` covers hovering
|
|
80
|
+
* the MARK directly — together the two satisfy the operator's decision
|
|
81
|
+
* ("hover over the text... the overlay checkmark") without nesting the mark
|
|
82
|
+
* inside the value's own text. Opacity never disables pointer events, so the
|
|
83
|
+
* mark stays a real, clickable `<button>` at 30%. `:focus-visible` raises it
|
|
84
|
+
* back to full opacity with higher selector specificity than either hover
|
|
85
|
+
* rule, so a keyboard user tabbing to the mark while the pointer happens to
|
|
86
|
+
* be resting on the value still sees it clearly.
|
|
67
87
|
*/
|
|
68
88
|
type __VLS_Props = {
|
|
69
89
|
source?: MetaCarrier;
|
package/dist/index.d.ts
CHANGED
|
@@ -41,4 +41,4 @@ export type { WalkedDataPoint } from "./lib/walk";
|
|
|
41
41
|
export { computeProgress } from "./lib/progress";
|
|
42
42
|
export type { VerificationProgress } from "./lib/progress";
|
|
43
43
|
export { CHROME_CLASS, ENABLED_STORAGE_KEY } from "./constants";
|
|
44
|
-
export type { VerificationStatus, ResolvedSource, SourceChoice, VerificationSource, ExtractedCandidate, OverrideCandidate, ClaimCandidate, CandidateSet, DataPointAnchor, ResolvedValue, DataPointMeta, MetaCarrier, SaveOverrideArgs, SaveOverrideFn, } from "./types";
|
|
44
|
+
export type { VerificationStatus, ResolvedSource, SourceChoice, VerificationSource, ExtractedCandidate, HumanCitation, OverrideCandidate, ClaimCandidate, CandidateSet, DataPointAnchor, ResolvedValue, DataPointMeta, MetaCarrier, SaveOverrideArgs, SaveOverrideFn, } from "./types";
|