@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/base.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- import { C as ComputedItemContext } from './session.context.d-DW09Lrie.js';
2
- export { I as INITIAL_SESSION_CONTEXT, S as SessionContext, V as View, s as sessionContext } from './session.context.d-DW09Lrie.js';
3
- import { C as ComputedContext } from './computed.types.d-IXACuBr7.js';
4
- export { a as ComputedItem } from './computed.types.d-IXACuBr7.js';
5
- export { C as ConfigContext, V as ValidationDisplayMode, c as configContext } from './config.context.d-BniMHSBB.js';
6
- export { C as ChoiceRole, I as Interaction, a as InteractionContext, R as RecordFieldValues, b as RecordValue, i as inferRecordFieldBaseType, c as interactionContext, d as isRecordValue, r as readRecordFieldValues } from './record.d-C6m0Y4xr.js';
1
+ import { C as ComputedItemContext } from './session.context.d-BNxGeyh9.js';
2
+ export { I as INITIAL_SESSION_CONTEXT, S as SessionContext, V as View, s as sessionContext } from './session.context.d-BNxGeyh9.js';
3
+ import { C as ComputedContext } from './computed.types.d-n3K2VvB0.js';
4
+ export { a as ComputedItem } from './computed.types.d-n3K2VvB0.js';
5
+ export { C as ConfigContext, V as ValidationDisplayMode, c as configContext } from './config.context.d-CCqlJXpE.js';
6
+ export { C as ChoiceRole, I as Interaction, a as InteractionContext, R as RecordFieldValues, b as RecordValue, V as ValidityKind, c as ValidityTrigger, i as inferRecordFieldBaseType, d as interactionContext, e as isRecordValue, r as readRecordFieldValues } from './record.d-Bojj6_LW.js';
7
7
  import { b as ItemContext, B as BaseType } from './item.types.d-DuVR0ZVK.js';
8
8
  export { C as Calculate, a as Cardinality, I as InterpolationTableEntry, M as Multiple, O as Ordered, c as OutcomeVariable, Q as QtiAreaMapEntry, d as QtiAreaMapping, e as QtiMapEntry, f as QtiMapping, R as ResponseInteraction, g as ResponseVariable, T as TemplateVariable, V as VariableDeclaration, h as VariableValue, i as areaShape, j as directedPair, k as float, l as integer, m as itemContextVariables } from './item.types.d-DuVR0ZVK.js';
9
9
  export { Q as QtiContext, a as QtiContextType, S as Seed, b as asSeed, i as isSeed, q as qtiContext } from './qti.context.d-CejJMlfZ.js';
10
10
  export { I as INITIAL_TEST_CONTEXT, Q as QtiExpression, a as QtiExpressionBase, T as TestContext, t as testContext } from './qti-expression.d-B-Cfbqlb.js';
11
11
  import * as lit from 'lit';
12
- export { Q as QtiFeedback, a as QtiVariableDeclaration } from './qti-feedback.d-DbzPSJuK.js';
12
+ export { Q as QtiFeedback, a as QtiVariableDeclaration } from './qti-feedback.d-1JL_qHjc.js';
13
13
  export { Q as QtiConditionExpression } from './qti-condition-expression.d-B-T1NNl0.js';
14
14
  export { D as DirectedPair, I as Identifier, P as Point, R as ResponseValue, i as iterResponseValues, p as parsePair, a as parsePoint, b as parseResponseAttribute, r as responseAttributeConverter, s as serializePair, c as serializePoint, d as serializeResponseAttribute } from './response.d-_8y4kjGP.js';
15
15
  export { F as FormAssociatedInteraction, I as IInteraction, R as ReadonlyInteraction, a as RegisteredInteraction, b as ResettableInteraction, c as ResponseIdentifiedInteraction, d as ResponseInteractionElement, V as ValidatableInteraction } from './interaction.interface.d-CvjHM2bi.js';
@@ -192,6 +192,30 @@ declare function classifyCustomStateSupport(attachInternals: (this: HTMLElement)
192
192
  */
193
193
  declare function installCustomStateSetFallback(): CustomStateSupport | 'already-installed';
194
194
 
195
+ /**
196
+ * The vocabulary of custom states (CONTRACT.md §3 in qti-theme), with the names it replaced.
197
+ *
198
+ * A state is set under the name the contract uses. For one major the old name is set too, so a
199
+ * host that still reads `:state(drag)` keeps working while the theme reads `:state(chip)`. When the
200
+ * alias period ends, empty the table; every call site then sets only the new name.
201
+ *
202
+ * Not in the table, because the old name meant something else on another element:
203
+ * - a drop target's `drag-active` replaced `active` + `enabled`; the interaction host's `drag-active`
204
+ * replaced `dragzone-active` + `dragzone-enabled`. Each call site names its own old pair.
205
+ * - a drop target's `full` replaced the attribute `disabled`, which stays as an attribute.
206
+ * - `answer-key` replaced `show-correct-response` on an interaction host and `correct-response` on a
207
+ * choice; the corrections package passes the one that applies.
208
+ */
209
+ declare const STATE_ALIASES: Readonly<Record<string, readonly string[]>>;
210
+ type StateSet = Pick<Set<string>, 'add' | 'delete' | 'has'>;
211
+ /**
212
+ * Set or clear a state and its aliases. `states` may be undefined on an element without internals;
213
+ * then nothing happens, as before.
214
+ */
215
+ declare function setState(states: StateSet | undefined | null, name: string, on: boolean, oldNames?: readonly string[]): void;
216
+ /** Whether a state is set, under its contract name or an alias. */
217
+ declare function hasState(states: StateSet | undefined | null, name: string): boolean;
218
+
195
219
  declare class ScoringHelper {
196
220
  /**
197
221
  * Checks if a given point is within a specified area.
@@ -232,4 +256,4 @@ declare const convertNumberToUniversalFormat: (number: number | string) => strin
232
256
  declare function IsNullOrUndefined(value: unknown): boolean;
233
257
  declare function removeDoubleSlashes(str: string): string;
234
258
 
235
- export { BaseType, ComputedContext, ComputedItemContext, type CustomOperator, type CustomOperatorValue, CustomStateSetShim, type CustomStateSupport, IsNullOrUndefined, ItemContext, ScoringHelper, boxSizing, classifyCustomStateSupport, computedContext, computedItemContext, convertNumberToUniversalFormat, decimalSeparator, dropRegion, getCustomOperator, installCustomStateSetFallback, itemContext, registerCustomOperator, removeDoubleSlashes, unregisterCustomOperator, validationMessage };
259
+ export { BaseType, ComputedContext, ComputedItemContext, type CustomOperator, type CustomOperatorValue, CustomStateSetShim, type CustomStateSupport, IsNullOrUndefined, ItemContext, STATE_ALIASES, ScoringHelper, boxSizing, classifyCustomStateSupport, computedContext, computedItemContext, convertNumberToUniversalFormat, decimalSeparator, dropRegion, getCustomOperator, hasState, installCustomStateSetFallback, itemContext, registerCustomOperator, removeDoubleSlashes, setState, unregisterCustomOperator, validationMessage };
package/dist/base.js CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  QtiFeedback,
12
12
  QtiRuleElement,
13
13
  QtiVariableDeclaration,
14
+ STATE_ALIASES,
14
15
  ScoringHelper,
15
16
  asSeed,
16
17
  boxSizing,
@@ -22,6 +23,7 @@ import {
22
23
  decimalSeparator,
23
24
  dropRegion,
24
25
  getCustomOperator,
26
+ hasState,
25
27
  inferRecordFieldBaseType,
26
28
  installCustomStateSetFallback,
27
29
  interactionContext,
@@ -42,10 +44,11 @@ import {
42
44
  serializePoint,
43
45
  serializeResponseAttribute,
44
46
  sessionContext,
47
+ setState,
45
48
  testContext,
46
49
  unregisterCustomOperator,
47
50
  validationMessage
48
- } from "./chunk-O2ENNGKV.js";
51
+ } from "./chunk-NZ7ZC4SP.js";
49
52
  export {
50
53
  CustomStateSetShim,
51
54
  INITIAL_SESSION_CONTEXT,
@@ -59,6 +62,7 @@ export {
59
62
  QtiFeedback,
60
63
  QtiRuleElement,
61
64
  QtiVariableDeclaration,
65
+ STATE_ALIASES,
62
66
  ScoringHelper,
63
67
  asSeed,
64
68
  boxSizing,
@@ -70,6 +74,7 @@ export {
70
74
  decimalSeparator,
71
75
  dropRegion,
72
76
  getCustomOperator,
77
+ hasState,
73
78
  inferRecordFieldBaseType,
74
79
  installCustomStateSetFallback,
75
80
  interactionContext,
@@ -90,6 +95,7 @@ export {
90
95
  serializePoint,
91
96
  serializeResponseAttribute,
92
97
  sessionContext,
98
+ setState,
93
99
  testContext,
94
100
  unregisterCustomOperator,
95
101
  validationMessage
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  qtiContentElements
3
- } from "./chunk-C7SYDLMG.js";
3
+ } from "./chunk-M4TZIB3W.js";
4
4
 
5
5
  // ../qti-elements/dist/register.js
6
6
  for (const { tag, ctor } of qtiContentElements) {
@@ -8,4 +8,4 @@ for (const { tag, ctor } of qtiContentElements) {
8
8
  customElements.define(tag, ctor);
9
9
  }
10
10
  }
11
- //# sourceMappingURL=chunk-HGKLF7SP.js.map
11
+ //# sourceMappingURL=chunk-4DC5Z2LQ.js.map