@examplary/pci-runtime 0.0.5 → 0.0.6

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@examplary/pci-runtime",
3
3
  "type": "module",
4
4
  "packageManager": "yarn@4.8.1",
5
- "version": "0.0.5",
5
+ "version": "0.0.6",
6
6
  "description": "PCI runtime for Examplary question type components.",
7
7
  "scripts": {
8
8
  "build": "node ./scripts/build.js",
@@ -3710,7 +3710,7 @@ import "https://unpkg.com/@cortex-js/compute-engine?module"`),'["Error", "comput
3710
3710
  ${o?.replace(/\\/g,"\\\\").replace(/`/g,"\\`")}
3711
3711
  </style>
3712
3712
  <div class="examplary-component-root"></div>
3713
- `;let u=this.shadowRoot.querySelector(".examplary-component-root"),c=()=>{let d=this.store(m=>m.answer),f=this.store(m=>m.saveAnswer);(0,Fh.useEffect)(()=>{this.config.onready&&(this._onReadyCalled||(this._onReadyCalled=!0,this.config.onready(this,this.getState())))},[]);let p=(0,Fh.useCallback)(m=>n?.[m]||m,[]),h=(0,Fh.useMemo)(()=>({language:a||"en"}),[]);return React.createElement(i,{question:this._question,isPreview:!1,answer:d,saveAnswer:f,api:null,t:p,i18n:h})};(0,Kte.createRoot)(u).render(React.createElement(c,null))})()}getResponse(){if(!this.store?.getState().answer)return;let u=this.store?.getState().answer?.value||"";return Array.isArray(u)?{list:{string:u.map(c=>(c||"").toString())}}:{base:{string:u.toString()}}}setResponse(u){let c=u?.base?.string||u?.list?.string||"";this.store?.setState(d=>({answer:{...d.answer,value:c}}))}checkValidity(){return!!this.store?.getState().answer}getState(){return JSON.stringify({answer:this.store?.getState().answer||null})}setState(u){u&&(this._state=JSON.parse(u),this.store?.setState({answer:this._state.answer||null}))}interactionChanged=()=>{this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(()=>{let u={interaction:this,responseIdentifier:this.config.responseIdentifier,valid:this.checkValidity(),value:this.getResponse()},c=new CustomEvent("qti-interaction-changed",{detail:u});this.dom?.dispatchEvent(c)},1e3)};oncompleted(){}off(){}on(u){}trigger=(u,c)=>{this.config.properties[u]=c,this.render()};resetResponse=()=>{this.render(),this.store?.setState({answer:null})}}return new s};return Yte(l8e);})();
3713
+ `;let u=this.shadowRoot.querySelector(".examplary-component-root"),c=()=>{let d=this.store(m=>m.answer),f=this.store(m=>m.saveAnswer);(0,Fh.useEffect)(()=>{this.config.onready&&(this._onReadyCalled||(this._onReadyCalled=!0,setTimeout(()=>{requestAnimationFrame(()=>{this.config.onready(this,this.getState())})})))},[]);let p=(0,Fh.useCallback)(m=>n?.[m]||m,[]),h=(0,Fh.useMemo)(()=>({language:a||"en"}),[]);return React.createElement(i,{question:this._question,isPreview:!1,answer:d,saveAnswer:f,api:null,t:p,i18n:h})};(0,Kte.createRoot)(u).render(React.createElement(c,null))})()}getResponse(){if(!this.store?.getState().answer)return;let u=this.store?.getState().answer?.value||"";return Array.isArray(u)?{list:{string:u.map(c=>(c||"").toString())}}:{base:{string:u.toString()}}}setResponse(u){let c=u?.base?.string||u?.list?.string||"";this.store?.setState(d=>({answer:{...d.answer,value:c}}))}checkValidity(){return!!this.store?.getState().answer}getState(){return JSON.stringify({answer:this.store?.getState().answer||null})}setState(u){u&&(this._state=JSON.parse(u),this.store?.setState({answer:this._state.answer||null}))}interactionChanged=()=>{this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(()=>{let u={interaction:this,responseIdentifier:this.config.responseIdentifier,valid:this.checkValidity(),value:this.getResponse()},c=new CustomEvent("qti-interaction-changed",{detail:u});this.dom?.dispatchEvent(c)},1e3)};oncompleted(){}off(){}on(u){}trigger=(u,c)=>{this.config.properties[u]=c,this.render()};resetResponse=()=>{this.render(),this.store?.setState({answer:null})}}return new s};return Yte(l8e);})();
3714
3714
  /*! Bundled license information:
3715
3715
 
3716
3716
  react/cjs/react.production.js: