@citolab/qti-components 6.7.1-54 → 6.7.1-56

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.
@@ -96,6 +96,65 @@
96
96
  }
97
97
  ]
98
98
  },
99
+ {
100
+ "kind": "javascript-module",
101
+ "path": "src/lib/qti-transformers/index.ts",
102
+ "declarations": [],
103
+ "exports": [
104
+ {
105
+ "kind": "js",
106
+ "name": "*",
107
+ "declaration": {
108
+ "name": "*",
109
+ "package": "./qti-transformers"
110
+ }
111
+ }
112
+ ]
113
+ },
114
+ {
115
+ "kind": "javascript-module",
116
+ "path": "src/lib/qti-transformers/qti-transformers.ts",
117
+ "declarations": [
118
+ {
119
+ "kind": "function",
120
+ "name": "qtiTransformItem",
121
+ "return": {
122
+ "type": {
123
+ "text": ""
124
+ }
125
+ },
126
+ "description": "Browser based QTI-XML to HTML transformer.\nReturns an object with methods to load, parse, transform and serialize QTI XML items."
127
+ },
128
+ {
129
+ "kind": "function",
130
+ "name": "qtiTransformTest",
131
+ "return": {
132
+ "type": {
133
+ "text": ""
134
+ }
135
+ },
136
+ "description": "Returns an object with methods to load, parse and transform QTI tests."
137
+ }
138
+ ],
139
+ "exports": [
140
+ {
141
+ "kind": "js",
142
+ "name": "qtiTransformItem",
143
+ "declaration": {
144
+ "name": "qtiTransformItem",
145
+ "module": "src/lib/qti-transformers/qti-transformers.ts"
146
+ }
147
+ },
148
+ {
149
+ "kind": "js",
150
+ "name": "qtiTransformTest",
151
+ "declaration": {
152
+ "name": "qtiTransformTest",
153
+ "module": "src/lib/qti-transformers/qti-transformers.ts"
154
+ }
155
+ }
156
+ ]
157
+ },
99
158
  {
100
159
  "kind": "javascript-module",
101
160
  "path": "src/lib/qti-components/index.ts",
@@ -519,65 +578,6 @@
519
578
  }
520
579
  ]
521
580
  },
522
- {
523
- "kind": "javascript-module",
524
- "path": "src/lib/qti-transformers/index.ts",
525
- "declarations": [],
526
- "exports": [
527
- {
528
- "kind": "js",
529
- "name": "*",
530
- "declaration": {
531
- "name": "*",
532
- "package": "./qti-transformers"
533
- }
534
- }
535
- ]
536
- },
537
- {
538
- "kind": "javascript-module",
539
- "path": "src/lib/qti-transformers/qti-transformers.ts",
540
- "declarations": [
541
- {
542
- "kind": "function",
543
- "name": "qtiTransformItem",
544
- "return": {
545
- "type": {
546
- "text": ""
547
- }
548
- },
549
- "description": "Browser based QTI-XML to HTML transformer.\nReturns an object with methods to load, parse, transform and serialize QTI XML items."
550
- },
551
- {
552
- "kind": "function",
553
- "name": "qtiTransformTest",
554
- "return": {
555
- "type": {
556
- "text": ""
557
- }
558
- },
559
- "description": "Returns an object with methods to load, parse and transform QTI tests."
560
- }
561
- ],
562
- "exports": [
563
- {
564
- "kind": "js",
565
- "name": "qtiTransformItem",
566
- "declaration": {
567
- "name": "qtiTransformItem",
568
- "module": "src/lib/qti-transformers/qti-transformers.ts"
569
- }
570
- },
571
- {
572
- "kind": "js",
573
- "name": "qtiTransformTest",
574
- "declaration": {
575
- "name": "qtiTransformTest",
576
- "module": "src/lib/qti-transformers/qti-transformers.ts"
577
- }
578
- }
579
- ]
580
- },
581
581
  {
582
582
  "kind": "javascript-module",
583
583
  "path": "src/lib/qti-components/internal/event-types.ts",
@@ -703,6 +703,62 @@
703
703
  "declarations": [],
704
704
  "exports": []
705
705
  },
