@pie-qti/qti-common 1.0.0-beta.0 → 1.0.0-beta.2

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 (76) hide show
  1. package/dist/accessibility/apip.d.ts +66 -0
  2. package/dist/accessibility/apip.js +576 -0
  3. package/dist/accessibility/apip.js.map +1 -0
  4. package/dist/accessibility/catalog-info.d.ts +17 -0
  5. package/dist/accessibility/catalog-info.js +60 -0
  6. package/dist/accessibility/catalog-info.js.map +1 -0
  7. package/dist/accessibility/catalog.d.ts +53 -0
  8. package/dist/accessibility/catalog.js +68 -0
  9. package/dist/accessibility/catalog.js.map +1 -0
  10. package/dist/accessibility/index.d.ts +4 -0
  11. package/dist/accessibility/index.js +5 -0
  12. package/dist/accessibility/index.js.map +1 -0
  13. package/dist/accessibility/markup.d.ts +61 -0
  14. package/dist/accessibility/markup.js +484 -0
  15. package/dist/accessibility/markup.js.map +1 -0
  16. package/dist/dom/assignProps.d.ts +4 -0
  17. package/dist/dom/assignProps.js +9 -0
  18. package/dist/dom/assignProps.js.map +1 -0
  19. package/dist/dom/svelteMountController.d.ts +25 -0
  20. package/dist/dom/svelteMountController.js +131 -0
  21. package/dist/dom/svelteMountController.js.map +1 -0
  22. package/dist/dom/touchDrag.d.ts +10 -0
  23. package/dist/dom/touchDrag.js +141 -0
  24. package/dist/dom/touchDrag.js.map +1 -0
  25. package/dist/element-mapper/AttributeNameMapper.d.ts +66 -0
  26. package/dist/element-mapper/AttributeNameMapper.js +2 -0
  27. package/dist/element-mapper/AttributeNameMapper.js.map +1 -0
  28. package/dist/element-mapper/ElementNameMapper.d.ts +66 -0
  29. package/dist/element-mapper/ElementNameMapper.js +2 -0
  30. package/dist/element-mapper/ElementNameMapper.js.map +1 -0
  31. package/dist/element-mapper/Qti2xAttributeNameMapper.d.ts +27 -0
  32. package/dist/element-mapper/Qti2xAttributeNameMapper.js +38 -0
  33. package/dist/element-mapper/Qti2xAttributeNameMapper.js.map +1 -0
  34. package/dist/element-mapper/Qti2xElementNameMapper.d.ts +37 -0
  35. package/dist/element-mapper/Qti2xElementNameMapper.js +47 -0
  36. package/dist/element-mapper/Qti2xElementNameMapper.js.map +1 -0
  37. package/dist/element-mapper/Qti3AttributeNameMapper.d.ts +40 -0
  38. package/dist/element-mapper/Qti3AttributeNameMapper.js +87 -0
  39. package/dist/element-mapper/Qti3AttributeNameMapper.js.map +1 -0
  40. package/dist/element-mapper/Qti3ElementNameMapper.d.ts +14 -0
  41. package/dist/element-mapper/Qti3ElementNameMapper.js +39 -0
  42. package/dist/element-mapper/Qti3ElementNameMapper.js.map +1 -0
  43. package/dist/element-mapper/index.d.ts +8 -0
  44. package/dist/element-mapper/index.js +7 -0
  45. package/dist/element-mapper/index.js.map +1 -0
  46. package/dist/element-mapper/qti2-to-qti3.d.ts +36 -0
  47. package/dist/element-mapper/qti2-to-qti3.js +228 -0
  48. package/dist/element-mapper/qti2-to-qti3.js.map +1 -0
  49. package/dist/element-mapper/qti3-attribute-map.d.ts +8 -0
  50. package/dist/element-mapper/qti3-attribute-map.js +115 -0
  51. package/dist/element-mapper/qti3-attribute-map.js.map +1 -0
  52. package/dist/element-mapper/qti3-element-mappings.d.ts +538 -0
  53. package/dist/element-mapper/qti3-element-mappings.js +381 -0
  54. package/dist/element-mapper/qti3-element-mappings.js.map +1 -0
  55. package/dist/feedback/visibility.d.ts +12 -0
  56. package/dist/feedback/visibility.js +22 -0
  57. package/dist/feedback/visibility.js.map +1 -0
  58. package/dist/index.d.ts +17 -0
  59. package/dist/index.js +21 -0
  60. package/dist/index.js.map +1 -0
  61. package/dist/language/direction.d.ts +10 -0
  62. package/dist/language/direction.js +42 -0
  63. package/dist/language/direction.js.map +1 -0
  64. package/dist/parser-factory.d.ts +137 -0
  65. package/dist/parser-factory.js +146 -0
  66. package/dist/parser-factory.js.map +1 -0
  67. package/dist/version-detection/detectQtiVersion.d.ts +23 -0
  68. package/dist/version-detection/detectQtiVersion.js +129 -0
  69. package/dist/version-detection/detectQtiVersion.js.map +1 -0
  70. package/dist/version-detection/index.d.ts +2 -0
  71. package/dist/version-detection/index.js +2 -0
  72. package/dist/version-detection/index.js.map +1 -0
  73. package/dist/xml/attributes.d.ts +77 -0
  74. package/dist/xml/attributes.js +120 -0
  75. package/dist/xml/attributes.js.map +1 -0
  76. package/package.json +2 -2
