@citolab/qti-components 6.0.20 → 6.0.22
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/audience-context-444478f4.d.ts +8 -0
- package/dist/chunk-3O4URV5U.cjs +1 -0
- package/dist/chunk-5GG2XAUT.js +1 -0
- package/dist/chunk-6RJ7J4AE.cjs +1 -0
- package/dist/{chunk-AQI672QR.js → chunk-GEVRCVN2.cjs} +3 -3
- package/dist/chunk-GGEPFBR7.cjs +1 -0
- package/dist/chunk-HOQW4KDA.cjs +1 -0
- package/dist/{chunk-5RZQOWDC.js → chunk-YDFMBQT4.js} +2 -2
- package/dist/context/index.cjs +1 -0
- package/dist/context/index.d.cts +1 -0
- package/dist/context/index.d.ts +1 -1
- package/dist/context/index.js +1 -1
- package/dist/decorators/index.cjs +1 -0
- package/dist/decorators/index.d.cts +37 -0
- package/dist/index.cjs +2889 -0
- package/dist/index.d.cts +1063 -0
- package/dist/index.d.ts +24 -16
- package/dist/index.js +73 -63
- package/dist/{qti-assessment-item-68bcc951.d.ts → qti-assessment-item-c1eb7de3.d.ts} +5 -5
- package/dist/qti-components/index.cjs +419 -0
- package/dist/qti-components/index.d.cts +560 -0
- package/dist/qti-components/index.d.ts +21 -12
- package/dist/qti-components/index.js +76 -66
- package/dist/qti-item/index.cjs +1 -0
- package/dist/qti-item/index.d.cts +4 -0
- package/dist/qti-item/index.d.ts +2 -2
- package/dist/qti-item/index.js +1 -1
- package/dist/{qti-item-8c26fa9e.d.ts → qti-item-e2edd87f.d.ts} +1 -1
- package/dist/qti-item-react/index.cjs +1 -0
- package/dist/qti-item-react/index.d.cts +30 -0
- package/dist/qti-item-react/index.d.ts +3 -3
- package/dist/qti-item-react/index.js +1 -1
- package/dist/{qti-simple-choice-3e910d03.d.ts → qti-simple-choice-e28cfb34.d.ts} +2 -2
- package/dist/qti-transform/index.cjs +17 -0
- package/dist/qti-transform/index.d.cts +17 -0
- package/package.json +24 -14
- package/dist/chunk-FIJLDR56.js +0 -2204
- package/dist/chunk-HQKT4SJF.js +0 -1
- package/dist/chunk-RPGALUIV.js +0 -1
- package/dist/chunk-UD6XWG6V.js +0 -2205
- package/dist/context-a957e50e.d.ts +0 -9
- package/dist/custom-elements.json +0 -6772
- package/dist/index.css +0 -2193
- package/dist/qti-assessment-item-f1fcf393.d.ts +0 -120
- package/dist/qti-item-e1fc6a70.d.ts +0 -30
- package/dist/qti-simple-choice-ca9b86db.d.ts +0 -352
- package/dist/qti-simple-choice-d1392d78.d.ts +0 -352
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGEVRCVN2cjs = require('../chunk-GEVRCVN2.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-3O4URV5U.cjs');require('../chunk-HOQW4KDA.cjs');exports.QtiItem = _chunkGEVRCVN2cjs.a;
|
package/dist/qti-item/index.d.ts
CHANGED
package/dist/qti-item/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"../chunk-
|
|
1
|
+
import{a as o}from"../chunk-YDFMBQT4.js";import"../chunk-5GG2XAUT.js";import"../chunk-WFLR5TH7.js";import"../chunk-NMCIOGD2.js";export{o as QtiItem};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
|
-
import { a as ResponseInteraction, Q as QtiAssessmentItem } from './qti-assessment-item-
|
|
4
|
+
import { a as ResponseInteraction, Q as QtiAssessmentItem } from './qti-assessment-item-c1eb7de3.js';
|
|
5
5
|
|
|
6
6
|
declare class QtiItem extends LitElement {
|
|
7
7
|
disabled: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkGEVRCVN2cjs = require('../chunk-GEVRCVN2.cjs');require('../chunk-GGEPFBR7.cjs');require('../chunk-3O4URV5U.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:_chunkGEVRCVN2cjs.a,events:{qtioutcomechanged:"qti-outcome-changed",qtiinteractionchanged:"qti-interaction-changed",qtiitemconnected:"qti-item-connected"}});exports.QtiItem = c;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { Ref } from 'react';
|
|
2
|
+
import { Q as QtiItem$1 } from '../qti-item-e2edd87f.js';
|
|
3
|
+
import { a as ResponseInteraction } from '../qti-assessment-item-c1eb7de3.js';
|
|
4
|
+
import { O as OutcomeChangedDetails, b as InteractionChangedDetails } from '../qti-simple-choice-e28cfb34.js';
|
|
5
|
+
import 'lit-html';
|
|
6
|
+
import 'lit';
|
|
7
|
+
import 'lit-html/directives/ref';
|
|
8
|
+
|
|
9
|
+
interface QtiItemProps {
|
|
10
|
+
ref?: Ref<QtiItem$1>;
|
|
11
|
+
className?: string;
|
|
12
|
+
responses?: ResponseInteraction[];
|
|
13
|
+
xml: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
qtiContext?: {
|
|
16
|
+
view: 'author' | 'candidate' | 'proctor' | 'scorer' | 'testConstructor' | 'tutor';
|
|
17
|
+
};
|
|
18
|
+
processResponse?: () => void;
|
|
19
|
+
showCorrectResponse?: () => void;
|
|
20
|
+
validateResponses?: () => boolean;
|
|
21
|
+
resetInteractions?: () => void;
|
|
22
|
+
qtioutcomechanged?: (e: CustomEvent<OutcomeChangedDetails>) => void;
|
|
23
|
+
qtiinteractionchanged?: (e: CustomEvent<InteractionChangedDetails>) => void;
|
|
24
|
+
qtiitemconnected?: (e: CustomEvent<{
|
|
25
|
+
identifier: string;
|
|
26
|
+
}>) => void;
|
|
27
|
+
}
|
|
28
|
+
declare const QtiItem: React.ForwardRefExoticComponent<QtiItemProps>;
|
|
29
|
+
|
|
30
|
+
export { QtiItem };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { Ref } from 'react';
|
|
2
|
-
import { Q as QtiItem$1 } from '../qti-item-
|
|
3
|
-
import { a as ResponseInteraction } from '../qti-assessment-item-
|
|
4
|
-
import { O as OutcomeChangedDetails, b as InteractionChangedDetails } from '../qti-simple-choice-
|
|
2
|
+
import { Q as QtiItem$1 } from '../qti-item-e2edd87f.js';
|
|
3
|
+
import { a as ResponseInteraction } from '../qti-assessment-item-c1eb7de3.js';
|
|
4
|
+
import { O as OutcomeChangedDetails, b as InteractionChangedDetails } from '../qti-simple-choice-e28cfb34.js';
|
|
5
5
|
import 'lit-html';
|
|
6
6
|
import 'lit';
|
|
7
7
|
import 'lit-html/directives/ref';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"../chunk-
|
|
1
|
+
import{a as e}from"../chunk-YDFMBQT4.js";import"../chunk-5GG2XAUT.js";import"../chunk-WFLR5TH7.js";import"../chunk-NMCIOGD2.js";import t from"react";import{createComponent as o}from"@lit-labs/react";var c=o({tagName:"qti-item",react:t,elementClass:e,events:{qtioutcomechanged:"qti-outcome-changed",qtiinteractionchanged:"qti-interaction-changed",qtiitemconnected:"qti-item-connected"}});export{c as QtiItem};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ResponseInteraction, V as VariableDeclaration } from './qti-assessment-item-
|
|
1
|
+
import { a as ResponseInteraction, V as VariableDeclaration } from './qti-assessment-item-c1eb7de3.js';
|
|
2
2
|
import * as lit_html from 'lit-html';
|
|
3
3
|
import * as lit from 'lit';
|
|
4
4
|
import { LitElement, CSSResultGroup } from 'lit';
|
|
@@ -7,7 +7,7 @@ import * as lit_html_directives_ref from 'lit-html/directives/ref';
|
|
|
7
7
|
interface OutcomeChangedDetails {
|
|
8
8
|
item: string;
|
|
9
9
|
outcomeIdentifier: string;
|
|
10
|
-
value: number;
|
|
10
|
+
value: number | string | string[];
|
|
11
11
|
}
|
|
12
12
|
type InteractionChangedDetails = ResponseInteraction & {
|
|
13
13
|
item: string;
|
|
@@ -0,0 +1,17 @@
|
|
|
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; } }require('../chunk-HOQW4KDA.cjs');var _cheerio = require('cheerio'); var u = _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>`,f= exports.qtiTransform =c=>{let e=c,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=u.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=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(o,r+"/"+encodeURIComponent(i))});return e=new XMLSerializer().serializeToString(l),n},customTypes(){let t=u.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=u.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=u.load(e,{xml:!0,xmlMode:!0});return t(s),e=s.xml(),n},elementNameAttributes(t){return t.forEach(s=>{e=p(e,s,s+` data-element="${s}" `)}),n},print(){return console.log(e),n},xml(){return e=h(e),e}};return n},h=c=>{let e=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],a=c.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 p(c,e,a){return c.replace(new RegExp(e,"g"),a)}exports.qtiTransform = f;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as cheerio from 'cheerio';
|
|
2
|
+
|
|
3
|
+
declare const qtiTransform: (xmlValue: string) => {
|
|
4
|
+
mathml(): any;
|
|
5
|
+
removeNamesSpaces(): any;
|
|
6
|
+
pciHooks(uri: string): any;
|
|
7
|
+
assetsLocation(uri: string, attributes?: string[]): any;
|
|
8
|
+
customTypes(): any;
|
|
9
|
+
suffix(elements: string[], suffix: string): any;
|
|
10
|
+
fn(fn: (xmlString: string) => string): any;
|
|
11
|
+
fnCh(fn: (xmlString: cheerio.CheerioAPI) => void): any;
|
|
12
|
+
elementNameAttributes(elements: string[]): any;
|
|
13
|
+
print(): any;
|
|
14
|
+
xml(): string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { qtiTransform };
|
package/package.json
CHANGED
|
@@ -12,30 +12,36 @@
|
|
|
12
12
|
"engines": {
|
|
13
13
|
"node": ">=16.0.0"
|
|
14
14
|
},
|
|
15
|
-
"version": "6.0.
|
|
15
|
+
"version": "6.0.22",
|
|
16
16
|
"type": "module",
|
|
17
|
-
"main": "dist/
|
|
17
|
+
"main": "dist/index.js",
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
|
-
"import": "./dist/
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
21
|
},
|
|
22
22
|
"./context": {
|
|
23
|
-
"import": "./dist/context/index.js"
|
|
23
|
+
"import": "./dist/context/index.js",
|
|
24
|
+
"require": "./dist/context/index.cjs"
|
|
24
25
|
},
|
|
25
26
|
"./decorators": {
|
|
26
|
-
"import": "./dist/decorators/index.js"
|
|
27
|
+
"import": "./dist/decorators/index.js",
|
|
28
|
+
"require": "./dist/decorators/index.cjs"
|
|
27
29
|
},
|
|
28
30
|
"./qti-components": {
|
|
29
|
-
"import": "./dist/qti-components/index.js"
|
|
31
|
+
"import": "./dist/qti-components/index.js",
|
|
32
|
+
"require": "./dist/qti-components/index.cjs"
|
|
30
33
|
},
|
|
31
34
|
"./qti-item": {
|
|
32
|
-
"import": "./dist/qti-item/index.js"
|
|
35
|
+
"import": "./dist/qti-item/index.js",
|
|
36
|
+
"require": "./dist/qti-item/index.cjs"
|
|
33
37
|
},
|
|
34
38
|
"./react/qti-item": {
|
|
35
|
-
"import": "./dist/qti-item-react/index.js"
|
|
39
|
+
"import": "./dist/qti-item-react/index.js",
|
|
40
|
+
"require": "./dist/qti-item-react/index.cjs"
|
|
36
41
|
},
|
|
37
42
|
"./qti-transform": {
|
|
38
|
-
"import": "./dist/qti-transform/index.js"
|
|
43
|
+
"import": "./dist/qti-transform/index.js",
|
|
44
|
+
"require": "./dist/qti-transform/index.cjs"
|
|
39
45
|
},
|
|
40
46
|
"./index.css": {
|
|
41
47
|
"import": "./dist/index.css"
|
|
@@ -83,14 +89,17 @@
|
|
|
83
89
|
"storybook": "storybook dev -p 6006",
|
|
84
90
|
"deploy": "firebase deploy --only hosting:qti-components",
|
|
85
91
|
"build-storybook": "storybook build",
|
|
86
|
-
"
|
|
87
|
-
"npm": "np --any-branch",
|
|
92
|
+
"npm": "np",
|
|
88
93
|
"test-storybook": "test-storybook",
|
|
89
94
|
"cem": "cem analyze --watch",
|
|
90
95
|
"lint": "eslint src/lib/**",
|
|
91
96
|
"kill 6006": "sudo lsof -i :6006 | grep LISTEN | awk '{print $2}' | xargs kill",
|
|
92
97
|
"list-outdated-dependencies": "npx npm-check-updates --format repo --peer",
|
|
93
|
-
"update-dependencies": "npx npm-check-updates --peer -u && npm install"
|
|
98
|
+
"update-dependencies": "npx npm-check-updates --peer -u && npm install",
|
|
99
|
+
"arethetypeswrong": "attw --pack",
|
|
100
|
+
"----hooks----": "",
|
|
101
|
+
"prepublishOnly": "echo 'calling prepublishOnly as npm lifecycle hook to build-lib!' && npm run build-lib",
|
|
102
|
+
"postpublish": "npm run deploy"
|
|
94
103
|
},
|
|
95
104
|
"dependencies": {
|
|
96
105
|
"@lit-labs/context": "^0.3.3",
|
|
@@ -139,6 +148,7 @@
|
|
|
139
148
|
"html-to-image": "^1.11.11",
|
|
140
149
|
"jest-environment-jsdom": "^29.5.0",
|
|
141
150
|
"nodemon": "^2.0.22",
|
|
151
|
+
"np": "^8.0.4",
|
|
142
152
|
"postcss": "^8.4.24",
|
|
143
153
|
"postcss-import": "^15.1.0",
|
|
144
154
|
"postcss-nesting": "^11.3.0",
|
|
@@ -152,10 +162,10 @@
|
|
|
152
162
|
"tailwindcss": "^3.3.2",
|
|
153
163
|
"ts-jest": "^29.1.0",
|
|
154
164
|
"ts-node": "^10.9.1",
|
|
155
|
-
"tsup": "^7.
|
|
165
|
+
"tsup": "^7.1.0",
|
|
156
166
|
"typescript": "^5.1.3",
|
|
157
167
|
"vite": "^4.3.9",
|
|
158
|
-
"
|
|
168
|
+
"@arethetypeswrong/cli": "^0.4.2"
|
|
159
169
|
},
|
|
160
170
|
"customElements": "custom-elements.json"
|
|
161
171
|
}
|