@citolab/qti-components 10.0.0-next.14 → 10.0.0-next.16

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 (72) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +1643 -2742
  3. package/dist/base.d.ts +32 -8
  4. package/dist/base.js +7 -1
  5. package/dist/{chunk-HGKLF7SP.js → chunk-4DC5Z2LQ.js} +2 -2
  6. package/dist/{chunk-MP2SUN7J.js → chunk-7MYZHZWV.js} +981 -383
  7. package/dist/chunk-7MYZHZWV.js.map +1 -0
  8. package/dist/{chunk-LFVPS7KB.js → chunk-DAOLVUTR.js} +2 -2
  9. package/dist/{chunk-CCI3QMQA.js → chunk-H3Z3TMFB.js} +55 -60
  10. package/dist/chunk-H3Z3TMFB.js.map +1 -0
  11. package/dist/{chunk-LEF7AAYZ.js → chunk-J3F3JSCW.js} +2 -2
  12. package/dist/{chunk-NYNL5HSR.js → chunk-L3LBSAGZ.js} +2 -2
  13. package/dist/{chunk-BZPMN57E.js → chunk-L7J2ZOJL.js} +2 -2
  14. package/dist/{chunk-TLAVOBEM.js → chunk-LORYM4U2.js} +120 -1
  15. package/dist/chunk-LORYM4U2.js.map +1 -0
  16. package/dist/{chunk-6XRNX574.js → chunk-LQ65RILE.js} +141 -106
  17. package/dist/chunk-LQ65RILE.js.map +1 -0
  18. package/dist/{chunk-C7SYDLMG.js → chunk-M4TZIB3W.js} +61 -27
  19. package/dist/chunk-M4TZIB3W.js.map +1 -0
  20. package/dist/{chunk-S5GLISQA.js → chunk-NWSDBYK7.js} +2 -2
  21. package/dist/{chunk-O2ENNGKV.js → chunk-NZ7ZC4SP.js} +126 -7
  22. package/dist/chunk-NZ7ZC4SP.js.map +1 -0
  23. package/dist/{chunk-SWNFCQ4G.js → chunk-OG5HIRHE.js} +4 -4
  24. package/dist/{chunk-TU34FFWF.js → chunk-UDJ7MHLF.js} +4 -4
  25. package/dist/chunk-UDJ7MHLF.js.map +1 -0
  26. package/dist/chunk-WWY2H2YO.js +7 -0
  27. package/dist/chunk-WWY2H2YO.js.map +1 -0
  28. package/dist/{computed.types.d-IXACuBr7.d.ts → computed.types.d-n3K2VvB0.d.ts} +2 -2
  29. package/dist/{config.context.d-BniMHSBB.d.ts → config.context.d-CCqlJXpE.d.ts} +2 -1
  30. package/dist/corrections.d.ts +119 -15
  31. package/dist/corrections.js +9 -9
  32. package/dist/elements.d.ts +67 -16
  33. package/dist/elements.js +4 -4
  34. package/dist/index.d.ts +11 -11
  35. package/dist/index.js +21 -15
  36. package/dist/interactions.d.ts +83 -17
  37. package/dist/interactions.js +3 -3
  38. package/dist/item.css +1133 -2370
  39. package/dist/item.d.ts +4 -4
  40. package/dist/item.js +5 -5
  41. package/dist/loader.d.ts +1 -1
  42. package/dist/loader.js +2 -2
  43. package/dist/processing.js +3 -3
  44. package/dist/qti-components-jsx.d.ts +1239 -214
  45. package/dist/{qti-feedback.d-DbzPSJuK.d.ts → qti-feedback.d-1JL_qHjc.d.ts} +7 -0
  46. package/dist/{qti-item.d-BqWYBdV2.d.ts → qti-item.d-DDMDjWIk.d.ts} +2 -2
  47. package/dist/{qti-test.d-C0I1BIdH.d.ts → qti-test.d-CDdyCp6e.d.ts} +21 -18
  48. package/dist/{qti-text-entry-interaction.d-V4sWE9TO.d.ts → qti-text-entry-interaction.d-BTAKmr4b.d.ts} +160 -50
  49. package/dist/{qti-transform-test.d-BL7GGFJj.d.ts → qti-transform-test.d-Bb9vnLzP.d.ts} +1 -0
  50. package/dist/{record.d-C6m0Y4xr.d.ts → record.d-Bojj6_LW.d.ts} +34 -3
  51. package/dist/{session.context.d-DW09Lrie.d.ts → session.context.d-BNxGeyh9.d.ts} +1 -1
  52. package/dist/test.d.ts +9 -9
  53. package/dist/test.js +6 -6
  54. package/dist/transformers.d.ts +1 -1
  55. package/dist/transformers.js +1 -1
  56. package/package.json +11 -11
  57. package/dist/chunk-6XRNX574.js.map +0 -1
  58. package/dist/chunk-C7SYDLMG.js.map +0 -1
  59. package/dist/chunk-CCI3QMQA.js.map +0 -1
  60. package/dist/chunk-MP2SUN7J.js.map +0 -1
  61. package/dist/chunk-O2ENNGKV.js.map +0 -1
  62. package/dist/chunk-Q4MJCEDE.js +0 -7
  63. package/dist/chunk-Q4MJCEDE.js.map +0 -1
  64. package/dist/chunk-TLAVOBEM.js.map +0 -1
  65. package/dist/chunk-TU34FFWF.js.map +0 -1
  66. /package/dist/{chunk-HGKLF7SP.js.map → chunk-4DC5Z2LQ.js.map} +0 -0
  67. /package/dist/{chunk-LFVPS7KB.js.map → chunk-DAOLVUTR.js.map} +0 -0
  68. /package/dist/{chunk-LEF7AAYZ.js.map → chunk-J3F3JSCW.js.map} +0 -0
  69. /package/dist/{chunk-NYNL5HSR.js.map → chunk-L3LBSAGZ.js.map} +0 -0
  70. /package/dist/{chunk-BZPMN57E.js.map → chunk-L7J2ZOJL.js.map} +0 -0
  71. /package/dist/{chunk-S5GLISQA.js.map → chunk-NWSDBYK7.js.map} +0 -0
  72. /package/dist/{chunk-SWNFCQ4G.js.map → chunk-OG5HIRHE.js.map} +0 -0
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk-S5GLISQA.js";
1
+ import "./chunk-NWSDBYK7.js";
2
2
  import {
3
3
  CandidateCorrectionMixin,
4
4
  ChoiceCorrectionMixin,
@@ -35,7 +35,7 @@ import {
35
35
  TestNavigationCorrection,
36
36
  TestShowCorrectResponse,
37
37
  correctionPart
38
- } from "./chunk-CCI3QMQA.js";
38
+ } from "./chunk-H3Z3TMFB.js";
39
39
  import {
40
40
  QTI_TEST_STATE_VERSION,
41
41
  QtiAssessmentItemRef,
@@ -83,8 +83,8 @@ import {
83
83
  pluginElements,
84
84
  pluginState,
85
85
  ttsElements
86
- } from "./chunk-6XRNX574.js";
87
- import "./chunk-HGKLF7SP.js";
86
+ } from "./chunk-LQ65RILE.js";
87
+ import "./chunk-4DC5Z2LQ.js";
88
88
  import {
89
89
  PUBLIC_ITEM_EVENTS,
90
90
  QtiAssessmentItem,
@@ -111,8 +111,8 @@ import {
111
111
  dispatchPublic,
112
112
  listenDeclared,
113
113
  listenPublic
114
- } from "./chunk-C7SYDLMG.js";
115
- import "./chunk-LEF7AAYZ.js";
114
+ } from "./chunk-M4TZIB3W.js";
115
+ import "./chunk-J3F3JSCW.js";
116
116
  import {
117
117
  QtiAssociableHotspot,
118
118
  QtiAssociateInteraction,
@@ -149,26 +149,26 @@ import {
149
149
  inlineScriptText,
150
150
  inlineStyleText,
151
151
  qtiInteractionElements
152
- } from "./chunk-MP2SUN7J.js";
153
- import "./chunk-BZPMN57E.js";
152
+ } from "./chunk-7MYZHZWV.js";
153
+ import "./chunk-L7J2ZOJL.js";
154
154
  import {
155
155
  ItemContainer,
156
156
  ItemPrintVariables,
157
157
  ItemViewMixin,
158
158
  QtiItem
159
- } from "./chunk-SWNFCQ4G.js";
160
- import "./chunk-Q4MJCEDE.js";
159
+ } from "./chunk-OG5HIRHE.js";
160
+ import "./chunk-WWY2H2YO.js";
161
161
  import "./chunk-4DB4SC5K.js";
