@pie-qti/item-player 0.1.10 → 0.1.11

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 (572) hide show
  1. package/dist/catalog/applyGlossaryTriggers.d.ts +0 -1
  2. package/dist/catalog/applyGlossaryTriggers.js +1 -0
  3. package/dist/catalog/applyGlossaryTriggers.js.map +1 -0
  4. package/dist/catalog/catalogExtractor.d.ts +0 -1
  5. package/dist/catalog/catalogExtractor.js +1 -0
  6. package/dist/catalog/catalogExtractor.js.map +1 -0
  7. package/dist/catalog/catalogLookup.d.ts +0 -1
  8. package/dist/catalog/catalogLookup.js +1 -0
  9. package/dist/catalog/catalogLookup.js.map +1 -0
  10. package/dist/catalog/glossaryAction.d.ts +0 -1
  11. package/dist/catalog/glossaryAction.js +1 -0
  12. package/dist/catalog/glossaryAction.js.map +1 -0
  13. package/dist/catalog/types.d.ts +0 -1
  14. package/dist/catalog/types.js +1 -0
  15. package/dist/catalog/types.js.map +1 -0
  16. package/dist/components/actions/typesetAction.d.ts +0 -1
  17. package/dist/components/actions/typesetAction.js +1 -0
  18. package/dist/components/actions/typesetAction.js.map +1 -0
  19. package/dist/components/utils/feedbackUtils.d.ts +0 -1
  20. package/dist/components/utils/feedbackUtils.js +1 -0
  21. package/dist/components/utils/feedbackUtils.js.map +1 -0
  22. package/dist/components/utils/index.d.ts +0 -1
  23. package/dist/components/utils/index.js +1 -0
  24. package/dist/components/utils/index.js.map +1 -0
  25. package/dist/components/utils/stimulusRender.d.ts +0 -1
  26. package/dist/components/utils/stimulusRender.js +1 -0
  27. package/dist/components/utils/stimulusRender.js.map +1 -0
  28. package/dist/components/utils/stylesheetRender.d.ts +0 -1
  29. package/dist/components/utils/stylesheetRender.js +1 -0
  30. package/dist/components/utils/stylesheetRender.js.map +1 -0
  31. package/dist/core/ComponentRegistry.d.ts +0 -1
  32. package/dist/core/ComponentRegistry.js +1 -0
  33. package/dist/core/ComponentRegistry.js.map +1 -0
  34. package/dist/core/Player.d.ts +0 -1
  35. package/dist/core/Player.js +1 -0
  36. package/dist/core/Player.js.map +1 -0
  37. package/dist/core/Plugin.d.ts +0 -1
  38. package/dist/core/Plugin.js +1 -0
  39. package/dist/core/Plugin.js.map +1 -0
  40. package/dist/core/PluginManager.d.ts +0 -1
  41. package/dist/core/PluginManager.js +1 -0
  42. package/dist/core/PluginManager.js.map +1 -0
  43. package/dist/core/constants.d.ts +0 -1
  44. package/dist/core/constants.js +1 -0
  45. package/dist/core/constants.js.map +1 -0
  46. package/dist/core/declarations.d.ts +0 -1
  47. package/dist/core/declarations.js +1 -0
  48. package/dist/core/declarations.js.map +1 -0
  49. package/dist/core/parsingLimits.d.ts +0 -1
  50. package/dist/core/parsingLimits.js +1 -0
  51. package/dist/core/parsingLimits.js.map +1 -0
  52. package/dist/core/random.d.ts +0 -1
  53. package/dist/core/random.js +1 -0
  54. package/dist/core/random.js.map +1 -0
  55. package/dist/core/rolePolicy.d.ts +0 -1
  56. package/dist/core/rolePolicy.js +1 -0
  57. package/dist/core/rolePolicy.js.map +1 -0
  58. package/dist/core/sanitizer.d.ts +0 -1
  59. package/dist/core/sanitizer.js +1 -0
  60. package/dist/core/sanitizer.js.map +1 -0
  61. package/dist/core/trustedTypes.d.ts +0 -1
  62. package/dist/core/trustedTypes.js +1 -0
  63. package/dist/core/trustedTypes.js.map +1 -0
  64. package/dist/core/urlPolicy.d.ts +0 -1
  65. package/dist/core/urlPolicy.js +1 -0
  66. package/dist/core/urlPolicy.js.map +1 -0
  67. package/dist/document/AssessmentItemDocument.d.ts +0 -1
  68. package/dist/document/AssessmentItemDocument.js +1 -0
  69. package/dist/document/AssessmentItemDocument.js.map +1 -0
  70. package/dist/element.js +8 -9
  71. package/dist/element.js.map +1 -1
  72. package/dist/extensions/MathLiveEditor.d.ts +0 -1
  73. package/dist/extensions/MathLiveEditor.js +1 -0
  74. package/dist/extensions/MathLiveEditor.js.map +1 -0
  75. package/dist/extraction/ExtractionRegistry.d.ts +0 -1
  76. package/dist/extraction/ExtractionRegistry.js +1 -0
  77. package/dist/extraction/ExtractionRegistry.js.map +1 -0
  78. package/dist/extraction/createContext.d.ts +0 -1
  79. package/dist/extraction/createContext.js +1 -0
  80. package/dist/extraction/createContext.js.map +1 -0
  81. package/dist/extraction/index.d.ts +0 -1
  82. package/dist/extraction/index.js +1 -0
  83. package/dist/extraction/index.js.map +1 -0
  84. package/dist/extraction/interactionExtractionPipeline.d.ts +0 -1
  85. package/dist/extraction/interactionExtractionPipeline.js +1 -0
  86. package/dist/extraction/interactionExtractionPipeline.js.map +1 -0
  87. package/dist/extraction/interactionSecurity.d.ts +0 -1
  88. package/dist/extraction/interactionSecurity.js +1 -0
  89. package/dist/extraction/interactionSecurity.js.map +1 -0
  90. package/dist/extraction/types.d.ts +0 -1
  91. package/dist/extraction/types.js +1 -0
  92. package/dist/extraction/types.js.map +1 -0
  93. package/dist/extraction/utils.d.ts +0 -1
  94. package/dist/extraction/utils.js +1 -0
  95. package/dist/extraction/utils.js.map +1 -0
  96. package/dist/iframe/IFramePlayerHost.d.ts +0 -1
  97. package/dist/iframe/IFramePlayerHost.js +1 -0
  98. package/dist/iframe/IFramePlayerHost.js.map +1 -0
  99. package/dist/iframe/index.d.ts +0 -1
  100. package/dist/iframe/index.js +1 -0
  101. package/dist/iframe/index.js.map +1 -0
  102. package/dist/iframe/protocol.d.ts +0 -1
  103. package/dist/iframe/protocol.js +1 -0
  104. package/dist/iframe/protocol.js.map +1 -0
  105. package/dist/index.d.ts +0 -1
  106. package/dist/index.js +1 -0
  107. package/dist/index.js.map +1 -0
  108. package/dist/interactions/associate/extractor.d.ts +0 -1
  109. package/dist/interactions/associate/extractor.js +1 -0
  110. package/dist/interactions/associate/extractor.js.map +1 -0
  111. package/dist/interactions/associate/index.d.ts +0 -1
  112. package/dist/interactions/associate/index.js +1 -0
  113. package/dist/interactions/associate/index.js.map +1 -0
  114. package/dist/interactions/associate/types.d.ts +0 -1
  115. package/dist/interactions/associate/types.js +1 -0
  116. package/dist/interactions/associate/types.js.map +1 -0
  117. package/dist/interactions/choice/extractor.d.ts +0 -1
  118. package/dist/interactions/choice/extractor.js +1 -0
  119. package/dist/interactions/choice/extractor.js.map +1 -0
  120. package/dist/interactions/choice/index.d.ts +0 -1
  121. package/dist/interactions/choice/index.js +1 -0
  122. package/dist/interactions/choice/index.js.map +1 -0
  123. package/dist/interactions/choice/types.d.ts +0 -1
  124. package/dist/interactions/choice/types.js +1 -0
  125. package/dist/interactions/choice/types.js.map +1 -0
  126. package/dist/interactions/custom/extractor.d.ts +0 -1
  127. package/dist/interactions/custom/extractor.js +1 -0
  128. package/dist/interactions/custom/extractor.js.map +1 -0
  129. package/dist/interactions/custom/index.d.ts +0 -1
  130. package/dist/interactions/custom/index.js +1 -0
  131. package/dist/interactions/custom/index.js.map +1 -0
  132. package/dist/interactions/custom/types.d.ts +0 -1
  133. package/dist/interactions/custom/types.js +1 -0
  134. package/dist/interactions/custom/types.js.map +1 -0
  135. package/dist/interactions/drawing/extractor.d.ts +0 -1
  136. package/dist/interactions/drawing/extractor.js +1 -0
  137. package/dist/interactions/drawing/extractor.js.map +1 -0
  138. package/dist/interactions/drawing/index.d.ts +0 -1
  139. package/dist/interactions/drawing/index.js +1 -0
  140. package/dist/interactions/drawing/index.js.map +1 -0
  141. package/dist/interactions/drawing/types.d.ts +0 -1
  142. package/dist/interactions/drawing/types.js +1 -0
  143. package/dist/interactions/drawing/types.js.map +1 -0
  144. package/dist/interactions/end-attempt/extractor.d.ts +0 -1
  145. package/dist/interactions/end-attempt/extractor.js +1 -0
  146. package/dist/interactions/end-attempt/extractor.js.map +1 -0
  147. package/dist/interactions/end-attempt/index.d.ts +0 -1
  148. package/dist/interactions/end-attempt/index.js +1 -0
  149. package/dist/interactions/end-attempt/index.js.map +1 -0
  150. package/dist/interactions/end-attempt/types.d.ts +0 -1
  151. package/dist/interactions/end-attempt/types.js +1 -0
  152. package/dist/interactions/end-attempt/types.js.map +1 -0
  153. package/dist/interactions/extended-text/extractor.d.ts +0 -1
  154. package/dist/interactions/extended-text/extractor.js +1 -0
  155. package/dist/interactions/extended-text/extractor.js.map +1 -0
  156. package/dist/interactions/extended-text/index.d.ts +0 -1
  157. package/dist/interactions/extended-text/index.js +1 -0
  158. package/dist/interactions/extended-text/index.js.map +1 -0
  159. package/dist/interactions/extended-text/types.d.ts +0 -1
  160. package/dist/interactions/extended-text/types.js +1 -0
  161. package/dist/interactions/extended-text/types.js.map +1 -0
  162. package/dist/interactions/gap-match/extractor.d.ts +0 -1
  163. package/dist/interactions/gap-match/extractor.js +1 -0
  164. package/dist/interactions/gap-match/extractor.js.map +1 -0
  165. package/dist/interactions/gap-match/index.d.ts +0 -1
  166. package/dist/interactions/gap-match/index.js +1 -0
  167. package/dist/interactions/gap-match/index.js.map +1 -0
  168. package/dist/interactions/gap-match/types.d.ts +0 -1
  169. package/dist/interactions/gap-match/types.js +1 -0
  170. package/dist/interactions/gap-match/types.js.map +1 -0
  171. package/dist/interactions/graphic-associate/extractor.d.ts +0 -1
  172. package/dist/interactions/graphic-associate/extractor.js +1 -0
  173. package/dist/interactions/graphic-associate/extractor.js.map +1 -0
  174. package/dist/interactions/graphic-associate/index.d.ts +0 -1
  175. package/dist/interactions/graphic-associate/index.js +1 -0
  176. package/dist/interactions/graphic-associate/index.js.map +1 -0
  177. package/dist/interactions/graphic-associate/types.d.ts +0 -1
  178. package/dist/interactions/graphic-associate/types.js +1 -0
  179. package/dist/interactions/graphic-associate/types.js.map +1 -0
  180. package/dist/interactions/graphic-gap-match/extractor.d.ts +0 -1
  181. package/dist/interactions/graphic-gap-match/extractor.js +1 -0
  182. package/dist/interactions/graphic-gap-match/extractor.js.map +1 -0
  183. package/dist/interactions/graphic-gap-match/index.d.ts +0 -1
  184. package/dist/interactions/graphic-gap-match/index.js +1 -0
  185. package/dist/interactions/graphic-gap-match/index.js.map +1 -0
  186. package/dist/interactions/graphic-gap-match/types.d.ts +0 -1
  187. package/dist/interactions/graphic-gap-match/types.js +1 -0
  188. package/dist/interactions/graphic-gap-match/types.js.map +1 -0
  189. package/dist/interactions/graphic-order/extractor.d.ts +0 -1
  190. package/dist/interactions/graphic-order/extractor.js +1 -0
  191. package/dist/interactions/graphic-order/extractor.js.map +1 -0
  192. package/dist/interactions/graphic-order/index.d.ts +0 -1
  193. package/dist/interactions/graphic-order/index.js +1 -0
  194. package/dist/interactions/graphic-order/index.js.map +1 -0
  195. package/dist/interactions/graphic-order/types.d.ts +0 -1
  196. package/dist/interactions/graphic-order/types.js +1 -0
  197. package/dist/interactions/graphic-order/types.js.map +1 -0
  198. package/dist/interactions/hotspot/extractor.d.ts +0 -1
  199. package/dist/interactions/hotspot/extractor.js +1 -0
  200. package/dist/interactions/hotspot/extractor.js.map +1 -0
  201. package/dist/interactions/hotspot/index.d.ts +0 -1
  202. package/dist/interactions/hotspot/index.js +1 -0
  203. package/dist/interactions/hotspot/index.js.map +1 -0
  204. package/dist/interactions/hotspot/types.d.ts +0 -1
  205. package/dist/interactions/hotspot/types.js +1 -0
  206. package/dist/interactions/hotspot/types.js.map +1 -0
  207. package/dist/interactions/hottext/extractor.d.ts +0 -1
  208. package/dist/interactions/hottext/extractor.js +1 -0
  209. package/dist/interactions/hottext/extractor.js.map +1 -0
  210. package/dist/interactions/hottext/index.d.ts +0 -1
  211. package/dist/interactions/hottext/index.js +1 -0
  212. package/dist/interactions/hottext/index.js.map +1 -0
  213. package/dist/interactions/hottext/types.d.ts +0 -1
  214. package/dist/interactions/hottext/types.js +1 -0
  215. package/dist/interactions/hottext/types.js.map +1 -0
  216. package/dist/interactions/index.d.ts +0 -1
  217. package/dist/interactions/index.js +1 -0
  218. package/dist/interactions/index.js.map +1 -0
  219. package/dist/interactions/inline/index.d.ts +0 -1
  220. package/dist/interactions/inline/index.js +1 -0
  221. package/dist/interactions/inline/index.js.map +1 -0
  222. package/dist/interactions/inline/render-plan.d.ts +0 -1
  223. package/dist/interactions/inline/render-plan.js +1 -0
  224. package/dist/interactions/inline/render-plan.js.map +1 -0
  225. package/dist/interactions/inline-choice/extractor.d.ts +0 -1
  226. package/dist/interactions/inline-choice/extractor.js +1 -0
  227. package/dist/interactions/inline-choice/extractor.js.map +1 -0
  228. package/dist/interactions/inline-choice/index.d.ts +0 -1
  229. package/dist/interactions/inline-choice/index.js +1 -0
  230. package/dist/interactions/inline-choice/index.js.map +1 -0
  231. package/dist/interactions/inline-choice/types.d.ts +0 -1
  232. package/dist/interactions/inline-choice/types.js +1 -0
  233. package/dist/interactions/inline-choice/types.js.map +1 -0
  234. package/dist/interactions/match/extractor.d.ts +0 -1
  235. package/dist/interactions/match/extractor.js +1 -0
  236. package/dist/interactions/match/extractor.js.map +1 -0
  237. package/dist/interactions/match/index.d.ts +0 -1
  238. package/dist/interactions/match/index.js +1 -0
  239. package/dist/interactions/match/index.js.map +1 -0
  240. package/dist/interactions/match/types.d.ts +0 -1
  241. package/dist/interactions/match/types.js +1 -0
  242. package/dist/interactions/match/types.js.map +1 -0
  243. package/dist/interactions/media/extractor.d.ts +0 -1
  244. package/dist/interactions/media/extractor.js +1 -0
  245. package/dist/interactions/media/extractor.js.map +1 -0
  246. package/dist/interactions/media/index.d.ts +0 -1
  247. package/dist/interactions/media/index.js +1 -0
  248. package/dist/interactions/media/index.js.map +1 -0
  249. package/dist/interactions/media/types.d.ts +0 -1
  250. package/dist/interactions/media/types.js +1 -0
  251. package/dist/interactions/media/types.js.map +1 -0
  252. package/dist/interactions/modules.d.ts +0 -1
  253. package/dist/interactions/modules.js +1 -0
  254. package/dist/interactions/modules.js.map +1 -0
  255. package/dist/interactions/order/extractor.d.ts +0 -1
  256. package/dist/interactions/order/extractor.js +1 -0
  257. package/dist/interactions/order/extractor.js.map +1 -0
  258. package/dist/interactions/order/index.d.ts +0 -1
  259. package/dist/interactions/order/index.js +1 -0
  260. package/dist/interactions/order/index.js.map +1 -0
  261. package/dist/interactions/order/types.d.ts +0 -1
  262. package/dist/interactions/order/types.js +1 -0
  263. package/dist/interactions/order/types.js.map +1 -0
  264. package/dist/interactions/portable-custom/extractor.d.ts +0 -1
  265. package/dist/interactions/portable-custom/extractor.js +1 -0
  266. package/dist/interactions/portable-custom/extractor.js.map +1 -0
  267. package/dist/interactions/portable-custom/index.d.ts +0 -1
  268. package/dist/interactions/portable-custom/index.js +1 -0
  269. package/dist/interactions/portable-custom/index.js.map +1 -0
  270. package/dist/interactions/portable-custom/types.d.ts +0 -1
  271. package/dist/interactions/portable-custom/types.js +1 -0
  272. package/dist/interactions/portable-custom/types.js.map +1 -0
  273. package/dist/interactions/position-object/extractor.d.ts +0 -1
  274. package/dist/interactions/position-object/extractor.js +1 -0
  275. package/dist/interactions/position-object/extractor.js.map +1 -0
  276. package/dist/interactions/position-object/index.d.ts +0 -1
  277. package/dist/interactions/position-object/index.js +1 -0
  278. package/dist/interactions/position-object/index.js.map +1 -0
  279. package/dist/interactions/position-object/types.d.ts +0 -1
  280. package/dist/interactions/position-object/types.js +1 -0
  281. package/dist/interactions/position-object/types.js.map +1 -0
  282. package/dist/interactions/select-point/extractor.d.ts +0 -1
  283. package/dist/interactions/select-point/extractor.js +1 -0
  284. package/dist/interactions/select-point/extractor.js.map +1 -0
  285. package/dist/interactions/select-point/index.d.ts +0 -1
  286. package/dist/interactions/select-point/index.js +1 -0
  287. package/dist/interactions/select-point/index.js.map +1 -0
  288. package/dist/interactions/select-point/types.d.ts +0 -1
  289. package/dist/interactions/select-point/types.js +1 -0
  290. package/dist/interactions/select-point/types.js.map +1 -0
  291. package/dist/interactions/shared/index.d.ts +0 -1
  292. package/dist/interactions/shared/index.js +1 -0
  293. package/dist/interactions/shared/index.js.map +1 -0
  294. package/dist/interactions/shared/types.d.ts +0 -1
  295. package/dist/interactions/shared/types.js +1 -0
  296. package/dist/interactions/shared/types.js.map +1 -0
  297. package/dist/interactions/slider/extractor.d.ts +0 -1
  298. package/dist/interactions/slider/extractor.js +1 -0
  299. package/dist/interactions/slider/extractor.js.map +1 -0
  300. package/dist/interactions/slider/index.d.ts +0 -1
  301. package/dist/interactions/slider/index.js +1 -0
  302. package/dist/interactions/slider/index.js.map +1 -0
  303. package/dist/interactions/slider/types.d.ts +0 -1
  304. package/dist/interactions/slider/types.js +1 -0
  305. package/dist/interactions/slider/types.js.map +1 -0
  306. package/dist/interactions/text-entry/extractor.d.ts +0 -1
  307. package/dist/interactions/text-entry/extractor.js +1 -0
  308. package/dist/interactions/text-entry/extractor.js.map +1 -0
  309. package/dist/interactions/text-entry/index.d.ts +0 -1
  310. package/dist/interactions/text-entry/index.js +1 -0
  311. package/dist/interactions/text-entry/index.js.map +1 -0
  312. package/dist/interactions/text-entry/types.d.ts +0 -1
  313. package/dist/interactions/text-entry/types.js +1 -0
  314. package/dist/interactions/text-entry/types.js.map +1 -0
  315. package/dist/interactions/upload/extractor.d.ts +0 -1
  316. package/dist/interactions/upload/extractor.js +1 -0
  317. package/dist/interactions/upload/extractor.js.map +1 -0
  318. package/dist/interactions/upload/index.d.ts +0 -1
  319. package/dist/interactions/upload/index.js +1 -0
  320. package/dist/interactions/upload/index.js.map +1 -0
  321. package/dist/interactions/upload/types.d.ts +0 -1
  322. package/dist/interactions/upload/types.js +1 -0
  323. package/dist/interactions/upload/types.js.map +1 -0
  324. package/dist/pci/PciHost.d.ts +0 -1
  325. package/dist/pci/PciHost.js +1 -0
  326. package/dist/pci/PciHost.js.map +1 -0
  327. package/dist/pci/types.d.ts +0 -1
  328. package/dist/pci/types.js +1 -0
  329. package/dist/pci/types.js.map +1 -0
  330. package/dist/pnp/applyPnp.d.ts +0 -1
  331. package/dist/pnp/applyPnp.js +1 -0
  332. package/dist/pnp/applyPnp.js.map +1 -0
  333. package/dist/pnp/parsePnpXml.d.ts +0 -1
  334. package/dist/pnp/parsePnpXml.js +1 -0
  335. package/dist/pnp/parsePnpXml.js.map +1 -0
  336. package/dist/pnp/types.d.ts +0 -1
  337. package/dist/pnp/types.js +1 -0
  338. package/dist/pnp/types.js.map +1 -0
  339. package/dist/presentation/itemPresentationPlan.d.ts +0 -1
  340. package/dist/presentation/itemPresentationPlan.js +2 -2
  341. package/dist/presentation/itemPresentationPlan.js.map +1 -0
  342. package/dist/server.d.ts +0 -1
  343. package/dist/server.js +1 -0
  344. package/dist/server.js.map +1 -0
  345. package/dist/types/index.d.ts +0 -1
  346. package/dist/types/index.js +1 -0
  347. package/dist/types/index.js.map +1 -0
  348. package/dist/types/responseValidation.d.ts +0 -1
  349. package/dist/types/responseValidation.js +1 -0
  350. package/dist/types/responseValidation.js.map +1 -0
  351. package/dist/utils/PerformanceMonitor.d.ts +0 -1
  352. package/dist/utils/PerformanceMonitor.js +1 -0
  353. package/dist/utils/PerformanceMonitor.js.map +1 -0
  354. package/dist/utils/drawingUtils.d.ts +0 -1
  355. package/dist/utils/drawingUtils.js +1 -0
  356. package/dist/utils/drawingUtils.js.map +1 -0
  357. package/dist/utils/responseUtils.d.ts +0 -1
  358. package/dist/utils/responseUtils.js +1 -0
  359. package/dist/utils/responseUtils.js.map +1 -0
  360. package/dist/web-components/QTIInteractionBase.d.ts +0 -1
  361. package/dist/web-components/QTIInteractionBase.js +1 -0
  362. package/dist/web-components/QTIInteractionBase.js.map +1 -0
  363. package/dist/web-components/QTIInteractionElement.d.ts +0 -1
  364. package/dist/web-components/QTIInteractionElement.js +1 -0
  365. package/dist/web-components/QTIInteractionElement.js.map +1 -0
  366. package/dist/web-components/index.d.ts +0 -1
  367. package/dist/web-components/index.js +1 -0
  368. package/dist/web-components/index.js.map +1 -0
  369. package/package.json +6 -6
  370. package/dist/catalog/applyGlossaryTriggers.d.ts.map +0 -1
  371. package/dist/catalog/catalogExtractor.d.ts.map +0 -1
  372. package/dist/catalog/catalogLookup.d.ts.map +0 -1
  373. package/dist/catalog/glossaryAction.d.ts.map +0 -1
  374. package/dist/catalog/types.d.ts.map +0 -1
  375. package/dist/components/actions/typesetAction.d.ts.map +0 -1
  376. package/dist/components/utils/assignProps.d.ts +0 -2
  377. package/dist/components/utils/assignProps.d.ts.map +0 -1
  378. package/dist/components/utils/assignProps.js +0 -1
  379. package/dist/components/utils/feedbackUtils.d.ts.map +0 -1
  380. package/dist/components/utils/index.d.ts.map +0 -1
  381. package/dist/components/utils/stimulusRender.d.ts.map +0 -1
  382. package/dist/components/utils/stylesheetRender.d.ts.map +0 -1
  383. package/dist/core/ComponentRegistry.d.ts.map +0 -1
  384. package/dist/core/ItemRenderer.d.ts +0 -91
  385. package/dist/core/ItemRenderer.d.ts.map +0 -1
  386. package/dist/core/ItemRenderer.js +0 -248
  387. package/dist/core/Player.d.ts.map +0 -1
  388. package/dist/core/Plugin.d.ts.map +0 -1
  389. package/dist/core/PluginManager.d.ts.map +0 -1
  390. package/dist/core/constants.d.ts.map +0 -1
  391. package/dist/core/declarations.d.ts.map +0 -1
  392. package/dist/core/parsingLimits.d.ts.map +0 -1
  393. package/dist/core/random.d.ts.map +0 -1
  394. package/dist/core/rolePolicy.d.ts.map +0 -1
  395. package/dist/core/sanitizer.d.ts.map +0 -1
  396. package/dist/core/trustedTypes.d.ts.map +0 -1
  397. package/dist/core/urlPolicy.d.ts.map +0 -1
  398. package/dist/document/AssessmentItemDocument.d.ts.map +0 -1
  399. package/dist/extensions/MathLiveEditor.d.ts.map +0 -1
  400. package/dist/extraction/ExtractionRegistry.d.ts.map +0 -1
  401. package/dist/extraction/createContext.d.ts.map +0 -1
  402. package/dist/extraction/extractors/associateExtractor.d.ts +0 -2
  403. package/dist/extraction/extractors/associateExtractor.d.ts.map +0 -1
  404. package/dist/extraction/extractors/associateExtractor.js +0 -1
  405. package/dist/extraction/extractors/choiceExtractor.d.ts +0 -2
  406. package/dist/extraction/extractors/choiceExtractor.d.ts.map +0 -1
  407. package/dist/extraction/extractors/choiceExtractor.js +0 -1
  408. package/dist/extraction/extractors/customExtractor.d.ts +0 -2
  409. package/dist/extraction/extractors/customExtractor.d.ts.map +0 -1
  410. package/dist/extraction/extractors/customExtractor.js +0 -1
  411. package/dist/extraction/extractors/drawingExtractor.d.ts +0 -2
  412. package/dist/extraction/extractors/drawingExtractor.d.ts.map +0 -1
  413. package/dist/extraction/extractors/drawingExtractor.js +0 -1
  414. package/dist/extraction/extractors/endAttemptExtractor.d.ts +0 -2
  415. package/dist/extraction/extractors/endAttemptExtractor.d.ts.map +0 -1
  416. package/dist/extraction/extractors/endAttemptExtractor.js +0 -1
  417. package/dist/extraction/extractors/extendedTextExtractor.d.ts +0 -2
  418. package/dist/extraction/extractors/extendedTextExtractor.d.ts.map +0 -1
  419. package/dist/extraction/extractors/extendedTextExtractor.js +0 -1
  420. package/dist/extraction/extractors/gapMatchExtractor.d.ts +0 -2
  421. package/dist/extraction/extractors/gapMatchExtractor.d.ts.map +0 -1
  422. package/dist/extraction/extractors/gapMatchExtractor.js +0 -1
  423. package/dist/extraction/extractors/graphicAssociateExtractor.d.ts +0 -2
  424. package/dist/extraction/extractors/graphicAssociateExtractor.d.ts.map +0 -1
  425. package/dist/extraction/extractors/graphicAssociateExtractor.js +0 -1
  426. package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts +0 -2
  427. package/dist/extraction/extractors/graphicGapMatchExtractor.d.ts.map +0 -1
  428. package/dist/extraction/extractors/graphicGapMatchExtractor.js +0 -1
  429. package/dist/extraction/extractors/graphicOrderExtractor.d.ts +0 -2
  430. package/dist/extraction/extractors/graphicOrderExtractor.d.ts.map +0 -1
  431. package/dist/extraction/extractors/graphicOrderExtractor.js +0 -1
  432. package/dist/extraction/extractors/hotspotExtractor.d.ts +0 -2
  433. package/dist/extraction/extractors/hotspotExtractor.d.ts.map +0 -1
  434. package/dist/extraction/extractors/hotspotExtractor.js +0 -1
  435. package/dist/extraction/extractors/hottextExtractor.d.ts +0 -2
  436. package/dist/extraction/extractors/hottextExtractor.d.ts.map +0 -1
  437. package/dist/extraction/extractors/hottextExtractor.js +0 -1
  438. package/dist/extraction/extractors/index.d.ts +0 -9
  439. package/dist/extraction/extractors/index.d.ts.map +0 -1
  440. package/dist/extraction/extractors/index.js +0 -8
  441. package/dist/extraction/extractors/inlineChoiceExtractor.d.ts +0 -2
  442. package/dist/extraction/extractors/inlineChoiceExtractor.d.ts.map +0 -1
  443. package/dist/extraction/extractors/inlineChoiceExtractor.js +0 -1
  444. package/dist/extraction/extractors/matchExtractor.d.ts +0 -2
  445. package/dist/extraction/extractors/matchExtractor.d.ts.map +0 -1
  446. package/dist/extraction/extractors/matchExtractor.js +0 -1
  447. package/dist/extraction/extractors/mediaExtractor.d.ts +0 -2
  448. package/dist/extraction/extractors/mediaExtractor.d.ts.map +0 -1
  449. package/dist/extraction/extractors/mediaExtractor.js +0 -1
  450. package/dist/extraction/extractors/orderExtractor.d.ts +0 -2
  451. package/dist/extraction/extractors/orderExtractor.d.ts.map +0 -1
  452. package/dist/extraction/extractors/orderExtractor.js +0 -1
  453. package/dist/extraction/extractors/portableCustomExtractor.d.ts +0 -2
  454. package/dist/extraction/extractors/portableCustomExtractor.d.ts.map +0 -1
  455. package/dist/extraction/extractors/portableCustomExtractor.js +0 -1
  456. package/dist/extraction/extractors/positionObjectExtractor.d.ts +0 -2
  457. package/dist/extraction/extractors/positionObjectExtractor.d.ts.map +0 -1
  458. package/dist/extraction/extractors/positionObjectExtractor.js +0 -1
  459. package/dist/extraction/extractors/selectPointExtractor.d.ts +0 -2
  460. package/dist/extraction/extractors/selectPointExtractor.d.ts.map +0 -1
  461. package/dist/extraction/extractors/selectPointExtractor.js +0 -1
  462. package/dist/extraction/extractors/sliderExtractor.d.ts +0 -2
  463. package/dist/extraction/extractors/sliderExtractor.d.ts.map +0 -1
  464. package/dist/extraction/extractors/sliderExtractor.js +0 -1
  465. package/dist/extraction/extractors/textEntryExtractor.d.ts +0 -2
  466. package/dist/extraction/extractors/textEntryExtractor.d.ts.map +0 -1
  467. package/dist/extraction/extractors/textEntryExtractor.js +0 -1
  468. package/dist/extraction/extractors/uploadExtractor.d.ts +0 -2
  469. package/dist/extraction/extractors/uploadExtractor.d.ts.map +0 -1
  470. package/dist/extraction/extractors/uploadExtractor.js +0 -1
  471. package/dist/extraction/index.d.ts.map +0 -1
  472. package/dist/extraction/interactionExtractionPipeline.d.ts.map +0 -1
  473. package/dist/extraction/interactionSecurity.d.ts.map +0 -1
  474. package/dist/extraction/types.d.ts.map +0 -1
  475. package/dist/extraction/utils.d.ts.map +0 -1
  476. package/dist/iframe/IFramePlayerHost.d.ts.map +0 -1
  477. package/dist/iframe/index.d.ts.map +0 -1
  478. package/dist/iframe/protocol.d.ts.map +0 -1
  479. package/dist/index.d.ts.map +0 -1
  480. package/dist/interactions/associate/extractor.d.ts.map +0 -1
  481. package/dist/interactions/associate/index.d.ts.map +0 -1
  482. package/dist/interactions/associate/types.d.ts.map +0 -1
  483. package/dist/interactions/choice/extractor.d.ts.map +0 -1
  484. package/dist/interactions/choice/index.d.ts.map +0 -1
  485. package/dist/interactions/choice/types.d.ts.map +0 -1
  486. package/dist/interactions/custom/extractor.d.ts.map +0 -1
  487. package/dist/interactions/custom/index.d.ts.map +0 -1
  488. package/dist/interactions/custom/types.d.ts.map +0 -1
  489. package/dist/interactions/drawing/extractor.d.ts.map +0 -1
  490. package/dist/interactions/drawing/index.d.ts.map +0 -1
  491. package/dist/interactions/drawing/types.d.ts.map +0 -1
  492. package/dist/interactions/end-attempt/extractor.d.ts.map +0 -1
  493. package/dist/interactions/end-attempt/index.d.ts.map +0 -1
  494. package/dist/interactions/end-attempt/types.d.ts.map +0 -1
  495. package/dist/interactions/extended-text/extractor.d.ts.map +0 -1
  496. package/dist/interactions/extended-text/index.d.ts.map +0 -1
  497. package/dist/interactions/extended-text/types.d.ts.map +0 -1
  498. package/dist/interactions/gap-match/extractor.d.ts.map +0 -1
  499. package/dist/interactions/gap-match/index.d.ts.map +0 -1
  500. package/dist/interactions/gap-match/types.d.ts.map +0 -1
  501. package/dist/interactions/graphic-associate/extractor.d.ts.map +0 -1
  502. package/dist/interactions/graphic-associate/index.d.ts.map +0 -1
  503. package/dist/interactions/graphic-associate/types.d.ts.map +0 -1
  504. package/dist/interactions/graphic-gap-match/extractor.d.ts.map +0 -1
  505. package/dist/interactions/graphic-gap-match/index.d.ts.map +0 -1
  506. package/dist/interactions/graphic-gap-match/types.d.ts.map +0 -1
  507. package/dist/interactions/graphic-order/extractor.d.ts.map +0 -1
  508. package/dist/interactions/graphic-order/index.d.ts.map +0 -1
  509. package/dist/interactions/graphic-order/types.d.ts.map +0 -1
  510. package/dist/interactions/hotspot/extractor.d.ts.map +0 -1
  511. package/dist/interactions/hotspot/index.d.ts.map +0 -1
  512. package/dist/interactions/hotspot/types.d.ts.map +0 -1
  513. package/dist/interactions/hottext/extractor.d.ts.map +0 -1
  514. package/dist/interactions/hottext/index.d.ts.map +0 -1
  515. package/dist/interactions/hottext/types.d.ts.map +0 -1
  516. package/dist/interactions/index.d.ts.map +0 -1
  517. package/dist/interactions/inline/index.d.ts.map +0 -1
  518. package/dist/interactions/inline/render-plan.d.ts.map +0 -1
  519. package/dist/interactions/inline-choice/extractor.d.ts.map +0 -1
  520. package/dist/interactions/inline-choice/index.d.ts.map +0 -1
  521. package/dist/interactions/inline-choice/types.d.ts.map +0 -1
  522. package/dist/interactions/match/extractor.d.ts.map +0 -1
  523. package/dist/interactions/match/index.d.ts.map +0 -1
  524. package/dist/interactions/match/types.d.ts.map +0 -1
  525. package/dist/interactions/media/extractor.d.ts.map +0 -1
  526. package/dist/interactions/media/index.d.ts.map +0 -1
  527. package/dist/interactions/media/types.d.ts.map +0 -1
  528. package/dist/interactions/modules.d.ts.map +0 -1
  529. package/dist/interactions/order/extractor.d.ts.map +0 -1
  530. package/dist/interactions/order/index.d.ts.map +0 -1
  531. package/dist/interactions/order/types.d.ts.map +0 -1
  532. package/dist/interactions/portable-custom/extractor.d.ts.map +0 -1
  533. package/dist/interactions/portable-custom/index.d.ts.map +0 -1
  534. package/dist/interactions/portable-custom/types.d.ts.map +0 -1
  535. package/dist/interactions/position-object/extractor.d.ts.map +0 -1
  536. package/dist/interactions/position-object/index.d.ts.map +0 -1
  537. package/dist/interactions/position-object/types.d.ts.map +0 -1
  538. package/dist/interactions/select-point/extractor.d.ts.map +0 -1
  539. package/dist/interactions/select-point/index.d.ts.map +0 -1
  540. package/dist/interactions/select-point/types.d.ts.map +0 -1
  541. package/dist/interactions/shared/index.d.ts.map +0 -1
  542. package/dist/interactions/shared/types.d.ts.map +0 -1
  543. package/dist/interactions/slider/extractor.d.ts.map +0 -1
  544. package/dist/interactions/slider/index.d.ts.map +0 -1
  545. package/dist/interactions/slider/types.d.ts.map +0 -1
  546. package/dist/interactions/text-entry/extractor.d.ts.map +0 -1
  547. package/dist/interactions/text-entry/index.d.ts.map +0 -1
  548. package/dist/interactions/text-entry/types.d.ts.map +0 -1
  549. package/dist/interactions/upload/extractor.d.ts.map +0 -1
  550. package/dist/interactions/upload/index.d.ts.map +0 -1
  551. package/dist/interactions/upload/types.d.ts.map +0 -1
  552. package/dist/pci/PciHost.d.ts.map +0 -1
  553. package/dist/pci/types.d.ts.map +0 -1
  554. package/dist/pnp/applyPnp.d.ts.map +0 -1
  555. package/dist/pnp/parsePnpXml.d.ts.map +0 -1
  556. package/dist/pnp/types.d.ts.map +0 -1
  557. package/dist/presentation/itemPresentationPlan.d.ts.map +0 -1
  558. package/dist/server.d.ts.map +0 -1
  559. package/dist/types/index.d.ts.map +0 -1
  560. package/dist/types/interactions.d.ts +0 -8
  561. package/dist/types/interactions.d.ts.map +0 -1
  562. package/dist/types/interactions.js +0 -7
  563. package/dist/types/responseValidation.d.ts.map +0 -1
  564. package/dist/utils/PerformanceMonitor.d.ts.map +0 -1
  565. package/dist/utils/drawingUtils.d.ts.map +0 -1
  566. package/dist/utils/responseUtils.d.ts.map +0 -1
  567. package/dist/utils/touchDragHelper.d.ts +0 -2
  568. package/dist/utils/touchDragHelper.d.ts.map +0 -1
  569. package/dist/utils/touchDragHelper.js +0 -1
  570. package/dist/web-components/QTIInteractionBase.d.ts.map +0 -1
  571. package/dist/web-components/QTIInteractionElement.d.ts.map +0 -1
  572. package/dist/web-components/index.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/interactions/select-point/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { SelectPointInteractionData, Point, ImageData } from '../shared/types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type * from './types.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interactions/shared/index.ts"],"names":[],"mappings":"","sourcesContent":["export type * from './types.js';\n"]}
