@ylzcc/editor 0.15.0 → 0.17.0

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/editor.es.js CHANGED
@@ -115043,6 +115043,8 @@ function Select(Ff) {
115043
115043
  }
115044
115044
  }
115045
115045
  },
115046
+ rootClassName: "run-code-select-drop",
115047
+ trigger: ["click"],
115046
115048
  disabled: $P,
115047
115049
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "run-code-select", children: [
115048
115050
  eme ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "run-code-select-select", children: typeof eme == "string" ? eme : eme.value }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "run-code-select-placeholder", children: $_ }),
@@ -115163,7 +115165,7 @@ function NodeView(Ff) {
115163
115165
  placeHolder: "选择语言",
115164
115166
  onChange: (gme) => {
115165
115167
  B_({
115166
- language: gme
115168
+ language: typeof gme == "string" ? gme : gme.value
115167
115169
  });
115168
115170
  }
115169
115171
  }
@@ -472,5 +472,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
472
472
  monaco.config({ paths: { vs: '...' } })
473
473
 
474
474
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
475
- `},errorHandler=curry(throwError)(errorMessages),validators={config:validateConfig},compose=function Ff(){for(var kh=arguments.length,x_=new Array(kh),B_=0;B_<kh;B_++)x_[B_]=arguments[B_];return function($_){return x_.reduceRight(function($P,zP){return zP($P)},$_)}};function merge(Ff,kh){return Object.keys(kh).forEach(function(x_){kh[x_]instanceof Object&&Ff[x_]&&Object.assign(kh[x_],merge(Ff[x_],kh[x_]))}),_objectSpread2$1(_objectSpread2$1({},Ff),kh)}var CANCELATION_MESSAGE={type:"cancelation",msg:"operation is manually canceled"};function makeCancelable(Ff){var kh=!1,x_=new Promise(function(B_,$_){Ff.then(function($P){return kh?$_(CANCELATION_MESSAGE):B_($P)}),Ff.catch($_)});return x_.cancel=function(){return kh=!0},x_}var _excluded=["monaco"],_state$create=index.create({config:config$1,isInitialized:!1,resolve:null,reject:null,monaco:null}),_state$create2=_slicedToArray(_state$create,2),getState=_state$create2[0],setState=_state$create2[1];function config(Ff){var kh=validators.config(Ff),x_=kh.monaco,B_=_objectWithoutProperties(kh,_excluded);setState(function($_){return{config:merge($_.config,B_),monaco:x_}})}function init(){var Ff=getState(function(kh){var x_=kh.monaco,B_=kh.isInitialized,$_=kh.resolve;return{monaco:x_,isInitialized:B_,resolve:$_}});if(!Ff.isInitialized){if(setState({isInitialized:!0}),Ff.monaco)return Ff.resolve(Ff.monaco),makeCancelable(wrapperPromise);if(window.monaco&&window.monaco.editor)return storeMonacoInstance(window.monaco),Ff.resolve(window.monaco),makeCancelable(wrapperPromise);compose(injectScripts,getMonacoLoaderScript)(configureLoader)}return makeCancelable(wrapperPromise)}function injectScripts(Ff){return document.body.appendChild(Ff)}function createScript(Ff){var kh=document.createElement("script");return Ff&&(kh.src=Ff),kh}function getMonacoLoaderScript(Ff){var kh=getState(function(B_){var $_=B_.config,$P=B_.reject;return{config:$_,reject:$P}}),x_=createScript("".concat(kh.config.paths.vs,"/loader.js"));return x_.onload=function(){return Ff()},x_.onerror=kh.reject,x_}function configureLoader(){var Ff=getState(function(x_){var B_=x_.config,$_=x_.resolve,$P=x_.reject;return{config:B_,resolve:$_,reject:$P}}),kh=window.require;kh.config(Ff.config),kh(["vs/editor/editor.main"],function(x_){var B_=x_.m||x_;storeMonacoInstance(B_),Ff.resolve(B_)},function(x_){Ff.reject(x_)})}function storeMonacoInstance(Ff){getState().monaco||setState({monaco:Ff})}function __getMonacoInstance(){return getState(function(Ff){var kh=Ff.monaco;return kh})}var wrapperPromise=new Promise(function(Ff,kh){return setState({resolve:Ff,reject:kh})}),loader={config,init,__getMonacoInstance},le={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},v=le,ae={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Y=ae;function Me({children:Ff}){return React.createElement("div",{style:Y.container},Ff)}var Z=Me,$=Z;function Ee({width:Ff,height:kh,isEditorReady:x_,loading:B_,_ref:$_,className:$P,wrapperProps:zP}){return React.createElement("section",{style:{...v.wrapper,width:Ff,height:kh},...zP},!x_&&React.createElement($,null,B_),React.createElement("div",{ref:$_,style:{...v.fullWidth,...!x_&&v.hide},className:$P}))}var ee=Ee,H=React.memo(ee);function Ce(Ff){React.useEffect(Ff,[])}var k=Ce;function he(Ff,kh,x_=!0){let B_=React.useRef(!0);React.useEffect(B_.current||!x_?()=>{B_.current=!1}:Ff,kh)}var l=he;function D(){}function h(Ff,kh,x_,B_){return De(Ff,B_)||be(Ff,kh,x_,B_)}function De(Ff,kh){return Ff.editor.getModel(te(Ff,kh))}function be(Ff,kh,x_,B_){return Ff.editor.createModel(kh,x_,B_?te(Ff,B_):void 0)}function te(Ff,kh){return Ff.Uri.parse(kh)}function Oe({original:Ff,modified:kh,language:x_,originalLanguage:B_,modifiedLanguage:$_,originalModelPath:$P,modifiedModelPath:zP,keepCurrentOriginalModel:eme=!1,keepCurrentModifiedModel:tme=!1,theme:nme="light",loading:rme="Loading...",options:ime={},height:ame="100%",width:ome="100%",className:sme,wrapperProps:cme={},beforeMount:lme=D,onMount:ume=D}){let[dme,fme]=React.useState(!1),[pme,hme]=React.useState(!0),mme=React.useRef(null),_me=React.useRef(null),Eme=React.useRef(null),gme=React.useRef(ume),vme=React.useRef(lme),yme=React.useRef(!1);k(()=>{let Nme=loader.init();return Nme.then(Bme=>(_me.current=Bme)&&hme(!1)).catch(Bme=>(Bme==null?void 0:Bme.type)!=="cancelation"&&console.error("Monaco initialization: error:",Bme)),()=>mme.current?Ome():Nme.cancel()}),l(()=>{if(mme.current&&_me.current){let Nme=mme.current.getOriginalEditor(),Bme=h(_me.current,Ff||"",B_||x_||"text",$P||"");Bme!==Nme.getModel()&&Nme.setModel(Bme)}},[$P],dme),l(()=>{if(mme.current&&_me.current){let Nme=mme.current.getModifiedEditor(),Bme=h(_me.current,kh||"",$_||x_||"text",zP||"");Bme!==Nme.getModel()&&Nme.setModel(Bme)}},[zP],dme),l(()=>{let Nme=mme.current.getModifiedEditor();Nme.getOption(_me.current.editor.EditorOption.readOnly)?Nme.setValue(kh||""):kh!==Nme.getValue()&&(Nme.executeEdits("",[{range:Nme.getModel().getFullModelRange(),text:kh||"",forceMoveMarkers:!0}]),Nme.pushUndoStop())},[kh],dme),l(()=>{var Nme,Bme;(Bme=(Nme=mme.current)==null?void 0:Nme.getModel())==null||Bme.original.setValue(Ff||"")},[Ff],dme),l(()=>{let{original:Nme,modified:Bme}=mme.current.getModel();_me.current.editor.setModelLanguage(Nme,B_||x_||"text"),_me.current.editor.setModelLanguage(Bme,$_||x_||"text")},[x_,B_,$_],dme),l(()=>{var Nme;(Nme=_me.current)==null||Nme.editor.setTheme(nme)},[nme],dme),l(()=>{var Nme;(Nme=mme.current)==null||Nme.updateOptions(ime)},[ime],dme);let Rme=React.useCallback(()=>{var Pme;if(!_me.current)return;vme.current(_me.current);let Nme=h(_me.current,Ff||"",B_||x_||"text",$P||""),Bme=h(_me.current,kh||"",$_||x_||"text",zP||"");(Pme=mme.current)==null||Pme.setModel({original:Nme,modified:Bme})},[x_,kh,$_,Ff,B_,$P,zP]),Ime=React.useCallback(()=>{var Nme;!yme.current&&Eme.current&&(mme.current=_me.current.editor.createDiffEditor(Eme.current,{automaticLayout:!0,...ime}),Rme(),(Nme=_me.current)==null||Nme.editor.setTheme(nme),fme(!0),yme.current=!0)},[ime,nme,Rme]);React.useEffect(()=>{dme&&gme.current(mme.current,_me.current)},[dme]),React.useEffect(()=>{!pme&&!dme&&Ime()},[pme,dme,Ime]);function Ome(){var Bme,Pme,Dme,Vme;let Nme=(Bme=mme.current)==null?void 0:Bme.getModel();eme||((Pme=Nme==null?void 0:Nme.original)==null||Pme.dispose()),tme||((Dme=Nme==null?void 0:Nme.modified)==null||Dme.dispose()),(Vme=mme.current)==null||Vme.dispose()}return React.createElement(H,{width:ome,height:ame,isEditorReady:dme,loading:rme,_ref:Eme,className:sme,wrapperProps:cme})}var ie=Oe;React.memo(ie);function Pe(){let[Ff,kh]=React.useState(loader.__getMonacoInstance());return k(()=>{let x_;return Ff||(x_=loader.init(),x_.then(B_=>{kh(B_)})),()=>x_==null?void 0:x_.cancel()}),Ff}var Le=Pe;function He(Ff){let kh=React.useRef();return React.useEffect(()=>{kh.current=Ff},[Ff]),kh.current}var se=He,_=new Map;function Ve({defaultValue:Ff,defaultLanguage:kh,defaultPath:x_,value:B_,language:$_,path:$P,theme:zP="light",line:eme,loading:tme="Loading...",options:nme={},overrideServices:rme={},saveViewState:ime=!0,keepCurrentModel:ame=!1,width:ome="100%",height:sme="100%",className:cme,wrapperProps:lme={},beforeMount:ume=D,onMount:dme=D,onChange:fme,onValidate:pme=D}){let[hme,mme]=React.useState(!1),[_me,Eme]=React.useState(!0),gme=React.useRef(null),vme=React.useRef(null),yme=React.useRef(null),Rme=React.useRef(dme),Ime=React.useRef(ume),Ome=React.useRef(),Nme=React.useRef(B_),Bme=se($P),Pme=React.useRef(!1),Dme=React.useRef(!1);k(()=>{let Lme=loader.init();return Lme.then(Fme=>(gme.current=Fme)&&Eme(!1)).catch(Fme=>(Fme==null?void 0:Fme.type)!=="cancelation"&&console.error("Monaco initialization: error:",Fme)),()=>vme.current?Ame():Lme.cancel()}),l(()=>{var Fme,Sme,bme,Cme;let Lme=h(gme.current,Ff||B_||"",kh||$_||"",$P||x_||"");Lme!==((Fme=vme.current)==null?void 0:Fme.getModel())&&(ime&&_.set(Bme,(Sme=vme.current)==null?void 0:Sme.saveViewState()),(bme=vme.current)==null||bme.setModel(Lme),ime&&((Cme=vme.current)==null||Cme.restoreViewState(_.get($P))))},[$P],hme),l(()=>{var Lme;(Lme=vme.current)==null||Lme.updateOptions(nme)},[nme],hme),l(()=>{!vme.current||B_===void 0||(vme.current.getOption(gme.current.editor.EditorOption.readOnly)?vme.current.setValue(B_):B_!==vme.current.getValue()&&(Dme.current=!0,vme.current.executeEdits("",[{range:vme.current.getModel().getFullModelRange(),text:B_,forceMoveMarkers:!0}]),vme.current.pushUndoStop(),Dme.current=!1))},[B_],hme),l(()=>{var Fme,Sme;let Lme=(Fme=vme.current)==null?void 0:Fme.getModel();Lme&&$_&&((Sme=gme.current)==null||Sme.editor.setModelLanguage(Lme,$_))},[$_],hme),l(()=>{var Lme;eme!==void 0&&((Lme=vme.current)==null||Lme.revealLine(eme))},[eme],hme),l(()=>{var Lme;(Lme=gme.current)==null||Lme.editor.setTheme(zP)},[zP],hme);let Vme=React.useCallback(()=>{var Lme;if(!(!yme.current||!gme.current)&&!Pme.current){Ime.current(gme.current);let Fme=$P||x_,Sme=h(gme.current,B_||Ff||"",kh||$_||"",Fme||"");vme.current=(Lme=gme.current)==null?void 0:Lme.editor.create(yme.current,{model:Sme,automaticLayout:!0,...nme},rme),ime&&vme.current.restoreViewState(_.get(Fme)),gme.current.editor.setTheme(zP),eme!==void 0&&vme.current.revealLine(eme),mme(!0),Pme.current=!0}},[Ff,kh,x_,B_,$_,$P,nme,rme,ime,zP,eme]);React.useEffect(()=>{hme&&Rme.current(vme.current,gme.current)},[hme]),React.useEffect(()=>{!_me&&!hme&&Vme()},[_me,hme,Vme]),Nme.current=B_,React.useEffect(()=>{var Lme,Fme;hme&&fme&&((Lme=Ome.current)==null||Lme.dispose(),Ome.current=(Fme=vme.current)==null?void 0:Fme.onDidChangeModelContent(Sme=>{Dme.current||fme(vme.current.getValue(),Sme)}))},[hme,fme]),React.useEffect(()=>{if(hme){let Lme=gme.current.editor.onDidChangeMarkers(Fme=>{var bme;let Sme=(bme=vme.current.getModel())==null?void 0:bme.uri;if(Sme&&Fme.find(Cme=>Cme.path===Sme.path)){let Cme=gme.current.editor.getModelMarkers({resource:Sme});pme==null||pme(Cme)}});return()=>{Lme==null||Lme.dispose()}}return()=>{}},[hme,pme]);function Ame(){var Lme,Fme;(Lme=Ome.current)==null||Lme.dispose(),ame?ime&&_.set($P,vme.current.saveViewState()):(Fme=vme.current.getModel())==null||Fme.dispose(),vme.current.dispose()}return React.createElement(H,{width:ome,height:sme,isEditorReady:hme,loading:tme,_ref:yme,className:cme,wrapperProps:lme})}var fe=Ve,de=React.memo(fe),Ft=de;loader.config({paths:{vs:"https://statics.oscollege.net/min/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});function MonacoEditor(Ff){const{value:kh,language:x_="plaintext",style:B_,className:$_,defaultValue:$P,readOnly:zP=!1}=Ff,eme=Le(),tme=(nme,rme)=>{var ime;(ime=Ff.onChange)==null||ime.call(Ff,nme||"",rme)};return React.useEffect(()=>{eme&&(eme.editor.defineTheme("custom",{base:"vs",inherit:!0,rules:[],encodedTokensColors:[],colors:{"editor.background":"#f7f8fa"}}),eme.editor.setTheme("custom"))},[eme]),jsxRuntimeExports.jsx("div",{className:classNames(["run-monaco-editor",$_]),style:B_,children:jsxRuntimeExports.jsx(Ft,{theme:"custom",defaultValue:$P,language:x_,value:kh,loading:jsxRuntimeExports.jsx("span",{style:{color:"#cccccc"},children:"加载中..."}),className:"monaco-editor-container",onChange:tme,onMount:Ff.onMount,options:{fontSize:14,lineHeight:18,readOnly:zP,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollbar:{vertical:"hidden",horizontal:"hidden"},automaticLayout:!0,overviewRulerLanes:0}})})}function Select(Ff){const{options:kh,checked:x_,onChange:B_,placeHolder:$_="请选择",disabled:$P=!1}=Ff,zP=kh==null?void 0:kh.map(rme=>{const ime=typeof rme=="string";return{key:ime?rme:rme.label,label:ime?rme:rme.value}}),[eme,tme]=React.useState(x_);React.useEffect(()=>{tme(x_)},[x_]);const nme=React.useMemo(()=>eme?typeof eme=="string"?[eme]:[eme.label]:[],[eme]);return jsxRuntimeExports.jsx(antd.Dropdown,{menu:{items:zP,selectable:!0,selectedKeys:nme,onSelect:({key:rme})=>{if(typeof(kh==null?void 0:kh[0])=="string")tme(rme),B_==null||B_(rme);else{const ame=kh==null?void 0:kh.find(ome=>ome.label===rme);tme(ame),B_==null||B_(ame)}}},disabled:$P,children:jsxRuntimeExports.jsxs("div",{className:"run-code-select",children:[eme?jsxRuntimeExports.jsx("span",{className:"run-code-select-select",children:typeof eme=="string"?eme:eme.value}):jsxRuntimeExports.jsx("span",{className:"run-code-select-placeholder",children:$_}),jsxRuntimeExports.jsx(DownOutlined$1,{style:{fontSize:16,color:"#cccccc"}})]})})}function TooltipWhite(Ff){const{children:kh,title:x_,placement:B_="bottom",arrow:$_=!1,trigger:$P="hover",rootClassName:zP}=Ff;return jsxRuntimeExports.jsx(antd.Tooltip,{trigger:$P,rootClassName:classNames(["run-code-tooltip",zP]),color:"white",title:x_,placement:B_,arrow:$_,children:kh})}function Btn(Ff){const{icon:kh,onClick:x_,disabled:B_=!1}=Ff;return jsxRuntimeExports.jsx("div",{className:"run-code-btn","data-disabled":B_,onClick:()=>{B_||x_==null||x_()},children:kh})}const useVerticalDrag=(Ff,kh)=>{const x_=React.useRef(!1),B_=React.useRef(0),$_=React.useCallback(eme=>{Ff.current&&(x_.current=!0,B_.current=eme.clientY)},[Ff]),$P=React.useCallback(eme=>{if(!x_.current||!Ff.current)return;const tme=eme.clientY-B_.current;kh(tme),B_.current=eme.clientY},[Ff,kh]),zP=React.useCallback(()=>{Ff.current&&(x_.current=!1)},[Ff]);return React.useEffect(()=>{if(!Ff.current)return;const eme=Ff.current;return eme.addEventListener("mousedown",$_),document.addEventListener("mousemove",$P),document.addEventListener("mouseup",zP),()=>{eme.removeEventListener("mousedown",$_),document.removeEventListener("mousemove",$P),document.removeEventListener("mouseup",zP)}},[Ff,$_,$P,zP]),{isDragging:x_.current}};function NodeView(Ff){const{editor:kh,node:x_,updateAttributes:B_,extension:$_,getPos:$P,deleteNode:zP}=Ff,eme=React.useRef(null),tme=React.useRef(null),nme=React.useRef(null),rme=React.useRef(null),ime=React.useRef(null),ame=React.useRef(!1),[ome,sme]=React.useState([]),[cme,lme]=React.useState(),{language:ume="plaintext"}=x_.attrs,{codePlayerLanguageList:dme=[]}=React.useContext(shareData),fme=React.useMemo(()=>x_.textContent,[x_.textContent]),pme=React.useMemo(()=>kh.isEditable,[kh==null?void 0:kh.isEditable]);useVerticalDrag(eme,gme=>{var vme;tme.current&&(tme.current.style.height=((vme=tme.current)==null?void 0:vme.getBoundingClientRect().height)+gme+"px")}),useVerticalDrag(rme,gme=>{var vme,yme;if(nme.current){nme.current.style.height=((vme=nme.current)==null?void 0:vme.getBoundingClientRect().height)+gme+"px";return}tme.current&&(tme.current.style.height=((yme=tme.current)==null?void 0:yme.getBoundingClientRect().height)+gme+"px")});const hme=gme=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(gme.trim());else{const vme=document.createElement("input");vme.value=gme.trim(),document.body.appendChild(vme),vme.select(),document.execCommand("copy"),document.body.removeChild(vme)}antd.message.success("复制成功")},[mme,_me]=React.useState(),Eme=React.useCallback(async(gme,vme)=>{if(gme.trim()&&$_.options.onCodeExec)try{const yme=await $_.options.onCodeExec({language:vme,code:gme});_me({output:yme});const Rme={key:"result",icon:jsxRuntimeExports.jsx(PlayCircleTwoTone$1,{twoToneColor:["rgb(107,195,72)","transparent"],style:{fontSize:16}}),title:"运行结果"};sme([Rme]),lme(Rme.key)}catch(yme){console.log("error",yme)}},[$P,x_]);return React.useEffect(()=>{if(!kh||!pme)return;const gme=({editor:vme})=>{if(ame.current)return;const{selection:yme}=vme.state,{from:Rme,to:Ime}=yme;if(typeof $P=="function"){const Ome=$P();if(Ome===void 0)return;const Nme=Ome+1,Bme=Ome+x_.nodeSize-1;if(Rme>=Nme&&Ime<=Bme&&ime.current){const Pme=ime.current.getModel();if(!Pme)return;const Dme=Rme-Nme,Vme=Ime-Nme,Ame=Math.max(0,Math.min(Dme,Pme.getValueLength())),Lme=Math.max(0,Math.min(Vme,Pme.getValueLength())),Fme=Pme.getPositionAt(Ame),Sme=Pme.getPositionAt(Lme),bme=ime.current.getSelection();if(bme&&bme.startLineNumber===Fme.lineNumber&&bme.startColumn===Fme.column&&bme.endLineNumber===Sme.lineNumber&&bme.endColumn===Sme.column){ime.current.hasTextFocus()||ime.current.focus();return}ame.current=!0,ime.current.setSelection({startLineNumber:Fme.lineNumber,startColumn:Fme.column,endLineNumber:Sme.lineNumber,endColumn:Sme.column}),ime.current.hasTextFocus()||ime.current.focus(),ame.current=!1}}};return kh.on("selectionUpdate",gme),()=>{kh.off("selectionUpdate",gme)}},[kh,$P,x_,pme]),jsxRuntimeExports.jsx(NodeViewWrapper,{contentEditable:!1,children:jsxRuntimeExports.jsxs("div",{className:"run-code-block",children:[jsxRuntimeExports.jsxs("div",{className:"run-code-block-header center",children:[jsxRuntimeExports.jsx("div",{className:"run-code-block-header-left center",children:jsxRuntimeExports.jsx(Select,{disabled:!pme,options:dme,checked:ume,placeHolder:"选择语言",onChange:gme=>{B_({language:gme})}})}),jsxRuntimeExports.jsxs("div",{className:"run-code-block-header-right center",children:[jsxRuntimeExports.jsx(TooltipWhite,{title:"复制",placement:"top",children:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Btn,{onClick:()=>{hme(x_.textContent||"")},icon:jsxRuntimeExports.jsx(CopyOutlined$1,{style:{fontSize:16,color:"#666666"}})})})}),ume&&$_.options.onCodeExec&&jsxRuntimeExports.jsx(TooltipWhite,{title:"运行",placement:"top",children:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Btn,{onClick:()=>{Eme==null||Eme(x_.textContent||"",ume)},icon:jsxRuntimeExports.jsx(PlayCircleTwoTone$1,{twoToneColor:["#666666","transparent"],style:{fontSize:16}})})})})]})]}),jsxRuntimeExports.jsx("div",{className:"run-code-block-editor",ref:tme,children:jsxRuntimeExports.jsx(MonacoEditor,{readOnly:!pme,defaultValue:fme,language:ume,onChange:(gme,vme)=>{if(pme&&!ame.current&&typeof $P=="function"){const yme=$P();if(yme===void 0)return;const Rme=kh.view.state.tr,Ime=yme+1;vme.changes.forEach(Ome=>{const Nme=Ime+Ome.rangeOffset,Bme=Nme+Ome.rangeLength;Ome.text?Rme.insertText(Ome.text,Nme,Bme):Rme.delete(Nme,Bme)}),ame.current=!0,kh.view.dispatch(Rme),ame.current=!1}},onMount:(gme,vme)=>{ime.current=gme,gme.onKeyDown(yme=>{if(!pme)return;const Rme=(Ime,Ome)=>{const Nme=gme.getSelection();if(!Nme||!Nme.isEmpty())return!1;const{startLineNumber:Bme,startColumn:Pme}=Nme,Dme=gme.getModel();if(!Dme)return!1;const Vme=Dme.getLineCount(),Ame=Bme===1,Lme=Bme===Vme,Fme=Ame&&Pme===1,Sme=Dme.getLineContent(Bme),bme=Lme&&Pme===Sme.length+1;if(Ome<0){if(Ime==="line"){if(!Ame)return!1}else if(!Fme)return!1}else if(Ime==="line"){if(!Lme)return!1}else if(!bme)return!1;if(typeof $P=="function"){const Cme=$P();if(Cme===void 0)return!1;const Tme=kh.state.doc.nodeAt(Cme),wme=Tme?Tme.nodeSize:x_.nodeSize,Mme=Cme+(Ome<0?0:wme),Ume=Selection.near(kh.view.state.doc.resolve(Mme),Ome);return kh.view.dispatch(kh.view.state.tr.setSelection(Ume).scrollIntoView()),kh.view.focus(),!0}return!1};if(yme.keyCode===vme.KeyCode.UpArrow)Rme("line",-1)&&(yme.preventDefault(),yme.stopPropagation());else if(yme.keyCode===vme.KeyCode.DownArrow)Rme("line",1)&&(yme.preventDefault(),yme.stopPropagation());else if(yme.keyCode===vme.KeyCode.LeftArrow)Rme("char",-1)&&(yme.preventDefault(),yme.stopPropagation());else if(yme.keyCode===vme.KeyCode.RightArrow)Rme("char",1)&&(yme.preventDefault(),yme.stopPropagation());else if(yme.keyCode===vme.KeyCode.Backspace||yme.keyCode===vme.KeyCode.Delete){const Ime=gme.getModel();if(Ime&&Ime.getValue()===""){if(typeof $P=="function"){const Ome=$P();if(Ome!==void 0){const Nme=Math.max(1,Ome-1);kh.commands.focus(Nme),zP()}}yme.preventDefault(),yme.stopPropagation()}}else if(yme.keyCode===vme.KeyCode.Enter&&(yme.ctrlKey||yme.metaKey)&&typeof $P=="function"){const Ime=$P();if(Ime!==void 0){const Ome=kh.state.doc.nodeAt(Ime),Nme=Ome?Ome.nodeSize:x_.nodeSize,Bme=kh.state.tr.insert(Ime+Nme,kh.schema.nodes.paragraph.create());kh.view.dispatch(Bme),kh.commands.focus(Ime+Nme+1),yme.preventDefault(),yme.stopPropagation()}}})}})}),ome.length>0&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"run-code-block-line",ref:eme}),jsxRuntimeExports.jsx("div",{className:"run-code-block-tabs",children:ome.map(gme=>jsxRuntimeExports.jsxs("div",{onClick:()=>{lme(gme.key)},className:"run-code-block-tabs-tab center","data-active":gme.key===cme,children:[gme.icon,jsxRuntimeExports.jsx("span",{className:"run-code-block-tabs-tab-title",children:gme.title}),jsxRuntimeExports.jsx(CloseOutlined$1,{onClick:vme=>{var Rme;vme.stopPropagation();const yme=ome.filter(Ime=>Ime.key!==gme.key);sme(yme),gme.key===cme&&lme(((Rme=yme[0])==null?void 0:Rme.key)||void 0)},style:{fontSize:16}})]},gme.key))}),ome.length>0&&jsxRuntimeExports.jsx("div",{className:"run-code-block-result",ref:nme,children:cme==="result"&&(mme==null?void 0:mme.output)})]}),jsxRuntimeExports.jsx("div",{className:"run-code-block-thumb",children:jsxRuntimeExports.jsxs("div",{ref:rme,onClick:gme=>{gme.preventDefault()},children:[jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{})]})})]})})}const backtickInputRegex=/^```([a-z]+)?[\s\n]$/,tildeInputRegex=/^~~~([a-z]+)?[\s\n]$/,RunCodeBlock=Node$1.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{class:"run-code-block"}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:Ff=>{var $P;const{languageClassPrefix:kh}=this.options,$_=[...(($P=Ff.firstElementChild)==null?void 0:$P.classList)||[]].filter(zP=>zP.startsWith(kh)).map(zP=>zP.replace(kh,""))[0];return $_||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:Ff,HTMLAttributes:kh}){return["pre",mergeAttributes(this.options.HTMLAttributes,kh),["code",{class:Ff.attrs.language?this.options.languageClassPrefix+Ff.attrs.language:null},0]]},addNodeView(){return ReactNodeViewRenderer(NodeView)},addCommands(){return{setCodeBlock:Ff=>({commands:kh})=>kh.setNode(this.name,Ff),toggleCodeBlock:Ff=>({commands:kh})=>kh.toggleNode(this.name,"paragraph",Ff)}},addInputRules(){return[textblockTypeInputRule({find:backtickInputRegex,type:this.type,getAttributes:Ff=>({language:Ff[1]})}),textblockTypeInputRule({find:tildeInputRegex,type:this.type,getAttributes:Ff=>({language:Ff[1]})})]},addKeyboardShortcuts(){const Ff=this.name;function kh(x_){return B_=>{const{state:$_,view:$P}=B_.editor,{dispatch:zP}=$P;if($_.selection.empty&&$P.endOfTextblock(x_)){let eme=x_=="left"||x_=="up"?-1:1,tme=$_.selection.$head,nme=Selection.near($_.doc.resolve(eme>0?tme.after():tme.before()),eme);if(nme.$head&&nme.$head.parent.type.name==Ff)return zP($_.tr.setSelection(nme)),!0}return!1}}return{ArrowDown:kh("down"),ArrowUp:kh("up"),ArrowLeft:kh("left"),ArrowRight:kh("right")}},addProseMirrorPlugins(){return[new Plugin({key:new PluginKey("codeBlockVSCodeHandler"),props:{handlePaste:(Ff,kh)=>{if(!kh.clipboardData||this.editor.isActive(this.type.name))return!1;const x_=kh.clipboardData.getData("text/plain"),B_=kh.clipboardData.getData("vscode-editor-data"),$_=B_?JSON.parse(B_):void 0,$P=$_==null?void 0:$_.mode;if(!x_||!$P)return!1;const{tr:zP}=Ff.state;return zP.replaceSelectionWith(this.type.create({language:$P})),zP.setSelection(TextSelection.near(zP.doc.resolve(Math.max(0,zP.selection.from-1)))),zP.insertText(x_.replace(/\r\n?/g,`
475
+ `},errorHandler=curry(throwError)(errorMessages),validators={config:validateConfig},compose=function Ff(){for(var kh=arguments.length,x_=new Array(kh),B_=0;B_<kh;B_++)x_[B_]=arguments[B_];return function($_){return x_.reduceRight(function($P,zP){return zP($P)},$_)}};function merge(Ff,kh){return Object.keys(kh).forEach(function(x_){kh[x_]instanceof Object&&Ff[x_]&&Object.assign(kh[x_],merge(Ff[x_],kh[x_]))}),_objectSpread2$1(_objectSpread2$1({},Ff),kh)}var CANCELATION_MESSAGE={type:"cancelation",msg:"operation is manually canceled"};function makeCancelable(Ff){var kh=!1,x_=new Promise(function(B_,$_){Ff.then(function($P){return kh?$_(CANCELATION_MESSAGE):B_($P)}),Ff.catch($_)});return x_.cancel=function(){return kh=!0},x_}var _excluded=["monaco"],_state$create=index.create({config:config$1,isInitialized:!1,resolve:null,reject:null,monaco:null}),_state$create2=_slicedToArray(_state$create,2),getState=_state$create2[0],setState=_state$create2[1];function config(Ff){var kh=validators.config(Ff),x_=kh.monaco,B_=_objectWithoutProperties(kh,_excluded);setState(function($_){return{config:merge($_.config,B_),monaco:x_}})}function init(){var Ff=getState(function(kh){var x_=kh.monaco,B_=kh.isInitialized,$_=kh.resolve;return{monaco:x_,isInitialized:B_,resolve:$_}});if(!Ff.isInitialized){if(setState({isInitialized:!0}),Ff.monaco)return Ff.resolve(Ff.monaco),makeCancelable(wrapperPromise);if(window.monaco&&window.monaco.editor)return storeMonacoInstance(window.monaco),Ff.resolve(window.monaco),makeCancelable(wrapperPromise);compose(injectScripts,getMonacoLoaderScript)(configureLoader)}return makeCancelable(wrapperPromise)}function injectScripts(Ff){return document.body.appendChild(Ff)}function createScript(Ff){var kh=document.createElement("script");return Ff&&(kh.src=Ff),kh}function getMonacoLoaderScript(Ff){var kh=getState(function(B_){var $_=B_.config,$P=B_.reject;return{config:$_,reject:$P}}),x_=createScript("".concat(kh.config.paths.vs,"/loader.js"));return x_.onload=function(){return Ff()},x_.onerror=kh.reject,x_}function configureLoader(){var Ff=getState(function(x_){var B_=x_.config,$_=x_.resolve,$P=x_.reject;return{config:B_,resolve:$_,reject:$P}}),kh=window.require;kh.config(Ff.config),kh(["vs/editor/editor.main"],function(x_){var B_=x_.m||x_;storeMonacoInstance(B_),Ff.resolve(B_)},function(x_){Ff.reject(x_)})}function storeMonacoInstance(Ff){getState().monaco||setState({monaco:Ff})}function __getMonacoInstance(){return getState(function(Ff){var kh=Ff.monaco;return kh})}var wrapperPromise=new Promise(function(Ff,kh){return setState({resolve:Ff,reject:kh})}),loader={config,init,__getMonacoInstance},le={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},v=le,ae={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Y=ae;function Me({children:Ff}){return React.createElement("div",{style:Y.container},Ff)}var Z=Me,$=Z;function Ee({width:Ff,height:kh,isEditorReady:x_,loading:B_,_ref:$_,className:$P,wrapperProps:zP}){return React.createElement("section",{style:{...v.wrapper,width:Ff,height:kh},...zP},!x_&&React.createElement($,null,B_),React.createElement("div",{ref:$_,style:{...v.fullWidth,...!x_&&v.hide},className:$P}))}var ee=Ee,H=React.memo(ee);function Ce(Ff){React.useEffect(Ff,[])}var k=Ce;function he(Ff,kh,x_=!0){let B_=React.useRef(!0);React.useEffect(B_.current||!x_?()=>{B_.current=!1}:Ff,kh)}var l=he;function D(){}function h(Ff,kh,x_,B_){return De(Ff,B_)||be(Ff,kh,x_,B_)}function De(Ff,kh){return Ff.editor.getModel(te(Ff,kh))}function be(Ff,kh,x_,B_){return Ff.editor.createModel(kh,x_,B_?te(Ff,B_):void 0)}function te(Ff,kh){return Ff.Uri.parse(kh)}function Oe({original:Ff,modified:kh,language:x_,originalLanguage:B_,modifiedLanguage:$_,originalModelPath:$P,modifiedModelPath:zP,keepCurrentOriginalModel:eme=!1,keepCurrentModifiedModel:tme=!1,theme:nme="light",loading:rme="Loading...",options:ime={},height:ame="100%",width:ome="100%",className:sme,wrapperProps:cme={},beforeMount:lme=D,onMount:ume=D}){let[dme,fme]=React.useState(!1),[pme,hme]=React.useState(!0),mme=React.useRef(null),_me=React.useRef(null),Eme=React.useRef(null),gme=React.useRef(ume),vme=React.useRef(lme),yme=React.useRef(!1);k(()=>{let Nme=loader.init();return Nme.then(Bme=>(_me.current=Bme)&&hme(!1)).catch(Bme=>(Bme==null?void 0:Bme.type)!=="cancelation"&&console.error("Monaco initialization: error:",Bme)),()=>mme.current?Ome():Nme.cancel()}),l(()=>{if(mme.current&&_me.current){let Nme=mme.current.getOriginalEditor(),Bme=h(_me.current,Ff||"",B_||x_||"text",$P||"");Bme!==Nme.getModel()&&Nme.setModel(Bme)}},[$P],dme),l(()=>{if(mme.current&&_me.current){let Nme=mme.current.getModifiedEditor(),Bme=h(_me.current,kh||"",$_||x_||"text",zP||"");Bme!==Nme.getModel()&&Nme.setModel(Bme)}},[zP],dme),l(()=>{let Nme=mme.current.getModifiedEditor();Nme.getOption(_me.current.editor.EditorOption.readOnly)?Nme.setValue(kh||""):kh!==Nme.getValue()&&(Nme.executeEdits("",[{range:Nme.getModel().getFullModelRange(),text:kh||"",forceMoveMarkers:!0}]),Nme.pushUndoStop())},[kh],dme),l(()=>{var Nme,Bme;(Bme=(Nme=mme.current)==null?void 0:Nme.getModel())==null||Bme.original.setValue(Ff||"")},[Ff],dme),l(()=>{let{original:Nme,modified:Bme}=mme.current.getModel();_me.current.editor.setModelLanguage(Nme,B_||x_||"text"),_me.current.editor.setModelLanguage(Bme,$_||x_||"text")},[x_,B_,$_],dme),l(()=>{var Nme;(Nme=_me.current)==null||Nme.editor.setTheme(nme)},[nme],dme),l(()=>{var Nme;(Nme=mme.current)==null||Nme.updateOptions(ime)},[ime],dme);let Rme=React.useCallback(()=>{var Pme;if(!_me.current)return;vme.current(_me.current);let Nme=h(_me.current,Ff||"",B_||x_||"text",$P||""),Bme=h(_me.current,kh||"",$_||x_||"text",zP||"");(Pme=mme.current)==null||Pme.setModel({original:Nme,modified:Bme})},[x_,kh,$_,Ff,B_,$P,zP]),Ime=React.useCallback(()=>{var Nme;!yme.current&&Eme.current&&(mme.current=_me.current.editor.createDiffEditor(Eme.current,{automaticLayout:!0,...ime}),Rme(),(Nme=_me.current)==null||Nme.editor.setTheme(nme),fme(!0),yme.current=!0)},[ime,nme,Rme]);React.useEffect(()=>{dme&&gme.current(mme.current,_me.current)},[dme]),React.useEffect(()=>{!pme&&!dme&&Ime()},[pme,dme,Ime]);function Ome(){var Bme,Pme,Dme,Vme;let Nme=(Bme=mme.current)==null?void 0:Bme.getModel();eme||((Pme=Nme==null?void 0:Nme.original)==null||Pme.dispose()),tme||((Dme=Nme==null?void 0:Nme.modified)==null||Dme.dispose()),(Vme=mme.current)==null||Vme.dispose()}return React.createElement(H,{width:ome,height:ame,isEditorReady:dme,loading:rme,_ref:Eme,className:sme,wrapperProps:cme})}var ie=Oe;React.memo(ie);function Pe(){let[Ff,kh]=React.useState(loader.__getMonacoInstance());return k(()=>{let x_;return Ff||(x_=loader.init(),x_.then(B_=>{kh(B_)})),()=>x_==null?void 0:x_.cancel()}),Ff}var Le=Pe;function He(Ff){let kh=React.useRef();return React.useEffect(()=>{kh.current=Ff},[Ff]),kh.current}var se=He,_=new Map;function Ve({defaultValue:Ff,defaultLanguage:kh,defaultPath:x_,value:B_,language:$_,path:$P,theme:zP="light",line:eme,loading:tme="Loading...",options:nme={},overrideServices:rme={},saveViewState:ime=!0,keepCurrentModel:ame=!1,width:ome="100%",height:sme="100%",className:cme,wrapperProps:lme={},beforeMount:ume=D,onMount:dme=D,onChange:fme,onValidate:pme=D}){let[hme,mme]=React.useState(!1),[_me,Eme]=React.useState(!0),gme=React.useRef(null),vme=React.useRef(null),yme=React.useRef(null),Rme=React.useRef(dme),Ime=React.useRef(ume),Ome=React.useRef(),Nme=React.useRef(B_),Bme=se($P),Pme=React.useRef(!1),Dme=React.useRef(!1);k(()=>{let Lme=loader.init();return Lme.then(Fme=>(gme.current=Fme)&&Eme(!1)).catch(Fme=>(Fme==null?void 0:Fme.type)!=="cancelation"&&console.error("Monaco initialization: error:",Fme)),()=>vme.current?Ame():Lme.cancel()}),l(()=>{var Fme,Sme,bme,Cme;let Lme=h(gme.current,Ff||B_||"",kh||$_||"",$P||x_||"");Lme!==((Fme=vme.current)==null?void 0:Fme.getModel())&&(ime&&_.set(Bme,(Sme=vme.current)==null?void 0:Sme.saveViewState()),(bme=vme.current)==null||bme.setModel(Lme),ime&&((Cme=vme.current)==null||Cme.restoreViewState(_.get($P))))},[$P],hme),l(()=>{var Lme;(Lme=vme.current)==null||Lme.updateOptions(nme)},[nme],hme),l(()=>{!vme.current||B_===void 0||(vme.current.getOption(gme.current.editor.EditorOption.readOnly)?vme.current.setValue(B_):B_!==vme.current.getValue()&&(Dme.current=!0,vme.current.executeEdits("",[{range:vme.current.getModel().getFullModelRange(),text:B_,forceMoveMarkers:!0}]),vme.current.pushUndoStop(),Dme.current=!1))},[B_],hme),l(()=>{var Fme,Sme;let Lme=(Fme=vme.current)==null?void 0:Fme.getModel();Lme&&$_&&((Sme=gme.current)==null||Sme.editor.setModelLanguage(Lme,$_))},[$_],hme),l(()=>{var Lme;eme!==void 0&&((Lme=vme.current)==null||Lme.revealLine(eme))},[eme],hme),l(()=>{var Lme;(Lme=gme.current)==null||Lme.editor.setTheme(zP)},[zP],hme);let Vme=React.useCallback(()=>{var Lme;if(!(!yme.current||!gme.current)&&!Pme.current){Ime.current(gme.current);let Fme=$P||x_,Sme=h(gme.current,B_||Ff||"",kh||$_||"",Fme||"");vme.current=(Lme=gme.current)==null?void 0:Lme.editor.create(yme.current,{model:Sme,automaticLayout:!0,...nme},rme),ime&&vme.current.restoreViewState(_.get(Fme)),gme.current.editor.setTheme(zP),eme!==void 0&&vme.current.revealLine(eme),mme(!0),Pme.current=!0}},[Ff,kh,x_,B_,$_,$P,nme,rme,ime,zP,eme]);React.useEffect(()=>{hme&&Rme.current(vme.current,gme.current)},[hme]),React.useEffect(()=>{!_me&&!hme&&Vme()},[_me,hme,Vme]),Nme.current=B_,React.useEffect(()=>{var Lme,Fme;hme&&fme&&((Lme=Ome.current)==null||Lme.dispose(),Ome.current=(Fme=vme.current)==null?void 0:Fme.onDidChangeModelContent(Sme=>{Dme.current||fme(vme.current.getValue(),Sme)}))},[hme,fme]),React.useEffect(()=>{if(hme){let Lme=gme.current.editor.onDidChangeMarkers(Fme=>{var bme;let Sme=(bme=vme.current.getModel())==null?void 0:bme.uri;if(Sme&&Fme.find(Cme=>Cme.path===Sme.path)){let Cme=gme.current.editor.getModelMarkers({resource:Sme});pme==null||pme(Cme)}});return()=>{Lme==null||Lme.dispose()}}return()=>{}},[hme,pme]);function Ame(){var Lme,Fme;(Lme=Ome.current)==null||Lme.dispose(),ame?ime&&_.set($P,vme.current.saveViewState()):(Fme=vme.current.getModel())==null||Fme.dispose(),vme.current.dispose()}return React.createElement(H,{width:ome,height:sme,isEditorReady:hme,loading:tme,_ref:yme,className:cme,wrapperProps:lme})}var fe=Ve,de=React.memo(fe),Ft=de;loader.config({paths:{vs:"https://statics.oscollege.net/min/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});function MonacoEditor(Ff){const{value:kh,language:x_="plaintext",style:B_,className:$_,defaultValue:$P,readOnly:zP=!1}=Ff,eme=Le(),tme=(nme,rme)=>{var ime;(ime=Ff.onChange)==null||ime.call(Ff,nme||"",rme)};return React.useEffect(()=>{eme&&(eme.editor.defineTheme("custom",{base:"vs",inherit:!0,rules:[],encodedTokensColors:[],colors:{"editor.background":"#f7f8fa"}}),eme.editor.setTheme("custom"))},[eme]),jsxRuntimeExports.jsx("div",{className:classNames(["run-monaco-editor",$_]),style:B_,children:jsxRuntimeExports.jsx(Ft,{theme:"custom",defaultValue:$P,language:x_,value:kh,loading:jsxRuntimeExports.jsx("span",{style:{color:"#cccccc"},children:"加载中..."}),className:"monaco-editor-container",onChange:tme,onMount:Ff.onMount,options:{fontSize:14,lineHeight:18,readOnly:zP,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollbar:{vertical:"hidden",horizontal:"hidden"},automaticLayout:!0,overviewRulerLanes:0}})})}function Select(Ff){const{options:kh,checked:x_,onChange:B_,placeHolder:$_="请选择",disabled:$P=!1}=Ff,zP=kh==null?void 0:kh.map(rme=>{const ime=typeof rme=="string";return{key:ime?rme:rme.label,label:ime?rme:rme.value}}),[eme,tme]=React.useState(x_);React.useEffect(()=>{tme(x_)},[x_]);const nme=React.useMemo(()=>eme?typeof eme=="string"?[eme]:[eme.label]:[],[eme]);return jsxRuntimeExports.jsx(antd.Dropdown,{menu:{items:zP,selectable:!0,selectedKeys:nme,onSelect:({key:rme})=>{if(typeof(kh==null?void 0:kh[0])=="string")tme(rme),B_==null||B_(rme);else{const ame=kh==null?void 0:kh.find(ome=>ome.label===rme);tme(ame),B_==null||B_(ame)}}},rootClassName:"run-code-select-drop",trigger:["click"],disabled:$P,children:jsxRuntimeExports.jsxs("div",{className:"run-code-select",children:[eme?jsxRuntimeExports.jsx("span",{className:"run-code-select-select",children:typeof eme=="string"?eme:eme.value}):jsxRuntimeExports.jsx("span",{className:"run-code-select-placeholder",children:$_}),jsxRuntimeExports.jsx(DownOutlined$1,{style:{fontSize:16,color:"#cccccc"}})]})})}function TooltipWhite(Ff){const{children:kh,title:x_,placement:B_="bottom",arrow:$_=!1,trigger:$P="hover",rootClassName:zP}=Ff;return jsxRuntimeExports.jsx(antd.Tooltip,{trigger:$P,rootClassName:classNames(["run-code-tooltip",zP]),color:"white",title:x_,placement:B_,arrow:$_,children:kh})}function Btn(Ff){const{icon:kh,onClick:x_,disabled:B_=!1}=Ff;return jsxRuntimeExports.jsx("div",{className:"run-code-btn","data-disabled":B_,onClick:()=>{B_||x_==null||x_()},children:kh})}const useVerticalDrag=(Ff,kh)=>{const x_=React.useRef(!1),B_=React.useRef(0),$_=React.useCallback(eme=>{Ff.current&&(x_.current=!0,B_.current=eme.clientY)},[Ff]),$P=React.useCallback(eme=>{if(!x_.current||!Ff.current)return;const tme=eme.clientY-B_.current;kh(tme),B_.current=eme.clientY},[Ff,kh]),zP=React.useCallback(()=>{Ff.current&&(x_.current=!1)},[Ff]);return React.useEffect(()=>{if(!Ff.current)return;const eme=Ff.current;return eme.addEventListener("mousedown",$_),document.addEventListener("mousemove",$P),document.addEventListener("mouseup",zP),()=>{eme.removeEventListener("mousedown",$_),document.removeEventListener("mousemove",$P),document.removeEventListener("mouseup",zP)}},[Ff,$_,$P,zP]),{isDragging:x_.current}};function NodeView(Ff){const{editor:kh,node:x_,updateAttributes:B_,extension:$_,getPos:$P,deleteNode:zP}=Ff,eme=React.useRef(null),tme=React.useRef(null),nme=React.useRef(null),rme=React.useRef(null),ime=React.useRef(null),ame=React.useRef(!1),[ome,sme]=React.useState([]),[cme,lme]=React.useState(),{language:ume="plaintext"}=x_.attrs,{codePlayerLanguageList:dme=[]}=React.useContext(shareData),fme=React.useMemo(()=>x_.textContent,[x_.textContent]),pme=React.useMemo(()=>kh.isEditable,[kh==null?void 0:kh.isEditable]);useVerticalDrag(eme,gme=>{var vme;tme.current&&(tme.current.style.height=((vme=tme.current)==null?void 0:vme.getBoundingClientRect().height)+gme+"px")}),useVerticalDrag(rme,gme=>{var vme,yme;if(nme.current){nme.current.style.height=((vme=nme.current)==null?void 0:vme.getBoundingClientRect().height)+gme+"px";return}tme.current&&(tme.current.style.height=((yme=tme.current)==null?void 0:yme.getBoundingClientRect().height)+gme+"px")});const hme=gme=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(gme.trim());else{const vme=document.createElement("input");vme.value=gme.trim(),document.body.appendChild(vme),vme.select(),document.execCommand("copy"),document.body.removeChild(vme)}antd.message.success("复制成功")},[mme,_me]=React.useState(),Eme=React.useCallback(async(gme,vme)=>{if(gme.trim()&&$_.options.onCodeExec)try{const yme=await $_.options.onCodeExec({language:vme,code:gme});_me({output:yme});const Rme={key:"result",icon:jsxRuntimeExports.jsx(PlayCircleTwoTone$1,{twoToneColor:["rgb(107,195,72)","transparent"],style:{fontSize:16}}),title:"运行结果"};sme([Rme]),lme(Rme.key)}catch(yme){console.log("error",yme)}},[$P,x_]);return React.useEffect(()=>{if(!kh||!pme)return;const gme=({editor:vme})=>{if(ame.current)return;const{selection:yme}=vme.state,{from:Rme,to:Ime}=yme;if(typeof $P=="function"){const Ome=$P();if(Ome===void 0)return;const Nme=Ome+1,Bme=Ome+x_.nodeSize-1;if(Rme>=Nme&&Ime<=Bme&&ime.current){const Pme=ime.current.getModel();if(!Pme)return;const Dme=Rme-Nme,Vme=Ime-Nme,Ame=Math.max(0,Math.min(Dme,Pme.getValueLength())),Lme=Math.max(0,Math.min(Vme,Pme.getValueLength())),Fme=Pme.getPositionAt(Ame),Sme=Pme.getPositionAt(Lme),bme=ime.current.getSelection();if(bme&&bme.startLineNumber===Fme.lineNumber&&bme.startColumn===Fme.column&&bme.endLineNumber===Sme.lineNumber&&bme.endColumn===Sme.column){ime.current.hasTextFocus()||ime.current.focus();return}ame.current=!0,ime.current.setSelection({startLineNumber:Fme.lineNumber,startColumn:Fme.column,endLineNumber:Sme.lineNumber,endColumn:Sme.column}),ime.current.hasTextFocus()||ime.current.focus(),ame.current=!1}}};return kh.on("selectionUpdate",gme),()=>{kh.off("selectionUpdate",gme)}},[kh,$P,x_,pme]),jsxRuntimeExports.jsx(NodeViewWrapper,{contentEditable:!1,children:jsxRuntimeExports.jsxs("div",{className:"run-code-block",children:[jsxRuntimeExports.jsxs("div",{className:"run-code-block-header center",children:[jsxRuntimeExports.jsx("div",{className:"run-code-block-header-left center",children:jsxRuntimeExports.jsx(Select,{disabled:!pme,options:dme,checked:ume,placeHolder:"选择语言",onChange:gme=>{B_({language:typeof gme=="string"?gme:gme.value})}})}),jsxRuntimeExports.jsxs("div",{className:"run-code-block-header-right center",children:[jsxRuntimeExports.jsx(TooltipWhite,{title:"复制",placement:"top",children:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Btn,{onClick:()=>{hme(x_.textContent||"")},icon:jsxRuntimeExports.jsx(CopyOutlined$1,{style:{fontSize:16,color:"#666666"}})})})}),ume&&$_.options.onCodeExec&&jsxRuntimeExports.jsx(TooltipWhite,{title:"运行",placement:"top",children:jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx(Btn,{onClick:()=>{Eme==null||Eme(x_.textContent||"",ume)},icon:jsxRuntimeExports.jsx(PlayCircleTwoTone$1,{twoToneColor:["#666666","transparent"],style:{fontSize:16}})})})})]})]}),jsxRuntimeExports.jsx("div",{className:"run-code-block-editor",ref:tme,children:jsxRuntimeExports.jsx(MonacoEditor,{readOnly:!pme,defaultValue:fme,language:ume,onChange:(gme,vme)=>{if(pme&&!ame.current&&typeof $P=="function"){const yme=$P();if(yme===void 0)return;const Rme=kh.view.state.tr,Ime=yme+1;vme.changes.forEach(Ome=>{const Nme=Ime+Ome.rangeOffset,Bme=Nme+Ome.rangeLength;Ome.text?Rme.insertText(Ome.text,Nme,Bme):Rme.delete(Nme,Bme)}),ame.current=!0,kh.view.dispatch(Rme),ame.current=!1}},onMount:(gme,vme)=>{ime.current=gme,gme.onKeyDown(yme=>{if(!pme)return;const Rme=(Ime,Ome)=>{const Nme=gme.getSelection();if(!Nme||!Nme.isEmpty())return!1;const{startLineNumber:Bme,startColumn:Pme}=Nme,Dme=gme.getModel();if(!Dme)return!1;const Vme=Dme.getLineCount(),Ame=Bme===1,Lme=Bme===Vme,Fme=Ame&&Pme===1,Sme=Dme.getLineContent(Bme),bme=Lme&&Pme===Sme.length+1;if(Ome<0){if(Ime==="line"){if(!Ame)return!1}else if(!Fme)return!1}else if(Ime==="line"){if(!Lme)return!1}else if(!bme)return!1;if(typeof $P=="function"){const Cme=$P();if(Cme===void 0)return!1;const Tme=kh.state.doc.nodeAt(Cme),wme=Tme?Tme.nodeSize:x_.nodeSize,Mme=Cme+(Ome<0?0:wme),Ume=Selection.near(kh.view.state.doc.resolve(Mme),Ome);return kh.view.dispatch(kh.view.state.tr.setSelection(Ume).scrollIntoView()),kh.view.focus(),!0}return!1};if(yme.keyCode===vme.KeyCode.UpArrow)Rme("line",-1)&&(yme.preventDefault(),yme.stopPropagation());else if(yme.keyCode===vme.KeyCode.DownArrow)Rme("line",1)&&(yme.preventDefault(),yme.stopPropagation());else if(yme.keyCode===vme.KeyCode.LeftArrow)Rme("char",-1)&&(yme.preventDefault(),yme.stopPropagation());else if(yme.keyCode===vme.KeyCode.RightArrow)Rme("char",1)&&(yme.preventDefault(),yme.stopPropagation());else if(yme.keyCode===vme.KeyCode.Backspace||yme.keyCode===vme.KeyCode.Delete){const Ime=gme.getModel();if(Ime&&Ime.getValue()===""){if(typeof $P=="function"){const Ome=$P();if(Ome!==void 0){const Nme=Math.max(1,Ome-1);kh.commands.focus(Nme),zP()}}yme.preventDefault(),yme.stopPropagation()}}else if(yme.keyCode===vme.KeyCode.Enter&&(yme.ctrlKey||yme.metaKey)&&typeof $P=="function"){const Ime=$P();if(Ime!==void 0){const Ome=kh.state.doc.nodeAt(Ime),Nme=Ome?Ome.nodeSize:x_.nodeSize,Bme=kh.state.tr.insert(Ime+Nme,kh.schema.nodes.paragraph.create());kh.view.dispatch(Bme),kh.commands.focus(Ime+Nme+1),yme.preventDefault(),yme.stopPropagation()}}})}})}),ome.length>0&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{className:"run-code-block-line",ref:eme}),jsxRuntimeExports.jsx("div",{className:"run-code-block-tabs",children:ome.map(gme=>jsxRuntimeExports.jsxs("div",{onClick:()=>{lme(gme.key)},className:"run-code-block-tabs-tab center","data-active":gme.key===cme,children:[gme.icon,jsxRuntimeExports.jsx("span",{className:"run-code-block-tabs-tab-title",children:gme.title}),jsxRuntimeExports.jsx(CloseOutlined$1,{onClick:vme=>{var Rme;vme.stopPropagation();const yme=ome.filter(Ime=>Ime.key!==gme.key);sme(yme),gme.key===cme&&lme(((Rme=yme[0])==null?void 0:Rme.key)||void 0)},style:{fontSize:16}})]},gme.key))}),ome.length>0&&jsxRuntimeExports.jsx("div",{className:"run-code-block-result",ref:nme,children:cme==="result"&&(mme==null?void 0:mme.output)})]}),jsxRuntimeExports.jsx("div",{className:"run-code-block-thumb",children:jsxRuntimeExports.jsxs("div",{ref:rme,onClick:gme=>{gme.preventDefault()},children:[jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{})]})})]})})}const backtickInputRegex=/^```([a-z]+)?[\s\n]$/,tildeInputRegex=/^~~~([a-z]+)?[\s\n]$/,RunCodeBlock=Node$1.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{class:"run-code-block"}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:Ff=>{var $P;const{languageClassPrefix:kh}=this.options,$_=[...(($P=Ff.firstElementChild)==null?void 0:$P.classList)||[]].filter(zP=>zP.startsWith(kh)).map(zP=>zP.replace(kh,""))[0];return $_||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:Ff,HTMLAttributes:kh}){return["pre",mergeAttributes(this.options.HTMLAttributes,kh),["code",{class:Ff.attrs.language?this.options.languageClassPrefix+Ff.attrs.language:null},0]]},addNodeView(){return ReactNodeViewRenderer(NodeView)},addCommands(){return{setCodeBlock:Ff=>({commands:kh})=>kh.setNode(this.name,Ff),toggleCodeBlock:Ff=>({commands:kh})=>kh.toggleNode(this.name,"paragraph",Ff)}},addInputRules(){return[textblockTypeInputRule({find:backtickInputRegex,type:this.type,getAttributes:Ff=>({language:Ff[1]})}),textblockTypeInputRule({find:tildeInputRegex,type:this.type,getAttributes:Ff=>({language:Ff[1]})})]},addKeyboardShortcuts(){const Ff=this.name;function kh(x_){return B_=>{const{state:$_,view:$P}=B_.editor,{dispatch:zP}=$P;if($_.selection.empty&&$P.endOfTextblock(x_)){let eme=x_=="left"||x_=="up"?-1:1,tme=$_.selection.$head,nme=Selection.near($_.doc.resolve(eme>0?tme.after():tme.before()),eme);if(nme.$head&&nme.$head.parent.type.name==Ff)return zP($_.tr.setSelection(nme)),!0}return!1}}return{ArrowDown:kh("down"),ArrowUp:kh("up"),ArrowLeft:kh("left"),ArrowRight:kh("right")}},addProseMirrorPlugins(){return[new Plugin({key:new PluginKey("codeBlockVSCodeHandler"),props:{handlePaste:(Ff,kh)=>{if(!kh.clipboardData||this.editor.isActive(this.type.name))return!1;const x_=kh.clipboardData.getData("text/plain"),B_=kh.clipboardData.getData("vscode-editor-data"),$_=B_?JSON.parse(B_):void 0,$P=$_==null?void 0:$_.mode;if(!x_||!$P)return!1;const{tr:zP}=Ff.state;return zP.replaceSelectionWith(this.type.create({language:$P})),zP.setSelection(TextSelection.near(zP.doc.resolve(Math.max(0,zP.selection.from-1)))),zP.insertText(x_.replace(/\r\n?/g,`
476
476
  `)),zP.setMeta("paste",!0),Ff.dispatch(zP),!0}}})]}}),{BubbleMenu,BubbleMenuView}=bubbleModules;let Editor=(Ff,kh)=>{var L_e,qme;const{showTitle:x_=!0,showCatalogue:B_=!0,editable:$_=!0,apiUrl:$P="https://openapi-test.oscollege.net",wsUrl:zP,templateInfo:eme,markdownText:tme,setHeader:nme,title:rme,titleOnChange:ime,titleEditable:ame=!0,onExec:ome,onCodeExec:sme,onBack:cme,finish:lme,reportData:ume,getActivity:dme,removeActivity:fme,updateActivity:pme,submitActivity:hme,codePlayerConnect:mme,xternUrl:_me,codePlayerLanguageList:Eme,showTemplate:gme,imageOnClick:vme,disableCopy:yme=!1}=Ff,[Rme,Ime]=React.useState(_me);React.useEffect(()=>{Ime(_me)},[_me]);const[Ome,Nme]=React.useState(),[Bme,Pme]=React.useState(),Dme=useEditor({content:{type:"document",content:[{type:"title",content:rme?[{type:"text",text:rme}]:[]},{type:"paragraph"}]},extensions:[HardBreak,HorizontalRule,BulletList,OrderedList,ListItem$2,Table.configure({resizable:$_}),TableRow,TableHeader,TableCell,Blockquote,Heading,Document$3,Title.configure({onChange:Wme=>{ime==null||ime(Wme)},titleEditable:ame}),Paragraph,Text$1,Code.configure({HTMLAttributes:{class:"inline-code"}}),Bold,Italic,Strike,Underline,Subscript,Superscript,Placeholder,TextStyle$2,History,Link.configure({openOnClick:!0}),Color.configure({types:["textStyle"]}),TextAlign.configure({types:["title","heading","paragraph","image"]}),BubbleMenu.configure({component:BubbleMenuView}),FloatingMenu,Image$1.configure({oss:$P,onClick(Wme){vme==null||vme(Wme)}}),RunCodeBlock.configure({onCodeExec:sme}),Active.configure({reportData:Wme=>{ume==null||ume(Wme)},getActivity:dme,removeActivity:fme,updateActivity:pme,submitActivity:hme,codePlayerConnect:mme,onExec:Wme=>{ome==null||ome(Wme)}}),PdfView.extend({addNodeView(){return ReactNodeViewRenderer(PdfViewShow)}}),Slash,Fragment]},[]),[Vme,Ame]=React.useState(!0),[Lme,Fme]=React.useState(!1),[Sme,bme]=React.useState(!0),[Cme,Tme]=React.useState(),[wme,Mme]=React.useState(!1),[Ume,jme]=React.useState(void 0),[Hme,zme]=React.useState(void 0),[e_e,Qme]=React.useState(!0),[a_e,S_e]=React.useState(),[p_e,I_e]=React.useState(),[O_e,D_e]=React.useState(!0),R_e=()=>{try{Cme&&(Cme==null?void 0:Cme.readyState)===1&&(Cme==null||Cme.close(4999));const Wme=new WebSocket(zP);Tme(Wme),Mme(!1),Wme.onmessage=function(d_e){const{data:y_e}=d_e;try{const x_e=JSON.parse(y_e),M_e=x_e==null?void 0:x_e.type,N_e=x_e==null?void 0:x_e.data;if(M_e==="read")if(N_e)try{const l_e=base64ToText(N_e);Nme(l_e);const t_e=markdownToJson(l_e);Pme(t_e);const n_e=toEditorJSON(t_e);jme(n_e)}catch{__e()}else jme("")}catch(x_e){console.log(x_e)}},Wme.onclose=function(d_e){const y_e=d_e.code;y_e<3e3&&y_e!==1005&&Mme(!0)}}catch(Wme){console.log(Wme)}},__e=()=>{antd.Modal.confirm({title:"切换失败!",icon:jsxRuntimeExports.jsx(ExclamationCircleFilled$1,{}),content:"因数据格式存在不兼容问题,本次切换失败,若选择留在当前编辑器,数据将会丢失,请谨慎操作。",cancelText:"留在当前",okText:"返回原编辑器",onOk(){cme==null||cme()},onCancel(){jme("")}})};React.useEffect(()=>{var Wme,d_e,y_e,x_e,M_e;if(tme&&nme)if((d_e=(Wme=Dme==null?void 0:Dme.view)==null?void 0:Wme.docView)!=null&&d_e.children){const N_e=(x_e=(y_e=Dme==null?void 0:Dme.view)==null?void 0:y_e.docView)==null?void 0:x_e.children;if(!N_e){nme([]);return}const l_e=(M_e=N_e==null?void 0:N_e.filter(t_e=>{var n_e,Kme;return((Kme=(n_e=t_e==null?void 0:t_e.node)==null?void 0:n_e.type)==null?void 0:Kme.name)==="heading"}))==null?void 0:M_e.map(t_e=>{var n_e,Kme,T_e,A_e;return{from:t_e==null?void 0:t_e.posAtStart,to:t_e==null?void 0:t_e.posAtEnd,text:(n_e=t_e==null?void 0:t_e.node)==null?void 0:n_e.textContent,level:(T_e=(Kme=t_e==null?void 0:t_e.node)==null?void 0:Kme.attrs)==null?void 0:T_e.level,id:(A_e=t_e==null?void 0:t_e.nodeDOM)==null?void 0:A_e.id}});nme(l_e)}else nme([])},[(qme=(L_e=Dme==null?void 0:Dme.view)==null?void 0:L_e.docView)==null?void 0:qme.children,tme]),React.useEffect(()=>{if(wme){const Wme=setTimeout(()=>{clearTimeout(Wme),R_e()},1e3)}},[wme]),React.useEffect(()=>()=>{Cme&&(Cme==null?void 0:Cme.readyState)===1&&(Cme==null||Cme.close(4999))},[Cme]),React.useEffect(()=>(zP&&(jme(void 0),Qme(!0),R_e()),()=>{Qme(!0),Fme(!1)}),[zP]);const u_e=React.useCallback(()=>{zme(Dme==null?void 0:Dme.getJSON())},[Dme]);React.useEffect(()=>{if(Hme!==void 0){a_e&&clearTimeout(a_e);const Wme=setTimeout(()=>{var M_e;let d_e=Hme;d_e={...d_e,content:(M_e=d_e==null?void 0:d_e.content)==null?void 0:M_e.filter(N_e=>(N_e==null?void 0:N_e.type)!=="title")};const y_e=toMarkdownJson(d_e),x_e=jsonToMarkdown(y_e);if(Nme(x_e),(Cme==null?void 0:Cme.readyState)===1){const N_e=x_e?textToBase64(x_e):"";Cme==null||Cme.send(JSON.stringify({type:"write",data:N_e}))}clearTimeout(Wme),S_e("")},500);S_e(Wme)}},[Hme]),React.useEffect(()=>(Dme&&!e_e&&(Dme==null||Dme.on("update",u_e)),()=>{Dme&&(Dme==null||Dme.off("update",u_e))}),[Dme,e_e]),React.useEffect(()=>{let Wme=null;return Dme&&Ume!==void 0&&e_e&&(Wme=setTimeout(()=>{if(x_){const d_e={type:"title",content:rme?[{type:"text",text:rme}]:[]},y_e=Ume?{...Ume,content:Ume!=null&&Ume.content?[d_e,...Ume.content]:[d_e]}:{type:"document",content:[d_e]};Dme.commands.setContent(y_e)}else Dme.commands.setContent(Ume);Qme(!1),Fme(!0)},0)),()=>{Wme&&clearTimeout(Wme)}},[Ume,Dme,e_e,rme,x_]),React.useEffect(()=>{Dme&&Dme.setEditable($_)},[Dme,$_]);const s_e=React.useRef(null);React.useEffect(()=>{const Wme=new ResizeObserver(d_e=>{for(const y_e of d_e)y_e.contentRect.width<700?bme(!1):bme(!0)});return s_e!=null&&s_e.current&&Wme.observe(s_e==null?void 0:s_e.current),()=>{s_e!=null&&s_e.current&&Wme.unobserve(s_e==null?void 0:s_e.current)}},[]),React.useEffect(()=>{const Wme=d_e=>{var y_e,x_e,M_e,N_e,l_e;if(((y_e=d_e==null?void 0:d_e.data)==null?void 0:y_e.type)==="sectionChange"){const t_e=(M_e=(x_e=d_e==null?void 0:d_e.data)==null?void 0:x_e.value)==null?void 0:M_e.template;t_e!=null&&t_e.experEnv?I_e(t_e):I_e("")}else((N_e=d_e==null?void 0:d_e.data)==null?void 0:N_e.type)==="permit-available"&&D_e((l_e=d_e==null?void 0:d_e.data)==null?void 0:l_e.value)};return window.addEventListener("message",Wme),()=>{window.removeEventListener("message",Wme)}},[Dme]),React.useEffect(()=>{eme!=null&&eme.experEnv?I_e(eme):I_e("")},[eme]),React.useEffect(()=>{if(tme){const Wme=markdownToJson(tme),d_e=toEditorJSON(Wme);jme(d_e)}},[tme]),React.useImperativeHandle(kh,()=>({editor:Dme,update:()=>{const Wme=setTimeout(()=>{var d_e;(d_e=Dme==null?void 0:Dme.commands)==null||d_e.clearContent(),Qme(!0),Fme(!1),clearTimeout(Wme)},500)},changeXternUrl:Wme=>{Ime(Wme)},addActive:Wme=>{if(Wme!=null&&Wme.id){console.log("🚀",Wme);const d_e=()=>{var M_e,N_e,l_e,t_e;return(t_e=(l_e=(N_e=(M_e=Dme==null?void 0:Dme.chain())==null?void 0:M_e.focus(Wme==null?void 0:Wme.pos))==null?void 0:N_e.setQuestion({id:Wme==null?void 0:Wme.id,language:Wme==null?void 0:Wme.language}))==null?void 0:l_e.hideTip())==null?void 0:t_e.run()},y_e=(M_e,N_e=2)=>{const{state:l_e,view:t_e}=M_e,{tr:n_e,selection:Kme}=l_e,T_e=M_e.schema.nodes.paragraph.create();n_e.insert(Kme.to+N_e,T_e),t_e.dispatch(n_e)},x_e=Dme==null?void 0:Dme.view.state.doc.nodeAt(((Wme==null?void 0:Wme.pos)||0)+1);d_e()&&(x_e||y_e(Dme,1))}},batchAddActive:Wme=>{if(Dme){const{state:d_e,schema:y_e}=Dme,{selection:x_e}=d_e,M_e=[];Wme==null||Wme.forEach(N_e=>{const l_e=y_e.nodes.active.create({id:N_e==null?void 0:N_e.id,language:N_e==null?void 0:N_e.type});M_e.push(l_e.toJSON())}),Dme.commands.insertContentAt(x_e.from,M_e)}},getMdText:()=>Ome,setTitle:Wme=>{const d_e=Dme==null?void 0:Dme.view.state.doc.content.child(0);Dme==null||Dme.view.dispatch(Dme==null?void 0:Dme.view.state.tr.insertText(Wme,1,d_e==null?void 0:d_e.nodeSize))},changeMdTest:Wme=>{console.log(Wme,Bme);const d_e=[];Bme==null||Bme.children.forEach(M_e=>{((M_e==null?void 0:M_e.props)!=="active"||(M_e==null?void 0:M_e.value)!==Wme[0].value)&&d_e.push(M_e)}),Bme.children=d_e;const y_e=jsonToMarkdown(Bme);if(Nme(y_e),(Cme==null?void 0:Cme.readyState)===1){const M_e=y_e?textToBase64(y_e):"";Cme==null||Cme.send(JSON.stringify({type:"write",data:M_e}))}const x_e=setTimeout(()=>{var M_e;(M_e=Dme==null?void 0:Dme.commands)==null||M_e.clearContent(),Qme(!0),clearTimeout(x_e)},500)}}));const C_e=React.useRef(null);return React.useEffect(()=>{var d_e;const Wme=y_e=>{y_e.preventDefault()};return yme&&((d_e=C_e.current)==null||d_e.addEventListener("copy",Wme,!0)),()=>{var y_e;(y_e=C_e.current)==null||y_e.removeEventListener("copy",Wme,!0)}},[yme]),jsxRuntimeExports.jsx(shareData.Provider,{value:{editor:Dme,template:p_e,apiUrl:$P,xternUrl:Rme,available:O_e,codePlayerLanguageList:Eme},children:jsxRuntimeExports.jsxs("div",{className:"ylz-editor",ref:s_e,children:[jsxRuntimeExports.jsxs("div",{ref:C_e,id:"ylz-editor-container","data-finish":!!lme,className:`ylz-editor-container${!B_||Sme===!1||!Vme?" ylz-editor-container-max":""}${$_?"":" ylz-editor-container-read"}`,children:[jsxRuntimeExports.jsx(EditorContent,{editor:Dme}),lme?jsxRuntimeExports.jsx("div",{children:jsxRuntimeExports.jsx("div",{className:"ylz-editor-container-footer",children:jsxRuntimeExports.jsx("button",{className:"ylz-editor-container-footer-btn",onClick:lme,children:"完成"})})}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})]}),B_&&jsxRuntimeExports.jsx(Catalogue,{editor:Dme,isUpdate:Lme,canOpenCatalogue:Sme,onChangeVisible:Wme=>Ame(Wme)})]})})};Editor=React.forwardRef(Editor),Editor=React.memo(Editor);const Editor$1=Editor;return Editor$1});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .tiptap{padding:30px 40px;max-width:1080px;box-sizing:border-box;margin:0 auto}.tiptap:focus{outline:none}.tiptap *{padding:0;margin:0}.tiptap .code-block .ant-btn{padding:0 16px;height:24px;background:#1677ff;border-radius:2px;font-size:12px;line-height:24px}.tiptap>.tiptap-image{margin:20px 0}.tiptap img.ProseMirror-selectednode{outline:2px solid #1677ff}.tiptap .inline-code{padding:2px 8px;background:#fff5ec;color:#f0861d;border-radius:2px}.tiptap .node-codeBlock{margin:20px 0}.tiptap blockquote{margin:20px 0;margin-inline-start:0!important;padding:8px 10px 8px 16px;background:#e6f7ff;color:#888;position:relative}.tiptap blockquote:after{position:absolute;left:0;bottom:0;width:4px;height:100%;background:#e6f7ff;content:""}.tiptap>ul{margin:20px 0!important;padding-left:18px!important}.tiptap ul{padding-left:14px;margin:0}.tiptap ul li p{line-height:28px}.tiptap ul li::marker{color:#1677ff}.tiptap ul ul ul ul{list-style-type:disc}.tiptap ul ul ul ul ul{list-style-type:circle}.tiptap ul ul ul ul ul ul{list-style-type:square}.tiptap ul ul ul ul ul ul ul{list-style-type:disc}.tiptap ul ul ul ul ul ul ul ul{list-style-type:circle}.tiptap ul ul ul ul ul ul ul ul ul{list-style-type:square}.tiptap>ol{margin:20px 0!important;padding-left:18px!important}.tiptap ol{padding-left:14px;margin:0}.tiptap ol li{margin:0}.tiptap ol li p{line-height:28px}.tiptap ol li::marker{color:#1677ff}.tiptap ol ol{list-style-type:lower-alpha}.tiptap ol ol ol{list-style-type:lower-roman}.tiptap ol ol ol ol{list-style-type:decimal}.tiptap ol ol ol ol ol{list-style-type:lower-alpha}.tiptap ol ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol ol ol ol ol ol ol{list-style-type:decimal}.tiptap ol ol ol ol ol ol ol ol{list-style-type:lower-alpha}.tiptap ol ol ol ol ol ol ol ol ol{list-style-type:lower-roman}.tiptap hr{margin:20px 0;border-top:.5px solid #d9d9d9}.ylz-editor{position:relative;height:100%;max-height:100%;min-height:100%;background:#fafcff;display:flex}.ylz-editor-container[data-finish=true]>div:nth-child(1){min-height:calc(100% - 62px)}.ylz-editor-container{margin:0;flex:1;overflow-y:auto}.ylz-editor-container>div{width:calc(100% - 268px)}.ylz-editor-container-footer{display:flex;align-items:center;justify-content:right;padding:0 40px 30px;max-width:1080px;box-sizing:border-box;margin:0 auto}.ylz-editor-container-footer-btn{background:#1677ff;color:#fff;width:64px;height:32px;border-radius:2px;font-size:16px;font-weight:400;cursor:pointer;outline:none;border:none}.ylz-editor-container-footer-btn:hover{background-color:#4592ff}.ylz-editor-container::-webkit-scrollbar{width:6px;height:6px}.ylz-editor-container::-webkit-scrollbar-track{background-color:transparent}.ylz-editor-container::-webkit-scrollbar-thumb{background-color:#cfcfcf;border-radius:10px}.ylz-editor-container::-webkit-scrollbar-thumb:hover{background-color:#b3b3b3}.ylz-editor-container-max>div{width:100%}.ylz-editor-container-read img.ProseMirror-selectednode{outline:none!important}.ylz-editor-tooltip{background:#fff;border:.5px solid #e5e5e5;border-radius:2px;box-shadow:1px 1px 2px #5c75991a;overflow:hidden}.ylz-editor-tooltip .ant-tooltip-inner{min-height:24px!important;padding:4px 8px;font-size:12px;font-weight:400;text-align:LEFT;color:#666;line-height:16px;border-radius:2px;text-align:justify}.tiptap-scroll::-webkit-scrollbar{width:8px;height:0px}.tiptap-scroll::-webkit-scrollbar-track{background-color:transparent}.tiptap-scroll::-webkit-scrollbar-thumb{background-color:#ededed;border-radius:4px}.tiptap-scroll::-webkit-scrollbar-thumb:hover{background-color:#e0e0e0}.tiptap-scroll-row::-webkit-scrollbar{width:0px;height:8px}.tiptap-scroll-row::-webkit-scrollbar-track{background-color:transparent}.tiptap-scroll-row::-webkit-scrollbar-thumb{background-color:#ededed;border-radius:4px}.tiptap-scroll-row::-webkit-scrollbar-thumb:hover{background-color:#e0e0e0}.tiptap h1,.tiptap h2,.tiptap h3,.tiptap h4,.tiptap h5,.tiptap h6{margin:20px 0!important;color:#333;font-weight:600}.tiptap h1{font-size:28px;line-height:38px}.tiptap h2{font-size:24px;line-height:34px}.tiptap h3{font-size:20px;line-height:30px}.tiptap h4{font-size:18px;line-height:28px}.tiptap h5{font-size:16px;line-height:26px}.tiptap h6{font-size:15px;line-height:24px}.tiptap-paragraph{font-size:14px;font-weight:400;color:#666;line-height:26px}.tiptap-title{font-size:28px;font-weight:600;color:block;line-height:38px;padding-bottom:20px;border-bottom:.5px solid #d9d9d9;margin-bottom:20px}.tiptap .tiptap-editor-nofocus-is-empty:before{content:attr(data-placeholder);float:left;pointer-events:none;height:0;font-size:14px;font-weight:400;color:#ccc;line-height:26px}.tiptap .tiptap-title-is-empty:before{content:attr(data-placeholder);float:left;pointer-events:none;height:0;font-size:28px;font-weight:600;color:#ccc;line-height:38px}.tiptap .tiptap-is-empty:before{content:attr(data-placeholder);float:left;pointer-events:none;height:0;font-size:14px;font-weight:400;color:#ccc;line-height:26px}.bubble-menu{display:flex;justify-content:center;align-items:center;position:relative;background:#fff;border:.5px solid #e5e5e5;border-radius:4px;box-shadow:0 2px 8px #615c9926;height:28px;z-index:1;padding:0 4px}.bubble-menu .dropdownLine{height:14px;border-left:.5px solid #d9d9d9}.bubble-menu .bubble-menu-item{display:flex;justify-content:center;align-items:center;width:20px;height:20px;border-radius:2px}.bubble-menu .bubble-menu-item:hover{background:#f0f2f5}.bubble-menu .bubble-menu-other-item{display:flex;justify-content:center;align-items:center;width:30px;height:20px;border-radius:2px;cursor:pointer}.bubble-menu .bubble-menu-other-item .bubble-menu-other-item-icon{transition:transform .5s ease-in-out}.bubble-menu .bubble-menu-other-item:hover{background:#f0f2f5}.floating-menu{width:16px;height:16px;display:flex;justify-content:center;align-items:center;border-radius:4px;border:1px solid #e0e0e0;background:#fff;padding:4px;z-index:1}.floating-menu button{width:14px;height:14px;display:flex;align-items:center;justify-content:center}.tom{margin-top:1rem;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px;box-sizing:border-box}.bubbleMenuDropdown{margin-top:10px}.bubbleMenuDropdown .ant-dropdown-menu{border:.5px solid #e5e5e5;border-radius:4px;box-shadow:0 2px 8px #615c9926}.bubbleMenuDropdown .ant-dropdown-menu-item{width:180px;height:28px;border-radius:2px}.bubbleMenuDropdown .ant-dropdown-menu-item:hover .MenuProps-item-left .MenuProps-item-left-text{color:#333!important}.bubbleMenuDropdown .ant-dropdown-menu-item:hover .MenuProps-item-left .MenuProps-item-left-svg svg{fill:#333}.bubbleMenuDropdown .MenuProps-item{display:flex;align-items:center;justify-content:space-between}.bubbleMenuDropdown .MenuProps-item .MenuProps-item-left{display:flex;align-items:center}.h-link{width:400px;background:#fff;border:.5px solid #e5e5e5;border-radius:4px;box-shadow:0 2px 8px #615c9926;padding:24px;box-sizing:border-box}.h-link .h-link-bottoms{display:flex;justify-content:end;align-items:center;margin-top:10px}.h-link .h-link-bottoms .cancleBtn{display:flex;align-items:center;justify-content:center;width:64px;height:32px;background:#fff;border:1px solid #d9d9d9;border-radius:2px;color:#666;font-size:14px;cursor:pointer}.h-link .h-link-bottoms .conBtn{cursor:pointer;display:flex;align-items:center;justify-content:center;width:64px;height:32px;background:#1677ff;border-radius:2px;font-size:14px;color:#fff;margin-left:10px}.h-link .h-link-line{position:relative;display:flex;align-items:center;font-size:14px;color:#333;margin-bottom:20px}.h-link .h-link-line .h-link-line-tip{position:absolute;bottom:-22px;color:#ff4d4f;font-size:14px;left:45px}.h-link .h-link-line .text{text-wrap:nowrap;margin-right:16px}.h-link .h-link-line .ant-input{border:1px solid #e5e5e5;border-radius:2px;color:#666;font-size:14px}.h-link .h-link-line .ant-input-outlined:focus{border:1px solid #1677ff}.tippy-box[data-animation=scale-extreme][data-placement^=top]{transform-origin:bottom}.tippy-box[data-animation=scale-extreme][data-placement^=bottom]{transform-origin:top}.tippy-box[data-animation=scale-extreme][data-placement^=left]{transform-origin:right}.tippy-box[data-animation=scale-extreme][data-placement^=right]{transform-origin:left}.tippy-box[data-animation=scale-extreme][data-state=hidden]{transform:scale(0);opacity:.25}.catalogue{position:absolute;top:0;right:6px;bottom:0;width:262px}.catalogue-header{padding:40px 30px 20px;display:flex;align-items:center}.catalogue-header>span{font-size:16px;font-weight:500;color:#333;line-height:16px}.catalogue-header svg{margin-left:12px;cursor:pointer}.catalogue-main{max-height:calc(100% - 76px);margin-right:2px;padding-right:10px;border-left:1px solid #d9d9d9;overflow-y:auto}.catalogue-main::-webkit-scrollbar{width:6px}.catalogue-main::-webkit-scrollbar-track{background-color:transparent}.catalogue-main::-webkit-scrollbar-thumb{background-color:#e0e0e0;border-radius:10px}.catalogue-main::-webkit-scrollbar-thumb:hover{background-color:#cfcfcf}.catalogue-main>div{padding-right:8px;height:28px;display:flex;align-items:center;cursor:pointer;position:relative}.catalogue-main>div .catalogue-collapse{margin-right:8px;width:14px;height:14px;display:flex}.catalogue-main>div .catalogue-collapse svg{fill:#999;transform:rotate(0);transition:all .5s}.catalogue-main>div .catalogue-collapse svg:hover{fill:#1677ff}.catalogue-main>div .collapsed svg{transform:rotate(-90deg)}.catalogue-main>div .catalogue-text{flex:1;font-size:13px;color:#666;line-height:initial;white-space:nowrap;word-break:break-all;text-overflow:ellipsis;overflow:hidden}.catalogue-main>div .catalogue-text:hover{color:#1677ff}.catalogue-main .active .catalogue-text{color:#1677ff!important}.catalogue-main .indent-level-1{padding-left:8px}.catalogue-main .indent-level-2{padding-left:16px}.catalogue-main .indent-level-3{padding-left:24px}.catalogue-main .indent-level-4{padding-left:32px}.catalogue-main .indent-level-5{padding-left:40px}.catalogue-main .indent-level-6{padding-left:48px}.catalogue-hover{right:0;width:268px;background:#fafcff;box-shadow:-4px 0 10px #0000000d;z-index:999}.catalogue-folded{position:absolute;top:calc(50% - 24px);right:0;display:flex;align-items:center;justify-content:center}.catalogue-folded div{width:27px;height:47px;background:#fff;border:.5px solid #e5e5e5;border-radius:2px;box-shadow:1px 1px 2px #5c75991a;font-size:14px;font-weight:400;color:#666;line-height:16px;writing-mode:vertical-lr;letter-spacing:2px;display:flex;align-items:center;justify-content:center;cursor:pointer}.floatingmenu-tip{width:16px;height:16px;border:.5px solid #d9d9d9;border-radius:2px;display:flex;align-items:center;justify-content:center;cursor:pointer}.floatingmenu-tip:hover{background:#f0f2f5}.tiptap-menu{width:182px;box-sizing:border-box;background:#fff;border:.5px solid #e5e5e5;border-radius:4px;box-shadow:0 2px 8px #615c9926;padding:10px 4px 4px}.tiptap-menu-item:not(:last-child){margin-bottom:20px}.tiptap-menu-item-title{font-size:12px;font-weight:400;text-align:LEFT;color:#999;line-height:12px;padding-bottom:10px;padding-left:16px;margin:0!important}.tiptap-menu-item-menus{display:flex;flex-wrap:wrap;gap:10px;padding:0 16px}.tiptap-menu-item-menus-light{background:#f0f2f5!important}.tiptap-menu-item-menus-item{width:20px;height:20px;border-radius:2px;cursor:pointer;display:flex;align-items:center;justify-content:center;--color: #666666;position:relative}.tiptap-menu-item-menus-item svg{fill:var(--color)}.tiptap-menu-item-menus-item:hover{background:#f0f2f5}.tiptap-menu-item-menus-item:hover:before{box-sizing:border-box;position:absolute;content:attr(data-tip);width:fit-content;left:50%;transform:translate(-50%);top:100%;white-space:nowrap;background:#fff;border:.5px solid #e5e5e5;border-radius:2px;font-size:12px;font-weight:400;color:#666;line-height:12px;padding:4px;box-shadow:1px 1px 2px #5c75991a;z-index:100}.tiptap-menu-item-list-item{height:28px;border-radius:2px;cursor:pointer;display:flex;align-items:center}.tiptap-menu-item-list-item:hover,.tiptap-menu-item-list-item-light{background:#f0f2f5}.tiptap-menu-item-list-item svg{margin:0 18px}.tiptap-menu-item-list-item span{font-size:13px;font-weight:400;text-align:LEFT;color:#666;line-height:13px}.tiptap-table-select{background-color:#fff;border:.5px solid #e5e5e5;border-radius:4px;box-shadow:0 2px 8px #615c9926;padding:10px 15px;box-sizing:border-box;width:282px;position:relative;left:6px}.tiptap-table-select-title{padding-bottom:10px;display:flex;align-items:center;justify-content:space-between;margin:0!important}.tiptap-table-select-title-left{font-size:12px}.tiptap-table-select-title-right{font-size:12px;color:#8a8a8a;letter-spacing:2px}.tiptap-table-select-content{border:1px solid #e5e5e5;display:flex;flex-wrap:wrap;padding:10px;gap:6px;cursor:pointer}.tiptap-table-select-content div{width:20px;height:20px;background-color:#e9e9e9;box-sizing:border-box;border:1px solid #e1e1e1}.tiptap-table-select-content div.light{background-color:#d0e4ff;border-color:#d0e4ff}.tiptap-active-select{padding:4px;width:105px;background:#fff;border:.5px solid #e5e5e5;border-radius:4px;box-shadow:0 2px 8px #615c9926}.tiptap-active-select div{padding:7.5px 0;font-size:13px;color:#666;line-height:13px;text-align:center}.tiptap-active-select div:hover{cursor:pointer;background:#f0f2f5;border-radius:2px}.tiptap-active-select .unavailable{color:#ccc}.tiptap-active-select .unavailable:hover{background:transparent}.tiptap-changemenu{background:#fff;border:.5px solid #e5e5e5;border-radius:4px;padding:4px;box-shadow:0 2px 8px #615c9926}.tiptap-changemenu-item{width:72px;height:28px;border-radius:2px;display:flex;align-items:center;justify-content:left;font-size:13px;font-weight:400;text-align:LEFT;color:#666;line-height:13px;cursor:pointer}.tiptap-changemenu-item:hover{background:#f0f2f5}.tiptap-changemenu-item svg{margin-left:10px;margin-right:8px}.tiptap-changemenu-item-del svg{fill:#999!important}.tiptap-changemenu-item-del:hover{color:#f5222d!important}.tiptap-changemenu-item-del:hover svg{fill:#f5222d!important}.tiptap .tiptap-image{display:block;object-fit:contain;max-width:100%;max-height:100%;height:auto}.tiptap-paragraph a{position:relative;display:inline-block;color:#1677ff;text-decoration:none;cursor:pointer}.tiptap-paragraph a:hover{color:#1677ff;text-decoration:underline}.hoveValue{background:#fff;border:.5px solid #e5e5e5;border-radius:2px;box-shadow:0 2px 8px #615c9926;height:20px;box-sizing:border-box;padding:0 4px;color:#666;font-size:12px;display:flex;align-items:center}.lintView{height:28px;display:flex;align-items:center;padding:0 10px;background:#fff;border:.5px solid #e5e5e5;border-radius:2px;box-shadow:0 2px 8px #615c9926;cursor:pointer}.lintView .lineValue{max-width:260px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#999;font-size:14px;box-sizing:border-box}.lintView .lineIcon{display:flex;justify-content:center;align-items:center;width:20px!important;height:20px!important;box-sizing:border-box;border-radius:2px}.lintView .lineIcon:hover{background:#f0f2f5}.link-tooltip{background:#f5f6fa!important;border:.5px solid #e5e5e5;border-radius:2px;box-shadow:1px 1px 1px #5c75991a;overflow:hidden}.link-tooltip .ant-tooltip-inner{min-height:16px!important;padding:2px 4px;font-size:12px;font-weight:400;text-align:LEFT;color:#999;line-height:20px;border-radius:2px}.pdfShow{position:relative}.pdfShow .annotationLayer{display:none}.pdfShow .react-pdf__Page__canvas{max-width:100%!important;height:100%!important}.pdfShow .react-pdf__Page__annotations{display:none}.pagechange{display:flex;align-items:center;font-size:12px;color:#666;justify-content:center;width:100%;background:#fff;cursor:pointer}.react-pdf__Page{display:flex;justify-content:center}.nowPage{width:24px;height:24px;background:#fff;border:1px solid #d9d9d9;border-radius:2px;display:flex;justify-content:center;align-items:center;margin:0 6px}.nowPageInput{border:none;background:transparent;width:100%;text-align:center;font-size:12px;color:#666}.rpv-toolbar__pagination{display:none}.tiptap table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed;width:100%}.tiptap table td,.tiptap table th{border:1px solid #d9d9d9;box-sizing:border-box;min-width:1em;padding:3px 5px;position:relative;vertical-align:top}.tiptap table td>*,.tiptap table th>*{margin-bottom:0}.tiptap table th{background:#f0f2f5;font-weight:700;text-align:left}.tiptap table th p{font-weight:600;color:#333!important}.tiptap table .selectedCell:after{background:#c8c8ff66;content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2}.tiptap table .column-resize-handle{background-color:#1677ff;bottom:-2px;position:absolute;right:-2px;pointer-events:none;top:0;width:4px;z-index:3}.tiptap table p{margin:0}.tableWrapper{margin:20px 0;overflow-x:auto}.tableWrapper::-webkit-scrollbar{width:0px;height:0px;cursor:default}.tableWrapper:hover::-webkit-scrollbar{height:8px}.tableWrapper::-webkit-scrollbar-track{background-color:transparent}.tableWrapper::-webkit-scrollbar-thumb{background-color:#ededed;border-radius:4px}.tableWrapper::-webkit-scrollbar-thumb:hover{background-color:#e0e0e0}.resize-cursor{cursor:ew-resize;cursor:col-resize}.editor-active{margin:10px 0;background:#fff;border-radius:4px;box-shadow:0 2px 8px #615c9926;padding:30px;position:relative}.editor-active.ProseMirror-selectednode{outline:2px solid #1677ff}.editor-active .svg-edited{position:absolute;stroke:#999;top:10px;right:36px;cursor:pointer}.editor-active .svg-edited:hover{stroke:#1677ff}.editor-active .svg-del{position:absolute;stroke:#999;top:10px;right:10px;cursor:pointer}.editor-active .svg-del:hover{stroke:#1677ff}.editor-active .title{font-size:18px;font-weight:600;text-align:LEFT;color:#333;line-height:18px;position:relative;width:fit-content}.editor-active .title:before{position:absolute;content:"";bottom:0;left:0;width:100%;height:4px;opacity:.3;background:#1677ff}.editor-active .ant-btn{border-radius:2px}.editor-active .question{width:100%}.editor-active .question-title{display:flex;align-items:center}.editor-active .question-title span{margin-left:10px;height:16px;background:#1677ff0d;border:.5px solid #1677ff;border-radius:2px;display:flex;align-items:center;justify-content:center;width:fit-content;padding:0 5px;font-size:12px;font-weight:300;color:#1677ff}.editor-active .question-content{margin:16px 0}.editor-active .question-tip-success{display:flex;align-items:center;color:#30c213;font-size:12px;margin-top:8px}.editor-active .question-tip-error{display:flex;align-items:center;color:#f5222d;font-size:12px;margin-top:8px}.editor-active .question-auxiliary-title{margin-top:20px;display:flex;align-items:center}.editor-active .question-auxiliary-title span{color:#faad14;font-size:14px;margin:0 4px}.editor-active .question-auxiliary-content{margin-top:8px;background:#fff;border:.5px solid rgba(250,173,20,.2);border-radius:2px;padding:10px 16px}.editor-active .demo-content{margin:16px 0}.editor-active .codetest-topic{font-size:15px;font-weight:400;text-align:LEFT;color:#333;line-height:23px;margin:16px 0}.editor-active .codetest-btns{margin-top:20px}.editor-active .codetest-btns-btn{height:32px;border:1px solid var(--color);border-radius:2px;cursor:pointer;display:flex;align-items:center;padding:0 16px;width:fit-content;font-size:14px;font-weight:400;color:var(--color);line-height:22px;--color: #1677ff;--hover: #e8f1ff}.editor-active .codetest-btns-btn:hover{background:var(--hover)}.ylz-editor-container-read .ProseMirror-selectednode{outline:none}.code-highlight code.hljs{display:block;overflow-x:auto;padding:1em}.code-highlight code.hljs::-webkit-scrollbar{height:8px;width:0}.code-highlight code.hljs::-webkit-scrollbar-track{background:transparent}.code-highlight code.hljs::-webkit-scrollbar-thumb{background:#444;border-radius:10px}.code-highlight code.hljs::-webkit-scrollbar-thumb:hover{background:#666}.code-highlight .hljs{color:#abb2bf!important;background:#282c34!important;border-radius:2px}.code-highlight .hljs-comment,.code-highlight .hljs-quote{color:#5c6370!important;font-style:italic!important}.code-highlight .hljs-doctag,.code-highlight .hljs-formula,.code-highlight .hljs-keyword{color:#c678dd!important}.code-highlight .hljs-deletion,.code-highlight .hljs-name,.code-highlight .hljs-section,.code-highlight .hljs-selector-tag,.code-highlight .hljs-subst{color:#e06c75!important}.code-highlight .hljs-literal{color:#56b6c2!important}.code-highlight .hljs-addition,.code-highlight .hljs-attribute,.code-highlight .hljs-meta .hljs-string,.code-highlight .hljs-regexp,.code-highlight .hljs-string{color:#98c379!important}.code-highlight .hljs-attr,.code-highlight .hljs-number,.code-highlight .hljs-selector-attr,.code-highlight .hljs-selector-class,.code-highlight .hljs-selector-pseudo,.code-highlight .hljs-template-variable,.code-highlight .hljs-type,.code-highlight .hljs-variable{color:#d19a66!important}.code-highlight .hljs-bullet,.code-highlight .hljs-link,.code-highlight .hljs-meta,.code-highlight .hljs-selector-id,.code-highlight .hljs-symbol,.code-highlight .hljs-title{color:#61aeee!important}.code-highlight .hljs-built_in,.code-highlight .hljs-class .hljs-title,.code-highlight .hljs-title.class_{color:#e6c07b!important}.code-highlight .hljs-emphasis{font-style:italic}.code-highlight .hljs-strong{font-weight:700}.code-highlight .hljs-link{text-decoration:underline}.run-code-block{width:100%;background:#f7f8fa;border:1px solid #e5e5e5;border-radius:10px}.run-code-block .center{display:flex;align-items:center;justify-content:center}.run-code-block-header{height:48px;background:#fff;border-bottom:1px solid #e5e5e5;justify-content:space-between!important;padding:0 24px;border-radius:10px 10px 0 0}.run-code-block-header-left{gap:12px}.run-code-block-header-right{gap:10px}.run-code-block-editor{height:252px;padding:10px 0;box-sizing:border-box;display:flex;width:100%}.run-code-block-editor>div{width:0;flex:1}.run-code-block-line{background-color:#e5e5e5;height:1px;width:100%;position:relative;cursor:ns-resize}.run-code-block-line:hover:before{background-color:#1677ff}.run-code-block-line:before{content:"";height:3px;width:100%;position:absolute;top:-1px;left:0;z-index:10}.run-code-block-tabs{width:100%;height:48px;background:#fff;border-bottom:1px solid #e5e5e5;display:flex;justify-content:left;overflow-x:auto}.run-code-block-tabs::-webkit-scrollbar{display:none}.run-code-block-tabs-tab{flex-shrink:0;width:152px;height:48px;cursor:pointer;font-size:14px;color:#333}.run-code-block-tabs-tab-title{margin:0 8px 0 4px}.run-code-block-tabs-tab[data-active=true]{background:#f7f8fa;position:relative}.run-code-block-tabs-tab[data-active=true]:before{content:"";position:absolute;bottom:0;left:0;width:100%;height:2px;background:#1677ff}.run-code-block-tabs-tab svg{color:#ccc}.run-code-block-tabs-tab svg:hover{color:#666}.run-code-block-result{height:252px;padding:10px 24px;background:#fff;box-sizing:border-box}.run-code-block>*:nth-last-child(2){border-radius:0 0 10px 10px}.run-code-block-thumb{width:100%;height:0;position:relative;display:flex;align-items:center;justify-content:center}.run-code-block-thumb>div{width:48px;height:10px;background:#fff;border:1px solid #e5e5e5;border-radius:6px;display:flex;align-items:center;flex-direction:column;gap:3px;justify-content:center;cursor:ns-resize}.run-code-block-thumb>div:hover{background:#f0f2f5}.run-code-block-thumb>div>span{width:8px;height:1px;background:#999}.run-code-select{height:24px;border-radius:4px;display:flex;align-items:center;justify-content:center;padding:0 4px;font-size:14px;font-weight:400;line-height:14px;cursor:pointer;width:fit-content}.run-code-select-select{margin-right:4px;color:#333}.run-code-select-placeholder{margin-right:4px;color:#ccc}.run-code-select:hover{background:#f0f2f5}.run-code-tooltip .ant-tooltip-inner{color:#666}.run-code-btn{width:24px;height:24px;border-radius:4px;display:flex;align-items:center;justify-content:center}.run-code-btn[data-disabled=true]{cursor:not-allowed}.run-code-btn[data-disabled=false]{cursor:pointer}.run-code-btn[data-disabled=false]:hover{background:#f0f2f5}.run-monaco-editor{width:100%;height:100%;outline:none!important}
1
+ .tiptap{padding:30px 40px;max-width:1080px;box-sizing:border-box;margin:0 auto}.tiptap:focus{outline:none}.tiptap *{padding:0;margin:0}.tiptap .code-block .ant-btn{padding:0 16px;height:24px;background:#1677ff;border-radius:2px;font-size:12px;line-height:24px}.tiptap>.tiptap-image{margin:20px 0}.tiptap img.ProseMirror-selectednode{outline:2px solid #1677ff}.tiptap .inline-code{padding:2px 8px;background:#fff5ec;color:#f0861d;border-radius:2px}.tiptap .node-codeBlock{margin:20px 0}.tiptap blockquote{margin:20px 0;margin-inline-start:0!important;padding:8px 10px 8px 16px;background:#e6f7ff;color:#888;position:relative}.tiptap blockquote:after{position:absolute;left:0;bottom:0;width:4px;height:100%;background:#e6f7ff;content:""}.tiptap>ul{margin:20px 0!important;padding-left:18px!important}.tiptap ul{padding-left:14px;margin:0}.tiptap ul li p{line-height:28px}.tiptap ul li::marker{color:#1677ff}.tiptap ul ul ul ul{list-style-type:disc}.tiptap ul ul ul ul ul{list-style-type:circle}.tiptap ul ul ul ul ul ul{list-style-type:square}.tiptap ul ul ul ul ul ul ul{list-style-type:disc}.tiptap ul ul ul ul ul ul ul ul{list-style-type:circle}.tiptap ul ul ul ul ul ul ul ul ul{list-style-type:square}.tiptap>ol{margin:20px 0!important;padding-left:18px!important}.tiptap ol{padding-left:14px;margin:0}.tiptap ol li{margin:0}.tiptap ol li p{line-height:28px}.tiptap ol li::marker{color:#1677ff}.tiptap ol ol{list-style-type:lower-alpha}.tiptap ol ol ol{list-style-type:lower-roman}.tiptap ol ol ol ol{list-style-type:decimal}.tiptap ol ol ol ol ol{list-style-type:lower-alpha}.tiptap ol ol ol ol ol ol{list-style-type:lower-roman}.tiptap ol ol ol ol ol ol ol{list-style-type:decimal}.tiptap ol ol ol ol ol ol ol ol{list-style-type:lower-alpha}.tiptap ol ol ol ol ol ol ol ol ol{list-style-type:lower-roman}.tiptap hr{margin:20px 0;border-top:.5px solid #d9d9d9}.ylz-editor{position:relative;height:100%;max-height:100%;min-height:100%;background:#fafcff;display:flex}.ylz-editor-container[data-finish=true]>div:nth-child(1){min-height:calc(100% - 62px)}.ylz-editor-container{margin:0;flex:1;overflow-y:auto}.ylz-editor-container>div{width:calc(100% - 268px)}.ylz-editor-container-footer{display:flex;align-items:center;justify-content:right;padding:0 40px 30px;max-width:1080px;box-sizing:border-box;margin:0 auto}.ylz-editor-container-footer-btn{background:#1677ff;color:#fff;width:64px;height:32px;border-radius:2px;font-size:16px;font-weight:400;cursor:pointer;outline:none;border:none}.ylz-editor-container-footer-btn:hover{background-color:#4592ff}.ylz-editor-container::-webkit-scrollbar{width:6px;height:6px}.ylz-editor-container::-webkit-scrollbar-track{background-color:transparent}.ylz-editor-container::-webkit-scrollbar-thumb{background-color:#cfcfcf;border-radius:10px}.ylz-editor-container::-webkit-scrollbar-thumb:hover{background-color:#b3b3b3}.ylz-editor-container-max>div{width:100%}.ylz-editor-container-read img.ProseMirror-selectednode{outline:none!important}.ylz-editor-tooltip{background:#fff;border:.5px solid #e5e5e5;border-radius:2px;box-shadow:1px 1px 2px #5c75991a;overflow:hidden}.ylz-editor-tooltip .ant-tooltip-inner{min-height:24px!important;padding:4px 8px;font-size:12px;font-weight:400;text-align:LEFT;color:#666;line-height:16px;border-radius:2px;text-align:justify}.tiptap-scroll::-webkit-scrollbar{width:8px;height:0px}.tiptap-scroll::-webkit-scrollbar-track{background-color:transparent}.tiptap-scroll::-webkit-scrollbar-thumb{background-color:#ededed;border-radius:4px}.tiptap-scroll::-webkit-scrollbar-thumb:hover{background-color:#e0e0e0}.tiptap-scroll-row::-webkit-scrollbar{width:0px;height:8px}.tiptap-scroll-row::-webkit-scrollbar-track{background-color:transparent}.tiptap-scroll-row::-webkit-scrollbar-thumb{background-color:#ededed;border-radius:4px}.tiptap-scroll-row::-webkit-scrollbar-thumb:hover{background-color:#e0e0e0}.tiptap h1,.tiptap h2,.tiptap h3,.tiptap h4,.tiptap h5,.tiptap h6{margin:20px 0!important;color:#333;font-weight:600}.tiptap h1{font-size:28px;line-height:38px}.tiptap h2{font-size:24px;line-height:34px}.tiptap h3{font-size:20px;line-height:30px}.tiptap h4{font-size:18px;line-height:28px}.tiptap h5{font-size:16px;line-height:26px}.tiptap h6{font-size:15px;line-height:24px}.tiptap-paragraph{font-size:14px;font-weight:400;color:#666;line-height:26px}.tiptap-title{font-size:28px;font-weight:600;color:block;line-height:38px;padding-bottom:20px;border-bottom:.5px solid #d9d9d9;margin-bottom:20px}.tiptap .tiptap-editor-nofocus-is-empty:before{content:attr(data-placeholder);float:left;pointer-events:none;height:0;font-size:14px;font-weight:400;color:#ccc;line-height:26px}.tiptap .tiptap-title-is-empty:before{content:attr(data-placeholder);float:left;pointer-events:none;height:0;font-size:28px;font-weight:600;color:#ccc;line-height:38px}.tiptap .tiptap-is-empty:before{content:attr(data-placeholder);float:left;pointer-events:none;height:0;font-size:14px;font-weight:400;color:#ccc;line-height:26px}.bubble-menu{display:flex;justify-content:center;align-items:center;position:relative;background:#fff;border:.5px solid #e5e5e5;border-radius:4px;box-shadow:0 2px 8px #615c9926;height:28px;z-index:1;padding:0 4px}.bubble-menu .dropdownLine{height:14px;border-left:.5px solid #d9d9d9}.bubble-menu .bubble-menu-item{display:flex;justify-content:center;align-items:center;width:20px;height:20px;border-radius:2px}.bubble-menu .bubble-menu-item:hover{background:#f0f2f5}.bubble-menu .bubble-menu-other-item{display:flex;justify-content:center;align-items:center;width:30px;height:20px;border-radius:2px;cursor:pointer}.bubble-menu .bubble-menu-other-item .bubble-menu-other-item-icon{transition:transform .5s ease-in-out}.bubble-menu .bubble-menu-other-item:hover{background:#f0f2f5}.floating-menu{width:16px;height:16px;display:flex;justify-content:center;align-items:center;border-radius:4px;border:1px solid #e0e0e0;background:#fff;padding:4px;z-index:1}.floating-menu button{width:14px;height:14px;display:flex;align-items:center;justify-content:center}.tom{margin-top:1rem;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px;box-sizing:border-box}.bubbleMenuDropdown{margin-top:10px}.bubbleMenuDropdown .ant-dropdown-menu{border:.5px solid #e5e5e5;border-radius:4px;box-shadow:0 2px 8px #615c9926}.bubbleMenuDropdown .ant-dropdown-menu-item{width:180px;height:28px;border-radius:2px}.bubbleMenuDropdown .ant-dropdown-menu-item:hover .MenuProps-item-left .MenuProps-item-left-text{color:#333!important}.bubbleMenuDropdown .ant-dropdown-menu-item:hover .MenuProps-item-left .MenuProps-item-left-svg svg{fill:#333}.bubbleMenuDropdown .MenuProps-item{display:flex;align-items:center;justify-content:space-between}.bubbleMenuDropdown .MenuProps-item .MenuProps-item-left{display:flex;align-items:center}.h-link{width:400px;background:#fff;border:.5px solid #e5e5e5;border-radius:4px;box-shadow:0 2px 8px #615c9926;padding:24px;box-sizing:border-box}.h-link .h-link-bottoms{display:flex;justify-content:end;align-items:center;margin-top:10px}.h-link .h-link-bottoms .cancleBtn{display:flex;align-items:center;justify-content:center;width:64px;height:32px;background:#fff;border:1px solid #d9d9d9;border-radius:2px;color:#666;font-size:14px;cursor:pointer}.h-link .h-link-bottoms .conBtn{cursor:pointer;display:flex;align-items:center;justify-content:center;width:64px;height:32px;background:#1677ff;border-radius:2px;font-size:14px;color:#fff;margin-left:10px}.h-link .h-link-line{position:relative;display:flex;align-items:center;font-size:14px;color:#333;margin-bottom:20px}.h-link .h-link-line .h-link-line-tip{position:absolute;bottom:-22px;color:#ff4d4f;font-size:14px;left:45px}.h-link .h-link-line .text{text-wrap:nowrap;margin-right:16px}.h-link .h-link-line .ant-input{border:1px solid #e5e5e5;border-radius:2px;color:#666;font-size:14px}.h-link .h-link-line .ant-input-outlined:focus{border:1px solid #1677ff}.tippy-box[data-animation=scale-extreme][data-placement^=top]{transform-origin:bottom}.tippy-box[data-animation=scale-extreme][data-placement^=bottom]{transform-origin:top}.tippy-box[data-animation=scale-extreme][data-placement^=left]{transform-origin:right}.tippy-box[data-animation=scale-extreme][data-placement^=right]{transform-origin:left}.tippy-box[data-animation=scale-extreme][data-state=hidden]{transform:scale(0);opacity:.25}.catalogue{position:absolute;top:0;right:6px;bottom:0;width:262px}.catalogue-header{padding:40px 30px 20px;display:flex;align-items:center}.catalogue-header>span{font-size:16px;font-weight:500;color:#333;line-height:16px}.catalogue-header svg{margin-left:12px;cursor:pointer}.catalogue-main{max-height:calc(100% - 76px);margin-right:2px;padding-right:10px;border-left:1px solid #d9d9d9;overflow-y:auto}.catalogue-main::-webkit-scrollbar{width:6px}.catalogue-main::-webkit-scrollbar-track{background-color:transparent}.catalogue-main::-webkit-scrollbar-thumb{background-color:#e0e0e0;border-radius:10px}.catalogue-main::-webkit-scrollbar-thumb:hover{background-color:#cfcfcf}.catalogue-main>div{padding-right:8px;height:28px;display:flex;align-items:center;cursor:pointer;position:relative}.catalogue-main>div .catalogue-collapse{margin-right:8px;width:14px;height:14px;display:flex}.catalogue-main>div .catalogue-collapse svg{fill:#999;transform:rotate(0);transition:all .5s}.catalogue-main>div .catalogue-collapse svg:hover{fill:#1677ff}.catalogue-main>div .collapsed svg{transform:rotate(-90deg)}.catalogue-main>div .catalogue-text{flex:1;font-size:13px;color:#666;line-height:initial;white-space:nowrap;word-break:break-all;text-overflow:ellipsis;overflow:hidden}.catalogue-main>div .catalogue-text:hover{color:#1677ff}.catalogue-main .active .catalogue-text{color:#1677ff!important}.catalogue-main .indent-level-1{padding-left:8px}.catalogue-main .indent-level-2{padding-left:16px}.catalogue-main .indent-level-3{padding-left:24px}.catalogue-main .indent-level-4{padding-left:32px}.catalogue-main .indent-level-5{padding-left:40px}.catalogue-main .indent-level-6{padding-left:48px}.catalogue-hover{right:0;width:268px;background:#fafcff;box-shadow:-4px 0 10px #0000000d;z-index:999}.catalogue-folded{position:absolute;top:calc(50% - 24px);right:0;display:flex;align-items:center;justify-content:center}.catalogue-folded div{width:27px;height:47px;background:#fff;border:.5px solid #e5e5e5;border-radius:2px;box-shadow:1px 1px 2px #5c75991a;font-size:14px;font-weight:400;color:#666;line-height:16px;writing-mode:vertical-lr;letter-spacing:2px;display:flex;align-items:center;justify-content:center;cursor:pointer}.floatingmenu-tip{width:16px;height:16px;border:.5px solid #d9d9d9;border-radius:2px;display:flex;align-items:center;justify-content:center;cursor:pointer}.floatingmenu-tip:hover{background:#f0f2f5}.tiptap-menu{width:182px;box-sizing:border-box;background:#fff;border:.5px solid #e5e5e5;border-radius:4px;box-shadow:0 2px 8px #615c9926;padding:10px 4px 4px}.tiptap-menu-item:not(:last-child){margin-bottom:20px}.tiptap-menu-item-title{font-size:12px;font-weight:400;text-align:LEFT;color:#999;line-height:12px;padding-bottom:10px;padding-left:16px;margin:0!important}.tiptap-menu-item-menus{display:flex;flex-wrap:wrap;gap:10px;padding:0 16px}.tiptap-menu-item-menus-light{background:#f0f2f5!important}.tiptap-menu-item-menus-item{width:20px;height:20px;border-radius:2px;cursor:pointer;display:flex;align-items:center;justify-content:center;--color: #666666;position:relative}.tiptap-menu-item-menus-item svg{fill:var(--color)}.tiptap-menu-item-menus-item:hover{background:#f0f2f5}.tiptap-menu-item-menus-item:hover:before{box-sizing:border-box;position:absolute;content:attr(data-tip);width:fit-content;left:50%;transform:translate(-50%);top:100%;white-space:nowrap;background:#fff;border:.5px solid #e5e5e5;border-radius:2px;font-size:12px;font-weight:400;color:#666;line-height:12px;padding:4px;box-shadow:1px 1px 2px #5c75991a;z-index:100}.tiptap-menu-item-list-item{height:28px;border-radius:2px;cursor:pointer;display:flex;align-items:center}.tiptap-menu-item-list-item:hover,.tiptap-menu-item-list-item-light{background:#f0f2f5}.tiptap-menu-item-list-item svg{margin:0 18px}.tiptap-menu-item-list-item span{font-size:13px;font-weight:400;text-align:LEFT;color:#666;line-height:13px}.tiptap-table-select{background-color:#fff;border:.5px solid #e5e5e5;border-radius:4px;box-shadow:0 2px 8px #615c9926;padding:10px 15px;box-sizing:border-box;width:282px;position:relative;left:6px}.tiptap-table-select-title{padding-bottom:10px;display:flex;align-items:center;justify-content:space-between;margin:0!important}.tiptap-table-select-title-left{font-size:12px}.tiptap-table-select-title-right{font-size:12px;color:#8a8a8a;letter-spacing:2px}.tiptap-table-select-content{border:1px solid #e5e5e5;display:flex;flex-wrap:wrap;padding:10px;gap:6px;cursor:pointer}.tiptap-table-select-content div{width:20px;height:20px;background-color:#e9e9e9;box-sizing:border-box;border:1px solid #e1e1e1}.tiptap-table-select-content div.light{background-color:#d0e4ff;border-color:#d0e4ff}.tiptap-active-select{padding:4px;width:105px;background:#fff;border:.5px solid #e5e5e5;border-radius:4px;box-shadow:0 2px 8px #615c9926}.tiptap-active-select div{padding:7.5px 0;font-size:13px;color:#666;line-height:13px;text-align:center}.tiptap-active-select div:hover{cursor:pointer;background:#f0f2f5;border-radius:2px}.tiptap-active-select .unavailable{color:#ccc}.tiptap-active-select .unavailable:hover{background:transparent}.tiptap-changemenu{background:#fff;border:.5px solid #e5e5e5;border-radius:4px;padding:4px;box-shadow:0 2px 8px #615c9926}.tiptap-changemenu-item{width:72px;height:28px;border-radius:2px;display:flex;align-items:center;justify-content:left;font-size:13px;font-weight:400;text-align:LEFT;color:#666;line-height:13px;cursor:pointer}.tiptap-changemenu-item:hover{background:#f0f2f5}.tiptap-changemenu-item svg{margin-left:10px;margin-right:8px}.tiptap-changemenu-item-del svg{fill:#999!important}.tiptap-changemenu-item-del:hover{color:#f5222d!important}.tiptap-changemenu-item-del:hover svg{fill:#f5222d!important}.tiptap .tiptap-image{display:block;object-fit:contain;max-width:100%;max-height:100%;height:auto}.tiptap-paragraph a{position:relative;display:inline-block;color:#1677ff;text-decoration:none;cursor:pointer}.tiptap-paragraph a:hover{color:#1677ff;text-decoration:underline}.hoveValue{background:#fff;border:.5px solid #e5e5e5;border-radius:2px;box-shadow:0 2px 8px #615c9926;height:20px;box-sizing:border-box;padding:0 4px;color:#666;font-size:12px;display:flex;align-items:center}.lintView{height:28px;display:flex;align-items:center;padding:0 10px;background:#fff;border:.5px solid #e5e5e5;border-radius:2px;box-shadow:0 2px 8px #615c9926;cursor:pointer}.lintView .lineValue{max-width:260px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#999;font-size:14px;box-sizing:border-box}.lintView .lineIcon{display:flex;justify-content:center;align-items:center;width:20px!important;height:20px!important;box-sizing:border-box;border-radius:2px}.lintView .lineIcon:hover{background:#f0f2f5}.link-tooltip{background:#f5f6fa!important;border:.5px solid #e5e5e5;border-radius:2px;box-shadow:1px 1px 1px #5c75991a;overflow:hidden}.link-tooltip .ant-tooltip-inner{min-height:16px!important;padding:2px 4px;font-size:12px;font-weight:400;text-align:LEFT;color:#999;line-height:20px;border-radius:2px}.pdfShow{position:relative}.pdfShow .annotationLayer{display:none}.pdfShow .react-pdf__Page__canvas{max-width:100%!important;height:100%!important}.pdfShow .react-pdf__Page__annotations{display:none}.pagechange{display:flex;align-items:center;font-size:12px;color:#666;justify-content:center;width:100%;background:#fff;cursor:pointer}.react-pdf__Page{display:flex;justify-content:center}.nowPage{width:24px;height:24px;background:#fff;border:1px solid #d9d9d9;border-radius:2px;display:flex;justify-content:center;align-items:center;margin:0 6px}.nowPageInput{border:none;background:transparent;width:100%;text-align:center;font-size:12px;color:#666}.rpv-toolbar__pagination{display:none}.tiptap table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed;width:100%}.tiptap table td,.tiptap table th{border:1px solid #d9d9d9;box-sizing:border-box;min-width:1em;padding:3px 5px;position:relative;vertical-align:top}.tiptap table td>*,.tiptap table th>*{margin-bottom:0}.tiptap table th{background:#f0f2f5;font-weight:700;text-align:left}.tiptap table th p{font-weight:600;color:#333!important}.tiptap table .selectedCell:after{background:#c8c8ff66;content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2}.tiptap table .column-resize-handle{background-color:#1677ff;bottom:-2px;position:absolute;right:-2px;pointer-events:none;top:0;width:4px;z-index:3}.tiptap table p{margin:0}.tableWrapper{margin:20px 0;overflow-x:auto}.tableWrapper::-webkit-scrollbar{width:0px;height:0px;cursor:default}.tableWrapper:hover::-webkit-scrollbar{height:8px}.tableWrapper::-webkit-scrollbar-track{background-color:transparent}.tableWrapper::-webkit-scrollbar-thumb{background-color:#ededed;border-radius:4px}.tableWrapper::-webkit-scrollbar-thumb:hover{background-color:#e0e0e0}.resize-cursor{cursor:ew-resize;cursor:col-resize}.editor-active{margin:10px 0;background:#fff;border-radius:4px;box-shadow:0 2px 8px #615c9926;padding:30px;position:relative}.editor-active.ProseMirror-selectednode{outline:2px solid #1677ff}.editor-active .svg-edited{position:absolute;stroke:#999;top:10px;right:36px;cursor:pointer}.editor-active .svg-edited:hover{stroke:#1677ff}.editor-active .svg-del{position:absolute;stroke:#999;top:10px;right:10px;cursor:pointer}.editor-active .svg-del:hover{stroke:#1677ff}.editor-active .title{font-size:18px;font-weight:600;text-align:LEFT;color:#333;line-height:18px;position:relative;width:fit-content}.editor-active .title:before{position:absolute;content:"";bottom:0;left:0;width:100%;height:4px;opacity:.3;background:#1677ff}.editor-active .ant-btn{border-radius:2px}.editor-active .question{width:100%}.editor-active .question-title{display:flex;align-items:center}.editor-active .question-title span{margin-left:10px;height:16px;background:#1677ff0d;border:.5px solid #1677ff;border-radius:2px;display:flex;align-items:center;justify-content:center;width:fit-content;padding:0 5px;font-size:12px;font-weight:300;color:#1677ff}.editor-active .question-content{margin:16px 0}.editor-active .question-tip-success{display:flex;align-items:center;color:#30c213;font-size:12px;margin-top:8px}.editor-active .question-tip-error{display:flex;align-items:center;color:#f5222d;font-size:12px;margin-top:8px}.editor-active .question-auxiliary-title{margin-top:20px;display:flex;align-items:center}.editor-active .question-auxiliary-title span{color:#faad14;font-size:14px;margin:0 4px}.editor-active .question-auxiliary-content{margin-top:8px;background:#fff;border:.5px solid rgba(250,173,20,.2);border-radius:2px;padding:10px 16px}.editor-active .demo-content{margin:16px 0}.editor-active .codetest-topic{font-size:15px;font-weight:400;text-align:LEFT;color:#333;line-height:23px;margin:16px 0}.editor-active .codetest-btns{margin-top:20px}.editor-active .codetest-btns-btn{height:32px;border:1px solid var(--color);border-radius:2px;cursor:pointer;display:flex;align-items:center;padding:0 16px;width:fit-content;font-size:14px;font-weight:400;color:var(--color);line-height:22px;--color: #1677ff;--hover: #e8f1ff}.editor-active .codetest-btns-btn:hover{background:var(--hover)}.ylz-editor-container-read .ProseMirror-selectednode{outline:none}.code-highlight code.hljs{display:block;overflow-x:auto;padding:1em}.code-highlight code.hljs::-webkit-scrollbar{height:8px;width:0}.code-highlight code.hljs::-webkit-scrollbar-track{background:transparent}.code-highlight code.hljs::-webkit-scrollbar-thumb{background:#444;border-radius:10px}.code-highlight code.hljs::-webkit-scrollbar-thumb:hover{background:#666}.code-highlight .hljs{color:#abb2bf!important;background:#282c34!important;border-radius:2px}.code-highlight .hljs-comment,.code-highlight .hljs-quote{color:#5c6370!important;font-style:italic!important}.code-highlight .hljs-doctag,.code-highlight .hljs-formula,.code-highlight .hljs-keyword{color:#c678dd!important}.code-highlight .hljs-deletion,.code-highlight .hljs-name,.code-highlight .hljs-section,.code-highlight .hljs-selector-tag,.code-highlight .hljs-subst{color:#e06c75!important}.code-highlight .hljs-literal{color:#56b6c2!important}.code-highlight .hljs-addition,.code-highlight .hljs-attribute,.code-highlight .hljs-meta .hljs-string,.code-highlight .hljs-regexp,.code-highlight .hljs-string{color:#98c379!important}.code-highlight .hljs-attr,.code-highlight .hljs-number,.code-highlight .hljs-selector-attr,.code-highlight .hljs-selector-class,.code-highlight .hljs-selector-pseudo,.code-highlight .hljs-template-variable,.code-highlight .hljs-type,.code-highlight .hljs-variable{color:#d19a66!important}.code-highlight .hljs-bullet,.code-highlight .hljs-link,.code-highlight .hljs-meta,.code-highlight .hljs-selector-id,.code-highlight .hljs-symbol,.code-highlight .hljs-title{color:#61aeee!important}.code-highlight .hljs-built_in,.code-highlight .hljs-class .hljs-title,.code-highlight .hljs-title.class_{color:#e6c07b!important}.code-highlight .hljs-emphasis{font-style:italic}.code-highlight .hljs-strong{font-weight:700}.code-highlight .hljs-link{text-decoration:underline}.run-code-block{width:100%;background:#f7f8fa;border:1px solid #e5e5e5;border-radius:10px}.run-code-block .center{display:flex;align-items:center;justify-content:center}.run-code-block-header{height:48px;background:#fff;border-bottom:1px solid #e5e5e5;justify-content:space-between!important;padding:0 24px;border-radius:10px 10px 0 0}.run-code-block-header-left{gap:12px}.run-code-block-header-right{gap:10px}.run-code-block-editor{height:252px;padding:10px 0;box-sizing:border-box;display:flex;width:100%}.run-code-block-editor>div{width:0;flex:1}.run-code-block-line{background-color:#e5e5e5;height:1px;width:100%;position:relative;cursor:ns-resize}.run-code-block-line:hover:before{background-color:#1677ff}.run-code-block-line:before{content:"";height:3px;width:100%;position:absolute;top:-1px;left:0;z-index:10}.run-code-block-tabs{width:100%;height:48px;background:#fff;border-bottom:1px solid #e5e5e5;display:flex;justify-content:left;overflow-x:auto}.run-code-block-tabs::-webkit-scrollbar{display:none}.run-code-block-tabs-tab{flex-shrink:0;width:152px;height:48px;cursor:pointer;font-size:14px;color:#333}.run-code-block-tabs-tab-title{margin:0 8px 0 4px}.run-code-block-tabs-tab[data-active=true]{background:#f7f8fa;position:relative}.run-code-block-tabs-tab[data-active=true]:before{content:"";position:absolute;bottom:0;left:0;width:100%;height:2px;background:#1677ff}.run-code-block-tabs-tab svg{color:#ccc}.run-code-block-tabs-tab svg:hover{color:#666}.run-code-block-result{height:252px;padding:10px 24px;background:#fff;box-sizing:border-box}.run-code-block>*:nth-last-child(2){border-radius:0 0 10px 10px}.run-code-block-thumb{width:100%;height:0;position:relative;display:flex;align-items:center;justify-content:center}.run-code-block-thumb>div{width:48px;height:10px;background:#fff;border:1px solid #e5e5e5;border-radius:6px;display:flex;align-items:center;flex-direction:column;gap:3px;justify-content:center;cursor:ns-resize}.run-code-block-thumb>div:hover{background:#f0f2f5}.run-code-block-thumb>div>span{width:8px;height:1px;background:#999}.run-code-select{height:24px;border-radius:4px;display:flex;align-items:center;justify-content:center;padding:0 4px;font-size:14px;font-weight:400;line-height:14px;cursor:pointer;width:fit-content}.run-code-select-select{margin-right:4px;color:#333}.run-code-select-placeholder{margin-right:4px;color:#ccc}.run-code-select:hover{background:#f0f2f5}.run-code-select-drop .ant-dropdown-menu{max-height:40vh;overflow-y:auto}.run-code-select-drop .ant-dropdown-menu::-webkit-scrollbar{width:6px;height:6px}.run-code-select-drop .ant-dropdown-menu::-webkit-scrollbar-track{background-color:transparent}.run-code-select-drop .ant-dropdown-menu::-webkit-scrollbar-thumb{background-color:#cfcfcf;border-radius:10px}.run-code-select-drop .ant-dropdown-menu::-webkit-scrollbar-thumb:hover{background-color:#b3b3b3}.run-code-tooltip .ant-tooltip-inner{color:#666}.run-code-btn{width:24px;height:24px;border-radius:4px;display:flex;align-items:center;justify-content:center}.run-code-btn[data-disabled=true]{cursor:not-allowed}.run-code-btn[data-disabled=false]{cursor:pointer}.run-code-btn[data-disabled=false]:hover{background:#f0f2f5}.run-monaco-editor{width:100%;height:100%;outline:none!important}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ylzcc/editor",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "type": "module",
5
5
  "description": "editor ui components",
6
6
  "keywords": [
@@ -25,7 +25,6 @@
25
25
  "preview": "vite preview",
26
26
  "publish:patch": "npm run build && npm --no-git-tag-version version patch && git commit -am '小版本升级' && npm publish",
27
27
  "publish:minor": "npm run build && npm --no-git-tag-version version minor && git commit -am '中版本升级' && npm publish",
28
- "publish": "npm run build && npm --no-git-tag-version version minor && git commit -am '中版本升级' && npm publish",
29
28
  "publish:major": "npm run build && npm --no-git-tag-version version major && git commit -am '大版本升级' && npm publish"
30
29
  },
31
30
  "dependencies": {