epic-designer-gold 0.0.21 → 0.0.23

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 (45) hide show
  1. package/dist/{attributeView-CP3hg3UK.cjs → attributeView-8NOrqlS1.cjs} +1 -1
  2. package/dist/{attributeView-Bs2qSxx7.js → attributeView-BHuhrlM5.js} +8 -8
  3. package/dist/core/components/designer/src/designer.vue.d.ts +0 -1
  4. package/dist/{index-CTNgPpDR.js → index-8kRf0Tni.js} +1 -1
  5. package/dist/index-9bx0Eg0-.cjs +1 -0
  6. package/dist/index-BHkCN6Gc.cjs +1 -0
  7. package/dist/{index-DFBtzyag.js → index-BcAPkz_3.js} +1 -1
  8. package/dist/{index-CzAJ8qnW.js → index-BcRau_iO.js} +74 -74
  9. package/dist/{index-CsimLiTB.cjs → index-BfV0-xlv.cjs} +1 -1
  10. package/dist/index-BfWxzrQ0.js +675 -0
  11. package/dist/{index-Ds85DNV7.cjs → index-BqP4q7kG.cjs} +1 -1
  12. package/dist/index-CI-wApqh.cjs +10 -0
  13. package/dist/{index-wltb2XZn.js → index-CNRYixnW.js} +493 -511
  14. package/dist/{index-CzU0fSLN.cjs → index-CtqoFTv7.cjs} +1 -1
  15. package/dist/{index-IoerwjxE.cjs → index-DAQnePGW.cjs} +1 -1
  16. package/dist/{index-C0kcltz_.js → index-DLXCQOpE.js} +1 -1
  17. package/dist/index-DMO6svHk.js +4 -0
  18. package/dist/{index-BOOu9IOW.cjs → index-DPQrSg6e.cjs} +1 -1
  19. package/dist/index-DzGESDFj.cjs +1 -0
  20. package/dist/{index-npC6NXqj.js → index-R1sGzPDh.js} +1 -1
  21. package/dist/index-zFyk0fsI.js +665 -0
  22. package/dist/index.cjs +1 -1
  23. package/dist/index.js +1 -1
  24. package/dist/style.css +1 -1
  25. package/dist/{styleView-PLyaM974.cjs → styleView-DevMh4gy.cjs} +1 -1
  26. package/dist/{styleView-CQ9CoWd1.js → styleView-Dq9MseMf.js} +1 -1
  27. package/package.json +1 -1
  28. package/dist/core/components/designer/src/modules/attributeView/eventView.vue.d.ts +0 -2
  29. package/dist/core/components/designer/src/modules/outline/outline.vue.d.ts +0 -2
  30. package/dist/core/components/designer/src/modules/sourceCode/index.vue.d.ts +0 -2
  31. package/dist/eventView-DqwO0f-q.cjs +0 -1
  32. package/dist/eventView-rsxe7yze.js +0 -64
  33. package/dist/index-93_j-O1m.cjs +0 -1
  34. package/dist/index-BQ_fSZ8_.cjs +0 -1
  35. package/dist/index-BbHxNc1N.cjs +0 -10
  36. package/dist/index-C6fguDNu.cjs +0 -1
  37. package/dist/index-CIgVQyhq.js +0 -432
  38. package/dist/index-CWzPGA7K.js +0 -41
  39. package/dist/index-DxLHfmGz.js +0 -4
  40. package/dist/index-DxUk7mzH.cjs +0 -1
  41. package/dist/index-Rtzc87-b.js +0 -682
  42. package/dist/outline-CJSEUbgc.cjs +0 -1
  43. package/dist/outline-yy4pIEi3.js +0 -54
  44. package/dist/tree.vue_vue_type_script_setup_true_lang-RWTXU6lO.cjs +0 -1
  45. package/dist/tree.vue_vue_type_script_setup_true_lang-uR4G8wa_.js +0 -242
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),H=require("./axios-CYGTE3lR.cjs"),C=require("./index-BbHxNc1N.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;