@citolab/qti-components 7.17.0 → 7.18.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 (63) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +629 -278
  3. package/custom-elements.json +139 -1950
  4. package/dist/base.d.ts +11 -11
  5. package/dist/base.js +1 -1
  6. package/dist/{chunk-VEV4DGPH.js → chunk-3OCDS5FG.js} +2 -2
  7. package/dist/{chunk-C2HQFI2C.js → chunk-5D7GD3JS.js} +763 -481
  8. package/dist/chunk-5D7GD3JS.js.map +1 -0
  9. package/dist/{chunk-W4SQRNWO.js → chunk-5J5P5GJY.js} +4 -8
  10. package/dist/{chunk-W4SQRNWO.js.map → chunk-5J5P5GJY.js.map} +1 -1
  11. package/dist/{chunk-RI47B4ZT.js → chunk-DO3QY5GP.js} +2 -2
  12. package/dist/{chunk-DWIRLYDS.js → chunk-FOWDOLXY.js} +2 -2
  13. package/dist/{chunk-INKI27D5.js → chunk-GMNH42S6.js} +27 -36
  14. package/dist/chunk-GMNH42S6.js.map +1 -0
  15. package/dist/{chunk-2DOYPVF5.js → chunk-HRVIMT5Y.js} +4 -4
  16. package/dist/{chunk-O4XIWHTF.js → chunk-IDW2ETV2.js} +27 -12
  17. package/dist/chunk-IDW2ETV2.js.map +1 -0
  18. package/dist/{chunk-F44CI35W.js → chunk-L4TXKTUA.js} +2 -2
  19. package/dist/{chunk-JEUY3MYB.js → chunk-VUSGFL4B.js} +21 -17
  20. package/dist/chunk-VUSGFL4B.js.map +1 -0
  21. package/dist/{chunk-352OTVTY.js → chunk-YAPCC4BO.js} +37 -25
  22. package/dist/chunk-YAPCC4BO.js.map +1 -0
  23. package/dist/{computed-item.context-CiddHLPz.d.ts → computed-item.context-DfsW_96S.d.ts} +1 -1
  24. package/dist/{computed.context-CH09_LCR.d.ts → computed.context-DHbxad0N.d.ts} +2 -2
  25. package/dist/{config.context-DAdkDDf5.d.ts → config.context-DUz2-kxN.d.ts} +1 -1
  26. package/dist/elements.d.ts +5 -3
  27. package/dist/elements.js +4 -4
  28. package/dist/index.d.ts +10 -10
  29. package/dist/index.js +11 -11
  30. package/dist/{interaction-C5Up6-68.d.ts → interaction-BLQjAZqN.d.ts} +4 -4
  31. package/dist/interactions.d.ts +50 -119
  32. package/dist/interactions.js +4 -4
  33. package/dist/{item.context-BRKXBC3m.d.ts → item.context-CkUeDcaO.d.ts} +6 -1
  34. package/dist/item.css +1 -5
  35. package/dist/item.d.ts +3 -3
  36. package/dist/item.js +5 -5
  37. package/dist/loader.d.ts +3 -3
  38. package/dist/loader.js +2 -2
  39. package/dist/processing.d.ts +4 -4
  40. package/dist/processing.js +2 -2
  41. package/dist/qti-components-jsx.d.ts +6448 -2802
  42. package/dist/{qti-feedback-B4cMzOcq.d.ts → qti-feedback-BNXgxua1.d.ts} +2 -2
  43. package/dist/{qti-rule-base-dL4opfvi.d.ts → qti-rule-base-BZSb0WTW.d.ts} +4 -4
  44. package/dist/{qti-transform-test-Bz9A3hmD.d.ts → qti-transform-test-C2fL4PtU.d.ts} +1 -1
  45. package/dist/{test.context-Bpw1HNAZ.d.ts → test.context-Oc_8ovbV.d.ts} +3 -3
  46. package/dist/test.d.ts +28 -28
  47. package/dist/test.js +7 -7
  48. package/dist/transformers.d.ts +1 -1
  49. package/dist/transformers.js +1 -1
  50. package/dist/{variables-CusMRnyJ.d.ts → variables-CMYcDbyW.d.ts} +2 -1
  51. package/package.json +9 -9
  52. package/dist/chunk-352OTVTY.js.map +0 -1
  53. package/dist/chunk-C2HQFI2C.js.map +0 -1
  54. package/dist/chunk-INKI27D5.js.map +0 -1
  55. package/dist/chunk-JEUY3MYB.js.map +0 -1
  56. package/dist/chunk-O4XIWHTF.js.map +0 -1
  57. package/dist/vscode.css-custom-data.json +0 -11
  58. package/dist/vscode.html-custom-data.json +0 -960
  59. /package/dist/{chunk-VEV4DGPH.js.map → chunk-3OCDS5FG.js.map} +0 -0
  60. /package/dist/{chunk-RI47B4ZT.js.map → chunk-DO3QY5GP.js.map} +0 -0
  61. /package/dist/{chunk-DWIRLYDS.js.map → chunk-FOWDOLXY.js.map} +0 -0
  62. /package/dist/{chunk-2DOYPVF5.js.map → chunk-HRVIMT5Y.js.map} +0 -0
  63. /package/dist/{chunk-F44CI35W.js.map → chunk-L4TXKTUA.js.map} +0 -0
