@pie-qti/item-player 0.1.10 → 0.1.12

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 +1510 -1435
  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
@@ -24,4 +24,3 @@ export interface GlossaryPlayer {
24
24
  export declare function applyGlossaryTriggers(container: HTMLElement, player: GlossaryPlayer): () => void;
25
25
  export declare function cleanupGlossaryTriggers(container: HTMLElement): void;
26
26
  export {};
27
- //# sourceMappingURL=applyGlossaryTriggers.d.ts.map
@@ -306,3 +306,4 @@ function buildFallbackPopup(label, html, close) {
306
306
  setTimeout(() => closeBtn.focus(), 0);
307
307
  return popup;
308
308
  }
309
+ //# sourceMappingURL=applyGlossaryTriggers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applyGlossaryTriggers.js","sourceRoot":"","sources":["../../src/catalog/applyGlossaryTriggers.ts"],"names":[],"mappings":"AAGA,MAAM,eAAe,GAAG;IACvB,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,uBAAuB,EAAE,IAAI,EAAE,GAAG,EAAE;IACnG,EAAE,KAAK,EAAE,oBAAoB,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,4BAA4B,EAAE,IAAI,EAAE,GAAG,EAAE;IAC1G,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,sBAAsB,EAAE,IAAI,EAAE,GAAG,EAAE;IACxF,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,kBAAkB,EAAE,KAAK,EAAE,2BAA2B,EAAE,IAAI,EAAE,GAAG,EAAE;IACvG,EAAE,KAAK,EAAE,sBAAsB,EAAE,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,8BAA8B,EAAE,IAAI,EAAE,GAAG,EAAE;CACvG,CAAC;AACX,MAAM,0BAA0B,GAAG,sBAAsB,CAAC;AAC1D,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAS;IAC7C,oBAAoB;IACpB,qBAAqB;IACrB,0BAA0B;CAC1B,CAAC,CAAC;AACH,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAS,eAAe,CAAC,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,EAAE,CAAC,EAAE,CAAC,YAAY,KAAK,IAAI,CAChC,CAAC;YACF,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAAC,CAAC,CAAC,cAAc,EAAE,CAAC;gBAAC,OAAO;YAAC,CAAC;YAC3D,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;YAC3B,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAC7C,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,aAAa,KAAK,KAAK,EAAE,CAAC;gBACpD,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,IAAI,CAAC,KAAK,EAAE,CAAC;YACd,CAAC;iBAAM,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,aAAa,KAAK,IAAI,EAAE,CAAC;gBAC3D,CAAC,CAAC,cAAc,EAAE,CAAC;gBACnB,KAAK,CAAC,KAAK,EAAE,CAAC;YACf,CAAC;QACF,CAAC;IACF,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACjD,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;IAElD,6BAA6B;IAC7B,UAAU,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;IAEtC,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["import type { CatalogSupportPreference } from '../pnp/types.js';\nimport type { PnpProfile } from '../pnp/types.js';\n\nconst PLATFORM_USAGES = [\n\t{ usage: 'tts-pronunciation', flag: 'ttsPronunciation', label: 'Request pronunciation', text: 'P' },\n\t{ usage: 'signing-definition', flag: 'signingDefinition', label: 'Request signing definition', text: 'S' },\n\t{ usage: 'braille-text', flag: 'brailleText', label: 'Request braille text', text: 'B' },\n\t{ usage: 'audio-description', flag: 'audioDescription', label: 'Request audio description', text: 'A' },\n\t{ usage: 'extended-description', flag: 'extendedDescription', label: 'Request extended description', text: 'D' },\n] as const;\nconst ILLUSTRATED_GLOSSARY_USAGE = 'illustrated-glossary';\nconst BUILT_IN_POPUP_USAGES = new Set<string>([\n\t'glossary-on-screen',\n\t'keyword-translation',\n\tILLUSTRATED_GLOSSARY_USAGE,\n]);\nconst RESERVED_PLATFORM_FLAGS = new Set<string>(PLATFORM_USAGES.map((support) => support.flag));\nconst RESERVED_PLATFORM_USAGES = new Set<string>(PLATFORM_USAGES.map((support) => support.usage));\nconst SAFE_CATALOG_USAGE = /^[a-z][a-z0-9._-]*$/;\n\ninterface HostCatalogSupport {\n\tusage: string;\n\tlabel: string;\n\ttext: string;\n\tlanguageCode?: string;\n}\n\ninterface CatalogComponentRegistry {\n\tgetTagNameForType(type: string): string | null;\n}\n\nexport interface GlossaryPlayer {\n\tgetPnp(): PnpProfile | undefined;\n\tgetCatalogEntry(\n\t\tidref: string,\n\t\tusage: string,\n\t\tlang?: string,\n\t\toptions?: { stimulusIdentifier?: string }\n\t): string | null;\n\tgetComponentRegistry(): CatalogComponentRegistry;\n}\n\n/**\n * Inject glossary/keyword-translation trigger buttons into a rendered item container.\n *\n * When pnp.content.glossaryOnScreen is true, each [data-catalog-idref] element gets a\n * trigger button. Clicking the button looks up the catalog entry and shows a floating\n * popup rendered by the 'catalogPopup' component from the registry (defaults to\n * pie-qti-catalog-popup). Clicking again or pressing Escape closes it.\n *\n * For platform-level usages (tts-pronunciation, signing-definition, braille-text,\n * audio-description) the player fires a `qti-catalog-lookup` CustomEvent instead of\n * mounting a popup — the host application handles those usages.\n */\nexport function applyGlossaryTriggers(container: HTMLElement, player: GlossaryPlayer): () => void {\n\tcleanupGlossaryTriggers(container);\n\tconst pnp = player.getPnp();\n\tif (!pnp) return () => cleanupGlossaryTriggers(container);\n\n\tconst glossaryOn = pnp.content?.glossaryOnScreen === true;\n\tconst kwTranslation = pnp.content?.keywordTranslation;\n\tconst kwOn = kwTranslation?.active === true && !!kwTranslation.languageCode;\n\tconst illustratedOn = pnp.content?.illustratedGlossary === true;\n\tconst platformSupports = pnp.content?.catalogSupports ?? {};\n\tconst hostSupports = getHostCatalogSupports(platformSupports);\n\n\tconst anyPlatformOn = PLATFORM_USAGES.some((support) => isSupportActive(getPlatformSupportPreference(platformSupports, support)));\n\tif (!glossaryOn && !kwOn && !illustratedOn && !anyPlatformOn && hostSupports.length === 0) return () => cleanupGlossaryTriggers(container);\n\n\tconst terms = container.querySelectorAll<HTMLElement>('[data-catalog-idref]');\n\tif (terms.length === 0) return () => cleanupGlossaryTriggers(container);\n\n\t// Track open popup so only one is open at a time\n\tlet currentCleanup: (() => void) | null = null;\n\n\tfor (const termEl of Array.from(terms)) {\n\t\tconst idref = termEl.getAttribute('data-catalog-idref');\n\t\tif (!idref) continue;\n\t\tconst stimulusIdentifier = getStimulusIdentifier(termEl);\n\n\t\t// Wrap term in a relative-positioned span so we can position popup against it\n\t\tconst wrapper = document.createElement('span');\n\t\twrapper.className = 'qti-catalog-term';\n\t\twrapper.style.cssText = 'position:relative;display:inline';\n\n\t\ttermEl.parentNode?.insertBefore(wrapper, termEl);\n\t\twrapper.appendChild(termEl);\n\n\t\tif (glossaryOn) {\n\t\t\tconst btn = createTriggerButton(termEl.textContent ?? idref, 'glossary-on-screen', 'Show definition');\n\t\t\twrapper.appendChild(btn);\n\n\t\t\tbtn.addEventListener('click', () => {\n\t\t\t\tif (currentCleanup) {\n\t\t\t\t\tcurrentCleanup();\n\t\t\t\t\tcurrentCleanup = null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst html = player.getCatalogEntry(idref, 'glossary-on-screen', undefined, { stimulusIdentifier });\n\t\t\t\tif (html !== null) {\n\t\t\t\t\tcurrentCleanup = mountPopup(wrapper, termEl.textContent ?? idref, html, btn, player, () => {\n\t\t\t\t\t\tcurrentCleanup = null;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (kwOn) {\n\t\t\tconst lang = kwTranslation!.languageCode;\n\t\t\tconst btn = createTriggerButton(termEl.textContent ?? idref, 'keyword-translation', 'Show translation');\n\t\t\twrapper.appendChild(btn);\n\n\t\t\tbtn.addEventListener('click', () => {\n\t\t\t\tif (currentCleanup) {\n\t\t\t\t\tcurrentCleanup();\n\t\t\t\t\tcurrentCleanup = null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst html = player.getCatalogEntry(idref, 'keyword-translation', lang, { stimulusIdentifier });\n\t\t\t\tif (html !== null) {\n\t\t\t\t\tcurrentCleanup = mountPopup(wrapper, termEl.textContent ?? idref, html, btn, player, () => {\n\t\t\t\t\t\tcurrentCleanup = null;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (illustratedOn) {\n\t\t\tconst btn = createTriggerButton(termEl.textContent ?? idref, ILLUSTRATED_GLOSSARY_USAGE, 'Show illustrated glossary');\n\t\t\twrapper.appendChild(btn);\n\n\t\t\tbtn.addEventListener('click', () => {\n\t\t\t\tif (currentCleanup) {\n\t\t\t\t\tcurrentCleanup();\n\t\t\t\t\tcurrentCleanup = null;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst html = player.getCatalogEntry(idref, ILLUSTRATED_GLOSSARY_USAGE, undefined, { stimulusIdentifier });\n\t\t\t\tif (html !== null) {\n\t\t\t\t\tcurrentCleanup = mountPopup(wrapper, termEl.textContent ?? idref, html, btn, player, () => {\n\t\t\t\t\t\tcurrentCleanup = null;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tfor (const support of PLATFORM_USAGES) {\n\t\t\tconst preference = getPlatformSupportPreference(platformSupports, support);\n\t\t\tif (!isSupportActive(preference)) continue;\n\t\t\taddHostCatalogSupportButton(wrapper, termEl, idref, {\n\t\t\t\t...support,\n\t\t\t\tlanguageCode: getSupportLanguageCode(preference),\n\t\t\t}, player, stimulusIdentifier);\n\t\t}\n\n\t\tfor (const support of hostSupports) {\n\t\t\taddHostCatalogSupportButton(wrapper, termEl, idref, support, player, stimulusIdentifier);\n\t\t}\n\t}\n\n\treturn () => {\n\t\tcurrentCleanup?.();\n\t\tcleanupGlossaryTriggers(container);\n\t};\n}\n\nexport function cleanupGlossaryTriggers(container: HTMLElement): void {\n\tfor (const wrapper of Array.from(container.querySelectorAll<HTMLElement>('.qti-catalog-term'))) {\n\t\tconst term = Array.from(wrapper.children).find((child) =>\n\t\t\t(child as HTMLElement).getAttribute?.('data-catalog-idref') !== null\n\t\t) as HTMLElement | undefined;\n\t\tif (term && wrapper.parentNode) {\n\t\t\twrapper.parentNode.insertBefore(term, wrapper);\n\t\t}\n\t\twrapper.remove();\n\t}\n}\n\nfunction createTriggerButton(termText: string, usage: string, labelPrefix: string, text?: string): HTMLButtonElement {\n\tconst btn = document.createElement('button');\n\tbtn.type = 'button';\n\tbtn.className = 'qti-catalog-trigger';\n\tbtn.style.cssText =\n\t\t'display:inline-flex;align-items:center;justify-content:center;min-width:1.75rem;min-height:1.75rem;margin-inline:0.25rem;line-height:1;';\n\tbtn.setAttribute('aria-label', `${labelPrefix}: ${termText}`);\n\tbtn.setAttribute('data-catalog-usage', usage);\n\tbtn.textContent = text ?? (usage === 'keyword-translation' ? 'T' : usage === ILLUSTRATED_GLOSSARY_USAGE ? 'I' : '?');\n\treturn btn;\n}\n\nfunction addHostCatalogSupportButton(\n\twrapper: HTMLElement,\n\ttermEl: HTMLElement,\n\tidref: string,\n\tsupport: HostCatalogSupport,\n\tplayer: GlossaryPlayer,\n\tstimulusIdentifier?: string\n): void {\n\tconst html = player.getCatalogEntry(idref, support.usage, support.languageCode, { stimulusIdentifier });\n\tif (html === null) return;\n\tconst btn = createTriggerButton(termEl.textContent ?? idref, support.usage, support.label, support.text);\n\twrapper.appendChild(btn);\n\tbtn.addEventListener('click', () => {\n\t\tbtn.dispatchEvent(\n\t\t\tnew CustomEvent('qti-catalog-lookup', {\n\t\t\t\tbubbles: true,\n\t\t\t\tcomposed: true,\n\t\t\t\tdetail: { idref, usage: support.usage, html, content: html, languageCode: support.languageCode },\n\t\t\t})\n\t\t);\n\t});\n}\n\nfunction getStimulusIdentifier(termEl: HTMLElement): string | undefined {\n\tconst scopeEl = termEl.closest?.('[data-stimulus-idref]');\n\tconst identifier = scopeEl?.getAttribute?.('data-stimulus-idref')?.trim();\n\treturn identifier || undefined;\n}\n\nfunction getHostCatalogSupports(platformSupports: Record<string, CatalogSupportPreference | undefined>): HostCatalogSupport[] {\n\treturn Object.entries(platformSupports)\n\t\t.map(([usage, preference]) => ({ usage: normalizeCatalogUsage(usage), preference }))\n\t\t.filter(({ usage, preference }) => usage !== null && isSupportActive(preference) && !isReservedCatalogUsage(usage))\n\t\t.map(({ usage, preference }) => ({\n\t\t\tusage: usage!,\n\t\t\tlabel: `Request ${usage!.replace(/[-_]+/g, ' ')}`,\n\t\t\ttext: usage!.slice(0, 1).toUpperCase(),\n\t\t\tlanguageCode: getSupportLanguageCode(preference),\n\t\t}));\n}\n\nfunction getPlatformSupportPreference(\n\tplatformSupports: Record<string, CatalogSupportPreference | undefined>,\n\tsupport: (typeof PLATFORM_USAGES)[number]\n): CatalogSupportPreference | undefined {\n\treturn platformSupports[support.flag] ?? platformSupports[support.usage];\n}\n\nfunction isSupportActive(preference: CatalogSupportPreference | undefined): boolean {\n\tif (preference === undefined) return false;\n\tif (typeof preference === 'boolean') return preference;\n\treturn preference.active !== false;\n}\n\nfunction getSupportLanguageCode(preference: CatalogSupportPreference | undefined): string | undefined {\n\tif (!preference || typeof preference === 'boolean') return undefined;\n\tconst languageCode = preference.languageCode?.trim();\n\tif (!languageCode || !/^[a-zA-Z]{2,8}(?:-[a-zA-Z0-9]{1,8})*$/.test(languageCode)) return undefined;\n\treturn languageCode;\n}\n\nfunction normalizeCatalogUsage(value: string): string | null {\n\tconst usage = value.trim().toLowerCase();\n\tif (!SAFE_CATALOG_USAGE.test(usage)) return null;\n\treturn usage;\n}\n\nfunction isReservedCatalogUsage(usage: string): boolean {\n\treturn RESERVED_PLATFORM_FLAGS.has(usage) || RESERVED_PLATFORM_USAGES.has(usage) || BUILT_IN_POPUP_USAGES.has(usage);\n}\n\n/**\n * Mount a catalog popup via the component registry. Falls back to a minimal\n * vanilla-JS popup if no 'catalogPopup' component is registered (e.g. in tests\n * that don't load default-components). Returns a cleanup function.\n */\nfunction mountPopup(\n\tanchor: HTMLElement,\n\tlabel: string,\n\thtml: string,\n\ttriggerBtn: HTMLButtonElement,\n\tplayer: GlossaryPlayer,\n\tonClose: () => void\n): () => void {\n\tconst registry = player.getComponentRegistry();\n\n\tlet popupEl: HTMLElement;\n\tlet closed = false;\n\n\tfunction cleanup() {\n\t\tif (closed) return;\n\t\tclosed = true;\n\t\tpopupEl.remove();\n\t\ttriggerBtn.focus();\n\t\tonClose();\n\t}\n\n\tconst catalogPopupTag = registry.getTagNameForType('catalogPopup');\n\tif (catalogPopupTag !== null) {\n\t\tconst el = document.createElement(catalogPopupTag) as HTMLElement & {\n\t\t\tcontent: string;\n\t\t\tlabel: string;\n\t\t\tonClose: () => void;\n\t\t};\n\t\tel.content = html;\n\t\tel.label = label;\n\t\tel.onClose = cleanup;\n\t\tanchor.appendChild(el);\n\t\tpopupEl = el;\n\t} else {\n\t\t// Minimal fallback for environments without default-components\n\t\tpopupEl = buildFallbackPopup(label, html, cleanup);\n\t\tanchor.appendChild(popupEl);\n\t}\n\n\treturn cleanup;\n}\n\n/**\n * Minimal accessible fallback popup used when no catalogPopup component is registered.\n * Uses DaisyUI card classes where available; degrades gracefully without them.\n */\nfunction buildFallbackPopup(label: string, html: string, close: () => void): HTMLElement {\n\tconst popup = document.createElement('div');\n\tpopup.className = 'card card-bordered bg-base-100 shadow-lg qti-catalog-popup';\n\tpopup.setAttribute('role', 'dialog');\n\tpopup.setAttribute('aria-label', label);\n\tpopup.setAttribute('aria-modal', 'true');\n\tpopup.style.cssText = 'position:absolute;z-index:1000;min-width:16rem;max-width:24rem';\n\n\tconst header = document.createElement('div');\n\theader.className = 'card-title flex justify-between items-center px-3 py-2 border-b border-base-300 bg-base-200';\n\n\tconst title = document.createElement('span');\n\ttitle.className = 'text-sm font-semibold';\n\ttitle.textContent = label;\n\n\tconst closeBtn = document.createElement('button');\n\tcloseBtn.type = 'button';\n\tcloseBtn.className = 'btn btn-ghost btn-xs';\n\tcloseBtn.setAttribute('aria-label', 'Close');\n\tcloseBtn.textContent = '✕';\n\n\theader.appendChild(title);\n\theader.appendChild(closeBtn);\n\n\tconst body = document.createElement('div');\n\tbody.className = 'card-body p-3';\n\n\tconst isUrl = /^(https?:\\/\\/|\\/)/i.test(html.trim());\n\tif (isUrl) {\n\t\tconst img = document.createElement('img');\n\t\timg.src = html.trim();\n\t\timg.alt = label;\n\t\timg.className = 'max-w-full h-auto block mx-auto';\n\t\tbody.appendChild(img);\n\t} else {\n\t\tbody.innerHTML = html;\n\t}\n\n\tpopup.appendChild(header);\n\tpopup.appendChild(body);\n\n\t// Focus trap + Escape\n\tconst focusableSelector = 'a[href], button:not([disabled]), input:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\n\tfunction handleKeyDown(e: KeyboardEvent) {\n\t\tif (e.key === 'Escape') {\n\t\t\te.preventDefault();\n\t\t\tcloseBtn.click();\n\t\t\treturn;\n\t\t}\n\t\tif (e.key === 'Tab') {\n\t\t\tconst focusable = Array.from(popup.querySelectorAll<HTMLElement>(focusableSelector)).filter(\n\t\t\t\t(el) => el.offsetParent !== null\n\t\t\t);\n\t\t\tif (focusable.length === 0) { e.preventDefault(); return; }\n\t\t\tconst first = focusable[0];\n\t\t\tconst last = focusable[focusable.length - 1];\n\t\t\tif (e.shiftKey && document.activeElement === first) {\n\t\t\t\te.preventDefault();\n\t\t\t\tlast.focus();\n\t\t\t} else if (!e.shiftKey && document.activeElement === last) {\n\t\t\t\te.preventDefault();\n\t\t\t\tfirst.focus();\n\t\t\t}\n\t\t}\n\t}\n\n\tpopup.addEventListener('keydown', handleKeyDown);\n\tcloseBtn.addEventListener('click', () => close());\n\n\t// Move focus in on next tick\n\tsetTimeout(() => closeBtn.focus(), 0);\n\n\treturn popup;\n}\n"]}
@@ -15,4 +15,3 @@ export declare function extractCatalogFromItemXml(itemXml: string): CatalogIndex
15
15
  * Merge two CatalogIndex maps. itemLevel entries win on collision (same identifier).
16
16
  */
17
17
  export declare function mergeCatalogs(base: CatalogIndex, override: CatalogIndex): CatalogIndex;
18
- //# sourceMappingURL=catalogExtractor.d.ts.map
@@ -112,3 +112,4 @@ function extractHtmlContent(el) {
112
112
  return fileHref.getAttribute('src') ?? fileHref.text?.trim() ?? '';
113
113
  return '';
114
114
  }
115
+ //# sourceMappingURL=catalogExtractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalogExtractor.js","sourceRoot":"","sources":["../../src/catalog/catalogExtractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAItD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW;IACzC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;QAAE,OAAO,IAAI,GAAG,EAAE,CAAC;IAElC,MAAM,GAAG,GAAG,SAAS,CAAC,SAAS,GAAG,SAAS,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;IAEzE,+CAA+C;IAC/C,MAAM,MAAM,GAAG,GAAG,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACrD,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,GAAG,EAAE,CAAC;IAE9B,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAe;IACxD,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,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O,CAAC,OAAO,CAAC;gBACtB,IAAI,EAAE,kBAAkB,CAAC,OAAO,CAAC;aACjC,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,IAAI,aAAa,EAAE,CAAC;QACnB,OAAO,CAAC,IAAI,CAAC;YACZ,KAAK,EAAE,aAAa;YACpB,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC;YACrB,IAAI,EAAE,kBAAkB,CAAC,MAAM,CAAC;SAChC,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,SAAS,OAAO,CAAC,EAAc;IAC9B,OAAO,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC;AAC1G,CAAC;AAED,SAAS,kBAAkB,CAAC,EAAc;IACzC,MAAM,WAAW,GAAG,EAAE,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,EAAE,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;IAEnD,IAAI,WAAW;QAAE,OAAO,WAAW,CAAC,SAAS,IAAI,WAAW,CAAC,IAAI,IAAI,EAAE,CAAC;IACxE,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACjF,OAAO,EAAE,CAAC;AACX,CAAC","sourcesContent":["import { parse as parseHtml } from 'node-html-parser';\nimport type { HTMLElement as NhpElement } from 'node-html-parser';\nimport type { CatalogCard, CatalogEntry, CatalogIndex } from './types.js';\n\n/**\n * Parse an XML string containing a QTI 3.0 <qti-catalog-info> element into a CatalogIndex.\n *\n * The mapper is not needed here because we parse the QTI 3.0 element names directly.\n * All element names use lower-case matching (node-html-parser normalises tags).\n */\nexport function extractCatalog(xml: string): CatalogIndex {\n\tif (!xml.trim()) return new Map();\n\n\tconst doc = parseHtml(`<root>${xml}</root>`, { lowerCaseTagName: true });\n\n\t// Find <qti-catalog-info> (QTI 3.0 kebab form)\n\tconst infoEl = doc.querySelector('qti-catalog-info');\n\tif (!infoEl) return new Map();\n\n\treturn buildIndex(infoEl);\n}\n\n/**\n * Parse a raw QTI item XML string and extract the embedded catalog.\n * Used by Player when integrating with the full item XML.\n */\nexport function extractCatalogFromItemXml(itemXml: string): CatalogIndex {\n\tconst doc = parseHtml(itemXml, { lowerCaseTagName: true });\n\tconst infoEl = doc.querySelector('qti-catalog-info');\n\tif (!infoEl) return new Map();\n\treturn buildIndex(infoEl);\n}\n\n/**\n * Merge two CatalogIndex maps. itemLevel entries win on collision (same identifier).\n */\nexport function mergeCatalogs(base: CatalogIndex, override: CatalogIndex): CatalogIndex {\n\tconst merged: CatalogIndex = new Map(base);\n\tfor (const [id, card] of override) {\n\t\tmerged.set(id, card);\n\t}\n\treturn merged;\n}\n\n// ---------------------------------------------------------------------------\n// Internal\n// ---------------------------------------------------------------------------\n\nfunction buildIndex(infoEl: NhpElement): CatalogIndex {\n\tconst index: CatalogIndex = new Map();\n\n\tfor (const catalogEl of infoEl.querySelectorAll('qti-catalog')) {\n\t\tconst identifier = catalogEl.getAttribute('id') ?? catalogEl.getAttribute('identifier');\n\t\tif (!identifier) continue;\n\n\t\tconst entries: CatalogEntry[] = [];\n\t\tfor (const cardEl of catalogEl.querySelectorAll('qti-card')) {\n\t\t\tconst cardUsage = cardEl.getAttribute('support') ?? cardEl.getAttribute('usage');\n\t\t\tfor (const entry of extractCardEntries(cardEl, cardUsage ?? undefined)) {\n\t\t\t\tentries.push(entry);\n\t\t\t}\n\t\t}\n\n\t\tif (entries.length > 0) {\n\t\t\tindex.set(identifier, { entries });\n\t\t}\n\t}\n\n\tfor (const cardEl of infoEl.querySelectorAll('qti-card')) {\n\t\tconst identifier = cardEl.getAttribute('identifier');\n\t\tif (!identifier) continue;\n\n\t\tconst entries = extractCardEntries(cardEl);\n\n\t\tif (entries.length > 0) {\n\t\t\tconst existing = index.get(identifier);\n\t\t\tif (existing) {\n\t\t\t\texisting.entries.push(...entries);\n\t\t\t} else {\n\t\t\t\tindex.set(identifier, { entries });\n\t\t\t}\n\t\t}\n\t}\n\n\treturn index;\n}\n\nfunction extractCardEntries(cardEl: NhpElement, fallbackUsage?: string): CatalogEntry[] {\n\tconst explicitEntries = cardEl.querySelectorAll('qti-card-entry');\n\tconst entries: CatalogEntry[] = [];\n\n\tif (explicitEntries.length > 0) {\n\t\tfor (const entryEl of explicitEntries) {\n\t\t\tconst usage =\n\t\t\t\tentryEl.getAttribute('usage') ??\n\t\t\t\tentryEl.getAttribute('data-reading-type') ??\n\t\t\t\tfallbackUsage;\n\t\t\tif (!usage) continue;\n\t\t\tentries.push({\n\t\t\t\tusage,\n\t\t\t\tlang: getLang(entryEl),\n\t\t\t\thtml: extractHtmlContent(entryEl),\n\t\t\t});\n\t\t}\n\t\treturn entries;\n\t}\n\n\tif (fallbackUsage) {\n\t\tentries.push({\n\t\t\tusage: fallbackUsage,\n\t\t\tlang: getLang(cardEl),\n\t\t\thtml: extractHtmlContent(cardEl),\n\t\t});\n\t}\n\n\treturn entries;\n}\n\nfunction getLang(el: NhpElement): string | undefined {\n\treturn el.getAttribute('xml:lang') ?? el.getAttribute('xmllang') ?? el.getAttribute('lang') ?? undefined;\n}\n\nfunction extractHtmlContent(el: NhpElement): string {\n\tconst htmlContent = el.querySelector('qti-html-content');\n\tconst fileHref = el.querySelector('qti-file-href');\n\n\tif (htmlContent) return htmlContent.innerHTML ?? htmlContent.text ?? '';\n\tif (fileHref) return fileHref.getAttribute('src') ?? fileHref.text?.trim() ?? '';\n\treturn '';\n}\n"]}
@@ -15,4 +15,3 @@ import type { CatalogIndex } from './types.js';
15
15
  * @returns The matched entry's html string, or null if nothing found
16
16
  */
17
17
  export declare function getCatalogEntry(index: CatalogIndex, idref: string, usage: string, lang?: string): string | null;
18
- //# sourceMappingURL=catalogLookup.d.ts.map
@@ -42,3 +42,4 @@ export function getCatalogEntry(index, idref, usage, lang) {
42
42
  return candidates[0].html;
43
43
  return null;
44
44
  }
45
+ //# sourceMappingURL=catalogLookup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalogLookup.js","sourceRoot":"","sources":["../../src/catalog/catalogLookup.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAC9B,KAAmB,EACnB,KAAa,EACb,KAAa,EACb,IAAa;IAEb,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;IACjE,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzC,0BAA0B;IAC1B,IAAI,IAAI,EAAE,CAAC;QACV,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QACtD,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC,IAAI,CAAC;QAE7B,qEAAqE;QACrE,+CAA+C;QAC/C,kEAAkE;QAClE,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAClC,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAClC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CACxG,CAAC;QACF,IAAI,WAAW;YAAE,OAAO,WAAW,CAAC,IAAI,CAAC;IAC1C,CAAC;IAED,uDAAuD;IACvD,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC/C,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC;IAE/B,iFAAiF;IACjF,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAEvD,OAAO,IAAI,CAAC;AACb,CAAC","sourcesContent":["import type { CatalogIndex } from './types.js';\n\n/**\n * Look up a catalog entry by card identifier, usage type, and optional language.\n *\n * Language fallback order (mirrors APIP 1.0 / HTTP Accept-Language conventions):\n * 1. Exact lang match (e.g. 'en-US')\n * 2. Language-prefix match (e.g. 'en' matches entry with lang 'en-US')\n * 3. Entry with no lang specified (universal fallback)\n * 4. null — no match found\n *\n * @param index CatalogIndex built by extractCatalog / extractCatalogFromItemXml\n * @param idref The data-catalog-idref value (maps to qti-card identifier)\n * @param usage Catalog usage type (e.g. 'glossary-on-screen')\n * @param lang Optional preferred language code (e.g. 'en-US', 'es')\n * @returns The matched entry's html string, or null if nothing found\n */\nexport function getCatalogEntry(\n\tindex: CatalogIndex,\n\tidref: string,\n\tusage: string,\n\tlang?: string\n): string | null {\n\tconst card = index.get(idref);\n\tif (!card) return null;\n\n\tconst candidates = card.entries.filter((e) => e.usage === usage);\n\tif (candidates.length === 0) return null;\n\n\t// 1. Exact language match\n\tif (lang) {\n\t\tconst exact = candidates.find((e) => e.lang === lang);\n\t\tif (exact) return exact.html;\n\n\t\t// 2. Language-prefix match: requested lang prefix matches entry lang\n\t\t// e.g. lang='en' matches entry.lang='en-US'\n\t\t// e.g. lang='en-US' matches entry.lang='en' (broader fallback)\n\t\tconst prefix = lang.split('-')[0];\n\t\tconst prefixMatch = candidates.find(\n\t\t\t(e) => e.lang && (e.lang === prefix || e.lang.startsWith(`${prefix}-`) || lang.startsWith(`${e.lang}-`))\n\t\t);\n\t\tif (prefixMatch) return prefixMatch.html;\n\t}\n\n\t// 3. No-lang fallback (entry without a lang attribute)\n\tconst noLang = candidates.find((e) => !e.lang);\n\tif (noLang) return noLang.html;\n\n\t// 4. If we get here and there's only one candidate, return it regardless of lang\n\tif (candidates.length === 1) return candidates[0].html;\n\n\treturn null;\n}\n"]}
@@ -16,4 +16,3 @@ export declare function glossaryAction(node: HTMLElement, params: GlossaryAction
16
16
  update(newParams: GlossaryActionParams): void;
17
17
  destroy(): void;
18
18
  };
19
- //# sourceMappingURL=glossaryAction.d.ts.map
@@ -29,3 +29,4 @@ export function glossaryAction(node, params) {
29
29
  },
30
30
  };
