@hep-code-runner/vue2 2.3.9 → 2.3.11

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
@@ -226,4 +226,4 @@ This is a sample markdown document.`};var K=typeof globalThis<"u"?globalThis:typ
226
226
  color: #333 !important;
227
227
  }
228
228
  `;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:"请输入代码..."},domProps:{value:e.value},on:{input:e.handleInput,scroll:e.handleScroll,keydown:e.handleKeydown}})])},[],0,0,"c5a23c34").exports},props:{pistonUrl:{type:String,default:"/api/piston"},token:{type:String,default:""},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:[],isCodeModified:!1,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.isCodeModified||(this.internalCode=function(t){const i=t.toLowerCase().split(":")[0];return ne[i]||`// ${t}
229
- // Write your code here`}(e)),this.isCodeModified=!1,this.$emit("update:language",e),this.$emit("language-change",e.includes(":")?e.split(":")[0]:e,this.internalCode)},internalCode:function(e){this.$emit("update:code",e),this.$emit("change",e)}},mounted:function(){this.client=new te({pistonUrl:this.pistonUrl,token:this.token}),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.isCodeModified=!0,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,"8e66fc6f").exports,re=z({name:"CodeRunnerDialog",components:{CodeRunner:L},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:""},pistonUrl:{type:String,default:"/api/piston"},token:{type:String,default:""},theme:{type:String,default:"light"},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:"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:{open(){this.localVisible=!0},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:["open","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({attrs:{language:e.language,code:e.code,pistonUrl:e.pistonUrl,token:e.token,theme:e.theme,themeColor:e.themeColor,showLanguageSelector:e.showLanguageSelector,showEditor:e.showEditor,editable:e.editable,executorLabel:e.executorLabel},on:{"update:language":function(i){e.language=i},"update:code":function(i){e.code=i}}},e.$listeners))],1),t("div",{staticClass:"hep-cr-dialog-footer"},[e._t("footer",null,{close:e.close})],2)])]):e._e()},[],0,0,"95644376").exports;L.install=e=>{e.component("CodeRunner",L)};const ie={install(e){e.component("CodeRunner",L)}};exports.CodeRunner=L,exports.CodeRunnerDialog=re,exports.default=ie;
229
+ // Write your code here`}(e)),this.isCodeModified=!1,this.$emit("update:language",e),this.$emit("language-change",e.includes(":")?e.split(":")[0]:e,this.internalCode)},internalCode:function(e){this.$emit("update:code",e),this.$emit("change",e)}},mounted:function(){this.client=new te({pistonUrl:this.pistonUrl,token:this.token}),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.isCodeModified=!0,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,"8e66fc6f").exports,re=z({name:"CodeRunnerDialog",components:{CodeRunner:L},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:""},pistonUrl:{type:String,default:"/api/piston"},token:{type:String,default:""},theme:{type:String,default:"light"},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:"value",event:"input"},data(){return{localVisible:this.value,localLanguage:this.language||"javascript",localCode:this.code!==void 0?this.code:""}},computed:{dialogWidth(){return typeof this.width=="number"?this.width+"px":this.width}},watch:{value(e){this.localVisible=e},language(e){e&&(this.localLanguage=e)},code(e){e!==void 0&&(this.localCode=e)}},methods:{open(){this.localVisible=!0},close(){this.localVisible=!1,this.$emit("input",!1),this.$emit("update:value",!1),this.$emit("close")},handleOverlayClick(e){e.target===e.currentTarget&&this.close()},handleLanguageUpdate(e){this.localLanguage=e,this.$emit("update:language",e)},handleCodeUpdate(e){this.localCode=e,this.$emit("update:code",e)}},expose:["open","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({attrs:{language:e.localLanguage,code:e.localCode,pistonUrl:e.pistonUrl,token:e.token,theme:e.theme,themeColor:e.themeColor,showLanguageSelector:e.showLanguageSelector,showEditor:e.showEditor,editable:e.editable,executorLabel:e.executorLabel},on:{"update:language":e.handleLanguageUpdate,"update:code":e.handleCodeUpdate}},e.$listeners))],1),t("div",{staticClass:"hep-cr-dialog-footer"},[e._t("footer",null,{close:e.close})],2)])]):e._e()},[],0,0,"743f3394").exports;L.install=e=>{e.component("CodeRunner",L)};const ie={install(e){e.component("CodeRunner",L)}};exports.CodeRunner=L,exports.CodeRunnerDialog=re,exports.default=ie;
package/dist/index.mjs CHANGED
@@ -725,25 +725,29 @@ const $ = z({ name: "CodeRunner", components: { CodeEditor: z({ name: "CodeEdito
725
725
  e.activeTab = "stderr";
726
726
  } } }, [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))])])])])]);
