@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 _chunkHOQW4KDAcjs = require('./chunk-HOQW4KDA.cjs');function u(e,d){let o=_chunkHOQW4KDAcjs.a.call(void 0, {waitUntilFirstUpdate:!1},d);return(s,r)=>{let{update:c}=s,f=Array.isArray(e)?e:[e];s.update=function(t){f.forEach(p=>{let n=p;if(t.has(n)){let a=t.get(n),i=this[n];a!==i&&(!o.waitUntilFirstUpdate||this.hasUpdated)&&this[r](a,i)}}),c.call(this,t)}}}exports.a = u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createContext as e}from"@lit-labs/context";var o=e("logger");export{o as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHOQW4KDAcjs = require('./chunk-HOQW4KDA.cjs');function b(o,l){let n,h=_chunkHOQW4KDAcjs.a.call(void 0, {},l);return(t,d)=>{let{connectedCallback:c,disconnectedCallback:u}=t;t.connectedCallback=function(){var r;c.call(this);let m=p=>{let y=Array.from(this.querySelectorAll(o));for(let s of p){let i=Array.from(s.addedNodes).map(e=>e),v=Array.from(s.addedNodes).map(e=>e);s.type==="childList"&&i.find(e=>y.includes(e))&&this[d](i,v)}};n=new MutationObserver(m),n.observe(this,{childList:!0,subtree:!0});let f=(r=this.querySelectorAll(o))!=null?r:[];this[d](Array.from(f),[])},t.disconnectedCallback=function(){u.call(this),n.disconnect()}}}exports.a = b;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGGEPFBR7cjs = require('./chunk-GGEPFBR7.cjs');var _chunk3O4URV5Ucjs = require('./chunk-3O4URV5U.cjs');var _chunkHOQW4KDAcjs = require('./chunk-HOQW4KDA.cjs');var _lit = require('lit');var _decoratorsjs = require('lit/decorators.js');var _unsafehtmljs = require('lit/directives/unsafe-html.js');var _context = require('@lit-labs/context');var c=`/* PK: Tailwind theming file for all qti-components
|
|
2
2
|
Uses tailwind components and utilities from the other files
|
|
3
3
|
|
|
4
4
|
https://play.tailwindcss.com/OFThGk8CbR
|
|
@@ -2191,8 +2191,8 @@ video {
|
|
|
2191
2191
|
max-width: 100%;
|
|
2192
2192
|
height: auto;
|
|
2193
2193
|
}
|
|
2194
|
-
`;var o=class extends
|
|
2194
|
+
`;var o=class extends _lit.LitElement{constructor(){super(...arguments);this.disabled=!1;this.readonly=!1;this.provider=new (0, _context.ContextProvider)(this,_chunkGGEPFBR7cjs.a,{view:"candidate"});this.processResponse=()=>{var t;return(t=this._item)==null?void 0:t.processResponse()};this.showCorrectResponse=()=>{var t;return(t=this._item)==null?void 0:t.showCorrectResponse()};this.validateResponses=()=>this._item?this._item.validateResponses():!1;this.resetInteractions=()=>{var t;return(t=this._item)==null?void 0:t.resetInteractions()};this.render=()=>_lit.html`${_unsafehtmljs.unsafeHTML.call(void 0, this._xml)}`}handleDisabledChange(t,r){var a,e;r&&((a=this._item)==null||a.setAttribute("disabled","")),!r&&((e=this._item)==null||e.removeAttribute("disabled"))}handleReadonlyChange(t,r){var a,e;r&&((a=this._item)==null||a.setAttribute("readonly","")),!r&&((e=this._item)==null||e.removeAttribute("readonly"))}handleResponsesChange(t,r){this._item&&(this._item.responses=r)}set qtiContext(t){this.provider.value.view=t.view,this.provider.updateObservers()}get _item(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("qti-assessment-item")}set xml(t){let r=this._xml;this._xml=t,this.requestUpdate("xml",r)}get xml(){return this._xml}connectedCallback(){super.connectedCallback();let t=document.createElement("style");t.textContent=c,this.shadowRoot.appendChild(t)}};o.styles=_lit.css`
|
|
2195
2195
|
:host {
|
|
2196
2196
|
display: block;
|
|
2197
2197
|
}
|
|
2198
|
-
`,
|
|
2198
|
+
`,_chunkHOQW4KDAcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Boolean})],o.prototype,"disabled",2),_chunkHOQW4KDAcjs.c.call(void 0, [_chunk3O4URV5Ucjs.a.call(void 0, "disabled",{waitUntilFirstUpdate:!0})],o.prototype,"handleDisabledChange",1),_chunkHOQW4KDAcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Boolean})],o.prototype,"readonly",2),_chunkHOQW4KDAcjs.c.call(void 0, [_chunk3O4URV5Ucjs.a.call(void 0, "readonly",{waitUntilFirstUpdate:!0})],o.prototype,"handleReadonlyChange",1),_chunkHOQW4KDAcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:Object,attribute:!1})],o.prototype,"responses",2),_chunkHOQW4KDAcjs.c.call(void 0, [_chunk3O4URV5Ucjs.a.call(void 0, "responses",{waitUntilFirstUpdate:!0})],o.prototype,"handleResponsesChange",1),_chunkHOQW4KDAcjs.c.call(void 0, [_decoratorsjs.property.call(void 0, {type:String})],o.prototype,"xml",1),o= exports.a =_chunkHOQW4KDAcjs.c.call(void 0, [_decoratorsjs.customElement.call(void 0, "qti-item")],o);exports.a = o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _context = require('@lit-labs/context');var o=_context.createContext.call(void 0, "logger");exports.a = o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var j=Object.defineProperty,k=Object.defineProperties,l=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyDescriptors;var h=Object.getOwnPropertySymbols;var n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;var i=(c,a,b)=>a in c?j(c,a,{enumerable:!0,configurable:!0,writable:!0,value:b}):c[a]=b,p= exports.a =(c,a)=>{for(var b in a||(a={}))n.call(a,b)&&i(c,b,a[b]);if(h)for(var b of h(a))o.call(a,b)&&i(c,b,a[b]);return c},q= exports.b =(c,a)=>k(c,m(a));var r=(c,a,b,e)=>{for(var d=e>1?void 0:e?l(a,b):a,f=c.length-1,g;f>=0;f--)(g=c[f])&&(d=(e?g(a,b,d):g(d))||d);return e&&d&&j(a,b,d),d};exports.a = p; exports.b = q; exports.c = r;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
1
|
+
import{a as s}from"./chunk-5GG2XAUT.js";import{a as n}from"./chunk-WFLR5TH7.js";import{c as i}from"./chunk-NMCIOGD2.js";import{css as g,html as h,LitElement as l}from"lit";import{customElement as p,property as w}from"lit/decorators.js";import{unsafeHTML as f}from"lit/directives/unsafe-html.js";import{ContextProvider as v}from"@lit-labs/context";var c=`/* PK: Tailwind theming file for all qti-components
|
|
2
2
|
Uses tailwind components and utilities from the other files
|
|
3
3
|
|
|
4
4
|
https://play.tailwindcss.com/OFThGk8CbR
|
|
@@ -2191,7 +2191,7 @@ video {
|
|
|
2191
2191
|
max-width: 100%;
|
|
2192
2192
|
height: auto;
|
|
2193
2193
|
}
|
|
2194
|
-
`;var o=class extends l{constructor(){super(...arguments);this.disabled=!1;this.readonly=!1;this.provider=new v(this,s,{
|
|
2194
|
+
`;var o=class extends l{constructor(){super(...arguments);this.disabled=!1;this.readonly=!1;this.provider=new v(this,s,{view:"candidate"});this.processResponse=()=>{var t;return(t=this._item)==null?void 0:t.processResponse()};this.showCorrectResponse=()=>{var t;return(t=this._item)==null?void 0:t.showCorrectResponse()};this.validateResponses=()=>this._item?this._item.validateResponses():!1;this.resetInteractions=()=>{var t;return(t=this._item)==null?void 0:t.resetInteractions()};this.render=()=>h`${f(this._xml)}`}handleDisabledChange(t,r){var a,e;r&&((a=this._item)==null||a.setAttribute("disabled","")),!r&&((e=this._item)==null||e.removeAttribute("disabled"))}handleReadonlyChange(t,r){var a,e;r&&((a=this._item)==null||a.setAttribute("readonly","")),!r&&((e=this._item)==null||e.removeAttribute("readonly"))}handleResponsesChange(t,r){this._item&&(this._item.responses=r)}set qtiContext(t){this.provider.value.view=t.view,this.provider.updateObservers()}get _item(){var t;return(t=this.shadowRoot)==null?void 0:t.querySelector("qti-assessment-item")}set xml(t){let r=this._xml;this._xml=t,this.requestUpdate("xml",r)}get xml(){return this._xml}connectedCallback(){super.connectedCallback();let t=document.createElement("style");t.textContent=c,this.shadowRoot.appendChild(t)}};o.styles=g`
|
|
2195
2195
|
:host {
|
|
2196
2196
|
display: block;
|
|
2197
2197
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGGEPFBR7cjs = require('../chunk-GGEPFBR7.cjs');require('../chunk-HOQW4KDA.cjs');exports.audienceContext = _chunkGGEPFBR7cjs.a;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { A as Audience, a as audienceContext } from '../audience-context-444478f4.js';
|
package/dist/context/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { A as Audience, a as audienceContext } from '../audience-context-444478f4.js';
|
package/dist/context/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"../chunk-
|
|
1
|
+
import{a as o}from"../chunk-5GG2XAUT.js";import"../chunk-NMCIOGD2.js";export{o as audienceContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6RJ7J4AEcjs = require('../chunk-6RJ7J4AE.cjs');var _chunk3O4URV5Ucjs = require('../chunk-3O4URV5U.cjs');require('../chunk-HOQW4KDA.cjs');exports.liveQuery = _chunk6RJ7J4AEcjs.a; exports.watch = _chunk3O4URV5Ucjs.a;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
|
|
3
|
+
type UpdateHandler$1 = (prev?: unknown, next?: unknown) => void;
|
|
4
|
+
type NonUndefined$1<A> = A extends undefined ? never : A;
|
|
5
|
+
type UpdateHandlerFunctionKeys$1<T extends object> = {
|
|
6
|
+
[K in keyof T]-?: NonUndefined$1<T[K]> extends UpdateHandler$1 ? K : never;
|
|
7
|
+
}[keyof T];
|
|
8
|
+
interface LiveQueryOptions {
|
|
9
|
+
}
|
|
10
|
+
declare function liveQuery(querySelector: string, options?: LiveQueryOptions): <ElemClass extends LitElement>(proto: ElemClass, decoratedFnName: UpdateHandlerFunctionKeys$1<ElemClass>) => void;
|
|
11
|
+
|
|
12
|
+
type UpdateHandler = (prev?: unknown, next?: unknown) => void;
|
|
13
|
+
type NonUndefined<A> = A extends undefined ? never : A;
|
|
14
|
+
type UpdateHandlerFunctionKeys<T extends object> = {
|
|
15
|
+
[K in keyof T]-?: NonUndefined<T[K]> extends UpdateHandler ? K : never;
|
|
16
|
+
}[keyof T];
|
|
17
|
+
interface WatchOptions {
|
|
18
|
+
/**
|
|
19
|
+
* If true, will only start watching after the initial update/render
|
|
20
|
+
*/
|
|
21
|
+
waitUntilFirstUpdate?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Runs when observed properties change, e.g. @property or @state, but before the component updates. To wait for an
|
|
25
|
+
* update to complete after a change occurs, use `await this.updateComplete` in the handler. To start watching after the
|
|
26
|
+
* initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.
|
|
27
|
+
*
|
|
28
|
+
* Usage:
|
|
29
|
+
*
|
|
30
|
+
* @watch('propName')
|
|
31
|
+
* handlePropChange(oldValue, newValue) {
|
|
32
|
+
* ...
|
|
33
|
+
* }
|
|
34
|
+
*/
|
|
35
|
+
declare function watch(propertyName: string | string[], options?: WatchOptions): <ElemClass extends LitElement>(proto: ElemClass, decoratedFnName: UpdateHandlerFunctionKeys<ElemClass>) => void;
|
|
36
|
+
|
|
37
|
+
export { liveQuery, watch };
|