706
+ {
707
+ "kind": "javascript-module",
708
+ "path": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts",
709
+ "declarations": [
710
+ {
711
+ "kind": "class",
712
+ "description": "Represents a custom element for referencing an assessment stimulus.",
713
+ "name": "QtiAssessmentStimulusRef",
714
+ "members": [],
715
+ "attributes": [
716
+ {
717
+ "name": "identifier",
718
+ "type": {
719
+ "text": "string"
720
+ },
721
+ "default": "''",
722
+ "description": "The identifier of the stimulus.",
723
+ "fieldName": "identifier"
724
+ },
725
+ {
726
+ "name": "href",
727
+ "type": {
728
+ "text": "string"
729
+ },
730
+ "default": "''",
731
+ "description": "The href of the stimulus.",
732
+ "fieldName": "href"
733
+ }
734
+ ],
735
+ "superclass": {
736
+ "name": "LitElement",
737
+ "package": "lit"
738
+ },
739
+ "tagName": "qti-assessment-stimulus-ref",
740
+ "customElement": true
741
+ }
742
+ ],
743
+ "exports": [
744
+ {
745
+ "kind": "js",
746
+ "name": "QtiAssessmentStimulusRef",
747
+ "declaration": {
748
+ "name": "QtiAssessmentStimulusRef",
749
+ "module": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts"
750
+ }
751
+ },
752
+ {
753
+ "kind": "custom-element-definition",
754
+ "name": "qti-assessment-stimulus-ref",
755
+ "declaration": {
756
+ "name": "QtiAssessmentStimulusRef",
757
+ "module": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts"
758
+ }
759
+ }
760
+ ]
761
+ },
706
762
  {
707
763
  "kind": "javascript-module",
708
764
  "path": "src/lib/qti-components/qti-assessment-item/item-print-variables.ts",
@@ -882,60 +938,6 @@
882
938
  }
883
939
  ]
884
940
  },
885
- {
886
- "kind": "javascript-module",
887
- "path": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts",
888
- "declarations": [
889
- {
890
- "kind": "class",
891
- "description": "",
892
- "name": "QtiAssessmentStimulusRef",
893
- "members": [],
894
- "attributes": [
895
- {
896
- "name": "identifier",
897
- "type": {
898
- "text": "string"
899
- },
900
- "default": "''",
901
- "fieldName": "identifier"
902
- },
903
- {
904
- "name": "href",
905
- "type": {
906
- "text": "string"
907
- },
908
- "default": "''",
909
- "fieldName": "href"
910
- }
911
- ],
912
- "superclass": {
913
- "name": "LitElement",
914
- "package": "lit"
915
- },
916
- "tagName": "qti-assessment-stimulus-ref",
917
- "customElement": true
918
- }
919
- ],
920
- "exports": [
921
- {
922
- "kind": "js",
923
- "name": "QtiAssessmentStimulusRef",
924
- "declaration": {
925
- "name": "QtiAssessmentStimulusRef",
926
- "module": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts"
927
- }
928
- },
929
- {
930
- "kind": "custom-element-definition",
931
- "name": "qti-assessment-stimulus-ref",
932
- "declaration": {
933
- "name": "QtiAssessmentStimulusRef",
934
- "module": "src/lib/qti-components/qti-assessment-stimulus-ref/qti-assessment-stimulus-ref.ts"
935
- }
936
- }
937
- ]
938
- },
939
941
  {
940
942
  "kind": "javascript-module",
941
943
  "path": "src/lib/qti-components/qti-companion-materials-info/qti-companion-materials-info.ts",
package/dist/index.js CHANGED
@@ -73,21 +73,22 @@ var $r=Object.defineProperty,$s=Object.defineProperties,Ss=Object.getOwnProperty
73
73
  height: 100%;
74
74
  border: 0;
75
75
  }