727
727
  }, [], 0, 0, "8e66fc6f").exports, re = z({ 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: "" }, pistonUrl: { type: String, default: "/api/piston" }, token: { type: String, default: "" }, theme: { type: String, default: "light" }, 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: "value", event: "input" }, data() {
728
- return { localVisible: this.value };
728
+ return { localVisible: this.value, localLanguage: this.language || "javascript", localCode: this.code !== void 0 ? this.code : "" };
729
729
  }, computed: { dialogWidth() {
730
730
  return typeof this.width == "number" ? this.width + "px" : this.width;
731
731
  } }, watch: { value(e) {
732
732
  this.localVisible = e;
733
+ }, language(e) {
734
+ e && (this.localLanguage = e);
735
+ }, code(e) {
736
+ e !== void 0 && (this.localCode = e);
733
737
  } }, methods: { open() {
734
738
  this.localVisible = !0;
735
739
  }, close() {
736
740
  this.localVisible = !1, this.$emit("input", !1), this.$emit("update:value", !1), this.$emit("close");
737
741
  }, handleOverlayClick(e) {
738
742
  e.target === e.currentTarget && this.close();
743
+ }, handleLanguageUpdate(e) {
744
+ this.localLanguage = e, this.$emit("update:language", e);
745
+ }, handleCodeUpdate(e) {
746
+ this.localCode = e, this.$emit("update:code", e);
739
747
  } }, expose: ["open", "close"] }, function() {
740
748
  var e = this, t = e._self._c;
741
- 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({ attrs: { language: e.language, code: e.code, pistonUrl: e.pistonUrl, token: e.token, theme: e.theme, themeColor: e.themeColor, showLanguageSelector: e.showLanguageSelector, showEditor: e.showEditor, editable: e.editable, executorLabel: e.executorLabel }, on: { "update:language": function(i) {
742
- e.language = i;
743
- }, "update:code": function(i) {
744
- e.code = i;
745
- } } }, e.$listeners))], 1), t("div", { staticClass: "hep-cr-dialog-footer" }, [e._t("footer", null, { close: e.close })], 2)])]) : e._e();
746
- }, [], 0, 0, "95644376").exports;
749
+ 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({ attrs: { language: e.localLanguage, code: e.localCode, pistonUrl: e.pistonUrl, token: e.token, theme: e.theme, themeColor: e.themeColor, showLanguageSelector: e.showLanguageSelector, showEditor: e.showEditor, editable: e.editable, executorLabel: e.executorLabel }, on: { "update:language": e.handleLanguageUpdate, "update:code": e.handleCodeUpdate } }, e.$listeners))], 1), t("div", { staticClass: "hep-cr-dialog-footer" }, [e._t("footer", null, { close: e.close })], 2)])]) : e._e();
750
+ }, [], 0, 0, "743f3394").exports;
747
751
  $.install = (e) => {
748
752
  e.component("CodeRunner", $);
749
753
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .hep-cr-editor[data-v-c5a23c34]{position:relative;flex:1;overflow:hidden}.hep-cr-highlight[data-v-c5a23c34],.hep-cr-input[data-v-c5a23c34]{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-c5a23c34]{pointer-events:none;z-index:1}.hep-cr-highlight.hep-cr-highlight[data-v-c5a23c34]{background:transparent!important}.hep-cr-highlight code[data-v-c5a23c34]{display:block;font-family:inherit;background:transparent!important}.hep-cr-input[data-v-c5a23c34]{position:relative;z-index:2;background:transparent;color:transparent;caret-color:#d4d4d4;resize:none;outline:none}.hep-cr-input[data-v-c5a23c34]:disabled{opacity:.7}.hep-cr-theme-light .hep-cr-input[data-v-c5a23c34]{caret-color:#333}.hep-cr-highlight pre[class*=language-][data-v-c5a23c34]{text-shadow:none}.hep-cr-runner[data-v-8e66fc6f]{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-8e66fc6f]{background:#fff}.hep-cr-runner-dark[data-v-8e66fc6f]{background:#1e1e1e;border-color:#333}.hep-cr-runner-header[data-v-8e66fc6f]{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-8e66fc6f]{background:#f3f3f3;border-color:#e0e0e0}.hep-cr-runner-controls[data-v-8e66fc6f]{display:flex;gap:8px}.hep-cr-language-select[data-v-8e66fc6f]{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-8e66fc6f]{background:#fff;color:#333;border-color:#ccc}.hep-cr-language-select[data-v-8e66fc6f]:focus{border-color:#4fc3f7}.hep-cr-runner-actions[data-v-8e66fc6f]{display:flex;gap:8px}.hep-cr-btn[data-v-8e66fc6f]{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-8e66fc6f]:disabled{opacity:.5;cursor:not-allowed}.hep-cr-btn-run[data-v-8e66fc6f]{background:var(--hep-cr-theme-color, #4caf50);color:var(--hep-cr-tab-active-color, #fff);font-weight:600}.hep-cr-btn-run[data-v-8e66fc6f]:hover:not(:disabled){background:var(--hep-cr-theme-color-hover, #43a047)}.hep-cr-btn-theme[data-v-8e66fc6f]{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-8e66fc6f]{display:block;width:18px;height:18px}.hep-cr-runner-light .hep-cr-btn-theme[data-v-8e66fc6f]{color:#f57c00}.hep-cr-btn-theme[data-v-8e66fc6f]:hover{background:#ffffff1a;color:#fff}.hep-cr-runner-light .hep-cr-btn-theme[data-v-8e66fc6f]:hover{background:#0000000d}.hep-cr-error-message[data-v-8e66fc6f]{padding:10px 16px;background:#c62828;color:#fff;font-size:13px}.hep-cr-runner-main[data-v-8e66fc6f]{display:flex;height:400px;overflow:hidden}.hep-cr-editor-panel[data-v-8e66fc6f]{display:flex;flex-direction:column;min-width:20%;max-width:80%}.hep-cr-panel-header[data-v-8e66fc6f]{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-8e66fc6f]{background:#f0f0f0;border-color:#e0e0e0}.hep-cr-panel-title[data-v-8e66fc6f]{font-size:12px;font-weight:600;color:#888;text-transform:uppercase;letter-spacing:.5px}.hep-cr-language-badge[data-v-8e66fc6f]{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-8e66fc6f]{flex:1;width:100%;background:#1e1e1e}.hep-cr-editor .hep-cr-highlight[data-v-8e66fc6f]{background:transparent!important}.hep-cr-editor .hep-cr-input[data-v-8e66fc6f]{color:transparent!important;caret-color:#d4d4d4}.hep-cr-runner-light .hep-cr-editor[data-v-8e66fc6f]{background:#fafafa}.hep-cr-runner-light .hep-cr-editor .hep-cr-highlight code[data-v-8e66fc6f]{color:#333}.hep-cr-resize-handle[data-v-8e66fc6f]{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-8e66fc6f]:hover{background:var(--hep-cr-theme-color, #4fc3f7)}.hep-cr-resize-line[data-v-8e66fc6f]{width:3px;height:40px;background:#555;border-radius:2px;transition:background .2s}.hep-cr-resize-handle:hover .hep-cr-resize-line[data-v-8e66fc6f]{background:#fff}.hep-cr-runner-light .hep-cr-resize-handle[data-v-8e66fc6f]{background:#e0e0e0;border-color:#ccc}.hep-cr-runner-light .hep-cr-resize-line[data-v-8e66fc6f]{background:#bbb}.hep-cr-runner-light .hep-cr-resize-handle[data-v-8e66fc6f]:hover{background:var(--hep-cr-theme-color, #4fc3f7)}.hep-cr-runner-light .hep-cr-resize-handle:hover .hep-cr-resize-line[data-v-8e66fc6f]{background:#fff}.hep-cr-output-panel[data-v-8e66fc6f]{display:flex;flex-direction:column;min-width:20%;border-left:1px solid #333}.hep-cr-runner-light .hep-cr-output-panel[data-v-8e66fc6f]{border-color:#e0e0e0}.hep-cr-output-tabs[data-v-8e66fc6f]{display:flex;gap:4px}.hep-cr-tab[data-v-8e66fc6f]{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-8e66fc6f]:hover{color:#d4d4d4;background:#3d3d3d}.hep-cr-runner-light .hep-cr-tab[data-v-8e66fc6f]:hover{color:#333;background:#e0e0e0}.hep-cr-tab.active[data-v-8e66fc6f]{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-8e66fc6f]{background:#f44336;color:#fff}.hep-cr-output-actions[data-v-8e66fc6f]{display:flex;align-items:center;gap:12px}.hep-cr-execution-time[data-v-8e66fc6f]{font-size:12px;color:var(--hep-cr-theme-color, #4caf50);font-weight:500}.hep-cr-btn-icon[data-v-8e66fc6f]{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-8e66fc6f]:hover{color:#fff;background:#3d3d3d}.hep-cr-runner-light .hep-cr-btn-icon[data-v-8e66fc6f]:hover{color:#333;background:#e0e0e0}.hep-cr-btn-icon[data-v-8e66fc6f]:disabled{cursor:not-allowed;opacity:.7}.hep-cr-btn-copied[data-v-8e66fc6f]{color:#4caf50!important}.hep-cr-copied-text[data-v-8e66fc6f]{font-size:12px;color:#4caf50}.hep-cr-output-content[data-v-8e66fc6f]{flex:1;padding:12px 16px;overflow:auto;background:#1e1e1e}.hep-cr-runner-light .hep-cr-output-content[data-v-8e66fc6f]{background:#fff}.hep-cr-output-content pre[data-v-8e66fc6f]{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-8e66fc6f]{color:#333}.hep-cr-output-content .hep-cr-stderr[data-v-8e66fc6f]{color:#f44336}.hep-cr-spinner[data-v-8e66fc6f]{width:12px;height:12px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:spin-8e66fc6f .8s linear infinite}@keyframes spin-8e66fc6f{to{transform:rotate(360deg)}}.hep-cr-dialog-overlay[data-v-95644376]{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-95644376]{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-95644376]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e0e0e0}.hep-cr-dialog-title[data-v-95644376]{margin:0;font-size:16px;font-weight:600;color:#333}.hep-cr-dialog-close[data-v-95644376]{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-95644376]:hover{background:#f0f0f0;color:#333}.hep-cr-dialog-body[data-v-95644376]{flex:1;overflow:auto;padding:0}.hep-cr-dialog-body[data-v-95644376] .hep-cr-runner{border:none;border-radius:0}.hep-cr-dialog-footer[data-v-95644376]{padding:12px 20px;border-top:1px solid #e0e0e0;display:flex;justify-content:flex-end;gap:12px}.hep-cr-dialog-fade-enter-active[data-v-95644376],.hep-cr-dialog-fade-leave-active[data-v-95644376]{transition:opacity .2s ease}.hep-cr-dialog-fade-enter-from[data-v-95644376],.hep-cr-dialog-fade-leave-to[data-v-95644376]{opacity:0}.hep-cr-dialog-fade-enter-active .hep-cr-dialog-container[data-v-95644376],.hep-cr-dialog-fade-leave-active .hep-cr-dialog-container[data-v-95644376]{transition:transform .2s ease}.hep-cr-dialog-fade-enter-from .hep-cr-dialog-container[data-v-95644376],.hep-cr-dialog-fade-leave-to .hep-cr-dialog-container[data-v-95644376]{transform:scale(.95)}
1
+ .hep-cr-editor[data-v-c5a23c34]{position:relative;flex:1;overflow:hidden}.hep-cr-highlight[data-v-c5a23c34],.hep-cr-input[data-v-c5a23c34]{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-c5a23c34]{pointer-events:none;z-index:1}.hep-cr-highlight.hep-cr-highlight[data-v-c5a23c34]{background:transparent!important}.hep-cr-highlight code[data-v-c5a23c34]{display:block;font-family:inherit;background:transparent!important}.hep-cr-input[data-v-c5a23c34]{position:relative;z-index:2;background:transparent;color:transparent;caret-color:#d4d4d4;resize:none;outline:none}.hep-cr-input[data-v-c5a23c34]:disabled{opacity:.7}.hep-cr-theme-light .hep-cr-input[data-v-c5a23c34]{caret-color:#333}.hep-cr-highlight pre[class*=language-][data-v-c5a23c34]{text-shadow:none}.hep-cr-runner[data-v-8e66fc6f]{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-8e66fc6f]{background:#fff}.hep-cr-runner-dark[data-v-8e66fc6f]{background:#1e1e1e;border-color:#333}.hep-cr-runner-header[data-v-8e66fc6f]{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-8e66fc6f]{background:#f3f3f3;border-color:#e0e0e0}.hep-cr-runner-controls[data-v-8e66fc6f]{display:flex;gap:8px}.hep-cr-language-select[data-v-8e66fc6f]{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-8e66fc6f]{background:#fff;color:#333;border-color:#ccc}.hep-cr-language-select[data-v-8e66fc6f]:focus{border-color:#4fc3f7}.hep-cr-runner-actions[data-v-8e66fc6f]{display:flex;gap:8px}.hep-cr-btn[data-v-8e66fc6f]{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-8e66fc6f]:disabled{opacity:.5;cursor:not-allowed}.hep-cr-btn-run[data-v-8e66fc6f]{background:var(--hep-cr-theme-color, #4caf50);color:var(--hep-cr-tab-active-color, #fff);font-weight:600}.hep-cr-btn-run[data-v-8e66fc6f]:hover:not(:disabled){background:var(--hep-cr-theme-color-hover, #43a047)}.hep-cr-btn-theme[data-v-8e66fc6f]{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-8e66fc6f]{display:block;width:18px;height:18px}.hep-cr-runner-light .hep-cr-btn-theme[data-v-8e66fc6f]{color:#f57c00}.hep-cr-btn-theme[data-v-8e66fc6f]:hover{background:#ffffff1a;color:#fff}.hep-cr-runner-light .hep-cr-btn-theme[data-v-8e66fc6f]:hover{background:#0000000d}.hep-cr-error-message[data-v-8e66fc6f]{padding:10px 16px;background:#c62828;color:#fff;font-size:13px}.hep-cr-runner-main[data-v-8e66fc6f]{display:flex;height:400px;overflow:hidden}.hep-cr-editor-panel[data-v-8e66fc6f]{display:flex;flex-direction:column;min-width:20%;max-width:80%}.hep-cr-panel-header[data-v-8e66fc6f]{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-8e66fc6f]{background:#f0f0f0;border-color:#e0e0e0}.hep-cr-panel-title[data-v-8e66fc6f]{font-size:12px;font-weight:600;color:#888;text-transform:uppercase;letter-spacing:.5px}.hep-cr-language-badge[data-v-8e66fc6f]{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-8e66fc6f]{flex:1;width:100%;background:#1e1e1e}.hep-cr-editor .hep-cr-highlight[data-v-8e66fc6f]{background:transparent!important}.hep-cr-editor .hep-cr-input[data-v-8e66fc6f]{color:transparent!important;caret-color:#d4d4d4}.hep-cr-runner-light .hep-cr-editor[data-v-8e66fc6f]{background:#fafafa}.hep-cr-runner-light .hep-cr-editor .hep-cr-highlight code[data-v-8e66fc6f]{color:#333}.hep-cr-resize-handle[data-v-8e66fc6f]{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-8e66fc6f]:hover{background:var(--hep-cr-theme-color, #4fc3f7)}.hep-cr-resize-line[data-v-8e66fc6f]{width:3px;height:40px;background:#555;border-radius:2px;transition:background .2s}.hep-cr-resize-handle:hover .hep-cr-resize-line[data-v-8e66fc6f]{background:#fff}.hep-cr-runner-light .hep-cr-resize-handle[data-v-8e66fc6f]{background:#e0e0e0;border-color:#ccc}.hep-cr-runner-light .hep-cr-resize-line[data-v-8e66fc6f]{background:#bbb}.hep-cr-runner-light .hep-cr-resize-handle[data-v-8e66fc6f]:hover{background:var(--hep-cr-theme-color, #4fc3f7)}.hep-cr-runner-light .hep-cr-resize-handle:hover .hep-cr-resize-line[data-v-8e66fc6f]{background:#fff}.hep-cr-output-panel[data-v-8e66fc6f]{display:flex;flex-direction:column;min-width:20%;border-left:1px solid #333}.hep-cr-runner-light .hep-cr-output-panel[data-v-8e66fc6f]{border-color:#e0e0e0}.hep-cr-output-tabs[data-v-8e66fc6f]{display:flex;gap:4px}.hep-cr-tab[data-v-8e66fc6f]{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-8e66fc6f]:hover{color:#d4d4d4;background:#3d3d3d}.hep-cr-runner-light .hep-cr-tab[data-v-8e66fc6f]:hover{color:#333;background:#e0e0e0}.hep-cr-tab.active[data-v-8e66fc6f]{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-8e66fc6f]{background:#f44336;color:#fff}.hep-cr-output-actions[data-v-8e66fc6f]{display:flex;align-items:center;gap:12px}.hep-cr-execution-time[data-v-8e66fc6f]{font-size:12px;color:var(--hep-cr-theme-color, #4caf50);font-weight:500}.hep-cr-btn-icon[data-v-8e66fc6f]{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-8e66fc6f]:hover{color:#fff;background:#3d3d3d}.hep-cr-runner-light .hep-cr-btn-icon[data-v-8e66fc6f]:hover{color:#333;background:#e0e0e0}.hep-cr-btn-icon[data-v-8e66fc6f]:disabled{cursor:not-allowed;opacity:.7}.hep-cr-btn-copied[data-v-8e66fc6f]{color:#4caf50!important}.hep-cr-copied-text[data-v-8e66fc6f]{font-size:12px;color:#4caf50}.hep-cr-output-content[data-v-8e66fc6f]{flex:1;padding:12px 16px;overflow:auto;background:#1e1e1e}.hep-cr-runner-light .hep-cr-output-content[data-v-8e66fc6f]{background:#fff}.hep-cr-output-content pre[data-v-8e66fc6f]{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-8e66fc6f]{color:#333}.hep-cr-output-content .hep-cr-stderr[data-v-8e66fc6f]{color:#f44336}.hep-cr-spinner[data-v-8e66fc6f]{width:12px;height:12px;border:2px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:spin-8e66fc6f .8s linear infinite}@keyframes spin-8e66fc6f{to{transform:rotate(360deg)}}.hep-cr-dialog-overlay[data-v-743f3394]{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-743f3394]{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-743f3394]{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #e0e0e0}.hep-cr-dialog-title[data-v-743f3394]{margin:0;font-size:16px;font-weight:600;color:#333}.hep-cr-dialog-close[data-v-743f3394]{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-743f3394]:hover{background:#f0f0f0;color:#333}.hep-cr-dialog-body[data-v-743f3394]{flex:1;overflow:auto;padding:0}.hep-cr-dialog-body[data-v-743f3394] .hep-cr-runner{border:none;border-radius:0}.hep-cr-dialog-footer[data-v-743f3394]{padding:12px 20px;border-top:1px solid #e0e0e0;display:flex;justify-content:flex-end;gap:12px}.hep-cr-dialog-fade-enter-active[data-v-743f3394],.hep-cr-dialog-fade-leave-active[data-v-743f3394]{transition:opacity .2s ease}.hep-cr-dialog-fade-enter-from[data-v-743f3394],.hep-cr-dialog-fade-leave-to[data-v-743f3394]{opacity:0}.hep-cr-dialog-fade-enter-active .hep-cr-dialog-container[data-v-743f3394],.hep-cr-dialog-fade-leave-active .hep-cr-dialog-container[data-v-743f3394]{transition:transform .2s ease}.hep-cr-dialog-fade-enter-from .hep-cr-dialog-container[data-v-743f3394],.hep-cr-dialog-fade-leave-to .hep-cr-dialog-container[data-v-743f3394]{transform:scale(.95)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hep-code-runner/vue2",
3
- "version": "2.3.9",
3
+ "version": "2.3.11",
4
4
  "description": "Vue 2 code runner component",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -16,10 +16,6 @@
16
16
  "files": [
17
17
  "dist"
18
18
  ],
19
- "scripts": {
20
- "build": "vite build",
21
- "dev": "vite"
22
- },
23
19
  "peerDependencies": {
24
20
  "vue": "^2.6.0 || ^2.7.0"
25
21
  },
@@ -33,7 +29,11 @@
33
29
  "vue": "^2.7.16"
34
30
  },
35
31
  "dependencies": {
36
- "@hep-code-runner/core": "workspace:*",
37
- "prismjs": "^1.30.0"
32
+ "prismjs": "^1.30.0",
33
+ "@hep-code-runner/core": "1.1.4"
34
+ },
35
+ "scripts": {
36
+ "build": "vite build",
37
+ "dev": "vite"
38
38
  }
39
- }
39
+ }