@@ -410,4 +410,3 @@ export interface InteractionValueMap {
410
410
  }>;
411
411
  endAttemptInteraction: boolean;
412
412
  }
413
- //# sourceMappingURL=types.d.ts.map
@@ -5,3 +5,4 @@
5
5
  * interaction renderer registry, ensuring compile-time type safety.
6
6
  */
7
7
  export {};
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/interactions/shared/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/**\n * Interaction type mappings for strongly-typed registry\n *\n * This file defines the complete type system for the plugin-based\n * interaction renderer registry, ensuring compile-time type safety.\n */\n\nimport type { HTMLElement } from 'node-html-parser';\nimport type { HtmlContent, QTIFileResponse } from '../../types/index.js';\n\n/**\n * Type alias for parsed QTI XML elements\n * Uses node-html-parser's HTMLElement type directly\n */\nexport type QTIElement = HTMLElement;\n\nexport interface BaseInteractionData {\n\ttype: string;\n\tresponseId: string;\n}\n\nexport interface ChoiceInteractionData extends BaseInteractionData {\n\ttype: 'choiceInteraction';\n\tshuffle: boolean;\n\tmaxChoices: number;\n\tminChoices: number;\n\tprompt: string | null;\n\tchoices: Array<{ identifier: string; text: HtmlContent; fixed?: boolean; classes?: string[] }>;\n\t/** CSS classes from the choiceInteraction element for custom renderer detection */\n\tinteractionClasses?: string[];\n\t/** Message shown when candidate exceeds maxChoices (data-max-selections-message) */\n\tmaxSelectionsMessage?: string | null;\n\t/** Message shown when candidate submits below minChoices (data-min-selections-message) */\n\tminSelectionsMessage?: string | null;\n}\n\nexport interface TextEntryInteractionData extends BaseInteractionData {\n\ttype: 'textEntryInteraction';\n\texpectedLength: number;\n\tpatternMask: string | null;\n\tplaceholderText: string;\n\tformat?: string;\n\t/** CSS classes from the textEntryInteraction element (e.g. qti-input-width-N) */\n\tinteractionClasses?: string[];\n\t/** Pattern mask validation message (data-patternmask-message) */\n\tpatternMaskMessage?: string | null;\n}\n\nexport interface ExtendedTextInteractionData extends BaseInteractionData {\n\ttype: 'extendedTextInteraction';\n\texpectedLines: number;\n\texpectedLength: number;\n\tprompt: string | null;\n\tplaceholderText: string;\n\tformat: string;\n\tpatternMask?: string | null;\n\tpatternMaskMessage?: string | null;\n\t/** CSS classes from the extendedTextInteraction element (e.g. qti-height-lines-N) */\n\tinteractionClasses?: string[];\n}\n\nexport interface InlineChoiceInteractionData extends BaseInteractionData {\n\ttype: 'inlineChoiceInteraction';\n\tshuffle: boolean;\n\t/** Placeholder label from the QTI <label> child element; shown as the unselected \"Select…\" option */\n\tlabel: string | null;\n\t/** Placeholder text from data-prompt attribute; alternative to <label> for dropdown default option */\n\tdataPrompt?: string | null;\n\tchoices: Array<{ identifier: string; text: string; fixed?: boolean }>;\n\t/** CSS classes from the inlineChoiceInteraction element (e.g. qti-input-width-N) */\n\tinteractionClasses?: string[];\n}\n\nexport interface OrderInteractionData extends BaseInteractionData {\n\ttype: 'orderInteraction';\n\tshuffle: boolean;\n\tminChoices: number;\n\tmaxChoices: number;\n\tprompt: string | null;\n\tchoices: Array<{ identifier: string; text: string; fixed?: boolean }>;\n}\n\nexport interface AssociableChoice {\n\tidentifier: string;\n\ttext: string;\n\tmatchMax: number;\n\t/** Minimum number of times this choice must appear in the response (QTI matchMin) */\n\tmatchMin?: number;\n\t/** Pairing constraint: choice can only be paired with others sharing a group value (QTI matchGroup) */\n\tmatchGroup?: string[];\n\t/** CSS classes from the choice element for custom renderer detection */\n\tclasses?: string[];\n}\n\nexport interface MatchInteractionData extends BaseInteractionData {\n\ttype: 'matchInteraction';\n\tshuffle: boolean;\n\tmaxAssociations: number;\n\tminAssociations?: number;\n\tprompt: string | null;\n\tsourceSet: AssociableChoice[];\n\ttargetSet: AssociableChoice[];\n\t/** CSS classes from the matchInteraction element (e.g. qti-choices-top, qti-match-tabular) */\n\tinteractionClasses?: string[];\n\t/** Message shown when candidate exceeds maxAssociations */\n\tmaxSelectionsMessage?: string | null;\n\t/** Message shown when candidate submits below minAssociations */\n\tminSelectionsMessage?: string | null;\n\t/** Label for first column header in tabular mode (data-qti-first-column-header) */\n\tfirstColumnHeader?: string | null;\n}\n\nexport interface AssociateInteractionData extends BaseInteractionData {\n\ttype: 'associateInteraction';\n\tshuffle: boolean;\n\tmaxAssociations: number;\n\tminAssociations?: number;\n\tprompt: string | null;\n\tchoices: AssociableChoice[];\n}\n\nexport interface GapMatchInteractionData extends BaseInteractionData {\n\ttype: 'gapMatchInteraction';\n\tshuffle: boolean;\n\tprompt: string | null;\n\tgapTexts: Array<{ identifier: string; text: string; matchMax: number; matchGroup?: string[]; inputWidth?: number }>;\n\tgaps: Array<{ identifier: string; index: number }>;\n\tpromptText: string;\n\t/** CSS classes from the gapMatchInteraction element (e.g. qti-choices-top, qti-choices-bottom) */\n\tinteractionClasses?: string[];\n\t/** Width of the choice container in px (data-choices-container-width) */\n\tchoicesContainerWidth?: string | null;\n\t/** Message shown when candidate exceeds max associations */\n\tmaxSelectionsMessage?: string | null;\n\t/** Message shown when candidate submits below min associations */\n\tminSelectionsMessage?: string | null;\n}\n\nexport interface SliderInteractionData extends BaseInteractionData {\n\ttype: 'sliderInteraction';\n\tlowerBound: number;\n\tupperBound: number;\n\tstep: number;\n\torientation: string;\n\treverse: boolean;\n\tprompt: string | null;\n}\n\nexport interface ImageData {\n\ttype: 'svg' | 'image';\n\tcontent?: HtmlContent;\n\tsrc?: string;\n\twidth: string;\n\theight: string;\n}\n\nexport interface HotspotChoice {\n\tidentifier: string;\n\tshape: string;\n\tcoords: string;\n\t/** Author-provided label for the hotspot; used as accessible aria-label */\n\thotspotLabel?: string;\n}\n\nexport interface HotspotInteractionData extends BaseInteractionData {\n\ttype: 'hotspotInteraction';\n\tmaxChoices: number;\n\tminChoices?: number;\n\tprompt: string | null;\n\timageData: ImageData | null;\n\thotspotChoices: HotspotChoice[];\n\t/** CSS classes from the hotspotInteraction element (e.g. qti-selections-light, qti-selections-dark) */\n\tinteractionClasses?: string[];\n\t/** Message shown when candidate exceeds maxChoices */\n\tmaxSelectionsMessage?: string | null;\n\t/** Message shown when candidate submits below minChoices */\n\tminSelectionsMessage?: string | null;\n}\n\nexport interface AssociableHotspot {\n\tidentifier: string;\n\tshape: string;\n\tcoords: string;\n\tmatchMax: number;\n}\n\nexport interface GraphicGapMatchInteractionData extends BaseInteractionData {\n\ttype: 'graphicGapMatchInteraction';\n\tprompt: string | null;\n\timageData: ImageData | null;\n\tmaxAssociations: number;\n\tgapTexts: Array<{ identifier: string; text: string; matchMax: number; matchGroup?: string[] }>;\n\t/** Image-based draggable labels (gapImg elements); rendered as <img> in the choice pool */\n\tgapImages: Array<{ identifier: string; src: string; alt: string; matchMax: number; matchGroup?: string[]; width?: number; height?: number }>;\n\thotspots: AssociableHotspot[];\n\t/** CSS classes from the graphicGapMatchInteraction element (e.g. qti-choices-top, qti-selections-dark) */\n\tinteractionClasses?: string[];\n\t/** Width of the choice container in px (data-choices-container-width) */\n\tchoicesContainerWidth?: string | null;\n\t/** Message shown when candidate exceeds max associations */\n\tmaxSelectionsMessage?: string | null;\n\t/** Message shown when candidate submits below min associations */\n\tminSelectionsMessage?: string | null;\n}\n\nexport interface UploadInteractionData extends BaseInteractionData {\n\ttype: 'uploadInteraction';\n\tprompt: string | null;\n\t/** Allowed MIME types / extensions (vendor-dependent); empty = accept any */\n\tfileTypes: string[];\n\trawAttributes: Record<string, string>;\n}\n\nexport interface DrawingInteractionData extends BaseInteractionData {\n\ttype: 'drawingInteraction';\n\tprompt: string | null;\n\t/** Optional background image/SVG to draw on top of */\n\timageData: ImageData | null;\n\trawAttributes: Record<string, string>;\n}\n\nexport interface CustomInteractionData extends BaseInteractionData {\n\ttype: 'customInteraction';\n\tprompt: string | null;\n\trawAttributes: Record<string, string>;\n\t/** Outer XML snippet for debugging (best-effort) */\n\txml: string;\n}\n\nexport interface MediaElement {\n\ttype: 'audio' | 'video' | 'object';\n\tsrc: string;\n\tmimeType: string;\n\twidth?: number;\n\theight?: number;\n}\n\nexport interface MediaInteractionData extends BaseInteractionData {\n\ttype: 'mediaInteraction';\n\tprompt: string | null;\n\tautostart: boolean;\n\tminPlays: number;\n\tmaxPlays: number; // 0 = unlimited\n\tloop: boolean;\n\tmediaElement: MediaElement;\n\t/** Whether the renderer should allow <object> embeds for this interaction (default false) */\n\tallowObjectEmbeds?: boolean;\n}\n\nexport interface HottextChoice {\n\tidentifier: string;\n\ttext: string;\n}\n\nexport interface HottextInteractionData extends BaseInteractionData {\n\ttype: 'hottextInteraction';\n\tprompt: string | null;\n\tmaxChoices: number;\n\tminChoices: number;\n\tcontentHtml: HtmlContent;\n\thottextChoices: HottextChoice[];\n\t/** CSS classes from the hottextInteraction element (e.g. qti-input-control-hidden) */\n\tinteractionClasses?: string[];\n\t/** Message shown when candidate exceeds maxChoices */\n\tmaxSelectionsMessage?: string | null;\n\t/** Message shown when candidate submits below minChoices */\n\tminSelectionsMessage?: string | null;\n}\n\nexport interface Point {\n\tx: number;\n\ty: number;\n}\n\nexport interface SelectPointInteractionData extends BaseInteractionData {\n\ttype: 'selectPointInteraction';\n\tprompt: string | null;\n\tmaxChoices: number;\n\tminChoices: number;\n\timageData: ImageData | null;\n}\n\nexport interface GraphicOrderChoice {\n\tidentifier: string;\n\tshape: string;\n\tcoords: string;\n\tlabel: string;\n}\n\nexport interface GraphicOrderInteractionData extends BaseInteractionData {\n\ttype: 'graphicOrderInteraction';\n\tprompt: string | null;\n\timageData: ImageData | null;\n\thotspotChoices: GraphicOrderChoice[];\n}\n\nexport interface GraphicAssociateHotspot {\n\tidentifier: string;\n\tshape: string;\n\tcoords: string;\n\tmatchMax: number;\n\tlabel: string;\n\t/** Pairing constraint: hotspot can only be associated with others sharing a group value (QTI matchGroup) */\n\tmatchGroup?: string[];\n}\n\nexport interface GraphicAssociateInteractionData extends BaseInteractionData {\n\ttype: 'graphicAssociateInteraction';\n\tprompt: string | null;\n\tmaxAssociations: number;\n\tminAssociations: number;\n\timageData: ImageData | null;\n\tassociableHotspots: GraphicAssociateHotspot[];\n}\n\nexport interface PositionObjectStage {\n\tidentifier: string;\n\tmatchMax: number;\n\tobjectData: {\n\t\ttype: 'image' | 'svg';\n\t\tsrc?: string;\n\t\tcontent?: HtmlContent;\n\t\twidth?: string;\n\t\theight?: string;\n\t} | null;\n\tlabel: string;\n}\n\nexport interface PositionObjectInteractionData extends BaseInteractionData {\n\ttype: 'positionObjectInteraction';\n\tprompt: string | null;\n\tmaxChoices: number;\n\tminChoices: number;\n\tcenterPoint: boolean;\n\timageData: ImageData | null;\n\tpositionObjectStages: PositionObjectStage[];\n}\n\nexport interface EndAttemptInteractionData extends BaseInteractionData {\n\ttype: 'endAttemptInteraction';\n\tprompt: string | null;\n\ttitle: string;\n\t/** Whether this interaction counts as an attempt (default: true) */\n\tcountAttempt: boolean;\n}\n\nexport type InteractionData =\n\t| ChoiceInteractionData\n\t| TextEntryInteractionData\n\t| ExtendedTextInteractionData\n\t| InlineChoiceInteractionData\n\t| OrderInteractionData\n\t| MatchInteractionData\n\t| AssociateInteractionData\n\t| GapMatchInteractionData\n\t| SliderInteractionData\n\t| HotspotInteractionData\n\t| GraphicGapMatchInteractionData\n\t| UploadInteractionData\n\t| DrawingInteractionData\n\t| CustomInteractionData\n\t| MediaInteractionData\n\t| HottextInteractionData\n\t| SelectPointInteractionData\n\t| GraphicOrderInteractionData\n\t| GraphicAssociateInteractionData\n\t| PositionObjectInteractionData\n\t| EndAttemptInteractionData;\n\n/**\n * QTI interaction type identifier\n * Extensible string type allows custom interaction types\n */\nexport type InteractionType = string;\n\n/**\n * Map interaction types to their data structures\n * TypeScript will ensure registrations use the correct data type\n */\nexport interface InteractionDataMap {\n\tchoiceInteraction: ChoiceInteractionData;\n\ttextEntryInteraction: TextEntryInteractionData;\n\textendedTextInteraction: ExtendedTextInteractionData;\n\tinlineChoiceInteraction: InlineChoiceInteractionData;\n\torderInteraction: OrderInteractionData;\n\tmatchInteraction: MatchInteractionData;\n\tassociateInteraction: AssociateInteractionData;\n\tgapMatchInteraction: GapMatchInteractionData;\n\tsliderInteraction: SliderInteractionData;\n\thotspotInteraction: HotspotInteractionData;\n\tgraphicGapMatchInteraction: GraphicGapMatchInteractionData;\n\tuploadInteraction: UploadInteractionData;\n\tdrawingInteraction: DrawingInteractionData;\n\tcustomInteraction: CustomInteractionData;\n\tmediaInteraction: MediaInteractionData;\n\thottextInteraction: HottextInteractionData;\n\tselectPointInteraction: SelectPointInteractionData;\n\tgraphicOrderInteraction: GraphicOrderInteractionData;\n\tgraphicAssociateInteraction: GraphicAssociateInteractionData;\n\tpositionObjectInteraction: PositionObjectInteractionData;\n\tendAttemptInteraction: EndAttemptInteractionData;\n}\n\n/**\n * Map interaction types to their response value types\n * Ensures getValue/setValue use the correct types\n */\nexport interface InteractionValueMap {\n\tchoiceInteraction: string | string[];\n\ttextEntryInteraction: string;\n\textendedTextInteraction: string;\n\tinlineChoiceInteraction: string;\n\torderInteraction: string[];\n\tmatchInteraction: Record<string, string>;\n\tassociateInteraction: Array<[string, string]>;\n\tgapMatchInteraction: Record<string, string>;\n\tsliderInteraction: number;\n\thotspotInteraction: string[];\n\tgraphicGapMatchInteraction: Record<string, string>;\n\tuploadInteraction: QTIFileResponse | null;\n\tdrawingInteraction: string;\n\tcustomInteraction: any;\n\tmediaInteraction: any;\n\thottextInteraction: string[];\n\tselectPointInteraction: Array<{ x: number; y: number }>;\n\tgraphicOrderInteraction: string[];\n\tgraphicAssociateInteraction: Array<[string, string]>;\n\tpositionObjectInteraction: Record<string, { x: number; y: number }>;\n\tendAttemptInteraction: boolean;\n}\n"]}
@@ -21,4 +21,3 @@ export interface SliderData {
21
21
  * Handles sliderInteraction elements (slider for numeric input)
22
22
  */
23
23
  export declare const standardSliderExtractor: ElementExtractor<SliderData>;
24
- //# sourceMappingURL=extractor.d.ts.map
@@ -71,3 +71,4 @@ export const standardSliderExtractor = {
71
71
  };
72
72
  },
73
73
  };
