@pie-players/pie-tool-line-reader 0.3.62 → 0.3.64

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/README.md CHANGED
@@ -4,7 +4,9 @@ Draggable reading guide overlay tool for PIE assessment players.
4
4
 
5
5
  ## Overview
6
6
 
7
- Provides a movable, resizable colored overlay strip that helps students focus on specific lines of text during assessments. Supports both highlight mode (colored strip) and obscure/masking mode (darkens everything except the reading window).
7
+ Provides a movable, resizable reading window that helps students focus on specific lines of text during assessments.
8
+
9
+ The tool renders as a "window": a fully transparent **pane** through which the underlying page content is visible unchanged, surrounded on all four edges by an obscuring **frame** (black at 80% opacity by default) that largely hides the neighbouring lines. The frame starts as a 48px band above and below the pane and a 12px edge to its left and right.
8
10
 
9
11
  ## Custom Element
10
12
 
@@ -17,18 +19,92 @@ Tag: `pie-tool-line-reader`
17
19
 
18
20
  ## Features
19
21
 
20
- - Drag to reposition; bottom handle to resize height
21
- - Two modes: **highlight** (colored overlay) and **obscure** (masks surrounding content)
22
- - Five color options (yellow, blue, pink, green, orange) with adjustable opacity
22
+ - Clear window pane inside an obscuring frame, at a host-configured opacity
23
+ - Drag anywhere on the frame to reposition
24
+ - Three controls on the frame:
25
+ - **Close** (top right) hides the tool through `ToolCoordinator.hideTool`, which also
26
+ deactivates its toolbar button
27
+ - **Reading-window resize** (bottom centre) changes the pane height
28
+ - **Frame resize** (bottom right) changes the frame band height and the overall width
23
29
  - Full keyboard support:
24
- - Arrow keys to move
25
- - `+`/`-` to resize height
26
- - `C` to cycle colors
27
- - `[`/`]` to adjust opacity
28
- - `M` to toggle highlight/masking mode
30
+ - On the tool: arrow keys to move, `+`/`-` to resize the reading window, `Escape` to
31
+ close
32
+ - On the reading-window handle: up/down arrows change the pane height
33
+ - On the frame handle: up/down arrows change the frame band height, left/right arrows
34
+ change the width
35
+ - Every drag has a keyboard equivalent (WCAG 2.5.7) and controls meet the 24x24 minimum
36
+ target size (WCAG 2.5.8)
29
37
  - Screen reader announcements for all state changes
30
38
  - Connects to `AssessmentToolkitRuntimeContext` for ToolCoordinator integration
31
39
 
40
+ ## Configuration
41
+
42
+ How the frame masks the page — its fill and how strongly it obscures — is a host
43
+ setting, not a student one. It trades reading focus against how much surrounding
44
+ context a test taker can still see, which is a call a programme makes for its whole
45
+ population, so it is configured once per deployment rather than adjusted mid-test.
46
+
47
+ ```css
48
+ :root {
49
+ /* Masking strength; the pane is always fully transparent. */
50
+ --pie-tool-line-reader-frame-opacity: 0.65;
51
+ /* Fill of the obscuring frame. */
52
+ --pie-tool-line-reader-frame-color: #10233b;
53
+ }
54
+ ```
55
+
56
+ | Custom property | Default | Description |
57
+ |---|---|---|
58
+ | `--pie-tool-line-reader-frame-opacity` | `0.8` | Masking strength of the frame |
59
+ | `--pie-tool-line-reader-frame-color` | `#000` | Fill of the obscuring frame |
60
+ | `--pie-tool-line-reader-control-color` | `#fff` | Glyph colour of the close and resize controls |
61
+
62
+ All three are `component-public` entries in
63
+ `packages/theme/src/token-registry.json` and are safe for a host to rely on. The
64
+ component only reads them — it never writes them inline — so a plain host
65
+ declaration wins without `!important`.
66
+
67
+ Two constraints come with overriding them. Lowering the opacity weakens the masking
68
+ the tool exists to provide, and there is no in-session control for a student to
69
+ recover from a value that masks too little, so check any override against the
70
+ schemes you ship (see [Colour schemes](#colour-schemes) for the figures the
71
+ defaults produce). And `--pie-tool-line-reader-control-color` is a companion to the
72
+ fill rather than a hook worth setting alone: the control glyphs sit on the frame and
73
+ default to white to pair with a dark scrim, so a light fill needs a new glyph colour
74
+ with it, keeping 3:1 against the fill (WCAG 2.2 SC 1.4.11). The controls stay fully
75
+ opaque whatever the frame opacity is, so the fill alone decides that ratio.
76
+
77
+ ## Colour schemes
78
+
79
+ The frame stays a dark scrim in every PIE colour scheme instead of following
80
+ `--pie-text`. Masking works by collapsing the contrast of whatever it covers, and
81
+ an ink-coloured scrim defeats that on its own scheme — a yellow scrim over
82
+ `yellow-on-blue` text hides nothing, and a white one glares in a dark scheme the
83
+ reader chose to avoid glare. Dimming works in both directions: at the default fill
84
+ and opacity, across all six built-in schemes the covered text drops from
85
+ 10.9–19.3:1 down to 1.09–1.71:1.
86
+
87
+ What does follow the scheme is the boundary. On a light page the dark scrim shows
88
+ its own edge against the background (11.7–17.6:1), but on a dark page it blends in,
89
+ so `--pie-tool-line-reader-outline-color` draws an ink hairline that reads against
90
+ the scrim (7.6–9.8:1 in the dark schemes). The drop shadow is ink-derived for the
91
+ same reason, becoming a soft halo rather than disappearing.
92
+
93
+ Because the fill is a deployment setting rather than a scheme-derived one, a host
94
+ that overrides it owns these numbers for the schemes it ships.
95
+
96
+ ## Theming
97
+
98
+ The remaining custom properties are package-private, not part of the registered
99
+ host token contract: they are read as `var(--x, fallback)` (or set inline by the
100
+ component, for the geometry ones), so a host can override them, but they carry no
101
+ compatibility guarantee and may change with the tool's internals. Prefer the
102
+ semantic tokens they derive from.
103
+
104
+ | Custom property | Default | Description |
105
+ |---|---|---|
106
+ | `--pie-tool-line-reader-outline-color` | `--pie-text` at 70% | Hairline marking the window boundary |
107
+
32
108
  ## Integration
33
109
 
34
110
  Registered through the `ToolRegistry` as `lineReader`. Managed by `ToolkitCoordinator` via `tools.placement`.