31
31
  }
32
+ //# sourceMappingURL=glossaryAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glossaryAction.js","sourceRoot":"","sources":["../../src/catalog/glossaryAction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAuB,MAAM,4BAA4B,CAAC;AAQxF;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,IAAiB,EAAE,MAA4B;IAC7E,IAAI,OAAO,GAAG,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACzD,IAAI,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE;QACrD,OAAO,EAAE,CAAC;QACV,OAAO,GAAG,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAEjB,OAAO;QACN,MAAM,CAAC,SAA+B;YACrC,OAAO,EAAE,CAAC;YACV,cAAc,EAAE,CAAC;YACjB,OAAO,GAAG,qBAAqB,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;YACxD,cAAc,GAAG,SAAS,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE;gBACpD,OAAO,EAAE,CAAC;gBACV,OAAO,GAAG,qBAAqB,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;YACzD,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,OAAO;YACN,cAAc,EAAE,CAAC;YACjB,OAAO,EAAE,CAAC;QACX,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["import { applyGlossaryTriggers, type GlossaryPlayer } from './applyGlossaryTriggers.js';\n\nexport interface GlossaryActionParams {\n\tplayer: GlossaryPlayer & {\n\t\tonPnpChange?: (listener: () => void) => () => void;\n\t};\n}\n\n/**\n * Svelte action that reactively applies glossary trigger buttons to\n * [data-catalog-idref] elements in the rendered item body.\n *\n * Applied to the .qti-item-body container. When the player changes (new item\n * loaded), Svelte calls update() after {@html} has replaced the DOM content,\n * so the walk always runs on fresh markup.\n */\nexport function glossaryAction(node: HTMLElement, params: GlossaryActionParams) {\n\tlet cleanup = applyGlossaryTriggers(node, params.player);\n\tlet unsubscribePnp = params.player.onPnpChange?.(() => {\n\t\tcleanup();\n\t\tcleanup = applyGlossaryTriggers(node, params.player);\n\t}) ?? (() => {});\n\n\treturn {\n\t\tupdate(newParams: GlossaryActionParams) {\n\t\t\tcleanup();\n\t\t\tunsubscribePnp();\n\t\t\tcleanup = applyGlossaryTriggers(node, newParams.player);\n\t\t\tunsubscribePnp = newParams.player.onPnpChange?.(() => {\n\t\t\t\tcleanup();\n\t\t\t\tcleanup = applyGlossaryTriggers(node, newParams.player);\n\t\t\t}) ?? (() => {});\n\t\t},\n\t\tdestroy() {\n\t\t\tunsubscribePnp();\n\t\t\tcleanup();\n\t\t},\n\t};\n}\n"]}
@@ -23,4 +23,3 @@ export interface CatalogEntry {
23
23
  */
24
24
  html: string;
25
25
  }
