@pie-players/pie-tool-annotation-toolbar 0.3.59 → 0.3.61
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.
|
@@ -2776,6 +2776,116 @@ var Ss = class $r {
|
|
|
2776
2776
|
text-underline-offset: 2px;
|
|
2777
2777
|
color: inherit;
|
|
2778
2778
|
}
|
|
2779
|
+
|
|
2780
|
+
/* The blocks below cover annotation swatches, print, and reduced motion.
|
|
2781
|
+
They deliberately do NOT retune the TTS layers: applyAdaptiveTTSStyle()
|
|
2782
|
+
writes the pie-tts custom properties inline on documentElement on every
|
|
2783
|
+
paint and on theme change, so a media query that only varies a var()
|
|
2784
|
+
fallback for those can never take effect. Annotation colours have no such
|
|
2785
|
+
adaptive path -- they are fixed swatches a student chose -- so a media
|
|
2786
|
+
query is the only way to adjust them, and each keeps its var() so a host
|
|
2787
|
+
override still wins.
|
|
2788
|
+
|
|
2789
|
+
The names above are spelled without their leading dashes on purpose.
|
|
2790
|
+
check-theme-tokens scans comments, and its token pattern stops at the
|
|
2791
|
+
first non-alphanumeric character, so writing the wildcard form reads as
|
|
2792
|
+
consumption of a shorter token that is not in the registry and fails the
|
|
2793
|
+
check. Spell property names in full, or omit the dashes. */
|
|
2794
|
+
|
|
2795
|
+
@media (prefers-color-scheme: dark) {
|
|
2796
|
+
::highlight(annotation-yellow) {
|
|
2797
|
+
background-color: var(--pie-annotation-yellow-highlight, rgba(139, 117, 0, 0.6));
|
|
2798
|
+
}
|
|
2799
|
+
::highlight(annotation-green) {
|
|
2800
|
+
background-color: var(--pie-annotation-green-highlight, rgba(45, 92, 63, 0.6));
|
|
2801
|
+
}
|
|
2802
|
+
::highlight(annotation-blue) {
|
|
2803
|
+
background-color: var(--pie-annotation-blue-highlight, rgba(0, 102, 170, 0.6));
|
|
2804
|
+
}
|
|
2805
|
+
::highlight(annotation-pink) {
|
|
2806
|
+
background-color: var(--pie-annotation-pink-highlight, rgba(139, 51, 74, 0.6));
|
|
2807
|
+
}
|
|
2808
|
+
::highlight(annotation-orange) {
|
|
2809
|
+
background-color: var(--pie-annotation-orange-highlight, rgba(154, 99, 0, 0.6));
|
|
2810
|
+
}
|
|
2811
|
+
::highlight(annotation-underline) {
|
|
2812
|
+
text-decoration-color: var(--pie-primary, #4da6ff);
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
/* WCAG 2.2 SC 1.4.11 non-text contrast: a highlight is the only indication
|
|
2817
|
+
that text is annotated, so the swatches saturate and the underline
|
|
2818
|
+
thickens when the user asks for more contrast.
|
|
2819
|
+
|
|
2820
|
+
The value is "more", not "high". The stylesheet this was recovered from
|
|
2821
|
+
used prefers-contrast: high, which is not a valid value for the feature
|
|
2822
|
+
-- the keywords are no-preference, more, less, custom. An invalid query
|
|
2823
|
+
evaluates to "not all", so that block could never have matched in any
|
|
2824
|
+
browser even had the file been loaded. Verified with matchMedia under
|
|
2825
|
+
emulation: "high" stays false where "more" flips true. */
|
|
2826
|
+
@media (prefers-contrast: more) {
|
|
2827
|
+
::highlight(annotation-yellow) {
|
|
2828
|
+
background-color: var(--pie-annotation-yellow-highlight, rgba(255, 255, 0, 0.7));
|
|
2829
|
+
}
|
|
2830
|
+
::highlight(annotation-green) {
|
|
2831
|
+
background-color: var(--pie-annotation-green-highlight, rgba(0, 255, 127, 0.7));
|
|
2832
|
+
}
|
|
2833
|
+
::highlight(annotation-blue) {
|
|
2834
|
+
background-color: var(--pie-annotation-blue-highlight, rgba(0, 191, 255, 0.7));
|
|
2835
|
+
}
|
|
2836
|
+
::highlight(annotation-pink) {
|
|
2837
|
+
background-color: var(--pie-annotation-pink-highlight, rgba(255, 105, 180, 0.7));
|
|
2838
|
+
}
|
|
2839
|
+
::highlight(annotation-orange) {
|
|
2840
|
+
background-color: var(--pie-annotation-orange-highlight, rgba(255, 165, 0, 0.85));
|
|
2841
|
+
}
|
|
2842
|
+
::highlight(annotation-underline) {
|
|
2843
|
+
text-decoration-thickness: 3px;
|
|
2844
|
+
}
|
|
2845
|
+
}
|
|
2846
|
+
|
|
2847
|
+
@media print {
|
|
2848
|
+
/* TTS highlighting is a transient read-along cue, not content. */
|
|
2849
|
+
::highlight(tts-word),
|
|
2850
|
+
::highlight(tts-sentence),
|
|
2851
|
+
[data-pie-tts-word-element="true"],
|
|
2852
|
+
[data-pie-tts-sentence-element="true"] {
|
|
2853
|
+
background-color: transparent;
|
|
2854
|
+
text-decoration: none;
|
|
2855
|
+
text-shadow: none;
|
|
2856
|
+
border-bottom: none;
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
/* Annotations are student work and must survive printing, but a fill
|
|
2860
|
+
that reads fine on screen can print as an illegible wash, so each
|
|
2861
|
+
becomes an underline that keeps its colour coding. */
|
|
2862
|
+
::highlight(annotation-yellow),
|
|
2863
|
+
::highlight(annotation-green),
|
|
2864
|
+
::highlight(annotation-blue),
|
|
2865
|
+
::highlight(annotation-pink),
|
|
2866
|
+
::highlight(annotation-orange) {
|
|
2867
|
+
background-color: transparent;
|
|
2868
|
+
border-bottom: 2px solid currentColor;
|
|
2869
|
+
}
|
|
2870
|
+
::highlight(annotation-yellow) { border-bottom-color: #ffeb3b; }
|
|
2871
|
+
::highlight(annotation-green) { border-bottom-color: #a6e1c5; }
|
|
2872
|
+
::highlight(annotation-blue) { border-bottom-color: #a7e0f6; }
|
|
2873
|
+
::highlight(annotation-pink) { border-bottom-color: #ff9fae; }
|
|
2874
|
+
::highlight(annotation-orange) { border-bottom-color: #ffa500; }
|
|
2875
|
+
::highlight(annotation-underline) {
|
|
2876
|
+
text-decoration-color: #000;
|
|
2877
|
+
border-bottom: none;
|
|
2878
|
+
}
|
|
2879
|
+
}
|
|
2880
|
+
|
|
2881
|
+
/* text-shadow is a direct property rather than a var(), so unlike the
|
|
2882
|
+
other TTS rules this one is not overridden by the adaptive path. */
|
|
2883
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2884
|
+
::highlight(tts-word),
|
|
2885
|
+
[data-pie-tts-word-element="true"] {
|
|
2886
|
+
text-shadow: none;
|
|
2887
|
+
}
|
|
2888
|
+
}
|
|
2779
2889
|
`, document.head.appendChild(t);
|
|
2780
2890
|
}
|
|
2781
2891
|
highlightTTSWord(t, n, r) {
|
|
@@ -3340,9 +3450,11 @@ function $c(e) {
|
|
|
3340
3450
|
"pie-multiple-choice",
|
|
3341
3451
|
"pie-inline-choice",
|
|
3342
3452
|
"pie-select-text",
|
|
3453
|
+
"pie-ebsr",
|
|
3343
3454
|
"multiple-choice",
|
|
3344
3455
|
"inline-choice",
|
|
3345
|
-
"select-text"
|
|
3456
|
+
"select-text",
|
|
3457
|
+
"ebsr"
|
|
3346
3458
|
];
|
|
3347
3459
|
if (xs(e)) {
|
|
3348
3460
|
const n = e.item.config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-players/pie-tool-annotation-toolbar",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.61",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Text annotation toolbar with highlighting and underlining for PIE assessment player",
|
|
6
6
|
"repository": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"unpkg": "./dist/tool-annotation-toolbar.js",
|
|
37
37
|
"jsdelivr": "./dist/tool-annotation-toolbar.js",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@pie-players/pie-assessment-toolkit": "0.3.
|
|
40
|
-
"@pie-players/pie-players-shared": "0.3.
|
|
39
|
+
"@pie-players/pie-assessment-toolkit": "0.3.61",
|
|
40
|
+
"@pie-players/pie-players-shared": "0.3.61"
|
|
41
41
|
},
|
|
42
42
|
"types": "./dist/index.d.ts",
|
|
43
43
|
"scripts": {
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
::highlight(tts-word){background-color:var( --pie-tts-word-highlight, color-mix(in srgb, var(--pie-missing, #ffeb3b) 68%, transparent) );text-decoration:underline 2px solid var( --pie-tts-word-underline, color-mix(in srgb, var(--pie-text, #111827) 70%, transparent) );text-underline-offset:2px;text-shadow:0 0 1px var( --pie-tts-word-shadow, color-mix(in srgb, var(--pie-text, #111827) 35%, transparent) );color:inherit}::highlight(tts-sentence){background-color:var( --pie-tts-sentence-highlight, color-mix(in srgb, var(--pie-missing, #ffeb3b) 38%, transparent) );color:inherit}::highlight(annotation-yellow){background-color:var( --pie-annotation-yellow-highlight, rgba(253, 233, 149, .5) );color:inherit}::highlight(annotation-pink){background-color:var( --pie-annotation-pink-highlight, rgba(255, 159, 174, .5) );color:inherit}::highlight(annotation-blue){background-color:var( --pie-annotation-blue-highlight, rgba(167, 224, 246, .5) );color:inherit}::highlight(annotation-green){background-color:var( --pie-annotation-green-highlight, rgba(166, 225, 197, .5) );color:inherit}::highlight(annotation-underline){background-color:transparent;text-decoration:underline 2px solid var(--pie-primary, #0066cc);text-underline-offset:2px;color:inherit}@media(prefers-color-scheme:dark){::highlight(tts-word){background-color:var( --pie-tts-word-highlight, color-mix(in srgb, var(--pie-missing, #ffeb3b) 72%, transparent) );text-decoration:underline 2px solid var( --pie-tts-word-underline, color-mix(in srgb, var(--pie-white, #fff) 70%, transparent) );text-shadow:0 0 2px var( --pie-tts-word-shadow, color-mix(in srgb, var(--pie-white, #fff) 32%, transparent) )}::highlight(tts-sentence){background-color:var( --pie-tts-sentence-highlight, color-mix(in srgb, var(--pie-missing, #ffeb3b) 42%, transparent) )}::highlight(annotation-yellow){background-color:#8b750099}::highlight(annotation-pink){background-color:#8b334a99}::highlight(annotation-blue){background-color:#06a9}::highlight(annotation-green){background-color:#2d5c3f99}::highlight(annotation-underline){text-decoration-color:#4da6ff}}@media(prefers-contrast:high){::highlight(tts-word){background-color:var( --pie-tts-word-highlight, color-mix(in srgb, var(--pie-missing, #ffeb3b) 85%, transparent) );text-decoration-color:var( --pie-tts-word-underline, color-mix(in srgb, var(--pie-text, #111827) 85%, transparent) );text-decoration-thickness:3px;text-shadow:none}::highlight(tts-sentence){background-color:var( --pie-tts-sentence-highlight, color-mix(in srgb, var(--pie-missing, #ffeb3b) 55%, transparent) )}::highlight(annotation-yellow){background-color:#ffff00b3}::highlight(annotation-pink){background-color:#ff69b4b3}::highlight(annotation-blue){background-color:#00bfffb3}::highlight(annotation-green){background-color:#00ff7fb3}::highlight(annotation-underline){text-decoration-thickness:3px;text-decoration-color:#000}}@media(prefers-color-scheme:dark)and (prefers-contrast:high){::highlight(tts-word){background-color:var( --pie-tts-word-highlight, color-mix(in srgb, var(--pie-missing, #ffeb3b) 85%, transparent) );text-decoration-color:var( --pie-tts-word-underline, color-mix(in srgb, var(--pie-white, #fff) 88%, transparent) )}::highlight(annotation-underline){text-decoration-color:#fff}}@media print{::highlight(tts-word),::highlight(tts-sentence){background-color:transparent;text-decoration:none;text-shadow:none}::highlight(annotation-yellow),::highlight(annotation-pink),::highlight(annotation-blue),::highlight(annotation-green){background-color:transparent;border-bottom:2px solid currentColor}::highlight(annotation-yellow){border-bottom-color:#ffeb3b}::highlight(annotation-pink){border-bottom-color:#ff9fae}::highlight(annotation-blue){border-bottom-color:#a7e0f6}::highlight(annotation-green){border-bottom-color:#a6e1c5}::highlight(annotation-underline){text-decoration-color:#000;border-bottom:none}}@media(prefers-reduced-motion:reduce){::highlight(tts-word){text-shadow:none}}.pie-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pie-tool-annotation-toolbar button:focus-visible{outline:2px solid var(--pie-button-focus-outline, var(--pie-primary, #0066cc));outline-offset:2px}@media(prefers-color-scheme:dark){.pie-tool-annotation-toolbar button:focus-visible{outline-color:#4da6ff}}@media(prefers-contrast:high){.pie-tool-annotation-toolbar button:focus-visible{outline-width:3px}}
|
|
2
|
-
/*$vite$:1*/
|