@citolab/qti-components 6.0.24 → 6.0.25
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.
- package/dist/chunk-OO5TITDR.js +17 -0
- package/dist/{chunk-XHNCXKJ6.cjs → chunk-VBLA6PHI.cjs} +2 -2
- package/dist/{chunk-WFE4NR22.js → chunk-YFSV2M2E.js} +2 -2
- package/dist/chunk-Z2P5ZMVD.cjs +17 -0
- package/dist/custom-elements.json +738 -734
- package/dist/index.cjs +77 -73
- package/dist/index.d.cts +72 -71
- package/dist/index.d.ts +72 -71
- package/dist/index.js +77 -73
- package/dist/qti-components/index.cjs +36 -32
- package/dist/qti-components/index.d.cts +42 -45
- package/dist/qti-components/index.d.ts +42 -45
- package/dist/qti-components/index.js +65 -61
- package/dist/qti-item/index.cjs +1 -1
- package/dist/qti-item/index.js +1 -1
- package/dist/qti-item-react/index.cjs +1 -1
- package/dist/qti-item-react/index.d.cts +1 -1
- package/dist/qti-item-react/index.d.ts +1 -1
- package/dist/qti-item-react/index.js +1 -1
- package/dist/{qti-simple-choice-6d581309.d.ts → qti-simple-choice-f19f8469.d.ts} +32 -29
- package/dist/qti-transform/index.cjs +1 -1
- package/dist/qti-transform/index.d.cts +1 -0
- package/dist/qti-transform/index.d.ts +1 -0
- package/dist/qti-transform/index.js +1 -1
- package/package.json +6 -6
- package/dist/chunk-NT6UB5QT.cjs +0 -17
- package/dist/chunk-RGNNQ7CN.js +0 -17
package/dist/qti-item/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVBLA6PHIcjs = require('../chunk-VBLA6PHI.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-Z2P5ZMVD.cjs');require('../chunk-HOQW4KDA.cjs');exports.QtiItem = _chunkVBLA6PHIcjs.a;
|
package/dist/qti-item/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"../chunk-
|
|
1
|
+
import{a as o}from"../chunk-YFSV2M2E.js";import"../chunk-5GG2XAUT.js";import"../chunk-OO5TITDR.js";import"../chunk-NMCIOGD2.js";export{o as QtiItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkVBLA6PHIcjs = require('../chunk-VBLA6PHI.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-Z2P5ZMVD.cjs');require('../chunk-HOQW4KDA.cjs');var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _react3 = require('@lit-labs/react');var c=_react3.createComponent.call(void 0, {tagName:"qti-item",react:_react2.default,elementClass:_chunkVBLA6PHIcjs.a,events:{"qti-outcome-changed":"qti-outcome-changed","qti-interaction-changed":"qti-interaction-changed","qti-item-connected":"qti-item-connected"}});exports.QtiItem = c;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Ref } from 'react';
|
|
2
2
|
import { Q as QtiItem$1 } from '../qti-item-395a9535.js';
|
|
3
|
-
import { h as OutcomeChangedDetails, j as InteractionChangedDetails, b as QtiAssessmentItem } from '../qti-simple-choice-
|
|
3
|
+
import { h as OutcomeChangedDetails, j as InteractionChangedDetails, b as QtiAssessmentItem } from '../qti-simple-choice-f19f8469.js';
|
|
4
4
|
import 'lit-html';
|
|
5
5
|
import 'lit';
|
|
6
6
|
import 'lit-html/directives/ref';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Ref } from 'react';
|
|
2
2
|
import { Q as QtiItem$1 } from '../qti-item-395a9535.js';
|
|
3
|
-
import { h as OutcomeChangedDetails, j as InteractionChangedDetails, b as QtiAssessmentItem } from '../qti-simple-choice-
|
|
3
|
+
import { h as OutcomeChangedDetails, j as InteractionChangedDetails, b as QtiAssessmentItem } from '../qti-simple-choice-f19f8469.js';
|
|
4
4
|
import 'lit-html';
|
|
5
5
|
import 'lit';
|
|
6
6
|
import 'lit-html/directives/ref';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t}from"../chunk-
|
|
1
|
+
import{a as t}from"../chunk-YFSV2M2E.js";import"../chunk-5GG2XAUT.js";import"../chunk-OO5TITDR.js";import"../chunk-NMCIOGD2.js";import e from"react";import{createComponent as o}from"@lit-labs/react";var c=o({tagName:"qti-item",react:e,elementClass:t,events:{"qti-outcome-changed":"qti-outcome-changed","qti-interaction-changed":"qti-interaction-changed","qti-item-connected":"qti-item-connected"}});export{c as QtiItem};
|
|
@@ -60,12 +60,42 @@ declare namespace qtiInteractionChanged {
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
declare class QtiMapping extends LitElement {
|
|
64
|
+
defaultValue: number;
|
|
65
|
+
lowerBound: number;
|
|
66
|
+
upperBound: number;
|
|
67
|
+
get mapEntries(): {
|
|
68
|
+
mapKey: string;
|
|
69
|
+
mappedValue: number;
|
|
70
|
+
}[];
|
|
71
|
+
}
|
|
72
|
+
|
|
63
73
|
interface VariableDeclaration<T> {
|
|
64
74
|
identifier: string;
|
|
65
75
|
cardinality: Cardinality;
|
|
66
76
|
baseType: BaseType;
|
|
67
77
|
value: T;
|
|
68
78
|
}
|
|
79
|
+
interface ResultVariable {
|
|
80
|
+
cardinality: Cardinality;
|
|
81
|
+
baseType: BaseType;
|
|
82
|
+
result: number | boolean | string | (number | boolean | string)[];
|
|
83
|
+
}
|
|
84
|
+
declare class OutcomeVariable implements VariableDeclaration<string | string[] | null> {
|
|
85
|
+
identifier: string;
|
|
86
|
+
cardinality: Cardinality;
|
|
87
|
+
baseType: BaseType;
|
|
88
|
+
value: string | string[] | null;
|
|
89
|
+
}
|
|
90
|
+
declare class ResponseVariable implements VariableDeclaration<string | string[] | null> {
|
|
91
|
+
identifier: string;
|
|
92
|
+
cardinality: Cardinality;
|
|
93
|
+
baseType: BaseType;
|
|
94
|
+
value: string | string[] | null;
|
|
95
|
+
candidateResponse: string | string[] | null;
|
|
96
|
+
mapping: QtiMapping;
|
|
97
|
+
correctResponse: string | string[] | null;
|
|
98
|
+
}
|
|
69
99
|
|
|
70
100
|
type QtiRegisterVariable = CustomEvent<{
|
|
71
101
|
variable: VariableDeclaration<string | string[]>;
|
|
@@ -163,33 +193,6 @@ declare namespace qtiChoiceElementSelected {
|
|
|
163
193
|
};
|
|
164
194
|
}
|
|
165
195
|
|
|
166
|
-
declare class QtiMapping extends LitElement {
|
|
167
|
-
defaultValue: number;
|
|
168
|
-
lowerBound: number;
|
|
169
|
-
upperBound: number;
|
|
170
|
-
get mapEntries(): {
|
|
171
|
-
mapKey: string;
|
|
172
|
-
mappedValue: number;
|
|
173
|
-
}[];
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
declare class ResponseVariable implements VariableDeclaration<string | string[] | null> {
|
|
177
|
-
identifier: string;
|
|
178
|
-
cardinality: Cardinality;
|
|
179
|
-
baseType: BaseType;
|
|
180
|
-
value: string | string[] | null;
|
|
181
|
-
candidateResponse: string | string[] | null;
|
|
182
|
-
mapping: QtiMapping;
|
|
183
|
-
correctResponse: string | string[] | null;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
declare class OutcomeVariable implements VariableDeclaration<string | string[] | null> {
|
|
187
|
-
identifier: string;
|
|
188
|
-
cardinality: Cardinality;
|
|
189
|
-
baseType: BaseType;
|
|
190
|
-
value: string | string[] | null;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
196
|
/**
|
|
194
197
|
* @summary The qti-assessment-item element contains all the other QTI 3 item structures.
|
|
195
198
|
* @documentation https://www.imsglobal.org/spec/qti/v3p0/impl#h.dltnnj87l0yj
|
|
@@ -219,7 +222,7 @@ declare class QtiAssessmentItem extends LitElement {
|
|
|
219
222
|
_handleDisabledChange: (_: boolean, disabled: boolean) => void;
|
|
220
223
|
_handleReadonlyChange: (_: boolean, readonly: boolean) => void;
|
|
221
224
|
constructor();
|
|
222
|
-
|
|
225
|
+
firstUpdated(val: any): void;
|
|
223
226
|
disconnectedCallback(): void;
|
|
224
227
|
private _registerVariable;
|
|
225
228
|
showCorrectResponse(): void;
|
|
@@ -456,4 +459,4 @@ declare global {
|
|
|
456
459
|
}
|
|
457
460
|
}
|
|
458
461
|
|
|
459
|
-
export {
|
|
462
|
+
export { QtiHottext as A, BaseType as B, Cardinality as C, QtiSimpleChoice as D, Interaction as I, Multiple as M, Ordered as O, QtiRule as Q, ResponseVariable as R, VariableDeclaration as V, Choices as a, QtiAssessmentItem as b, QtiChoice as c, directedPair as d, ResponseInteraction as e, Calculate as f, float as g, OutcomeChangedDetails as h, integer as i, InteractionChangedDetails as j, qtiInteractionChanged as k, qtiRegisterVariable as l, qtiRegisterInteraction as m, qtiRegisterChoice as n, qtiRegisterHotspot as o, qtiLooseChoice as p, qtiOutcomeChanged as q, qtiInteractionResponse as r, qtiChoiceElementSelected as s, ResultVariable as t, OutcomeVariable as u, QtiTextEntryInteraction as v, QtiExtendedTextInteraction as w, QtiChoiceInteraction as x, QtiResponseProcessing as y, QtiMapping as z };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkZ2P5ZMVDcjs = require('../chunk-Z2P5ZMVD.cjs');require('../chunk-HOQW4KDA.cjs');exports.qtiTransform = _chunkZ2P5ZMVDcjs.a;
|
|
@@ -6,6 +6,7 @@ declare const qtiTransform: (xmlValue: string) => {
|
|
|
6
6
|
pciHooks(uri: string): any;
|
|
7
7
|
assetsLocation(uri: string, attributes?: string[]): any;
|
|
8
8
|
customTypes(): any;
|
|
9
|
+
customDefinition(): any;
|
|
9
10
|
suffix(elements: string[], suffix: string): any;
|
|
10
11
|
fn(fn: (xmlString: string) => string): any;
|
|
11
12
|
fnCh(fn: (xmlString: cheerio.CheerioAPI) => void): any;
|
|
@@ -6,6 +6,7 @@ declare const qtiTransform: (xmlValue: string) => {
|
|
|
6
6
|
pciHooks(uri: string): any;
|
|
7
7
|
assetsLocation(uri: string, attributes?: string[]): any;
|
|
8
8
|
customTypes(): any;
|
|
9
|
+
customDefinition(): any;
|
|
9
10
|
suffix(elements: string[], suffix: string): any;
|
|
10
11
|
fn(fn: (xmlString: string) => string): any;
|
|
11
12
|
fnCh(fn: (xmlString: cheerio.CheerioAPI) => void): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-OO5TITDR.js";import"../chunk-NMCIOGD2.js";export{a as qtiTransform};
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"engines": {
|
|
13
13
|
"node": ">=16.0.0"
|
|
14
14
|
},
|
|
15
|
-
"version": "6.0.
|
|
15
|
+
"version": "6.0.25",
|
|
16
16
|
"type": "module",
|
|
17
17
|
"main": "dist/index.js",
|
|
18
18
|
"exports": {
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
105
|
"@lit-labs/context": "^0.3.3",
|
|
106
|
-
"@lit-labs/react": "^1.2.
|
|
106
|
+
"@lit-labs/react": "^1.2.1",
|
|
107
107
|
"@tailwindcss/nesting": "^0.0.0-insiders.565cd3e",
|
|
108
108
|
"cheerio": "^1.0.0-rc.12",
|
|
109
109
|
"haunted": "^5.0.0",
|
|
@@ -111,10 +111,10 @@
|
|
|
111
111
|
"lit-xml": "^0.5.0"
|
|
112
112
|
},
|
|
113
113
|
"peerdependencies": {
|
|
114
|
-
"@lit-labs/context": "
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
114
|
+
"@lit-labs/context": "> 0.3",
|
|
115
|
+
"@lit-labs/react": "> 1.2",
|
|
116
|
+
"lit": ">= 3 < 4",
|
|
117
|
+
"react": "> 18"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
120
|
"@custom-elements-manifest/analyzer": "^0.8.3",
|
package/dist/chunk-NT6UB5QT.cjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _cheerio = require('cheerio'); var c = _interopRequireWildcard(_cheerio);var g=`
|
|
2
|
-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
3
|
-
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
|
|
4
|
-
<xsl:template match="*">
|
|
5
|
-
<!-- remove element prefix -->
|
|
6
|
-
<xsl:element name="{local-name()}">
|
|
7
|
-
<!-- process attributes -->
|
|
8
|
-
<xsl:for-each select="@*">
|
|
9
|
-
<!-- remove attribute prefix -->
|
|
10
|
-
<xsl:attribute name="{local-name()}">
|
|
11
|
-
<xsl:value-of select="."/>
|
|
12
|
-
</xsl:attribute>
|
|
13
|
-
</xsl:for-each>
|
|
14
|
-
<xsl:apply-templates/>
|
|
15
|
-
</xsl:element>
|
|
16
|
-
</xsl:template>
|
|
17
|
-
</xsl:stylesheet>`,d= exports.a =u=>{let e=u,a=t=>{let s=new DOMParser().parseFromString(e,"text/xml"),r=new XSLTProcessor,l=new DOMParser().parseFromString(t,"text/xml");r.importStylesheet(l);let o=r.transformToFragment(s,document);e=new XMLSerializer().serializeToString(o)},n={mathml(){let t=c.load(e,{xmlMode:!0,xml:!0});return t("math").each((s,r)=>{r.tagName="math-ml"}).find("*").each((s,r)=>{r.tagName=`math-${r.tagName.substring(1)}`}),e=t.xml(),n},removeNamesSpaces(){return a(g),n},pciHooks(t){let s=["hook","module"],r=t.substring(0,t.lastIndexOf("/")),l=new DOMParser().parseFromString(e,"text/xml");for(let o of s)l.querySelectorAll("["+o+"]").forEach(m=>{let i=m.getAttribute(o);!i.startsWith("data:")&&!i.startsWith("http")&&(m.setAttribute("base-url",t),m.setAttribute("module",r+"/"+encodeURIComponent(i+(i.endsWith(".js")?"":".js"))))});return e=new XMLSerializer().serializeToString(l),n},assetsLocation(t,s=["src","href","data"]){let r=t.substring(0,t.lastIndexOf("/")),l=c.load(e,{xmlMode:!0});for(let o of s)l(`[${o}]`).each((x,m)=>{let i=l(m).attr(o);if(!i.startsWith("data:")&&!i.startsWith("http")){let h=r+"/"+encodeURIComponent(i);l(m).attr(o,h)}});return e=l.xml(),n},customTypes(){let t=c.load(e,{xml:!0,xmlMode:!0});return t("*").each((s,r)=>{var o;let l=(o=t(r).attr("class"))==null?void 0:o.split(" ");l&&l.forEach(x=>{x.startsWith("type:")&&(r.name=`${r.name}-${x.slice(5)}`)})}),e=t.xml(),n},suffix(t,s){let r=c.load(e,{xml:!0,xmlMode:!0});return r("*").each((l,o)=>{t.includes(o.name)&&(o.name=`${o.name}-${s}`)}),e=r.xml(),n},fn(t){return e=t(e),n},fnCh(t){let s=c.load(e,{xml:!0,xmlMode:!0});return t(s),e=s.xml(),n},elementNameAttributes(t){return t.forEach(s=>{e=f(e,s,s+` data-element="${s}" `)}),n},print(){return console.log(e),n},xml(){return e=p(e),e}};return n},p=u=>{let e=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],a=u.split("/>"),n="";for(let t=0;t<a.length-1;t++){let s=a[t].split("<"),r=s[s.length-1].split(" ")[0];e.includes(r)?n+=a[t]+"/>":n+=a[t]+"></"+r+">"}return n+a[a.length-1]};function f(u,e,a){return u.replace(new RegExp(e,"g"),a)}exports.a = d;
|
package/dist/chunk-RGNNQ7CN.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import*as c from"cheerio";var g=`
|
|
2
|
-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
3
|
-
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
|
|
4
|
-
<xsl:template match="*">
|
|
5
|
-
<!-- remove element prefix -->
|
|
6
|
-
<xsl:element name="{local-name()}">
|
|
7
|
-
<!-- process attributes -->
|
|
8
|
-
<xsl:for-each select="@*">
|
|
9
|
-
<!-- remove attribute prefix -->
|
|
10
|
-
<xsl:attribute name="{local-name()}">
|
|
11
|
-
<xsl:value-of select="."/>
|
|
12
|
-
</xsl:attribute>
|
|
13
|
-
</xsl:for-each>
|
|
14
|
-
<xsl:apply-templates/>
|
|
15
|
-
</xsl:element>
|
|
16
|
-
</xsl:template>
|
|
17
|
-
</xsl:stylesheet>`,d=u=>{let e=u,a=t=>{let s=new DOMParser().parseFromString(e,"text/xml"),r=new XSLTProcessor,l=new DOMParser().parseFromString(t,"text/xml");r.importStylesheet(l);let o=r.transformToFragment(s,document);e=new XMLSerializer().serializeToString(o)},n={mathml(){let t=c.load(e,{xmlMode:!0,xml:!0});return t("math").each((s,r)=>{r.tagName="math-ml"}).find("*").each((s,r)=>{r.tagName=`math-${r.tagName.substring(1)}`}),e=t.xml(),n},removeNamesSpaces(){return a(g),n},pciHooks(t){let s=["hook","module"],r=t.substring(0,t.lastIndexOf("/")),l=new DOMParser().parseFromString(e,"text/xml");for(let o of s)l.querySelectorAll("["+o+"]").forEach(m=>{let i=m.getAttribute(o);!i.startsWith("data:")&&!i.startsWith("http")&&(m.setAttribute("base-url",t),m.setAttribute("module",r+"/"+encodeURIComponent(i+(i.endsWith(".js")?"":".js"))))});return e=new XMLSerializer().serializeToString(l),n},assetsLocation(t,s=["src","href","data"]){let r=t.substring(0,t.lastIndexOf("/")),l=c.load(e,{xmlMode:!0});for(let o of s)l(`[${o}]`).each((x,m)=>{let i=l(m).attr(o);if(!i.startsWith("data:")&&!i.startsWith("http")){let h=r+"/"+encodeURIComponent(i);l(m).attr(o,h)}});return e=l.xml(),n},customTypes(){let t=c.load(e,{xml:!0,xmlMode:!0});return t("*").each((s,r)=>{var o;let l=(o=t(r).attr("class"))==null?void 0:o.split(" ");l&&l.forEach(x=>{x.startsWith("type:")&&(r.name=`${r.name}-${x.slice(5)}`)})}),e=t.xml(),n},suffix(t,s){let r=c.load(e,{xml:!0,xmlMode:!0});return r("*").each((l,o)=>{t.includes(o.name)&&(o.name=`${o.name}-${s}`)}),e=r.xml(),n},fn(t){return e=t(e),n},fnCh(t){let s=c.load(e,{xml:!0,xmlMode:!0});return t(s),e=s.xml(),n},elementNameAttributes(t){return t.forEach(s=>{e=f(e,s,s+` data-element="${s}" `)}),n},print(){return console.log(e),n},xml(){return e=p(e),e}};return n},p=u=>{let e=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],a=u.split("/>"),n="";for(let t=0;t<a.length-1;t++){let s=a[t].split("<"),r=s[s.length-1].split(" ")[0];e.includes(r)?n+=a[t]+"/>":n+=a[t]+"></"+r+">"}return n+a[a.length-1]};function f(u,e,a){return u.replace(new RegExp(e,"g"),a)}export{d as a};
|