26
- //# sourceMappingURL=types.d.ts.map
@@ -4,3 +4,4 @@
4
4
  * Cards hold multiple CatalogEntry records, one per usage/language combination.
5
5
  */
6
6
  export {};
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/catalog/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG","sourcesContent":["/**\n * QTI 3.0 §6.3 Catalog types.\n * A CatalogIndex maps card identifiers to their CatalogCard.\n * Cards hold multiple CatalogEntry records, one per usage/language combination.\n */\n\nexport type CatalogIndex = Map<string, CatalogCard>;\n\nexport interface CatalogCard {\n\tentries: CatalogEntry[];\n}\n\nexport interface CatalogEntry {\n\t/**\n\t * QTI 3.0 catalog usage type.\n\t * The 8 standard types are listed below; additional string values are accepted\n\t * for forward-compatibility and host-defined extensions.\n\t */\n\tusage:\n\t\t| 'glossary-on-screen'\n\t\t| 'keyword-translation'\n\t\t| 'illustrated-glossary'\n\t\t| 'tts-pronunciation'\n\t\t| 'signing-definition'\n\t\t| 'braille-text'\n\t\t| 'audio-description'\n\t\t| 'extended-description'\n\t\t| string;\n\t/** xml:lang value (e.g. 'en-US', 'es'). Undefined when no language is specified. */\n\tlang?: string;\n\t/**\n\t * Inner HTML from <qti-html-content>, or the src URL from <qti-file-href>.\n\t * For illustrated-glossary entries the player checks whether this looks like a URL\n\t * and renders an <img> instead of innerHTML.\n\t */\n\thtml: string;\n}\n"]}
@@ -21,4 +21,3 @@ export declare function typesetAction(node: HTMLElement, params: TypesetActionPa
21
21
  update(next: TypesetActionParams): void;
22
22
  destroy(): void;
23
23
  };