74
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/slider/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAiC;IACpE,EAAE,EAAE,wBAAwB;IAC5B,IAAI,EAAE,iCAAiC;IACvC,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC,mBAAmB,CAAC;IACnC,WAAW,EAAE,wDAAwD;IAErE,SAAS,CAAC,OAAO,EAAE,QAAQ;QAC1B,8CAA8C;QAC9C,OAAO,OAAO,CAAC,UAAU,KAAK,mBAAmB,CAAC;IACnD,CAAC;IAED,OAAO,CAAC,OAAO,EAAE,OAAO;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAE1B,8BAA8B;QAC9B,MAAM,UAAU,GAAG,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;QACtE,MAAM,UAAU,GAAG,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC;QACxE,MAAM,IAAI,GAAG,KAAK,CAAC,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAC1D,MAAM,WAAW,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;QAC7E,MAAM,OAAO,GAAG,KAA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C,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAChD,IAAI,IAAI,CAAC,IAAI,GAAG,KAAK,EAAE,CAAC;YACvB,QAAQ,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,+BAA+B,KAAK,GAAG,CAAC,CAAC;QAC1E,CAAC;aAAM,IAAI,KAAK,GAAG,IAAI,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACpC,2CAA2C;YAC3C,QAAQ,CAAC,IAAI,CACZ,QAAQ,IAAI,CAAC,IAAI,iCAAiC,KAAK,KAAK,IAAI,CAAC,UAAU,OAAO,IAAI,CAAC,UAAU,GAAG,CACpG,CAAC;QACH,CAAC;QAED,OAAO;YACN,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;YAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;YAC9C,QAAQ,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;SACpD,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/**\n * Standard QTI sliderInteraction extractor\n *\n * Extracts data from sliderInteraction elements (slider input)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Slider data extracted from sliderInteraction elements\n */\nexport interface SliderData {\n\tlowerBound: number;\n\tupperBound: number;\n\tstep: number;\n\tstepLabel?: boolean;\n\torientation: string;\n\treverse: boolean;\n\tprompt: string | null;\n}\n\n/**\n * Standard QTI slider interaction extractor\n * Handles sliderInteraction elements (slider for numeric input)\n */\nexport const standardSliderExtractor: ElementExtractor<SliderData> = {\n\tid: 'qti:slider-interaction',\n\tname: 'QTI Standard Slider Interaction',\n\tpriority: 10,\n\telementTypes: ['sliderInteraction'],\n\tdescription: 'Extracts standard QTI sliderInteraction (slider input)',\n\n\tcanHandle(element, _context) {\n\t\t// All sliderInteraction elements are standard\n\t\treturn element.rawTagName === 'sliderInteraction';\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract required attributes\n\t\tconst lowerBound = utils.getNumberAttribute(element, 'lowerBound', 0);\n\t\tconst upperBound = utils.getNumberAttribute(element, 'upperBound', 100);\n\t\tconst step = utils.getNumberAttribute(element, 'step', 1);\n\t\tconst orientation = utils.getAttribute(element, 'orientation', 'horizontal');\n\t\tconst reverse = utils.getBooleanAttribute(element, 'reverse', false);\n\n\t\t// Extract optional attributes\n\t\tconst stepLabel = utils.getBooleanAttribute(element, 'stepLabel');\n\n\t\t// Extract prompt (optional)\n\t\tconst promptElements = utils.getChildrenByTag(element, 'prompt');\n\t\tconst prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;\n\n\t\treturn {\n\t\t\tlowerBound,\n\t\t\tupperBound,\n\t\t\tstep,\n\t\t\torientation,\n\t\t\treverse,\n\t\t\t...(stepLabel ? { stepLabel } : {}),\n\t\t\tprompt,\n\t\t};\n\t},\n\n\tvalidate(data) {\n\t\tconst errors: string[] = [];\n\t\tconst warnings: string[] = [];\n\n\t\t// Validate bounds\n\t\tif (data.lowerBound >= data.upperBound) {\n\t\t\terrors.push('lowerBound must be less than upperBound');\n\t\t}\n\n\t\t// Validate step\n\t\tif (data.step <= 0) {\n\t\t\terrors.push('step must be greater than 0');\n\t\t}\n\n\t\t// Validate orientation\n\t\tif (data.orientation && !['horizontal', 'vertical'].includes(data.orientation)) {\n\t\t\terrors.push('orientation must be \"horizontal\" or \"vertical\"');\n\t\t}\n\n\t\t// Warn if step is larger than range\n\t\tconst range = data.upperBound - data.lowerBound;\n\t\tif (data.step > range) {\n\t\t\twarnings.push(`step (${data.step}) is larger than the range (${range})`);\n\t\t} else if (range % data.step !== 0) {\n\t\t\t// Warn if step doesn't evenly divide range\n\t\t\twarnings.push(\n\t\t\t\t`step ${data.step} does not evenly divide range ${range} (${data.lowerBound} to ${data.upperBound})`\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\tvalid: errors.length === 0,\n\t\t\terrors: errors.length > 0 ? errors : undefined,\n\t\t\twarnings: warnings.length > 0 ? warnings : undefined,\n\t\t};\n\t},\n};\n"]}
@@ -1,3 +1,2 @@
1
1
  export * from './extractor.js';
2
2
  export type { SliderInteractionData } from './types.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1,2 @@
1
1
  export * from './extractor.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interactions/slider/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { SliderInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { SliderInteractionData } from '../shared/types.js';
2
- //# sourceMappingURL=types.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/interactions/slider/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { SliderInteractionData } from '../shared/types.js';\n"]}
@@ -18,4 +18,3 @@ export interface TextEntryData {
18
18
  * Handles textEntryInteraction elements (inline text input)
19
19
  */
20
20
  export declare const standardTextEntryExtractor: ElementExtractor<TextEntryData>;
21
- //# sourceMappingURL=extractor.d.ts.map
@@ -52,3 +52,4 @@ export const standardTextEntryExtractor = {
52
52
  };
53
53
  },
54
54
  };
55
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/text-entry/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAoC;IAC1E,EAAE,EAAE,4BAA4B;IAChC,IAAI,EAAE,qCAAqC;IAC3C,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC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D,CAAC;IACH,CAAC;IAED,QAAQ,CAAC,IAAI;QACZ,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,0BAA0B;QAC1B,IAAI,IAAI,CAAC,cAAc,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAChD,CAAC;QAED,IAAI,IAAI,CAAC,cAAc,GAAG,IAAI,EAAE,CAAC;YAChC,QAAQ,CAAC,IAAI,CACZ,mBAAmB,IAAI,CAAC,cAAc,0DAA0D,CAChG,CAAC;QACH,CAAC;QAED,OAAO;YACN,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;YAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;YAC9C,QAAQ,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;SACpD,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/**\n * Standard QTI textEntryInteraction extractor\n *\n * Extracts data from textEntryInteraction elements (inline text input)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Text entry data extracted from textEntryInteraction elements\n */\nexport interface TextEntryData {\n\texpectedLength: number;\n\tpatternMask: string | null;\n\tplaceholderText: string;\n\tformat?: string;\n}\n\n/**\n * Standard QTI text entry interaction extractor\n * Handles textEntryInteraction elements (inline text input)\n */\nexport const standardTextEntryExtractor: ElementExtractor<TextEntryData> = {\n\tid: 'qti:text-entry-interaction',\n\tname: 'QTI Standard Text Entry Interaction',\n\tpriority: 10,\n\telementTypes: ['textEntryInteraction'],\n\tdescription: 'Extracts standard QTI textEntryInteraction (inline text input)',\n\n\tcanHandle(element, _context) {\n\t\t// All textEntryInteraction elements are standard (both QTI 2.x and 3.0)\n\t\treturn (\n\t\t\telement.rawTagName === 'textEntryInteraction' || element.rawTagName === 'qti-text-entry-interaction'\n\t\t);\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract attributes\n\t\tconst expectedLength = utils.getNumberAttribute(element, 'expectedLength', 20);\n\t\tconst patternMask = utils.getAttribute(element, 'patternMask', '');\n\t\tconst placeholderText = utils.getAttribute(element, 'placeholderText', '');\n\t\tconst format = utils.getAttribute(element, 'format', '');\n\t\tconst interactionClasses = utils.getClasses(element);\n\t\tconst patternMaskMessage = utils.getAttribute(element, 'data-patternmask-message', '') || null;\n\n\t\treturn {\n\t\t\texpectedLength,\n\t\t\tpatternMask: patternMask || null,\n\t\t\tplaceholderText,\n\t\t\t...(format ? { format } : {}),\n\t\t\t...(interactionClasses.length > 0 ? { interactionClasses } : {}),\n\t\t\t...(patternMaskMessage ? { patternMaskMessage } : {}),\n\t\t};\n\t},\n\n\tvalidate(data) {\n\t\tconst errors: string[] = [];\n\t\tconst warnings: string[] = [];\n\n\t\t// Validate expectedLength\n\t\tif (data.expectedLength < 1) {\n\t\t\terrors.push('expectedLength must be positive');\n\t\t}\n\n\t\tif (data.expectedLength > 1000) {\n\t\t\twarnings.push(\n\t\t\t\t`expectedLength (${data.expectedLength}) is very large - consider using extendedTextInteraction`\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\tvalid: errors.length === 0,\n\t\t\terrors: errors.length > 0 ? errors : undefined,\n\t\t\twarnings: warnings.length > 0 ? warnings : undefined,\n\t\t};\n\t},\n};\n"]}
@@ -1,3 +1,2 @@
1
1
  export * from './extractor.js';
2
2
  export type { TextEntryInteractionData } from './types.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1,2 @@
1
1
  export * from './extractor.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interactions/text-entry/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { TextEntryInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { TextEntryInteractionData } from '../shared/types.js';
2
- //# sourceMappingURL=types.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/interactions/text-entry/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { TextEntryInteractionData } from '../shared/types.js';\n"]}
@@ -17,4 +17,3 @@ export interface UploadData {
17
17
  * Handles uploadInteraction elements (file upload)
18
18
  */
19
19
  export declare const standardUploadExtractor: ElementExtractor<UploadData>;
20
- //# sourceMappingURL=extractor.d.ts.map
@@ -57,3 +57,4 @@ export const standardUploadExtractor = {
57
57
  };
58
58
  },
59
59
  };
60
+ //# sourceMappingURL=extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../../src/interactions/upload/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAiC;IACpE,EAAE,EAAE,wBAAwB;IAC5B,IAAI,EAAE,iCAAiC;IACvC,QAAQ,EAAE,EAAE;IACZ,YAAY,EAAE,CAAC,mBAAmB,CAAC;IACnC,WAAW,EAAE,uDAAuD;IAEpE,SAAS,CAAC,OAAO,EAAE,QAAQ;QAC1B,8CAA8C;QAC9C,OAAO,OAAO,CAAC,UAAU,KAAK,mBAAmB,CAAC;IACnD,CAAC;IAED,OAAO,CAAC,OAAO,EAAE,OAAO;QACvB,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAE1B,2DAA2D;QAC3D,MAAM,gBAAgB,GAAG,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QACrE,IAAI,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAA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AE,IAAI;YACX,QAAQ,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;SACpD,CAAC;IACH,CAAC;CACD,CAAC","sourcesContent":["/**\n * Standard QTI uploadInteraction extractor\n *\n * Extracts data from uploadInteraction elements (file upload)\n */\n\nimport type { ElementExtractor } from '../../extraction/types.js';\n\n/**\n * Upload data extracted from uploadInteraction elements\n */\nexport interface UploadData {\n\tfileTypes: string[];\n\trawAttributes: Record<string, string>;\n\tprompt: string | null;\n}\n\n/**\n * Standard QTI upload interaction extractor\n * Handles uploadInteraction elements (file upload)\n */\nexport const standardUploadExtractor: ElementExtractor<UploadData> = {\n\tid: 'qti:upload-interaction',\n\tname: 'QTI Standard Upload Interaction',\n\tpriority: 10,\n\telementTypes: ['uploadInteraction'],\n\tdescription: 'Extracts standard QTI uploadInteraction (file upload)',\n\n\tcanHandle(element, _context) {\n\t\t// All uploadInteraction elements are standard\n\t\treturn element.rawTagName === 'uploadInteraction';\n\t},\n\n\textract(element, context) {\n\t\tconst { utils } = context;\n\n\t\t// Extract fileType child elements (vendor / QTI 3.0 style)\n\t\tconst fileTypeElements = utils.getChildrenByTag(element, 'fileType');\n\t\tlet fileTypes = fileTypeElements.map((el) => utils.getTextContent(el));\n\n\t\t// Fall back to QTI 2.x `type` attribute when no <fileType> children are present\n\t\tif (fileTypes.length === 0) {\n\t\t\tconst typeAttr = utils.getAttribute(element, 'type', '');\n\t\t\tif (typeAttr) {\n\t\t\t\tfileTypes = typeAttr.split(/\\s+/).filter(Boolean);\n\t\t\t}\n\t\t}\n\n\t\t// Extract all attributes\n\t\tconst rawAttributes: Record<string, string> = {};\n\t\tif (element.attributes) {\n\t\t\tfor (const [key, value] of Object.entries(element.attributes)) {\n\t\t\t\trawAttributes[key] = String(value);\n\t\t\t}\n\t\t}\n\n\t\t// Extract prompt (optional)\n\t\tconst promptElements = utils.getChildrenByTag(element, 'prompt');\n\t\tconst prompt = promptElements.length > 0 ? utils.getHtmlContent(promptElements[0]) : null;\n\n\t\treturn {\n\t\t\tfileTypes,\n\t\t\trawAttributes,\n\t\t\tprompt,\n\t\t};\n\t},\n\n\tvalidate(data) {\n\t\tconst warnings: string[] = [];\n\n\t\t// Warn if no file type restrictions\n\t\tif (!data.fileTypes || data.fileTypes.length === 0) {\n\t\t\twarnings.push('uploadInteraction has no fileTypes - any file type will be accepted');\n\t\t}\n\n\t\treturn {\n\t\t\tvalid: true,\n\t\t\twarnings: warnings.length > 0 ? warnings : undefined,\n\t\t};\n\t},\n};\n"]}
@@ -1,3 +1,2 @@
1
1
  export * from './extractor.js';
2
2
  export type { UploadInteractionData } from './types.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +1,2 @@
1
1
  export * from './extractor.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interactions/upload/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './extractor.js';\nexport type { UploadInteractionData } from './types.js';\n"]}
@@ -1,2 +1 @@
1
1
  export type { UploadInteractionData } from '../shared/types.js';
2
- //# sourceMappingURL=types.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/interactions/upload/types.ts"],"names":[],"mappings":"","sourcesContent":["export type { UploadInteractionData } from '../shared/types.js';\n"]}
@@ -50,4 +50,3 @@ export declare class PciHost {
50
50
  */
51
51
  private extractPciInterface;
52
52
  }
53
- //# sourceMappingURL=PciHost.d.ts.map
@@ -114,3 +114,4 @@ export class PciHost {
114
114
  return candidate;
115
115
  }
116
116
  }
117
+ //# sourceMappingURL=PciHost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PciHost.js","sourceRoot":"","sources":["../../src/pci/PciHost.ts"],"names":[],"mappings":"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,IAAI,CAAC;IACpB,CAAC;IAED,8EAA8E;IAC9E,kBAAkB;IAClB,8EAA8E;IAE9E,iEAAiE;IACvD,aAAa,CAAC,GAAW;QAClC,OAAO,MAAM,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;QACnE,yCAAyC;QACzC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QAC5E,OAAO,IAAI,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;OAGG;IACK,mBAAmB,CAAC,GAAQ;QACnC,MAAM,SAAS,GAAG,GAAG,EAAE,OAAO,IAAI,GAAG,EAAE,WAAW,EAAE,EAAE,IAAI,GAAG,CAAC;QAC9D,IAAI,OAAO,SAAS,EAAE,UAAU,KAAK,UAAU,EAAE,CAAC;YACjD,MAAM,IAAI,KAAK,CACd,kBAAkB,IAAI,CAAC,IAAI,CAAC,WAAW,gDAAgD;gBACtF,iFAAiF,CAClF,CAAC;QACH,CAAC;QACD,OAAO,SAAsB,CAAC;IAC/B,CAAC;CACD","sourcesContent":["import type { ExtractedPci, PciBoundTo, PciModule } from './types.js';\nimport { PciLoadError } from './types.js';\n\n/**\n * Loads, initializes, and manages the lifecycle of a single PCI module.\n *\n * Usage:\n * const host = new PciHost(extractedData, baseUrl);\n * await host.load();\n * host.initialize(domNode);\n * host.getResponse(); // returns current response\n * host.destroy(); // cleanup on player teardown\n */\nexport class PciHost {\n\tprivate readonly data: ExtractedPci;\n\tprivate readonly baseUrl: string;\n\tprivate module: PciModule | null = null;\n\tprivate _response: unknown = null;\n\tprivate _onResponseChange: ((responseId: string, value: unknown) => void) | null = null;\n\n\tconstructor(data: ExtractedPci, baseUrl: string) {\n\t\tthis.data = data;\n\t\tthis.baseUrl = baseUrl;\n\t}\n\n\t/**\n\t * Register a callback to fire when the PCI's response changes.\n\t * The player calls this to wire the PCI into its internal response map.\n\t */\n\tpublic onResponseChange(callback: (responseId: string, value: unknown) => void): void {\n\t\tthis._onResponseChange = callback;\n\t}\n\n\t/**\n\t * Load the PCI module from primaryPath, falling back to fallbackPath.\n\t * Throws PciLoadError if both fail.\n\t */\n\tpublic async load(): Promise<void> {\n\t\tconst primary = this.resolveUrl(this.data.primaryPath);\n\t\ttry {\n\t\t\tconst mod = await this.dynamicImport(primary);\n\t\t\tthis.module = this.extractPciInterface(mod);\n\t\t\treturn;\n\t\t} catch (primaryErr) {\n\t\t\tif (!this.data.fallbackPath) {\n\t\t\t\tthrow new PciLoadError(this.data.primaryPath, undefined, primaryErr as Error);\n\t\t\t}\n\t\t}\n\n\t\tconst fallback = this.resolveUrl(this.data.fallbackPath!);\n\t\ttry {\n\t\t\tconst mod = await this.dynamicImport(fallback);\n\t\t\tthis.module = this.extractPciInterface(mod);\n\t\t} catch (fallbackErr) {\n\t\t\tthrow new PciLoadError(\n\t\t\t\tthis.data.primaryPath,\n\t\t\t\tthis.data.fallbackPath,\n\t\t\t\tfallbackErr as Error\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Initialize the PCI inside the given DOM element.\n\t * Must be called after load() resolves.\n\t */\n\tpublic initialize(dom: HTMLElement): void {\n\t\tif (!this.module) return;\n\n\t\tconst boundTo: PciBoundTo = {\n\t\t\tonReady: () => {},\n\t\t\tonResponseChange: (value: unknown) => {\n\t\t\t\tthis._response = value;\n\t\t\t\tthis._onResponseChange?.(this.data.responseIdentifier, value);\n\t\t\t},\n\t\t};\n\n\t\tthis.module.initialize(dom, this.data.config, boundTo);\n\t}\n\n\t/** Return the current response value from the PCI module. */\n\tpublic getResponse(): unknown {\n\t\treturn this.module ? this.module.getResponse() : this._response;\n\t}\n\n\t/** Restore a response value into the PCI module (e.g. from session state). */\n\tpublic setResponse(value: unknown): void {\n\t\tthis._response = value;\n\t\tthis.module?.setResponse(value);\n\t}\n\n\t/** Disable the PCI (e.g. when role is not candidate, or after final submission). */\n\tpublic disable(): void {\n\t\tthis.module?.disable();\n\t}\n\n\t/** Re-enable the PCI. */\n\tpublic enable(): void {\n\t\tthis.module?.enable();\n\t}\n\n\t/** Tear down the PCI and release all resources. */\n\tpublic destroy(): void {\n\t\tthis.module?.destroy();\n\t\tthis.module = null;\n\t}\n\n\t// ---------------------------------------------------------------------------\n\t// Private helpers\n\t// ---------------------------------------------------------------------------\n\n\t/** Thin wrapper around dynamic import — overridable in tests. */\n\tprotected dynamicImport(url: string): Promise<any> {\n\t\treturn import(/* @vite-ignore */ url);\n\t}\n\n\tprivate resolveUrl(path: string): string {\n\t\tif (/^https?:\\/\\//.test(path) || path.startsWith('/')) return path;\n\t\t// Relative path: resolve against baseUrl\n\t\tconst base = this.baseUrl.endsWith('/') ? this.baseUrl : this.baseUrl + '/';\n\t\treturn base + path;\n\t}\n\n\t/**\n\t * Extract a PciModule from a dynamic import result.\n\t * Supports: default export, named `getInstance` export, or the module itself.\n\t */\n\tprivate extractPciInterface(mod: any): PciModule {\n\t\tconst candidate = mod?.default ?? mod?.getInstance?.() ?? mod;\n\t\tif (typeof candidate?.initialize !== 'function') {\n\t\t\tthrow new Error(\n\t\t\t\t`PCI module at '${this.data.primaryPath}' does not export a valid PciModule interface ` +\n\t\t\t\t\t'(expected .initialize, .getResponse, .setResponse, .disable, .enable, .destroy)'\n\t\t\t);\n\t\t}\n\t\treturn candidate as PciModule;\n\t}\n}\n"]}
@@ -54,4 +54,3 @@ export declare class PciLoadError extends Error {
54
54
  readonly fallbackPath: string | undefined;
55
55
  constructor(primaryPath: string, fallbackPath: string | undefined, cause?: Error);
56
56
  }
57
- //# sourceMappingURL=types.d.ts.map
package/dist/pci/types.js CHANGED
@@ -17,3 +17,4 @@ export class PciLoadError extends Error {
17
17
  Object.defineProperty(this, 'cause', { value: cause, writable: true, configurable: true });
18
18
  }
19
19
  }