package/dist/elements.js CHANGED
@@ -15,11 +15,11 @@ import {
15
15
  QtiResponseProcessing,
16
16
  QtiRubricBlock,
17
17
  QtiStylesheet
18
- } from "./chunk-O4XIWHTF.js";
19
- import "./chunk-DWIRLYDS.js";
18
+ } from "./chunk-IDW2ETV2.js";
19
+ import "./chunk-FOWDOLXY.js";
20
20
  import "./chunk-2ZEJ3RR5.js";
21
- import "./chunk-INKI27D5.js";
22
- import "./chunk-JEUY3MYB.js";
21
+ import "./chunk-GMNH42S6.js";
22
+ import "./chunk-VUSGFL4B.js";
23
23
  import "./chunk-EUXUH3YW.js";
24
24
  export {
25
25
  QtiAssessmentItem,
package/dist/index.d.ts CHANGED
@@ -2,19 +2,19 @@ export { IMyQtiTest, IQtiTest, ITestNavigationMixin, ITestProcessingMixin, QtiAs
2
2
  export { ItemContainer, ItemCorrectResponseMode, ItemPrintVariables, ItemShowCandidateCorrection, ItemShowCorrectResponse, QtiItem } from './item.js';
3
3
  export { QtiAssessmentItem, QtiAssessmentStimulusRef, QtiAssessmentStimulusRefConnectedEvent, QtiCompanionMaterialsInfo, QtiContentBody, QtiCustomOperator, QtiFeedbackBlock, QtiFeedbackInline, QtiItemBody, QtiModalFeedback, QtiOutcomeDeclaration, QtiPrompt, QtiResponseDeclaration, QtiResponseProcessing, QtiRubricBlock, QtiStylesheet } from './elements.js';
4
4
  export { Orientation, QtiAssociableHotspot, QtiAssociateInteraction, QtiChoiceInteraction, QtiCustomInteraction, QtiEndAttemptInteraction, QtiExtendedTextInteraction, QtiGap, QtiGapImg, QtiGapMatchInteraction, QtiGapText, QtiGraphicAssociateInteraction, QtiGraphicGapMatchInteraction, QtiGraphicOrderInteraction, QtiHotspotChoice, QtiHotspotInteraction, QtiHottext, QtiHottextInteraction, QtiInlineChoice, QtiInlineChoiceInteraction, QtiMatchInteraction, QtiMediaInteraction, QtiOrderInteraction, QtiPortableCustomInteraction, QtiPositionObjectInteraction, QtiPositionObjectStage, QtiSelectPointInteraction, QtiSimpleAssociableChoice, QtiSimpleChoice, QtiSliderInteraction, QtiTextEntryInteraction, QtiUploadInteraction } from './interactions.js';
5
- export { M as ModuleResolutionConfig, q as qtiTransformItem, b as qtiTransformTest, t as transformItemApi, a as transformTestApi } from './qti-transform-test-Bz9A3hmD.js';
5
+ export { M as ModuleResolutionConfig, q as qtiTransformItem, a as qtiTransformTest, t as transformItemApi, b as transformTestApi } from './qti-transform-test-C2fL4PtU.js';
6
6
  export { qtiTransformManifest } from './transformers.js';
7
7
  export { ManifestInfo, getItemByUri, getManifestInfo } from './loader.js';
8
- export { C as ComputedItemContext, c as computedItemContext } from './computed-item.context-CiddHLPz.js';
9
- export { a as ComputedContext, C as ComputedItem, I as INITIAL_SESSION_CONTEXT, S as SessionContext, V as View, c as computedContext, s as sessionContext } from './computed.context-CH09_LCR.js';
10
- export { a as ConfigContext, C as CorrectResponseMode, c as configContext } from './config.context-DAdkDDf5.js';
11
- export { I as ItemContext, i as itemContextVariables } from './item.context-BRKXBC3m.js';
8
+ export { C as ComputedItemContext, c as computedItemContext } from './computed-item.context-DfsW_96S.js';
9
+ export { C as ComputedContext, a as ComputedItem, I as INITIAL_SESSION_CONTEXT, S as SessionContext, V as View, c as computedContext, s as sessionContext } from './computed.context-DHbxad0N.js';
10
+ export { C as ConfigContext, a as CorrectResponseMode, c as configContext } from './config.context-DUz2-kxN.js';
11
+ export { I as ItemContext, i as itemContextVariables } from './item.context-CkUeDcaO.js';
12
12
  export { IsNullOrUndefined, ScoringHelper, convertNumberToUniversalFormat, decimalSeparator, itemContext, removeDoubleSlashes } from './base.js';
13
- export { I as INITIAL_TEST_CONTEXT, a as QtiContext, Q as QtiContextType, T as TestContext, q as qtiContext, t as testContext } from './test.context-Bpw1HNAZ.js';
14
- export { C as Correctness, a as IInteraction, I as Interaction } from './interaction-C5Up6-68.js';
15
- export { a as QtiFeedback, Q as QtiVariableDeclaration } from './qti-feedback-B4cMzOcq.js';
16
- export { Q as QtiConditionExpression, b as QtiExpression, a as QtiExpressionBase, c as QtiRuleBase, d as QtiRuleElement } from './qti-rule-base-dL4opfvi.js';
17
- export { B as BaseType, C as Calculate, a as Cardinality, M as Multiple, O as Ordered, j as OutcomeVariable, b as QtiAreaMapEntry, Q as QtiAreaMapping, e as QtiMapEntry, c as QtiMapping, R as ResponseInteraction, k as ResponseVariable, T as TemplateVariable, h as VariableDeclaration, V as VariableValue, g as areaShape, d as directedPair, f as float, i as integer } from './variables-CusMRnyJ.js';
13
+ export { I as INITIAL_TEST_CONTEXT, Q as QtiContext, a as QtiContextType, T as TestContext, q as qtiContext, t as testContext } from './test.context-Oc_8ovbV.js';
14
+ export { C as Correctness, I as IInteraction, a as Interaction } from './interaction-BLQjAZqN.js';
15
+ export { Q as QtiFeedback, a as QtiVariableDeclaration } from './qti-feedback-BNXgxua1.js';
16
+ export { Q as QtiConditionExpression, a as QtiExpression, b as QtiExpressionBase, c as QtiRuleBase, d as QtiRuleElement } from './qti-rule-base-BZSb0WTW.js';
17
+ export { B as BaseType, C as Calculate, a as Cardinality, M as Multiple, O as Ordered, b as OutcomeVariable, Q as QtiAreaMapEntry, c as QtiAreaMapping, d as QtiMapEntry, e as QtiMapping, R as ResponseInteraction, f as ResponseVariable, T as TemplateVariable, V as VariableDeclaration, g as VariableValue, h as areaShape, i as directedPair, j as float, k as integer } from './variables-CMYcDbyW.js';
18
18
  export { QtiAnd, QtiBaseValue, QtiContainerSize, QtiContains, QtiCorrect, QtiDefault, QtiDelete, QtiEqual, QtiEqualRounded, QtiFieldValue, QtiGcd, QtiGt, QtiGte, QtiIndex, QtiIsNull, QtiLookupOutcomeValue, QtiLt, QtiLte, QtiMapResponse, QtiMapResponsePoint, QtiMatch, QtiMathOperator, QtiMember, QtiMultiple, QtiNot, QtiNull, QtiOr, QtiOrdered, QtiPower, QtiPrintedVariable, QtiProduct, QtiRandom, QtiRandomInteger, QtiResponseCondition, QtiResponseElse, QtiResponseElseIf, QtiResponseIf, QtiRound, QtiRoundTo, QtiSetOutcomeValue, QtiSetOutcomeValueRule, QtiStringMatch, QtiSubtract, QtiSum, QtiSumExpression, QtiVariable, qtiAndMixin, qtiSubtractMixin } from './processing.js';
19
19
  import 'lit';
20
20
  import '@heximal/templates';
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ import {
30
30
  QtiSliderInteraction,
31
31
  QtiTextEntryInteraction,
32
32
  QtiUploadInteraction
33
- } from "./chunk-C2HQFI2C.js";
33
+ } from "./chunk-5D7GD3JS.js";
34
34
  import {
35
35
  ItemContainer,
36
36
  ItemCorrectResponseMode,
@@ -38,11 +38,11 @@ import {
38
38
  ItemShowCandidateCorrection,
39
39
  ItemShowCorrectResponse,
40
40
  QtiItem
41
- } from "./chunk-2DOYPVF5.js";
41
+ } from "./chunk-HRVIMT5Y.js";
42
42
  import {
43
43
  getItemByUri,
44
44
  getManifestInfo
45
- } from "./chunk-VEV4DGPH.js";
45
+ } from "./chunk-3OCDS5FG.js";
46
46
  import {
47
47
  QtiAnd,
48
48
  QtiBaseValue,
@@ -92,7 +92,7 @@ import {
92
92
  QtiVariable,
93
93
  qtiAndMixin,
94
94
  qtiSubtractMixin
95
- } from "./chunk-RI47B4ZT.js";
95
+ } from "./chunk-DO3QY5GP.js";
96
96
  import {
97
97
  QtiAssessmentItemRef,
98
98
  QtiAssessmentSection,
@@ -118,7 +118,7 @@ import {
118
118
  TestStamp,
119
119
  TestView,
120
120
  TestViewToggle
121
- } from "./chunk-352OTVTY.js";
121
+ } from "./chunk-YAPCC4BO.js";
122
122
  import {
123
123
  QtiAssessmentItem,
124
124
  QtiAssessmentStimulusRef,
@@ -136,16 +136,16 @@ import {
136
136
  QtiResponseProcessing,
137
137
  QtiRubricBlock,
138
138
  QtiStylesheet
139
- } from "./chunk-O4XIWHTF.js";
140
- import "./chunk-DWIRLYDS.js";
141
- import "./chunk-W4SQRNWO.js";
142
- import "./chunk-F44CI35W.js";
139
+ } from "./chunk-IDW2ETV2.js";
140
+ import "./chunk-FOWDOLXY.js";
141
+ import "./chunk-5J5P5GJY.js";
142
+ import "./chunk-L4TXKTUA.js";
143
143
  import "./chunk-2ZEJ3RR5.js";
