@pie-players/pie-assessment-toolkit 0.2.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.
Files changed (194) hide show
  1. package/README.md +520 -0
  2. package/dist/attempt/TestSession.d.ts +90 -0
  3. package/dist/attempt/TestSession.d.ts.map +1 -0
  4. package/dist/attempt/TestSession.js +174 -0
  5. package/dist/attempt/TestSession.js.map +1 -0
  6. package/dist/core/TypedEventBus.d.ts +48 -0
  7. package/dist/core/TypedEventBus.d.ts.map +1 -0
  8. package/dist/core/TypedEventBus.js +63 -0
  9. package/dist/core/TypedEventBus.js.map +1 -0
  10. package/dist/index.d.ts +37 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +44 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/item-loader.d.ts +45 -0
  15. package/dist/item-loader.d.ts.map +1 -0
  16. package/dist/item-loader.js +62 -0
  17. package/dist/item-loader.js.map +1 -0
  18. package/dist/player/AssessmentPlayer.d.ts +388 -0
  19. package/dist/player/AssessmentPlayer.d.ts.map +1 -0
  20. package/dist/player/AssessmentPlayer.js +965 -0
  21. package/dist/player/AssessmentPlayer.js.map +1 -0
  22. package/dist/player/index.d.ts +17 -0
  23. package/dist/player/index.d.ts.map +1 -0
  24. package/dist/player/index.js +15 -0
  25. package/dist/player/index.js.map +1 -0
  26. package/dist/player/navigation-types.d.ts +63 -0
  27. package/dist/player/navigation-types.d.ts.map +1 -0
  28. package/dist/player/navigation-types.js +7 -0
  29. package/dist/player/navigation-types.js.map +1 -0
  30. package/dist/player/qti-navigation.d.ts +29 -0
  31. package/dist/player/qti-navigation.d.ts.map +1 -0
  32. package/dist/player/qti-navigation.js +160 -0
  33. package/dist/player/qti-navigation.js.map +1 -0
  34. package/dist/reference-layout/index.d.ts +19 -0
  35. package/dist/reference-layout/index.d.ts.map +1 -0
  36. package/dist/reference-layout/index.js +20 -0
  37. package/dist/reference-layout/index.js.map +1 -0
  38. package/dist/services/AccessibilityCatalogResolver.d.ts +141 -0
  39. package/dist/services/AccessibilityCatalogResolver.d.ts.map +1 -0
  40. package/dist/services/AccessibilityCatalogResolver.js +249 -0
  41. package/dist/services/AccessibilityCatalogResolver.js.map +1 -0
  42. package/dist/services/AssessmentAuthoringService.d.ts +60 -0
  43. package/dist/services/AssessmentAuthoringService.d.ts.map +1 -0
  44. package/dist/services/AssessmentAuthoringService.js +183 -0
  45. package/dist/services/AssessmentAuthoringService.js.map +1 -0
  46. package/dist/services/ContextVariableStore.d.ts +114 -0
  47. package/dist/services/ContextVariableStore.d.ts.map +1 -0
  48. package/dist/services/ContextVariableStore.js +207 -0
  49. package/dist/services/ContextVariableStore.js.map +1 -0
  50. package/dist/services/ElementToolStateStore.d.ts +125 -0
  51. package/dist/services/ElementToolStateStore.d.ts.map +1 -0
  52. package/dist/services/ElementToolStateStore.js +200 -0
  53. package/dist/services/ElementToolStateStore.js.map +1 -0
  54. package/dist/services/HighlightCoordinator.d.ts +179 -0
  55. package/dist/services/HighlightCoordinator.d.ts.map +1 -0
  56. package/dist/services/HighlightCoordinator.js +446 -0
  57. package/dist/services/HighlightCoordinator.js.map +1 -0
  58. package/dist/services/I18nService.d.ts +121 -0
  59. package/dist/services/I18nService.d.ts.map +1 -0
  60. package/dist/services/I18nService.js +276 -0
  61. package/dist/services/I18nService.js.map +1 -0
  62. package/dist/services/PNPMapper.d.ts +71 -0
  63. package/dist/services/PNPMapper.d.ts.map +1 -0
  64. package/dist/services/PNPMapper.js +98 -0
  65. package/dist/services/PNPMapper.js.map +1 -0
  66. package/dist/services/PNPToolResolver.d.ts +127 -0
  67. package/dist/services/PNPToolResolver.d.ts.map +1 -0
  68. package/dist/services/PNPToolResolver.js +222 -0
  69. package/dist/services/PNPToolResolver.js.map +1 -0
  70. package/dist/services/SSMLExtractor.d.ts +61 -0
  71. package/dist/services/SSMLExtractor.d.ts.map +1 -0
  72. package/dist/services/SSMLExtractor.js +181 -0
  73. package/dist/services/SSMLExtractor.js.map +1 -0
  74. package/dist/services/TTSService.d.ts +162 -0
  75. package/dist/services/TTSService.d.ts.map +1 -0
  76. package/dist/services/TTSService.js +465 -0
  77. package/dist/services/TTSService.js.map +1 -0
  78. package/dist/services/ThemeProvider.d.ts +95 -0
  79. package/dist/services/ThemeProvider.d.ts.map +1 -0
  80. package/dist/services/ThemeProvider.js +299 -0
  81. package/dist/services/ThemeProvider.js.map +1 -0
  82. package/dist/services/ToolConfigResolver.d.ts +162 -0
  83. package/dist/services/ToolConfigResolver.d.ts.map +1 -0
  84. package/dist/services/ToolConfigResolver.js +230 -0
  85. package/dist/services/ToolConfigResolver.js.map +1 -0
  86. package/dist/services/ToolCoordinator.d.ts +137 -0
  87. package/dist/services/ToolCoordinator.d.ts.map +1 -0
  88. package/dist/services/ToolCoordinator.js +318 -0
  89. package/dist/services/ToolCoordinator.js.map +1 -0
  90. package/dist/services/ToolkitCoordinator.d.ts +188 -0
  91. package/dist/services/ToolkitCoordinator.d.ts.map +1 -0
  92. package/dist/services/ToolkitCoordinator.js +252 -0
  93. package/dist/services/ToolkitCoordinator.js.map +1 -0
  94. package/dist/services/interfaces.d.ts +391 -0
  95. package/dist/services/interfaces.d.ts.map +1 -0
  96. package/dist/services/interfaces.js +12 -0
  97. package/dist/services/interfaces.js.map +1 -0
  98. package/dist/services/tool-providers/DesmosToolProvider.d.ts +103 -0
  99. package/dist/services/tool-providers/DesmosToolProvider.d.ts.map +1 -0
  100. package/dist/services/tool-providers/DesmosToolProvider.js +127 -0
  101. package/dist/services/tool-providers/DesmosToolProvider.js.map +1 -0
  102. package/dist/services/tool-providers/IToolProvider.d.ts +137 -0
  103. package/dist/services/tool-providers/IToolProvider.d.ts.map +1 -0
  104. package/dist/services/tool-providers/IToolProvider.js +13 -0
  105. package/dist/services/tool-providers/IToolProvider.js.map +1 -0
  106. package/dist/services/tool-providers/TIToolProvider.d.ts +107 -0
  107. package/dist/services/tool-providers/TIToolProvider.d.ts.map +1 -0
  108. package/dist/services/tool-providers/TIToolProvider.js +123 -0
  109. package/dist/services/tool-providers/TIToolProvider.js.map +1 -0
  110. package/dist/services/tool-providers/TTSToolProvider.d.ts +143 -0
  111. package/dist/services/tool-providers/TTSToolProvider.d.ts.map +1 -0
  112. package/dist/services/tool-providers/TTSToolProvider.js +168 -0
  113. package/dist/services/tool-providers/TTSToolProvider.js.map +1 -0
  114. package/dist/services/tool-providers/ToolProviderRegistry.d.ts +165 -0
  115. package/dist/services/tool-providers/ToolProviderRegistry.d.ts.map +1 -0
  116. package/dist/services/tool-providers/ToolProviderRegistry.js +240 -0
  117. package/dist/services/tool-providers/ToolProviderRegistry.js.map +1 -0
  118. package/dist/services/tool-providers/index.d.ts +18 -0
  119. package/dist/services/tool-providers/index.d.ts.map +1 -0
  120. package/dist/services/tool-providers/index.js +15 -0
  121. package/dist/services/tool-providers/index.js.map +1 -0
  122. package/dist/services/tts/browser-provider.d.ts +24 -0
  123. package/dist/services/tts/browser-provider.d.ts.map +1 -0
  124. package/dist/services/tts/browser-provider.js +177 -0
  125. package/dist/services/tts/browser-provider.js.map +1 -0
  126. package/dist/services/tts/provider-interface.d.ts +131 -0
  127. package/dist/services/tts/provider-interface.d.ts.map +1 -0
  128. package/dist/services/tts/provider-interface.js +10 -0
  129. package/dist/services/tts/provider-interface.js.map +1 -0
  130. package/dist/tools/calculators/desmos-provider.d.ts +54 -0
  131. package/dist/tools/calculators/desmos-provider.d.ts.map +1 -0
  132. package/dist/tools/calculators/desmos-provider.js +384 -0
  133. package/dist/tools/calculators/desmos-provider.js.map +1 -0
  134. package/dist/tools/calculators/mathjs-provider.d.ts +50 -0
  135. package/dist/tools/calculators/mathjs-provider.d.ts.map +1 -0
  136. package/dist/tools/calculators/mathjs-provider.js +660 -0
  137. package/dist/tools/calculators/mathjs-provider.js.map +1 -0
  138. package/dist/tools/calculators/ti-provider.d.ts +122 -0
  139. package/dist/tools/calculators/ti-provider.d.ts.map +1 -0
  140. package/dist/tools/calculators/ti-provider.js +587 -0
  141. package/dist/tools/calculators/ti-provider.js.map +1 -0
  142. package/dist/tools/client.d.ts +17 -0
  143. package/dist/tools/client.d.ts.map +1 -0
  144. package/dist/tools/client.js +26 -0
  145. package/dist/tools/client.js.map +1 -0
  146. package/dist/tools/index.d.ts +8 -0
  147. package/dist/tools/index.d.ts.map +1 -0
  148. package/dist/tools/index.js +10 -0
  149. package/dist/tools/index.js.map +1 -0
  150. package/dist/tools/library-loader.d.ts +63 -0
  151. package/dist/tools/library-loader.d.ts.map +1 -0
  152. package/dist/tools/library-loader.js +292 -0
  153. package/dist/tools/library-loader.js.map +1 -0
  154. package/dist/tools/response-discovery.d.ts +72 -0
  155. package/dist/tools/response-discovery.d.ts.map +1 -0
  156. package/dist/tools/response-discovery.js +183 -0
  157. package/dist/tools/response-discovery.js.map +1 -0
  158. package/dist/tools/tool-coordinator.d.ts +76 -0
  159. package/dist/tools/tool-coordinator.d.ts.map +1 -0
  160. package/dist/tools/tool-coordinator.js +197 -0
  161. package/dist/tools/tool-coordinator.js.map +1 -0
  162. package/dist/tools/types.d.ts +427 -0
  163. package/dist/tools/types.d.ts.map +1 -0
  164. package/dist/tools/types.js +13 -0
  165. package/dist/tools/types.js.map +1 -0
  166. package/dist/tools/variant-resolver.d.ts +48 -0
  167. package/dist/tools/variant-resolver.d.ts.map +1 -0
  168. package/dist/tools/variant-resolver.js +214 -0
  169. package/dist/tools/variant-resolver.js.map +1 -0
  170. package/dist/types/events.d.ts +157 -0
  171. package/dist/types/events.d.ts.map +1 -0
  172. package/dist/types/events.js +11 -0
  173. package/dist/types/events.js.map +1 -0
  174. package/dist/utils/logger.d.ts +7 -0
  175. package/dist/utils/logger.d.ts.map +1 -0
  176. package/dist/utils/logger.js +11 -0
  177. package/dist/utils/logger.js.map +1 -0
  178. package/package.json +71 -0
  179. package/src/README.md +626 -0
  180. package/src/components/QuestionToolBar.svelte +406 -0
  181. package/src/player/AssessmentLayout.svelte +68 -0
  182. package/src/player/README.md +154 -0
  183. package/src/reference-layout/README.md +135 -0
  184. package/src/reference-layout/ReferenceLayout.svelte +209 -0
  185. package/src/reference-layout/components/AssessmentContent.svelte +259 -0
  186. package/src/reference-layout/components/AssessmentFooter.svelte +89 -0
  187. package/src/reference-layout/components/AssessmentHeader.svelte +250 -0
  188. package/src/reference-layout/components/AssessmentNavigation.svelte +134 -0
  189. package/src/reference-layout/components/AssessmentToolsBar.svelte +176 -0
  190. package/src/reference-layout/components/ItemPanel.svelte +200 -0
  191. package/src/reference-layout/components/NotesPanel.svelte +179 -0
  192. package/src/reference-layout/components/PassagePanel.svelte +76 -0
  193. package/src/tools/README.md +616 -0
  194. package/src/tools/calculators/README.md +395 -0
@@ -0,0 +1,179 @@
1
+ /**
2
+ * HighlightCoordinator
3
+ *
4
+ * Manages separate highlight layers for TTS (temporary) and annotations (persistent).
5
+ * Uses CSS Custom Highlight API - zero DOM mutation, preserves accessibility.
6
+ *
7
+ * Features:
8
+ * - Separate layers prevent TTS clearing from removing student annotations
9
+ * - CSS Custom Highlight API (no DOM mutation)
10
+ * - Full accessibility support (screen readers see original text)
11
+ * - Configurable colors and styles
12
+ *
13
+ * Part of PIE Assessment Toolkit.
14
+ *
15
+ * Browser Support:
16
+ * - Chrome/Edge 105+
17
+ * - Safari 17.2+
18
+ * - Firefox: Behind flag (not recommended for production)
19
+ *
20
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API
21
+ */
22
+ import type { IHighlightCoordinator } from "./interfaces";
23
+ /**
24
+ * Highlight types
25
+ */
26
+ export declare enum HighlightType {
27
+ TTS_WORD = "tts-word",
28
+ TTS_SENTENCE = "tts-sentence",
29
+ ANNOTATION = "annotation"
30
+ }
31
+ /**
32
+ * Highlight colors for annotations
33
+ */
34
+ export declare enum HighlightColor {
35
+ YELLOW = "yellow",
36
+ GREEN = "green",
37
+ BLUE = "blue",
38
+ PINK = "pink",
39
+ ORANGE = "orange"
40
+ }
41
+ /**
42
+ * Annotation data
43
+ */
44
+ export interface Annotation {
45
+ id: string;
46
+ range: Range;
47
+ type: HighlightType.ANNOTATION;
48
+ color: HighlightColor;
49
+ timestamp: number;
50
+ }
51
+ /**
52
+ * Configuration for HighlightCoordinator
53
+ * Currently empty but allows future extension without breaking changes
54
+ */
55
+ export type HighlightCoordinatorConfig = Record<string, never>;
56
+ export declare class HighlightCoordinator implements IHighlightCoordinator {
57
+ private config;
58
+ private ttsWordHighlight;
59
+ private ttsSentenceHighlight;
60
+ private annotations;
61
+ private annotationHighlights;
62
+ private nextAnnotationId;
63
+ private supported;
64
+ constructor(config?: HighlightCoordinatorConfig);
65
+ /**
66
+ * Initialize CSS Custom Highlights
67
+ */
68
+ private initializeHighlights;
69
+ /**
70
+ * Register CSS styles for highlights
71
+ */
72
+ private registerStyles;
73
+ /**
74
+ * Highlight a word for TTS (temporary)
75
+ *
76
+ * @param textNode Text node containing the word
77
+ * @param startOffset Start position in text node
78
+ * @param endOffset End position in text node
79
+ */
80
+ highlightTTSWord(textNode: Text, startOffset: number, endOffset: number): void;
81
+ /**
82
+ * Highlight a sentence for TTS (temporary)
83
+ *
84
+ * @param ranges Array of ranges that make up the sentence
85
+ */
86
+ highlightTTSSentence(ranges: Range[]): void;
87
+ /**
88
+ * Clear TTS word highlight
89
+ */
90
+ clearTTSWord(): void;
91
+ /**
92
+ * Clear TTS sentence highlight
93
+ */
94
+ clearTTSSentence(): void;
95
+ /**
96
+ * Clear all TTS highlights
97
+ */
98
+ clearTTS(): void;
99
+ /**
100
+ * Add an annotation highlight (persistent)
101
+ *
102
+ * @param range Text range to annotate
103
+ * @param color Highlight color
104
+ * @returns Annotation ID for later removal
105
+ */
106
+ addAnnotation(range: Range, color?: HighlightColor): string;
107
+ /**
108
+ * Remove an annotation
109
+ *
110
+ * @param id Annotation ID
111
+ */
112
+ removeAnnotation(id: string): void;
113
+ /**
114
+ * Remove all annotations
115
+ */
116
+ clearAnnotations(): void;
117
+ /**
118
+ * Get all annotations
119
+ */
120
+ getAnnotations(): Annotation[];
121
+ /**
122
+ * Get annotation by ID
123
+ */
124
+ getAnnotation(id: string): Annotation | null;
125
+ /**
126
+ * Change annotation color
127
+ *
128
+ * @param id Annotation ID
129
+ * @param newColor New color
130
+ */
131
+ changeAnnotationColor(id: string, newColor: HighlightColor): void;
132
+ /**
133
+ * Export annotations as serializable data
134
+ */
135
+ exportAnnotations(): Array<{
136
+ id: string;
137
+ startContainer: string;
138
+ startOffset: number;
139
+ endContainer: string;
140
+ endOffset: number;
141
+ color: HighlightColor;
142
+ timestamp: number;
143
+ }>;
144
+ /**
145
+ * Get XPath-like path for a node (simplified)
146
+ */
147
+ private getNodePath;
148
+ /**
149
+ * Highlight a text range (interface method)
150
+ *
151
+ * Generic method that adapts to the specific highlight type.
152
+ * For more control, use the specific methods like highlightTTSWord().
153
+ */
154
+ highlightRange(range: Range, type: HighlightType, color?: HighlightColor): void;
155
+ /**
156
+ * Clear highlights of a specific type (interface method)
157
+ */
158
+ clearHighlights(type: HighlightType): void;
159
+ /**
160
+ * Clear all highlights (interface method)
161
+ */
162
+ clearAll(): void;
163
+ /**
164
+ * Check if CSS Highlight API is supported (interface method)
165
+ */
166
+ isSupported(): boolean;
167
+ /**
168
+ * Update TTS highlight style dynamically
169
+ *
170
+ * @param color CSS color value (e.g., '#ffeb3b')
171
+ * @param opacity Opacity value (0.0 to 1.0)
172
+ */
173
+ updateTTSHighlightStyle(color: string, opacity: number): void;
174
+ /**
175
+ * Cleanup - remove all highlights
176
+ */
177
+ destroy(): void;
178
+ }
179
+ //# sourceMappingURL=HighlightCoordinator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HighlightCoordinator.d.ts","sourceRoot":"","sources":["../../src/services/HighlightCoordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D;;GAEG;AACH,oBAAY,aAAa;IACxB,QAAQ,aAAa;IACrB,YAAY,iBAAi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gB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAYlC;;OAEG;IACH,gBAAgB,IAAI,IAAI;IAMxB;;OAEG;IACH,cAAc,IAAI,UAAU,EAAE;IAI9B;;OAEG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAI5C;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI;IAiBjE;;OAEG;IACH,iBAAiB,IAAI,KAAK,CAAC;QAC1B,EAAE,EAAE,MAAM,CAAC;QACX,cAAc,EAAE,MAAM,CAAC;QACvB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,cAAc,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;KAClB,CAAC;IAcF;;OAEG;IACH,OAAO,CAAC,WAAW;IAoBnB;;;;;OAKG;IACH,cAAc,CACb,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,aAAa,EACnB,KAAK,GAAE,cAAsC,GAC3C,IAAI;IAwBP;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI;IAgB1C;;OAEG;IACH,QAAQ,IAAI,IAAI;IAMhB;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;;;;OAKG;IACH,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAiE7D;;OAEG;IACH,OAAO,IAAI,IAAI;CAcf"}
@@ -0,0 +1,446 @@
1
+ /**
2
+ * HighlightCoordinator
3
+ *
4
+ * Manages separate highlight layers for TTS (temporary) and annotations (persistent).
5
+ * Uses CSS Custom Highlight API - zero DOM mutation, preserves accessibility.
6
+ *
7
+ * Features:
8
+ * - Separate layers prevent TTS clearing from removing student annotations
9
+ * - CSS Custom Highlight API (no DOM mutation)
10
+ * - Full accessibility support (screen readers see original text)
11
+ * - Configurable colors and styles
12
+ *
13
+ * Part of PIE Assessment Toolkit.
14
+ *
15
+ * Browser Support:
16
+ * - Chrome/Edge 105+
17
+ * - Safari 17.2+
18
+ * - Firefox: Behind flag (not recommended for production)
19
+ *
20
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API
21
+ */
22
+ /**
23
+ * Highlight types
24
+ */
25
+ export var HighlightType;
26
+ (function (HighlightType) {
27
+ HighlightType["TTS_WORD"] = "tts-word";
28
+ HighlightType["TTS_SENTENCE"] = "tts-sentence";
29
+ HighlightType["ANNOTATION"] = "annotation";
30
+ })(HighlightType || (HighlightType = {}));
31
+ /**
32
+ * Highlight colors for annotations
33
+ */
34
+ export var HighlightColor;
35
+ (function (HighlightColor) {
36
+ HighlightColor["YELLOW"] = "yellow";
37
+ HighlightColor["GREEN"] = "green";
38
+ HighlightColor["BLUE"] = "blue";
39
+ HighlightColor["PINK"] = "pink";
40
+ HighlightColor["ORANGE"] = "orange";
41
+ })(HighlightColor || (HighlightColor = {}));
42
+ export class HighlightCoordinator {
43
+ config;
44
+ ttsWordHighlight = null;
45
+ ttsSentenceHighlight = null;
46
+ annotations = new Map();
47
+ annotationHighlights = new Map();
48
+ nextAnnotationId = 1;
49
+ supported = false;
50
+ constructor(config = {}) {
51
+ this.config = config;
52
+ // SSR guard
53
+ if (typeof CSS === "undefined" || !("highlights" in CSS)) {
54
+ console.warn("CSS Custom Highlight API not supported (SSR or unsupported browser)");
55
+ return;
56
+ }
57
+ this.supported = true;
58
+ this.initializeHighlights();
59
+ this.registerStyles();
60
+ }
61
+ /**
62
+ * Initialize CSS Custom Highlights
63
+ */
64
+ initializeHighlights() {
65
+ if (!this.supported)
66
+ return;
67
+ // Create highlight registries
68
+ this.ttsWordHighlight = new Highlight();
69
+ this.ttsSentenceHighlight = new Highlight();
70
+ // Register with CSS
71
+ CSS.highlights.set("tts-word", this.ttsWordHighlight);
72
+ CSS.highlights.set("tts-sentence", this.ttsSentenceHighlight);
73
+ }
74
+ /**
75
+ * Register CSS styles for highlights
76
+ */
77
+ registerStyles() {
78
+ if (!this.supported)
79
+ return;
80
+ if (typeof document === "undefined")
81
+ return; // SSR guard
82
+ // Check if styles already exist
83
+ if (document.getElementById("pie-highlight-styles"))
84
+ return;
85
+ const style = document.createElement("style");
86
+ style.id = "pie-highlight-styles";
87
+ style.textContent = `
88
+ /* TTS highlights - temporary */
89
+ ::highlight(tts-word) {
90
+ background-color: rgba(255, 235, 59, 0.4);
91
+ color: inherit;
92
+ }
93
+
94
+ ::highlight(tts-sentence) {
95
+ background-color: rgba(173, 216, 230, 0.3);
96
+ color: inherit;
97
+ }
98
+
99
+ /* Annotation highlights - persistent */
100
+ ::highlight(annotation-yellow) {
101
+ background-color: rgba(255, 255, 0, 0.3);
102
+ color: inherit;
103
+ }
104
+
105
+ ::highlight(annotation-green) {
106
+ background-color: rgba(144, 238, 144, 0.3);
107
+ color: inherit;
108
+ }
109
+
110
+ ::highlight(annotation-blue) {
111
+ background-color: rgba(173, 216, 230, 0.3);
112
+ color: inherit;
113
+ }
114
+
115
+ ::highlight(annotation-pink) {
116
+ background-color: rgba(255, 182, 193, 0.3);
117
+ color: inherit;
118
+ }
119
+
120
+ ::highlight(annotation-orange) {
121
+ background-color: rgba(255, 165, 0, 0.3);
122
+ color: inherit;
123
+ }
124
+ `;
125
+ document.head.appendChild(style);
126
+ }
127
+ /**
128
+ * Highlight a word for TTS (temporary)
129
+ *
130
+ * @param textNode Text node containing the word
131
+ * @param startOffset Start position in text node
132
+ * @param endOffset End position in text node
133
+ */
134
+ highlightTTSWord(textNode, startOffset, endOffset) {
135
+ if (!this.ttsWordHighlight)
136
+ return;
137
+ // Clear previous word highlight
138
+ this.clearTTSWord();
139
+ // Create range for word
140
+ const range = document.createRange();
141
+ range.setStart(textNode, startOffset);
142
+ range.setEnd(textNode, endOffset);
143
+ // Add to highlight
144
+ this.ttsWordHighlight.add(range);
145
+ }
146
+ /**
147
+ * Highlight a sentence for TTS (temporary)
148
+ *
149
+ * @param ranges Array of ranges that make up the sentence
150
+ */
151
+ highlightTTSSentence(ranges) {
152
+ if (!this.ttsSentenceHighlight)
153
+ return;
154
+ // Clear previous sentence highlight
155
+ this.clearTTSSentence();
156
+ // Add all ranges
157
+ for (const range of ranges) {
158
+ this.ttsSentenceHighlight.add(range);
159
+ }
160
+ }
161
+ /**
162
+ * Clear TTS word highlight
163
+ */
164
+ clearTTSWord() {
165
+ if (!this.ttsWordHighlight)
166
+ return;
167
+ this.ttsWordHighlight.clear();
168
+ }
169
+ /**
170
+ * Clear TTS sentence highlight
171
+ */
172
+ clearTTSSentence() {
173
+ if (!this.ttsSentenceHighlight)
174
+ return;
175
+ this.ttsSentenceHighlight.clear();
176
+ }
177
+ /**
178
+ * Clear all TTS highlights
179
+ */
180
+ clearTTS() {
181
+ this.clearTTSWord();
182
+ this.clearTTSSentence();
183
+ }
184
+ /**
185
+ * Add an annotation highlight (persistent)
186
+ *
187
+ * @param range Text range to annotate
188
+ * @param color Highlight color
189
+ * @returns Annotation ID for later removal
190
+ */
191
+ addAnnotation(range, color = HighlightColor.YELLOW) {
192
+ const id = `annotation-${this.nextAnnotationId++}`;
193
+ // Store annotation data
194
+ const annotation = {
195
+ id,
196
+ range: range.cloneRange(),
197
+ type: HighlightType.ANNOTATION,
198
+ color,
199
+ timestamp: Date.now(),
200
+ };
201
+ this.annotations.set(id, annotation);
202
+ // Create highlight for this annotation
203
+ const highlight = new Highlight(range);
204
+ this.annotationHighlights.set(id, highlight);
205
+ // Register with CSS
206
+ CSS.highlights.set(`annotation-${color}-${id}`, highlight);
207
+ return id;
208
+ }
209
+ /**
210
+ * Remove an annotation
211
+ *
212
+ * @param id Annotation ID
213
+ */
214
+ removeAnnotation(id) {
215
+ const annotation = this.annotations.get(id);
216
+ if (!annotation)
217
+ return;
218
+ // Remove from CSS highlights
219
+ CSS.highlights.delete(`annotation-${annotation.color}-${id}`);
220
+ // Clean up
221
+ this.annotationHighlights.delete(id);
222
+ this.annotations.delete(id);
223
+ }
224
+ /**
225
+ * Remove all annotations
226
+ */
227
+ clearAnnotations() {
228
+ for (const id of this.annotations.keys()) {
229
+ this.removeAnnotation(id);
230
+ }
231
+ }
232
+ /**
233
+ * Get all annotations
234
+ */
235
+ getAnnotations() {
236
+ return Array.from(this.annotations.values());
237
+ }
238
+ /**
239
+ * Get annotation by ID
240
+ */
241
+ getAnnotation(id) {
242
+ return this.annotations.get(id) ?? null;
243
+ }
244
+ /**
245
+ * Change annotation color
246
+ *
247
+ * @param id Annotation ID
248
+ * @param newColor New color
249
+ */
250
+ changeAnnotationColor(id, newColor) {
251
+ const annotation = this.annotations.get(id);
252
+ if (!annotation)
253
+ return;
254
+ // Remove old highlight
255
+ CSS.highlights.delete(`annotation-${annotation.color}-${id}`);
256
+ // Update color
257
+ annotation.color = newColor;
258
+ // Re-register with new color
259
+ const highlight = this.annotationHighlights.get(id);
260
+ if (highlight) {
261
+ CSS.highlights.set(`annotation-${newColor}-${id}`, highlight);
262
+ }
263
+ }
264
+ /**
265
+ * Export annotations as serializable data
266
+ */
267
+ exportAnnotations() {
268
+ // Note: This is a simplified export. Production implementation
269
+ // would need a robust way to serialize DOM ranges.
270
+ return this.getAnnotations().map((annotation) => ({
271
+ id: annotation.id,
272
+ startContainer: this.getNodePath(annotation.range.startContainer),
273
+ startOffset: annotation.range.startOffset,
274
+ endContainer: this.getNodePath(annotation.range.endContainer),
275
+ endOffset: annotation.range.endOffset,
276
+ color: annotation.color,
277
+ timestamp: annotation.timestamp,
278
+ }));
279
+ }
280
+ /**
281
+ * Get XPath-like path for a node (simplified)
282
+ */
283
+ getNodePath(node) {
284
+ const path = [];
285
+ let current = node;
286
+ while (current && current !== document.body) {
287
+ if (current.parentNode) {
288
+ const siblings = Array.from(current.parentNode.childNodes);
289
+ const index = siblings.indexOf(current);
290
+ path.unshift(`${current.nodeName}[${index}]`);
291
+ }
292
+ current = current.parentNode;
293
+ }
294
+ return "/" + path.join("/");
295
+ }
296
+ // ============================================================================
297
+ // IHighlightCoordinator Interface Implementation
298
+ // ============================================================================
299
+ /**
300
+ * Highlight a text range (interface method)
301
+ *
302
+ * Generic method that adapts to the specific highlight type.
303
+ * For more control, use the specific methods like highlightTTSWord().
304
+ */
305
+ highlightRange(range, type, color = HighlightColor.YELLOW) {
306
+ if (!this.supported)
307
+ return;
308
+ switch (type) {
309
+ case HighlightType.TTS_WORD:
310
+ case HighlightType.TTS_SENTENCE: {
311
+ // For TTS, add to appropriate highlight
312
+ const highlight = type === HighlightType.TTS_WORD
313
+ ? this.ttsWordHighlight
314
+ : this.ttsSentenceHighlight;
315
+ if (highlight) {
316
+ highlight.clear();
317
+ highlight.add(range);
318
+ }
319
+ break;
320
+ }
321
+ case HighlightType.ANNOTATION:
322
+ // For annotations, use the existing method
323
+ this.addAnnotation(range, color);
324
+ break;
325
+ }
326
+ }
327
+ /**
328
+ * Clear highlights of a specific type (interface method)
329
+ */
330
+ clearHighlights(type) {
331
+ if (!this.supported)
332
+ return;
333
+ switch (type) {
334
+ case HighlightType.TTS_WORD:
335
+ this.clearTTSWord();
336
+ break;
337
+ case HighlightType.TTS_SENTENCE:
338
+ this.clearTTSSentence();
339
+ break;
340
+ case HighlightType.ANNOTATION:
341
+ this.clearAnnotations();
342
+ break;
343
+ }
344
+ }
345
+ /**
346
+ * Clear all highlights (interface method)
347
+ */
348
+ clearAll() {
349
+ if (!this.supported)
350
+ return;
351
+ this.clearTTS();
352
+ this.clearAnnotations();
353
+ }
354
+ /**
355
+ * Check if CSS Highlight API is supported (interface method)
356
+ */
357
+ isSupported() {
358
+ return this.supported;
359
+ }
360
+ /**
361
+ * Update TTS highlight style dynamically
362
+ *
363
+ * @param color CSS color value (e.g., '#ffeb3b')
364
+ * @param opacity Opacity value (0.0 to 1.0)
365
+ */
366
+ updateTTSHighlightStyle(color, opacity) {
367
+ if (!this.supported)
368
+ return;
369
+ if (typeof document === "undefined")
370
+ return;
371
+ const styleEl = document.getElementById("pie-highlight-styles");
372
+ if (!styleEl)
373
+ return;
374
+ // Convert hex to rgba
375
+ const hexToRgb = (hex) => {
376
+ const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
377
+ return result
378
+ ? {
379
+ r: parseInt(result[1], 16),
380
+ g: parseInt(result[2], 16),
381
+ b: parseInt(result[3], 16),
382
+ }
383
+ : null;
384
+ };
385
+ const rgb = hexToRgb(color);
386
+ if (!rgb)
387
+ return;
388
+ const rgbaColor = `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, ${opacity})`;
389
+ // Update the style element
390
+ styleEl.textContent = `
391
+ /* TTS highlights - temporary */
392
+ ::highlight(tts-word) {
393
+ background-color: ${rgbaColor};
394
+ color: inherit;
395
+ }
396
+
397
+ ::highlight(tts-sentence) {
398
+ background-color: rgba(173, 216, 230, 0.3);
399
+ color: inherit;
400
+ }
401
+
402
+ /* Annotation highlights - persistent */
403
+ ::highlight(annotation-yellow) {
404
+ background-color: rgba(255, 255, 0, 0.3);
405
+ color: inherit;
406
+ }
407
+
408
+ ::highlight(annotation-green) {
409
+ background-color: rgba(144, 238, 144, 0.3);
410
+ color: inherit;
411
+ }
412
+
413
+ ::highlight(annotation-blue) {
414
+ background-color: rgba(173, 216, 230, 0.3);
415
+ color: inherit;
416
+ }
417
+
418
+ ::highlight(annotation-pink) {
419
+ background-color: rgba(255, 182, 193, 0.3);
420
+ color: inherit;
421
+ }
422
+
423
+ ::highlight(annotation-orange) {
424
+ background-color: rgba(255, 165, 0, 0.3);
425
+ color: inherit;
426
+ }
427
+ `;
428
+ }
429
+ /**
430
+ * Cleanup - remove all highlights
431
+ */
432
+ destroy() {
433
+ if (!this.supported)
434
+ return;
435
+ this.clearTTS();
436
+ this.clearAnnotations();
437
+ // Remove style element
438
+ if (typeof document !== "undefined") {
439
+ const styleEl = document.getElementById("pie-highlight-styles");
440
+ if (styleEl) {
441
+ styleEl.remove();
442
+ }
443
+ }
444
+ }
445
+ }
446
+ //# sourceMappingURL=HighlightCoordinator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HighlightCoordinator.js","sourceRoot":"","sources":["../../src/services/HighlightCoordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAIH;;GAEG;AACH,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACxB,sCAAqB,CAAA;IACrB,8CAA6B,CAAA;IAC7B,0CAAyB,CAAA;AAC1B,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAMX;AAND,WAAY,cAAc;IACzB,mCAAiB,CAAA;IACjB,iCAAe,CAAA;IACf,+BAAa,CAAA;IACb,+BAAa,CAAA;IACb,mCAAiB,CAAA;AAClB,CAAC,EANW,cAAc,KAAd,cAAc,QAMzB;AAmBD,MAAM,OAAO,oBAAoB;IACxB,MAAM,CAA6B;IACnC,gBAAgB,GAAqB,IAAI,CAAC;IAC1C,oBAAoB,GAAqB,IAAI,CAAC;IAC9C,WAAW,GAAG,IAAI,GAAG,EAAsB,CAAC;IAC5C,oBAAoB,GAAG,IAAI,GAAG,EAAqB,CAAC;IACpD,gBAAgB,GAAG,CAAC,CAAC;IACrB,SAAS,GAAG,KAAK,CAAC;IAE1B,YAAY,SAAqC,EAAE;QAClD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,YAAY;QACZ,IAAI,OAAO,GAAG,KAAK,WAAW,IAAI,CAAC,CAAC,YAAY,IAAI,GAAG,CAAC,EAAE,CAAC;YAC1D,OAAO,CAAC,IAAI,CACX,qEAAqE,CACrE,CAAC;YACF,OAAO;QACR,CAAC;QAED,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,CAAC,cAAc,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACK,oBAAoB;QAC3B,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE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