@pie-players/pie-tool-line-reader 0.3.63 → 0.3.65

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
@@ -19,7 +19,7 @@ Tag: `pie-tool-line-reader`
19
19
 
20
20
  ## Features
21
21
 
22
- - Clear window pane inside an obscuring frame; adjustable frame opacity
22
+ - Clear window pane inside an obscuring frame, at a host-configured opacity
23
23
  - Drag anywhere on the frame to reposition
24
24
  - Three controls on the frame:
25
25
  - **Close** (top right) hides the tool through `ToolCoordinator.hideTool`, which also
@@ -27,8 +27,8 @@ Tag: `pie-tool-line-reader`
27
27
  - **Reading-window resize** (bottom centre) changes the pane height
28
28
  - **Frame resize** (bottom right) changes the frame band height and the overall width
29
29
  - Full keyboard support:
30
- - On the tool: arrow keys to move, `+`/`-` to resize the reading window, `[`/`]` to
31
- adjust frame opacity, `Escape` to close
30
+ - On the tool: arrow keys to move, `+`/`-` to resize the reading window, `Escape` to
31
+ close
32
32
  - On the reading-window handle: up/down arrows change the pane height
33
33
  - On the frame handle: up/down arrows change the frame band height, left/right arrows
34
34
  change the width
@@ -37,34 +37,52 @@ Tag: `pie-tool-line-reader`
37
37
  - Screen reader announcements for all state changes
38
38
  - Connects to `AssessmentToolkitRuntimeContext` for ToolCoordinator integration
39
39
 
40
- ## Theming
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.
41
46
 
42
- These are package-private custom properties, not part of the registered host
43
- token contract in `packages/theme/src/token-registry.json`: they are read as
44
- `var(--x, fallback)` (or set inline by the component, for the geometry ones), so
45
- a host can override them, but they carry no compatibility guarantee and may
46
- change with the tool's internals. Prefer the semantic tokens they derive from.
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
+ ```
47
55
 
48
56
  | Custom property | Default | Description |
49
57
  |---|---|---|
58
+ | `--pie-tool-line-reader-frame-opacity` | `0.8` | Masking strength of the frame |
50
59
  | `--pie-tool-line-reader-frame-color` | `#000` | Fill of the obscuring frame |
51
- | `--pie-tool-line-reader-frame-opacity` | `0.8` | Frame opacity; the pane is always fully transparent |
52
- | `--pie-tool-line-reader-outline-color` | `--pie-text` at 70% | Hairline marking the window boundary |
53
60
  | `--pie-tool-line-reader-control-color` | `#fff` | Glyph colour of the close and resize controls |
54
61
 
55
- The frame opacity custom property is set inline by the component from its current
56
- state, so host overrides need `!important` (or a higher-specificity rule) to win.
57
- The controls sit on top of the frame rather than inside it, so they stay fully
58
- opaque whatever the frame opacity is.
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`.
59
66
 
60
- ### Colour schemes
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
61
78
 
62
79
  The frame stays a dark scrim in every PIE colour scheme instead of following
63
80
  `--pie-text`. Masking works by collapsing the contrast of whatever it covers, and
64
81
  an ink-coloured scrim defeats that on its own scheme — a yellow scrim over
65
82
  `yellow-on-blue` text hides nothing, and a white one glares in a dark scheme the
66
- reader chose to avoid glare. Dimming works in both directions: across all six
67
- built-in schemes the covered text drops from 10.9–19.3:1 down to 1.09–1.71:1.
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.
68
86
 
69
87
  What does follow the scheme is the boundary. On a light page the dark scrim shows
70
88
  its own edge against the background (11.7–17.6:1), but on a dark page it blends in,
@@ -72,9 +90,20 @@ so `--pie-tool-line-reader-outline-color` draws an ink hairline that reads again
72
90
  the scrim (7.6–9.8:1 in the dark schemes). The drop shadow is ink-derived for the
73
91
  same reason, becoming a soft halo rather than disappearing.
74
92
 
75
- Overriding `--pie-tool-line-reader-frame-color` to a light fill means overriding
76
- `--pie-tool-line-reader-control-color` too — the glyphs are white to pair with the
77
- dark scrim, not with the page.
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 |
78
107
 
79
108
  ## Integration
80
109
 
package/dist/index.d.ts CHANGED
@@ -1,7 +1 @@
1
- /**
2
- * pie-tool-line-reader - PIE Assessment Tool
3
- *
4
- * This package exports a web component built from Svelte.
5
- * Import the built version for CDN usage, or the .svelte source for Svelte projects.
6
- */
7
- export {};
1
+ export {}