@pie-players/pie-tool-line-reader 0.3.75 → 1.0.0-beta.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.
- package/README.md +15 -16
- package/custom-elements.json +82 -0
- package/dist/tool-line-reader.js +725 -722
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ Draggable reading guide overlay tool for PIE assessment players.
|
|
|
6
6
|
|
|
7
7
|
Provides a movable, resizable reading window that helps students focus on specific lines of text during assessments.
|
|
8
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
|
|
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 neighboring lines. The frame starts as a 48px band above and below the pane and a 12px edge to its left and right.
|
|
10
10
|
|
|
11
11
|
## Custom Element
|
|
12
12
|
|
|
@@ -24,7 +24,7 @@ Tag: `pie-tool-line-reader`
|
|
|
24
24
|
- Three controls on the frame:
|
|
25
25
|
- **Close** (top right) hides the tool through `ToolCoordinator.hideTool`, which also
|
|
26
26
|
deactivates its toolbar button
|
|
27
|
-
- **Reading-window resize** (bottom
|
|
27
|
+
- **Reading-window resize** (bottom center) 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
30
|
- On the tool: arrow keys to move, `+`/`-` to resize the reading window, `Escape` to
|
|
@@ -41,7 +41,7 @@ Tag: `pie-tool-line-reader`
|
|
|
41
41
|
|
|
42
42
|
How the frame masks the page — its fill and how strongly it obscures — is a host
|
|
43
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
|
|
44
|
+
context a test taker can still see, which is a call a program makes for its whole
|
|
45
45
|
population, so it is configured once per deployment rather than adjusted mid-test.
|
|
46
46
|
|
|
47
47
|
```css
|
|
@@ -57,7 +57,7 @@ population, so it is configured once per deployment rather than adjusted mid-tes
|
|
|
57
57
|
|---|---|---|
|
|
58
58
|
| `--pie-tool-line-reader-frame-opacity` | `0.8` | Masking strength of the frame |
|
|
59
59
|
| `--pie-tool-line-reader-frame-color` | `#000` | Fill of the obscuring frame |
|
|
60
|
-
| `--pie-tool-line-reader-control-color` | `#fff` | Glyph
|
|
60
|
+
| `--pie-tool-line-reader-control-color` | `#fff` | Glyph color of the close and resize controls |
|
|
61
61
|
|
|
62
62
|
All three are `component-public` entries in
|
|
63
63
|
`packages/theme/src/token-registry.json` and are safe for a host to rely on. The
|
|
@@ -67,27 +67,27 @@ declaration wins without `!important`.
|
|
|
67
67
|
Two constraints come with overriding them. Lowering the opacity weakens the masking
|
|
68
68
|
the tool exists to provide, and there is no in-session control for a student to
|
|
69
69
|
recover from a value that masks too little, so check any override against the
|
|
70
|
-
schemes you ship (see [
|
|
70
|
+
schemes you ship (see [Color schemes](#color-schemes) for the figures the
|
|
71
71
|
defaults produce). And `--pie-tool-line-reader-control-color` is a companion to the
|
|
72
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
|
|
73
|
+
default to white to pair with a dark scrim, so a light fill needs a new glyph color
|
|
74
74
|
with it, keeping 3:1 against the fill (WCAG 2.2 SC 1.4.11). The controls stay fully
|
|
75
75
|
opaque whatever the frame opacity is, so the fill alone decides that ratio.
|
|
76
76
|
|
|
77
|
-
##
|
|
77
|
+
## Color schemes
|
|
78
78
|
|
|
79
|
-
The frame stays a dark scrim in every PIE
|
|
79
|
+
The frame stays a dark scrim in every PIE color scheme instead of following
|
|
80
80
|
`--pie-text`. Masking works by collapsing the contrast of whatever it covers, and
|
|
81
|
-
an ink-
|
|
81
|
+
an ink-colored scrim defeats that on its own scheme — a yellow scrim over
|
|
82
82
|
`yellow-on-blue` text hides nothing, and a white one glares in a dark scheme the
|
|
83
83
|
reader chose to avoid glare. Dimming works in both directions: at the default fill
|
|
84
|
-
and opacity, across all
|
|
85
|
-
|
|
84
|
+
and opacity, across all ten built-in schemes the covered text drops from
|
|
85
|
+
6.2–21:1 down to 1.36–1.66:1.
|
|
86
86
|
|
|
87
87
|
What does follow the scheme is the boundary. On a light page the dark scrim shows
|
|
88
|
-
its own edge against the background (
|
|
88
|
+
its own edge against the background (7.7–12.6:1), but on a dark page it blends in,
|
|
89
89
|
so `--pie-tool-line-reader-outline-color` draws an ink hairline that reads against
|
|
90
|
-
the scrim (7.6–
|
|
90
|
+
the scrim (7.6–10:1 in the dark schemes). The drop shadow is ink-derived for the
|
|
91
91
|
same reason, becoming a soft halo rather than disappearing.
|
|
92
92
|
|
|
93
93
|
Because the fill is a deployment setting rather than a scheme-derived one, a host
|
|
@@ -97,9 +97,8 @@ that overrides it owns these numbers for the schemes it ships.
|
|
|
97
97
|
|
|
98
98
|
The remaining custom properties are package-private, not part of the registered
|
|
99
99
|
host token contract: they are read as `var(--x, fallback)` (or set inline by the
|
|
100
|
-
component, for the geometry ones),
|
|
101
|
-
|
|
102
|
-
semantic tokens they derive from.
|
|
100
|
+
component, for the geometry ones), carry no compatibility guarantee, and may
|
|
101
|
+
change with the tool's internals. Prefer the semantic tokens they derive from.
|
|
103
102
|
|
|
104
103
|
| Custom property | Default | Description |
|
|
105
104
|
|---|---|---|
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "2.1.0",
|
|
3
|
+
"modules": [
|
|
4
|
+
{
|
|
5
|
+
"kind": "javascript-module",
|
|
6
|
+
"path": "dist/tool-line-reader.js",
|
|
7
|
+
"declarations": [
|
|
8
|
+
{
|
|
9
|
+
"kind": "class",
|
|
10
|
+
"description": "Reading-guide overlay: a transparent reading window inside an obscuring frame that the student drags over text, with controls on the frame to resize the window, resize the frame and close. The host shows it with `visible`; inside a toolkit runtime context it registers `tool-id` with the tool coordinator on the tool layer, and the close control hides it there. Arrow keys move it, `+` and `-` resize the window, and Escape closes it.",
|
|
11
|
+
"name": "ToolLineReader",
|
|
12
|
+
"tagName": "pie-tool-line-reader",
|
|
13
|
+
"customElement": true,
|
|
14
|
+
"members": [
|
|
15
|
+
{
|
|
16
|
+
"kind": "field",
|
|
17
|
+
"name": "visible",
|
|
18
|
+
"type": {
|
|
19
|
+
"text": "boolean"
|
|
20
|
+
},
|
|
21
|
+
"default": "false",
|
|
22
|
+
"attribute": "visible"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"kind": "field",
|
|
26
|
+
"name": "toolId",
|
|
27
|
+
"type": {
|
|
28
|
+
"text": "string"
|
|
29
|
+
},
|
|
30
|
+
"default": "'lineReader'",
|
|
31
|
+
"attribute": "tool-id"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"attributes": [
|
|
35
|
+
{
|
|
36
|
+
"name": "visible",
|
|
37
|
+
"type": {
|
|
38
|
+
"text": "boolean"
|
|
39
|
+
},
|
|
40
|
+
"default": "false",
|
|
41
|
+
"fieldName": "visible"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "tool-id",
|
|
45
|
+
"type": {
|
|
46
|
+
"text": "string"
|
|
47
|
+
},
|
|
48
|
+
"default": "'lineReader'",
|
|
49
|
+
"fieldName": "toolId"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"cssProperties": [
|
|
53
|
+
{
|
|
54
|
+
"name": "--pie-tool-line-reader-control-color",
|
|
55
|
+
"description": "Glyph colour of the line reader's close and resize controls. Registered as the required companion to --pie-tool-line-reader-frame-color rather than as a hook worth setting on its own: the controls sit on the frame, so this is paired with the fill and not with the page, and the #fff default only holds while the fill stays dark. A host that sets a light fill must set this too. Does not fall through --pie-text or the canonical button tokens, which track the page rather than the scrim the glyphs are drawn on. Must keep 3:1 against the resolved fill (WCAG 2.2 SC 1.4.11); the controls are fully opaque regardless of --pie-tool-line-reader-frame-opacity, so the fill alone determines the ratio."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "--pie-tool-line-reader-frame-color",
|
|
59
|
+
"description": "Fill of the line reader's obscuring frame, configured per deployment alongside --pie-tool-line-reader-frame-opacity. Deliberately does not fall through --pie-text or any canonical surface token, and deliberately does not follow data-color-scheme: masking works by collapsing the contrast of whatever it covers, and an ink-coloured scrim defeats that on its own scheme -- a yellow scrim over yellow-on-blue text hides nothing, and a white one glares in a dark scheme the reader chose to avoid glare. The #000 default dims in both directions instead, dropping covered text from 6.2-21:1 to 1.36-1.66:1 across the ten built-in schemes. A host overriding it owns that verification for every scheme it ships, and must set --pie-tool-line-reader-control-color with it when picking a light fill, because the control glyphs default to white to pair with the dark scrim."
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "--pie-tool-line-reader-frame-opacity",
|
|
63
|
+
"description": "Masking strength of the line reader's obscuring frame. A programme-level decision rather than a student one -- it sets how much surrounding context a test taker can still see -- so it is configured per deployment and the tool exposes no in-session control for it. Read as var() with a 0.8 default and never written inline by the component, so a host declaration wins without !important. Does not fall through any canonical token: this is unitless masking strength, not a palette value. Lowering it weakens the masking the tool exists to provide and invalidates the contrast figures recorded for --pie-tool-line-reader-frame-color, which were measured at the 0.8 default."
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"x-pie": {
|
|
67
|
+
"shadow": "open"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"exports": [
|
|
72
|
+
{
|
|
73
|
+
"kind": "custom-element-definition",
|
|
74
|
+
"name": "pie-tool-line-reader",
|
|
75
|
+
"declaration": {
|
|
76
|
+
"name": "ToolLineReader"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
}
|