Socket
Socket
Sign inDemoInstall

@pie-api/pie-element-extensions

Package Overview
Dependencies
Maintainers
2
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pie-api/pie-element-extensions - npm Package Compare versions

Comparing version 1.6.8 to 1.6.9

6

dist/pies/MathInlineResponse.js

@@ -1,4 +0,4 @@

import{L as t,r as e,h as s}from"./cssUtils-4ab6f935.js";import{u as a}from"./unsafe-html-80e1c91a.js";const o={ROUND_BRACKETS:"round_brackets",SQUARE_BRACKETS:"square_brackets",DOLLAR:"dollar",DOUBLE_DOLLAR:"double_dollar"},r={[o.ROUND_BRACKETS]:["\\(","\\)"],[o.SQUARE_BRACKETS]:["\\[","\\]"],[o.DOLLAR]:["$","$"],[o.DOUBLE_DOLLAR]:["$$","$$"]};class n extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},imgSrc:{type:String,attribute:!1},svgSrc:{type:String,attribute:!1},mathLoaded:{type:Boolean,attribute:!1}}}constructor(){super(),this.createSvg()}createSvg(){const t=this;window.MathJax={jax:["input/TeX","output/SVG"],extensions:["tex2jax.js","MathMenu.js","MathZoom.js"],showMathMenu:!1,showProcessingMessages:!1,messageStyle:"none",SVG:{useGlobalCache:!1},TeX:{extensions:["AMSmath.js","AMSsymbols.js","autoload-all.js"],inlineMath:[["$","$"],["\\(","\\)"]]},AuthorInit(){window.MathJax.Hub.Register.StartupHook("End",(function(){const{completeAnswer:e}=t.session||{};e&&n.mathToSvg(((t,e)=>{let s=e;s===o.SQUARE_BRACKETS&&(console.warn("\\[...\\] is not supported yet"),s=o.ROUND_BRACKETS),s===o.DOUBLE_DOLLAR&&(console.warn("$$...$$ is not supported yet"),s=o.DOLLAR);const[a,n]=r[s]||r[o.ROUND_BRACKETS];return`${a}${t}${n}`})(e)).then(e=>{t.svgSrc=e}).catch(t=>console.error(t))}))}},(t=>{const e=t.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js",t.getElementsByTagName("head")[0].appendChild(e)})(document)}updated(t){const e=t.get("session"),{completeAnswer:s}=e||{};this.session&&s!==this.session.completeAnswer&&this.createSvg()}static mathToSvg(t){return new Promise(e=>{const s=t,a=document.createElement("div");a.innerHTML=s,window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,a]),window.MathJax.Hub.Queue(()=>{const t=a.getElementsByTagName("svg")[0];t.setAttribute("xmlns","http://www.w3.org/2000/svg"),e(t.outerHTML)})})}render(){return s`<div class="response">
${this.svgSrc?a(this.svgSrc):""}
</div>`}}export default n;export{n as MathInlineResponse};
import{L as t,r as e,h as s}from"./cssUtils-4ab6f935.js";import{u as o}from"./unsafe-html-80e1c91a.js";const a={ROUND_BRACKETS:"round_brackets",SQUARE_BRACKETS:"square_brackets",DOLLAR:"dollar",DOUBLE_DOLLAR:"double_dollar"},n={[a.ROUND_BRACKETS]:["\\(","\\)"],[a.SQUARE_BRACKETS]:["\\[","\\]"],[a.DOLLAR]:["$","$"],[a.DOUBLE_DOLLAR]:["$$","$$"]};class r extends t{static get styles(){return[e]}static get properties(){return{model:{type:Object,attribute:!1},session:{type:Array,attribute:!1},imgSrc:{type:String,attribute:!1},svgSrc:{type:String,attribute:!1},mathLoaded:{type:Boolean,attribute:!1}}}constructor(){super(),(t=>{const e=t.createElement("script");e.type="text/javascript",e.async=!0,e.src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js",t.getElementsByTagName("head")[0].appendChild(e)})(document),this.createSvg()}setSvg(t){const e=this;r.mathToSvg(((t,e)=>{let s=e;s===a.SQUARE_BRACKETS&&(console.warn("\\[...\\] is not supported yet"),s=a.ROUND_BRACKETS),s===a.DOUBLE_DOLLAR&&(console.warn("$$...$$ is not supported yet"),s=a.DOLLAR);const[o,r]=n[s]||n[a.ROUND_BRACKETS];return`${o}${t}${r}`})(t)).then(t=>{e.svgSrc=t}).catch(t=>console.error(t))}createSvg(){const t=this;if(window.MathJax){const{completeAnswer:e}=t.session||{};e&&t.setSvg(e)}else window.MathJax={jax:["input/TeX","output/SVG"],extensions:["tex2jax.js","MathMenu.js","MathZoom.js"],showMathMenu:!1,showProcessingMessages:!1,messageStyle:"none",SVG:{useGlobalCache:!1},TeX:{extensions:["AMSmath.js","AMSsymbols.js","autoload-all.js"],inlineMath:[["$","$"],["\\(","\\)"]]},AuthorInit(){window.MathJax.Hub.Register.StartupHook("End",(function(){const{completeAnswer:e}=t.session||{};e&&t.setSvg(e)}))}}}updated(t){const e=t.get("session"),{completeAnswer:s}=e||{};this.session&&s!==this.session.completeAnswer&&this.session.completeAnswer&&(!s&&this.svgSrc||this.setSvg(this.session.completeAnswer))}static mathToSvg(t){return new Promise(e=>{setTimeout(()=>{const s=t,o=document.createElement("div");o.innerHTML=s,window.MathJax&&window.MathJax.Hub&&(window.MathJax.Hub.Queue(["Typeset",window.MathJax.Hub,o]),window.MathJax.Hub.Queue(()=>{const t=o.getElementsByTagName("svg")[0];t.setAttribute("xmlns","http://www.w3.org/2000/svg"),e(t.outerHTML)}))},200)})}render(){return s`<div class="response">
${this.svgSrc?o(this.svgSrc):""}
</div>`}}export default r;export{r as MathInlineResponse};
//# sourceMappingURL=MathInlineResponse.js.map

@@ -6,3 +6,3 @@ {

},
"version": "1.6.8",
"version": "1.6.9",
"description": "Extended capabilites for pie-elements",

@@ -9,0 +9,0 @@ "author": "PIE Api Authors",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc