@citolab/qti-components 6.0.31 → 6.0.34

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.
@@ -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; } }var _cheerio = require('cheerio'); var m = _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,o=new DOMParser().parseFromString(t,"text/xml");r.importStylesheet(o);let l=r.transformToFragment(s,document);e=new XMLSerializer().serializeToString(l)},n={mathml(){let t=m.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("/")),o=new DOMParser().parseFromString(e,"text/xml");for(let l of s)o.querySelectorAll("["+l+"]").forEach(c=>{let i=c.getAttribute(l);!i.startsWith("data:")&&!i.startsWith("http")&&(c.setAttribute("base-url",t),c.setAttribute("module",r+"/"+encodeURIComponent(i+(i.endsWith(".js")?"":".js"))))});return e=new XMLSerializer().serializeToString(o),n},assetsLocation(t,s=["src","href","data"]){let r=m.load(e,{xmlMode:!0});if(t!==""){let o=t.substring(0,t.lastIndexOf("/"));for(let l of s)r(`[${l}]`).each((x,c)=>{let i=r(c).attr(l);if(!i.startsWith("data:")&&!i.startsWith("http")){let h=o+"/"+encodeURIComponent(i);r(c).attr(l,h)}})}return e=r.xml(),n},customTypes(){let t=m.load(e,{xml:!0,xmlMode:!0});return t("*").each((s,r)=>{var l;let o=(l=t(r).attr("class"))==null?void 0:l.split(" ");o&&o.forEach(x=>{x.startsWith("type:")&&(r.name=`${r.name}-${x.slice(5)}`)})}),e=t.xml(),n},customDefinition(){let t=m.load(e,{xml:!0,xmlMode:!0});return t("*").each((s,r)=>{let o=t(r).attr("definition");o&&o.startsWith("type:")&&(r.name=`${r.name}-${o.slice(5)}`)}),e=t.xml(),n},suffix(t,s){let r=m.load(e,{xml:!0,xmlMode:!0});return r("*").each((o,l)=>{t.includes(l.name)&&(l.name=`${l.name}-${s}`)}),e=r.xml(),n},fn(t){return e=t(e),n},fnCh(t){let s=m.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;
@@ -0,0 +1,17 @@
1
+ import*as m 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,o=new DOMParser().parseFromString(t,"text/xml");r.importStylesheet(o);let l=r.transformToFragment(s,document);e=new XMLSerializer().serializeToString(l)},n={mathml(){let t=m.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("/")),o=new DOMParser().parseFromString(e,"text/xml");for(let l of s)o.querySelectorAll("["+l+"]").forEach(c=>{let i=c.getAttribute(l);!i.startsWith("data:")&&!i.startsWith("http")&&(c.setAttribute("base-url",t),c.setAttribute("module",r+"/"+encodeURIComponent(i+(i.endsWith(".js")?"":".js"))))});return e=new XMLSerializer().serializeToString(o),n},assetsLocation(t,s=["src","href","data"]){let r=m.load(e,{xmlMode:!0});if(t!==""){let o=t.substring(0,t.lastIndexOf("/"));for(let l of s)r(`[${l}]`).each((x,c)=>{let i=r(c).attr(l);if(!i.startsWith("data:")&&!i.startsWith("http")){let h=o+"/"+encodeURIComponent(i);r(c).attr(l,h)}})}return e=r.xml(),n},customTypes(){let t=m.load(e,{xml:!0,xmlMode:!0});return t("*").each((s,r)=>{var l;let o=(l=t(r).attr("class"))==null?void 0:l.split(" ");o&&o.forEach(x=>{x.startsWith("type:")&&(r.name=`${r.name}-${x.slice(5)}`)})}),e=t.xml(),n},customDefinition(){let t=m.load(e,{xml:!0,xmlMode:!0});return t("*").each((s,r)=>{let o=t(r).attr("definition");o&&o.startsWith("type:")&&(r.name=`${r.name}-${o.slice(5)}`)}),e=t.xml(),n},suffix(t,s){let r=m.load(e,{xml:!0,xmlMode:!0});return r("*").each((o,l)=>{t.includes(l.name)&&(l.name=`${l.name}-${s}`)}),e=r.xml(),n},fn(t){return e=t(e),n},fnCh(t){let s=m.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};
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGGEPFBR7cjs = require('./chunk-GGEPFBR7.cjs');var _chunkZ2P5ZMVDcjs = require('./chunk-Z2P5ZMVD.cjs');var _chunk6G76D2MIcjs = require('./chunk-6G76D2MI.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 e=`/* PK: Tailwind theming file for all qti-components
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGGEPFBR7cjs = require('./chunk-GGEPFBR7.cjs');var _chunkG7BJTOY4cjs = require('./chunk-G7BJTOY4.cjs');var _chunk6G76D2MIcjs = require('./chunk-6G76D2MI.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 n=`/* 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
@@ -683,6 +683,11 @@ qti-choice-interaction:not(.qti-input-control-hidden) qti-simple-choice[aria-rea
683
683
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
684
684
  }
685
685
 
686
+ qti-choice-interaction qti-simple-choice > p{
687
+ margin: 0px;
688
+ padding: 0px;
689
+ }
690
+
686
691
  qti-text-entry-interaction{
687
692
  margin-top: 0.5rem;
688
693
  margin-bottom: 0.5rem;
@@ -772,6 +777,7 @@ qti-gap-match-interaction qti-gap-text{
772
777
  --tw-ring-inset: inset;
773
778
  --tw-ring-opacity: 1;
774
779
  --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
780
+ display: inline-block;
775
781
  cursor: grab;
776
782
  --tw-bg-opacity: 1;
777
783
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@@ -1379,6 +1385,7 @@ qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:first-of-type
1379
1385
  --tw-ring-inset: inset;
1380
1386
  --tw-ring-opacity: 1;
1381
1387
  --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
1388
+ display: inline-block;
1382
1389
  cursor: grab;
1383
1390
  --tw-bg-opacity: 1;
1384
1391
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@@ -1471,6 +1478,7 @@ qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:last-of-type
1471
1478
  --tw-ring-inset: inset;
1472
1479
  --tw-ring-opacity: 1;
1473
1480
  --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
1481
+ display: inline-block;
1474
1482
  cursor: grab;
1475
1483
  --tw-bg-opacity: 1;
1476
1484
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@@ -1521,6 +1529,7 @@ qti-order-interaction::part(qti-simple-choice),
1521
1529
  --tw-ring-inset: inset;
1522
1530
  --tw-ring-opacity: 1;
1523
1531
  --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
1532
+ display: inline-block;
1524
1533
  cursor: grab;
1525
1534
  --tw-bg-opacity: 1;
1526
1535
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@@ -1628,6 +1637,7 @@ qti-associate-interaction::part(qti-simple-associable-choice),
1628
1637
  --tw-ring-inset: inset;
1629
1638
  --tw-ring-opacity: 1;
1630
1639
  --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
1640
+ display: inline-block;
1631
1641
  cursor: grab;
1632
1642
  --tw-bg-opacity: 1;
1633
1643
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@@ -2185,7 +2195,7 @@ video {
2185
2195
  max-width: 100%;
2186
2196
  height: auto;
2187
2197
  }
2188
- `;var t=class extends _lit.LitElement{constructor(){super(...arguments);this.itemLocation="";this.provider=new (0, _context.ContextProvider)(this,_chunkGGEPFBR7cjs.a,{view:"candidate"});this.render=()=>_lit.html`${_unsafehtmljs.unsafeHTML.call(void 0, this._xml)}<slot></slot>`}set audienceContext(o){this.provider.value.view=o.view,this.provider.updateObservers()}set xml(o){let w=this._xml;this._xml=_chunkZ2P5ZMVDcjs.a.call(void 0, o).customTypes().customDefinition().assetsLocation(`${this.itemLocation}`).xml(),this.requestUpdate("xml",w)}get xml(){return this._xml}connectedCallback(){super.connectedCallback();let o=document.createElement("style");o.textContent=e,this.shadowRoot.appendChild(o)}};t.styles=_lit.css`
2198
+ `;var t=class extends _lit.LitElement{constructor(){super(...arguments);this.itemLocation="";this.provider=new (0, _context.ContextProvider)(this,_chunkGGEPFBR7cjs.a,{view:"candidate"});this.render=()=>_lit.html`${_unsafehtmljs.unsafeHTML.call(void 0, this._xml)}<slot></slot>`}set audienceContext(o){this.provider.value.view=o.view,this.provider.updateObservers()}set xml(o){let r=this._xml;this._xml=_chunkG7BJTOY4cjs.a.call(void 0, o).customTypes().customDefinition().assetsLocation(`${this.itemLocation}`).xml(),this.requestUpdate("xml",r)}get xml(){return this._xml}connectedCallback(){var r;super.connectedCallback();let o=document.createElement("style");o.textContent=n,(r=this.shadowRoot)==null||r.appendChild(o)}};t.styles=_lit.css`
2189
2199
  :host {
2190
2200
  display: block;
2191
2201
  }
@@ -1,4 +1,4 @@
1
- import{a as i}from"./chunk-5GG2XAUT.js";import{a}from"./chunk-OO5TITDR.js";import{c as r}from"./chunk-343LZK3D.js";import{css as c,html as d,LitElement as g}from"lit";import{customElement as h,property as n}from"lit/decorators.js";import{unsafeHTML as l}from"lit/directives/unsafe-html.js";import{ContextProvider as p}from"@lit-labs/context";var e=`/* PK: Tailwind theming file for all qti-components
1
+ import{a}from"./chunk-5GG2XAUT.js";import{a as e}from"./chunk-UE4QJK43.js";import{c as i}from"./chunk-343LZK3D.js";import{css as c,html as d,LitElement as g}from"lit";import{customElement as h,property as w}from"lit/decorators.js";import{unsafeHTML as l}from"lit/directives/unsafe-html.js";import{ContextProvider as p}from"@lit-labs/context";var n=`/* 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
@@ -683,6 +683,11 @@ qti-choice-interaction:not(.qti-input-control-hidden) qti-simple-choice[aria-rea
683
683
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
684
684
  }
685
685
 
686
+ qti-choice-interaction qti-simple-choice > p{
687
+ margin: 0px;
688
+ padding: 0px;
689
+ }
690
+
686
691
  qti-text-entry-interaction{
687
692
  margin-top: 0.5rem;
688
693
  margin-bottom: 0.5rem;
@@ -772,6 +777,7 @@ qti-gap-match-interaction qti-gap-text{
772
777
  --tw-ring-inset: inset;
773
778
  --tw-ring-opacity: 1;
774
779
  --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
780
+ display: inline-block;
775
781
  cursor: grab;
776
782
  --tw-bg-opacity: 1;
777
783
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@@ -1379,6 +1385,7 @@ qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:first-of-type
1379
1385
  --tw-ring-inset: inset;
1380
1386
  --tw-ring-opacity: 1;
1381
1387
  --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
1388
+ display: inline-block;
1382
1389
  cursor: grab;
1383
1390
  --tw-bg-opacity: 1;
1384
1391
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@@ -1471,6 +1478,7 @@ qti-match-interaction:not(.qti-match-tabular) qti-simple-match-set:last-of-type
1471
1478
  --tw-ring-inset: inset;
1472
1479
  --tw-ring-opacity: 1;
1473
1480
  --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
1481
+ display: inline-block;
1474
1482
  cursor: grab;
1475
1483
  --tw-bg-opacity: 1;
1476
1484
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@@ -1521,6 +1529,7 @@ qti-order-interaction::part(qti-simple-choice),
1521
1529
  --tw-ring-inset: inset;
1522
1530
  --tw-ring-opacity: 1;
1523
1531
  --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
1532
+ display: inline-block;
1524
1533
  cursor: grab;
1525
1534
  --tw-bg-opacity: 1;
1526
1535
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@@ -1628,6 +1637,7 @@ qti-associate-interaction::part(qti-simple-associable-choice),
1628
1637
  --tw-ring-inset: inset;
1629
1638
  --tw-ring-opacity: 1;
1630
1639
  --tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
1640
+ display: inline-block;
1631
1641
  cursor: grab;
1632
1642
  --tw-bg-opacity: 1;
1633
1643
  background-color: rgb(255 255 255 / var(--tw-bg-opacity));
@@ -2185,8 +2195,8 @@ video {
2185
2195
  max-width: 100%;
2186
2196
  height: auto;
2187
2197
  }
2188
- `;var t=class extends g{constructor(){super(...arguments);this.itemLocation="";this.provider=new p(this,i,{view:"candidate"});this.render=()=>d`${l(this._xml)}<slot></slot>`}set audienceContext(o){this.provider.value.view=o.view,this.provider.updateObservers()}set xml(o){let w=this._xml;this._xml=a(o).customTypes().customDefinition().assetsLocation(`${this.itemLocation}`).xml(),this.requestUpdate("xml",w)}get xml(){return this._xml}connectedCallback(){super.connectedCallback();let o=document.createElement("style");o.textContent=e,this.shadowRoot.appendChild(o)}};t.styles=c`
2198
+ `;var t=class extends g{constructor(){super(...arguments);this.itemLocation="";this.provider=new p(this,a,{view:"candidate"});this.render=()=>d`${l(this._xml)}<slot></slot>`}set audienceContext(o){this.provider.value.view=o.view,this.provider.updateObservers()}set xml(o){let r=this._xml;this._xml=e(o).customTypes().customDefinition().assetsLocation(`${this.itemLocation}`).xml(),this.requestUpdate("xml",r)}get xml(){return this._xml}connectedCallback(){var r;super.connectedCallback();let o=document.createElement("style");o.textContent=n,(r=this.shadowRoot)==null||r.appendChild(o)}};t.styles=c`
2189
2199
  :host {
2190
2200
  display: block;
2191
2201
  }
2192
- `,r([n({type:String,attribute:"item-location"})],t.prototype,"itemLocation",2),r([n({type:String})],t.prototype,"xml",1),t=r([h("qti-item")],t);export{t as a};
2202
+ `,i([w({type:String,attribute:"item-location"})],t.prototype,"itemLocation",2),i([w({type:String})],t.prototype,"xml",1),t=i([h("qti-item")],t);export{t as a};