@citolab/qti-components 10.0.0-next.15 → 10.0.0-next.17

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 (84) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +1503 -2931
  3. package/dist/base.d.ts +37 -11
  4. package/dist/base.js +8 -1
  5. package/dist/{chunk-G2EIC7H2.js → chunk-7MYZHZWV.js} +955 -364
  6. package/dist/chunk-7MYZHZWV.js.map +1 -0
  7. package/dist/chunk-DJ7PB252.js +7 -0
  8. package/dist/chunk-DJ7PB252.js.map +1 -0
  9. package/dist/{chunk-F553IZPL.js → chunk-J3F3JSCW.js} +2 -2
  10. package/dist/chunk-J6VX4N7M.js +197 -0
  11. package/dist/chunk-J6VX4N7M.js.map +1 -0
  12. package/dist/{chunk-32PI7KWX.js → chunk-L3LBSAGZ.js} +2 -2
  13. package/dist/{chunk-WIUPAUJV.js → chunk-L7J2ZOJL.js} +2 -2
  14. package/dist/{chunk-IM5AKPIJ.js → chunk-NZ7ZC4SP.js} +96 -4
  15. package/dist/chunk-NZ7ZC4SP.js.map +1 -0
  16. package/dist/{chunk-XY5DHYIH.js → chunk-OG5HIRHE.js} +3 -3
  17. package/dist/chunk-PZ5AY32C.js +10 -0
  18. package/dist/chunk-PZ5AY32C.js.map +1 -0
  19. package/dist/{chunk-HT3LSWXL.js → chunk-QLGUI5VG.js} +2 -2
  20. package/dist/chunk-UCXLDQYA.js +56 -0
  21. package/dist/chunk-UCXLDQYA.js.map +1 -0
  22. package/dist/{chunk-5AJZGRWI.js → chunk-UDJ7MHLF.js} +4 -4
  23. package/dist/chunk-UDJ7MHLF.js.map +1 -0
  24. package/dist/{chunk-MIQZBDTB.js → chunk-UURHLJVM.js} +107 -1809
  25. package/dist/chunk-UURHLJVM.js.map +1 -0
  26. package/dist/{chunk-IWNRQVNW.js → chunk-V5GL7PTC.js} +2 -2
  27. package/dist/{chunk-QT7WQXCS.js → chunk-WGUQCB2Z.js} +28 -82
  28. package/dist/chunk-WGUQCB2Z.js.map +1 -0
  29. package/dist/chunk-WWY2H2YO.js +7 -0
  30. package/dist/chunk-WWY2H2YO.js.map +1 -0
  31. package/dist/{chunk-URYYGVTA.js → chunk-ZAHZVBV7.js} +60 -75
  32. package/dist/chunk-ZAHZVBV7.js.map +1 -0
  33. package/dist/{computed.types.d-IXACuBr7.d.ts → computed.types.d-D4wskgi0.d.ts} +2 -2
  34. package/dist/corrections.d.ts +123 -20
  35. package/dist/corrections.js +11 -11
  36. package/dist/corrections.js.map +1 -1
  37. package/dist/elements.d.ts +35 -112
  38. package/dist/elements.js +8 -5
  39. package/dist/index.d.ts +18 -14
  40. package/dist/index.js +29 -63
  41. package/dist/interactions.d.ts +84 -17
  42. package/dist/interactions.js +4 -3
  43. package/dist/item.css +1057 -2383
  44. package/dist/item.d.ts +6 -4
  45. package/dist/item.js +5 -4
  46. package/dist/item.types.d-Zc6ZQDhu.d.ts +25 -0
  47. package/dist/loader.d.ts +4 -2
  48. package/dist/loader.js +1 -0
  49. package/dist/processing.d.ts +4 -3
  50. package/dist/processing.js +4 -3
  51. package/dist/public-events.d-3dGip9pd.d.ts +105 -0
  52. package/dist/qti-components-jsx.d.ts +4058 -4421
  53. package/dist/{qti-condition-expression.d-B-T1NNl0.d.ts → qti-condition-expression.d-7Kd4LBxn.d.ts} +1 -1
  54. package/dist/{qti-expression.d-B-Cfbqlb.d.ts → qti-expression.d-iH3w6mqf.d.ts} +2 -1
  55. package/dist/{qti-feedback.d-GAqMqAt6.d.ts → qti-feedback.d-CT0W-8Gm.d.ts} +2 -2
  56. package/dist/{qti-item.d-pFcNk0th.d.ts → qti-item.d-CLChmRvB.d.ts} +2 -1
  57. package/dist/qti-test-state-BAf5AmJ2.d.ts +68 -0
  58. package/dist/qti-test-state.d-D8Q89RzZ.d.ts +57 -0
  59. package/dist/{qti-test.d-BjhVQnQy.d.ts → qti-test.d-COzv7YZG.d.ts} +14 -548
  60. package/dist/{qti-text-entry-interaction.d-DECzpIzi.d.ts → qti-text-entry-interaction.d-DsUyecBC.d.ts} +144 -43
  61. package/dist/{record.d-CljDLwRz.d.ts → record.d-BfZhFr0L.d.ts} +34 -3
  62. package/dist/{session.context.d-DW09Lrie.d.ts → session.context.d-9gRdGK4T.d.ts} +2 -2
  63. package/dist/test-plugin-api.d.ts +134 -0
  64. package/dist/test-plugin-api.js +19 -0
  65. package/dist/test-plugin-api.js.map +1 -0
  66. package/dist/test.d.ts +16 -158
  67. package/dist/test.js +13 -52
  68. package/dist/transformers.js +1 -0
  69. package/dist/{item.types.d-DuVR0ZVK.d.ts → variables.d-DWHlTszN.d.ts} +1 -23
  70. package/package.json +13 -9
  71. package/dist/chunk-5AJZGRWI.js.map +0 -1
  72. package/dist/chunk-G2EIC7H2.js.map +0 -1
  73. package/dist/chunk-IM5AKPIJ.js.map +0 -1
  74. package/dist/chunk-MIQZBDTB.js.map +0 -1
  75. package/dist/chunk-QT7WQXCS.js.map +0 -1
  76. package/dist/chunk-RNLSNH4N.js +0 -7
  77. package/dist/chunk-RNLSNH4N.js.map +0 -1
  78. package/dist/chunk-URYYGVTA.js.map +0 -1
  79. /package/dist/{chunk-F553IZPL.js.map → chunk-J3F3JSCW.js.map} +0 -0
  80. /package/dist/{chunk-32PI7KWX.js.map → chunk-L3LBSAGZ.js.map} +0 -0
  81. /package/dist/{chunk-WIUPAUJV.js.map → chunk-L7J2ZOJL.js.map} +0 -0
  82. /package/dist/{chunk-XY5DHYIH.js.map → chunk-OG5HIRHE.js.map} +0 -0
  83. /package/dist/{chunk-HT3LSWXL.js.map → chunk-QLGUI5VG.js.map} +0 -0
  84. /package/dist/{chunk-IWNRQVNW.js.map → chunk-V5GL7PTC.js.map} +0 -0