20
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/pci/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiDH;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IACtC,YACiB,WAAmB,EACnB,YAAgC,EAChD,KAAa;QAEb,KAAK,CACJ,YAAY;YACX,CAAC,CAAC,mCAAmC,WAAW,mBAAmB,YAAY,GAAG;YAClF,CAAC,CAAC,mCAAmC,WAAW,GAAG,CACpD,CAAC;QARc,gBAAW,GAAX,WAAW,CAAQ;QACnB,iBAAY,GAAZ,YAAY,CAAoB;QAQhD,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,KAAK;YAAE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;IACvG,CAAC;CACD","sourcesContent":["/**\n * QTI 3.0 Portable Custom Interaction (PCI) types.\n * Based on IMS QTI 3.0 Portable Custom Interaction specification.\n */\n\n/**\n * Callbacks the player provides to a PCI module so it can signal state changes.\n */\nexport interface PciBoundTo {\n\t/** Called when the PCI has finished initializing and is ready to accept responses. */\n\tonReady(): void;\n\t/** Called whenever the candidate's response changes. */\n\tonResponseChange(value: unknown): void;\n}\n\n/**\n * Contract that every PCI module must fulfill.\n * The module's default export (or named `getInstance` export) must implement this interface.\n */\nexport interface PciModule {\n\t/** Initialize the PCI inside the given DOM element. */\n\tinitialize(dom: HTMLElement, config: Record<string, string>, boundTo: PciBoundTo): void;\n\t/** Return the current response value. */\n\tgetResponse(): unknown;\n\t/** Restore a previously-captured response value. */\n\tsetResponse(value: unknown): void;\n\t/** Disable candidate interaction (e.g. after submission or when role is not candidate). */\n\tdisable(): void;\n\t/** Re-enable candidate interaction. */\n\tenable(): void;\n\t/** Tear down: remove event listeners, cancel timers, free resources. */\n\tdestroy(): void;\n}\n\n/**\n * Extracted data from a <qti-portable-custom-interaction> element.\n */\nexport interface ExtractedPci {\n\t/** responseIdentifier attribute value. */\n\tresponseIdentifier: string;\n\t/** customInteractionTypeIdentifier attribute value (URN identifying the PCI type). */\n\tcustomInteractionTypeIdentifier: string;\n\t/** Primary JS module path (required). */\n\tprimaryPath: string;\n\t/** Fallback JS module path (optional). */\n\tfallbackPath?: string;\n\t/** Inner HTML of the <qti-interaction-markup> element. */\n\tmarkup: string;\n\t/** Key/value pairs from <qti-pci-properties>/<qti-pci-property>. */\n\tconfig: Record<string, string>;\n}\n\n/**\n * Thrown when a PCI module fails to load from both primary and fallback paths.\n */\nexport class PciLoadError extends Error {\n\tconstructor(\n\t\tpublic readonly primaryPath: string,\n\t\tpublic readonly fallbackPath: string | undefined,\n\t\tcause?: Error\n\t) {\n\t\tsuper(\n\t\t\tfallbackPath\n\t\t\t\t? `PCI module failed to load from '${primaryPath}' and fallback '${fallbackPath}'`\n\t\t\t\t: `PCI module failed to load from '${primaryPath}'`\n\t\t);\n\t\tthis.name = 'PciLoadError';\n\t\tif (cause) Object.defineProperty(this, 'cause', { value: cause, writable: true, configurable: true });\n\t}\n}\n"]}
@@ -6,4 +6,3 @@ import type { PnpProfile } from './types.js';
6
6
  * Magnification is intentionally deferred — host stylesheets / browser zoom are sufficient for now.
7
7
  */
8
8
  export declare function applyPnpToRoot(rootEl: HTMLElement, pnp: PnpProfile | undefined): void;
9
- //# sourceMappingURL=applyPnp.d.ts.map
@@ -24,3 +24,4 @@ export function applyPnpToRoot(rootEl, pnp) {
24
24
  rootEl.style?.removeProperty?.('--qti-magnification');
25
25
  }
26
26
  }
27
+ //# sourceMappingURL=applyPnp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyPnp.js","sourceRoot":"","sources":["../../src/pnp/applyPnp.ts"],"names":[],"mappings":"AAEA,MAAM,IAAI,GAAG,sBAAsB,CAAC;AACpC,MAAM,kBAAkB,GAAG,wBAAwB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,MAAmB,EAAE,GAA2B;IAC9E,MAAM,MAAM,GAAG,GAAG,EAAE,OAAO,EAAE,WAAW,CAAC;IAEzC,IAAI,CAAC,MAAM,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACrC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;SAAM,CAAC;QACP,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,MAAM,aAAa,GAAG,GAAG,EAAE,OAAO,EAAE,aAAa,CAAC;IAClD,IAAI,aAAa,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;QACxF,MAAM,CAAC,YAAY,CAAC,kBAAkB,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;QAC/D,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,qBAAqB,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC;IAC3E,CAAC;SAAM,CAAC;QACP,MAAM,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;QAC3C,MAAM,CAAC,KAAK,EAAE,cAAc,EAAE,CAAC,qBAAqB,CAAC,CAAC;IACvD,CAAC;AACF,CAAC","sourcesContent":["import type { PnpProfile } from './types.js';\n\nconst ATTR = 'data-qti-colorscheme';\nconst MAGNIFICATION_ATTR = 'data-qti-magnification';\n\n/**\n * Apply a PNP profile to the player root element.\n *\n * Currently handles color scheme (data-qti-colorscheme attribute).\n * Magnification is intentionally deferred — host stylesheets / browser zoom are sufficient for now.\n */\nexport function applyPnpToRoot(rootEl: HTMLElement, pnp: PnpProfile | undefined): void {\n\tconst scheme = pnp?.display?.colorScheme;\n\n\tif (!scheme || scheme === 'default') {\n\t\trootEl.removeAttribute(ATTR);\n\t} else {\n\t\trootEl.setAttribute(ATTR, scheme);\n\t}\n\n\tconst magnification = pnp?.display?.magnification;\n\tif (magnification !== undefined && Number.isFinite(magnification) && magnification > 0) {\n\t\trootEl.setAttribute(MAGNIFICATION_ATTR, String(magnification));\n\t\trootEl.style?.setProperty?.('--qti-magnification', String(magnification));\n\t} else {\n\t\trootEl.removeAttribute(MAGNIFICATION_ATTR);\n\t\trootEl.style?.removeProperty?.('--qti-magnification');\n\t}\n}\n"]}
@@ -6,4 +6,3 @@ import type { PnpProfile } from './types.js';
6
6
  * Unknown child elements are silently ignored for forward-compatibility.
7
7
  */
8
8
  export declare function parsePnpXml(xml: string | Element): PnpProfile;
9
- //# sourceMappingURL=parsePnpXml.d.ts.map
@@ -187,3 +187,4 @@ function catalogSupportPreferenceKey(usage) {
187
187
  return usage;
188
188
  }
189
189
  }
