@hep-code-runner/vue3 2.3.5 → 2.3.7
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/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -227,5 +227,5 @@ This is a sample markdown document.`};var q=typeof globalThis<"u"?globalThis:typ
|
|
|
227
227
|
.hep-cr-editor .token.console {
|
|
228
228
|
color: #333 !important;
|
|
229
229
|
}
|
|
230
|
-
`;r&&r.remove();const s=document.createElement("style");s.id=t,s.textContent=o,document.head.appendChild(s)}e.useCssVars(n=>({e3543a54:A.value})),typeof window<"u"&&(window.Prism=X);const c=u,m=a,b=e.ref(null),i=e.ref(null);let w=null;function y(n){w&&clearTimeout(w),w=setTimeout(()=>{m("change",n)},500)}const E={javascript:"javascript",js:"javascript",typescript:"typescript",ts:"typescript",python:"python",py:"python",java:"java",c:"c",cpp:"cpp","c++":"cpp",csharp:"csharp","c#":"csharp",go:"go",golang:"go",rust:"rust",ruby:"ruby",rb:"ruby",php:"php",swift:"swift",kotlin:"kotlin",kt:"kotlin",sql:"sql",bash:"bash",sh:"bash",shell:"bash",json:"json",yaml:"yaml",yml:"yaml",markdown:"markdown",md:"markdown"},S=e.computed(()=>E[c.language.toLowerCase()]||"javascript"),A=e.computed(()=>c.theme==="dark"?"#1e1e1e":"#fafafa"),v=e.computed(()=>{try{const n=X.languages[S.value];if(n)return X.highlight(c.modelValue||"",n,S.value)}catch{}return function(n){const t=document.createElement("div");return t.textContent=n,t.innerHTML}(c.modelValue||"")});function N(n){const t=n.target;m("update:modelValue",t.value),y(t.value)}function I(){b.value&&i.value&&(i.value.scrollTop=b.value.scrollTop,i.value.scrollLeft=b.value.scrollLeft)}function F(n){if(n.key==="Tab"){n.preventDefault();const t=n.target,r=t.selectionStart,o=t.selectionEnd,s=t.value;t.value=s.substring(0,r)+" "+s.substring(o),t.selectionStart=t.selectionEnd=r+2,m("update:modelValue",t.value),y(t.value)}}return e.onMounted(()=>{l(c.theme)}),e.watch(()=>c.theme,n=>{l(n)}),e.onUnmounted(()=>{w&&clearTimeout(w)}),(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hep-cr-editor",`hep-cr-theme-${u.theme}`])},[e.createElementVNode("pre",{ref_key:"highlightRef",ref:i,class:e.normalizeClass(["hep-cr-highlight",[`language-${S.value}`,`hep-cr-prism-${u.theme}`]]),"aria-hidden":"true"},[e.createElementVNode("code",{innerHTML:v.value},null,8,oe)],2),e.createElementVNode("textarea",{ref_key:"codeRef",ref:b,class:"hep-cr-input",value:u.modelValue,disabled:u.disabled,onInput:N,onScroll:I,onKeydown:F,spellcheck:"false",placeholder:"请输入代码..."},null,40,se)],2))}}),[["__scopeId","data-v-f7f3a9f5"]]),le={class:"hep-cr-header"},ce={class:"hep-cr-controls"},ue=["disabled"],de={key:0,value:""},pe=["value"],ge={class:"hep-cr-actions"},he=["disabled"],me={key:0,class:"hep-cr-spinner"},fe={key:1,class:"hep-cr-run-icon"},be=["title"],Ee={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ve={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ke={key:0,class:"hep-cr-error"},ye={class:"hep-cr-main"},we={class:"hep-cr-panel-header"},Se={class:"hep-cr-output-actions"},Ae={class:"hep-cr-language-badge"},Te=["disabled","title"],Ne={key:0,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},xe={key:1,class:"hep-cr-copied-text"},Ie={class:"hep-cr-panel-header"},Fe={class:"hep-cr-output-tabs"},_e={class:"hep-cr-output-actions"},Re={key:0,class:"hep-cr-execution-time"},Oe=["disabled","title"],Le={key:0,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Ce={key:1,class:"hep-cr-copied-text"},Pe={class:"hep-cr-output-content"},De={key:0},Be={key:1,class:"hep-cr-stderr"},$=Q(e.defineComponent({__name:"CodeRunner",props:{pistonUrl:{default:"/api/piston"},modelValue:{default:""},code:{default:""},language:{default:"javascript"},theme:{default:"light"},themeColor:{default:""},showLanguageSelector:{type:Boolean,default:!0},showEditor:{type:Boolean,default:!0},editable:{type:Boolean,default:!0},executorLabel:{default:"运行"}},emits:["execute-start","execute-end","language-change","update:language","update:modelValue","update:code"],setup(u,{emit:a}){const l=u,c=a,m=e.ref(!1),b=e.ref(l.modelValue||l.code);e.watch(()=>l.modelValue,d=>{d!==void 0&&d!==b.value&&(b.value=d)}),e.watch(()=>l.code,d=>{d!==void 0&&d!==b.value&&(b.value=d)}),e.watch(b,d=>{c("update:modelValue",d),c("update:code",d)});const i=e.ref(l.language||"javascript");e.watch(()=>l.language,d=>{d&&d!==i.value&&(i.value=d)}),e.watch(i,d=>{m.value||(b.value=function(h){const k=h.toLowerCase();return ae[k]||`// ${h}
|
|
230
|
+
`;r&&r.remove();const s=document.createElement("style");s.id=t,s.textContent=o,document.head.appendChild(s)}e.useCssVars(n=>({e3543a54:A.value})),typeof window<"u"&&(window.Prism=X);const c=u,m=a,b=e.ref(null),i=e.ref(null);let w=null;function y(n){w&&clearTimeout(w),w=setTimeout(()=>{m("change",n)},500)}const E={javascript:"javascript",js:"javascript",typescript:"typescript",ts:"typescript",python:"python",py:"python",java:"java",c:"c",cpp:"cpp","c++":"cpp",csharp:"csharp","c#":"csharp",go:"go",golang:"go",rust:"rust",ruby:"ruby",rb:"ruby",php:"php",swift:"swift",kotlin:"kotlin",kt:"kotlin",sql:"sql",bash:"bash",sh:"bash",shell:"bash",json:"json",yaml:"yaml",yml:"yaml",markdown:"markdown",md:"markdown"},S=e.computed(()=>E[c.language.toLowerCase()]||"javascript"),A=e.computed(()=>c.theme==="dark"?"#1e1e1e":"#fafafa"),v=e.computed(()=>{try{const n=X.languages[S.value];if(n)return X.highlight(c.modelValue||"",n,S.value)}catch{}return function(n){const t=document.createElement("div");return t.textContent=n,t.innerHTML}(c.modelValue||"")});function N(n){const t=n.target;m("update:modelValue",t.value),y(t.value)}function I(){b.value&&i.value&&(i.value.scrollTop=b.value.scrollTop,i.value.scrollLeft=b.value.scrollLeft)}function F(n){if(n.key==="Tab"){n.preventDefault();const t=n.target,r=t.selectionStart,o=t.selectionEnd,s=t.value;t.value=s.substring(0,r)+" "+s.substring(o),t.selectionStart=t.selectionEnd=r+2,m("update:modelValue",t.value),y(t.value)}}return e.onMounted(()=>{l(c.theme)}),e.watch(()=>c.theme,n=>{l(n)}),e.onUnmounted(()=>{w&&clearTimeout(w)}),(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hep-cr-editor",`hep-cr-theme-${u.theme}`])},[e.createElementVNode("pre",{ref_key:"highlightRef",ref:i,class:e.normalizeClass(["hep-cr-highlight",[`language-${S.value}`,`hep-cr-prism-${u.theme}`]]),"aria-hidden":"true"},[e.createElementVNode("code",{innerHTML:v.value},null,8,oe)],2),e.createElementVNode("textarea",{ref_key:"codeRef",ref:b,class:"hep-cr-input",value:u.modelValue,disabled:u.disabled,onInput:N,onScroll:I,onKeydown:F,spellcheck:"false",placeholder:"请输入代码..."},null,40,se)],2))}}),[["__scopeId","data-v-f7f3a9f5"]]),le={class:"hep-cr-header"},ce={class:"hep-cr-controls"},ue=["disabled"],de={key:0,value:""},pe=["value"],ge={class:"hep-cr-actions"},he=["disabled"],me={key:0,class:"hep-cr-spinner"},fe={key:1,class:"hep-cr-run-icon"},be=["title"],Ee={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ve={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ke={key:0,class:"hep-cr-error"},ye={class:"hep-cr-main"},we={class:"hep-cr-panel-header"},Se={class:"hep-cr-output-actions"},Ae={class:"hep-cr-language-badge"},Te=["disabled","title"],Ne={key:0,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},xe={key:1,class:"hep-cr-copied-text"},Ie={class:"hep-cr-panel-header"},Fe={class:"hep-cr-output-tabs"},_e={class:"hep-cr-output-actions"},Re={key:0,class:"hep-cr-execution-time"},Oe=["disabled","title"],Le={key:0,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Ce={key:1,class:"hep-cr-copied-text"},Pe={class:"hep-cr-output-content"},De={key:0},Be={key:1,class:"hep-cr-stderr"},$=Q(e.defineComponent({__name:"CodeRunner",props:{pistonUrl:{default:"/api/piston"},modelValue:{default:""},code:{default:""},language:{default:"javascript"},theme:{default:"light"},themeColor:{default:""},showLanguageSelector:{type:Boolean,default:!0},showEditor:{type:Boolean,default:!0},editable:{type:Boolean,default:!0},executorLabel:{default:"运行"}},emits:["execute-start","execute-end","language-change","update:language","update:modelValue","update:code"],setup(u,{emit:a}){const l=u,c=a,m=e.ref(!1),b=e.ref(l.modelValue||l.code);e.watch(()=>l.modelValue,d=>{d!==void 0&&d!==b.value&&(b.value=d)}),e.watch(()=>l.code,d=>{d!==void 0&&d!==b.value&&(b.value=d)}),e.watch(b,d=>{c("update:modelValue",d),c("update:code",d)});const i=e.ref(l.language||"javascript");e.watch(()=>l.language,d=>{d&&d!==i.value&&(i.value=d)}),e.watch(i,d=>{m.value||(b.value=function(h){const k=h.toLowerCase().split(":")[0];return ae[k]||`// ${h}
|
|
231
231
|
// Write your code here`}(d)),m.value=!1,c("update:language",d)});const w=e.computed(()=>{if(!l.themeColor)return{};const d=l.theme==="dark",h=l.themeColor,k=function(R){const O=parseInt(R.replace("#",""),16);return(.299*(O>>16&255)+.587*(O>>8&255)+.114*(255&O))/255>.5}(h)?"#000":"#fff";return{"--hep-cr-theme-color":h,"--hep-cr-theme-color-hover":y(h,d?20:-20),"--hep-cr-tab-active-color":k}});function y(d,h){const k=parseInt(d.replace("#",""),16),R=Math.round(2.55*h);return"#"+(16777216+65536*Math.min(255,Math.max(0,(k>>16)+R))+256*Math.min(255,Math.max(0,(k>>8&255)+R))+Math.min(255,Math.max(0,(255&k)+R))).toString(16).slice(1)}const E=e.computed(()=>new ne({pistonUrl:l.pistonUrl})),S=e.ref([]),A=e.ref(l.theme),v=e.ref(""),N=e.ref(""),I=e.ref(!1),F=e.ref(null),n=e.ref("stdout"),t=e.ref(null),r=e.ref(!1),o=e.ref(60),s=e.ref(!1),p=e.ref(!1),g=e.computed(()=>S.value.map(d=>({value:`${d.language}:${d.version}`,label:`${d.language.charAt(0).toUpperCase()+d.language.slice(1)} ${d.version}`}))),f=e.computed(()=>{const d=i.value;return d.includes(":")?d.split(":")[0]:d});function T(){A.value=A.value==="light"?"dark":"light"}async function x(){if(!I.value){I.value=!0,v.value="",N.value="",F.value=null,t.value=null,n.value="stdout",c("execute-start");try{const d=await E.value.execute(f.value,b.value);v.value=d.output,N.value=d.stderr,F.value=d.executionTime||null,n.value=d.stderr?"stderr":"stdout",c("execute-end",d)}catch(d){t.value=d instanceof Error?d.message:"Execution failed",c("execute-end",{success:!1,output:"",stderr:t.value,code:-1})}finally{I.value=!1}}}async function C(){await navigator.clipboard.writeText(b.value),s.value=!0,setTimeout(()=>{s.value=!1},2e3)}async function M(){const d=n.value==="stdout"?v.value:N.value;await navigator.clipboard.writeText(d),p.value=!0,setTimeout(()=>{p.value=!1},2e3)}(async function(){r.value=!0,t.value=null;try{S.value=await E.value.getRuntimes();const d=f.value,h=S.value.find(k=>k.language===d);h&&!i.value.includes(":")&&(i.value=`${d}:${h.version}`)}catch(d){t.value=d instanceof Error?d.message:"Failed to load runtimes"}finally{r.value=!1}})();let P=!1;function j(d){P=!0,document.addEventListener("mousemove",U),document.addEventListener("mouseup",D),document.body.style.cursor="col-resize",document.body.style.userSelect="none"}function U(d){if(!P)return;const h=document.querySelector(".hep-cr-main");if(!h)return;const k=h.getBoundingClientRect(),R=(d.clientX-k.left)/k.width*100;o.value=Math.max(20,Math.min(80,R))}function D(){P=!1,document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",D),document.body.style.cursor="",document.body.style.userSelect=""}const _=e.computed(()=>`hep-cr-runner-${A.value}`);return(d,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hep-cr-runner",_.value]),style:e.normalizeStyle(w.value)},[e.createElementVNode("div",le,[e.createElementVNode("div",ce,[u.showLanguageSelector?e.withDirectives((e.openBlock(),e.createElementBlock("select",{key:0,"onUpdate:modelValue":h[0]||(h[0]=k=>i.value=k),class:"hep-cr-language-select",disabled:I.value},[r.value?(e.openBlock(),e.createElementBlock("option",de,"加载中...")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,k=>(e.openBlock(),e.createElementBlock("option",{key:k.value,value:k.value},e.toDisplayString(k.label),9,pe))),128))],8,ue)),[[e.vModelSelect,i.value]]):e.createCommentVNode("",!0)]),e.createElementVNode("div",ge,[e.createElementVNode("button",{class:"hep-cr-btn hep-cr-btn-run",disabled:I.value||r.value,onClick:x},[I.value?(e.openBlock(),e.createElementBlock("span",me)):(e.openBlock(),e.createElementBlock("span",fe,"▶")),e.createTextVNode(" "+e.toDisplayString(I.value?"运行中...":u.executorLabel),1)],8,he),e.createElementVNode("button",{class:"hep-cr-btn hep-cr-btn-theme",onClick:T,title:A.value==="light"?"Switch to dark mode":"Switch to light mode"},[A.value==="light"?(e.openBlock(),e.createElementBlock("svg",Ee,[...h[5]||(h[5]=[e.createElementVNode("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",ve,[...h[6]||(h[6]=[e.createStaticVNode('<circle cx="12" cy="12" r="5" data-v-28f350be></circle><line x1="12" y1="1" x2="12" y2="3" data-v-28f350be></line><line x1="12" y1="21" x2="12" y2="23" data-v-28f350be></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64" data-v-28f350be></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78" data-v-28f350be></line><line x1="1" y1="12" x2="3" y2="12" data-v-28f350be></line><line x1="21" y1="12" x2="23" y2="12" data-v-28f350be></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36" data-v-28f350be></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22" data-v-28f350be></line>',9)])]))],8,be)])]),t.value?(e.openBlock(),e.createElementBlock("div",ke,e.toDisplayString(t.value),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ye,[u.showEditor?(e.openBlock(),e.createElementBlock("div",{key:0,class:"hep-cr-editor-panel",style:e.normalizeStyle({width:o.value+"%"})},[e.createElementVNode("div",we,[h[8]||(h[8]=e.createElementVNode("span",{class:"hep-cr-panel-title"},"编辑器",-1)),e.createElementVNode("div",Se,[e.createElementVNode("span",Ae,e.toDisplayString(f.value),1),e.createElementVNode("button",{class:e.normalizeClass(["hep-cr-btn-icon",{"hep-cr-btn-copied":s.value}]),disabled:s.value,onClick:C,title:s.value?"已复制":"复制"},[s.value?(e.openBlock(),e.createElementBlock("span",xe,"已复制")):(e.openBlock(),e.createElementBlock("svg",Ne,[...h[7]||(h[7]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"},null,-1),e.createElementVNode("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"},null,-1)])]))],10,Te)])]),e.createVNode(ie,{modelValue:b.value,"onUpdate:modelValue":h[1]||(h[1]=k=>b.value=k),language:f.value,theme:A.value,disabled:!u.editable||I.value,onChange:h[2]||(h[2]=k=>{m.value=!0,c("update:modelValue",k)})},null,8,["modelValue","language","theme","disabled"])],4)):e.createCommentVNode("",!0),u.showEditor?(e.openBlock(),e.createElementBlock("div",{key:1,class:"hep-cr-resize-handle",onMousedown:j},[...h[9]||(h[9]=[e.createElementVNode("div",{class:"hep-cr-resize-line"},null,-1)])],32)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"hep-cr-output-panel",style:e.normalizeStyle({width:u.showEditor?100-o.value+"%":"100%"})},[e.createElementVNode("div",Ie,[e.createElementVNode("div",Fe,[e.createElementVNode("button",{class:e.normalizeClass(["hep-cr-tab",{active:n.value==="stdout"}]),onClick:h[3]||(h[3]=k=>n.value="stdout")}," 输出 ",2),N.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["hep-cr-tab","hep-cr-tab-error",{active:n.value==="stderr"}]),onClick:h[4]||(h[4]=k=>n.value="stderr")}," 错误 ",2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",_e,[F.value!==null?(e.openBlock(),e.createElementBlock("span",Re,e.toDisplayString(F.value)+"ms ",1)):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["hep-cr-btn-icon",{"hep-cr-btn-copied":p.value}]),disabled:p.value,onClick:M,title:p.value?"已复制":"复制"},[p.value?(e.openBlock(),e.createElementBlock("span",Ce,"已复制")):(e.openBlock(),e.createElementBlock("svg",Le,[...h[10]||(h[10]=[e.createElementVNode("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"},null,-1),e.createElementVNode("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"},null,-1)])]))],10,Oe)])]),e.createElementVNode("div",Pe,[n.value==="stdout"?(e.openBlock(),e.createElementBlock("pre",De,e.toDisplayString(I.value?"代码执行中...":v.value||'点击"运行"执行代码'),1)):(e.openBlock(),e.createElementBlock("pre",Be,e.toDisplayString(N.value),1))])],4)])],6))}}),[["__scopeId","data-v-28f350be"]]),$e={class:"hep-cr-dialog-header"},Me={class:"hep-cr-dialog-title"},Ue={class:"hep-cr-dialog-body"},He={key:0,class:"hep-cr-dialog-footer"},Ve=e.defineComponent({__name:"CodeRunnerDialog",props:{title:{default:"代码执行器"},width:{default:800},pistonUrl:{default:"/api/piston"},language:{default:"javascript"},code:{default:""},theme:{default:"light"},themeColor:{default:""},showLanguageSelector:{type:Boolean,default:!0},showEditor:{type:Boolean,default:!0},editable:{type:Boolean,default:!0},executorLabel:{default:"运行"}},emits:["update:modelValue","update:language","update:code","close"],setup(u,{expose:a,emit:l}){const c=u,m=l,b=e.ref(!1),i=e.ref(c.language||"javascript"),w=e.ref(c.code||"");function y(){b.value=!1,m("update:modelValue",!1),m("close")}function E(v){v.target===v.currentTarget&&y()}function S(v){i.value=v,m("update:language",v)}function A(v){w.value=v,m("update:code",v)}return e.watch(()=>c.language,v=>{v&&(i.value=v)}),e.watch(()=>c.code,v=>{v!==void 0&&(w.value=v)}),a({open:function(){b.value=!0,m("update:modelValue",!0)},close:y}),(v,N)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"hep-cr-dialog-fade"},{default:e.withCtx(()=>[b.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"hep-cr-dialog-overlay",onClick:E},[e.createElementVNode("div",{class:"hep-cr-dialog-container",style:e.normalizeStyle({width:typeof u.width=="number"?u.width+"px":u.width})},[e.createElementVNode("div",$e,[e.createElementVNode("h3",Me,e.toDisplayString(u.title),1),e.createElementVNode("button",{class:"hep-cr-dialog-close",onClick:y},[...N[0]||(N[0]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),e.createElementVNode("div",Ue,[e.createVNode($,{language:i.value,code:w.value,pistonUrl:u.pistonUrl,theme:u.theme,themeColor:u.themeColor,showLanguageSelector:u.showLanguageSelector,showEditor:u.showEditor,editable:u.editable,executorLabel:u.executorLabel,"onUpdate:language":S,"onUpdate:code":A},null,8,["language","code","pistonUrl","theme","themeColor","showLanguageSelector","showEditor","editable","executorLabel"])]),v.$slots.footer?(e.openBlock(),e.createElementBlock("div",He,[e.renderSlot(v.$slots,"footer",{close:y})])):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]),_:3})]))}});$.install=u=>{u.component("CodeRunner",$)};const je={install(u){u.component("CodeRunner",$)}};exports.CodeRunner=$,exports.CodeRunnerDialog=Ve,exports.default=je;
|
package/dist/index.mjs
CHANGED
|
@@ -633,7 +633,7 @@ const Re = ["innerHTML"], Ne = ["value", "disabled"], ce = (u, n) => {
|
|
|
633
633
|
c && c !== s.value && (s.value = c);
|
|
634
634
|
}), U(s, (c) => {
|
|
635
635
|
h.value || (f.value = function(g) {
|
|
636
|
-
const y = g.toLowerCase();
|
|
636
|
+
const y = g.toLowerCase().split(":")[0];
|
|
637
637
|
return Ie[y] || `// ${g}
|
|
638
638
|
// Write your code here`;
|
|
639
639
|
}(c)), h.value = !1, l("update:language", c);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hep-code-runner/vue3",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.7",
|
|
4
4
|
"description": "Vue 3 code runner component",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"vue": "^3.4.0"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@hep-code-runner/core": "
|
|
37
|
+
"@hep-code-runner/core": "workspace:*",
|
|
38
38
|
"prismjs": "^1.30.0"
|
|
39
39
|
}
|
|
40
40
|
}
|