@@ -0,0 +1,115 @@
1
+ // GENERATED FILE — do not edit by hand.
2
+ // Regenerate with:
3
+ // bun run packages/qti-common/scripts/generate-qti3-attribute-map.ts
4
+ //
5
+ // Derived from the IMS QTI schemas vendored in packages/to-pie (imsqti_v2p1.xsd, imsqti_v2p2.xsd) by taking every
6
+ // camelCase attribute name in the QTI 2.x vocabulary and kebab-casing it, which is exactly
7
+ // the QTI 3.0 attribute rename. Attributes already kebab-case in QTI 2.x (`aria-*`) carry
8
+ // no uppercase letter and so are absent here by construction — as are `data-*`,
9
+ // `xml:lang` and HTML attributes, since lookup is by exact name.
10
+ /** QTI 3.0 kebab-case attribute name → QTI 2.x camelCase equivalent. 79 entries. */
11
+ export const QTI3_ATTRIBUTE_TO_QTI2 = new Map([
12
+ ['allow-comment', 'allowComment'],
13
+ ['allow-late-submission', 'allowLateSubmission'],
14
+ ['allow-review', 'allowReview'],
15
+ ['allow-skipping', 'allowSkipping'],
16
+ ['base-type', 'baseType'],
17
+ ['case-sensitive', 'caseSensitive'],
18
+ ['center-point', 'centerPoint'],
19
+ ['centre-point', 'centrePoint'],
20
+ ['count-attempt', 'countAttempt'],
21
+ ['data-extension', 'dataExtension'],
22
+ ['default-value', 'defaultValue'],
23
+ ['exclude-category', 'excludeCategory'],
24
+ ['expected-length', 'expectedLength'],
25
+ ['expected-lines', 'expectedLines'],
26
+ ['external-scored', 'externalScored'],
27
+ ['field-identifier', 'fieldIdentifier'],
28
+ ['hotspot-label', 'hotspotLabel'],
29
+ ['include-boundary', 'includeBoundary'],
30
+ ['include-category', 'includeCategory'],
31
+ ['include-lower-bound', 'includeLowerBound'],
32
+ ['include-upper-bound', 'includeUpperBound'],
33
+ ['keep-together', 'keepTogether'],
34
+ ['long-interpretation', 'longInterpretation'],
35
+ ['lower-bound', 'lowerBound'],
36
+ ['map-key', 'mapKey'],
37
+ ['mapped-value', 'mappedValue'],
38
+ ['mapping-indicator', 'mappingIndicator'],
39
+ ['mastery-value', 'masteryValue'],
40
+ ['match-group', 'matchGroup'],
41
+ ['match-max', 'matchMax'],
42
+ ['match-min', 'matchMin'],
43
+ ['math-variable', 'mathVariable'],
44
+ ['max-associations', 'maxAssociations'],
45
+ ['max-attempts', 'maxAttempts'],
46
+ ['max-choices', 'maxChoices'],
47
+ ['max-plays', 'maxPlays'],
48
+ ['max-strings', 'maxStrings'],
49
+ ['max-time', 'maxTime'],
50
+ ['min-associations', 'minAssociations'],
51
+ ['min-choices', 'minChoices'],
52
+ ['min-plays', 'minPlays'],
53
+ ['min-strings', 'minStrings'],
54
+ ['min-time', 'minTime'],
55
+ ['navigation-mode', 'navigationMode'],
56
+ ['normal-maximum', 'normalMaximum'],
57
+ ['normal-minimum', 'normalMinimum'],
58
+ ['number-repeats', 'numberRepeats'],
59
+ ['object-label', 'objectLabel'],
60
+ ['outcome-identifier', 'outcomeIdentifier'],
61
+ ['param-variable', 'paramVariable'],
62
+ ['pattern-mask', 'patternMask'],
63
+ ['placeholder-text', 'placeholderText'],
64
+ ['power-form', 'powerForm'],
65
+ ['response-identifier', 'responseIdentifier'],
66
+ ['rounding-mode', 'roundingMode'],
67
+ ['section-identifier', 'sectionIdentifier'],
68
+ ['show-feedback', 'showFeedback'],
69
+ ['show-hide', 'showHide'],
70
+ ['show-solution', 'showSolution'],
71
+ ['source-identifier', 'sourceIdentifier'],
72
+ ['source-value', 'sourceValue'],
73
+ ['step-label', 'stepLabel'],
74
+ ['string-identifier', 'stringIdentifier'],
75
+ ['submission-mode', 'submissionMode'],
76
+ ['target-identifier', 'targetIdentifier'],
77
+ ['target-type', 'targetType'],
78
+ ['target-value', 'targetValue'],
79
+ ['template-identifier', 'templateIdentifier'],
80
+ ['template-location', 'templateLocation'],
81
+ ['time-dependent', 'timeDependent'],
82
+ ['tolerance-mode', 'toleranceMode'],
83
+ ['tool-name', 'toolName'],
84
+ ['tool-version', 'toolVersion'],
85
+ ['upper-bound', 'upperBound'],
86
+ ['validate-responses', 'validateResponses'],
87
+ ['variable-identifier', 'variableIdentifier'],
88
+ ['variable-identifier-ref', 'variableIdentifierRef'],
89
+ ['weight-identifier', 'weightIdentifier'],
90
+ ['with-replacement', 'withReplacement'],
91
+ ]);
92
+ /**
93
+ * QTI 2.2 interactions whose content model permits a `prompt` child (it must come first).
94
+ * The inline interactions are deliberately absent: moving a prompt into one would trade one
95
+ * schema violation for another.
96
+ */
97
+ export const QTI2_PROMPT_BEARING_INTERACTIONS = new Set([
98
+ 'associateInteraction',
99
+ 'choiceInteraction',
100
+ 'drawingInteraction',
101
+ 'extendedTextInteraction',
102
+ 'gapMatchInteraction',
103
+ 'graphicAssociateInteraction',
104
+ 'graphicGapMatchInteraction',
105
+ 'graphicOrderInteraction',
106
+ 'hotspotInteraction',
107
+ 'hottextInteraction',
108
+ 'matchInteraction',
109
+ 'mediaInteraction',
110
+ 'orderInteraction',
111
+ 'selectPointInteraction',
112
+ 'sliderInteraction',
113
+ 'uploadInteraction',
114
+ ]);
115
+ //# sourceMappingURL=qti3-attribute-map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"qti3-attribute-map.js","sourceRoot":"","sources":["../../src/element-mapper/qti3-attribute-map.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,mBAAmB;AACnB,uEAAuE;AACvE,EAAE;AACF,kHAAkH;AAClH,2FAA2F;AAC3F,0FAA0F;AAC1F,gFAAgF;AAChF,iEAAiE;AAEjE,oFAAoF;AACpF,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAiB;IAC5D,CAAC,eAAe,EAAE,cAAc,CAAC;IACjC,CAAC,uBAAuB,EAAE,qBAAqB,CAAC;IA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AAC,cAAc,EAAE,aAAa,CAAC;IAC/B,CAAC,qBAAqB,EAAE,oBAAoB,CAAC;IAC7C,CAAC,mBAAmB,EAAE,kBAAkB,CAAC;IACzC,CAAC,gBAAgB,EAAE,eAAe,CAAC;IACnC,CAAC,gBAAgB,EAAE,eAAe,CAAC;IACnC,CAAC,WAAW,EAAE,UAAU,CAAC;IACzB,CAAC,cAAc,EAAE,aAAa,CAAC;IAC/B,CAAC,aAAa,EAAE,YAAY,CAAC;IAC7B,CAAC,oBAAoB,EAAE,mBAAmB,CAAC;IAC3C,CAAC,qBAAqB,EAAE,oBAAoB,CAAC;IAC7C,CAAC,yBAAyB,EAAE,uBAAuB,CAAC;IACpD,CAAC,mBAAmB,EAAE,kBAAkB,CAAC;IACzC,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;CACxC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAwB,IAAI,GAAG,CAAC;IAC3E,sBAAsB;IACtB,mBAAmB;IACnB,oBAAoB;IACpB,yBAAyB;IACzB,qBAAqB;IACrB,6BAA6B;IAC7B,4BAA4B;IAC5B,yBAAyB;IACzB,oBAAoB;IACpB,oBAAoB;IACpB,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,wBAAwB;IACxB,mBAAmB;IACnB,mBAAmB;CACpB,CAAC,CAAC","sourcesContent":["// GENERATED FILE — do not edit by hand.\n// Regenerate with:\n// bun run packages/qti-common/scripts/generate-qti3-attribute-map.ts\n//\n// Derived from the IMS QTI schemas vendored in packages/to-pie (imsqti_v2p1.xsd, imsqti_v2p2.xsd) by taking every\n// camelCase attribute name in the QTI 2.x vocabulary and kebab-casing it, which is exactly\n// the QTI 3.0 attribute rename. Attributes already kebab-case in QTI 2.x (`aria-*`) carry\n// no uppercase letter and so are absent here by construction — as are `data-*`,\n// `xml:lang` and HTML attributes, since lookup is by exact name.\n\n/** QTI 3.0 kebab-case attribute name → QTI 2.x camelCase equivalent. 79 entries. */\nexport const QTI3_ATTRIBUTE_TO_QTI2 = new Map<string, string>([\n ['allow-comment', 'allowComment'],\n ['allow-late-submission', 'allowLateSubmission'],\n ['allow-review', 'allowReview'],\n ['allow-skipping', 'allowSkipping'],\n ['base-type', 'baseType'],\n ['case-sensitive', 'caseSensitive'],\n ['center-point', 'centerPoint'],\n ['centre-point', 'centrePoint'],\n ['count-attempt', 'countAttempt'],\n ['data-extension', 'dataExtension'],\n ['default-value', 'defaultValue'],\n ['exclude-category', 'excludeCategory'],\n ['expected-length', 'expectedLength'],\n ['expected-lines', 'expectedLines'],\n ['external-scored', 'externalScored'],\n ['field-identifier', 'fieldIdentifier'],\n ['hotspot-label', 'hotspotLabel'],\n ['include-boundary', 'includeBoundary'],\n ['include-category', 'includeCategory'],\n ['include-lower-bound', 'includeLowerBound'],\n ['include-upper-bound', 'includeUpperBound'],\n ['keep-together', 'keepTogether'],\n ['long-interpretation', 'longInterpretation'],\n ['lower-bound', 'lowerBound'],\n ['map-key', 'mapKey'],\n ['mapped-value', 'mappedValue'],\n ['mapping-indicator', 'mappingIndicator'],\n ['mastery-value', 'masteryValue'],\n ['match-group', 'matchGroup'],\n ['match-max', 'matchMax'],\n ['match-min', 'matchMin'],\n ['math-variable', 'mathVariable'],\n ['max-associations', 'maxAssociations'],\n ['max-attempts', 'maxAttempts'],\n ['max-choices', 'maxChoices'],\n ['max-plays', 'maxPlays'],\n ['max-strings', 'maxStrings'],\n ['max-time', 'maxTime'],\n ['min-associations', 'minAssociations'],\n ['min-choices', 'minChoices'],\n ['min-plays', 'minPlays'],\n ['min-strings', 'minStrings'],\n ['min-time', 'minTime'],\n ['navigation-mode', 'navigationMode'],\n ['normal-maximum', 'normalMaximum'],\n ['normal-minimum', 'normalMinimum'],\n ['number-repeats', 'numberRepeats'],\n ['object-label', 'objectLabel'],\n ['outcome-identifier', 'outcomeIdentifier'],\n ['param-variable', 'paramVariable'],\n ['pattern-mask', 'patternMask'],\n ['placeholder-text', 'placeholderText'],\n ['power-form', 'powerForm'],\n ['response-identifier', 'responseIdentifier'],\n ['rounding-mode', 'roundingMode'],\n ['section-identifier', 'sectionIdentifier'],\n ['show-feedback', 'showFeedback'],\n ['show-hide', 'showHide'],\n ['show-solution', 'showSolution'],\n ['source-identifier', 'sourceIdentifier'],\n ['source-value', 'sourceValue'],\n ['step-label', 'stepLabel'],\n ['string-identifier', 'stringIdentifier'],\n ['submission-mode', 'submissionMode'],\n ['target-identifier', 'targetIdentifier'],\n ['target-type', 'targetType'],\n ['target-value', 'targetValue'],\n ['template-identifier', 'templateIdentifier'],\n ['template-location', 'templateLocation'],\n ['time-dependent', 'timeDependent'],\n ['tolerance-mode', 'toleranceMode'],\n ['tool-name', 'toolName'],\n ['tool-version', 'toolVersion'],\n ['upper-bound', 'upperBound'],\n ['validate-responses', 'validateResponses'],\n ['variable-identifier', 'variableIdentifier'],\n ['variable-identifier-ref', 'variableIdentifierRef'],\n ['weight-identifier', 'weightIdentifier'],\n ['with-replacement', 'withReplacement'],\n]);\n\n/**\n * QTI 2.2 interactions whose content model permits a `prompt` child (it must come first).\n * The inline interactions are deliberately absent: moving a prompt into one would trade one\n * schema violation for another.\n */\nexport const QTI2_PROMPT_BEARING_INTERACTIONS: ReadonlySet<string> = new Set([\n 'associateInteraction',\n 'choiceInteraction',\n 'drawingInteraction',\n 'extendedTextInteraction',\n 'gapMatchInteraction',\n 'graphicAssociateInteraction',\n 'graphicGapMatchInteraction',\n 'graphicOrderInteraction',\n 'hotspotInteraction',\n 'hottextInteraction',\n 'matchInteraction',\n 'mediaInteraction',\n 'orderInteraction',\n 'selectPointInteraction',\n 'sliderInteraction',\n 'uploadInteraction',\n]);\n"]}