190
+ //# sourceMappingURL=parsePnpXml.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsePnpXml.js","sourceRoot":"","sources":["../../src/pnp/parsePnpXml.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAItD;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,GAAqB;IAChD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC7B,2EAA2E;QAC3E,OAAO,WAAW,CAAE,GAAe,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAExB,4DAA4D;IAC5D,MAAM,GAAG,GAAG,SAAS,CAAC,SAAS,OAAO,SAAS,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAG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QACtB,KAAK,mBAAmB;YACvB,OAAO,kBAAkB,CAAC;QAC3B,KAAK,sBAAsB;YAC1B,OAAO,qBAAqB,CAAC;QAC9B;YACC,OAAO,KAAK,CAAC;IACf,CAAC;AACF,CAAC","sourcesContent":["import { parse as parseHtml } from 'node-html-parser';\nimport type { HTMLElement as NhpElement } from 'node-html-parser';\nimport type { CatalogSupportPreference, PnpProfile } from './types.js';\n\n/**\n * Parse a QTI 3.0 <personalNeedsProfile> element (or legacy <pnp> element) into a PnpProfile.\n *\n * Accepts either an XML/HTML string containing the profile element, or a live DOM Element.\n * Unknown child elements are silently ignored for forward-compatibility.\n */\nexport function parsePnpXml(xml: string | Element): PnpProfile {\n\tif (typeof xml !== 'string') {\n\t\t// Live DOM Element — serialise to string and re-parse via node-html-parser\n\t\treturn parsePnpXml((xml as Element).outerHTML ?? '');\n\t}\n\n\tconst trimmed = xml.trim();\n\tif (!trimmed) return {};\n\n\t// Wrap so node-html-parser treats the outer tag as the root\n\tconst doc = parseHtml(`<root>${trimmed}</root>`, { lowerCaseTagName: true });\n\tconst root = doc.querySelector('personalneedsprofile') ?? doc.querySelector('pnp');\n\tif (!root) return {};\n\n\treturn extractProfile(root);\n}\n\nfunction extractProfile(root: NhpElement): PnpProfile {\n\tconst profile: PnpProfile = {};\n\n\t// <display>\n\tconst displayEl = findChild(root, ['display']);\n\tif (displayEl) {\n\t\tprofile.display = {};\n\n\t\tconst colorSchemeEl = findChild(displayEl, ['colorscheme', 'color-scheme']);\n\t\tif (colorSchemeEl) {\n\t\t\tconst val = (colorSchemeEl.getAttribute('value') ?? colorSchemeEl.text ?? '').trim().toLowerCase();\n\t\t\tif (isColorScheme(val)) profile.display.colorScheme = val;\n\t\t}\n\n\t\tconst magEl = findChild(displayEl, ['magnification']);\n\t\tif (magEl) {\n\t\t\tconst val = parseFloat(magEl.getAttribute('value') ?? magEl.text ?? '');\n\t\t\tif (Number.isFinite(val) && val > 0) profile.display.magnification = val;\n\t\t}\n\t}\n\n\t// <content>\n\tconst contentEl = findChild(root, ['content']);\n\tif (contentEl) {\n\t\tprofile.content = {};\n\n\t\tconst glossaryEl = findChild(contentEl, ['glossaryonscreen', 'glossary-on-screen']);\n\t\tif (glossaryEl) {\n\t\t\tprofile.content.glossaryOnScreen = parseBool(glossaryEl.getAttribute('enabled') ?? glossaryEl.text ?? 'true');\n\t\t}\n\n\t\tconst kwEl = findChild(contentEl, ['keywordtranslation', 'keyword-translation']);\n\t\tif (kwEl) {\n\t\t\tconst active = parseBool(kwEl.getAttribute('active') ?? 'true');\n\t\t\tconst languageCode = (kwEl.getAttribute('languagecode') ?? kwEl.getAttribute('language-code') ?? kwEl.getAttribute('lang') ?? '').trim();\n\t\t\tif (languageCode) profile.content.keywordTranslation = { active, languageCode };\n\t\t}\n\n\t\tconst illustratedEl = findChild(contentEl, [\n\t\t\t'illustratedglossary',\n\t\t\t'illustrated-glossary',\n\t\t\t'ext:sbacglossaryillustration',\n\t\t\t'ext:sbac-glossary-illustration',\n\t\t]);\n\t\tif (illustratedEl) {\n\t\t\tprofile.content.illustratedGlossary = parseBool(\n\t\t\t\tillustratedEl.getAttribute('enabled') ?? illustratedEl.getAttribute('active') ?? illustratedEl.text ?? 'true'\n\t\t\t);\n\t\t}\n\n\t\tconst catalogSupportMap = [\n\t\t\t['ttsPronunciation', ['ttspronunciation', 'tts-pronunciation']],\n\t\t\t['signingDefinition', ['signingdefinition', 'signing-definition']],\n\t\t\t['brailleText', ['brailletext', 'braille-text']],\n\t\t\t['audioDescription', ['audiodescription', 'audio-description']],\n\t\t\t['extendedDescription', ['extendeddescription', 'extended-description']],\n\t\t] as const;\n\t\tfor (const [key, names] of catalogSupportMap) {\n\t\t\tconst el = findChild(contentEl, names);\n\t\t\tif (el) {\n\t\t\t\tprofile.content.catalogSupports ??= {};\n\t\t\t\tprofile.content.catalogSupports[key] = parseCatalogSupportPreference(el);\n\t\t\t}\n\t\t}\n\n\t\tfor (const el of findChildren(contentEl, ['catalogsupport', 'catalog-support', 'qti-catalog-support'])) {\n\t\t\tconst usage = normalizeCatalogUsage(\n\t\t\t\tel.getAttribute('usage') ?? el.getAttribute('support') ?? el.getAttribute('name') ?? ''\n\t\t\t);\n\t\t\tif (!usage) continue;\n\t\t\tconst key = catalogSupportPreferenceKey(usage);\n\t\t\tprofile.content.catalogSupports ??= {};\n\t\t\tprofile.content.catalogSupports[key] = parseCatalogSupportPreference(el);\n\t\t}\n\n\t\tconst etEl = findChild(contentEl, ['extendedtime', 'extended-time']);\n\t\tif (etEl) {\n\t\t\tconst active = parseBool(etEl.getAttribute('active') ?? 'true');\n\t\t\tconst rawMultiplier = etEl.getAttribute('multiplier') ?? etEl.text ?? '';\n\t\t\tconst multiplier = rawMultiplier.trim().toLowerCase() === 'infinity'\n\t\t\t\t? Infinity\n\t\t\t\t: parseFloat(rawMultiplier);\n\t\t\tif (Number.isFinite(multiplier) || multiplier === Infinity) {\n\t\t\t\tprofile.content.extendedTime = { active, multiplier };\n\t\t\t}\n\t\t}\n\t}\n\n\t// <cognitive>\n\tconst cogEl = findChild(root, ['cognitive']);\n\tif (cogEl) {\n\t\tprofile.cognitive = {};\n\n\t\tconst elTool = findChild(cogEl, ['eliminationtool', 'elimination-tool']);\n\t\tif (elTool) {\n\t\t\tprofile.cognitive.eliminationTool = parseBool(\n\t\t\t\telTool.getAttribute('enabled') ?? elTool.getAttribute('active') ?? elTool.text ?? 'true'\n\t\t\t);\n\t\t}\n\t}\n\n\treturn profile;\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction findChild(parent: NhpElement, names: readonly string[]): NhpElement | null {\n\treturn findChildren(parent, names)[0] ?? null;\n}\n\nfunction findChildren(parent: NhpElement, names: readonly string[]): NhpElement[] {\n\tconst matches: NhpElement[] = [];\n\tfor (const child of parent.childNodes) {\n\t\tif (child.nodeType !== 1) continue; // element nodes only\n\t\tconst el = child as NhpElement;\n\t\tconst tag = (el.rawTagName ?? '').toLowerCase();\n\t\tif (names.includes(tag)) matches.push(el);\n\t}\n\treturn matches;\n}\n\nfunction parseBool(value: string): boolean {\n\tconst v = (value ?? '').trim().toLowerCase();\n\treturn v !== 'false' && v !== '0' && v !== 'no';\n}\n\nfunction parseCatalogSupportPreference(el: NhpElement): CatalogSupportPreference {\n\tconst active = parseBool(el.getAttribute('enabled') ?? el.getAttribute('active') ?? el.text ?? 'true');\n\tconst languageCode = normalizeLanguageCode(\n\t\tel.getAttribute('languagecode') ?? el.getAttribute('language-code') ?? el.getAttribute('lang') ?? ''\n\t);\n\treturn languageCode ? { active, languageCode } : active;\n}\n\ntype ColorScheme = PnpProfile['display'] extends { colorScheme?: infer C } ? Exclude<C, undefined> : never;\nconst COLOR_SCHEMES = new Set<string>([\n\t'default',\n\t'defaultreverse',\n\t'blackwhite',\n\t'whiteblack',\n\t'blackrose',\n\t'roseblack',\n\t'yellowblue',\n\t'blueyellow',\n\t'mgraydgray',\n\t'dgraymgray',\n\t'blackcyan',\n\t'cyanblack',\n\t'blackcream',\n\t'creamblack',\n\t'whitenav',\n\t'medgray',\n]);\nfunction isColorScheme(v: string): v is ColorScheme {\n\treturn COLOR_SCHEMES.has(v);\n}\n\nfunction normalizeCatalogUsage(value: string): string | null {\n\tconst usage = value.trim().toLowerCase();\n\tif (!/^[a-z][a-z0-9._-]*$/.test(usage)) return null;\n\treturn usage;\n}\n\nfunction normalizeLanguageCode(value: string): string | undefined {\n\tconst languageCode = value.trim();\n\tif (!languageCode) return undefined;\n\tif (!/^[a-zA-Z]{2,8}(?:-[a-zA-Z0-9]{1,8})*$/.test(languageCode)) return undefined;\n\treturn languageCode;\n}\n\nfunction catalogSupportPreferenceKey(usage: string): string {\n\tswitch (usage) {\n\t\tcase 'tts-pronunciation':\n\t\t\treturn 'ttsPronunciation';\n\t\tcase 'signing-definition':\n\t\t\treturn 'signingDefinition';\n\t\tcase 'braille-text':\n\t\t\treturn 'brailleText';\n\t\tcase 'audio-description':\n\t\t\treturn 'audioDescription';\n\t\tcase 'extended-description':\n\t\t\treturn 'extendedDescription';\n\t\tdefault:\n\t\t\treturn usage;\n\t}\n}\n"]}
@@ -60,4 +60,3 @@ export interface CatalogSupportPreferenceOptions {
60
60
  /** Preferred catalog entry language for this support, such as "en-US" or "es". */
61
61
  languageCode?: string;
62
62
  }
63
- //# sourceMappingURL=types.d.ts.map
package/dist/pnp/types.js CHANGED
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/pnp/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * QTI 3.0 §6.2 Personal Needs and Preferences profile.\n * All fields are optional; absent means \"use platform default\".\n */\nexport interface PnpProfile {\n\tdisplay?: {\n\t\t/**\n\t\t * Named color scheme. Maps to the data-qti-colorscheme attribute on the player root.\n\t\t * 'default' or undefined → attribute removed (browser/host default).\n\t\t */\n\t\tcolorScheme?:\n\t\t\t| 'default'\n\t\t\t| 'defaultreverse'\n\t\t\t| 'blackwhite'\n\t\t\t| 'whiteblack'\n\t\t\t| 'blackrose'\n\t\t\t| 'roseblack'\n\t\t\t| 'yellowblue'\n\t\t\t| 'blueyellow'\n\t\t\t| 'mgraydgray'\n\t\t\t| 'dgraymgray'\n\t\t\t| 'blackcyan'\n\t\t\t| 'cyanblack'\n\t\t\t| 'blackcream'\n\t\t\t| 'creamblack'\n\t\t\t| 'whitenav'\n\t\t\t| 'medgray';\n\t\t/**\n\t\t * CSS zoom factor (1.0 = 100%). Deferred — set by browser zoom or host stylesheet.\n\t\t * Stored here for forward-compatibility but not yet applied by the player.\n\t\t */\n\t\tmagnification?: number;\n\t};\n\tcontent?: {\n\t\t/** Show glossary trigger buttons on [data-catalog-idref] terms (G-10). */\n\t\tglossaryOnScreen?: boolean;\n\t\t/** Show keyword-translation trigger buttons using the given language code. */\n\t\tkeywordTranslation?: { active: boolean; languageCode: string };\n\t\t/** Show illustrated glossary supports when catalog entries provide them. */\n\t\tillustratedGlossary?: boolean;\n\t\t/** Enable user-initiated host-routed catalog supports. */\n\t\tcatalogSupports?: CatalogSupportPreferences;\n\t\t/**\n\t\t * Scale assessment time limits. multiplier: 1.5 means 50% extra time.\n\t\t * multiplier: Infinity removes the time limit entirely.\n\t\t */\n\t\textendedTime?: { active: boolean; multiplier: number };\n\t};\n\tcognitive?: {\n\t\t/** Render per-choice elimination toggle buttons in choiceInteraction and orderInteraction. */\n\t\teliminationTool?: boolean;\n\t};\n}\n\nexport interface CatalogSupportPreferences {\n\tttsPronunciation?: CatalogSupportPreference;\n\tsigningDefinition?: CatalogSupportPreference;\n\tbrailleText?: CatalogSupportPreference;\n\taudioDescription?: CatalogSupportPreference;\n\textendedDescription?: CatalogSupportPreference;\n\t/**\n\t * Host-defined catalog usage names. Use QTI/catalog usage strings such as\n\t * \"custom-audio\" rather than DOM event names or implementation-specific APIs.\n\t */\n\t[usage: string]: CatalogSupportPreference | undefined;\n}\n\nexport type CatalogSupportPreference = boolean | CatalogSupportPreferenceOptions;\n\nexport interface CatalogSupportPreferenceOptions {\n\t/** Defaults to true when omitted. */\n\tactive?: boolean;\n\t/** Preferred catalog entry language for this support, such as \"en-US\" or \"es\". */\n\tlanguageCode?: string;\n}\n"]}
@@ -51,4 +51,3 @@ export interface ItemPresentationPlan {
51
51
  }
52
52
  export declare function createItemPresentationPlan({ player, responses, disabled, role, outcomeValues, heuristicsConfig, stimulusContent, deliveryContext, itemBodyScopeSelector, onComponentError, }: CreateItemPresentationPlanOptions): ItemPresentationPlan;
53
53
  export declare function interactionKey(interaction: InteractionData): string;