162
162
  import {
163
163
  getItemByUri,
164
164
  getManifestInfo
165
- } from "./chunk-LFVPS7KB.js";
165
+ } from "./chunk-DAOLVUTR.js";
166
166
  import {
167
167
  qtiTransformItem,
168
168
  qtiTransformManifest,
169
169
  qtiTransformTest
170
- } from "./chunk-TLAVOBEM.js";
171
- import "./chunk-NYNL5HSR.js";
170
+ } from "./chunk-LORYM4U2.js";
171
+ import "./chunk-L3LBSAGZ.js";
172
172
  import {
173
173
  QtiAnd,
174
174
  QtiAnyN,
@@ -246,7 +246,7 @@ import {
246
246
  QtiVariable,
247
247
  qtiAndMixin,
248
248
  qtiSubtractMixin
249
- } from "./chunk-TU34FFWF.js";
249
+ } from "./chunk-UDJ7MHLF.js";
250
250
  import {
251
251
  CustomStateSetShim,
252
252
  INITIAL_SESSION_CONTEXT,
@@ -260,6 +260,7 @@ import {
260
260
  QtiFeedback,
261
261
  QtiRuleElement,
262
262
  QtiVariableDeclaration,
263
+ STATE_ALIASES,
263
264
  ScoringHelper,
264
265
  asSeed,
265
266
  boxSizing,
@@ -271,6 +272,7 @@ import {
271
272
  decimalSeparator,
272
273
  dropRegion,
273
274
  getCustomOperator,
275
+ hasState,
274
276
  inferRecordFieldBaseType,
275
277
  installCustomStateSetFallback,
276
278
  interactionContext,
@@ -291,10 +293,11 @@ import {
291
293
  serializePoint,
292
294
  serializeResponseAttribute,
293
295
  sessionContext,
296
+ setState,
294
297
  testContext,
295
298
  unregisterCustomOperator,
296
299
  validationMessage
297
- } from "./chunk-O2ENNGKV.js";
300
+ } from "./chunk-NZ7ZC4SP.js";
298
301
  export {
299
302
  CandidateCorrectionMixin,
300
303
  ChoiceCorrectionMixin,
@@ -486,6 +489,7 @@ export {
486
489
  QtiUploadInteraction,
487
490
  QtiVariable,
488
491
  QtiVariableDeclaration,
492
+ STATE_ALIASES,
489
493
  ScoringHelper,
490
494
  TestBookmark,
491
495
  TestCheckItem,
@@ -532,6 +536,7 @@ export {
532
536
  getCustomOperator,
533
537
  getItemByUri,
534
538
  getManifestInfo,
539
+ hasState,
535
540
  inferRecordFieldBaseType,
536
541
  inlineScriptText,
537
542
  inlineStyleText,
@@ -564,6 +569,7 @@ export {
564
569
  serializePoint,
565
570
  serializeResponseAttribute,
566
571
  sessionContext,
572
+ setState,
567
573
  testContext,
568
574
  ttsElements,
569
575
  unregisterCustomOperator,
@@ -1,10 +1,10 @@
1
- import { a as QtiAssociateInteraction, b as QtiChoiceInteraction, c as QtiExtendedTextInteraction, f as QtiGapMatchInteraction, h as QtiGraphicAssociateInteraction, i as QtiGraphicGapMatchInteraction, j as QtiGraphicOrderInteraction, l as QtiHotspotInteraction, n as QtiHottextInteraction, p as QtiInlineChoiceInteraction, q as QtiMatchInteraction, r as QtiOrderInteraction, s as QtiPortableCustomInteraction, B as QtiPortableCustomInteractionTest, u as QtiSelectPointInteraction, x as QtiSliderInteraction, y as QtiTextEntryInteraction, Q as QtiAssociableHotspot, d as QtiGap, e as QtiGapImg, g as QtiGapText, k as QtiHotspotChoice, m as QtiHottext, o as QtiInlineChoice, t as QtiPrompt, v as QtiSimpleAssociableChoice, w as QtiSimpleChoice } from './qti-text-entry-interaction.d-V4sWE9TO.js';
2
- export { O as Orientation, z as inlineScriptText, A as inlineStyleText } from './qti-text-entry-interaction.d-V4sWE9TO.js';
1
+ import { a as QtiAssociateInteraction, b as QtiChoiceInteraction, c as QtiExtendedTextInteraction, f as QtiGapMatchInteraction, h as QtiGraphicAssociateInteraction, i as QtiGraphicGapMatchInteraction, j as QtiGraphicOrderInteraction, l as QtiHotspotInteraction, n as QtiHottextInteraction, p as QtiInlineChoiceInteraction, q as QtiMatchInteraction, r as QtiOrderInteraction, s as QtiPortableCustomInteraction, B as QtiPortableCustomInteractionTest, u as QtiSelectPointInteraction, x as QtiSliderInteraction, y as QtiTextEntryInteraction, Q as QtiAssociableHotspot, d as QtiGap, e as QtiGapImg, g as QtiGapText, k as QtiHotspotChoice, m as QtiHottext, o as QtiInlineChoice, t as QtiPrompt, v as QtiSimpleAssociableChoice, w as QtiSimpleChoice } from './qti-text-entry-interaction.d-BTAKmr4b.js';
2
+ export { O as Orientation, z as inlineScriptText, A as inlineStyleText } from './qti-text-entry-interaction.d-BTAKmr4b.js';
3
3
  import * as lit from 'lit';
4
- import { CSSResultGroup, LitElement, PropertyValueMap } from 'lit';
5
- import { I as Interaction } from './record.d-C6m0Y4xr.js';
4
+ import { CSSResultGroup, LitElement } from 'lit';
5
+ import { I as Interaction, c as ValidityTrigger } from './record.d-Bojj6_LW.js';
6
6
  import './interaction.interface.d-CvjHM2bi.js';
7
- import './config.context.d-BniMHSBB.js';
7
+ import './config.context.d-CCqlJXpE.js';
8
8
  import './item.types.d-DuVR0ZVK.js';
9
9
  import './qti.context.d-CejJMlfZ.js';
10
10
  import 'lit/directives/ref.js';
@@ -13,6 +13,10 @@ import 'lit/directives/ref.js';
13
13
  * Upload interaction: candidates attach a file as their response.
14
14
  *
15
15
  * @slot prompt - The prompt shown above the file input.
16
+ *
17
+ * @csspart input - The file input element.
18
+ * @cssstate disabled - The interaction is switched off.
19
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
16
20
  */
17
21
  declare class QtiUploadInteraction extends Interaction {
18
22
  #private;
@@ -33,27 +37,76 @@ declare global {
33
37
  }
34
38
 
35
39
  /**
36
- * Position-object interaction: candidates place draggable objects onto a stage image.
40
+ * Position object interaction (QTI 3, 3.2.16): the candidate places copies of an image (the
41
+ * object) on another image (the stage, the parent `qti-position-object-stage`). The response is a
42
+ * list of `point`s, each the object's centre point in the stage image's own coordinates (its
43
+ * `width`/`height` attributes, else its natural size), whatever size the stage is shown at.
44
+ *
45
+ * Placing:
46
+ * - drag the object onto the stage, or click it and then click the stage;
47
+ * - keyboard: focus the object and press Enter or Space to place a copy at the stage's centre;
48
+ * on a placed copy, the arrow keys move it (Shift: ten times as far) and Delete or Backspace
49
+ * removes it;
50
+ * - drag a placed copy to move it, or off the stage to remove it.
51
+ *
52
+ * At `max-choices` (default 1; 0 = no limit) no further copy is placed and the host carries
53
+ * `:state(used)`. Area-mapping areas are never shown, only the candidate's positions.
37
54
  *
38
- * @slot - Default slot for the object choices and stage.
55
+ * @customElement qti-position-object-interaction
56
+ * @slot - The object image (`img` or `picture`).
57
+ * @attr {number} [max-choices=1] - Most positions; 0 = no limit.
58
+ * @attr {number} [min-choices=0] - Fewest positions for a valid response.
59
+ * @attr {string} center-point - The object's centre point, `x y` (or `x,y`) from its top-left, in
60
+ * the object's own pixels. Default: the centre of its box.
61
+ *
62
+ * @csspart object - The object to place, beside the stage. Tokens: `selected` while a click has
63
+ * picked it up (the next click on the stage places it); `used` at `max-choices`.
64
+ * @csspart point - Each placed copy on the stage.
65
+ * @csspart message - The validation message, hidden until `reportValidity` shows it.
66
+ * @cssstate used - Every allowed copy is placed (`max-choices` reached).
67
+ * @cssstate disabled - The interaction is switched off.
68
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
39
69
  */
40
- declare class QtiPositionObjectInteraction extends LitElement {
70
+ declare class QtiPositionObjectInteraction extends Interaction {
71
+ #private;
41
72
  static styles: CSSResultGroup;
73
+ maxChoices: number;
74
+ minChoices: number;
75
+ centerPoint: string | null;
76
+ response: string[] | null;
77
+ /** Bumped when the stage image changes size, so the copies are placed again. */
78
+ private _layout;
79
+ /** A copy following the pointer: the index it moves (-1: a new one) and where it is, in client px. */
80
+ private _drag;
81
+ /** The object was clicked: the next click on the stage places it. */
82
+ private _armed;
83
+ protected _handleResponseChange: () => void;
84
+ validate(): boolean;
85
+ reportValidity(options?: {
86
+ trigger?: ValidityTrigger;
87
+ }): boolean;
88
+ reset(): void;
89
+ connectedCallback(): void;
90
+ disconnectedCallback(): void;
42
91
  render(): lit.TemplateResult<1>;
43
92
  }
93
+ declare global {
94
+ interface HTMLElementTagNameMap {
95
+ 'qti-position-object-interaction': QtiPositionObjectInteraction;
96
+ }
97
+ }
44
98
 
99
+ /**
100
+ * The stage of one or more position object interactions: the image the objects are placed on, and
101
+ * the containing block of their placed copies. Layout only: each `qti-position-object-interaction`
102
+ * inside it handles its own input and response, measured against this stage's image.
103
+ *
104
+ * @customElement qti-position-object-stage
105
+ * @slot - The stage image (`img` or `picture`), then the interactions.
106
+ */
45
107
  declare class QtiPositionObjectStage extends LitElement {
46
108
  static styles: CSSResultGroup;
47
- choiceOrdering: boolean;
48
- startX: any;
49
- startY: any;
50
- dragElement: any;
51
109
  render(): lit.TemplateResult<1>;
52
- constructor();
53
- dragElementHandler(event: MouseEvent): void;
54
- firstUpdated(a: PropertyValueMap<any>): void;
55
- removeMoveListener(): void;
56
- disconnectedCallback(): void;
57
110
  }
58
111
  declare global {
59
112
  interface HTMLElementTagNameMap {
@@ -66,6 +119,11 @@ declare global {
66
119
  *
67
120
  * @slot prompt - The prompt shown above the media element.
68
121
  * @slot - Default slot for the embedded media element.
122
+ *
123
+ * No parts: the media element is slotted light DOM and is styled directly.
124
+ *
125
+ * @cssstate disabled - The interaction is switched off.
126
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
69
127
  */
70
128
  declare class QtiMediaInteraction extends Interaction {
71
129
  #private;
@@ -99,6 +157,9 @@ declare global {
99
157
  * session, so no further attempt can start (QTI info model §2.5).
100
158
  *
101
159
  * @csspart button - The end-attempt button element.
160
+ *
161
+ * No states: the element has no internals; `disabled` and `readonly` are read off the item and
162
+ * land on the button's `disabled` attribute.
102
163
  */
103
164
  declare class QtiEndAttemptInteraction extends LitElement {
104
165
  #private;
@@ -148,6 +209,11 @@ declare global {
148
209
  *
149
210
  * Messages are sent to all parent windows to support embedding scenarios like Storybook
150
211
  * where window.top might not be the actual host application.
212
+ *
213
+ * No parts: the interaction renders inside an iframe it owns, and the iframe is not themed.
214
+ *
215
+ * @cssstate disabled - The interaction is switched off.
216
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
151
217
  */
152
218
  declare class QtiCustomInteraction extends Interaction {
153
219
  #private;
@@ -1,4 +1,4 @@
1
- import "./chunk-LEF7AAYZ.js";
1
+ import "./chunk-J3F3JSCW.js";
2
2
  import {
3
3
  QtiAssociableHotspot,
4
4
  QtiAssociateInteraction,
@@ -35,9 +35,9 @@ import {
35
35
  inlineScriptText,
36
36
  inlineStyleText,
37
37
  qtiInteractionElements
38
- } from "./chunk-MP2SUN7J.js";
38
+ } from "./chunk-7MYZHZWV.js";
39
39
  import "./chunk-4DB4SC5K.js";
40
- import "./chunk-O2ENNGKV.js";
40
+ import "./chunk-NZ7ZC4SP.js";
41
41
  export {
42
42
  QtiAssociableHotspot,
43
43
  QtiAssociateInteraction,