24
- //# sourceMappingURL=typesetAction.d.ts.map
@@ -57,3 +57,4 @@ export function typesetAction(node, params) {
57
57
  },
58
58
  };
59
59
  }
60
+ //# sourceMappingURL=typesetAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typesetAction.js","sourceRoot":"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B,QAAQ,EAAE,UAAU,EAAE,CAAC;QACvB,QAAQ,GAAG,IAAI,CAAC;IACjB,CAAC,CAAC;IAEF,UAAU;IACV,QAAQ,EAAE,CAAC;IACX,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK;QAAE,aAAa,EAAE,CAAC;IAE/C,OAAO;QACN,MAAM,CAAC,IAAyB;YAC/B,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK;gBAAE,YAAY,EAAE,CAAC;;gBACzC,aAAa,EAAE,CAAC;YACrB,QAAQ,EAAE,CAAC;QACZ,CAAC;QACD,OAAO;YACN,QAAQ,GAAG,IAAI,CAAC;YAChB,YAAY,EAAE,CAAC;QAChB,CAAC;KACD,CAAC;AACH,CAAC","sourcesContent":["export interface TypesetActionParams {\n\t/**\n\t * Typeset function provided by the host app (KaTeX, MathJax, etc).\n\t * It should be idempotent or at least safe to call repeatedly on updates.\n\t * Optional - if not provided, the action is a no-op.\n\t */\n\ttypeset?: (root: HTMLElement) => void | Promise<void>;\n\n\t/**\n\t * Observe subtree changes and re-typeset automatically.\n\t * Default: true\n\t */\n\tobserve?: boolean;\n}\n\n/**\n * Generic Svelte action that calls `params.typeset(node)` initially and on DOM updates.\n *\n * This is intentionally dependency-free so the player/components can be used\n * outside the example app without pulling in a math engine.\n */\nexport function typesetAction(node: HTMLElement, params: TypesetActionParams) {\n\tconst isBrowser = typeof window !== 'undefined' && typeof MutationObserver !== 'undefined';\n\tif (!isBrowser) return { update() {}, destroy() {} };\n\n\tlet disposed = false;\n\tlet scheduled = false;\n\tlet observer: MutationObserver | null = null;\n\tlet current = params;\n\n\tconst schedule = () => {\n\t\tif (disposed || scheduled || !current.typeset) return;\n\t\tscheduled = true;\n\t\trequestAnimationFrame(async () => {\n\t\t\tscheduled = false;\n\t\t\tif (disposed || !current.typeset) return;\n\t\t\ttry {\n\t\t\t\tawait current.typeset(node);\n\t\t\t} catch {\n\t\t\t\t// ignore typesetting errors; keep raw text\n\t\t\t}\n\t\t});\n\t};\n\n\tconst startObserver = () => {\n\t\tif (observer) return;\n\t\tobserver = new MutationObserver(() => schedule());\n\t\tobserver.observe(node, { childList: true, subtree: true, characterData: true });\n\t};\n\n\tconst stopObserver = () => {\n\t\tobserver?.disconnect();\n\t\tobserver = null;\n\t};\n\n\t// initial\n\tschedule();\n\tif (current.observe !== false) startObserver();\n\n\treturn {\n\t\tupdate(next: TypesetActionParams) {\n\t\t\tcurrent = next;\n\t\t\tif (current.observe === false) stopObserver();\n\t\t\telse startObserver();\n\t\t\tschedule();\n\t\t},\n\t\tdestroy() {\n\t\t\tdisposed = true;\n\t\t\tstopObserver();\n\t\t},\n\t};\n}\n\n\n"]}
@@ -70,4 +70,3 @@ export interface ProcessFeedbackInlineOptions {
70
70
  * ```
71
71
  */
72
72
  export declare function processFeedbackInline(html: string, options: ProcessFeedbackInlineOptions): string;
73
- //# sourceMappingURL=feedbackUtils.d.ts.map
@@ -91,3 +91,4 @@ export function processFeedbackInline(html, options) {
91
91
  return content;
92
92
  });
93
93
  }
94
+ //# sourceMappingURL=feedbackUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feedbackUtils.js","sourceRoot":"","sources":["../../../src/components/utils/feedbackUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAYH;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAwB;IAC/D,sEAAsE;IACtE,EAAE,OAAO,EAAE,gCAAgC,EAAE,WAAW,EAAE,6BAA6B,EAAE;IACzF,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE;IAEtD,oEAAoE;IACpE,EAAE,OAAO,EAAE,8BAA8B,EAAE,WAAW,EAAE,2BAA2B,EAAE;IACrF,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE;CAClD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAChC,OAAe,EACf,aAAkC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AE,CAAC,CAAC;QAE3F,4CAA4C;QAC5C,IAAI,eAAe,EAAE,CAAC;YACrB,OAAO,GAAG,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAClD,CAAC;QAED,oCAAoC;QACpC,IAAI,YAAY,EAAE,CAAC;YAClB,OAAO,sCAAsC,OAAO,SAAS,CAAC;QAC/D,CAAC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC,CACD,CAAC;AACH,CAAC","sourcesContent":["/**\n * Feedback text utilities for QTI items\n *\n * NOTE: The cleanFeedbackText function contains vendor-specific transforms\n * for content that uses semicolons after \"Correct\" and \"Incorrect\" labels.\n * This is common in some QTI authoring tools but not part of the QTI specification.\n *\n * To customize this behavior for your vendor's content, you can:\n * 1. Modify the patterns in this file\n * 2. Create a vendor-specific transform plugin (see VENDOR-TRANSFORM-PLUGIN-GUIDE.md)\n * 3. Pass custom transforms via the feedbackTransforms option\n */\n\n/**\n * Text pattern replacement for feedback content\n */\nexport interface FeedbackTransform {\n\t/** Regular expression to match the pattern */\n\tpattern: RegExp;\n\t/** Replacement string (can use capture groups like $1, $2) */\n\treplacement: string;\n}\n\n/**\n * Default feedback text transforms\n * These are vendor-specific patterns commonly found in certain QTI authoring tools\n */\nexport const DEFAULT_FEEDBACK_TRANSFORMS: FeedbackTransform[] = [\n\t// Remove semicolons after \"Incorrect\" (with or without <strong> tags)\n\t{ pattern: /<strong>Incorrect;<\\/strong>/gi, replacement: '<strong>Incorrect</strong> ' },\n\t{ pattern: /Incorrect;/gi, replacement: 'Incorrect ' },\n\n\t// Remove semicolons after \"Correct\" (with or without <strong> tags)\n\t{ pattern: /<strong>Correct;<\\/strong>/gi, replacement: '<strong>Correct</strong> ' },\n\t{ pattern: /Correct;/gi, replacement: 'Correct ' },\n];\n\n/**\n * Clean up feedback text formatting using configurable transforms\n *\n * @param content - The feedback content HTML string\n * @param transforms - Optional custom transforms (defaults to DEFAULT_FEEDBACK_TRANSFORMS)\n * @returns Cleaned feedback content\n */\nexport function cleanFeedbackText(\n\tcontent: string,\n\ttransforms: FeedbackTransform[] = DEFAULT_FEEDBACK_TRANSFORMS\n): string {\n\tif (!content) return content;\n\n\tlet result = content;\n\tfor (const transform of transforms) {\n\t\tresult = result.replace(transform.pattern, transform.replacement);\n\t}\n\n\treturn result;\n}\n\n/**\n * Default outcome identifier for feedback display\n * This can be overridden if your QTI content uses a different identifier\n */\nexport const DEFAULT_FEEDBACK_OUTCOME_ID = 'FEEDBACK';\n\n/**\n * Options for processing feedbackInline elements\n */\nexport interface ProcessFeedbackInlineOptions {\n\t/** Outcome values from response processing */\n\toutcomeValues: Record<string, any>;\n\t/** Whether to apply feedback text cleaning heuristics */\n\tapplyHeuristics?: boolean;\n\t/** Whether to wrap feedback content with qti-feedback-inline span */\n\twrapWithSpan?: boolean;\n\t/** Custom feedback transforms (defaults to DEFAULT_FEEDBACK_TRANSFORMS) */\n\ttransforms?: FeedbackTransform[];\n}\n\n/**\n * Process feedbackInline elements in QTI content\n *\n * Conditionally shows/hides feedback based on outcome values and the showHide attribute.\n * Optionally applies text cleaning heuristics and wraps content with styling span.\n *\n * @param html - The HTML content containing feedbackInline elements\n * @param options - Processing options\n * @returns Modified HTML with processed feedbackInline elements\n *\n * @example\n * ```typescript\n * const html = processFeedbackInline(content, {\n * outcomeValues: { FEEDBACK: 'choiceA' },\n * applyHeuristics: true,\n * wrapWithSpan: true\n * });\n * ```\n */\nexport function processFeedbackInline(\n\thtml: string,\n\toptions: ProcessFeedbackInlineOptions\n): string {\n\tconst { outcomeValues, applyHeuristics = false, wrapWithSpan = false, transforms } = options;\n\n\tif (!html) return html;\n\n\treturn html.replace(\n\t\t/<feedbackInline[^>]*outcomeIdentifier=\"([^\"]+)\"[^>]*identifier=\"([^\"]+)\"[^>]*showHide=\"([^\"]+)\"[^>]*>([\\s\\S]*?)<\\/feedbackInline>/gi,\n\t\t(match, outcomeId, feedbackId, showHide) => {\n\t\t\tconst outcomeValue = outcomeValues[outcomeId];\n\n\t\t\t// If outcome value is not set (undefined, null, empty string), hide feedback\n\t\t\tif (outcomeValue === undefined || outcomeValue === null || outcomeValue === '') {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\t// Determine if feedback should be shown based on showHide attribute\n\t\t\tconst shouldShow =\n\t\t\t\tshowHide.toLowerCase() === 'show'\n\t\t\t\t\t? outcomeValue === feedbackId\n\t\t\t\t\t: outcomeValue !== feedbackId;\n\n\t\t\tif (!shouldShow) return '';\n\n\t\t\t// Extract content from feedbackInline tags\n\t\t\tlet content = match.replace(/<feedbackInline[^>]*>/, '').replace(/<\\/feedbackInline>/, '');\n\n\t\t\t// Apply text cleaning heuristics if enabled\n\t\t\tif (applyHeuristics) {\n\t\t\t\tcontent = cleanFeedbackText(content, transforms);\n\t\t\t}\n\n\t\t\t// Wrap with styling span if enabled\n\t\t\tif (wrapWithSpan) {\n\t\t\t\treturn ` <span class=\"qti-feedback-inline\">${content}</span>`;\n\t\t\t}\n\n\t\t\treturn content;\n\t\t}\n\t);\n}\n"]}
@@ -2,4 +2,3 @@
2
2
  * Utilities for QTI item component rendering
3
3
  */
4
4
  export { cleanFeedbackText, processFeedbackInline, DEFAULT_FEEDBACK_OUTCOME_ID, DEFAULT_FEEDBACK_TRANSFORMS, type FeedbackTransform, type ProcessFeedbackInlineOptions, } from './feedbackUtils.js';
5
- //# sourceMappingURL=index.d.ts.map
@@ -2,3 +2,4 @@
2
2
  * Utilities for QTI item component rendering
3
3
  */
4
4
  export { cleanFeedbackText, processFeedbackInline, DEFAULT_FEEDBACK_OUTCOME_ID, DEFAULT_FEEDBACK_TRANSFORMS, } from './feedbackUtils.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,2BAA2B,GAG3B,MAAM,oBAAoB,CAAC","sourcesContent":["/**\n * Utilities for QTI item component rendering\n */\n\nexport {\n\tcleanFeedbackText,\n\tprocessFeedbackInline,\n\tDEFAULT_FEEDBACK_OUTCOME_ID,\n\tDEFAULT_FEEDBACK_TRANSFORMS,\n\ttype FeedbackTransform,\n\ttype ProcessFeedbackInlineOptions,\n} from './feedbackUtils.js';\n"]}
@@ -14,4 +14,3 @@ export declare function buildEffectiveStimulusContent(deliveryContext: ResolvedI
14
14
  * delivery-context order so undocked package content is still visible.
15
15
  */
16
16
  export declare function injectStimulusContent(itemBodyHtml: string, stimulusContent: Record<string, string>): string;
17
- //# sourceMappingURL=stimulusRender.d.ts.map
@@ -68,3 +68,4 @@ function escapeHtmlAttribute(value) {
68
68
  .replace(/</g, '&lt;')
69
69
  .replace(/>/g, '&gt;');
70
70
  }
71
+ //# sourceMappingURL=stimulusRender.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stimulusRender.js","sourceRoot":"","sources":["../../../src/components/utils/stimulusRender.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAC5C,eAAwD,EACxD,uBAA+C,EAC/C,QAA2B;IAE3B,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAClC,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,EAAE,CAAC;QAC9E,UAAU;QACV,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;KAC3B,CAAC,CACF,CAAC;IACF,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAClC,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CACvG,CAAC;IACF,OAAO,EAAE,GAA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CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC;AAC/F,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAa;IACzC,OAAO,KAAK;SACV,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACzB,CAAC","sourcesContent":["import type { ResolvedItemDeliveryContext } from '@pie-qti/ims-cp-core';\n\nexport type StimulusSanitizer = (html: string) => string;\n\n/**\n * Build the effective stimulus content map for an item render.\n *\n * Resolved delivery-context content is the package/assessment source of truth.\n * Explicit content remains as a compatibility override for older host wiring.\n */\nexport function buildEffectiveStimulusContent(\n\tdeliveryContext: ResolvedItemDeliveryContext | undefined,\n\texplicitStimulusContent: Record<string, string>,\n\tsanitize: StimulusSanitizer\n): Record<string, string> {\n\tconst resolved = Object.fromEntries(\n\t\tObject.entries(deliveryContext?.stimuli ?? {}).map(([identifier, stimulus]) => [\n\t\t\tidentifier,\n\t\t\tsanitize(stimulus.bodyHtml),\n\t\t])\n\t);\n\tconst explicit = Object.fromEntries(\n\t\tObject.entries(explicitStimulusContent).map(([identifier, content]) => [identifier, sanitize(content)])\n\t);\n\treturn { ...resolved, ...explicit };\n}\n\n/**\n * Inject shared stimulus bodies at QTI refs or host-authored docking points.\n *\n * Any resolved stimulus that has no matching docking point is prepended in\n * delivery-context order so undocked package content is still visible.\n */\nexport function injectStimulusContent(itemBodyHtml: string, stimulusContent: Record<string, string>): string {\n\tif (Object.keys(stimulusContent).length === 0) return itemBodyHtml;\n\n\tconst docked = new Set<string>();\n\tlet html = itemBodyHtml.replace(\n\t\t/<([a-z][\\w:-]*)([^>]*\\bdata-stimulus-idref=([\"'])([^\"']+)\\3[^>]*)>\\s*<\\/\\1>/gi,\n\t\t(match, tagName, attrs, _quote, identifier) => {\n\t\t\tconst content = stimulusContent[identifier];\n\t\t\tif (!content) return match;\n\t\t\tdocked.add(identifier);\n\t\t\treturn `<${tagName}${mergeClassAttribute(attrs, 'qti-stimulus-dock')}>${content}</${tagName}>`;\n\t\t}\n\t);\n\n\thtml = html.replace(\n\t\t/<qti-assessment-stimulus-ref\\b([^>]*)\\/?>\\s*(?:<\\/qti-assessment-stimulus-ref>)?/gi,\n\t\t(match, attrs) => {\n\t\t\tconst identifier = extractAttribute(attrs, 'identifier');\n\t\t\tif (!identifier) return match;\n\t\t\tif (docked.has(identifier)) return '';\n\t\t\tconst content = stimulusContent[identifier];\n\t\t\tif (!content) return match;\n\t\t\tdocked.add(identifier);\n\t\t\treturn `<div data-stimulus-idref=\"${escapeHtmlAttribute(identifier)}\" class=\"qti-stimulus-dock\">${content}</div>`;\n\t\t}\n\t);\n\n\tconst undocked = Object.entries(stimulusContent)\n\t\t.filter(([identifier]) => !docked.has(identifier))\n\t\t.map(\n\t\t\t([identifier, content]) =>\n\t\t\t\t`<div data-stimulus-idref=\"${escapeHtmlAttribute(identifier)}\" class=\"qti-stimulus-block\">${content}</div>`\n\t\t)\n\t\t.join('');\n\n\treturn undocked ? undocked + html : html;\n}\n\nfunction extractAttribute(attrs: string, name: string): string | null {\n\tconst match = attrs.match(new RegExp(`\\\\b${name}\\\\s*=\\\\s*[\"']([^\"']+)[\"']`, 'i'));\n\treturn match?.[1] ?? null;\n}\n\nfunction mergeClassAttribute(attrs: string, className: string): string {\n\tconst classMatch = attrs.match(/\\bclass\\s*=\\s*([\"'])([^\"']*)\\1/i);\n\tif (!classMatch) return `${attrs} class=\"${className}\"`;\n\tconst quote = classMatch[1]!;\n\tconst existing = classMatch[2] ?? '';\n\tconst classes = new Set(existing.split(/\\s+/).filter(Boolean));\n\tclasses.add(className);\n\treturn attrs.replace(classMatch[0], `class=${quote}${Array.from(classes).join(' ')}${quote}`);\n}\n\nfunction escapeHtmlAttribute(value: string): string {\n\treturn value\n\t\t.replace(/&/g, '&amp;')\n\t\t.replace(/\"/g, '&quot;')\n\t\t.replace(/</g, '&lt;')\n\t\t.replace(/>/g, '&gt;');\n}\n"]}
@@ -1,4 +1,3 @@
1
1
  import type { ResolvedItemDeliveryContext } from '@pie-qti/ims-cp-core';
2
2
  export declare function buildScopedStylesheetCss(deliveryContext: ResolvedItemDeliveryContext | undefined, scopeSelector?: string): string;
3
3
  export declare function scopeCssRules(css: string, scopeSelector?: string): string;
4
- //# sourceMappingURL=stylesheetRender.d.ts.map
@@ -55,3 +55,4 @@ function scopeSelectorText(selector, scopeSelector) {
55
55
  function escapeCssString(value) {
56
56
  return value.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n|\r|\f/g, ' ');
57
57
  }
58
+ //# sourceMappingURL=stylesheetRender.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stylesheetRender.js","sourceRoot":"","sources":["../../../src/components/utils/stylesheetRender.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,GAAG,mFAAmF,CAAC;AAExG,MAAM,UAAU,wBAAwB,CACvC,eAAwD,EACxD,aAAa,GAAG,4BAA4B;IAE5C,IAAI,CAAC,eAAe;QAAE,OAAO,EAAE,CAAC;IAChC,OAAO,eAAe,CAAC,WAAW;SAChC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,qBAAqB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;SACrE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,IAAI,CAAC,CAAC;AACd,CAAC;AAED,SAAS,qBAAqB,CAAC,UAAoC,EAAE,aAAqB;IACzF,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;IACvC,IAAI,CAAC,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IAC7C,MAAM,eAAe,GAAG,0BAA0B,CAAC,UAAU,EAAE,aAAa,CAAC,CA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aAAa,0BAA0B,eAAe,CAAC,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC;AACrG,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAgB,EAAE,aAAqB;IACjE,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzB,IAAI,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC;QAAE,OAAO,QAAQ,CAAC;IACxD,IAAI,QAAQ,KAAK,OAAO,IAAI,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,MAAM;QAAE,OAAO,aAAa,CAAC;IAC7F,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,aAAa,GAAG,QAAQ,EAAE,CAAC;IACnE,OAAO,GAAG,aAAa,IAAI,QAAQ,EAAE,CAAC;AACvC,CAAC;AAED,SAAS,eAAe,CAAC,KAAa;IACrC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AACpF,CAAC","sourcesContent":["import type { ResolvedItemDeliveryContext, ResolvedQtiStylesheetRef } from '@pie-qti/ims-cp-core';\n\nconst BLOCKED_CSS = /@import\\b|url\\s*\\(|<\\/style|expression\\s*\\(|javascript\\s*:|vbscript\\s*:|data\\s*:/i;\n\nexport function buildScopedStylesheetCss(\n\tdeliveryContext: ResolvedItemDeliveryContext | undefined,\n\tscopeSelector = '[data-qti-item-body-scope]'\n): string {\n\tif (!deliveryContext) return '';\n\treturn deliveryContext.stylesheets\n\t\t.map((stylesheet) => stylesheetToScopedCss(stylesheet, scopeSelector))\n\t\t.filter(Boolean)\n\t\t.join('\\n');\n}\n\nfunction stylesheetToScopedCss(stylesheet: ResolvedQtiStylesheetRef, scopeSelector: string): string {\n\tconst css = stylesheet.cssText?.trim();\n\tif (!css || BLOCKED_CSS.test(css)) return '';\n\tconst stylesheetScope = getStylesheetScopeSelector(stylesheet, scopeSelector);\n\tconst scoped = scopeCssRules(css, stylesheetScope);\n\tif (!scoped) return '';\n\treturn scoped;\n}\n\nexport function scopeCssRules(css: string, scopeSelector = '[data-qti-item-body-scope]'): string {\n\tconst withoutComments = css.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '');\n\tlet scoped = '';\n\tconst rulePattern = /([^{}@]+)\\{([^{}]*)\\}/g;\n\tfor (const match of withoutComments.matchAll(rulePattern)) {\n\t\tconst selectorList = match[1]?.trim();\n\t\tconst declarations = match[2]?.trim();\n\t\tif (!selectorList || !declarations) continue;\n\t\tconst selectors = selectorList\n\t\t\t.split(',')\n\t\t\t.map((selector) => scopeSelectorText(selector.trim(), scopeSelector))\n\t\t\t.filter(Boolean);\n\t\tif (selectors.length === 0) continue;\n\t\tscoped += `${selectors.join(', ')} { ${declarations} }\\n`;\n\t}\n\treturn scoped.trim();\n}\n\nfunction getStylesheetScopeSelector(stylesheet: ResolvedQtiStylesheetRef, scopeSelector: string): string {\n\tif (stylesheet.source !== 'stimulus' || !stylesheet.stimulusIdentifier) return scopeSelector;\n\treturn `${scopeSelector} [data-stimulus-idref=\"${escapeCssString(stylesheet.stimulusIdentifier)}\"]`;\n}\n\nfunction scopeSelectorText(selector: string, scopeSelector: string): string {\n\tif (!selector) return '';\n\tif (selector.startsWith(scopeSelector)) return selector;\n\tif (selector === ':root' || selector === 'html' || selector === 'body') return scopeSelector;\n\tif (selector.startsWith(':')) return `${scopeSelector}${selector}`;\n\treturn `${scopeSelector} ${selector}`;\n}\n\nfunction escapeCssString(value: string): string {\n\treturn value.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/\\n|\\r|\\f/g, ' ');\n}\n"]}
@@ -135,4 +135,3 @@ export interface ComponentPlugin {
135
135
  */
136
136
  register(registry: ComponentRegistry): void;
137
137
  }
138
- //# sourceMappingURL=ComponentRegistry.d.ts.map
@@ -183,3 +183,4 @@ export function registerDefaultComponentTags(registry) {
183
183
  });
184
184
  }
185
185
  }
186
+ //# sourceMappingURL=ComponentRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentRegistry.js","sourceRoot":"","sources":["../../src/core/ComponentRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA6DH,MAAM,8BAA8B,GAAG;IACtC,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,gBAAgB,EAAE;IACxE,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,gBAAgB,EAAE;IACxE,gBAAgB,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE;IACrE,gBAAgB,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE;IACrE,oBAAoB,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,mBAAmB,EAAE;IACjF,mBAAmB,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,mBAAmB,EAAE;IAChF,kBAAkB,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,iBAAiB,EAAE;IAC3E,kBAAkB,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,iBAAiB,EAAE;IAC3E,gBAAgB,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE;IACrE,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,gBAAgB,EAAE;IACxE,qBAAqB,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,qBAAqB,EAAE;IACtF,yBAAyB,EAAE,EAAE,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,yBAAyB,EAAE;IAClG,0BAA0B,EAAE,EAAE,IAAI,EAAE,2BAA2B,EAAE,OAAO,EAAE,2BAA2B,EAAE;I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AAC,GAAG,CAAC,IAAI,CAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;;;OAOG;IACH,iBAAiB,CAAC,IAAY;QAC7B,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC7C,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACxD,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;IACrC,CAAC;CACD;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACtC,MAAM,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;IACzC,4BAA4B,CAAC,QAAQ,CAAC,CAAC;IACvC,OAAO,QAAQ,CAAC;AACjB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAAC,QAA2B;IACvE,KAAK,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,8BAA8B,CAAC,EAAE,CAAC;QAChF,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE;YACvB,GAAG,SAAS;YACZ,WAAW,EAAE,iCAAiC,IAAI,EAAE;YACpD,QAAQ,EAAE,CAAC,GAAG;SACd,CAAC,CAAC;IACJ,CAAC;AACF,CAAC","sourcesContent":["/**\n * Component Registry for Web Component-based Interaction Rendering\n *\n * Provides a pluggable system for registering web components to render\n * different QTI interaction types. Uses priority-based dispatch similar to the\n * ExtractionRegistry, but for framework-agnostic web components.\n */\n\nimport type { InteractionData } from '../interactions/index.js';\n\n/**\n * Configuration for registering a web component renderer\n */\nexport interface ComponentConfig<TData extends InteractionData = InteractionData> {\n\t/** Unique name for this renderer (e.g., 'rating-choice', 'standard-choice') */\n\tname: string;\n\n\t/**\n\t * Priority for renderer evaluation (higher = checked first)\n\t * - 100: Very specific custom renderers\n\t * - 50: Moderately specific custom renderers\n\t * - 10: Generic custom renderers\n\t * - 0: Default fallback renderers\n\t * Default: 0\n\t */\n\tpriority?: number;\n\n\t/** Optional description for debugging/error messages */\n\tdescription?: string;\n\n\t/**\n\t * Predicate to determine if this component can handle the interaction\n\t * Evaluated in priority order (highest first)\n\t * @returns true if this component should be used\n\t * Default: always true\n\t */\n\tcanHandle?: (data: TData) => boolean;\n\n\t/**\n\t * Web component tag name (must contain a hyphen per web component spec)\n\t * e.g., 'qti-choice-interaction', 'custom-rating-choice'\n\t */\n\ttagName: string;\n\n\t/**\n\t * Optional web component class constructor\n\t * If provided, the component will be automatically registered with customElements\n\t */\n\tcomponentClass?: CustomElementConstructor;\n\n\t/**\n\t * Whether to automatically register the component with customElements\n\t * Default: true if componentClass is provided\n\t */\n\tautoRegister?: boolean;\n}\n\n/**\n * Internal registered component with metadata\n */\ninterface RegisteredComponent<TData extends InteractionData = InteractionData> {\n\tconfig: ComponentConfig<TData> & {\n\t\tpriority: number;\n\t\tcanHandle: (data: TData) => boolean;\n\t};\n}\n\nconst DEFAULT_COMPONENT_TAGS_BY_TYPE = {\n\tchoiceInteraction: { name: 'default-choice', tagName: 'pie-qti-choice' },\n\tsliderInteraction: { name: 'default-slider', tagName: 'pie-qti-slider' },\n\torderInteraction: { name: 'default-order', tagName: 'pie-qti-order' },\n\tmatchInteraction: { name: 'default-match', tagName: 'pie-qti-match' },\n\tassociateInteraction: { name: 'default-associate', tagName: 'pie-qti-associate' },\n\tgapMatchInteraction: { name: 'default-gap-match', tagName: 'pie-qti-gap-match' },\n\thotspotInteraction: { name: 'default-hotspot', tagName: 'pie-qti-hotspot' },\n\thottextInteraction: { name: 'default-hottext', tagName: 'pie-qti-hottext' },\n\tmediaInteraction: { name: 'default-media', tagName: 'pie-qti-media' },\n\tcustomInteraction: { name: 'default-custom', tagName: 'pie-qti-custom' },\n\tendAttemptInteraction: { name: 'default-end-attempt', tagName: 'pie-qti-end-attempt' },\n\tpositionObjectInteraction: { name: 'default-position-object', tagName: 'pie-qti-position-object' },\n\tgraphicGapMatchInteraction: { name: 'default-graphic-gap-match', tagName: 'pie-qti-graphic-gap-match' },\n\tgraphicOrderInteraction: { name: 'default-graphic-order', tagName: 'pie-qti-graphic-order' },\n\tgraphicAssociateInteraction: { name: 'default-graphic-associate', tagName: 'pie-qti-graphic-associate' },\n\tselectPointInteraction: { name: 'default-select-point', tagName: 'pie-qti-select-point' },\n\textendedTextInteraction: { name: 'default-extended-text', tagName: 'pie-qti-extended-text' },\n\tuploadInteraction: { name: 'default-upload', tagName: 'pie-qti-upload' },\n\tdrawingInteraction: { name: 'default-drawing', tagName: 'pie-qti-drawing' },\n\tcatalogPopup: { name: 'default-catalog-popup', tagName: 'pie-qti-catalog-popup' },\n} satisfies Record<string, { name: string; tagName: string }>;\n\n/**\n * Registry for web components that render QTI interactions\n */\nexport class ComponentRegistry {\n\tprivate components = new Map<string, RegisteredComponent[]>();\n\tprivate definedElements = new Set<string>();\n\n\t/**\n\t * Register a web component for an interaction type with priority-based dispatch\n\t *\n\t * @param type - QTI interaction type (e.g., 'choiceInteraction', 'textEntryInteraction')\n\t * @param config - Component configuration with priority and canHandle predicate\n\t *\n\t * @example\n\t * // Custom rating choice component with high priority\n\t * registry.register('choiceInteraction', {\n\t * name: 'rating-choice',\n\t * priority: 100,\n\t * description: 'Star rating interactions',\n\t * canHandle: (data) => data.interactionClasses?.includes('rating-interaction'),\n\t * tagName: 'custom-rating-choice',\n\t * componentClass: RatingChoiceInteraction,\n\t * autoRegister: true\n\t * });\n\t *\n\t * // Default choice component\n\t * registry.register('choiceInteraction', {\n\t * name: 'standard-choice',\n\t * tagName: 'qti-choice-interaction'\n\t * });\n\t */\n\tregister<TData extends InteractionData>(\n\t\ttype: string,\n\t\tconfig: ComponentConfig<TData>\n\t): void {\n\t\t// Validate tag name\n\t\tif (!config.tagName.includes('-')) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid tag name '${config.tagName}'. ` +\n\t\t\t\t\t`Web component tag names must contain a hyphen.`\n\t\t\t);\n\t\t}\n\n\t\t// Auto-register custom element if requested\n\t\tif (config.componentClass && config.autoRegister !== false) {\n\t\t\tif (!this.definedElements.has(config.tagName)) {\n\t\t\t\tif (!customElements.get(config.tagName)) {\n\t\t\t\t\tcustomElements.define(config.tagName, config.componentClass);\n\t\t\t\t}\n\t\t\t\tthis.definedElements.add(config.tagName);\n\t\t\t}\n\t\t}\n\n\t\t// Get or create component array for this type\n\t\tlet components = this.components.get(type);\n\t\tif (!components) {\n\t\t\tcomponents = [];\n\t\t\tthis.components.set(type, components);\n\t\t}\n\n\t\t// Add normalized component and sort by priority (highest first)\n\t\tcomponents.push(this.createRegisteredComponent(config) as RegisteredComponent);\n\t\tcomponents.sort((a, b) => b.config.priority - a.config.priority);\n\t}\n\n\tprivate createRegisteredComponent<TData extends InteractionData>(\n\t\tconfig: ComponentConfig<TData>\n\t): RegisteredComponent<TData> {\n\t\treturn {\n\t\t\tconfig: {\n\t\t\t\t...config,\n\t\t\t\tpriority: config.priority ?? 0,\n\t\t\t\tcanHandle: config.canHandle ?? (() => true),\n\t\t\t},\n\t\t};\n\t}\n\n\t/**\n\t * Get a web component tag name for an interaction type\n\t * Evaluates canHandle predicates in priority order\n\t *\n\t * @param data - Interaction data\n\t * @returns Web component tag name (e.g., 'qti-choice-interaction')\n\t * @throws Error if no component matches\n\t */\n\tgetTagName<TData extends InteractionData>(data: TData): string {\n\t\tconst components = this.components.get(data.type);\n\n\t\tif (!components || components.length === 0) {\n\t\t\tthrow new Error(\n\t\t\t\t`No component registered for '${data.type}' interaction. ` +\n\t\t\t\t\t`Available types: ${Array.from(this.components.keys()).join(', ')}`\n\t\t\t);\n\t\t}\n\n\t\t// Evaluate canHandle in priority order\n\t\tfor (const { config } of components) {\n\t\t\ttry {\n\t\t\t\tif (config.canHandle(data as any)) {\n\t\t\t\t\treturn config.tagName;\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\t// Log but continue to next component\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`canHandle() failed for '${config.name}' component:`,\n\t\t\t\t\terror\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// No component matched\n\t\tconst componentList = components\n\t\t\t.map((c) => {\n\t\t\t\tconst desc = c.config.description ? ` (${c.config.description})` : '';\n\t\t\t\treturn `${c.config.name}${desc}`;\n\t\t\t})\n\t\t\t.join(', ');\n\n\t\tthrow new Error(\n\t\t\t`No component available for '${data.type}' interaction.\\n` +\n\t\t\t\t`Registered components: ${componentList}.\\n` +\n\t\t\t\t`None of these components matched the current interaction.`\n\t\t);\n\t}\n\n\t/**\n\t * Get all registered interaction types\n\t * @returns Array of registered interaction type names\n\t */\n\tgetRegisteredTypes(): string[] {\n\t\treturn Array.from(this.components.keys());\n\t}\n\n\t/**\n\t * Check if a component is registered for a type\n\t */\n\thasComponent(type: string): boolean {\n\t\treturn this.components.has(type) && this.components.get(type)!.length > 0;\n\t}\n\n\t/**\n\t * Get the tag name for a registered type by name (no canHandle evaluation).\n\t * Useful for non-interaction components like catalogPopup where the type string\n\t * is known and there is no InteractionData object to pass.\n\t *\n\t * Returns the highest-priority registered tag name for the type, or null if\n\t * the type is not registered.\n\t */\n\tgetTagNameForType(type: string): string | null {\n\t\tconst components = this.components.get(type);\n\t\tif (!components || components.length === 0) return null;\n\t\treturn components[0].config.tagName;\n\t}\n}\n\n/**\n * Create a new component registry\n */\nexport function createComponentRegistry(): ComponentRegistry {\n\tconst registry = new ComponentRegistry();\n\tregisterDefaultComponentTags(registry);\n\treturn registry;\n}\n\n/**\n * Register the default QTI interaction tag names without importing their implementations.\n *\n * Hosts still choose the implementation bundle, typically by importing\n * `@pie-qti/default-components/plugins` in the browser. Keeping only tag metadata here lets\n * the item-player custom element remain the public rendering boundary without depending on\n * Svelte-authored default components.\n */\nexport function registerDefaultComponentTags(registry: ComponentRegistry): void {\n\tfor (const [type, component] of Object.entries(DEFAULT_COMPONENT_TAGS_BY_TYPE)) {\n\t\tregistry.register(type, {\n\t\t\t...component,\n\t\t\tdescription: `Default web component tag for ${type}`,\n\t\t\tpriority: -100,\n\t\t});\n\t}\n}\n\n/**\n * Plugin interface for registering web components\n */\nexport interface ComponentPlugin {\n\t/** Plugin name (e.g., '@renaissance/rating-choice') */\n\tname: string;\n\n\t/** Plugin version (semver) */\n\tversion: string;\n\n\t/** Plugin description */\n\tdescription: string;\n\n\t/**\n\t * Register web components with the registry\n\t * @param registry - ComponentRegistry instance\n\t */\n\tregister(registry: ComponentRegistry): void;\n}\n"]}
@@ -235,4 +235,3 @@ export declare class Player {
235
235
  private renderPrintedVariables;
236
236
  private getModalFeedback;
237
237
  }
238
- //# sourceMappingURL=Player.d.ts.map
@@ -1412,3 +1412,4 @@ function looksLikeCatalogUrl(value) {
1412
1412
  return /^(https?:\/\/|\/\/|\/|\.{0,2}\/|data:|blob:)/i.test(trimmed) ||
1413
1413
  /\.(png|jpe?g|gif|webp|svg|mp3|wav|ogg|mp4|webm|pdf)(\?.*)?$/i.test(trimmed);
1414
1414
  }
1415
+ //# sourceMappingURL=Player.js.map