54
- //# sourceMappingURL=itemPresentationPlan.d.ts.map
@@ -11,7 +11,6 @@ export function createItemPresentationPlan({ player, responses = {}, disabled =
11
11
  const correctResponses = roleCapabilities.canViewCorrectResponses ? player.getCorrectResponses() : {};
12
12
  const itemBodyHtml = buildItemBodyPresentationHtml({
13
13
  player,
14
- interactions,
15
14
  outcomeValues,
16
15
  heuristicsConfig,
17
16
  stimulusContent,
@@ -35,7 +34,7 @@ export function createItemPresentationPlan({ player, responses = {}, disabled =
35
34
  }),
36
35
  };
37
36
  }
38
- function buildItemBodyPresentationHtml({ player, interactions, outcomeValues, heuristicsConfig, stimulusContent, deliveryContext, itemBodyScopeSelector, }) {
37
+ function buildItemBodyPresentationHtml({ player, outcomeValues, heuristicsConfig, stimulusContent, deliveryContext, itemBodyScopeSelector, }) {
39
38
  let html = String(player.getItemBodyHtml());
40
39
  const resolvedDeliveryContext = deliveryContext ?? player.getDeliveryContext();
41
40
  const stylesheetCss = buildScopedStylesheetCss(resolvedDeliveryContext, itemBodyScopeSelector);
@@ -96,3 +95,4 @@ export function interactionKey(interaction) {
96
95
  const prompt = typeof anyInteraction?.prompt === 'string' ? anyInteraction.prompt : '';
97
96
  return `${interaction.type}|${interaction.responseId}|${ids}|${prompt}`;
98
97
  }
98
+ //# sourceMappingURL=itemPresentationPlan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"itemPresentationPlan.js","sourceRoot":"","sources":["../../src/presentation/itemPresentationPlan.ts"],"names":[],"mappings":"AACA,OAAO,EACN,yBAAyB,GAEzB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,mBAAmB,EAAyB,MAAM,uBAAuB,CAAC;AAEnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACnF,OAAO,EAAE,6BAA6B,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC7G,OAAO,EACN,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,GAEvB,MAAM,uCAAuC,CAAC;AAqD/C,MAAM,UAAU,0BAA0B,CAAC,EAC1C,MAAM,EACN,SAAS,GAAG,EAAE,EACd,QAAQ,GAAG,KAAK,EAChB,IAAI,GAAG,WAAW,EAClB,aAAa,GAAG,EAAE,EAClB,gBAAgB,EAChB,eAAe,GAAG,EAAE,EACpB,e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AC,CAAC,CAAC,EAAE,CAAC;IACvF,OAAO,GAAG,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,UAAU,IAAI,GAAG,IAAI,MAAM,EAAE,CAAC;AACzE,CAAC","sourcesContent":["import type { ResolvedItemDeliveryContext } from '@pie-qti/ims-cp-core';\nimport {\n\tnormalizeHeuristicsConfig,\n\ttype QtiHeuristicsConfig,\n} from '@pie-qti/ims-cp-core';\nimport type { PnpProfile } from '../pnp/types.js';\nimport { getRoleCapabilities, type RoleCapabilities } from '../core/rolePolicy.js';\nimport type { InteractionData, HtmlContent, QTIRole } from '../types/index.js';\nimport { processFeedbackInline } from '../components/utils/feedbackUtils.js';\nimport { buildScopedStylesheetCss } from '../components/utils/stylesheetRender.js';\nimport { buildEffectiveStimulusContent, injectStimulusContent } from '../components/utils/stimulusRender.js';\nimport {\n\tcreateInlineRenderPlan,\n\tisInlineInteractionTagName,\n\tisInlineInteractionType,\n\ttype InlineRenderSegment,\n} from '../interactions/inline/render-plan.js';\n\nexport type ItemPresentationResponseValue = unknown;\nexport type ItemPresentationResponseMap = Record<string, ItemPresentationResponseValue>;\n\nexport interface ItemPresentationComponentRegistry {\n\tgetTagName(interaction: InteractionData): string;\n}\n\nexport interface ItemPresentationPlayer {\n\tgetComponentRegistry(): ItemPresentationComponentRegistry;\n\tgetInteractionData(): InteractionData[];\n\tgetCorrectResponses(): Record<string, unknown>;\n\tgetItemBodyHtml(): HtmlContent;\n\tgetDeliveryContext(): ResolvedItemDeliveryContext | undefined;\n\tsanitizeHtmlContent(html: string): string;\n\tgetPnp(): PnpProfile | undefined;\n}\n\nexport interface CreateItemPresentationPlanOptions {\n\tplayer: ItemPresentationPlayer;\n\tresponses?: ItemPresentationResponseMap;\n\tdisabled?: boolean;\n\trole?: QTIRole;\n\toutcomeValues?: Record<string, unknown>;\n\theuristicsConfig?: QtiHeuristicsConfig;\n\tstimulusContent?: Record<string, string>;\n\tdeliveryContext?: ResolvedItemDeliveryContext;\n\titemBodyScopeSelector?: string;\n\tonComponentError?: (interaction: InteractionData, error: unknown) => void;\n}\n\nexport interface BlockInteractionPresentation {\n\tinteraction: InteractionData;\n\ttagName: string;\n\tkey: string;\n\tresponse: ItemPresentationResponseValue | null;\n\tcorrectResponse: unknown;\n\tpnp: PnpProfile | undefined;\n\teliminationTool: boolean;\n\tdisabled: boolean;\n\tcomponentRole: 'scorer' | undefined;\n}\n\nexport interface ItemPresentationPlan {\n\troleCapabilities: RoleCapabilities;\n\teffectiveDisabled: boolean;\n\tcorrectResponses: Record<string, unknown>;\n\titemBodyHtml: string;\n\tinlineSegments: InlineRenderSegment[];\n\tblockInteractions: BlockInteractionPresentation[];\n}\n\nexport function createItemPresentationPlan({\n\tplayer,\n\tresponses = {},\n\tdisabled = false,\n\trole = 'candidate',\n\toutcomeValues = {},\n\theuristicsConfig,\n\tstimulusContent = {},\n\tdeliveryContext,\n\titemBodyScopeSelector = '[data-qti-item-body-scope]',\n\tonComponentError,\n}: CreateItemPresentationPlanOptions): ItemPresentationPlan {\n\tconst interactions = player.getInteractionData();\n\tconst roleCapabilities = getRoleCapabilities(role);\n\tconst effectiveDisabled = disabled || roleCapabilities.isReadOnly;\n\tconst correctResponses = roleCapabilities.canViewCorrectResponses ? player.getCorrectResponses() : {};\n\tconst itemBodyHtml = buildItemBodyPresentationHtml({\n\t\tplayer,\n\t\toutcomeValues,\n\t\theuristicsConfig,\n\t\tstimulusContent,\n\t\tdeliveryContext,\n\t\titemBodyScopeSelector,\n\t});\n\n\treturn {\n\t\troleCapabilities,\n\t\teffectiveDisabled,\n\t\tcorrectResponses,\n\t\titemBodyHtml,\n\t\tinlineSegments: createInlineRenderPlan(itemBodyHtml, interactions),\n\t\tblockInteractions: createBlockInteractionPresentations({\n\t\t\tinteractions,\n\t\t\tplayer,\n\t\t\tresponses,\n\t\t\tcorrectResponses,\n\t\t\troleCapabilities,\n\t\t\teffectiveDisabled,\n\t\t\tonComponentError,\n\t\t}),\n\t};\n}\n\nfunction buildItemBodyPresentationHtml({\n\tplayer,\n\toutcomeValues,\n\theuristicsConfig,\n\tstimulusContent,\n\tdeliveryContext,\n\titemBodyScopeSelector,\n}: {\n\tplayer: ItemPresentationPlayer;\n\toutcomeValues: Record<string, unknown>;\n\theuristicsConfig: QtiHeuristicsConfig | undefined;\n\tstimulusContent: Record<string, string>;\n\tdeliveryContext: ResolvedItemDeliveryContext | undefined;\n\titemBodyScopeSelector: string;\n}): string {\n\tlet html = String(player.getItemBodyHtml());\n\tconst resolvedDeliveryContext = deliveryContext ?? player.getDeliveryContext();\n\tconst stylesheetCss = buildScopedStylesheetCss(resolvedDeliveryContext, itemBodyScopeSelector);\n\tconst effectiveStimulusContent = buildEffectiveStimulusContent(\n\t\tresolvedDeliveryContext,\n\t\tstimulusContent,\n\t\t(content) => player.sanitizeHtmlContent(content)\n\t);\n\n\thtml = injectStimulusContent(html, effectiveStimulusContent);\n\tif (stylesheetCss) {\n\t\thtml = `<style data-qti-stylesheets=\"resolved\">${stylesheetCss}</style>${html}`;\n\t}\n\n\tconst heuristics = normalizeHeuristicsConfig(heuristicsConfig);\n\thtml = processFeedbackInline(html, {\n\t\toutcomeValues,\n\t\tapplyHeuristics: heuristics.feedbackTextFormatting,\n\t\twrapWithSpan: false,\n\t});\n\n\treturn hideBlockInteractionMarkup(html);\n}\n\nfunction hideBlockInteractionMarkup(html: string): string {\n\treturn html.replace(\n\t\t/<(\\w+Interaction|qti-[\\w-]+-interaction)(\\s[^>]*)?>[\\s\\S]*?<\\/\\1>/gi,\n\t\t(match, tagName) => {\n\t\t\tconst lower = tagName.toLowerCase();\n\t\t\tif (isInlineInteractionTagName(lower)) return match;\n\t\t\treturn `<span class=\"qti-hidden-interaction\">${match}</span>`;\n\t\t}\n\t);\n}\n\nfunction createBlockInteractionPresentations({\n\tinteractions,\n\tplayer,\n\tresponses,\n\tcorrectResponses,\n\troleCapabilities,\n\teffectiveDisabled,\n\tonComponentError,\n}: {\n\tinteractions: InteractionData[];\n\tplayer: ItemPresentationPlayer;\n\tresponses: ItemPresentationResponseMap;\n\tcorrectResponses: Record<string, unknown>;\n\troleCapabilities: RoleCapabilities;\n\teffectiveDisabled: boolean;\n\tonComponentError?: (interaction: InteractionData, error: unknown) => void;\n}): BlockInteractionPresentation[] {\n\tconst componentRegistry = player.getComponentRegistry();\n\treturn interactions\n\t\t.filter((interaction) => !isInlineInteractionType(interaction.type))\n\t\t.map((interaction) => {\n\t\t\ttry {\n\t\t\t\tconst block: BlockInteractionPresentation = {\n\t\t\t\t\tinteraction,\n\t\t\t\t\ttagName: componentRegistry.getTagName(interaction),\n\t\t\t\t\tkey: interactionKey(interaction),\n\t\t\t\t\tresponse: responses[interaction.responseId] ?? null,\n\t\t\t\t\tcorrectResponse: roleCapabilities.canViewCorrectResponses\n\t\t\t\t\t\t? (correctResponses[interaction.responseId] ?? null)\n\t\t\t\t\t\t: null,\n\t\t\t\t\tpnp: player.getPnp(),\n\t\t\t\t\teliminationTool: player.getPnp()?.cognitive?.eliminationTool === true,\n\t\t\t\t\tdisabled: effectiveDisabled,\n\t\t\t\t\tcomponentRole: roleCapabilities.canViewCorrectResponses ? 'scorer' : undefined,\n\t\t\t\t};\n\t\t\t\treturn block;\n\t\t\t} catch (error) {\n\t\t\t\tonComponentError?.(interaction, error);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t})\n\t\t.filter((item): item is BlockInteractionPresentation => item !== null);\n}\n\nexport function interactionKey(interaction: InteractionData): string {\n\tconst anyInteraction = interaction as any;\n\tconst ids =\n\t\tArray.isArray(anyInteraction?.choices) && anyInteraction.choices.length > 0\n\t\t\t? anyInteraction.choices.map((choice: any) => choice?.identifier).filter(Boolean).join(',')\n\t\t\t: '';\n\tconst prompt = typeof anyInteraction?.prompt === 'string' ? anyInteraction.prompt : '';\n\treturn `${interaction.type}|${interaction.responseId}|${ids}|${prompt}`;\n}\n"]}
package/dist/server.d.ts CHANGED
@@ -7,4 +7,3 @@
7
7
  export * from './core/constants.js';
8
8
  export * from './core/declarations.js';
9
9
  export { Player } from './core/Player.js';
10
- //# sourceMappingURL=server.d.ts.map
package/dist/server.js CHANGED
@@ -8,3 +8,4 @@
8
8
  export * from './core/constants.js';
9
9
  export * from './core/declarations.js';
10
10
  export { Player } from './core/Player.js';
11
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,gEAAgE;AAChE,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["/**\n * Server-safe entrypoint for @pie-qti/item-player\n *\n * This module must remain free of browser/DOM globals (document, window, HTMLElement).\n * Use it from SSR / backend code (e.g. SvelteKit endpoints) for scoring and parsing.\n */\n\n\n// These are used by scoring/processing and are DOM-independent.\nexport * from './core/constants.js';\nexport * from './core/declarations.js';\nexport { Player } from './core/Player.js';\n\n\n"]}
@@ -363,4 +363,3 @@ export interface InteractionContext {
363
363
  }
364
364
  export type * from '../interactions/index.js';
365
365
  export * from './responseValidation.js';
366
- //# sourceMappingURL=index.d.ts.map
@@ -2,3 +2,4 @@
2
2
  * Core QTI types for the player
3
3
  */
4
4
  export * from './responseValidation.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AA6YH,cAAc,yBAAyB,CAAC","sourcesContent":["/**\n * Core QTI types for the player\n */\n\nimport type {\n\tBaseType as ProcessingBaseType,\n\tCardinality as ProcessingCardinality,\n\tQtiValue,\n} from '@pie-qti/qti-processing';\nimport type { ResolvedItemDeliveryContext } from '@pie-qti/ims-cp-core';\nimport type { ResponseValidationResult } from './responseValidation.js';\n\n/**\n * QTI base type identifier\n * Extensible string type allows custom base types\n */\nexport type VariableBaseType = ProcessingBaseType;\n\n/**\n * QTI cardinality identifier\n * Extensible string type allows custom cardinality values\n */\nexport type VariableCardinality = ProcessingCardinality;\n\nexport interface VariableDeclaration {\n\tidentifier: string;\n\tbaseType: VariableBaseType;\n\tcardinality: VariableCardinality;\n\tvalue: any;\n\tdefaultValue?: any;\n\tmapping?: Mapping;\n\tareaMapping?: AreaMapping;\n}\n\nexport interface Mapping {\n\tdefaultValue?: number;\n\tlowerBound?: number;\n\tupperBound?: number;\n\t/**\n\t * QTI attribute on <mapping>. When \"false\", string mappings are case-insensitive by default.\n\t * Stored as raw string to match XML attribute values (\"true\"/\"false\").\n\t */\n\tcaseSensitive?: string;\n\tentries: Record<string, MapEntry>;\n}\n\nexport interface MapEntry {\n\tmapKey: string;\n\tmappedValue: number;\n\tcaseSensitive?: string;\n}\n\nexport interface AreaMapping {\n\tdefaultValue?: number;\n\tlowerBound?: number;\n\tupperBound?: number;\n\tentries: AreaMapEntry[];\n}\n\nexport interface AreaMapEntry {\n\tshape: 'circle' | 'rect' | 'poly' | 'ellipse' | 'default';\n\tcoords: string;\n\tmappedValue: number;\n}\n\nexport interface ResponseDeclaration extends VariableDeclaration {\n\tcorrectResponse?: any;\n}\n\nexport interface OutcomeDeclaration extends VariableDeclaration {\n\tinterpretation?: string;\n\tlongInterpretation?: string;\n\tnormalMaximum?: number;\n\tnormalMinimum?: number;\n\tmasteryValue?: number;\n\tviews?: string[];\n}\n\nexport interface ItemSessionState {\n\t[variableId: string]: any;\n}\n\nexport type ItemLifecycleStatus = 'initial' | 'interacting' | 'suspended' | 'closed' | 'review' | 'solution' | 'answer';\n\nexport type SerializedVariableKind = 'response' | 'outcome' | 'template' | 'context';\n\nexport interface SerializedItemSessionVariable {\n\tidentifier: string;\n\tkind: SerializedVariableKind;\n\tbaseType: VariableBaseType;\n\tcardinality: VariableCardinality;\n\tvalue: any;\n\tdefaultValue?: any;\n}\n\nexport interface SerializedItemSessionState {\n\titemIdentifier?: string;\n\tsessionGuid: string;\n\tlifecycleStatus: ItemLifecycleStatus;\n\tcompletionStatus: CompletionStatus;\n\tnumAttempts: number;\n\t/**\n\t * Time-on-task in milliseconds, stored as the QTI built-in duration variable value.\n\t */\n\tduration: number;\n\tresponseVariables: Record<string, SerializedItemSessionVariable>;\n\toutcomeVariables: Record<string, SerializedItemSessionVariable>;\n\ttemplateVariables: Record<string, SerializedItemSessionVariable>;\n\tcontextVariables: Record<string, SerializedItemSessionVariable>;\n\tvalidationMessages: ResponseValidationResult['issues'];\n\tsavedAt: string;\n}\n\nexport type ItemSessionAction =\n\t| 'suspendAttempt'\n\t| 'endAttempt'\n\t| 'scoreAttempt'\n\t| 'newTemplate'\n\t| 'submitAttempt';\n\nexport type ItemSessionActionCommand =\n\t| { action: 'suspendAttempt' }\n\t| { action: 'endAttempt'; countAttempt?: boolean; validateResponses?: boolean }\n\t| { action: 'scoreAttempt' }\n\t| { action: 'newTemplate'; resetResponses?: boolean }\n\t| { action: 'submitAttempt'; countAttempt?: boolean };\n\nexport interface ItemSessionActionResult {\n\taction: ItemSessionAction;\n\tlifecycleStatus: ItemLifecycleStatus;\n\tcompletionStatus: CompletionStatus;\n\tnumAttempts: number;\n\tduration: number;\n\tcompleted: boolean;\n\tsessionState: SerializedItemSessionState;\n\tvalidation?: ResponseValidationResult;\n\tscoring?: ScoringResult;\n}\n\nexport interface InteractionResponse {\n\t[responseId: string]: any;\n}\n\n/**\n * Serializable representation of a QTI baseType=\"file\" response.\n * (We cannot store a browser File object in session state / JSON exports.)\n */\nexport interface QTIFileResponse {\n\tname: string;\n\ttype: string;\n\tsize: number;\n\tlastModified: number;\n\t/** Base64 data URL, e.g. data:application/pdf;base64,... */\n\tdataUrl: string;\n\t/**\n\t * Optional ImageData extracted from canvas (for drawing interactions).\n\t * This allows custom operators to analyze drawing content synchronously\n\t * without needing to decode the dataUrl asynchronously.\n\t */\n\timageData?: {\n\t\tdata: Uint8ClampedArray;\n\t\twidth: number;\n\t\theight: number;\n\t};\n}\n\nexport interface ModalFeedback {\n\t/** Unique identifier for this feedback block */\n\tidentifier: string;\n\t/** Outcome variable identifier this feedback is tied to */\n\toutcomeIdentifier: string;\n\t/** When to show: 'show' means display when outcome matches identifier */\n\tshowHide: 'show' | 'hide';\n\t/** HTML content to display */\n\tcontent: HtmlContent;\n\t/** Optional title for the feedback */\n\ttitle?: string;\n}\n\nexport interface ScoringResult {\n\tscore: number;\n\tmaxScore: number;\n\tcompleted: boolean;\n\toutcomeValues: Record<string, any>;\n\t/** Modal feedback elements that should be displayed based on outcome values */\n\tmodalFeedback?: ModalFeedback[];\n}\n\n/**\n * QTI 2.2 completionStatus values for adaptive items\n * - not_attempted: No interaction has occurred yet\n * - unknown: Response exists but hasn't been scored/evaluated\n * - incomplete: Item has been scored but is still active (can submit again)\n * - completed: Item is finished (final state)\n */\nexport type CompletionStatus = 'not_attempted' | 'unknown' | 'incomplete' | 'completed';\n\n/**\n * Extended scoring result for adaptive items with multi-attempt support\n */\nexport interface AdaptiveAttemptResult extends ScoringResult {\n\t/** Number of attempts made so far */\n\tnumAttempts: number;\n\t/** Current completion status of the item */\n\tcompletionStatus: CompletionStatus;\n\t/** Whether the item can accept more submissions */\n\tcanContinue: boolean;\n}\n\n/**\n * QTI role/view actors used for audience filtering (for example rubric/outcome visibility).\n * Runtime interaction behavior (readonly vs editable, correct-answer visibility) is a player\n * policy layered on top of these roles.\n */\nexport type QTIRole = 'candidate' | 'scorer' | 'proctor' | 'testConstructor' | 'tutor' | 'author';\n\nexport interface RubricBlock {\n\tview: string[]; // Array of role strings that can see this rubric\n\thtml: HtmlContent; // HTML content of the rubric\n}\n\n/**\n * QTI specification compliance configuration.\n * Controls whether the player enforces strict QTI 2.2 spec or allows vendor extensions.\n */\nexport interface QTIComplianceConfig {\n\t/** Enable strict QTI 2.2 compliance mode. Default: false (lenient) */\n\tenabled?: boolean;\n\n\t/** Reject items with unknown or non-standard elements. Default: false */\n\trejectUnknownExtensions?: boolean;\n\n\t/** Log warnings for spec deviations and vendor extensions. Default: true */\n\tlogDeviations?: boolean;\n}\n\nexport interface PlayerConfig {\n\titemXml?: string;\n\t/**\n\t * QTI 3.0 §6.2 Personal Needs and Preferences profile.\n\t * Color scheme is applied immediately as data-qti-colorscheme on the player root.\n\t * Use player.updatePnp() to change mid-session without re-parsing the item.\n\t */\n\tpnp?: import('../pnp/types.js').PnpProfile;\n\t/**\n\t * Optional shared catalog XML string (QTI 3.0 §6.3).\n\t * Parsed and merged with any catalog embedded in the item XML.\n\t * Item-level catalog entries take precedence over shared entries with the same identifier.\n\t * Deferred: external catalog files from IMS manifest (G-15) are not yet supported.\n\t */\n\tcatalogXml?: string;\n\t/**\n\t * Optional resolved delivery context produced by IMS package/assessment layers.\n\t * This is additive to catalogXml: shared catalog sources are merged first, then\n\t * catalogXml, then item-embedded catalog entries so item-local entries win.\n\t */\n\tdeliveryContext?: ResolvedItemDeliveryContext;\n\tsessionState?: ItemSessionState;\n\tresponses?: InteractionResponse;\n\trole?: QTIRole;\n\t/** Optional seed for deterministic random operations (e.g. templateProcessing randomInteger) */\n\tseed?: number;\n\t/** Optional RNG override (takes precedence over seed if provided) */\n\trng?: () => number;\n\t/**\n\t * Optional element name mapper for handling different QTI versions.\n\t * Defaults to Qti2xElementNameMapper (primary supported QTI format).\n\t * @since 0.2.0\n\t */\n\telementNameMapper?: any; // Will be ElementNameMapper from @pie-qti/qti-common\n\t/**\n\t * Optional attribute name mapper for handling different QTI versions.\n\t * Defaults to Qti2xAttributeNameMapper (primary supported QTI format).\n\t * @since 0.3.0\n\t */\n\tattributeNameMapper?: any; // Will be AttributeNameMapper from @pie-qti/qti-common\n\t/** Optional web component registry for custom interaction components */\n\tcomponentRegistry?: any; // Will be ComponentRegistry, but avoiding circular dependency\n\t/** Optional extraction registry for custom element extractors */\n\textractionRegistry?: any; // Will be ExtractionRegistry, but avoiding circular dependency\n\t/** Optional plugins to extend player functionality */\n\tplugins?: any[]; // Will be QTIPlugin[], but avoiding circular dependency\n\t/**\n\t * Optional i18n provider for internationalization.\n\t * If not provided, defaults to DefaultI18nProvider with English messages.\n\t */\n\ti18nProvider?: any; // Will be I18nProvider from @pie-qti/i18n\n\t/**\n\t * Optional registry for executing QTI <customOperator> expressions.\n\t * Keyed by operator `class` (preferred) or `definition` URI.\n\t */\n\tcustomOperators?: Record<string, (args: QtiValue[], meta: { class?: string; definition?: string }) => QtiValue>;\n\t/**\n\t * Optional base URL for resolving relative PCI module paths.\n\t * Defaults to document.baseURI when running in a browser.\n\t */\n\tpciBaseUrl?: string;\n\n\t/**\n\t * Security-related controls for untrusted QTI rendered into the host DOM.\n\t * Defaults are conservative for same-DOM embedding.\n\t */\n\tsecurity?: PlayerSecurityConfig;\n\n\t/**\n\t * QTI specification compliance settings.\n\t * Set strictQtiCompliance.enabled = true for strict QTI 2.2 validation.\n\t */\n\tstrictQtiCompliance?: QTIComplianceConfig;\n}\n\nexport interface UrlPolicyConfig {\n\t/**\n\t * Optional base URL used to resolve relative asset URLs (e.g. images/media).\n\t * If omitted, relative URLs are preserved as-is.\n\t */\n\tassetBaseUrl?: string;\n\t/** Allow https: URLs */\n\tallowHttps?: boolean;\n\t/** Allow http: URLs (default false; prefer https) */\n\tallowHttp?: boolean;\n\t/** Allow protocol-relative URLs (e.g. //cdn.example/asset). Default false. */\n\tallowProtocolRelative?: boolean;\n\t/** Allow data:image/* for <img src>. */\n\tallowDataImages?: boolean;\n\t/** Allow data:image/svg+xml (default false) */\n\tallowSvgDataImages?: boolean;\n\t/** Optional allowlist of hostnames for absolute URLs (exact match). */\n\tallowedHosts?: string[];\n}\n\n/**\n * Trusted Types support:\n * - When enabled and supported by the host browser + CSP, HTML-returning APIs may return TrustedHTML instead of string.\n * - When not enabled (default), APIs return plain strings as before.\n */\nexport type TrustedTypesHtml = typeof globalThis extends { TrustedHTML: infer T } ? T : never;\nexport type HtmlContent = string | TrustedTypesHtml;\n\nexport interface PlayerSecurityConfig {\n\t/** URL policy applied to extracted URL fields and HTML attribute URLs */\n\turlPolicy?: UrlPolicyConfig;\n\t/** Allow <object>/<embed> usage (default false) */\n\tallowObjectEmbeds?: boolean;\n\t/** Allow <iframe> usage (default false) */\n\tallowIframes?: boolean;\n\t/**\n\t * Optional parsing/processing guardrails to reduce DoS risk from untrusted QTI.\n\t * Disabled by default for compatibility.\n\t */\n\tparsingLimits?: ParsingLimitsConfig;\n\t/**\n\t * Optional Trusted Types policy name (host-controlled).\n\t * When set, and Trusted Types is available, the player will produce TrustedHTML for HTML injection sinks.\n\t *\n\t * Note: this is only effective when the host enables Trusted Types via CSP.\n\t */\n\ttrustedTypesPolicyName?: string;\n}\n\nexport interface ParsingLimitsConfig {\n\t/**\n\t * Enables parsing limits. When false/undefined, the player behaves exactly as before (compat default).\n\t */\n\tenabled?: boolean;\n\t/**\n\t * Reject any XML containing <!DOCTYPE ...> (case-insensitive) when enabled.\n\t * Helps reduce entity-expansion and other parser edge-case risks.\n\t */\n\trejectDoctype?: boolean;\n\t/**\n\t * Maximum bytes for `itemXml` input (UTF-8). Enforced when enabled.\n\t */\n\tmaxItemXmlBytes?: number;\n\t/**\n\t * Maximum bytes for HTML strings passed to sanitizer (UTF-8). Enforced when enabled.\n\t */\n\tmaxHtmlBytes?: number;\n\t/**\n\t * Maximum number of element nodes sanitized per HTML input. Enforced when enabled.\n\t */\n\tmaxHtmlNodes?: number;\n\t/**\n\t * Maximum element depth sanitized per HTML input. Enforced when enabled.\n\t */\n\tmaxHtmlDepth?: number;\n}\n\nexport interface InteractionContext {\n\tresponseIdentifier: string;\n\tmaxChoices?: number;\n\tminChoices?: number;\n\tshuffle?: boolean;\n\torientation?: 'horizontal' | 'vertical';\n}\n\n// Interaction data shapes for the component/plugin system.\n// Exported here so consumers can import them from `@pie-qti/item-player`.\nexport type * from '../interactions/index.js';\nexport * from './responseValidation.js';\n"]}
@@ -22,4 +22,3 @@ export interface ResponseValidationResult {
22
22
  entries: Record<string, ResponseValidationEntry>;
23
23
  issues: ResponseValidationIssue[];
24
24
  }
25
- //# sourceMappingURL=responseValidation.d.ts.map
@@ -1 +1,2 @@
1
1
  export {};
2
+ //# sourceMappingURL=responseValidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responseValidation.js","sourceRoot":"","sources":["../../src/types/responseValidation.ts"],"names":[],"mappings":"","sourcesContent":["export type ResponseValidationSeverity = 'error' | 'warning';\n\nexport interface ResponseValidationIssue {\n\tresponseId: string;\n\tcode: string;\n\tmessage: string;\n\tseverity: ResponseValidationSeverity;\n}\n\nexport interface ResponseValidationEntry {\n\tresponseId: string;\n\tinteractionType: string;\n\t/** Whether this interaction is required for submission purposes (derived from constraints like minPlays/minChoices). */\n\trequired: boolean;\n\t/** Whether the interaction is complete for submission purposes. */\n\tcomplete: boolean;\n\t/** Whether the response value is valid (shape + constraints). */\n\tvalid: boolean;\n\terrors: string[];\n\twarnings: string[];\n}\n\nexport interface ResponseValidationResult {\n\tvalid: boolean;\n\tentries: Record<string, ResponseValidationEntry>;\n\tissues: ResponseValidationIssue[];\n}\n\n\n"]}
@@ -167,4 +167,3 @@ export declare class PerformanceMonitor {
167
167
  * ```
168
168
  */
169
169
  export declare const globalPerformanceMonitor: PerformanceMonitor;
170
- //# sourceMappingURL=PerformanceMonitor.d.ts.map
@@ -240,3 +240,4 @@ export const globalPerformanceMonitor = new PerformanceMonitor({
240
240
  maxEntries: 100,
241
241
  logWarnings: false,
242
242
  });
243
+ //# sourceMappingURL=PerformanceMonitor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PerformanceMonitor.js","sourceRoot":"","sources":["../../src/utils/PerformanceMonitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAgDH,MAAM,OAAO,kBAAkB;IAW9B,YAAY,SAAmC,EAAE;QAJzC,YAAO,GAAuB,EAAE,CAAC;QACjC,kBAAa,GAAG,CAAC,CAAC;QAClB,eAAU,GAAG,IAAI,GAAG,EAAkB,CAAC;QAG9C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,I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;QAKlB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACnC,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,QAAQ,EAAE,KAAK,CAAC,QAAQ;SACxB,CAAC,CAAC,CAAC;IACL,CAAC;CACD;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,kBAAkB,CAAC;IAC9D,OAAO,EAAE,KAAK,EAAE,yCAAyC;IACzD,UAAU,EAAE,GAAG;IACf,WAAW,EAAE,KAAK;CAClB,CAAC,CAAC","sourcesContent":["/**\n * Performance Monitor Utility\n *\n * Provides lightweight performance monitoring for QTI player operations\n * without requiring external dependencies. Useful for debugging, optimization,\n * and tracking performance metrics in production.\n *\n * Features:\n * - Measure operation durations\n * - Track custom metrics\n * - Export performance data\n * - Memory-efficient (circular buffer for metrics)\n *\n * Usage:\n * ```typescript\n * import { PerformanceMonitor } from './utils/PerformanceMonitor';\n *\n * const monitor = new PerformanceMonitor({ enabled: true, maxEntries: 100 });\n *\n * // Measure an operation\n * const stopTimer = monitor.startTimer('render-item');\n * // ... do work\n * stopTimer(); // Records duration\n *\n * // Track custom metrics\n * monitor.recordMetric('item-response-time', 245);\n *\n * // Get performance report\n * const report = monitor.getReport();\n * console.log(report);\n * ```\n */\n\nexport interface PerformanceEntry {\n\t/** Metric name */\n\tname: string;\n\t/** Timestamp when metric was recorded (ms since epoch) */\n\ttimestamp: number;\n\t/** Duration in milliseconds (for timers) */\n\tduration?: number;\n\t/** Custom value (for non-timer metrics) */\n\tvalue?: number;\n\t/** Additional metadata */\n\tmetadata?: Record<string, unknown>;\n}\n\nexport interface PerformanceReport {\n\t/** Total number of metrics recorded */\n\ttotalEntries: number;\n\t/** Number of entries currently stored (may be less due to circular buffer) */\n\tstoredEntries: number;\n\t/** Summary statistics by metric name */\n\tmetrics: Record<\n\t\tstring,\n\t\t{\n\t\t\tcount: number;\n\t\t\tmin: number;\n\t\t\tmax: number;\n\t\t\tavg: number;\n\t\t\ttotal: number;\n\t\t}\n\t>;\n\t/** Recent entries (last N based on buffer size) */\n\trecentEntries: PerformanceEntry[];\n}\n\nexport interface PerformanceMonitorConfig {\n\t/** Enable/disable monitoring (default: false) */\n\tenabled?: boolean;\n\t/** Maximum entries to store (circular buffer, default: 100) */\n\tmaxEntries?: number;\n\t/** Auto-export metrics when buffer is full (default: false) */\n\tautoExport?: boolean;\n\t/** Callback for auto-export */\n\tonExport?: (report: PerformanceReport) => void;\n\t/** Log warnings to console (default: false) */\n\tlogWarnings?: boolean;\n}\n\nexport class PerformanceMonitor {\n\tprivate enabled: boolean;\n\tprivate maxEntries: number;\n\tprivate autoExport: boolean;\n\tprivate onExport?: (report: PerformanceReport) => void;\n\tprivate logWarnings: boolean;\n\n\tprivate entries: PerformanceEntry[] = [];\n\tprivate totalRecorded = 0;\n\tprivate startTimes = new Map<string, number>();\n\n\tconstructor(config: PerformanceMonitorConfig = {}) {\n\t\tthis.enabled = config.enabled ?? false;\n\t\tthis.maxEntries = config.maxEntries ?? 100;\n\t\tthis.autoExport = config.autoExport ?? false;\n\t\tthis.onExport = config.onExport;\n\t\tthis.logWarnings = config.logWarnings ?? false;\n\t}\n\n\t/**\n\t * Enable performance monitoring\n\t */\n\tenable(): void {\n\t\tthis.enabled = true;\n\t}\n\n\t/**\n\t * Disable performance monitoring\n\t */\n\tdisable(): void {\n\t\tthis.enabled = false;\n\t}\n\n\t/**\n\t * Check if monitoring is enabled\n\t */\n\tisEnabled(): boolean {\n\t\treturn this.enabled;\n\t}\n\n\t/**\n\t * Start a timer for an operation\n\t *\n\t * @param name - Name of the operation\n\t * @param metadata - Optional metadata to attach\n\t * @returns Function to stop the timer and record duration\n\t *\n\t * @example\n\t * const stop = monitor.startTimer('render-item', { itemId: 'item-001' });\n\t * // ... do work\n\t * stop(); // Records duration automatically\n\t */\n\tstartTimer(name: string, metadata?: Record<string, unknown>): () => void {\n\t\tif (!this.enabled) {\n\t\t\treturn () => {}; // No-op\n\t\t}\n\n\t\tconst startTime = performance.now();\n\t\tconst timerKey = `${name}:${startTime}`;\n\t\tthis.startTimes.set(timerKey, startTime);\n\n\t\treturn () => {\n\t\t\tconst endTime = performance.now();\n\t\t\tconst duration = endTime - startTime;\n\t\t\tthis.startTimes.delete(timerKey);\n\n\t\t\tthis.recordEntry({\n\t\t\t\tname,\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t\tduration,\n\t\t\t\tmetadata,\n\t\t\t});\n\t\t};\n\t}\n\n\t/**\n\t * Record a custom metric value\n\t *\n\t * @param name - Name of the metric\n\t * @param value - Numeric value\n\t * @param metadata - Optional metadata\n\t *\n\t * @example\n\t * monitor.recordMetric('item-count', 25);\n\t * monitor.recordMetric('memory-usage', process.memoryUsage().heapUsed);\n\t */\n\trecordMetric(name: string, value: number, metadata?: Record<string, unknown>): void {\n\t\tif (!this.enabled) return;\n\n\t\tthis.recordEntry({\n\t\t\tname,\n\t\t\ttimestamp: Date.now(),\n\t\t\tvalue,\n\t\t\tmetadata,\n\t\t});\n\t}\n\n\t/**\n\t * Record a performance entry\n\t */\n\tprivate recordEntry(entry: PerformanceEntry): void {\n\t\tthis.totalRecorded++;\n\n\t\t// Add to circular buffer\n\t\tif (this.entries.length >= this.maxEntries) {\n\t\t\t// Remove oldest entry\n\t\t\tthis.entries.shift();\n\n\t\t\t// Auto-export if configured\n\t\t\tif (this.autoExport && this.onExport) {\n\t\t\t\ttry {\n\t\t\t\t\tthis.onExport(this.getReport());\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (this.logWarnings) {\n\t\t\t\t\t\tconsole.warn('Performance monitor auto-export failed:', error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.entries.push(entry);\n\t}\n\n\t/**\n\t * Get performance report with statistics\n\t */\n\tgetReport(): PerformanceReport {\n\t\tconst metrics: Record<\n\t\t\tstring,\n\t\t\t{\n\t\t\t\tcount: number;\n\t\t\t\tmin: number;\n\t\t\t\tmax: number;\n\t\t\t\tavg: number;\n\t\t\t\ttotal: number;\n\t\t\t}\n\t\t> = {};\n\n\t\t// Calculate statistics for each metric\n\t\tfor (const entry of this.entries) {\n\t\t\tconst value = entry.duration ?? entry.value ?? 0;\n\n\t\t\tif (!metrics[entry.name]) {\n\t\t\t\tmetrics[entry.name] = {\n\t\t\t\t\tcount: 0,\n\t\t\t\t\tmin: Infinity,\n\t\t\t\t\tmax: -Infinity,\n\t\t\t\t\tavg: 0,\n\t\t\t\t\ttotal: 0,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst stats = metrics[entry.name];\n\t\t\tstats.count++;\n\t\t\tstats.total += value;\n\t\t\tstats.min = Math.min(stats.min, value);\n\t\t\tstats.max = Math.max(stats.max, value);\n\t\t}\n\n\t\t// Calculate averages\n\t\tfor (const stats of Object.values(metrics)) {\n\t\t\tstats.avg = stats.total / stats.count;\n\t\t}\n\n\t\treturn {\n\t\t\ttotalEntries: this.totalRecorded,\n\t\t\tstoredEntries: this.entries.length,\n\t\t\tmetrics,\n\t\t\trecentEntries: [...this.entries],\n\t\t};\n\t}\n\n\t/**\n\t * Get entries for a specific metric name\n\t */\n\tgetEntriesByName(name: string): PerformanceEntry[] {\n\t\treturn this.entries.filter((entry) => entry.name === name);\n\t}\n\n\t/**\n\t * Clear all stored entries\n\t */\n\tclear(): void {\n\t\tthis.entries = [];\n\t\tthis.totalRecorded = 0;\n\t\tthis.startTimes.clear();\n\t}\n\n\t/**\n\t * Export report as JSON string\n\t */\n\texportJSON(): string {\n\t\treturn JSON.stringify(this.getReport(), null, 2);\n\t}\n\n\t/**\n\t * Export report to console\n\t */\n\texportToConsole(): void {\n\t\tconst report = this.getReport();\n\n\t\tconsole.group('📊 Performance Report');\n\t\tconsole.log(`Total Entries: ${report.totalEntries}`);\n\t\tconsole.log(`Stored Entries: ${report.storedEntries}`);\n\t\tconsole.log('\\nMetrics:');\n\n\t\tfor (const [name, stats] of Object.entries(report.metrics)) {\n\t\t\tconsole.group(` ${name}`);\n\t\t\tconsole.log(` Count: ${stats.count}`);\n\t\t\tconsole.log(` Min: ${stats.min.toFixed(2)}ms`);\n\t\t\tconsole.log(` Max: ${stats.max.toFixed(2)}ms`);\n\t\t\tconsole.log(` Avg: ${stats.avg.toFixed(2)}ms`);\n\t\t\tconsole.log(` Total: ${stats.total.toFixed(2)}ms`);\n\t\t\tconsole.groupEnd();\n\t\t}\n\n\t\tconsole.groupEnd();\n\t}\n\n\t/**\n\t * Get performance marks for Web Performance API integration\n\t *\n\t * If using browser's Performance API, this exports entries\n\t * in a compatible format.\n\t */\n\tgetPerformanceMarks(): Array<{\n\t\tname: string;\n\t\tstartTime: number;\n\t\tduration?: number;\n\t}> {\n\t\treturn this.entries.map((entry) => ({\n\t\t\tname: entry.name,\n\t\t\tstartTime: entry.timestamp,\n\t\t\tduration: entry.duration,\n\t\t}));\n\t}\n}\n\n/**\n * Singleton instance for global performance monitoring\n *\n * Usage:\n * ```typescript\n * import { globalPerformanceMonitor } from './utils/PerformanceMonitor';\n *\n * globalPerformanceMonitor.enable();\n * const stop = globalPerformanceMonitor.startTimer('operation');\n * // ... work\n * stop();\n * ```\n */\nexport const globalPerformanceMonitor = new PerformanceMonitor({\n\tenabled: false, // Disabled by default, enable explicitly\n\tmaxEntries: 100,\n\tlogWarnings: false,\n});\n"]}
@@ -36,4 +36,3 @@ export declare function getImageDataFromResponse(fileResponse: QTIFileResponse |
36
36
  * @returns true if drawing contains content, false otherwise
37
37
  */
38
38
  export declare function analyzeDrawing(fileResponse: QTIFileResponse | null | undefined, threshold?: number): boolean;
39
- //# sourceMappingURL=drawingUtils.d.ts.map
@@ -55,3 +55,4 @@ export function analyzeDrawing(fileResponse, threshold = 50) {
55
55
  }
56
56
  return hasLine(imageData, threshold);
57
57
  }
58
+ //# sourceMappingURL=drawingUtils.js.map