144
144
  import {
145
145
  qtiTransformItem,
146
146
  qtiTransformManifest,
147
147
  qtiTransformTest
148
- } from "./chunk-INKI27D5.js";
148
+ } from "./chunk-GMNH42S6.js";
149
149
  import {
150
150
  Correctness,
151
151
  INITIAL_SESSION_CONTEXT,
@@ -169,7 +169,7 @@ import {
169
169
  removeDoubleSlashes,
170
170
  sessionContext,
171
171
  testContext
172
- } from "./chunk-JEUY3MYB.js";
172
+ } from "./chunk-VUSGFL4B.js";
173
173
  import "./chunk-EUXUH3YW.js";
174
174
  export {
175
175
  Correctness,
@@ -1,6 +1,6 @@
1
1
  import { LitElement } from 'lit';
2
- import { a as ConfigContext } from './config.context-DAdkDDf5.js';
3
- import { k as ResponseVariable } from './variables-CusMRnyJ.js';
2
+ import { C as ConfigContext } from './config.context-DUz2-kxN.js';
3
+ import { f as ResponseVariable } from './variables-CMYcDbyW.js';
4
4
 
5
5
  interface IInteraction {
6
6
  correctResponse: Readonly<string | string[]>;
@@ -50,7 +50,7 @@ declare abstract class Interaction extends LitElement implements IInteraction {
50
50
  reportValidity(): boolean;
51
51
  reset(): void;
52
52
  connectedCallback(): void;
53
- saveResponse(value: string | string[]): void;
53
+ saveResponse(value: string | string[], state?: string | null): void;
54
54
  }
55
55
 
56
- export { Correctness as C, Interaction as I, type IInteraction as a };
56
+ export { Correctness as C, type IInteraction as I, Interaction as a };
@@ -1,9 +1,9 @@
1
1
  import * as lit from 'lit';
2
2
  import { CSSResultGroup, LitElement, PropertyValues, PropertyValueMap } from 'lit';
3
- import { a as IInteraction, I as Interaction, C as Correctness } from './interaction-C5Up6-68.js';
4
- import { a as ConfigContext } from './config.context-DAdkDDf5.js';
5
- import { a as Cardinality, B as BaseType } from './variables-CusMRnyJ.js';
6
- import { I as ItemContext } from './item.context-BRKXBC3m.js';
3
+ import { I as IInteraction, a as Interaction, C as Correctness } from './interaction-BLQjAZqN.js';
4
+ import { C as ConfigContext } from './config.context-DUz2-kxN.js';
5
+ import { a as Cardinality, B as BaseType } from './variables-CMYcDbyW.js';
6
+ import { I as ItemContext } from './item.context-CkUeDcaO.js';
7
7
  import * as lit_directives_ref_js from 'lit/directives/ref.js';
8
8
 
9
9
  declare const QtiAssociateInteraction_base: (abstract new (...args: any[]) => IInteraction) & typeof Interaction;
@@ -70,8 +70,35 @@ declare global {
70
70
  }
71
71
  }
72
72
 
73
+ /**
74
+ * QTI Custom Interaction component for legacy CES-based interactions.
75
+ *
76
+ * This component implements support for custom interactions originally built for the CES
77
+ * (Custom Element Standard) player - the predecessor to FACET and the Trifork QTI Player.
78
+ *
79
+ * @remarks
80
+ * The interaction workflow:
81
+ * 1. Fetch the CI manifest (JSON file with script, style, media references)
82
+ * 2. Check if bootstrap.js uses the CES API
83
+ * 3. If CES is used:
84
+ * - Fetch index.html from main window (where service worker/fetch works)
85
+ * - Inject registerCES proxy script for postMessage-based communication
86
+ * - Create blob URL and pass it to ciBootstrap
87
+ * 4. Create pciContainer iframe with style and bootstrap script
88
+ * 5. Handle postMessage events for getMedia, getResponse, setResponse, getBlobUrl
89
+ *
90
+ * The postMessage bridge is necessary because:
91
+ * - Iframes created via document.write() have about:blank origin
92
+ * - They cannot access the parent's global CES object (cross-origin)
93
+ * - Service workers don't control about:blank documents
94
+ *
95
+ * Messages are sent to all parent windows to support embedding scenarios like Storybook
96
+ * where window.top might not be the actual host application.
97
+ */
73
98
  declare class QtiCustomInteraction extends Interaction {
74
99
  private rawResponse;
100
+ private _manifestUrl;
101
+ private _resourceBaseUrl;
75
102
  constructor();
76
103
  data: string;
77
104
  baseItemUrl: string;
@@ -83,8 +110,20 @@ declare class QtiCustomInteraction extends Interaction {
83
110
  style: string[];
84
111
  media: string[];
85
112
  };
113
+ private _contentBlobUrl;
86
114
  connectedCallback(): void;
87
- setupCES(): void;
115
+ /**
116
+ * Sets up the CES custom interaction by creating the iframe structure and
117
+ * handling the CES API communication via postMessage.
118
+ *
119
+ * For interactions that use CES, this method:
120
+ * 1. Fetches the original bootstrap.js and checks if it uses CES
121
+ * 2. If CES is used, fetches index.html and injects the registerCES proxy
122
+ * 3. Creates a blob URL for the modified HTML (stored in _contentBlobUrl)
123
+ * 4. Replaces bootstrap.js with ciBootstrap that loads the blob URL
124
+ * 5. Sets up postMessage listeners for CES API calls
125
+ */
126
+ setupCES(): Promise<void>;
88
127
  private getIFrames;
89
128
  private getInnerIFrames;
90
129
  private postToWindowAndIframes;
@@ -94,6 +133,10 @@ declare class QtiCustomInteraction extends Interaction {
94
133
  set response(val: string | string[] | null);
95
134
  disconnectedCallback(): void;
96
135
  render(): lit.TemplateResult<1>;
136
+ private getBaseCandidates;
137
+ private getManifestBaseUrl;
138
+ private getManifestParentBaseUrl;
139
+ private resolveResourceWithFallback;
97
140
  }
98
141
  declare global {
99
142
  interface HTMLElementTagNameMap {
@@ -370,68 +413,6 @@ declare global {
370
413
  }
371
414
  }
372
415
 
373
- interface PciReadyPayload {
374
- responseIdentifier: string;
375
- status: 'interacting' | 'suspended' | 'closed' | 'solution' | 'review';
376
- }
377
- interface PciDonePayload {
378
- responseIdentifier: string;
379
- status: 'interacting' | 'suspended' | 'closed' | 'solution' | 'review';
380
- outcome?: unknown;
381
- }
382
- interface ConfigProperties<T> {
383
- properties: T;
384
- templateVariables: Record<string, unknown>;
385
- contextVariables: Record<string, unknown>;
386
- boundTo: unknown;
387
- responseIdentifier: string;
388
- onready: (payload: PciReadyPayload) => void;
389
- ondone?: (payload: PciDonePayload) => void;
390
- status?: 'interacting' | 'suspended' | 'closed' | 'solution' | 'review';
391
- }
392
- interface IMSpci<T> {
393
- typeIdentifier: string;
394
- /** @access public
395
- * @method getInstance Create a new instance of this portable custom interaction
396
- * Will be called by the qtiCustomInteractionContext
397
- * @param {DOM Element} dom - the DOM Element this PCI is being added to
398
- * @param {Object} configuration - the configuration to apply to this PCI
399
- * @param {String} state - a previous saved state to apply to this instance.
400
- * This must have been obtained from a prior call to getState on an
401
- * instance of this type (same typeIdentifier)
402
- */
403
- getInstance: (dom: HTMLElement, configuration: Configuration<T>, state: string) => void;
404
- /** @access public
405
- * @method getResponse
406
- * @return {Object} - the value to assign to the bound QTI response variable
407
- */
408
- getResponse: () => QtiVariableJSON | undefined;
409
- /** @access public
410
- * @method setResponse
411
- * @param {Object} value - the value to assign to the bound QTI response variable
412
- * NOTE: This is not an official QTI method, so no guarantee it is implemented
413
- * in all PCIs.
414
- */
415
- setResponse: (value: QtiVariableJSON) => void;
416
- /** @access public
417
- * @method getState
418
- * @return {String} The current state of this PCI. May be passed to
419
- * getInstance to later restore this PCI instance.
420
- */
421
- getState: () => string;
422
- /** @access public
423
- * @method setState
424
- * @param {String} value - a state previously obtained from getState
425
- * to restore this PCI instance to a prior state.
426
- */
427
- setState(value: string): unknown;
428
- oncompleted?: () => void;
429
- destroy?: () => void;
430
- }
431
- declare type Configuration<T> = {
432
- onready: (pci: IMSpci<ConfigProperties<T>>, state?: string) => void;
433
- properties: T;
434
- };
435
416
  type QtiFileData = {
436
417
  data: string;
437
418
  mime: string;
@@ -488,31 +469,16 @@ declare type QtiVariableJSON = {
488
469
  list?: QtiListTypeJSON;
489
470
  record?: QtiRecordItem[] | null;
490
471
  };
491
- interface ModuleResolutionConfig {
492
- waitSeconds?: number;
493
- context?: string;
494
- catchError?: boolean;
495
- paths: {
496
- [key: string]: string | string[];
497
- };
498
- shim?: {
499
- [key: string]: {
500
- deps?: string[];
501
- exports?: string;
502
- };
503
- };
504
- }
505
472
 
506
473
  declare class QtiPortableCustomInteraction extends Interaction {
507
474
  private _value;
508
- private pci;
509
475
  protected _iframeLoaded: boolean;
510
476
  protected _pendingMessages: Array<{
511
477
  method: string;
512
478
  params: any;
513
479
  }>;
514
480
  protected iframe: HTMLIFrameElement;
515
- private _responseCheckInterval;
481
+ protected _iframeMessageOrigin: string | null;
516
482
  static styles: CSSResultGroup;
517
483
  module: string;
518
484
  customInteractionTypeIdentifier: string;
@@ -520,13 +486,11 @@ declare class QtiPortableCustomInteraction extends Interaction {
520
486
  requireShimJson: string;
521
487
  requireJsUrl: string;
522
488
  baseUrl: string;
523
- useIframe: boolean;
524
489
  useDefaultShims: boolean;
525
490
  useDefaultPaths: boolean;
526
491
  private _errorMessage;
527
492
  protected context?: ItemContext;
528
- response: string | string[];
529
- private dom;
493
+ response: string | string[] | null;
530
494
  private _parsedRequirePaths;
531
495
  private _parsedRequireShim;
532
496
  /**
@@ -578,10 +542,6 @@ declare class QtiPortableCustomInteraction extends Interaction {
578
542
  * Unescape HTML entities in all values of an object
579
543
  */
580
544
  private unescapeDataAttributes;
581
- /**
582
- * DIRECT MODE: Register PCI instance
583
- */
584
- register(pci: IMSpci<ConfigProperties<unknown>>): void;
585
545
  disconnectedCallback(): void;
586
546
  /**
587
547
  * IFRAME MODE: Send message to iframe
@@ -616,35 +576,6 @@ declare class QtiPortableCustomInteraction extends Interaction {
616
576
  */
617
577
  private initializeInteraction;
618
578
  connectedCallback(): void;
619
- /**
620
- * Stop checking for response changes
621
- */
622
- private stopResponseCheck;
623
- private _onInteractionChanged;
624
- /**
625
- * DIRECT MODE: Build RequireJS configuration
626
- */
627
- buildRequireConfig(): ModuleResolutionConfig;
628
- /**
629
- * DIRECT MODE: Helper method to combine require paths
630
- */
631
- private combineRequireResolvePaths;
632
- /**
633
- * DIRECT MODE: Helper method to remove double slashes
634
- */
635
- private removeDoubleSlashes;
636
- /**
637
- * DIRECT MODE: Load config from URL
638
- */
639
- loadConfig: (url: string, baseUrl?: string) => Promise<ModuleResolutionConfig>;
640
- /**
641
- * DIRECT MODE: Helper method to get resolvable path string
642
- */
643
- getResolvablePathString: (path: string, basePath?: string) => string;
644
- /**
645
- * DIRECT MODE: Helper method to get resolvable path
646
- */
647
- getResolvablePath: (path: string | string[], basePath?: string) => string | string[];
648
579
  /**
649
580
  * IFRAME MODE: Generate iframe HTML content
650
581
  */
@@ -30,11 +30,11 @@ import {
30
30
  QtiSliderInteraction,
31
31
  QtiTextEntryInteraction,
32
32
  QtiUploadInteraction
33
- } from "./chunk-C2HQFI2C.js";
34
- import "./chunk-DWIRLYDS.js";
35
- import "./chunk-F44CI35W.js";
33
+ } from "./chunk-5D7GD3JS.js";
34
+ import "./chunk-FOWDOLXY.js";
35
+ import "./chunk-L4TXKTUA.js";
36
36
  import "./chunk-2ZEJ3RR5.js";
37
- import "./chunk-JEUY3MYB.js";
37
+ import "./chunk-VUSGFL4B.js";
38
38
  import "./chunk-EUXUH3YW.js";
39
39
  export {
40
40
  QtiAssociableHotspot,
@@ -1,9 +1,14 @@
1
- import { h as VariableDeclaration } from './variables-CusMRnyJ.js';
1
+ import { V as VariableDeclaration } from './variables-CMYcDbyW.js';
2
2
 
3
3
  interface ItemContext {
4
4
  identifier?: string;
5
5
  href?: string;
6
6
  variables?: ReadonlyArray<VariableDeclaration<string | string[] | null>>;
7
+ /**
8
+ * Optional per-interaction opaque state, keyed by responseIdentifier.
9
+ * Used for interactions that support state save/restore (e.g. PCI).
10
+ */
11
+ state?: Record<string, string | null>;
7
12
  }
8
13
  declare const itemContextVariables: VariableDeclaration<string | string[]>[];
9
14
 
package/dist/item.css CHANGED
@@ -1818,8 +1818,6 @@
1818
1818
  text-orientation: upright;
1819
1819
  }
1820
1820
 
1821
- /* stylelint-disable number-max-precision */
1822
-
1823
1821
  @layer qti-base {
1824
1822
  .qti-layout-row {
1825
1823
  display: flex;
@@ -2112,7 +2110,6 @@ qti-response-declaration {
2112
2110
  }
2113
2111
  }
2114
2112
 
2115
- /* stylelint-disable-next-line no-descending-specificity */
2116
2113
  & qti-simple-choice {
2117
2114
  width: -moz-fit-content;
2118
2115
  width: fit-content;
@@ -2121,7 +2118,6 @@ qti-response-declaration {
2121
2118
  /* Keep the checkmark for non-hidden input controls */
2122
2119
  &:state(correct-response),
2123
2120
  &[data-correct-response='true'] {
2124
- /* stylelint-disable-next-line no-descending-specificity */
2125
2121
  &::after {
2126
2122
  content: '\02714';
2127
2123
  color: var(--qti-correct);
@@ -2367,7 +2363,7 @@ qti-response-declaration {
2367
2363
  &:focus {
2368
2364
  box-shadow: 0 0 0 var(--qti-focus-border-width) var(--qti-focus-color);
2369
2365
  }
2370
-
2366
+
2371
2367
  &:state(candidate-correct) {
2372
2368
  background-color: var(--qti-correct);
2373
2369
  }
package/dist/item.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
- import { C as ComputedItemContext } from './computed-item.context-CiddHLPz.js';
4
- import { a as ConfigContext } from './config.context-DAdkDDf5.js';
5
- import './variables-CusMRnyJ.js';
3
+ import { C as ComputedItemContext } from './computed-item.context-DfsW_96S.js';
4
+ import { C as ConfigContext } from './config.context-DUz2-kxN.js';
5
+ import './variables-CMYcDbyW.js';
6
6
 
7
7
  /**
8
8
  * `<item-container>` is a custom element designed for hosting the qti-assessment-item.
package/dist/item.js CHANGED
@@ -5,12 +5,12 @@ import {
5
5
  ItemShowCandidateCorrection,
6
6
  ItemShowCorrectResponse,
7
7
  QtiItem
8
- } from "./chunk-2DOYPVF5.js";
9
- import "./chunk-W4SQRNWO.js";
10
- import "./chunk-F44CI35W.js";
8
+ } from "./chunk-HRVIMT5Y.js";
9
+ import "./chunk-5J5P5GJY.js";
10
+ import "./chunk-L4TXKTUA.js";
11
11
  import "./chunk-2ZEJ3RR5.js";
12
- import "./chunk-INKI27D5.js";
13
- import "./chunk-JEUY3MYB.js";
12
+ import "./chunk-GMNH42S6.js";
13
+ import "./chunk-VUSGFL4B.js";
14
14
  import "./chunk-EUXUH3YW.js";
15
15
  export {
16
16
  ItemContainer,
package/dist/loader.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { QtiAssessmentItem } from './elements.js';
2
2
  import 'lit';
3
- import './variables-CusMRnyJ.js';
4
- import './qti-feedback-B4cMzOcq.js';
5
- import './item.context-BRKXBC3m.js';
3
+ import './variables-CMYcDbyW.js';
4
+ import './item.context-CkUeDcaO.js';
5
+ import './qti-feedback-BNXgxua1.js';
6
6
 
7
7
  type ManifestInfo = {
8
8
  testIdentifier: string;
package/dist/loader.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  getItemByUri,
3
3
  getManifestInfo
4
- } from "./chunk-VEV4DGPH.js";
5
- import "./chunk-INKI27D5.js";
4
+ } from "./chunk-3OCDS5FG.js";
5
+ import "./chunk-GMNH42S6.js";
6
6
  import "./chunk-EUXUH3YW.js";
7
7
  export {
8
8
  getItemByUri,
@@ -1,9 +1,9 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, nothing } from 'lit';
3
- import { c as QtiRuleBase, b as QtiExpression, a as QtiExpressionBase, Q as QtiConditionExpression } from './qti-rule-base-dL4opfvi.js';
4
- import { I as ItemContext } from './item.context-BRKXBC3m.js';
5
- import { B as BaseType, k as ResponseVariable, h as VariableDeclaration } from './variables-CusMRnyJ.js';
6
- import { T as TestContext } from './test.context-Bpw1HNAZ.js';
3
+ import { c as QtiRuleBase, a as QtiExpression, b as QtiExpressionBase, Q as QtiConditionExpression } from './qti-rule-base-BZSb0WTW.js';
4
+ import { I as ItemContext } from './item.context-CkUeDcaO.js';
5
+ import { B as BaseType, f as ResponseVariable, V as VariableDeclaration } from './variables-CMYcDbyW.js';
6
+ import { T as TestContext } from './test.context-Oc_8ovbV.js';
7
7
 
8
8
  declare class QtiRule extends LitElement implements QtiRuleBase {
9
9
  render(): lit.TemplateResult<1>;
@@ -47,8 +47,8 @@ import {
47
47
  QtiVariable,
48
48
  qtiAndMixin,
49
49
  qtiSubtractMixin
50
- } from "./chunk-RI47B4ZT.js";
51
- import "./chunk-JEUY3MYB.js";
50
+ } from "./chunk-DO3QY5GP.js";
51
+ import "./chunk-VUSGFL4B.js";
52
52
  import "./chunk-EUXUH3YW.js";
53
53
  export {
54
54
  QtiAnd,