epic-designer-gold 0.0.12 → 0.0.14

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.
Files changed (82) hide show
  1. package/dist/{attributeView-jwbZhq65.js → attributeView-BN2nA4jI.js} +2 -2
  2. package/dist/attributeView-lpFl3t4a.cjs +1 -0
  3. package/dist/axios-CYGTE3lR.cjs +6 -0
  4. package/dist/axios-ITY6Uw7A.js +2085 -0
  5. package/dist/core/components/builder/src/builder.vue.d.ts +2 -0
  6. package/dist/core/components/node/src/node.vue.d.ts +2 -0
  7. package/dist/core/components/tree/src/tree.vue.d.ts +1 -1
  8. package/dist/{eventView-CEeT_JLL.js → eventView-BKpQ9YIh.js} +2 -2
  9. package/dist/eventView-DgqXxWY1.cjs +1 -0
  10. package/dist/index-1afOcXnV.cjs +1 -0
  11. package/dist/{index-M-hTLR0c.js → index-ASoFJnMl.js} +1 -1
  12. package/dist/index-B03W7FZR.cjs +1 -0
  13. package/dist/index-BHmIF8aI.cjs +10 -0
  14. package/dist/index-BJlPL6eL.cjs +1 -0
  15. package/dist/index-BXNPTGKl.cjs +1 -0
  16. package/dist/{index-D4e8XNyx.js → index-BlJ0TQyn.js} +1 -1
  17. package/dist/index-By5rfqCj.cjs +1 -0
  18. package/dist/{index-E2PvWPhl.js → index-BzsFImwK.js} +2 -2
  19. package/dist/{index-Ba0ZjQgI.js → index-C-XUgjda.js} +1 -1
  20. package/dist/{index-HM72iSCq.js → index-C4sdhgF2.js} +1 -1
  21. package/dist/index-C6ceZM1C.cjs +1 -0
  22. package/dist/{index-Dm_60RQ9.js → index-CCTMCqiz.js} +3 -4
  23. package/dist/index-CGHtM1lr.cjs +1 -0
  24. package/dist/{index-yVm3iKnk.js → index-CL_7RzF7.js} +87 -88
  25. package/dist/index-CNzcV-bQ.cjs +1 -0
  26. package/dist/{index-B7sMvYm_.cjs → index-CdgT4gQu.cjs} +1 -1
  27. package/dist/index-CkRhCvJK.cjs +1 -0
  28. package/dist/index-D8YBJFH6.cjs +1 -0
  29. package/dist/{index-DC4NLl3o.js → index-DPfAejnH.js} +2 -2
  30. package/dist/{index-BcZSHbp2.js → index-DZYSBPVO.js} +2 -2
  31. package/dist/index-DpzLP1Zp.cjs +1 -0
  32. package/dist/{index-Dtax565w.js → index-Mf82MCCF.js} +2 -2
  33. package/dist/index-Ol-YPkY9.js +1550 -0
  34. package/dist/index-YHlIFgpT.cjs +1 -0
  35. package/dist/{index-DHwtlP2J.js → index-Yx99TN9O.js} +2 -2
  36. package/dist/{index-DZRPexQZ.js → index-kWCcT4er.js} +3 -3
  37. package/dist/{index-D3KAAzmX.cjs → index-lH0_mCG-.cjs} +1 -1
  38. package/dist/{index-uaq_HmHi.js → index-ooVzYa5L.js} +1 -1
  39. package/dist/index-qJNRPNIj.js +4 -0
  40. package/dist/index.cjs +1 -1
  41. package/dist/index.js +2 -2
  42. package/dist/outline-CJSEUbgc.cjs +1 -0
  43. package/dist/{outline-utbOTCBV.js → outline-yy4pIEi3.js} +2 -2
  44. package/dist/select-B479QwwL.cjs +1 -0
  45. package/dist/select-CtUVWh2M.js +29 -0
  46. package/dist/{sign-CdhDIjlg.js → sign-BDZCr3wJ.js} +11 -12
  47. package/dist/sign-Gwu2PIRy.cjs +1 -0
  48. package/dist/style.css +1 -1
  49. package/dist/{styleView-B1kY8Fux.js → styleView-CXp05_Ar.js} +2 -2
  50. package/dist/styleView-auUK19Dr.cjs +1 -0
  51. package/dist/tree.vue_vue_type_script_setup_true_lang-RWTXU6lO.cjs +1 -0
  52. package/dist/{tree.vue_vue_type_script_setup_true_lang-Bnl1CGxG.js → tree.vue_vue_type_script_setup_true_lang-uR4G8wa_.js} +1 -1
  53. package/dist/ui/elementPlus/index.cjs +1 -1
  54. package/dist/ui/elementPlus/index.js +2 -2
  55. package/package.json +1 -1
  56. package/dist/attributeView-DEyQL7em.cjs +0 -1
  57. package/dist/axios-CXDYiOMX.js +0 -1704
  58. package/dist/axios-tuVKNgv9.cjs +0 -6
  59. package/dist/eventView-CfMax_U7.cjs +0 -1
  60. package/dist/index-B2N4pP55.cjs +0 -1
  61. package/dist/index-B3dTIoEC.cjs +0 -1
  62. package/dist/index-B6yexTNr.js +0 -1509
  63. package/dist/index-Bs6GdgDl.cjs +0 -1
  64. package/dist/index-CTd2_vna.cjs +0 -1
  65. package/dist/index-Cevjl8jo.cjs +0 -1
  66. package/dist/index-CrrXaIZY.js +0 -4
  67. package/dist/index-CuxnFxdY.cjs +0 -1
  68. package/dist/index-D-2x46HI.cjs +0 -1
  69. package/dist/index-DBQ-tc2k.cjs +0 -1
  70. package/dist/index-DWjMyXtP.cjs +0 -1
  71. package/dist/index-DgRGSX7j.cjs +0 -10
  72. package/dist/index-Xb_SJdEs.cjs +0 -1
  73. package/dist/index-br62scsB.cjs +0 -1
  74. package/dist/index-gFqI49-0.cjs +0 -1
  75. package/dist/outline-UAdT8ap6.cjs +0 -1
  76. package/dist/pluginManager-D8PM7ICc.js +0 -383
  77. package/dist/pluginManager-itCTrGag.cjs +0 -1
  78. package/dist/select-B8HCbraJ.js +0 -29
  79. package/dist/select-D6bRz5G2.cjs +0 -1
  80. package/dist/sign-Dx0d5kWo.cjs +0 -1
  81. package/dist/styleView-CHar-6GB.cjs +0 -1
  82. package/dist/tree.vue_vue_type_script_setup_true_lang-BVopU0uv.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),H=require("./axios-CYGTE3lR.cjs"),C=require("./index-BHmIF8aI.cjs"),J=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),G=require("./vuedraggable.umd-BqhSJIAi.cjs"),ee={class:"epic-widget-action-item whitespace-nowrap"},te={key:0,class:"flex items-center"},ne=e.defineComponent({__name:"previewWidgets",setup(F,{expose:R}){const f=e.inject("pageManager",{}),k=e.inject("pageSchema"),s=e.inject("designer"),g=e.inject("designerProps"),c=e.inject("revoke"),p=e.ref(null),S=e.ref(null),x=e.ref(null),M=e.ref(!1),l=e.ref(!1),a=e.ref(!0),i=e.ref("top"),{canvasScale:r,disabledZoom:b}=C.useStore();let n=null;const L=e.computed(()=>{const t=s.state.checkedNode;return!(!(t!=null&&t.id)||g.value.lockDefaultSchemaEdit&&f.defaultComponentIds.value.includes(t==null?void 0:t.id))}),T=e.computed(()=>{var B,V,$,m,O,D;const t=f.componentInstances.value,u=(B=s.state.checkedNode)==null?void 0:B.id;if(($=(V=s.state.checkedNode)==null?void 0:V.componentProps)!=null&&$.hidden)return null;const _=H.pluginManager.getComponentConfingByType((m=s.state.checkedNode)==null?void 0:m.type)??null;if(!u||!(t!=null&&t[u]))return null;if(_!=null&&_.defaultSchema.input&&((O=s.state.checkedNode)==null?void 0:O.noFormItem)!==!0)return(D=t[u+"formItem"])==null?void 0:D.$el;const o=t[u];return!(o!=null&&o.$el)||(o==null?void 0:o.$el.nodeName)==="#text"||!(o!=null&&o.$el.getBoundingClientRect)?null:o==null?void 0:o.$el}),E=e.computed(()=>{var B,V,$,m;const t=f.componentInstances.value,u=(B=s.state.hoverNode)==null?void 0:B.id,_=H.pluginManager.getComponentConfingByType((V=s.state.hoverNode)==null?void 0:V.type)??null;if(!u||!(t!=null&&t[u]))return null;if(_!=null&&_.defaultSchema.input&&(($=s.state.hoverNode)==null?void 0:$.noFormItem)!==!0)return(m=t[u+"formItem"])==null?void 0:m.$el;const o=t[u];return(o==null?void 0:o.$el.nodeName)==="#text"?null:o==null?void 0:o.$el}),{mutationObserver:P,observerConfig:W}=Z(j),{startTimedQuery:d,stopTimedQuery:y}=C.useTimedQuery(j);e.watch(()=>T.value,t=>{if(t){M.value=!0,P.observe(t,W);const u=t.parentNode;u&&(u.ondragstart=()=>{a.value=!1,d()},u.ondragend=()=>{a.value=!0,y()}),j()}else M.value=!1});const{mutationObserver:v,observerConfig:w}=Z(q);e.watch(()=>E.value,t=>{t&&(v.observe(t,w),q())});let h=0;e.watch(()=>{var t;return(t=s.state.hoverNode)==null?void 0:t.id},t=>{if(t){l.value=!0,clearTimeout(h);return}h=setTimeout(()=>{l.value=!1},300)});let N=0,z=0;function j(){const t=T.value;if(!t||!n)return;const{top:u,left:_}=n==null?void 0:n.getBoundingClientRect(),{top:o,left:B,width:V,height:$}=t.getBoundingClientRect(),m=b.value?1:r.value,O=o-u+((n==null?void 0:n.scrollTop)??0)*m,D=B-_+((n==null?void 0:n.scrollLeft)??0)*m,I=$/m;p.value&&(p.value.style.width=`${V/m}px`,p.value.style.height=`${I}px`,p.value.style.top=`${O/m}px`,p.value.style.left=`${D/m}px`,A(O,D)),x.value&&(O<45&&I<100?(x.value.style.top="",x.value.style.bottom="-30px",x.value.style["border-radius"]="0px 0px 4px 4px",i.value="bottom"):O<45?(x.value.style.top="0px",x.value.style["border-radius"]="0px 0px 4px 0",i.value="center"):(x.value.style.top="-30px",x.value.style["border-radius"]="4px 4px 0px 0px",i.value="top"))}function A(t,u){const _=T.value;if(!n||!_)return;const o=n.getBoundingClientRect(),{width:B}=_.getBoundingClientRect(),V=b.value?1:r.value,$=t/V-o.top;let m=u/V-o.left+B/V;m<o.width&&(m=0);const O=n.scrollTop-o.height/3+60,D=n.scrollTop+o.height/3*2,I=n.scrollLeft-o.width+200,U=n.scrollLeft+o.width-200;Math.abs($-N)<10&&Math.abs(m-z)<10||(N=$,z=m,!($>O&&$<D&&m>I&&m<U)&&(n.scrollTop=$,n.scrollLeft=m))}function q(){var I,U;const t=E.value;if(!t)return;const{top:u,left:_}=(n==null?void 0:n.getBoundingClientRect())??{top:0,left:0},{top:o,left:B,width:V,height:$}=((I=t.getBoundingClientRect)==null?void 0:I.call(t))??((U=t.nextElementSibling)==null?void 0:U.getBoundingClientRect()),m=b.value?1:r.value,O=o-u+((n==null?void 0:n.scrollTop)??0)*m,D=B-_+((n==null?void 0:n.scrollLeft)??0)*m;S.value&&(S.value.style.width=`${V/m}px`,S.value.style.height=`${$/m}px`,S.value.style.top=`${O/m}px`,S.value.style.left=`${D/m}px`)}function Z(t){const u=window.MutationObserver,_={childList:!0,attributes:!0,subtree:!0};return{mutationObserver:new u(t),observerConfig:_}}function K(){var V;const t=C.findSchemaInfoById(k.schemas,((V=s.state.checkedNode)==null?void 0:V.id)??"root");if(!t)return!1;const{list:u,schema:_,index:o}=t,B=C.generateNewSchema(_);u.splice(o+1,0,B),s.setCheckedNode(B),c.push(k.schemas,"复制组件")}function X(){var B;const t=C.findSchemaInfoById(k.schemas,((B=s.state.checkedNode)==null?void 0:B.id)??"root");if(!t)return!1;let{list:u,schema:_,index:o}=t;u.splice(o,1),o===u.length&&o--,s.setCheckedNode(u[o]),c.push(k.schemas,"删除组件")}function Y(t){n=t,n==null||n.addEventListener("scroll",()=>{j()}),C.useResizeObserver(T,j),C.useResizeObserver(E,q)}return R({handleInit:Y}),(t,u)=>{var _,o,B,V,$;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.withDirectives(e.createElementVNode("div",{ref_key:"selectorRef",ref:p,class:e.normalizeClass(["epic-checked-widget absolute pointer-events-none z-20",i.value+" "+(a.value?"transition-all":"")])},[e.createElementVNode("div",{class:"epic-widget-action-box",ref_key:"actionBoxRef",ref:x},[e.createElementVNode("div",ee,e.toDisplayString((o=e.unref(H.pluginManager).getComponentConfingByType(((_=e.unref(s).state.checkedNode)==null?void 0:_.type)??""))==null?void 0:o.defaultSchema.label),1),L.value?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",{title:"复制",class:"epic-widget-action-item pointer-events-auto",onClick:K},[e.createVNode(e.unref(J._sfc_main),{name:"icon--epic--copy-all-outline-rounded"})]),e.createElementVNode("div",{title:"删除",class:"epic-widget-action-item pointer-events-auto",onClick:X},[e.createVNode(e.unref(J._sfc_main),{name:"icon--epic--delete-outline-rounded"})])])):e.createCommentVNode("",!0)],512)],2),[[e.vShow,M.value&&((B=e.unref(s).state.checkedNode)==null?void 0:B.id)!=="root"]]),e.withDirectives(e.createElementVNode("div",{ref_key:"hoverWidgetRef",ref:S,class:"epic-hover-widget absolute transition-all pointer-events-none z-998"},null,512),[[e.vShow,l.value&&((V=e.unref(s).state.checkedNode)==null?void 0:V.id)!==(($=e.unref(s).state.hoverNode)==null?void 0:$.id)]])],64)}}}),oe=e.defineComponent({name:"EditNodeItem",__name:"editNodeItem",props:{schemas:{}},emits:["update:schemas"],setup(F,{emit:R}){const f=e.inject("designer"),k=e.inject("pageSchema"),s=e.inject("revoke"),g=F,c=R,p=e.computed({get(){return g.schemas},set(a){c("update:schemas",a)}});function S(a){f.setCheckedNode(p.value[a]),f.setDisableHover(!0)}function x(){f.setDisableHover(),s.push(k.schemas,"拖拽组件")}function M(){s.push(k.schemas,"插入组件")}function l(a){var i,r,b;return a.id===((i=k.schemas[0])==null?void 0:i.id)||(b=(r=H.pluginManager.getComponentConfingByType(a.type))==null?void 0:r.editConstraints)!=null&&b.immovable?"unmover-item":"draggable-item"}return(a,i)=>(e.openBlock(),e.createBlock(e.unref(G.draggable),e.mergeProps({modelValue:p.value,"onUpdate:modelValue":i[0]||(i[0]=r=>p.value=r),"item-key":"id","component-data":{type:"transition-group"},class:"epic-draggable-range"},{animation:200,group:"edit-draggable",handle:".draggable-item",ghostClass:"moveing"},{onStart:i[1]||(i[1]=r=>S(r.oldIndex)),onEnd:i[2]||(i[2]=r=>x()),onAdd:i[3]||(i[3]=r=>{S(r.newIndex),M()})}),{item:e.withCtx(({element:r,index:b})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["widget-box",l(r)]),key:b},[e.createVNode(Q,{schema:r},null,8,["schema"])],2))]),_:1},16,["modelValue"]))}}),Q=e.defineComponent({name:"ENodeItem",__name:"nodeItem",props:{schema:{},name:{}},setup(F){const R=e.useAttrs(),f=e.inject("designer"),k=e.inject("pageManager",{}),s=e.inject("pageSchema",{}),g=e.ref(null);e.provide("nodeAttrs",R);const c=F,p=e.computed(()=>{var b,n,L,T,E;const l=k.componentInstances.value,a=(b=c.schema)==null?void 0:b.id,i=H.pluginManager.getComponentConfingByType((n=c.schema)==null?void 0:n.type)??null;if(!a||!(l!=null&&l[a]))return null;if(i!=null&&i.defaultSchema.input&&((L=c.schema)==null?void 0:L.noFormItem)!==!0)return(T=l[a+"formItem"])==null?void 0:T.$el;const r=l[a];return((E=r==null?void 0:r.$el)==null?void 0:E.nodeName)==="#text"?null:r==null?void 0:r.$el});e.watch(()=>p.value,l=>{l==null||l.addEventListener("click",S,!1),l==null||l.addEventListener("mouseover",x,!1),l==null||l.addEventListener("mouseout",M,!1)}),e.onUnmounted(()=>{var l,a,i;(l=p.value)==null||l.removeEventListener("click",S,!1),(a=p.value)==null||a.removeEventListener("mouseover",x,!1),(i=p.value)==null||i.removeEventListener("mouseout",M,!1)});function S(l){l.stopPropagation(),f.setCheckedNode(c.schema)}function x(l){var a;c.schema.id!==((a=s.schemas[0])==null?void 0:a.id)&&(l.stopPropagation(),f.setHoverNode(c.schema))}function M(l){l.stopPropagation(),f.setHoverNode(null)}return(l,a)=>{var r,b;const i=e.resolveComponent("ENodeItem");return e.openBlock(),e.createBlock(e.unref(C._sfc_main),{ref_key:"nodeRef",ref:g,componentSchema:c.schema},e.createSlots({_:2},[(b=(r=e.unref(H.pluginManager).getComponentConfingByType(c.schema.type))==null?void 0:r.editConstraints)!=null&&b.childImmovable?{name:"edit-node",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.schema.children,n=>(e.openBlock(),e.createBlock(i,{key:n.id,schema:n},null,8,["schema"]))),128))]),key:"0"}:{name:"edit-node",fn:e.withCtx(()=>[c.schema.children?(e.openBlock(),e.createBlock(oe,{key:0,schemas:c.schema.children,"onUpdate:schemas":a[0]||(a[0]=n=>c.schema.children=n)},null,8,["schemas"])):e.createCommentVNode("",!0)]),key:"1"}]),1032,["componentSchema"])}}}),le={class:"min-w-750px rounded h-full"},ae=e.defineComponent({__name:"previewJson",setup(F,{expose:R}){const f=H.pluginManager.getComponent("modal"),k=H.pluginManager.getComponent("monacoEditor"),s={theme:"vs-light",selectOnLineNumbers:!0,minimap:{enabled:!1},readOnly:!0},g=e.ref(null),c=e.ref(!1),p=e.inject("pageSchema");function S(){c.value=!1}function x(){c.value=!0,g.value?g.value.setValue(JSON.stringify(p,null,2)):setTimeout(()=>{x()},300)}function M(l="epic-data.json"){const a=JSON.stringify(p,null,2);var i=`data:text/json;charset=utf-8,${encodeURIComponent(a)}`,r=document.createElement("a");r.setAttribute("href",i),r.setAttribute("download",l),r.click()}return R({handleOpen:x}),(l,a)=>(e.openBlock(),e.createBlock(e.unref(f),{modelValue:c.value,"onUpdate:modelValue":a[0]||(a[0]=i=>c.value=i),title:"查看数据",class:"w-900px",width:"900px",onClose:S,onOk:M,okText:"导出数据"},{default:e.withCtx(()=>[e.createElementVNode("div",le,[e.createVNode(e.unref(k),{ref_key:"monacoEditorRef",ref:g,class:"editor h-full",autoToggleTheme:"",readOnly:"",config:s,language:"json"},null,512)])]),_:1},8,["modelValue"]))}}),re={class:"epic-edit-toolbar flex items-center justify-between px-2"},se={class:"flex-1 h-full flex items-center"},ie={key:0,class:"epic-divider"},ce=["title","onClick"],de={class:"flex-1 h-full flex items-center justify-end"},ue={key:0,class:"flex items-center ml-12px"},fe={class:"pr-8px w-82px cursor-pointer"},pe={class:"epic-device h-28px items-center gap-1 rounded-md border p-2px flex"},me=["title","onClick"],ve=e.defineComponent({__name:"toolbar",setup(F){const R=H.pluginManager.getComponent("select"),{canvasScale:f,disabledZoom:k}=C.useStore(),s=e.ref("pc"),g=e.inject("pageSchema"),c=e.inject("designer"),p=e.inject("revoke"),S=e.ref(null),x=[{icon:"icon--epic--computer-outline-rounded",title:"pc",key:"pc"},{icon:"icon--epic--tablet-android-outline-rounded",title:"平板",key:"pad"},{icon:"icon--epic--phone-iphone-outline-sharp",title:"手机",key:"mobile"}],M=e.computed(()=>[{icon:"icon--epic--code",title:"查看数据",on:()=>L()},{icon:"icon--epic--exit-to-app-rounded",title:"导入数据",on:T},{icon:"icon--epic--trash",title:"清空",on:n},{icon:"icon--epic--undo",title:"撤销",on:r,disabled:!p.recordList.value.length,divider:!0},{icon:"icon--epic--redo",title:"重做",on:b,disabled:!p.undoList.value.length}]),l=e.ref(null),a=e.computed({get(){return`${(f.value*100).toFixed(0)}%`},set(d){const y=parseFloat(d);f.value=y/100}}),i=[{label:"60%",value:"60%"},{label:"80%",value:"80%"},{label:"100%",value:"100%"},{label:"120%",value:"120%"},{label:"140%",value:"140%"}];function r(){const d=p.undo();d&&(C.deepCompareAndModify(g.schemas,d),c.setCheckedNode(g.schemas[0]))}function b(){const d=p.redo();d&&(C.deepCompareAndModify(g.schemas,d),c.setCheckedNode(g.schemas[0]))}function n(){c.reset()}function L(){S.value.handleOpen()}function T(){var d;(d=l.value)==null||d.click()}function E(d){var w;const y=(w=d.target.files)==null?void 0:w[0];if(!y)return;d.target.value=null;const v=new FileReader;v.readAsText(y),v.onload=h=>{var N;P((N=h.target)==null?void 0:N.result)}}function P(d){try{let y=JSON.parse(d??"");y.schemas||(y=C.convertKFormData(y)),C.deepCompareAndModify(g,y)}catch(y){console.error(y)}}function W(d){c.handleToggleDeviceMode(d),s.value=d;const y={pc:{},pad:{width:"780px",mode:d},mobile:{width:"390px",mode:d}};g.canvas=y[d]}return(d,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",re,[e.createElementVNode("div",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(v,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w},[v.divider?(e.openBlock(),e.createElementBlock("div",ie)):e.createCommentVNode("",!0),e.createElementVNode("div",{title:v.title,class:e.normalizeClass(["epic-action-item text-base h-90% px-10px flex items-center cursor-pointer",{disabled:v.disabled}]),onClick:v.on},[e.createVNode(e.unref(J._sfc_main),{name:v.icon},null,8,["name"])],10,ce)],64))),128))]),e.withDirectives(e.createElementVNode("input",{type:"file",ref_key:"fileRef",ref:l,accept:".json,.txt",onChange:E},null,544),[[e.vShow,!1]]),e.createElementVNode("div",de,[e.unref(k)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ue,[e.createElementVNode("div",fe,[e.createVNode(e.unref(R),{value:a.value,"onUpdate:value":y[0]||(y[0]=v=>a.value=v),modelValue:a.value,"onUpdate:modelValue":y[1]||(y[1]=v=>a.value=v),options:i,size:"small"},null,8,["value","modelValue"])])])),e.createElementVNode("div",pe,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(x,v=>e.createElementVNode("div",{key:v.key,title:v.title,class:e.normalizeClass(["epic-device-item h-full px-1 flex items-center cursor-pointer text-base transition-colors rounded-sm",{checked:v.key===s.value}]),onClick:w=>W(v.key)},[e.createVNode(e.unref(J._sfc_main),{name:v.icon},null,8,["name"])],10,me)),64))])])]),e.createVNode(ae,{ref_key:"previewJson",ref:S},null,512)],64))}}),he={class:"h-full flex flex-col relative"},ge=["draggable"],xe=e.defineComponent({__name:"editScreenContainer",setup(F){const R=e.inject("pageSchema"),f=e.ref(null),k=e.ref(null),s=e.ref(null),{pressSpace:g,disabledZoom:c}=C.useStore(),{handleElementDragStart:p,handleElementDrag:S,handleElementDragEnd:x}=C.useElementDrag(f),{width:M,height:l}=C.useElementSize(f),{canvasScale:a,handleZoom:i}=C.useElementZoom(k);let r=0,b=0;const n=e.ref({}),L=e.ref({}),T=e.ref({}),E=e.shallowRef({width:0,height:0});e.watchEffect(W),e.watch(T,()=>{e.nextTick(P)});function P(){s.value&&(E.value={width:s.value.clientWidth,height:s.value.clientHeight})}function W(){var w,h;T.value={width:((w=R.canvas)==null?void 0:w.width)??"0",height:((h=R.canvas)==null?void 0:h.height)??"0"}}C.watchOnce(M,d),e.watch(E,d);function d(){let w=E.value.width||r,h=E.value.height||b;n.value={width:M.value+w+"px",height:l.value+h+"px"},L.value={width:w+"px",height:h+"px"},y()}function y(){e.nextTick(()=>{var j;let w=E.value.width||r;const N=(E.value.height||b)/2,z=w/2;(j=f.value)==null||j.scrollTo(z,N)})}C.useResizeObserver(f,v),C.useResizeObserver(k,v);function v(){var h;if(!f.value)return;const w=f.value.getBoundingClientRect();if(r=w.width-60,b=w.height-80,!c.value)if(E.value.width===0)a.value=1;else{const N=(r-20)/E.value.width,z=b/(E.value.height||((h=k.value)==null?void 0:h.clientHeight)||1),j=Math.abs(N-1)<Math.abs(z-1);let A=1;j?A=N:A=z,(N<1||z<1)&&(A=Math.min(N,z)),A<1.4&&A>.5&&(a.value=A)}C.debounce(d,50)()}return(w,h)=>(e.openBlock(),e.createElementBlock("div",he,[e.createVNode(ve),e.createElementVNode("div",{ref_key:"editScreenContainerRef",ref:f,class:e.normalizeClass(["flex-1 overflow-auto overflow-y-hidden epic-edit-screen-container",{"cursor-grab":e.unref(g)}]),draggable:e.unref(g),onWheel:h[0]||(h[0]=(...N)=>e.unref(i)&&e.unref(i)(...N)),onDragstart:h[1]||(h[1]=(...N)=>e.unref(p)&&e.unref(p)(...N)),onDragend:h[2]||(h[2]=(...N)=>e.unref(x)&&e.unref(x)(...N)),onDrag:h[3]||(h[3]=(...N)=>e.unref(S)&&e.unref(S)(...N))},[e.createElementVNode("div",{id:"canvasContainer",class:"flex items-center justify-center",style:e.normalizeStyle(n.value)},[e.createElementVNode("div",{ref_key:"draggableElRef",ref:k,class:"transition-all"},[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none":e.unref(g)}),style:e.normalizeStyle(L.value)},[e.renderSlot(w.$slots,"default")],6)],512)],4)],42,ge),e.createElementVNode("div",{ref_key:"sizeBoxRef",ref:s,class:"absolute top-0 pointer-events-none",style:e.normalizeStyle(T.value)},null,4)]))}}),ye={class:"epic-edit-canvas"},_e=e.defineComponent({__name:"index",setup(F){const R=e.ref(null),f=e.ref(null),k=e.inject("pageSchema"),s=e.computed(()=>k.schemas[0]),g=e.computed(()=>({width:"100%",height:"100%"}));return e.onMounted(()=>{var c;(c=f.value)==null||c.handleInit(R.value)}),(c,p)=>(e.openBlock(),e.createElementBlock("section",ye,[e.createVNode(xe,null,{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"epicEditRangeRef",ref:R,class:"epic-edit-range rounded-md overflow-auto relative",style:e.normalizeStyle(g.value)},[e.createVNode(Q,{schema:s.value},null,8,["schema"]),e.createVNode(ne,{ref_key:"ePreviewWidgetsRef",ref:f},null,512)],4)]),_:1})]))}});exports.default=_e;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as u, ref as p, inject as d, watch as f, toRaw as m, openBlock as g, createElementBlock as _, createVNode as h, unref as r } from "vue";
2
- import { p as N } from "./pluginManager-D8PM7ICc.js";
3
- import { o as y, d as k } from "./index-B6yexTNr.js";
2
+ import { p as N } from "./axios-ITY6Uw7A.js";
3
+ import { o as y, d as k } from "./index-Ol-YPkY9.js";
4
4
  const E = { class: "epic-sound-code" }, R = /* @__PURE__ */ u({
5
5
  __name: "index",
6
6
  setup(O) {
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as U, inject as L, openBlock as p, createElementBlock as g, Fragment as A, renderList as T, createElementVNode as i, toDisplayString as O, createVNode as C, unref as _, withCtx as R, createCommentVNode as G, createTextVNode as J, ref as E, computed as S, withDirectives as F, normalizeClass as j, vShow as P, reactive as H, createBlock as K, nextTick as Q, toRaw as z, watch as W } from "vue";
2
- import { l as q, _ as X, k as Y, m as Z } from "./index-B6yexTNr.js";
3
- import { p as w } from "./pluginManager-D8PM7ICc.js";
2
+ import { l as q, _ as X, k as Y, m as Z } from "./index-Ol-YPkY9.js";
3
+ import { p as w } from "./axios-ITY6Uw7A.js";
4
4
  import { _ as D } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
5
5
  import { d as ee } from "./vuedraggable.umd-D2S7Eo7p.js";
6
- import { _ as te } from "./tree.vue_vue_type_script_setup_true_lang-Bnl1CGxG.js";
6
+ import { _ as te } from "./tree.vue_vue_type_script_setup_true_lang-uR4G8wa_.js";
7
7
  const ne = { class: "epic-event-info" }, oe = ["title"], le = { class: "epic-event-btn text-lg flex items-center text-$epic-text-secondary" }, ae = { class: "epic-action-editor-main" }, se = { class: "epic-editor-item rounded" }, ie = { class: "w-36px flex items-center text-lg" }, ce = { class: "flex-1" }, de = { key: 0 }, ue = { key: 1 }, re = { key: 2 }, pe = { class: "epic-action-box text-lg text-$epic-text-medium" }, me = ["onClick"], ve = ["onClick"], fe = /* @__PURE__ */ U({
8
8
  __name: "EActionEditorItem",
9
9
  props: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DgRGSX7j.cjs");exports.default=e._sfc_main;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BHmIF8aI.cjs");exports.default=e._sfc_main;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as b, inject as B, openBlock as t, createElementBlock as s, Fragment as C, renderList as y, unref as n, createCommentVNode as h, createBlock as w, createElementVNode as r, withModifiers as f, toDisplayString as x, ref as g, computed as S, shallowRef as H, createVNode as k, normalizeClass as v, resolveDynamicComponent as R } from "vue";
2
- import { p as $ } from "./pluginManager-D8PM7ICc.js";
2
+ import { p as $ } from "./axios-ITY6Uw7A.js";
3
3
  import { _ as M } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
4
4
  const V = { class: "epic-breadcrumb pl-4 py-2 truncate h-40px flex items-center" }, j = {
5
5
  key: 0,
@@ -0,0 +1,4 @@
1
+ import { _ as f } from "./index-Ol-YPkY9.js";
2
+ export {
3
+ f as default
4
+ };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DgRGSX7j.cjs"),a=require("./pluginManager-itCTrGag.cjs");exports.EBuilder=e._sfc_main$1;exports.EDesigner=e._sfc_main$2;exports.ENode=e._sfc_main;exports.capitalizeFirstLetter=e.capitalizeFirstLetter;exports.convertKFormData=e.convertKFormData;exports.debounce=e.debounce;exports.deepClone=e.deepClone;exports.deepCompareAndModify=e.deepCompareAndModify;exports.deepEqual=e.deepEqual;exports.findSchemaById=e.findSchemaById;exports.findSchemaInfoById=e.findSchemaInfoById;exports.findSchemas=e.findSchemas;exports.generateNewSchema=e.generateNewSchema;exports.getDarkState=e.getDarkState;exports.getFormFields=e.getFormFields;exports.getFormSchemas=e.getFormSchemas;exports.getMatchedById=e.getMatchedById;exports.getUUID=e.getUUID;exports.getValueByPath=e.getValueByPath;exports.initStore=e.initStore;exports.mapSchemas=e.mapSchemas;exports.recursionConvertedNode=e.recursionConvertedNode;exports.setValueByPath=e.setValueByPath;exports.useDark=e.useDark;exports.useElementDrag=e.useElementDrag;exports.useElementZoom=e.useElementZoom;exports.useKeyPress=e.useKeyPress;exports.usePageManager=e.usePageManager;exports.useRevoke=e.useRevoke;exports.useStore=e.useStore;exports.useTheme=e.useTheme;exports.useTimedQuery=e.useTimedQuery;exports.EventBus=a.EventBus;exports.PluginManager=a.PluginManager;exports.loadAsyncComponent=a.loadAsyncComponent;exports.pluginManager=a.pluginManager;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BHmIF8aI.cjs"),a=require("./axios-CYGTE3lR.cjs");exports.EBuilder=e._sfc_main$1;exports.EDesigner=e._sfc_main$2;exports.ENode=e._sfc_main;exports.capitalizeFirstLetter=e.capitalizeFirstLetter;exports.convertKFormData=e.convertKFormData;exports.debounce=e.debounce;exports.deepClone=e.deepClone;exports.deepCompareAndModify=e.deepCompareAndModify;exports.deepEqual=e.deepEqual;exports.findSchemaById=e.findSchemaById;exports.findSchemaInfoById=e.findSchemaInfoById;exports.findSchemas=e.findSchemas;exports.generateNewSchema=e.generateNewSchema;exports.getDarkState=e.getDarkState;exports.getFormFields=e.getFormFields;exports.getFormSchemas=e.getFormSchemas;exports.getMatchedById=e.getMatchedById;exports.getUUID=e.getUUID;exports.getValueByPath=e.getValueByPath;exports.initStore=e.initStore;exports.mapSchemas=e.mapSchemas;exports.recursionConvertedNode=e.recursionConvertedNode;exports.setValueByPath=e.setValueByPath;exports.useDark=e.useDark;exports.useElementDrag=e.useElementDrag;exports.useElementZoom=e.useElementZoom;exports.useKeyPress=e.useKeyPress;exports.usePageManager=e.usePageManager;exports.useRevoke=e.useRevoke;exports.useStore=e.useStore;exports.useTheme=e.useTheme;exports.useTimedQuery=e.useTimedQuery;exports.EventBus=a.EventBus;exports.PluginManager=a.PluginManager;exports.loadAsyncComponent=a.loadAsyncComponent;exports.pluginManager=a.pluginManager;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { r as s, t, _ as r, E as o, c as n, j as d, m, d as u, o as i, l as g, f as l, B as c, g as p, H as h, z as y, A as E, y as S, k as f, p as B, I as D, C as F, D as I, s as P, G as v, e as C, i as M, F as k, v as x, x as A, u as N, q, a as z } from "./index-B6yexTNr.js";
2
- import { E as T, P as U, l as V, p as b } from "./pluginManager-D8PM7ICc.js";
1
+ import { r as s, t, _ as r, E as o, c as n, j as d, m, d as u, o as i, l as g, f as l, B as c, g as p, H as h, z as y, A as E, y as S, k as f, p as B, I as D, C as F, D as I, s as P, G as v, e as C, i as M, F as k, v as x, x as A, u as N, q, a as z } from "./index-Ol-YPkY9.js";
2
+ import { E as T, P as U, l as V, p as b } from "./axios-ITY6Uw7A.js";
3
3
  export {
4
4
  s as EBuilder,
5
5
  t as EDesigner,
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),_=require("./tree.vue_vue_type_script_setup_true_lang-RWTXU6lO.cjs"),f=require("./axios-CYGTE3lR.cjs"),m=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),v={class:"epic-outline"},y=["onMouseenter"],g={class:"max-w-full truncate"},h={class:"epic-node-type-text flex-1 w-0 truncate"},k=e.defineComponent({__name:"outline",setup(N){const n=e.inject("designer"),a=e.inject("pageSchema"),l=e.computed(()=>{var s;const o=(s=n.state.checkedNode)==null?void 0:s.id;return o?[o]:[]});function u(o){n.setCheckedNode(o.componentSchema)}return(o,s)=>{var i;return e.openBlock(),e.createElementBlock("div",v,[e.createVNode(e.unref(_._sfc_main),{options:e.unref(a).schemas,draggable:"","selected-keys":l.value,"hover-key":(i=e.unref(n).state.hoverNode)==null?void 0:i.id,onNodeClick:u},{"tree-node":e.withCtx(({schema:t})=>{var r,c,d;return[e.createElementVNode("div",{class:e.normalizeClass(["epic-text-padding flex",{hidden:(r=t.componentProps)==null?void 0:r.hidden}]),onMouseenter:e.withModifiers(p=>e.unref(n).setHoverNode(t),["stop"]),onMouseleave:s[0]||(s[0]=e.withModifiers(p=>e.unref(n).setHoverNode(null),["stop"]))},[e.createElementVNode("span",g,[(c=t.componentProps)!=null&&c.hidden?(e.openBlock(),e.createBlock(e.unref(m._sfc_main),{key:0,name:"icon--epic--visibility-off-outline-rounded",class:"translate-y-2px"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label??((d=e.unref(f.pluginManager).getComponentConfingByType(t.type))==null?void 0:d.defaultSchema.label)),1)]),e.createElementVNode("span",h,e.toDisplayString(t.id),1)],42,y)]}),_:1},8,["options","selected-keys","hover-key"])])}}});exports.default=k;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as g, inject as l, computed as k, openBlock as p, createElementBlock as v, createVNode as N, unref as e, withCtx as x, createElementVNode as i, normalizeClass as C, withModifiers as m, createBlock as M, createCommentVNode as S, createTextVNode as b, toDisplayString as u } from "vue";
2
- import { _ as w } from "./tree.vue_vue_type_script_setup_true_lang-Bnl1CGxG.js";
3
- import { p as B } from "./pluginManager-D8PM7ICc.js";
2
+ import { _ as w } from "./tree.vue_vue_type_script_setup_true_lang-uR4G8wa_.js";
3
+ import { p as B } from "./axios-ITY6Uw7A.js";
4
4
  import { _ as V } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
5
5
  const $ = { class: "epic-outline" }, E = ["onMouseenter"], H = { class: "max-w-full truncate" }, P = { class: "epic-node-type-text flex-1 w-0 truncate" }, q = /* @__PURE__ */ g({
6
6
  __name: "outline",
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("vue");;/* empty css */const o=require("element-plus"),c=l.defineComponent({emits:["update:modelValue"],setup(d,{emit:a,attrs:t}){function r(e=null){a("update:modelValue",e)}return()=>{const e={...t,key:String(t.multiple),"onUpdate:modelValue":r};return console.log("%c [ ]-20","font-size:13px; background:pink; color:#bf2c9f;",e),l.h(o.ElSelect,e,{default:()=>{var u;return[(u=e==null?void 0:e.options)==null?void 0:u.map(n=>l.h(o.ElOption,{label:n.label,value:n.value}))]}})}}});exports.default=c;
@@ -0,0 +1,29 @@
1
+ import { defineComponent as p, h as n } from "vue";
2
+ /* empty css */
3
+ import { ElSelect as d, ElOption as m } from "element-plus";
4
+ const s = p({
5
+ emits: ["update:modelValue"],
6
+ setup(i, { emit: a, attrs: l }) {
7
+ function u(e = null) {
8
+ a("update:modelValue", e);
9
+ }
10
+ return () => {
11
+ const e = {
12
+ ...l,
13
+ key: String(l.multiple),
14
+ "onUpdate:modelValue": u
15
+ };
16
+ return console.log("%c [ ]-20", "font-size:13px; background:pink; color:#bf2c9f;", e), n(d, e, {
17
+ default: () => {
18
+ var o;
19
+ return [
20
+ (o = e == null ? void 0 : e.options) == null ? void 0 : o.map((t) => n(m, { label: t.label, value: t.value }))
21
+ ];
22
+ }
23
+ });
24
+ };
25
+ }
26
+ });
27
+ export {
28
+ s as default
29
+ };
@@ -1,6 +1,5 @@
1
1
  import { watch as R, nextTick as U, ref as n, onMounted as A, onUnmounted as H, openBlock as N, createElementBlock as O, normalizeStyle as E, createElementVNode as i, createVNode as x, unref as b, withCtx as w, createTextVNode as P } from "vue";
2
- import { p as F } from "./pluginManager-D8PM7ICc.js";
3
- import { a as I } from "./axios-CXDYiOMX.js";
2
+ import { p as F, a as I } from "./axios-ITY6Uw7A.js";
4
3
  import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
4
  const L = { class: "btn" }, G = { class: "btns" }, J = {
6
5
  __name: "sign",
@@ -18,30 +17,30 @@ const L = { class: "btn" }, G = { class: "btns" }, J = {
18
17
  () => a.componentSchema,
19
18
  () => {
20
19
  U(() => {
21
- m();
20
+ v();
22
21
  });
23
22
  },
24
23
  { deep: !0, immediate: !0 }
25
24
  );
26
25
  const C = new ResizeObserver((t) => {
27
26
  for (const e of t)
28
- e.target && e.target.clientWidth && e.target.clientHeight && m();
27
+ e.target && e.target.clientWidth && e.target.clientHeight && v();
29
28
  }), l = n(null), s = n(null), o = n(), D = n("");
30
- function m() {
29
+ function v() {
31
30
  var t, e;
32
31
  s.value && ((t = s.value) != null && t.clientHeight) && ((e = s.value) != null && e.clientWidth) && (l.value.height = s.value.clientHeight, l.value.width = s.value.clientWidth, o.value = l.value.getContext("2d"), o.value.lineWidth = a.componentSchema.componentProps.lineWidth || 4, a.componentSchema && a.componentSchema.componentProps && a.componentSchema.componentProps.style && a.componentSchema.componentProps.style.color && (o.value.strokeStyle = a.componentSchema.componentProps.style.color), D.value = l.value.getBoundingClientRect());
33
32
  }
34
- const r = n(""), c = n(""), W = n(""), B = n(""), u = n([]), v = n(!1);
33
+ const r = n(""), c = n(""), W = n(""), B = n(""), u = n([]), m = n(!1);
35
34
  function M(t) {
36
35
  t = t || event, t.preventDefault();
37
36
  let e = {
38
37
  x: t.offsetX,
39
38
  y: t.offsetY
40
39
  };
41
- r.value = e.x, c.value = e.y, o.value.beginPath(), o.value.moveTo(e.x, e.y), o.value.lineTo(e.x, e.y), o.value.stroke(), o.value.closePath(), u.value.push(e), v.value = !0;
40
+ r.value = e.x, c.value = e.y, o.value.beginPath(), o.value.moveTo(e.x, e.y), o.value.lineTo(e.x, e.y), o.value.stroke(), o.value.closePath(), u.value.push(e), m.value = !0;
42
41
  }
43
42
  function z(t) {
44
- if (t = t || event, t.preventDefault(), v.value) {
43
+ if (t = t || event, t.preventDefault(), m.value) {
45
44
  let e = {
46
45
  x: t.offsetX,
47
46
  y: t.offsetY
@@ -55,7 +54,7 @@ const L = { class: "btn" }, G = { class: "btns" }, J = {
55
54
  x: t.offsetX,
56
55
  y: t.offsetY
57
56
  };
58
- o.value.beginPath(), o.value.moveTo(r.value, c.value), o.value.lineTo(e.x, e.y), o.value.stroke(), o.value.closePath(), u.value.push(e), u.value.push({ x: -1, y: -1 }), v.value = !1;
57
+ o.value.beginPath(), o.value.moveTo(r.value, c.value), o.value.lineTo(e.x, e.y), o.value.stroke(), o.value.closePath(), u.value.push(e), u.value.push({ x: -1, y: -1 }), m.value = !1;
59
58
  }
60
59
  function h() {
61
60
  o.value.clearRect(0, 0, l.value.width, l.value.height), u.value = [];
@@ -79,7 +78,7 @@ const L = { class: "btn" }, G = { class: "btns" }, J = {
79
78
  })).data.data.url;
80
79
  }
81
80
  return A(() => {
82
- m(), C.observe(s.value);
81
+ v(), C.observe(s.value);
83
82
  }), H(() => {
84
83
  }), k({
85
84
  surewrite: f
@@ -132,7 +131,7 @@ const L = { class: "btn" }, G = { class: "btns" }, J = {
132
131
  ])
133
132
  ], 4));
134
133
  }
135
- }, te = /* @__PURE__ */ q(J, [["__scopeId", "data-v-e972b6e0"]]);
134
+ }, ee = /* @__PURE__ */ q(J, [["__scopeId", "data-v-e972b6e0"]]);
136
135
  export {
137
- te as default
136
+ ee as default
138
137
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),g=require("./axios-CYGTE3lR.cjs"),B=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),E={class:"btn"},j={class:"btns"},z={__name:"sign",props:{componentSchema:{type:Object,require:!0,default:()=>({})}},emits:["update:modelValue"],setup(x,{expose:b,emit:w}){const f=g.pluginManager.getComponent("button"),P=w,a=x;t.watch(()=>a.componentSchema,()=>{t.nextTick(()=>{p()})},{deep:!0,immediate:!0});const S=new ResizeObserver(o=>{for(const e of o)e.target&&e.target.clientWidth&&e.target.clientHeight&&p()}),l=t.ref(null),s=t.ref(null),n=t.ref(),_=t.ref("");function p(){var o,e;s.value&&((o=s.value)!=null&&o.clientHeight)&&((e=s.value)!=null&&e.clientWidth)&&(l.value.height=s.value.clientHeight,l.value.width=s.value.clientWidth,n.value=l.value.getContext("2d"),n.value.lineWidth=a.componentSchema.componentProps.lineWidth||4,a.componentSchema&&a.componentSchema.componentProps&&a.componentSchema.componentProps.style&&a.componentSchema.componentProps.style.color&&(n.value.strokeStyle=a.componentSchema.componentProps.style.color),_.value=l.value.getBoundingClientRect())}const r=t.ref(""),i=t.ref(""),T=t.ref(""),k=t.ref(""),u=t.ref([]),v=t.ref(!1);function V(o){o=o||event,o.preventDefault();let e={x:o.offsetX,y:o.offsetY};r.value=e.x,i.value=e.y,n.value.beginPath(),n.value.moveTo(e.x,e.y),n.value.lineTo(e.x,e.y),n.value.stroke(),n.value.closePath(),u.value.push(e),v.value=!0}function C(o){if(o=o||event,o.preventDefault(),v.value){let e={x:o.offsetX,y:o.offsetY};T.value=e.x,k.value=e.y,n.value.beginPath(),n.value.moveTo(r.value,i.value),n.value.lineTo(e.x,e.y),n.value.stroke(),n.value.closePath(),r.value=e.x,i.value=e.y,u.value.push(e)}}function N(o){o=o||event,o.preventDefault();let e={x:o.offsetX,y:o.offsetY};n.value.beginPath(),n.value.moveTo(r.value,i.value),n.value.lineTo(e.x,e.y),n.value.stroke(),n.value.closePath(),u.value.push(e),u.value.push({x:-1,y:-1}),v.value=!1}function d(){n.value.clearRect(0,0,l.value.width,l.value.height),u.value=[]}async function m(){let o=await D(l.value.toDataURL("image/png"));P("update:modelValue",o)}async function D(o){let e=atob(o.split(",")[1]),h=new ArrayBuffer(e.length),M=new Uint8Array(h);for(let c=0;c<e.length;c++)M[c]=e.charCodeAt(c);let W=new Blob([h],{type:"image/png"}),y=new FormData;return y.append("file",W,Date.now()+"png"),(await g.axios({method:"post",url:"https://ess-ds.com/prod-api/center-file/file/upload",data:y,headers:{"Content-Type":"multipart/form-data"}})).data.data.url}return t.onMounted(()=>{p(),S.observe(s.value)}),t.onUnmounted(()=>{}),b({surewrite:m}),(o,e)=>(t.openBlock(),t.createElementBlock("div",{class:"sign",style:t.normalizeStyle({height:a.componentSchema.componentProps.style.height,width:a.componentSchema.componentProps.style.width||"100%"})},[t.createElementVNode("div",{class:"canvas",ref_key:"canvasWrap",ref:s},[t.createElementVNode("canvas",{ref_key:"canvas",ref:l,onMousedown:V,onMousemove:C,onMouseup:N},null,544)],512),t.createElementVNode("div",E,[e[2]||(e[2]=t.createElementVNode("div",{class:"remark"},null,-1)),t.createElementVNode("div",j,[t.createVNode(t.unref(f),{type:"info",size:"mini",onClick:d,onTouch:d},{default:t.withCtx(()=>e[0]||(e[0]=[t.createTextVNode("重写")])),_:1}),t.createVNode(t.unref(f),{type:"primary",size:"mini",onClick:m,onTouch:m},{default:t.withCtx(()=>e[1]||(e[1]=[t.createTextVNode("确定")])),_:1})])])],4))}},X=B._export_sfc(z,[["__scopeId","data-v-e972b6e0"]]);exports.default=X;