@citolab/qti-components 7.12.0 → 7.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +102 -102
  3. package/custom-elements.json +1123 -334
  4. package/dist/chunks/{chunk-IHE5M7QU.js → chunk-CNLDFJAA.js} +4 -4
  5. package/dist/chunks/chunk-CNLDFJAA.js.map +1 -0
  6. package/dist/chunks/{chunk-WFUXZ4UT.js → chunk-LJ4KAG72.js} +26 -36
  7. package/dist/chunks/chunk-LJ4KAG72.js.map +1 -0
  8. package/dist/chunks/{chunk-TFNRSY74.js → chunk-SJGUMIKK.js} +24 -19
  9. package/dist/chunks/chunk-SJGUMIKK.js.map +1 -0
  10. package/dist/chunks/{chunk-GGTWY53P.js → chunk-XD7DR5YG.js} +362 -339
  11. package/dist/chunks/chunk-XD7DR5YG.js.map +1 -0
  12. package/dist/exports/qti-test.d.ts +2 -2
  13. package/dist/index.d.ts +3 -3
  14. package/dist/index.js +16 -5
  15. package/dist/index.js.map +1 -1
  16. package/dist/qti-components/index.d.ts +10 -9
  17. package/dist/qti-components/index.js +4 -2
  18. package/dist/qti-components-jsx.d.ts +15 -18
  19. package/dist/qti-item/index.js +2 -2
  20. package/dist/qti-loader/index.js +2 -2
  21. package/dist/qti-loader/index.js.map +1 -1
  22. package/dist/qti-test/index.d.ts +3 -4
  23. package/dist/qti-test/index.js +2 -2
  24. package/dist/{qti-test-BWQRhMTT.d.ts → qti-test-Db7oNIWY.d.ts} +2 -2
  25. package/dist/{qti-transform-test-DkSRdVBF.d.ts → qti-transform-test-Bz9A3hmD.d.ts} +2 -5
  26. package/dist/qti-transformers/index.d.ts +3 -3
  27. package/dist/qti-transformers/index.js +1 -1
  28. package/dist/vscode.html-custom-data.json +5 -27
  29. package/package.json +10 -1
  30. package/dist/chunks/chunk-GGTWY53P.js.map +0 -1
  31. package/dist/chunks/chunk-IHE5M7QU.js.map +0 -1
  32. package/dist/chunks/chunk-TFNRSY74.js.map +0 -1
  33. package/dist/chunks/chunk-WFUXZ4UT.js.map +0 -1
@@ -1,4 +1,4 @@
1
- export { Q as QtiAssessmentItem } from '../qti-assessment-item-l-mN3teH.js';
1
+ import { Q as QtiAssessmentItem } from '../qti-assessment-item-l-mN3teH.js';
2
2
  import * as lit from 'lit';
3
3
  import { LitElement, CSSResultGroup, PropertyValues, PropertyValueMap, nothing } from 'lit';
4
4
  import * as lit_html from 'lit-html';
@@ -17,21 +17,22 @@ import { R as ResponseVariable, V as VariableDeclaration } from '../variables-BC
17
17
  export { c as QtiAreaMapEntry, b as QtiAreaMapping, a as QtiMapEntry, Q as QtiMapping, d as areaShape } from '../variables-BCkyLoXK.js';
18
18
  import '../exports/qti.context.js';
19
19
 
20
+ declare class QtiAssessmentStimulusRefConnectedEvent extends Event {
21
+ element: QtiAssessmentStimulusRef;
22
+ item: QtiAssessmentItem;
23
+ static eventName: string;
24
+ constructor(element: QtiAssessmentStimulusRef, item: QtiAssessmentItem);
25
+ }
20
26
  /**
21
27
  * Represents a custom element for referencing an assessment stimulus.
22
28
  */
