@hep-code-runner/vue2 2.3.0 → 2.3.1

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 CHANGED
@@ -160,4 +160,4 @@
160
160
  .hep-cr-editor .token.console {
161
161
  color: #333 !important;
162
162
  }
163
- `;i&&i.remove();const p=document.createElement("style");p.id=t,p.textContent=c,document.head.appendChild(p)},escapeHtml:function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML},handleInput:function(e){this.$emit("input",e.target.value),this.$emit("update:value",e.target.value),this.emitChange(e.target.value)},handleScroll:function(e){var t=this.$refs.highlightRef;t&&(t.scrollTop=e.target.scrollTop,t.scrollLeft=e.target.scrollLeft)},handleKeydown:function(e){if(e.key==="Tab"){e.preventDefault();var t=e.target,i=t.selectionStart,c=t.selectionEnd,p=t.value;t.value=p.substring(0,i)+" "+p.substring(c),t.selectionStart=t.selectionEnd=i+2,this.$emit("input",t.value),this.$emit("update:value",t.value),this.emitChange(t.value)}},emitChange:function(e){var t=this;t.changeTimer&&clearTimeout(t.changeTimer),t.changeTimer=setTimeout(function(){t.$emit("change",e)},500)}},beforeDestroy:function(){this.changeTimer&&clearTimeout(this.changeTimer)}},function(){var e=this,t=e._self._c;return t("div",{staticClass:"hep-cr-editor",class:"hep-cr-theme-"+e.theme,style:{background:e.editorBackground}},[t("pre",{ref:"highlightRef",staticClass:"hep-cr-highlight",class:"language-"+e.prismLanguage,attrs:{"aria-hidden":"true"}},[t("code",{domProps:{innerHTML:e._s(e.highlightedCode)}})]),t("textarea",{staticClass:"hep-cr-input",attrs:{disabled:e.disabled,spellcheck:"false",placeholder:"Write your code here..."},domProps:{value:e.value},on:{input:e.handleInput,scroll:e.handleScroll,keydown:e.handleKeydown}})])},[],0,0,"525880d3").exports},props:{pistonUrl:{type:String,default:"/api/piston"},language:{type:String,default:"javascript"},code:{type:String,default:""},theme:{type:String,default:"light",validator:function(e){return["light","dark"].indexOf(e)!==-1}},themeColor:{type:String,default:""},showLanguageSelector:{type:Boolean,default:!0},showEditor:{type:Boolean,default:!0},editable:{type:Boolean,default:!0},executorLabel:{type:String,default:"运行"}},data:function(){return{runtimes:[],internalLanguage:this.language||"javascript",internalCode:this.code!==void 0?this.code:"",currentTheme:this.theme,output:"",stderr:"",isRunning:!1,executionTime:null,activeTab:"stdout",error:null,runtimesLoading:!1,client:null,editorWidth:60,copiedEditor:!1,copiedOutput:!1}},computed:{themeClass:function(){return"hep-cr-runner-"+this.currentTheme},themeStyle:function(){if(!this.themeColor)return{};var e,t=this.currentTheme==="dark",i=this.themeColor,c=function(f,l){var b=parseInt(f.replace("#",""),16),h=Math.round(2.55*l);return"#"+(16777216+65536*Math.min(255,Math.max(0,(b>>16)+h))+256*Math.min(255,Math.max(0,(b>>8&255)+h))+Math.min(255,Math.max(0,(255&b)+h))).toString(16).slice(1)},p=(.299*((e=parseInt(i.replace("#",""),16))>>16&255)+.587*(e>>8&255)+.114*(255&e))/255>.5?"#000":"#fff";return{"--hep-cr-theme-color":i,"--hep-cr-theme-color-hover":c(i,t?20:-20),"--hep-cr-tab-active-color":p}},languageOptions:function(){return this.runtimes.map(function(e){return{value:e.language+":"+e.version,label:e.language.charAt(0).toUpperCase()+e.language.slice(1)+" "+e.version}})},languageName:function(){var e=this.internalLanguage;return e.includes(":")?e.split(":")[0]:e}},watch:{language:function(e){e&&e!==this.internalLanguage&&(this.internalLanguage=e)},code:function(e){e!==void 0&&e!==this.internalCode&&(this.internalCode=e)},internalLanguage:function(e){this.$emit("update:language",e),this.$emit("language-change",e.includes(":")?e.split(":")[0]:e,this.internalCode)},internalCode:function(e){this.$emit("update:modelValue",e),this.$emit("update:code",e),this.$emit("change",e)}},mounted:function(){this.client=new te({pistonUrl:this.pistonUrl}),this.loadRuntimes()},methods:{loadRuntimes:function(){var e=this;this.runtimesLoading=!0,this.error=null,this.client.getRuntimes().then(function(t){e.runtimes=t;var i=e.languageName,c=t.find(function(p){return p.language===i});c&&!e.internalLanguage.includes(":")&&(e.internalLanguage=i+":"+c.version)}).catch(function(t){e.error=t.message||"Failed to load runtimes"}).finally(function(){e.runtimesLoading=!1})},handleCodeInput:function(e){this.internalCode=e},handleCodeChange:function(e){this.internalCode=e},execute:function(){var e=this;this.isRunning||(this.isRunning=!0,this.output="",this.stderr="",this.executionTime=null,this.error=null,this.activeTab="stdout",this.$emit("execute-start"),this.client.execute(this.languageName,this.internalCode).then(function(t){e.output=t.output,e.stderr=t.stderr,e.executionTime=t.executionTime||null,e.activeTab=t.stderr?"stderr":"stdout",e.$emit("execute-end",t)}).catch(function(t){e.error=t.message||"Execution failed",e.$emit("execute-end",{success:!1,output:"",stderr:e.error,code:-1})}).finally(function(){e.isRunning=!1}))},clearOutput:function(){this.output="",this.stderr="",this.executionTime=null,this.error=null},copyCode:function(){var e=this;navigator.clipboard.writeText(this.internalCode),this.copiedEditor=!0,setTimeout(function(){e.copiedEditor=!1},2e3)},copyOutput:function(){var e=this,t=this.activeTab==="stdout"?this.output:this.stderr;navigator.clipboard.writeText(t),this.copiedOutput=!0,setTimeout(function(){e.copiedOutput=!1},2e3)},toggleTheme:function(){this.currentTheme=this.currentTheme==="light"?"dark":"light"},startDrag:function(e){var t=this,i=document.querySelector(".hep-cr-runner-main");if(i){var c=function(f){var l=i.getBoundingClientRect(),b=(f.clientX-l.left)/l.width*100;t.editorWidth=Math.max(20,Math.min(80,b))},p=function(){document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",p),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",c),document.addEventListener("mouseup",p),document.body.style.cursor="col-resize",document.body.style.userSelect="none"}}}},function(){var e=this,t=e._self._c;return t("div",{class:["hep-cr-runner",e.themeClass],style:e.themeStyle},[t("div",{staticClass:"hep-cr-runner-header"},[t("div",{staticClass:"hep-cr-runner-controls"},[e.showLanguageSelector?t("select",{directives:[{name:"model",rawName:"v-model",value:e.internalLanguage,expression:"internalLanguage"}],staticClass:"hep-cr-language-select",attrs:{disabled:e.isRunning},on:{change:function(i){var c=Array.prototype.filter.call(i.target.options,function(p){return p.selected}).map(function(p){return"_value"in p?p._value:p.value});e.internalLanguage=i.target.multiple?c:c[0]}}},[e.runtimesLoading?t("option",{attrs:{value:""}},[e._v("加载中...")]):e._e(),e._l(e.languageOptions,function(i){return t("option",{key:i.value,domProps:{value:i.value}},[e._v(" "+e._s(i.label)+" ")])})],2):e._e()]),t("div",{staticClass:"hep-cr-runner-actions"},[t("button",{staticClass:"hep-cr-btn hep-cr-btn-run",attrs:{disabled:e.isRunning||e.runtimesLoading},on:{click:e.execute}},[e.isRunning?t("span",{staticClass:"hep-cr-spinner"}):t("span",{staticClass:"hep-cr-run-icon"},[e._v("▶")]),e._v(" "+e._s(e.isRunning?"运行中...":e.executorLabel)+" ")]),t("button",{staticClass:"hep-cr-btn hep-cr-btn-theme",attrs:{title:e.currentTheme==="light"?"Switch to dark mode":"Switch to light mode"},on:{click:e.toggleTheme}},[e.currentTheme==="light"?t("svg",{attrs:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"}},[t("path",{attrs:{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"}})]):t("svg",{attrs:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"}},[t("circle",{attrs:{cx:"12",cy:"12",r:"5"}}),t("line",{attrs:{x1:"12",y1:"1",x2:"12",y2:"3"}}),t("line",{attrs:{x1:"12",y1:"21",x2:"12",y2:"23"}}),t("line",{attrs:{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}}),t("line",{attrs:{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}}),t("line",{attrs:{x1:"1",y1:"12",x2:"3",y2:"12"}}),t("line",{attrs:{x1:"21",y1:"12",x2:"23",y2:"12"}}),t("line",{attrs:{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}}),t("line",{attrs:{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"}})])])])]),e.error?t("div",{staticClass:"hep-cr-error-message"},[e._v(" "+e._s(e.error)+" ")]):e._e(),t("div",{staticClass:"hep-cr-runner-main"},[e.showEditor?t("div",{staticClass:"hep-cr-editor-panel",style:{width:e.editorWidth+"%"}},[t("div",{staticClass:"hep-cr-panel-header"},[t("span",{staticClass:"hep-cr-panel-title"},[e._v("编辑器")]),t("div",{staticClass:"hep-cr-output-actions"},[t("span",{staticClass:"hep-cr-language-badge"},[e._v(e._s(e.languageName))]),t("button",{staticClass:"hep-cr-btn-icon",class:{"hep-cr-btn-copied":e.copiedEditor},attrs:{disabled:e.copiedEditor,title:e.copiedEditor?"已复制":"复制"},on:{click:e.copyCode}},[e.copiedEditor?t("span",{staticClass:"hep-cr-copied-text"},[e._v("已复制")]):t("svg",{attrs:{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"}},[t("rect",{attrs:{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}})])])])]),t("CodeEditor",{attrs:{value:e.internalCode,language:e.languageName,theme:e.currentTheme,disabled:!e.editable||e.isRunning},on:{input:e.handleCodeInput,change:e.handleCodeChange}})],1):e._e(),e.showEditor?t("div",{staticClass:"hep-cr-resize-handle",on:{mousedown:e.startDrag}},[t("div",{staticClass:"hep-cr-resize-line"})]):e._e(),t("div",{staticClass:"hep-cr-output-panel",style:{width:e.showEditor?100-e.editorWidth+"%":"100%"}},[t("div",{staticClass:"hep-cr-panel-header"},[t("div",{staticClass:"hep-cr-output-tabs"},[t("button",{class:["hep-cr-tab",{active:e.activeTab==="stdout"}],on:{click:function(i){e.activeTab="stdout"}}},[e._v(" 输出 ")]),e.stderr?t("button",{class:["hep-cr-tab","hep-cr-tab-error",{active:e.activeTab==="stderr"}],on:{click:function(i){e.activeTab="stderr"}}},[e._v(" 错误 ")]):e._e()]),t("div",{staticClass:"hep-cr-output-actions"},[e.executionTime!==null?t("span",{staticClass:"hep-cr-execution-time"},[e._v(" "+e._s(e.executionTime)+"ms ")]):e._e(),t("button",{staticClass:"hep-cr-btn-icon",class:{"hep-cr-btn-copied":e.copiedOutput},attrs:{disabled:e.copiedOutput,title:e.copiedOutput?"已复制":"复制"},on:{click:e.copyOutput}},[e.copiedOutput?t("span",{staticClass:"hep-cr-copied-text"},[e._v("已复制")]):t("svg",{attrs:{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"}},[t("rect",{attrs:{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}})])])])]),t("div",{staticClass:"hep-cr-output-content"},[e.activeTab==="stdout"?t("pre",[e._v(e._s(e.isRunning?"代码执行中...":e.output||'点击"运行"执行代码'))]):t("pre",{staticClass:"hep-cr-stderr"},[e._v(e._s(e.stderr))])])])])])},[],0,0,"44636f26").exports,ae=H({name:"CodeRunnerDialog",components:{CodeRunner:O},props:{value:{type:Boolean,default:!1},title:{type:String,default:"代码执行器"},width:{type:[String,Number],default:800},language:{type:String,default:"javascript"},code:{type:String,default:""}},model:{prop:"value",event:"input"},data(){return{localVisible:this.value}},computed:{dialogWidth(){return typeof this.width=="number"?this.width+"px":this.width}},watch:{value(e){this.localVisible=e}},methods:{close(){this.localVisible=!1,this.$emit("input",!1),this.$emit("update:value",!1),this.$emit("close")},handleOverlayClick(e){e.target===e.currentTarget&&this.close()}},expose:["close"]},function(){var e=this,t=e._self._c;return e.localVisible?t("div",{staticClass:"hep-cr-dialog-overlay",on:{click:e.handleOverlayClick}},[t("div",{staticClass:"hep-cr-dialog-container",style:{width:e.dialogWidth}},[t("div",{staticClass:"hep-cr-dialog-header"},[t("h3",{staticClass:"hep-cr-dialog-title"},[e._v(e._s(e.title))]),t("button",{staticClass:"hep-cr-dialog-close",on:{click:e.close}},[t("svg",{attrs:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"}},[t("line",{attrs:{x1:"18",y1:"6",x2:"6",y2:"18"}}),t("line",{attrs:{x1:"6",y1:"6",x2:"18",y2:"18"}})])])]),t("div",{staticClass:"hep-cr-dialog-body"},[t("CodeRunner",e._g(e._b({},"CodeRunner",e.$attrs,!1),e.$listeners))],1),t("div",{staticClass:"hep-cr-dialog-footer"},[e._t("footer",null,{close:e.close})],2)])]):e._e()},[],0,0,"a0648644").exports;O.install=e=>{e.component("CodeRunner",O)};const re={install(e){e.component("CodeRunner",O)}};exports.CodeRunner=O,exports.CodeRunnerDialog=ae,exports.default=re;
163
+ `;i&&i.remove();const p=document.createElement("style");p.id=t,p.textContent=c,document.head.appendChild(p)},escapeHtml:function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML},handleInput:function(e){this.$emit("input",e.target.value),this.$emit("update:value",e.target.value),this.emitChange(e.target.value)},handleScroll:function(e){var t=this.$refs.highlightRef;t&&(t.scrollTop=e.target.scrollTop,t.scrollLeft=e.target.scrollLeft)},handleKeydown:function(e){if(e.key==="Tab"){e.preventDefault();var t=e.target,i=t.selectionStart,c=t.selectionEnd,p=t.value;t.value=p.substring(0,i)+" "+p.substring(c),t.selectionStart=t.selectionEnd=i+2,this.$emit("input",t.value),this.$emit("update:value",t.value),this.emitChange(t.value)}},emitChange:function(e){var t=this;t.changeTimer&&clearTimeout(t.changeTimer),t.changeTimer=setTimeout(function(){t.$emit("change",e)},500)}},beforeDestroy:function(){this.changeTimer&&clearTimeout(this.changeTimer)}},function(){var e=this,t=e._self._c;return t("div",{staticClass:"hep-cr-editor",class:"hep-cr-theme-"+e.theme,style:{background:e.editorBackground}},[t("pre",{ref:"highlightRef",staticClass:"hep-cr-highlight",class:"language-"+e.prismLanguage,attrs:{"aria-hidden":"true"}},[t("code",{domProps:{innerHTML:e._s(e.highlightedCode)}})]),t("textarea",{staticClass:"hep-cr-input",attrs:{disabled:e.disabled,spellcheck:"false",placeholder:"Write your code here..."},domProps:{value:e.value},on:{input:e.handleInput,scroll:e.handleScroll,keydown:e.handleKeydown}})])},[],0,0,"525880d3").exports},props:{pistonUrl:{type:String,default:"/api/piston"},language:{type:String,default:"javascript"},code:{type:String,default:""},theme:{type:String,default:"light",validator:function(e){return["light","dark"].indexOf(e)!==-1}},themeColor:{type:String,default:""},showLanguageSelector:{type:Boolean,default:!0},showEditor:{type:Boolean,default:!0},editable:{type:Boolean,default:!0},executorLabel:{type:String,default:"运行"}},model:{prop:"code",event:"update:modelValue"},data:function(){return{runtimes:[],internalLanguage:this.language||"javascript",internalCode:this.code!==void 0?this.code:"",currentTheme:this.theme,output:"",stderr:"",isRunning:!1,executionTime:null,activeTab:"stdout",error:null,runtimesLoading:!1,client:null,editorWidth:60,copiedEditor:!1,copiedOutput:!1}},computed:{themeClass:function(){return"hep-cr-runner-"+this.currentTheme},themeStyle:function(){if(!this.themeColor)return{};var e,t=this.currentTheme==="dark",i=this.themeColor,c=function(f,l){var b=parseInt(f.replace("#",""),16),h=Math.round(2.55*l);return"#"+(16777216+65536*Math.min(255,Math.max(0,(b>>16)+h))+256*Math.min(255,Math.max(0,(b>>8&255)+h))+Math.min(255,Math.max(0,(255&b)+h))).toString(16).slice(1)},p=(.299*((e=parseInt(i.replace("#",""),16))>>16&255)+.587*(e>>8&255)+.114*(255&e))/255>.5?"#000":"#fff";return{"--hep-cr-theme-color":i,"--hep-cr-theme-color-hover":c(i,t?20:-20),"--hep-cr-tab-active-color":p}},languageOptions:function(){return this.runtimes.map(function(e){return{value:e.language+":"+e.version,label:e.language.charAt(0).toUpperCase()+e.language.slice(1)+" "+e.version}})},languageName:function(){var e=this.internalLanguage;return e.includes(":")?e.split(":")[0]:e}},watch:{language:function(e){e&&e!==this.internalLanguage&&(this.internalLanguage=e)},code:function(e){e!==void 0&&e!==this.internalCode&&(this.internalCode=e)},language:function(e){e&&e!==this.internalLanguage&&(this.internalLanguage=e)},internalLanguage:function(e){this.$emit("update:language",e),this.$emit("language-change",e.includes(":")?e.split(":")[0]:e,this.internalCode)},internalCode:function(e){this.$emit("update:modelValue",e),this.$emit("update:code",e),this.$emit("change",e)}},mounted:function(){this.client=new te({pistonUrl:this.pistonUrl}),this.loadRuntimes()},methods:{loadRuntimes:function(){var e=this;this.runtimesLoading=!0,this.error=null,this.client.getRuntimes().then(function(t){e.runtimes=t;var i=e.languageName,c=t.find(function(p){return p.language===i});c&&!e.internalLanguage.includes(":")&&(e.internalLanguage=i+":"+c.version)}).catch(function(t){e.error=t.message||"Failed to load runtimes"}).finally(function(){e.runtimesLoading=!1})},handleCodeInput:function(e){this.internalCode=e},handleCodeChange:function(e){this.internalCode=e},execute:function(){var e=this;this.isRunning||(this.isRunning=!0,this.output="",this.stderr="",this.executionTime=null,this.error=null,this.activeTab="stdout",this.$emit("execute-start"),this.client.execute(this.languageName,this.internalCode).then(function(t){e.output=t.output,e.stderr=t.stderr,e.executionTime=t.executionTime||null,e.activeTab=t.stderr?"stderr":"stdout",e.$emit("execute-end",t)}).catch(function(t){e.error=t.message||"Execution failed",e.$emit("execute-end",{success:!1,output:"",stderr:e.error,code:-1})}).finally(function(){e.isRunning=!1}))},clearOutput:function(){this.output="",this.stderr="",this.executionTime=null,this.error=null},copyCode:function(){var e=this;navigator.clipboard.writeText(this.internalCode),this.copiedEditor=!0,setTimeout(function(){e.copiedEditor=!1},2e3)},copyOutput:function(){var e=this,t=this.activeTab==="stdout"?this.output:this.stderr;navigator.clipboard.writeText(t),this.copiedOutput=!0,setTimeout(function(){e.copiedOutput=!1},2e3)},toggleTheme:function(){this.currentTheme=this.currentTheme==="light"?"dark":"light"},startDrag:function(e){var t=this,i=document.querySelector(".hep-cr-runner-main");if(i){var c=function(f){var l=i.getBoundingClientRect(),b=(f.clientX-l.left)/l.width*100;t.editorWidth=Math.max(20,Math.min(80,b))},p=function(){document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",p),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",c),document.addEventListener("mouseup",p),document.body.style.cursor="col-resize",document.body.style.userSelect="none"}}}},function(){var e=this,t=e._self._c;return t("div",{class:["hep-cr-runner",e.themeClass],style:e.themeStyle},[t("div",{staticClass:"hep-cr-runner-header"},[t("div",{staticClass:"hep-cr-runner-controls"},[e.showLanguageSelector?t("select",{directives:[{name:"model",rawName:"v-model",value:e.internalLanguage,expression:"internalLanguage"}],staticClass:"hep-cr-language-select",attrs:{disabled:e.isRunning},on:{change:function(i){var c=Array.prototype.filter.call(i.target.options,function(p){return p.selected}).map(function(p){return"_value"in p?p._value:p.value});e.internalLanguage=i.target.multiple?c:c[0]}}},[e.runtimesLoading?t("option",{attrs:{value:""}},[e._v("加载中...")]):e._e(),e._l(e.languageOptions,function(i){return t("option",{key:i.value,domProps:{value:i.value}},[e._v(" "+e._s(i.label)+" ")])})],2):e._e()]),t("div",{staticClass:"hep-cr-runner-actions"},[t("button",{staticClass:"hep-cr-btn hep-cr-btn-run",attrs:{disabled:e.isRunning||e.runtimesLoading},on:{click:e.execute}},[e.isRunning?t("span",{staticClass:"hep-cr-spinner"}):t("span",{staticClass:"hep-cr-run-icon"},[e._v("▶")]),e._v(" "+e._s(e.isRunning?"运行中...":e.executorLabel)+" ")]),t("button",{staticClass:"hep-cr-btn hep-cr-btn-theme",attrs:{title:e.currentTheme==="light"?"Switch to dark mode":"Switch to light mode"},on:{click:e.toggleTheme}},[e.currentTheme==="light"?t("svg",{attrs:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"}},[t("path",{attrs:{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"}})]):t("svg",{attrs:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"}},[t("circle",{attrs:{cx:"12",cy:"12",r:"5"}}),t("line",{attrs:{x1:"12",y1:"1",x2:"12",y2:"3"}}),t("line",{attrs:{x1:"12",y1:"21",x2:"12",y2:"23"}}),t("line",{attrs:{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}}),t("line",{attrs:{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}}),t("line",{attrs:{x1:"1",y1:"12",x2:"3",y2:"12"}}),t("line",{attrs:{x1:"21",y1:"12",x2:"23",y2:"12"}}),t("line",{attrs:{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}}),t("line",{attrs:{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"}})])])])]),e.error?t("div",{staticClass:"hep-cr-error-message"},[e._v(" "+e._s(e.error)+" ")]):e._e(),t("div",{staticClass:"hep-cr-runner-main"},[e.showEditor?t("div",{staticClass:"hep-cr-editor-panel",style:{width:e.editorWidth+"%"}},[t("div",{staticClass:"hep-cr-panel-header"},[t("span",{staticClass:"hep-cr-panel-title"},[e._v("编辑器")]),t("div",{staticClass:"hep-cr-output-actions"},[t("span",{staticClass:"hep-cr-language-badge"},[e._v(e._s(e.languageName))]),t("button",{staticClass:"hep-cr-btn-icon",class:{"hep-cr-btn-copied":e.copiedEditor},attrs:{disabled:e.copiedEditor,title:e.copiedEditor?"已复制":"复制"},on:{click:e.copyCode}},[e.copiedEditor?t("span",{staticClass:"hep-cr-copied-text"},[e._v("已复制")]):t("svg",{attrs:{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"}},[t("rect",{attrs:{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}})])])])]),t("CodeEditor",{attrs:{value:e.internalCode,language:e.languageName,theme:e.currentTheme,disabled:!e.editable||e.isRunning},on:{input:e.handleCodeInput,change:e.handleCodeChange}})],1):e._e(),e.showEditor?t("div",{staticClass:"hep-cr-resize-handle",on:{mousedown:e.startDrag}},[t("div",{staticClass:"hep-cr-resize-line"})]):e._e(),t("div",{staticClass:"hep-cr-output-panel",style:{width:e.showEditor?100-e.editorWidth+"%":"100%"}},[t("div",{staticClass:"hep-cr-panel-header"},[t("div",{staticClass:"hep-cr-output-tabs"},[t("button",{class:["hep-cr-tab",{active:e.activeTab==="stdout"}],on:{click:function(i){e.activeTab="stdout"}}},[e._v(" 输出 ")]),e.stderr?t("button",{class:["hep-cr-tab","hep-cr-tab-error",{active:e.activeTab==="stderr"}],on:{click:function(i){e.activeTab="stderr"}}},[e._v(" 错误 ")]):e._e()]),t("div",{staticClass:"hep-cr-output-actions"},[e.executionTime!==null?t("span",{staticClass:"hep-cr-execution-time"},[e._v(" "+e._s(e.executionTime)+"ms ")]):e._e(),t("button",{staticClass:"hep-cr-btn-icon",class:{"hep-cr-btn-copied":e.copiedOutput},attrs:{disabled:e.copiedOutput,title:e.copiedOutput?"已复制":"复制"},on:{click:e.copyOutput}},[e.copiedOutput?t("span",{staticClass:"hep-cr-copied-text"},[e._v("已复制")]):t("svg",{attrs:{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"}},[t("rect",{attrs:{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}}),t("path",{attrs:{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"}})])])])]),t("div",{staticClass:"hep-cr-output-content"},[e.activeTab==="stdout"?t("pre",[e._v(e._s(e.isRunning?"代码执行中...":e.output||'点击"运行"执行代码'))]):t("pre",{staticClass:"hep-cr-stderr"},[e._v(e._s(e.stderr))])])])])])},[],0,0,"517835e3").exports,ae=H({name:"CodeRunnerDialog",components:{CodeRunner:O},props:{value:{type:Boolean,default:!1},title:{type:String,default:"代码执行器"},width:{type:[String,Number],default:800},language:{type:String,default:"javascript"},code:{type:String,default:""}},model:{prop:"value",event:"input"},data(){return{localVisible:this.value}},computed:{dialogWidth(){return typeof this.width=="number"?this.width+"px":this.width}},watch:{value(e){this.localVisible=e}},methods:{close(){this.localVisible=!1,this.$emit("input",!1),this.$emit("update:value",!1),this.$emit("close")},handleOverlayClick(e){e.target===e.currentTarget&&this.close()}},expose:["close"]},function(){var e=this,t=e._self._c;return e.localVisible?t("div",{staticClass:"hep-cr-dialog-overlay",on:{click:e.handleOverlayClick}},[t("div",{staticClass:"hep-cr-dialog-container",style:{width:e.dialogWidth}},[t("div",{staticClass:"hep-cr-dialog-header"},[t("h3",{staticClass:"hep-cr-dialog-title"},[e._v(e._s(e.title))]),t("button",{staticClass:"hep-cr-dialog-close",on:{click:e.close}},[t("svg",{attrs:{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"}},[t("line",{attrs:{x1:"18",y1:"6",x2:"6",y2:"18"}}),t("line",{attrs:{x1:"6",y1:"6",x2:"18",y2:"18"}})])])]),t("div",{staticClass:"hep-cr-dialog-body"},[t("CodeRunner",e._g(e._b({},"CodeRunner",e.$attrs,!1),e.$listeners))],1),t("div",{staticClass:"hep-cr-dialog-footer"},[e._t("footer",null,{close:e.close})],2)])]):e._e()},[],0,0,"a0648644").exports;O.install=e=>{e.component("CodeRunner",O)};const re={install(e){e.component("CodeRunner",O)}};exports.CodeRunner=O,exports.CodeRunnerDialog=ae,exports.default=re;
package/dist/index.mjs CHANGED
@@ -553,7 +553,7 @@ const $ = j({ name: "CodeRunner", components: { CodeEditor: j({ name: "CodeEdito
553
553
  return t("div", { staticClass: "hep-cr-editor", class: "hep-cr-theme-" + e.theme, style: { background: e.editorBackground } }, [t("pre", { ref: "highlightRef", staticClass: "hep-cr-highlight", class: "language-" + e.prismLanguage, attrs: { "aria-hidden": "true" } }, [t("code", { domProps: { innerHTML: e._s(e.highlightedCode) } })]), t("textarea", { staticClass: "hep-cr-input", attrs: { disabled: e.disabled, spellcheck: "false", placeholder: "Write your code here..." }, domProps: { value: e.value }, on: { input: e.handleInput, scroll: e.handleScroll, keydown: e.handleKeydown } })]);
554
554
  }, [], 0, 0, "525880d3").exports }, props: { pistonUrl: { type: String, default: "/api/piston" }, language: { type: String, default: "javascript" }, code: { type: String, default: "" }, theme: { type: String, default: "light", validator: function(e) {
555
555
  return ["light", "dark"].indexOf(e) !== -1;
556
- } }, themeColor: { type: String, default: "" }, showLanguageSelector: { type: Boolean, default: !0 }, showEditor: { type: Boolean, default: !0 }, editable: { type: Boolean, default: !0 }, executorLabel: { type: String, default: "运行" } }, data: function() {
556
+ } }, themeColor: { type: String, default: "" }, showLanguageSelector: { type: Boolean, default: !0 }, showEditor: { type: Boolean, default: !0 }, editable: { type: Boolean, default: !0 }, executorLabel: { type: String, default: "运行" } }, model: { prop: "code", event: "update:modelValue" }, data: function() {
557
557
  return { runtimes: [], internalLanguage: this.language || "javascript", internalCode: this.code !== void 0 ? this.code : "", currentTheme: this.theme, output: "", stderr: "", isRunning: !1, executionTime: null, activeTab: "stdout", error: null, runtimesLoading: !1, client: null, editorWidth: 60, copiedEditor: !1, copiedOutput: !1 };
558
558
  }, computed: { themeClass: function() {
559
559
  return "hep-cr-runner-" + this.currentTheme;
@@ -575,6 +575,8 @@ const $ = j({ name: "CodeRunner", components: { CodeEditor: j({ name: "CodeEdito
575
575
  e && e !== this.internalLanguage && (this.internalLanguage = e);
576
576
  }, code: function(e) {
577
577
  e !== void 0 && e !== this.internalCode && (this.internalCode = e);
578
+ }, language: function(e) {
579
+ e && e !== this.internalLanguage && (this.internalLanguage = e);
578
580
  }, internalLanguage: function(e) {
579
581
  this.$emit("update:language", e), this.$emit("language-change", e.includes(":") ? e.split(":")[0] : e, this.internalCode);
580
582
  }, internalCode: function(e) {
@@ -648,7 +650,7 @@ const $ = j({ name: "CodeRunner", components: { CodeEditor: j({ name: "CodeEdito
648
650
  } } }, [e._v(" 输出 ")]), e.stderr ? t("button", { class: ["hep-cr-tab", "hep-cr-tab-error", { active: e.activeTab === "stderr" }], on: { click: function(i) {
649
651
  e.activeTab = "stderr";
650
652
  } } }, [e._v(" 错误 ")]) : e._e()]), t("div", { staticClass: "hep-cr-output-actions" }, [e.executionTime !== null ? t("span", { staticClass: "hep-cr-execution-time" }, [e._v(" " + e._s(e.executionTime) + "ms ")]) : e._e(), t("button", { staticClass: "hep-cr-btn-icon", class: { "hep-cr-btn-copied": e.copiedOutput }, attrs: { disabled: e.copiedOutput, title: e.copiedOutput ? "已复制" : "复制" }, on: { click: e.copyOutput } }, [e.copiedOutput ? t("span", { staticClass: "hep-cr-copied-text" }, [e._v("已复制")]) : t("svg", { attrs: { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2" } }, [t("rect", { attrs: { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" } }), t("path", { attrs: { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" } })])])])]), t("div", { staticClass: "hep-cr-output-content" }, [e.activeTab === "stdout" ? t("pre", [e._v(e._s(e.isRunning ? "代码执行中..." : e.output || '点击"运行"执行代码'))]) : t("pre", { staticClass: "hep-cr-stderr" }, [e._v(e._s(e.stderr))])])])])]);
651
- }, [], 0, 0, "44636f26").exports, ae = j({ name: "CodeRunnerDialog", components: { CodeRunner: $ }, props: { value: { type: Boolean, default: !1 }, title: { type: String, default: "代码执行器" }, width: { type: [String, Number], default: 800 }, language: { type: String, default: "javascript" }, code: { type: String, default: "" } }, model: { prop: "value", event: "input" }, data() {
653
+ }, [], 0, 0, "517835e3").exports, ae = j({ name: "CodeRunnerDialog", components: { CodeRunner: $ }, props: { value: { type: Boolean, default: !1 }, title: { type: String, default: "代码执行器" }, width: { type: [String, Number], default: 800 }, language: { type: String, default: "javascript" }, code: { type: String, default: "" } }, model: { prop: "value", event: "input" }, data() {
652
654
  return { localVisible: this.value };
653
655
  }, computed: { dialogWidth() {
654
656
  return typeof this.width == "number" ? this.width + "px" : this.width;
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .hep-cr-editor[data-v-525880d3]{position:relative;flex:1;overflow:hidden}.hep-cr-highlight[data-v-525880d3],.hep-cr-input[data-v-525880d3]{position:absolute;top:0;left:0;width:100%;height:100%;padding:12px 16px;margin:0;border:none;font-family:SF Mono,Monaco,Menlo,Ubuntu Mono,monospace;font-size:14px;line-height:1.6;white-space:pre;overflow:auto}.hep-cr-highlight[data-v-525880d3]{pointer-events:none;z-index:1}.hep-cr-highlight.hep-cr-highlight[data-v-525880d3]{background:transparent!important}.hep-cr-highlight code[data-v-525880d3]{display:block;font-family:inherit;background:transparent!important}.hep-cr-input[data-v-525880d3]{position:relative;z-index:2;background:transparent;color:transparent;caret-color:#d4d4d4;resize:none;outline:none}.hep-cr-input[data-v-525880d3]:disabled{opacity:.7}.hep-cr-theme-light .hep-cr-input[data-v-525880d3]{caret-color:#333}.hep-cr-highlight pre[class*=language-][data-v-525880d3]{text-shadow:none}.hep-cr-runner[data-v-44636f26]{display:flex;flex-direction:column;border:1px solid #e0e0e0;border-radius:12px;overflow:hidden;font-family:SF Mono,Monaco,Menlo,Ubuntu Mono,monospace}.hep-cr-runner-light[data-v-44636f26]{background:#fff}.hep-cr-runner-dark[data-v-44636f26]{background:#1e1e1e;border-color:#333}.hep-cr-runner-header[data-v-44636f26]{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background:#252526;border-bottom:1px solid #333}.hep-cr-runner-light .hep-cr-runner-header[data-v-44636f26]{background:#f3f3f3;border-color:#e0e0e0}.hep-cr-runner-controls[data-v-44636f26]{display:flex;gap:8px}.hep-cr-language-select[data-v-44636f26]{padding:6px 12px;border:1px solid #444;border-radius:6px;background:#2d2d2d;color:#d4d4d4;font-size:13px;cursor:pointer;outline:none}.hep-cr-runner-light .hep-cr-language-select[data-v-44636f26]{background:#fff;color:#333;border-color:#ccc}.hep-cr-language-select[data-v-44636f26]:focus{border-color:#4fc3f7}.hep-cr-runner-actions[data-v-44636f26]{display:flex;gap:8px}.hep-cr-btn[data-v-44636f26]{padding:6px 16px;border:none;border-radius:6px;font-size:13px;font-weight:500;cursor:pointer;display:flex;align-items:center;gap:6px;transition:all .2s}.hep-cr-btn[data-v-44636f26]:disabled{opacity:.5;cursor:not-allowed}.hep-cr-btn-run[data-v-44636f26]{background:var(--hep-cr-theme-color, #4caf50);color:var(--hep-cr-tab-active-color, #fff);font-weight:600}.hep-cr-btn-run[data-v-44636f26]:hover:not(:disabled){background:var(--hep-cr-theme-color-hover, #43a047)}.hep-cr-btn-theme[data-v-44636f26]{background:transparent;color:#fdd835;padding:6px 10px;font-size:14px;line-height:1;height:auto;min-height:28px;display:flex;align-items:center;justify-content:center}.hep-cr-btn-theme svg[data-v-44636f26]{display:block;width:18px;height:18px}.hep-cr-runner-light .hep-cr-btn-theme[data-v-44636f26]{color:#f57c00}.hep-cr-btn-theme[data-v-44636f26]:hover{background:#ffffff1a;color:#fff}.hep-cr-runner-light .hep-cr-btn-theme[data-v-44636f26]:hover{background:#0000000d}.hep-cr-error-message[data-v-44636f26]{padding:10px 16px;background:#c62828;color:#fff;font-size:13px}.hep-cr-runner-main[data-v-44636f26]{display:flex;height:400px;overflow:hidden}.hep-cr-editor-panel[data-v-44636f26]{display:flex;flex-direction:column;min-width:20%;max-width:80%}.hep-cr-panel-header[data-v-44636f26]{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;background:#2d2d2d;border-bottom:1px solid #333}.hep-cr-runner-light .hep-cr-panel-header[data-v-44636f26]{background:#f0f0f0;border-color:#e0e0e0}.hep-cr-panel-title[data-v-44636f26]{font-size:12px;font-weight:600;color:#888;text-transform:uppercase;letter-spacing:.5px}.hep-cr-language-badge[data-v-44636f26]{font-size:11px;padding:2px 8px;background:var(--hep-cr-theme-color, #4fc3f7);color:var(--hep-cr-tab-active-color, #000);border-radius:10px;font-weight:600}.hep-cr-editor[data-v-44636f26]{flex:1;width:100%;background:#1e1e1e}.hep-cr-editor .hep-cr-highlight[data-v-44636f26]{background:transparent!important}.hep-cr-editor .hep-cr-input[data-v-44636f26]{color:transparent!important;caret-color:#d4d4d4}.hep-cr-runner-light .hep-cr-editor[data-v-44636f26]{background:#fafafa}.hep-cr-runner-light .hep-cr-editor .hep-cr-highlight code[data-v-44636f26]{color:#333}.hep-cr-resize-handle[data-v-44636f26]{width:8px;background:#2d2d2d;cursor:col-resize;display:flex;align-items:center;justify-content:center;transition:background .2s;border-left:1px solid #3d3d3d;border-right:1px solid #3d3d3d}.hep-cr-resize-handle[data-v-44636f26]:hover{background:var(--hep-cr-theme-color, #4fc3f7)}.hep-cr-resize-line[data-v-44636f26]{width:3px;height:40px;background:#555;border-radius:2px;transition:background .2s}.hep-cr-resize-handle:hover .hep-cr-resize-line[data-v-44636f26]{background:#fff}.hep-cr-runner-light .hep-cr-resize-handle[data-v-44636f26]{background:#e0e0e0;border-color:#ccc}.hep-cr-runner-light .hep-cr-resize-line[data-v-44636f26]{background:#bbb}.hep-cr-runner-light .hep-cr-resize-handle[data-v-44636f26]:hover{background:var(--hep-cr-theme-color, #4fc3f7)}.hep-cr-runner-light .hep-cr-resize-handle:hover .hep-cr-resize-line[data-v-44636f26]{background:#fff}.hep-cr-output-panel[data-v-44636f26]{display:flex;flex-direction:column;min-width:20%;border-left:1px solid #333}.hep-cr-runner-light .hep-cr-output-panel[data-v-44636f26]{border-color:#e0e0e0}.hep-cr-output-tabs[data-v-44636f26]{display:flex;gap:4px}.hep-cr-tab[data-v-44636f26]{padding:4px 12px;border:none;background:transparent;cursor:pointer;font-size:12px;border-radius:4px;color:#888;transition:all .2s}.hep-cr-tab[data-v-44636f26]:hover{color:#d4d4d4;background:#3d3d3d}.hep-cr-runner-light .hep-cr-tab[data-v-44636f26]:hover{color:#333;background:#e0e0e0}.hep-cr-tab.active[data-v-44636f26]{background:var(--hep-cr-theme-color, #4fc3f7);color:var(--hep-cr-tab-active-color, #000);font-weight:600}.hep-cr-tab-error.active[data-v-44636f26]{background:#f44336;color:#fff}.hep-cr-output-actions[data-v-44636f26]{display:flex;align-items:center;gap:12px}.hep-cr-execution-time[data-v-44636f26]{font-size:12px;color:var(--hep-cr-theme-color, #4caf50);font-weight:500}.hep-cr-btn-icon[data-v-44636f26]{background:transparent;border:none;cursor:pointer;padding:4px;border-radius:4px;color:#888;display:flex;align-items:center;justify-content:center;transition:all .2s}.hep-cr-btn-icon[data-v-44636f26]:hover{color:#fff;background:#3d3d3d}.hep-cr-runner-light .hep-cr-btn-icon[data-v-44636f26]:hover{color:#333;background:#e0e0e0}.hep-cr-btn-icon[data-v-44636f26]:disabled{cursor:not-allowed;opacity:.7}.hep-cr-btn-copied[data-v-44636f26]{color:#4caf50!important}.hep-cr-copied-text[data-v-44636f26]{font-size:12px;color:#4caf50}.hep-cr-output-content[data-v-44636f26]{flex:1;padding:12px 16px;overflow:auto;background:#1e1e1e}.hep-cr-runner-light .hep-cr-output-content[data-v-44636f26]{background:#fff}.hep-cr-output-content pre[data-v-44636f26]{margin:0;font-size:13px;line-height:1.6;white-space:pre-wrap;word-break:break-all;color:#d4d4d4}.hep-cr-runner-light .hep-cr-output-content pre[data-v-44636f26]{color:#333}.hep-cr-output-content .hep-cr-stderr[data-v-44636f26]{color:#f44336}.hep-cr-spinner[data-v-44636f26]{width:12px;height:12px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:spin-44636f26 .8s linear infinite}@keyframes spin-44636f26{to{transform:rotate(360deg)}}.hep-cr-dialog-overlay[data-v-a0648644]{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:9999}.hep-cr-dialog-container[data-v-a0648644]{background:#fff;border-radius:12px;box-shadow:0 20px 60px #0000004d;max-width:90vw;max-height:90vh;display:flex;flex-direction:column;overflow:hidden}.hep-cr-dialog-header[data-v-a0648644]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e0e0e0}.hep-cr-dialog-title[data-v-a0648644]{margin:0;font-size:16px;font-weight:600;color:#333}.hep-cr-dialog-close[data-v-a0648644]{background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;color:#666;display:flex;align-items:center;justify-content:center;transition:all .2s}.hep-cr-dialog-close[data-v-a0648644]:hover{background:#f0f0f0;color:#333}.hep-cr-dialog-body[data-v-a0648644]{flex:1;overflow:auto;padding:0}.hep-cr-dialog-body[data-v-a0648644] .hep-cr-runner{border:none;border-radius:0}.hep-cr-dialog-footer[data-v-a0648644]{padding:12px 20px;border-top:1px solid #e0e0e0;display:flex;justify-content:flex-end;gap:12px}.hep-cr-dialog-fade-enter-active[data-v-a0648644],.hep-cr-dialog-fade-leave-active[data-v-a0648644]{transition:opacity .2s ease}.hep-cr-dialog-fade-enter-from[data-v-a0648644],.hep-cr-dialog-fade-leave-to[data-v-a0648644]{opacity:0}.hep-cr-dialog-fade-enter-active .hep-cr-dialog-container[data-v-a0648644],.hep-cr-dialog-fade-leave-active .hep-cr-dialog-container[data-v-a0648644]{transition:transform .2s ease}.hep-cr-dialog-fade-enter-from .hep-cr-dialog-container[data-v-a0648644],.hep-cr-dialog-fade-leave-to .hep-cr-dialog-container[data-v-a0648644]{transform:scale(.95)}
1
+ .hep-cr-editor[data-v-525880d3]{position:relative;flex:1;overflow:hidden}.hep-cr-highlight[data-v-525880d3],.hep-cr-input[data-v-525880d3]{position:absolute;top:0;left:0;width:100%;height:100%;padding:12px 16px;margin:0;border:none;font-family:SF Mono,Monaco,Menlo,Ubuntu Mono,monospace;font-size:14px;line-height:1.6;white-space:pre;overflow:auto}.hep-cr-highlight[data-v-525880d3]{pointer-events:none;z-index:1}.hep-cr-highlight.hep-cr-highlight[data-v-525880d3]{background:transparent!important}.hep-cr-highlight code[data-v-525880d3]{display:block;font-family:inherit;background:transparent!important}.hep-cr-input[data-v-525880d3]{position:relative;z-index:2;background:transparent;color:transparent;caret-color:#d4d4d4;resize:none;outline:none}.hep-cr-input[data-v-525880d3]:disabled{opacity:.7}.hep-cr-theme-light .hep-cr-input[data-v-525880d3]{caret-color:#333}.hep-cr-highlight pre[class*=language-][data-v-525880d3]{text-shadow:none}.hep-cr-runner[data-v-517835e3]{display:flex;flex-direction:column;border:1px solid #e0e0e0;border-radius:12px;overflow:hidden;font-family:SF Mono,Monaco,Menlo,Ubuntu Mono,monospace}.hep-cr-runner-light[data-v-517835e3]{background:#fff}.hep-cr-runner-dark[data-v-517835e3]{background:#1e1e1e;border-color:#333}.hep-cr-runner-header[data-v-517835e3]{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background:#252526;border-bottom:1px solid #333}.hep-cr-runner-light .hep-cr-runner-header[data-v-517835e3]{background:#f3f3f3;border-color:#e0e0e0}.hep-cr-runner-controls[data-v-517835e3]{display:flex;gap:8px}.hep-cr-language-select[data-v-517835e3]{padding:6px 12px;border:1px solid #444;border-radius:6px;background:#2d2d2d;color:#d4d4d4;font-size:13px;cursor:pointer;outline:none}.hep-cr-runner-light .hep-cr-language-select[data-v-517835e3]{background:#fff;color:#333;border-color:#ccc}.hep-cr-language-select[data-v-517835e3]:focus{border-color:#4fc3f7}.hep-cr-runner-actions[data-v-517835e3]{display:flex;gap:8px}.hep-cr-btn[data-v-517835e3]{padding:6px 16px;border:none;border-radius:6px;font-size:13px;font-weight:500;cursor:pointer;display:flex;align-items:center;gap:6px;transition:all .2s}.hep-cr-btn[data-v-517835e3]:disabled{opacity:.5;cursor:not-allowed}.hep-cr-btn-run[data-v-517835e3]{background:var(--hep-cr-theme-color, #4caf50);color:var(--hep-cr-tab-active-color, #fff);font-weight:600}.hep-cr-btn-run[data-v-517835e3]:hover:not(:disabled){background:var(--hep-cr-theme-color-hover, #43a047)}.hep-cr-btn-theme[data-v-517835e3]{background:transparent;color:#fdd835;padding:6px 10px;font-size:14px;line-height:1;height:auto;min-height:28px;display:flex;align-items:center;justify-content:center}.hep-cr-btn-theme svg[data-v-517835e3]{display:block;width:18px;height:18px}.hep-cr-runner-light .hep-cr-btn-theme[data-v-517835e3]{color:#f57c00}.hep-cr-btn-theme[data-v-517835e3]:hover{background:#ffffff1a;color:#fff}.hep-cr-runner-light .hep-cr-btn-theme[data-v-517835e3]:hover{background:#0000000d}.hep-cr-error-message[data-v-517835e3]{padding:10px 16px;background:#c62828;color:#fff;font-size:13px}.hep-cr-runner-main[data-v-517835e3]{display:flex;height:400px;overflow:hidden}.hep-cr-editor-panel[data-v-517835e3]{display:flex;flex-direction:column;min-width:20%;max-width:80%}.hep-cr-panel-header[data-v-517835e3]{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;background:#2d2d2d;border-bottom:1px solid #333}.hep-cr-runner-light .hep-cr-panel-header[data-v-517835e3]{background:#f0f0f0;border-color:#e0e0e0}.hep-cr-panel-title[data-v-517835e3]{font-size:12px;font-weight:600;color:#888;text-transform:uppercase;letter-spacing:.5px}.hep-cr-language-badge[data-v-517835e3]{font-size:11px;padding:2px 8px;background:var(--hep-cr-theme-color, #4fc3f7);color:var(--hep-cr-tab-active-color, #000);border-radius:10px;font-weight:600}.hep-cr-editor[data-v-517835e3]{flex:1;width:100%;background:#1e1e1e}.hep-cr-editor .hep-cr-highlight[data-v-517835e3]{background:transparent!important}.hep-cr-editor .hep-cr-input[data-v-517835e3]{color:transparent!important;caret-color:#d4d4d4}.hep-cr-runner-light .hep-cr-editor[data-v-517835e3]{background:#fafafa}.hep-cr-runner-light .hep-cr-editor .hep-cr-highlight code[data-v-517835e3]{color:#333}.hep-cr-resize-handle[data-v-517835e3]{width:8px;background:#2d2d2d;cursor:col-resize;display:flex;align-items:center;justify-content:center;transition:background .2s;border-left:1px solid #3d3d3d;border-right:1px solid #3d3d3d}.hep-cr-resize-handle[data-v-517835e3]:hover{background:var(--hep-cr-theme-color, #4fc3f7)}.hep-cr-resize-line[data-v-517835e3]{width:3px;height:40px;background:#555;border-radius:2px;transition:background .2s}.hep-cr-resize-handle:hover .hep-cr-resize-line[data-v-517835e3]{background:#fff}.hep-cr-runner-light .hep-cr-resize-handle[data-v-517835e3]{background:#e0e0e0;border-color:#ccc}.hep-cr-runner-light .hep-cr-resize-line[data-v-517835e3]{background:#bbb}.hep-cr-runner-light .hep-cr-resize-handle[data-v-517835e3]:hover{background:var(--hep-cr-theme-color, #4fc3f7)}.hep-cr-runner-light .hep-cr-resize-handle:hover .hep-cr-resize-line[data-v-517835e3]{background:#fff}.hep-cr-output-panel[data-v-517835e3]{display:flex;flex-direction:column;min-width:20%;border-left:1px solid #333}.hep-cr-runner-light .hep-cr-output-panel[data-v-517835e3]{border-color:#e0e0e0}.hep-cr-output-tabs[data-v-517835e3]{display:flex;gap:4px}.hep-cr-tab[data-v-517835e3]{padding:4px 12px;border:none;background:transparent;cursor:pointer;font-size:12px;border-radius:4px;color:#888;transition:all .2s}.hep-cr-tab[data-v-517835e3]:hover{color:#d4d4d4;background:#3d3d3d}.hep-cr-runner-light .hep-cr-tab[data-v-517835e3]:hover{color:#333;background:#e0e0e0}.hep-cr-tab.active[data-v-517835e3]{background:var(--hep-cr-theme-color, #4fc3f7);color:var(--hep-cr-tab-active-color, #000);font-weight:600}.hep-cr-tab-error.active[data-v-517835e3]{background:#f44336;color:#fff}.hep-cr-output-actions[data-v-517835e3]{display:flex;align-items:center;gap:12px}.hep-cr-execution-time[data-v-517835e3]{font-size:12px;color:var(--hep-cr-theme-color, #4caf50);font-weight:500}.hep-cr-btn-icon[data-v-517835e3]{background:transparent;border:none;cursor:pointer;padding:4px;border-radius:4px;color:#888;display:flex;align-items:center;justify-content:center;transition:all .2s}.hep-cr-btn-icon[data-v-517835e3]:hover{color:#fff;background:#3d3d3d}.hep-cr-runner-light .hep-cr-btn-icon[data-v-517835e3]:hover{color:#333;background:#e0e0e0}.hep-cr-btn-icon[data-v-517835e3]:disabled{cursor:not-allowed;opacity:.7}.hep-cr-btn-copied[data-v-517835e3]{color:#4caf50!important}.hep-cr-copied-text[data-v-517835e3]{font-size:12px;color:#4caf50}.hep-cr-output-content[data-v-517835e3]{flex:1;padding:12px 16px;overflow:auto;background:#1e1e1e}.hep-cr-runner-light .hep-cr-output-content[data-v-517835e3]{background:#fff}.hep-cr-output-content pre[data-v-517835e3]{margin:0;font-size:13px;line-height:1.6;white-space:pre-wrap;word-break:break-all;color:#d4d4d4}.hep-cr-runner-light .hep-cr-output-content pre[data-v-517835e3]{color:#333}.hep-cr-output-content .hep-cr-stderr[data-v-517835e3]{color:#f44336}.hep-cr-spinner[data-v-517835e3]{width:12px;height:12px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:spin-517835e3 .8s linear infinite}@keyframes spin-517835e3{to{transform:rotate(360deg)}}.hep-cr-dialog-overlay[data-v-a0648644]{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:9999}.hep-cr-dialog-container[data-v-a0648644]{background:#fff;border-radius:12px;box-shadow:0 20px 60px #0000004d;max-width:90vw;max-height:90vh;display:flex;flex-direction:column;overflow:hidden}.hep-cr-dialog-header[data-v-a0648644]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e0e0e0}.hep-cr-dialog-title[data-v-a0648644]{margin:0;font-size:16px;font-weight:600;color:#333}.hep-cr-dialog-close[data-v-a0648644]{background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;color:#666;display:flex;align-items:center;justify-content:center;transition:all .2s}.hep-cr-dialog-close[data-v-a0648644]:hover{background:#f0f0f0;color:#333}.hep-cr-dialog-body[data-v-a0648644]{flex:1;overflow:auto;padding:0}.hep-cr-dialog-body[data-v-a0648644] .hep-cr-runner{border:none;border-radius:0}.hep-cr-dialog-footer[data-v-a0648644]{padding:12px 20px;border-top:1px solid #e0e0e0;display:flex;justify-content:flex-end;gap:12px}.hep-cr-dialog-fade-enter-active[data-v-a0648644],.hep-cr-dialog-fade-leave-active[data-v-a0648644]{transition:opacity .2s ease}.hep-cr-dialog-fade-enter-from[data-v-a0648644],.hep-cr-dialog-fade-leave-to[data-v-a0648644]{opacity:0}.hep-cr-dialog-fade-enter-active .hep-cr-dialog-container[data-v-a0648644],.hep-cr-dialog-fade-leave-active .hep-cr-dialog-container[data-v-a0648644]{transition:transform .2s ease}.hep-cr-dialog-fade-enter-from .hep-cr-dialog-container[data-v-a0648644],.hep-cr-dialog-fade-leave-to .hep-cr-dialog-container[data-v-a0648644]{transform:scale(.95)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hep-code-runner/vue2",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Vue 2 code runner component",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",