@qti-components/elements 1.6.3 → 1.6.4

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 (47) hide show
  1. package/dist/components/qti-assessment-item/qti-assessment-item.d.ts +5 -10
  2. package/dist/components/qti-assessment-item/qti-assessment-item.js +15 -48
  3. package/dist/components/qti-assessment-item/qti-assessment-item.js.map +1 -1
  4. package/dist/components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.js +3 -7
  5. package/dist/components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.js.map +1 -1
  6. package/dist/components/qti-companion-materials-info/qti-companion-materials-info.js +2 -13
  7. package/dist/components/qti-companion-materials-info/qti-companion-materials-info.js.map +1 -1
  8. package/dist/components/qti-content-body/qti-content-body.js +6 -8
  9. package/dist/components/qti-content-body/qti-content-body.js.map +1 -1
  10. package/dist/components/qti-context-declaration/qti-context-declaration.js +3 -7
  11. package/dist/components/qti-context-declaration/qti-context-declaration.js.map +1 -1
  12. package/dist/components/qti-custom-operator/qti-custom-operator.js +3 -7
  13. package/dist/components/qti-custom-operator/qti-custom-operator.js.map +1 -1
  14. package/dist/components/qti-feedback-block/qti-feedback-block.js +2 -13
  15. package/dist/components/qti-feedback-block/qti-feedback-block.js.map +1 -1
  16. package/dist/components/qti-feedback-inline/qti-feedback-inline.js +2 -13
  17. package/dist/components/qti-feedback-inline/qti-feedback-inline.js.map +1 -1
  18. package/dist/components/qti-item-body/qti-item-body.js +2 -13
  19. package/dist/components/qti-item-body/qti-item-body.js.map +1 -1
  20. package/dist/components/qti-modal-feedback/qti-modal-feedback.js +12 -24
  21. package/dist/components/qti-modal-feedback/qti-modal-feedback.js.map +1 -1
  22. package/dist/components/qti-outcome-declaration/qti-outcome-declaration.js +3 -7
  23. package/dist/components/qti-outcome-declaration/qti-outcome-declaration.js.map +1 -1
  24. package/dist/components/qti-response-declaration/qti-response-declaration.js +3 -7
  25. package/dist/components/qti-response-declaration/qti-response-declaration.js.map +1 -1
  26. package/dist/components/qti-response-processing/qti-response-processing.js +2 -13
  27. package/dist/components/qti-response-processing/qti-response-processing.js.map +1 -1
  28. package/dist/components/qti-rubric-block/qti-rubric-block.js +3 -7
  29. package/dist/components/qti-rubric-block/qti-rubric-block.js.map +1 -1
  30. package/dist/components/qti-stylesheet/qti-stylesheet.js +2 -13
  31. package/dist/components/qti-stylesheet/qti-stylesheet.js.map +1 -1
  32. package/dist/components/qti-template-constraint/qti-template-constraint.js +2 -13
  33. package/dist/components/qti-template-constraint/qti-template-constraint.js.map +1 -1
  34. package/dist/components/qti-template-declaration/qti-template-declaration.js +3 -7
  35. package/dist/components/qti-template-declaration/qti-template-declaration.js.map +1 -1
  36. package/dist/components/qti-template-processing/qti-template-processing.js +2 -13
  37. package/dist/components/qti-template-processing/qti-template-processing.js.map +1 -1
  38. package/dist/elements.d.ts +74 -0
  39. package/dist/elements.js +40 -0
  40. package/dist/elements.js.map +1 -0
  41. package/dist/index.d.ts +1 -0
  42. package/dist/index.js +1 -0
  43. package/dist/index.js.map +1 -1
  44. package/dist/register.d.ts +1 -0
  45. package/dist/register.js +7 -0
  46. package/dist/register.js.map +1 -0
  47. package/package.json +22 -5
@@ -5,12 +5,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { css, LitElement, html } from 'lit';
8
- import { customElement, property } from 'lit/decorators.js';
8
+ import { property } from 'lit/decorators.js';
9
9
  /**
10
10
  * @summary The qti-template-declaration element declares template variables for item cloning.
11
11
  * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-declaration
12
12
  */
13
- let QtiTemplateDeclaration = class QtiTemplateDeclaration extends LitElement {
13
+ export class QtiTemplateDeclaration extends LitElement {
14
14
  constructor() {
15
15
  super(...arguments);
16
16
  this.identifier = '';
@@ -106,7 +106,7 @@ let QtiTemplateDeclaration = class QtiTemplateDeclaration extends LitElement {
106
106
  paramVariable: this.paramVariable
107
107
  };
108
108
  }
109
- };
109
+ }
110
110
  __decorate([
111
111
  property({ type: String })
112
112
  ], QtiTemplateDeclaration.prototype, "identifier", void 0);