23
29
  declare class QtiAssessmentStimulusRef extends LitElement {
24
- /**
25
- * The identifier of the stimulus.
26
- */
27
30
  identifier: string;
28
- /**
29
- * The href of the stimulus.
30
- */
31
31
  href: string;
32
32
  /**
33
33
  * Lifecycle method called when the element is connected to the DOM.
34
- * Loads and appends the stimulus if the 'qti-assessment-stimulus-ref-connected' event is not prevented.
34
+ * First checks if there's a data-stimulus-idref element. If found, loads the stimulus directly.
35
+ * If not found, delegates to the delivery platform via an event.
35
36
  */
36
37
  connectedCallback(): Promise<void>;
37
38
  /**
@@ -1518,4 +1519,4 @@ declare global {
1518
1519
  }
1519
1520
  }
1520
1521
 
1521
- export { type Orientation, QtiAnd, QtiAssessmentStimulusRef, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoiceInteraction, QtiCompanionMaterialsInfo, QtiContainerSize, QtiContains, QtiContentBody, QtiCorrect, QtiCustomInteraction, QtiCustomOperator, QtiDefault, QtiDelete, QtiEndAttemptInteraction, QtiEqual, QtiEqualRounded, QtiExtendedTextInteraction, QtiFeedbackBlock, QtiFeedbackInline, QtiFieldValue, QtiGap, QtiGapImg, QtiGapMatchInteraction, QtiGapText, QtiGcd, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiGt, QtiGte, QtiHotspotChoice, QtiHotspotInteraction, QtiHottext, QtiHottextInteraction, QtiIndex, QtiInlineChoice, QtiInlineChoiceInteraction, QtiIsNull, QtiItemBody, QtiLookupOutcomeValue, QtiLt, QtiLte, QtiMapResponse, QtiMapResponsePoint, QtiMatch, QtiMatchInteraction, QtiMathOperator, QtiMediaInteraction, QtiMember, QtiMultiple, QtiNot, QtiNull, QtiOr, QtiOrderInteraction, QtiOrdered, QtiOutcomeDeclaration, QtiOutcomeProcessing, QtiOutcomeProcessingProcessor, QtiPortableCustomInteraction, QtiPositionObjectInteraction, QtiPositionObjectStage, QtiPower, QtiPrintedVariable, QtiProduct, QtiPrompt, QtiRandom, QtiRandomInteger, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiResponseProcessing, QtiRound, QtiRoundTo, QtiRubricBlock, QtiRule, type QtiRuleBase, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSetOutcomeValueRule, QtiSimpleAssociableChoice, QtiSimpleChoice, QtiSliderInteraction, QtiStringMatch, QtiStylesheet, QtiSubtract, QtiSum, QtiSumExpression, QtiTextEntryInteraction, QtiUploadInteraction, QtiVariable, qtiAndMixin, qtiSubtractMixin };
1522
+ export { type Orientation, QtiAnd, QtiAssessmentItem, QtiAssessmentStimulusRef, QtiAssessmentStimulusRefConnectedEvent, QtiAssociableHotspot, QtiAssociateInteraction, QtiBaseValue, QtiChoiceInteraction, QtiCompanionMaterialsInfo, QtiContainerSize, QtiContains, QtiContentBody, QtiCorrect, QtiCustomInteraction, QtiCustomOperator, QtiDefault, QtiDelete, QtiEndAttemptInteraction, QtiEqual, QtiEqualRounded, QtiExtendedTextInteraction, QtiFeedbackBlock, QtiFeedbackInline, QtiFieldValue, QtiGap, QtiGapImg, QtiGapMatchInteraction, QtiGapText, QtiGcd, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiGt, QtiGte, QtiHotspotChoice, QtiHotspotInteraction, QtiHottext, QtiHottextInteraction, QtiIndex, QtiInlineChoice, QtiInlineChoiceInteraction, QtiIsNull, QtiItemBody, QtiLookupOutcomeValue, QtiLt, QtiLte, QtiMapResponse, QtiMapResponsePoint, QtiMatch, QtiMatchInteraction, QtiMathOperator, QtiMediaInteraction, QtiMember, QtiMultiple, QtiNot, QtiNull, QtiOr, QtiOrderInteraction, QtiOrdered, QtiOutcomeDeclaration, QtiOutcomeProcessing, QtiOutcomeProcessingProcessor, QtiPortableCustomInteraction, QtiPositionObjectInteraction, QtiPositionObjectStage, QtiPower, QtiPrintedVariable, QtiProduct, QtiPrompt, QtiRandom, QtiRandomInteger, QtiResponseCondition, QtiResponseDeclaration, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiResponseProcessing, QtiRound, QtiRoundTo, QtiRubricBlock, QtiRule, type QtiRuleBase, QtiSelectPointInteraction, QtiSetOutcomeValue, QtiSetOutcomeValueRule, QtiSimpleAssociableChoice, QtiSimpleChoice, QtiSliderInteraction, QtiStringMatch, QtiStylesheet, QtiSubtract, QtiSum, QtiSumExpression, QtiTextEntryInteraction, QtiUploadInteraction, QtiVariable, qtiAndMixin, qtiSubtractMixin };
@@ -2,6 +2,7 @@ import {
2
2
  QtiAnd,
3
3
  QtiAssessmentItem,
4
4
  QtiAssessmentStimulusRef,
5
+ QtiAssessmentStimulusRefConnectedEvent,
5
6
  QtiAssociableHotspot,
6
7
  QtiAssociateInteraction,
7
8
  QtiBaseValue,
@@ -95,12 +96,12 @@ import {
95
96
  QtiVariable,
96
97
  qtiAndMixin,
97
98
  qtiSubtractMixin
98
- } from "../chunks/chunk-TFNRSY74.js";
99
+ } from "../chunks/chunk-SJGUMIKK.js";
99
100
  import {
100
101
  QtiModalFeedback
101
102
  } from "../chunks/chunk-YD7FVKDP.js";
102
103
  import "../chunks/chunk-ELDMXTUQ.js";
103
- import "../chunks/chunk-WFUXZ4UT.js";
104
+ import "../chunks/chunk-LJ4KAG72.js";
104
105
  import "../chunks/chunk-SV4K25ZI.js";
105
106
  import "../chunks/chunk-GAAFN7QF.js";
106
107
  import "../chunks/chunk-H6KHXSIO.js";
@@ -114,6 +115,7 @@ export {
114
115
  QtiAnd,
115
116
  QtiAssessmentItem,
116
117
  QtiAssessmentStimulusRef,
118
+ QtiAssessmentStimulusRefConnectedEvent,
117
119
  QtiAssociableHotspot,
118
120
  QtiAssociateInteraction,
119
121
  QtiBaseValue,
@@ -51,7 +51,7 @@ import type { QtiTemplateProcessing } from "src/lib/qti-components/qti-template-
51
51
  import type { QtiFeedback } from "src/lib/qti-components/qti-feedback/qti-feedback.ts";
52
52
  import type { ItemShowCorrectResponse } from "src/lib/qti-item/components/item-show-correct-response.ts";
53
53
  import type { QtiAssessmentItem } from "src/lib/qti-components/qti-assessment-item/qti-assessment-item.ts";
54
- import type { QtiAssessmentStimulusRef } from "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts";
54
+ import type { QtiAssessmentStimulusRefConnectedEvent, QtiAssessmentStimulusRef } from "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts";
55
55
  import type { QtiCompanionMaterialsInfo } from "src/lib/qti-components/qti-companion-materials-info/qti-companion-materials-info.ts";
56
56
  import type { QtiCustomOperator } from "src/lib/qti-components/qti-custom-operator/qti-custom-operator.ts";
57
57
  import type { QtiFeedbackBlock } from "src/lib/qti-components/qti-feedback/qti-feedback-block/qti-feedback-block.ts";
@@ -610,9 +610,9 @@ export type QtiAssessmentItemProps = {
610
610
 
611
611
 
612
612
  export type QtiAssessmentStimulusRefProps = {
613
- /** The identifier of the stimulus. */
613
+ /** */
614
614
  "identifier"?: QtiAssessmentStimulusRef['identifier'];
615
- /** The href of the stimulus. */
615
+ /** */
616
616
  "href"?: QtiAssessmentStimulusRef['href'];
617
617
 
618
618
 
@@ -1622,8 +1622,6 @@ export type QtiTestProps = {
1622
1622
  /** */
1623
1623
  "requestTimeout"?: QtiTest['requestTimeout'];
1624
1624
  /** */
1625
- "showLoadingIndicators"?: QtiTest['showLoadingIndicators'];
1626
- /** */
1627
1625
  "postLoadTransformCallback"?: QtiTest['postLoadTransformCallback'];
1628
1626
  /** */
1629
1627
  "postLoadTestTransformCallback"?: QtiTest['postLoadTestTransformCallback'];
@@ -1637,9 +1635,11 @@ export type QtiTestProps = {
1637
1635
  /** */
1638
1636
  "onqti-request-navigation"?: (e: CustomEvent<CustomEvent>) => void;
1639
1637
  /** */
1640
- "onqti-navigation-error"?: (e: CustomEvent<CustomEvent>) => void;
1638
+ "onqti-navigation-loading-started"?: (e: CustomEvent<CustomEvent>) => void;
1641
1639
  /** */
1642
- "onqti-navigation-status"?: (e: CustomEvent<CustomEvent>) => void;
1640
+ "onqti-navigation-loading-ended"?: (e: CustomEvent<CustomEvent>) => void;
1641
+ /** */
1642
+ "onqti-navigation-error"?: (e: CustomEvent<CustomEvent>) => void;
1643
1643
  /** */
1644
1644
  "onqti-test-loaded"?: (e: CustomEvent<CustomEvent>) => void;
1645
1645
  /** */
@@ -1764,8 +1764,6 @@ export type TestContainerProps = {
1764
1764
  "test-url"?: TestContainer['testURL'];
1765
1765
  /** URL of the item to load */
1766
1766
  "testURL"?: TestContainer['testURL'];
1767
- /** Callback function to transform the test after loading */
1768
- "postLoadTestTransformCallback"?: TestContainer['postLoadTestTransformCallback'];
1769
1767
  /** A parsed HTML document */
1770
1768
  "testDoc"?: TestContainer['testDoc'];
1771
1769
  /** The raw XML string */
@@ -2662,8 +2660,8 @@ export type QtiTestVariablesProps = {
2662
2660
  *
2663
2661
  * Component attributes and properties that can be applied to the element or by using JavaScript.
2664
2662
  *
2665
- * - `identifier`: The identifier of the stimulus.
2666
- * - `href`: The href of the stimulus.
2663
+ * - `identifier`: undefined
2664
+ * - `href`: undefined
2667
2665
  *
2668
2666
  * ## Methods
2669
2667
  *
@@ -4056,9 +4054,8 @@ export type QtiTestVariablesProps = {
4056
4054
  * - `navigate`: undefined
4057
4055
  * - `cache-transform`/`cacheTransform`: undefined
4058
4056
  * - `requestTimeout`: undefined
4059
- * - `showLoadingIndicators`: undefined
4060
- * - `postLoadTransformCallback`: undefined
4061
- * - `postLoadTestTransformCallback`: undefined
4057
+ * - `postLoadTransformCallback`: undefined (property only)
4058
+ * - `postLoadTestTransformCallback`: undefined (property only)
4062
4059
  * - `sessionContext`: undefined (property only)
4063
4060
  * - `testContext`: undefined (property only)
4064
4061
  *
@@ -4068,8 +4065,9 @@ export type QtiTestVariablesProps = {
4068
4065
  *
4069
4066
  * - `qti-test-connected`: undefined
4070
4067
  * - `qti-request-navigation`: undefined
4068
+ * - `qti-navigation-loading-started`: undefined
4069
+ * - `qti-navigation-loading-ended`: undefined
4071
4070
  * - `qti-navigation-error`: undefined
4072
- * - `qti-navigation-status`: undefined
4073
4071
  * - `qti-test-loaded`: undefined
4074
4072
  * - `qti-test-context-updated`: undefined
4075
4073
  *
@@ -4077,8 +4075,8 @@ export type QtiTestVariablesProps = {
4077
4075
  *
4078
4076
  * Methods that can be called to access component functionality.
4079
4077
  *
4080
- * - `navigateTo(type: 'item' | 'section', id?: string) => void`: undefined
4081
- * - `retryNavigation() => void`: Retry the last failed navigation
4078
+ * - `navigateTo(type: 'item' | 'section', id?: string) => void`: Navigate to a specific item or section
4079
+ * - `getLoadingProgress() => void`: Get current loading progress for external consumption
4082
4080
  * - `outcomeProcessing() => boolean`: undefined
4083
4081
  * - `updateOutcomeVariable(identifier: string, value: string | string[] | undefined) => void`: undefined
4084
4082
  * - `getOutcome(identifier: string) => Readonly<OutcomeVariable>`: undefined
@@ -4267,7 +4265,6 @@ export type QtiTestVariablesProps = {
4267
4265
  * Component attributes and properties that can be applied to the element or by using JavaScript.
4268
4266
  *
4269
4267
  * - `test-url`/`testURL`: URL of the item to load
4270
- * - `postLoadTestTransformCallback`: Callback function to transform the test after loading
4271
4268
  * - `testDoc`: A parsed HTML document (property only)
4272
4269
  * - `testXML`: The raw XML string (property only)
4273
4270
  */
@@ -3,10 +3,10 @@ import {
3
3
  ItemShowCorrectResponse,
4
4
  PrintItemVariables,
5
5
  QtiItem
6
- } from "../chunks/chunk-IHE5M7QU.js";
6
+ } from "../chunks/chunk-CNLDFJAA.js";
7
7
  import "../chunks/chunk-PT5ASWGQ.js";
8
8
  import "../chunks/chunk-ELDMXTUQ.js";
9
- import "../chunks/chunk-WFUXZ4UT.js";
9
+ import "../chunks/chunk-LJ4KAG72.js";
10
10
  import "../chunks/chunk-4OGJBG35.js";
11
11
  import "../chunks/chunk-BHJSX3Q6.js";
12
12
  import "../chunks/chunk-H2JE6IVU.js";
@@ -2,7 +2,7 @@ import {
2
2
  qtiTransformItem,
3
3
  qtiTransformManifest,
4
4
  qtiTransformTest
5
- } from "../chunks/chunk-WFUXZ4UT.js";
5
+ } from "../chunks/chunk-LJ4KAG72.js";
6
6
  import "../chunks/chunk-H2JE6IVU.js";
7
7
 
8
8
  // src/lib/qti-loader/qti-loader.ts
@@ -22,7 +22,7 @@ var getManifestInfo = async (manifestURL) => {
22
22
  };
23
23
  };
24
24
  var getItemByUri = async (itemUri) => {
25
- return qtiTransformItem().load(itemUri).promise.then((api) => api.htmlDoc().firstElementChild);
25
+ return qtiTransformItem().load(itemUri).then((api) => api.htmlDoc().firstElementChild);
26
26
  };
27
27
  export {
28
28
  getItemByUri,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/qti-loader/qti-loader.ts"],"sourcesContent":["import { qtiTransformItem, qtiTransformTest } from '../qti-transformers';\nimport { qtiTransformManifest } from '../qti-transformers/qti-transform-manifest';\n\nimport type { QtiAssessmentItem } from '../qti-components/qti-assessment-item/qti-assessment-item';\n\nexport type ManifestInfo = {\n testIdentifier: string;\n testHTMLDoc: DocumentFragment;\n testURI: string;\n testURL: string;\n items: {\n identifier: string;\n href: string;\n category: string;\n }[];\n};\n\n// Utility function to ensure package URIs end with a '/'\n// const normalizeUri = (uri: string) => (uri.endsWith('/') ? uri : `${uri}/`);\n\n// Fetches assessment data from the manifest\nexport const getManifestInfo = async (manifestURL: string): Promise<ManifestInfo> => {\n const baseURI = manifestURL.substring(0, manifestURL.lastIndexOf('/'));\n\n const test = await qtiTransformManifest()\n .load(`${manifestURL}`)\n .then(api => api.assessmentTest());\n\n const testHTMLDoc = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.htmlDoc());\n\n const items = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.items());\n\n const testURL = `${baseURI}/${test.href}`;\n const testURI = `${baseURI}/${test.href.substring(0, test.href.lastIndexOf('/'))}`;\n\n return {\n testHTMLDoc,\n testURI,\n testURL,\n items,\n testIdentifier: test.identifier\n };\n};\n\n// Fetches a single item by URI\nexport const getItemByUri = async (itemUri: string): Promise<QtiAssessmentItem> => {\n return qtiTransformItem()\n .load(itemUri)\n .promise.then(api => api.htmlDoc().firstElementChild as QtiAssessmentItem);\n};\n"],"mappings":";;;;;;;;AAqBO,IAAM,kBAAkB,OAAO,gBAA+C;AACnF,QAAM,UAAU,YAAY,UAAU,GAAG,YAAY,YAAY,GAAG,CAAC;AAErE,QAAM,OAAO,MAAM,qBAAqB,EACrC,KAAK,GAAG,WAAW,EAAE,EACrB,KAAK,SAAO,IAAI,eAAe,CAAC;AAEnC,QAAM,cAAc,MAAM,iBAAiB,EACxC,KAAK,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,EAC9B,KAAK,SAAO,IAAI,QAAQ,CAAC;AAE5B,QAAM,QAAQ,MAAM,iBAAiB,EAClC,KAAK,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,EAC9B,KAAK,SAAO,IAAI,MAAM,CAAC;AAE1B,QAAM,UAAU,GAAG,OAAO,IAAI,KAAK,IAAI;AACvC,QAAM,UAAU,GAAG,OAAO,IAAI,KAAK,KAAK,UAAU,GAAG,KAAK,KAAK,YAAY,GAAG,CAAC,CAAC;AAEhF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB,KAAK;AAAA,EACvB;AACF;AAGO,IAAM,eAAe,OAAO,YAAgD;AACjF,SAAO,iBAAiB,EACrB,KAAK,OAAO,EACZ,QAAQ,KAAK,SAAO,IAAI,QAAQ,EAAE,iBAAsC;AAC7E;","names":[]}
1
+ {"version":3,"sources":["../../src/lib/qti-loader/qti-loader.ts"],"sourcesContent":["import { qtiTransformItem, qtiTransformTest } from '../qti-transformers';\nimport { qtiTransformManifest } from '../qti-transformers/qti-transform-manifest';\n\nimport type { QtiAssessmentItem } from '../qti-components/qti-assessment-item/qti-assessment-item';\n\nexport type ManifestInfo = {\n testIdentifier: string;\n testHTMLDoc: DocumentFragment;\n testURI: string;\n testURL: string;\n items: {\n identifier: string;\n href: string;\n category: string;\n }[];\n};\n\n// Utility function to ensure package URIs end with a '/'\n// const normalizeUri = (uri: string) => (uri.endsWith('/') ? uri : `${uri}/`);\n\n// Fetches assessment data from the manifest\nexport const getManifestInfo = async (manifestURL: string): Promise<ManifestInfo> => {\n const baseURI = manifestURL.substring(0, manifestURL.lastIndexOf('/'));\n\n const test = await qtiTransformManifest()\n .load(`${manifestURL}`)\n .then(api => api.assessmentTest());\n\n const testHTMLDoc = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.htmlDoc());\n\n const items = await qtiTransformTest()\n .load(`${baseURI}/${test.href}`)\n .then(api => api.items());\n\n const testURL = `${baseURI}/${test.href}`;\n const testURI = `${baseURI}/${test.href.substring(0, test.href.lastIndexOf('/'))}`;\n\n return {\n testHTMLDoc,\n testURI,\n testURL,\n items,\n testIdentifier: test.identifier\n };\n};\n\n// Fetches a single item by URI\nexport const getItemByUri = async (itemUri: string): Promise<QtiAssessmentItem> => {\n return qtiTransformItem()\n .load(itemUri)\n .then(api => api.htmlDoc().firstElementChild as QtiAssessmentItem);\n};\n"],"mappings":";;;;;;;;AAqBO,IAAM,kBAAkB,OAAO,gBAA+C;AACnF,QAAM,UAAU,YAAY,UAAU,GAAG,YAAY,YAAY,GAAG,CAAC;AAErE,QAAM,OAAO,MAAM,qBAAqB,EACrC,KAAK,GAAG,WAAW,EAAE,EACrB,KAAK,SAAO,IAAI,eAAe,CAAC;AAEnC,QAAM,cAAc,MAAM,iBAAiB,EACxC,KAAK,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,EAC9B,KAAK,SAAO,IAAI,QAAQ,CAAC;AAE5B,QAAM,QAAQ,MAAM,iBAAiB,EAClC,KAAK,GAAG,OAAO,IAAI,KAAK,IAAI,EAAE,EAC9B,KAAK,SAAO,IAAI,MAAM,CAAC;AAE1B,QAAM,UAAU,GAAG,OAAO,IAAI,KAAK,IAAI;AACvC,QAAM,UAAU,GAAG,OAAO,IAAI,KAAK,KAAK,UAAU,GAAG,KAAK,KAAK,YAAY,GAAG,CAAC,CAAC;AAEhF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB,KAAK;AAAA,EACvB;AACF;AAGO,IAAM,eAAe,OAAO,YAAgD;AACjF,SAAO,iBAAiB,EACrB,KAAK,OAAO,EACZ,KAAK,SAAO,IAAI,QAAQ,EAAE,iBAAsC;AACrE;","names":[]}
@@ -3,8 +3,8 @@ import { e as VariableValue, O as OutcomeVariable, V as VariableDeclaration } fr
3
3
  import * as lit from 'lit';
4
4
  import { LitElement, PropertyValues, nothing } from 'lit';
5
5
  import { SessionContext } from '../exports/session.context.js';
6
- import { b as QtiAssessmentTest, I as IQtiTest, P as PostLoadTestTransformCallback } from '../qti-test-BWQRhMTT.js';
7
- export { Q as QtiAssessmentItemRef, a as QtiAssessmentSection, d as QtiTestFeedback, c as QtiTestPart } from '../qti-test-BWQRhMTT.js';
6
+ import { b as QtiAssessmentTest, I as IQtiTest } from '../qti-test-Db7oNIWY.js';
7
+ export { Q as QtiAssessmentItemRef, a as QtiAssessmentSection, d as QtiTestFeedback, c as QtiTestPart } from '../qti-test-Db7oNIWY.js';
8
8
  import { TestContext } from '../exports/test.context.js';
9
9
  export { INITIAL_TEST_CONTEXT, testContext } from '../exports/test.context.js';
10
10
  import { QtiContext } from '../exports/qti.context.js';
@@ -13,7 +13,7 @@ import { ConfigContext } from '../exports/config.context.js';
13
13
  import { TemplateFunction } from '@heximal/templates';
14
14
  import { ViewMode } from 'storybook/internal/types';
15
15
  import '../exports/expression-result.js';
16
- import '../qti-transform-test-DkSRdVBF.js';
16
+ import '../qti-transform-test-Bz9A3hmD.js';
17
17
  import '../qti-assessment-item-l-mN3teH.js';
18
18
  import '../qti-modal-feedback-PKbhO-3w.js';
19
19
  import '../exports/item.context.js';
@@ -333,7 +333,6 @@ declare class TestContainer extends LitElement {
333
333
  /** Template content if provided */
334
334
  private templateContent;
335
335
  /** Callback function to transform the test after loading */
336
- postLoadTestTransformCallback: PostLoadTestTransformCallback | null;
337
336
  protected handleTestURLChange(): Promise<void>;
338
337
  protected handleTestXMLChange(): void;
339
338
  connectedCallback(): Promise<void>;
@@ -23,11 +23,11 @@ import {
23
23
  TestStamp,
24
24
  TestView,
25
25
  TestViewToggle
26
- } from "../chunks/chunk-GGTWY53P.js";
26
+ } from "../chunks/chunk-XD7DR5YG.js";
27
27
  import "../chunks/chunk-YD7FVKDP.js";
28
28
  import "../chunks/chunk-PT5ASWGQ.js";
29
29
  import "../chunks/chunk-ELDMXTUQ.js";
30
- import "../chunks/chunk-WFUXZ4UT.js";
30
+ import "../chunks/chunk-LJ4KAG72.js";
31
31
  import "../chunks/chunk-H6KHXSIO.js";
32
32
  import "../chunks/chunk-C5RLRG3L.js";
33
33
  import {
@@ -1,4 +1,4 @@
1
- import { a as transformTestApi, t as transformItemApi } from './qti-transform-test-DkSRdVBF.js';
1
+ import { t as transformItemApi, a as transformTestApi } from './qti-transform-test-Bz9A3hmD.js';
2
2
  import * as lit from 'lit';
3
3
  import { LitElement } from 'lit';
4
4
  import { Q as QtiAssessmentItem } from './qti-assessment-item-l-mN3teH.js';
@@ -117,4 +117,4 @@ interface ITestProcessingMixin {
117
117
  outcomeProcessing(): boolean;
118
118
  }
119
119
 
120
- export { type IQtiTest as I, type PostLoadTestTransformCallback as P, QtiAssessmentItemRef as Q, QtiAssessmentSection as a, QtiAssessmentTest as b, QtiTestPart as c, QtiTestFeedback as d, type QtiTest as e, type ITestNavigationMixin as f, type ITestProcessingMixin as g };
120
+ export { type IQtiTest as I, QtiAssessmentItemRef as Q, QtiAssessmentSection as a, QtiAssessmentTest as b, QtiTestPart as c, QtiTestFeedback as d, type QtiTest as e, type ITestNavigationMixin as f, type ITestProcessingMixin as g };
@@ -14,10 +14,7 @@ interface ModuleResolutionConfig {
14
14
  };
15
15
  }
16
16
  type transformItemApi = {
17
- load: (uri: string) => {
18
- promise: Promise<transformItemApi>;
19
- request: XMLHttpRequest | null;
20
- };
17
+ load: (uri: string, signal?: AbortSignal) => Promise<transformItemApi>;
21
18
  parse: (xmlString: string) => transformItemApi;
22
19
  path: (location: string) => transformItemApi;
23
20
  fn: (fn: (xmlFragment: XMLDocument) => void) => transformItemApi;
@@ -47,7 +44,7 @@ declare const qtiTransformItem: (cache?: boolean) => transformItemApi;
47
44
  * const xml = qtiTransformer.xml();
48
45
  */
49
46
  type transformTestApi = {
50
- load: (uri: string) => Promise<transformTestApi>;
47
+ load: (uri: string, signal?: AbortSignal) => Promise<transformTestApi>;
51
48
  parse: (xmlString: string) => transformTestApi;
52
49
  path: (location: string) => transformTestApi;
53
50
  fn: (fn: (xmlFragment: XMLDocument) => void) => transformTestApi;
@@ -1,8 +1,8 @@
1
- export { M as ModuleResolutionConfig, q as qtiTransformItem, b as qtiTransformTest, t as transformItemApi, a as transformTestApi } from '../qti-transform-test-DkSRdVBF.js';
1
+ export { M as ModuleResolutionConfig, q as qtiTransformItem, b as qtiTransformTest, t as transformItemApi, a as transformTestApi } from '../qti-transform-test-Bz9A3hmD.js';
2
2
 
3
3
  declare const qtiTransformManifest: () => {
4
- load: (uri: string) => Promise<{
5
- load(uri: any): Promise</*elided*/ any>;
4
+ load: (uri: string, signal?: AbortSignal) => Promise<{
5
+ load(uri: any, signal: any): Promise</*elided*/ any>;
6
6
  parse(xmlString: string): void;
7
7
  assessmentTest(): {
8
8
  href: string;
@@ -2,7 +2,7 @@ import {
2
2
  qtiTransformItem,
3
3
  qtiTransformManifest,
4
4
  qtiTransformTest
5
- } from "../chunks/chunk-WFUXZ4UT.js";
5
+ } from "../chunks/chunk-LJ4KAG72.js";
6
6
  import "../chunks/chunk-H2JE6IVU.js";
7
7
  export {
8
8
  qtiTransformItem,
@@ -369,16 +369,8 @@
369
369
  "name": "qti-assessment-stimulus-ref",
370
370
  "description": "Represents a custom element for referencing an assessment stimulus.\n---\n\n\n### **Methods:**\n - **updateStimulusRef(stimulusRef: _Element_)** - Loads and appends the stimulus to the specified element.",
371
371
  "attributes": [
372
- {
373
- "name": "identifier",
374
- "description": "The identifier of the stimulus.",
375
- "values": []
376
- },
377
- {
378
- "name": "href",
379
- "description": "The href of the stimulus.",
380
- "values": []
381
- }
372
+ { "name": "identifier", "values": [] },
373
+ { "name": "href", "values": [] }
382
374
  ],
383
375
  "references": []
384
376
  },
@@ -966,23 +958,14 @@
966
958
  },
967
959
  {
968
960
  "name": "qti-test",
969
- "description": "`<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.\n\nThis component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.\n\n### Example Usage\n\nMinimal example including navigation:\n\n```html\n<qti-test>\n <test-navigation>\n <test-container test-url=\"./path/to/assessment.xml\"></test-container>\n <nav class=\"flex\">\n <test-prev></test-prev>\n <test-next></test-next>\n </nav>\n </test-navigation>\n</qti-test>\n```\n\nUse the following file structure\nA qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.\n\n```plaintext\nRoot/\n├── index.html\n└── /assets/api/examples/\n ├── assessmenttest.xml\n └── imsmanifest.xml\n\n```\n\n### Test components\n\nUse test components inside the qti-test component for added functionality.\n### Test next\n`<test-next> | TestNext`\n\n### Test prev\n\n`<test-prev> | TestPrev`\n### Test components\n\nYou can use normal class names to style the elements.\nAnd you can use the `test-prev` and `test-next` elements to navigate through the test.\n---\n\n\n### **Events:**\n - **qti-test-connected**\n- **qti-request-navigation**\n- **qti-navigation-error**\n- **qti-navigation-status**\n- **qti-test-loaded**\n- **qti-test-context-updated**\n\n### **Methods:**\n - **retryNavigation(): _void_** - Retry the last failed navigation",
961
+ "description": "`<qti-test>` is a custom element designed for rendering and interacting with QTI (Question and Test Interoperability) tests.\n\nThis component leverages several mixins to provide functionality for loading, navigating, processing, and displaying QTI test assessments.\n\n### Example Usage\n\nMinimal example including navigation:\n\n```html\n<qti-test>\n <test-navigation>\n <test-container test-url=\"./path/to/assessment.xml\"></test-container>\n <nav class=\"flex\">\n <test-prev></test-prev>\n <test-next></test-next>\n </nav>\n </test-navigation>\n</qti-test>\n```\n\nUse the following file structure\nA qti-test loads a QTI3.0 assessmenttest.xml file from a package folder.\n\n```plaintext\nRoot/\n├── index.html\n└── /assets/api/examples/\n ├── assessmenttest.xml\n └── imsmanifest.xml\n\n```\n\n### Test components\n\nUse test components inside the qti-test component for added functionality.\n### Test next\n`<test-next> | TestNext`\n\n### Test prev\n\n`<test-prev> | TestPrev`\n### Test components\n\nYou can use normal class names to style the elements.\nAnd you can use the `test-prev` and `test-next` elements to navigate through the test.\n---\n\n\n### **Events:**\n - **qti-test-connected**\n- **qti-request-navigation**\n- **qti-navigation-loading-started**\n- **qti-navigation-loading-ended**\n- **qti-navigation-error**\n- **qti-test-loaded**\n- **qti-test-context-updated**\n\n### **Methods:**\n - **navigateTo(type: _'item' | 'section'_, id: _string_): _void_** - Navigate to a specific item or section\n- **getLoadingProgress()** - Get current loading progress for external consumption",
970
962
  "attributes": [
971
963
  {
972
964
  "name": "navigate",
973
965
  "values": [{ "name": "item" }, { "name": "section" }]
974
966
  },
975
967
  { "name": "cache-transform", "values": [] },
976
- { "name": "requestTimeout", "values": [] },
977
- { "name": "showLoadingIndicators", "values": [] },
978
- {
979
- "name": "postLoadTransformCallback",
980
- "values": [{ "name": "PostLoadTransformCallback" }]
981
- },
982
- {
983
- "name": "postLoadTestTransformCallback",
984
- "values": [{ "name": "PostLoadTestTransformCallback" }]
985
- }
968
+ { "name": "requestTimeout", "values": [] }
986
969
  ],
987
970
  "references": []
988
971
  },
@@ -1056,17 +1039,12 @@
1056
1039
  },
1057
1040
  {
1058
1041
  "name": "test-container",
1059
- "description": "`<test-container>` is a custom element designed for hosting the qti-assessment-item.\nThe `qti-assessment-test` will be placed inside the shadow DOM of this element.\nThe element loads the test from the provided URL and renders it inside the shadow DOM.\n\n```html\n<qti-test>\n <test-navigation>\n <test-container class=\"m-4 bg-white\" test-url=\"./path/to/assessmenttest.xml\"></test-container>\n </test-navigation>\n</qti-test>\n```\n---\n",
1042
+ "description": "`<test-container>` is a custom element designed for hosting the qti-assessment-item.\nThe `qti-assessment-test` will be placed inside the shadow DOM of this element.\nThe element loads the test from the provided URL and renders it inside the shadow DOM.\n\n```html\n<qti-test>\n <test-navigation>\n <test-container class=\"m-4 bg-white\" test-url=\"./path/to/assessmenttest.xml\"></test-container>\n </test-navigation>\n</qti-test>\n```\n---\n\n\n### **Methods:**\n ",
1060
1043
  "attributes": [
1061
1044
  {
1062
1045
  "name": "test-url",
1063
1046
  "description": "URL of the item to load",
1064
1047
  "values": []
1065
- },
1066
- {
1067
- "name": "postLoadTestTransformCallback",
1068
- "description": "Callback function to transform the test after loading",
1069
- "values": [{ "name": "PostLoadTestTransformCallback" }]
1070
1048
  }
1071
1049
  ],
1072
1050
  "references": []
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "engines": {
22
22
  "node": ">=22.0.0"
23
23
  },
24
- "version": "7.12.0",
24
+ "version": "7.14.0",
25
25
  "type": "module",
26
26
  "main": "./dist/index.js",
27
27
  "types": "./dist/index.d.ts",
@@ -147,6 +147,10 @@
147
147
  "husky": "^9.1.7",
148
148
  "lit": "^3.3.0",
149
149
  "madge": "^8.0.0",
150
+ "mdx-mermaid": "^2.0.3",
151
+ "mermaid": "^11.12.0",
152
+ "msw": "^2.11.5",
153
+ "msw-storybook-addon": "^2.0.5",
150
154
  "nodemon": "^3.1.10",
151
155
  "npm-run-all": "^4.1.5",
152
156
  "path-browserify": "^1.0.1",
@@ -185,5 +189,10 @@
185
189
  "homepage": "https://github.com/Citolab/qti-components#readme",
186
190
  "overrides": {
187
191
  "storybook": "$storybook"
192
+ },
193
+ "msw": {
194
+ "workerDirectory": [
195
+ "public"
196
+ ]
188
197
  }
189
198
  }