@@ -1,9 +1,10 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, CSSResultGroup, PropertyValues } from 'lit';
3
- import { I as Interaction, b as RecordValue } from './record.d-CljDLwRz.js';
3
+ import { I as Interaction, c as ValidityTrigger, b as RecordValue } from './record.d-BfZhFr0L.js';
4
4
  import { V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
5
5
  import { C as ConfigContext } from './config.context.d-CCqlJXpE.js';
6
- import { B as BaseType, a as Cardinality, b as ItemContext, Q as QtiAreaMapEntry } from './item.types.d-DuVR0ZVK.js';
6
+ import { B as BaseType, a as Cardinality, Q as QtiAreaMapEntry } from './variables.d-DWHlTszN.js';
7
+ import { I as ItemContext } from './item.types.d-Zc6ZQDhu.js';
7
8
  import { Q as QtiContext } from './qti.context.d-CejJMlfZ.js';
8
9
  import * as lit_directives_ref_js from 'lit/directives/ref.js';
9
10
 
@@ -99,9 +100,21 @@ declare global {
99
100
  }
100
101
 
101
102
  declare const QtiHotspotChoice_base: (abstract new (...args: any[]) => ActiveElementMixinInterface) & typeof LitElement;
103
+ /**
104
+ * A clickable area on the image of `qti-hotspot-interaction` or `qti-graphic-order-interaction`.
105
+ *
106
+ * @customElement qti-hotspot-choice
107
+ * @cssstate checked - Chosen by the candidate.
108
+ * @cssstate disabled - Switched off by the interaction.
109
+ * @cssstate readonly - Frozen by the interaction.
110
+ * @attr {number} data-order - Graphic order: the 1-based position the candidate gave this choice.
111
+ * A theme prints it with `attr(data-order)`. Reflected from the `order` property; the old
112
+ * `aria-ordervalue` spelling (not an ARIA attribute) is written too for one major.
113
+ */
102
114
  declare class QtiHotspotChoice extends QtiHotspotChoice_base {
103
115
  static styles: CSSResultGroup;
104
116
  order: number;
117
+ protected updated(changed: PropertyValues<this>): void;
105
118
  }
106
119
  declare global {
107
120
  interface HTMLElementTagNameMap {
@@ -244,7 +257,7 @@ interface DragDropState {
244
257
  * Target identifier -> how many chips it holds for capacity purposes.
245
258
  *
246
259
  * Deliberately *not* `dragsByTarget[id].length`. Capacity counts
247
- * `max(draggablesSelector matches, [qti-draggable] matches)`, because a dropped clone may not
260
+ * `max(draggablesSelector matches, [data-draggable] matches)`, because a dropped clone may not
248
261
  * match the interaction's structural selector (match-interaction's nested choices do; a bare
249
262
  * clone elsewhere may only carry the attribute). Response serialisation uses the selector
250
263
  * only. Collapsing the two would silently change `matchMax` behaviour.
@@ -418,7 +431,7 @@ type DragDropCore = Interaction & {
418
431
  initiateDrag(dragElement: HTMLElement, startX: number, startY: number, inputType: 'mouse' | 'touch', eventSource?: 'pointer' | 'mouse' | 'touch', pointerId?: number, startedFromTrustedEvent?: boolean): void;
419
432
  createDragClone(element: HTMLElement, rect: DOMRect): HTMLElement;
420
433
  updateClonePosition(clientX: number, clientY: number): void;
421
- activateAllDroppables(): void;
434
+ activateAllDroppables(fromDroppable?: boolean): void;
422
435
  setupMoveObservables(inputType: 'mouse' | 'touch', eventSource?: 'pointer' | 'mouse' | 'touch'): void;
423
436
  };
424
437
  interface DragState {
@@ -455,7 +468,9 @@ type DragDropSlotted = DragDropCore & DropzoneAutoSize & {
455
468
  disableAnimations: boolean;
456
469
  enableFlipAnimations: boolean;
457
470
  validate(): boolean;
458
- reportValidity(): boolean;
471
+ reportValidity(options?: {
472
+ trigger?: ValidityTrigger;
473
+ }): boolean;
459
474
  reset(): void;
460
475
  saveResponse(value?: string | string[]): void;
461
476
  shouldTreatBlockedMaxAsInvalid(): boolean;
@@ -506,11 +521,15 @@ declare const QtiAssociateInteraction_base: (abstract new (...args: any[]) => Dr
506
521
  * @slot prompt - The prompt shown above the choices.
507
522
  * @slot qti-simple-associable-choice - The associable choice sources.
508
523
  *
509
- * @csspart drags - Wrapper around the associable choice slot.
524
+ * @csspart bank - The slot holding the unplaced chips (was `drags`).
510
525
  * @csspart drops - The container holding all drop targets.
511
- * @csspart drop-row - Container for one left/right drop pair.
512
- * @csspart drop - Each individual drop target.
526
+ * @csspart row - One left/right drop pair (was `drop-row`).
527
+ * @csspart drop - Each individual drop target. Tokens: `filled`, `full`, `drag-active`, `drag-over`
528
+ * (a plain div cannot carry `:state()`, so the state names are part tokens here).
513
529
  * @csspart message - Live validation message region (role="alert").
530
+ * @cssstate disabled - The interaction is switched off.
531
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
532
+ * @cssstate drag-active - A drag is in progress (was `dragzone-active`, `dragzone-enabled`).
514
533
  */
515
534
  declare class QtiAssociateInteraction extends QtiAssociateInteraction_base {
516
535
  #private;
@@ -565,8 +584,10 @@ declare const QtiChoiceInteraction_base: (abstract new (...args: any[]) => {}) &
565
584
  * @slot - Default slot for `qti-simple-choice` elements.
566
585
  *
567
586
  * @csspart prompt - Wrapper around the prompt slot.
568
- * @csspart slot - Wrapper around the default slot containing the choices.
587
+ * @csspart choices - The slot holding the choices (was `slot`).
569
588
  * @csspart message - Live validation message region (role="alert").
589
+ * @cssstate disabled - The interaction is switched off.
590
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
570
591
  */
571
592
  declare class QtiChoiceInteraction extends QtiChoiceInteraction_base implements ChoicesInterface {
572
593
  #private;
@@ -617,6 +638,9 @@ declare global {
617
638
  * @slot prompt - The prompt shown above the textarea.
618
639
  *
619
640
  * @csspart textarea - The textarea input element.
641
+ * @csspart message - The validation message, hidden until `reportValidity` shows it.
642
+ * @cssstate disabled - The interaction is switched off.
643
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
620
644
  */
621
645
  declare class QtiExtendedTextInteraction extends Interaction {
622
646
  #private;
@@ -649,7 +673,9 @@ declare class QtiExtendedTextInteraction extends Interaction {
649
673
  get value(): string | null;
650
674
  set value(val: string | null);
651
675
  validate(): boolean;
652
- reportValidity(): boolean;
676
+ reportValidity(options?: {
677
+ trigger?: ValidityTrigger;
678
+ }): boolean;
653
679
  /** The prompt, above the field. */
654
680
  protected renderPrompt(): unknown;
655
681
  /** The field itself. */
@@ -689,9 +715,13 @@ declare const QtiGapMatchInteraction_base: (abstract new (...args: any[]) => Dra
689
715
  * @slot drags - The draggable choice sources.
690
716
  * @slot - Default slot for the drop targets (gaps).
691
717
  *
692
- * @csspart drags - Wrapper around the drag sources slot.
693
- * @csspart drops - Wrapper around the drop targets slot.
718
+ * @csspart bank - The slot holding the unplaced chips (was `drags`).
719
+ * @csspart drops - Wrapper around the drop targets slot. The targets themselves are `qti-gap`
720
+ * elements in the light DOM; they carry their own states (`drop`, `filled`, `full`, …).
694
721
  * @csspart message - Live validation message region (role="alert").
722
+ * @cssstate disabled - The interaction is switched off.
723
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
724
+ * @cssstate drag-active - A drag is in progress (was `dragzone-active`, `dragzone-enabled`).
695
725
  */
696
726
  declare class QtiGapMatchInteraction extends QtiGapMatchInteraction_base {
697
727
  static styles: CSSResultGroup;
@@ -711,10 +741,19 @@ declare global {
711
741
  * @slot prompt - The prompt shown above the image.
712
742
  * @slot - Default slot for hotspot choices layered over the image.
713
743
  *
714
- * @csspart line - Each line drawn by the candidate.
715
- * @csspart correct-line - Each line displayed as part of the correct response.
716
- * @csspart point - Each in-progress endpoint indicator.
744
+ * @csspart line - Each line drawn by the candidate. Tokens: `answer-key` on a line of the correct
745
+ * response, drawn by `qti-corrections` (was the part `correct-line`).
746
+ * @csspart point - The in-progress line from the first chosen hotspot to the pointer.
747
+ *
748
+ * Interaction: click (or Enter / Space on a focused point) a point to start a line, then another
749
+ * point to finish it. The chosen start point carries `:state(checked)`; clicking it again, Escape,
750
+ * or a click on the image away from the points cancels. A point that already takes its `match-max`
751
+ * lines carries `:state(full)` and cannot start or end another. Click a line (or focus it and press
752
+ * Enter, Space, Delete or Backspace) to remove it. The response is `pair`, undirected: "B A" is the
753
+ * existing "A B", and a point cannot be paired with itself.
717
754
  * @csspart message - Live validation message region (role="alert").
755
+ * @cssstate disabled - The interaction is switched off.
756
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
718
757
  */
719
758
  declare class QtiGraphicAssociateInteraction extends Interaction {
720
759
  #private;
@@ -724,8 +763,15 @@ declare class QtiGraphicAssociateInteraction extends Interaction {
724
763
  grImage: any[];
725
764
  private _response;
726
765
  constructor();
766
+ /** Fewest associations a valid response holds (QTI `min-associations`, default 0). */
767
+ minAssociations: number;
768
+ /** Most associations a candidate can draw (QTI `max-associations`, default 1; 0 = no limit). */
769
+ maxAssociations: number;
727
770
  reset(): void;
728
771
  validate(): boolean;
772
+ reportValidity(options?: {
773
+ trigger?: ValidityTrigger;
774
+ }): boolean;
729
775
  set response(val: string | string[] | null);
730
776
  get response(): string[] | null;
731
777
  /** Extension hook for optional SVG lines rendered above the candidate response. */
@@ -749,8 +795,11 @@ declare const QtiGraphicGapMatchInteraction_base: (abstract new (...args: any[])
749
795
  * @slot - Default slot for the base image and hotspots.
750
796
  *
751
797
  * @csspart image - Wrapper around the image slot.
752
- * @csspart drags - Wrapper around the drag sources slot.
798
+ * @csspart bank - The slot holding the unplaced chips (was `drags`).
753
799
  * @csspart message - Live validation message region (role="alert").
800
+ * @cssstate disabled - The interaction is switched off.
801
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
802
+ * @cssstate drag-active - A drag is in progress (was `dragzone-active`, `dragzone-enabled`).
754
803
  */
755
804
  declare class QtiGraphicGapMatchInteraction extends QtiGraphicGapMatchInteraction_base {
756
805
  #private;
@@ -793,6 +842,8 @@ declare const QtiGraphicOrderInteraction_base: (abstract new (...args: any[]) =>
793
842
  * @slot - Default slot for the image and hotspot choices.
794
843
  *
795
844
  * @csspart message - Live validation message region (role="alert").
845
+ * @cssstate disabled - The interaction is switched off.
846
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
796
847
  */
797
848
  declare class QtiGraphicOrderInteraction extends QtiGraphicOrderInteraction_base {
798
849
  #private;
@@ -822,6 +873,10 @@ declare const QtiHotspotInteraction_base: (abstract new (...args: any[]) => Choi
822
873
  *
823
874
  * @slot prompt - The prompt shown above the image.
824
875
  * @slot - Default slot for the image and hotspot choices.
876
+ *
877
+ * @csspart message - Live validation message region (role="alert").
878
+ * @cssstate disabled - The interaction is switched off.
879
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
825
880
  */
826
881
  declare class QtiHotspotInteraction extends QtiHotspotInteraction_base {
827
882
  #private;
@@ -852,6 +907,8 @@ declare const QtiHottextInteraction_base: (abstract new (...args: any[]) => Choi
852
907
  * @slot - Default slot for the mixed content and `qti-hottext` choices.
853
908
  *
854
909
  * @csspart message - Live validation message region (role="alert").
910
+ * @cssstate disabled - The interaction is switched off.
911
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
855
912
  */
856
913
  declare class QtiHottextInteraction extends QtiHottextInteraction_base {
857
914
  static styles: CSSResultGroup;
@@ -887,12 +944,19 @@ declare const QtiInlineChoiceInteraction_base: (abstract new (...args: any[]) =>
887
944
  *
888
945
  * @csspart trigger - The dropdown trigger button.
889
946
  * @csspart value - The currently displayed value inside the trigger.
890
- * @csspart dropdown-icon - The chevron icon inside the trigger; also carries `dropdown-icon-open` when open.
947
+ * @csspart icon - The chevron inside the trigger (was `dropdown-icon`). Tokens: `open` while the
948
+ * menu is open (was `dropdown-icon-open`).
891
949
  * @csspart menu - The popover element containing the option list.
892
- * @csspart option - Each option button; also carries `option-prompt`, `option-selected` and
893
- * `option-clear` (the prompt row as a clear button, see `data-clear-label`) variants.
894
- * @csspart option-content - The content wrapper inside each option.
950
+ * @csspart option - The prompt row in the menu: the way back to "nothing chosen". Tokens: `prompt`;
951
+ * `selected` while nothing is chosen; `clear` when the row is the clear button (see
952
+ * `data-clear-label`). Were `option-prompt`, `option-selected`, `option-clear`. The other rows
953
+ * are `qti-inline-choice` elements and carry their own parts and states.
954
+ * @csspart option-content - The content wrapper inside the prompt row.
895
955
  * @csspart clear-icon - The x glyph inside the clear row.
956
+ * @csspart message - The validation message, hidden until `reportValidity` shows it.
957
+ * @cssstate disabled - The interaction is switched off.
958
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
959
+ * @cssstate open - The menu is open. The chosen option carries `checked`, on the `qti-inline-choice`.
896
960
  */
897
961
  declare class QtiInlineChoiceInteraction extends QtiInlineChoiceInteraction_base {
898
962
  #private;
@@ -988,7 +1052,9 @@ declare class QtiInlineChoiceInteraction extends QtiInlineChoiceInteraction_base
988
1052
  */
989
1053
  menuAutoSizeExtraWidth(): number;
990
1054
  validate(): boolean;
991
- reportValidity(): boolean;
1055
+ reportValidity(options?: {
1056
+ trigger?: ValidityTrigger;
1057
+ }): boolean;
992
1058
  reset(): void;
993
1059
  /**
994
1060
  * Captures an attribute-set response before slotted options have been
@@ -1037,18 +1103,21 @@ declare const QtiMatchInteraction_base: (abstract new (...args: any[]) => DragDr
1037
1103
  *
1038
1104
  * @csspart grid - The tabular grid container.
1039
1105
  * @csspart corner - The top-left corner cell of the grid; shows `data-first-column-header`.
1040
- * @csspart cols-wrap - Wrapper row for the column headers.
1041
- * @csspart c-header - The column header slot wrapper.
1042
- * @csspart rows-wrap - Wrapper column for the row headers.
1043
- * @csspart r-header - The row header slot wrapper.
1044
- * @csspart checkbox-grid - The interactive cell grid area.
1045
- * @csspart input-cell - Each cell's label element.
1046
- * @csspart control - The visible checkbox/radio box (tabular mode). Also carries the variant
1047
- * tokens `radio` | `checkbox`, `checked`, and `correct` | `incorrect` — e.g.
1048
- * `::part(control radio checked correct)`. These mirror the custom-state vocabulary; the cells
1049
- * are plain spans in the shadow root, so they cannot carry real `:state()`.
1050
- * @csspart control-mark - The inner mark element; carries the same variant tokens as `control`.
1106
+ * @csspart columns - Wrapper row for the column headers (was `cols-wrap`).
1107
+ * @csspart column-header - The column header slot (was `c-header`).
1108
+ * @csspart rows - Wrapper column for the row headers (was `rows-wrap`).
1109
+ * @csspart row-header - The row header slot (was `r-header`).
1110
+ * @csspart cells - The interactive cell grid area (was `checkbox-grid`).
1111
+ * @csspart cell - Each cell's label element (was `input-cell`).
1112
+ * @csspart control - The visible checkbox/radio box (tabular mode). Tokens: `radio` | `checkbox`,
1113
+ * `checked`, `candidate-correct` | `candidate-incorrect` — e.g.
1114
+ * `::part(control radio checked candidate-correct)`. These mirror the custom-state vocabulary;
1115
+ * the cells are plain spans in the shadow root, so they cannot carry real `:state()`.
1116
+ * @csspart control-mark - The inner mark element; carries the same tokens as `control`.
1051
1117
  * @csspart message - Live validation message region (role="alert").
1118
+ * @cssstate disabled - The interaction is switched off.
1119
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
1120
+ * @cssstate drag-active - A drag is in progress (was `dragzone-active`, `dragzone-enabled`).
1052
1121
  */
1053
1122
  declare class QtiMatchInteraction extends QtiMatchInteraction_base {
1054
1123
  static styles: CSSResultGroup;
@@ -1128,11 +1197,16 @@ declare const QtiOrderInteraction_base: (abstract new (...args: any[]) => DragDr
1128
1197
  * @slot prompt - The prompt shown above the interaction.
1129
1198
  * @slot drags - The draggable choice sources.
1130
1199
  *
1131
- * @csspart container - The outer container wrapping drags and drops.
1132
- * @csspart drags - Wrapper around the drag sources slot.
1200
+ * @csspart container - The outer container wrapping the bank and the drops.
1201
+ * @csspart bank - The slot holding the unplaced chips (was `drags`).
1133
1202
  * @csspart drops - The drop-target region.
1134
- * @csspart drop - Each individual drop target.
1135
- * @csspart drag - A choice that has been placed into a drop target.
1203
+ * @csspart drop - Each individual drop target. Tokens: `filled`, `full`, `drag-active`, `drag-over`
1204
+ * (a plain div cannot carry `:state()`, so the state names are part tokens here).
1205
+ * @csspart chip - A choice placed into a drop target (was `drag`).
1206
+ * @csspart message - Live validation message region (role="alert").
1207
+ * @cssstate disabled - The interaction is switched off.
1208
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
1209
+ * @cssstate drag-active - A drag is in progress (was `dragzone-active`, `dragzone-enabled`).
1136
1210
  */
1137
1211
  declare class QtiOrderInteraction extends QtiOrderInteraction_base {
1138
1212
  static styles: lit.CSSResult[];
@@ -1265,6 +1339,15 @@ declare const inlineScriptText: (text: string) => string;
1265
1339
  declare const inlineStyleText: (text: string) => string;
1266
1340
  /** A response value as this interaction holds it: a record response is its field map. */
1267
1341
  type PciResponseValue = string | string[] | RecordValue;
1342
+ /**
1343
+ * Portable custom interaction (PCI): hosts a third-party interaction module.
1344
+ *
1345
+ * No parts: the PCI renders its own markup into the default slot (or into an iframe) and the
1346
+ * element adds nothing of its own to theme.
1347
+ *
1348
+ * @cssstate disabled - The interaction is switched off.
1349
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
1350
+ */
1268
1351
  declare class QtiPortableCustomInteraction extends Interaction {
1269
1352
  #private;
1270
1353
  protected _iframeLoaded: boolean;
@@ -1477,7 +1560,11 @@ declare global {
1477
1560
  * @slot prompt - The prompt shown above the image.
1478
1561
  * @slot - Default slot for the base image.
1479
1562
  *
1480
- * @csspart point - Each selected point marker.
1563
+ * @csspart point - Each selected point marker. Tokens: `candidate-correct` |
1564
+ * `candidate-incorrect` when `qti-corrections` has marked it.
1565
+ * @csspart message - The validation message, hidden until `reportValidity` shows it.
1566
+ * @cssstate disabled - The interaction is switched off.
1567
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
1481
1568
  * @cssprop --qti-select-point-icon - Marker mask image (SVG data URL). Should be a solid silhouette for color inheritance.
1482
1569
  * @cssprop --qti-select-point-marker-size - Marker size.
1483
1570
  * @cssprop --qti-select-point-marker-anchor - Vertical translate anchor (`-100%` for bottom tip, `-50%` for center).
@@ -1502,6 +1589,11 @@ declare class QtiSelectPointInteraction extends Interaction {
1502
1589
  */
1503
1590
  areaMappings: string | null;
1504
1591
  private _areaEntries;
1592
+ /**
1593
+ * Every route into the response (a click, a removed marker, a restore, a reset) updates the form
1594
+ * value and the validity; a click or a removal also reports, as a change.
1595
+ */
1596
+ protected _handleResponseChange: () => void;
1505
1597
  protected _handleAreaMappingsChange: () => void;
1506
1598
  protected get _effectiveAreaEntries(): QtiAreaMapEntry[];
1507
1599
  connectedCallback(): void;
@@ -1517,7 +1609,9 @@ declare class QtiSelectPointInteraction extends Interaction {
1517
1609
  protected positionOverlayElements(elements: Iterable<HTMLElement>): void;
1518
1610
  render(): lit.TemplateResult<1>;
1519
1611
  validate(): boolean;
1520
- reportValidity(): boolean;
1612
+ reportValidity(options?: {
1613
+ trigger?: ValidityTrigger;
1614
+ }): boolean;
1521
1615
  firstUpdated(): void;
1522
1616
  disconnectedCallback(): void;
1523
1617
  }
@@ -1536,9 +1630,11 @@ declare global {
1536
1630
  * @csspart bounds - The min/max bounds label wrapper.
1537
1631
  * @csspart ticks - The tick marks along the rail.
1538
1632
  * @csspart rail - The rail element the knob slides along.
1539
- * @csspart knob - The draggable knob.
1540
- * @csspart value - The current value display (used twice in the layout).
1541
- * @csspart knob-correct - Ghost knob shown at the correct response position.
1633
+ * @csspart knob - The draggable knob. Tokens: `answer-key` on the ghost knob `qti-corrections`
1634
+ * draws at the correct response (was the part `knob-correct`).
1635
+ * @csspart value - The current value display.
1636
+ * @cssstate disabled - The interaction is switched off.
1637
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
1542
1638
  */
1543
1639
  declare class QtiSliderInteraction extends Interaction {
1544
1640
  #private;
@@ -1586,9 +1682,12 @@ declare global {
1586
1682
  * single-line input has no formatting to render: it can show neither preserved line breaks nor
1587
1683
  * markup. The field is always plain text, so this is not planned either.
1588
1684
  *
1589
- * @csspart answer - The answer-key line, revealed above the field when the correct response is shown.
1685
+ * @csspart answer-key - The correct answer, revealed above the field when the correct response is
1686
+ * shown (was `answer`).
1590
1687
  * @csspart input - The text input element.
1591
1688
  * @csspart message - The validation message, hidden until `reportValidity` shows it.
1689
+ * @cssstate disabled - The interaction is switched off.
1690
+ * @cssstate readonly - The interaction is frozen: it shows its value and takes no input.
1592
1691
  */
1593
1692
  declare class QtiTextEntryInteraction extends Interaction {
1594
1693
  static styles: CSSResultGroup;
@@ -1612,7 +1711,9 @@ declare class QtiTextEntryInteraction extends Interaction {
1612
1711
  protected renderValidationMessage(): unknown;
1613
1712
  render(): lit.TemplateResult<1>;
1614
1713
  protected textChanged(event: Event): void;
1615
- reportValidity(): boolean;
1714
+ reportValidity(options?: {
1715
+ trigger?: ValidityTrigger;
1716
+ }): boolean;
1616
1717
  reset(): void;
1617
1718
  }
1618
1719
  declare global {
@@ -1,7 +1,7 @@
1
1
  import { LitElement, PropertyValues } from 'lit';
2
2
  import { C as ConfigContext, V as ValidationDisplayMode } from './config.context.d-CCqlJXpE.js';
3
3
  import { V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
4
- import { g as ResponseVariable, B as BaseType } from './item.types.d-DuVR0ZVK.js';
4
+ import { f as ResponseVariable, B as BaseType } from './variables.d-DWHlTszN.js';
5
5
 
6
6
  /**
7
7
  * What a choice element should render and behave as. The same element — `qti-simple-choice`,
@@ -40,6 +40,10 @@ declare const interactionContext: {
40
40
  __context__: Readonly<InteractionContext>;
41
41
  };
42
42
 
43
+ /** Why an interaction is invalid: too few (`min`), too many (`max`), or something else (`other`). */
44
+ type ValidityKind = 'min' | 'max' | 'other';
45
+ /** What asked for the report: the candidate changing the response, or a submit (end attempt, form). */
46
+ type ValidityTrigger = 'change' | 'submit';
43
47
  /**
44
48
  * Shared QTI interaction base. Formative correction behavior is supplied by the
45
49
  * `@qti-components/corrections` package.
@@ -89,7 +93,27 @@ declare abstract class Interaction extends LitElement implements ValidatableInte
89
93
  set value(val: string | null);
90
94
  abstract get response(): string | string[] | null;
91
95
  abstract set response(val: string | string[] | null);
92
- reportValidity(): boolean;
96
+ /** Why the interaction is invalid right now; `undefined` while it is valid. */
97
+ protected _validityKind?: ValidityKind;
98
+ /** Set once a submit has reported; from then on every change reports in full. */
99
+ protected _validityReported: boolean;
100
+ /** True while this element asks its own internals to report, so its `invalid` is not a submit. */
101
+ protected _reportingNatively: boolean;
102
+ /** Forget that a submit has reported: a reset or a new attempt waits for a submit again. */
103
+ protected resetValidityReport(): void;
104
+ /**
105
+ * Show the validity state, in the configured mode.
106
+ *
107
+ * When it shows depends on what asked: a `change` (the candidate picked or dropped something)
108
+ * reports what they just did wrong, too many, at once; too few is not an error until they say they
109
+ * are done, so a `submit` (the item's end attempt, a form's submit) is what first shows it. After
110
+ * that first submit, changes report in full, so the message clears the moment the minimum is met
111
+ * and comes back if it is lost again. The validity itself is always set: a form with a
112
+ * below-minimum interaction cannot submit either way.
113
+ */
114
+ reportValidity(options?: {
115
+ trigger?: ValidityTrigger;
116
+ }): boolean;
93
117
  protected get validationDisplayMode(): ValidationDisplayMode;
94
118
  protected resolveAllowReorder(options?: {
95
119
  defaultWhenUnset?: boolean;
@@ -99,6 +123,7 @@ declare abstract class Interaction extends LitElement implements ValidatableInte
99
123
  }): boolean;
100
124
  protected setInteractionValidity(isValid: boolean, validityMessage?: string, anchor?: HTMLElement | null, options?: {
101
125
  suppressInline?: boolean;
126
+ kind?: ValidityKind;
102
127
  }): void;
103
128
  protected updateInlineValidationMessage(): void;
104
129
  protected clearInlineValidationMessage(): void;
@@ -107,6 +132,12 @@ declare abstract class Interaction extends LitElement implements ValidatableInte
107
132
  formResetCallback(): void;
108
133
  connectedCallback(): void;
109
134
  saveResponse(value: string | string[], state?: string | null): void;
135
+ /**
136
+ * `disabled` and `readonly` are states as well as attributes (qti-theme CONTRACT.md §3): a theme
137
+ * reads `:state(disabled)` on the host the way it reads it on a choice. The attribute stays
138
+ * reflected, so `[disabled]` keeps matching.
139
+ */
140
+ protected update(changed: PropertyValues): void;
110
141
  constructor();
111
142
  /**
112
143
  * Optional lifecycle bridge for interaction subclasses that do not need changed-property data.
@@ -155,4 +186,4 @@ declare const readRecordFieldValues: (valueElements: Iterable<Element>) => Recor
155
186
  */
156
187
  declare const inferRecordFieldBaseType: (value: unknown) => BaseType;
157
188
 
158
- export { type ChoiceRole as C, Interaction as I, type RecordFieldValues as R, type InteractionContext as a, type RecordValue as b, interactionContext as c, isRecordValue as d, inferRecordFieldBaseType as i, readRecordFieldValues as r };
189
+ export { type ChoiceRole as C, Interaction as I, type RecordFieldValues as R, type ValidityKind as V, type InteractionContext as a, type RecordValue as b, type ValidityTrigger as c, interactionContext as d, isRecordValue as e, inferRecordFieldBaseType as i, readRecordFieldValues as r };
@@ -1,4 +1,4 @@
1
- import { V as VariableDeclaration } from './item.types.d-DuVR0ZVK.js';
1
+ import { V as VariableDeclaration } from './variables.d-DWHlTszN.js';
2
2
 
3
3
  type ComputedItemContext = {
4
4
  identifier: string;
@@ -29,7 +29,7 @@ interface SessionContext {
29
29
  /**
30
30
  * What test plugins keep, by plugin name: JSON the test stores and restores without reading it.
31
31
  * Part of the persisted state (`QtiTestState.session.plugins`); written through the
32
- * `cito-test-update-plugin-state` request.
32
+ * `qc-test-update-plugin-state` request.
33
33
  */
34
34
  plugins?: Readonly<Record<string, unknown>>;
35
35
  }
@@ -0,0 +1,134 @@
1
+ import { V as View } from './session.context.d-9gRdGK4T.js';
2
+ import { a as PublicEventDeclaration } from './public-events.d-3dGip9pd.js';
3
+ import { Q as QtiTestState } from './qti-test-state.d-D8Q89RzZ.js';
4
+ export { a as QtiTestPluginState, b as QtiTestState, p as pluginState } from './qti-test-state-BAf5AmJ2.js';
5
+ import * as lit from 'lit';
6
+ import './variables.d-DWHlTszN.js';
7
+ import './computed.types.d-D4wskgi0.js';
8
+
9
+ /**
10
+ * The public events of the test. The name tells you it is public: everything here starts with
11
+ * `qc-`; every other event is internal plumbing and may change in any release.
12
+ *
13
+ * Requests are verbs (a host or plugin dispatches them at the test), notifications are past tense
14
+ * (the test dispatches them). All bubble and are composed.
15
+ *
16
+ * `deprecated` is the `cito-` name this event had in 9.x. One helper (`dispatchPublic`,
17
+ * `listenPublic`) sends or handles both names until the next major, then the field goes. The 7.x
18
+ * names (`qti-request-navigation`, `test-end-attempt`, `on-test-switch-view`, …) are no longer sent
19
+ * or handled.
20
+ */
21
+ interface NavigationTarget {
22
+ type: 'item' | 'section';
23
+ id: string;
24
+ }
25
+ interface NavigationFailure {
26
+ message: string;
27
+ details?: unknown;
28
+ itemId?: string;
29
+ sectionId?: string;
30
+ }
31
+ interface PublicEventMap {
32
+ 'qc-test-navigate': CustomEvent<NavigationTarget>;
33
+ /**
34
+ * Ends an attempt: processes the response of the item-ref `itemId`, or, without it, of the item on
35
+ * screen. `<test-end-attempt>` sends the `itemId` of the item it is stamped into or names.
36
+ */
37
+ 'qc-test-end-attempt': CustomEvent<{
38
+ itemId?: string;
39
+ }>;
40
+ /** Scores the test: resets its outcomes to their defaults, runs outcome processing, then `qc-test-submitted`. */
41
+ 'qc-test-submit': CustomEvent<Record<string, never>>;
42
+ 'qc-test-update-outcome': CustomEvent<{
43
+ assessmentItemRefId: string;
44
+ outcomeVariableId: string;
45
+ value: number | string;
46
+ }>;
47
+ 'qc-test-switch-view': CustomEvent<View>;
48
+ /** `value` is JSON; `null` or `undefined` removes the plugin's entry. */
49
+ 'qc-test-update-plugin-state': CustomEvent<{
50
+ plugin: string;
51
+ value: unknown;
52
+ }>;
53
+ /** Outcome processing ran after a submit: read the test outcomes now. */
54
+ 'qc-test-submitted': CustomEvent<Record<string, never>>;
55
+ 'qc-test-navigated': CustomEvent<NavigationTarget>;
56
+ 'qc-test-navigation-started': CustomEvent<NavigationTarget>;
57
+ 'qc-test-navigation-failed': CustomEvent<NavigationFailure>;
58
+ 'qc-test-rendered': CustomEvent<{
59
+ identifier: string;
60
+ element: Element;
61
+ }[]>;
62
+ 'qc-test-state-changed': CustomEvent<QtiTestState>;
63
+ 'qc-test-items-skipped': CustomEvent<{
64
+ ids: string[];
65
+ }>;
66
+ 'qc-test-end-reached': CustomEvent<Record<string, never>>;
67
+ 'qc-item-ref-connected': CustomEvent<{
68
+ identifier: string;
69
+ href: string;
70
+ category: string;
71
+ }>;
72
+ }
73
+ type PublicEventName = keyof PublicEventMap;
74
+ declare const PUBLIC_EVENTS: Record<PublicEventName, PublicEventDeclaration>;
75
+ declare global {
76
+ interface HTMLElementEventMap extends PublicEventMap {
77
+ }
78
+ }
79
+ /**
80
+ * Dispatch a public event, and its deprecated name with the same `detail` object. The detail is
81
+ * always an object so `listenPublic` can tell the two apart from one dispatch.
82
+ */
83
+ declare function dispatchPublic<K extends PublicEventName>(target: EventTarget, name: K, detail: PublicEventMap[K] extends CustomEvent<infer D> ? D : never): void;
84
+ /**
85
+ * Listen for a public event and its deprecated name; the handler runs once for a sender that
86
+ * dispatched both. See `listenDeclared`.
87
+ */
88
+ declare function listenPublic<K extends PublicEventName>(target: EventTarget, name: K, handler: (e: PublicEventMap[K]) => void): void;
89
+
90
+ declare const hostBox: lit.CSSResult;
91
+ /** The box of the control itself: the inner element. */
92
+ declare const form: lit.CSSResult;
93
+ declare const btn: lit.CSSResult;
94
+ /** The filled look: the neutral colour, its content colour on top. Same box as `btn`, so the two sit level. */
95
+ declare const btnPrimary: lit.CSSResult;
96
+ /** Hover; paint only, so the box never moves. */
97
+ declare const btnInteractive: lit.CSSResult;
98
+ declare const btnPrimaryInteractive: lit.CSSResult;
99
+ /** Pressed: the same mix, twice as far. Paint only, so a click never moves the button. */
100
+ declare const btnActive: lit.CSSResult;
101
+ declare const btnPrimaryActive: lit.CSSResult;
102
+ /** The theme's one focus ring (qti-theme `@mixin foc`), so a page shows one kind of ring. */
103
+ declare const focusRing: lit.CSSResult;
104
+ declare const dis: lit.CSSResult;
105
+ declare const ind: lit.CSSResult;
106
+ /** What a test control renders: the inner element that carries the look (see `hostBox`). */
107
+ declare const control: lit.TemplateResult<1>;
108
+ /**
109
+ * The stylesheet of a neutral test control: the host box, the look on `.control`, and its hover, press,
110
+ * focus and disabled states. A control with its own content (a bookmark's icon) adds to it.
111
+ */
112
+ declare const button: lit.CSSResult;
113
+ /** The filled look of `test-next`: add after `button`, so its rules win at equal specificity. */
114
+ declare const buttonPrimary: lit.CSSResult;
115
+
116
+ declare const styles_btn: typeof btn;
117
+ declare const styles_btnActive: typeof btnActive;
118
+ declare const styles_btnInteractive: typeof btnInteractive;
119
+ declare const styles_btnPrimary: typeof btnPrimary;
120
+ declare const styles_btnPrimaryActive: typeof btnPrimaryActive;
121
+ declare const styles_btnPrimaryInteractive: typeof btnPrimaryInteractive;
122
+ declare const styles_button: typeof button;
123
+ declare const styles_buttonPrimary: typeof buttonPrimary;
124
+ declare const styles_control: typeof control;
125
+ declare const styles_dis: typeof dis;
126
+ declare const styles_focusRing: typeof focusRing;
127
+ declare const styles_form: typeof form;
128
+ declare const styles_hostBox: typeof hostBox;
129
+ declare const styles_ind: typeof ind;
130
+ declare namespace styles {
131
+ export { styles_btn as btn, styles_btnActive as btnActive, styles_btnInteractive as btnInteractive, styles_btnPrimary as btnPrimary, styles_btnPrimaryActive as btnPrimaryActive, styles_btnPrimaryInteractive as btnPrimaryInteractive, styles_button as button, styles_buttonPrimary as buttonPrimary, styles_control as control, styles_dis as dis, styles_focusRing as focusRing, styles_form as form, styles_hostBox as hostBox, styles_ind as ind };
132
+ }
133
+
134
+ export { type NavigationFailure, type NavigationTarget, PUBLIC_EVENTS, type PublicEventMap, type PublicEventName, styles as controlStyles, dispatchPublic, listenPublic };
@@ -0,0 +1,19 @@
1
+ import {
2
+ pluginState
3
+ } from "./chunk-DJ7PB252.js";
4
+ import {
5
+ PUBLIC_EVENTS,
6
+ dispatchPublic,
7
+ listenPublic,
8
+ styles_exports
9
+ } from "./chunk-J6VX4N7M.js";
10
+ import "./chunk-UCXLDQYA.js";
11
+ import "./chunk-PZ5AY32C.js";
12
+ export {
13
+ PUBLIC_EVENTS,
14
+ styles_exports as controlStyles,
15
+ dispatchPublic,
16
+ listenPublic,
17
+ pluginState
18
+ };
19
+ //# sourceMappingURL=test-plugin-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}