@@ -122,8 +122,4 @@ __decorate([
122
122
  __decorate([
123
123
  property({ type: Boolean, attribute: 'param-variable' })
124
124
  ], QtiTemplateDeclaration.prototype, "paramVariable", void 0);
125
- QtiTemplateDeclaration = __decorate([
126
- customElement('qti-template-declaration')
127
- ], QtiTemplateDeclaration);
128
- export { QtiTemplateDeclaration };
129
125
  //# sourceMappingURL=qti-template-declaration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"qti-template-declaration.js","sourceRoot":"","sources":["../../../src/components/qti-template-declaration/qti-template-declaration.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAK5D;;;GAGG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,UAAU;IAA/C;;QACuB,eAAU,GAAW,EAAE,CAAC;QACxB,gBAAW,GAAiD,QAAQ,CAAC;QAC7C,aAAQ,GAAa,QAAQ,CAAC;QACzB,iBAAY,GAAY,KAAK,CAAC;QAC7B,kBAAa,GAAY,KAAK,CAAC;QAEzF,kBAAa,GAAQ,IAAI,CAAC;IAkG5B,CAAC;IAlGC,aAAa,CAAa;aAEV,WAAM,GAAG;QACvB,GAAG,CAAA;;;;KAIF;KACF,AANqB,CAMpB;IAEO,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;IAEQ,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE;YAC5B,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC5B,IAAI,CAAC,yBAAyB,EAAE,CAAC;QACn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E,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC;QACtF,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,uBAAuB,EAAE;YACvC,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,EAAE,QAAQ,EAAE;SACrB,CAAC,CACH,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,mBAAmB;QACxB,OAAO;YACL,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,aAAa;YACzB,IAAI,EAAE,UAAU;YAChB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,aAAa,EAAE,IAAI,CAAC,aAAa;SAClC,CAAC;IACJ,CAAC;;AAvG2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DAAyB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DAAsE;AAC7C;IAAnD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;wDAA+B;AACzB;IAAxD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;4DAA+B;AAC7B;IAAzD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;6DAAgC;AAL9E,sBAAsB;IADlC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,sBAAsB,CAyGlC","sourcesContent":["import { css, LitElement, html } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport type { TemplateVariable } from '@qti-components/base';\nimport type { BaseType } from '@qti-components/base';\n\n/**\n * @summary The qti-template-declaration element declares template variables for item cloning.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-declaration\n */\n@customElement('qti-template-declaration')\nexport class QtiTemplateDeclaration extends LitElement {\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) cardinality: 'single' | 'multiple' | 'ordered' | 'record' = 'single';\n @property({ type: String, attribute: 'base-type' }) baseType: BaseType = 'string';\n @property({ type: Boolean, attribute: 'math-variable' }) mathVariable: boolean = false;\n @property({ type: Boolean, attribute: 'param-variable' }) paramVariable: boolean = false;\n\n #defaultValue: any = null;\n\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n return html`<slot></slot>`;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.updateComplete.then(() => {\n this.#processDefaultValue();\n this.#registerTemplateVariable();\n });\n }\n\n /**\n * Process qti-default-value to extract the default value\n */\n #processDefaultValue(): void {\n const defaultValueElement = this.querySelector('qti-default-value');\n if (!defaultValueElement) {\n return;\n }\n\n // For now, just get the text content - this could be enhanced to handle expressions\n const textContent = defaultValueElement.textContent?.trim() || '';\n this.#defaultValue = this.#convertValue(textContent);\n }\n\n /**\n * Convert string value based on base-type\n */\n #convertValue(value: string): any {\n if (!value) return null;\n\n switch (this.baseType) {\n case 'integer':\n return parseInt(value, 10);\n case 'float':\n case 'duration':\n return parseFloat(value);\n case 'boolean':\n return value.toLowerCase() === 'true';\n case 'string':\n default:\n return value;\n }\n }\n\n /**\n * Register this template variable with the assessment item\n */\n #registerTemplateVariable(): void {\n const templateVariable: TemplateVariable = {\n identifier: this.identifier,\n cardinality: this.cardinality,\n baseType: this.baseType,\n defaultValue: this.#defaultValue,\n value: this.#defaultValue,\n type: 'template',\n mathVariable: this.mathVariable,\n paramVariable: this.paramVariable\n };\n\n // Dispatch event to register the variable\n\n // value must string or string[]\n const variable = { ...templateVariable, value: this.#defaultValue?.toString() || '' };\n this.dispatchEvent(\n new CustomEvent('qti-register-variable', {\n bubbles: true,\n composed: true,\n detail: { variable }\n })\n );\n }\n\n /**\n * Get the template variable definition\n */\n public getTemplateVariable(): TemplateVariable {\n return {\n identifier: this.identifier,\n cardinality: this.cardinality,\n baseType: this.baseType,\n value: this.#defaultValue,\n type: 'template',\n mathVariable: this.mathVariable,\n paramVariable: this.paramVariable\n };\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-template-declaration': QtiTemplateDeclaration;\n }\n}\n"]}
1
+ {"version":3,"file":"qti-template-declaration.js","sourceRoot":"","sources":["../../../src/components/qti-template-declaration/qti-template-declaration.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAK7C;;;GAGG;AAEH,MAAM,OAAO,sBAAuB,SAAQ,UAAU;IAAtD;;QAC8B,eAAU,GAAW,EAAE,CAAC;QACxB,gBAAW,GAAiD,QAAQ,CAAC;QAC7C,aAAQ,GAAa,QAAQ,CAAC;QACzB,iBAAY,GAAY,KAAK,CAAC;QAC7B,kBAAa,GAAY,KAAK,CAAC;QAEzF,kBAAa,GAAQ,IAAI,CAAC;IAkG5B,CAAC;IAlGC,aAAa,CAAa;aAEV,WAAM,GAAG;QACvB,GAAG,CAAA;;;;KAIF;KACF,AANqB,CAMpB;IAEO,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;IAEQ,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE;YAC5B,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC5B,IAAI,CAAC,yBAAyB,EAAE,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,oBAAoB;QAClB,MAAM,mBAAmB,GAAG,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC;QACpE,IAAI,CAAC,mBAAmB,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E,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,EAAE,QAAQ,EAAE;SACrB,CAAC,CACH,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,mBAAmB;QACxB,OAAO;YACL,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,aAAa;YACzB,IAAI,EAAE,UAAU;YAChB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,aAAa,EAAE,IAAI,CAAC,aAAa;SAClC,CAAC;IACJ,CAAC;;AAvG2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DAAyB;AACxB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2DAAsE;AAC7C;IAAnD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;wDAA+B;AACzB;IAAxD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;4DAA+B;AAC7B;IAAzD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;6DAAgC","sourcesContent":["import { css, LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport type { TemplateVariable } from '@qti-components/base';\nimport type { BaseType } from '@qti-components/base';\n\n/**\n * @summary The qti-template-declaration element declares template variables for item cloning.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-declaration\n */\n\nexport class QtiTemplateDeclaration extends LitElement {\n @property({ type: String }) identifier: string = '';\n @property({ type: String }) cardinality: 'single' | 'multiple' | 'ordered' | 'record' = 'single';\n @property({ type: String, attribute: 'base-type' }) baseType: BaseType = 'string';\n @property({ type: Boolean, attribute: 'math-variable' }) mathVariable: boolean = false;\n @property({ type: Boolean, attribute: 'param-variable' }) paramVariable: boolean = false;\n\n #defaultValue: any = null;\n\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n override render() {\n return html`<slot></slot>`;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.updateComplete.then(() => {\n this.#processDefaultValue();\n this.#registerTemplateVariable();\n });\n }\n\n /**\n * Process qti-default-value to extract the default value\n */\n #processDefaultValue(): void {\n const defaultValueElement = this.querySelector('qti-default-value');\n if (!defaultValueElement) {\n return;\n }\n\n // For now, just get the text content - this could be enhanced to handle expressions\n const textContent = defaultValueElement.textContent?.trim() || '';\n this.#defaultValue = this.#convertValue(textContent);\n }\n\n /**\n * Convert string value based on base-type\n */\n #convertValue(value: string): any {\n if (!value) return null;\n\n switch (this.baseType) {\n case 'integer':\n return parseInt(value, 10);\n case 'float':\n case 'duration':\n return parseFloat(value);\n case 'boolean':\n return value.toLowerCase() === 'true';\n case 'string':\n default:\n return value;\n }\n }\n\n /**\n * Register this template variable with the assessment item\n */\n #registerTemplateVariable(): void {\n const templateVariable: TemplateVariable = {\n identifier: this.identifier,\n cardinality: this.cardinality,\n baseType: this.baseType,\n defaultValue: this.#defaultValue,\n value: this.#defaultValue,\n type: 'template',\n mathVariable: this.mathVariable,\n paramVariable: this.paramVariable\n };\n\n // Dispatch event to register the variable\n\n // value must string or string[]\n const variable = { ...templateVariable, value: this.#defaultValue?.toString() || '' };\n this.dispatchEvent(\n new CustomEvent('qti-register-variable', {\n bubbles: true,\n composed: true,\n detail: { variable }\n })\n );\n }\n\n /**\n * Get the template variable definition\n */\n public getTemplateVariable(): TemplateVariable {\n return {\n identifier: this.identifier,\n cardinality: this.cardinality,\n baseType: this.baseType,\n value: this.#defaultValue,\n type: 'template',\n mathVariable: this.mathVariable,\n paramVariable: this.paramVariable\n };\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-template-declaration': QtiTemplateDeclaration;\n }\n}\n"]}
@@ -1,16 +1,9 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
1
  import { css, html, LitElement } from 'lit';
8
- import { customElement } from 'lit/decorators.js';
9
2
  /**
10
3
  * @summary The qti-template-processing element contains template processing rules.
11
4
  * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-processing
12
5
  */
13
- let QtiTemplateProcessing = class QtiTemplateProcessing extends LitElement {
6
+ export class QtiTemplateProcessing extends LitElement {
14
7
  static { this.styles = [
15
8
  css `
16
9
  :host {
@@ -76,9 +69,5 @@ let QtiTemplateProcessing = class QtiTemplateProcessing extends LitElement {
76
69
  console.info('Template processing with external template not yet implemented');
77
70
  }
78
71
  }
79
- };
80
- QtiTemplateProcessing = __decorate([
81
- customElement('qti-template-processing')
82
- ], QtiTemplateProcessing);
83
- export { QtiTemplateProcessing };
72
+ }
84
73
  //# sourceMappingURL=qti-template-processing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"qti-template-processing.js","sourceRoot":"","sources":["../../../src/components/qti-template-processing/qti-template-processing.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMlD;;;GAGG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,UAAU;aACnC,WAAM,GAAG;QACvB,GAAG,CAAA;;;;KAIF;KACF,AANqB,CAMpB;IAEF,cAAc,GAAG,GAAG,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IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,kCAAkC,EAAE;YAClD,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,EAAE,UAAU,EAAE;SACvB,CAAC,CACH,CAAC;IACJ,CAAC;IAEe,YAAY,CAAC,kBAAqE;QAChG,wFAAwF;QACxF,kFAAkF;QAClF,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;YAClC,OAAO,CAAC,IAAI,CAAC,gEAAgE,CAAC,CAAC;QACjF,CAAC;IACH,CAAC;;AA1EU,qBAAqB;IADjC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,qBAAqB,CA2EjC","sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement } from 'lit/decorators.js';\n\nimport type { QtiRuleBase } from '@qti-components/base';\nimport type { QtiTemplateConstraint } from '../qti-template-constraint/qti-template-constraint';\nimport type { PropertyValueMap } from 'lit';\n\n/**\n * @summary The qti-template-processing element contains template processing rules.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-processing\n */\n@customElement('qti-template-processing')\nexport class QtiTemplateProcessing extends LitElement {\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n #maxIterations = 100; // Prevent infinite loops in template constraints\n\n override render() {\n return html`<slot></slot>`;\n }\n\n /**\n * Process template rules to set template variable values\n */\n public process(): void {\n const assessmentItem = this.closest('qti-assessment-item');\n if (!assessmentItem) {\n console.warn('qti-template-processing must be inside qti-assessment-item');\n return;\n }\n\n let iterations = 0;\n let shouldReprocess = false;\n\n do {\n shouldReprocess = false;\n iterations++;\n\n if (iterations > this.#maxIterations) {\n console.error('Template processing exceeded maximum iterations. Possible infinite loop.');\n break;\n }\n\n try {\n const rules = [...this.children] as unknown as (Element & QtiRuleBase)[];\n for (const rule of rules) {\n // Check if this is a template constraint that failed\n if (rule.tagName.toLowerCase() === 'qti-template-constraint') {\n const constraintResult = (rule as QtiTemplateConstraint).calculate();\n if (constraintResult === false) {\n // Template constraint failed, restart processing\n shouldReprocess = true;\n break;\n }\n } else {\n rule.process();\n }\n }\n } catch (error) {\n console.error('Error during template processing:', error);\n break;\n }\n } while (shouldReprocess);\n\n // Dispatch event that template processing is complete\n this.dispatchEvent(\n new CustomEvent('qti-template-processing-complete', {\n bubbles: true,\n composed: true,\n detail: { iterations }\n })\n );\n }\n\n public override firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n // Template processing doesn't typically use external templates like response processing\n // But we could add support for common template processing patterns here if needed\n if (this.getAttribute('template')) {\n console.info('Template processing with external template not yet implemented');\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-template-processing': QtiTemplateProcessing;\n }\n}\n"]}
1
+ {"version":3,"file":"qti-template-processing.js","sourceRoot":"","sources":["../../../src/components/qti-template-processing/qti-template-processing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAM5C;;;GAGG;AAEH,MAAM,OAAO,qBAAsB,SAAQ,UAAU;aACnC,WAAM,GAAG;QACvB,GAAG,CAAA;;;;KAIF;KACF,CAAC;IAEF,cAAc,GAAG,GAAG,CAAC,CAAC,iDAAiD;IAE9D,MAAM;QACb,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,OAAO;QACZ,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAC3D,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;YAC3E,OAAO;QACT,CAAC;QAED,IAAI,UAAU,GAAG,CAAC,CAAC;QACnB,IAAI,eAAe,GAAG,KAAK,CAAC;QAE5B,GAAG,CAAC;YACF,eAAe,GAAG,KAAK,CAAC;YACxB,UAAU,EAAE,CAAC;YAEb,IAAI,UAAU,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;gBACrC,OAAO,CAAC,KAAK,CAAC,0EAA0E,CAAC,CAAC;gBAC1F,MAAM;YACR,CAAC;YAED,IAAI,CAAC;gBACH,MAAM,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAyC,CAAC;gBACzE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;oBACzB,qDAAqD;oBACrD,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,yBAAyB,EAAE,CAAC;wBAC7D,MAAM,gBAAgB,GAAI,IAA8B,CAAC,SAAS,EAAE,CAAC;wBACrE,IAAI,gBAAgB,KAAK,KAAK,EAAE,CAAC;4BAC/B,iDAAiD;4BACjD,eAAe,GAAG,IAAI,CAAC;4BACvB,MAAM;wBACR,CAAC;oBACH,CAAC;yBAAM,CAAC;wBACN,IAAI,CAAC,OAAO,EAAE,CAAC;oBACjB,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,mCAAmC,EAAE,KAAK,CAAC,CAAC;gBAC1D,MAAM;YACR,CAAC;QACH,CAAC,QAAQ,eAAe,EAAE;QAE1B,sDAAsD;QACtD,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,kCAAkC,EAAE;YAClD,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,EAAE,UAAU,EAAE;SACvB,CAAC,CACH,CAAC;IACJ,CAAC;IAEe,YAAY,CAAC,kBAAqE;QAChG,wFAAwF;QACxF,kFAAkF;QAClF,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;YAClC,OAAO,CAAC,IAAI,CAAC,gEAAgE,CAAC,CAAC;QACjF,CAAC;IACH,CAAC","sourcesContent":["import { css, html, LitElement } from 'lit';\n\nimport type { QtiRuleBase } from '@qti-components/base';\nimport type { QtiTemplateConstraint } from '../qti-template-constraint/qti-template-constraint';\nimport type { PropertyValueMap } from 'lit';\n\n/**\n * @summary The qti-template-processing element contains template processing rules.\n * @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.template-processing\n */\n\nexport class QtiTemplateProcessing extends LitElement {\n static override styles = [\n css`\n :host {\n display: none;\n }\n `\n ];\n\n #maxIterations = 100; // Prevent infinite loops in template constraints\n\n override render() {\n return html`<slot></slot>`;\n }\n\n /**\n * Process template rules to set template variable values\n */\n public process(): void {\n const assessmentItem = this.closest('qti-assessment-item');\n if (!assessmentItem) {\n console.warn('qti-template-processing must be inside qti-assessment-item');\n return;\n }\n\n let iterations = 0;\n let shouldReprocess = false;\n\n do {\n shouldReprocess = false;\n iterations++;\n\n if (iterations > this.#maxIterations) {\n console.error('Template processing exceeded maximum iterations. Possible infinite loop.');\n break;\n }\n\n try {\n const rules = [...this.children] as unknown as (Element & QtiRuleBase)[];\n for (const rule of rules) {\n // Check if this is a template constraint that failed\n if (rule.tagName.toLowerCase() === 'qti-template-constraint') {\n const constraintResult = (rule as QtiTemplateConstraint).calculate();\n if (constraintResult === false) {\n // Template constraint failed, restart processing\n shouldReprocess = true;\n break;\n }\n } else {\n rule.process();\n }\n }\n } catch (error) {\n console.error('Error during template processing:', error);\n break;\n }\n } while (shouldReprocess);\n\n // Dispatch event that template processing is complete\n this.dispatchEvent(\n new CustomEvent('qti-template-processing-complete', {\n bubbles: true,\n composed: true,\n detail: { iterations }\n })\n );\n }\n\n public override firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n // Template processing doesn't typically use external templates like response processing\n // But we could add support for common template processing patterns here if needed\n if (this.getAttribute('template')) {\n console.info('Template processing with external template not yet implemented');\n }\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'qti-template-processing': QtiTemplateProcessing;\n }\n}\n"]}
@@ -0,0 +1,74 @@
1
+ import { QtiAssessmentItem } from './components/qti-assessment-item/qti-assessment-item';
2
+ import { QtiAssessmentStimulusRef } from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';
3
+ import { QtiCompanionMaterialsInfo } from './components/qti-companion-materials-info/qti-companion-materials-info';
4
+ import { QtiContentBody } from './components/qti-content-body/qti-content-body';
5
+ import { QtiContextDeclaration } from './components/qti-context-declaration/qti-context-declaration';
6
+ import { QtiCustomOperator } from './components/qti-custom-operator/qti-custom-operator';
7
+ import { QtiFeedbackBlock } from './components/qti-feedback-block/qti-feedback-block';
8
+ import { QtiFeedbackInline } from './components/qti-feedback-inline/qti-feedback-inline';
9
+ import { QtiItemBody } from './components/qti-item-body/qti-item-body';
10
+ import { QtiModalFeedback } from './components/qti-modal-feedback/qti-modal-feedback';
11
+ import { QtiOutcomeDeclaration } from './components/qti-outcome-declaration/qti-outcome-declaration';
12
+ import { QtiResponseDeclaration } from './components/qti-response-declaration/qti-response-declaration';
13
+ import { QtiResponseProcessing } from './components/qti-response-processing/qti-response-processing';
14
+ import { QtiRubricBlock } from './components/qti-rubric-block/qti-rubric-block';
15
+ import { QtiStylesheet } from './components/qti-stylesheet/qti-stylesheet';
16
+ import { QtiTemplateConstraint } from './components/qti-template-constraint/qti-template-constraint';
17
+ import { QtiTemplateDeclaration } from './components/qti-template-declaration/qti-template-declaration';
18
+ import { QtiTemplateProcessing } from './components/qti-template-processing/qti-template-processing';
19
+ export { QtiAssessmentItem, QtiAssessmentStimulusRef, QtiCompanionMaterialsInfo, QtiContentBody, QtiContextDeclaration, QtiCustomOperator, QtiFeedbackBlock, QtiFeedbackInline, QtiItemBody, QtiModalFeedback, QtiOutcomeDeclaration, QtiResponseDeclaration, QtiResponseProcessing, QtiRubricBlock, QtiStylesheet, QtiTemplateConstraint, QtiTemplateDeclaration, QtiTemplateProcessing };
20
+ export declare const qtiContentElements: readonly [{
21
+ readonly tag: "qti-assessment-item";
22
+ readonly ctor: typeof QtiAssessmentItem;
23
+ }, {
24
+ readonly tag: "qti-assessment-stimulus-ref";
25
+ readonly ctor: typeof QtiAssessmentStimulusRef;
26
+ }, {
27
+ readonly tag: "qti-companion-materials-info";
28
+ readonly ctor: typeof QtiCompanionMaterialsInfo;
29
+ }, {
30
+ readonly tag: "qti-content-body";
31
+ readonly ctor: typeof QtiContentBody;
32
+ }, {
33
+ readonly tag: "qti-context-declaration";
34
+ readonly ctor: typeof QtiContextDeclaration;
35
+ }, {
36
+ readonly tag: "qti-custom-operator";
37
+ readonly ctor: typeof QtiCustomOperator;
38
+ }, {
39
+ readonly tag: "qti-feedback-block";
40
+ readonly ctor: typeof QtiFeedbackBlock;
41
+ }, {
42
+ readonly tag: "qti-feedback-inline";
43
+ readonly ctor: typeof QtiFeedbackInline;
44
+ }, {
45
+ readonly tag: "qti-item-body";
46
+ readonly ctor: typeof QtiItemBody;
47
+ }, {
48
+ readonly tag: "qti-modal-feedback";
49
+ readonly ctor: typeof QtiModalFeedback;
50
+ }, {
51
+ readonly tag: "qti-outcome-declaration";
52
+ readonly ctor: typeof QtiOutcomeDeclaration;
53
+ }, {
54
+ readonly tag: "qti-response-declaration";
55
+ readonly ctor: typeof QtiResponseDeclaration;
56
+ }, {
57
+ readonly tag: "qti-response-processing";
58
+ readonly ctor: typeof QtiResponseProcessing;
59
+ }, {
60
+ readonly tag: "qti-rubric-block";
61
+ readonly ctor: typeof QtiRubricBlock;
62
+ }, {
63
+ readonly tag: "qti-stylesheet";
64
+ readonly ctor: typeof QtiStylesheet;
65
+ }, {
66
+ readonly tag: "qti-template-constraint";
67
+ readonly ctor: typeof QtiTemplateConstraint;
68
+ }, {
69
+ readonly tag: "qti-template-declaration";
70
+ readonly ctor: typeof QtiTemplateDeclaration;
71
+ }, {
72
+ readonly tag: "qti-template-processing";
73
+ readonly ctor: typeof QtiTemplateProcessing;
74
+ }];
@@ -0,0 +1,40 @@
1
+ import { QtiAssessmentItem } from './components/qti-assessment-item/qti-assessment-item';
2
+ import { QtiAssessmentStimulusRef } from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';
3
+ import { QtiCompanionMaterialsInfo } from './components/qti-companion-materials-info/qti-companion-materials-info';
4
+ import { QtiContentBody } from './components/qti-content-body/qti-content-body';
5
+ import { QtiContextDeclaration } from './components/qti-context-declaration/qti-context-declaration';
6
+ import { QtiCustomOperator } from './components/qti-custom-operator/qti-custom-operator';
7
+ import { QtiFeedbackBlock } from './components/qti-feedback-block/qti-feedback-block';
8
+ import { QtiFeedbackInline } from './components/qti-feedback-inline/qti-feedback-inline';
9
+ import { QtiItemBody } from './components/qti-item-body/qti-item-body';
10
+ import { QtiModalFeedback } from './components/qti-modal-feedback/qti-modal-feedback';
11
+ import { QtiOutcomeDeclaration } from './components/qti-outcome-declaration/qti-outcome-declaration';
12
+ import { QtiResponseDeclaration } from './components/qti-response-declaration/qti-response-declaration';
13
+ import { QtiResponseProcessing } from './components/qti-response-processing/qti-response-processing';
14
+ import { QtiRubricBlock } from './components/qti-rubric-block/qti-rubric-block';
15
+ import { QtiStylesheet } from './components/qti-stylesheet/qti-stylesheet';
16
+ import { QtiTemplateConstraint } from './components/qti-template-constraint/qti-template-constraint';
17
+ import { QtiTemplateDeclaration } from './components/qti-template-declaration/qti-template-declaration';
18
+ import { QtiTemplateProcessing } from './components/qti-template-processing/qti-template-processing';
19
+ export { QtiAssessmentItem, QtiAssessmentStimulusRef, QtiCompanionMaterialsInfo, QtiContentBody, QtiContextDeclaration, QtiCustomOperator, QtiFeedbackBlock, QtiFeedbackInline, QtiItemBody, QtiModalFeedback, QtiOutcomeDeclaration, QtiResponseDeclaration, QtiResponseProcessing, QtiRubricBlock, QtiStylesheet, QtiTemplateConstraint, QtiTemplateDeclaration, QtiTemplateProcessing };
20
+ export const qtiContentElements = [
21
+ { tag: 'qti-assessment-item', ctor: QtiAssessmentItem },
22
+ { tag: 'qti-assessment-stimulus-ref', ctor: QtiAssessmentStimulusRef },
23
+ { tag: 'qti-companion-materials-info', ctor: QtiCompanionMaterialsInfo },
24
+ { tag: 'qti-content-body', ctor: QtiContentBody },
25
+ { tag: 'qti-context-declaration', ctor: QtiContextDeclaration },
26
+ { tag: 'qti-custom-operator', ctor: QtiCustomOperator },
27
+ { tag: 'qti-feedback-block', ctor: QtiFeedbackBlock },
28
+ { tag: 'qti-feedback-inline', ctor: QtiFeedbackInline },
29
+ { tag: 'qti-item-body', ctor: QtiItemBody },
30
+ { tag: 'qti-modal-feedback', ctor: QtiModalFeedback },
31
+ { tag: 'qti-outcome-declaration', ctor: QtiOutcomeDeclaration },
32
+ { tag: 'qti-response-declaration', ctor: QtiResponseDeclaration },
33
+ { tag: 'qti-response-processing', ctor: QtiResponseProcessing },
34
+ { tag: 'qti-rubric-block', ctor: QtiRubricBlock },
35
+ { tag: 'qti-stylesheet', ctor: QtiStylesheet },
36
+ { tag: 'qti-template-constraint', ctor: QtiTemplateConstraint },
37
+ { tag: 'qti-template-declaration', ctor: QtiTemplateDeclaration },
38
+ { tag: 'qti-template-processing', ctor: QtiTemplateProcessing }
39
+ ];
40
+ //# sourceMappingURL=elements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elements.js","sourceRoot":"","sources":["../src/elements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AACzF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sEAAsE,CAAC;AAChH,OAAO,EAAE,yBAAyB,EAAE,MAAM,wEAAwE,CAAC;AACnH,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,8DAA8D,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAE,qBAAq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,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,EAAE;IAC3C,EAAE,GAAG,EAAE,oBAAoB,EAAE,IAAI,EAAE,gBAAgB,EAAE;IACrD,EAAE,GAAG,EAAE,yBAAyB,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC/D,EAAE,GAAG,EAAE,0BAA0B,EAAE,IAAI,EAAE,sBAAsB,EAAE;IACjE,EAAE,GAAG,EAAE,yBAAyB,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC/D,EAAE,GAAG,EAAE,kBAAkB,EAAE,IAAI,EAAE,cAAc,EAAE;IACjD,EAAE,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,EAAE;IAC9C,EAAE,GAAG,EAAE,yBAAyB,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC/D,EAAE,GAAG,EAAE,0BAA0B,EAAE,IAAI,EAAE,sBAAsB,EAAE;IACjE,EAAE,GAAG,EAAE,yBAAyB,EAAE,IAAI,EAAE,qBAAqB,EAAE;CACvD,CAAC","sourcesContent":["import { QtiAssessmentItem } from './components/qti-assessment-item/qti-assessment-item';\nimport { QtiAssessmentStimulusRef } from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';\nimport { QtiCompanionMaterialsInfo } from './components/qti-companion-materials-info/qti-companion-materials-info';\nimport { QtiContentBody } from './components/qti-content-body/qti-content-body';\nimport { QtiContextDeclaration } from './components/qti-context-declaration/qti-context-declaration';\nimport { QtiCustomOperator } from './components/qti-custom-operator/qti-custom-operator';\nimport { QtiFeedbackBlock } from './components/qti-feedback-block/qti-feedback-block';\nimport { QtiFeedbackInline } from './components/qti-feedback-inline/qti-feedback-inline';\nimport { QtiItemBody } from './components/qti-item-body/qti-item-body';\nimport { QtiModalFeedback } from './components/qti-modal-feedback/qti-modal-feedback';\nimport { QtiOutcomeDeclaration } from './components/qti-outcome-declaration/qti-outcome-declaration';\nimport { QtiResponseDeclaration } from './components/qti-response-declaration/qti-response-declaration';\nimport { QtiResponseProcessing } from './components/qti-response-processing/qti-response-processing';\nimport { QtiRubricBlock } from './components/qti-rubric-block/qti-rubric-block';\nimport { QtiStylesheet } from './components/qti-stylesheet/qti-stylesheet';\nimport { QtiTemplateConstraint } from './components/qti-template-constraint/qti-template-constraint';\nimport { QtiTemplateDeclaration } from './components/qti-template-declaration/qti-template-declaration';\nimport { QtiTemplateProcessing } from './components/qti-template-processing/qti-template-processing';\n\nexport {\n QtiAssessmentItem,\n QtiAssessmentStimulusRef,\n QtiCompanionMaterialsInfo,\n QtiContentBody,\n QtiContextDeclaration,\n QtiCustomOperator,\n QtiFeedbackBlock,\n QtiFeedbackInline,\n QtiItemBody,\n QtiModalFeedback,\n QtiOutcomeDeclaration,\n QtiResponseDeclaration,\n QtiResponseProcessing,\n QtiRubricBlock,\n QtiStylesheet,\n QtiTemplateConstraint,\n QtiTemplateDeclaration,\n QtiTemplateProcessing\n};\n\nexport const qtiContentElements = [\n { tag: 'qti-assessment-item', ctor: QtiAssessmentItem },\n { tag: 'qti-assessment-stimulus-ref', ctor: QtiAssessmentStimulusRef },\n { tag: 'qti-companion-materials-info', ctor: QtiCompanionMaterialsInfo },\n { tag: 'qti-content-body', ctor: QtiContentBody },\n { tag: 'qti-context-declaration', ctor: QtiContextDeclaration },\n { tag: 'qti-custom-operator', ctor: QtiCustomOperator },\n { tag: 'qti-feedback-block', ctor: QtiFeedbackBlock },\n { tag: 'qti-feedback-inline', ctor: QtiFeedbackInline },\n { tag: 'qti-item-body', ctor: QtiItemBody },\n { tag: 'qti-modal-feedback', ctor: QtiModalFeedback },\n { tag: 'qti-outcome-declaration', ctor: QtiOutcomeDeclaration },\n { tag: 'qti-response-declaration', ctor: QtiResponseDeclaration },\n { tag: 'qti-response-processing', ctor: QtiResponseProcessing },\n { tag: 'qti-rubric-block', ctor: QtiRubricBlock },\n { tag: 'qti-stylesheet', ctor: QtiStylesheet },\n { tag: 'qti-template-constraint', ctor: QtiTemplateConstraint },\n { tag: 'qti-template-declaration', ctor: QtiTemplateDeclaration },\n { tag: 'qti-template-processing', ctor: QtiTemplateProcessing }\n] as const;\n"]}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import './register';
1
2
  export * from './components/qti-assessment-item/qti-assessment-item';
2
3
  export * from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';
3
4
  export * from './components/qti-companion-materials-info/qti-companion-materials-info';
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import './register';
1
2
  export * from './components/qti-assessment-item/qti-assessment-item';
2
3
  export * from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';
3
4
  export * from './components/qti-companion-materials-info/qti-companion-materials-info';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sDAAsD,CAAC;AACrE,cAAc,sEAAsE,CAAC;AACrF,cAAc,wEAAwE,CAAC;AACvF,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gEAAgE,CAAC;AAC/E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC","sourcesContent":["export * from './components/qti-assessment-item/qti-assessment-item';\nexport * from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';\nexport * from './components/qti-companion-materials-info/qti-companion-materials-info';\nexport * from './components/qti-custom-operator/qti-custom-operator';\nexport * from './components/qti-feedback-block/qti-feedback-block';\nexport * from './components/qti-feedback-inline/qti-feedback-inline';\nexport * from './components/qti-modal-feedback/qti-modal-feedback';\nexport * from './components/qti-item-body/qti-item-body';\nexport * from './components/qti-content-body/qti-content-body';\nexport * from './components/qti-rubric-block/qti-rubric-block';\nexport * from './components/qti-stylesheet/qti-stylesheet';\nexport * from './components/qti-response-declaration/qti-response-declaration';\nexport * from './components/qti-outcome-declaration/qti-outcome-declaration';\nexport * from './components/qti-response-processing/qti-response-processing';\nexport * from './components/qti-template-declaration/qti-template-declaration';\nexport * from './components/qti-template-processing/qti-template-processing';\nexport * from './components/qti-template-constraint/qti-template-constraint';\nexport * from './components/qti-context-declaration/qti-context-declaration';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,CAAC;AAEpB,cAAc,sDAAsD,CAAC;AACrE,cAAc,sEAAsE,CAAC;AACrF,cAAc,wEAAwE,CAAC;AACvF,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,oDAAoD,CAAC;AACnE,cAAc,0CAA0C,CAAC;AACzD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gEAAgE,CAAC;AAC/E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC;AAC7E,cAAc,8DAA8D,CAAC","sourcesContent":["import './register';\n\nexport * from './components/qti-assessment-item/qti-assessment-item';\nexport * from './components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref';\nexport * from './components/qti-companion-materials-info/qti-companion-materials-info';\nexport * from './components/qti-custom-operator/qti-custom-operator';\nexport * from './components/qti-feedback-block/qti-feedback-block';\nexport * from './components/qti-feedback-inline/qti-feedback-inline';\nexport * from './components/qti-modal-feedback/qti-modal-feedback';\nexport * from './components/qti-item-body/qti-item-body';\nexport * from './components/qti-content-body/qti-content-body';\nexport * from './components/qti-rubric-block/qti-rubric-block';\nexport * from './components/qti-stylesheet/qti-stylesheet';\nexport * from './components/qti-response-declaration/qti-response-declaration';\nexport * from './components/qti-outcome-declaration/qti-outcome-declaration';\nexport * from './components/qti-response-processing/qti-response-processing';\nexport * from './components/qti-template-declaration/qti-template-declaration';\nexport * from './components/qti-template-processing/qti-template-processing';\nexport * from './components/qti-template-constraint/qti-template-constraint';\nexport * from './components/qti-context-declaration/qti-context-declaration';\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { qtiContentElements } from './elements';
2
+ for (const { tag, ctor } of qtiContentElements) {
3
+ if (!customElements.get(tag)) {
4
+ customElements.define(tag, ctor);
5
+ }
6
+ }
7
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,KAAK,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,kBAAkB,EAAE,CAAC;IAC/C,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7B,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;AACH,CAAC","sourcesContent":["import { qtiContentElements } from './elements';\n\nfor (const { tag, ctor } of qtiContentElements) {\n if (!customElements.get(tag)) {\n customElements.define(tag, ctor);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@qti-components/elements",
3
3
  "description": "QTI elements utilities",
4
- "version": "1.6.3",
4
+ "version": "1.6.4",
5
5
  "author": "",
6
6
  "dependencies": {
7
- "@qti-components/base": "^1.4.3",
8
- "@qti-components/utilities": "^1.3.3",
9
- "@qti-components/transformers": "^1.6.3"
7
+ "@qti-components/base": "^2.0.0",
8
+ "@qti-components/transformers": "^1.7.1",
9
+ "@qti-components/utilities": "^1.3.3"
10
10
  },
11
11
  "devDependencies": {
12
12
  "@lit/context": "^1.1.6",
@@ -18,6 +18,21 @@
18
18
  ],
19
19
  "license": "GPL-3.0-only",
20
20
  "main": "dist/index.js",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/index.js"
25
+ },
26
+ "./elements": {
27
+ "types": "./dist/elements.d.ts",
28
+ "import": "./dist/elements.js"
29
+ },
30
+ "./register": {
31
+ "types": "./dist/register.d.ts",
32
+ "import": "./dist/register.js"
33
+ },
34
+ "./*": "./dist/*"
35
+ },
21
36
  "peerDependencies": {
22
37
  "@lit/context": "^1.1.6",
23
38
  "lit": "^3.3.1"
@@ -39,6 +54,8 @@
39
54
  "scripts": {
40
55
  "attw": "attw --profile esm-only --pack",
41
56
  "build": "tsc --paths null",
42
- "clean": "rm -rf dist"
57
+ "clean": "rm -rf dist",
58
+ "yalc": "yalc publish",
59
+ "yalc:push": "yalc push"
43
60
  }
44
61
  }