76
- `]}render(){return d`<textarea
77
- part="textarea"
78
- ${gs(this.textareaRef)}
79
- spellcheck="false"
80
- autocomplete="off"
81
- @keydown="${e=>e.stopImmediatePropagation()}"
82
- @keyup="${this.textChanged}"
83
- @change="${this.textChanged}"
84
- placeholder="${X(this.placeholderText?this.placeholderText:void 0)}"
85
- maxlength="${X(this.expectedLength?this.expectedLength:void 0)}"
86
- pattern="${X(this.patternMask?this.patternMask:void 0)}"
87
- ?disabled="${this.disabled}"
88
- ?readonly="${this.readonly}"
89
- .value=${this._value}
90
- ></textarea>`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};a([p({type:Number,attribute:"expected-length"})],j.prototype,"expectedLength",2),a([p({type:String,attribute:"pattern-mask"})],j.prototype,"patternMask",2),a([p({type:String,attribute:"placeholder-text"})],j.prototype,"placeholderText",2),a([C()],j.prototype,"_value",2),a([p({type:String,attribute:"class"})],j.prototype,"classNames",2),a([$("classNames",{waitUntilFirstUpdate:!0})],j.prototype,"handleclassNamesChange",1),j=a([m("qti-extended-text-interaction")],j);function bs(i,t){let e,r=E({},t);return(s,n)=>{let{connectedCallback:o,disconnectedCallback:l}=s;s.connectedCallback=function(){var h;o.call(this);let c=f=>{let x=Array.from(this.querySelectorAll(i));for(let v of f){let w=Array.from(v.addedNodes).map(S=>S),A=Array.from(v.addedNodes).map(S=>S);v.type==="childList"&&w.find(S=>x.includes(S))&&this[n](w,A)}};e=new MutationObserver(c),e.observe(this,{childList:!0,subtree:!0});let u=(h=this.querySelectorAll(i))!=null?h:[];this[n](Array.from(u),[])},s.disconnectedCallback=function(){l.call(this),e.disconnect()}}}var P=class extends q{constructor(){super(...arguments);this._value="";this._correctValue="";this._size=5;this.inputRef=Tt()}handleclassNamesChange(e,r){r.split(" ").forEach(n=>{if(n.startsWith("qti-input-width")){let o=n.replace("qti-input-width-","");this._size=parseInt(o)}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[b`
76
+ `]}render(){return d`<slot name="prompt"></slot
77
+ ><textarea
78
+ part="textarea"
79
+ ${gs(this.textareaRef)}
80
+ spellcheck="false"
81
+ autocomplete="off"
82
+ @keydown="${e=>e.stopImmediatePropagation()}"
83
+ @keyup="${this.textChanged}"
84
+ @change="${this.textChanged}"
85
+ placeholder="${X(this.placeholderText?this.placeholderText:void 0)}"
86
+ maxlength="${X(this.expectedLength?this.expectedLength:void 0)}"
87
+ pattern="${X(this.patternMask?this.patternMask:void 0)}"
88
+ ?disabled="${this.disabled}"
89
+ ?readonly="${this.readonly}"
90
+ .value=${this._value}
91
+ ></textarea>`}textChanged(e){if(this.disabled||this.readonly)return;let r=e.target;this.setEmptyAttribute(r.value),this._value!==r.value&&(this._value=r.value,this.saveResponse(r.value))}reset(){this._value=""}setEmptyAttribute(e){this.setAttribute("empty",e===""?"true":"false")}};a([p({type:Number,attribute:"expected-length"})],j.prototype,"expectedLength",2),a([p({type:String,attribute:"pattern-mask"})],j.prototype,"patternMask",2),a([p({type:String,attribute:"placeholder-text"})],j.prototype,"placeholderText",2),a([C()],j.prototype,"_value",2),a([p({type:String,attribute:"class"})],j.prototype,"classNames",2),a([$("classNames",{waitUntilFirstUpdate:!0})],j.prototype,"handleclassNamesChange",1),j=a([m("qti-extended-text-interaction")],j);function bs(i,t){let e,r=E({},t);return(s,n)=>{let{connectedCallback:o,disconnectedCallback:l}=s;s.connectedCallback=function(){var h;o.call(this);let c=f=>{let x=Array.from(this.querySelectorAll(i));for(let v of f){let w=Array.from(v.addedNodes).map(S=>S),A=Array.from(v.addedNodes).map(S=>S);v.type==="childList"&&w.find(S=>x.includes(S))&&this[n](w,A)}};e=new MutationObserver(c),e.observe(this,{childList:!0,subtree:!0});let u=(h=this.querySelectorAll(i))!=null?h:[];this[n](Array.from(u),[])},s.disconnectedCallback=function(){l.call(this),e.disconnect()}}}var P=class extends q{constructor(){super(...arguments);this._value="";this._correctValue="";this._size=5;this.inputRef=Tt()}handleclassNamesChange(e,r){r.split(" ").forEach(n=>{if(n.startsWith("qti-input-width")){let o=n.replace("qti-input-width-","");this._size=parseInt(o)}})}set response(e){this._value=e!==void 0?e:""}validate(){return this._value!==""}static get styles(){return[b`
91
92
  [part='correct'] {
92
93
  position: absolute;
93
94
  width: 100%;
@@ -180,10 +180,27 @@ declare global {
180
180
  }
181
181
  }
182
182
 
183
+ /**
184
+ * Represents a custom element for referencing an assessment stimulus.
185
+ */
183
186
  declare class QtiAssessmentStimulusRef extends LitElement {
187
+ /**
188
+ * The identifier of the stimulus.
189
+ */
184
190
  identifier: string;
191
+ /**
192
+ * The href of the stimulus.
193
+ */
185
194
  href: string;
195
+ /**
196
+ * Lifecycle method called when the element is connected to the DOM.
197
+ * Loads and appends the stimulus if the 'qti-assessment-stimulus-ref-connected' event is not prevented.
198
+ */
186
199
  connectedCallback(): Promise<void>;
200
+ /**
201
+ * Loads and appends the stimulus to the specified element.
202
+ * @param stimulusRef - The element to which the stimulus will be appended.
203
+ */
187
204
  loadAndAppendStimulus(stimulusRef: Element): Promise<void>;
188
205
  }
189
206
  declare global {